Changeset 2761678
- Timestamp:
- 07/26/2022 10:24:52 AM (4 years ago)
- Location:
- linky/trunk
- Files:
-
- 4 edited
-
assets/dist/linky.js (modified) (1 diff)
-
assets/dist/wp-linky.js (modified) (1 diff)
-
linky.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
linky/trunk/assets/dist/linky.js
r2761627 r2761678 1 if(void 0===$&&"undefined"!=typeof jQuery)var $=jQuery;$(document).ready(function(){$(".js-toggle-menu").click(function(){$(this).closest(".header__burger").toggleClass("is-open"),$(".linky-page").toggleClass("menu-open")})}),$(window).load(function(){$("img").each(function(){var a=$(this),b=a.data(),c=Object.keys(b);if(c.length>0)for(var d=0;d<c.length;d++)c[d].toLowerCase().indexOf("src")>=0&&(a.attr("src",a.data(c[d])),a.addClass("lazyloaded"))})});1 "undefined"==typeof $&&"undefined"!=typeof jQuery&&($=jQuery),$(document).ready(function(){$(".js-toggle-menu").click(function(){$(this).closest(".header__burger").toggleClass("is-open"),$(".linky-page").toggleClass("menu-open")})}),$(window).load(function(){$("img").each(function(){var a=$(this),b=a.data(),c=Object.keys(b);if(c.length>0)for(var d=0;d<c.length;d++)c[d].toLowerCase().indexOf("src")>=0&&(a.attr("src",a.data(c[d])),a.addClass("lazyloaded"))})}); -
linky/trunk/assets/dist/wp-linky.js
r2723457 r2761678 1 1 !function(a,b,c,d){function e(b,c){this.element=a(b),this.options=c||{},this.options.scope=this.options.scope||m.Parent,this.options.className=this.options.className||"stick",this.options.top=this.options.top||0,this.options.extraHeight=this.options.extraHeight||0,this.options.zIndex===d&&(this.zIndex=this.element.css("z-index")||100,"auto"==this.zIndex&&(this.zIndex=100)),this.offsetY=0,this.lastY=0,this.stick=n.None,this.spacer=a("<div />"),this.spacer[0].id=b.id,this.spacer[0].className=b.className,this.spacer[0].style.cssText=b.style.cssText,this.spacer.addClass(i),this.spacer.css({display:"none",visibility:"hidden"}),this.spacer.insertAfter(this.element),"static"==this.element.parent().css("position")&&this.element.parent().css("position","relative"),this.bound(),this.precalculate(),this.store()}function f(){p=b.innerHeight||c.documentElement.clientHeight,q=b.innerWidth||c.documentElement.clientWidth,a(j).each(function(){a(this).data(h).resize()})}function g(){a(j).each(function(){a(this).data(h).locate()})}var h="jquery-stickit",i=h+"-spacer",j=":"+h,k=-1!=navigator.userAgent.indexOf("MSIE 7.0"),l=k?-2:0,m=b.StickScope={Parent:0,Document:1},n={None:0,Fixed:1,Absolute:2},o=!1;a.expr[":"][h]=function(b){return!!a(b).data(h)},e.prototype.store=function(){var a=this.element[0];this.origStyle={width:a.style.width,position:a.style.position,left:a.style.left,top:a.style.top,bottom:a.style.bottom,zIndex:a.style.zIndex}},e.prototype.restore=function(){this.element.css(this.origStyle)},e.prototype.bound=function(){var a=this.element;if(k||"border-box"!=a.css("box-sizing"))this.extraWidth=0;else{var b=parseInt(a.css("border-left-width"))||0,c=parseInt(a.css("border-right-width"))||0,d=parseInt(a.css("padding-left"))||0,e=parseInt(a.css("padding-right"))||0;this.extraWidth=b+c+d+e}this.margin={top:parseInt(a.css("margin-top"))||0,bottom:parseInt(a.css("margin-bottom"))||0,left:parseInt(a.css("margin-left"))||0,right:parseInt(a.css("margin-right"))||0},this.parent={border:{bottom:parseInt(a.parent().css("border-bottom-width"))||0}}},e.prototype.precalculate=function(){this.baseTop=this.margin.top+this.options.top,this.basePadding=this.baseTop+this.margin.bottom,this.baseParentOffset=this.options.extraHeight-this.parent.border.bottom,this.offsetHeight=Math.max(this.element.height()-p,0)},e.prototype.reset=function(){this.stick=n.None,this.spacer.hide(),this.spacer.css("width",""),this.restore(),this.element.removeClass(this.options.className)},e.prototype.setAbsolute=function(a){this.stick==n.None&&this.element.addClass(this.options.className),this.stick=n.Absolute,this.element.css({width:this.element.width()+this.extraWidth+"px",position:"absolute",top:this.origStyle.top,left:a+"px",bottom:-this.options.extraHeight+"px","z-index":this.zIndex})},e.prototype.setFixed=function(a,b,c){this.stick==n.None&&this.element.addClass(this.options.className),this.stick=n.Fixed,this.lastY=b,this.offsetY=c,this.element.css({width:this.element.width()+this.extraWidth+"px",position:"fixed",top:this.options.top+c+"px",left:a+"px",bottom:this.origStyle.bottom,"z-index":this.zIndex})},e.prototype.updateScroll=function(a){0!=this.offsetHeight&&(this.offsetY=Math.max(this.offsetY+a-this.lastY,-this.offsetHeight),this.offsetY=Math.min(this.offsetY,0),this.lastY=a,this.element.css("top",this.options.top+this.offsetY+"px"))},e.prototype.isActive=function(){return(this.options.screenMinWidth===d||q>=this.options.screenMinWidth)&&(this.options.screenMaxWidth===d||q<=this.options.screenMaxWidth)&&this.element.is(":visible")},e.prototype.locate=function(){var a,b,c,d=this.element,e=this.spacer;if(!this.isActive())return void(this.stick!=n.None&&this.reset());switch(this.stick){case n.Fixed:a=e[0].getBoundingClientRect(),b=a.top-this.baseTop,b>=0?this.reset():this.options.scope==m.Parent?(a=d.parent()[0].getBoundingClientRect(),a.bottom+this.baseParentOffset+this.offsetHeight<=d.outerHeight(!1)+this.basePadding?this.setAbsolute(this.spacer.position().left):this.updateScroll(a.bottom)):this.updateScroll(a.bottom);break;case n.Absolute:a=e[0].getBoundingClientRect(),b=a.top-this.baseTop,c=a.left-this.margin.left,b>=0?this.reset():(a=d.parent()[0].getBoundingClientRect(),a.bottom+this.baseParentOffset+this.offsetHeight>d.outerHeight(!1)+this.basePadding&&this.setFixed(c+l,a.bottom,-this.offsetHeight));break;case n.None:default:if(a=d[0].getBoundingClientRect(),(b=a.top-this.baseTop)>=0)return;if(e.height(d.height()),e.show(),c=a.left-this.margin.left,this.options.scope==m.Document)this.setFixed(c,a.bottom,0);else{d.parent()[0].getBoundingClientRect().bottom+this.baseParentOffset<=d.outerHeight(!1)+this.basePadding?this.setAbsolute(this.element.position().left):this.setFixed(c+l,a.bottom,0)}e.width()||e.width(d.width())}},e.prototype.resize=function(){if(this.bound(),this.precalculate(),this.stick==n.None)return void this.locate();var a=this.element,b=this.spacer;if(a.width(b.width()),b.height(a.height()),this.stick==n.Fixed){var c=this.spacer[0].getBoundingClientRect(),d=c.left-this.margin.left;a.css("left",d+"px")}this.locate()},e.prototype.destroy=function(){this.reset(),this.spacer.remove(),this.element.removeData(h)};var p,q,r=["destroy"];a.fn.stickit=function(d,i){return"string"==typeof d?-1!=a.inArray(d,r)&&this.each(function(){var b=a(this).data(h);b&&b[d].apply(b,i)}):(o||(o=!0,f(),a(c).ready(function(){a(b).bind("resize",f).bind("scroll",g)})),i=d,this.each(function(){var b=new e(this,i);a(this).data(h,b),b.locate()})),this}}(jQuery,window,document),window.Choices=function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var c={};return b.m=a,b.c=c,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{enumerable:!0,get:d})},b.r=function(a){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},b.t=function(a,c){if(1&c&&(a=b(a)),8&c)return a;if(4&c&&"object"==typeof a&&a&&a.__esModule)return a;var d=Object.create(null);if(b.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:a}),2&c&&"string"!=typeof a)for(var e in a)b.d(d,e,function(b){return a[b]}.bind(null,e));return d},b.n=function(a){var c=a&&a.__esModule?function(){return a.default}:function(){return a};return b.d(c,"a",c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p="/public/assets/scripts/",b(b.s=4)}([function(a,b,c){"use strict";function d(a,b){return!1!==b.clone&&b.isMergeableObject(a)?h((c=a,Array.isArray(c)?[]:{}),a,b):a;var c}function e(a,b,c){return a.concat(b).map(function(a){return d(a,c)})}function f(a){return Object.keys(a).concat(function(a){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(a).filter(function(b){return a.propertyIsEnumerable(b)}):[]}(a))}function g(a,b,c){var e={};return c.isMergeableObject(a)&&f(a).forEach(function(b){e[b]=d(a[b],c)}),f(b).forEach(function(f){(function(a,b){try{return b in a&&!(Object.hasOwnProperty.call(a,b)&&Object.propertyIsEnumerable.call(a,b))}catch(a){return!1}})(a,f)||(c.isMergeableObject(b[f])&&a[f]?e[f]=function(a,b){if(!b.customMerge)return h;var c=b.customMerge(a);return"function"==typeof c?c:h}(f,c)(a[f],b[f],c):e[f]=d(b[f],c))}),e}function h(a,b,c){(c=c||{}).arrayMerge=c.arrayMerge||e,c.isMergeableObject=c.isMergeableObject||i,c.cloneUnlessOtherwiseSpecified=d;var f=Array.isArray(b);return f===Array.isArray(a)?f?c.arrayMerge(a,b,c):g(a,b,c):d(b,c)}var i=function(a){return function(a){return!!a&&"object"==typeof a}(a)&&!function(a){var b=Object.prototype.toString.call(a);return"[object RegExp]"===b||"[object Date]"===b||function(a){return a.$$typeof===j}(a)}(a)},j="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;h.all=function(a,b){if(!Array.isArray(a))throw new Error("first argument should be an array");return a.reduce(function(a,c){return h(a,c,b)},{})};var k=h;a.exports=k},function(a,b,c){"use strict";(function(a,d){var e,f=c(3);e="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==a?a:d;var g=Object(f.a)(e);b.a=g}).call(this,c(5),c(6)(a))},function(a,b,c){a.exports=function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var c={};return b.m=a,b.c=c,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{enumerable:!0,get:d})},b.r=function(a){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},b.t=function(a,c){if(1&c&&(a=b(a)),8&c)return a;if(4&c&&"object"==typeof a&&a&&a.__esModule)return a;var d=Object.create(null);if(b.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:a}),2&c&&"string"!=typeof a)for(var e in a)b.d(d,e,function(b){return a[b]}.bind(null,e));return d},b.n=function(a){var c=a&&a.__esModule?function(){return a.default}:function(){return a};return b.d(c,"a",c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p="",b(b.s=1)}([function(a,b){a.exports=function(a){return Array.isArray?Array.isArray(a):"[object Array]"===Object.prototype.toString.call(a)}},function(a,b,c){function d(a){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a})(a)}function e(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}var f=c(2),g=c(8),h=c(0),i=function(){function a(b,c){var d=c.location,e=void 0===d?0:d,f=c.distance,h=void 0===f?100:f,i=c.threshold,j=void 0===i?.6:i,k=c.maxPatternLength,l=void 0===k?32:k,m=c.caseSensitive,n=void 0!==m&&m,o=c.tokenSeparator,p=void 0===o?/ +/g:o,q=c.findAllMatches,r=void 0!==q&&q,s=c.minMatchCharLength,t=void 0===s?1:s,u=c.id,v=void 0===u?null:u,w=c.keys,x=void 0===w?[]:w,y=c.shouldSort,z=void 0===y||y,A=c.getFn,B=void 0===A?g:A,C=c.sortFn,D=void 0===C?function(a,b){return a.score-b.score}:C,E=c.tokenize,F=void 0!==E&&E,G=c.matchAllTokens,H=void 0!==G&&G,I=c.includeMatches,J=void 0!==I&&I,K=c.includeScore,L=void 0!==K&&K,M=c.verbose,N=void 0!==M&&M;!function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}(this,a),this.options={location:e,distance:h,threshold:j,maxPatternLength:l,isCaseSensitive:n,tokenSeparator:p,findAllMatches:r,minMatchCharLength:t,id:v,keys:x,includeMatches:J,includeScore:L,shouldSort:z,getFn:B,sortFn:D,verbose:N,tokenize:F,matchAllTokens:H},this.setCollection(b)}var b,c;return b=a,(c=[{key:"setCollection",value:function(a){return this.list=a,a}},{key:"search",value:function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{limit:!1};this._log('---------\nSearch pattern: "'.concat(a,'"'));var c=this._prepareSearchers(a),d=c.tokenSearchers,e=c.fullSearcher,f=this._search(d,e),g=f.weights,h=f.results;return this._computeScore(g,h),this.options.shouldSort&&this._sort(h),b.limit&&"number"==typeof b.limit&&(h=h.slice(0,b.limit)),this._format(h)}},{key:"_prepareSearchers",value:function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",b=[];if(this.options.tokenize)for(var c=a.split(this.options.tokenSeparator),d=0,e=c.length;d<e;d+=1)b.push(new f(c[d],this.options));return{tokenSearchers:b,fullSearcher:new f(a,this.options)}}},{key:"_search",value:function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],b=arguments.length>1?arguments[1]:void 0,c=this.list,d={},e=[];if("string"==typeof c[0]){for(var f=0,g=c.length;f<g;f+=1)this._analyze({key:"",value:c[f],record:f,index:f},{resultMap:d,results:e,tokenSearchers:a,fullSearcher:b});return{weights:null,results:e}}for(var h={},i=0,j=c.length;i<j;i+=1)for(var k=c[i],l=0,m=this.options.keys.length;l<m;l+=1){var n=this.options.keys[l];if("string"!=typeof n){if(h[n.name]={weight:1-n.weight||1},n.weight<=0||n.weight>1)throw new Error("Key weight has to be > 0 and <= 1");n=n.name}else h[n]={weight:1};this._analyze({key:n,value:this.options.getFn(k,n),record:k,index:i},{resultMap:d,results:e,tokenSearchers:a,fullSearcher:b})}return{weights:h,results:e}}},{key:"_analyze",value:function(a,b){var c=a.key,d=a.arrayIndex,e=void 0===d?-1:d,f=a.value,g=a.record,i=a.index,j=b.tokenSearchers,k=void 0===j?[]:j,l=b.fullSearcher,m=void 0===l?[]:l,n=b.resultMap,o=void 0===n?{}:n,p=b.results,q=void 0===p?[]:p;if(null!=f){var r=!1,s=-1,t=0;if("string"==typeof f){this._log("\nKey: ".concat(""===c?"-":c));var u=m.search(f);if(this._log('Full text: "'.concat(f,'", score: ').concat(u.score)),this.options.tokenize){for(var v=f.split(this.options.tokenSeparator),w=[],x=0;x<k.length;x+=1){var y=k[x];this._log('\nPattern: "'.concat(y.pattern,'"'));for(var z=!1,A=0;A<v.length;A+=1){var B=v[A],C=y.search(B),D={};C.isMatch?(D[B]=C.score,r=!0,z=!0,w.push(C.score)):(D[B]=1,this.options.matchAllTokens||w.push(1)),this._log('Token: "'.concat(B,'", score: ').concat(D[B]))}z&&(t+=1)}s=w[0];for(var E=w.length,F=1;F<E;F+=1)s+=w[F];s/=E,this._log("Token score average:",s)}var G=u.score;s>-1&&(G=(G+s)/2),this._log("Score average:",G);var H=!this.options.tokenize||!this.options.matchAllTokens||t>=k.length;if(this._log("\nCheck Matches: ".concat(H)),(r||u.isMatch)&&H){var I=o[i];I?I.output.push({key:c,arrayIndex:e,value:f,score:G,matchedIndices:u.matchedIndices}):(o[i]={item:g,output:[{key:c,arrayIndex:e,value:f,score:G,matchedIndices:u.matchedIndices}]},q.push(o[i]))}}else if(h(f))for(var J=0,K=f.length;J<K;J+=1)this._analyze({key:c,arrayIndex:J,value:f[J],record:g,index:i},{resultMap:o,results:q,tokenSearchers:k,fullSearcher:m})}}},{key:"_computeScore",value:function(a,b){this._log("\n\nComputing score:\n");for(var c=0,d=b.length;c<d;c+=1){for(var e=b[c].output,f=e.length,g=1,h=1,i=0;i<f;i+=1){var j=a?a[e[i].key].weight:1,k=(1===j?e[i].score:e[i].score||.001)*j;1!==j?h=Math.min(h,k):(e[i].nScore=k,g*=k)}b[c].score=1===h?g:h,this._log(b[c])}}},{key:"_sort",value:function(a){this._log("\n\nSorting...."),a.sort(this.options.sortFn)}},{key:"_format",value:function(a){var b=[];if(this.options.verbose){var c=[];this._log("\n\nOutput:\n\n",JSON.stringify(a,function(a,b){if("object"===d(b)&&null!==b){if(-1!==c.indexOf(b))return;c.push(b)}return b})),c=null}var e=[];this.options.includeMatches&&e.push(function(a,b){var c=a.output;b.matches=[];for(var d=0,e=c.length;d<e;d+=1){var f=c[d];if(0!==f.matchedIndices.length){var g={indices:f.matchedIndices,value:f.value};f.key&&(g.key=f.key),f.hasOwnProperty("arrayIndex")&&f.arrayIndex>-1&&(g.arrayIndex=f.arrayIndex),b.matches.push(g)}}}),this.options.includeScore&&e.push(function(a,b){b.score=a.score});for(var f=0,g=a.length;f<g;f+=1){var h=a[f];if(this.options.id&&(h.item=this.options.getFn(h.item,this.options.id)[0]),e.length){for(var i={item:h.item},j=0,k=e.length;j<k;j+=1)e[j](h,i);b.push(i)}else b.push(h.item)}return b}},{key:"_log",value:function(){var a;this.options.verbose&&(a=console).log.apply(a,arguments)}}])&&e(b.prototype,c),a}();a.exports=i},function(a,b,c){function d(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}var e=c(3),f=c(4),g=c(7),h=function(){function a(b,c){var d=c.location,e=void 0===d?0:d,f=c.distance,h=void 0===f?100:f,i=c.threshold,j=void 0===i?.6:i,k=c.maxPatternLength,l=void 0===k?32:k,m=c.isCaseSensitive,n=void 0!==m&&m,o=c.tokenSeparator,p=void 0===o?/ +/g:o,q=c.findAllMatches,r=void 0!==q&&q,s=c.minMatchCharLength,t=void 0===s?1:s;!function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}(this,a),this.options={location:e,distance:h,threshold:j,maxPatternLength:l,isCaseSensitive:n,tokenSeparator:p,findAllMatches:r,minMatchCharLength:t},this.pattern=this.options.isCaseSensitive?b:b.toLowerCase(),this.pattern.length<=l&&(this.patternAlphabet=g(this.pattern))}var b,c;return b=a,(c=[{key:"search",value:function(a){if(this.options.isCaseSensitive||(a=a.toLowerCase()),this.pattern===a)return{isMatch:!0,score:0,matchedIndices:[[0,a.length-1]]};var b=this.options,c=b.maxPatternLength,d=b.tokenSeparator;if(this.pattern.length>c)return e(a,this.pattern,d);var g=this.options,h=g.location,i=g.distance,j=g.threshold,k=g.findAllMatches,l=g.minMatchCharLength;return f(a,this.pattern,this.patternAlphabet,{location:h,distance:i,threshold:j,findAllMatches:k,minMatchCharLength:l})}}])&&d(b.prototype,c),a}();a.exports=h},function(a,b){var c=/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g;a.exports=function(a,b){var d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:/ +/g,e=new RegExp(b.replace(c,"\\$&").replace(d,"|")),f=a.match(e),g=!!f,h=[];if(g)for(var i=0,j=f.length;i<j;i+=1){var k=f[i];h.push([a.indexOf(k),k.length-1])}return{score:g?.5:1,isMatch:g,matchedIndices:h}}},function(a,b,c){var d=c(5),e=c(6);a.exports=function(a,b,c,f){for(var g=f.location,h=void 0===g?0:g,i=f.distance,j=void 0===i?100:i,k=f.threshold,l=void 0===k?.6:k,m=f.findAllMatches,n=void 0!==m&&m,o=f.minMatchCharLength,p=void 0===o?1:o,q=h,r=a.length,s=l,t=a.indexOf(b,q),u=b.length,v=[],w=0;w<r;w+=1)v[w]=0;if(-1!==t){var x=d(b,{errors:0,currentLocation:t,expectedLocation:q,distance:j});if(s=Math.min(x,s),-1!==(t=a.lastIndexOf(b,q+u))){var y=d(b,{errors:0,currentLocation:t,expectedLocation:q,distance:j});s=Math.min(y,s)}}t=-1;for(var z=[],A=1,B=u+r,C=1<<u-1,D=0;D<u;D+=1){for(var E=0,F=B;E<F;)d(b,{errors:D,currentLocation:q+F,expectedLocation:q,distance:j})<=s?E=F:B=F,F=Math.floor((B-E)/2+E);B=F;var G=Math.max(1,q-F+1),H=n?r:Math.min(q+F,r)+u,I=Array(H+2);I[H+1]=(1<<D)-1;for(var J=H;J>=G;J-=1){var K=J-1,L=c[a.charAt(K)];if(L&&(v[K]=1),I[J]=(I[J+1]<<1|1)&L,0!==D&&(I[J]|=(z[J+1]|z[J])<<1|1|z[J+1]),I[J]&C&&(A=d(b,{errors:D,currentLocation:K,expectedLocation:q,distance:j}))<=s){if(s=A,(t=K)<=q)break;G=Math.max(1,2*q-t)}}if(d(b,{errors:D+1,currentLocation:q,expectedLocation:q,distance:j})>s)break;z=I}return{isMatch:t>=0,score:0===A?.001:A,matchedIndices:e(v,p)}}},function(a,b){a.exports=function(a,b){var c=b.errors,d=void 0===c?0:c,e=b.currentLocation,f=void 0===e?0:e,g=b.expectedLocation,h=void 0===g?0:g,i=b.distance,j=void 0===i?100:i,k=d/a.length,l=Math.abs(h-f);return j?k+l/j:l?1:k}},function(a,b){a.exports=function(){for(var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,c=[],d=-1,e=-1,f=0,g=a.length;f<g;f+=1){var h=a[f];h&&-1===d?d=f:h||-1===d||((e=f-1)-d+1>=b&&c.push([d,e]),d=-1)}return a[f-1]&&f-d>=b&&c.push([d,f-1]),c}},function(a,b){a.exports=function(a){for(var b={},c=a.length,d=0;d<c;d+=1)b[a.charAt(d)]=0;for(var e=0;e<c;e+=1)b[a.charAt(e)]|=1<<c-e-1;return b}},function(a,b,c){var d=c(0);a.exports=function(a,b){return function a(b,c,e){if(c){var f=c.indexOf("."),g=c,h=null;-1!==f&&(g=c.slice(0,f),h=c.slice(f+1));var i=b[g];if(null!=i)if(h||"string"!=typeof i&&"number"!=typeof i)if(d(i))for(var j=0,k=i.length;j<k;j+=1)a(i[j],h,e);else h&&a(i,h,e);else e.push(i.toString())}else e.push(b);return e}(a,b,[])}}])},function(a,b,c){"use strict";function d(a){var b,c=a.Symbol;return"function"==typeof c?c.observable?b=c.observable:(b=c("observable"),c.observable=b):b="@@observable",b}c.d(b,"a",function(){return d})},function(a,b,c){a.exports=c(7)},function(a,b){var c;c=function(){return this}();try{c=c||new Function("return this")()}catch(a){"object"==typeof window&&(c=window)}a.exports=c},function(a,b){a.exports=function(a){if(!a.webpackPolyfill){var b=Object.create(a);b.children||(b.children=[]),Object.defineProperty(b,"loaded",{enumerable:!0,get:function(){return b.l}}),Object.defineProperty(b,"id",{enumerable:!0,get:function(){return b.i}}),Object.defineProperty(b,"exports",{enumerable:!0}),b.webpackPolyfill=1}return b}},function(a,b,c){"use strict";function d(a){if("object"!=typeof a||null===a)return!1;for(var b=a;null!==Object.getPrototypeOf(b);)b=Object.getPrototypeOf(b);return Object.getPrototypeOf(a)===b}function e(a,b,c){function f(){n===m&&(n=m.slice())}function g(){if(o)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return l}function h(a){if("function"!=typeof a)throw new Error("Expected the listener to be a function.");if(o)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");var b=!0;return f(),n.push(a),function(){if(b){if(o)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");b=!1,f();var c=n.indexOf(a);n.splice(c,1)}}}function i(a){if(!d(a))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===a.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(o)throw new Error("Reducers may not dispatch actions.");try{o=!0,l=k(l,a)}finally{o=!1}for(var b=m=n,c=0;c<b.length;c++)(0,b[c])();return a}var j;if("function"==typeof b&&"function"==typeof c||"function"==typeof c&&"function"==typeof arguments[3])throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function.");if("function"==typeof b&&void 0===c&&(c=b,b=void 0),void 0!==c){if("function"!=typeof c)throw new Error("Expected the enhancer to be a function.");return c(e)(a,b)}if("function"!=typeof a)throw new Error("Expected the reducer to be a function.");var k=a,l=b,m=[],n=m,o=!1;return i({type:u.INIT}),(j={dispatch:i,subscribe:h,getState:g,replaceReducer:function(a){if("function"!=typeof a)throw new Error("Expected the nextReducer to be a function.");k=a,i({type:u.REPLACE})}})[s.a]=function(){var a,b=h;return(a={subscribe:function(a){function c(){a.next&&a.next(g())}if("object"!=typeof a||null===a)throw new TypeError("Expected the observer to be an object.");return c(),{unsubscribe:b(c)}}})[s.a]=function(){return this},a},j}function f(a,b){var c=b&&b.type;return"Given "+(c&&'action "'+String(c)+'"'||"an action")+', reducer "'+a+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function g(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}function h(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}function i(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}function j(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}function k(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}function l(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}function m(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}c.r(b);var n,o=c(2),p=c.n(o),q=c(0),r=c.n(q),s=c(1),t=function(){return Math.random().toString(36).substring(7).split("").join(".")},u={INIT:"@@redux/INIT"+t(),REPLACE:"@@redux/REPLACE"+t(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+t()}},v=[],w=[],x=[],y={loading:!1},z=function(a,b){switch(void 0===a&&(a=y),b.type){case"SET_IS_LOADING":return{loading:b.isLoading};default:return a}},A=function(a){return Array.from({length:a},function(){return(a=0,b=36,Math.floor(Math.random()*(b-a)+a)).toString(36);var a,b}).join("")},B=function(a,b){var c=a.id||a.name&&a.name+"-"+A(2)||A(4);return c=b+"-"+(c=c.replace(/(:|\.|\[|\]|,)/g,""))},C=function(a){return Object.prototype.toString.call(a).slice(8,-1)},D=function(a,b){return null!=b&&C(b)===a},E=function(a){return"string"!=typeof a?a:a.replace(/&/g,"&").replace(/>/g,"&rt;").replace(/</g,"<").replace(/"/g,""")},F=(n=document.createElement("div"),function(a){var b=a.trim();n.innerHTML=b;for(var c=n.children[0];n.firstChild;)n.removeChild(n.firstChild);return c}),G=function(a,b){return a.score-b.score},H=function(a){return JSON.parse(JSON.stringify(a))},I=function(a,b){var c=Object.keys(a).sort(),d=Object.keys(b).sort();return c.filter(function(a){return d.indexOf(a)<0})},J=function(a){for(var b=Object.keys(a),c={},d=0;d<b.length;d++){var e=b[d];"function"==typeof a[e]&&(c[e]=a[e])}var g,h=Object.keys(c);try{!function(a){Object.keys(a).forEach(function(b){var c=a[b];if(void 0===c(void 0,{type:u.INIT}))throw new Error('Reducer "'+b+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===c(void 0,{type:u.PROBE_UNKNOWN_ACTION()}))throw new Error('Reducer "'+b+"\" returned undefined when probed with a random type. Don't try to handle "+u.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')})}(c)}catch(a){g=a}return function(a,b){if(void 0===a&&(a={}),g)throw g;for(var d=!1,e={},i=0;i<h.length;i++){var j=h[i],k=c[j],l=a[j],m=k(l,b);if(void 0===m){var n=f(j,b);throw new Error(n)}e[j]=m,d=d||m!==l}return d?e:a}}({items:function(a,b){switch(void 0===a&&(a=v),b.type){case"ADD_ITEM":return[].concat(a,[{id:b.id,choiceId:b.choiceId,groupId:b.groupId,value:b.value,label:b.label,active:!0,highlighted:!1,customProperties:b.customProperties,placeholder:b.placeholder||!1,keyCode:null}]).map(function(a){var b=a;return b.highlighted=!1,b});case"REMOVE_ITEM":return a.map(function(a){var c=a;return c.id===b.id&&(c.active=!1),c});case"HIGHLIGHT_ITEM":return a.map(function(a){var c=a;return c.id===b.id&&(c.highlighted=b.highlighted),c});default:return a}},groups:function(a,b){switch(void 0===a&&(a=w),b.type){case"ADD_GROUP":return[].concat(a,[{id:b.id,value:b.value,active:b.active,disabled:b.disabled}]);case"CLEAR_CHOICES":return[];default:return a}},choices:function(a,b){switch(void 0===a&&(a=x),b.type){case"ADD_CHOICE":return[].concat(a,[{id:b.id,elementId:b.elementId,groupId:b.groupId,value:b.value,label:b.label||b.value,disabled:b.disabled||!1,selected:!1,active:!0,score:9999,customProperties:b.customProperties,placeholder:b.placeholder||!1,keyCode:null}]);case"ADD_ITEM":return b.activateOptions?a.map(function(a){var c=a;return c.active=b.active,c}):b.choiceId>-1?a.map(function(a){var c=a;return c.id===parseInt(b.choiceId,10)&&(c.selected=!0),c}):a;case"REMOVE_ITEM":return b.choiceId>-1?a.map(function(a){var c=a;return c.id===parseInt(b.choiceId,10)&&(c.selected=!1),c}):a;case"FILTER_CHOICES":return a.map(function(a){var c=a;return c.active=b.results.some(function(a){var b=a.item,d=a.score;return b.id===c.id&&(c.score=d,!0)}),c});case"ACTIVATE_CHOICES":return a.map(function(a){var c=a;return c.active=b.active,c});case"CLEAR_CHOICES":return x;default:return a}},general:z}),K=function(a,b){var c=a;if("CLEAR_ALL"===b.type)c=void 0;else if("RESET_TO"===b.type)return H(b.state);return J(c,b)},L=function(){function a(){this._store=e(K,window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__())}var b,c,d,f=a.prototype;return f.subscribe=function(a){this._store.subscribe(a)},f.dispatch=function(a){this._store.dispatch(a)},f.isLoading=function(){return this.state.general.loading},f.getChoiceById=function(a){return this.activeChoices.find(function(b){return b.id===parseInt(a,10)})},f.getGroupById=function(a){return this.groups.find(function(b){return b.id===a})},b=a,(c=[{key:"state",get:function(){return this._store.getState()}},{key:"items",get:function(){return this.state.items}},{key:"activeItems",get:function(){return this.items.filter(function(a){return!0===a.active})}},{key:"highlightedActiveItems",get:function(){return this.items.filter(function(a){return a.active&&a.highlighted})}},{key:"choices",get:function(){return this.state.choices}},{key:"activeChoices",get:function(){return this.choices.filter(function(a){return!0===a.active})}},{key:"selectableChoices",get:function(){return this.choices.filter(function(a){return!0!==a.disabled})}},{key:"searchableChoices",get:function(){return this.selectableChoices.filter(function(a){return!0!==a.placeholder})}},{key:"placeholderChoice",get:function(){return[].concat(this.choices).reverse().find(function(a){return!0===a.placeholder})}},{key:"groups",get:function(){return this.state.groups}},{key:"activeGroups",get:function(){var a=this.groups,b=this.choices;return a.filter(function(a){var c=!0===a.active&&!1===a.disabled,d=b.some(function(a){return!0===a.active&&!1===a.disabled});return c&&d},[])}}])&&g(b.prototype,c),d&&g(b,d),a}(),M=function(){function a(a){var b=a.element,c=a.type,d=a.classNames;this.element=b,this.classNames=d,this.type=c,this.isActive=!1}var b,c,d,e=a.prototype;return e.getChild=function(a){return this.element.querySelector(a)},e.show=function(){return this.element.classList.add(this.classNames.activeState),this.element.setAttribute("aria-expanded","true"),this.isActive=!0,this},e.hide=function(){return this.element.classList.remove(this.classNames.activeState),this.element.setAttribute("aria-expanded","false"),this.isActive=!1,this},b=a,(c=[{key:"distanceFromTopWindow",get:function(){return this.element.getBoundingClientRect().bottom}}])&&h(b.prototype,c),d&&h(b,d),a}(),N={items:[],choices:[],silent:!1,renderChoiceLimit:-1,maxItemCount:-1,addItems:!0,addItemFilter:null,removeItems:!0,removeItemButton:!1,editItems:!1,duplicateItemsAllowed:!0,delimiter:",",paste:!0,searchEnabled:!0,searchChoices:!0,searchFloor:1,searchResultLimit:4,searchFields:["label","value"],position:"auto",resetScrollPosition:!0,shouldSort:!0,shouldSortItems:!1,sorter:function(a,b){var c=a.value,d=a.label,e=void 0===d?c:d,f=b.value,g=b.label,h=void 0===g?f:g;return e.localeCompare(h,[],{sensitivity:"base",ignorePunctuation:!0,numeric:!0})},placeholder:!0,placeholderValue:null,searchPlaceholderValue:null,prependValue:null,appendValue:null,renderSelectedChoices:"auto",loadingText:"Loading...",noResultsText:"No results found",noChoicesText:"No choices to choose from",itemSelectText:"Press to select",uniqueItemText:"Only unique values can be added",customAddItemText:"Only values matching specific conditions can be added",addItemText:function(a){return'Press Enter to add <b>"'+E(a)+'"</b>'},maxItemText:function(a){return"Only "+a+" values can be added"},valueComparer:function(a,b){return a===b},fuseOptions:{includeScore:!0},callbackOnInit:null,callbackOnCreateTemplates:null,classNames:{containerOuter:"choices",containerInner:"choices__inner",input:"choices__input",inputCloned:"choices__input--cloned",list:"choices__list",listItems:"choices__list--multiple",listSingle:"choices__list--single",listDropdown:"choices__list--dropdown", 2 2 item:"choices__item",itemSelectable:"choices__item--selectable",itemDisabled:"choices__item--disabled",itemChoice:"choices__item--choice",placeholder:"choices__placeholder",group:"choices__group",groupHeading:"choices__heading",button:"choices__button",activeState:"is-active",focusState:"is-focused",openState:"is-open",disabledState:"is-disabled",highlightedState:"is-highlighted",selectedState:"is-selected",flippedState:"is-flipped",loadingState:"is-loading",noResults:"has-no-results",noChoices:"has-no-choices"}},O="showDropdown",P="hideDropdown",Q="change",R="choice",S="search",T="addItem",U="removeItem",V="highlightItem",W="highlightChoice",X="ADD_CHOICE",Y="FILTER_CHOICES",Z="ACTIVATE_CHOICES",$="CLEAR_CHOICES",_="ADD_GROUP",aa="ADD_ITEM",ba="REMOVE_ITEM",ca="HIGHLIGHT_ITEM",da=46,ea=8,fa=13,ga=65,ha=27,ia=38,ja=40,ka=33,la=34,ma="text",na="select-one",oa="select-multiple",pa=function(){function a(a){var b=a.element,c=a.type,d=a.classNames,e=a.position;this.element=b,this.classNames=d,this.type=c,this.position=e,this.isOpen=!1,this.isFlipped=!1,this.isFocussed=!1,this.isDisabled=!1,this.isLoading=!1,this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this)}var b=a.prototype;return b.addEventListeners=function(){this.element.addEventListener("focus",this._onFocus),this.element.addEventListener("blur",this._onBlur)},b.removeEventListeners=function(){this.element.removeEventListener("focus",this._onFocus),this.element.removeEventListener("blur",this._onBlur)},b.shouldFlip=function(a){if("number"!=typeof a)return!1;var b=!1;return"auto"===this.position?b=!window.matchMedia("(min-height: "+(a+1)+"px)").matches:"top"===this.position&&(b=!0),b},b.setActiveDescendant=function(a){this.element.setAttribute("aria-activedescendant",a)},b.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},b.open=function(a){this.element.classList.add(this.classNames.openState),this.element.setAttribute("aria-expanded","true"),this.isOpen=!0,this.shouldFlip(a)&&(this.element.classList.add(this.classNames.flippedState),this.isFlipped=!0)},b.close=function(){this.element.classList.remove(this.classNames.openState),this.element.setAttribute("aria-expanded","false"),this.removeActiveDescendant(),this.isOpen=!1,this.isFlipped&&(this.element.classList.remove(this.classNames.flippedState),this.isFlipped=!1)},b.focus=function(){this.isFocussed||this.element.focus()},b.addFocusState=function(){this.element.classList.add(this.classNames.focusState)},b.removeFocusState=function(){this.element.classList.remove(this.classNames.focusState)},b.enable=function(){this.element.classList.remove(this.classNames.disabledState),this.element.removeAttribute("aria-disabled"),this.type===na&&this.element.setAttribute("tabindex","0"),this.isDisabled=!1},b.disable=function(){this.element.classList.add(this.classNames.disabledState),this.element.setAttribute("aria-disabled","true"),this.type===na&&this.element.setAttribute("tabindex","-1"),this.isDisabled=!0},b.wrap=function(a){!function(a,b){void 0===b&&(b=document.createElement("div")),a.nextSibling?a.parentNode.insertBefore(b,a.nextSibling):a.parentNode.appendChild(b),b.appendChild(a)}(a,this.element)},b.unwrap=function(a){this.element.parentNode.insertBefore(a,this.element),this.element.parentNode.removeChild(this.element)},b.addLoadingState=function(){this.element.classList.add(this.classNames.loadingState),this.element.setAttribute("aria-busy","true"),this.isLoading=!0},b.removeLoadingState=function(){this.element.classList.remove(this.classNames.loadingState),this.element.removeAttribute("aria-busy"),this.isLoading=!1},b._onFocus=function(){this.isFocussed=!0},b._onBlur=function(){this.isFocussed=!1},a}(),qa=function(){function a(a){var b=a.element,c=a.type,d=a.classNames,e=a.preventPaste;this.element=b,this.type=c,this.classNames=d,this.preventPaste=e,this.isFocussed=this.element===document.activeElement,this.isDisabled=b.disabled,this._onPaste=this._onPaste.bind(this),this._onInput=this._onInput.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this)}var b,c,d,e=a.prototype;return e.addEventListeners=function(){this.element.addEventListener("paste",this._onPaste),this.element.addEventListener("input",this._onInput,{passive:!0}),this.element.addEventListener("focus",this._onFocus,{passive:!0}),this.element.addEventListener("blur",this._onBlur,{passive:!0})},e.removeEventListeners=function(){this.element.removeEventListener("input",this._onInput,{passive:!0}),this.element.removeEventListener("paste",this._onPaste),this.element.removeEventListener("focus",this._onFocus,{passive:!0}),this.element.removeEventListener("blur",this._onBlur,{passive:!0})},e.enable=function(){this.element.removeAttribute("disabled"),this.isDisabled=!1},e.disable=function(){this.element.setAttribute("disabled",""),this.isDisabled=!0},e.focus=function(){this.isFocussed||this.element.focus()},e.blur=function(){this.isFocussed&&this.element.blur()},e.clear=function(a){return void 0===a&&(a=!0),this.element.value&&(this.element.value=""),a&&this.setWidth(),this},e.setWidth=function(){var a=this.element,b=a.style,c=a.value,d=a.placeholder;b.minWidth=d.length+1+"ch",b.width=c.length+1+"ch"},e.setActiveDescendant=function(a){this.element.setAttribute("aria-activedescendant",a)},e.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},e._onInput=function(){this.type!==na&&this.setWidth()},e._onPaste=function(a){this.preventPaste&&a.preventDefault()},e._onFocus=function(){this.isFocussed=!0},e._onBlur=function(){this.isFocussed=!1},b=a,(c=[{key:"placeholder",set:function(a){this.element.placeholder=a}},{key:"value",get:function(){return E(this.element.value)},set:function(a){this.element.value=a}}])&&i(b.prototype,c),d&&i(b,d),a}(),ra=function(){function a(a){var b=a.element;this.element=b,this.scrollPos=this.element.scrollTop,this.height=this.element.offsetHeight}var b=a.prototype;return b.clear=function(){this.element.innerHTML=""},b.append=function(a){this.element.appendChild(a)},b.getChild=function(a){return this.element.querySelector(a)},b.hasChildren=function(){return this.element.hasChildNodes()},b.scrollToTop=function(){this.element.scrollTop=0},b.scrollToChildElement=function(a,b){var c=this;if(a){var d=this.element.offsetHeight,e=this.element.scrollTop+d,f=a.offsetHeight,g=a.offsetTop+f,h=b>0?this.element.scrollTop+g-e:a.offsetTop;requestAnimationFrame(function(){c._animateScroll(h,b)})}},b._scrollDown=function(a,b,c){var d=(c-a)/b,e=d>1?d:1;this.element.scrollTop=a+e},b._scrollUp=function(a,b,c){var d=(a-c)/b,e=d>1?d:1;this.element.scrollTop=a-e},b._animateScroll=function(a,b){var c=this,d=this.element.scrollTop,e=!1;b>0?(this._scrollDown(d,4,a),d<a&&(e=!0)):(this._scrollUp(d,4,a),d>a&&(e=!0)),e&&requestAnimationFrame(function(){c._animateScroll(a,b)})},a}(),sa=function(){function a(a){var b=a.element,c=a.classNames;if(this.element=b,this.classNames=c,!(b instanceof HTMLInputElement||b instanceof HTMLSelectElement))throw new TypeError("Invalid element passed");this.isDisabled=!1}var b,c,d,e=a.prototype;return e.conceal=function(){this.element.classList.add(this.classNames.input),this.element.hidden=!0,this.element.tabIndex=-1;var a=this.element.getAttribute("style");a&&this.element.setAttribute("data-choice-orig-style",a),this.element.setAttribute("data-choice","active")},e.reveal=function(){this.element.classList.remove(this.classNames.input),this.element.hidden=!1,this.element.removeAttribute("tabindex");var a=this.element.getAttribute("data-choice-orig-style");a?(this.element.removeAttribute("data-choice-orig-style"),this.element.setAttribute("style",a)):this.element.removeAttribute("style"),this.element.removeAttribute("data-choice"),this.element.value=this.element.value},e.enable=function(){this.element.removeAttribute("disabled"),this.element.disabled=!1,this.isDisabled=!1},e.disable=function(){this.element.setAttribute("disabled",""),this.element.disabled=!0,this.isDisabled=!0},e.triggerEvent=function(a,b){!function(a,b,c){void 0===c&&(c=null);var d=new CustomEvent(b,{detail:c,bubbles:!0,cancelable:!0});a.dispatchEvent(d)}(this.element,a,b)},b=a,(c=[{key:"isActive",get:function(){return"active"===this.element.dataset.choice}},{key:"dir",get:function(){return this.element.dir}},{key:"value",get:function(){return this.element.value},set:function(a){this.element.value=a}}])&&j(b.prototype,c),d&&j(b,d),a}(),ta=function(a){function b(b){var c,d=b.element,e=b.classNames,f=b.delimiter;return(c=a.call(this,{element:d,classNames:e})||this).delimiter=f,c}var c,d,e,f,g;return d=a,(c=b).prototype=Object.create(d.prototype),c.prototype.constructor=c,c.__proto__=d,e=b,(f=[{key:"value",get:function(){return this.element.value},set:function(a){var b=a.map(function(a){return a.value}).join(this.delimiter);this.element.setAttribute("value",b),this.element.value=b}}])&&k(e.prototype,f),g&&k(e,g),b}(sa),ua=function(a){function b(b){var c,d=b.element,e=b.classNames,f=b.template;return(c=a.call(this,{element:d,classNames:e})||this).template=f,c}var c,d,e,f,g;return d=a,(c=b).prototype=Object.create(d.prototype),c.prototype.constructor=c,c.__proto__=d,b.prototype.appendDocFragment=function(a){this.element.innerHTML="",this.element.appendChild(a)},e=b,(f=[{key:"placeholderOption",get:function(){return this.element.querySelector('option[value=""]')||this.element.querySelector("option[placeholder]")}},{key:"optionGroups",get:function(){return Array.from(this.element.getElementsByTagName("OPTGROUP"))}},{key:"options",get:function(){return Array.from(this.element.options)},set:function(a){var b=this,c=document.createDocumentFragment();a.forEach(function(a){return d=a,e=b.template(d),void c.appendChild(e);var d,e}),this.appendDocFragment(c)}}])&&l(e.prototype,f),g&&l(e,g),b}(sa),va={containerOuter:function(a,b,c,d,e,f){var g=a.containerOuter,h=Object.assign(document.createElement("div"),{className:g});return h.dataset.type=f,b&&(h.dir=b),d&&(h.tabIndex=0),c&&(h.setAttribute("role",e?"combobox":"listbox"),e&&h.setAttribute("aria-autocomplete","list")),h.setAttribute("aria-haspopup","true"),h.setAttribute("aria-expanded","false"),h},containerInner:function(a){var b=a.containerInner;return Object.assign(document.createElement("div"),{className:b})},itemList:function(a,b){var c=a.list,d=a.listSingle,e=a.listItems;return Object.assign(document.createElement("div"),{className:c+" "+(b?d:e)})},placeholder:function(a,b){var c=a.placeholder;return Object.assign(document.createElement("div"),{className:c,innerHTML:b})},item:function(a,b,c){var d=a.item,e=a.button,f=a.highlightedState,g=a.itemSelectable,h=a.placeholder,i=b.id,j=b.value,k=b.label,l=b.customProperties,m=b.active,n=b.disabled,o=b.highlighted,p=b.placeholder,q=Object.assign(document.createElement("div"),{className:d,innerHTML:k});if(Object.assign(q.dataset,{item:"",id:i,value:j,customProperties:l}),m&&q.setAttribute("aria-selected","true"),n&&q.setAttribute("aria-disabled","true"),p&&q.classList.add(h),q.classList.add(o?f:g),c){n&&q.classList.remove(g),q.dataset.deletable="";var r=Object.assign(document.createElement("button"),{type:"button",className:e,innerHTML:"Remove item"});r.setAttribute("aria-label","Remove item: '"+j+"'"),r.dataset.button="",q.appendChild(r)}return q},choiceList:function(a,b){var c=a.list,d=Object.assign(document.createElement("div"),{className:c});return b||d.setAttribute("aria-multiselectable","true"),d.setAttribute("role","listbox"),d},choiceGroup:function(a,b){var c=a.group,d=a.groupHeading,e=a.itemDisabled,f=b.id,g=b.value,h=b.disabled,i=Object.assign(document.createElement("div"),{className:c+" "+(h?e:"")});return i.setAttribute("role","group"),Object.assign(i.dataset,{group:"",id:f,value:g}),h&&i.setAttribute("aria-disabled","true"),i.appendChild(Object.assign(document.createElement("div"),{className:d,innerHTML:g})),i},choice:function(a,b,c){var d=a.item,e=a.itemChoice,f=a.itemSelectable,g=a.selectedState,h=a.itemDisabled,i=a.placeholder,j=b.id,k=b.value,l=b.label,m=b.groupId,n=b.elementId,o=b.disabled,p=b.selected,q=b.placeholder,r=Object.assign(document.createElement("div"),{id:n,innerHTML:l,className:d+" "+e});return p&&r.classList.add(g),q&&r.classList.add(i),r.setAttribute("role",m>0?"treeitem":"option"),Object.assign(r.dataset,{choice:"",id:j,value:k,selectText:c}),o?(r.classList.add(h),r.dataset.choiceDisabled="",r.setAttribute("aria-disabled","true")):(r.classList.add(f),r.dataset.choiceSelectable=""),r},input:function(a,b){var c=a.input,d=a.inputCloned,e=Object.assign(document.createElement("input"),{type:"text",className:c+" "+d,autocomplete:"off",autocapitalize:"off",spellcheck:!1});return e.setAttribute("role","textbox"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-label",b),e},dropdown:function(a){var b=a.list,c=a.listDropdown,d=document.createElement("div");return d.classList.add(b,c),d.setAttribute("aria-expanded","false"),d},notice:function(a,b,c){var d=a.item,e=a.itemChoice,f=a.noResults,g=a.noChoices;void 0===c&&(c="");var h=[d,e];return"no-choices"===c?h.push(g):"no-results"===c&&h.push(f),Object.assign(document.createElement("div"),{innerHTML:b,className:h.join(" ")})},option:function(a){var b=a.label,c=a.value,d=a.customProperties,e=a.active,f=a.disabled,g=new Option(b,c,!1,e);return d&&(g.dataset.customProperties=d),g.disabled=f,g}},wa=function(a){return void 0===a&&(a=!0),{type:Z,active:a}},xa=function(a,b){return{type:ca,id:a,highlighted:b}},ya=function(a){var b=a.value,c=a.id,d=a.active,e=a.disabled;return{type:_,value:b,id:c,active:d,disabled:e}},za=function(a){return{type:"SET_IS_LOADING",isLoading:a}},Aa="-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style,Ba={},Ca=function(){function a(b,c){var d=this;void 0===b&&(b="[data-choice]"),void 0===c&&(c={}),this.config=r.a.all([N,a.defaults.options,c],{arrayMerge:function(a,b){return[].concat(b)}});var e=I(this.config,N);e.length&&console.warn("Unknown config option(s) passed",e.join(", "));var f="string"==typeof b?document.querySelector(b):b;if(!(f instanceof HTMLInputElement||f instanceof HTMLSelectElement))throw TypeError("Expected one of the following types text|select-one|select-multiple");if(this._isTextElement=f.type===ma,this._isSelectOneElement=f.type===na,this._isSelectMultipleElement=f.type===oa,this._isSelectElement=this._isSelectOneElement||this._isSelectMultipleElement,this.config.searchEnabled=this._isSelectMultipleElement||this.config.searchEnabled,["auto","always"].includes(this.config.renderSelectedChoices)||(this.config.renderSelectedChoices="auto"),c.addItemFilter&&"function"!=typeof c.addItemFilter){var g=c.addItemFilter instanceof RegExp?c.addItemFilter:new RegExp(c.addItemFilter);this.config.addItemFilter=g.test.bind(g)}if(this._isTextElement?this.passedElement=new ta({element:f,classNames:this.config.classNames,delimiter:this.config.delimiter}):this.passedElement=new ua({element:f,classNames:this.config.classNames,template:function(a){return d._templates.option(a)}}),this.initialised=!1,this._store=new L,this._initialState={},this._currentState={},this._prevState={},this._currentValue="",this._canSearch=this.config.searchEnabled,this._isScrollingOnIe=!1,this._highlightPosition=0,this._wasTap=!0,this._placeholderValue=this._generatePlaceholderValue(),this._baseId=B(this.passedElement.element,"choices-"),this._direction=this.passedElement.dir,!this._direction){var h=window.getComputedStyle(this.passedElement.element).direction;h!==window.getComputedStyle(document.documentElement).direction&&(this._direction=h)}if(this._idNames={itemChoice:"item-choice"},this._presetGroups=this.passedElement.optionGroups,this._presetOptions=this.passedElement.options,this._presetChoices=this.config.choices,this._presetItems=this.config.items,this.passedElement.value&&(this._presetItems=this._presetItems.concat(this.passedElement.value.split(this.config.delimiter))),this.passedElement.options&&this.passedElement.options.forEach(function(a){d._presetChoices.push({value:a.value,label:a.innerHTML,selected:a.selected,disabled:a.disabled||a.parentNode.disabled,placeholder:""===a.value||a.hasAttribute("placeholder"),customProperties:a.getAttribute("data-custom-properties")})}),this._render=this._render.bind(this),this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this),this._onKeyUp=this._onKeyUp.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onClick=this._onClick.bind(this),this._onTouchMove=this._onTouchMove.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onMouseDown=this._onMouseDown.bind(this),this._onMouseOver=this._onMouseOver.bind(this),this._onFormReset=this._onFormReset.bind(this),this._onAKey=this._onAKey.bind(this),this._onEnterKey=this._onEnterKey.bind(this),this._onEscapeKey=this._onEscapeKey.bind(this),this._onDirectionKey=this._onDirectionKey.bind(this),this._onDeleteKey=this._onDeleteKey.bind(this),this.passedElement.isActive)return this.config.silent||console.warn("Trying to initialise Choices on element already initialised"),void(this.initialised=!0);this.init()}var b,c,d;b=a,d=[{key:"defaults",get:function(){return Object.preventExtensions({get options(){return Ba},get templates(){return va}})}}],(c=null)&&m(b.prototype,c),d&&m(b,d);var e=a.prototype;return e.init=function(){if(!this.initialised){this._createTemplates(),this._createElements(),this._createStructure(),this._initialState=H(this._store.state),this._store.subscribe(this._render),this._render(),this._addEventListeners(),(!this.config.addItems||this.passedElement.element.hasAttribute("disabled"))&&this.disable(),this.initialised=!0;var a=this.config.callbackOnInit;a&&"function"==typeof a&&a.call(this)}},e.destroy=function(){this.initialised&&(this._removeEventListeners(),this.passedElement.reveal(),this.containerOuter.unwrap(this.passedElement.element),this.clearStore(),this._isSelectElement&&(this.passedElement.options=this._presetOptions),this._templates=null,this.initialised=!1)},e.enable=function(){return this.passedElement.isDisabled&&this.passedElement.enable(),this.containerOuter.isDisabled&&(this._addEventListeners(),this.input.enable(),this.containerOuter.enable()),this},e.disable=function(){return this.passedElement.isDisabled||this.passedElement.disable(),this.containerOuter.isDisabled||(this._removeEventListeners(),this.input.disable(),this.containerOuter.disable()),this},e.highlightItem=function(a,b){if(void 0===b&&(b=!0),!a)return this;var c=a.id,d=a.groupId,e=void 0===d?-1:d,f=a.value,g=void 0===f?"":f,h=a.label,i=void 0===h?"":h,j=e>=0?this._store.getGroupById(e):null;return this._store.dispatch(xa(c,!0)),b&&this.passedElement.triggerEvent(V,{id:c,value:g,label:i,groupValue:j&&j.value?j.value:null}),this},e.unhighlightItem=function(a){if(!a)return this;var b=a.id,c=a.groupId,d=void 0===c?-1:c,e=a.value,f=void 0===e?"":e,g=a.label,h=void 0===g?"":g,i=d>=0?this._store.getGroupById(d):null;return this._store.dispatch(xa(b,!1)),this.passedElement.triggerEvent(V,{id:b,value:f,label:h,groupValue:i&&i.value?i.value:null}),this},e.highlightAll=function(){var a=this;return this._store.items.forEach(function(b){return a.highlightItem(b)}),this},e.unhighlightAll=function(){var a=this;return this._store.items.forEach(function(b){return a.unhighlightItem(b)}),this},e.removeActiveItemsByValue=function(a){var b=this;return this._store.activeItems.filter(function(b){return b.value===a}).forEach(function(a){return b._removeItem(a)}),this},e.removeActiveItems=function(a){var b=this;return this._store.activeItems.filter(function(b){return b.id!==a}).forEach(function(a){return b._removeItem(a)}),this},e.removeHighlightedItems=function(a){var b=this;return void 0===a&&(a=!1),this._store.highlightedActiveItems.forEach(function(c){b._removeItem(c),a&&b._triggerChange(c.value)}),this},e.showDropdown=function(a){var b=this;return this.dropdown.isActive?this:(requestAnimationFrame(function(){b.dropdown.show(),b.containerOuter.open(b.dropdown.distanceFromTopWindow),!a&&b._canSearch&&b.input.focus(),b.passedElement.triggerEvent(O,{})}),this)},e.hideDropdown=function(a){var b=this;return this.dropdown.isActive?(requestAnimationFrame(function(){b.dropdown.hide(),b.containerOuter.close(),!a&&b._canSearch&&(b.input.removeActiveDescendant(),b.input.blur()),b.passedElement.triggerEvent(P,{})}),this):this},e.getValue=function(a){void 0===a&&(a=!1);var b=this._store.activeItems.reduce(function(b,c){var d=a?c.value:c;return b.push(d),b},[]);return this._isSelectOneElement?b[0]:b},e.setValue=function(a){var b=this;return this.initialised?(a.forEach(function(a){return b._setChoiceOrItem(a)}),this):this},e.setChoiceByValue=function(a){var b=this;return!this.initialised||this._isTextElement?this:((Array.isArray(a)?a:[a]).forEach(function(a){return b._findAndSelectChoiceByValue(a)}),this)},e.setChoices=function(a,b,c,d){var e=this;if(void 0===a&&(a=[]),void 0===b&&(b="value"),void 0===c&&(c="label"),void 0===d&&(d=!1),!this.initialised)throw new ReferenceError("setChoices was called on a non-initialized instance of Choices");if(!this._isSelectElement)throw new TypeError("setChoices can't be used with INPUT based Choices");if("string"!=typeof b||!b)throw new TypeError("value parameter must be a name of 'value' field in passed objects");if(d&&this.clearChoices(),"function"==typeof a){var f=a(this);if("function"==typeof Promise&&f instanceof Promise)return new Promise(function(a){return requestAnimationFrame(a)}).then(function(){return e._handleLoadingState(!0)}).then(function(){return f}).then(function(a){return e.setChoices(a,b,c,d)}).catch(function(a){e.config.silent||console.error(a)}).then(function(){return e._handleLoadingState(!1)}).then(function(){return e});if(!Array.isArray(f))throw new TypeError(".setChoices first argument function must return either array of choices or Promise, got: "+typeof f);return this.setChoices(f,b,c,!1)}if(!Array.isArray(a))throw new TypeError(".setChoices must be called either with array of choices with a function resulting into Promise of array of choices");return this.containerOuter.removeLoadingState(),this._startLoading(),a.forEach(function(a){a.choices?e._addGroup({id:parseInt(a.id,10)||null,group:a,valueKey:b,labelKey:c}):e._addChoice({value:a[b],label:a[c],isSelected:a.selected,isDisabled:a.disabled,customProperties:a.customProperties,placeholder:a.placeholder})}),this._stopLoading(),this},e.clearChoices=function(){return this._store.dispatch({type:$}),this},e.clearStore=function(){return this._store.dispatch({type:"CLEAR_ALL"}),this},e.clearInput=function(){var a=!this._isSelectOneElement;return this.input.clear(a),!this._isTextElement&&this._canSearch&&(this._isSearching=!1,this._store.dispatch(wa(!0))),this},e._render=function(){if(!this._store.isLoading()){this._currentState=this._store.state;var a=this._currentState.choices!==this._prevState.choices||this._currentState.groups!==this._prevState.groups||this._currentState.items!==this._prevState.items,b=this._isSelectElement,c=this._currentState.items!==this._prevState.items;a&&(b&&this._renderChoices(),c&&this._renderItems(),this._prevState=this._currentState)}},e._renderChoices=function(){var a=this,b=this._store,c=b.activeGroups,d=b.activeChoices,e=document.createDocumentFragment();if(this.choiceList.clear(),this.config.resetScrollPosition&&requestAnimationFrame(function(){return a.choiceList.scrollToTop()}),c.length>=1&&!this._isSearching){var f=d.filter(function(a){return!0===a.placeholder&&-1===a.groupId});f.length>=1&&(e=this._createChoicesFragment(f,e)),e=this._createGroupsFragment(c,d,e)}else d.length>=1&&(e=this._createChoicesFragment(d,e));if(e.childNodes&&e.childNodes.length>0){var g=this._store.activeItems,h=this._canAddItem(g,this.input.value);h.response?(this.choiceList.append(e),this._highlightChoice()):this.choiceList.append(this._getTemplate("notice",h.notice))}else{var i,j;this._isSearching?(j="function"==typeof this.config.noResultsText?this.config.noResultsText():this.config.noResultsText,i=this._getTemplate("notice",j,"no-results")):(j="function"==typeof this.config.noChoicesText?this.config.noChoicesText():this.config.noChoicesText,i=this._getTemplate("notice",j,"no-choices")),this.choiceList.append(i)}},e._renderItems=function(){var a=this._store.activeItems||[];this.itemList.clear();var b=this._createItemsFragment(a);b.childNodes&&this.itemList.append(b)},e._createGroupsFragment=function(a,b,c){var d=this;return void 0===c&&(c=document.createDocumentFragment()),this.config.shouldSort&&a.sort(this.config.sorter),a.forEach(function(a){var e=function(a){return b.filter(function(b){return d._isSelectOneElement?b.groupId===a.id:b.groupId===a.id&&("always"===d.config.renderSelectedChoices||!b.selected)})}(a);if(e.length>=1){var f=d._getTemplate("choiceGroup",a);c.appendChild(f),d._createChoicesFragment(e,c,!0)}}),c},e._createChoicesFragment=function(a,b,c){var d=this;void 0===b&&(b=document.createDocumentFragment()),void 0===c&&(c=!1);var e=this.config,f=e.renderSelectedChoices,g=e.searchResultLimit,h=e.renderChoiceLimit,i=this._isSearching?G:this.config.sorter,j=function(a){if("auto"!==f||d._isSelectOneElement||!a.selected){var c=d._getTemplate("choice",a,d.config.itemSelectText);b.appendChild(c)}},k=a;"auto"!==f||this._isSelectOneElement||(k=a.filter(function(a){return!a.selected}));var l=k.reduce(function(a,b){return b.placeholder?a.placeholderChoices.push(b):a.normalChoices.push(b),a},{placeholderChoices:[],normalChoices:[]}),m=l.placeholderChoices,n=l.normalChoices;(this.config.shouldSort||this._isSearching)&&n.sort(i);var o=k.length,p=this._isSelectOneElement?[].concat(m,n):n;this._isSearching?o=g:h&&h>0&&!c&&(o=h);for(var q=0;q<o;q+=1)p[q]&&j(p[q]);return b},e._createItemsFragment=function(a,b){var c=this;void 0===b&&(b=document.createDocumentFragment());var d=this.config,e=d.shouldSortItems,f=d.sorter,g=d.removeItemButton;return e&&!this._isSelectOneElement&&a.sort(f),this._isTextElement?this.passedElement.value=a:this.passedElement.options=a,a.forEach(function(a){var d=c._getTemplate("item",a,g);b.appendChild(d)}),b},e._triggerChange=function(a){null!=a&&this.passedElement.triggerEvent(Q,{value:a})},e._selectPlaceholderChoice=function(){var a=this._store.placeholderChoice;a&&(this._addItem({value:a.value,label:a.label,choiceId:a.id,groupId:a.groupId,placeholder:a.placeholder}),this._triggerChange(a.value))},e._handleButtonAction=function(a,b){if(a&&b&&this.config.removeItems&&this.config.removeItemButton){var c=b.parentNode.getAttribute("data-id"),d=a.find(function(a){return a.id===parseInt(c,10)});this._removeItem(d),this._triggerChange(d.value),this._isSelectOneElement&&this._selectPlaceholderChoice()}},e._handleItemAction=function(a,b,c){var d=this;if(void 0===c&&(c=!1),a&&b&&this.config.removeItems&&!this._isSelectOneElement){var e=b.getAttribute("data-id");a.forEach(function(a){a.id!==parseInt(e,10)||a.highlighted?!c&&a.highlighted&&d.unhighlightItem(a):d.highlightItem(a)}),this.input.focus()}},e._handleChoiceAction=function(a,b){if(a&&b){var c=b.dataset.id,d=this._store.getChoiceById(c);if(d){var e=a[0]&&a[0].keyCode?a[0].keyCode:null,f=this.dropdown.isActive;d.keyCode=e,this.passedElement.triggerEvent(R,{choice:d}),d.selected||d.disabled||this._canAddItem(a,d.value).response&&(this._addItem({value:d.value,label:d.label,choiceId:d.id,groupId:d.groupId,customProperties:d.customProperties,placeholder:d.placeholder,keyCode:d.keyCode}),this._triggerChange(d.value)),this.clearInput(),f&&this._isSelectOneElement&&(this.hideDropdown(!0),this.containerOuter.focus())}}},e._handleBackspace=function(a){if(this.config.removeItems&&a){var b=a[a.length-1],c=a.some(function(a){return a.highlighted});this.config.editItems&&!c&&b?(this.input.value=b.value,this.input.setWidth(),this._removeItem(b),this._triggerChange(b.value)):(c||this.highlightItem(b,!1),this.removeHighlightedItems(!0))}},e._startLoading=function(){this._store.dispatch(za(!0))},e._stopLoading=function(){this._store.dispatch(za(!1))},e._handleLoadingState=function(a){void 0===a&&(a=!0);var b=this.itemList.getChild("."+this.config.classNames.placeholder);a?(this.disable(),this.containerOuter.addLoadingState(),this._isSelectOneElement?b?b.innerHTML=this.config.loadingText:(b=this._getTemplate("placeholder",this.config.loadingText),this.itemList.append(b)):this.input.placeholder=this.config.loadingText):(this.enable(),this.containerOuter.removeLoadingState(),this._isSelectOneElement?b.innerHTML=this._placeholderValue||"":this.input.placeholder=this._placeholderValue||"")},e._handleSearch=function(a){if(a&&this.input.isFocussed){var b=this._store.choices,c=this.config,d=c.searchFloor,e=c.searchChoices,f=b.some(function(a){return!a.active});if(a&&a.length>=d){var g=e?this._searchChoices(a):0;this.passedElement.triggerEvent(S,{value:a,resultCount:g})}else f&&(this._isSearching=!1,this._store.dispatch(wa(!0)))}},e._canAddItem=function(a,b){var c=!0,d="function"==typeof this.config.addItemText?this.config.addItemText(b):this.config.addItemText;if(!this._isSelectOneElement){var e=function(a,b,c){return void 0===c&&(c="value"),a.some(function(a){return"string"==typeof b?a[c]===b.trim():a[c]===b})}(a,b);this.config.maxItemCount>0&&this.config.maxItemCount<=a.length&&(c=!1,d="function"==typeof this.config.maxItemText?this.config.maxItemText(this.config.maxItemCount):this.config.maxItemText),!this.config.duplicateItemsAllowed&&e&&c&&(c=!1,d="function"==typeof this.config.uniqueItemText?this.config.uniqueItemText(b):this.config.uniqueItemText),this._isTextElement&&this.config.addItems&&c&&"function"==typeof this.config.addItemFilter&&!this.config.addItemFilter(b)&&(c=!1,d="function"==typeof this.config.customAddItemText?this.config.customAddItemText(b):this.config.customAddItemText)}return{response:c,notice:d}},e._searchChoices=function(a){var b="string"==typeof a?a.trim():a,c="string"==typeof this._currentValue?this._currentValue.trim():this._currentValue;if(b.length<1&&b===c+" ")return 0;var d=this._store.searchableChoices,e=b,f=[].concat(this.config.searchFields),g=Object.assign(this.config.fuseOptions,{keys:f}),h=new p.a(d,g).search(e);return this._currentValue=b,this._highlightPosition=0,this._isSearching=!0,this._store.dispatch(function(a){return{type:Y,results:a}}(h)),h.length},e._addEventListeners=function(){var a=document.documentElement;a.addEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.addEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.addEventListener("mousedown",this._onMouseDown,!0),a.addEventListener("click",this._onClick,{passive:!0}),a.addEventListener("touchmove",this._onTouchMove,{passive:!0}),this.dropdown.element.addEventListener("mouseover",this._onMouseOver,{passive:!0}),this._isSelectOneElement&&(this.containerOuter.element.addEventListener("focus",this._onFocus,{passive:!0}),this.containerOuter.element.addEventListener("blur",this._onBlur,{passive:!0})),this.input.element.addEventListener("keyup",this._onKeyUp,{passive:!0}),this.input.element.addEventListener("focus",this._onFocus,{passive:!0}),this.input.element.addEventListener("blur",this._onBlur,{passive:!0}),this.input.element.form&&this.input.element.form.addEventListener("reset",this._onFormReset,{passive:!0}),this.input.addEventListeners()},e._removeEventListeners=function(){var a=document.documentElement;a.removeEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.removeEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.removeEventListener("mousedown",this._onMouseDown,!0),a.removeEventListener("click",this._onClick),a.removeEventListener("touchmove",this._onTouchMove),this.dropdown.element.removeEventListener("mouseover",this._onMouseOver),this._isSelectOneElement&&(this.containerOuter.element.removeEventListener("focus",this._onFocus),this.containerOuter.element.removeEventListener("blur",this._onBlur)), 3 this.input.element.removeEventListener("keyup",this._onKeyUp),this.input.element.removeEventListener("focus",this._onFocus),this.input.element.removeEventListener("blur",this._onBlur),this.input.element.form&&this.input.element.form.removeEventListener("reset",this._onFormReset),this.input.removeEventListeners()},e._onKeyDown=function(a){var b,c=a.target,d=a.keyCode,e=a.ctrlKey,f=a.metaKey,g=this._store.activeItems,h=this.input.isFocussed,i=this.dropdown.isActive,j=this.itemList.hasChildren(),k=String.fromCharCode(d),l=da,m=ea,n=fa,o=ga,p=ha,q=ia,r=ja,s=ka,t=la,u=e||f;!this._isTextElement&&/[a-zA-Z0-9-_ ]/.test(k)&&this.showDropdown();var v=((b={})[o]=this._onAKey,b[n]=this._onEnterKey,b[p]=this._onEscapeKey,b[q]=this._onDirectionKey,b[s]=this._onDirectionKey,b[r]=this._onDirectionKey,b[t]=this._onDirectionKey,b[m]=this._onDeleteKey,b[l]=this._onDeleteKey,b);v[d]&&v[d]({event:a,target:c,keyCode:d,metaKey:f,activeItems:g,hasFocusedInput:h,hasActiveDropdown:i,hasItems:j,hasCtrlDownKeyPressed:u})},e._onKeyUp=function(a){var b=a.target,c=a.keyCode,d=this.input.value,e=this._store.activeItems,f=this._canAddItem(e,d),g=da,h=ea;if(this._isTextElement)if(f.notice&&d){var i=this._getTemplate("notice",f.notice);this.dropdown.element.innerHTML=i.outerHTML,this.showDropdown(!0)}else this.hideDropdown(!0);else{var j=(c===g||c===h)&&!b.value,k=!this._isTextElement&&this._isSearching,l=this._canSearch&&f.response;j&&k?(this._isSearching=!1,this._store.dispatch(wa(!0))):l&&this._handleSearch(this.input.value)}this._canSearch=this.config.searchEnabled},e._onAKey=function(a){var b=a.hasItems;a.hasCtrlDownKeyPressed&&b&&(this._canSearch=!1,this.config.removeItems&&!this.input.value&&this.input.element===document.activeElement&&this.highlightAll())},e._onEnterKey=function(a){var b=a.event,c=a.target,d=a.activeItems,e=a.hasActiveDropdown,f=fa,g=c.hasAttribute("data-button");if(this._isTextElement&&c.value){var h=this.input.value;this._canAddItem(d,h).response&&(this.hideDropdown(!0),this._addItem({value:h}),this._triggerChange(h),this.clearInput())}if(g&&(this._handleButtonAction(d,c),b.preventDefault()),e){var i=this.dropdown.getChild("."+this.config.classNames.highlightedState);i&&(d[0]&&(d[0].keyCode=f),this._handleChoiceAction(d,i)),b.preventDefault()}else this._isSelectOneElement&&(this.showDropdown(),b.preventDefault())},e._onEscapeKey=function(a){a.hasActiveDropdown&&(this.hideDropdown(!0),this.containerOuter.focus())},e._onDirectionKey=function(a){var b,c,d,e=a.event,f=a.hasActiveDropdown,g=a.keyCode,h=a.metaKey,i=ja,j=ka,k=la;if(f||this._isSelectOneElement){this.showDropdown(),this._canSearch=!1;var l,m=g===i||g===k?1:-1;if(h||g===k||g===j)l=m>0?this.dropdown.element.querySelector("[data-choice-selectable]:last-of-type"):this.dropdown.element.querySelector("[data-choice-selectable]");else{var n=this.dropdown.element.querySelector("."+this.config.classNames.highlightedState);l=n?function(a,b,c){if(void 0===c&&(c=1),a instanceof Element&&"string"==typeof b){for(var d=(c>0?"next":"previous")+"ElementSibling",e=a[d];e;){if(e.matches(b))return e;e=e[d]}return e}}(n,"[data-choice-selectable]",m):this.dropdown.element.querySelector("[data-choice-selectable]")}l&&(b=l,c=this.choiceList.element,void 0===(d=m)&&(d=1),b&&(d>0?c.scrollTop+c.offsetHeight>=b.offsetTop+b.offsetHeight:b.offsetTop>=c.scrollTop)||this.choiceList.scrollToChildElement(l,m),this._highlightChoice(l)),e.preventDefault()}},e._onDeleteKey=function(a){var b=a.event,c=a.target,d=a.hasFocusedInput,e=a.activeItems;!d||c.value||this._isSelectOneElement||(this._handleBackspace(e),b.preventDefault())},e._onTouchMove=function(){this._wasTap&&(this._wasTap=!1)},e._onTouchEnd=function(a){var b=(a||a.touches[0]).target;this._wasTap&&this.containerOuter.element.contains(b)&&((b===this.containerOuter.element||b===this.containerInner.element)&&(this._isTextElement?this.input.focus():this._isSelectMultipleElement&&this.showDropdown()),a.stopPropagation()),this._wasTap=!0},e._onMouseDown=function(a){var b=a.target;if(b instanceof HTMLElement){if(Aa&&this.choiceList.element.contains(b)){var c=this.choiceList.element.firstElementChild,d="ltr"===this._direction?a.offsetX>=c.offsetWidth:a.offsetX<c.offsetLeft;this._isScrollingOnIe=d}if(b!==this.input.element){var e=b.closest("[data-button],[data-item],[data-choice]");if(e instanceof HTMLElement){var f=a.shiftKey,g=this._store.activeItems,h=e.dataset;"button"in h?this._handleButtonAction(g,e):"item"in h?this._handleItemAction(g,e,f):"choice"in h&&this._handleChoiceAction(g,e)}a.preventDefault()}}},e._onMouseOver=function(a){var b=a.target;b instanceof HTMLElement&&"choice"in b.dataset&&this._highlightChoice(b)},e._onClick=function(a){var b=a.target;this.containerOuter.element.contains(b)?this.dropdown.isActive||this.containerOuter.isDisabled?this._isSelectOneElement&&b!==this.input.element&&!this.dropdown.element.contains(b)&&this.hideDropdown():this._isTextElement?document.activeElement!==this.input.element&&this.input.focus():(this.showDropdown(),this.containerOuter.focus()):(this._store.highlightedActiveItems.length>0&&this.unhighlightAll(),this.containerOuter.removeFocusState(),this.hideDropdown(!0))},e._onFocus=function(a){var b,c=this,d=a.target;this.containerOuter.element.contains(d)&&((b={})[ma]=function(){d===c.input.element&&c.containerOuter.addFocusState()},b[na]=function(){c.containerOuter.addFocusState(),d===c.input.element&&c.showDropdown(!0)},b[oa]=function(){d===c.input.element&&(c.showDropdown(!0),c.containerOuter.addFocusState())},b)[this.passedElement.element.type]()},e._onBlur=function(a){var b=this,c=a.target;if(this.containerOuter.element.contains(c)&&!this._isScrollingOnIe){var d,e=this._store.activeItems.some(function(a){return a.highlighted});((d={})[ma]=function(){c===b.input.element&&(b.containerOuter.removeFocusState(),e&&b.unhighlightAll(),b.hideDropdown(!0))},d[na]=function(){b.containerOuter.removeFocusState(),(c===b.input.element||c===b.containerOuter.element&&!b._canSearch)&&b.hideDropdown(!0)},d[oa]=function(){c===b.input.element&&(b.containerOuter.removeFocusState(),b.hideDropdown(!0),e&&b.unhighlightAll())},d)[this.passedElement.element.type]()}else this._isScrollingOnIe=!1,this.input.element.focus()},e._onFormReset=function(){this._store.dispatch({type:"RESET_TO",state:this._initialState})},e._highlightChoice=function(a){var b=this;void 0===a&&(a=null);var c=Array.from(this.dropdown.element.querySelectorAll("[data-choice-selectable]"));if(c.length){var d=a;Array.from(this.dropdown.element.querySelectorAll("."+this.config.classNames.highlightedState)).forEach(function(a){a.classList.remove(b.config.classNames.highlightedState),a.setAttribute("aria-selected","false")}),d?this._highlightPosition=c.indexOf(d):(d=c.length>this._highlightPosition?c[this._highlightPosition]:c[c.length-1])||(d=c[0]),d.classList.add(this.config.classNames.highlightedState),d.setAttribute("aria-selected","true"),this.passedElement.triggerEvent(W,{el:d}),this.dropdown.isActive&&(this.input.setActiveDescendant(d.id),this.containerOuter.setActiveDescendant(d.id))}},e._addItem=function(a){var b=a.value,c=a.label,d=void 0===c?null:c,e=a.choiceId,f=void 0===e?-1:e,g=a.groupId,h=void 0===g?-1:g,i=a.customProperties,j=void 0===i?null:i,k=a.placeholder,l=void 0!==k&&k,m=a.keyCode,n=void 0===m?null:m,o="string"==typeof b?b.trim():b,p=n,q=j,r=this._store.items,s=d||o,t=f||-1,u=h>=0?this._store.getGroupById(h):null,v=r?r.length+1:1;return this.config.prependValue&&(o=this.config.prependValue+o.toString()),this.config.appendValue&&(o+=this.config.appendValue.toString()),this._store.dispatch(function(a){var b=a.value,c=a.label,d=a.id,e=a.choiceId,f=a.groupId,g=a.customProperties,h=a.placeholder,i=a.keyCode;return{type:aa,value:b,label:c,id:d,choiceId:e,groupId:f,customProperties:g,placeholder:h,keyCode:i}}({value:o,label:s,id:v,choiceId:t,groupId:h,customProperties:j,placeholder:l,keyCode:p})),this._isSelectOneElement&&this.removeActiveItems(v),this.passedElement.triggerEvent(T,{id:v,value:o,label:s,customProperties:q,groupValue:u&&u.value?u.value:void 0,keyCode:p}),this},e._removeItem=function(a){if(!a||!D("Object",a))return this;var b=a.id,c=a.value,d=a.label,e=a.choiceId,f=a.groupId,g=f>=0?this._store.getGroupById(f):null;return this._store.dispatch(function(a,b){return{type:ba,id:a,choiceId:b}}(b,e)),g&&g.value?this.passedElement.triggerEvent(U,{id:b,value:c,label:d,groupValue:g.value}):this.passedElement.triggerEvent(U,{id:b,value:c,label:d}),this},e._addChoice=function(a){var b=a.value,c=a.label,d=void 0===c?null:c,e=a.isSelected,f=void 0!==e&&e,g=a.isDisabled,h=void 0!==g&&g,i=a.groupId,j=void 0===i?-1:i,k=a.customProperties,l=void 0===k?null:k,m=a.placeholder,n=void 0!==m&&m,o=a.keyCode,p=void 0===o?null:o;if(null!=b){var q=this._store.choices,r=d||b,s=q?q.length+1:1,t=this._baseId+"-"+this._idNames.itemChoice+"-"+s;this._store.dispatch(function(a){var b=a.value,c=a.label,d=a.id,e=a.groupId,f=a.disabled,g=a.elementId,h=a.customProperties,i=a.placeholder,j=a.keyCode;return{type:X,value:b,label:c,id:d,groupId:e,disabled:f,elementId:g,customProperties:h,placeholder:i,keyCode:j}}({id:s,groupId:j,elementId:t,value:b,label:r,disabled:h,customProperties:l,placeholder:n,keyCode:p})),f&&this._addItem({value:b,label:r,choiceId:s,customProperties:l,placeholder:n,keyCode:p})}},e._addGroup=function(a){var b=this,c=a.group,d=a.id,e=a.valueKey,f=void 0===e?"value":e,g=a.labelKey,h=void 0===g?"label":g,i=D("Object",c)?c.choices:Array.from(c.getElementsByTagName("OPTION")),j=d||Math.floor((new Date).valueOf()*Math.random()),k=!!c.disabled&&c.disabled;i?(this._store.dispatch(ya({value:c.label,id:j,active:!0,disabled:k})),i.forEach(function(a){var c=a.disabled||a.parentNode&&a.parentNode.disabled;b._addChoice({value:a[f],label:D("Object",a)?a[h]:a.innerHTML,isSelected:a.selected,isDisabled:c,groupId:j,customProperties:a.customProperties,placeholder:a.placeholder})})):this._store.dispatch(ya({value:c.label,id:c.id,active:!1,disabled:c.disabled}))},e._getTemplate=function(a){var b;if(!a)return null;for(var c=this.config.classNames,d=arguments.length,e=new Array(d>1?d-1:0),f=1;f<d;f++)e[f-1]=arguments[f];return(b=this._templates[a]).call.apply(b,[this,c].concat(e))},e._createTemplates=function(){var a=this.config.callbackOnCreateTemplates,b={};a&&"function"==typeof a&&(b=a.call(this,F)),this._templates=r()(va,b)},e._createElements=function(){this.containerOuter=new pa({element:this._getTemplate("containerOuter",this._direction,this._isSelectElement,this._isSelectOneElement,this.config.searchEnabled,this.passedElement.element.type),classNames:this.config.classNames,type:this.passedElement.element.type,position:this.config.position}),this.containerInner=new pa({element:this._getTemplate("containerInner"),classNames:this.config.classNames,type:this.passedElement.element.type,position:this.config.position}),this.input=new qa({element:this._getTemplate("input",this._placeholderValue),classNames:this.config.classNames,type:this.passedElement.element.type,preventPaste:!this.config.paste}),this.choiceList=new ra({element:this._getTemplate("choiceList",this._isSelectOneElement)}),this.itemList=new ra({element:this._getTemplate("itemList",this._isSelectOneElement)}),this.dropdown=new M({element:this._getTemplate("dropdown"),classNames:this.config.classNames,type:this.passedElement.element.type})},e._createStructure=function(){this.passedElement.conceal(),this.containerInner.wrap(this.passedElement.element),this.containerOuter.wrap(this.containerInner.element),this._isSelectOneElement?this.input.placeholder=this.config.searchPlaceholderValue||"":this._placeholderValue&&(this.input.placeholder=this._placeholderValue,this.input.setWidth()),this.containerOuter.element.appendChild(this.containerInner.element),this.containerOuter.element.appendChild(this.dropdown.element),this.containerInner.element.appendChild(this.itemList.element),this._isTextElement||this.dropdown.element.appendChild(this.choiceList.element),this._isSelectOneElement?this.config.searchEnabled&&this.dropdown.element.insertBefore(this.input.element,this.dropdown.element.firstChild):this.containerInner.element.appendChild(this.input.element),this._isSelectElement&&(this._highlightPosition=0,this._isSearching=!1,this._startLoading(),this._presetGroups.length?this._addPredefinedGroups(this._presetGroups):this._addPredefinedChoices(this._presetChoices),this._stopLoading()),this._isTextElement&&this._addPredefinedItems(this._presetItems)},e._addPredefinedGroups=function(a){var b=this,c=this.passedElement.placeholderOption;c&&"SELECT"===c.parentNode.tagName&&this._addChoice({value:c.value,label:c.innerHTML,isSelected:c.selected,isDisabled:c.disabled,placeholder:!0}),a.forEach(function(a){return b._addGroup({group:a,id:a.id||null})})},e._addPredefinedChoices=function(a){var b=this;this.config.shouldSort&&a.sort(this.config.sorter);var c=a.some(function(a){return a.selected}),d=a.findIndex(function(a){return void 0===a.disabled||!a.disabled});a.forEach(function(a,e){var f=a.value,g=a.label,h=a.customProperties,i=a.placeholder;if(b._isSelectElement)if(a.choices)b._addGroup({group:a,id:a.id||null});else{var j=!(!b._isSelectOneElement||c||e!==d)||a.selected,k=a.disabled;b._addChoice({value:f,label:g,isSelected:j,isDisabled:k,customProperties:h,placeholder:i})}else b._addChoice({value:f,label:g,isSelected:a.selected,isDisabled:a.disabled,customProperties:h,placeholder:i})})},e._addPredefinedItems=function(a){var b=this;a.forEach(function(a){"object"==typeof a&&a.value&&b._addItem({value:a.value,label:a.label,choiceId:a.id,customProperties:a.customProperties,placeholder:a.placeholder}),"string"==typeof a&&b._addItem({value:a})})},e._setChoiceOrItem=function(a){var b=this;({object:function(){a.value&&(b._isTextElement?b._addItem({value:a.value,label:a.label,choiceId:a.id,customProperties:a.customProperties,placeholder:a.placeholder}):b._addChoice({value:a.value,label:a.label,isSelected:!0,isDisabled:!1,customProperties:a.customProperties,placeholder:a.placeholder}))},string:function(){b._isTextElement?b._addItem({value:a}):b._addChoice({value:a,label:a,isSelected:!0,isDisabled:!1})}})[C(a).toLowerCase()]()},e._findAndSelectChoiceByValue=function(a){var b=this,c=this._store.choices.find(function(c){return b.config.valueComparer(c.value,a)});c&&!c.selected&&this._addItem({value:c.value,label:c.label,choiceId:c.id,groupId:c.groupId,customProperties:c.customProperties,placeholder:c.placeholder,keyCode:c.keyCode})},e._generatePlaceholderValue=function(){if(this._isSelectElement){var a=this.passedElement.placeholderOption;return!!a&&a.text}var b=this.config,c=b.placeholder,d=b.placeholderValue,e=this.passedElement.element.dataset;if(c){if(d)return d;if(e.placeholder)return e.placeholder}return!1},a}();b.default=Ca}]).default,function(a){a.fn.colorPick=function(b){return this.each(function(){new a.colorPick(this,b||{})})},a.colorPick=function(b,c){c=c||{},this.options=a.extend({},a.fn.colorPick.defaults,c),c.str&&(this.options.str=a.extend({},a.fn.colorPick.defaults.str,c.str)),a.fn.colorPick.defaults=this.options,this.color=this.options.initialColor.toUpperCase(),this.element=a(b);var d=this.element.data("initialcolor");d&&(this.color=d,this.appendToStorage(this.color));var e=[];return a.each(a.fn.colorPick.defaults.palette.map(function(a){return a.toUpperCase()}),function(b,c){-1===a.inArray(c,e)&&e.push(c)}),this.palette=e,this.element.hasClass(this.options.pickrclass)?this:this.init()},a.fn.colorPick.defaults={initialColor:"#3498db",paletteLabel:"Default palette:",allowRecent:!0,recentMax:5,allowCustomColor:!1,palette:["transparent","#1abc9c","#16a085","#2ecc71","#27ae60","#3498db","#2980b9","#9b59b6","#8e44ad","#34495e","#2c3e50","#f1c40f","#f39c12","#e67e22","#d35400","#e74c3c","#c0392b","#ecf0f1","#bdc3c7","#95a5a6","#7f8c8d"],onColorSelected:function(){this.element.css({backgroundColor:this.color,color:this.color})}},a.colorPick.prototype={init:function(){var b=this;this.options;return a.proxy(a.fn.colorPick.defaults.onColorSelected,this)(),this.element.click(function(c){return c.preventDefault(),b.show(c.pageX,c.pageY),a(".customColorHash").val(b.color),a(".colorPickButton").click(function(c){return b.color=a(c.target).attr("hexValue"),b.appendToStorage(a(c.target).attr("hexValue")),b.hide(),a.proxy(b.options.onColorSelected,b)(),!1}),a(".customColorHash").click(function(a){return!1}).keyup(function(c){var d=a(this).val();0!==d.indexOf("#")&&(d="#"+d),/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(d)?(b.color=d,b.appendToStorage(d),a.proxy(b.options.onColorSelected,b)(),a(this).removeClass("error")):a(this).addClass("error")}),!1}).blur(function(){return b.element.val(b.color),a.proxy(b.options.onColorSelected,b)(),b.hide(),!1}),a(document).on("click",function(a){return b.hide(),!0}),this},appendToStorage:function(b){if(!0===a.fn.colorPick.defaults.allowRecent){var c=JSON.parse(localStorage.getItem("colorPickRecentItems"));null==c&&(c=[]),-1==a.inArray(b,c)&&(c.unshift(b),c=c.slice(0,a.fn.colorPick.defaults.recentMax),localStorage.setItem("colorPickRecentItems",JSON.stringify(c)))}},show:function(b,c){a("#colorPick").remove(),a("body").append('<div id="colorPick" style="display:none;top:'+c+"px;left:"+b+'px"><span>'+a.fn.colorPick.defaults.paletteLabel+"</span></div>"),jQuery.each(this.palette,function(b,c){a("#colorPick").append('<div class="colorPickButton" hexValue="'+c+'" style="background:'+c+'"></div>')}),!0===a.fn.colorPick.defaults.allowCustomColor&&a("#colorPick").append('<input type="text" style="margin-top:5px" class="customColorHash" />'),!0===a.fn.colorPick.defaults.allowRecent&&(a("#colorPick").append('<span style="margin-top:5px">Recent:</span>'),null==JSON.parse(localStorage.getItem("colorPickRecentItems"))||JSON.parse(localStorage.getItem("colorPickRecentItems"))==[]?a("#colorPick").append('<div class="colorPickButton colorPickDummy"></div>'):jQuery.each(JSON.parse(localStorage.getItem("colorPickRecentItems")),function(b,c){if(a("#colorPick").append('<div class="colorPickButton" hexValue="'+c+'" style="background:'+c+'"></div>'),b==a.fn.colorPick.defaults.recentMax-1)return!1})),a("#colorPick").fadeIn(200)},hide:function(){a("#colorPick").fadeOut(200,function(){return a("#colorPick").remove(),this})}}}(jQuery),function(a){a.fn.gradientPick=function(b){return this.each(function(){new a.gradientPick(this,b||{})})},a.gradientPick=function(b,c){c=c||{},this.options=a.extend({},a.fn.gradientPick.defaults,c),c.str&&(this.options.str=a.extend({},a.fn.gradientPick.defaults.str,c.str)),a.fn.gradientPick.defaults=this.options,this.color=this.options.initialColor.toUpperCase(),this.element=a(b);var d=this.element.data("initialcolor");d&&(this.color=d);var e=[];return a.each(a.fn.gradientPick.defaults.palette.map(function(a){return a}),function(b,c){-1===a.inArray(c,e)&&e.push(c)}),this.palette=e,this.element.hasClass(this.options.pickrclass)?this:this.init()},a.fn.gradientPick.defaults={initialColor:"linky",paletteLabel:"Default palette:",palette:Object.keys(args.gradients),onColorSelected:function(){this.element.css({backgroundImage:"linear-gradient(120deg, "+args.gradients[this.color].join(",")+")"})}},a.gradientPick.prototype={init:function(){var b=this;this.options;return a.proxy(a.fn.gradientPick.defaults.onColorSelected,this)(),this.element.click(function(c){return c.preventDefault(),b.show(c.pageX,c.pageY),a(".gradientPickButton").click(function(c){return b.color=a(c.target).attr("hexValue"),b.hide(),a.proxy(b.options.onColorSelected,b)(),!1}),!1}).blur(function(){return b.element.val(b.color),a.proxy(b.options.onColorSelected,b)(),b.hide(),!1}),a(document).on("click",function(a){return b.hide(),!0}),this},show:function(b,c){a("#gradientPick").remove(),a("body").append('<div id="gradientPick" style="display:none;top:'+c+"px;left:"+b+'px"><span>'+a.fn.gradientPick.defaults.paletteLabel+"</span></div>"),jQuery.each(this.palette,function(b,c){a("#gradientPick").append('<div class="gradientPickButton" hexValue="'+c+'" style="background-image:linear-gradient(120deg,'+args.gradients[c].join(",")+')"></div>')}),a("#gradientPick").fadeIn(200)},hide:function(){a("#gradientPick").fadeOut(200,function(){return a("#gradientPick").remove(),this})}}}(jQuery) ;var $=void 0===$?jQuery:$,paletteLinky=["transparent","#6be39c","#39cb75","#1a7e43","#06421f","#68e0c6","#29bb9c","#23a085","#0e5f4d","#043a2e","#6fcade","#3b99d9","#2f81b7","#2f59b7","#354a5d","#d988de","#9a5cb4","#8d48ab","#6a2887","#410c58","#ea827b","#e54d42","#be3a31","#94241c","#580f0a","#f1d372","#f0c330","#f19b2c","#e47e31","#d15519","#ffffff","#ecf0f1","#bdc3c7","#808c8d","#1d1d1d"];$(document).ready(function(){var a=new renderComponent(".linky-page",{}),b=new imageUploader(".image-uploader",{}),c=new WPLinkyAdminForm(".settings-wp-linky",{imgUploader:b,renderComponent:a});new linksComponent("._js-form .links",{linkyForm:c}),$(window).load(function(){c.dirtyEvent()})}),$(window).load(function(){$(window).width()>1024&&($(".render-view").height($("._col-8").height()-110),$(".iphone-x").stickit({top:50,scope:StickScope.Parent}))});var WPLinkyAdminForm=function(a,b){var c={},d=this;d.settings={};var e=$(a),a=a;d.form=e.find("form._js-form"),d.renderButton=$("._js-linky-button"),d.formIsDirty=!1,d.init=function(){d.settings=$.extend({},c,b),d._events(),d._libInstance()},d._events=function(){e.find(".theme-input").click(function(){e.find(".theme-input").removeClass("is-checked"),$(this).addClass("is-checked"),$(this).find('input[type="radio"]').prop("checked",!0)}),$(document).on("click","._js-delete",function(){$(this).closest(".link").toggleClass("is-deleted");var a=$(this).siblings('input[type="hidden"]');a.val("no"==a.val()?"yes":"no")}),$(document).on("click",".link__active",function(){var a=$(this).find('input[type="hidden"]');$(this).closest(".link").toggleClass("is-hidden"),a.val("no"==a.val()?"yes":"no")}),$(document).on("click",".js-size-button",function(){var a=$(this),b=a.siblings('input[type="hidden"]'),c=a.data("value");a.closest(".link").toggleClass("half-size",50==c),$(".js-size-button").removeClass("active"),a.addClass("active"),b.val(c)}),$(".js-override").click(function(){$('input[name="_override"]').val($(this).data("override"))}),$(".js-toggle-select").on("change",function(){var a=$(this),b=$(this).val();$(".toggle-"+a.attr("name")).hide(),$("#"+a.attr("name")+"-"+b).show()}).trigger("change"),window.onbeforeunload=function(a){if(a=a||window.event,d.formIsDirty)return a&&(a.returnValue=args.promptMessage),args.promptMessage},d.form.on("submit",function(a){a.preventDefault();var b=$(this),c=new FormData(b[0]);$.ajax({url:b.attr("action"),method:"POST",processData:!1,contentType:!1,data:c,beforeSend:function(){d.form.find(".message").remove()},success:function(a){if(void 0!=a.success){d.formIsDirty=!1;var b=d.getMessage("success",d.form.data("success-message"));d.form.prepend(b),d.renderButton.attr("href",d.renderButton.data("prefix")+a.data.global.slug),d.settings.renderComponent.refresh(),d.form.find(".is-deleted").remove()}}})}),d.form.find(".links").sortable({handle:".link__sort"}),d.form.find(".links").disableSelection()},d.dirtyEvent=function(){d.formIsDirty=!1,d.form.find("input, select").change(function(){d.formIsDirty=!0})},d._libInstance=function(){const a=document.querySelectorAll(".js-choices");for(var b=0;b<a.length;b++)new Choices(a[b],{placeholderValue:a[b].placeholder,editItems:!0});$(".colorpicker").colorPick({initialColor:"#fff",paletteLabel:"",palette:paletteLinky,allowCustomColor:!0,onColorSelected:function(){this.element.css({backgroundColor:this.color,color:this.color}).removeClass("is-transparent").toggleClass("is-transparent","transparent"==this.color.toLowerCase()),this.element.siblings('input[type="text"]').val(this.color).trigger("change")}}),$(".gradientpicker").gradientPick({paletteLabel:"",onColorSelected:function(){this.element.css({backgroundImage:"linear-gradient(120deg, "+args.gradients[this.color].join(",")+")"}),this.element.siblings('input[type="hidden"]').val(this.color).trigger("change")}}),d.loadColorPicker()},d.getMessage=function(a,b){return'<div class="message '+a+'">'+b+"</div>"},d.loadColorPicker=function(){$(".link_colorpicker").not(".loaded").colorPick({initialColor:"#fff",paletteLabel:"Linky",palette:paletteLinky,allowCustomColor:!0,onColorSelected:function(){this.element.siblings('input[type="hidden"]').val(this.color).trigger("change");var a=this.element.data("property");this.element.css({backgroundColor:this.color}).removeClass("is-transparent").toggleClass("is-transparent","transparent"==this.color.toLowerCase());var b=this.element.closest(".link"),c={};c[a]=this.color,"sepColor"===a&&(c={borderColor:this.color,color:this.color}),b.css(c)}}).addClass("loaded")},d.init()},renderComponent=function(a,b){var c={},d=this;d.settings={};var e=$(a),a=a;d.init=function(){d.settings=$.extend({},c,b),d._events()},d._events=function(){$(".link__label-link input").on({keyup:function(){var a=$(this),b=a.closest(".form-field");if(b.find(".link__autocomplete").html(""),b.removeClass("is-autocomplete"),!a.val())return void b.removeClass("is-loading");b.addClass("is-loading"),$.ajax({url:args.ajaxurl,method:"POST",dataType:"html",data:{action:"get_suggests",s:a.val()},success:function(a){b.removeClass("is-loading"),a?(b.addClass("is-autocomplete"),b.find(".link__autocomplete").html(a)):$(this).closest(".form-field").removeClass("is-loading is-autocomplete")}})}}),$(document).on("click",".link__autocomplete li",function(a){a.preventDefault();var b=$(this),c=b.closest(".link"),d=c.find(".image-uploader"),e=b.data("thumbnail-id");c.find(".link__label-link input").val(b.find(".label-link").text().trim()),c.find("._js-remove-image").trigger("click"),c.find(".link__link input").val(b.data("link")),e&&(d.addClass("is-filled"),d.find('input[type="hidden"]').val(e).trigger("change"),d.css("background-image","url("+b.find("img").attr("src")+")")),c.find(".link__autocomplete").html("")}),$(document).on("click",function(a){$(a.target).hasClass("link__autocomplete")||$(".form-field").removeClass("is-loading is-autocomplete")})},d.refresh=function(){$.ajax({url:args.ajaxurl,method:"POST",dataType:"html",data:{action:"get_admin_page_content"},beforeSend:function(){$("body").addClass("render-loading")},success:function(a){$("body").removeClass("render-loading");var b=$(a);e.html(b.html()),e.attr("class",b.attr("class")),e.attr("style",b.attr("style"))}})},d.init()},linksComponent=function(a,b){var c={},d=this;d.settings={};var e=$(a),a=a;d.form=$("form._js-links-form"),d.init=function(){d.settings=$.extend({},c,b),d._events()},d._events=function(){d.form.on("submit",function(a){a.preventDefault();var b=$(this),c=b.data("position");$.ajax({url:args.ajaxurl,method:"POST",data:{action:"get_link_template",_type:b.find('[name="_type"]').val()},dataType:"html",beforeSend:function(){d.form.find("button").prop("disabled",!0)},success:function(a){d.form.find("button").prop("disabled",!1),d.addLink(a,c)}})})},d.addLink=function(a,b){b=void 0!=b?b:"append";var c=$(a);e.find(".links__empty").remove(),"prepend"==b?e.prepend(c):e.append(c),d.settings.linkyForm.loadColorPicker()},d.init()},imageUploader=function(a,b){var c={},d=this;d.settings={};var a=($(a),a);d.init=function(){d.settings=$.extend({},c,b),d._events()},d._events=function(){$(document).on("click",a,function(a){a.preventDefault();var b=$(this),c=wp.media({title:"Insert image",library:{type:"image"},button:{text:"Use this image"},multiple:!1}).on("select",function(){var a=c.state().get("selection").first().toJSON();b.addClass("is-filled"),b.find('input[type="hidden"]').val(a.id).trigger("change"),b.css("background-image","url("+a.url+")")}).open()}),$(document).on("click","._js-remove-image",function(b){b.preventDefault(),b.stopPropagation();var c=$(this).closest(a);return c.removeClass("is-filled"),c.find('input[type="hidden"]').val("").trigger("change"),c.attr("style",""),!1})},d.init()};3 this.input.element.removeEventListener("keyup",this._onKeyUp),this.input.element.removeEventListener("focus",this._onFocus),this.input.element.removeEventListener("blur",this._onBlur),this.input.element.form&&this.input.element.form.removeEventListener("reset",this._onFormReset),this.input.removeEventListeners()},e._onKeyDown=function(a){var b,c=a.target,d=a.keyCode,e=a.ctrlKey,f=a.metaKey,g=this._store.activeItems,h=this.input.isFocussed,i=this.dropdown.isActive,j=this.itemList.hasChildren(),k=String.fromCharCode(d),l=da,m=ea,n=fa,o=ga,p=ha,q=ia,r=ja,s=ka,t=la,u=e||f;!this._isTextElement&&/[a-zA-Z0-9-_ ]/.test(k)&&this.showDropdown();var v=((b={})[o]=this._onAKey,b[n]=this._onEnterKey,b[p]=this._onEscapeKey,b[q]=this._onDirectionKey,b[s]=this._onDirectionKey,b[r]=this._onDirectionKey,b[t]=this._onDirectionKey,b[m]=this._onDeleteKey,b[l]=this._onDeleteKey,b);v[d]&&v[d]({event:a,target:c,keyCode:d,metaKey:f,activeItems:g,hasFocusedInput:h,hasActiveDropdown:i,hasItems:j,hasCtrlDownKeyPressed:u})},e._onKeyUp=function(a){var b=a.target,c=a.keyCode,d=this.input.value,e=this._store.activeItems,f=this._canAddItem(e,d),g=da,h=ea;if(this._isTextElement)if(f.notice&&d){var i=this._getTemplate("notice",f.notice);this.dropdown.element.innerHTML=i.outerHTML,this.showDropdown(!0)}else this.hideDropdown(!0);else{var j=(c===g||c===h)&&!b.value,k=!this._isTextElement&&this._isSearching,l=this._canSearch&&f.response;j&&k?(this._isSearching=!1,this._store.dispatch(wa(!0))):l&&this._handleSearch(this.input.value)}this._canSearch=this.config.searchEnabled},e._onAKey=function(a){var b=a.hasItems;a.hasCtrlDownKeyPressed&&b&&(this._canSearch=!1,this.config.removeItems&&!this.input.value&&this.input.element===document.activeElement&&this.highlightAll())},e._onEnterKey=function(a){var b=a.event,c=a.target,d=a.activeItems,e=a.hasActiveDropdown,f=fa,g=c.hasAttribute("data-button");if(this._isTextElement&&c.value){var h=this.input.value;this._canAddItem(d,h).response&&(this.hideDropdown(!0),this._addItem({value:h}),this._triggerChange(h),this.clearInput())}if(g&&(this._handleButtonAction(d,c),b.preventDefault()),e){var i=this.dropdown.getChild("."+this.config.classNames.highlightedState);i&&(d[0]&&(d[0].keyCode=f),this._handleChoiceAction(d,i)),b.preventDefault()}else this._isSelectOneElement&&(this.showDropdown(),b.preventDefault())},e._onEscapeKey=function(a){a.hasActiveDropdown&&(this.hideDropdown(!0),this.containerOuter.focus())},e._onDirectionKey=function(a){var b,c,d,e=a.event,f=a.hasActiveDropdown,g=a.keyCode,h=a.metaKey,i=ja,j=ka,k=la;if(f||this._isSelectOneElement){this.showDropdown(),this._canSearch=!1;var l,m=g===i||g===k?1:-1;if(h||g===k||g===j)l=m>0?this.dropdown.element.querySelector("[data-choice-selectable]:last-of-type"):this.dropdown.element.querySelector("[data-choice-selectable]");else{var n=this.dropdown.element.querySelector("."+this.config.classNames.highlightedState);l=n?function(a,b,c){if(void 0===c&&(c=1),a instanceof Element&&"string"==typeof b){for(var d=(c>0?"next":"previous")+"ElementSibling",e=a[d];e;){if(e.matches(b))return e;e=e[d]}return e}}(n,"[data-choice-selectable]",m):this.dropdown.element.querySelector("[data-choice-selectable]")}l&&(b=l,c=this.choiceList.element,void 0===(d=m)&&(d=1),b&&(d>0?c.scrollTop+c.offsetHeight>=b.offsetTop+b.offsetHeight:b.offsetTop>=c.scrollTop)||this.choiceList.scrollToChildElement(l,m),this._highlightChoice(l)),e.preventDefault()}},e._onDeleteKey=function(a){var b=a.event,c=a.target,d=a.hasFocusedInput,e=a.activeItems;!d||c.value||this._isSelectOneElement||(this._handleBackspace(e),b.preventDefault())},e._onTouchMove=function(){this._wasTap&&(this._wasTap=!1)},e._onTouchEnd=function(a){var b=(a||a.touches[0]).target;this._wasTap&&this.containerOuter.element.contains(b)&&((b===this.containerOuter.element||b===this.containerInner.element)&&(this._isTextElement?this.input.focus():this._isSelectMultipleElement&&this.showDropdown()),a.stopPropagation()),this._wasTap=!0},e._onMouseDown=function(a){var b=a.target;if(b instanceof HTMLElement){if(Aa&&this.choiceList.element.contains(b)){var c=this.choiceList.element.firstElementChild,d="ltr"===this._direction?a.offsetX>=c.offsetWidth:a.offsetX<c.offsetLeft;this._isScrollingOnIe=d}if(b!==this.input.element){var e=b.closest("[data-button],[data-item],[data-choice]");if(e instanceof HTMLElement){var f=a.shiftKey,g=this._store.activeItems,h=e.dataset;"button"in h?this._handleButtonAction(g,e):"item"in h?this._handleItemAction(g,e,f):"choice"in h&&this._handleChoiceAction(g,e)}a.preventDefault()}}},e._onMouseOver=function(a){var b=a.target;b instanceof HTMLElement&&"choice"in b.dataset&&this._highlightChoice(b)},e._onClick=function(a){var b=a.target;this.containerOuter.element.contains(b)?this.dropdown.isActive||this.containerOuter.isDisabled?this._isSelectOneElement&&b!==this.input.element&&!this.dropdown.element.contains(b)&&this.hideDropdown():this._isTextElement?document.activeElement!==this.input.element&&this.input.focus():(this.showDropdown(),this.containerOuter.focus()):(this._store.highlightedActiveItems.length>0&&this.unhighlightAll(),this.containerOuter.removeFocusState(),this.hideDropdown(!0))},e._onFocus=function(a){var b,c=this,d=a.target;this.containerOuter.element.contains(d)&&((b={})[ma]=function(){d===c.input.element&&c.containerOuter.addFocusState()},b[na]=function(){c.containerOuter.addFocusState(),d===c.input.element&&c.showDropdown(!0)},b[oa]=function(){d===c.input.element&&(c.showDropdown(!0),c.containerOuter.addFocusState())},b)[this.passedElement.element.type]()},e._onBlur=function(a){var b=this,c=a.target;if(this.containerOuter.element.contains(c)&&!this._isScrollingOnIe){var d,e=this._store.activeItems.some(function(a){return a.highlighted});((d={})[ma]=function(){c===b.input.element&&(b.containerOuter.removeFocusState(),e&&b.unhighlightAll(),b.hideDropdown(!0))},d[na]=function(){b.containerOuter.removeFocusState(),(c===b.input.element||c===b.containerOuter.element&&!b._canSearch)&&b.hideDropdown(!0)},d[oa]=function(){c===b.input.element&&(b.containerOuter.removeFocusState(),b.hideDropdown(!0),e&&b.unhighlightAll())},d)[this.passedElement.element.type]()}else this._isScrollingOnIe=!1,this.input.element.focus()},e._onFormReset=function(){this._store.dispatch({type:"RESET_TO",state:this._initialState})},e._highlightChoice=function(a){var b=this;void 0===a&&(a=null);var c=Array.from(this.dropdown.element.querySelectorAll("[data-choice-selectable]"));if(c.length){var d=a;Array.from(this.dropdown.element.querySelectorAll("."+this.config.classNames.highlightedState)).forEach(function(a){a.classList.remove(b.config.classNames.highlightedState),a.setAttribute("aria-selected","false")}),d?this._highlightPosition=c.indexOf(d):(d=c.length>this._highlightPosition?c[this._highlightPosition]:c[c.length-1])||(d=c[0]),d.classList.add(this.config.classNames.highlightedState),d.setAttribute("aria-selected","true"),this.passedElement.triggerEvent(W,{el:d}),this.dropdown.isActive&&(this.input.setActiveDescendant(d.id),this.containerOuter.setActiveDescendant(d.id))}},e._addItem=function(a){var b=a.value,c=a.label,d=void 0===c?null:c,e=a.choiceId,f=void 0===e?-1:e,g=a.groupId,h=void 0===g?-1:g,i=a.customProperties,j=void 0===i?null:i,k=a.placeholder,l=void 0!==k&&k,m=a.keyCode,n=void 0===m?null:m,o="string"==typeof b?b.trim():b,p=n,q=j,r=this._store.items,s=d||o,t=f||-1,u=h>=0?this._store.getGroupById(h):null,v=r?r.length+1:1;return this.config.prependValue&&(o=this.config.prependValue+o.toString()),this.config.appendValue&&(o+=this.config.appendValue.toString()),this._store.dispatch(function(a){var b=a.value,c=a.label,d=a.id,e=a.choiceId,f=a.groupId,g=a.customProperties,h=a.placeholder,i=a.keyCode;return{type:aa,value:b,label:c,id:d,choiceId:e,groupId:f,customProperties:g,placeholder:h,keyCode:i}}({value:o,label:s,id:v,choiceId:t,groupId:h,customProperties:j,placeholder:l,keyCode:p})),this._isSelectOneElement&&this.removeActiveItems(v),this.passedElement.triggerEvent(T,{id:v,value:o,label:s,customProperties:q,groupValue:u&&u.value?u.value:void 0,keyCode:p}),this},e._removeItem=function(a){if(!a||!D("Object",a))return this;var b=a.id,c=a.value,d=a.label,e=a.choiceId,f=a.groupId,g=f>=0?this._store.getGroupById(f):null;return this._store.dispatch(function(a,b){return{type:ba,id:a,choiceId:b}}(b,e)),g&&g.value?this.passedElement.triggerEvent(U,{id:b,value:c,label:d,groupValue:g.value}):this.passedElement.triggerEvent(U,{id:b,value:c,label:d}),this},e._addChoice=function(a){var b=a.value,c=a.label,d=void 0===c?null:c,e=a.isSelected,f=void 0!==e&&e,g=a.isDisabled,h=void 0!==g&&g,i=a.groupId,j=void 0===i?-1:i,k=a.customProperties,l=void 0===k?null:k,m=a.placeholder,n=void 0!==m&&m,o=a.keyCode,p=void 0===o?null:o;if(null!=b){var q=this._store.choices,r=d||b,s=q?q.length+1:1,t=this._baseId+"-"+this._idNames.itemChoice+"-"+s;this._store.dispatch(function(a){var b=a.value,c=a.label,d=a.id,e=a.groupId,f=a.disabled,g=a.elementId,h=a.customProperties,i=a.placeholder,j=a.keyCode;return{type:X,value:b,label:c,id:d,groupId:e,disabled:f,elementId:g,customProperties:h,placeholder:i,keyCode:j}}({id:s,groupId:j,elementId:t,value:b,label:r,disabled:h,customProperties:l,placeholder:n,keyCode:p})),f&&this._addItem({value:b,label:r,choiceId:s,customProperties:l,placeholder:n,keyCode:p})}},e._addGroup=function(a){var b=this,c=a.group,d=a.id,e=a.valueKey,f=void 0===e?"value":e,g=a.labelKey,h=void 0===g?"label":g,i=D("Object",c)?c.choices:Array.from(c.getElementsByTagName("OPTION")),j=d||Math.floor((new Date).valueOf()*Math.random()),k=!!c.disabled&&c.disabled;i?(this._store.dispatch(ya({value:c.label,id:j,active:!0,disabled:k})),i.forEach(function(a){var c=a.disabled||a.parentNode&&a.parentNode.disabled;b._addChoice({value:a[f],label:D("Object",a)?a[h]:a.innerHTML,isSelected:a.selected,isDisabled:c,groupId:j,customProperties:a.customProperties,placeholder:a.placeholder})})):this._store.dispatch(ya({value:c.label,id:c.id,active:!1,disabled:c.disabled}))},e._getTemplate=function(a){var b;if(!a)return null;for(var c=this.config.classNames,d=arguments.length,e=new Array(d>1?d-1:0),f=1;f<d;f++)e[f-1]=arguments[f];return(b=this._templates[a]).call.apply(b,[this,c].concat(e))},e._createTemplates=function(){var a=this.config.callbackOnCreateTemplates,b={};a&&"function"==typeof a&&(b=a.call(this,F)),this._templates=r()(va,b)},e._createElements=function(){this.containerOuter=new pa({element:this._getTemplate("containerOuter",this._direction,this._isSelectElement,this._isSelectOneElement,this.config.searchEnabled,this.passedElement.element.type),classNames:this.config.classNames,type:this.passedElement.element.type,position:this.config.position}),this.containerInner=new pa({element:this._getTemplate("containerInner"),classNames:this.config.classNames,type:this.passedElement.element.type,position:this.config.position}),this.input=new qa({element:this._getTemplate("input",this._placeholderValue),classNames:this.config.classNames,type:this.passedElement.element.type,preventPaste:!this.config.paste}),this.choiceList=new ra({element:this._getTemplate("choiceList",this._isSelectOneElement)}),this.itemList=new ra({element:this._getTemplate("itemList",this._isSelectOneElement)}),this.dropdown=new M({element:this._getTemplate("dropdown"),classNames:this.config.classNames,type:this.passedElement.element.type})},e._createStructure=function(){this.passedElement.conceal(),this.containerInner.wrap(this.passedElement.element),this.containerOuter.wrap(this.containerInner.element),this._isSelectOneElement?this.input.placeholder=this.config.searchPlaceholderValue||"":this._placeholderValue&&(this.input.placeholder=this._placeholderValue,this.input.setWidth()),this.containerOuter.element.appendChild(this.containerInner.element),this.containerOuter.element.appendChild(this.dropdown.element),this.containerInner.element.appendChild(this.itemList.element),this._isTextElement||this.dropdown.element.appendChild(this.choiceList.element),this._isSelectOneElement?this.config.searchEnabled&&this.dropdown.element.insertBefore(this.input.element,this.dropdown.element.firstChild):this.containerInner.element.appendChild(this.input.element),this._isSelectElement&&(this._highlightPosition=0,this._isSearching=!1,this._startLoading(),this._presetGroups.length?this._addPredefinedGroups(this._presetGroups):this._addPredefinedChoices(this._presetChoices),this._stopLoading()),this._isTextElement&&this._addPredefinedItems(this._presetItems)},e._addPredefinedGroups=function(a){var b=this,c=this.passedElement.placeholderOption;c&&"SELECT"===c.parentNode.tagName&&this._addChoice({value:c.value,label:c.innerHTML,isSelected:c.selected,isDisabled:c.disabled,placeholder:!0}),a.forEach(function(a){return b._addGroup({group:a,id:a.id||null})})},e._addPredefinedChoices=function(a){var b=this;this.config.shouldSort&&a.sort(this.config.sorter);var c=a.some(function(a){return a.selected}),d=a.findIndex(function(a){return void 0===a.disabled||!a.disabled});a.forEach(function(a,e){var f=a.value,g=a.label,h=a.customProperties,i=a.placeholder;if(b._isSelectElement)if(a.choices)b._addGroup({group:a,id:a.id||null});else{var j=!(!b._isSelectOneElement||c||e!==d)||a.selected,k=a.disabled;b._addChoice({value:f,label:g,isSelected:j,isDisabled:k,customProperties:h,placeholder:i})}else b._addChoice({value:f,label:g,isSelected:a.selected,isDisabled:a.disabled,customProperties:h,placeholder:i})})},e._addPredefinedItems=function(a){var b=this;a.forEach(function(a){"object"==typeof a&&a.value&&b._addItem({value:a.value,label:a.label,choiceId:a.id,customProperties:a.customProperties,placeholder:a.placeholder}),"string"==typeof a&&b._addItem({value:a})})},e._setChoiceOrItem=function(a){var b=this;({object:function(){a.value&&(b._isTextElement?b._addItem({value:a.value,label:a.label,choiceId:a.id,customProperties:a.customProperties,placeholder:a.placeholder}):b._addChoice({value:a.value,label:a.label,isSelected:!0,isDisabled:!1,customProperties:a.customProperties,placeholder:a.placeholder}))},string:function(){b._isTextElement?b._addItem({value:a}):b._addChoice({value:a,label:a,isSelected:!0,isDisabled:!1})}})[C(a).toLowerCase()]()},e._findAndSelectChoiceByValue=function(a){var b=this,c=this._store.choices.find(function(c){return b.config.valueComparer(c.value,a)});c&&!c.selected&&this._addItem({value:c.value,label:c.label,choiceId:c.id,groupId:c.groupId,customProperties:c.customProperties,placeholder:c.placeholder,keyCode:c.keyCode})},e._generatePlaceholderValue=function(){if(this._isSelectElement){var a=this.passedElement.placeholderOption;return!!a&&a.text}var b=this.config,c=b.placeholder,d=b.placeholderValue,e=this.passedElement.element.dataset;if(c){if(d)return d;if(e.placeholder)return e.placeholder}return!1},a}();b.default=Ca}]).default,function(a){a.fn.colorPick=function(b){return this.each(function(){new a.colorPick(this,b||{})})},a.colorPick=function(b,c){c=c||{},this.options=a.extend({},a.fn.colorPick.defaults,c),c.str&&(this.options.str=a.extend({},a.fn.colorPick.defaults.str,c.str)),a.fn.colorPick.defaults=this.options,this.color=this.options.initialColor.toUpperCase(),this.element=a(b);var d=this.element.data("initialcolor");d&&(this.color=d,this.appendToStorage(this.color));var e=[];return a.each(a.fn.colorPick.defaults.palette.map(function(a){return a.toUpperCase()}),function(b,c){-1===a.inArray(c,e)&&e.push(c)}),this.palette=e,this.element.hasClass(this.options.pickrclass)?this:this.init()},a.fn.colorPick.defaults={initialColor:"#3498db",paletteLabel:"Default palette:",allowRecent:!0,recentMax:5,allowCustomColor:!1,palette:["transparent","#1abc9c","#16a085","#2ecc71","#27ae60","#3498db","#2980b9","#9b59b6","#8e44ad","#34495e","#2c3e50","#f1c40f","#f39c12","#e67e22","#d35400","#e74c3c","#c0392b","#ecf0f1","#bdc3c7","#95a5a6","#7f8c8d"],onColorSelected:function(){this.element.css({backgroundColor:this.color,color:this.color})}},a.colorPick.prototype={init:function(){var b=this;this.options;return a.proxy(a.fn.colorPick.defaults.onColorSelected,this)(),this.element.click(function(c){return c.preventDefault(),b.show(c.pageX,c.pageY),a(".customColorHash").val(b.color),a(".colorPickButton").click(function(c){return b.color=a(c.target).attr("hexValue"),b.appendToStorage(a(c.target).attr("hexValue")),b.hide(),a.proxy(b.options.onColorSelected,b)(),!1}),a(".customColorHash").click(function(a){return!1}).keyup(function(c){var d=a(this).val();0!==d.indexOf("#")&&(d="#"+d),/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(d)?(b.color=d,b.appendToStorage(d),a.proxy(b.options.onColorSelected,b)(),a(this).removeClass("error")):a(this).addClass("error")}),!1}).blur(function(){return b.element.val(b.color),a.proxy(b.options.onColorSelected,b)(),b.hide(),!1}),a(document).on("click",function(a){return b.hide(),!0}),this},appendToStorage:function(b){if(!0===a.fn.colorPick.defaults.allowRecent){var c=JSON.parse(localStorage.getItem("colorPickRecentItems"));null==c&&(c=[]),-1==a.inArray(b,c)&&(c.unshift(b),c=c.slice(0,a.fn.colorPick.defaults.recentMax),localStorage.setItem("colorPickRecentItems",JSON.stringify(c)))}},show:function(b,c){a("#colorPick").remove(),a("body").append('<div id="colorPick" style="display:none;top:'+c+"px;left:"+b+'px"><span>'+a.fn.colorPick.defaults.paletteLabel+"</span></div>"),jQuery.each(this.palette,function(b,c){a("#colorPick").append('<div class="colorPickButton" hexValue="'+c+'" style="background:'+c+'"></div>')}),!0===a.fn.colorPick.defaults.allowCustomColor&&a("#colorPick").append('<input type="text" style="margin-top:5px" class="customColorHash" />'),!0===a.fn.colorPick.defaults.allowRecent&&(a("#colorPick").append('<span style="margin-top:5px">Recent:</span>'),null==JSON.parse(localStorage.getItem("colorPickRecentItems"))||JSON.parse(localStorage.getItem("colorPickRecentItems"))==[]?a("#colorPick").append('<div class="colorPickButton colorPickDummy"></div>'):jQuery.each(JSON.parse(localStorage.getItem("colorPickRecentItems")),function(b,c){if(a("#colorPick").append('<div class="colorPickButton" hexValue="'+c+'" style="background:'+c+'"></div>'),b==a.fn.colorPick.defaults.recentMax-1)return!1})),a("#colorPick").fadeIn(200)},hide:function(){a("#colorPick").fadeOut(200,function(){return a("#colorPick").remove(),this})}}}(jQuery),function(a){a.fn.gradientPick=function(b){return this.each(function(){new a.gradientPick(this,b||{})})},a.gradientPick=function(b,c){c=c||{},this.options=a.extend({},a.fn.gradientPick.defaults,c),c.str&&(this.options.str=a.extend({},a.fn.gradientPick.defaults.str,c.str)),a.fn.gradientPick.defaults=this.options,this.color=this.options.initialColor.toUpperCase(),this.element=a(b);var d=this.element.data("initialcolor");d&&(this.color=d);var e=[];return a.each(a.fn.gradientPick.defaults.palette.map(function(a){return a}),function(b,c){-1===a.inArray(c,e)&&e.push(c)}),this.palette=e,this.element.hasClass(this.options.pickrclass)?this:this.init()},a.fn.gradientPick.defaults={initialColor:"linky",paletteLabel:"Default palette:",palette:Object.keys(args.gradients),onColorSelected:function(){this.element.css({backgroundImage:"linear-gradient(120deg, "+args.gradients[this.color].join(",")+")"})}},a.gradientPick.prototype={init:function(){var b=this;this.options;return a.proxy(a.fn.gradientPick.defaults.onColorSelected,this)(),this.element.click(function(c){return c.preventDefault(),b.show(c.pageX,c.pageY),a(".gradientPickButton").click(function(c){return b.color=a(c.target).attr("hexValue"),b.hide(),a.proxy(b.options.onColorSelected,b)(),!1}),!1}).blur(function(){return b.element.val(b.color),a.proxy(b.options.onColorSelected,b)(),b.hide(),!1}),a(document).on("click",function(a){return b.hide(),!0}),this},show:function(b,c){a("#gradientPick").remove(),a("body").append('<div id="gradientPick" style="display:none;top:'+c+"px;left:"+b+'px"><span>'+a.fn.gradientPick.defaults.paletteLabel+"</span></div>"),jQuery.each(this.palette,function(b,c){a("#gradientPick").append('<div class="gradientPickButton" hexValue="'+c+'" style="background-image:linear-gradient(120deg,'+args.gradients[c].join(",")+')"></div>')}),a("#gradientPick").fadeIn(200)},hide:function(){a("#gradientPick").fadeOut(200,function(){return a("#gradientPick").remove(),this})}}}(jQuery),"undefined"==typeof $&&"undefined"!=typeof jQuery&&($=jQuery);var paletteLinky=["transparent","#6be39c","#39cb75","#1a7e43","#06421f","#68e0c6","#29bb9c","#23a085","#0e5f4d","#043a2e","#6fcade","#3b99d9","#2f81b7","#2f59b7","#354a5d","#d988de","#9a5cb4","#8d48ab","#6a2887","#410c58","#ea827b","#e54d42","#be3a31","#94241c","#580f0a","#f1d372","#f0c330","#f19b2c","#e47e31","#d15519","#ffffff","#ecf0f1","#bdc3c7","#808c8d","#1d1d1d"];$(document).ready(function(){var a=new renderComponent(".linky-page",{}),b=new imageUploader(".image-uploader",{}),c=new WPLinkyAdminForm(".settings-wp-linky",{imgUploader:b,renderComponent:a});new linksComponent("._js-form .links",{linkyForm:c}),$(window).load(function(){c.dirtyEvent()})}),$(window).load(function(){$(window).width()>1024&&($(".render-view").height($("._col-8").height()-110),$(".iphone-x").stickit({top:50,scope:StickScope.Parent}))});var WPLinkyAdminForm=function(a,b){var c={},d=this;d.settings={};var e=$(a),a=a;d.form=e.find("form._js-form"),d.renderButton=$("._js-linky-button"),d.formIsDirty=!1,d.init=function(){d.settings=$.extend({},c,b),d._events(),d._libInstance()},d._events=function(){e.find(".theme-input").click(function(){e.find(".theme-input").removeClass("is-checked"),$(this).addClass("is-checked"),$(this).find('input[type="radio"]').prop("checked",!0)}),$(document).on("click","._js-delete",function(){$(this).closest(".link").toggleClass("is-deleted");var a=$(this).siblings('input[type="hidden"]');a.val("no"==a.val()?"yes":"no")}),$(document).on("click",".link__active",function(){var a=$(this).find('input[type="hidden"]');$(this).closest(".link").toggleClass("is-hidden"),a.val("no"==a.val()?"yes":"no")}),$(document).on("click",".js-size-button",function(){var a=$(this),b=a.siblings('input[type="hidden"]'),c=a.data("value");a.closest(".link").toggleClass("half-size",50==c),$(".js-size-button").removeClass("active"),a.addClass("active"),b.val(c)}),$(".js-override").click(function(){$('input[name="_override"]').val($(this).data("override"))}),$(".js-toggle-select").on("change",function(){var a=$(this),b=$(this).val();$(".toggle-"+a.attr("name")).hide(),$("#"+a.attr("name")+"-"+b).show()}).trigger("change"),window.onbeforeunload=function(a){if(a=a||window.event,d.formIsDirty)return a&&(a.returnValue=args.promptMessage),args.promptMessage},d.form.on("submit",function(a){a.preventDefault();var b=$(this),c=new FormData(b[0]);$.ajax({url:b.attr("action"),method:"POST",processData:!1,contentType:!1,data:c,beforeSend:function(){d.form.find(".message").remove()},success:function(a){if(void 0!=a.success){d.formIsDirty=!1;var b=d.getMessage("success",d.form.data("success-message"));d.form.prepend(b),d.renderButton.attr("href",d.renderButton.data("prefix")+a.data.global.slug),d.settings.renderComponent.refresh(),d.form.find(".is-deleted").remove()}}})}),d.form.find(".links").sortable({handle:".link__sort"}),d.form.find(".links").disableSelection()},d.dirtyEvent=function(){d.formIsDirty=!1,d.form.find("input, select").change(function(){d.formIsDirty=!0})},d._libInstance=function(){const a=document.querySelectorAll(".js-choices");for(var b=0;b<a.length;b++)new Choices(a[b],{placeholderValue:a[b].placeholder,editItems:!0});$(".colorpicker").colorPick({initialColor:"#fff",paletteLabel:"",palette:paletteLinky,allowCustomColor:!0,onColorSelected:function(){this.element.css({backgroundColor:this.color,color:this.color}).removeClass("is-transparent").toggleClass("is-transparent","transparent"==this.color.toLowerCase()),this.element.siblings('input[type="text"]').val(this.color).trigger("change")}}),$(".gradientpicker").gradientPick({paletteLabel:"",onColorSelected:function(){this.element.css({backgroundImage:"linear-gradient(120deg, "+args.gradients[this.color].join(",")+")"}),this.element.siblings('input[type="hidden"]').val(this.color).trigger("change")}}),d.loadColorPicker()},d.getMessage=function(a,b){return'<div class="message '+a+'">'+b+"</div>"},d.loadColorPicker=function(){$(".link_colorpicker").not(".loaded").colorPick({initialColor:"#fff",paletteLabel:"Linky",palette:paletteLinky,allowCustomColor:!0,onColorSelected:function(){this.element.siblings('input[type="hidden"]').val(this.color).trigger("change");var a=this.element.data("property");this.element.css({backgroundColor:this.color}).removeClass("is-transparent").toggleClass("is-transparent","transparent"==this.color.toLowerCase());var b=this.element.closest(".link"),c={};c[a]=this.color,"sepColor"===a&&(c={borderColor:this.color,color:this.color}),b.css(c)}}).addClass("loaded")},d.init()},renderComponent=function(a,b){var c={},d=this;d.settings={};var e=$(a),a=a;d.init=function(){d.settings=$.extend({},c,b),d._events()},d._events=function(){$(".link__label-link input").on({keyup:function(){var a=$(this),b=a.closest(".form-field");if(b.find(".link__autocomplete").html(""),b.removeClass("is-autocomplete"),!a.val())return void b.removeClass("is-loading");b.addClass("is-loading"),$.ajax({url:args.ajaxurl,method:"POST",dataType:"html",data:{action:"get_suggests",s:a.val()},success:function(a){b.removeClass("is-loading"),a?(b.addClass("is-autocomplete"),b.find(".link__autocomplete").html(a)):$(this).closest(".form-field").removeClass("is-loading is-autocomplete")}})}}),$(document).on("click",".link__autocomplete li",function(a){a.preventDefault();var b=$(this),c=b.closest(".link"),d=c.find(".image-uploader"),e=b.data("thumbnail-id");c.find(".link__label-link input").val(b.find(".label-link").text().trim()),c.find("._js-remove-image").trigger("click"),c.find(".link__link input").val(b.data("link")),e&&(d.addClass("is-filled"),d.find('input[type="hidden"]').val(e).trigger("change"),d.css("background-image","url("+b.find("img").attr("src")+")")),c.find(".link__autocomplete").html("")}),$(document).on("click",function(a){$(a.target).hasClass("link__autocomplete")||$(".form-field").removeClass("is-loading is-autocomplete")})},d.refresh=function(){$.ajax({url:args.ajaxurl,method:"POST",dataType:"html",data:{action:"get_admin_page_content"},beforeSend:function(){$("body").addClass("render-loading")},success:function(a){$("body").removeClass("render-loading");var b=$(a);e.html(b.html()),e.attr("class",b.attr("class")),e.attr("style",b.attr("style"))}})},d.init()},linksComponent=function(a,b){var c={},d=this;d.settings={};var e=$(a),a=a;d.form=$("form._js-links-form"),d.init=function(){d.settings=$.extend({},c,b),d._events()},d._events=function(){d.form.on("submit",function(a){a.preventDefault();var b=$(this),c=b.data("position");$.ajax({url:args.ajaxurl,method:"POST",data:{action:"get_link_template",_type:b.find('[name="_type"]').val()},dataType:"html",beforeSend:function(){d.form.find("button").prop("disabled",!0)},success:function(a){d.form.find("button").prop("disabled",!1),d.addLink(a,c)}})})},d.addLink=function(a,b){b=void 0!=b?b:"append";var c=$(a);e.find(".links__empty").remove(),"prepend"==b?e.prepend(c):e.append(c),d.settings.linkyForm.loadColorPicker()},d.init()},imageUploader=function(a,b){var c={},d=this;d.settings={};var a=($(a),a);d.init=function(){d.settings=$.extend({},c,b),d._events()},d._events=function(){$(document).on("click",a,function(a){a.preventDefault();var b=$(this),c=wp.media({title:"Insert image",library:{type:"image"},button:{text:"Use this image"},multiple:!1}).on("select",function(){var a=c.state().get("selection").first().toJSON();b.addClass("is-filled"),b.find('input[type="hidden"]').val(a.id).trigger("change"),b.css("background-image","url("+a.url+")")}).open()}),$(document).on("click","._js-remove-image",function(b){b.preventDefault(),b.stopPropagation();var c=$(this).closest(a);return c.removeClass("is-filled"),c.find('input[type="hidden"]').val("").trigger("change"),c.attr("style",""),!1})},d.init()}; -
linky/trunk/linky.php
r2761627 r2761678 12 12 Description: Create & manage link’s hub for your 13 13 social profile directly in your websites 14 Version: 1.3. 714 Version: 1.3.8 15 15 Author Name: Nicolas RIVIERE (hello@undefined.fr) 16 16 Author: Nicolas RIVIERE (Undefined) -
linky/trunk/readme.txt
r2761627 r2761678 5 5 Requires at least: 4.0 6 6 Tested up to: 6.0 7 Stable tag: 1.3. 77 Stable tag: 1.3.8 8 8 Requires PHP: 5.4 9 9 License: GPLv2 or later … … 191 191 * jQuery conflict (bis) 192 192 193 =1.3.8= 194 * jQuery conflict (bis) 195 193 196 == Upgrade Notice == 194 197
Note: See TracChangeset
for help on using the changeset viewer.