UNPKG

@salla.sa/twilight-components

Version:
4 lines 376 kB
/*! * Crafted with ❤ by Salla */ function t(t,e){return e.forEach((function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach((function(n){if("default"!==n&&!(n in t)){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}))})),Object.freeze(t)}var e,n,r,i,o,u,s,a,l,c,d,f,h,p,D,m,g,v,F,b,y,w,E,A,C,S,k,_,B,j,x,O,I,$,P,T,R,z,U,N,L,q,M,J,G,H,V,W,K,Q,X,Z,Y,tt,et,nt,rt,it,ot,ut,st,at,lt,ct,dt,ft,ht,pt,Dt,mt,gt,vt,Ft,bt,yt,wt,Et,At,Ct,St,kt,_t,Bt,jt,xt,Ot,It,$t,Pt,Tt,Rt,zt,Ut,Nt,Lt,qt,Mt,Jt,Gt,Ht,Vt,Wt,Kt,Qt,Xt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Zt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Yt(){return n?e:(n=1,e=Array.isArray)}function te(){if(u)return o;u=1;var t=i?r:(i=1,r="object"==typeof Xt&&Xt&&Xt.Object===Object&&Xt),e="object"==typeof self&&self&&self.Object===Object&&self,n=t||e||Function("return this")();return o=n}function ee(){if(a)return s;a=1;var t=te();return s=t.Symbol}function ne(){if(p)return h;p=1;var t=ee(),e=function(){if(c)return l;c=1;var t=ee(),e=Object.prototype,n=e.hasOwnProperty,r=e.toString,i=t?t.toStringTag:void 0;return l=function(t){var e=n.call(t,i),o=t[i];try{t[i]=void 0;var u=!0}catch(t){}var s=r.call(t);return u&&(e?t[i]=o:delete t[i]),s}}(),n=function(){if(f)return d;f=1;var t=Object.prototype.toString;return d=function(e){return t.call(e)}}(),r=t?t.toStringTag:void 0;return h=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":r&&r in Object(t)?e(t):n(t)}}function re(){if(v)return g;v=1;var t=ne(),e=m?D:(m=1,D=function(t){return null!=t&&"object"==typeof t});return g=function(n){return"symbol"==typeof n||e(n)&&"[object Symbol]"==t(n)}}function ie(){return w?y:(w=1,y=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)})}function oe(){if(O)return x;O=1;var t=function(){if(A)return E;A=1;var t=ne(),e=ie();return E=function(n){if(!e(n))return!1;var r=t(n);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r}}(),e=function(){if(_)return k;_=1;var t=function(){if(S)return C;S=1;var t=te();return C=t["__core-js_shared__"]}(),e=function(){var e=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();return k=function(t){return!!e&&e in t}}(),n=ie(),r=function(){if(j)return B;j=1;var t=Function.prototype.toString;return B=function(e){if(null!=e){try{return t.call(e)}catch(t){}try{return e+""}catch(t){}}return""}}(),i=/^\[object .+?Constructor\]$/,o=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return x=function(u){return!(!n(u)||e(u))&&(t(u)?o:i).test(r(u))}}function ue(){if(T)return P;T=1;var t=oe(),e=$?I:($=1,I=function(t,e){return null==t?void 0:t[e]});return P=function(n,r){var i=e(n,r);return t(i)?i:void 0}}function se(){if(z)return R;z=1;var t=ue()(Object,"create");return R=t}function ae(){if(nt)return et;nt=1;var t=tt?Y:(tt=1,Y=function(t,e){return t===e||t!=t&&e!=e});return et=function(e,n){for(var r=e.length;r--;)if(t(e[r][0],n))return r;return-1}}function le(){if(mt)return Dt;mt=1;var t=function(){if(Q)return K;Q=1;var t=function(){if(N)return U;N=1;var t=se();return U=function(){this.__data__=t?t(null):{},this.size=0}}(),e=q?L:(q=1,L=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}),n=function(){if(J)return M;J=1;var t=se(),e=Object.prototype.hasOwnProperty;return M=function(n){var r=this.__data__;if(t){var i=r[n];return"__lodash_hash_undefined__"===i?void 0:i}return e.call(r,n)?r[n]:void 0}}(),r=function(){if(H)return G;H=1;var t=se(),e=Object.prototype.hasOwnProperty;return G=function(n){var r=this.__data__;return t?void 0!==r[n]:e.call(r,n)}}(),i=function(){if(W)return V;W=1;var t=se();return V=function(e,n){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=t&&void 0===n?"__lodash_hash_undefined__":n,this}}();function o(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}return o.prototype.clear=t,o.prototype.delete=e,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,K=o}(),e=function(){if(ft)return dt;ft=1;var t=Z?X:(Z=1,X=function(){this.__data__=[],this.size=0}),e=function(){if(it)return rt;it=1;var t=ae(),e=Array.prototype.splice;return rt=function(n){var r=this.__data__,i=t(r,n);return!(i<0||(i==r.length-1?r.pop():e.call(r,i,1),--this.size,0))}}(),n=function(){if(ut)return ot;ut=1;var t=ae();return ot=function(e){var n=this.__data__,r=t(n,e);return r<0?void 0:n[r][1]}}(),r=function(){if(at)return st;at=1;var t=ae();return st=function(e){return t(this.__data__,e)>-1}}(),i=function(){if(ct)return lt;ct=1;var t=ae();return lt=function(e,n){var r=this.__data__,i=t(r,e);return i<0?(++this.size,r.push([e,n])):r[i][1]=n,this}}();function o(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}return o.prototype.clear=t,o.prototype.delete=e,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,dt=o}(),n=function(){if(pt)return ht;pt=1;var t=ue()(te(),"Map");return ht=t}();return Dt=function(){this.size=0,this.__data__={hash:new t,map:new(n||e),string:new t}}}function ce(){if(bt)return Ft;bt=1;var t=vt?gt:(vt=1,gt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t});return Ft=function(e,n){var r=e.__data__;return t(n)?r["string"==typeof n?"string":"hash"]:r.map},Ft}function de(){if($t)return It;$t=1;var t=function(){if(Ot)return xt;Ot=1;var t=function(){if(jt)return Bt;jt=1;var t=le(),e=function(){if(wt)return yt;wt=1;var t=ce();return yt=function(e){var n=t(this,e).delete(e);return this.size-=n?1:0,n}}(),n=function(){if(At)return Et;At=1;var t=ce();return Et=function(e){return t(this,e).get(e)}}(),r=function(){if(St)return Ct;St=1;var t=ce();return Ct=function(e){return t(this,e).has(e)}}(),i=function(){if(_t)return kt;_t=1;var t=ce();return kt=function(e,n){var r=t(this,e),i=r.size;return r.set(e,n),this.size+=r.size==i?0:1,this}}();function o(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}return o.prototype.clear=t,o.prototype.delete=e,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,Bt=o}();function e(n,r){if("function"!=typeof n||null!=r&&"function"!=typeof r)throw new TypeError("Expected a function");var i=function(){var t=arguments,e=r?r.apply(this,t):t[0],o=i.cache;if(o.has(e))return o.get(e);var u=n.apply(this,t);return i.cache=o.set(e,u)||o,u};return i.cache=new(e.Cache||t),i}return e.Cache=t,xt=e}();return It=function(e){var n=t(e,(function(t){return 500===r.size&&r.clear(),t})),r=n.cache;return n}}function fe(){if(Jt)return Mt;Jt=1;var t=Yt(),e=function(){if(b)return F;b=1;var t=Yt(),e=re(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;return F=function(i,o){if(t(i))return!1;var u=typeof i;return!("number"!=u&&"symbol"!=u&&"boolean"!=u&&null!=i&&!e(i))||r.test(i)||!n.test(i)||null!=o&&i in Object(o)}}(),n=function(){if(Tt)return Pt;Tt=1;var t=de(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=t((function(t){var r=[];return 46===t.charCodeAt(0)&&r.push(""),t.replace(e,(function(t,e,i,o){r.push(i?o.replace(n,"$1"):e||t)})),r}));return Pt=r}(),r=function(){if(qt)return Lt;qt=1;var t=function(){if(Nt)return Ut;Nt=1;var t=ee(),e=zt?Rt:(zt=1,Rt=function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}),n=Yt(),r=re(),i=t?t.prototype:void 0,o=i?i.toString:void 0;return Ut=function t(i){if("string"==typeof i)return i;if(n(i))return e(i,t)+"";if(r(i))return o?o.call(i):"";var u=i+"";return"0"==u&&1/i==-1/0?"-0":u}}();return Lt=function(e){return null==e?"":t(e)}}();return Mt=function(i,o){return t(i)?i:e(i,o)?[i]:n(r(i))}}var he,pe,De,me,ge,ve=Zt(function(){if(Qt)return Kt;Qt=1;var t=function(){if(Wt)return Vt;Wt=1;var t=fe(),e=function(){if(Ht)return Gt;Ht=1;var t=re();return Gt=function(e){if("string"==typeof e||t(e))return e;var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}}();return Vt=function(n,r){for(var i=0,o=(r=t(r,n)).length;null!=n&&i<o;)n=n[e(r[i++])];return i&&i==o?n:void 0}}();return Kt=function(e,n,r){var i=null==e?void 0:t(e,n);return void 0===i?r:i}}()),Fe={exports:{}},be=(he||(he=1,function(t){!function(e){var n=Object.hasOwnProperty,r=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},i="object"==typeof process&&"function"==typeof process.nextTick,o="function"==typeof Symbol,u="object"==typeof Reflect,s="function"==typeof setImmediate?setImmediate:setTimeout,a=o?u&&"function"==typeof Reflect.ownKeys?Reflect.ownKeys:function(t){var e=Object.getOwnPropertyNames(t);return e.push.apply(e,Object.getOwnPropertySymbols(t)),e}:Object.keys;function l(){this._events={},this._conf&&c.call(this,this._conf)}function c(t){t&&(this._conf=t,t.delimiter&&(this.delimiter=t.delimiter),t.maxListeners!==e&&(this._maxListeners=t.maxListeners),t.wildcard&&(this.wildcard=t.wildcard),t.newListener&&(this._newListener=t.newListener),t.removeListener&&(this._removeListener=t.removeListener),t.verboseMemoryLeak&&(this.verboseMemoryLeak=t.verboseMemoryLeak),t.ignoreErrors&&(this.ignoreErrors=t.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function d(t,e){var n="(node) warning: possible EventEmitter memory leak detected. "+t+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(n+=" Event name: "+e+"."),"undefined"!=typeof process&&process.emitWarning){var r=Error(n);r.name="MaxListenersExceededWarning",r.emitter=this,r.count=t,process.emitWarning(r)}else console.error(n),console.trace&&console.trace()}var f=function(t,e,n){var r=arguments.length;switch(r){case 0:return[];case 1:return[t];case 2:return[t,e];case 3:return[t,e,n];default:for(var i=Array(r);r--;)i[r]=arguments[r];return i}};function h(t,n){for(var r={},i=t.length,o=0;o<i;o++)r[t[o]]=o<0?n[o]:e;return r}function p(t,e,n){var r,i;if(this._emitter=t,this._target=e,this._listeners={},this._listenersCount=0,(n.on||n.off)&&(r=n.on,i=n.off),e.addEventListener?(r=e.addEventListener,i=e.removeEventListener):e.addListener?(r=e.addListener,i=e.removeListener):e.on&&(r=e.on,i=e.off),!r&&!i)throw Error("target does not implement any known event API");if("function"!=typeof r)throw TypeError("on method must be a function");if("function"!=typeof i)throw TypeError("off method must be a function");this._on=r,this._off=i;var o=t._observers;o?o.push(this):t._observers=[this]}function D(t,r,i){var o=Object.assign({},r);if(!t)return o;if("object"!=typeof t)throw TypeError("options must be an object");var u,s,a,l=Object.keys(t),c=l.length;function d(t){throw Error('Invalid "'+u+'" option value'+(t?". Reason: "+t:""))}for(var f=0;f<c;f++){if(!n.call(r,u=l[f]))throw Error('Unknown "'+u+'" option');(s=t[u])!==e&&(o[u]=(a=i[u])?a(s,d):s)}return o}function m(t,e){return"function"==typeof t&&t.hasOwnProperty("prototype")||e("value must be a constructor"),t}function g(t){var e="value must be type of "+t.join("|"),n=t.length,r=t[0],i=t[1];return 1===n?function(t,n){if(typeof t===r)return t;n(e)}:2===n?function(t,n){var o=typeof t;if(o===r||o===i)return t;n(e)}:function(r,i){for(var o=typeof r,u=n;u-- >0;)if(o===t[u])return r;i(e)}}Object.assign(p.prototype,{subscribe:function(t,e,n){var r=this,i=this._target,o=this._emitter,u=this._listeners,s=function(){var r=f.apply(null,arguments),u={data:r,name:e,original:t};n?!1!==n.call(i,u)&&o.emit.apply(o,[u.name].concat(r)):o.emit.apply(o,[e].concat(r))};if(u[t])throw Error("Event '"+t+"' is already listening");this._listenersCount++,o._newListener&&o._removeListener&&!r._onNewListener?(this._onNewListener=function(n){n===e&&null===u[t]&&(u[t]=s,r._on.call(i,t,s))},o.on("newListener",this._onNewListener),this._onRemoveListener=function(n){n===e&&!o.hasListeners(n)&&u[t]&&(u[t]=null,r._off.call(i,t,s))},u[t]=null,o.on("removeListener",this._onRemoveListener)):(u[t]=s,r._on.call(i,t,s))},unsubscribe:function(t){var e,n,r,i=this,o=this._listeners,u=this._emitter,s=this._off,l=this._target;if(t&&"string"!=typeof t)throw TypeError("event must be a string");function c(){i._onNewListener&&(u.off("newListener",i._onNewListener),u.off("removeListener",i._onRemoveListener),i._onNewListener=null,i._onRemoveListener=null);var t=y.call(u,i);u._observers.splice(t,1)}if(t){if(!(e=o[t]))return;s.call(l,t,e),delete o[t],--this._listenersCount||c()}else{for(r=(n=a(o)).length;r-- >0;)s.call(l,t=n[r],o[t]);this._listeners={},this._listenersCount=0,c()}}});var v=g(["function"]),F=g(["object","function"]);function b(t,e,n){var r,i,o,u=0,s=new t((function(a,l,c){function d(){i&&(i=null),u&&(clearTimeout(u),u=0)}n=D(n,{timeout:0,overload:!1},{timeout:function(t,e){return("number"!=typeof(t*=1)||t<0||!Number.isFinite(t))&&e("timeout must be a positive number"),t}});var f=function(t){d(),a(t)},h=function(t){d(),l(t)};(r=!n.overload&&"function"==typeof t.prototype.cancel&&"function"==typeof c)?e(f,h,c):(i=[function(t){h(t||Error("canceled"))}],e(f,h,(function(t){if(o)throw Error("Unable to subscribe on cancel event asynchronously");if("function"!=typeof t)throw TypeError("onCancel callback must be a function");i.push(t)})),o=!0),n.timeout>0&&(u=setTimeout((function(){var t=Error("timeout");t.code="ETIMEDOUT",u=0,s.cancel(t),l(t)}),n.timeout))}));return r||(s.cancel=function(t){if(i){for(var e=i.length,n=1;n<e;n++)i[n](t);i[0](t),i=null}}),s}function y(t){var e=this._observers;if(!e)return-1;for(var n=e.length,r=0;r<n;r++)if(e[r]._target===t)return r;return-1}function w(t,e,n,r,i){if(!n)return null;if(0===r){var o=typeof e;if("string"===o){var u,s,l=0,c=0,d=this.delimiter,f=d.length;if(-1!==(s=e.indexOf(d))){u=[,,,,,];do{u[l++]=e.slice(c,s),c=s+f}while(-1!==(s=e.indexOf(d,c)));u[l++]=e.slice(c),e=u,i=l}else e=[e],i=1}else"object"===o?i=e.length:(e=[e],i=1)}var h,p,D,m,g,v,F,b=null,y=e[r],E=e[r+1];if(r===i)n._listeners&&("function"==typeof n._listeners?(t&&t.push(n._listeners),b=[n]):(t&&t.push.apply(t,n._listeners),b=[n]));else{if("*"===y){for(s=(v=a(n)).length;s-- >0;)"_listeners"!==(h=v[s])&&(F=w(t,e,n[h],r+1,i))&&(b?b.push.apply(b,F):b=F);return b}if("**"===y){for((g=r+1===i||r+2===i&&"*"===E)&&n._listeners&&(b=w(t,e,n,i,i)),s=(v=a(n)).length;s-- >0;)"_listeners"!==(h=v[s])&&("*"===h||"**"===h?(n[h]._listeners&&!g&&(F=w(t,e,n[h],i,i))&&(b?b.push.apply(b,F):b=F),F=w(t,e,n[h],r,i)):F=w(t,e,n[h],h===E?r+2:r,i),F&&(b?b.push.apply(b,F):b=F));return b}n[y]&&(b=w(t,e,n[y],r+1,i))}if((p=n["*"])&&w(t,e,p,r+1,i),D=n["**"])if(r<i)for(D._listeners&&w(t,e,D,i,i),s=(v=a(D)).length;s-- >0;)"_listeners"!==(h=v[s])&&(h===E?w(t,e,D[h],r+2,i):h===y?w(t,e,D[h],r+1,i):((m={})[h]=D[h],w(t,e,{"**":m},r+1,i)));else D._listeners?w(t,e,D,i,i):D["*"]&&D["*"]._listeners&&w(t,e,D["*"],i,i);return b}function E(t,e,n){var r,i,o=0,u=0,s=this.delimiter,a=s.length;if("string"==typeof t)if(-1!==(r=t.indexOf(s))){i=[,,,,,];do{i[o++]=t.slice(u,r),u=r+a}while(-1!==(r=t.indexOf(s,u)));i[o++]=t.slice(u)}else i=[t],o=1;else i=t,o=t.length;if(o>1)for(r=0;r+1<o;r++)if("**"===i[r]&&"**"===i[r+1])return;var l,c=this.listenerTree;for(r=0;r<o;r++)if(c=c[l=i[r]]||(c[l]={}),r===o-1)return c._listeners?("function"==typeof c._listeners&&(c._listeners=[c._listeners]),n?c._listeners.unshift(e):c._listeners.push(e),!c._listeners.warned&&this._maxListeners>0&&c._listeners.length>this._maxListeners&&(c._listeners.warned=!0,d.call(this,c._listeners.length,l))):c._listeners=e,!0;return!0}function A(t,e,n,r){for(var i,o,u,s,l=a(t),c=l.length,d=t._listeners;c-- >0;)i=t[o=l[c]],u="_listeners"===o?n:n?n.concat(o):[o],s=r||"symbol"==typeof o,d&&e.push(s?u:u.join(this.delimiter)),"object"==typeof i&&A.call(this,i,e,u,s);return e}function C(t){for(var e,n,r,i=a(t),o=i.length;o-- >0;)(e=t[n=i[o]])&&(r=!0,"_listeners"===n||C(e)||delete t[n]);return r}function S(t,e,n){this.emitter=t,this.event=e,this.listener=n}function k(t,n,r){if(!0===r)u=!0;else if(!1===r)o=!0;else{if(!r||"object"!=typeof r)throw TypeError("options should be an object or true");var o=r.async,u=r.promisify,a=r.nextTick,l=r.objectify}if(o||a||u){var c=n,d=n._origin||n;if(a&&!i)throw Error("process.nextTick is not supported");u===e&&(u="AsyncFunction"===n.constructor.name),n=function(){var t=arguments,e=this,n=this.event;return u?a?Promise.resolve():new Promise((function(t){s(t)})).then((function(){return e.event=n,c.apply(e,t)})):(a?process.nextTick:s)((function(){e.event=n,c.apply(e,t)}))},n._async=!0,n._origin=d}return[n,l?new S(this,t,n):this]}function _(t){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,c.call(this,t)}S.prototype.off=function(){return this.emitter.off(this.event,this.listener),this},_.EventEmitter2=_,_.prototype.listenTo=function(t,n,i){if("object"!=typeof t)throw TypeError("target musts be an object");var o=this;function u(e){if("object"!=typeof e)throw TypeError("events must be an object");var n,r=i.reducers,u=y.call(o,t);n=-1===u?new p(o,t,i):o._observers[u];for(var s,l=a(e),c=l.length,d="function"==typeof r,f=0;f<c;f++)n.subscribe(s=l[f],e[s]||s,d?r:r&&r[s])}return i=D(i,{on:e,off:e,reducers:e},{on:v,off:v,reducers:F}),r(n)?u(h(n)):u("string"==typeof n?h(n.split(/\s+/)):n),this},_.prototype.stopListeningTo=function(t,e){var n=this._observers;if(!n)return!1;var r,i=n.length,o=!1;if(t&&"object"!=typeof t)throw TypeError("target should be an object");for(;i-- >0;)r=n[i],t&&r._target!==t||(r.unsubscribe(e),o=!0);return o},_.prototype.delimiter=".",_.prototype.setMaxListeners=function(t){t!==e&&(this._maxListeners=t,this._conf||(this._conf={}),this._conf.maxListeners=t)},_.prototype.getMaxListeners=function(){return this._maxListeners},_.prototype.event="",_.prototype.once=function(t,e,n){return this._once(t,e,!1,n)},_.prototype.prependOnceListener=function(t,e,n){return this._once(t,e,!0,n)},_.prototype._once=function(t,e,n,r){return this._many(t,1,e,n,r)},_.prototype.many=function(t,e,n,r){return this._many(t,e,n,!1,r)},_.prototype.prependMany=function(t,e,n,r){return this._many(t,e,n,!0,r)},_.prototype._many=function(t,e,n,r,i){var o=this;if("function"!=typeof n)throw Error("many only accepts instances of Function");function u(){return 0==--e&&o.off(t,u),n.apply(this,arguments)}return u._origin=n,this._on(t,u,r,i)},_.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||l.call(this);var t,e,n,r,i,u,s=arguments[0],a=this.wildcard;if("newListener"===s&&!this._newListener&&!this._events.newListener)return!1;if(a&&(t=s,"newListener"!==s&&"removeListener"!==s&&"object"==typeof s)){if(n=s.length,o)for(r=0;r<n;r++)if("symbol"==typeof s[r]){u=!0;break}u||(s=s.join(this.delimiter))}var c,d=arguments.length;if(this._all&&this._all.length)for(r=0,n=(c=this._all.slice()).length;r<n;r++)switch(this.event=s,d){case 1:c[r].call(this,s);break;case 2:c[r].call(this,s,arguments[1]);break;case 3:c[r].call(this,s,arguments[1],arguments[2]);break;default:c[r].apply(this,arguments)}if(a)w.call(this,c=[],t,this.listenerTree,0,n);else{if("function"==typeof(c=this._events[s])){switch(this.event=s,d){case 1:c.call(this);break;case 2:c.call(this,arguments[1]);break;case 3:c.call(this,arguments[1],arguments[2]);break;default:for(e=Array(d-1),i=1;i<d;i++)e[i-1]=arguments[i];c.apply(this,e)}return!0}c&&(c=c.slice())}if(c&&c.length){if(d>3)for(e=Array(d-1),i=1;i<d;i++)e[i-1]=arguments[i];for(r=0,n=c.length;r<n;r++)switch(this.event=s,d){case 1:c[r].call(this);break;case 2:c[r].call(this,arguments[1]);break;case 3:c[r].call(this,arguments[1],arguments[2]);break;default:c[r].apply(this,e)}return!0}if(!this.ignoreErrors&&!this._all&&"error"===s)throw arguments[1]instanceof Error?arguments[1]:Error("Uncaught, unspecified 'error' event.");return!!this._all},_.prototype.emitAsync=function(){if(!this._events&&!this._all)return!1;this._events||l.call(this);var t,e,n,r,i,u,s=arguments[0],a=this.wildcard;if("newListener"===s&&!this._newListener&&!this._events.newListener)return Promise.resolve([!1]);if(a&&(t=s,"newListener"!==s&&"removeListener"!==s&&"object"==typeof s)){if(r=s.length,o)for(i=0;i<r;i++)if("symbol"==typeof s[i]){e=!0;break}e||(s=s.join(this.delimiter))}var c,d=[],f=arguments.length;if(this._all)for(i=0,r=this._all.length;i<r;i++)switch(this.event=s,f){case 1:d.push(this._all[i].call(this,s));break;case 2:d.push(this._all[i].call(this,s,arguments[1]));break;case 3:d.push(this._all[i].call(this,s,arguments[1],arguments[2]));break;default:d.push(this._all[i].apply(this,arguments))}if(a?w.call(this,c=[],t,this.listenerTree,0):c=this._events[s],"function"==typeof c)switch(this.event=s,f){case 1:d.push(c.call(this));break;case 2:d.push(c.call(this,arguments[1]));break;case 3:d.push(c.call(this,arguments[1],arguments[2]));break;default:for(n=Array(f-1),u=1;u<f;u++)n[u-1]=arguments[u];d.push(c.apply(this,n))}else if(c&&c.length){if(c=c.slice(),f>3)for(n=Array(f-1),u=1;u<f;u++)n[u-1]=arguments[u];for(i=0,r=c.length;i<r;i++)switch(this.event=s,f){case 1:d.push(c[i].call(this));break;case 2:d.push(c[i].call(this,arguments[1]));break;case 3:d.push(c[i].call(this,arguments[1],arguments[2]));break;default:d.push(c[i].apply(this,n))}}else if(!this.ignoreErrors&&!this._all&&"error"===s)return Promise.reject(arguments[1]instanceof Error?arguments[1]:"Uncaught, unspecified 'error' event.");return Promise.all(d)},_.prototype.on=function(t,e,n){return this._on(t,e,!1,n)},_.prototype.prependListener=function(t,e,n){return this._on(t,e,!0,n)},_.prototype.onAny=function(t){return this._onAny(t,!1)},_.prototype.prependAny=function(t){return this._onAny(t,!0)},_.prototype.addListener=_.prototype.on,_.prototype._onAny=function(t,e){if("function"!=typeof t)throw Error("onAny only accepts instances of Function");return this._all||(this._all=[]),e?this._all.unshift(t):this._all.push(t),this},_.prototype._on=function(t,n,r,i){if("function"==typeof t)return this._onAny(t,n),this;if("function"!=typeof n)throw Error("on only accepts instances of Function");this._events||l.call(this);var o,u=this;return i!==e&&(n=(o=k.call(this,t,n,i))[0],u=o[1]),this._newListener&&this.emit("newListener",t,n),this.wildcard?(E.call(this,t,n,r),u):(this._events[t]?("function"==typeof this._events[t]&&(this._events[t]=[this._events[t]]),r?this._events[t].unshift(n):this._events[t].push(n),!this._events[t].warned&&this._maxListeners>0&&this._events[t].length>this._maxListeners&&(this._events[t].warned=!0,d.call(this,this._events[t].length,t))):this._events[t]=n,u)},_.prototype.off=function(t,e){if("function"!=typeof e)throw Error("removeListener only takes instances of Function");var n,i=[];if(this.wildcard){var o="string"==typeof t?t.split(this.delimiter):t.slice();if(!(i=w.call(this,null,o,this.listenerTree,0)))return this}else{if(!this._events[t])return this;i.push({_listeners:n=this._events[t]})}for(var u=0;u<i.length;u++){var s=i[u];if(r(n=s._listeners)){for(var a=-1,l=0,c=n.length;l<c;l++)if(n[l]===e||n[l].listener&&n[l].listener===e||n[l]._origin&&n[l]._origin===e){a=l;break}if(a<0)continue;return this.wildcard?s._listeners.splice(a,1):this._events[t].splice(a,1),0===n.length&&(this.wildcard?delete s._listeners:delete this._events[t]),this._removeListener&&this.emit("removeListener",t,e),this}(n===e||n.listener&&n.listener===e||n._origin&&n._origin===e)&&(this.wildcard?delete s._listeners:delete this._events[t],this._removeListener&&this.emit("removeListener",t,e))}return this.listenerTree&&C(this.listenerTree),this},_.prototype.offAny=function(t){var e,n=0,r=0;if(t&&this._all&&this._all.length>0){for(n=0,r=(e=this._all).length;n<r;n++)if(t===e[n])return e.splice(n,1),this._removeListener&&this.emit("removeListenerAny",t),this}else{if(e=this._all,this._removeListener)for(n=0,r=e.length;n<r;n++)this.emit("removeListenerAny",e[n]);this._all=[]}return this},_.prototype.removeListener=_.prototype.off,_.prototype.removeAllListeners=function(t){if(t===e)return!this._events||l.call(this),this;if(this.wildcard){var n,r=w.call(this,null,t,this.listenerTree,0);if(!r)return this;for(n=0;n<r.length;n++)r[n]._listeners=null;this.listenerTree&&C(this.listenerTree)}else this._events&&(this._events[t]=null);return this},_.prototype.listeners=function(t){var n,r,i,o,u,s=this._events;if(t===e){if(this.wildcard)throw Error("event name required for wildcard emitter");if(!s)return[];for(o=(n=a(s)).length,i=[];o-- >0;)"function"==typeof(r=s[n[o]])?i.push(r):i.push.apply(i,r);return i}if(this.wildcard){if(!(u=this.listenerTree))return[];var l=[],c="string"==typeof t?t.split(this.delimiter):t.slice();return w.call(this,l,c,u,0),l}return s&&(r=s[t])?"function"==typeof r?[r]:r:[]},_.prototype.eventNames=function(t){var e=this._events;return this.wildcard?A.call(this,this.listenerTree,[],null,t):e?a(e):[]},_.prototype.listenerCount=function(t){return this.listeners(t).length},_.prototype.hasListeners=function(t){if(this.wildcard){var n=[],r="string"==typeof t?t.split(this.delimiter):t.slice();return w.call(this,n,r,this.listenerTree,0),n.length>0}var i=this._events,o=this._all;return!!(o&&o.length||i&&(t===e?a(i).length:i[t]))},_.prototype.listenersAny=function(){return this._all?this._all:[]},_.prototype.waitFor=function(t,n){var r=this,i=typeof n;return"number"===i?n={timeout:n}:"function"===i&&(n={filter:n}),b((n=D(n,{timeout:0,filter:e,handleError:!1,Promise,overload:!1},{filter:v,Promise:m})).Promise,(function(e,i,o){function u(){var o=n.filter;if(!o||o.apply(r,arguments))if(r.off(t,u),n.handleError){var s=arguments[0];s?i(s):e(f.apply(null,arguments).slice(1))}else e(f.apply(null,arguments))}o((function(){r.off(t,u)})),r._on(t,u,!1)}),{timeout:n.timeout,overload:n.overload})};var B=_.prototype;Object.defineProperties(_,{defaultMaxListeners:{get:function(){return B._maxListeners},set:function(t){if("number"!=typeof t||t<0||Number.isNaN(t))throw TypeError("n must be a non-negative number");B._maxListeners=t},enumerable:!0},once:{value:function(t,e,n){return b((n=D(n,{Promise,timeout:0,overload:!1},{Promise:m})).Promise,(function(n,r,i){var o;if("function"==typeof t.addEventListener)return o=function(){n(f.apply(null,arguments))},i((function(){t.removeEventListener(e,o)})),void t.addEventListener(e,o,{once:!0});var u,s=function(){u&&t.removeListener("error",u),n(f.apply(null,arguments))};"error"!==e&&(u=function(n){t.removeListener(e,s),r(n)},t.once("error",u)),i((function(){u&&t.removeListener("error",u),t.removeListener(e,s)})),t.once(e,s)}),{timeout:n.timeout,overload:n.overload})},writable:!0,configurable:!0}}),Object.defineProperties(B,{_maxListeners:{value:10,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),t.exports=_}()}(Fe)),Fe.exports);function ye(){if(De)return pe;De=1;var t=Object.assign?Object.assign:function(t){for(var e=1;e<arguments.length;e++)i(Object(arguments[e]),(function(e,n){t[n]=e}));return t},e=function(){if(Object.create)return function(e,n,i,o){var u=r(arguments,1);return t.apply(this,[Object.create(e)].concat(u))};{function e(){}return function(n,i,o,u){var s=r(arguments,1);return e.prototype=n,t.apply(this,[new e].concat(s))}}}(),n="undefined"!=typeof window?window:Xt;function r(t,e){return Array.prototype.slice.call(t,e||0)}function i(t,e){o(t,(function(t,n){return e(t,n),!1}))}function o(t,e){if(u(t)){for(var n=0;n<t.length;n++)if(e(t[n],n))return t[n]}else for(var r in t)if(t.hasOwnProperty(r)&&e(t[r],r))return t[r]}function u(t){return null!=t&&"function"!=typeof t&&"number"==typeof t.length}return pe={assign:t,create:e,trim:String.prototype.trim?function(t){return String.prototype.trim.call(t)}:function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},bind:function(t,e){return function(){return e.apply(t,Array.prototype.slice.call(arguments,0))}},slice:r,each:i,map:function(t,e){var n=u(t)?[]:{};return o(t,(function(t,r){return n[r]=e(t,r),!1})),n},pluck:o,isList:u,isFunction:function(t){return t&&"[object Function]"==={}.toString.call(t)},isObject:function(t){return t&&"[object Object]"==={}.toString.call(t)},Global:n},pe}var we,Ee,Ae,Ce,Se,ke,_e,Be,je=function(){if(ge)return me;ge=1;var t=ye(),e=t.slice,n=t.pluck,r=t.each,i=t.bind,o=t.create,u=t.isList,s=t.isFunction,a=t.isObject,l={version:"2.0.12",enabled:!1,get:function(t,e){var n=this.storage.read(this._namespacePrefix+t);return this._deserialize(n,e)},set:function(t,e){return void 0===e?this.remove(t):(this.storage.write(this._namespacePrefix+t,this._serialize(e)),e)},remove:function(t){this.storage.remove(this._namespacePrefix+t)},each:function(t){var e=this;this.storage.each((function(n,r){t.call(e,e._deserialize(n),(r||"").replace(e._namespaceRegexp,""))}))},clearAll:function(){this.storage.clearAll()},hasNamespace:function(t){return this._namespacePrefix=="__storejs_"+t+"_"},createStore:function(){return c.apply(this,arguments)},addPlugin:function(t){this._addPlugin(t)},namespace:function(t){return c(this.storage,this.plugins,t)}};function c(t,c,d){d||(d=""),t&&!u(t)&&(t=[t]),c&&!u(c)&&(c=[c]);var f=d?"__storejs_"+d+"_":"",h=d?RegExp("^"+f):null;if(!/^[a-zA-Z0-9_\-]*$/.test(d))throw Error("store.js namespaces can only have alphanumerics + underscores and dashes");var p={_namespacePrefix:f,_namespaceRegexp:h,_testStorage:function(t){try{var e="__storejs__test__";t.write(e,e);var n=t.read(e)===e;return t.remove(e),n}catch(t){return!1}},_assignPluginFnProp:function(t,n){var i=this[n];this[n]=function(){var n=e(arguments,0),o=this,u=[function(){if(i)return r(arguments,(function(t,e){n[e]=t})),i.apply(o,n)}].concat(n);return t.apply(o,u)}},_serialize:function(t){return JSON.stringify(t)},_deserialize:function(t,e){if(!t)return e;var n="";try{n=JSON.parse(t)}catch(e){n=t}return void 0!==n?n:e},_addStorage:function(t){this.enabled||this._testStorage(t)&&(this.storage=t,this.enabled=!0)},_addPlugin:function(t){var e=this;if(u(t))r(t,(function(t){e._addPlugin(t)}));else if(!n(this.plugins,(function(e){return t===e}))){if(this.plugins.push(t),!s(t))throw Error("Plugins must be function values that return objects");var i=t.call(this);if(!a(i))throw Error("Plugins must return an object of function properties");r(i,(function(n,r){if(!s(n))throw Error("Bad plugin property: "+r+" from plugin "+t.name+". Plugins should only return functions.");e._assignPluginFnProp(n,r)}))}},addStorage:function(t){!function(){var t=void 0===console?null:console;t&&(t.warn?t.warn:t.log).apply(t,arguments)}("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(t)}},D=o(p,l,{plugins:[]});return D.raw={},r(D,(function(t,e){s(t)&&(D.raw[e]=i(D,t))})),r(t,(function(t){D._addStorage(t)})),r(c,(function(t){D._addPlugin(t)})),D}return me={createStore:c}}(),xe=function(){if(Ee)return we;Ee=1;var t=ye().Global;function e(){return t.localStorage}function n(t){return e().getItem(t)}return we={name:"localStorage",read:n,write:function(t,n){return e().setItem(t,n)},each:function(t){for(var r=e().length-1;r>=0;r--){var i=e().key(r);t(n(i),i)}},remove:function(t){return e().removeItem(t)},clearAll:function(){return e().clear()}},we}(),Oe=t({__proto__:null,default:Zt(xe)},[xe]),Ie=function(){if(Ce)return Ae;Ce=1;var t=ye().Global;function e(){return t.sessionStorage}function n(t){return e().getItem(t)}return Ae={name:"sessionStorage",read:n,write:function(t,n){return e().setItem(t,n)},each:function(t){for(var r=e().length-1;r>=0;r--){var i=e().key(r);t(n(i),i)}},remove:function(t){return e().removeItem(t)},clearAll:function(){return e().clear()}},Ae}(),$e=t({__proto__:null,default:Zt(Ie)},[Ie]),Pe=function(){if(ke)return Se;ke=1;var t=ye(),e=t.trim;Se={name:"cookieStorage",read:function(t){if(!t||!o(t))return null;var e="(?:^|.*;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(n.cookie.replace(RegExp(e),"$1"))},write:function(t,e){t&&(n.cookie=escape(t)+"="+escape(e)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/")},each:r,remove:i,clearAll:function(){r((function(t,e){i(e)}))}};var n=t.Global.document;function r(t){for(var r=n.cookie.split(/; ?/g),i=r.length-1;i>=0;i--)if(e(r[i])){var o=r[i].split("="),u=unescape(o[0]);t(unescape(o[1]),u)}}function i(t){t&&o(t)&&(n.cookie=escape(t)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}function o(t){return RegExp("(?:^|;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(n.cookie)}return Se}(),Te=t({__proto__:null,default:Zt(Pe)},[Pe]),Re=function(){if(Be)return _e;Be=1,_e={name:"memoryStorage",read:function(e){return t[e]},write:function(e,n){t[e]=n},each:function(e){for(var n in t)t.hasOwnProperty(n)&&e(t[n],n)},remove:function(e){delete t[e]},clearAll:function(){t={}}};var t={};return _e}(),ze=t({__proto__:null,default:Zt(Re)},[Re]);function Ue(t,e){void 0===e&&(e=!1),t+="";for(var n,r=["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],i=["0","1","2","3","4","5","6","7","8","9"],o=(e=e||!Salla.config.get("store.settings.arabic_numbers_enabled"))?r:i,u=e?i:r,s=0;s<o.length;s++)n=RegExp(o[s],"g"),t=t.replace(n,u[s]);return t.replace(e?"٫":".",e?".":"٫")}function Ne(t){var e=("".concat(t).match(/\./g)||[]).length;return e&&1!==e?Ne(t.replace(/\.(.+)\./g,".$1")):t}function Le(t){return"".concat(t).startsWith("https://")||"".concat(t).startsWith("http://")}function qe(t){if(Le(t))return t;var e=Salla.config.get("store.url");return e||(e=window.location.href.split("/").slice(0,-1).join("/"),Salla.config.set("store.url",e)),e.rtrim("/")+"/"+(null==t?void 0:t.ltrim("/"))}function Me(t,e,n){if(n=n||window.location.href,!e||!t)return n;var r=RegExp("([?&])"+t+"=[^&]+[&]?","g");return(n=n.replace(r,"$1").split("#")[0].replace(/&$|\?$/,"")).includes("?")?n+="&":n+=(n.endsWith("/")?"":"/")+"?",(n+t+"="+encodeURIComponent(e)).replace(/&$|\?$/,"")}function Je(t){return window.location.origin+"/"+(null==t?void 0:t.ltrim("/"))}function Ge(t){return Le(t)?t:Salla.config.get("theme.assets")?Salla.config.get("theme.assets").replace(":path",null==t?void 0:t.ltrim("/")):Je("themes/"+Salla.config.get("theme.name")+"/"+(null==t?void 0:t.ltrim("/")))}String.prototype.toStudlyCase=function(){return this.trim().replace(/([^a-zA-Z\d].)/g,(function(t){return t.toUpperCase().replace(/[^a-zA-Z\d]/g,"")}))},String.prototype.toDatasetName=function(){return this.startsWith("data-")?this.substr(5).toStudlyCase():this.toStudlyCase()},String.prototype.toSelector=function(){return this.trim().startsWith(".")||this.trim().startsWith("#")?""+this:"#"+this},String.prototype.replaceArray=function(t,e){for(var n,r=this,i=0;i<t.length;i++)n=RegExp(t[i],"g"),r=r.replace(n,e[i]);return r},String.prototype.rtrim=function(t){return void 0===t&&(t="\\s"),this.replace(RegExp("["+t+"]*$"),"")},String.prototype.ltrim=function(t){return void 0===t&&(t="\\s"),this.replace(RegExp("^["+t+"]*"),"")},String.prototype.digitsOnly=function(){return Salla.helpers.digitsOnly(this)};var He=Object.freeze({__proto__:null,addParamToUrl:Me,api:function(t){var e;return(null===(e=Salla.config.get("store.api",qe("")))||void 0===e?void 0:e.rtrim("/"))+"/"+(null==t?void 0:t.ltrim("/"))},asset:Ge,base:function(t){return Le(t)?t:"https://"+new URL(qe("/")).hostname+"/"+(null==t?void 0:t.ltrim("/"))},baseUrl:Je,cdn:function(t,e,n){var r="https://cdn.salla.network/";return(e||n)&&(e=e?",width=".concat(e):"",n=n?",height=".concat(n):"",r+="cdn-cgi/image/fit=scale-down".concat(e).concat(n,",onerror=redirect,format=auto/")),r+(null==t?void 0:t.ltrim("/"))},create:function(t,e){return"custom"===t?e:qe("offers"===t?t:"redirect/".concat(t,"/").concat(e))},domain:function(t){return Le(t)?t:"".concat(Salla.config.get("store.url",window.location.href.split("/").slice(0,-1).join("/")).rtrim("/"),"/").concat(null==t?void 0:t.ltrim("/"))},get:qe,is_full_url:Le,is_page:function(t){return t&&Salla.config.get("page.slug")===t},is_placeholder:function(t){return Ge(salla.config.get("theme.settings.placeholder"))===Ge(t)}}),Ve=function(t,e){return Ve=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},Ve(t,e)},We=function(){return We=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},We.apply(this,arguments)};function Ke(t,e,n){if(2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function Qe(t){return t instanceof FormData}function Xe(t){return t instanceof File}function Ze(t){return t instanceof Blob}"function"==typeof SuppressedError&&SuppressedError;var Ye=function(){function t(t){this.data=t,this.proxy=this.createProxy()}return t.prototype.createProxy=function(){var t=this;return new Proxy(this,{get:function(e,n){return n in e?e[n]:"string"==typeof n?t.get(n):void 0},set:function(e,n,r){return"string"==typeof n&&(t.set(n,r),!0)},has:function(e,n){return"string"==typeof n?t.has(n):n in e},deleteProperty:function(e,n){return"string"==typeof n&&t.delete(n)}})},t.prototype.get=function(t){return Qe(this.data)?this.data.get(t):this.data[t]},t.prototype.getAll=function(t){if(Qe(this.data))return this.data.getAll(t);var e=this.data[t];return void 0===e?[]:[e]},t.prototype.set=function(t,e){var n=this;Qe(this.data)?(this.data.delete(t),null!=e&&(Array.isArray(e)?e.forEach((function(e){Xe(e)||Ze(e)?n.data.append(t,e):n.data.append(t,e+"")})):Xe(e)||Ze(e)?this.data.append(t,e):this.data.append(t,e+""))):this.data[t]=e},t.prototype.append=function(t,e){if(Qe(this.data))Xe(e)||Ze(e)?this.data.append(t,e):null!=e&&this.data.append(t,e+"");else{var n=this.data[t];void 0===n?this.data[t]=e:Array.isArray(n)?n.push(e):this.data[t]=[n,e]}},t.prototype.setFile=function(t,e){this.set(t,e)},t.prototype.getFile=function(t){var e=this.get(t);return Xe(e)?e:null},t.prototype.getFiles=function(t){return this.getAll(t).filter(Xe)},t.prototype.has=function(t){return Qe(this.data)?this.data.has(t):t in this.data},t.prototype.delete=function(t){return Qe(this.data)?(this.data.delete(t),!0):delete this.data[t]},t.prototype.keys=function(){if(!Qe(this.data))return Object.keys(this.data);for(var t=new Set,e=0,n=this.data.entries();e<n.length;e++)t.add(n[e][0]);return Array.from(t)},t.prototype.values=function(){if(!Qe(this.data))return Object.values(this.data);for(var t=[],e=0,n=this.data.entries();e<n.length;e++)t.push(n[e][1]);return t},t.prototype.entries=function(){return Qe(this.data)?Array.from(this.data.entries()):Object.entries(this.data)},t.prototype.toObject=function(){if(!Qe(this.data))return We({},this.data);for(var t={},e=0,n=this.data.entries();e<n.length;e++){var r=n[e],i=r[0],o=r[1];void 0!==t[i]?(Array.isArray(t[i])||(t[i]=[t[i]]),t[i].push(o)):t[i]=o}return t},t.prototype.getFileInfo=function(t){var e=this.getFiles(t);return 0===e.length?null:e.map((function(t){return{name:t.name,size:t.size,type:t.type}}))},t.prototype.isFile=function(t){var e=this.get(t);return Xe(e)||Ze(e)},t.prototype.getRawData=function(){return this.data},t.prototype.getProxy=function(){return this.proxy},t}();function tn(t,e,n){var r,i=t[0];return n&&0==t.length?Array.isArray(n)?(n.push(e),n):[n,e]:Array.isArray(n)?(n.push(e),n):"string"==typeof n?[n,e]:n?(n[i]=tn(t.slice(1),e,n[i]),n):i?((r={})[i]=tn(t.slice(1),e),r):""===i?[e]:e}function en(){return window.self!==window.top}var nn,rn,on,un,sn={digitsOnly:function(t){return Ue(t,!0).replace(/[^0-9.]/g,"").replace("..",".").rtrim(".")},inputDigitsOnly:function t(e,n){if(void 0===n&&(n=!1),"string"==typeof e)return document.querySelectorAll(e).forEach((function(e){return t(e,n)}));if(e){var r=Salla.helpers.digitsOnly(e.value);return e.value=e.min&&r<parseInt(e.min)?e.min:e.max&&r>parseInt(e.max)?e.max:e.maxLength>=1&&(""+r).length>e.maxLength?(""+r).substring(0,e.maxLength):n||e.dataset.hasOwnProperty("digitsWithDecimal")?Ne(r):r.replace(/\D/g,"")}Salla.logger.warn("Can't find Object With Id: "+e)},number:Ue,money:function(t,e){void 0===e&&(e=!0);var n=Salla.config.currency(null==t?void 0:t.currency).symbol;return t=Ue(t="object"==typeof t?t.amount:t)+" "+n,e&&["SAR","ر.س"].includes(n)&&Salla.config.get("store.settings.use_sar_symbol")&&(t=t.replace(n,"<i class=sicon-sar></i>")),t},isIframe:en,isPreview:function(){return en()},setNested:function(t,e,n){for(var r=t,i=e.split("."),o=i.length,u=0;u<o-1;u++){var s=i[u];r[s]||(r[s]={}),r=r[s]}return r[i[o-1]]=n,t},getNested:function(t,e,n){var r=ve.default?ve.default(t,e):ve(t,e);return void 0!==r?r:n},inputData:function(t,e,n){if(void 0===n&&(n={}),t.includes("[")){var r=t.split("]").join("").split("["),i=r[0],o=n&&"object"==typeof n?n[i]:void 0;return{name:i,value:tn(r.slice(1),e,o)}}return{name:t,value:e}},url:He,addParamToUrl:Me,debounce:function(t,e){e=e||100;var n,r=[];return function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return clearTimeout(n),n=setTimeout((function(){var e=t.apply(void 0,i);r.forEach((function(t){return t(e)})),r=[]}),e),new Promise((function(t){return r.push(t)}))}},hasApplePay:function(){var t;try{return!!(null===(t=window.ApplePaySession)||void 0===t?void 0:t.canMakePayments())}catch(t){return console.error(t),!1}},createFormDataWrapper:function(t){return new Ye(t).getProxy()},isAppleDevice:function(){try{var t=navigator.userAgent||"",e=navigator.platform||"";return/iPhone|iPad|iPod/i.test(t)||/Mac/i.test(e)}catch(t){return console.error(t),!1}},isIOSDevice:function(){try{var t=navigator.userAgent||"";return/iPhone|iPad|iPod/i.test(t)}catch(t){return console.error(t),!1}},isWebView:function(){try{if(void 0===window.navigator)return!1;var t=window.navigator.userAgent;return/iP(hone|od|ad)/.test(t)&&/AppleWebKit/.test(t)&&!/Safari/.test(t)||/\bwv\b/.test(t)||/Android/.test(t)&&/AppleWebKit/.test(t)&&!/Chrome/.test(t)}catch(t){return console.error(t),!1}}},an=(rn=[],on=[],un={log:function(t,e){if(nn&&salla.config.isDebug()){rn.push([e,t]),"trace"===salla.config.get("debug")&&(e="trace");var n=nn.log,r=void 0===e?n:this.__dict__[e]||n,i=["%cTwilight","color: #5cd5c4;font-weight:bold; border:1px solid #5cd5c4; padding: 2px 6px; border-radius: 5px;"];on.forEach((function(t){i[0]+=t[0],i.push(t[1])}));var o={event:"#CFF680",backend:"#7b68ee"}[e];o&&(i[0]+="%c"+e[0].toUpperCase()+e.substring(1),i.push("margin-left: 5px;color: ".concat(o,";font-weight:bold; border:1px solid ").concat(o,"; padding: 2px 6px; border-radius: 5px;"))),r.call.apply(r,Ke([nn],i.concat.apply(i,t),!1))}},__dict__:{trace:(nn=console).trace,debug:nn.debug,info:nn.info,warn:nn.warn,error:nn.error}},{event:function(){un.log(arguments,"event")},trace:function(){un.log(arguments,"trace")},debug:function(){un.log(arguments,"debug")},info:function(){un.log(arguments,"info")},warn:function(){un.log(arguments,"warn")},error:function(){un.log(arguments,"error")},log:function(){un.log(arguments,void 0)},backend:function(){un.log(arguments,"backend")},logs:function(t){[t].flat().forEach((function(t){return t&&un.log([t].flat(),"backend")}))},history:function(){return rn.map((function(t){return nn.log.apply(nn,Ke([t[0]],t[1],!1))})),rn},addPrefix:function(t){return Array.isArray(t)?on.unshift(t):this.warn("addPrefix receives array only!"),this}}),ln=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e={}),this.default_properties=e,this.properties_=We(We({},this.default_properties),t)}return t.prototype.merge=function(t){var e;return this.properties_=We(We({},this.properties_),t),this.properties_.store=We(We({},(null===(e=this.default_properties)||void 0===e?void 0:e.store)||{}),this.properties_.store),this},t.prototype.set=function(t,e){return t.includes(".")?(Salla.helpers.setNested(this.properties_,t,e),this):(this.properties_[t]=e,this)},t.prototype.currency=function(t){return void 0===t&&(t=void 0),t=t||this.get("user.currency_code"),this.get("currencies."+t)||Object.values(this.get("currencies"))[0]},t.prototype.get=function(t,e){return void 0===e&&(e=null),t.includes(".")?Salla.helpers.getNested(this.properties_,t,e):this.properties_.hasOwnProperty(t)?this.properties_[t]||e:e||void 0},t.prototype.all=function(){return this.properties_},t.prototype.isDebug=function(){return this.get("debug")||Salla.storage.get("debug")},t}(),cn=function(t){function e(){var e=this;return(e=t.call(this,{wildcard:!0,delimiter:"::",newListener:!1,removeListener:!1,maxListeners:10,verboseMemoryLeak:!1,ignoreErrors:!1})||this).delimiter="::","undefined"!=typeof document&&(e.body=document.querySelector("body")),e.logableEvents=["cart::item.added.failed","cart::item.deleted.failed"],e.ingoreLogEvents=["document::click","document::keyup","document::change"],e.noneFireableActions=["document.request"],e.emittedEvents=new Set,e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function n(){this.constructor=t}Ve(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.createAndDispatch=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];this.dispatch.apply(this,Ke([t],e,!1))},e.prototype.emit=function(e){for(var n,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];this.emittedEvents.add(e);var o=e.replace("::",".");if(!this.noneFireableActions.includes(o)&&Salla.call&&"function"==typeof Salla.call(o))return Salla.log("'Salla.".concat(o,"(...)' triggered using event '").concat(e,"'")),o=o.split("."),Array.isArray(r[0])&&(r=r[0]),void(n=salla[o[0]])[o[1]].apply(n,r);t.prototype.emit.apply(this,Ke([e],r,!1)),this.trackEvents.apply(this,Ke([e],r,!1))},e.prototype.onlyWhen=function(t,e){var n=this;return e=e||function(){},new Promise((function(r){return n.emittedEvents.has(t)?r(e()):n.once(t,(function(){return r(e())}))}))},e.prototype.emitAsync=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.emittedEvents.add(e);var i=t.prototype.emitAsync.apply(this,Ke([e],n,!1));try{this.trackEvents.apply(this,Ke([e],n,!1))}catch(t){Salla.logger.warn("error on tracking event (".concat(e,")"),n,t)}return i},e.prototype.trackEvents=function(t){for(var e,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];if("undefined"!=typeof window)try{window.dataLayer=window.dataLayer||[];var i={event:t};n.map((function(t){return"object"==typeof t&&(i=We(We({},i),t))})),window.dataLayer.push(i)}catch(t){salla.logger.error(t.message)}Salla.logger&&!this.ingoreLogEvents.includes(t)&&(e=Salla.logger).event.apply(e,Ke([t],n,!1)),this.dispatchMobileEvent.apply(this,Ke([t],n,!1))},e.prototype.dispatch=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return this.emit.apply(this,Ke([t],e,!1))},e.prototype.dispatchEvents=function(t){if(t)if("object"!=typeof t||Array.isArray(t))Salla.log("Events object is wrong, it should be object of {event:payload}",t);else for(var e=0,n=Object.entries(t);e<n.length;e++){var r=n[e];this.dispatch(r[0],r[1])}else Salla.log("No Events To Dispatch!",t)},e.prototype.addListener=function(t,e,n){return this.on(t,e,n)},e.prototype.addEventListener=function(t,e,n){return this.on(t,e,n)},e.prototype.listen=function(t,e){return this.on(t,e)},e.prototype.registerGlobalListener=function(t,e){return this.onAny(e)},e.prototype.dispatchMobileEvent=function(t,e){var n;if(void 0===e&&(e={}),"undefined"!=typeof window){if(window.webkit)try{return void window.webkit.messageHandlers.callbackHandler.postMessage(JSON.stringify({event:t,details:e}))}catch(t){Salla.log(t,"The native context does not exist yet")}if(null===(n=window.Android)||void 0===n?void 0:n.customEventWithData)try{window.Android.customEventWithData(t,JSON.stringify({details:e}))}catch(t){Salla.log(t,"The native context does not exist yet")}else if(window.flutter_inappwebview)try{window.flutter_inappwebview.callHandler("sallaEvent",{event:t,details:e})}catch(t){Salla.log(t,"The Flutter context does not exist yet")}}},e}(be.EventEmitter2),dn=je.createStore([Oe,$e,Te,ze],[]),fn=je.createStore([$e],[]),hn=je.createStore([Te],[]),pn=function(){function t(){var t=this;this.clearableItems=["cart","user","salla::wishlist","token"],Salla.event.on("storage::item.remove",(function(e){return t.remove(e)})),Salla.event.on("storage::item.set",(function(e,n){return t.set(e,n)})),this.store=dn,this.session=fn,this.cookie=hn}return t.prototype.set=function(t,e){var n;if(t.includes(".")){var r=t.split(".")[0],i=((n={})[r]=this.store.get(r),n);return i=Salla.helpers.setNested(i,t,e),this.store.set(r,i[r])}return this.store.set(t,e)},t.prototype.remove=function(t){return this.store.remove(t)},t.prototype.clearAll=function(t){var e=this;if(void 0===t&&(t=!1),t)return this.store.clearAll();this.clearableItems.forEach((function(t){e.store.remove(t)}))},t.prototype.get=function(t,e){var n;if(t.includes(".")){var r=t.split(".")[0];return Salla.helpers.getNested(((n={})[r]=this.store.get(r),n),t)}return this.store.get(t,e)},t.prototype.prefixKey=function(t){return"".concat(t,"_").concat(Salla.config.get("store.id"))},t.prototype.setWithTTL=function(t,e,n,r){void 0===n&&(n=10),void 0===r&&(r="store");var i=this.prefixKey(t),o=(new Date).getTime()+60*n*1e3;return this[r].set(i,{value:e,expiry:o})},t.prototype.getWithTTL=function(t,e,n){void 0===e&&(e=null),void 0===n&&(n="store");var r=this.prefixKey(t),i=this[n].get(r);return i?(new Date).getTime()>i.expiry?(this[n].remove(r),e):i.value:e},t}(),Dn=function(){function t(){var t=this;this.keysToRemove=["__said","__ssid","theme_edit","ws_port","s-token"],this.dynamicKeysToRemove=["affiliate","cart"],Salla.event.on("cookies::remove",(function(e){return t.remove(e)})),Salla.event.on("cookies::add",(function(e,n){return t.set(e,n)}))}return t.prototype.get=function(t){var e;return null===(e=document.cookie.split("; ").find((function(e){return