silverstripe-font-awesome/dist/js/app.js

2 lines
24 KiB
JavaScript

/*! For license information please see app.js.LICENSE.txt */
!function(){var u={155:function(u,y,p){var v,_,b,g;function _regeneratorRuntime(){"use strict";_regeneratorRuntime=function _regeneratorRuntime(){return y};var u,y={},p=Object.prototype,v=p.hasOwnProperty,_=Object.defineProperty||function(u,y,p){u[y]=p.value},b="function"==typeof Symbol?Symbol:{},g=b.iterator||"@@iterator",w=b.asyncIterator||"@@asyncIterator",k=b.toStringTag||"@@toStringTag";function define(u,y,p){return Object.defineProperty(u,y,{value:p,enumerable:!0,configurable:!0,writable:!0}),u[y]}try{define({},"")}catch(u){define=function define(u,y,p){return u[y]=p}}function wrap(u,y,p,v){var b=y&&y.prototype instanceof Generator?y:Generator,g=Object.create(b.prototype),w=new Context(v||[]);return _(g,"_invoke",{value:makeInvokeMethod(u,p,w)}),g}function tryCatch(u,y,p){try{return{type:"normal",arg:u.call(y,p)}}catch(u){return{type:"throw",arg:u}}}y.wrap=wrap;var x="suspendedStart",S="suspendedYield",O="executing",A="completed",E={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var L={};define(L,g,(function(){return this}));var j=Object.getPrototypeOf,I=j&&j(j(values([])));I&&I!==p&&v.call(I,g)&&(L=I);var P=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(L);function defineIteratorMethods(u){["next","throw","return"].forEach((function(y){define(u,y,(function(u){return this._invoke(y,u)}))}))}function AsyncIterator(u,y){function invoke(p,_,b,g){var w=tryCatch(u[p],u,_);if("throw"!==w.type){var k=w.arg,x=k.value;return x&&"object"==_typeof(x)&&v.call(x,"__await")?y.resolve(x.__await).then((function(u){invoke("next",u,b,g)}),(function(u){invoke("throw",u,b,g)})):y.resolve(x).then((function(u){k.value=u,b(k)}),(function(u){return invoke("throw",u,b,g)}))}g(w.arg)}var p;_(this,"_invoke",{value:function value(u,v){function callInvokeWithMethodAndArg(){return new y((function(y,p){invoke(u,v,y,p)}))}return p=p?p.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(y,p,v){var _=x;return function(b,g){if(_===O)throw Error("Generator is already running");if(_===A){if("throw"===b)throw g;return{value:u,done:!0}}for(v.method=b,v.arg=g;;){var w=v.delegate;if(w){var k=maybeInvokeDelegate(w,v);if(k){if(k===E)continue;return k}}if("next"===v.method)v.sent=v._sent=v.arg;else if("throw"===v.method){if(_===x)throw _=A,v.arg;v.dispatchException(v.arg)}else"return"===v.method&&v.abrupt("return",v.arg);_=O;var L=tryCatch(y,p,v);if("normal"===L.type){if(_=v.done?A:S,L.arg===E)continue;return{value:L.arg,done:v.done}}"throw"===L.type&&(_=A,v.method="throw",v.arg=L.arg)}}}function maybeInvokeDelegate(y,p){var v=p.method,_=y.iterator[v];if(_===u)return p.delegate=null,"throw"===v&&y.iterator.return&&(p.method="return",p.arg=u,maybeInvokeDelegate(y,p),"throw"===p.method)||"return"!==v&&(p.method="throw",p.arg=new TypeError("The iterator does not provide a '"+v+"' method")),E;var b=tryCatch(_,y.iterator,p.arg);if("throw"===b.type)return p.method="throw",p.arg=b.arg,p.delegate=null,E;var g=b.arg;return g?g.done?(p[y.resultName]=g.value,p.next=y.nextLoc,"return"!==p.method&&(p.method="next",p.arg=u),p.delegate=null,E):g:(p.method="throw",p.arg=new TypeError("iterator result is not an object"),p.delegate=null,E)}function pushTryEntry(u){var y={tryLoc:u[0]};1 in u&&(y.catchLoc=u[1]),2 in u&&(y.finallyLoc=u[2],y.afterLoc=u[3]),this.tryEntries.push(y)}function resetTryEntry(u){var y=u.completion||{};y.type="normal",delete y.arg,u.completion=y}function Context(u){this.tryEntries=[{tryLoc:"root"}],u.forEach(pushTryEntry,this),this.reset(!0)}function values(y){if(y||""===y){var p=y[g];if(p)return p.call(y);if("function"==typeof y.next)return y;if(!isNaN(y.length)){var _=-1,b=function next(){for(;++_<y.length;)if(v.call(y,_))return next.value=y[_],next.done=!1,next;return next.value=u,next.done=!0,next};return b.next=b}}throw new TypeError(_typeof(y)+" is not iterable")}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_(P,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),_(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,k,"GeneratorFunction"),y.isGeneratorFunction=function(u){var y="function"==typeof u&&u.constructor;return!!y&&(y===GeneratorFunction||"GeneratorFunction"===(y.displayName||y.name))},y.mark=function(u){return Object.setPrototypeOf?Object.setPrototypeOf(u,GeneratorFunctionPrototype):(u.__proto__=GeneratorFunctionPrototype,define(u,k,"GeneratorFunction")),u.prototype=Object.create(P),u},y.awrap=function(u){return{__await:u}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,w,(function(){return this})),y.AsyncIterator=AsyncIterator,y.async=function(u,p,v,_,b){void 0===b&&(b=Promise);var g=new AsyncIterator(wrap(u,p,v,_),b);return y.isGeneratorFunction(p)?g:g.next().then((function(u){return u.done?u.value:g.next()}))},defineIteratorMethods(P),define(P,k,"Generator"),define(P,g,(function(){return this})),define(P,"toString",(function(){return"[object Generator]"})),y.keys=function(u){var y=Object(u),p=[];for(var v in y)p.push(v);return p.reverse(),function next(){for(;p.length;){var u=p.pop();if(u in y)return next.value=u,next.done=!1,next}return next.done=!0,next}},y.values=values,Context.prototype={constructor:Context,reset:function reset(y){if(this.prev=0,this.next=0,this.sent=this._sent=u,this.done=!1,this.delegate=null,this.method="next",this.arg=u,this.tryEntries.forEach(resetTryEntry),!y)for(var p in this)"t"===p.charAt(0)&&v.call(this,p)&&!isNaN(+p.slice(1))&&(this[p]=u)},stop:function stop(){this.done=!0;var u=this.tryEntries[0].completion;if("throw"===u.type)throw u.arg;return this.rval},dispatchException:function dispatchException(y){if(this.done)throw y;var p=this;function handle(v,_){return g.type="throw",g.arg=y,p.next=v,_&&(p.method="next",p.arg=u),!!_}for(var _=this.tryEntries.length-1;_>=0;--_){var b=this.tryEntries[_],g=b.completion;if("root"===b.tryLoc)return handle("end");if(b.tryLoc<=this.prev){var w=v.call(b,"catchLoc"),k=v.call(b,"finallyLoc");if(w&&k){if(this.prev<b.catchLoc)return handle(b.catchLoc,!0);if(this.prev<b.finallyLoc)return handle(b.finallyLoc)}else if(w){if(this.prev<b.catchLoc)return handle(b.catchLoc,!0)}else{if(!k)throw Error("try statement without catch or finally");if(this.prev<b.finallyLoc)return handle(b.finallyLoc)}}}},abrupt:function abrupt(u,y){for(var p=this.tryEntries.length-1;p>=0;--p){var _=this.tryEntries[p];if(_.tryLoc<=this.prev&&v.call(_,"finallyLoc")&&this.prev<_.finallyLoc){var b=_;break}}b&&("break"===u||"continue"===u)&&b.tryLoc<=y&&y<=b.finallyLoc&&(b=null);var g=b?b.completion:{};return g.type=u,g.arg=y,b?(this.method="next",this.next=b.finallyLoc,E):this.complete(g)},complete:function complete(u,y){if("throw"===u.type)throw u.arg;return"break"===u.type||"continue"===u.type?this.next=u.arg:"return"===u.type?(this.rval=this.arg=u.arg,this.method="return",this.next="end"):"normal"===u.type&&y&&(this.next=y),E},finish:function finish(u){for(var y=this.tryEntries.length-1;y>=0;--y){var p=this.tryEntries[y];if(p.finallyLoc===u)return this.complete(p.completion,p.afterLoc),resetTryEntry(p),E}},catch:function _catch(u){for(var y=this.tryEntries.length-1;y>=0;--y){var p=this.tryEntries[y];if(p.tryLoc===u){var v=p.completion;if("throw"===v.type){var _=v.arg;resetTryEntry(p)}return _}}throw Error("illegal catch attempt")},delegateYield:function delegateYield(y,p,v){return this.delegate={iterator:values(y),resultName:p,nextLoc:v},"next"===this.method&&(this.arg=u),E}},y}function ownKeys(u,y){var p=Object.keys(u);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(u);y&&(v=v.filter((function(y){return Object.getOwnPropertyDescriptor(u,y).enumerable}))),p.push.apply(p,v)}return p}function _objectSpread(u){for(var y=1;y<arguments.length;y++){var p=null!=arguments[y]?arguments[y]:{};y%2?ownKeys(Object(p),!0).forEach((function(y){_defineProperty(u,y,p[y])})):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(p)):ownKeys(Object(p)).forEach((function(y){Object.defineProperty(u,y,Object.getOwnPropertyDescriptor(p,y))}))}return u}function _slicedToArray(u,y){return function _arrayWithHoles(u){if(Array.isArray(u))return u}(u)||function _iterableToArrayLimit(u,y){var p=null==u?null:"undefined"!=typeof Symbol&&u[Symbol.iterator]||u["@@iterator"];if(null!=p){var v,_,b,g,w=[],k=!0,x=!1;try{if(b=(p=p.call(u)).next,0===y){if(Object(p)!==p)return;k=!1}else for(;!(k=(v=b.call(p)).done)&&(w.push(v.value),w.length!==y);k=!0);}catch(u){x=!0,_=u}finally{try{if(!k&&null!=p.return&&(g=p.return(),Object(g)!==g))return}finally{if(x)throw _}}return w}}(u,y)||_unsupportedIterableToArray(u,y)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function asyncGeneratorStep(u,y,p,v,_,b,g){try{var w=u[b](g),k=w.value}catch(u){return void p(u)}w.done?y(k):Promise.resolve(k).then(v,_)}function _asyncToGenerator(u){return function(){var y=this,p=arguments;return new Promise((function(v,_){var b=u.apply(y,p);function _next(u){asyncGeneratorStep(b,v,_,_next,_throw,"next",u)}function _throw(u){asyncGeneratorStep(b,v,_,_next,_throw,"throw",u)}_next(void 0)}))}}function _toConsumableArray(u){return function _arrayWithoutHoles(u){if(Array.isArray(u))return _arrayLikeToArray(u)}(u)||function _iterableToArray(u){if("undefined"!=typeof Symbol&&null!=u[Symbol.iterator]||null!=u["@@iterator"])return Array.from(u)}(u)||_unsupportedIterableToArray(u)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _defineProperties(u,y){for(var p=0;p<y.length;p++){var v=y[p];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(u,_toPropertyKey(v.key),v)}}function _defineProperty(u,y,p){return(y=_toPropertyKey(y))in u?Object.defineProperty(u,y,{value:p,enumerable:!0,configurable:!0,writable:!0}):u[y]=p,u}function _toPropertyKey(u){var y=function _toPrimitive(u,y){if("object"!=_typeof(u)||!u)return u;var p=u[Symbol.toPrimitive];if(void 0!==p){var v=p.call(u,y||"default");if("object"!=_typeof(v))return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===y?String:Number)(u)}(u,"string");return"symbol"==_typeof(y)?y:y+""}function _createForOfIteratorHelper(u,y){var p="undefined"!=typeof Symbol&&u[Symbol.iterator]||u["@@iterator"];if(!p){if(Array.isArray(u)||(p=_unsupportedIterableToArray(u))||y&&u&&"number"==typeof u.length){p&&(u=p);var v=0,_=function F(){};return{s:_,n:function n(){return v>=u.length?{done:!0}:{done:!1,value:u[v++]}},e:function e(u){throw u},f:_}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var b,g=!0,w=!1;return{s:function s(){p=p.call(u)},n:function n(){var u=p.next();return g=u.done,u},e:function e(u){w=!0,b=u},f:function f(){try{g||null==p.return||p.return()}finally{if(w)throw b}}}}function _unsupportedIterableToArray(u,y){if(u){if("string"==typeof u)return _arrayLikeToArray(u,y);var p={}.toString.call(u).slice(8,-1);return"Object"===p&&u.constructor&&(p=u.constructor.name),"Map"===p||"Set"===p?Array.from(u):"Arguments"===p||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(p)?_arrayLikeToArray(u,y):void 0}}function _arrayLikeToArray(u,y){(null==y||y>u.length)&&(y=u.length);for(var p=0,v=Array(y);p<y;p++)v[p]=u[p];return v}function _typeof(u){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(u){return typeof u}:function(u){return u&&"function"==typeof Symbol&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},_typeof(u)}u=p.nmd(u),self,g=function(){return function(){"use strict";var u={d:function d(y,p){for(var v in p)u.o(p,v)&&!u.o(y,v)&&Object.defineProperty(y,v,{enumerable:!0,get:p[v]})},o:function o(u,y){return Object.prototype.hasOwnProperty.call(u,y)}},y={};function i(u,y,p,v){Array.isArray(y)||(y=[y]),Array.isArray(p)||(p=[p]);var _,b=_createForOfIteratorHelper(y);try{for(b.s();!(_=b.n()).done;){var g,w=_.value,k=_createForOfIteratorHelper(p);try{for(k.s();!(g=k.n()).done;){var x=g.value;w[u](x,v)}}catch(S){k.e(S)}finally{k.f()}}}catch(S){b.e(S)}finally{b.f()}return[].slice.call(arguments,1)}u.d(y,{default:function _default(){return g}});var p=i.bind(null,"addEventListener"),v=i.bind(null,"removeEventListener");function o(u){if(window.DOMParser)return(new DOMParser).parseFromString(u,"text/html").body.firstElementChild;var y=document.createElement("div");return y.innerHTML=u,y.firstElementChild}function r(u){return u&&"object"==_typeof(u)&&!Array.isArray(u)}function a(u,y){var p=Object.assign({},u);return r(u)&&r(y)&&Object.keys(y).forEach((function(v){r(y[v])&&v in u?p[v]=a(u[v],y[v]):Object.assign(p,_defineProperty({},v,y[v]))})),p}function l(u,y){return Object.keys(u).find((function(p){return u[p]===y}))}var _="https://raw.githubusercontent.com/iconify/icon-sets/master/json",b={"Material Design Icons":{key:"mdi",prefix:"mdi mdi-",url:"".concat(_,"/mdi.json")},"FontAwesome Brands 6":{key:"fa6-brands",prefix:"fab fa-",url:"".concat(_,"/fa6-brands.json")},"FontAwesome Solid 6":{key:"fa6-solid",prefix:"fas fa-",url:"".concat(_,"/fa6-solid.json")},"FontAwesome Regular 6":{key:"fa6-regular",prefix:"far fa-",url:"".concat(_,"/fa6-regular.json")},Iconoir:{key:"iconoir",prefix:"iconoir-",url:"".concat(_,"/iconoir.json")}};function h(u){var y=Object.create({});return Array.isArray(u)&&u.forEach((function(u){!function(u){return b.hasOwnProperty(u)}(u)?u.key&&(y[u.key]=u):y[b[u].key]=b[u]})),y}var g=function(){return function _createClass(u,y,p){return y&&_defineProperties(u.prototype,y),p&&_defineProperties(u,p),Object.defineProperty(u,"prototype",{writable:!1}),u}((function m(u){var y=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function _classCallCheck(u,y){if(!(u instanceof y))throw new TypeError("Cannot call a class as a function")}(this,m),_defineProperty(this,"_eventListener",{select:[],save:[],show:[],clear:[],hide:[]}),this.options=a(m.DEFAULT_OPTIONS,y),this.element=u,this._preBuild(),this.element&&this.options.iconSource.length>0?(this._binEvents(),this._renderdIcons(),this._createModal()):this._catchError("iconSourceMissing")}),[{key:"_preBuild",value:function _preBuild(){var u;this.element=(u=this.element)instanceof HTMLElement?u:"string"==typeof u?document.querySelector(u):null,this.root=function c(u){var y,p=u.theme,v=u.i18n,_=u.closeOnSelect,b=function(u){var y=function t(u,y){var p=u.getAttribute(y);return u.removeAttribute(y),p},p=function i(u){var v=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},_=y(u,"data-element");_&&(v[_]=u);for(var b=0,g=Array.from(u.children);b<g.length;b++){var w=g[b],k=y(w,"data-interaction");k&&k&&(v[k]=w),p(w,v)}return v};return p(o(u))}('\n <div class="icon-picker-modal" tabindex="-1" data-theme="'.concat(p,'" data-element="modal" aria-modal="true" aria-labelledby="Icon picker modal" role="dialog">\n <div class="icon-picker-modal__dialog">\n <div class="icon-picker-modal__header" data-element="header">\n ').concat("string"==typeof v["text:title"]&&""!==v["text:title"]?"<h2>".concat(v["text:title"],"</h2>"):"",'\n \n <button class="icon-picker-modal--close" aria-label="Close" data-interaction="close">\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" stroke-width="1.5">\n <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M6.758 17.243 12.001 12m5.243-5.243L12 12m0 0L6.758 6.757M12.001 12l5.243 5.243"/>\n </svg>\n </button>\n </div>\n \n <input placeholder="').concat(v["input:placeholder"],'" class="icon-picker-modal__search" aria-label="').concat(v["input:placeholder"],'" data-interaction="search">\n \n <div class="icon-picker-modal__content" data-element="content"></div>\n \n ').concat(_?"":'\n <div class="icon-picker-modal__footer" data-element="footer">\n <button type="button" class="picker-save" data-interaction="save">'.concat(v["btn:save"],"</button>\n </div>"),"\n </div>\n </div>\n "));return p.includes("bootstrap")&&(null!==(y=b.save)&&void 0!==y&&y.classList.add("btn","btn-primary"),b.search.classList.add("form-control")),b}(this.options),!Array.isArray(this.options.iconSource)&&this.options.iconSource.length>0&&(this.options.iconSource=[this.options.iconSource])}},{key:"_binEvents",value:function _binEvents(){var u,y,v=this,_=this.options,b=this.root,g=this.element,w=[];this._eventBindings=[p(g,"click",(function(){return v.show()})),p(b.close,"click",(function(){return v.hide()})),p(b.modal,"click",(function(u){u.target===b.modal&&v.hide()})),p(b.search,"keyup",(u=function r(u){var y=v.availableIcons.filter((function(y){var p;return y.value.includes(u.target.value.toLowerCase())||(null===(p=y.categories)||void 0===p?void 0:p.filter((function(y){return y.includes(u.target.value.toLowerCase())})).length)>0}));w.length||(w=document.querySelectorAll(".icon-element")),w.forEach((function(u){u.hidden=!0,y.forEach((function(y){u.classList.contains(y.value)&&(u.hidden=!1)}))}));var r=b.content.querySelector(".is-empty");y.length>0?r&&r.remove():r||b.content.appendChild(o('<div class="is-empty">'.concat(_.i18n["text:empty"],"</div>")))},function(){var p=arguments,v=this;clearTimeout(y),y=setTimeout((function(){u.apply(v,p)}),250)}))],_.closeOnSelect||this._eventBindings.push(p(b.save,"click",(function(){return v._onSave()})))}},{key:"hide",value:function hide(){return!!this.isOpen()&&(this.root.modal.classList.remove("is-visible"),this._emit("hide"),this)}},{key:"show",value:function show(){return!this.isOpen()&&(this.root.modal.classList.add("is-visible"),this._emit("show"),this)}},{key:"clear",value:function clear(){this.initialized&&this.currentlySelectName&&(this.currentlySelectName=null,this._emit("clear"))}},{key:"isOpen",value:function isOpen(){return this.root.modal.classList.contains("is-visible")}},{key:"destroy",value:function destroy(){var u=this,y=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.initialized=!1,this._eventBindings.forEach((function(u){return v.apply(void 0,_toConsumableArray(u))})),y&&Object.keys(this).forEach((function(y){return delete u[y]}))}},{key:"_emit",value:function _emit(u){for(var y=this,p=arguments.length,v=new Array(p>1?p-1:0),_=1;_<p;_++)v[_-1]=arguments[_];this._eventListener[u].forEach((function(u){return u.apply(void 0,v.concat([y]))}))}},{key:"on",value:function on(u,y){return void 0!==this._eventListener[u]&&(this._eventListener[u].push(y),this)}},{key:"off",value:function off(u,y){var p=this._eventListener[u]||[],v=p.indexOf(y);return~v&&p.splice(v,1),this}},{key:"_createModal",value:function _createModal(){document.body.appendChild(this.root.modal),this.initialized=!0}},{key:"_onSave",value:function _onSave(){this._setValueInput(),this.hide(),this._emit("save",this.emitValues)}},{key:"_renderdIcons",value:(y=_asyncToGenerator(_regeneratorRuntime().mark((function _callee(){var u,y,p,v,_,b,g,w,k=this;return _regeneratorRuntime().wrap((function _callee$(x){for(;;)switch(x.prev=x.next){case 0:return u=this.root,y=this.options,p=null,v=null,_=null,this.availableIcons=[],u.content.innerHTML="",x.next=6,this._getIcons();case 6:if(x.sent.forEach((function(b){for(var g=b.iconFormat?b.iconFormat:"svg",w=function _loop(){var w,O=_slicedToArray(S[x],2),A=O[0],E=O[1],L=document.createElement("button");if(L.title=A,L.className="icon-element ".concat(A),L.dataset.value=b.prefix+A,b.categories&&Object.entries(b.categories).length>0){_=[];for(var j=0,I=Object.entries(b.categories);j<I.length;j++){var P=_slicedToArray(I[j],1)[0];b.categories[P].includes(A)&&(_.length>0?_.push(P.toLowerCase()):_=[P.toLowerCase()])}}if(b.chars&&(L.dataset.unicode=l(b.chars,A)),"i"!==g&&E.body)if("markup"===g){var T=document.createElement("template");T.innerHTML=E.body,w=T.content}else(w=document.createElementNS("http://www.w3.org/2000/svg","svg")).setAttribute("height","24"),w.setAttribute("width","24"),w.setAttribute("viewBox","0 0 ".concat(E.width?E.width:b.width," ").concat(E.height?E.height:b.height)),w.innerHTML=E.body;else(w=document.createElement("i")).setAttribute("class",L.dataset.value);L.append(w),u.content.appendChild(L),k.availableIcons.push(_objectSpread({value:A,body:w.outerHTML},_.length>0&&{categories:_})),L.addEventListener("click",(function(u){k.currentlySelectName!==u.currentTarget.firstChild.className&&(u.currentTarget.classList.add("is-selected"),v=u.currentTarget,k.currentlySelectName=v.dataset.value,k.SVGString=w.outerHTML,k.emitValues={name:A,value:k.currentlySelectName,svg:k.SVGString},b.chars&&(k.emitValues.unicode=w.dataset.unicode),k._emit("select",k.emitValues)),p&&p.classList.remove("is-selected"),y.closeOnSelect&&k._onSave(),p=v}))},x=0,S=Object.entries(b.icons);x<S.length;x++)w()})),!y.defaultValue&&!this.element.value){x.next=10;break}g=document.querySelector('[data-value="'.concat(y.defaultValue?y.defaultValue:this.element.value,'"]'))?document.querySelector('[data-value="'.concat(y.defaultValue?y.defaultValue:this.element.value,'"]')):document.querySelector(".".concat(y.defaultValue?y.defaultValue:this.element.value)),w=null!==(b=null===g||void 0===g?void 0:g.dataset.value)&&void 0!==b?b:"",null!==g&&void 0!==g&&g.classList.add("is-selected"),p=g,this.currentlySelectName=w,this.element.value||this._setValueInput();case 10:case"end":return x.stop()}}),_callee,this)}))),function _renderdIcons(){return y.apply(this,arguments)})},{key:"_getIcons",value:(u=_asyncToGenerator(_regeneratorRuntime().mark((function _callee2(){var u,y,p,v,_,b;return _regeneratorRuntime().wrap((function _callee2$(g){for(;;)switch(g.prev=g.next){case 0:for(u=this.options,y=[],p=h(u.iconSource),v=0,_=Object.values(p);v<_.length;v++)b=_[v],y.push(b.url);return g.next=5,Promise.all(y.map((function(u){return fetch(u).then((function(u){return u.json()}))}))).then((function(u){return u.forEach((function(u){p.hasOwnProperty(u.prefix)&&(u.prefix=p[u.prefix].prefix)})),u}));case 5:return g.abrupt("return",g.sent);case 6:case"end":return g.stop()}}),_callee2,this)}))),function _getIcons(){return u.apply(this,arguments)})},{key:"_catchError",value:function _catchError(u){if("iconSourceMissing"===u)throw Error("No icon source was found.")}},{key:"_setValueInput",value:function _setValueInput(){var u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.currentlySelectName,y=this.element;y instanceof HTMLInputElement&&this.currentlySelectName&&(y.value=u)}}]);var u,y}();return _defineProperty(g,"DEFAULT_OPTIONS",{theme:"default",closeOnSelect:!0,defaultValue:null,iconSource:[],i18n:{"input:placeholder":"Search icon\u2026","text:title":"Select icon","text:empty":"No results found\u2026","btn:save":"Save"}}),y.default}()},"object"==_typeof(y)&&"object"==_typeof(u)?u.exports=g():(_=[],void 0===(b="function"===typeof(v=g)?v.apply(y,_):v)||(u.exports=b))}},y={};function __webpack_require__(p){var v=y[p];if(void 0!==v)return v.exports;var _=y[p]={id:p,loaded:!1,exports:{}};return u[p](_,_.exports,__webpack_require__),_.loaded=!0,_.exports}__webpack_require__.n=function(u){var y=u&&u.__esModule?function(){return u.default}:function(){return u};return __webpack_require__.d(y,{a:y}),y},__webpack_require__.d=function(u,y){for(var p in y)__webpack_require__.o(y,p)&&!__webpack_require__.o(u,p)&&Object.defineProperty(u,p,{enumerable:!0,get:y[p]})},__webpack_require__.o=function(u,y){return Object.prototype.hasOwnProperty.call(u,y)},__webpack_require__.nmd=function(u){return u.paths=[],u.children||(u.children=[]),u},function(){"use strict";var u=__webpack_require__(155),y=__webpack_require__.n(u);jQuery.entwine((function($){$(".icp-auto").entwine({onmatch:function onmatch(){new(y())($(".icp-auto")[0],{theme:"bootstrap-5",iconSource:["FontAwesome Brands 6","FontAwesome Solid 6","FontAwesome Regular 6"],closeOnSelect:!0,defaultValue:null,i18n:{"input:placeholder":"Search icon\u2026","text:title":"Select icon","text:empty":"No results found\u2026","btn:save":"Save"}})}})}))}()}();