@letscooee/web-sdk 13.1.11 → 13.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +0,0 @@
1
- import{a as ee,b as lt,c as ue,e as dt,g as mt,h as he}from"./chunk-U4XWPFUW.js";var vt=dt((ht,ke)=>{"use strict";(function(s){if(typeof ht=="object"&&typeof ke<"u")ke.exports=s();else if(typeof define=="function"&&define.amd)define([],s);else{var n;typeof window<"u"?n=window:typeof global<"u"?n=global:typeof self<"u"?n=self:n=this,n.localforage=s()}})(function(){var s,n,h;return(function c(v,I,w){function R(T,V){if(!I[T]){if(!v[T]){var p=typeof ue=="function"&&ue;if(!V&&p)return p(T,!0);if(b)return b(T,!0);var _=new Error("Cannot find module '"+T+"'");throw _.code="MODULE_NOT_FOUND",_}var C=I[T]={exports:{}};v[T][0].call(C.exports,function(O){var j=v[T][1][O];return R(j||O)},C,C.exports,c,v,I,w)}return I[T].exports}for(var b=typeof ue=="function"&&ue,m=0;m<w.length;m++)R(w[m]);return R})({1:[function(c,v,I){(function(w){"use strict";var R=w.MutationObserver||w.WebKitMutationObserver,b;if(R){var m=0,T=new R(O),V=w.document.createTextNode("");T.observe(V,{characterData:!0}),b=function(){V.data=m=++m%2}}else if(!w.setImmediate&&typeof w.MessageChannel<"u"){var p=new w.MessageChannel;p.port1.onmessage=O,b=function(){p.port2.postMessage(0)}}else"document"in w&&"onreadystatechange"in w.document.createElement("script")?b=function(){var B=w.document.createElement("script");B.onreadystatechange=function(){O(),B.onreadystatechange=null,B.parentNode.removeChild(B),B=null},w.document.documentElement.appendChild(B)}:b=function(){setTimeout(O,0)};var _,C=[];function O(){_=!0;for(var B,z,F=C.length;F;){for(z=C,C=[],B=-1;++B<F;)z[B]();F=C.length}_=!1}v.exports=j;function j(B){C.push(B)===1&&!_&&b()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(c,v,I){"use strict";var w=c(1);function R(){}var b={},m=["REJECTED"],T=["FULFILLED"],V=["PENDING"];v.exports=p;function p(y){if(typeof y!="function")throw new TypeError("resolver must be a function");this.state=V,this.queue=[],this.outcome=void 0,y!==R&&j(this,y)}p.prototype.catch=function(y){return this.then(null,y)},p.prototype.then=function(y,A){if(typeof y!="function"&&this.state===T||typeof A!="function"&&this.state===m)return this;var D=new this.constructor(R);if(this.state!==V){var L=this.state===T?y:A;C(D,L,this.outcome)}else this.queue.push(new _(D,y,A));return D};function _(y,A,D){this.promise=y,typeof A=="function"&&(this.onFulfilled=A,this.callFulfilled=this.otherCallFulfilled),typeof D=="function"&&(this.onRejected=D,this.callRejected=this.otherCallRejected)}_.prototype.callFulfilled=function(y){b.resolve(this.promise,y)},_.prototype.otherCallFulfilled=function(y){C(this.promise,this.onFulfilled,y)},_.prototype.callRejected=function(y){b.reject(this.promise,y)},_.prototype.otherCallRejected=function(y){C(this.promise,this.onRejected,y)};function C(y,A,D){w(function(){var L;try{L=A(D)}catch(U){return b.reject(y,U)}L===y?b.reject(y,new TypeError("Cannot resolve promise with itself")):b.resolve(y,L)})}b.resolve=function(y,A){var D=B(O,A);if(D.status==="error")return b.reject(y,D.value);var L=D.value;if(L)j(y,L);else{y.state=T,y.outcome=A;for(var U=-1,k=y.queue.length;++U<k;)y.queue[U].callFulfilled(A)}return y},b.reject=function(y,A){y.state=m,y.outcome=A;for(var D=-1,L=y.queue.length;++D<L;)y.queue[D].callRejected(A);return y};function O(y){var A=y&&y.then;if(y&&(typeof y=="object"||typeof y=="function")&&typeof A=="function")return function(){A.apply(y,arguments)}}function j(y,A){var D=!1;function L(G){D||(D=!0,b.reject(y,G))}function U(G){D||(D=!0,b.resolve(y,G))}function k(){A(U,L)}var $=B(k);$.status==="error"&&L($.value)}function B(y,A){var D={};try{D.value=y(A),D.status="success"}catch(L){D.status="error",D.value=L}return D}p.resolve=z;function z(y){return y instanceof this?y:b.resolve(new this(R),y)}p.reject=F;function F(y){var A=new this(R);return b.reject(A,y)}p.all=Re;function Re(y){var A=this;if(Object.prototype.toString.call(y)!=="[object Array]")return this.reject(new TypeError("must be an array"));var D=y.length,L=!1;if(!D)return this.resolve([]);for(var U=new Array(D),k=0,$=-1,G=new this(R);++$<D;)q(y[$],$);return G;function q(ie,me){A.resolve(ie).then(Ce,function(te){L||(L=!0,b.reject(G,te))});function Ce(te){U[me]=te,++k===D&&!L&&(L=!0,b.resolve(G,U))}}}p.race=Z;function Z(y){var A=this;if(Object.prototype.toString.call(y)!=="[object Array]")return this.reject(new TypeError("must be an array"));var D=y.length,L=!1;if(!D)return this.resolve([]);for(var U=-1,k=new this(R);++U<D;)$(y[U]);return k;function $(G){A.resolve(G).then(function(q){L||(L=!0,b.resolve(k,q))},function(q){L||(L=!0,b.reject(k,q))})}}},{1:1}],3:[function(c,v,I){(function(w){"use strict";typeof w.Promise!="function"&&(w.Promise=c(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(c,v,I){"use strict";var w=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function R(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function b(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var m=b();function T(){try{if(!m||!m.open)return!1;var e=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),r=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!e||r)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function V(e,r){e=e||[],r=r||{};try{return new Blob(e,r)}catch(o){if(o.name!=="TypeError")throw o;for(var t=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,i=new t,a=0;a<e.length;a+=1)i.append(e[a]);return i.getBlob(r.type)}}typeof Promise>"u"&&c(3);var p=Promise;function _(e,r){r&&e.then(function(t){r(null,t)},function(t){r(t)})}function C(e,r,t){typeof r=="function"&&e.then(r),typeof t=="function"&&e.catch(t)}function O(e){return typeof e!="string"&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function j(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var B="local-forage-detect-blob-support",z=void 0,F={},Re=Object.prototype.toString,Z="readonly",y="readwrite";function A(e){for(var r=e.length,t=new ArrayBuffer(r),i=new Uint8Array(t),a=0;a<r;a++)i[a]=e.charCodeAt(a);return t}function D(e){return new p(function(r){var t=e.transaction(B,y),i=V([""]);t.objectStore(B).put(i,"key"),t.onabort=function(a){a.preventDefault(),a.stopPropagation(),r(!1)},t.oncomplete=function(){var a=navigator.userAgent.match(/Chrome\/(\d+)/),o=navigator.userAgent.match(/Edge\//);r(o||!a||parseInt(a[1],10)>=43)}}).catch(function(){return!1})}function L(e){return typeof z=="boolean"?p.resolve(z):D(e).then(function(r){return z=r,z})}function U(e){var r=F[e.name],t={};t.promise=new p(function(i,a){t.resolve=i,t.reject=a}),r.deferredOperations.push(t),r.dbReady?r.dbReady=r.dbReady.then(function(){return t.promise}):r.dbReady=t.promise}function k(e){var r=F[e.name],t=r.deferredOperations.pop();if(t)return t.resolve(),t.promise}function $(e,r){var t=F[e.name],i=t.deferredOperations.pop();if(i)return i.reject(r),i.promise}function G(e,r){return new p(function(t,i){if(F[e.name]=F[e.name]||Ye(),e.db)if(r)U(e),e.db.close();else return t(e.db);var a=[e.name];r&&a.push(e.version);var o=m.open.apply(m,a);r&&(o.onupgradeneeded=function(u){var f=o.result;try{f.createObjectStore(e.storeName),u.oldVersion<=1&&f.createObjectStore(B)}catch(l){if(l.name==="ConstraintError")console.warn('The database "'+e.name+'" has been upgraded from version '+u.oldVersion+" to version "+u.newVersion+', but the storage "'+e.storeName+'" already exists.');else throw l}}),o.onerror=function(u){u.preventDefault(),i(o.error)},o.onsuccess=function(){var u=o.result;u.onversionchange=function(f){f.target.close()},t(u),k(e)}})}function q(e){return G(e,!1)}function ie(e){return G(e,!0)}function me(e,r){if(!e.db)return!0;var t=!e.db.objectStoreNames.contains(e.storeName),i=e.version<e.db.version,a=e.version>e.db.version;if(i&&(e.version!==r&&console.warn('The database "'+e.name+`" can't be downgraded from version `+e.db.version+" to version "+e.version+"."),e.version=e.db.version),a||t){if(t){var o=e.db.version+1;o>e.version&&(e.version=o)}return!0}return!1}function Ce(e){return new p(function(r,t){var i=new FileReader;i.onerror=t,i.onloadend=function(a){var o=btoa(a.target.result||"");r({__local_forage_encoded_blob:!0,data:o,type:e.type})},i.readAsBinaryString(e)})}function te(e){var r=A(atob(e.data));return V([r],{type:e.type})}function He(e){return e&&e.__local_forage_encoded_blob}function Lt(e){var r=this,t=r._initReady().then(function(){var i=F[r._dbInfo.name];if(i&&i.dbReady)return i.dbReady});return C(t,e,e),t}function Ot(e){U(e);for(var r=F[e.name],t=r.forages,i=0;i<t.length;i++){var a=t[i];a._dbInfo.db&&(a._dbInfo.db.close(),a._dbInfo.db=null)}return e.db=null,q(e).then(function(o){return e.db=o,me(e)?ie(e):o}).then(function(o){e.db=r.db=o;for(var u=0;u<t.length;u++)t[u]._dbInfo.db=o}).catch(function(o){throw $(e,o),o})}function K(e,r,t,i){i===void 0&&(i=1);try{var a=e.db.transaction(e.storeName,r);t(null,a)}catch(o){if(i>0&&(!e.db||o.name==="InvalidStateError"||o.name==="NotFoundError"))return p.resolve().then(function(){if(!e.db||o.name==="NotFoundError"&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),ie(e)}).then(function(){return Ot(e).then(function(){K(e,r,t,i-1)})}).catch(t);t(o)}}function Ye(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Pt(e){var r=this,t={db:null};if(e)for(var i in e)t[i]=e[i];var a=F[t.name];a||(a=Ye(),F[t.name]=a),a.forages.push(r),r._initReady||(r._initReady=r.ready,r.ready=Lt);var o=[];function u(){return p.resolve()}for(var f=0;f<a.forages.length;f++){var l=a.forages[f];l!==r&&o.push(l._initReady().catch(u))}var d=a.forages.slice(0);return p.all(o).then(function(){return t.db=a.db,q(t)}).then(function(g){return t.db=g,me(t,r._defaultConfig.version)?ie(t):g}).then(function(g){t.db=a.db=g,r._dbInfo=t;for(var E=0;E<d.length;E++){var S=d[E];S!==r&&(S._dbInfo.db=t.db,S._dbInfo.version=t.version)}})}function Vt(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){K(t._dbInfo,Z,function(u,f){if(u)return o(u);try{var l=f.objectStore(t._dbInfo.storeName),d=l.get(e);d.onsuccess=function(){var g=d.result;g===void 0&&(g=null),He(g)&&(g=te(g)),a(g)},d.onerror=function(){o(d.error)}}catch(g){o(g)}})}).catch(o)});return _(i,r),i}function Mt(e,r){var t=this,i=new p(function(a,o){t.ready().then(function(){K(t._dbInfo,Z,function(u,f){if(u)return o(u);try{var l=f.objectStore(t._dbInfo.storeName),d=l.openCursor(),g=1;d.onsuccess=function(){var E=d.result;if(E){var S=E.value;He(S)&&(S=te(S));var N=e(S,E.key,g++);N!==void 0?a(N):E.continue()}else a()},d.onerror=function(){o(d.error)}}catch(E){o(E)}})}).catch(o)});return _(i,r),i}function Bt(e,r,t){var i=this;e=O(e);var a=new p(function(o,u){var f;i.ready().then(function(){return f=i._dbInfo,Re.call(r)==="[object Blob]"?L(f.db).then(function(l){return l?r:Ce(r)}):r}).then(function(l){K(i._dbInfo,y,function(d,g){if(d)return u(d);try{var E=g.objectStore(i._dbInfo.storeName);l===null&&(l=void 0);var S=E.put(l,e);g.oncomplete=function(){l===void 0&&(l=null),o(l)},g.onabort=g.onerror=function(){var N=S.error?S.error:S.transaction.error;u(N)}}catch(N){u(N)}})}).catch(u)});return _(a,t),a}function Ft(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){K(t._dbInfo,y,function(u,f){if(u)return o(u);try{var l=f.objectStore(t._dbInfo.storeName),d=l.delete(e);f.oncomplete=function(){a()},f.onerror=function(){o(d.error)},f.onabort=function(){var g=d.error?d.error:d.transaction.error;o(g)}}catch(g){o(g)}})}).catch(o)});return _(i,r),i}function Ut(e){var r=this,t=new p(function(i,a){r.ready().then(function(){K(r._dbInfo,y,function(o,u){if(o)return a(o);try{var f=u.objectStore(r._dbInfo.storeName),l=f.clear();u.oncomplete=function(){i()},u.onabort=u.onerror=function(){var d=l.error?l.error:l.transaction.error;a(d)}}catch(d){a(d)}})}).catch(a)});return _(t,e),t}function kt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){K(r._dbInfo,Z,function(o,u){if(o)return a(o);try{var f=u.objectStore(r._dbInfo.storeName),l=f.count();l.onsuccess=function(){i(l.result)},l.onerror=function(){a(l.error)}}catch(d){a(d)}})}).catch(a)});return _(t,e),t}function Wt(e,r){var t=this,i=new p(function(a,o){if(e<0){a(null);return}t.ready().then(function(){K(t._dbInfo,Z,function(u,f){if(u)return o(u);try{var l=f.objectStore(t._dbInfo.storeName),d=!1,g=l.openKeyCursor();g.onsuccess=function(){var E=g.result;if(!E){a(null);return}e===0||d?a(E.key):(d=!0,E.advance(e))},g.onerror=function(){o(g.error)}}catch(E){o(E)}})}).catch(o)});return _(i,r),i}function $t(e){var r=this,t=new p(function(i,a){r.ready().then(function(){K(r._dbInfo,Z,function(o,u){if(o)return a(o);try{var f=u.objectStore(r._dbInfo.storeName),l=f.openKeyCursor(),d=[];l.onsuccess=function(){var g=l.result;if(!g){i(d);return}d.push(g.key),g.continue()},l.onerror=function(){a(l.error)}}catch(g){a(g)}})}).catch(a)});return _(t,e),t}function Gt(e,r){r=j.apply(this,arguments);var t=this.config();e=typeof e!="function"&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var i=this,a;if(!e.name)a=p.reject("Invalid arguments");else{var o=e.name===t.name&&i._dbInfo.db,u=o?p.resolve(i._dbInfo.db):q(e).then(function(f){var l=F[e.name],d=l.forages;l.db=f;for(var g=0;g<d.length;g++)d[g]._dbInfo.db=f;return f});e.storeName?a=u.then(function(f){if(f.objectStoreNames.contains(e.storeName)){var l=f.version+1;U(e);var d=F[e.name],g=d.forages;f.close();for(var E=0;E<g.length;E++){var S=g[E];S._dbInfo.db=null,S._dbInfo.version=l}var N=new p(function(x,M){var P=m.open(e.name,l);P.onerror=function(H){var se=P.result;se.close(),M(H)},P.onupgradeneeded=function(){var H=P.result;H.deleteObjectStore(e.storeName)},P.onsuccess=function(){var H=P.result;H.close(),x(H)}});return N.then(function(x){d.db=x;for(var M=0;M<g.length;M++){var P=g[M];P._dbInfo.db=x,k(P._dbInfo)}}).catch(function(x){throw($(e,x)||p.resolve()).catch(function(){}),x})}}):a=u.then(function(f){U(e);var l=F[e.name],d=l.forages;f.close();for(var g=0;g<d.length;g++){var E=d[g];E._dbInfo.db=null}var S=new p(function(N,x){var M=m.deleteDatabase(e.name);M.onerror=function(){var P=M.result;P&&P.close(),x(M.error)},M.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},M.onsuccess=function(){var P=M.result;P&&P.close(),N(P)}});return S.then(function(N){l.db=N;for(var x=0;x<d.length;x++){var M=d[x];k(M._dbInfo)}}).catch(function(N){throw($(e,N)||p.resolve()).catch(function(){}),N})})}return _(a,r),a}var Ht={_driver:"asyncStorage",_initStorage:Pt,_support:T(),iterate:Mt,getItem:Vt,setItem:Bt,removeItem:Ft,clear:Ut,length:kt,key:Wt,keys:$t,dropInstance:Gt};function Yt(){return typeof openDatabase=="function"}var X="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",jt="~~local_forage_type~",je=/^~~local_forage_type~([^~]+)~/,ge="__lfsc__:",Ae=ge.length,Ne="arbf",xe="blob",ze="si08",qe="ui08",Ke="uic8",Xe="si16",Je="si32",Qe="ur16",Ze="ui32",et="fl32",tt="fl64",rt=Ae+Ne.length,nt=Object.prototype.toString;function ot(e){var r=e.length*.75,t=e.length,i,a=0,o,u,f,l;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);var d=new ArrayBuffer(r),g=new Uint8Array(d);for(i=0;i<t;i+=4)o=X.indexOf(e[i]),u=X.indexOf(e[i+1]),f=X.indexOf(e[i+2]),l=X.indexOf(e[i+3]),g[a++]=o<<2|u>>4,g[a++]=(u&15)<<4|f>>2,g[a++]=(f&3)<<6|l&63;return d}function Le(e){var r=new Uint8Array(e),t="",i;for(i=0;i<r.length;i+=3)t+=X[r[i]>>2],t+=X[(r[i]&3)<<4|r[i+1]>>4],t+=X[(r[i+1]&15)<<2|r[i+2]>>6],t+=X[r[i+2]&63];return r.length%3===2?t=t.substring(0,t.length-1)+"=":r.length%3===1&&(t=t.substring(0,t.length-2)+"=="),t}function zt(e,r){var t="";if(e&&(t=nt.call(e)),e&&(t==="[object ArrayBuffer]"||e.buffer&&nt.call(e.buffer)==="[object ArrayBuffer]")){var i,a=ge;e instanceof ArrayBuffer?(i=e,a+=Ne):(i=e.buffer,t==="[object Int8Array]"?a+=ze:t==="[object Uint8Array]"?a+=qe:t==="[object Uint8ClampedArray]"?a+=Ke:t==="[object Int16Array]"?a+=Xe:t==="[object Uint16Array]"?a+=Qe:t==="[object Int32Array]"?a+=Je:t==="[object Uint32Array]"?a+=Ze:t==="[object Float32Array]"?a+=et:t==="[object Float64Array]"?a+=tt:r(new Error("Failed to get type for BinaryArray"))),r(a+Le(i))}else if(t==="[object Blob]"){var o=new FileReader;o.onload=function(){var u=jt+e.type+"~"+Le(this.result);r(ge+xe+u)},o.readAsArrayBuffer(e)}else try{r(JSON.stringify(e))}catch(u){console.error("Couldn't convert value into a JSON string: ",e),r(null,u)}}function qt(e){if(e.substring(0,Ae)!==ge)return JSON.parse(e);var r=e.substring(rt),t=e.substring(Ae,rt),i;if(t===xe&&je.test(r)){var a=r.match(je);i=a[1],r=r.substring(a[0].length)}var o=ot(r);switch(t){case Ne:return o;case xe:return V([o],{type:i});case ze:return new Int8Array(o);case qe:return new Uint8Array(o);case Ke:return new Uint8ClampedArray(o);case Xe:return new Int16Array(o);case Qe:return new Uint16Array(o);case Je:return new Int32Array(o);case Ze:return new Uint32Array(o);case et:return new Float32Array(o);case tt:return new Float64Array(o);default:throw new Error("Unkown type: "+t)}}var Oe={serialize:zt,deserialize:qt,stringToBuffer:ot,bufferToString:Le};function it(e,r,t,i){e.executeSql("CREATE TABLE IF NOT EXISTS "+r.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],t,i)}function Kt(e){var r=this,t={db:null};if(e)for(var i in e)t[i]=typeof e[i]!="string"?e[i].toString():e[i];var a=new p(function(o,u){try{t.db=openDatabase(t.name,String(t.version),t.description,t.size)}catch(f){return u(f)}t.db.transaction(function(f){it(f,t,function(){r._dbInfo=t,o()},function(l,d){u(d)})},u)});return t.serializer=Oe,a}function J(e,r,t,i,a,o){e.executeSql(t,i,a,function(u,f){f.code===f.SYNTAX_ERR?u.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[r.storeName],function(l,d){d.rows.length?o(l,f):it(l,r,function(){l.executeSql(t,i,a,o)},o)},o):o(u,f)},o)}function Xt(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(f){J(f,u,"SELECT * FROM "+u.storeName+" WHERE key = ? LIMIT 1",[e],function(l,d){var g=d.rows.length?d.rows.item(0).value:null;g&&(g=u.serializer.deserialize(g)),a(g)},function(l,d){o(d)})})}).catch(o)});return _(i,r),i}function Jt(e,r){var t=this,i=new p(function(a,o){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(f){J(f,u,"SELECT * FROM "+u.storeName,[],function(l,d){for(var g=d.rows,E=g.length,S=0;S<E;S++){var N=g.item(S),x=N.value;if(x&&(x=u.serializer.deserialize(x)),x=e(x,N.key,S+1),x!==void 0){a(x);return}}a()},function(l,d){o(d)})})}).catch(o)});return _(i,r),i}function at(e,r,t,i){var a=this;e=O(e);var o=new p(function(u,f){a.ready().then(function(){r===void 0&&(r=null);var l=r,d=a._dbInfo;d.serializer.serialize(r,function(g,E){E?f(E):d.db.transaction(function(S){J(S,d,"INSERT OR REPLACE INTO "+d.storeName+" (key, value) VALUES (?, ?)",[e,g],function(){u(l)},function(N,x){f(x)})},function(S){if(S.code===S.QUOTA_ERR){if(i>0){u(at.apply(a,[e,l,t,i-1]));return}f(S)}})})}).catch(f)});return _(o,t),o}function Qt(e,r,t){return at.apply(this,[e,r,t,1])}function Zt(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(f){J(f,u,"DELETE FROM "+u.storeName+" WHERE key = ?",[e],function(){a()},function(l,d){o(d)})})}).catch(o)});return _(i,r),i}function er(e){var r=this,t=new p(function(i,a){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(u){J(u,o,"DELETE FROM "+o.storeName,[],function(){i()},function(f,l){a(l)})})}).catch(a)});return _(t,e),t}function tr(e){var r=this,t=new p(function(i,a){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(u){J(u,o,"SELECT COUNT(key) as c FROM "+o.storeName,[],function(f,l){var d=l.rows.item(0).c;i(d)},function(f,l){a(l)})})}).catch(a)});return _(t,e),t}function rr(e,r){var t=this,i=new p(function(a,o){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(f){J(f,u,"SELECT key FROM "+u.storeName+" WHERE id = ? LIMIT 1",[e+1],function(l,d){var g=d.rows.length?d.rows.item(0).key:null;a(g)},function(l,d){o(d)})})}).catch(o)});return _(i,r),i}function nr(e){var r=this,t=new p(function(i,a){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(u){J(u,o,"SELECT key FROM "+o.storeName,[],function(f,l){for(var d=[],g=0;g<l.rows.length;g++)d.push(l.rows.item(g).key);i(d)},function(f,l){a(l)})})}).catch(a)});return _(t,e),t}function or(e){return new p(function(r,t){e.transaction(function(i){i.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(a,o){for(var u=[],f=0;f<o.rows.length;f++)u.push(o.rows.item(f).name);r({db:e,storeNames:u})},function(a,o){t(o)})},function(i){t(i)})})}function ir(e,r){r=j.apply(this,arguments);var t=this.config();e=typeof e!="function"&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var i=this,a;return e.name?a=new p(function(o){var u;e.name===t.name?u=i._dbInfo.db:u=openDatabase(e.name,"","",0),e.storeName?o({db:u,storeNames:[e.storeName]}):o(or(u))}).then(function(o){return new p(function(u,f){o.db.transaction(function(l){function d(N){return new p(function(x,M){l.executeSql("DROP TABLE IF EXISTS "+N,[],function(){x()},function(P,H){M(H)})})}for(var g=[],E=0,S=o.storeNames.length;E<S;E++)g.push(d(o.storeNames[E]));p.all(g).then(function(){u()}).catch(function(N){f(N)})},function(l){f(l)})})}):a=p.reject("Invalid arguments"),_(a,r),a}var ar={_driver:"webSQLStorage",_initStorage:Kt,_support:Yt(),iterate:Jt,getItem:Xt,setItem:Qt,removeItem:Zt,clear:er,length:tr,key:rr,keys:nr,dropInstance:ir};function sr(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function st(e,r){var t=e.name+"/";return e.storeName!==r.storeName&&(t+=e.storeName+"/"),t}function ur(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch{return!0}}function cr(){return!ur()||localStorage.length>0}function fr(e){var r=this,t={};if(e)for(var i in e)t[i]=e[i];return t.keyPrefix=st(e,r._defaultConfig),cr()?(r._dbInfo=t,t.serializer=Oe,p.resolve()):p.reject()}function lr(e){var r=this,t=r.ready().then(function(){for(var i=r._dbInfo.keyPrefix,a=localStorage.length-1;a>=0;a--){var o=localStorage.key(a);o.indexOf(i)===0&&localStorage.removeItem(o)}});return _(t,e),t}function dr(e,r){var t=this;e=O(e);var i=t.ready().then(function(){var a=t._dbInfo,o=localStorage.getItem(a.keyPrefix+e);return o&&(o=a.serializer.deserialize(o)),o});return _(i,r),i}function mr(e,r){var t=this,i=t.ready().then(function(){for(var a=t._dbInfo,o=a.keyPrefix,u=o.length,f=localStorage.length,l=1,d=0;d<f;d++){var g=localStorage.key(d);if(g.indexOf(o)===0){var E=localStorage.getItem(g);if(E&&(E=a.serializer.deserialize(E)),E=e(E,g.substring(u),l++),E!==void 0)return E}}});return _(i,r),i}function gr(e,r){var t=this,i=t.ready().then(function(){var a=t._dbInfo,o;try{o=localStorage.key(e)}catch{o=null}return o&&(o=o.substring(a.keyPrefix.length)),o});return _(i,r),i}function pr(e){var r=this,t=r.ready().then(function(){for(var i=r._dbInfo,a=localStorage.length,o=[],u=0;u<a;u++){var f=localStorage.key(u);f.indexOf(i.keyPrefix)===0&&o.push(f.substring(i.keyPrefix.length))}return o});return _(t,e),t}function hr(e){var r=this,t=r.keys().then(function(i){return i.length});return _(t,e),t}function vr(e,r){var t=this;e=O(e);var i=t.ready().then(function(){var a=t._dbInfo;localStorage.removeItem(a.keyPrefix+e)});return _(i,r),i}function yr(e,r,t){var i=this;e=O(e);var a=i.ready().then(function(){r===void 0&&(r=null);var o=r;return new p(function(u,f){var l=i._dbInfo;l.serializer.serialize(r,function(d,g){if(g)f(g);else try{localStorage.setItem(l.keyPrefix+e,d),u(o)}catch(E){(E.name==="QuotaExceededError"||E.name==="NS_ERROR_DOM_QUOTA_REACHED")&&f(E),f(E)}})})});return _(a,t),a}function Er(e,r){if(r=j.apply(this,arguments),e=typeof e!="function"&&e||{},!e.name){var t=this.config();e.name=e.name||t.name,e.storeName=e.storeName||t.storeName}var i=this,a;return e.name?a=new p(function(o){e.storeName?o(st(e,i._defaultConfig)):o(e.name+"/")}).then(function(o){for(var u=localStorage.length-1;u>=0;u--){var f=localStorage.key(u);f.indexOf(o)===0&&localStorage.removeItem(f)}}):a=p.reject("Invalid arguments"),_(a,r),a}var _r={_driver:"localStorageWrapper",_initStorage:fr,_support:sr(),iterate:mr,getItem:dr,setItem:yr,removeItem:vr,clear:lr,length:hr,key:gr,keys:pr,dropInstance:Er},br=function(r,t){return r===t||typeof r=="number"&&typeof t=="number"&&isNaN(r)&&isNaN(t)},Tr=function(r,t){for(var i=r.length,a=0;a<i;){if(br(r[a],t))return!0;a++}return!1},ut=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"},ae={},ct={},re={INDEXEDDB:Ht,WEBSQL:ar,LOCALSTORAGE:_r},wr=[re.INDEXEDDB._driver,re.WEBSQL._driver,re.LOCALSTORAGE._driver],pe=["dropInstance"],Pe=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(pe),Ir={description:"",driver:wr.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Sr(e,r){e[r]=function(){var t=arguments;return e.ready().then(function(){return e[r].apply(e,t)})}}function Ve(){for(var e=1;e<arguments.length;e++){var r=arguments[e];if(r)for(var t in r)r.hasOwnProperty(t)&&(ut(r[t])?arguments[0][t]=r[t].slice():arguments[0][t]=r[t])}return arguments[0]}var Dr=(function(){function e(r){R(this,e);for(var t in re)if(re.hasOwnProperty(t)){var i=re[t],a=i._driver;this[t]=a,ae[a]||this.defineDriver(i)}this._defaultConfig=Ve({},Ir),this._config=Ve({},this._defaultConfig,r),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return e.prototype.config=function(t){if((typeof t>"u"?"undefined":w(t))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var i in t){if(i==="storeName"&&(t[i]=t[i].replace(/\W/g,"_")),i==="version"&&typeof t[i]!="number")return new Error("Database version must be a number.");this._config[i]=t[i]}return"driver"in t&&t.driver?this.setDriver(this._config.driver):!0}else return typeof t=="string"?this._config[t]:this._config},e.prototype.defineDriver=function(t,i,a){var o=new p(function(u,f){try{var l=t._driver,d=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!t._driver){f(d);return}for(var g=Pe.concat("_initStorage"),E=0,S=g.length;E<S;E++){var N=g[E],x=!Tr(pe,N);if((x||t[N])&&typeof t[N]!="function"){f(d);return}}var M=function(){for(var se=function(Ar){return function(){var Nr=new Error("Method "+Ar+" is not implemented by the current driver"),ft=p.reject(Nr);return _(ft,arguments[arguments.length-1]),ft}},Me=0,Cr=pe.length;Me<Cr;Me++){var Be=pe[Me];t[Be]||(t[Be]=se(Be))}};M();var P=function(se){ae[l]&&console.info("Redefining LocalForage driver: "+l),ae[l]=t,ct[l]=se,u()};"_support"in t?t._support&&typeof t._support=="function"?t._support().then(P,f):P(!!t._support):P(!0)}catch(H){f(H)}});return C(o,i,a),o},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(t,i,a){var o=ae[t]?p.resolve(ae[t]):p.reject(new Error("Driver not found."));return C(o,i,a),o},e.prototype.getSerializer=function(t){var i=p.resolve(Oe);return C(i,t),i},e.prototype.ready=function(t){var i=this,a=i._driverSet.then(function(){return i._ready===null&&(i._ready=i._initDriver()),i._ready});return C(a,t,t),a},e.prototype.setDriver=function(t,i,a){var o=this;ut(t)||(t=[t]);var u=this._getSupportedDrivers(t);function f(){o._config.driver=o.driver()}function l(E){return o._extend(E),f(),o._ready=o._initStorage(o._config),o._ready}function d(E){return function(){var S=0;function N(){for(;S<E.length;){var x=E[S];return S++,o._dbInfo=null,o._ready=null,o.getDriver(x).then(l).catch(N)}f();var M=new Error("No available storage method found.");return o._driverSet=p.reject(M),o._driverSet}return N()}}var g=this._driverSet!==null?this._driverSet.catch(function(){return p.resolve()}):p.resolve();return this._driverSet=g.then(function(){var E=u[0];return o._dbInfo=null,o._ready=null,o.getDriver(E).then(function(S){o._driver=S._driver,f(),o._wrapLibraryMethodsWithReady(),o._initDriver=d(u)})}).catch(function(){f();var E=new Error("No available storage method found.");return o._driverSet=p.reject(E),o._driverSet}),C(this._driverSet,i,a),this._driverSet},e.prototype.supports=function(t){return!!ct[t]},e.prototype._extend=function(t){Ve(this,t)},e.prototype._getSupportedDrivers=function(t){for(var i=[],a=0,o=t.length;a<o;a++){var u=t[a];this.supports(u)&&i.push(u)}return i},e.prototype._wrapLibraryMethodsWithReady=function(){for(var t=0,i=Pe.length;t<i;t++)Sr(this,Pe[t])},e.prototype.createInstance=function(t){return new e(t)},e})(),Rr=new Dr;v.exports=Rr},{3:3}]},{},[4])(4)})});var wt=dt((Tt,we)=>{"use strict";(function(s){"use strict";var n={};n.VERSION="1.6.1";var h,c={},v=function(m,T){return function(){return T.apply(m,arguments)}},I=function(){var m=arguments,T=m[0],V,p;for(p=1;p<m.length;p++)for(V in m[p])!(V in T)&&m[p].hasOwnProperty(V)&&(T[V]=m[p][V]);return T},w=function(m,T){return{value:m,name:T}};n.TRACE=w(1,"TRACE"),n.DEBUG=w(2,"DEBUG"),n.INFO=w(3,"INFO"),n.TIME=w(4,"TIME"),n.WARN=w(5,"WARN"),n.ERROR=w(8,"ERROR"),n.OFF=w(99,"OFF");var R=function(m){this.context=m,this.setLevel(m.filterLevel),this.log=this.info};R.prototype={setLevel:function(m){m&&"value"in m&&(this.context.filterLevel=m)},getLevel:function(){return this.context.filterLevel},enabledFor:function(m){var T=this.context.filterLevel;return m.value>=T.value},trace:function(){this.invoke(n.TRACE,arguments)},debug:function(){this.invoke(n.DEBUG,arguments)},info:function(){this.invoke(n.INFO,arguments)},warn:function(){this.invoke(n.WARN,arguments)},error:function(){this.invoke(n.ERROR,arguments)},time:function(m){typeof m=="string"&&m.length>0&&this.invoke(n.TIME,[m,"start"])},timeEnd:function(m){typeof m=="string"&&m.length>0&&this.invoke(n.TIME,[m,"end"])},invoke:function(m,T){h&&this.enabledFor(m)&&h(T,I({level:m},this.context))}};var b=new R({filterLevel:n.OFF});(function(){var m=n;m.enabledFor=v(b,b.enabledFor),m.trace=v(b,b.trace),m.debug=v(b,b.debug),m.time=v(b,b.time),m.timeEnd=v(b,b.timeEnd),m.info=v(b,b.info),m.warn=v(b,b.warn),m.error=v(b,b.error),m.log=m.info})(),n.setHandler=function(m){h=m},n.setLevel=function(m){b.setLevel(m);for(var T in c)c.hasOwnProperty(T)&&c[T].setLevel(m)},n.getLevel=function(){return b.getLevel()},n.get=function(m){return c[m]||(c[m]=new R(I({name:m},b.context)))},n.createDefaultHandler=function(m){m=m||{},m.formatter=m.formatter||function(_,C){C.name&&_.unshift("["+C.name+"]")};var T={},V=function(p,_){Function.prototype.apply.call(p,console,_)};return typeof console>"u"?function(){}:function(p,_){p=Array.prototype.slice.call(p);var C=console.log,O;_.level===n.TIME?(O=(_.name?"["+_.name+"] ":"")+p[0],p[1]==="start"?console.time?console.time(O):T[O]=new Date().getTime():console.timeEnd?console.timeEnd(O):V(C,[O+": "+(new Date().getTime()-T[O])+"ms"])):(_.level===n.WARN&&console.warn?C=console.warn:_.level===n.ERROR&&console.error?C=console.error:_.level===n.INFO&&console.info?C=console.info:_.level===n.DEBUG&&console.debug?C=console.debug:_.level===n.TRACE&&console.trace&&(C=console.trace),m.formatter(p,_),V(C,p))}},n.useDefaults=function(m){n.setLevel(m&&m.defaultLevel||n.DEBUG),n.setHandler(n.createDefaultHandler(m))},n.setDefaults=n.useDefaults,typeof define=="function"&&define.amd?define(n):typeof we<"u"&&we.exports?we.exports=n:(n._prevLogger=s.Logger,n.noConflict=function(){return s.Logger=n._prevLogger,n},s.Logger=n)})(Tt)});var Fe="13.1.11";var Lr=Fe.split("-")[0].split(".").slice(0,3).map(s=>s.padStart(2,"0")).join(""),qr="WEB",gt="CooeeSDK",Q=Fe,Kr=parseInt(Lr,10);var Xr=["collection","product","cart"],Jr=[{identifier:"#flo-checkout-wrapper",gateway:"Shopflow"},{identifier:"#fastrr-main-container",gateway:"Shiprocket"},{identifier:"#gokwik-modal-wrapper",gateway:"Gokwik"},{identifier:"#zecpe",gateway:"Ecom 360"}],Qr=["View Item","View Cart","View Collection"],Zr=["CE Screen View","View Collection","View Item","View Cart"],pt="https://cdn.jsdelivr.net/npm/swiper@11";var Ue=`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${Q}/dist`,ce={apiURL:"https://api.sdk.letscooee.com",debug:!1,mode:"production",baseURL:Ue,styleURL:`${Ue}/widget.min.css`,widgetURL:`${Ue}/widget.min.js`,swiperStyleURL:`${pt}/swiper-bundle.min.css`};var ve=class{static ISO_WITHOUT_MS_REGEX=new RegExp(/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)/);static isObject(n){return typeof n=="object"&&!Array.isArray(n)&&n!==null}static parseToAny(n){try{return JSON.parse(n.toString())}catch{}return n.toString().match(this.ISO_WITHOUT_MS_REGEX)?new Date(n.toString()):n}static async sleep(n){return new Promise(h=>setTimeout(h,n))}static hasKeys(n){return n?Object.keys(n).length>=1:!1}static convertObjectToArray(n,h){return h.reduce((c,v)=>(n.hasOwnProperty(v)&&n[v]!=null&&c.push({[v]:n[v]}),c),[])}static removeNullUndefinedKeys(n){return Object.keys(n).reduce((h,c)=>(n[c]!==null&&n[c]!==void 0&&(h[c]=n[c]),h),{})}static stringify(n){return JSON.stringify(n,function(h,c){return c===void 0?null:c})}};var ye=class{gaEnabled;gaMeasurementID;pixelPush;website;currencyCount;money;storefrontToken;skipItemAttribute;widgetCustomisation;currency;static get(){return window.CooeeSDK.config}update(n){return n??={},this.gaEnabled=n.gaEnabled,this.gaMeasurementID=n.gaMeasurementID,this.pixelPush=n.pixelPush,this.website=n.website??{},this.currencyCount=n.currencyCount??0,this.money=n.money,this.currency=n.currency,this.storefrontToken=n.storefrontToken,this.skipItemAttribute=n.skipItemAttribute,this.widgetCustomisation=n.widgetCustomisation,this}};var We=mt(vt());function Ee(s){return We.default.createInstance({name:"lc",storeName:s,driver:We.default.LOCALSTORAGE})}var ne=class{static storage;static async get(n,h){return await this.storage?.getItem(n)??h}static set(n,h){return this.storage?.setItem(n,h)}static remove(n){return this.storage?.removeItem(n)}static clear(){return this.storage?.clear()}static getForage(){return this.storage}};var fe=class fe extends ne{};he(fe,"storeName","ses"),fe.storage=Ee(fe.storeName);var _e=fe;var le=class le extends ne{};he(le,"storeName","usr"),le.storage=Ee(le.storeName);var de=le;var be=class{static format(n,h){let c=/{{\s*(\w+)\s*}}/;return h.replace(c,(v,I)=>{switch(I){case"amount":return this.formatWithDelimiters(n,2);case"amount_no_decimals":return this.formatWithDelimiters(n,0);case"amount_with_comma_separator":return this.formatWithDelimiters(n,2,".",",");case"amount_no_decimals_with_comma_separator":return this.formatWithDelimiters(n,0,".",",");case"amount_with_apostrophe_separator":return this.formatWithDelimiters(n,2,"'",".");case"amount_no_decimals_with_space_separator":return this.formatWithDelimiters(n,0," ");case"amount_with_space_separator":return this.formatWithDelimiters(n,2," ",",");case"amount_with_period_and_space_separator":return this.formatWithDelimiters(n,2," ",".");default:return v}})}static formatWithDelimiters(n,h=2,c=",",v="."){if(isNaN(n)||n==null)return"0";let w=(n/100).toFixed(h).split("."),R=w[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+c),b=w[1]?v+w[1]:"";return R+b}};function yt(s){if(s<0)return`${s}ms`;let n=new Date(Date.UTC(0,0,0,0,0,0,s)),h=[];return n.getUTCMinutes()&&h.push(n.getUTCMinutes()+"m"),n.getUTCSeconds()&&h.push(n.getUTCSeconds()+"s"),n.getUTCMilliseconds()&&h.push(n.getUTCMilliseconds()+"ms"),h.length||h.push("0ms"),h.join(" ")}function $e(){return window.CooeeSDK.runtimeData}function yn(){return yt(Date.now()-$e().sdkLoadTime.getTime())}function Nn(s){try{return new URL(s)}catch{return}}function xn(s){return!s||s==="null"||s==="undefined"}function Ln(s,n){let h=s.indexOf(n);return h===-1?!1:(s.splice(h,1),!0)}function On(s,n,h){return{[s]:Or(n,h),[s+"_wo_currency"]:n}}function Or(s,n){if(s==0&&n)return"Free";let h=$e(),c=ye.get(),v=h.shopCurrencyCode||c.currency,I=h.currencyCode;I||Y.warn("Currency code is not set in RuntimeData");let w=c.money?.format??h.moneyFormat,R;if(w&&v===I)R=be.format(s*100,w);else{let b;try{b=new Intl.NumberFormat(Et(),{style:"currency",currency:I||v,minimumFractionDigits:0,maximumFractionDigits:2})}catch(m){return Ge(m,"format-currency",{extra:{currentCurrency:I,shopCurrency:v}}),""}R=b.format(s),R=R.replace("\u20B9","Rs. "),c.money?.showCurrency&&I!=="INR"&&(R=R.concat(` ${I}`))}return R}function Pn(s){let n=Et();try{return new Intl.NumberFormat(n,{notation:"compact"}).format(s)}catch(h){return Ge(h,"format-number",{extra:{lang:n,value:s}}),s.toString()}}function Et(){let s="en";return typeof navigator<"u"&&(navigator.languages!==void 0&&navigator.languages.length>0?s=navigator.languages[0]:navigator.language&&(s=navigator.language)),s=s.split(";")[0],s=s.split("-")[0],s||"en"}var Te;function _t(){if(Te)return Te;try{return Te=Intl.DateTimeFormat().resolvedOptions().timeZone,Te}catch{return""}}function bt(s){document.readyState!=="loading"?s():document.addEventListener("DOMContentLoaded",s)}function Vn(s){let n=document.createElement("span");n.id="snackbar",n.innerText=s,document.body.appendChild(n),n.className="show",setTimeout(()=>{n.classList.remove("show"),document.body.removeChild(n)},5e3)}async function Pr(s,n=7,h=document){let c=1,v=document.querySelectorAll("nonexistent-tag");for(;c<=n;){let I=Math.min(50*2**c,1e3);if(c>1&&await ve.sleep(I),v=h.querySelectorAll(s),v.length)return Y.verbose(`Attempt ${c}: ${v.length} elements found with ${s}`),v;Y.verbose(`Attempt ${c}: Elements not found with ${s}. Will retry after ${I}ms.`),c++}return Y.verbose(`\u26A0\uFE0F Max attempts reached. Element not found with ${s}.`),v}async function Mn(s,n=10,h=document){return(await Pr(s,n,h)).item(0)}async function Vr(s){let[n,h,c]=await Promise.all([de.get("did"),_e.get("id",""),de.get("sessionNumber",1)]),v={letscooee_did:n,letscooee_sid:h,letscooee_sn:`${c}`,__letscooee_time:new Date().toLocaleString()};return s&&(v.__letscooee_via=s),v}async function Bn(s){let n=await Vr(s);return Object.entries(n).map(([h,c])=>({key:h,value:c.toString()}))}function Fn(s,n,h,c=!1){Object.defineProperty(s,n,{enumerable:!1,configurable:!1,writable:c,value:h})}function Un(s){if(s%100>=11&&s%100<=13)return s+"th";switch(s%10){case 1:return s+"st";case 2:return s+"nd";case 3:return s+"rd";default:return s+"th"}}var W=mt(wt());var Y=class{static debuggerEl;static infoLogs=[];static log(...n){W.default.info(...n)}static verbose(...n){W.default.debug(...n)}static error(...n){W.default.error(...n)}static warn(...n){W.default.warn(...n)}static info(...n){W.default.info(...n),this.infoLogs.push({time:new Date,message:n.join(" ")}),this.addToDebugger()}static trace(...n){W.default.trace(...n)}static addToDebugger(){sessionStorage.cooeeDebug&&(this.debuggerEl=this.debuggerEl??document.querySelector("cooee-debugger"),this.debuggerEl&&this.debuggerEl&&(this.debuggerEl.logs=[...this.infoLogs]))}};function Hn(s=gt){W.default.useDefaults({formatter:function(n){n.unshift(`${s} (v${Q}):`)}}),Mr()&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?W.default.setLevel(W.default[localStorage.cooeeLogLevel]):W.default.setLevel(ce.debug?W.default.TRACE:W.default.OFF)}function Mr(){let s=It();return s==="1"||s==="on"}function It(){return new URL(location.href).searchParams?.get("cooee-debug")}function Yn(){let s=["display: inline-block;","font-size: 14px;","background: linear-gradient(90deg, #d52dc8 25%, #2179e2 82%);","color: white;","padding: 4px;","border-radius: 4px;"].join(" "),n=`
2
- `;n+=`\u{1F4E3} Drive higher conversions with AI-powered onsite engagement
3
- `,n+=`\u{1F50D} Track real-time visitor intent & optimize engagement
4
- `,n+=`\u{1F4CA} Improve Meta Ads ROAS with intent-driven campaigns
5
- `,n+=`\u{1F6CD}\uFE0F Boost purchases & repeat sales effortlessly
6
- `,n+=`
7
-
8
- `,n+="Learn more: https://www.letscooee.com",console.group("%c Elevate your ecommerce experience with Cooee \u{1F680} ",s),console.log(`%c${n}`,"font-size: 13px; line-height: 1.8;"),console.log(`SDK v${Q}`),console.groupEnd(),Y.info(`SDK v${Q} loaded`)}function jn(){let s=localStorage.getItem("cooeeDebugTill"),n=It();if(n==="1"||n==="on"){let h=Fr();s||(s=h.toString(),localStorage.setItem("cooeeDebugTill",s))}n==="on"?sessionStorage.cooeeDebug="1":n==="off"&&sessionStorage.removeItem("cooeeDebug"),sessionStorage.cooeeDebug&&Br(),s&&new Date(+s)<new Date&&localStorage.removeItem("cooeeDebugTill")}function Br(){let s=document.createElement("cooee-debugger");bt(()=>{document.body.appendChild(s)})}function Fr(){return new Date().getTime()+360*60*1e3}var St=5,Ur=500,oe=class extends Error{request;response;status;requestBody;responseText;constructor(n){super(n),this.name="FetchError",Object.setPrototypeOf(this,new.target.prototype)}is40x(){return!!this.response&&this.response.status>=400&&this.response.status<500}};async function Kn(s,n){let h=Date.now(),c;try{c=await kr(s,n)}catch{}let v=c?new Request(c.url,{method:n?.method||"GET"}):new Request(s,n);if(!c||!c.ok){let m="Failed to fetch";c?.statusText&&(m+=`: ${c.statusText}`);let T=new oe(m);throw T.request=v,T.response=c?.clone(),T.status=c?.status,T.requestBody=n?.body,T.responseText=await Dt(c),T}let I,w=(c.headers.get("content-type")||"").toLowerCase(),R=c.headers.get("content-length"),b=n?.method?.toUpperCase()||"GET";if(c.status===204||c.status===205||b==="HEAD"||R==="0")I=void 0;else if(w.includes("application/json")||w.includes("application/problem+json")||w.includes("text/javascript"))try{I=await c.clone().json()}catch(m){let T=new oe(`Failed to parse JSON response: ${m?.message}`);throw T.request=v,T.response=c.clone(),T.status=c.status,T.requestBody=n?.body,T.responseText=await Dt(c),T}else w.includes("text/")||w.includes("image/svg+xml")?I=await c.text():I=await c.arrayBuffer();return{data:I,status:c.status,statusText:c.statusText,headers:c.headers,timeTakenMs:Date.now()-h,options:n,request:v}}async function kr(s,n){let h=null,c;for(let v=0;v<=St;v++){try{let I=new Headers(n?.headers);(s.includes("letscooee.com")||s.includes("localhost"))&&I.set("Cooee-Retry-Attempt",v.toString());let w=lt(ee({},n),{headers:I});if(c=await fetch(s,w),c.ok||c.status>=400&&c.status<500)return c;h=new Error(`Server error: ${c.status} ${c.statusText}`)}catch(I){h=I instanceof Error?I:new Error(String(I))}if(v<St){let I=Math.pow(2,v)*Ur;Y.info(`Request to ${s} failed. Retrying in ${I}ms...`),await new Promise(w=>setTimeout(w,I))}}if(c&&!c.ok)return c;throw h||new Error("Request failed after retries")}async function Dt(s){if(s){try{return s=s.clone(),await s.json()}catch{}try{return await s.text()}catch{}}}var Ie={},Se,De,Ct,At,Rt;async function Nt(){if(!De)return Rt??=Wr(),Rt}async function Wr(){let{BrowserClient:s,Scope:n,defaultStackParser:h,getDefaultIntegrations:c,makeFetchTransport:v}=await import("./esm-EYV26LOR.js");At=n;let I=c({}).filter(w=>!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(w.name));De=new s({dsn:"https://1bc3dda4c861f60cd6be1b67584f4bc6@o559187.ingest.us.sentry.io/4507626484203520",transport:v,stackParser:h,integrations:I,environment:ce.mode,release:`web-sdk@${Q}`,debug:ce.debug,sampleRate:.5}),De.init()}function Ge(s,n,h){Y.error(`${n}:`,s),Nt().then(()=>{let c=xt(h);if(c.setTag("operation",n),s instanceof oe){$r(c,s,n);return}c.captureException(s)})}function no(s,n,h){Nt().then(()=>{xt(h).captureMessage(s,n??"error")})}function $r(s,n,h){if(Gr(s,n),n.response){let c=n.response,v=n.responseText;s.setTag("error.message",n.message),c.status!=null&&s.setTag("http.status_code",c.status),c.statusText&&s.setTag("http.status_text",c.statusText),v&&typeof v=="object"&&"error"in v&&(s.setTag("http.error_code",v.error.code),s.setTag("http.error_message",v.error.message)),s.setExtras({responseText:n.responseText,statusText:c.statusText,responseType:c.type,redirected:c.redirected,responseUrl:c.url,originalError:n.message}),s.captureMessage(`${h} failed with ${c.status}`,"error");return}if(n.request){s.captureMessage(`No response was received for ${h}`,"error");return}}function Gr(s,n){let h=n.request;if(!h)return;s.setExtras({body:n.requestBody,headers:h.headers,method:h.method,url:h.url});let c=h.headers?.get("Cooee-Retry-Attempt");c!==null&&s.setTag("retry.attempt",c)}function oo(s){Ct=s}function io(s,n){Ie[s]=ee(ee({},Ie[s]),n)}function ao(s){Se=ee(ee({},Se),s)}function xt(s){s??={};let{extra:n,tags:h}=s,c=new At;if(c.setClient(De),c.setUser(Ct),s.triggerContext&&!s.engagementTrigger&&(s.engagementTrigger=s.triggerContext.triggerData),s.engagementTrigger){let v=s.engagementTrigger;c.setTags({"engagement.id":v.engagementID,"engagement.short_id":v.shortID,"engagement.objective":v.objective,"engagement.delivery_type":v.onsiteDeliveryType,"engagement.content_id":v.contentID,"engagement.variation":v.variation,"engagement.currency":v.currency})}return n&&c.setExtras(n),h&&c.setTags(h),Se&&c.setTags(Se),Object.keys(Ie).forEach(v=>{c.setContext(v,Ie[v])}),c.setTag("language",navigator.language),c.setTag("timezone",_t()),Hr(c),c}function Hr(s){window.Shopify&&(s.setTag("shopify.shop",window.Shopify.shop),s.setTag("shopify.currency",window.Shopify.currency?.active),s.setTag("shopify.locale",window.Shopify.locale),s.setTag("theme.schema_name",window.Shopify.theme?.schema_name),s.setTag("theme.schema_version",window.Shopify.theme?.schema_version))}export{qr as a,Q as b,Kr as c,Xr as d,Jr as e,Qr as f,Zr as g,pt as h,ce as i,ve as j,ye as k,Ee as l,ne as m,_e as n,de as o,oe as p,Kn as q,Ge as r,no as s,oo as t,io as u,ao as v,yt as w,$e as x,yn as y,Nn as z,xn as A,Ln as B,On as C,Or as D,Pn as E,bt as F,Vn as G,Pr as H,Mn as I,Vr as J,Bn as K,Fn as L,Un as M,wt as N,Y as O,Hn as P,Mr as Q,Yn as R,jn as S};
@@ -1 +0,0 @@
1
- var k=Object.create;var g=Object.defineProperty,l=Object.defineProperties,m=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,p=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var h=(a,b,c)=>b in a?g(a,b,{enumerable:!0,configurable:!0,writable:!0,value:c}):a[b]=c,r=(a,b)=>{for(var c in b||={})i.call(b,c)&&h(a,c,b[c]);if(f)for(var c of f(b))j.call(b,c)&&h(a,c,b[c]);return a},s=(a,b)=>l(a,n(b));var t=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var u=(a,b)=>{var c={};for(var d in a)i.call(a,d)&&b.indexOf(d)<0&&(c[d]=a[d]);if(a!=null&&f)for(var d of f(a))b.indexOf(d)<0&&j.call(a,d)&&(c[d]=a[d]);return c};var v=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),w=(a,b)=>{for(var c in b)g(a,c,{get:b[c],enumerable:!0})},q=(a,b,c,d)=>{if(b&&typeof b=="object"||typeof b=="function")for(let e of o(b))!i.call(a,e)&&e!==c&&g(a,e,{get:()=>b[e],enumerable:!(d=m(b,e))||d.enumerable});return a};var x=(a,b,c)=>(c=a!=null?k(p(a)):{},q(b||!a||!a.__esModule?g(c,"default",{value:a,enumerable:!0}):c,a));var y=(a,b,c)=>h(a,typeof b!="symbol"?b+"":b,c);export{r as a,s as b,t as c,u as d,v as e,w as f,x as g,y as h};
@@ -1,10 +0,0 @@
1
- import{a as Be,b as et,c as bn,g as De}from"./chunk-CFZOV3EF.js";import{a as tt,b as wt}from"./chunk-7XDM4HDH.js";import{$ as Et,$a as Ce,Aa as sn,Ab as Dt,Ba as L,Bb as me,Ca as an,D as he,Da as p,E as ie,Ea as ln,Fa as cn,Fb as He,Gb as yn,I as _e,Ib as j,Ja as un,K as ge,Ka as dn,L as ue,La as P,Na as Le,O as u,Oa as Qe,Pa as Xe,Qa as x,Ra as oe,Sa as ve,Wa as z,X as k,Xa as q,Y as bt,Ya as U,Za as pn,_ as Jt,_a as Ze,ab as Je,b as Kt,ba as $,bb as fn,ca as ke,cb as Y,db as K,fb as fe,ga as en,ha as Ee,hb as se,ia as C,ib as ae,ja as y,jb as ee,ka as tn,kb as N,lb as mn,ma as de,mb as Ue,na as pe,o as Qt,oa as g,pa as m,q as Xt,qa as h,ra as I,s as Ct,sa as J,sb as hn,t as yt,ta as re,tb as _n,u as Zt,ua as Ke,ub as gn,v as S,va as nn,wa as rn,wb as vn,x as R,xa as T,y as F,ya as on,za as B,zb as Cn}from"./chunk-GIEYLCFF.js";import{a as H,b as Fe}from"./chunk-U4XWPFUW.js";var En=0;function mi(t=document.head){return Dn(Dt.styleURL,t,"cooee-global-styles")}function hi(t=document.head){return Dn(Dt.swiperStyleURL,t,"cooee-swiper-styles")}function Dn(t,e=document.head,n){return new Promise(i=>{if(e.querySelector(`#${n}`)){i();return}let o=document.createElement("link");o.rel="stylesheet",o.href=t,o.id=n,o.onload=()=>{i()},o.onerror=()=>{console.error("Failed to load stylesheet:",t),i()},e.appendChild(o)})}function Ge(t,e=document.head){if(!t)return;En++;let n=document.createElement("style");n.id=`cooee-app-css-${En}`,n.textContent=t,e.appendChild(n)}async function nt(){let t=(await import(`${Cn}/swiper-bundle.min.mjs`)).Swiper;return window.CooeeSDK.Swiper=t}async function it(t,e=!0){if(!t)return;let n=[];e&&n.push(hi(t)),n.push(mi(t)),await Promise.all(n);let i=me.get().website.commonCSS;Ge(i,t)}var vi={"[class.ng-untouched]":"isUntouched","[class.ng-touched]":"isTouched","[class.ng-pristine]":"isPristine","[class.ng-dirty]":"isDirty","[class.ng-valid]":"isValid","[class.ng-invalid]":"isInvalid","[class.ng-pending]":"isPending"},wo=Fe(H({},vi),{"[class.ng-submitted]":"isSubmitted"});var Ci=new Zt("",{providedIn:"root",factory:()=>wn}),wn="always";var yi=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=bt({type:t});static \u0275inj=yt({})}return t})();var In=(()=>{class t{static withConfig(n){return{ngModule:t,providers:[{provide:Ci,useValue:n.callSetDisabledState??wn}]}}static \u0275fac=function(i){return new(i||t)};static \u0275mod=bt({type:t});static \u0275inj=yt({imports:[yi]})}return t})();var It=(function(t){return t.SHOPIFY_CHECKOUT="shopify_checkout",t.THIRD_PARTY_CHECKOUT="third_party_checkout",t.CART_PAGE="cart_page",t.CART_DRAWER="cart_drawer",t})(It||{});var Q=(function(t){return t[t.NONE=0]="NONE",t[t.REJECT_POPUP=1]="REJECT_POPUP",t[t.ACCEPT_POPUP=2]="ACCEPT_POPUP",t[t.GO_TO_URL=4]="GO_TO_URL",t[t.SHARE=5]="SHARE",t[t.KEY_VALUE=100]="KEY_VALUE",t[t.GO_TO_PRODUCT=101]="GO_TO_PRODUCT",t[t.ADD_TO_CART=102]="ADD_TO_CART",t[t.COPY_COUPON_CODE=103]="COPY_COUPON_CODE",t[t.GO_TO_COLLECTION=104]="GO_TO_COLLECTION",t[t.OPEN_CART=105]="OPEN_CART",t[t.SUBMIT_FORM=106]="SUBMIT_FORM",t[t.INITIATE_CHECKOUT=107]="INITIATE_CHECKOUT",t[t.ADD_BUNDLE=108]="ADD_BUNDLE",t[t.UPGRADE_TO_SUBSCRIPTION=109]="UPGRADE_TO_SUBSCRIPTION",t[t.BUY_NOW=110]="BUY_NOW",t[t.QUICK_VIEW=111]="QUICK_VIEW",t})(Q||{});var bi=(function(t){return t.FREE_SHIPPING="FREE_SHIPPING",t.DISCOUNT="DISCOUNT",t.FREE_AUTO_GIFT="FREE_AUTO_GIFT",t.FREE_GIFT_SELECT="FREE_GIFT_SELECT",t.UI_ONLY="UI_ONLY",t})(bi||{});var X=class t{engagementContext=S(Be);eventData=S(et);constructor(){}executeCTA(e,n){let i,r=this.engagementContext();if(!r){j.error("Engagement context is not available; aborting executeCTA.");return}if(e===Q.ADD_TO_CART)i="CE Add To Cart Clicked";else if(e===Q.GO_TO_PRODUCT)i="CE View Item Clicked";else if(e===Q.OPEN_CART)i="CE Open Cart Clicked",r.triggerData.redirectBehaviour=It.CART_DRAWER;else{j.warn(`Unsupported CTA type: ${e}`);return}window.CooeeSDK.executeCTA(r,H({clickAction:{at:e}},n));let o=new bn(i,this.eventData.props,r.triggerData);n?.video?o.setVideos(n.video):this.eventData.video&&o.setVideos(this.eventData.video),window.CooeeSDK.sendEvent(o)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Ct({token:t,factory:t.\u0275fac})};function xn(t,e){return[X,...Ei(t,e)]}function Ei(t,e){return[{provide:Be,useValue:ie(t)},{provide:et,useValue:H({},e)}]}var rt=class t{elementRef=S(_e);engagementService=S(X);hasSwiper=!1;_engagementTrigger=ie(null);_triggerContext=S(Be);constructor(){this.elementRef.nativeElement.update=this.update.bind(this)}get classes(){let e=["letscooee-widget"],n=this._engagementTrigger();return e.push(`widget-${n?.shortID}`),e}get triggerContext(){return this._triggerContext()}set triggerContext(e){this._triggerContext.set(e),this._engagementTrigger.set(e.triggerData),this.engagementTriggerReceived(e.triggerData)}get engagementTrigger(){return this._engagementTrigger()}ngOnInit(){j.verbose("Init",this.constructor.name);let e=this.elementRef.nativeElement.shadowRoot;e&&(it(e,this.hasSwiper),Ge(this.engagementTrigger?.content?.innerCSS,e))}ngOnDestroy(){j.verbose("Destroying",this.constructor.name)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=k({type:t,selectors:[["ng-component"]],hostVars:2,hostBindings:function(n,i){n&2&&Xe(i.classes)},inputs:{triggerContext:"triggerContext"},decls:1,vars:0,template:function(n,i){n&1&&on(0)},encapsulation:2})};var Vn=(t,e)=>e.id;function Di(t,e){if(t&1&&(m(0,"span",6),x(1),h()),t&2){p();let n=U(0);u(),oe(n)}}function wi(t,e){if(t&1){let n=B();z(0),m(1,"button",5),L("click",function(){let r=R(n).$implicit,o=p().$implicit,s=p();return F(s.onOptionChange(o,r))}),C(2,Di,2,1,"span",6),h()}if(t&2){let n=e.$implicit,i=p().$implicit,r=U(1),o=p(),s=n.name,l=q(n.displayName||n.name),c=n.swatch,d=r?n.hexColor??s:"",_=o.selectedOptions()[i.name]===s,a=!!(c!=null&&c.color),v=!!(!(c==null||c.image==null)&&c.image.url);u(),Le("swatch-color-type",a)("swatch-image-type",v)("selected",_)("disabled",n.disabled),g("title",l)("ngStyle",o.getSwatchStyles(c,d)),Ee("aria-checked",_?"true":"false")("data-value",s)("aria-disabled",n.disabled?"true":null)("aria-label",l),u(),y(!r&&!a&&!v?2:-1)}}function Ii(t,e){if(t&1&&(m(0,"div"),z(1),m(2,"div",1),x(3),h(),m(4,"div",2),x(5),h(),m(6,"div",3),de(7,wi,3,16,"button",4,Vn),h()()),t&2){let n=e.$implicit,i=p();Xe(Ze("option-group ",n.name.toLowerCase())),u(),q(i.hasHexColors(n)),u(2),ve("",n.name,":"),u(2),oe(i.selectedOptions()[n.name]),u(),Ee("aria-label",n.name),u(),pe(n.optionValues)}}var je=t=>t.trim().toLowerCase(),ot=class t extends rt{selectedVariant=new ke;item=N.required();selectedOptions=ie({});options=se(()=>{let e=this.item();if(!e.options||e.vars.length===1)return[];if(window.cooeeManipulateProduct)try{window.cooeeManipulateProduct(e,this.engagementTrigger)}catch(n){j.error(n)}return e.options.forEach(n=>{n.optionValues.forEach(i=>{i.disabled=this.isOptionValueDisabledFast(n,i)})}),e.options});matchedVariant=se(()=>{let e=this.item(),n=this.selectedOptions();return e.vars.find(i=>e.options.every(r=>{let o=i.selectedOptions.find(s=>s.name===r.name)?.value;return n[r.name]===o}))});availabilityIndex=se(()=>{let e=this.item(),n=new Map;return e?.vars?.length&&e.vars.forEach((i,r)=>{if(i.isAvailable)for(let o of i.selectedOptions){let s=je(o.name),l=o.value,c=n.get(s);c||n.set(s,c=new Map);let d=c.get(l);d||c.set(l,d=new Set),d.add(r)}}),n});constructor(){super(),ae(()=>{let n=this.matchedVariant();n&&(this.item().setSelectedVariant(n),this.selectedVariant.emit(n))});let e=ae(()=>{let n=this.item();if(!n?.options)return;let i=H({},this.selectedOptions()),r=n.vars.find(o=>o.isAvailable)??n.vars[0];n.options.forEach(o=>{let s=r?.selectedOptions.find(l=>l.name===o.name)?.value;s&&(i[o.name]=s)}),this.selectedOptions.set(i),e.destroy()})}ngOnInit(){super.ngOnInit();let e=this.elementRef.nativeElement.shadowRoot;if(!e)return;let n=me.get().website?.itemSwatchMapping;n&&Ge(n,e)}onOptionChange(e,n){let i=H({},this.selectedOptions());i[e.name]=n.name,this.selectedOptions.set(i)}engagementTriggerReceived(){}update(){}hasHexColors(e){return!!e.optionValues[0]?.name.match(/#[a-f0-9]{6}\b/i)}getSwatchStyles(e,n){let i={};return!e&&n?(i["--option-color"]=n,i["background-color"]=n,i):(e?.image?.url?i["background-image"]=`url("${e.image.url}")`:e?.color&&(i["--option-color"]=e.color,i["background-color"]=e.color),i)}getCandidateVariantsExcluding(e){let n=this.item(),i=this.availabilityIndex(),r=new Set;n.vars.forEach((s,l)=>{s.isAvailable&&r.add(l)});let o=r;for(let[s,l]of Object.entries(this.selectedOptions())){if(je(s)===je(e))continue;let c=i.get(je(s));if(!c)return new Set;let d=c.get(String(l));if(!d)return new Set;if(o=new Set([...o].filter(_=>d.has(_))),o.size===0)return o}return o}isOptionValueDisabledFast(e,n){let r=this.availabilityIndex().get(je(e.name));if(!r)return!0;let o=n.name,s=r.get(o);if(!s||s.size===0)return!0;let l=this.getCandidateVariantsExcluding(e.name);if(l.size===0)return!0;for(let c of l)if(s.has(c))return!1;return!0}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=k({type:t,selectors:[["cooee-item-options-picker"]],inputs:{item:[1,"item"]},outputs:{selectedVariant:"selectedVariant"},features:[Ce(xn()),Et],decls:2,vars:0,consts:[[3,"class"],[1,"name"],[1,"selected-value"],["role","radiogroup",1,"option-values"],["type","button","role","radio",1,"option-value",3,"swatch-color-type","swatch-image-type","selected","disabled","title","ngStyle"],["type","button","role","radio",1,"option-value",3,"click","title","ngStyle"],[1,"title"]],template:function(n,i){n&1&&de(0,Ii,9,7,"div",0,Vn),n&2&&pe(i.options())},dependencies:[vn,_n,In],styles:[`.option-group{display:flex;gap:4px;align-items:center}.option-group+.option-group{margin-top:8px}.option-values{display:flex;flex-wrap:nowrap;overflow-x:auto;padding:6px;gap:4px;scrollbar-gutter:stable both-edges;scrollbar-width:none}.option-values::-webkit-scrollbar{display:none}.selected-value{display:none}.option-value{padding:5px 10px;border:1px solid #ccc;cursor:pointer;border-radius:4px;min-width:32px;min-height:32px;text-align:center;position:relative;flex-shrink:0;--selected-color: var(--option-color, rgba(var(--lc-primary-button-bg-color, 0 0 0)));background-size:cover;background-position:center;background-repeat:no-repeat}.option-value.selected{box-shadow:#fff 0 0 0 2px,var(--selected-color) 0 0 0 4px}.option-value.disabled{opacity:.5;pointer-events:none}
2
- `],encapsulation:3})};var we=class{lastWidth;lastHeight;resizeTimeout=null;debounceDelay=200;onResizeCallback;constructor(e){this.onResizeCallback=e,this.lastWidth=window.innerWidth,this.lastHeight=window.innerHeight,window.addEventListener("resize",this.debouncedResize),window.addEventListener("orientationchange",this.handleImmediateResize)}destroy(){window.removeEventListener("resize",this.debouncedResize),window.removeEventListener("orientationchange",this.handleImmediateResize)}handleImmediateResize=()=>{this.triggerResize()};debouncedResize=()=>{this.resizeTimeout!==null&&clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout(()=>{this.triggerResize()},this.debounceDelay)};triggerResize(){let e=window.innerWidth,n=window.innerHeight;(n!==this.lastHeight||e!==this.lastWidth)&&(this.onResizeCallback(),this.lastWidth=e,this.lastHeight=n)}};var Nn,b,Tn,Mt,be,Sn,Pn,Rn,Fn,At,Vt,St,xi,Ot={},kn=[],Vi=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,lt=Array.isArray;function le(t,e){for(var n in e)t[n]=e[n];return t}function Nt(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function xt(t,e,n,i,r){var o={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++Tn,__i:-1,__u:0};return r==null&&b.vnode!=null&&b.vnode(o),o}function Tt(t){return t.children}function Ie(t,e){this.props=t,this.context=e}function xe(t,e){if(e==null)return t.__?xe(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?xe(t):null}function Ln(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return Ln(t)}}function On(t){(!t.__d&&(t.__d=!0)&&be.push(t)&&!at.__r++||Sn!=b.debounceRendering)&&((Sn=b.debounceRendering)||Pn)(at)}function at(){for(var t,e,n,i,r,o,s,l=1;be.length;)be.length>l&&be.sort(Rn),t=be.shift(),l=be.length,t.__d&&(n=void 0,r=(i=(e=t).__v).__e,o=[],s=[],e.__P&&((n=le({},i)).__v=i.__v+1,b.vnode&&b.vnode(n),Bn(e.__P,n,i,e.__n,e.__P.namespaceURI,32&i.__u?[r]:null,o,r??xe(i),!!(32&i.__u),s),n.__v=i.__v,n.__.__k[n.__i]=n,Mi(o,n,s),n.__e!=r&&Ln(n)));at.__r=0}function Un(t,e,n,i,r,o,s,l,c,d,_){var a,v,f,V,W,A,D=i&&i.__k||kn,w=e.length;for(c=Si(n,e,D,c,w),a=0;a<w;a++)(f=n.__k[a])!=null&&(v=f.__i==-1?Ot:D[f.__i]||Ot,f.__i=a,A=Bn(t,f,v,r,o,s,l,c,d,_),V=f.__e,f.ref&&v.ref!=f.ref&&(v.ref&&Pt(v.ref,null,f),_.push(f.ref,f.__c||V,f)),W==null&&V!=null&&(W=V),4&f.__u||v.__k===f.__k?c=Hn(f,c,t):typeof f.type=="function"&&A!==void 0?c=A:V&&(c=V.nextSibling),f.__u&=-7);return n.__e=W,c}function Si(t,e,n,i,r){var o,s,l,c,d,_=n.length,a=_,v=0;for(t.__k=new Array(r),o=0;o<r;o++)(s=e[o])!=null&&typeof s!="boolean"&&typeof s!="function"?(c=o+v,(s=t.__k[o]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?xt(null,s,null,null,null):lt(s)?xt(Tt,{children:s},null,null,null):s.constructor==null&&s.__b>0?xt(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=t,s.__b=t.__b+1,l=null,(d=s.__i=Oi(s,n,c,a))!=-1&&(a--,(l=n[d])&&(l.__u|=2)),l==null||l.__v==null?(d==-1&&(r>_?v--:r<_&&v++),typeof s.type!="function"&&(s.__u|=4)):d!=c&&(d==c-1?v--:d==c+1?v++:(d>c?v--:v++,s.__u|=4))):t.__k[o]=null;if(a)for(o=0;o<_;o++)(l=n[o])!=null&&(2&l.__u)==0&&(l.__e==i&&(i=xe(l)),jn(l,l));return i}function Hn(t,e,n){var i,r;if(typeof t.type=="function"){for(i=t.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=t,e=Hn(i[r],e,n));return e}t.__e!=e&&(e&&t.type&&!n.contains(e)&&(e=xe(t)),n.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Oi(t,e,n,i){var r,o,s=t.key,l=t.type,c=e[n];if(c===null&&t.key==null||c&&s==c.key&&l==c.type&&(2&c.__u)==0)return n;if(i>(c!=null&&(2&c.__u)==0?1:0))for(r=n-1,o=n+1;r>=0||o<e.length;){if(r>=0){if((c=e[r])&&(2&c.__u)==0&&s==c.key&&l==c.type)return r;r--}if(o<e.length){if((c=e[o])&&(2&c.__u)==0&&s==c.key&&l==c.type)return o;o++}}return-1}function Mn(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Vi.test(e)?n:n+"px"}function st(t,e,n,i,r){var o,s;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof i=="string"&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||Mn(t.style,e,"");if(n)for(e in n)i&&n[e]==i[e]||Mn(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")o=e!=(e=e.replace(Fn,"$1")),s=e.toLowerCase(),e=s in t||e=="onFocusOut"||e=="onFocusIn"?s.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?i?n.u=i.u:(n.u=At,t.addEventListener(e,o?St:Vt,o)):t.removeEventListener(e,o?St:Vt,o);else{if(r=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function An(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=At++;else if(e.t<n.u)return;return n(b.event?b.event(e):e)}}}function Bn(t,e,n,i,r,o,s,l,c,d){var _,a,v,f,V,W,A,D,w,Ne,ce,qe,Te,Yt,Ye,Pe,vt,Z=e.type;if(e.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),o=[l=e.__e=n.__e]),(_=b.__b)&&_(e);e:if(typeof Z=="function")try{if(D=e.props,w="prototype"in Z&&Z.prototype.render,Ne=(_=Z.contextType)&&i[_.__c],ce=_?Ne?Ne.props.value:_.__:i,n.__c?A=(a=e.__c=n.__c).__=a.__E:(w?e.__c=a=new Z(D,ce):(e.__c=a=new Ie(D,ce),a.constructor=Z,a.render=Ni),Ne&&Ne.sub(a),a.props=D,a.state||(a.state={}),a.context=ce,a.__n=i,v=a.__d=!0,a.__h=[],a._sb=[]),w&&a.__s==null&&(a.__s=a.state),w&&Z.getDerivedStateFromProps!=null&&(a.__s==a.state&&(a.__s=le({},a.__s)),le(a.__s,Z.getDerivedStateFromProps(D,a.__s))),f=a.props,V=a.state,a.__v=e,v)w&&Z.getDerivedStateFromProps==null&&a.componentWillMount!=null&&a.componentWillMount(),w&&a.componentDidMount!=null&&a.__h.push(a.componentDidMount);else{if(w&&Z.getDerivedStateFromProps==null&&D!==f&&a.componentWillReceiveProps!=null&&a.componentWillReceiveProps(D,ce),!a.__e&&a.shouldComponentUpdate!=null&&a.shouldComponentUpdate(D,a.__s,ce)===!1||e.__v==n.__v){for(e.__v!=n.__v&&(a.props=D,a.state=a.__s,a.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(Re){Re&&(Re.__=e)}),qe=0;qe<a._sb.length;qe++)a.__h.push(a._sb[qe]);a._sb=[],a.__h.length&&s.push(a);break e}a.componentWillUpdate!=null&&a.componentWillUpdate(D,a.__s,ce),w&&a.componentDidUpdate!=null&&a.__h.push(function(){a.componentDidUpdate(f,V,W)})}if(a.context=ce,a.props=D,a.__P=t,a.__e=!1,Te=b.__r,Yt=0,w){for(a.state=a.__s,a.__d=!1,Te&&Te(e),_=a.render(a.props,a.state,a.context),Ye=0;Ye<a._sb.length;Ye++)a.__h.push(a._sb[Ye]);a._sb=[]}else do a.__d=!1,Te&&Te(e),_=a.render(a.props,a.state,a.context),a.state=a.__s;while(a.__d&&++Yt<25);a.state=a.__s,a.getChildContext!=null&&(i=le(le({},i),a.getChildContext())),w&&!v&&a.getSnapshotBeforeUpdate!=null&&(W=a.getSnapshotBeforeUpdate(f,V)),Pe=_,_!=null&&_.type===Tt&&_.key==null&&(Pe=Gn(_.props.children)),l=Un(t,lt(Pe)?Pe:[Pe],e,n,i,r,o,s,l,c,d),a.base=e.__e,e.__u&=-161,a.__h.length&&s.push(a),A&&(a.__E=a.__=null)}catch(Re){if(e.__v=null,c||o!=null)if(Re.then){for(e.__u|=c?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;o[o.indexOf(l)]=null,e.__e=l}else for(vt=o.length;vt--;)Nt(o[vt]);else e.__e=n.__e,e.__k=n.__k;b.__e(Re,e,n)}else o==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):l=e.__e=Ai(n.__e,e,n,i,r,o,s,c,d);return(_=b.diffed)&&_(e),128&e.__u?void 0:l}function Mi(t,e,n){for(var i=0;i<n.length;i++)Pt(n[i],n[++i],n[++i]);b.__c&&b.__c(e,t),t.some(function(r){try{t=r.__h,r.__h=[],t.some(function(o){o.call(r)})}catch(o){b.__e(o,r.__v)}})}function Gn(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:lt(t)?t.map(Gn):le({},t)}function Ai(t,e,n,i,r,o,s,l,c){var d,_,a,v,f,V,W,A=n.props,D=e.props,w=e.type;if(w=="svg"?r="http://www.w3.org/2000/svg":w=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),o!=null){for(d=0;d<o.length;d++)if((f=o[d])&&"setAttribute"in f==!!w&&(w?f.localName==w:f.nodeType==3)){t=f,o[d]=null;break}}if(t==null){if(w==null)return document.createTextNode(D);t=document.createElementNS(r,w,D.is&&D),l&&(b.__m&&b.__m(e,o),l=!1),o=null}if(w==null)A===D||l&&t.data==D||(t.data=D);else{if(o=o&&Nn.call(t.childNodes),A=n.props||Ot,!l&&o!=null)for(A={},d=0;d<t.attributes.length;d++)A[(f=t.attributes[d]).name]=f.value;for(d in A)if(f=A[d],d!="children"){if(d=="dangerouslySetInnerHTML")a=f;else if(!(d in D)){if(d=="value"&&"defaultValue"in D||d=="checked"&&"defaultChecked"in D)continue;st(t,d,null,f,r)}}for(d in D)f=D[d],d=="children"?v=f:d=="dangerouslySetInnerHTML"?_=f:d=="value"?V=f:d=="checked"?W=f:l&&typeof f!="function"||A[d]===f||st(t,d,f,A[d],r);if(_)l||a&&(_.__html==a.__html||_.__html==t.innerHTML)||(t.innerHTML=_.__html),e.__k=[];else if(a&&(t.innerHTML=""),Un(e.type=="template"?t.content:t,lt(v)?v:[v],e,n,i,w=="foreignObject"?"http://www.w3.org/1999/xhtml":r,o,s,o?o[0]:n.__k&&xe(n,0),l,c),o!=null)for(d=o.length;d--;)Nt(o[d]);l||(d="value",w=="progress"&&V==null?t.removeAttribute("value"):V!=null&&(V!==t[d]||w=="progress"&&!V||w=="option"&&V!=A[d])&&st(t,d,V,A[d],r),d="checked",W!=null&&W!=t[d]&&st(t,d,W,A[d],r))}return t}function Pt(t,e,n){try{if(typeof t=="function"){var i=typeof t.__u=="function";i&&t.__u(),i&&e==null||(t.__u=t(e))}else t.current=e}catch(r){b.__e(r,n)}}function jn(t,e,n){var i,r;if(b.unmount&&b.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||Pt(i,null,e)),(i=t.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(o){b.__e(o,e)}i.base=i.__P=null}if(i=t.__k)for(r=0;r<i.length;r++)i[r]&&jn(i[r],e,n||typeof t.type!="function");n||Nt(t.__e),t.__c=t.__=t.__e=void 0}function Ni(t,e,n){return this.constructor(t,n)}Nn=kn.slice,b={__e:function(t,e,n,i){for(var r,o,s;e=e.__;)if((r=e.__c)&&!r.__)try{if((o=r.constructor)&&o.getDerivedStateFromError!=null&&(r.setState(o.getDerivedStateFromError(t)),s=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(t,i||{}),s=r.__d),s)return r.__E=r}catch(l){t=l}throw t}},Tn=0,Mt=function(t){return t!=null&&t.constructor==null},Ie.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=le({},this.state),typeof t=="function"&&(t=t(le({},n),this.props)),t&&le(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),On(this))},Ie.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),On(this))},Ie.prototype.render=Tt,be=[],Pn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Rn=function(t,e){return t.__v.__b-e.__v.__b},at.__r=0,Fn=/(PointerCapture)$|Capture$/i,At=0,Vt=An(!1),St=An(!0),xi=0;var Ft,G,Rt,Wn,$n=0,Jn=[],O=b,zn=O.__b,qn=O.__r,Yn=O.diffed,Kn=O.__c,Qn=O.unmount,Xn=O.__;function Ti(t,e){O.__h&&O.__h(G,t,$n||e),$n=0;var n=G.__H||(G.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function Lt(t,e){var n=Ti(Ft++,7);return Fi(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function Pi(){for(var t;t=Jn.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(ct),t.__H.__h.forEach(kt),t.__H.__h=[]}catch(e){t.__H.__h=[],O.__e(e,t.__v)}}O.__b=function(t){G=null,zn&&zn(t)},O.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Xn&&Xn(t,e)},O.__r=function(t){qn&&qn(t),Ft=0;var e=(G=t.__c).__H;e&&(Rt===G?(e.__h=[],G.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach(ct),e.__h.forEach(kt),e.__h=[],Ft=0)),Rt=G},O.diffed=function(t){Yn&&Yn(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Jn.push(e)!==1&&Wn===O.requestAnimationFrame||((Wn=O.requestAnimationFrame)||Ri)(Pi)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Rt=G=null},O.__c=function(t,e){e.some(function(n){try{n.__h.forEach(ct),n.__h=n.__h.filter(function(i){return!i.__||kt(i)})}catch(i){e.some(function(r){r.__h&&(r.__h=[])}),e=[],O.__e(i,n.__v)}}),Kn&&Kn(t,e)},O.unmount=function(t){Qn&&Qn(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(i){try{ct(i)}catch(r){e=r}}),n.__H=void 0,e&&O.__e(e,n.__v))};var Zn=typeof requestAnimationFrame=="function";function Ri(t){var e,n=function(){clearTimeout(i),Zn&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,35);Zn&&(e=requestAnimationFrame(n))}function ct(t){var e=G,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),G=e}function kt(t){var e=G;t.__c=t.__(),G=e}function Fi(t,e){return!t||t.length!==e.length||e.some(function(n,i){return n!==t[i]})}var ki=Symbol.for("preact-signals");function Ht(){if(Ve>1)Ve--;else{for(var t,e=!1;We!==void 0;){var n=We;for(We=void 0,Ut++;n!==void 0;){var i=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&ti(n))try{n.c()}catch(r){e||(t=r,e=!0)}n=i}}if(Ut=0,Ve--,e)throw t}}var E=void 0;var We=void 0,Ve=0,Ut=0,ut=0;function ei(t){if(E!==void 0){var e=t.n;if(e===void 0||e.t!==E)return e={i:0,S:t,p:E.s,n:void 0,t:E,e:void 0,x:void 0,r:e},E.s!==void 0&&(E.s.n=e),E.s=e,t.n=e,32&E.f&&t.S(e),e;if(e.i===-1)return e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=E.s,e.n=void 0,E.s.n=e,E.s=e),e}}function M(t){this.v=t,this.i=0,this.n=void 0,this.t=void 0}M.prototype.brand=ki;M.prototype.h=function(){return!0};M.prototype.S=function(t){this.t!==t&&t.e===void 0&&(t.x=this.t,this.t!==void 0&&(this.t.e=t),this.t=t)};M.prototype.U=function(t){if(this.t!==void 0){var e=t.e,n=t.x;e!==void 0&&(e.x=n,t.e=void 0),n!==void 0&&(n.e=e,t.x=void 0),t===this.t&&(this.t=n)}};M.prototype.subscribe=function(t){var e=this;return ze(function(){var n=e.value,i=E;E=void 0;try{t(n)}finally{E=i}})};M.prototype.valueOf=function(){return this.value};M.prototype.toString=function(){return this.value+""};M.prototype.toJSON=function(){return this.value};M.prototype.peek=function(){var t=E;E=void 0;try{return this.value}finally{E=t}};Object.defineProperty(M.prototype,"value",{get:function(){var t=ei(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(Ut>100)throw new Error("Cycle detected");this.v=t,this.i++,ut++,Ve++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{Ht()}}}});function ne(t){return new M(t)}function ti(t){for(var e=t.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function ni(t){for(var e=t.s;e!==void 0;e=e.n){var n=e.S.n;if(n!==void 0&&(e.r=n),e.S.n=e,e.i=-1,e.n===void 0){t.s=e;break}}}function ii(t){for(var e=t.s,n=void 0;e!==void 0;){var i=e.p;e.i===-1?(e.S.U(e),i!==void 0&&(i.n=e.n),e.n!==void 0&&(e.n.p=i)):n=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=i}t.s=n}function Se(t){M.call(this,void 0),this.x=t,this.s=void 0,this.g=ut-1,this.f=4}(Se.prototype=new M).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===ut))return!0;if(this.g=ut,this.f|=1,this.i>0&&!ti(this))return this.f&=-2,!0;var t=E;try{ni(this),E=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return E=t,ii(this),this.f&=-2,!0};Se.prototype.S=function(t){if(this.t===void 0){this.f|=36;for(var e=this.s;e!==void 0;e=e.n)e.S.S(e)}M.prototype.S.call(this,t)};Se.prototype.U=function(t){if(this.t!==void 0&&(M.prototype.U.call(this,t),this.t===void 0)){this.f&=-33;for(var e=this.s;e!==void 0;e=e.n)e.S.U(e)}};Se.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;t!==void 0;t=t.x)t.t.N()}};Object.defineProperty(Se.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=ei(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});function Bt(t){return new Se(t)}function ri(t){var e=t.u;if(t.u=void 0,typeof e=="function"){Ve++;var n=E;E=void 0;try{e()}catch(i){throw t.f&=-2,t.f|=8,Gt(t),i}finally{E=n,Ht()}}}function Gt(t){for(var e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,ri(t)}function Li(t){if(E!==this)throw new Error("Out-of-order effect");ii(this),E=t,this.f&=-2,8&this.f&&Gt(this),Ht()}function $e(t){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}$e.prototype.c=function(){var t=this.S();try{if(8&this.f||this.x===void 0)return;var e=this.x();typeof e=="function"&&(this.u=e)}finally{t()}};$e.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,ri(this),ni(this),Ve++;var t=E;return E=this,Li.bind(this,t)};$e.prototype.N=function(){2&this.f||(this.f|=2,this.o=We,We=this)};$e.prototype.d=function(){this.f|=8,1&this.f||Gt(this)};function ze(t){var e=new $e(t);try{e.c()}catch(n){throw e.d(),n}return e.d.bind(e)}var Wt,jt;function Oe(t,e){b[t]=e.bind(null,b[t]||function(){})}function dt(t){jt&&jt(),jt=t&&t.S()}function oi(t){var e=this,n=t.data,i=Hi(n);i.value=n;var r=Lt(function(){for(var o=e.__v;o=o.__;)if(o.__c){o.__c.__$f|=4;break}return e.__$u.c=function(){var s,l=e.__$u.S(),c=r.value;l(),Mt(c)||((s=e.base)==null?void 0:s.nodeType)!==3?(e.__$f|=1,e.setState({})):e.base.data=c},Bt(function(){var s=i.value.value;return s===0?0:s===!0?"":s||""})},[]);return r.value}oi.displayName="_st";Object.defineProperties(M.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:oi},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});Oe("__b",function(t,e){if(typeof e.type=="string"){var n,i=e.props;for(var r in i)if(r!=="children"){var o=i[r];o instanceof M&&(n||(e.__np=n={}),n[r]=o,i[r]=o.peek())}}t(e)});Oe("__r",function(t,e){dt();var n,i=e.__c;i&&(i.__$f&=-2,(n=i.__$u)===void 0&&(i.__$u=n=(function(r){var o;return ze(function(){o=this}),o.c=function(){i.__$f|=1,i.setState({})},o})())),Wt=i,dt(n),t(e)});Oe("__e",function(t,e,n,i){dt(),Wt=void 0,t(e,n,i)});Oe("diffed",function(t,e){dt(),Wt=void 0;var n;if(typeof e.type=="string"&&(n=e.__e)){var i=e.__np,r=e.props;if(i){var o=n.U;if(o)for(var s in o){var l=o[s];l!==void 0&&!(s in i)&&(l.d(),o[s]=void 0)}else n.U=o={};for(var c in i){var d=o[c],_=i[c];d===void 0?(d=Ui(n,c,_,r),o[c]=d):d.o(_,r)}}}t(e)});function Ui(t,e,n,i){var r=e in t&&t.ownerSVGElement===void 0,o=ne(n);return{o:function(s,l){o.value=s,i=l},d:ze(function(){var s=o.value.value;i[e]!==s&&(i[e]=s,r?t[e]=s:s?t.setAttribute(e,s):t.removeAttribute(e))})}}Oe("unmount",function(t,e){if(typeof e.type=="string"){var n=e.__e;if(n){var i=n.U;if(i){n.U=void 0;for(var r in i){var o=i[r];o&&o.d()}}}}else{var s=e.__c;if(s){var l=s.__$u;l&&(s.__$u=void 0,l.d())}}t(e)});Oe("__h",function(t,e,n,i){(i<3||i===9)&&(e.__$f|=2),t(e,n,i)});Ie.prototype.shouldComponentUpdate=function(t,e){var n=this.__$u,i=n&&n.s!==void 0;for(var r in e)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){if(!(i||2&this.__$f||4&this.__$f)||1&this.__$f)return!0}else if(!(i||4&this.__$f)||3&this.__$f)return!0;for(var o in t)if(o!=="__source"&&t[o]!==this.props[o])return!0;for(var s in this.props)if(!(s in t))return!0;return!1};function Hi(t){return Lt(function(){return ne(t)},[])}var pt=class{id;mID;vID;vName;imageURL;name;link;quantity;price;finalPrice;constructor(e){this.id=e.id,this.mID=e.mID,this.vID=e.vID,this.vName=e.vName,this.imageURL=e.imageURL,this.name=e.name,this.link=e.link,this.quantity=e.quantity,this.price=e.price,this.finalPrice=e.finalPrice??e.price}};var ft=class{url;alt;constructor(e){e.alt&&(this.alt=e.alt),this.url=e.url}};var mt=class{d;cmp;effective;constructor(e={}){this.d=e.d,this.cmp=e.cmp,this.effective=this.d}};var $t=class{id;mID;name;groupID;groupName;isSelected;constructor(e){e??={},this.id=e.id,this.mID=e.mID,this.name=e.name,this.groupID=e.groupID,this.groupName=e.groupName,this.isSelected=e.isSelected??!1}},ht=class{mID;name;imgs;link;price;sku;isAvailable;quantity;sellingPlans;selectedOptions;selectedSellingPlan;effectivePrice;constructor(e){e=e??{},this.mID=e.mID,this.name=e.name,this.imgs=e.imgs?.map(n=>new ft(n))??[],this.link=e.link,this.price=new mt(e.price),this.sku=e.sku,this.isAvailable=e.isAvailable,this.quantity=e.quantity,this.selectedOptions=e.selectedOptions??[],this.effectivePrice=ne(this.price.effective),e.sellingPlans?.length&&(this.selectedSellingPlan=ne(void 0)),this.sellingPlans=e.sellingPlans?.map(n=>{let i=new $t(n);return i.isSelected&&(this.selectedSellingPlan.value=i),i})}getOneImage(){return this.imgs[0]?.url}changeSellingPlan(e){this.selectedSellingPlan.value=e}hasEffectivePrice(){return this.effectivePrice.value!==this.price.d}};function zt(t,e){for(let n of t){let i=e.get(n.attr),r=Array.isArray(i),o=typeof i=="string",s=typeof i=="number"&&typeof n.value=="number",l=Array.isArray(n.value),c=!0;switch(n.op){case"contains":{c=(r||o)&&i.includes(n.value);break}case"notContains":{c=(r||o)&&!i.includes(n.value);break}case"eq":{c=i===n.value;break}case"ne":{c=i!==n.value;break}case"gt":{c=s&&i>n.value;break}case"gte":{c=s&&i>=n.value;break}case"lt":{c=s&&i<n.value;break}case"lte":{c=s&&i<=n.value;break}case"in":{c=l&&n.value.includes(i);break}case"nin":{c=l&&!n.value.includes(i);break}case"between":{c=s&&l&&n.value.length===2&&i>=n.value[0]&&i<=n.value[1];break}case"all":{c=r&&l&&n.value.every(d=>i.includes(d));break}default:{c=!1;break}}if(!c)return!1}return!0}var _t=class{id;mID;name;options;imgs;vars;desc;link;slug;quantity;category;meta;reviews;tags;templateSuffix;selectedOrFirstVariant;selected=ne(!0);_showAddToCartButton;constructor(e){this.update(e),this.selectedOrFirstVariant=ne(this.selectedVariant),this._showAddToCartButton=this.evaluateShowATCFlag()}get firstImageURL(){return this.imgs?.[0]?.url}get secondaryImageURL(){return this.imgs?.[1]?.url}get getVariantImages(){return this.selectedOrFirstVariant.value.imgs}get variantImage(){return this.getVariantImages[0]?.url}get variantSecondaryImage(){return this.getVariantImages[1]?.url}get showAddToCartButton(){return this._showAddToCartButton}set variants(e){this.vars=e,this.selectedOrFirstVariant.value=this.selectedVariant}get selectedVariant(){return this.vars.find(e=>e.isAvailable)??this.vars[0]}hasVariants(){return this.vars?.length>1}setSelectedVariant(e){this.selectedOrFirstVariant.value=e}setSelectedVariantByID(e){if(!e)return;let n=this.vars.find(i=>i.mID===e.toString());n&&this.setSelectedVariant(n)}update(e){return this.id=e.id??this.id,this.mID=e.mID??this.mID,this.name=e.name??this.name,this.imgs=e.imgs??this.imgs,this.desc=e.desc??this.desc,this.link=e.link??this.link,this.slug=e.slug??this.slug,this.quantity=e.quantity??this.quantity,this.meta=e.meta??this.meta,this.category=e.category??this.category,this.reviews=e.reviews??this.reviews,this.options=e.options??this.options,this.tags=e.tags??this.tags,this.templateSuffix=e.templateSuffix??this.templateSuffix,e.vars&&(this.vars=e.vars.map(n=>new ht(n))),this}toEmbed(e){return e=e??this.selectedOrFirstVariant.value,new pt({id:this.id,mID:this.mID,vID:e.mID,vName:e.name,name:this.name,link:this.link,slug:this.slug,price:e.price.d,imageURL:e.getOneImage()??this.imgs?.[0].url})}getTemplateVariables(){let e=this.selectedOrFirstVariant.value,n=e.price,i=this.name,r=this.category,o=this.variantImage??this.firstImageURL,s=this.meta,l=this.tags?.join(",")??"",c=this.reviews?.rating,d=this.reviews?.totalReviews,_=n.cmp&&n.cmp>n.d,a=Fe(H({name:i},He("price",n.d,!0)),{image_url:o,meta:s,category:r,rating:c,reviews:d,tags:l});if(e.hasEffectivePrice()){let f=He("effective_price",e.effectivePrice.value,!0);Object.assign(a,f)}if(_){let f=n.cmp-n.d,V={discount_percent:(f/n.cmp*100).toFixed(0)};Object.assign(a,V),Object.assign(a,He("compare_price",n.cmp)),Object.assign(a,He("discount_price",f))}let v={name:e.name,quantity:e.quantity};return{product:a,variant:v}}evaluateShowATCFlag(){let e=me.get().widgetCustomisation?.atcButton?.showWhen;if(!e?.predicates?.length)return!0;let n=e.predicates,i=this.getValueMap(n);return e.op==="or"?n.some(r=>zt([r],i)):zt(n,i)}getValueMap(e){let n=new Map;for(let i of e){let r=i.attr.split(".");switch(r[1]){case"tags":{n.set(i.attr,this.tags);break}case"type":case"category":{n.set(i.attr,this.category);break}case"meta":case"metafield":{let s=r[2];if(!s)continue;n.set(i.attr,this.meta?.[s]);break}}}return n}};var gt=class{id;alt;shortID;sources;items;durationMS;thumbnail;card;bestSource;highSource;goodSource;lowSource;m3u8Source;constructor(e={}){if(this.id=e.id,this.alt=e.alt,this.shortID=e.shortID,this.sources=e.sources?.sort((n,i)=>i.height-n.height),this.durationMS=e.durationMS,this.thumbnail=e.thumbnail,this.items=e.items?e.items.map(n=>new _t(n)):[],this.card=e.card,this.sources){let n=[];for(let i of this.sources)i.format==="mp4"?n.push(i):i.format==="m3u8"&&!this.m3u8Source&&(this.m3u8Source=i);n.length>0&&(this.bestSource=n[0],this.highSource=n.length>1?n[1]:n[0],this.lowSource=n.length>2?n[n.length-1]:n[0])}}};var qt=(n=>(n.CLASSIC="CLASSIC",n.ITEM_CARD_HEADER="ITEM_CARD_HEADER",n))(qt||{});var Bi=(i=>(i.ON="ON",i.OFF="OFF",i.ON_HOVER="ON_HOVER",i))(Bi||{}),Gi=(r=>(r.FIRST_ITEM="FIRST_ITEM",r.ITEM_SWIPER="ITEM_SWIPER",r.CARD="CARD",r.NONE="NONE",r))(Gi||{});var si=class{videos;source;template;heading;autoPlay;showMuteButton;footerContent;detailPopup;playlistConfig;itemDetailConfig;constructor(e={}){this.videos=e.videos?.map(n=>new gt(n))??[],this.source=e.source,this.template=e.template,this.detailPopup=e.detailPopup??{template:"VIDEO_ONLY_VIEW"},this.heading=e.heading,this.showMuteButton=e.showMuteButton,this.autoPlay=e.autoPlay??"ON",this.footerContent=e.footerContent??"FIRST_ITEM",this.playlistConfig={videoSwiper:e.playlistConfig?.videoSwiper??void 0,itemCardClickBehavior:e.playlistConfig?.itemCardClickBehavior??"OPEN_VIDEO_DETAIL"},this.itemDetailConfig={template:e.itemDetailConfig?.template??"CLASSIC"}}showItems(){return this.footerContent==="FIRST_ITEM"||this.footerContent==="ITEM_SWIPER"}};function ai(t){t||(t=S(he));let e=new Kt(n=>{if(t.destroyed){n.next();return}return t.onDestroy(n.next.bind(n))});return n=>n.pipe(Xt(e))}var li=(n=>(n.SINGLE_PANE="SINGLE_PANE",n.TWO_PANE="TWO_PANE",n))(li||{});var Me=class t{transform(e){return e==null?null:yn(e)}static \u0275fac=function(n){return new(n||t)};static \u0275pipe=Jt({name:"cooeeCurrency",type:t,pure:!0})};function ji(t,e){if(t&1&&(I(0,"span",6),Y(1,"cooeeCurrency"),Y(2,"safeHtml")),t&2){p();let n=U(7);g("innerHTML",K(2,3,K(1,1,n.cmp)),ge)}}function Wi(t,e){if(t&1&&(m(0,"span",8),x(1),h()),t&2){p();let n=U(14);u(),ve(" ",n,"% off ")}}function $i(t,e){t&1&&(x(0," Out of Stock "),I(1,"cooee-icon",16))}function zi(t,e){t&1&&(x(0," Add To Cart "),I(1,"cooee-icon",17))}function qi(t,e){if(t&1){let n=B();m(0,"button",15),L("click",function(r){R(n);let o=p();return F(o.addToCartClicked(r))}),C(1,$i,2,0)(2,zi,2,0),h()}if(t&2){let n=p();g("disabled",n.isButtonDisabled()),u(),y(n.isButtonDisabled()?1:2)}}var Ae=class t{buttonClick=ee();item=N.required();isButtonDisabled=se(()=>{let e=this.item();return e.hasVariants()?!e.vars.some(n=>n.isAvailable):!e.selectedOrFirstVariant.value.isAvailable});addToCartClicked(e){e.stopPropagation(),this.buttonClick.emit(this.item())}getDiscountPercentage(e){return e.cmp&&e.cmp>e.d?Math.round((1-e.d/e.cmp)*100):0}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=k({type:t,selectors:[["cooee-item-card"]],inputs:{item:[1,"item"]},outputs:{buttonClick:"buttonClick"},decls:22,vars:17,consts:[[1,"card-body"],[1,"item-image",3,"alt","src"],[1,"item-info"],[1,"item-name"],[1,"prices"],[1,"item-price",3,"innerHTML"],[1,"item-cmp-price",3,"innerHTML"],["type","button",1,"shop-now-button",3,"click","href"],[1,"item-discount-percentage"],["type","button",1,"item-detail-button",3,"aria-label"],["name","open"],[1,"card-footer"],["type","button",1,"cta-button",3,"disabled"],["href","/cart","title","View Cart",1,"view-cart-button"],["width","32","height","32","src","https://img.icons8.com/material-sharp/48/shopping-cart.png","alt","shopping-cart"],["type","button",1,"cta-button",3,"click","disabled"],["name","unavailable","aria-hidden","true"],["name","add","aria-hidden","true"]],template:function(n,i){if(n&1){let r=B();nn(0),m(1,"div",0),I(2,"img",1),m(3,"div",2)(4,"div",3),x(5),h(),m(6,"div",4),z(7),I(8,"span",5),Y(9,"cooeeCurrency"),Y(10,"safeHtml"),C(11,ji,3,5,"span",6),h(),m(12,"a",7),L("click",function(s){return R(r),F(s.stopPropagation())}),x(13," Shop now "),h(),z(14),C(15,Wi,2,1,"span",8),h(),m(16,"button",9),I(17,"cooee-icon",10),h()(),m(18,"div",11),C(19,qi,3,2,"button",12),m(20,"a",13),I(21,"img",14),h()(),rn()}if(n&2){let r=i.item().selectedOrFirstVariant.value;u(2),g("alt",pn(i.item().name))("src",i.item().firstImageURL,ue),u(3),ve(" ",i.item().name," "),u(2);let o=q(r.price);u(),g("innerHTML",K(10,14,K(9,12,o.d)),ge),u(3),y(o.cmp?11:-1),u(),g("href","/products/"+i.item().slug,ue),u(2);let s=q(i.getDiscountPercentage(r.price));u(),y(s>0?15:-1),u(),en("aria-label",Ze("View product details for ",i.item().name)),u(3),y(i.item().showAddToCartButton?19:-1)}},dependencies:[De,Me,tt],styles:["[_nghost-%COMP%]{max-width:100%;position:relative;display:flex;flex-direction:column;gap:8px;padding:8px}.card-body[_ngcontent-%COMP%]{display:flex;gap:8px;width:100%;align-items:flex-start}.item-image[_ngcontent-%COMP%]{width:70px;height:70px;object-fit:cover;box-sizing:border-box;border-radius:var(--lc-media-radius)}.item-info[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:3.5px;font-size:10.5px;margin-right:20px}.item-name[_ngcontent-%COMP%]{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.card-footer[_ngcontent-%COMP%]{display:flex;gap:6px;align-items:center}.cta-button[_ngcontent-%COMP%]{padding:10px;border:none;width:100%;text-align:center}.shop-now-button[_ngcontent-%COMP%], .item-discount-percentage[_ngcontent-%COMP%]{display:none;background:rgb(var(--lc-primary-button-bg-color));color:rgb(var(--lc-primary-button-color));border-radius:var(--lc-button-radius);font-size:12px;width:fit-content;height:auto;text-align:center;z-index:4;padding:2px 8px;text-decoration:none}.item-detail-button[_ngcontent-%COMP%]{position:absolute;top:8px;right:8px;cursor:pointer}.item-detail-button[_ngcontent-%COMP%] cooee-icon[name=open][_ngcontent-%COMP%]{color:#000;width:20px;height:20px;transition-duration:.2s}.item-detail-button[_ngcontent-%COMP%] cooee-icon[name=open][_ngcontent-%COMP%]:hover{color:rgba(var(--lc-primary-color))}.view-cart-button[_ngcontent-%COMP%]{display:none}"]})};var Yi=t=>({active:t}),Ki=(t,e)=>e.mID;function Qi(t,e){t&1&&T(0)}function Xi(t,e){t&1&&T(0)}function Zi(t,e){t&1&&T(0)}function Ji(t,e){if(t&1&&(m(0,"div",11)(1,"div",12),x(2,"Shop Now"),h(),$(3,Qi,1,0,"ng-container",10),h(),m(4,"div",13),$(5,Xi,1,0,"ng-container",10),m(6,"div",14),$(7,Zi,1,0,"ng-container",10),h()()),t&2){p(2);let n=P(4),i=P(6),r=P(8);u(3),g("ngTemplateOutlet",n),u(2),g("ngTemplateOutlet",i),u(2),g("ngTemplateOutlet",r)}}function er(t,e){t&1&&T(0)}function tr(t,e){t&1&&T(0)}function nr(t,e){t&1&&T(0)}function ir(t,e){t&1&&T(0)}function rr(t,e){t&1&&T(0)}function or(t,e){if(t&1&&(m(0,"div",15),I(1,"cooee-item-card",16),$(2,er,1,0,"ng-container",10),h(),m(3,"div",13)(4,"div",17),$(5,tr,1,0,"ng-container",10)(6,nr,1,0,"ng-container",10)(7,ir,1,0,"ng-container",10)(8,rr,1,0,"ng-container",10),h()()),t&2){let n=p(2),i=P(4),r=P(6),o=P(10),s=P(12),l=P(14);u(),g("item",n.item()),u(),g("ngTemplateOutlet",i),u(3),g("ngTemplateOutlet",l),u(),g("ngTemplateOutlet",r),u(),g("ngTemplateOutlet",s),u(),g("ngTemplateOutlet",o)}}function sr(t,e){t&1&&T(0)}function ar(t,e){if(t&1&&(m(0,"div",7),C(1,Ji,8,3)(2,or,9,6),m(3,"div",9),$(4,sr,1,0,"ng-container",10),h()()),t&2){let n=p(),i=P(16),r=n.template()===n.ItemDetailTemplate.CLASSIC;u(),y(r?1:2),u(3),g("ngTemplateOutlet",i)}}function lr(t,e){t&1&&T(0)}function cr(t,e){t&1&&T(0)}function ur(t,e){t&1&&T(0)}function dr(t,e){t&1&&T(0)}function pr(t,e){if(t&1&&(m(0,"div",8)(1,"div",18),$(2,lr,1,0,"ng-container",10),h(),m(3,"div",17),$(4,cr,1,0,"ng-container",10)(5,ur,1,0,"ng-container",10)(6,dr,1,0,"ng-container",10),h()()),t&2){p();let n=P(4),i=P(6),r=P(8),o=P(16);u(2),g("ngTemplateOutlet",i),u(2),g("ngTemplateOutlet",n),u(),g("ngTemplateOutlet",r),u(),g("ngTemplateOutlet",o)}}function fr(t,e){if(t&1){let n=B();m(0,"button",19),L("click",function(){R(n);let r=p();return F(r.close())}),I(1,"cooee-icon",20),h()}}function mr(t,e){if(t&1&&I(0,"img",22),t&2){let n=e.$implicit,i=p(2);g("src",n.url,ue)("alt",n.alt??i.item().name)}}function hr(t,e){if(t&1&&(m(0,"div",21),de(1,mr,1,2,"img",22,tn),h()),t&2){let n=p();u(),pe(n.item().imgs)}}function _r(t,e){if(t&1&&(I(0,"span",25),Y(1,"cooeeCurrency"),Y(2,"safeHtml")),t&2){p(2);let n=U(2);g("innerHTML",K(2,3,K(1,1,n.d)),ge)}}function gr(t,e){if(t&1&&(I(0,"span",26),Y(1,"cooeeCurrency"),Y(2,"safeHtml")),t&2){p(2);let n=U(2);g("innerHTML",K(2,3,K(1,1,n.cmp)),ge)}}function vr(t,e){if(t&1&&(m(0,"div",24),C(1,_r,3,5,"span",25),C(2,gr,3,5,"span",26),h()),t&2){p();let n=U(2);u(),y(n.d?1:-1),u(),y(n.cmp?2:-1)}}function Cr(t,e){t&1&&T(0)}function yr(t,e){t&1&&T(0)}function br(t,e){t&1&&T(0)}function Er(t,e){if(t&1&&(m(0,"div",23),x(1),h(),z(2),C(3,vr,3,2,"div",24),$(4,Cr,1,0,"ng-container",10)(5,yr,1,0,"ng-container",10)(6,br,1,0,"ng-container",10)),t&2){let n=p(),i=P(10),r=P(12),o=P(14),s=U(0);u(),oe(n.item().name),u();let l=q(s.price);u(),y(l?3:-1),u(),g("ngTemplateOutlet",r),u(),g("ngTemplateOutlet",o),u(),g("ngTemplateOutlet",i)}}function Dr(t,e){if(t&1&&(m(0,"div",27),x(1,"Description"),h(),I(2,"div",28),Y(3,"safeHtml")),t&2){let n=p(2);u(2),g("innerHTML",K(3,1,n.item().desc),ge)}}function wr(t,e){if(t&1&&C(0,Dr,4,3),t&2){let n=p();y(n.item().desc?0:-1)}}function Ir(t,e){if(t&1){let n=B();m(0,"a",32),L("click",function(r){let o=R(n).$implicit,s=p(3);return F(s.changeItem(r,o))}),I(1,"img",22),h()}if(t&2){let n=e.$implicit,i=p(3);g("ngClass",Je(3,Yi,n.mID===i.item().mID+"")),u(),g("src",n.firstImageURL,ue)("alt",i.item().name)}}function xr(t,e){if(t&1&&(m(0,"span",29),x(1,"Select product"),h(),m(2,"div",30),de(3,Ir,2,5,"a",31,Ki),h()),t&2){let n=p(2);u(3),pe(n.similarItems())}}function Vr(t,e){if(t&1&&C(0,xr,5,0),t&2){let n=p();y(n.similarItems().length>1?0:-1)}}function Sr(t,e){if(t&1&&(m(0,"span",33),x(1,"Select variant"),h(),I(2,"cooee-item-options-picker",16)),t&2){let n=p(2);u(2),g("item",n.item())}}function Or(t,e){if(t&1&&C(0,Sr,3,1),t&2){let n=p();y(n.item().hasVariants()?0:-1)}}function Mr(t,e){t&1&&(x(0," Add To Cart "),I(1,"cooee-icon",42))}function Ar(t,e){t&1&&(x(0," Out of stock "),I(1,"cooee-icon",43))}function Nr(t,e){if(t&1){let n=B();m(0,"button",41),L("click",function(){R(n);let r=p(2);return F(r.clickAddToCart())}),C(1,Mr,2,0)(2,Ar,2,0),h()}if(t&2){p(2);let n=U(0);g("disabled",!n.isAvailable),u(),y(n.isAvailable?1:2)}}function Tr(t,e){if(t&1&&(m(0,"span",40),x(1),h()),t&2){let n=p(2);u(),oe(n.currentVideoCartItemsCount())}}function Pr(t,e){if(t&1){let n=B();m(0,"div",34),C(1,Nr,3,2,"button",35),m(2,"button",36),L("click",function(){R(n);let r=p();return F(r.goToPDP())}),x(3," More Info "),I(4,"cooee-icon",37),h(),m(5,"button",38),L("click",function(){R(n);let r=p();return F(r.openCart())}),I(6,"img",39),C(7,Tr,2,1,"span",40),h()()}if(t&2){let n=p();u(),y(n.item().showAddToCartButton?1:-1),u(6),y(n.currentVideoCartItemsCount()?7:-1)}}var ci=class t{closeClick=new ke;layout=Ue("SINGLE_PANE");item=Ue.required();similarItems=N([]);template=N("CLASSIC");cartItems=ie([]);currentVideoCartItemsCount=se(()=>{let e=this.item(),n=this.cartItems();return!e||!n.length?0:n.filter(i=>i.mID===e.mID).reduce((i,r)=>i+r.quantity,0)});ItemDetailTemplate=qt;engagementService=S(X);destroyRef=S(he);lastLayout=null;resizeObserver=new we(()=>{wt()?(this.lastLayout===null&&(this.lastLayout=this.layout()),this.layout.set("SINGLE_PANE")):this.lastLayout!==null&&(this.layout.set(this.lastLayout),this.lastLayout=null)});ngOnInit(){this.subscribeToCartChanges()}ngOnDestroy(){this.resizeObserver.destroy()}close(){this.closeClick.emit()}clickAddToCart(){this.engagementService.executeCTA(Q.ADD_TO_CART,{item:this.item()}),this.close()}openCart(){this.engagementService.executeCTA(Q.OPEN_CART)}changeItem(e,n){e.stopPropagation(),e.preventDefault(),this.item.set(n)}goToPDP(){this.engagementService.executeCTA(Q.GO_TO_PRODUCT,{item:this.item()})}isSinglePane(){return this.layout()!=="TWO_PANE"||wt()}subscribeToCartChanges(){window.CooeeSDK.cartChange$.pipe(Qt({cart:window.CooeeSDK.cart.getCooeeCart()}),ai(this.destroyRef)).subscribe(e=>{this.cartItems.set(e.cart?.items??[])})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=k({type:t,selectors:[["cooee-item-detail"]],hostAttrs:[1,"letscooee-widget"],inputs:{layout:[1,"layout"],item:[1,"item"],similarItems:[1,"similarItems"],template:[1,"template"]},outputs:{closeClick:"closeClick",layout:"layoutChange",item:"itemChange"},features:[Ce([X])],decls:17,vars:2,consts:[["closeButtonTemplate",""],["imageStripTemplate",""],["bodyTemplate",""],["descriptionTemplate",""],["productSelectorTemplate",""],["variantSelectorTemplate",""],["footerButtonsTemplate",""],[1,"lc-card-wrapper","card-wrapper","single-pane"],[1,"card-wrapper","two-pane"],[1,"lc-card-footer","card-footer"],[4,"ngTemplateOutlet"],[1,"lc-card-header","card-header"],[1,"lc-header","header"],[1,"card-content"],[1,"lc-inner-body","inner-body"],[1,"card-header"],[3,"item"],[1,"inner-body"],[1,"images-container"],["type","button","aria-label","Close product details",1,"lc-close-button","close-button",3,"click"],["name","close","aria-hidden","true"],[1,"image-strip"],[3,"src","alt"],[1,"lc-item-name","item-name"],[1,"lc-prices","prices"],[1,"lc-item-price","item-price",3,"innerHTML"],[1,"lc-item-cmp-price","item-cmp-price",3,"innerHTML"],[1,"lc-description-title","description-title"],[1,"lc-description","description",3,"innerHTML"],[1,"lc-selected-product-title","selected-product-title"],[1,"lc-image-strip","image-strip"],["href","#",1,"product-selector",3,"ngClass"],["href","#",1,"product-selector",3,"click","ngClass"],[1,"selected-variant-title"],[1,"footer-buttons"],["type","button",1,"lc-cta-button","cta-button",3,"disabled"],["type","button",1,"lc-more-info-button","more-info-button",3,"click"],["name","info","aria-hidden","true",1,"more-info-icon"],["type","button","aria-label","View cart","title","View Cart",1,"view-cart-button",3,"click"],["width","32","height","32","src","https://img.icons8.com/material-sharp/48/shopping-cart.png","alt","shopping-cart"],["aria-live","polite","aria-atomic","true",1,"cart-icon-badge"],["type","button",1,"lc-cta-button","cta-button",3,"click","disabled"],["name","add","aria-hidden","true",1,"add-to-cart-icon"],["name","unavailable","aria-hidden","true"]],template:function(n,i){n&1&&(z(0),C(1,ar,5,2,"div",7)(2,pr,7,4,"div",8),$(3,fr,2,0,"ng-template",null,0,fe)(5,hr,3,0,"ng-template",null,1,fe)(7,Er,7,6,"ng-template",null,2,fe)(9,wr,1,1,"ng-template",null,3,fe)(11,Vr,1,1,"ng-template",null,4,fe)(13,Or,1,1,"ng-template",null,5,fe)(15,Pr,8,2,"ng-template",null,6,fe)),n&2&&(q(i.item().selectedOrFirstVariant.value),u(),y(i.isSinglePane()?1:2))},dependencies:[hn,ot,De,gn,Ae,tt,Me],styles:["[_nghost-%COMP%]{display:block;background:#fff}.card-wrapper[_ngcontent-%COMP%]{position:relative}.card-wrapper.single-pane[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:auto}.card-wrapper.two-pane[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr}.card-header[_ngcontent-%COMP%]{display:var(--header-display, flex);flex-direction:row;justify-content:space-between;align-items:start;padding:8px 16px;border-bottom:1px solid var(--lc-color-gray-300)}.header[_ngcontent-%COMP%]{font-size:24px;font-weight:var(--lc-subheading-weight);color:rgba(var(--lc-subheading-color))}.close-button[_ngcontent-%COMP%]{background:transparent;border:none;width:36px;height:36px}.close-button[_ngcontent-%COMP%] cooee-icon[_ngcontent-%COMP%]{color:#000000b3}.two-pane[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]{position:absolute;top:8px;right:4px}.card-content[_ngcontent-%COMP%]{flex:1;overflow-y:auto;overscroll-behavior:contain} cooee-item-card .item-info{margin-right:0!important} cooee-item-card .item-detail-button{display:none!important} cooee-item-card .card-footer{display:none!important}.inner-body[_ngcontent-%COMP%]{padding:16px;display:flex;flex-direction:column;gap:8px}.images-container[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:start}.image-strip[_ngcontent-%COMP%]{width:100%;display:flex;overflow-x:auto;gap:8px;flex-wrap:nowrap}.image-strip[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:auto;height:200px}.two-pane[_ngcontent-%COMP%] .image-strip[_ngcontent-%COMP%]{padding:16px}.product-selector[_ngcontent-%COMP%]{height:100px;flex-shrink:0;border-radius:var(--lc-media-radius);padding:2px}.product-selector.active[_ngcontent-%COMP%]{border:1px solid rgba(var(--lc-primary-color))}.product-selector[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-height:100%;border-radius:var(--lc-media-radius)}.description-title[_ngcontent-%COMP%], .selected-product-title[_ngcontent-%COMP%], .selected-variant-title[_ngcontent-%COMP%]{font-size:var(--lc-subheading-size);font-weight:var(--lc-subheading-weight);color:rgba(var(--lc-subheading-color));margin-top:8px;line-height:normal}.description[_ngcontent-%COMP%]{line-height:normal;color:#000;font-size:var(--lc-description-size);font-weight:var(--lc-description-weight)}.card-footer[_ngcontent-%COMP%]{padding:var(--lc-item-detail-footer-padding);background-color:rgba(var(--lc-item-detail-footer-bg-color));box-shadow:var(--lc-item-detail-footer-box-shadow)}.footer-buttons[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;gap:12px}.two-pane[_ngcontent-%COMP%] .footer-buttons[_ngcontent-%COMP%]{margin-top:16px}.cta-button[_ngcontent-%COMP%], .more-info-button[_ngcontent-%COMP%]{width:50%;padding:12px;display:flex;justify-content:center;align-items:center}.more-info-button[_ngcontent-%COMP%]{background-color:rgba(var(--lc-secondary-button-bg-color));color:rgba(var(--lc-secondary-button-color));font-weight:var(--lc-secondary-button-weight);text-transform:var(--lc-secondary-button-transform);border-radius:var(--lc-button-radius);font-size:var(--lc-button-size);font-family:var(--lc-button-family),serif;height:var(--lc-button-height);letter-spacing:var(--lc-button-letter-spacing);transition:filter .12s ease,background-color .2s ease,color .2s ease;border-width:1px;border-style:solid;border-color:rgba(var(--lc-secondary-button-border-color));display:flex;align-items:center;justify-content:center;gap:8px}.more-info-button[_ngcontent-%COMP%] cooee-icon[_ngcontent-%COMP%]{display:var(--lc-button-icon-display);width:var(--lc-button-icon-size, 20px)!important;height:var(--lc-button-icon-size, 20px)!important;color:inherit}.more-info-button[_ngcontent-%COMP%]:hover{filter:brightness(.95)}.more-info-button[_ngcontent-%COMP%]:active{filter:brightness(.9)}.more-info-button[_ngcontent-%COMP%]:focus-visible{outline:2px solid rgba(var(--lc-primary-color, 0, 0, 0));outline-offset:2px}.view-cart-button[_ngcontent-%COMP%]{position:relative}.view-cart-button[_ngcontent-%COMP%] .cart-icon-badge[_ngcontent-%COMP%]{position:absolute;top:-6px;right:-6px;background-color:rgba(var(--lc-primary-color));color:#fff;border-radius:50%;width:18px;height:18px;font-size:12px;display:flex;align-items:center;justify-content:center}"]})};var Rr=[[["swiper-slides"]]],Fr=["swiper-slides"],kr=(t,e)=>({"--swiper-navigation-size":t,color:e}),Lr=t=>({color:t,bottom:0,top:"unset",position:"relative"});function Ur(t,e){if(t&1&&(J(0,"div",2),Ke(1,"span"),re(),J(2,"div",3),Ke(3,"span"),re()),t&2){let n,i,r=p(),o=((n=r.navigationConfig())==null?null:n.size)??50,s=((i=r.navigationConfig())==null||i.color==null?null:i.color.rgba)??"white",l=fn(4,kr,o+"px",s);Qe(l),u(2),Qe(l)}}function Hr(t,e){if(t&1&&(J(0,"div",4),Ke(1,"span"),re()),t&2){let n,i=((n=p().paginationConfig())==null||n.color==null?null:n.color.rgba)??"white",r=Je(2,Lr,i);Qe(r)}}var ui=class t{options=N.required();navigationConfig=N();paginationConfig=N();slideChange=ee();elementRef=S(_e);swiperInstance;initToken=0;resizeDebouncer=new we(this.onResize.bind(this));constructor(){ae(()=>{this.options()&&this.reInitSwiper()})}get swiper(){return this.swiperInstance}ngOnDestroy(){this.resizeDebouncer?.destroy(),this.swiperInstance?.destroy?.(),this.swiperInstance=void 0}async initSwiper(e=this.initToken){if(await nt(),e!==this.initToken){j.warn("Swiper token not matching");return}let n=this.elementRef.nativeElement,i={nextEl:n.querySelector(".swiper-button-next"),prevEl:n.querySelector(".swiper-button-prev"),enabled:this.navigationConfig()?.enabled},r=this.paginationConfig(),o={el:n.querySelector(".swiper-pagination"),enabled:this.paginationConfig()?.enabled,type:this.paginationConfig()?.type,clickable:!0,renderBullet:function(s,l){return`
3
- <span class="${l}"
4
- style="background-color: ${r?.color?.rgba};"></span>
5
- `},renderProgressbar:s=>`
6
- <span class="${s}"
7
- style="background-color: ${r?.color?.rgba};">
8
- </span>
9
- `};this.swiperInstance=new window.CooeeSDK.Swiper(n,H({navigation:i,pagination:o},this.options())),this.swiperInstance.on("slideChange",s=>{this.slideChange.emit(s)})}onResize(){this.swiperInstance?(j.verbose("Updating swiper"),this.swiperInstance.update()):(j.verbose("Reinitialising swiper"),this.reInitSwiper())}reInitSwiper(){this.initToken++;let e=this.initToken;this.swiperInstance?.destroy?.(),this.swiperInstance=void 0,this.initSwiper(e)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=k({type:t,selectors:[["cooee-swiper"]],hostAttrs:[1,"swiper"],inputs:{options:[1,"options"],navigationConfig:[1,"navigationConfig"],paginationConfig:[1,"paginationConfig"]},outputs:{slideChange:"slideChange"},ngContentSelectors:Fr,decls:4,vars:2,consts:[[1,"swiper-wrapper"],[1,"swiper-pagination",3,"style"],[1,"swiper-button-prev"],[1,"swiper-button-next"],[1,"swiper-pagination"]],template:function(n,i){if(n&1&&(ln(Rr),J(0,"div",0),cn(1),re(),C(2,Ur,4,7),C(3,Hr,2,4,"div",1)),n&2){let r,o;u(2),y((r=i.navigationConfig())!=null&&r.enabled?2:-1),u(),y((o=i.paginationConfig())!=null&&o.enabled?3:-1)}},styles:[`:host{display:block}.swiper-wrapper{scrollbar-width:none;display:flex}.swiper-wrapper::-webkit-scrollbar{display:none}.swiper .swiper-button-prev,.swiper .swiper-button-next{background:rgba(var(--lc-icon-button-bg-color));width:var(--lc-icon-button-size);height:var(--lc-icon-button-size);border-radius:100%}.swiper .swiper-button-prev:after,.swiper .swiper-button-next:after{font-size:20px;color:rgba(var(--lc-icon-button-color))}
10
- `],encapsulation:2})};function Br(t,e){if(t&1&&(J(0,"span",1),x(1),re()),t&2){p();let n=U(0);u(),oe(n.heading)}}function Gr(t,e){if(t&1&&(J(0,"span",2),x(1),re()),t&2){p();let n=U(0);u(),oe(n.subHeading)}}var di=class t{card=N.required();linkClicked=ee();linkAfterSanity(){return this.card()?.buttonLink?.startsWith("https")?this.card().buttonLink:null}clickLink(e){e.stopPropagation(),this.linkClicked.emit()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=k({type:t,selectors:[["cooee-video-card"]],inputs:{card:[1,"card"]},outputs:{linkClicked:"linkClicked"},decls:6,vars:6,consts:[[1,"video-card-details"],[1,"heading"],[1,"subheading"],["rel","noopener noreferrer",1,"cta-button",3,"click","href","target"]],template:function(n,i){if(n&1){let r=B();z(0),J(1,"div",0),C(2,Br,2,1,"span",1),C(3,Gr,2,1,"span",2),J(4,"a",3),an("click",function(s){return R(r),F(i.clickLink(s))}),x(5),re()()}if(n&2){let r=q(i.card());u(2),y(r!=null&&r.heading?2:-1),u(),y(r!=null&&r.subHeading?3:-1),u(),sn("href",i.linkAfterSanity(),ue)("target",r.newTab?"_blank":"_self"),u(),ve(" ",r==null?null:r.buttonTitle," ")}},styles:["[_nghost-%COMP%]{display:block}.video-card-details[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:3.75px;font-size:14px;line-height:normal}.video-card-details[_ngcontent-%COMP%] .cta-button[_ngcontent-%COMP%]{text-align:center;background-color:#fff;border-radius:var(--lc-button-radius);padding:7.5px 15px;font-weight:var(--lc-primary-button-weight);color:rgba(var(--lc-primary-button-bg-color));font-size:var(--lc-button-size);border-width:var(--lc-primary-button-border-width, 0);text-decoration:none}.video-card-details[_ngcontent-%COMP%] .heading[_ngcontent-%COMP%], .video-card-details[_ngcontent-%COMP%] .subheading[_ngcontent-%COMP%]{text-align:start;color:#000;font-weight:600;overflow:hidden}.video-card-details[_ngcontent-%COMP%] .heading[_ngcontent-%COMP%]{font-size:18px}.video-card-details[_ngcontent-%COMP%] .subheading[_ngcontent-%COMP%]{font-size:16px}"],changeDetection:0})};function jr(t,e){t&1&&I(0,"cooee-icon",1)}function Wr(t,e){t&1&&I(0,"cooee-icon",2)}var pi=class t{muted=Ue.required();videoEl=N.required();toggled=ee();constructor(){ae(()=>{this.videoEl().muted=this.muted(),this.muted()||this.videoEl().play()})}toggle(e){e.stopPropagation(),e.preventDefault(),this.muted.update(n=>!n),this.toggled.emit(this.muted())}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=k({type:t,selectors:[["cooee-mute-toggle"]],inputs:{muted:[1,"muted"],videoEl:[1,"videoEl"]},outputs:{muted:"mutedChange",toggled:"toggled"},decls:3,vars:5,consts:[["type","button",3,"click"],["name","unmute"],["name","mute"]],template:function(n,i){n&1&&(m(0,"button",0),L("click",function(o){return i.toggle(o)}),C(1,jr,1,0,"cooee-icon",1)(2,Wr,1,0,"cooee-icon",2),h()),n&2&&(Le("unmute",!i.muted()),Ee("aria-label",i.muted()?"Unmute video":"Mute video")("aria-pressed",i.muted()),u(),y(i.muted()?1:2))},dependencies:[De],styles:["button[_ngcontent-%COMP%]{width:var(--lc-icon-button-size, 44px);height:var(--lc-icon-button-size, 44px);display:flex;justify-content:center;align-items:center;border:none;border-radius:100%;background:#00000080;background:color-mix(in oklab,#000 50%,transparent)}"]})};var $r=["swiperContainer"],zr=(t,e)=>e.id;function qr(t,e){if(t&1){let n=B();m(0,"div",3)(1,"cooee-item-card",4),L("buttonClick",function(r){R(n);let o=p();return F(o.onButtonClick(r))})("click",function(){let r=R(n).$implicit,o=p();return F(o.cardClick.emit(r))}),h()()}if(t&2){let n=e.$implicit;u(),g("item",n)}}var fi=class t{items=N.required();centeredSlides=N(!0);cardClick=ee();destroyRef=S(he);elementRef=S(_e);engagementService=S(X);swiperContainerRef=mn.required("swiperContainer");swiperInstance;constructor(){ae(()=>{this.swiperContainerRef()&&this.initSwiper()}),this.destroyRef.onDestroy(()=>{this.swiperInstance?.destroy()})}ngOnInit(){it(this.elementRef.nativeElement.shadowRoot)}onButtonClick(e){let n=me.get().website?.canChangeVariantInCart;if(this.items()?.length>1||e.hasVariants()&&!n){this.cardClick.emit(e);return}this.engagementService.executeCTA(Q.ADD_TO_CART,{item:e})}async initSwiper(){await nt(),this.swiperInstance=new window.CooeeSDK.Swiper(this.swiperContainerRef().nativeElement,{direction:"horizontal",effect:"slide",slidesPerView:1.2,nested:!0,centeredSlides:this.centeredSlides(),spaceBetween:12,mousewheel:{enabled:!0,thresholdDelta:10,thresholdTime:200}})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=k({type:t,selectors:[["cooee-video-promoted-items"]],viewQuery:function(n,i){n&1&&un(i.swiperContainerRef,$r,5),n&2&&dn()},hostAttrs:[1,"letscooee-widget"],inputs:{items:[1,"items"],centeredSlides:[1,"centeredSlides"]},outputs:{cardClick:"cardClick"},features:[Ce([X])],decls:5,vars:0,consts:[["swiperContainer",""],[1,"swiper-container"],[1,"swiper-wrapper"],[1,"swiper-slide"],["tabindex","0",3,"buttonClick","click","item"]],template:function(n,i){n&1&&(m(0,"div",1,0)(2,"div",2),de(3,qr,2,1,"div",3,zr),h()()),n&2&&(u(3),pe(i.items()))},dependencies:[Ae],styles:["[_nghost-%COMP%]{display:block;width:100%}cooee-item-card[_ngcontent-%COMP%]{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);background-color:rgba(var(--lc-card-bg-color));cursor:pointer;border-radius:var(--lc-card-radius)}"]})};export{nt as a,it as b,Q as c,bi as d,xn as e,Ei as f,rt as g,ot as h,Me as i,li as j,ai as k,we as l,Ae as m,Bi as n,Gi as o,si as p,ci as q,ui as r,di as s,pi as t,fi as u};
@@ -1,2 +0,0 @@
1
- import{$a as mt,B as ht,C as z,E as V,G as ct,I as dt,Kb as bt,Lb as Pt,Mb as T,Na as ft,Ob as S,Qb as St,Rb as v,Sb as yt,T as B,Ub as Rt,V as _t,Wb as Et,X as pt,Z as gt,a as w,b as A,c as _,ca as D,d as et,da as C,ea as ut,f as it,h as st,j as nt,k as F,l as rt,nb as vt,o as ot,ob as Dt,p as at,pb as wt,q as x,r as lt,s as H,u as P,v as d}from"./chunk-GIEYLCFF.js";function W(r){let t=r.cloneNode(!0),e=t.querySelectorAll("[id]"),i=r.nodeName.toLowerCase();t.removeAttribute("id");for(let s=0;s<e.length;s++)e[s].removeAttribute("id");return i==="canvas"?Ct(r,t):(i==="input"||i==="select"||i==="textarea")&&xt(r,t),It("canvas",r,t,Ct),It("input, textarea, select",r,t,xt),t}function It(r,t,e,i){let s=t.querySelectorAll(r);if(s.length){let n=e.querySelectorAll(r);for(let o=0;o<s.length;o++)i(s[o],n[o])}}var Xt=0;function xt(r,t){t.type!=="file"&&(t.value=r.value),t.type==="radio"&&t.name&&(t.name=`mat-clone-${t.name}-${Xt++}`)}function Ct(r,t){let e=t.getContext("2d");if(e)try{e.drawImage(r,0,0)}catch{}}function Y(r){let t=r.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height,x:t.x,y:t.y}}function Z(r,t,e){let{top:i,bottom:s,left:n,right:o}=r;return e>=i&&e<=s&&t>=n&&t<=o}function Jt(r,t){let e=t.left<r.left,i=t.left+t.width>r.right,s=t.top<r.top,n=t.top+t.height>r.bottom;return e||i||s||n}function E(r,t,e){r.top+=t,r.bottom=r.top+r.height,r.left+=e,r.right=r.left+r.width}function Tt(r,t,e,i){let{top:s,right:n,bottom:o,left:a,width:l,height:h}=r,c=l*t,g=h*t;return i>s-g&&i<o+g&&e>a-c&&e<n+c}var k=class{_document;positions=new Map;constructor(t){this._document=t}clear(){this.positions.clear()}cache(t){this.clear(),this.positions.set(this._document,{scrollPosition:this.getViewportScrollPosition()}),t.forEach(e=>{this.positions.set(e,{scrollPosition:{top:e.scrollTop,left:e.scrollLeft},clientRect:Y(e)})})}handleScroll(t){let e=S(t),i=this.positions.get(e);if(!i)return null;let s=i.scrollPosition,n,o;if(e===this._document){let h=this.getViewportScrollPosition();n=h.top,o=h.left}else n=e.scrollTop,o=e.scrollLeft;let a=s.top-n,l=s.left-o;return this.positions.forEach((h,c)=>{h.clientRect&&e!==c&&e.contains(c)&&E(h.clientRect,a,l)}),s.top=n,s.left=o,{top:a,left:l}}getViewportScrollPosition(){return{top:window.scrollY,left:window.scrollX}}};function Gt(r,t){let e=r.rootNodes;if(e.length===1&&e[0].nodeType===t.ELEMENT_NODE)return e[0];let i=t.createElement("div");return e.forEach(s=>i.appendChild(s)),i}function X(r,t,e){for(let i in t)if(t.hasOwnProperty(i)){let s=t[i];s?r.setProperty(i,s,e?.has(i)?"important":""):r.removeProperty(i)}return r}function b(r,t){let e=t?"":"none";X(r.style,{"touch-action":t?"":"none","-webkit-user-drag":t?"":"none","-webkit-tap-highlight-color":t?"":"transparent","user-select":e,"-ms-user-select":e,"-webkit-user-select":e,"-moz-user-select":e})}function kt(r,t,e){X(r.style,{position:t?"":"fixed",top:t?"":"0",opacity:t?"":"0",left:t?"":"-999em"},e)}function O(r,t){return t&&t!="none"?r+" "+t:r}function Ot(r,t){r.style.width=`${t.width}px`,r.style.height=`${t.height}px`,r.style.transform=I(t.left,t.top)}function I(r,t){return`translate3d(${Math.round(r)}px, ${Math.round(t)}px, 0)`}function Lt(r){let t=r.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(r)*t}function Qt(r){let t=getComputedStyle(r),e=G(t,"transition-property"),i=e.find(a=>a==="transform"||a==="all");if(!i)return 0;let s=e.indexOf(i),n=G(t,"transition-duration"),o=G(t,"transition-delay");return Lt(n[s])+Lt(o[s])}function G(r,t){return r.getPropertyValue(t).split(",").map(i=>i.trim())}var te=new Set(["position"]),j=class{_document;_rootElement;_direction;_initialDomRect;_previewTemplate;_previewClass;_pickupPositionOnPage;_initialTransform;_zIndex;_renderer;_previewEmbeddedView;_preview;get element(){return this._preview}constructor(t,e,i,s,n,o,a,l,h,c){this._document=t,this._rootElement=e,this._direction=i,this._initialDomRect=s,this._previewTemplate=n,this._previewClass=o,this._pickupPositionOnPage=a,this._initialTransform=l,this._zIndex=h,this._renderer=c}attach(t){this._preview=this._createPreview(),t.appendChild(this._preview),Nt(this._preview)&&this._preview.showPopover()}destroy(){this._preview.remove(),this._previewEmbeddedView?.destroy(),this._preview=this._previewEmbeddedView=null}setTransform(t){this._preview.style.transform=t}getBoundingClientRect(){return this._preview.getBoundingClientRect()}addClass(t){this._preview.classList.add(t)}getTransitionDuration(){return Qt(this._preview)}addEventListener(t,e){return this._renderer.listen(this._preview,t,e)}_createPreview(){let t=this._previewTemplate,e=this._previewClass,i=t?t.template:null,s;if(i&&t){let n=t.matchSize?this._initialDomRect:null,o=t.viewContainer.createEmbeddedView(i,t.context);o.detectChanges(),s=Gt(o,this._document),this._previewEmbeddedView=o,t.matchSize?Ot(s,n):s.style.transform=I(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else s=W(this._rootElement),Ot(s,this._initialDomRect),this._initialTransform&&(s.style.transform=this._initialTransform);return X(s.style,{"pointer-events":"none",margin:Nt(s)?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":this._zIndex+""},te),b(s,!1),s.classList.add("cdk-drag-preview"),s.setAttribute("popover","manual"),s.setAttribute("dir",this._direction),e&&(Array.isArray(e)?e.forEach(n=>s.classList.add(n)):s.classList.add(e)),s}};function Nt(r){return"showPopover"in r}var ee={passive:!0},Mt={passive:!1},ie={passive:!1,capture:!0},se=800,At="cdk-drag-placeholder",Ft=new Set(["position"]),q=class{_config;_document;_ngZone;_viewportRuler;_dragDropRegistry;_renderer;_rootElementCleanups;_cleanupShadowRootSelectStart;_preview;_previewContainer;_placeholderRef;_placeholder;_pickupPositionInElement;_pickupPositionOnPage;_marker;_anchor=null;_passiveTransform={x:0,y:0};_activeTransform={x:0,y:0};_initialTransform;_hasStartedDragging=V(!1);_hasMoved;_initialContainer;_initialIndex;_parentPositions;_moveEvents=new _;_pointerDirectionDelta;_pointerPositionAtLastDirectionChange;_lastKnownPointerPosition;_rootElement;_ownerSVGElement;_rootElementTapHighlight;_pointerMoveSubscription=w.EMPTY;_pointerUpSubscription=w.EMPTY;_scrollSubscription=w.EMPTY;_resizeSubscription=w.EMPTY;_lastTouchEventTime;_dragStartTime;_boundaryElement=null;_nativeInteractionsEnabled=!0;_initialDomRect;_previewRect;_boundaryRect;_previewTemplate;_placeholderTemplate;_handles=[];_disabledHandles=new Set;_dropContainer;_direction="ltr";_parentDragRef;_cachedShadowRoot;lockAxis;dragStartDelay=0;previewClass;scale=1;get disabled(){return this._disabled||!!(this._dropContainer&&this._dropContainer.disabled)}set disabled(t){t!==this._disabled&&(this._disabled=t,this._toggleNativeDragInteractions(),this._handles.forEach(e=>b(e,t)))}_disabled=!1;beforeStarted=new _;started=new _;released=new _;ended=new _;entered=new _;exited=new _;dropped=new _;moved=this._moveEvents;data;constrainPosition;constructor(t,e,i,s,n,o,a){this._config=e,this._document=i,this._ngZone=s,this._viewportRuler=n,this._dragDropRegistry=o,this._renderer=a,this.withRootElement(t).withParent(e.parentDragRef||null),this._parentPositions=new k(i),o.registerDragItem(this)}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(t){this._handles=t.map(i=>v(i)),this._handles.forEach(i=>b(i,this.disabled)),this._toggleNativeDragInteractions();let e=new Set;return this._disabledHandles.forEach(i=>{this._handles.indexOf(i)>-1&&e.add(i)}),this._disabledHandles=e,this}withPreviewTemplate(t){return this._previewTemplate=t,this}withPlaceholderTemplate(t){return this._placeholderTemplate=t,this}withRootElement(t){let e=v(t);if(e!==this._rootElement){this._removeRootElementListeners();let i=this._renderer;this._rootElementCleanups=this._ngZone.runOutsideAngular(()=>[i.listen(e,"mousedown",this._pointerDown,Mt),i.listen(e,"touchstart",this._pointerDown,ee),i.listen(e,"dragstart",this._nativeDragStart,Mt)]),this._initialTransform=void 0,this._rootElement=e}return typeof SVGElement<"u"&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(t){return this._boundaryElement=t?v(t):null,this._resizeSubscription.unsubscribe(),t&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(t){return this._parentDragRef=t,this}dispose(){this._removeRootElementListeners(),this.isDragging()&&this._rootElement?.remove(),this._marker?.remove(),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeListeners(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._resizeSubscription.unsubscribe(),this._parentPositions.clear(),this._boundaryElement=this._rootElement=this._ownerSVGElement=this._placeholderTemplate=this._previewTemplate=this._marker=this._parentDragRef=null}isDragging(){return this._hasStartedDragging()&&this._dragDropRegistry.isDragging(this)}reset(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0}}resetToBoundary(){if(this._boundaryElement&&this._rootElement&&Jt(this._boundaryElement.getBoundingClientRect(),this._rootElement.getBoundingClientRect())){let t=this._boundaryElement.getBoundingClientRect(),e=this._rootElement.getBoundingClientRect(),i=0,s=0;e.left<t.left?i=t.left-e.left:e.right>t.right&&(i=t.right-e.right),e.top<t.top?s=t.top-e.top:e.bottom>t.bottom&&(s=t.bottom-e.bottom);let n=this._activeTransform.x,o=this._activeTransform.y,a=n+i,l=o+s;this._rootElement.style.transform=I(a,l),this._activeTransform={x:a,y:l},this._passiveTransform={x:a,y:l}}}disableHandle(t){!this._disabledHandles.has(t)&&this._handles.indexOf(t)>-1&&(this._disabledHandles.add(t),b(t,!0))}enableHandle(t){this._disabledHandles.has(t)&&(this._disabledHandles.delete(t),b(t,this.disabled))}withDirection(t){return this._direction=t,this}_withDropContainer(t){this._dropContainer=t}getFreeDragPosition(){let t=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:t.x,y:t.y}}setFreeDragPosition(t){return this._activeTransform={x:0,y:0},this._passiveTransform.x=t.x,this._passiveTransform.y=t.y,this._dropContainer||this._applyRootElementTransform(t.x,t.y),this}withPreviewContainer(t){return this._previewContainer=t,this}_sortFromLastPointerPosition(){let t=this._lastKnownPointerPosition;t&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(t),t)}_removeListeners(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe(),this._cleanupShadowRootSelectStart?.(),this._cleanupShadowRootSelectStart=void 0}_destroyPreview(){this._preview?.destroy(),this._preview=null}_destroyPlaceholder(){this._anchor?.remove(),this._placeholder?.remove(),this._placeholderRef?.destroy(),this._placeholder=this._anchor=this._placeholderRef=null}_pointerDown=t=>{if(this.beforeStarted.next(),this._handles.length){let e=this._getTargetHandle(t);e&&!this._disabledHandles.has(e)&&!this.disabled&&this._initializeDragSequence(e,t)}else this.disabled||this._initializeDragSequence(this._rootElement,t)};_pointerMove=t=>{let e=this._getPointerPositionOnPage(t);if(!this._hasStartedDragging()){let s=Math.abs(e.x-this._pickupPositionOnPage.x),n=Math.abs(e.y-this._pickupPositionOnPage.y);if(s+n>=this._config.dragStartThreshold){let a=Date.now()>=this._dragStartTime+this._getDragStartDelay(t),l=this._dropContainer;if(!a){this._endDragSequence(t);return}(!l||!l.isDragging()&&!l.isReceiving())&&(t.cancelable&&t.preventDefault(),this._hasStartedDragging.set(!0),this._ngZone.run(()=>this._startDragSequence(t)))}return}t.cancelable&&t.preventDefault();let i=this._getConstrainedPointerPosition(e);if(this._hasMoved=!0,this._lastKnownPointerPosition=e,this._updatePointerDirectionDelta(i),this._dropContainer)this._updateActiveDropContainer(i,e);else{let s=this.constrainPosition?this._initialDomRect:this._pickupPositionOnPage,n=this._activeTransform;n.x=i.x-s.x+this._passiveTransform.x,n.y=i.y-s.y+this._passiveTransform.y,this._applyRootElementTransform(n.x,n.y)}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:i,event:t,distance:this._getDragDistance(i),delta:this._pointerDirectionDelta})})};_pointerUp=t=>{this._endDragSequence(t)};_endDragSequence(t){if(this._dragDropRegistry.isDragging(this)&&(this._removeListeners(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),!!this._hasStartedDragging()))if(this.released.next({source:this,event:t}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(t),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)});else{this._passiveTransform.x=this._activeTransform.x;let e=this._getPointerPositionOnPage(t);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(e),dropPoint:e,event:t})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)}}_startDragSequence(t){y(t)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();let e=this._getShadowRoot(),i=this._dropContainer;if(e&&this._ngZone.runOutsideAngular(()=>{this._cleanupShadowRootSelectStart=this._renderer.listen(e,"selectstart",ne,ie)}),i){let s=this._rootElement,n=s.parentNode,o=this._placeholder=this._createPlaceholderElement(),a=this._marker=this._marker||this._document.createComment("");n.insertBefore(a,s),this._initialTransform=s.style.transform||"",this._preview=new j(this._document,this._rootElement,this._direction,this._initialDomRect,this._previewTemplate||null,this.previewClass||null,this._pickupPositionOnPage,this._initialTransform,this._config.zIndex||1e3,this._renderer),this._preview.attach(this._getPreviewInsertionPoint(n,e)),kt(s,!1,Ft),this._document.body.appendChild(n.replaceChild(o,s)),this.started.next({source:this,event:t}),i.start(),this._initialContainer=i,this._initialIndex=i.getItemIndex(this)}else this.started.next({source:this,event:t}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(i?i.getScrollableParents():[])}_initializeDragSequence(t,e){this._parentDragRef&&e.stopPropagation();let i=this.isDragging(),s=y(e),n=!s&&e.button!==0,o=this._rootElement,a=S(e),l=!s&&this._lastTouchEventTime&&this._lastTouchEventTime+se>Date.now(),h=s?Pt(e):bt(e);if(a&&a.draggable&&e.type==="mousedown"&&e.preventDefault(),i||n||l||h)return;if(this._handles.length){let m=o.style;this._rootElementTapHighlight=m.webkitTapHighlightColor||"",m.webkitTapHighlightColor="transparent"}this._hasMoved=!1,this._hasStartedDragging.set(this._hasMoved),this._removeListeners(),this._initialDomRect=this._rootElement.getBoundingClientRect(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(m=>this._updateOnScroll(m)),this._boundaryElement&&(this._boundaryRect=Y(this._boundaryElement));let c=this._previewTemplate;this._pickupPositionInElement=c&&c.template&&!c.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialDomRect,t,e);let g=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(e);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:g.x,y:g.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,e)}_cleanupDragArtifacts(t){kt(this._rootElement,!0,Ft),this._marker.parentNode.replaceChild(this._rootElement,this._marker),this._destroyPreview(),this._destroyPlaceholder(),this._initialDomRect=this._boundaryRect=this._previewRect=this._initialTransform=void 0,this._ngZone.run(()=>{let e=this._dropContainer,i=e.getItemIndex(this),s=this._getPointerPositionOnPage(t),n=this._getDragDistance(s),o=e._isOverContainer(s.x,s.y);this.ended.next({source:this,distance:n,dropPoint:s,event:t}),this.dropped.next({item:this,currentIndex:i,previousIndex:this._initialIndex,container:e,previousContainer:this._initialContainer,isPointerOverContainer:o,distance:n,dropPoint:s,event:t}),e.drop(this,i,this._initialIndex,this._initialContainer,o,n,s,t),this._dropContainer=this._initialContainer})}_updateActiveDropContainer({x:t,y:e},{x:i,y:s}){let n=this._initialContainer._getSiblingContainerFromPosition(this,t,e);!n&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(t,e)&&(n=this._initialContainer),n&&n!==this._dropContainer&&this._ngZone.run(()=>{let o=this._dropContainer.getItemIndex(this),a=this._dropContainer.getItemAtIndex(o+1)?.getVisibleElement()||null;this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._conditionallyInsertAnchor(n,this._dropContainer,a),this._dropContainer=n,this._dropContainer.enter(this,t,e,n===this._initialContainer&&n.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:n,currentIndex:n.getItemIndex(this)})}),this.isDragging()&&(this._dropContainer._startScrollingIfNecessary(i,s),this._dropContainer._sortItem(this,t,e,this._pointerDirectionDelta),this.constrainPosition?this._applyPreviewTransform(t,e):this._applyPreviewTransform(t-this._pickupPositionInElement.x,e-this._pickupPositionInElement.y))}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();let t=this._placeholder.getBoundingClientRect();this._preview.addClass("cdk-drag-animating"),this._applyPreviewTransform(t.left,t.top);let e=this._preview.getTransitionDuration();return e===0?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(i=>{let s=a=>{(!a||this._preview&&S(a)===this._preview.element&&a.propertyName==="transform")&&(o(),i(),clearTimeout(n))},n=setTimeout(s,e*1.5),o=this._preview.addEventListener("transitionend",s)}))}_createPlaceholderElement(){let t=this._placeholderTemplate,e=t?t.template:null,i;return e?(this._placeholderRef=t.viewContainer.createEmbeddedView(e,t.context),this._placeholderRef.detectChanges(),i=Gt(this._placeholderRef,this._document)):i=W(this._rootElement),i.style.pointerEvents="none",i.classList.add(At),i}_getPointerPositionInElement(t,e,i){let s=e===this._rootElement?null:e,n=s?s.getBoundingClientRect():t,o=y(i)?i.targetTouches[0]:i,a=this._getViewportScrollPosition(),l=o.pageX-n.left-a.left,h=o.pageY-n.top-a.top;return{x:n.left-t.left+l,y:n.top-t.top+h}}_getPointerPositionOnPage(t){let e=this._getViewportScrollPosition(),i=y(t)?t.touches[0]||t.changedTouches[0]||{pageX:0,pageY:0}:t,s=i.pageX-e.left,n=i.pageY-e.top;if(this._ownerSVGElement){let o=this._ownerSVGElement.getScreenCTM();if(o){let a=this._ownerSVGElement.createSVGPoint();return a.x=s,a.y=n,a.matrixTransform(o.inverse())}}return{x:s,y:n}}_getConstrainedPointerPosition(t){let e=this._dropContainer?this._dropContainer.lockAxis:null,{x:i,y:s}=this.constrainPosition?this.constrainPosition(t,this,this._initialDomRect,this._pickupPositionInElement):t;if(this.lockAxis==="x"||e==="x"?s=this._pickupPositionOnPage.y-(this.constrainPosition?this._pickupPositionInElement.y:0):(this.lockAxis==="y"||e==="y")&&(i=this._pickupPositionOnPage.x-(this.constrainPosition?this._pickupPositionInElement.x:0)),this._boundaryRect){let{x:n,y:o}=this.constrainPosition?{x:0,y:0}:this._pickupPositionInElement,a=this._boundaryRect,{width:l,height:h}=this._getPreviewRect(),c=a.top+o,g=a.bottom-(h-o),m=a.left+n,N=a.right-(l-n);i=Ht(i,m,N),s=Ht(s,c,g)}return{x:i,y:s}}_updatePointerDirectionDelta(t){let{x:e,y:i}=t,s=this._pointerDirectionDelta,n=this._pointerPositionAtLastDirectionChange,o=Math.abs(e-n.x),a=Math.abs(i-n.y);return o>this._config.pointerDirectionChangeThreshold&&(s.x=e>n.x?1:-1,n.x=e),a>this._config.pointerDirectionChangeThreshold&&(s.y=i>n.y?1:-1,n.y=i),s}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;let t=this._handles.length>0||!this.isDragging();t!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=t,b(this._rootElement,t))}_removeRootElementListeners(){this._rootElementCleanups?.forEach(t=>t()),this._rootElementCleanups=void 0}_applyRootElementTransform(t,e){let i=1/this.scale,s=I(t*i,e*i),n=this._rootElement.style;this._initialTransform==null&&(this._initialTransform=n.transform&&n.transform!="none"?n.transform:""),n.transform=O(s,this._initialTransform)}_applyPreviewTransform(t,e){let i=this._previewTemplate?.template?void 0:this._initialTransform,s=I(t,e);this._preview.setTransform(O(s,i))}_getDragDistance(t){let e=this._pickupPositionOnPage;return e?{x:t.x-e.x,y:t.y-e.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}_containInsideBoundaryOnResize(){let{x:t,y:e}=this._passiveTransform;if(t===0&&e===0||this.isDragging()||!this._boundaryElement)return;let i=this._rootElement.getBoundingClientRect(),s=this._boundaryElement.getBoundingClientRect();if(s.width===0&&s.height===0||i.width===0&&i.height===0)return;let n=s.left-i.left,o=i.right-s.right,a=s.top-i.top,l=i.bottom-s.bottom;s.width>i.width?(n>0&&(t+=n),o>0&&(t-=o)):t=0,s.height>i.height?(a>0&&(e+=a),l>0&&(e-=l)):e=0,(t!==this._passiveTransform.x||e!==this._passiveTransform.y)&&this.setFreeDragPosition({y:e,x:t})}_getDragStartDelay(t){let e=this.dragStartDelay;return typeof e=="number"?e:y(t)?e.touch:e?e.mouse:0}_updateOnScroll(t){let e=this._parentPositions.handleScroll(t);if(e){let i=S(t);this._boundaryRect&&i!==this._boundaryElement&&i.contains(this._boundaryElement)&&E(this._boundaryRect,e.top,e.left),this._pickupPositionOnPage.x+=e.left,this._pickupPositionOnPage.y+=e.top,this._dropContainer||(this._activeTransform.x-=e.left,this._activeTransform.y-=e.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y))}}_getViewportScrollPosition(){return this._parentPositions.positions.get(this._document)?.scrollPosition||this._parentPositions.getViewportScrollPosition()}_getShadowRoot(){return this._cachedShadowRoot===void 0&&(this._cachedShadowRoot=T(this._rootElement)),this._cachedShadowRoot}_getPreviewInsertionPoint(t,e){let i=this._previewContainer||"global";if(i==="parent")return t;if(i==="global"){let s=this._document;return e||s.fullscreenElement||s.webkitFullscreenElement||s.mozFullScreenElement||s.msFullscreenElement||s.body}return v(i)}_getPreviewRect(){return(!this._previewRect||!this._previewRect.width&&!this._previewRect.height)&&(this._previewRect=this._preview?this._preview.getBoundingClientRect():this._initialDomRect),this._previewRect}_nativeDragStart=t=>{if(this._handles.length){let e=this._getTargetHandle(t);e&&!this._disabledHandles.has(e)&&!this.disabled&&t.preventDefault()}else this.disabled||t.preventDefault()};_getTargetHandle(t){return this._handles.find(e=>t.target&&(t.target===e||e.contains(t.target)))}_conditionallyInsertAnchor(t,e,i){if(t===this._initialContainer)this._anchor?.remove(),this._anchor=null;else if(e===this._initialContainer&&e.hasAnchor){let s=this._anchor??=W(this._placeholder);s.classList.remove(At),s.classList.add("cdk-drag-anchor"),s.style.transform="",i?i.before(s):v(e.element).appendChild(s)}}};function Ht(r,t,e){return Math.max(t,Math.min(e,r))}function y(r){return r.type[0]==="t"}function ne(r){r.preventDefault()}function Ut(r,t,e){let i=zt(t,r.length-1),s=zt(e,r.length-1);if(i===s)return;let n=r[i],o=s<i?-1:1;for(let a=i;a!==s;a+=o)r[a]=r[a+o];r[s]=n}function zt(r,t){return Math.max(0,Math.min(t,r))}var L=class{_dragDropRegistry;_element;_sortPredicate;_itemPositions=[];_activeDraggables;orientation="vertical";direction;constructor(t){this._dragDropRegistry=t}_previousSwap={drag:null,delta:0,overlaps:!1};start(t){this.withItems(t)}sort(t,e,i,s){let n=this._itemPositions,o=this._getItemIndexFromPointerPosition(t,e,i,s);if(o===-1&&n.length>0)return null;let a=this.orientation==="horizontal",l=n.findIndex(u=>u.drag===t),h=n[o],c=n[l].clientRect,g=h.clientRect,m=l>o?1:-1,N=this._getItemOffsetPx(c,g,m),$t=this._getSiblingOffsetPx(l,n,m),Kt=n.slice();return Ut(n,l,o),n.forEach((u,Yt)=>{if(Kt[Yt]===u)return;let J=u.drag===t,M=J?N:$t,Q=J?t.getPlaceholderElement():u.drag.getRootElement();u.offset+=M;let tt=Math.round(u.offset*(1/u.drag.scale));a?(Q.style.transform=O(`translate3d(${tt}px, 0, 0)`,u.initialTransform),E(u.clientRect,0,M)):(Q.style.transform=O(`translate3d(0, ${tt}px, 0)`,u.initialTransform),E(u.clientRect,M,0))}),this._previousSwap.overlaps=Z(g,e,i),this._previousSwap.drag=h.drag,this._previousSwap.delta=a?s.x:s.y,{previousIndex:l,currentIndex:o}}enter(t,e,i,s){let n=s==null||s<0?this._getItemIndexFromPointerPosition(t,e,i):s,o=this._activeDraggables,a=o.indexOf(t),l=t.getPlaceholderElement(),h=o[n];if(h===t&&(h=o[n+1]),!h&&(n==null||n===-1||n<o.length-1)&&this._shouldEnterAsFirstChild(e,i)&&(h=o[0]),a>-1&&o.splice(a,1),h&&!this._dragDropRegistry.isDragging(h)){let c=h.getRootElement();c.parentElement.insertBefore(l,c),o.splice(n,0,t)}else this._element.appendChild(l),o.push(t);l.style.transform="",this._cacheItemPositions()}withItems(t){this._activeDraggables=t.slice(),this._cacheItemPositions()}withSortPredicate(t){this._sortPredicate=t}reset(){this._activeDraggables?.forEach(t=>{let e=t.getRootElement();if(e){let i=this._itemPositions.find(s=>s.drag===t)?.initialTransform;e.style.transform=i||""}}),this._itemPositions=[],this._activeDraggables=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=!1}getActiveItemsSnapshot(){return this._activeDraggables}getItemIndex(t){return this._getVisualItemPositions().findIndex(e=>e.drag===t)}getItemAtIndex(t){return this._getVisualItemPositions()[t]?.drag||null}updateOnScroll(t,e){this._itemPositions.forEach(({clientRect:i})=>{E(i,t,e)}),this._itemPositions.forEach(({drag:i})=>{this._dragDropRegistry.isDragging(i)&&i._sortFromLastPointerPosition()})}withElementContainer(t){this._element=t}_cacheItemPositions(){let t=this.orientation==="horizontal";this._itemPositions=this._activeDraggables.map(e=>{let i=e.getVisibleElement();return{drag:e,offset:0,initialTransform:i.style.transform||"",clientRect:Y(i)}}).sort((e,i)=>t?e.clientRect.left-i.clientRect.left:e.clientRect.top-i.clientRect.top)}_getVisualItemPositions(){return this.orientation==="horizontal"&&this.direction==="rtl"?this._itemPositions.slice().reverse():this._itemPositions}_getItemOffsetPx(t,e,i){let s=this.orientation==="horizontal",n=s?e.left-t.left:e.top-t.top;return i===-1&&(n+=s?e.width-t.width:e.height-t.height),n}_getSiblingOffsetPx(t,e,i){let s=this.orientation==="horizontal",n=e[t].clientRect,o=e[t+i*-1],a=n[s?"width":"height"]*i;if(o){let l=s?"left":"top",h=s?"right":"bottom";i===-1?a-=o.clientRect[l]-n[h]:a+=n[l]-o.clientRect[h]}return a}_shouldEnterAsFirstChild(t,e){if(!this._activeDraggables.length)return!1;let i=this._itemPositions,s=this.orientation==="horizontal";if(i[0].drag!==this._activeDraggables[0]){let o=i[i.length-1].clientRect;return s?t>=o.right:e>=o.bottom}else{let o=i[0].clientRect;return s?t<=o.left:e<=o.top}}_getItemIndexFromPointerPosition(t,e,i,s){let n=this.orientation==="horizontal",o=this._itemPositions.findIndex(({drag:a,clientRect:l})=>{if(a===t)return!1;if(s){let h=n?s.x:s.y;if(a===this._previousSwap.drag&&this._previousSwap.overlaps&&h===this._previousSwap.delta)return!1}return n?e>=Math.floor(l.left)&&e<Math.floor(l.right):i>=Math.floor(l.top)&&i<Math.floor(l.bottom)});return o===-1||!this._sortPredicate(o,t)?-1:o}},$=class{_document;_dragDropRegistry;_element;_sortPredicate;_rootNode;_activeItems;_previousSwap={drag:null,deltaX:0,deltaY:0,overlaps:!1};_relatedNodes=[];constructor(t,e){this._document=t,this._dragDropRegistry=e}start(t){let e=this._element.childNodes;this._relatedNodes=[];for(let i=0;i<e.length;i++){let s=e[i];this._relatedNodes.push([s,s.nextSibling])}this.withItems(t)}sort(t,e,i,s){let n=this._getItemIndexFromPointerPosition(t,e,i),o=this._previousSwap;if(n===-1||this._activeItems[n]===t)return null;let a=this._activeItems[n];if(o.drag===a&&o.overlaps&&o.deltaX===s.x&&o.deltaY===s.y)return null;let l=this.getItemIndex(t),h=t.getPlaceholderElement(),c=a.getRootElement();n>l?c.after(h):c.before(h),Ut(this._activeItems,l,n);let g=this._getRootNode().elementFromPoint(e,i);return o.deltaX=s.x,o.deltaY=s.y,o.drag=a,o.overlaps=c===g||c.contains(g),{previousIndex:l,currentIndex:n}}enter(t,e,i,s){let n=this._activeItems.indexOf(t);n>-1&&this._activeItems.splice(n,1);let o=s==null||s<0?this._getItemIndexFromPointerPosition(t,e,i):s;o===-1&&(o=this._getClosestItemIndexToPointer(t,e,i));let a=this._activeItems[o];a&&!this._dragDropRegistry.isDragging(a)?(this._activeItems.splice(o,0,t),a.getRootElement().before(t.getPlaceholderElement())):(this._activeItems.push(t),this._element.appendChild(t.getPlaceholderElement()))}withItems(t){this._activeItems=t.slice()}withSortPredicate(t){this._sortPredicate=t}reset(){let t=this._element,e=this._previousSwap;for(let i=this._relatedNodes.length-1;i>-1;i--){let[s,n]=this._relatedNodes[i];s.parentNode===t&&s.nextSibling!==n&&(n===null?t.appendChild(s):n.parentNode===t&&t.insertBefore(s,n))}this._relatedNodes=[],this._activeItems=[],e.drag=null,e.deltaX=e.deltaY=0,e.overlaps=!1}getActiveItemsSnapshot(){return this._activeItems}getItemIndex(t){return this._activeItems.indexOf(t)}getItemAtIndex(t){return this._activeItems[t]||null}updateOnScroll(){this._activeItems.forEach(t=>{this._dragDropRegistry.isDragging(t)&&t._sortFromLastPointerPosition()})}withElementContainer(t){t!==this._element&&(this._element=t,this._rootNode=void 0)}_getItemIndexFromPointerPosition(t,e,i){let s=this._getRootNode().elementFromPoint(Math.floor(e),Math.floor(i)),n=s?this._activeItems.findIndex(o=>{let a=o.getRootElement();return s===a||a.contains(s)}):-1;return n===-1||!this._sortPredicate(n,t)?-1:n}_getRootNode(){return this._rootNode||(this._rootNode=T(this._element)||this._document),this._rootNode}_getClosestItemIndexToPointer(t,e,i){if(this._activeItems.length===0)return-1;if(this._activeItems.length===1)return 0;let s=1/0,n=-1;for(let o=0;o<this._activeItems.length;o++){let a=this._activeItems[o];if(a!==t){let{x:l,y:h}=a.getRootElement().getBoundingClientRect(),c=Math.hypot(e-l,i-h);c<s&&(s=c,n=o)}}return n}},Vt=.05,Wt=.05,f=(function(r){return r[r.NONE=0]="NONE",r[r.UP=1]="UP",r[r.DOWN=2]="DOWN",r})(f||{}),p=(function(r){return r[r.NONE=0]="NONE",r[r.LEFT=1]="LEFT",r[r.RIGHT=2]="RIGHT",r})(p||{}),K=class{_dragDropRegistry;_ngZone;_viewportRuler;element;disabled=!1;sortingDisabled=!1;lockAxis;autoScrollDisabled=!1;autoScrollStep=2;hasAnchor=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;beforeStarted=new _;entered=new _;exited=new _;dropped=new _;sorted=new _;receivingStarted=new _;receivingStopped=new _;data;_container;_isDragging=!1;_parentPositions;_sortStrategy;_domRect;_draggables=[];_siblings=[];_activeSiblings=new Set;_viewportScrollSubscription=w.EMPTY;_verticalScrollDirection=f.NONE;_horizontalScrollDirection=p.NONE;_scrollNode;_stopScrollTimers=new _;_cachedShadowRoot=null;_document;_scrollableElements=[];_initialScrollSnap;_direction="ltr";constructor(t,e,i,s,n){this._dragDropRegistry=e,this._ngZone=s,this._viewportRuler=n;let o=this.element=v(t);this._document=i,this.withOrientation("vertical").withElementContainer(o),e.registerDropContainer(this),this._parentPositions=new k(i)}dispose(){this._stopScrolling(),this._stopScrollTimers.complete(),this._viewportScrollSubscription.unsubscribe(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this.receivingStarted.complete(),this.receivingStopped.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._parentPositions.clear(),this._dragDropRegistry.removeDropContainer(this)}isDragging(){return this._isDragging}start(){this._draggingStarted(),this._notifyReceivingSiblings()}enter(t,e,i,s){this._draggingStarted(),s==null&&this.sortingDisabled&&(s=this._draggables.indexOf(t)),this._sortStrategy.enter(t,e,i,s),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:t,container:this,currentIndex:this.getItemIndex(t)})}exit(t){this._reset(),this.exited.next({item:t,container:this})}drop(t,e,i,s,n,o,a,l={}){this._reset(),this.dropped.next({item:t,currentIndex:e,previousIndex:i,container:this,previousContainer:s,isPointerOverContainer:n,distance:o,dropPoint:a,event:l})}withItems(t){let e=this._draggables;return this._draggables=t,t.forEach(i=>i._withDropContainer(this)),this.isDragging()&&(e.filter(s=>s.isDragging()).every(s=>t.indexOf(s)===-1)?this._reset():this._sortStrategy.withItems(this._draggables)),this}withDirection(t){return this._direction=t,this._sortStrategy instanceof L&&(this._sortStrategy.direction=t),this}connectedTo(t){return this._siblings=t.slice(),this}withOrientation(t){if(t==="mixed")this._sortStrategy=new $(this._document,this._dragDropRegistry);else{let e=new L(this._dragDropRegistry);e.direction=this._direction,e.orientation=t,this._sortStrategy=e}return this._sortStrategy.withElementContainer(this._container),this._sortStrategy.withSortPredicate((e,i)=>this.sortPredicate(e,i,this)),this}withScrollableParents(t){let e=this._container;return this._scrollableElements=t.indexOf(e)===-1?[e,...t]:t.slice(),this}withElementContainer(t){if(t===this._container)return this;let e=v(this.element),i=this._scrollableElements.indexOf(this._container),s=this._scrollableElements.indexOf(t);return i>-1&&this._scrollableElements.splice(i,1),s>-1&&this._scrollableElements.splice(s,1),this._sortStrategy&&this._sortStrategy.withElementContainer(t),this._cachedShadowRoot=null,this._scrollableElements.unshift(t),this._container=t,this}getScrollableParents(){return this._scrollableElements}getItemIndex(t){return this._isDragging?this._sortStrategy.getItemIndex(t):this._draggables.indexOf(t)}getItemAtIndex(t){return this._isDragging?this._sortStrategy.getItemAtIndex(t):this._draggables[t]||null}isReceiving(){return this._activeSiblings.size>0}_sortItem(t,e,i,s){if(this.sortingDisabled||!this._domRect||!Tt(this._domRect,Vt,e,i))return;let n=this._sortStrategy.sort(t,e,i,s);n&&this.sorted.next({previousIndex:n.previousIndex,currentIndex:n.currentIndex,container:this,item:t})}_startScrollingIfNecessary(t,e){if(this.autoScrollDisabled)return;let i,s=f.NONE,n=p.NONE;if(this._parentPositions.positions.forEach((o,a)=>{a===this._document||!o.clientRect||i||Tt(o.clientRect,Vt,t,e)&&([s,n]=re(a,o.clientRect,this._direction,t,e),(s||n)&&(i=a))}),!s&&!n){let{width:o,height:a}=this._viewportRuler.getViewportSize(),l={width:o,height:a,top:0,right:o,bottom:a,left:0};s=Zt(l,e),n=jt(l,t),i=window}i&&(s!==this._verticalScrollDirection||n!==this._horizontalScrollDirection||i!==this._scrollNode)&&(this._verticalScrollDirection=s,this._horizontalScrollDirection=n,this._scrollNode=i,(s||n)&&i?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling())}_stopScrolling(){this._stopScrollTimers.next()}_draggingStarted(){let t=this._container.style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=t.msScrollSnapType||t.scrollSnapType||"",t.scrollSnapType=t.msScrollSnapType="none",this._sortStrategy.start(this._draggables),this._cacheParentPositions(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents()}_cacheParentPositions(){this._parentPositions.cache(this._scrollableElements),this._domRect=this._parentPositions.positions.get(this._container).clientRect}_reset(){this._isDragging=!1;let t=this._container.style;t.scrollSnapType=t.msScrollSnapType=this._initialScrollSnap,this._siblings.forEach(e=>e._stopReceiving(this)),this._sortStrategy.reset(),this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear()}_startScrollInterval=()=>{this._stopScrolling(),nt(0,it).pipe(x(this._stopScrollTimers)).subscribe(()=>{let t=this._scrollNode,e=this.autoScrollStep;this._verticalScrollDirection===f.UP?t.scrollBy(0,-e):this._verticalScrollDirection===f.DOWN&&t.scrollBy(0,e),this._horizontalScrollDirection===p.LEFT?t.scrollBy(-e,0):this._horizontalScrollDirection===p.RIGHT&&t.scrollBy(e,0)})};_isOverContainer(t,e){return this._domRect!=null&&Z(this._domRect,t,e)}_getSiblingContainerFromPosition(t,e,i){return this._siblings.find(s=>s._canReceive(t,e,i))}_canReceive(t,e,i){if(!this._domRect||!Z(this._domRect,e,i)||!this.enterPredicate(t,this))return!1;let s=this._getShadowRoot().elementFromPoint(e,i);return s?s===this._container||this._container.contains(s):!1}_startReceiving(t,e){let i=this._activeSiblings;!i.has(t)&&e.every(s=>this.enterPredicate(s,this)||this._draggables.indexOf(s)>-1)&&(i.add(t),this._cacheParentPositions(),this._listenToScrollEvents(),this.receivingStarted.next({initiator:t,receiver:this,items:e}))}_stopReceiving(t){this._activeSiblings.delete(t),this._viewportScrollSubscription.unsubscribe(),this.receivingStopped.next({initiator:t,receiver:this})}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(t=>{if(this.isDragging()){let e=this._parentPositions.handleScroll(t);e&&this._sortStrategy.updateOnScroll(e.top,e.left)}else this.isReceiving()&&this._cacheParentPositions()})}_getShadowRoot(){if(!this._cachedShadowRoot){let t=T(this._container);this._cachedShadowRoot=t||this._document}return this._cachedShadowRoot}_notifyReceivingSiblings(){let t=this._sortStrategy.getActiveItemsSnapshot().filter(e=>e.isDragging());this._siblings.forEach(e=>e._startReceiving(this,t))}};function Zt(r,t){let{top:e,bottom:i,height:s}=r,n=s*Wt;return t>=e-n&&t<=e+n?f.UP:t>=i-n&&t<=i+n?f.DOWN:f.NONE}function jt(r,t){let{left:e,right:i,width:s}=r,n=s*Wt;return t>=e-n&&t<=e+n?p.LEFT:t>=i-n&&t<=i+n?p.RIGHT:p.NONE}function re(r,t,e,i,s){let n=Zt(t,s),o=jt(t,i),a=f.NONE,l=p.NONE;if(n){let h=r.scrollTop;n===f.UP?h>0&&(a=f.UP):r.scrollHeight-h>r.clientHeight&&(a=f.DOWN)}if(o){let h=r.scrollLeft;e==="rtl"?o===p.RIGHT?h<0&&(l=p.RIGHT):r.scrollWidth+h>r.clientWidth&&(l=p.LEFT):o===p.LEFT?h>0&&(l=p.LEFT):r.scrollWidth-h>r.clientWidth&&(l=p.RIGHT)}return[a,l]}var R={capture:!0},U={passive:!1,capture:!0},oe=(()=>{class r{static \u0275fac=function(i){return new(i||r)};static \u0275cmp=pt({type:r,selectors:[["ng-component"]],hostAttrs:["cdk-drag-resets-container",""],decls:0,vars:0,template:function(i,s){},styles:[`@layer cdk-resets{.cdk-drag-preview{background:none;border:none;padding:0;color:inherit;inset:auto}}.cdk-drag-placeholder *,.cdk-drag-preview *{pointer-events:none !important}
2
- `],encapsulation:2,changeDetection:0})}return r})(),qt=(()=>{class r{_ngZone=d(C);_document=d(z);_styleLoader=d(yt);_renderer=d(B).createRenderer(null,null);_cleanupDocumentTouchmove;_scroll=new _;_dropInstances=new Set;_dragInstances=new Set;_activeDragInstances=V([]);_globalListeners;_draggingPredicate=e=>e.isDragging();_domNodesToDirectives=null;pointerMove=new _;pointerUp=new _;constructor(){}registerDropContainer(e){this._dropInstances.has(e)||this._dropInstances.add(e)}registerDragItem(e){this._dragInstances.add(e),this._dragInstances.size===1&&this._ngZone.runOutsideAngular(()=>{this._cleanupDocumentTouchmove?.(),this._cleanupDocumentTouchmove=this._renderer.listen(this._document,"touchmove",this._persistentTouchmoveListener,U)})}removeDropContainer(e){this._dropInstances.delete(e)}removeDragItem(e){this._dragInstances.delete(e),this.stopDragging(e),this._dragInstances.size===0&&this._cleanupDocumentTouchmove?.()}startDragging(e,i){if(!(this._activeDragInstances().indexOf(e)>-1)&&(this._styleLoader.load(oe),this._activeDragInstances.update(s=>[...s,e]),this._activeDragInstances().length===1)){let s=i.type.startsWith("touch"),n=a=>this.pointerUp.next(a),o=[["scroll",a=>this._scroll.next(a),R],["selectstart",this._preventDefaultWhileDragging,U]];s?o.push(["touchend",n,R],["touchcancel",n,R]):o.push(["mouseup",n,R]),s||o.push(["mousemove",a=>this.pointerMove.next(a),U]),this._ngZone.runOutsideAngular(()=>{this._globalListeners=o.map(([a,l,h])=>this._renderer.listen(this._document,a,l,h))})}}stopDragging(e){this._activeDragInstances.update(i=>{let s=i.indexOf(e);return s>-1?(i.splice(s,1),[...i]):i}),this._activeDragInstances().length===0&&this._clearGlobalListeners()}isDragging(e){return this._activeDragInstances().indexOf(e)>-1}scrolled(e){let i=[this._scroll];return e&&e!==this._document&&i.push(new A(s=>this._ngZone.runOutsideAngular(()=>{let n=this._renderer.listen(e,"scroll",o=>{this._activeDragInstances().length&&s.next(o)},R);return()=>{n()}}))),F(...i)}registerDirectiveNode(e,i){this._domNodesToDirectives??=new WeakMap,this._domNodesToDirectives.set(e,i)}removeDirectiveNode(e){this._domNodesToDirectives?.delete(e)}getDragDirectiveForNode(e){return this._domNodesToDirectives?.get(e)||null}ngOnDestroy(){this._dragInstances.forEach(e=>this.removeDragItem(e)),this._dropInstances.forEach(e=>this.removeDropContainer(e)),this._domNodesToDirectives=null,this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete()}_preventDefaultWhileDragging=e=>{this._activeDragInstances().length>0&&e.preventDefault()};_persistentTouchmoveListener=e=>{this._activeDragInstances().length>0&&(this._activeDragInstances().some(this._draggingPredicate)&&e.preventDefault(),this.pointerMove.next(e))};_clearGlobalListeners(){this._globalListeners?.forEach(e=>e()),this._globalListeners=void 0}static \u0275fac=function(i){return new(i||r)};static \u0275prov=H({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})(),ae={dragStartThreshold:5,pointerDirectionChangeThreshold:5},le=(()=>{class r{_document=d(z);_ngZone=d(C);_viewportRuler=d(Et);_dragDropRegistry=d(qt);_renderer=d(B).createRenderer(null,null);constructor(){}createDrag(e,i=ae){return new q(e,i,this._document,this._ngZone,this._viewportRuler,this._dragDropRegistry,this._renderer)}createDropList(e){return new K(e,this._dragDropRegistry,this._document,this._ngZone,this._viewportRuler)}static \u0275fac=function(i){return new(i||r)};static \u0275prov=H({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})(),Bt=new P("CDK_DRAG_PARENT");var he=new P("CdkDragHandle");var ce=new P("CDK_DRAG_CONFIG"),de=new P("CdkDropList"),Ae=(()=>{class r{element=d(dt);dropContainer=d(de,{optional:!0,skipSelf:!0});_ngZone=d(C);_viewContainerRef=d(_t);_dir=d(Rt,{optional:!0});_changeDetectorRef=d(vt);_selfHandle=d(he,{optional:!0,self:!0});_parentDrag=d(Bt,{optional:!0,skipSelf:!0});_dragDropRegistry=d(qt);_destroyed=new _;_handles=new et([]);_previewTemplate;_placeholderTemplate;_dragRef;data;lockAxis;rootElementSelector;boundaryElement;dragStartDelay;freeDragPosition;get disabled(){return this._disabled||!!(this.dropContainer&&this.dropContainer.disabled)}set disabled(e){this._disabled=e,this._dragRef.disabled=this._disabled}_disabled;constrainPosition;previewClass;previewContainer;scale=1;started=new D;released=new D;ended=new D;entered=new D;exited=new D;dropped=new D;moved=new A(e=>{let i=this._dragRef.moved.pipe(st(s=>({source:this,pointerPosition:s.pointerPosition,event:s.event,delta:s.delta,distance:s.distance}))).subscribe(e);return()=>{i.unsubscribe()}});_injector=d(ht);constructor(){let e=this.dropContainer,i=d(ce,{optional:!0}),s=d(le);this._dragRef=s.createDrag(this.element,{dragStartThreshold:i&&i.dragStartThreshold!=null?i.dragStartThreshold:5,pointerDirectionChangeThreshold:i&&i.pointerDirectionChangeThreshold!=null?i.pointerDirectionChangeThreshold:5,zIndex:i?.zIndex}),this._dragRef.data=this,this._dragDropRegistry.registerDirectiveNode(this.element.nativeElement,this),i&&this._assignDefaults(i),e&&(e.addItem(this),e._dropListRef.beforeStarted.pipe(x(this._destroyed)).subscribe(()=>{this._dragRef.scale=this.scale})),this._syncInputs(this._dragRef),this._handleEvents(this._dragRef)}getPlaceholderElement(){return this._dragRef.getPlaceholderElement()}getRootElement(){return this._dragRef.getRootElement()}reset(){this._dragRef.reset()}resetToBoundary(){this._dragRef.resetToBoundary()}getFreeDragPosition(){return this._dragRef.getFreeDragPosition()}setFreeDragPosition(e){this._dragRef.setFreeDragPosition(e)}ngAfterViewInit(){ut(()=>{this._updateRootElement(),this._setupHandlesListener(),this._dragRef.scale=this.scale,this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)},{injector:this._injector})}ngOnChanges(e){let i=e.rootElementSelector,s=e.freeDragPosition;i&&!i.firstChange&&this._updateRootElement(),this._dragRef.scale=this.scale,s&&!s.firstChange&&this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)}ngOnDestroy(){this.dropContainer&&this.dropContainer.removeItem(this),this._dragDropRegistry.removeDirectiveNode(this.element.nativeElement),this._ngZone.runOutsideAngular(()=>{this._handles.complete(),this._destroyed.next(),this._destroyed.complete(),this._dragRef.dispose()})}_addHandle(e){let i=this._handles.getValue();i.push(e),this._handles.next(i)}_removeHandle(e){let i=this._handles.getValue(),s=i.indexOf(e);s>-1&&(i.splice(s,1),this._handles.next(i))}_setPreviewTemplate(e){this._previewTemplate=e}_resetPreviewTemplate(e){e===this._previewTemplate&&(this._previewTemplate=null)}_setPlaceholderTemplate(e){this._placeholderTemplate=e}_resetPlaceholderTemplate(e){e===this._placeholderTemplate&&(this._placeholderTemplate=null)}_updateRootElement(){let e=this.element.nativeElement,i=e;this.rootElementSelector&&(i=e.closest!==void 0?e.closest(this.rootElementSelector):e.parentElement?.closest(this.rootElementSelector)),this._dragRef.withRootElement(i||e)}_getBoundaryElement(){let e=this.boundaryElement;return e?typeof e=="string"?this.element.nativeElement.closest(e):v(e):null}_syncInputs(e){e.beforeStarted.subscribe(()=>{if(!e.isDragging()){let i=this._dir,s=this.dragStartDelay,n=this._placeholderTemplate?{template:this._placeholderTemplate.templateRef,context:this._placeholderTemplate.data,viewContainer:this._viewContainerRef}:null,o=this._previewTemplate?{template:this._previewTemplate.templateRef,context:this._previewTemplate.data,matchSize:this._previewTemplate.matchSize,viewContainer:this._viewContainerRef}:null;e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.scale=this.scale,e.dragStartDelay=typeof s=="object"&&s?s:St(s),e.constrainPosition=this.constrainPosition,e.previewClass=this.previewClass,e.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(n).withPreviewTemplate(o).withPreviewContainer(this.previewContainer||"global"),i&&e.withDirection(i.value)}}),e.beforeStarted.pipe(rt(1)).subscribe(()=>{if(this._parentDrag){e.withParent(this._parentDrag._dragRef);return}let i=this.element.nativeElement.parentElement;for(;i;){let s=this._dragDropRegistry.getDragDirectiveForNode(i);if(s){e.withParent(s._dragRef);break}i=i.parentElement}})}_handleEvents(e){e.started.subscribe(i=>{this.started.emit({source:this,event:i.event}),this._changeDetectorRef.markForCheck()}),e.released.subscribe(i=>{this.released.emit({source:this,event:i.event})}),e.ended.subscribe(i=>{this.ended.emit({source:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event}),this._changeDetectorRef.markForCheck()}),e.entered.subscribe(i=>{this.entered.emit({container:i.container.data,item:this,currentIndex:i.currentIndex})}),e.exited.subscribe(i=>{this.exited.emit({container:i.container.data,item:this})}),e.dropped.subscribe(i=>{this.dropped.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,previousContainer:i.previousContainer.data,container:i.container.data,isPointerOverContainer:i.isPointerOverContainer,item:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event})})}_assignDefaults(e){let{lockAxis:i,dragStartDelay:s,constrainPosition:n,previewClass:o,boundaryElement:a,draggingDisabled:l,rootElementSelector:h,previewContainer:c}=e;this.disabled=l??!1,this.dragStartDelay=s||0,i&&(this.lockAxis=i),n&&(this.constrainPosition=n),o&&(this.previewClass=o),a&&(this.boundaryElement=a),h&&(this.rootElementSelector=h),c&&(this.previewContainer=c)}_setupHandlesListener(){this._handles.pipe(lt(e=>{let i=e.map(s=>s.element);this._selfHandle&&this.rootElementSelector&&i.push(this.element),this._dragRef.withHandles(i)}),at(e=>F(...e.map(i=>i._stateChanges.pipe(ot(i))))),x(this._destroyed)).subscribe(e=>{let i=this._dragRef,s=e.element.nativeElement;e.disabled?i.disableHandle(s):i.enableHandle(s)})}static \u0275fac=function(i){return new(i||r)};static \u0275dir=gt({type:r,selectors:[["","cdkDrag",""]],hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(i,s){i&2&&ft("cdk-drag-disabled",s.disabled)("cdk-drag-dragging",s._dragRef.isDragging())},inputs:{data:[0,"cdkDragData","data"],lockAxis:[0,"cdkDragLockAxis","lockAxis"],rootElementSelector:[0,"cdkDragRootElement","rootElementSelector"],boundaryElement:[0,"cdkDragBoundary","boundaryElement"],dragStartDelay:[0,"cdkDragStartDelay","dragStartDelay"],freeDragPosition:[0,"cdkDragFreeDragPosition","freeDragPosition"],disabled:[2,"cdkDragDisabled","disabled",Dt],constrainPosition:[0,"cdkDragConstrainPosition","constrainPosition"],previewClass:[0,"cdkDragPreviewClass","previewClass"],previewContainer:[0,"cdkDragPreviewContainer","previewContainer"],scale:[2,"cdkDragScale","scale",wt]},outputs:{started:"cdkDragStarted",released:"cdkDragReleased",ended:"cdkDragEnded",entered:"cdkDragEntered",exited:"cdkDragExited",dropped:"cdkDragDropped",moved:"cdkDragMoved"},exportAs:["cdkDrag"],features:[mt([{provide:Bt,useExisting:r}]),ct]})}return r})();export{Ae as a};
@@ -1,7 +0,0 @@
1
- import{a as k}from"./chunk-ZFMH37WK.js";import{a as w,b as P}from"./chunk-7XDM4HDH.js";import{Aa as h,Ca as x,Hb as E,K as d,O as r,Qa as a,Ra as S,X as f,aa as m,cb as c,db as b,eb as $,kb as T,la as p,ma as u,na as g,sa as s,ta as n,ua as l,vb as v}from"./chunk-GIEYLCFF.js";import"./chunk-U4XWPFUW.js";var D=["/v1/engagement/cart-widgets","/v1/engagement/page-widgets","/v1/event/validate-session"];function A(){let i=performance.getEntriesByType?.("resource");return i?i.filter(o=>D.some(e=>o.name.includes(e))):[]}function R(){let i=A();return i.length?i.map(e=>JSON.stringify(e.toJSON())).join(`
2
- `):""}function z(i,o){if(i&1&&(s(0,"li")(1,"span",1),a(2),c(3,"date"),n(),a(4,"\xA0 "),l(5,"span",2),c(6,"safeHtml"),n()),i&2){let e=o.$implicit;r(2),S($(3,2,e.time,"hh:mm:ss a")),r(3),h("innerHTML",b(6,5,e.message),d)}}var C=class i{logs=T.required();constructor(){}async shareLogs(){let o=this.logs().map(t=>`[${new Date(t.time).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3,hour12:!1,timeZoneName:"short"})}] ${t.message}`).join(`
3
- `);o=o.replaceAll("\xA0"," ");let e=R();if(e&&(o+=`
4
-
5
- \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 API Resource Metrics (Raw) \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
6
- `+e),P()&&navigator.share){navigator.share({text:o});return}navigator.clipboard.writeText(o),E("Copied to your clipboard")}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=f({type:i,selectors:[["cooee-debugger"]],inputs:{logs:[1,"logs"]},features:[m([k])],decls:5,vars:0,consts:[[1,"btn-copy",3,"click"],[2,"color","rgb(100, 116, 139)"],[3,"innerHTML"]],template:function(e,t){e&1&&(s(0,"ol"),u(1,z,7,7,"li",null,p),n(),s(3,"button",0),x("click",function(){return t.shareLogs()}),a(4,"Copy"),n()),e&2&&(r(),g(t.logs()))},dependencies:[w,v],styles:[`:host{display:block;position:fixed;top:calc(100vh - 90px);left:10px;right:10px;width:auto;max-width:100%;min-width:calc(100vw - 20px);height:80px;background:#fff;z-index:111111111111;overflow-y:auto;font-size:13px;line-height:1.5;padding:5px;font-family:Arial,"sans-serif";font-weight:500;border:2px solid rgb(245,28,143);border-radius:6px;resize:both;-webkit-user-select:auto;user-select:auto;box-shadow:#0000001a 0 10px 15px -3px,#0000001a 0 4px 6px -4px}@media (min-width: 768px){:host{width:600px;min-width:auto}}ol{margin:0;padding:0 0 0 28px}.btn-copy{position:absolute;top:5px;right:5px;background:#f51c8f;border:none;cursor:pointer;padding:6px 8px;font-size:12px;font-weight:500;border-radius:6px;color:#fff}
7
- `],encapsulation:3})};export{C as DebuggerComponent};