/**! * MixItUp v3.3.1 * A high-performance, dependency-free library for animated filtering, sorting and more * Build 94e0fbf6-cd0b-4987-b3c0-14b59b67b8a0 * * @copyright Copyright 2014-2018 KunkaLabs Limited. * @author KunkaLabs Limited. * @link https://www.kunkalabs.com/mixitup/ * * @license Commercial use requires a commercial license. * https://www.kunkalabs.com/mixitup/licenses/ * * Non-commercial use permitted under same terms as CC BY-NC 3.0 license. * http://creativecommons.org/licenses/by-nc/3.0/ */ (function(n){"use strict";var t=null,i=null;(function(){for(var i=["webkit","moz","o","ms"],r=n.document.createElement("div"),t=-1,t=0;t-1}}(n.Element.prototype);Object.keys||(Object.keys=function(){var t=Object.prototype.hasOwnProperty,i=!1,n=[],r=-1;return i=!{toString:null}.propertyIsEnumerable("toString"),n=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],r=n.length,function(u){var e=[],o="",f=-1;if(typeof u!="object"&&(typeof u!="function"||u===null))throw new TypeError("Object.keys called on non-object");for(o in u)t.call(u,o)&&e.push(o);if(i)for(f=0;f>>0,r===0)||(t=0,arguments.length>1&&(t=Number(arguments[1]),t!==t?t=0:t!==0&&t!==Infinity&&t!==-Infinity&&(t=(t>0||-1)*Math.floor(Math.abs(t)))),t>=r))return-1;for(i=t>=0?t:Math.max(r-Math.abs(t),0);i0&&!h)break;s.id?e=s.id:(e="MixItUp"+i.randomHex(),s.id=e);t.instances[e]instanceof t.Mixer?(o=t.instances[e],(!u||u&&u.debug&&u.debug.showWarnings!==!1)&&console.warn(t.messages.warningFactoryPreexistingInstance())):(o=new t.Mixer,o.attach(s,l,e,u),t.instances[e]=o);y=new t.Facade(o);u&&u.debug&&u.debug.enable?a.push(o):a.push(y)}return h?new t.Collection(a):a[0]};t.use=function(n){t.Base.prototype.callActions.call(t,"beforeUse",arguments);typeof n=="function"&&n.TYPE==="mixitup-extension"?typeof t.extensions[n.NAME]=="undefined"&&(n(t),t.extensions[n.NAME]=n):n.fn&&n.fn.jquery&&(t.libraries.$=n);t.Base.prototype.callActions.call(t,"afterUse",arguments)};t.instances={};t.extensions={};t.libraries={};i={hasClass:function(n,t){return!!n.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))},addClass:function(n,t){this.hasClass(n,t)||(n.className+=n.className?" "+t:t)},removeClass:function(n,t){if(this.hasClass(n,t)){var i=new RegExp("(\\s|^)"+t+"(\\s|$)");n.className=n.className.replace(i," ").trim()}},extend:function(n,t,i,r){var e=[],u="",f=-1;i=i||!1;r=r||!1;try{if(Array.isArray(t))for(f=0;fe&&(e=r,c=f)}e>1&&(h=t.messages.errorConfigInvalidPropertySuggestion({probableMatch:c}));s=t.messages.errorConfigInvalidProperty({erroneous:u,suggestion:h});throw new TypeError(s);}throw n;},template:function(n){for(var r=/\${([\w]*)}/g,t={},i=null;i=r.exec(n);)t[i[1]]=new RegExp("\\${"+i[1]+"}","g");return function(i){var r="",u=n;i=i||{};for(r in t)u=u.replace(t[r],typeof i[r]!="undefined"?i[r]:"");return u}},on:function(t,i,r,u){t&&(t.addEventListener?t.addEventListener(i,r,u):t.attachEvent&&(t["e"+i+r]=r,t[i+r]=function(){t["e"+i+r](n.event)},t.attachEvent("on"+i,t[i+r])))},off:function(n,t,i){n&&(n.removeEventListener?n.removeEventListener(t,i,!1):n.detachEvent&&(n.detachEvent("on"+t,n[t+i]),n[t+i]=null))},getCustomEvent:function(t,i,r){var u=null;return r=r||n.document,typeof n.CustomEvent=="function"?u=new n.CustomEvent(t,{detail:i,bubbles:!0,cancelable:!0}):typeof r.createEvent=="function"?(u=r.createEvent("CustomEvent"),u.initCustomEvent(t,!0,!0,i)):(u=r.createEventObject(),u.type=t,u.returnValue=!1,u.cancelBubble=!1,u.detail=i),u},getOriginalEvent:function(n){return n.touches&&n.touches.length?n.touches[0]:n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n},index:function(n,t){for(var i=0;(n=n.previousElementSibling)!==null;)(!t||n.matches(t))&&++i;return i},camelCase:function(n){return n.toLowerCase().replace(/([_-][a-z])/g,function(n){return n.toUpperCase().replace(/[_-]/,"")})},pascalCase:function(n){return(n=this.camelCase(n)).charAt(0).toUpperCase()+n.slice(1)},dashCase:function(n){return n.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()},isElement:function(t,i){return i=i||n.document,n.HTMLElement&&t instanceof n.HTMLElement?!0:i.defaultView&&i.defaultView.HTMLElement&&t instanceof i.defaultView.HTMLElement?!0:t!==null&&t.nodeType===1&&typeof t.nodeName=="string"},createElement:function(t,i){var u=null,r=null;for(i=i||n.document,u=i.createDocumentFragment(),r=i.createElement("div"),r.innerHTML=t.trim();r.firstChild;)u.appendChild(r.firstChild);return u},removeWhitespace:function(n){for(var t;n&&n.nodeName==="#text";)t=n,n=n.previousSibling,t.parentElement&&t.parentElement.removeChild(t)},isEqualArray:function(n,t){var i=n.length;if(i!==t.length)return!1;while(i--)if(n[i]!==t[i])return!1;return!0},deepEquals:function(n,t){var i;if(typeof n=="object"&&n&&typeof t=="object"&&t){if(Object.keys(n).length!==Object.keys(t).length)return!1;for(i in n)if(!t.hasOwnProperty(i)||!this.deepEquals(n[i],t[i]))return!1}else if(n!==t)return!1;return!0},arrayShuffle:function(n){for(var t=n.slice(),u=t.length,i=u,r=-1,f=[];i--;)r=~~(Math.random()*u),f=t[i],t[i]=t[r],t[r]=f;return t},arrayFromList:function(n){var i,t;try{return Array.prototype.slice.call(n)}catch(r){for(i=[],t=0;t "+i),u&&t.removeAttribute("id")),f},clean:function(n){for(var i=[],t=-1,t=0;tr)return!0}return!0},Deferred:function(){this.promise=null;this.resolve=null;this.reject=null;this.id=i.randomHex()},isEmptyObject:function(n){var t="";if(typeof Object.keys=="function")return Object.keys(n).length===0;for(t in n)if(n.hasOwnProperty(t))return!1;return!0},getClassname:function(n,t,i){var r="";return(r+=n.block,r.length&&(r+=n.delineatorElement),r+=n["element"+this.pascalCase(t)],!i)?r:(r.length&&(r+=n.delineatorModifier),r+i)},getProperty:function(n,t){var r=t.split("."),u=null,f="",i=0;if(!t)return n;for(u=function(n){return n?n[f]:null};i-1,t.callFilters("afterIsBound",i,arguments)},addBinding:function(n){var t=this;this.callActions("beforeAddBinding",arguments);t.isBound()||t.bound.push(n);this.callActions("afterAddBinding",arguments)},removeBinding:function(n){var i=this,r=-1;this.callActions("beforeRemoveBinding",arguments);(r=i.bound.indexOf(n))>-1&&i.bound.splice(r,1);i.bound.length0)||(r.status==="live"?r.updateLive(n,i):(u.sort=r.sort,u.filter=r.filter,r.callFilters("actionsUpdate",u,arguments),r.parseStatusChange(r.el,n,u,i)),r.callActions("afterUpdate",arguments))},updateLive:function(n,i){var u=this,o=null,r=null,f=null,e=-1;if(u.callActions("beforeUpdateLive",arguments),u.el){for(o=u.el.querySelectorAll(u.selector),e=0;f=o[e];e++){r=new t.CommandMultimix;switch(u.type){case"filter":r.filter=f.getAttribute("data-filter");break;case"sort":r.sort=f.getAttribute("data-sort");break;case"multimix":r.filter=f.getAttribute("data-filter");r.sort=f.getAttribute("data-sort");break;case"toggle":r.filter=f.getAttribute("data-toggle")}r=u.callFilters("actionsUpdateLive",r,arguments);u.parseStatusChange(f,n,r,i)}u.callActions("afterUpdateLive",arguments)}},parseStatusChange:function(n,t,i,r){var u=this,e="",o="",f=-1;u.callActions("beforeParseStatusChange",arguments);switch(u.type){case"filter":t.filter===i.filter?u.renderStatus(n,"active"):u.renderStatus(n,"inactive");break;case"multimix":t.sort===i.sort&&t.filter===i.filter?u.renderStatus(n,"active"):u.renderStatus(n,"inactive");break;case"sort":t.sort.match(/:asc/g)&&(e=t.sort.replace(/:asc/g,""));t.sort===i.sort||e===i.sort?u.renderStatus(n,"active"):u.renderStatus(n,"inactive");break;case"toggle":for(r.length-1)throw new Error(t.messages.errorInsertPreexistingElement());(f.style.display="none",o.appendChild(f),o.appendChild(u.dom.document.createTextNode(" ")),i.isElement(f,u.dom.document)&&f.matches(u.config.selectors.target))&&(s=new t.Target,s.init(f,u),s.isInDom=!0,u.targets.splice(h,0,s),h++)}u.dom.parent.insertBefore(o,e)}r.startOrder=u.origOrder=u.targets;u.callActions("afterInsertTargets",arguments)},getNextSibling:function(n,t,i){var r=this,u=null;return n=Math.max(n,0),t&&i==="before"?u=t:t&&i==="after"?u=t.nextElementSibling||null:r.targets.length>0&&typeof n!="undefined"?u=n0?r.config.layout.siblingAfter?u=r.config.layout.siblingAfter:r.config.layout.siblingBefore?u=r.config.layout.siblingBefore.nextElementSibling:r.dom.parent.children[0]:u===null,r.callFilters("elementGetNextSibling",u,arguments)},filterOperation:function(n){var r=this,u=!1,f=-1,e="",t=null,i=-1;for(r.callActions("beforeFilterOperation",arguments),e=n.newFilter.action,i=0;t=n.newOrder[i];i++)u=n.newFilter.collection?n.newFilter.collection.indexOf(t.dom.el)>-1:n.newFilter.selector===""?!1:t.dom.el.matches(n.newFilter.selector),r.evaluateHideShow(u,t,e,n);if(n.toRemove.length)for(i=0;t=n.show[i];i++)n.toRemove.indexOf(t)>-1&&(n.show.splice(i,1),(f=n.toShow.indexOf(t))>-1&&n.toShow.splice(f,1),n.toHide.push(t),n.hide.push(t),i--);n.matching=n.show.slice();n.show.length===0&&n.newFilter.selector!==""&&r.targets.length!==0&&(n.hasFailed=!0);r.callActions("afterFilterOperation",arguments)},evaluateHideShow:function(n,t,i,r){var u=this,f=!1,e=Array.prototype.slice.call(arguments,1);f=u.callFilters("testResultEvaluateHideShow",n,e);u.callActions("beforeEvaluateHideShow",arguments);f===!0&&i==="show"||f===!1&&i==="hide"?(r.show.push(t),t.isShown||r.toShow.push(t)):(r.hide.push(t),t.isShown&&r.toHide.push(t));u.callActions("afterEvaluateHideShow",arguments)},sortOperation:function(n){var r=this,f=[],u=null,e=null,o=-1;if(r.callActions("beforeSortOperation",arguments),n.startOrder=r.targets,n.newSort.collection){for(f=[],o=0;e=n.newSort.collection[o];o++){if(r.dom.targets.indexOf(e)u?e==="asc"?1:-1:r===u&&i.next?f.compare(n,t,i.next):0},getAttributeValue:function(n,i){var u=this,r="";return r=n.dom.el.getAttribute("data-"+i),r===null&&u.config.debug.showWarnings&&console.warn(t.messages.warningInconsistentSortingAttributes({attribute:"data-"+i})),u.callFilters("valueGetAttributeValue",r||0,arguments)},printSort:function(t,r){var f=this,h=t?r.newOrder:r.startOrder,a=t?r.startOrder:r.newOrder,s=h.length?h[h.length-1].dom.el.nextElementSibling:null,u=n.document.createDocumentFragment(),c=null,l=null,e=null,o=-1;for(f.callActions("beforePrintSort",arguments),o=0;l=h[o];o++)(e=l.dom.el,e.style.position!=="absolute")&&(i.removeWhitespace(e.previousSibling),e.parentElement.removeChild(e));for(c=s?s.previousSibling:f.dom.parent.lastChild,c&&c.nodeName==="#text"&&i.removeWhitespace(c),o=0;l=a[o];o++)e=l.dom.el,i.isElement(u.lastChild)&&u.appendChild(n.document.createTextNode(" ")),u.appendChild(e);f.dom.parent.firstChild&&f.dom.parent.firstChild!==s&&u.insertBefore(n.document.createTextNode(" "),u.childNodes[0]);s?(u.appendChild(n.document.createTextNode(" ")),f.dom.parent.insertBefore(u,s)):f.dom.parent.appendChild(u);f.callActions("afterPrintSort",arguments)},parseSortString:function(n,r){for(var s=this,e=n.split(" "),u=r,o=[],f=-1,f=0;f-1&&(l=i.substring(s),a=/\(([^)]+)\)/.exec(l),e=a[1]);switch(n){case"fade":r.opacity=e?parseFloat(e):0;break;case"stagger":o.staggerDuration=e?parseFloat(e):100;break;default:if(r[n].value=f&&o.config.animation.reverseOut&&n!=="scale"?(e?parseFloat(e):t.transformDefaults[n].value)*-1:e?parseFloat(e):t.transformDefaults[n].value,e){for(c=0;h=v[c];c++)if(e.indexOf(h)>-1){r[n].unit=h;break}}else r[n].unit=t.transformDefaults[n].unit;u.push(n+"("+r[n].value+r[n].unit+")")}o.callActions("afterParseEffect",arguments)},buildState:function(n){var f=this,i=new t.State,u=null,r=-1;for(f.callActions("beforeBuildState",arguments),r=0;u=f.targets[r];r++)(!n.toRemove.length||n.toRemove.indexOf(u)-1&&((o=u.dom.el.previousSibling)&&o.nodeName==="#text"&&(s=u.dom.el.nextSibling)&&s.nodeName==="#text"&&i.removeWhitespace(o),n.willSort||r.dom.parent.removeChild(u.dom.el),r.targets.splice(f,1),u.isInDom=!1,f--);r.origOrder=r.targets}n.willSort&&(r.targets=n.newOrder);r.state=n.newState;r.lastOperation=n;r.dom.targets=r.state.targets;t.events.fire("mixEnd",r.dom.container,{state:r.state,instance:r},r.dom.document);typeof r.config.callbacks.onMixEnd=="function"&&r.config.callbacks.onMixEnd.call(r.dom.container,r.state,r);n.hasFailed&&(t.events.fire("mixFail",r.dom.container,{state:r.state,instance:r},r.dom.document),typeof r.config.callbacks.onMixFail=="function"&&r.config.callbacks.onMixFail.call(r.dom.container,r.state,r),i.addClass(r.dom.container,i.getClassname(r.config.classNames,"container",r.config.classNames.modifierFailed)));typeof r.userCallback=="function"&&r.userCallback.call(r.dom.container,r.state,r);typeof r.userDeferred.resolve=="function"&&r.userDeferred.resolve(r.state);r.userCallback=null;r.userDeferred=null;r.lastClicked=null;r.isToggling=!1;r.isBusy=!1;r.queue.length&&(r.callActions("beforeReadQueueCleanUp",arguments),e=r.queue.shift(),r.userDeferred=e.deferred,r.isToggling=e.isToggling,r.lastClicked=e.triggerElement,e.instruction.command instanceof t.CommandMultimix?r.multimix.apply(r,e.args):r.dataset.apply(r,e.args));r.callActions("afterCleanUp",arguments)},parseMultimixArgs:function(n){var f=this,r=new t.UserInstruction,u=null,e=-1;for(r.animate=f.config.animation.enable,r.command=new t.CommandMultimix,e=0;e-1?u.command.position=r:typeof r=="string"?u.command.collection=i.arrayFromList(i.createElement(r).childNodes):typeof r=="object"&&i.isElement(r,f.dom.document)?u.command.collection.length?u.command.sibling=r:u.command.collection=[r]:typeof r=="object"&&r.length?u.command.collection.length?u.command.sibling=r[0]:u.command.collection=r:typeof r=="object"&&r.childNodes&&r.childNodes.length?u.command.collection.length?u.command.sibling=r.childNodes[0]:u.command.collection=i.arrayFromList(r.childNodes):typeof r=="object"?i.extend(u.command,r):typeof r=="boolean"?u.animate=r:typeof r=="function"&&(u.callback=r));if(u.command.index&&u.command.sibling)throw new Error(t.messages.errorInsertInvalidArguments());return!u.command.collection.length&&f.config.debug.showWarnings&&console.warn(t.messages.warningInsertNoElements()),u=f.callFilters("instructionParseInsertArgs",u,arguments),i.freeze(u),u},parseRemoveArgs:function(n){var f=this,r=new t.UserInstruction,o=null,u=null,e=-1;for(r.animate=f.config.animation.enable,r.command=new t.CommandRemove,e=0;e-1&&r.command.targets.push(o);return!r.command.targets.length&&f.config.debug.showWarnings&&console.warn(t.messages.warningRemoveNoElements()),i.freeze(r),r},parseDatasetArgs:function(n){var e=this,u=new t.UserInstruction,r=null,f=-1;for(u.animate=e.config.animation.enable,u.command=new t.CommandDataset,f=0;f-1&&n.toggleArray.splice(i,1),r=n.getToggleSelector(),n.multimix({filter:r},t.animate,t.callback)},sort:function(){var t=this,n=t.parseSortArgs(arguments);return t.multimix({sort:n.command},n.animate,n.callback)},changeLayout:function(){var t=this,n=t.parseChangeLayoutArgs(arguments);return t.multimix({changeLayout:n.command},n.animate,n.callback)},dataset:function(){var n=this,i=n.parseDatasetArgs(arguments),u=null,r=null,f=!1;return n.callActions("beforeDataset",arguments),n.isBusy?(r=new t.QueueItem,r.args=arguments,r.instruction=i,n.queueMix(r)):(i.callback&&(n.userCallback=i.callback),f=i.animate^n.config.animation.enable?i.animate:n.config.animation.enable,u=n.getDataOperation(i.command.dataset),n.goMix(f,u))},multimix:function(){var n=this,u=null,f=!1,r=null,i=n.parseMultimixArgs(arguments);return n.callActions("beforeMultimix",arguments),n.isBusy?(r=new t.QueueItem,r.args=arguments,r.instruction=i,r.triggerElement=n.lastClicked,r.isToggling=n.isToggling,n.queueMix(r)):(u=n.getOperation(i.command),n.config.controls.enable&&(i.command.filter&&!n.isToggling&&(n.toggleArray.length=0,n.buildToggleArray(u.command)),n.queue.length-1&&(u=n.toHidePosData[f],i.isShown||i.show(),i.applyTween(u,t))},insert:function(){var t=this,n=t.parseInsertArgs(arguments);return t.multimix({insert:n.command},n.animate,n.callback)},insertBefore:function(){var t=this,n=t.parseInsertArgs(arguments);return t.insert(n.command.collection,"before",n.command.sibling,n.animate,n.callback)},insertAfter:function(){var t=this,n=t.parseInsertArgs(arguments);return t.insert(n.command.collection,"after",n.command.sibling,n.animate,n.callback)},prepend:function(){var t=this,n=t.parseInsertArgs(arguments);return t.insert(0,n.command.collection,n.animate,n.callback)},append:function(){var n=this,t=n.parseInsertArgs(arguments);return n.insert(n.state.totalTargets,t.command.collection,t.animate,t.callback)},remove:function(){var t=this,n=t.parseRemoveArgs(arguments);return t.multimix({remove:n.command},n.animate,n.callback)},getConfig:function(n){var t=this,r=null;return r=n?i.getProperty(t.config,n):t.config,t.callFilters("valueGetConfig",r,arguments)},configure:function(n){var t=this;t.callActions("beforeConfigure",arguments);i.extend(t.config,n,!0,!0);t.callActions("afterConfigure",arguments)},getState:function(){var r=this,n=null;return n=new t.State,i.extend(n,r.state),i.freeze(n),r.callFilters("stateGetState",n,arguments)},forceRefresh:function(){var n=this;n.indexTargets()},forceRender:function(){var t=this,n=null,i=null;for(var r in t.cache)n=t.cache[r],i=n.render(n.data),i!==n.dom.el&&(n.isInDom&&(n.unbindEvents(),t.dom.parent.replaceChild(i,n.dom.el)),n.isShown||(i.style.display="none"),n.dom.el=i,n.isInDom&&n.bindEvents());t.state=t.buildState(t.lastOperation)},destroy:function(n){var i=this,f=null,u=null,r=0;for(i.callActions("beforeDestroy",arguments),r=0;f=i.controls[r];r++)f.removeBinding(i);for(r=0;u=i.targets[r];r++)n&&u.show(),u.unbindEvents();i.dom.container.id.match(/^MixItUp/)&&i.dom.container.removeAttribute("id");delete t.instances[i.id];i.callActions("afterDestroy",arguments)}});t.IMoveData=function(){t.Base.call(this);this.callActions("beforeConstruct");this.posIn=null;this.posOut=null;this.operation=null;this.callback=null;this.statusChange="";this.duration=-1;this.staggerIndex=-1;this.callActions("afterConstruct");i.seal(this)};t.BaseStatic.call(t.IMoveData);t.IMoveData.prototype=Object.create(t.Base.prototype);t.IMoveData.prototype.constructor=t.IMoveData;t.TargetDom=function(){t.Base.call(this);this.callActions("beforeConstruct");this.el=null;this.callActions("afterConstruct");i.seal(this)};t.BaseStatic.call(t.TargetDom);t.TargetDom.prototype=Object.create(t.Base.prototype);t.TargetDom.prototype.constructor=t.TargetDom;t.Target=function(){t.Base.call(this);this.callActions("beforeConstruct");this.id="";this.sortString="";this.mixer=null;this.callback=null;this.isShown=!1;this.isBound=!1;this.isExcluded=!1;this.isInDom=!1;this.handler=null;this.operation=null;this.data=null;this.dom=new t.TargetDom;this.callActions("afterConstruct");i.seal(this)};t.BaseStatic.call(t.Target);t.Target.prototype=Object.create(t.Base.prototype);i.extend(t.Target.prototype,{constructor:t.Target,init:function(n,i,r){var u=this,f="";if(u.callActions("beforeInit",arguments),u.mixer=i,n||(n=u.render(r)),u.cacheDom(n),u.bindEvents(),u.dom.el.style.display!=="none"&&(u.isShown=!0),r&&i.config.data.uidKey){if(typeof(f=r[i.config.data.uidKey])=="undefined"||f.toString().length0&&n.posOut.height>0&&(i.dom.el.style.width=n.posOut.width+"px",i.dom.el.style.height=n.posOut.height+"px",i.dom.el.style.marginRight=n.posOut.marginRight+"px",i.dom.el.style.marginBottom=n.posOut.marginBottom+"px");i.mixer.config.animation.nudge||n.statusChange!=="hide"||u.push("translate("+n.posOut.x+"px, "+n.posOut.y+"px)");switch(n.statusChange){case"hide":e&&(i.dom.el.style.opacity=i.mixer.effectsOut.opacity);u=u.concat(i.mixer.transformOut);break;case"show":e&&(i.dom.el.style.opacity=1)}(i.mixer.config.animation.nudge||!i.mixer.config.animation.nudge&&n.statusChange!=="hide")&&u.push("translate("+n.posOut.x+"px, "+n.posOut.y+"px)");i.dom.el.style[t.features.transformProp]=u.join(" ");i.callActions("afterApplyStylesOut",arguments)},writeTransitionRule:function(n,t,i){var r=this,f=r.getDelay(t),u="";return u=n+" "+(i>0?i:r.mixer.config.animation.duration)+"ms "+f+"ms "+(n==="opacity"?"linear":r.mixer.config.animation.easing),r.callFilters("ruleWriteTransitionRule",u,arguments)},getDelay:function(n){var t=this,i=-1;return typeof t.mixer.config.animation.staggerSequence=="function"&&(n=t.mixer.config.animation.staggerSequence.call(t,n,t.state)),i=!t.mixer.staggerDuration?0:n*t.mixer.staggerDuration,t.callFilters("delayGetDelay",i,arguments)},applyTransition:function(n){var i=this,r=n.join(", ");i.callActions("beforeApplyTransition",arguments);i.dom.el.style[t.features.transitionProp]=r;i.callActions("afterApplyTransition",arguments)},handleTransitionEnd:function(n){var t=this,i=n.propertyName,r=t.mixer.config.animation.animateResizeTargets;t.callActions("beforeHandleTransitionEnd",arguments);t.isBound&&n.target.matches(t.mixer.config.selectors.target)&&(i.indexOf("transform")>-1||i.indexOf("opacity")>-1||r&&i.indexOf("height")>-1||r&&i.indexOf("width")>-1||r&&i.indexOf("margin")>-1)&&(t.callback.call(t,t.operation),t.isBound=!1,t.callback=null,t.operation=null);t.callActions("afterHandleTransitionEnd",arguments)},eventBus:function(n){var t=this;t.callActions("beforeEventBus",arguments);switch(n.type){case"webkitTransitionEnd":case"transitionend":t.handleTransitionEnd(n)}t.callActions("afterEventBus",arguments)},unbindEvents:function(){var n=this;n.callActions("beforeUnbindEvents",arguments);i.off(n.dom.el,"webkitTransitionEnd",n.handler);i.off(n.dom.el,"transitionend",n.handler);n.callActions("afterUnbindEvents",arguments)},bindEvents:function(){var n=this,r="";n.callActions("beforeBindEvents",arguments);r=t.features.transitionPrefix==="webkit"?"webkitTransitionEnd":"transitionend";n.handler=function(t){return n.eventBus(t)};i.on(n.dom.el,r,n.handler);n.callActions("afterBindEvents",arguments)},getPosData:function(i){var u=this,e={},f=null,r=new t.StyleData;return u.callActions("beforeGetPosData",arguments),r.x=u.dom.el.offsetLeft,r.y=u.dom.el.offsetTop,(u.mixer.config.animation.animateResizeTargets||i)&&(f=u.dom.el.getBoundingClientRect(),r.top=f.top,r.right=f.right,r.bottom=f.bottom,r.left=f.left,r.width=f.width,r.height=f.height),u.mixer.config.animation.animateResizeTargets&&(e=n.getComputedStyle(u.dom.el),r.marginBottom=parseFloat(e.marginBottom),r.marginRight=parseFloat(e.marginRight)),u.callFilters("posDataGetPosData",r,arguments)},cleanUp:function(){var n=this;n.callActions("beforeCleanUp",arguments);n.dom.el.style[t.features.transformProp]="";n.dom.el.style[t.features.transitionProp]="";n.dom.el.style.opacity="";n.mixer.config.animation.animateResizeTargets&&(n.dom.el.style.width="",n.dom.el.style.height="",n.dom.el.style.marginRight="",n.dom.el.style.marginBottom="");n.callActions("afterCleanUp",arguments)}});t.Collection=function(n){var r=null,t=-1;for(this.callActions("beforeConstruct"),t=0;r=n[t];t++)this[t]=r;this.length=n.length;this.callActions("afterConstruct");i.freeze(this)};t.BaseStatic.call(t.Collection);t.Collection.prototype=Object.create(t.Base.prototype);i.extend(t.Collection.prototype,{constructor:t.Collection,mixitup:function(n){var f=this,r=null,e=Array.prototype.slice.call(arguments),o=[],u=-1;for(this.callActions("beforeMixitup"),e.shift(),u=0;r=f[u];u++)o.push(r[n].apply(r,e));return f.callFilters("promiseMixitup",i.all(o,t.libraries),arguments)}});t.Operation=function(){t.Base.call(this);this.callActions("beforeConstruct");this.id="";this.args=[];this.command=null;this.showPosData=[];this.toHidePosData=[];this.startState=null;this.newState=null;this.docState=null;this.willSort=!1;this.willChangeLayout=!1;this.hasEffect=!1;this.hasFailed=!1;this.triggerElement=null;this.show=[];this.hide=[];this.matching=[];this.toShow=[];this.toHide=[];this.toMove=[];this.toRemove=[];this.startOrder=[];this.newOrder=[];this.startSort=null;this.newSort=null;this.startFilter=null;this.newFilter=null;this.startDataset=null;this.newDataset=null;this.viewportDeltaX=0;this.viewportDeltaY=0;this.startX=0;this.startY=0;this.startHeight=0;this.startWidth=0;this.newX=0;this.newY=0;this.newHeight=0;this.newWidth=0;this.startContainerClassName="";this.startDisplay="";this.newContainerClassName="";this.newDisplay="";this.callActions("afterConstruct");i.seal(this)};t.BaseStatic.call(t.Operation);t.Operation.prototype=Object.create(t.Base.prototype);t.Operation.prototype.constructor=t.Operation;t.State=function(){t.Base.call(this);this.callActions("beforeConstruct");this.id="";this.activeFilter=null;this.activeSort=null;this.activeContainerClassName="";this.container=null;this.targets=[];this.hide=[];this.show=[];this.matching=[];this.totalTargets=-1;this.totalShow=-1;this.totalHide=-1;this.totalMatching=-1;this.hasFailed=!1;this.triggerElement=null;this.activeDataset=null;this.callActions("afterConstruct");i.seal(this)};t.BaseStatic.call(t.State);t.State.prototype=Object.create(t.Base.prototype);t.State.prototype.constructor=t.State;t.UserInstruction=function(){t.Base.call(this);this.callActions("beforeConstruct");this.command={};this.animate=!1;this.callback=null;this.callActions("afterConstruct");i.seal(this)};t.BaseStatic.call(t.UserInstruction);t.UserInstruction.prototype=Object.create(t.Base.prototype);t.UserInstruction.prototype.constructor=t.UserInstruction;t.Messages=function(){t.Base.call(this);this.callActions("beforeConstruct");this.ERROR_FACTORY_INVALID_CONTAINER="[MixItUp] An invalid selector or element reference was passed to the mixitup factory function";this.ERROR_FACTORY_CONTAINER_NOT_FOUND="[MixItUp] The provided selector yielded no container element";this.ERROR_CONFIG_INVALID_ANIMATION_EFFECTS="[MixItUp] Invalid value for `animation.effects`";this.ERROR_CONFIG_INVALID_CONTROLS_SCOPE="[MixItUp] Invalid value for `controls.scope`";this.ERROR_CONFIG_INVALID_PROPERTY='[MixitUp] Invalid configuration object property "${erroneous}"${suggestion}';this.ERROR_CONFIG_INVALID_PROPERTY_SUGGESTION='. Did you mean "${probableMatch}"?';this.ERROR_CONFIG_DATA_UID_KEY_NOT_SET="[MixItUp] To use the dataset API, a UID key must be specified using `data.uidKey`";this.ERROR_DATASET_INVALID_UID_KEY='[MixItUp] The specified UID key "${uidKey}" is not present on one or more dataset items';this.ERROR_DATASET_DUPLICATE_UID='[MixItUp] The UID "${uid}" was found on two or more dataset items. UIDs must be unique.';this.ERROR_INSERT_INVALID_ARGUMENTS="[MixItUp] Please provider either an index or a sibling and position to insert, not both";this.ERROR_INSERT_PREEXISTING_ELEMENT="[MixItUp] An element to be inserted already exists in the container";this.ERROR_FILTER_INVALID_ARGUMENTS="[MixItUp] Please provide either a selector or collection `.filter()`, not both";this.ERROR_DATASET_NOT_SET="[MixItUp] To use the dataset API with pre-rendered targets, a starting dataset must be set using `load.dataset`";this.ERROR_DATASET_PRERENDERED_MISMATCH="[MixItUp] `load.dataset` does not match pre-rendered targets";this.ERROR_DATASET_RENDERER_NOT_SET="[MixItUp] To insert an element via the dataset API, a target renderer function must be provided to `render.target`";this.ERROR_SORT_NON_EXISTENT_ELEMENT="[MixItUp] An element to be sorted does not already exist in the container";this.WARNING_FACTORY_PREEXISTING_INSTANCE="[MixItUp] WARNING: This element already has an active MixItUp instance. The provided configuration object will be ignored. If you wish to perform additional methods on this instance, please create a reference.";this.WARNING_INSERT_NO_ELEMENTS="[MixItUp] WARNING: No valid elements were passed to `.insert()`";this.WARNING_REMOVE_NO_ELEMENTS="[MixItUp] WARNING: No valid elements were passed to `.remove()`";this.WARNING_MULTIMIX_INSTANCE_QUEUE_FULL="[MixItUp] WARNING: An operation was requested but the MixItUp instance was busy. The operation was rejected because the queue is full or queuing is disabled.";this.WARNING_GET_OPERATION_INSTANCE_BUSY="[MixItUp] WARNING: Operations can be be created while the MixItUp instance is busy.";this.WARNING_NO_PROMISE_IMPLEMENTATION="[MixItUp] WARNING: No Promise implementations could be found. If you wish to use promises with MixItUp please install an ES6 Promise polyfill.";this.WARNING_INCONSISTENT_SORTING_ATTRIBUTES='[MixItUp] WARNING: The requested sorting data attribute "${attribute}" was not present on one or more target elements which may product unexpected sort output';this.callActions("afterConstruct");this.compileTemplates();i.seal(this)};t.BaseStatic.call(t.Messages);t.Messages.prototype=Object.create(t.Base.prototype);t.Messages.prototype.constructor=t.Messages;t.Messages.prototype.compileTemplates=function(){var n="",t="";for(n in this)typeof(t=this[n])=="string"&&(this[i.camelCase(n)]=i.template(t))};t.messages=new t.Messages;t.Facade=function(n){t.Base.call(this);this.callActions("beforeConstruct",arguments);this.configure=n.configure.bind(n);this.show=n.show.bind(n);this.hide=n.hide.bind(n);this.filter=n.filter.bind(n);this.toggleOn=n.toggleOn.bind(n);this.toggleOff=n.toggleOff.bind(n);this.sort=n.sort.bind(n);this.changeLayout=n.changeLayout.bind(n);this.multimix=n.multimix.bind(n);this.dataset=n.dataset.bind(n);this.tween=n.tween.bind(n);this.insert=n.insert.bind(n);this.insertBefore=n.insertBefore.bind(n);this.insertAfter=n.insertAfter.bind(n);this.prepend=n.prepend.bind(n);this.append=n.append.bind(n);this.remove=n.remove.bind(n);this.destroy=n.destroy.bind(n);this.forceRefresh=n.forceRefresh.bind(n);this.forceRender=n.forceRender.bind(n);this.isMixing=n.isMixing.bind(n);this.getOperation=n.getOperation.bind(n);this.getConfig=n.getConfig.bind(n);this.getState=n.getState.bind(n);this.callActions("afterConstruct",arguments);i.freeze(this);i.seal(this)};t.BaseStatic.call(t.Facade);t.Facade.prototype=Object.create(t.Base.prototype);t.Facade.prototype.constructor=t.Facade;typeof exports=="object"&&typeof module=="object"?module.exports=t:typeof define=="function"&&define.amd?define(function(){return t}):(typeof n.mixitup=="undefined"||typeof n.mixitup!="function")&&(n.mixitup=t);t.BaseStatic.call(t.constructor);t.NAME="mixitup";t.CORE_VERSION="3.3.1"})(window); $(()=>{const n=document.getElementById("game_list"),t=()=>{n&&(n.onclick=n=>{if(n.target.className==="favourite-game-btn"){let t="";t=n.target.checked?"/game/new-favourite":"/game/remove-favourite";$.ajax({type:"POST",data:JSON.stringify({Provider:n.target.dataset.provider,GameCode:n.target.value}),url:t,contentType:"application/json; charset=utf-8",dataType:"json",success:t=>{t.errorCode!=0&&(n.target.checked=!n.target.checked,registerPopup({content:`Unable to update favourite game. ${t.message}`}))},error:()=>{n.target.checked=!n.target.checked,registerPopup({content:"Unable to update favourite game."})}})}})};t()}); $(()=>{const n=document.querySelector("#filter_categories"),i=document.querySelector("#filter_input"),t=document.querySelector("#game_list");window.initializeRaceGames=r=>{$.ajax({type:"GET",url:`/desktop/race/games/${r.provider}`,contentType:"application/json; charset=utf-8",dataType:"json",success:u=>{const e=new Set,o=document.createDocumentFragment();u.forEach(n=>{e.add(n.category);const u=document.createElement("div");u.className="link-container";const i=document.createElement("a");if(i.className="play-now",i.dataset.game=n.name,i.href=n.link,i.innerText=r.translations.playNow,u.appendChild(i),r.onDemoLinkClicked){const t=document.createElement("a");t.className="free-play";t.innerText=r.translations.demo;t.onclick=()=>r.onDemoLinkClicked(n.gameCode);u.appendChild(t)}const s=document.createElement("img");s.src=`${r.directoryPath}${r.provider}/${n.gameImage}`;s.alt=n.name;const f=document.createElement("div");f.className="wrapper-container";f.appendChild(s);f.appendChild(u);const h=document.createElement("div");h.className="game-name";h.innerText=n.name;const t=document.createElement("div");if(t.className="game-item",t.dataset.game=n.name,t.dataset.category=n.category,t.dataset.match=!0,n.isFavourite!==undefined&&n.isFavourite!==null){const i=document.createElement("input");i.type="checkbox";i.dataset.provider=r.provider;i.value=n.gameCode;i.id=n.gameCode;i.className="favourite-game-btn";n.isFavourite&&(i.checked=!0);const u=document.createElement("label");u.htmlFor=n.gameCode;t.appendChild(i);t.appendChild(u)}t.appendChild(f);t.appendChild(h);o.appendChild(t)});t.appendChild(o);const s=document.createDocumentFragment();e.forEach(n=>{const t=document.createElement("div");t.className="category-filter-link";t.dataset.category=n;t.innerText=n;s.appendChild(t)});n.appendChild(s);const l=t.querySelectorAll(".game-item"),f={name:null,category:null},a=window.mixitup(t,{selectors:{target:".game-item"},controls:{enable:!1}}),h=()=>{Array.prototype.slice.call(l).forEach(n=>{const t=n.dataset.game.toLowerCase(),i=n.dataset.category,r=!f.category||i===f.category,u=!f.name||t.indexOf(f.name)>=0;n.dataset.match=r&&u?!0:!1}),a.filter('[data-match="true"]')},v=(n,t,i)=>{var r;return function(){var u=this,f=arguments;clearTimeout(r);r=setTimeout(function(){r=null;i||n.apply(u,f)},t);i&&!r&&n.apply(u,f)}};$(i).keyup(v(function(){f.name=i.value.toLowerCase();h()},250));$(n).on("click",".category-filter-link",function(){const n=$(this);n.siblings().removeClass("active");n.addClass("active");f.category=this.dataset.category;h()});const c=new URLSearchParams(window.location.search).get("PromotionCategory");if(c){const t=Array.from(e).find(n=>n.toLowerCase()===c.toLowerCase());if(t){n.querySelector(`[data-category="${t}"]`).click();return}}}})}});