@billgangcom/theme-lib 1.125.3 → 1.125.4
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.
- package/dist/{builder-BTUURFPe.js → builder-B5L_sXTT.js} +5 -5
- package/dist/{builder-components-lKDLASGI.js → builder-components-BIfe6RPT.js} +5 -4
- package/dist/{builder-components-_P8JWB1_.cjs → builder-components-X1GAfroW.cjs} +2 -2
- package/dist/{builder-BR3UGcKn.cjs → builder-l3Mn4viI.cjs} +2 -2
- package/dist/builder.cjs.js +1 -1
- package/dist/builder.es.js +23 -23
- package/dist/{charge-DEiKeu4I.cjs → charge-9VEQkwem.cjs} +38 -38
- package/dist/{charge-BI1xffQt.js → charge-Di-4QINM.js} +3407 -3405
- package/dist/{checkout-Dm9pzm5d.cjs → checkout-DCuFIAUp.cjs} +1 -1
- package/dist/{checkout-CZRAhp4K.js → checkout-DsCj-O1M.js} +5 -5
- package/dist/exports.cjs.js +1 -1
- package/dist/exports.es.js +6 -6
- package/dist/{index-4x4Ia1bf.cjs → index-78ELLFPJ.cjs} +1 -1
- package/dist/{index-CngSfS5V.cjs → index-B98dVJaK.cjs} +1 -1
- package/dist/{index-BYPqh6AI.js → index-BEH-iY-2.js} +5 -5
- package/dist/{index-Ij4XsN2K.js → index-BpyYli2C.js} +5 -5
- package/dist/{index-Du4uVvQ_.js → index-CEGNqpya.js} +5 -5
- package/dist/{index-C2ZHAv9L.cjs → index-CcSUuqaw.cjs} +1 -1
- package/dist/{index-DsiIDdbl.cjs → index-DFDIsooy.cjs} +1 -1
- package/dist/{index-D6XiKw_O.js → index-DymofhMw.js} +2 -2
- package/dist/{index-DvlcgzzS.js → index-F6Vdi_NY.js} +5 -5
- package/dist/{index-Bk0MqKGg.cjs → index-IAZX-Ulk.cjs} +1 -1
- package/dist/{index-JPSwqO2t.cjs → index-_V3o_Cpe.cjs} +1 -1
- package/dist/{index-CAe4Pbyv.js → index-x0UXGxZZ.js} +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +6 -6
- package/dist/{order-Cz5k8Ms5.js → order-BDBX80KD.js} +5 -5
- package/dist/{order-C7MQy_k5.cjs → order-DPalIxS2.cjs} +1 -1
- package/dist/{subscription-DJmmS4G8.cjs → subscription-6YfhKXW6.cjs} +1 -1
- package/dist/{subscription-D_ZlQz6z.js → subscription-aL3jcYCi.js} +5 -5
- package/dist/{ticket-ClTGdP4P.cjs → ticket-CjFb8U_g.cjs} +1 -1
- package/dist/{ticket-CW-fMGEc.js → ticket-D73mbXt4.js} +5 -5
- package/dist/{top-up-Cwa9vo-P.js → top-up-BTDWKfwy.js} +5 -5
- package/dist/{top-up-CSphIfNE.cjs → top-up-DRjxtNDd.cjs} +1 -1
- package/dist/{ui-components-CH1YcuZp.cjs → ui-components-CvWzKgkI.cjs} +1 -1
- package/dist/{ui-components-FKiw1QuZ.js → ui-components-D2keDJbK.js} +4 -4
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +1 -1
- package/dist/{validation-IJlx8HaC.cjs → validation-BIkz39RU.cjs} +1 -1
- package/dist/{validation-BzcI5vxY.js → validation-BeyWmqN7.js} +5 -5
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";const i=require("react/jsx-runtime"),f=require("react"),l=require("./builder-BR3UGcKn.cjs"),j=require("./ui-components-CH1YcuZp.cjs");require("./charge-DEiKeu4I.cjs");const at=require("react-dom");require("./ticket-ClTGdP4P.cjs");const Tt=({render:e,block:t})=>e(t),dn=({settings:e,pageContext:t})=>{const{footer:n}=l.useLayersStore(),{settings:s}=l.useSettingsStore(),{pageContext:o}=l.usePagesStore(),{footer:r}=l.useBlocksStore();if(!r||!n)return null;const a=new r;return Object.keys(n).map(c=>{a[c]=n[c]}),a.renderBlock((e==null?void 0:e.blockSettings)||s,t||o)},hn=({settings:e,pageContext:t})=>{const{header:n}=l.useLayersStore(),{settings:s}=l.useSettingsStore(),{pageContext:o}=l.usePagesStore(),{header:r}=l.useBlocksStore();if(!r||!n)return null;const a=new r;return Object.keys(n).map(c=>{a[c]=n[c]}),a.renderBlock((e==null?void 0:e.blockSettings)||s,t||o)},fn=({settings:e,pageContext:t})=>{const{announcement:n}=l.useLayersStore(),{settings:s}=l.useSettingsStore(),{pageContext:o}=l.usePagesStore(),{announcement:r}=l.useBlocksStore();if(!r||!n)return null;const a=new r;return Object.keys(n).map(c=>{a[c]=n[c]}),a.renderBlock(e||s,t||o)},Us=Object.freeze(Object.defineProperty({__proto__:null,RenderAnnouncement:fn,RenderBlock:Tt,RenderFooter:dn,RenderHeader:hn},Symbol.toStringTag,{value:"Module"}));function Ce(e){return Array.isArray?Array.isArray(e):es(e)==="[object Array]"}function Vs(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Ks(e){return e==null?"":Vs(e)}function ve(e){return typeof e=="string"}function Qn(e){return typeof e=="number"}function Gs(e){return e===!0||e===!1||Ys(e)&&es(e)=="[object Boolean]"}function Zn(e){return typeof e=="object"}function Ys(e){return Zn(e)&&e!==null}function te(e){return e!=null}function zt(e){return!e.trim().length}function es(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Xs="Incorrect 'index' type",qs=e=>`Invalid value for key ${e}`,Js=e=>`Pattern length exceeds max of ${e}.`,Qs=e=>`Missing ${e} property in key`,Zs=e=>`Property 'weight' in key '${e}' must be a positive integer`,Bn=Object.prototype.hasOwnProperty;class eo{constructor(t){this._keys=[],this._keyMap={};let n=0;t.forEach(s=>{let o=ts(s);this._keys.push(o),this._keyMap[o.id]=o,n+=o.weight}),this._keys.forEach(s=>{s.weight/=n})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function ts(e){let t=null,n=null,s=null,o=1,r=null;if(ve(e)||Ce(e))s=e,t=En(e),n=Qt(e);else{if(!Bn.call(e,"name"))throw new Error(Qs("name"));const a=e.name;if(s=a,Bn.call(e,"weight")&&(o=e.weight,o<=0))throw new Error(Zs(a));t=En(a),n=Qt(a),r=e.getFn}return{path:t,id:n,weight:o,src:s,getFn:r}}function En(e){return Ce(e)?e:e.split(".")}function Qt(e){return Ce(e)?e.join("."):e}function to(e,t){let n=[],s=!1;const o=(r,a,c)=>{if(te(r))if(!a[c])n.push(r);else{let u=a[c];const h=r[u];if(!te(h))return;if(c===a.length-1&&(ve(h)||Qn(h)||Gs(h)))n.push(Ks(h));else if(Ce(h)){s=!0;for(let d=0,p=h.length;d<p;d+=1)o(h[d],a,c+1)}else a.length&&o(h,a,c+1)}};return o(e,ve(t)?t.split("."):t,0),s?n:n[0]}const no={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},so={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},oo={location:0,threshold:.6,distance:100},ro={useExtendedSearch:!1,getFn:to,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var B={...so,...no,...oo,...ro};const io=/[^ ]+/g;function ao(e=1,t=3){const n=new Map,s=Math.pow(10,t);return{get(o){const r=o.match(io).length;if(n.has(r))return n.get(r);const a=1/Math.pow(r,.5*e),c=parseFloat(Math.round(a*s)/s);return n.set(r,c),c},clear(){n.clear()}}}class gn{constructor({getFn:t=B.getFn,fieldNormWeight:n=B.fieldNormWeight}={}){this.norm=ao(n,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((n,s)=>{this._keysMap[n.id]=s})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,ve(this.docs[0])?this.docs.forEach((t,n)=>{this._addString(t,n)}):this.docs.forEach((t,n)=>{this._addObject(t,n)}),this.norm.clear())}add(t){const n=this.size();ve(t)?this._addString(t,n):this._addObject(t,n)}removeAt(t){this.records.splice(t,1);for(let n=t,s=this.size();n<s;n+=1)this.records[n].i-=1}getValueForItemAtKeyId(t,n){return t[this._keysMap[n]]}size(){return this.records.length}_addString(t,n){if(!te(t)||zt(t))return;let s={v:t,i:n,n:this.norm.get(t)};this.records.push(s)}_addObject(t,n){let s={i:n,$:{}};this.keys.forEach((o,r)=>{let a=o.getFn?o.getFn(t):this.getFn(t,o.path);if(te(a)){if(Ce(a)){let c=[];const u=[{nestedArrIndex:-1,value:a}];for(;u.length;){const{nestedArrIndex:h,value:d}=u.pop();if(te(d))if(ve(d)&&!zt(d)){let p={v:d,i:h,n:this.norm.get(d)};c.push(p)}else Ce(d)&&d.forEach((p,v)=>{u.push({nestedArrIndex:v,value:p})})}s.$[r]=c}else if(ve(a)&&!zt(a)){let c={v:a,n:this.norm.get(a)};s.$[r]=c}}}),this.records.push(s)}toJSON(){return{keys:this.keys,records:this.records}}}function ns(e,t,{getFn:n=B.getFn,fieldNormWeight:s=B.fieldNormWeight}={}){const o=new gn({getFn:n,fieldNormWeight:s});return o.setKeys(e.map(ts)),o.setSources(t),o.create(),o}function co(e,{getFn:t=B.getFn,fieldNormWeight:n=B.fieldNormWeight}={}){const{keys:s,records:o}=e,r=new gn({getFn:t,fieldNormWeight:n});return r.setKeys(s),r.setIndexRecords(o),r}function xt(e,{errors:t=0,currentLocation:n=0,expectedLocation:s=0,distance:o=B.distance,ignoreLocation:r=B.ignoreLocation}={}){const a=t/e.length;if(r)return a;const c=Math.abs(s-n);return o?a+c/o:c?1:a}function lo(e=[],t=B.minMatchCharLength){let n=[],s=-1,o=-1,r=0;for(let a=e.length;r<a;r+=1){let c=e[r];c&&s===-1?s=r:!c&&s!==-1&&(o=r-1,o-s+1>=t&&n.push([s,o]),s=-1)}return e[r-1]&&r-s>=t&&n.push([s,r-1]),n}const Pe=32;function uo(e,t,n,{location:s=B.location,distance:o=B.distance,threshold:r=B.threshold,findAllMatches:a=B.findAllMatches,minMatchCharLength:c=B.minMatchCharLength,includeMatches:u=B.includeMatches,ignoreLocation:h=B.ignoreLocation}={}){if(t.length>Pe)throw new Error(Js(Pe));const d=t.length,p=e.length,v=Math.max(0,Math.min(s,p));let m=r,_=v;const g=c>1||u,x=g?Array(p):[];let y;for(;(y=e.indexOf(t,_))>-1;){let S=xt(t,{currentLocation:y,expectedLocation:v,distance:o,ignoreLocation:h});if(m=Math.min(S,m),_=y+d,g){let N=0;for(;N<d;)x[y+N]=1,N+=1}}_=-1;let w=[],b=1,A=d+p;const C=1<<d-1;for(let S=0;S<d;S+=1){let N=0,M=A;for(;N<M;)xt(t,{errors:S,currentLocation:v+M,expectedLocation:v,distance:o,ignoreLocation:h})<=m?N=M:A=M,M=Math.floor((A-N)/2+N);A=M;let $=Math.max(1,v-M+1),R=a?p:Math.min(v+M,p)+d,D=Array(R+2);D[R+1]=(1<<S)-1;for(let T=R;T>=$;T-=1){let z=T-1,X=n[e.charAt(z)];if(g&&(x[z]=+!!X),D[T]=(D[T+1]<<1|1)&X,S&&(D[T]|=(w[T+1]|w[T])<<1|1|w[T+1]),D[T]&C&&(b=xt(t,{errors:S,currentLocation:z,expectedLocation:v,distance:o,ignoreLocation:h}),b<=m)){if(m=b,_=z,_<=v)break;$=Math.max(1,2*v-_)}}if(xt(t,{errors:S+1,currentLocation:v,expectedLocation:v,distance:o,ignoreLocation:h})>m)break;w=D}const k={isMatch:_>=0,score:Math.max(.001,b)};if(g){const S=lo(x,c);S.length?u&&(k.indices=S):k.isMatch=!1}return k}function ho(e){let t={};for(let n=0,s=e.length;n<s;n+=1){const o=e.charAt(n);t[o]=(t[o]||0)|1<<s-n-1}return t}const At=String.prototype.normalize?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):e=>e;class ss{constructor(t,{location:n=B.location,threshold:s=B.threshold,distance:o=B.distance,includeMatches:r=B.includeMatches,findAllMatches:a=B.findAllMatches,minMatchCharLength:c=B.minMatchCharLength,isCaseSensitive:u=B.isCaseSensitive,ignoreDiacritics:h=B.ignoreDiacritics,ignoreLocation:d=B.ignoreLocation}={}){if(this.options={location:n,threshold:s,distance:o,includeMatches:r,findAllMatches:a,minMatchCharLength:c,isCaseSensitive:u,ignoreDiacritics:h,ignoreLocation:d},t=u?t:t.toLowerCase(),t=h?At(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const p=(m,_)=>{this.chunks.push({pattern:m,alphabet:ho(m),startIndex:_})},v=this.pattern.length;if(v>Pe){let m=0;const _=v%Pe,g=v-_;for(;m<g;)p(this.pattern.substr(m,Pe),m),m+=Pe;if(_){const x=v-Pe;p(this.pattern.substr(x),x)}}else p(this.pattern,0)}searchIn(t){const{isCaseSensitive:n,ignoreDiacritics:s,includeMatches:o}=this.options;if(t=n?t:t.toLowerCase(),t=s?At(t):t,this.pattern===t){let g={isMatch:!0,score:0};return o&&(g.indices=[[0,t.length-1]]),g}const{location:r,distance:a,threshold:c,findAllMatches:u,minMatchCharLength:h,ignoreLocation:d}=this.options;let p=[],v=0,m=!1;this.chunks.forEach(({pattern:g,alphabet:x,startIndex:y})=>{const{isMatch:w,score:b,indices:A}=uo(t,g,x,{location:r+y,distance:a,threshold:c,findAllMatches:u,minMatchCharLength:h,includeMatches:o,ignoreLocation:d});w&&(m=!0),v+=b,w&&A&&(p=[...p,...A])});let _={isMatch:m,score:m?v/this.chunks.length:1};return m&&o&&(_.indices=p),_}}class Me{constructor(t){this.pattern=t}static isMultiMatch(t){return Dn(t,this.multiRegex)}static isSingleMatch(t){return Dn(t,this.singleRegex)}search(){}}function Dn(e,t){const n=e.match(t);return n?n[1]:null}class fo extends Me{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const n=t===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class go extends Me{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const s=t.indexOf(this.pattern)===-1;return{isMatch:s,score:s?0:1,indices:[0,t.length-1]}}}class po extends Me{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const n=t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class mo extends Me{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const n=!t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class vo extends Me{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const n=t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class bo extends Me{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const n=!t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class os extends Me{constructor(t,{location:n=B.location,threshold:s=B.threshold,distance:o=B.distance,includeMatches:r=B.includeMatches,findAllMatches:a=B.findAllMatches,minMatchCharLength:c=B.minMatchCharLength,isCaseSensitive:u=B.isCaseSensitive,ignoreDiacritics:h=B.ignoreDiacritics,ignoreLocation:d=B.ignoreLocation}={}){super(t),this._bitapSearch=new ss(t,{location:n,threshold:s,distance:o,includeMatches:r,findAllMatches:a,minMatchCharLength:c,isCaseSensitive:u,ignoreDiacritics:h,ignoreLocation:d})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class rs extends Me{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let n=0,s;const o=[],r=this.pattern.length;for(;(s=t.indexOf(this.pattern,n))>-1;)n=s+r,o.push([s,n-1]);const a=!!o.length;return{isMatch:a,score:a?0:1,indices:o}}}const Zt=[fo,rs,po,mo,bo,vo,go,os],Tn=Zt.length,xo=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,So="|";function yo(e,t={}){return e.split(So).map(n=>{let s=n.trim().split(xo).filter(r=>r&&!!r.trim()),o=[];for(let r=0,a=s.length;r<a;r+=1){const c=s[r];let u=!1,h=-1;for(;!u&&++h<Tn;){const d=Zt[h];let p=d.isMultiMatch(c);p&&(o.push(new d(p,t)),u=!0)}if(!u)for(h=-1;++h<Tn;){const d=Zt[h];let p=d.isSingleMatch(c);if(p){o.push(new d(p,t));break}}}return o})}const _o=new Set([os.type,rs.type]);class Co{constructor(t,{isCaseSensitive:n=B.isCaseSensitive,ignoreDiacritics:s=B.ignoreDiacritics,includeMatches:o=B.includeMatches,minMatchCharLength:r=B.minMatchCharLength,ignoreLocation:a=B.ignoreLocation,findAllMatches:c=B.findAllMatches,location:u=B.location,threshold:h=B.threshold,distance:d=B.distance}={}){this.query=null,this.options={isCaseSensitive:n,ignoreDiacritics:s,includeMatches:o,minMatchCharLength:r,findAllMatches:c,ignoreLocation:a,location:u,threshold:h,distance:d},t=n?t:t.toLowerCase(),t=s?At(t):t,this.pattern=t,this.query=yo(this.pattern,this.options)}static condition(t,n){return n.useExtendedSearch}searchIn(t){const n=this.query;if(!n)return{isMatch:!1,score:1};const{includeMatches:s,isCaseSensitive:o,ignoreDiacritics:r}=this.options;t=o?t:t.toLowerCase(),t=r?At(t):t;let a=0,c=[],u=0;for(let h=0,d=n.length;h<d;h+=1){const p=n[h];c.length=0,a=0;for(let v=0,m=p.length;v<m;v+=1){const _=p[v],{isMatch:g,indices:x,score:y}=_.search(t);if(g){if(a+=1,u+=y,s){const w=_.constructor.type;_o.has(w)?c=[...c,...x]:c.push(x)}}else{u=0,a=0,c.length=0;break}}if(a){let v={isMatch:!0,score:u/a};return s&&(v.indices=c),v}}return{isMatch:!1,score:1}}}const en=[];function wo(...e){en.push(...e)}function tn(e,t){for(let n=0,s=en.length;n<s;n+=1){let o=en[n];if(o.condition(e,t))return new o(e,t)}return new ss(e,t)}const Nt={AND:"$and",OR:"$or"},nn={PATH:"$path",PATTERN:"$val"},sn=e=>!!(e[Nt.AND]||e[Nt.OR]),ko=e=>!!e[nn.PATH],jo=e=>!Ce(e)&&Zn(e)&&!sn(e),Mn=e=>({[Nt.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function is(e,t,{auto:n=!0}={}){const s=o=>{let r=Object.keys(o);const a=ko(o);if(!a&&r.length>1&&!sn(o))return s(Mn(o));if(jo(o)){const u=a?o[nn.PATH]:r[0],h=a?o[nn.PATTERN]:o[u];if(!ve(h))throw new Error(qs(u));const d={keyId:Qt(u),pattern:h};return n&&(d.searcher=tn(h,t)),d}let c={children:[],operator:r[0]};return r.forEach(u=>{const h=o[u];Ce(h)&&h.forEach(d=>{c.children.push(s(d))})}),c};return sn(e)||(e=Mn(e)),s(e)}function Ao(e,{ignoreFieldNorm:t=B.ignoreFieldNorm}){e.forEach(n=>{let s=1;n.matches.forEach(({key:o,norm:r,score:a})=>{const c=o?o.weight:null;s*=Math.pow(a===0&&c?Number.EPSILON:a,(c||1)*(t?1:r))}),n.score=s})}function No(e,t){const n=e.matches;t.matches=[],te(n)&&n.forEach(s=>{if(!te(s.indices)||!s.indices.length)return;const{indices:o,value:r}=s;let a={indices:o,value:r};s.key&&(a.key=s.key.src),s.idx>-1&&(a.refIndex=s.idx),t.matches.push(a)})}function Io(e,t){t.score=e.score}function Bo(e,t,{includeMatches:n=B.includeMatches,includeScore:s=B.includeScore}={}){const o=[];return n&&o.push(No),s&&o.push(Io),e.map(r=>{const{idx:a}=r,c={item:t[a],refIndex:a};return o.length&&o.forEach(u=>{u(r,c)}),c})}class Oe{constructor(t,n={},s){this.options={...B,...n},this.options.useExtendedSearch,this._keyStore=new eo(this.options.keys),this.setCollection(t,s)}setCollection(t,n){if(this._docs=t,n&&!(n instanceof gn))throw new Error(Xs);this._myIndex=n||ns(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){te(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const n=[];for(let s=0,o=this._docs.length;s<o;s+=1){const r=this._docs[s];t(r,s)&&(this.removeAt(s),s-=1,o-=1,n.push(r))}return n}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:n=-1}={}){const{includeMatches:s,includeScore:o,shouldSort:r,sortFn:a,ignoreFieldNorm:c}=this.options;let u=ve(t)?ve(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return Ao(u,{ignoreFieldNorm:c}),r&&u.sort(a),Qn(n)&&n>-1&&(u=u.slice(0,n)),Bo(u,this._docs,{includeMatches:s,includeScore:o})}_searchStringList(t){const n=tn(t,this.options),{records:s}=this._myIndex,o=[];return s.forEach(({v:r,i:a,n:c})=>{if(!te(r))return;const{isMatch:u,score:h,indices:d}=n.searchIn(r);u&&o.push({item:r,idx:a,matches:[{score:h,value:r,norm:c,indices:d}]})}),o}_searchLogical(t){const n=is(t,this.options),s=(c,u,h)=>{if(!c.children){const{keyId:p,searcher:v}=c,m=this._findMatches({key:this._keyStore.get(p),value:this._myIndex.getValueForItemAtKeyId(u,p),searcher:v});return m&&m.length?[{idx:h,item:u,matches:m}]:[]}const d=[];for(let p=0,v=c.children.length;p<v;p+=1){const m=c.children[p],_=s(m,u,h);if(_.length)d.push(..._);else if(c.operator===Nt.AND)return[]}return d},o=this._myIndex.records,r={},a=[];return o.forEach(({$:c,i:u})=>{if(te(c)){let h=s(n,c,u);h.length&&(r[u]||(r[u]={idx:u,item:c,matches:[]},a.push(r[u])),h.forEach(({matches:d})=>{r[u].matches.push(...d)}))}}),a}_searchObjectList(t){const n=tn(t,this.options),{keys:s,records:o}=this._myIndex,r=[];return o.forEach(({$:a,i:c})=>{if(!te(a))return;let u=[];s.forEach((h,d)=>{u.push(...this._findMatches({key:h,value:a[d],searcher:n}))}),u.length&&r.push({idx:c,item:a,matches:u})}),r}_findMatches({key:t,value:n,searcher:s}){if(!te(n))return[];let o=[];if(Ce(n))n.forEach(({v:r,i:a,n:c})=>{if(!te(r))return;const{isMatch:u,score:h,indices:d}=s.searchIn(r);u&&o.push({score:h,key:t,value:r,idx:a,norm:c,indices:d})});else{const{v:r,n:a}=n,{isMatch:c,score:u,indices:h}=s.searchIn(r);c&&o.push({score:u,key:t,value:r,norm:a,indices:h})}return o}}Oe.version="7.1.0";Oe.createIndex=ns;Oe.parseIndex=co;Oe.config=B;Oe.parseQuery=is;wo(Co);function Eo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return f.useMemo(()=>s=>{t.forEach(o=>o(s))},t)}const Mt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Xe(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function pn(e){return"nodeType"in e}function J(e){var t,n;return e?Xe(e)?e:pn(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function mn(e){const{Document:t}=J(e);return e instanceof t}function ft(e){return Xe(e)?!1:e instanceof J(e).HTMLElement}function as(e){return e instanceof J(e).SVGElement}function qe(e){return e?Xe(e)?e.document:pn(e)?mn(e)?e:ft(e)||as(e)?e.ownerDocument:document:document:document}const be=Mt?f.useLayoutEffect:f.useEffect;function vn(e){const t=f.useRef(e);return be(()=>{t.current=e}),f.useCallback(function(){for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return t.current==null?void 0:t.current(...s)},[])}function Do(){const e=f.useRef(null),t=f.useCallback((s,o)=>{e.current=setInterval(s,o)},[]),n=f.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function dt(e,t){t===void 0&&(t=[e]);const n=f.useRef(e);return be(()=>{n.current!==e&&(n.current=e)},t),n}function gt(e,t){const n=f.useRef();return f.useMemo(()=>{const s=e(n.current);return n.current=s,s},[...t])}function It(e){const t=vn(e),n=f.useRef(null),s=f.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,s]}function on(e){const t=f.useRef();return f.useEffect(()=>{t.current=e},[e]),t.current}let Ht={};function pt(e,t){return f.useMemo(()=>{if(t)return t;const n=Ht[e]==null?0:Ht[e]+1;return Ht[e]=n,e+"-"+n},[e,t])}function cs(e){return function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];return s.reduce((r,a)=>{const c=Object.entries(a);for(const[u,h]of c){const d=r[u];d!=null&&(r[u]=d+e*h)}return r},{...t})}}const Ge=cs(1),Bt=cs(-1);function To(e){return"clientX"in e&&"clientY"in e}function bn(e){if(!e)return!1;const{KeyboardEvent:t}=J(e.target);return t&&e instanceof t}function Mo(e){if(!e)return!1;const{TouchEvent:t}=J(e.target);return t&&e instanceof t}function rn(e){if(Mo(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return To(e)?{x:e.clientX,y:e.clientY}:null}const Ye=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Ye.Translate.toString(e),Ye.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:s}=e;return t+" "+n+"ms "+s}}}),Rn="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Ro(e){return e.matches(Rn)?e:e.querySelector(Rn)}const Po={display:"none"};function Oo(e){let{id:t,value:n}=e;return f.createElement("div",{id:t,style:Po},n)}function Lo(e){let{id:t,announcement:n,ariaLiveType:s="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return f.createElement("div",{id:t,style:o,role:"status","aria-live":s,"aria-atomic":!0},n)}function $o(){const[e,t]=f.useState("");return{announce:f.useCallback(s=>{s!=null&&t(s)},[]),announcement:e}}const ls=f.createContext(null);function Fo(e){const t=f.useContext(ls);f.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function zo(){const[e]=f.useState(()=>new Set),t=f.useCallback(s=>(e.add(s),()=>e.delete(s)),[e]);return[f.useCallback(s=>{let{type:o,event:r}=s;e.forEach(a=>{var c;return(c=a[o])==null?void 0:c.call(a,r)})},[e]),t]}const Ho={draggable:`
|
|
1
|
+
"use strict";const i=require("react/jsx-runtime"),f=require("react"),l=require("./builder-l3Mn4viI.cjs"),j=require("./ui-components-CvWzKgkI.cjs");require("./charge-9VEQkwem.cjs");const at=require("react-dom");require("./ticket-CjFb8U_g.cjs");const Tt=({render:e,block:t})=>e(t),dn=({settings:e,pageContext:t})=>{const{footer:n}=l.useLayersStore(),{settings:s}=l.useSettingsStore(),{pageContext:o}=l.usePagesStore(),{footer:r}=l.useBlocksStore();if(!r||!n)return null;const a=new r;return Object.keys(n).map(c=>{a[c]=n[c]}),a.renderBlock((e==null?void 0:e.blockSettings)||s,t||o)},hn=({settings:e,pageContext:t})=>{const{header:n}=l.useLayersStore(),{settings:s}=l.useSettingsStore(),{pageContext:o}=l.usePagesStore(),{header:r}=l.useBlocksStore();if(!r||!n)return null;const a=new r;return Object.keys(n).map(c=>{a[c]=n[c]}),a.renderBlock((e==null?void 0:e.blockSettings)||s,t||o)},fn=({settings:e,pageContext:t})=>{const{announcement:n}=l.useLayersStore(),{settings:s}=l.useSettingsStore(),{pageContext:o}=l.usePagesStore(),{announcement:r}=l.useBlocksStore();if(!r||!n)return null;const a=new r;return Object.keys(n).map(c=>{a[c]=n[c]}),a.renderBlock(e||s,t||o)},Us=Object.freeze(Object.defineProperty({__proto__:null,RenderAnnouncement:fn,RenderBlock:Tt,RenderFooter:dn,RenderHeader:hn},Symbol.toStringTag,{value:"Module"}));function Ce(e){return Array.isArray?Array.isArray(e):es(e)==="[object Array]"}function Vs(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Ks(e){return e==null?"":Vs(e)}function ve(e){return typeof e=="string"}function Qn(e){return typeof e=="number"}function Gs(e){return e===!0||e===!1||Ys(e)&&es(e)=="[object Boolean]"}function Zn(e){return typeof e=="object"}function Ys(e){return Zn(e)&&e!==null}function te(e){return e!=null}function zt(e){return!e.trim().length}function es(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Xs="Incorrect 'index' type",qs=e=>`Invalid value for key ${e}`,Js=e=>`Pattern length exceeds max of ${e}.`,Qs=e=>`Missing ${e} property in key`,Zs=e=>`Property 'weight' in key '${e}' must be a positive integer`,Bn=Object.prototype.hasOwnProperty;class eo{constructor(t){this._keys=[],this._keyMap={};let n=0;t.forEach(s=>{let o=ts(s);this._keys.push(o),this._keyMap[o.id]=o,n+=o.weight}),this._keys.forEach(s=>{s.weight/=n})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function ts(e){let t=null,n=null,s=null,o=1,r=null;if(ve(e)||Ce(e))s=e,t=En(e),n=Qt(e);else{if(!Bn.call(e,"name"))throw new Error(Qs("name"));const a=e.name;if(s=a,Bn.call(e,"weight")&&(o=e.weight,o<=0))throw new Error(Zs(a));t=En(a),n=Qt(a),r=e.getFn}return{path:t,id:n,weight:o,src:s,getFn:r}}function En(e){return Ce(e)?e:e.split(".")}function Qt(e){return Ce(e)?e.join("."):e}function to(e,t){let n=[],s=!1;const o=(r,a,c)=>{if(te(r))if(!a[c])n.push(r);else{let u=a[c];const h=r[u];if(!te(h))return;if(c===a.length-1&&(ve(h)||Qn(h)||Gs(h)))n.push(Ks(h));else if(Ce(h)){s=!0;for(let d=0,p=h.length;d<p;d+=1)o(h[d],a,c+1)}else a.length&&o(h,a,c+1)}};return o(e,ve(t)?t.split("."):t,0),s?n:n[0]}const no={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},so={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},oo={location:0,threshold:.6,distance:100},ro={useExtendedSearch:!1,getFn:to,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var B={...so,...no,...oo,...ro};const io=/[^ ]+/g;function ao(e=1,t=3){const n=new Map,s=Math.pow(10,t);return{get(o){const r=o.match(io).length;if(n.has(r))return n.get(r);const a=1/Math.pow(r,.5*e),c=parseFloat(Math.round(a*s)/s);return n.set(r,c),c},clear(){n.clear()}}}class gn{constructor({getFn:t=B.getFn,fieldNormWeight:n=B.fieldNormWeight}={}){this.norm=ao(n,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((n,s)=>{this._keysMap[n.id]=s})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,ve(this.docs[0])?this.docs.forEach((t,n)=>{this._addString(t,n)}):this.docs.forEach((t,n)=>{this._addObject(t,n)}),this.norm.clear())}add(t){const n=this.size();ve(t)?this._addString(t,n):this._addObject(t,n)}removeAt(t){this.records.splice(t,1);for(let n=t,s=this.size();n<s;n+=1)this.records[n].i-=1}getValueForItemAtKeyId(t,n){return t[this._keysMap[n]]}size(){return this.records.length}_addString(t,n){if(!te(t)||zt(t))return;let s={v:t,i:n,n:this.norm.get(t)};this.records.push(s)}_addObject(t,n){let s={i:n,$:{}};this.keys.forEach((o,r)=>{let a=o.getFn?o.getFn(t):this.getFn(t,o.path);if(te(a)){if(Ce(a)){let c=[];const u=[{nestedArrIndex:-1,value:a}];for(;u.length;){const{nestedArrIndex:h,value:d}=u.pop();if(te(d))if(ve(d)&&!zt(d)){let p={v:d,i:h,n:this.norm.get(d)};c.push(p)}else Ce(d)&&d.forEach((p,v)=>{u.push({nestedArrIndex:v,value:p})})}s.$[r]=c}else if(ve(a)&&!zt(a)){let c={v:a,n:this.norm.get(a)};s.$[r]=c}}}),this.records.push(s)}toJSON(){return{keys:this.keys,records:this.records}}}function ns(e,t,{getFn:n=B.getFn,fieldNormWeight:s=B.fieldNormWeight}={}){const o=new gn({getFn:n,fieldNormWeight:s});return o.setKeys(e.map(ts)),o.setSources(t),o.create(),o}function co(e,{getFn:t=B.getFn,fieldNormWeight:n=B.fieldNormWeight}={}){const{keys:s,records:o}=e,r=new gn({getFn:t,fieldNormWeight:n});return r.setKeys(s),r.setIndexRecords(o),r}function xt(e,{errors:t=0,currentLocation:n=0,expectedLocation:s=0,distance:o=B.distance,ignoreLocation:r=B.ignoreLocation}={}){const a=t/e.length;if(r)return a;const c=Math.abs(s-n);return o?a+c/o:c?1:a}function lo(e=[],t=B.minMatchCharLength){let n=[],s=-1,o=-1,r=0;for(let a=e.length;r<a;r+=1){let c=e[r];c&&s===-1?s=r:!c&&s!==-1&&(o=r-1,o-s+1>=t&&n.push([s,o]),s=-1)}return e[r-1]&&r-s>=t&&n.push([s,r-1]),n}const Pe=32;function uo(e,t,n,{location:s=B.location,distance:o=B.distance,threshold:r=B.threshold,findAllMatches:a=B.findAllMatches,minMatchCharLength:c=B.minMatchCharLength,includeMatches:u=B.includeMatches,ignoreLocation:h=B.ignoreLocation}={}){if(t.length>Pe)throw new Error(Js(Pe));const d=t.length,p=e.length,v=Math.max(0,Math.min(s,p));let m=r,_=v;const g=c>1||u,x=g?Array(p):[];let y;for(;(y=e.indexOf(t,_))>-1;){let S=xt(t,{currentLocation:y,expectedLocation:v,distance:o,ignoreLocation:h});if(m=Math.min(S,m),_=y+d,g){let N=0;for(;N<d;)x[y+N]=1,N+=1}}_=-1;let w=[],b=1,A=d+p;const C=1<<d-1;for(let S=0;S<d;S+=1){let N=0,M=A;for(;N<M;)xt(t,{errors:S,currentLocation:v+M,expectedLocation:v,distance:o,ignoreLocation:h})<=m?N=M:A=M,M=Math.floor((A-N)/2+N);A=M;let $=Math.max(1,v-M+1),R=a?p:Math.min(v+M,p)+d,D=Array(R+2);D[R+1]=(1<<S)-1;for(let T=R;T>=$;T-=1){let z=T-1,X=n[e.charAt(z)];if(g&&(x[z]=+!!X),D[T]=(D[T+1]<<1|1)&X,S&&(D[T]|=(w[T+1]|w[T])<<1|1|w[T+1]),D[T]&C&&(b=xt(t,{errors:S,currentLocation:z,expectedLocation:v,distance:o,ignoreLocation:h}),b<=m)){if(m=b,_=z,_<=v)break;$=Math.max(1,2*v-_)}}if(xt(t,{errors:S+1,currentLocation:v,expectedLocation:v,distance:o,ignoreLocation:h})>m)break;w=D}const k={isMatch:_>=0,score:Math.max(.001,b)};if(g){const S=lo(x,c);S.length?u&&(k.indices=S):k.isMatch=!1}return k}function ho(e){let t={};for(let n=0,s=e.length;n<s;n+=1){const o=e.charAt(n);t[o]=(t[o]||0)|1<<s-n-1}return t}const At=String.prototype.normalize?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):e=>e;class ss{constructor(t,{location:n=B.location,threshold:s=B.threshold,distance:o=B.distance,includeMatches:r=B.includeMatches,findAllMatches:a=B.findAllMatches,minMatchCharLength:c=B.minMatchCharLength,isCaseSensitive:u=B.isCaseSensitive,ignoreDiacritics:h=B.ignoreDiacritics,ignoreLocation:d=B.ignoreLocation}={}){if(this.options={location:n,threshold:s,distance:o,includeMatches:r,findAllMatches:a,minMatchCharLength:c,isCaseSensitive:u,ignoreDiacritics:h,ignoreLocation:d},t=u?t:t.toLowerCase(),t=h?At(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const p=(m,_)=>{this.chunks.push({pattern:m,alphabet:ho(m),startIndex:_})},v=this.pattern.length;if(v>Pe){let m=0;const _=v%Pe,g=v-_;for(;m<g;)p(this.pattern.substr(m,Pe),m),m+=Pe;if(_){const x=v-Pe;p(this.pattern.substr(x),x)}}else p(this.pattern,0)}searchIn(t){const{isCaseSensitive:n,ignoreDiacritics:s,includeMatches:o}=this.options;if(t=n?t:t.toLowerCase(),t=s?At(t):t,this.pattern===t){let g={isMatch:!0,score:0};return o&&(g.indices=[[0,t.length-1]]),g}const{location:r,distance:a,threshold:c,findAllMatches:u,minMatchCharLength:h,ignoreLocation:d}=this.options;let p=[],v=0,m=!1;this.chunks.forEach(({pattern:g,alphabet:x,startIndex:y})=>{const{isMatch:w,score:b,indices:A}=uo(t,g,x,{location:r+y,distance:a,threshold:c,findAllMatches:u,minMatchCharLength:h,includeMatches:o,ignoreLocation:d});w&&(m=!0),v+=b,w&&A&&(p=[...p,...A])});let _={isMatch:m,score:m?v/this.chunks.length:1};return m&&o&&(_.indices=p),_}}class Me{constructor(t){this.pattern=t}static isMultiMatch(t){return Dn(t,this.multiRegex)}static isSingleMatch(t){return Dn(t,this.singleRegex)}search(){}}function Dn(e,t){const n=e.match(t);return n?n[1]:null}class fo extends Me{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const n=t===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class go extends Me{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const s=t.indexOf(this.pattern)===-1;return{isMatch:s,score:s?0:1,indices:[0,t.length-1]}}}class po extends Me{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const n=t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class mo extends Me{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const n=!t.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class vo extends Me{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const n=t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class bo extends Me{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const n=!t.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}}class os extends Me{constructor(t,{location:n=B.location,threshold:s=B.threshold,distance:o=B.distance,includeMatches:r=B.includeMatches,findAllMatches:a=B.findAllMatches,minMatchCharLength:c=B.minMatchCharLength,isCaseSensitive:u=B.isCaseSensitive,ignoreDiacritics:h=B.ignoreDiacritics,ignoreLocation:d=B.ignoreLocation}={}){super(t),this._bitapSearch=new ss(t,{location:n,threshold:s,distance:o,includeMatches:r,findAllMatches:a,minMatchCharLength:c,isCaseSensitive:u,ignoreDiacritics:h,ignoreLocation:d})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class rs extends Me{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let n=0,s;const o=[],r=this.pattern.length;for(;(s=t.indexOf(this.pattern,n))>-1;)n=s+r,o.push([s,n-1]);const a=!!o.length;return{isMatch:a,score:a?0:1,indices:o}}}const Zt=[fo,rs,po,mo,bo,vo,go,os],Tn=Zt.length,xo=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,So="|";function yo(e,t={}){return e.split(So).map(n=>{let s=n.trim().split(xo).filter(r=>r&&!!r.trim()),o=[];for(let r=0,a=s.length;r<a;r+=1){const c=s[r];let u=!1,h=-1;for(;!u&&++h<Tn;){const d=Zt[h];let p=d.isMultiMatch(c);p&&(o.push(new d(p,t)),u=!0)}if(!u)for(h=-1;++h<Tn;){const d=Zt[h];let p=d.isSingleMatch(c);if(p){o.push(new d(p,t));break}}}return o})}const _o=new Set([os.type,rs.type]);class Co{constructor(t,{isCaseSensitive:n=B.isCaseSensitive,ignoreDiacritics:s=B.ignoreDiacritics,includeMatches:o=B.includeMatches,minMatchCharLength:r=B.minMatchCharLength,ignoreLocation:a=B.ignoreLocation,findAllMatches:c=B.findAllMatches,location:u=B.location,threshold:h=B.threshold,distance:d=B.distance}={}){this.query=null,this.options={isCaseSensitive:n,ignoreDiacritics:s,includeMatches:o,minMatchCharLength:r,findAllMatches:c,ignoreLocation:a,location:u,threshold:h,distance:d},t=n?t:t.toLowerCase(),t=s?At(t):t,this.pattern=t,this.query=yo(this.pattern,this.options)}static condition(t,n){return n.useExtendedSearch}searchIn(t){const n=this.query;if(!n)return{isMatch:!1,score:1};const{includeMatches:s,isCaseSensitive:o,ignoreDiacritics:r}=this.options;t=o?t:t.toLowerCase(),t=r?At(t):t;let a=0,c=[],u=0;for(let h=0,d=n.length;h<d;h+=1){const p=n[h];c.length=0,a=0;for(let v=0,m=p.length;v<m;v+=1){const _=p[v],{isMatch:g,indices:x,score:y}=_.search(t);if(g){if(a+=1,u+=y,s){const w=_.constructor.type;_o.has(w)?c=[...c,...x]:c.push(x)}}else{u=0,a=0,c.length=0;break}}if(a){let v={isMatch:!0,score:u/a};return s&&(v.indices=c),v}}return{isMatch:!1,score:1}}}const en=[];function wo(...e){en.push(...e)}function tn(e,t){for(let n=0,s=en.length;n<s;n+=1){let o=en[n];if(o.condition(e,t))return new o(e,t)}return new ss(e,t)}const Nt={AND:"$and",OR:"$or"},nn={PATH:"$path",PATTERN:"$val"},sn=e=>!!(e[Nt.AND]||e[Nt.OR]),ko=e=>!!e[nn.PATH],jo=e=>!Ce(e)&&Zn(e)&&!sn(e),Mn=e=>({[Nt.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function is(e,t,{auto:n=!0}={}){const s=o=>{let r=Object.keys(o);const a=ko(o);if(!a&&r.length>1&&!sn(o))return s(Mn(o));if(jo(o)){const u=a?o[nn.PATH]:r[0],h=a?o[nn.PATTERN]:o[u];if(!ve(h))throw new Error(qs(u));const d={keyId:Qt(u),pattern:h};return n&&(d.searcher=tn(h,t)),d}let c={children:[],operator:r[0]};return r.forEach(u=>{const h=o[u];Ce(h)&&h.forEach(d=>{c.children.push(s(d))})}),c};return sn(e)||(e=Mn(e)),s(e)}function Ao(e,{ignoreFieldNorm:t=B.ignoreFieldNorm}){e.forEach(n=>{let s=1;n.matches.forEach(({key:o,norm:r,score:a})=>{const c=o?o.weight:null;s*=Math.pow(a===0&&c?Number.EPSILON:a,(c||1)*(t?1:r))}),n.score=s})}function No(e,t){const n=e.matches;t.matches=[],te(n)&&n.forEach(s=>{if(!te(s.indices)||!s.indices.length)return;const{indices:o,value:r}=s;let a={indices:o,value:r};s.key&&(a.key=s.key.src),s.idx>-1&&(a.refIndex=s.idx),t.matches.push(a)})}function Io(e,t){t.score=e.score}function Bo(e,t,{includeMatches:n=B.includeMatches,includeScore:s=B.includeScore}={}){const o=[];return n&&o.push(No),s&&o.push(Io),e.map(r=>{const{idx:a}=r,c={item:t[a],refIndex:a};return o.length&&o.forEach(u=>{u(r,c)}),c})}class Oe{constructor(t,n={},s){this.options={...B,...n},this.options.useExtendedSearch,this._keyStore=new eo(this.options.keys),this.setCollection(t,s)}setCollection(t,n){if(this._docs=t,n&&!(n instanceof gn))throw new Error(Xs);this._myIndex=n||ns(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){te(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const n=[];for(let s=0,o=this._docs.length;s<o;s+=1){const r=this._docs[s];t(r,s)&&(this.removeAt(s),s-=1,o-=1,n.push(r))}return n}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:n=-1}={}){const{includeMatches:s,includeScore:o,shouldSort:r,sortFn:a,ignoreFieldNorm:c}=this.options;let u=ve(t)?ve(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return Ao(u,{ignoreFieldNorm:c}),r&&u.sort(a),Qn(n)&&n>-1&&(u=u.slice(0,n)),Bo(u,this._docs,{includeMatches:s,includeScore:o})}_searchStringList(t){const n=tn(t,this.options),{records:s}=this._myIndex,o=[];return s.forEach(({v:r,i:a,n:c})=>{if(!te(r))return;const{isMatch:u,score:h,indices:d}=n.searchIn(r);u&&o.push({item:r,idx:a,matches:[{score:h,value:r,norm:c,indices:d}]})}),o}_searchLogical(t){const n=is(t,this.options),s=(c,u,h)=>{if(!c.children){const{keyId:p,searcher:v}=c,m=this._findMatches({key:this._keyStore.get(p),value:this._myIndex.getValueForItemAtKeyId(u,p),searcher:v});return m&&m.length?[{idx:h,item:u,matches:m}]:[]}const d=[];for(let p=0,v=c.children.length;p<v;p+=1){const m=c.children[p],_=s(m,u,h);if(_.length)d.push(..._);else if(c.operator===Nt.AND)return[]}return d},o=this._myIndex.records,r={},a=[];return o.forEach(({$:c,i:u})=>{if(te(c)){let h=s(n,c,u);h.length&&(r[u]||(r[u]={idx:u,item:c,matches:[]},a.push(r[u])),h.forEach(({matches:d})=>{r[u].matches.push(...d)}))}}),a}_searchObjectList(t){const n=tn(t,this.options),{keys:s,records:o}=this._myIndex,r=[];return o.forEach(({$:a,i:c})=>{if(!te(a))return;let u=[];s.forEach((h,d)=>{u.push(...this._findMatches({key:h,value:a[d],searcher:n}))}),u.length&&r.push({idx:c,item:a,matches:u})}),r}_findMatches({key:t,value:n,searcher:s}){if(!te(n))return[];let o=[];if(Ce(n))n.forEach(({v:r,i:a,n:c})=>{if(!te(r))return;const{isMatch:u,score:h,indices:d}=s.searchIn(r);u&&o.push({score:h,key:t,value:r,idx:a,norm:c,indices:d})});else{const{v:r,n:a}=n,{isMatch:c,score:u,indices:h}=s.searchIn(r);c&&o.push({score:u,key:t,value:r,norm:a,indices:h})}return o}}Oe.version="7.1.0";Oe.createIndex=ns;Oe.parseIndex=co;Oe.config=B;Oe.parseQuery=is;wo(Co);function Eo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return f.useMemo(()=>s=>{t.forEach(o=>o(s))},t)}const Mt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Xe(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function pn(e){return"nodeType"in e}function J(e){var t,n;return e?Xe(e)?e:pn(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function mn(e){const{Document:t}=J(e);return e instanceof t}function ft(e){return Xe(e)?!1:e instanceof J(e).HTMLElement}function as(e){return e instanceof J(e).SVGElement}function qe(e){return e?Xe(e)?e.document:pn(e)?mn(e)?e:ft(e)||as(e)?e.ownerDocument:document:document:document}const be=Mt?f.useLayoutEffect:f.useEffect;function vn(e){const t=f.useRef(e);return be(()=>{t.current=e}),f.useCallback(function(){for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return t.current==null?void 0:t.current(...s)},[])}function Do(){const e=f.useRef(null),t=f.useCallback((s,o)=>{e.current=setInterval(s,o)},[]),n=f.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function dt(e,t){t===void 0&&(t=[e]);const n=f.useRef(e);return be(()=>{n.current!==e&&(n.current=e)},t),n}function gt(e,t){const n=f.useRef();return f.useMemo(()=>{const s=e(n.current);return n.current=s,s},[...t])}function It(e){const t=vn(e),n=f.useRef(null),s=f.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,s]}function on(e){const t=f.useRef();return f.useEffect(()=>{t.current=e},[e]),t.current}let Ht={};function pt(e,t){return f.useMemo(()=>{if(t)return t;const n=Ht[e]==null?0:Ht[e]+1;return Ht[e]=n,e+"-"+n},[e,t])}function cs(e){return function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];return s.reduce((r,a)=>{const c=Object.entries(a);for(const[u,h]of c){const d=r[u];d!=null&&(r[u]=d+e*h)}return r},{...t})}}const Ge=cs(1),Bt=cs(-1);function To(e){return"clientX"in e&&"clientY"in e}function bn(e){if(!e)return!1;const{KeyboardEvent:t}=J(e.target);return t&&e instanceof t}function Mo(e){if(!e)return!1;const{TouchEvent:t}=J(e.target);return t&&e instanceof t}function rn(e){if(Mo(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return To(e)?{x:e.clientX,y:e.clientY}:null}const Ye=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Ye.Translate.toString(e),Ye.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:s}=e;return t+" "+n+"ms "+s}}}),Rn="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Ro(e){return e.matches(Rn)?e:e.querySelector(Rn)}const Po={display:"none"};function Oo(e){let{id:t,value:n}=e;return f.createElement("div",{id:t,style:Po},n)}function Lo(e){let{id:t,announcement:n,ariaLiveType:s="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return f.createElement("div",{id:t,style:o,role:"status","aria-live":s,"aria-atomic":!0},n)}function $o(){const[e,t]=f.useState("");return{announce:f.useCallback(s=>{s!=null&&t(s)},[]),announcement:e}}const ls=f.createContext(null);function Fo(e){const t=f.useContext(ls);f.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function zo(){const[e]=f.useState(()=>new Set),t=f.useCallback(s=>(e.add(s),()=>e.delete(s)),[e]);return[f.useCallback(s=>{let{type:o,event:r}=s;e.forEach(a=>{var c;return(c=a[o])==null?void 0:c.call(a,r)})},[e]),t]}const Ho={draggable:`
|
|
2
2
|
To pick up a draggable item, press the space bar.
|
|
3
3
|
While dragging, use the arrow keys to move the item.
|
|
4
4
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
5
|
-
`},Wo={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Uo(e){let{announcements:t=Wo,container:n,hiddenTextDescribedById:s,screenReaderInstructions:o=Ho}=e;const{announce:r,announcement:a}=$o(),c=pt("DndLiveRegion"),[u,h]=f.useState(!1);if(f.useEffect(()=>{h(!0)},[]),Fo(f.useMemo(()=>({onDragStart(p){let{active:v}=p;r(t.onDragStart({active:v}))},onDragMove(p){let{active:v,over:m}=p;t.onDragMove&&r(t.onDragMove({active:v,over:m}))},onDragOver(p){let{active:v,over:m}=p;r(t.onDragOver({active:v,over:m}))},onDragEnd(p){let{active:v,over:m}=p;r(t.onDragEnd({active:v,over:m}))},onDragCancel(p){let{active:v,over:m}=p;r(t.onDragCancel({active:v,over:m}))}}),[r,t])),!u)return null;const d=f.createElement(f.Fragment,null,f.createElement(Oo,{id:s,value:o.draggable}),f.createElement(Lo,{id:c,announcement:a}));return n?at.createPortal(d,n):d}var W;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(W||(W={}));function Et(){}function us(e,t){return f.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function ds(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return f.useMemo(()=>[...t].filter(s=>s!=null),[...t])}const ue=Object.freeze({x:0,y:0});function Vo(e,t){let{data:{value:n}}=e,{data:{value:s}}=t;return s-n}function Ko(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Go(e,t){const n=Math.max(t.top,e.top),s=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),r=Math.min(t.top+t.height,e.top+e.height),a=o-s,c=r-n;if(s<o&&n<r){const u=t.width*t.height,h=e.width*e.height,d=a*c,p=d/(u+h-d);return Number(p.toFixed(4))}return 0}const Yo=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:s}=e;const o=[];for(const r of s){const{id:a}=r,c=n.get(a);if(c){const u=Go(c,t);u>0&&o.push({id:a,data:{droppableContainer:r,value:u}})}}return o.sort(Vo)};function Xo(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function hs(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ue}function qo(e){return function(n){for(var s=arguments.length,o=new Array(s>1?s-1:0),r=1;r<s;r++)o[r-1]=arguments[r];return o.reduce((a,c)=>({...a,top:a.top+e*c.y,bottom:a.bottom+e*c.y,left:a.left+e*c.x,right:a.right+e*c.x}),{...n})}}const Jo=qo(1);function Qo(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Zo(e,t,n){const s=Qo(t);if(!s)return e;const{scaleX:o,scaleY:r,x:a,y:c}=s,u=e.left-a-(1-o)*parseFloat(n),h=e.top-c-(1-r)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,p=r?e.height/r:e.height;return{width:d,height:p,top:h,right:u+d,bottom:h+p,left:u}}const er={ignoreTransform:!1};function Je(e,t){t===void 0&&(t=er);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:h,transformOrigin:d}=J(e).getComputedStyle(e);h&&(n=Zo(n,h,d))}const{top:s,left:o,width:r,height:a,bottom:c,right:u}=n;return{top:s,left:o,width:r,height:a,bottom:c,right:u}}function Pn(e){return Je(e,{ignoreTransform:!0})}function tr(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function nr(e,t){return t===void 0&&(t=J(e).getComputedStyle(e)),t.position==="fixed"}function sr(e,t){t===void 0&&(t=J(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const r=t[o];return typeof r=="string"?n.test(r):!1})}function xn(e,t){const n=[];function s(o){if(t!=null&&n.length>=t||!o)return n;if(mn(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!ft(o)||as(o)||n.includes(o))return n;const r=J(e).getComputedStyle(o);return o!==e&&sr(o,r)&&n.push(o),nr(o,r)?n:s(o.parentNode)}return e?s(e):n}function fs(e){const[t]=xn(e,1);return t??null}function Wt(e){return!Mt||!e?null:Xe(e)?e:pn(e)?mn(e)||e===qe(e).scrollingElement?window:ft(e)?e:null:null}function gs(e){return Xe(e)?e.scrollX:e.scrollLeft}function ps(e){return Xe(e)?e.scrollY:e.scrollTop}function an(e){return{x:gs(e),y:ps(e)}}var U;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(U||(U={}));function ms(e){return!Mt||!e?!1:e===document.scrollingElement}function vs(e){const t={x:0,y:0},n=ms(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},s={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,r=e.scrollLeft<=t.x,a=e.scrollTop>=s.y,c=e.scrollLeft>=s.x;return{isTop:o,isLeft:r,isBottom:a,isRight:c,maxScroll:s,minScroll:t}}const or={x:.2,y:.2};function rr(e,t,n,s,o){let{top:r,left:a,right:c,bottom:u}=n;s===void 0&&(s=10),o===void 0&&(o=or);const{isTop:h,isBottom:d,isLeft:p,isRight:v}=vs(e),m={x:0,y:0},_={x:0,y:0},g={height:t.height*o.y,width:t.width*o.x};return!h&&r<=t.top+g.height?(m.y=U.Backward,_.y=s*Math.abs((t.top+g.height-r)/g.height)):!d&&u>=t.bottom-g.height&&(m.y=U.Forward,_.y=s*Math.abs((t.bottom-g.height-u)/g.height)),!v&&c>=t.right-g.width?(m.x=U.Forward,_.x=s*Math.abs((t.right-g.width-c)/g.width)):!p&&a<=t.left+g.width&&(m.x=U.Backward,_.x=s*Math.abs((t.left+g.width-a)/g.width)),{direction:m,speed:_}}function ir(e){if(e===document.scrollingElement){const{innerWidth:r,innerHeight:a}=window;return{top:0,left:0,right:r,bottom:a,width:r,height:a}}const{top:t,left:n,right:s,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:s,bottom:o,width:e.clientWidth,height:e.clientHeight}}function bs(e){return e.reduce((t,n)=>Ge(t,an(n)),ue)}function ar(e){return e.reduce((t,n)=>t+gs(n),0)}function cr(e){return e.reduce((t,n)=>t+ps(n),0)}function lr(e,t){if(t===void 0&&(t=Je),!e)return;const{top:n,left:s,bottom:o,right:r}=t(e);fs(e)&&(o<=0||r<=0||n>=window.innerHeight||s>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ur=[["x",["left","right"],ar],["y",["top","bottom"],cr]];class Sn{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const s=xn(n),o=bs(s);this.rect={...t},this.width=t.width,this.height=t.height;for(const[r,a,c]of ur)for(const u of a)Object.defineProperty(this,u,{get:()=>{const h=c(s),d=o[r]-h;return this.rect[u]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ct{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var s;return(s=this.target)==null?void 0:s.removeEventListener(...n)})},this.target=t}add(t,n,s){var o;(o=this.target)==null||o.addEventListener(t,n,s),this.listeners.push([t,n,s])}}function dr(e){const{EventTarget:t}=J(e);return e instanceof t?e:qe(e)}function Ut(e,t){const n=Math.abs(e.x),s=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+s**2)>t:"x"in t&&"y"in t?n>t.x&&s>t.y:"x"in t?n>t.x:"y"in t?s>t.y:!1}var oe;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(oe||(oe={}));function On(e){e.preventDefault()}function hr(e){e.stopPropagation()}var O;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(O||(O={}));const xs={start:[O.Space,O.Enter],cancel:[O.Esc],end:[O.Space,O.Enter,O.Tab]},fr=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case O.Right:return{...n,x:n.x+25};case O.Left:return{...n,x:n.x-25};case O.Down:return{...n,y:n.y+25};case O.Up:return{...n,y:n.y-25}}};class Ss{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new ct(qe(n)),this.windowListeners=new ct(J(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(oe.Resize,this.handleCancel),this.windowListeners.add(oe.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(oe.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,s=t.node.current;s&&lr(s),n(ue)}handleKeyDown(t){if(bn(t)){const{active:n,context:s,options:o}=this.props,{keyboardCodes:r=xs,coordinateGetter:a=fr,scrollBehavior:c="smooth"}=o,{code:u}=t;if(r.end.includes(u)){this.handleEnd(t);return}if(r.cancel.includes(u)){this.handleCancel(t);return}const{collisionRect:h}=s.current,d=h?{x:h.left,y:h.top}:ue;this.referenceCoordinates||(this.referenceCoordinates=d);const p=a(t,{active:n,context:s.current,currentCoordinates:d});if(p){const v=Bt(p,d),m={x:0,y:0},{scrollableAncestors:_}=s.current;for(const g of _){const x=t.code,{isTop:y,isRight:w,isLeft:b,isBottom:A,maxScroll:C,minScroll:k}=vs(g),S=ir(g),N={x:Math.min(x===O.Right?S.right-S.width/2:S.right,Math.max(x===O.Right?S.left:S.left+S.width/2,p.x)),y:Math.min(x===O.Down?S.bottom-S.height/2:S.bottom,Math.max(x===O.Down?S.top:S.top+S.height/2,p.y))},M=x===O.Right&&!w||x===O.Left&&!b,$=x===O.Down&&!A||x===O.Up&&!y;if(M&&N.x!==p.x){const R=g.scrollLeft+v.x,D=x===O.Right&&R<=C.x||x===O.Left&&R>=k.x;if(D&&!v.y){g.scrollTo({left:R,behavior:c});return}D?m.x=g.scrollLeft-R:m.x=x===O.Right?g.scrollLeft-C.x:g.scrollLeft-k.x,m.x&&g.scrollBy({left:-m.x,behavior:c});break}else if($&&N.y!==p.y){const R=g.scrollTop+v.y,D=x===O.Down&&R<=C.y||x===O.Up&&R>=k.y;if(D&&!v.x){g.scrollTo({top:R,behavior:c});return}D?m.y=g.scrollTop-R:m.y=x===O.Down?g.scrollTop-C.y:g.scrollTop-k.y,m.y&&g.scrollBy({top:-m.y,behavior:c});break}}this.handleMove(t,Ge(Bt(p,this.referenceCoordinates),m))}}}handleMove(t,n){const{onMove:s}=this.props;t.preventDefault(),s(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Ss.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:s=xs,onActivation:o}=t,{active:r}=n;const{code:a}=e.nativeEvent;if(s.start.includes(a)){const c=r.activatorNode.current;return c&&e.target!==c?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function Ln(e){return!!(e&&"distance"in e)}function $n(e){return!!(e&&"delay"in e)}class yn{constructor(t,n,s){var o;s===void 0&&(s=dr(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:r}=t,{target:a}=r;this.props=t,this.events=n,this.document=qe(a),this.documentListeners=new ct(this.document),this.listeners=new ct(s),this.windowListeners=new ct(J(a)),this.initialCoordinates=(o=rn(r))!=null?o:ue,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:s}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(oe.Resize,this.handleCancel),this.windowListeners.add(oe.DragStart,On),this.windowListeners.add(oe.VisibilityChange,this.handleCancel),this.windowListeners.add(oe.ContextMenu,On),this.documentListeners.add(oe.Keydown,this.handleKeydown),n){if(s!=null&&s({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if($n(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Ln(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:s,onPending:o}=this.props;o(s,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(oe.Click,hr,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(oe.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:s,initialCoordinates:o,props:r}=this,{onMove:a,options:{activationConstraint:c}}=r;if(!o)return;const u=(n=rn(t))!=null?n:ue,h=Bt(o,u);if(!s&&c){if(Ln(c)){if(c.tolerance!=null&&Ut(h,c.tolerance))return this.handleCancel();if(Ut(h,c.distance))return this.handleStart()}if($n(c)&&Ut(h,c.tolerance))return this.handleCancel();this.handlePending(c,h);return}t.cancelable&&t.preventDefault(),a(u)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===O.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const gr={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Rt extends yn{constructor(t){const{event:n}=t,s=qe(n.target);super(t,gr,s)}}Rt.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;return!n.isPrimary||n.button!==0?!1:(s==null||s({event:n}),!0)}}];const pr={move:{name:"mousemove"},end:{name:"mouseup"}};var cn;(function(e){e[e.RightClick=2]="RightClick"})(cn||(cn={}));class mr extends yn{constructor(t){super(t,pr,qe(t.event.target))}}mr.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;return n.button===cn.RightClick?!1:(s==null||s({event:n}),!0)}}];const Vt={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class vr extends yn{constructor(t){super(t,Vt)}static setup(){return window.addEventListener(Vt.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Vt.move.name,t)};function t(){}}}vr.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;const{touches:o}=n;return o.length>1?!1:(s==null||s({event:n}),!0)}}];var lt;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(lt||(lt={}));var Dt;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Dt||(Dt={}));function br(e){let{acceleration:t,activator:n=lt.Pointer,canScroll:s,draggingRect:o,enabled:r,interval:a=5,order:c=Dt.TreeOrder,pointerCoordinates:u,scrollableAncestors:h,scrollableAncestorRects:d,delta:p,threshold:v}=e;const m=Sr({delta:p,disabled:!r}),[_,g]=Do(),x=f.useRef({x:0,y:0}),y=f.useRef({x:0,y:0}),w=f.useMemo(()=>{switch(n){case lt.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case lt.DraggableRect:return o}},[n,o,u]),b=f.useRef(null),A=f.useCallback(()=>{const k=b.current;if(!k)return;const S=x.current.x*y.current.x,N=x.current.y*y.current.y;k.scrollBy(S,N)},[]),C=f.useMemo(()=>c===Dt.TreeOrder?[...h].reverse():h,[c,h]);f.useEffect(()=>{if(!r||!h.length||!w){g();return}for(const k of C){if((s==null?void 0:s(k))===!1)continue;const S=h.indexOf(k),N=d[S];if(!N)continue;const{direction:M,speed:$}=rr(k,N,w,t,v);for(const R of["x","y"])m[R][M[R]]||($[R]=0,M[R]=0);if($.x>0||$.y>0){g(),b.current=k,_(A,a),x.current=$,y.current=M;return}}x.current={x:0,y:0},y.current={x:0,y:0},g()},[t,A,s,g,r,a,JSON.stringify(w),JSON.stringify(m),_,h,C,d,JSON.stringify(v)])}const xr={x:{[U.Backward]:!1,[U.Forward]:!1},y:{[U.Backward]:!1,[U.Forward]:!1}};function Sr(e){let{delta:t,disabled:n}=e;const s=on(t);return gt(o=>{if(n||!s||!o)return xr;const r={x:Math.sign(t.x-s.x),y:Math.sign(t.y-s.y)};return{x:{[U.Backward]:o.x[U.Backward]||r.x===-1,[U.Forward]:o.x[U.Forward]||r.x===1},y:{[U.Backward]:o.y[U.Backward]||r.y===-1,[U.Forward]:o.y[U.Forward]||r.y===1}}},[n,t,s])}function yr(e,t){const n=t!=null?e.get(t):void 0,s=n?n.node.current:null;return gt(o=>{var r;return t==null?null:(r=s??o)!=null?r:null},[s,t])}function _r(e,t){return f.useMemo(()=>e.reduce((n,s)=>{const{sensor:o}=s,r=o.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,s)}));return[...n,...r]},[]),[e,t])}var ht;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(ht||(ht={}));var ln;(function(e){e.Optimized="optimized"})(ln||(ln={}));const Fn=new Map;function Cr(e,t){let{dragging:n,dependencies:s,config:o}=t;const[r,a]=f.useState(null),{frequency:c,measure:u,strategy:h}=o,d=f.useRef(e),p=x(),v=dt(p),m=f.useCallback(function(y){y===void 0&&(y=[]),!v.current&&a(w=>w===null?y:w.concat(y.filter(b=>!w.includes(b))))},[v]),_=f.useRef(null),g=gt(y=>{if(p&&!n)return Fn;if(!y||y===Fn||d.current!==e||r!=null){const w=new Map;for(let b of e){if(!b)continue;if(r&&r.length>0&&!r.includes(b.id)&&b.rect.current){w.set(b.id,b.rect.current);continue}const A=b.node.current,C=A?new Sn(u(A),A):null;b.rect.current=C,C&&w.set(b.id,C)}return w}return y},[e,r,n,p,u]);return f.useEffect(()=>{d.current=e},[e]),f.useEffect(()=>{p||m()},[n,p]),f.useEffect(()=>{r&&r.length>0&&a(null)},[JSON.stringify(r)]),f.useEffect(()=>{p||typeof c!="number"||_.current!==null||(_.current=setTimeout(()=>{m(),_.current=null},c))},[c,p,m,...s]),{droppableRects:g,measureDroppableContainers:m,measuringScheduled:r!=null};function x(){switch(h){case ht.Always:return!1;case ht.BeforeDragging:return n;default:return!n}}}function ys(e,t){return gt(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function wr(e,t){return ys(e,t)}function kr(e){let{callback:t,disabled:n}=e;const s=vn(t),o=f.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:r}=window;return new r(s)},[s,n]);return f.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Pt(e){let{callback:t,disabled:n}=e;const s=vn(t),o=f.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:r}=window;return new r(s)},[n]);return f.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function jr(e){return new Sn(Je(e),e)}function zn(e,t,n){t===void 0&&(t=jr);const[s,o]=f.useState(null);function r(){o(u=>{if(!e)return null;if(e.isConnected===!1){var h;return(h=u??n)!=null?h:null}const d=t(e);return JSON.stringify(u)===JSON.stringify(d)?u:d})}const a=kr({callback(u){if(e)for(const h of u){const{type:d,target:p}=h;if(d==="childList"&&p instanceof HTMLElement&&p.contains(e)){r();break}}}}),c=Pt({callback:r});return be(()=>{r(),e?(c==null||c.observe(e),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(c==null||c.disconnect(),a==null||a.disconnect())},[e]),s}function Ar(e){const t=ys(e);return hs(e,t)}const Hn=[];function Nr(e){const t=f.useRef(e),n=gt(s=>e?s&&s!==Hn&&e&&t.current&&e.parentNode===t.current.parentNode?s:xn(e):Hn,[e]);return f.useEffect(()=>{t.current=e},[e]),n}function Ir(e){const[t,n]=f.useState(null),s=f.useRef(e),o=f.useCallback(r=>{const a=Wt(r.target);a&&n(c=>c?(c.set(a,an(a)),new Map(c)):null)},[]);return f.useEffect(()=>{const r=s.current;if(e!==r){a(r);const c=e.map(u=>{const h=Wt(u);return h?(h.addEventListener("scroll",o,{passive:!0}),[h,an(h)]):null}).filter(u=>u!=null);n(c.length?new Map(c):null),s.current=e}return()=>{a(e),a(r)};function a(c){c.forEach(u=>{const h=Wt(u);h==null||h.removeEventListener("scroll",o)})}},[o,e]),f.useMemo(()=>e.length?t?Array.from(t.values()).reduce((r,a)=>Ge(r,a),ue):bs(e):ue,[e,t])}function Wn(e,t){t===void 0&&(t=[]);const n=f.useRef(null);return f.useEffect(()=>{n.current=null},t),f.useEffect(()=>{const s=e!==ue;s&&!n.current&&(n.current=e),!s&&n.current&&(n.current=null)},[e]),n.current?Bt(e,n.current):ue}function Br(e){f.useEffect(()=>{if(!Mt)return;const t=e.map(n=>{let{sensor:s}=n;return s.setup==null?void 0:s.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function Er(e,t){return f.useMemo(()=>e.reduce((n,s)=>{let{eventName:o,handler:r}=s;return n[o]=a=>{r(a,t)},n},{}),[e,t])}function _s(e){return f.useMemo(()=>e?tr(e):null,[e])}const Un=[];function Dr(e,t){t===void 0&&(t=Je);const[n]=e,s=_s(n?J(n):null),[o,r]=f.useState(Un);function a(){r(()=>e.length?e.map(u=>ms(u)?s:new Sn(t(u),u)):Un)}const c=Pt({callback:a});return be(()=>{c==null||c.disconnect(),a(),e.forEach(u=>c==null?void 0:c.observe(u))},[e]),o}function Tr(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ft(t)?t:e}function Mr(e){let{measure:t}=e;const[n,s]=f.useState(null),o=f.useCallback(h=>{for(const{target:d}of h)if(ft(d)){s(p=>{const v=t(d);return p?{...p,width:v.width,height:v.height}:v});break}},[t]),r=Pt({callback:o}),a=f.useCallback(h=>{const d=Tr(h);r==null||r.disconnect(),d&&(r==null||r.observe(d)),s(d?t(d):null)},[t,r]),[c,u]=It(a);return f.useMemo(()=>({nodeRef:c,rect:n,setRef:u}),[n,c,u])}const Rr=[{sensor:Rt,options:{}},{sensor:Ss,options:{}}],Pr={current:{}},jt={draggable:{measure:Pn},droppable:{measure:Pn,strategy:ht.WhileDragging,frequency:ln.Optimized},dragOverlay:{measure:Je}};class ut extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,s;return(n=(s=this.get(t))==null?void 0:s.node.current)!=null?n:void 0}}const Or={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ut,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Et},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:jt,measureDroppableContainers:Et,windowRect:null,measuringScheduled:!1},Lr={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Et,draggableNodes:new Map,over:null,measureDroppableContainers:Et},Ot=f.createContext(Lr),Cs=f.createContext(Or);function $r(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ut}}}function Fr(e,t){switch(t.type){case W.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case W.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case W.DragEnd:case W.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case W.RegisterDroppable:{const{element:n}=t,{id:s}=n,o=new ut(e.droppable.containers);return o.set(s,n),{...e,droppable:{...e.droppable,containers:o}}}case W.SetDroppableDisabled:{const{id:n,key:s,disabled:o}=t,r=e.droppable.containers.get(n);if(!r||s!==r.key)return e;const a=new ut(e.droppable.containers);return a.set(n,{...r,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case W.UnregisterDroppable:{const{id:n,key:s}=t,o=e.droppable.containers.get(n);if(!o||s!==o.key)return e;const r=new ut(e.droppable.containers);return r.delete(n),{...e,droppable:{...e.droppable,containers:r}}}default:return e}}function zr(e){let{disabled:t}=e;const{active:n,activatorEvent:s,draggableNodes:o}=f.useContext(Ot),r=on(s),a=on(n==null?void 0:n.id);return f.useEffect(()=>{if(!t&&!s&&r&&a!=null){if(!bn(r)||document.activeElement===r.target)return;const c=o.get(a);if(!c)return;const{activatorNode:u,node:h}=c;if(!u.current&&!h.current)return;requestAnimationFrame(()=>{for(const d of[u.current,h.current]){if(!d)continue;const p=Ro(d);if(p){p.focus();break}}})}},[s,t,o,a,r]),null}function Hr(e,t){let{transform:n,...s}=t;return e!=null&&e.length?e.reduce((o,r)=>r({transform:o,...s}),n):n}function Wr(e){return f.useMemo(()=>({draggable:{...jt.draggable,...e==null?void 0:e.draggable},droppable:{...jt.droppable,...e==null?void 0:e.droppable},dragOverlay:{...jt.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Ur(e){let{activeNode:t,measure:n,initialRect:s,config:o=!0}=e;const r=f.useRef(!1),{x:a,y:c}=typeof o=="boolean"?{x:o,y:o}:o;be(()=>{if(!a&&!c||!t){r.current=!1;return}if(r.current||!s)return;const h=t==null?void 0:t.node.current;if(!h||h.isConnected===!1)return;const d=n(h),p=hs(d,s);if(a||(p.x=0),c||(p.y=0),r.current=!0,Math.abs(p.x)>0||Math.abs(p.y)>0){const v=fs(h);v&&v.scrollBy({top:p.y,left:p.x})}},[t,a,c,s,n])}const ws=f.createContext({...ue,scaleX:1,scaleY:1});var Te;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Te||(Te={}));const ks=f.memo(function(t){var n,s,o,r;let{id:a,accessibility:c,autoScroll:u=!0,children:h,sensors:d=Rr,collisionDetection:p=Yo,measuring:v,modifiers:m,..._}=t;const g=f.useReducer(Fr,void 0,$r),[x,y]=g,[w,b]=zo(),[A,C]=f.useState(Te.Uninitialized),k=A===Te.Initialized,{draggable:{active:S,nodes:N,translate:M},droppable:{containers:$}}=x,R=S!=null?N.get(S):null,D=f.useRef({initial:null,translated:null}),P=f.useMemo(()=>{var G;return S!=null?{id:S,data:(G=R==null?void 0:R.data)!=null?G:Pr,rect:D}:null},[S,R]),T=f.useRef(null),[z,X]=f.useState(null),[E,H]=f.useState(null),re=dt(_,Object.values(_)),we=pt("DndDescribedBy",a),Le=f.useMemo(()=>$.getEnabled(),[$]),K=Wr(v),{droppableRects:ie,measureDroppableContainers:de,measuringScheduled:Re}=Cr(Le,{dragging:k,dependencies:[M.x,M.y],config:K.droppable}),L=yr(N,S),$e=f.useMemo(()=>E?rn(E):null,[E]),ke=Ws(),xe=wr(L,K.draggable.measure);Ur({activeNode:S!=null?N.get(S):null,config:ke.layoutShiftCompensation,initialRect:xe,measure:K.draggable.measure});const F=zn(L,K.draggable.measure,xe),Qe=zn(L?L.parentElement:null),he=f.useRef({activatorEvent:null,active:null,activeNode:L,collisionRect:null,collisions:null,droppableRects:ie,draggableNodes:N,draggingNode:null,draggingNodeRect:null,droppableContainers:$,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Fe=$.getNodeFor((n=he.current.over)==null?void 0:n.id),Se=Mr({measure:K.dragOverlay.measure}),ze=(s=Se.nodeRef.current)!=null?s:L,He=k?(o=Se.rect)!=null?o:F:null,_n=!!(Se.nodeRef.current&&Se.rect),Cn=Ar(_n?null:F),Lt=_s(ze?J(ze):null),je=Nr(k?Fe??L:null),vt=Dr(je),bt=Hr(m,{transform:{x:M.x-Cn.x,y:M.y-Cn.y,scaleX:1,scaleY:1},activatorEvent:E,active:P,activeNodeRect:F,containerNodeRect:Qe,draggingNodeRect:He,over:he.current.over,overlayNodeRect:Se.rect,scrollableAncestors:je,scrollableAncestorRects:vt,windowRect:Lt}),wn=$e?Ge($e,M):null,kn=Ir(je),Ps=Wn(kn),Os=Wn(kn,[F]),We=Ge(bt,Ps),Ue=He?Jo(He,bt):null,Ze=P&&Ue?p({active:P,collisionRect:Ue,droppableRects:ie,droppableContainers:Le,pointerCoordinates:wn}):null,jn=Ko(Ze,"id"),[Ae,An]=f.useState(null),Ls=_n?bt:Ge(bt,Os),$s=Xo(Ls,(r=Ae==null?void 0:Ae.rect)!=null?r:null,F),$t=f.useRef(null),Nn=f.useCallback((G,Q)=>{let{sensor:Z,options:Ne}=Q;if(T.current==null)return;const ne=N.get(T.current);if(!ne)return;const ee=G.nativeEvent,fe=new Z({active:T.current,activeNode:ne,event:ee,options:Ne,context:he,onAbort(V){if(!N.get(V))return;const{onDragAbort:ge}=re.current,ye={id:V};ge==null||ge(ye),w({type:"onDragAbort",event:ye})},onPending(V,Ie,ge,ye){if(!N.get(V))return;const{onDragPending:tt}=re.current,Be={id:V,constraint:Ie,initialCoordinates:ge,offset:ye};tt==null||tt(Be),w({type:"onDragPending",event:Be})},onStart(V){const Ie=T.current;if(Ie==null)return;const ge=N.get(Ie);if(!ge)return;const{onDragStart:ye}=re.current,et={activatorEvent:ee,active:{id:Ie,data:ge.data,rect:D}};at.unstable_batchedUpdates(()=>{ye==null||ye(et),C(Te.Initializing),y({type:W.DragStart,initialCoordinates:V,active:Ie}),w({type:"onDragStart",event:et}),X($t.current),H(ee)})},onMove(V){y({type:W.DragMove,coordinates:V})},onEnd:Ve(W.DragEnd),onCancel:Ve(W.DragCancel)});$t.current=fe;function Ve(V){return async function(){const{active:ge,collisions:ye,over:et,scrollAdjustedTranslate:tt}=he.current;let Be=null;if(ge&&tt){const{cancelDrop:nt}=re.current;Be={activatorEvent:ee,active:ge,collisions:ye,delta:tt,over:et},V===W.DragEnd&&typeof nt=="function"&&await Promise.resolve(nt(Be))&&(V=W.DragCancel)}T.current=null,at.unstable_batchedUpdates(()=>{y({type:V}),C(Te.Uninitialized),An(null),X(null),H(null),$t.current=null;const nt=V===W.DragEnd?"onDragEnd":"onDragCancel";if(Be){const Ft=re.current[nt];Ft==null||Ft(Be),w({type:nt,event:Be})}})}}},[N]),Fs=f.useCallback((G,Q)=>(Z,Ne)=>{const ne=Z.nativeEvent,ee=N.get(Ne);if(T.current!==null||!ee||ne.dndKit||ne.defaultPrevented)return;const fe={active:ee};G(Z,Q.options,fe)===!0&&(ne.dndKit={capturedBy:Q.sensor},T.current=Ne,Nn(Z,Q))},[N,Nn]),In=_r(d,Fs);Br(d),be(()=>{F&&A===Te.Initializing&&C(Te.Initialized)},[F,A]),f.useEffect(()=>{const{onDragMove:G}=re.current,{active:Q,activatorEvent:Z,collisions:Ne,over:ne}=he.current;if(!Q||!Z)return;const ee={active:Q,activatorEvent:Z,collisions:Ne,delta:{x:We.x,y:We.y},over:ne};at.unstable_batchedUpdates(()=>{G==null||G(ee),w({type:"onDragMove",event:ee})})},[We.x,We.y]),f.useEffect(()=>{const{active:G,activatorEvent:Q,collisions:Z,droppableContainers:Ne,scrollAdjustedTranslate:ne}=he.current;if(!G||T.current==null||!Q||!ne)return;const{onDragOver:ee}=re.current,fe=Ne.get(jn),Ve=fe&&fe.rect.current?{id:fe.id,rect:fe.rect.current,data:fe.data,disabled:fe.disabled}:null,V={active:G,activatorEvent:Q,collisions:Z,delta:{x:ne.x,y:ne.y},over:Ve};at.unstable_batchedUpdates(()=>{An(Ve),ee==null||ee(V),w({type:"onDragOver",event:V})})},[jn]),be(()=>{he.current={activatorEvent:E,active:P,activeNode:L,collisionRect:Ue,collisions:Ze,droppableRects:ie,draggableNodes:N,draggingNode:ze,draggingNodeRect:He,droppableContainers:$,over:Ae,scrollableAncestors:je,scrollAdjustedTranslate:We},D.current={initial:He,translated:Ue}},[P,L,Ze,Ue,N,ze,He,ie,$,Ae,je,We]),br({...ke,delta:M,draggingRect:Ue,pointerCoordinates:wn,scrollableAncestors:je,scrollableAncestorRects:vt});const zs=f.useMemo(()=>({active:P,activeNode:L,activeNodeRect:F,activatorEvent:E,collisions:Ze,containerNodeRect:Qe,dragOverlay:Se,draggableNodes:N,droppableContainers:$,droppableRects:ie,over:Ae,measureDroppableContainers:de,scrollableAncestors:je,scrollableAncestorRects:vt,measuringConfiguration:K,measuringScheduled:Re,windowRect:Lt}),[P,L,F,E,Ze,Qe,Se,N,$,ie,Ae,de,je,vt,K,Re,Lt]),Hs=f.useMemo(()=>({activatorEvent:E,activators:In,active:P,activeNodeRect:F,ariaDescribedById:{draggable:we},dispatch:y,draggableNodes:N,over:Ae,measureDroppableContainers:de}),[E,In,P,F,y,we,N,Ae,de]);return f.createElement(ls.Provider,{value:b},f.createElement(Ot.Provider,{value:Hs},f.createElement(Cs.Provider,{value:zs},f.createElement(ws.Provider,{value:$s},h)),f.createElement(zr,{disabled:(c==null?void 0:c.restoreFocus)===!1})),f.createElement(Uo,{...c,hiddenTextDescribedById:we}));function Ws(){const G=(z==null?void 0:z.autoScrollEnabled)===!1,Q=typeof u=="object"?u.enabled===!1:u===!1,Z=k&&!G&&!Q;return typeof u=="object"?{...u,enabled:Z}:{enabled:Z}}}),Vr=f.createContext(null),Vn="button",Kr="Draggable";function Gr(e){let{id:t,data:n,disabled:s=!1,attributes:o}=e;const r=pt(Kr),{activators:a,activatorEvent:c,active:u,activeNodeRect:h,ariaDescribedById:d,draggableNodes:p,over:v}=f.useContext(Ot),{role:m=Vn,roleDescription:_="draggable",tabIndex:g=0}=o??{},x=(u==null?void 0:u.id)===t,y=f.useContext(x?ws:Vr),[w,b]=It(),[A,C]=It(),k=Er(a,t),S=dt(n);be(()=>(p.set(t,{id:t,key:r,node:w,activatorNode:A,data:S}),()=>{const M=p.get(t);M&&M.key===r&&p.delete(t)}),[p,t]);const N=f.useMemo(()=>({role:m,tabIndex:g,"aria-disabled":s,"aria-pressed":x&&m===Vn?!0:void 0,"aria-roledescription":_,"aria-describedby":d.draggable}),[s,m,g,x,_,d.draggable]);return{active:u,activatorEvent:c,activeNodeRect:h,attributes:N,isDragging:x,listeners:s?void 0:k,node:w,over:v,setNodeRef:b,setActivatorNodeRef:C,transform:y}}function Yr(){return f.useContext(Cs)}const Xr="Droppable",qr={timeout:25};function Jr(e){let{data:t,disabled:n=!1,id:s,resizeObserverConfig:o}=e;const r=pt(Xr),{active:a,dispatch:c,over:u,measureDroppableContainers:h}=f.useContext(Ot),d=f.useRef({disabled:n}),p=f.useRef(!1),v=f.useRef(null),m=f.useRef(null),{disabled:_,updateMeasurementsFor:g,timeout:x}={...qr,...o},y=dt(g??s),w=f.useCallback(()=>{if(!p.current){p.current=!0;return}m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{h(Array.isArray(y.current)?y.current:[y.current]),m.current=null},x)},[x]),b=Pt({callback:w,disabled:_||!a}),A=f.useCallback((N,M)=>{b&&(M&&(b.unobserve(M),p.current=!1),N&&b.observe(N))},[b]),[C,k]=It(A),S=dt(t);return f.useEffect(()=>{!b||!C.current||(b.disconnect(),p.current=!1,b.observe(C.current))},[C,b]),f.useEffect(()=>(c({type:W.RegisterDroppable,element:{id:s,key:r,disabled:n,node:C,rect:v,data:S}}),()=>c({type:W.UnregisterDroppable,key:r,id:s})),[s]),f.useEffect(()=>{n!==d.current.disabled&&(c({type:W.SetDroppableDisabled,id:s,key:r,disabled:n}),d.current.disabled=n)},[s,r,n,c]),{active:a,rect:v,isOver:(u==null?void 0:u.id)===s,node:C,over:u,setNodeRef:k}}function js(e,t,n){const s=e.slice();return s.splice(n<0?s.length+n:n,0,s.splice(t,1)[0]),s}function Qr(e,t){return e.reduce((n,s,o)=>{const r=t.get(s);return r&&(n[o]=r),n},Array(e.length))}function St(e){return e!==null&&e>=0}function Zr(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function ei(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const As=e=>{let{rects:t,activeIndex:n,overIndex:s,index:o}=e;const r=js(t,s,n),a=t[o],c=r[o];return!c||!a?null:{x:c.left-a.left,y:c.top-a.top,scaleX:c.width/a.width,scaleY:c.height/a.height}},yt={scaleX:1,scaleY:1},Ns=e=>{var t;let{activeIndex:n,activeNodeRect:s,index:o,rects:r,overIndex:a}=e;const c=(t=r[n])!=null?t:s;if(!c)return null;if(o===n){const h=r[a];return h?{x:0,y:n<a?h.top+h.height-(c.top+c.height):h.top-c.top,...yt}:null}const u=ti(r,o,n);return o>n&&o<=a?{x:0,y:-c.height-u,...yt}:o<n&&o>=a?{x:0,y:c.height+u,...yt}:{x:0,y:0,...yt}};function ti(e,t,n){const s=e[t],o=e[t-1],r=e[t+1];return s?n<t?o?s.top-(o.top+o.height):r?r.top-(s.top+s.height):0:r?r.top-(s.top+s.height):o?s.top-(o.top+o.height):0:0}const Is="Sortable",Bs=f.createContext({activeIndex:-1,containerId:Is,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:As,disabled:{draggable:!1,droppable:!1}});function Es(e){let{children:t,id:n,items:s,strategy:o=As,disabled:r=!1}=e;const{active:a,dragOverlay:c,droppableRects:u,over:h,measureDroppableContainers:d}=Yr(),p=pt(Is,n),v=c.rect!==null,m=f.useMemo(()=>s.map(k=>typeof k=="object"&&"id"in k?k.id:k),[s]),_=a!=null,g=a?m.indexOf(a.id):-1,x=h?m.indexOf(h.id):-1,y=f.useRef(m),w=!Zr(m,y.current),b=x!==-1&&g===-1||w,A=ei(r);be(()=>{w&&_&&d(m)},[w,m,_,d]),f.useEffect(()=>{y.current=m},[m]);const C=f.useMemo(()=>({activeIndex:g,containerId:p,disabled:A,disableTransforms:b,items:m,overIndex:x,useDragOverlay:v,sortedRects:Qr(m,u),strategy:o}),[g,p,A.draggable,A.droppable,b,m,x,u,v,o]);return f.createElement(Bs.Provider,{value:C},t)}const ni=e=>{let{id:t,items:n,activeIndex:s,overIndex:o}=e;return js(n,s,o).indexOf(t)},si=e=>{let{containerId:t,isSorting:n,wasDragging:s,index:o,items:r,newIndex:a,previousItems:c,previousContainerId:u,transition:h}=e;return!h||!s||c!==r&&o===a?!1:n?!0:a!==o&&t===u},oi={duration:200,easing:"ease"},Ds="transform",ri=Ye.Transition.toString({property:Ds,duration:0,easing:"linear"}),ii={roleDescription:"sortable"};function ai(e){let{disabled:t,index:n,node:s,rect:o}=e;const[r,a]=f.useState(null),c=f.useRef(n);return be(()=>{if(!t&&n!==c.current&&s.current){const u=o.current;if(u){const h=Je(s.current,{ignoreTransform:!0}),d={x:u.left-h.left,y:u.top-h.top,scaleX:u.width/h.width,scaleY:u.height/h.height};(d.x||d.y)&&a(d)}}n!==c.current&&(c.current=n)},[t,n,s,o]),f.useEffect(()=>{r&&a(null)},[r]),r}function Ts(e){let{animateLayoutChanges:t=si,attributes:n,disabled:s,data:o,getNewIndex:r=ni,id:a,strategy:c,resizeObserverConfig:u,transition:h=oi}=e;const{items:d,containerId:p,activeIndex:v,disabled:m,disableTransforms:_,sortedRects:g,overIndex:x,useDragOverlay:y,strategy:w}=f.useContext(Bs),b=ci(s,m),A=d.indexOf(a),C=f.useMemo(()=>({sortable:{containerId:p,index:A,items:d},...o}),[p,o,A,d]),k=f.useMemo(()=>d.slice(d.indexOf(a)),[d,a]),{rect:S,node:N,isOver:M,setNodeRef:$}=Jr({id:a,data:C,disabled:b.droppable,resizeObserverConfig:{updateMeasurementsFor:k,...u}}),{active:R,activatorEvent:D,activeNodeRect:P,attributes:T,setNodeRef:z,listeners:X,isDragging:E,over:H,setActivatorNodeRef:re,transform:we}=Gr({id:a,data:C,attributes:{...ii,...n},disabled:b.draggable}),Le=Eo($,z),K=!!R,ie=K&&!_&&St(v)&&St(x),de=!y&&E,Re=de&&ie?we:null,$e=ie?Re??(c??w)({rects:g,activeNodeRect:P,activeIndex:v,overIndex:x,index:A}):null,ke=St(v)&&St(x)?r({id:a,items:d,activeIndex:v,overIndex:x}):A,xe=R==null?void 0:R.id,F=f.useRef({activeId:xe,items:d,newIndex:ke,containerId:p}),Qe=d!==F.current.items,he=t({active:R,containerId:p,isDragging:E,isSorting:K,id:a,index:A,items:d,newIndex:F.current.newIndex,previousItems:F.current.items,previousContainerId:F.current.containerId,transition:h,wasDragging:F.current.activeId!=null}),Fe=ai({disabled:!he,index:A,node:N,rect:S});return f.useEffect(()=>{K&&F.current.newIndex!==ke&&(F.current.newIndex=ke),p!==F.current.containerId&&(F.current.containerId=p),d!==F.current.items&&(F.current.items=d)},[K,ke,p,d]),f.useEffect(()=>{if(xe===F.current.activeId)return;if(xe!=null&&F.current.activeId==null){F.current.activeId=xe;return}const ze=setTimeout(()=>{F.current.activeId=xe},50);return()=>clearTimeout(ze)},[xe]),{active:R,activeIndex:v,attributes:T,data:C,rect:S,index:A,newIndex:ke,items:d,isOver:M,isSorting:K,isDragging:E,listeners:X,node:N,overIndex:x,over:H,setNodeRef:Le,setActivatorNodeRef:re,setDroppableNodeRef:$,setDraggableNodeRef:z,transform:Fe??$e,transition:Se()};function Se(){if(Fe||Qe&&F.current.newIndex===A)return ri;if(!(de&&!bn(D)||!h)&&(K||he))return Ye.Transition.toString({...h,property:Ds})}}function ci(e,t){var n,s;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(s=e==null?void 0:e.droppable)!=null?s:t.droppable}}O.Down,O.Right,O.Up,O.Left;const li="_header_17vny_1",ui="_left_17vny_14",di="_right_17vny_15",_t={header:li,left:ui,right:di},hi="_buttons_12xlr_1",fi="_button_12xlr_1",gi="_disabled_12xlr_20",st={buttons:hi,button:fi,disabled:gi},pi=()=>{const{undo:e,redo:t,past:n,future:s}=l.useHistoryStore(),[o,r]=f.useState(!1),[a,c]=f.useState(!1),[u,h]=f.useState(!1),[d,p]=f.useState(!1),[v,m]=f.useState(null),{notifications:_,setNotifications:g}=l.useNotificationStore();return f.useEffect(()=>{r(n.length===0)},[n]),f.useEffect(()=>{c(s.length===0)},[s]),i.jsxs("div",{className:st.buttons,children:[i.jsxs("div",{className:l.clx(st.button,{[st.disabled]:o}),onMouseEnter:()=>{const x=setTimeout(()=>{p(!0),h(!1)},200);m(x)},onMouseLeave:()=>{v&&clearTimeout(v),p(!1),h(!1)},children:[i.jsx(j.Icon,{name:"ArrowUUpLeft",width:20,height:20,onClick:()=>{o||(e(),g([..._,{id:l.v4(),message:"Changes undone",status:"success"}]))},fill:o?"#757575":"#252525"}),d&&i.jsx(l.Tooltip,{text:o?"Nothing to undo":"Click to undo changes"})]}),i.jsxs("div",{className:l.clx(st.button,{[st.disabled]:a}),onMouseEnter:()=>{const x=setTimeout(()=>{h(!0),p(!1)},200);m(x)},onMouseLeave:()=>{v&&clearTimeout(v),h(!1),p(!1)},children:[i.jsx(j.Icon,{name:"ArrowUUpRight",width:20,height:20,onClick:()=>{a||(t(),g([..._,{id:l.v4(),message:"Changes redone",status:"success"}]))},fill:a?"#757575":"#252525"}),u&&i.jsx(l.Tooltip,{text:a?"Nothing to redo":"Click to redo changes"})]})]})},mi="_devices_vftsw_1",vi="_device_vftsw_1",bi="_active_vftsw_27",un={devices:mi,device:vi,active:bi},xi=()=>i.jsx("div",{className:un.devices,children:l.devices.map(e=>i.jsx(Si,{device:e}))}),Si=e=>{const{device:t}=e,{currentDevice:n,setCurrentDevice:s}=l.useDeviceStore(),[o,r]=f.useState(!1),[a,c]=f.useState(null);return i.jsxs("div",{className:l.clx(un.device,{[un.active]:n.value===t.value}),onClick:()=>s(t),onMouseEnter:()=>{const u=setTimeout(()=>{r(!0)},200);c(u)},onMouseLeave:()=>{a&&clearTimeout(a),r(!1)},children:[i.jsx(j.Icon,{name:t.icon,fill:n.value===t.value?"var(--builder-text-primary)":"var(--builder-text-secondary)",width:20,height:20}),o&&i.jsx(l.Tooltip,{text:`Switch to ${t.value} view`})]},t.value)},yi="_preview_1hcqg_2",_i="_active_1hcqg_19",Kt={preview:yi,active:_i},Ci=()=>{const{onPreview:e}=l.usePreviewStore(),[t,n]=f.useState(!1),[s,o]=f.useState(null);return i.jsxs("a",{href:"/",className:l.clx(Kt.preview,{[Kt.active]:e}),target:"_blank",onMouseEnter:()=>{const r=setTimeout(()=>{n(!0)},200);o(r)},onMouseLeave:()=>{s&&clearTimeout(s),n(!1)},children:[i.jsx(j.Icon,{name:"ArrowUpRight",width:20,height:20}),i.jsx("span",{className:Kt.text,children:"Preview"}),t&&i.jsx(l.Tooltip,{text:"Open draft theme in new tab"})]})},wi="_settings_u4cv4_1",ki={settings:wi},ji="_pages_ws1ac_1",Ai="_text_ws1ac_21",Ni="_modal_ws1ac_27",Ii="_open_ws1ac_46",Bi="_page_ws1ac_1",Ei="_hoverable_ws1ac_61",Di="_separator_ws1ac_65",Ti="_button_ws1ac_70",Mi="_items_ws1ac_85",ae={pages:ji,default:"_default_ws1ac_5",text:Ai,modal:Ni,open:Ii,page:Bi,hoverable:Ei,separator:Di,button:Ti,items:Mi},Ms=async e=>{const t=localStorage.getItem("shopId")||void 0,n=localStorage.getItem("draftId"),o=`${l.useApiStore.getState().apiUrls.api}/v2/builder/shops/${t}/drafts/${n}/pages/${encodeURIComponent(e)}`;return await l.request({url:o,withToken:!0,method:"delete"})},Ri=()=>{const{currentPage:e,setCurrentPage:t,setIsOpenModal:n,pages:s,setIsEdit:o,setEditedPage:r,deletePage:a,setIsOpenSelectModal:c}=l.usePagesStore(),{deletePage:u,setCurrentBlock:h}=l.useLayersStore(),[d,p]=f.useState(null),{setTitle:v,setDescription:m,setOnConfirm:_}=l.useConfirmationModalStore(),[g,x]=f.useState(!1),y=f.useRef(null);j.useOnClickOutside(y,()=>{g&&x(!1)}),f.useEffect(()=>{g?c(!0):setTimeout(()=>{c(!1)},300)},[g]);const w=b=>b?b.replace(/_/g," ").split(" ").map(A=>A.charAt(0).toUpperCase()+A.slice(1)).join(" "):"";return i.jsxs("div",{className:ae.pages,ref:y,children:[i.jsxs("div",{className:ae.default,onClick:b=>{b.stopPropagation(),x(A=>!A)},children:[i.jsx(j.Icon,{name:s&&s[e]&&s[e].icon||"File",fill:"var(--builder-text-primary)",width:20,height:20}),i.jsx("span",{className:ae.text,children:s&&s[e]&&l.defaultPagePaths.includes(s[e].path)?`${w(s[e].name)} page`:s&&s[e]&&s[e].name}),i.jsx("div",{style:{transform:g?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.3s ease",display:"flex"},children:i.jsx(j.Icon,{name:"CaretDown",width:20,height:20})})]}),i.jsxs("div",{className:l.clx(ae.modal,{[ae.open]:g}),onClick:b=>b.stopPropagation(),children:[s&&i.jsx("div",{className:ae.items,children:Object.keys(s).map(b=>{const A=s[b];return i.jsxs("div",{className:l.clx(ae.page,{[ae.hoverable]:d===b}),onMouseEnter:()=>p(b),onMouseLeave:()=>p(null),onClick:()=>{p(null),o(!1),h(null),t(b),x(!1)},children:[i.jsx(j.Icon,{name:A.icon,fill:"#252525"}),i.jsx("span",{className:ae.text,children:l.defaultPagePaths.includes(A.path)?`${w(A.name)} page`:A.name}),d===b&&i.jsxs(i.Fragment,{children:[i.jsx(j.Icon,{name:"Gear",fill:"#757575",onClick:C=>{C.stopPropagation(),o(!0),r(b),n(!0)}}),!l.defaultPagePaths.includes(A.path)&&i.jsx(j.Icon,{name:"Trash",fill:"#C12A2A",onClick:C=>{C.stopPropagation(),v("Delete Page"),m(`Are you sure you want to delete ${A.name||"this"} page? Once you delete this page, any content visible will also be deleted. This is irreversible.`),_(()=>{C.stopPropagation(),s[e].path===A.path&&t(Object.keys(s)[0]),a(b),u(A.name),Ms(A.path)})}})]}),s[e]&&s[e].name===A.name&&i.jsx(j.Icon,{name:"Check",fill:"var(--brand-color)"})]},b)})}),i.jsx("div",{className:ae.separator}),i.jsxs(j.ButtonSettings,{className:ae.button,onClick:b=>{b.stopPropagation(),n(!0)},size:"l",children:[i.jsx(j.Icon,{name:"Plus",fill:"var(--brand-color)"}),i.jsx("span",{children:"Create New Page"})]})]})]})},Pi="_zoom_16goq_1",Kn={zoom:Pi},Oi=()=>{const{zoomLevel:e,setZoomLevel:t}=l.usePreviewStore();return i.jsxs("label",{htmlFor:"zoom",className:Kn.zoom,children:[i.jsx("label",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center"},htmlFor:"zoom",children:i.jsx(j.Icon,{name:"MagnifyingGlassMinus",width:20,height:20})}),i.jsx("input",{id:"zoom",type:"number",min:25,max:250,value:(e*100).toFixed(0),onChange:n=>{const s=Number(n.target.value);t(s/100)},className:Kn.input}),i.jsx("span",{children:"%"})]})},Li=()=>i.jsxs("div",{className:ki.settings,children:[i.jsx(Ri,{}),i.jsx(Oi,{})]}),$i="_theme_8ncc1_1",Fi="_text_8ncc1_13",Gn={theme:$i,text:Fi},zi=()=>i.jsx("div",{className:Gn.theme,children:i.jsx("div",{className:Gn.text,children:"Live Theme"})}),Hi=async(e,t,n)=>{const s=localStorage.getItem("shopId")||void 0,o=localStorage.getItem("draftId"),a=`${l.useApiStore.getState().apiUrls.api}/v2/builder/shops/${s}/drafts/${o}/${t}`;return await l.request({url:a,withToken:!0,method:e,body:n})};function ot(e,t){var n;try{const s=[],o=(a,c)=>{const u=[],h=d=>{if(!(!d||typeof d!="object")){if(Array.isArray(d)){d.forEach(h);return}Object.entries(d).forEach(([p,v])=>{p===c&&u.push(v),v&&typeof v=="object"&&h(v)})}};return h(a),u};for(const a of t){if(!((n=a==null?void 0:a.value)!=null&&n.blockSettings))continue;const c=a.value.blockSettings,u=Object.values(c).filter(d=>d&&d.type===e).flatMap(d=>d.value);s.push(...u);const h=o(c,e);s.push(...h)}let r=s.filter(a=>a!=null).map(a=>e==="ListingIds"?(a==null?void 0:a.listingId)??a:typeof a=="object"&&a!==null&&Object.prototype.hasOwnProperty.call(a,e)?a[e]:a);if(r.length>0)if(typeof r[0]!="object")r=Array.from(new Set(r));else{const a=new Set;r=r.filter(c=>{const u=JSON.stringify(c);return a.has(u)?!1:(a.add(u),!0)})}return r}catch{return[]}}function Wi(e,t,n){return Ui(e,t)?(n.reviews||[]).length*3:0}function Ui(e,t){return t.map(s=>{if(!s.value||!s.value.blockSettings){console.error("block.value or block.value.blockSettings is undefined.");return}return Object.values(s.value.blockSettings).filter(r=>r&&r.type===e).map(r=>{if(r.value===void 0)throw new Error("item.value is undefined.");return r.value}).flat()}).flat().filter(s=>s).length>0}function Vi(e,t){if(t){const n=Object.keys(t).find(s=>t[s].path===e);if(n)return t[n]}return null}const Ki=({setIsLoading:e,isLoading:t})=>{const{themeSettings:n}=l.useThemeSettingsStore(),{settings:s}=l.useSettingsStore(),[o,r]=f.useState(null),[a,c]=f.useState(!1),{setNotifications:u,notifications:h}=l.useNotificationStore(),{header:d,footer:p,announcement:v,blocks:m}=l.useLayersStore(),{pageContext:_}=l.usePagesStore(),{pages:g}=l.usePagesStore(),x=async()=>{if(a)o&&clearTimeout(o);else{e(!0);const w=Object.keys(m).map(C=>{const k=Vi(C,g);return m[C]&&m[C].data&&(k!=null&&k.path)?{id:k?k.id:C,name:k?k.name:C,path:k.path,layout:{...m[C]},neededProductIds:[...ot("ProductId",Object.values(m[C].data))],neededCategoryIds:[...ot("CategoryId",Object.values(m[C].data))],neededAnnouncementIds:[...ot("AnnouncementId",Object.values(m[C].data))],neededListingIds:[...ot("ListingIds",Object.values(m[C].data))],neededFaqIds:[...ot("FaqsIds",Object.values(m[C].data))],neededReviewCount:Wi("ReviewCount",Object.values(m[C].data),_),neededVouchCount:Object.values(m[C].data).some(S=>S.name==="Vouches")?1e3:void 0,includeLiveStats:Object.values(m[C].data).some(S=>S.name==="LiveActivity"),seo:{pageTitle:k&&k.seo&&k.seo.pageTitle?k.seo.pageTitle:"",pageDescription:k&&k.seo&&k.seo.pageDescription?k.seo.pageDescription:""},isPrivate:!!(k&&k.visibility==="private")}:null}).filter(C=>C),b={settings:{...s},header:d,footer:p,announcement:v},{status:A}=await Hi("post","save",{themeSettings:n,settings:b,updatedPages:w});u([...h,{id:l.v4(),message:A===200?"Settings saved":"Error",status:A===200?"success":"error"}]),e(!1)}c(!0);const y=setTimeout(()=>{c(!1)},2e3);r(y)};return i.jsx(j.ButtonSettings,{onClick:x,disabled:t,type:"Primary",children:i.jsx("span",{style:{userSelect:"none"},children:"Save"})})},Gi=()=>{const{isOpenSelectModal:e}=l.usePagesStore(),[t,n]=f.useState(!1),{showTooltip:s}=l.useTooltipStore();return i.jsxs("div",{className:_t.header,style:{zIndex:e?5e4:s?501:50},children:[i.jsxs("div",{className:_t.left,children:[i.jsx(xi,{}),i.jsx(Ci,{})]}),i.jsx("div",{className:_t.center,children:i.jsx(Li,{})}),i.jsxs("div",{className:_t.right,children:[i.jsx(zi,{}),i.jsx(pi,{}),i.jsx(Ki,{setIsLoading:n,isLoading:t}),t&&i.jsx(l.Loader,{})]})]})},Yi="_exit_ovvox_1",Xi="_text_ovvox_11",qi="_exitLink_ovvox_16",Gt={exit:Yi,text:Xi,exitLink:qi},Ji=()=>i.jsx("div",{className:Gt.exit,children:i.jsxs("a",{href:location.origin,className:Gt.exitLink,children:[i.jsx(j.Icon,{name:"SignOut",width:20,height:20}),i.jsx("span",{className:Gt.text,children:"Exit"})]})}),Qi="_navbar_1lnmu_1",Zi="_main_1lnmu_8",ea="_block_1lnmu_15",ta="_active_1lnmu_31",Ct={navbar:Qi,main:Zi,block:ea,active:ta},na=()=>{const{activeBlock:e}=l.useNavbarStore(),{setActiveBlock:t}=l.useBlocksStore(),{setCurrentBlock:n}=l.useLayersStore(),{setActiveBlock:s}=l.useThemeSettingsStore(),{setActiveBlock:o}=l.usePreviewStore(),r=l.useNavigate();function a(c){switch(t(null),n(null),s(null),o({id:null,neededScroll:!1}),c.name){case"Layers":r("/admin/builder");break;case"Add":r("/admin/builder/add");break;case"Theme":r("/admin/builder/theme");break;case"Settings":r("/admin/builder/settings");break}}return i.jsxs("div",{className:Ct.navbar,children:[i.jsx(Ji,{}),i.jsx("div",{className:Ct.main,children:l.navbarBlocks.map(c=>i.jsxs("div",{className:l.clx(Ct.block,{[Ct.active]:e.icon===c.icon}),onClick:()=>a(c),children:[i.jsx(j.Icon,{name:c.icon,fill:e.icon===c.icon?"var(--builder-text-primary)":"var(--builder-text-secondary)"}),i.jsx("span",{children:c.name})]},c.icon))})]})},sa="_preview_ltg9y_1",oa="_main_ltg9y_15",ra="_content_ltg9y_25",ia="_loading_ltg9y_34",aa="_previewLoading_ltg9y_65",rt={preview:sa,main:oa,content:ra,loading:ia,previewLoading:aa},ca="_header_17siy_2",la="_circles_17siy_16",ua="_circle_17siy_16",da="_red_17siy_32",ha="_green_17siy_36",fa="_yellow_17siy_40",ga="_input_17siy_44",pa="_main_17siy_55",ma="_text_17siy_63",va="_copy_17siy_75",pe={header:ca,circles:la,circle:ua,red:da,green:ha,yellow:fa,input:ga,main:pa,text:ma,copy:va},ba=["red","yellow","green"],xa=()=>{const{currentDevice:e}=l.useDeviceStore(),t=(o,r)=>o.length>r?o.slice(0,r)+"...":o,{notifications:n,setNotifications:s}=l.useNotificationStore();return i.jsxs("div",{className:pe.header,children:[i.jsx("div",{className:pe.circles,children:ba.map(o=>i.jsx("div",{className:l.clx(pe.circle,{[pe.red]:o==="red",[pe.yellow]:o==="yellow",[pe.green]:o==="green"})},o))}),i.jsx("div",{className:pe.input,children:i.jsxs("div",{className:pe.main,children:[i.jsx(j.Icon,{name:"Lock",fill:"#757575",width:15,height:16}),i.jsx("span",{className:pe.text,children:e.value==="mobile"?t(window.location.origin,35):e.value==="desktop"?t(window.location.origin,200):t(window.location.origin,100)})]})}),i.jsx(j.ButtonSettings,{type:"Secondary",style:{padding:"8px"},onClick:()=>{navigator.clipboard.writeText(window.location.origin),s([...n,{id:l.v4(),status:"success",message:"Domain copied to clipboard"}])},className:pe.copy,children:i.jsx(j.Icon,{name:"Copy",width:20,height:20,fill:"#252525"})})]})},Sa="_content_s4v4v_1",ya="_main_s4v4v_12",_a="_block_s4v4v_16",Ca="_active_s4v4v_22",wa="_name_s4v4v_32",ka="_addSection_s4v4v_109",ja="_addSectionTop_s4v4v_117",Ee={content:Sa,main:ya,block:_a,active:Ca,name:wa,addSection:ka,addSectionTop:ja},Aa="_sidebar_p1ojw_1",Na="_content_p1ojw_14",Ia="_button_p1ojw_24",Ba="_moveButton_p1ojw_40",Ea="_deleteButton_p1ojw_49",me={sidebar:Aa,content:Na,button:Ia,moveButton:Ba,deleteButton:Ea},Da=()=>{var C;const{activeBlock:e,setActiveBlock:t}=l.usePreviewStore(),{blocks:n,removeBlock:s,moveBlock:o,duplicateBlock:r,setCurrentBlock:a}=l.useLayersStore(),{currentPage:c,pages:u}=l.usePagesStore(),{setTitle:h,setDescription:d,setOnConfirm:p}=l.useConfirmationModalStore(),{setActiveBlock:v}=l.useBlocksStore(),m=(C=u==null?void 0:u[c])==null?void 0:C.path,_=m?n[m]:null,g=(_==null?void 0:_.order)||[],x=g.indexOf(e.id),y=k=>{k.stopPropagation(),x>0&&m&&(o(m,x,x-1),t({id:e.id,neededScroll:!0}),setTimeout(()=>{t({id:e.id,neededScroll:!1})},100))},w=k=>{k.stopPropagation(),x<g.length-1&&m&&(o(m,x,x+1),t({id:e.id,neededScroll:!0}),setTimeout(()=>{t({id:e.id,neededScroll:!1})},100))},b=k=>{k.stopPropagation(),m&&r(m,e.id)},A=()=>{m&&(s(m,e.id),a(null),v(null),t({id:null,neededScroll:!1}))};return i.jsx("div",{className:me.sidebar,children:i.jsxs("div",{className:me.content,children:[i.jsx("button",{onClick:y,className:l.clx(me.button,me.moveButton),disabled:x===0,children:i.jsx(j.Icon,{name:"ArrowUp"})}),i.jsx("button",{onClick:w,className:l.clx(me.button,me.moveButton),disabled:x===g.length-1,children:i.jsx(j.Icon,{name:"ArrowDown"})}),i.jsx("button",{onClick:b,className:l.clx(me.button,me.moveButton),children:i.jsx(j.Icon,{name:"Copy"})}),i.jsx("button",{className:l.clx(me.button,me.deleteButton),onClick:k=>{k.stopPropagation(),h("Remove Block"),d(`Are you sure you want to delete ${(_==null?void 0:_.data[e.id].name)||"this"} block? Once you delete this block, any content visible will also be deleted. This is irreversible.`),p(A)},children:i.jsx(j.Icon,{name:"Trash",hoverable:!0,fill:"#C12A2A"})})]})})},Ta=f.memo(({scrollableRef:e})=>{const{setActiveBlock:t,activeBlock:n,zoomLevel:s}=l.usePreviewStore(),{blocks:o,sourceBlocks:r}=l.useBlocksStore(),{blocks:a,setCurrentBlock:c,currentBlock:u,setPositionBlock:h,announcement:d}=l.useLayersStore(),{settings:p}=l.useSettingsStore(),{currentPage:v,pages:m,pageContext:_}=l.usePagesStore(),{activeBlock:g,setActiveBlock:x}=l.useThemeSettingsStore(),{setError:y}=l.useErrorStore(),{setActiveBlock:w}=l.useBlocksStore(),b=f.useRef(n.id),A=f.useRef({});f.useEffect(()=>{if(n.id&&n.neededScroll&&A.current[n.id]){const S=A.current[n.id];if(S&&e.current){const N=S.offsetTop;e.current.scrollTo({top:N-30,behavior:"smooth"})}}},[n,e]);const C=l.useNavigate();f.useEffect(()=>{b.current=n.id},[n.id]);const k=S=>{if(!S||!S.name)return y({message:"Block or block.name is undefined.",failedSettings:!1,failedThemeSettings:!1,failedPageIds:m&&m[v].id?[m[v].id]:[]}),i.jsx(j.ErrorableBlock,{error:"Block or block.name is undefined."});if(!o||!o[S.name])return y({message:'Block "${block.name}" does not exist in blocks.',failedSettings:!1,failedThemeSettings:!1,failedPageIds:m&&m[v].id?[m[v].id]:[]}),i.jsx(j.ErrorableBlock,{error:`Block "${S.name}" does not exist in blocks.`});const N=new o[S.name];return S.value&&Object.assign(N,S.value),N.renderBlock(p,_)};return i.jsxs("div",{onClick:S=>{S.stopPropagation()},className:Ee.content,style:{width:"100%",height:"100%",zoom:`${s}`},ref:e,children:[d&&i.jsx(fn,{}),i.jsx(hn,{}),i.jsx("div",{className:Ee.main,children:m&&m[v]&&a[m[v].path]&&a[m[v].path].data&&a[m[v].path].order.map(S=>i.jsxs("div",{ref:N=>A.current[S]=N,onClick:N=>{N.stopPropagation(),w(null),g&&x(null),t({id:S,neededScroll:!0}),setTimeout(()=>{t({id:S,neededScroll:!1})},100),c(null),u?setTimeout(()=>{c(n.id)},100):c(n.id)},onMouseEnter:N=>{N.stopPropagation(),n.neededScroll||t({id:S,neededScroll:!1})},onMouseLeave:N=>{N.stopPropagation(),n.neededScroll||t({id:null,neededScroll:!1})},className:l.clx(Ee.block),children:[(n.id===S||u===S)&&i.jsx("div",{className:Ee.active}),(n.id===S||u===S)&&i.jsx("div",{className:Ee.name,children:l.getDisplayName(a[m[v].path].data[S].name,r)}),(n.id===S||u===S)&&l.getDisplayName(a[m[v].path].data[S].name,r)!=="unknown name"&&i.jsx(Da,{}),(n.id===S||u===S)&&l.getDisplayName(a[m[v].path].data[S].name,r)!=="unknown name"&&i.jsx("div",{className:Ee.addSection,children:i.jsx(j.ButtonSettings,{type:"Primary",onClick:N=>{N.stopPropagation(),h(S,!0),c(null),t({id:null,neededScroll:!1}),w(null),C("/admin/builder/add")},children:"Add Section"})}),(n.id===S||u===S)&&l.getDisplayName(a[m[v].path].data[S].name,r)!=="unknown name"&&i.jsx("div",{className:l.clx(Ee.addSection,Ee.addSectionTop),children:i.jsx(j.ButtonSettings,{type:"Primary",onClick:N=>{N.stopPropagation(),h(S,!1),c(null),t({id:null,neededScroll:!1}),w(null),C("/admin/builder/add")},children:"Add Section"})}),o&&i.jsx(Tt,{render:k,block:a[m[v].path].data[S]})]},S))}),i.jsx(dn,{})]})}),Ma="_results_1pahy_1",Yn={results:Ma};function Ra(e,t){return t?new t[e]().blockSettings.isAddable:!1}function Xn(e,t){return e?Object.keys(e||{}).reduce((n,s)=>(Ra(s,t)&&n.push({name:s,displayName:l.getDisplayName(s,t)}),n),[]):[]}const Pa="_product_wgb53_1",Oa="_name_wgb53_15",Yt={product:Pa,name:Oa},La=e=>{const{blockId:t,setSearchValue:n}=e,{sourceBlocks:s,setActiveBlock:o}=l.useBlocksStore(),{hideModal:r,hoverBlockId:a,isModalVisible:c,showPreview:u,hidePreview:h,clearHideTimeout:d,startHideTimeout:p,setHoverBlockTopPosition:v}=l.useSubmodalStore();function m(x){n(""),o(x),r("keyBlock")}function _(x,y){const w=window.innerHeight,b=400,A=10;let C=y.clientY-120;C+b>w&&(C=w-b-A),C<A&&(C=A),a||r("keyBlock"),u(x,"keyBlock"),d(),v(C)}function g(){c?p("keyBlock"):h("keyBlock"),v(null)}return i.jsxs("div",{className:Yt.product,onClick:()=>m(t),onMouseEnter:x=>_(t,x),onMouseLeave:g,children:[(()=>{const x=l.blockIcons[t];return x?i.jsx(x,{className:Yt.icon}):i.jsx(j.Icon,{name:"Cards"})})(),i.jsx("span",{className:Yt.name,children:l.getDisplayName(t,s)}),i.jsx(j.Icon,{name:"CaretRight",width:20,height:20})]},t)},Rs=()=>{const{blocks:e,sourceBlocks:t}=l.useBlocksStore(),[n,s]=f.useState(""),[o,r]=f.useState([]),a=f.useMemo(()=>Xn(e,t),[e,t]),c=f.useMemo(()=>new Oe(a,{keys:["displayName"],threshold:.4}),[a]);return f.useEffect(()=>{if(n.trim()==="")r(Xn(e,t));else{const u=c.search(n);r(u.map(h=>h.item))}},[n,c]),i.jsxs(i.Fragment,{children:[i.jsx(j.InputSettings,{type:"text",placeholder:"Search for sections",isSearch:!0,onChange:s,value:n,style:{marginBottom:10}}),i.jsx("div",{className:Yn.results,children:o.length>0?o.map(u=>i.jsx(La,{blockId:u.name,setSearchValue:s})):i.jsx("div",{className:Yn.noResults,children:"No sections found"})})]})},$a=()=>{const{onPreview:e,zoomLevel:t}=l.usePreviewStore(),{keyBlock:n,hoverBlockId:s,isModalVisible:o,hoverBlockTopPosition:r}=l.useSubmodalStore(),{settings:a}=l.useSettingsStore(),{sourceBlocks:c}=l.useBlocksStore(),{pageContext:u}=l.usePagesStore(),{showModal:h}=l.useColorPickerStore(),{currentDevice:d}=l.useDeviceStore(),{isLoadingThemeSettings:p}=l.useThemeSettingsStore(),{isLoadingLayers:v}=l.useLayersStore(),m=b=>b?!c||!c[b]?i.jsx(j.ErrorableBlock,{error:`Block "${b}" does not exist in blocks.`}):new c[b]().renderPreview(a,u):i.jsx(j.ErrorableBlock,{error:"Block or block.name is undefined."});function _(){if(d.value==="desktop")return t>=1?"100%":`${(t*100).toFixed(2)}%`;{const b=d.value==="tablet"?768:425;return t>=1?`${b}px`:`${(b*t).toFixed(2)}px`}}function g(){switch(d.value){case"desktop":return"100%";case"tablet":return 768;case"mobile":return 425;default:return"100%"}}const{isOpenSelectModal:x}=l.usePagesStore(),y=f.useRef(null),w=b=>{y.current&&(y.current.scrollTop+=b.deltaY)};return i.jsxs("div",{className:rt.preview,style:{zIndex:h&&!x?5e3:500},onWheel:b=>{b.stopPropagation(),w(b)},children:[o&&i.jsx(l.AddSectionSubmodal,{children:i.jsx(Rs,{})}),i.jsxs(l.Submodal,{positionTop:r,positionLeft:!s&&n?void 0:250,children:[!p&&!v&&i.jsx(Tt,{render:m,block:n},n),(p||!n||v)&&i.jsx("div",{className:rt.previewLoading,children:i.jsx(l.Loader,{})})]}),h&&i.jsx(l.ColorPickerModal,{}),e&&i.jsxs("div",{className:rt.main,style:{width:g()},children:[i.jsx(xa,{}),i.jsx("div",{style:{borderLeft:_()==="100%"?"none":"var(--default-border)",borderRight:_()==="100%"?"none":"var(--default-border)",width:"100%",display:"flex",flexDirection:"column",alignItems:"center",height:"calc(100vh - 160px)",overflowY:"scroll",overflowX:"hidden"},onScroll:b=>{b.stopPropagation()},onWheel:b=>{b.stopPropagation()},children:!p&&!v?i.jsx("div",{className:rt.content,style:{width:_()},children:i.jsx(Ta,{scrollableRef:y})}):i.jsx("div",{className:rt.loading,children:i.jsx(l.Loader,{})})})]})]})},Fa="_sidebar_zs8s9_1",za="_title_zs8s9_13",qn={sidebar:Fa,title:za},Ha="_layers_1ai1e_1",Wa="_wrapper_1ai1e_10",Ua="_draggingWrapper_1ai1e_18",Va="_block_1ai1e_22",Ka="_dragging_1ai1e_18",Ga="_active_1ai1e_57",Ya="_add_1ai1e_64",Xa="_addTop_1ai1e_80",qa="_visible_1ai1e_96",Ja="_button_1ai1e_100",Qa="_nameBlock_1ai1e_159",Za="_loader_1ai1e_163",ec="_actions_1ai1e_172",tc="_deleteButton_1ai1e_180",Y={layers:Ha,wrapper:Wa,draggingWrapper:Ua,block:Va,dragging:Ka,active:Ga,add:Ya,addTop:Xa,visible:qa,button:Ja,nameBlock:Qa,loader:Za,actions:ec,deleteButton:tc},nc="_block_owmqd_1",sc="_title_owmqd_17",oc="_actions_owmqd_21",De={block:nc,title:sc,actions:oc},Jn={header:"Header",footer:"Footer",announcement:"Announcement"},Xt=({id:e})=>{const{setCurrentBlock:t}=l.useLayersStore(),{activeBlock:n}=l.usePreviewStore(),[s,o]=f.useState(!1);function r(a){t(a)}return i.jsxs("div",{className:l.clx(De.block,{[De.active]:n.id===e,[De.header]:e==="header",[De.footer]:e==="footer",[De.announcement]:e==="announcement"}),onClick:()=>r(e),onMouseOver:()=>o(!0),onMouseLeave:()=>o(!1),children:[(()=>{const a=l.blockIcons[Jn[e]];return a?i.jsx(a,{width:20,height:20,className:De.icon}):i.jsx(j.Icon,{name:"Cards",width:20,height:20})})(),i.jsx("span",{className:De.title,children:Jn[e]}),i.jsx("div",{className:De.actions,children:i.jsx(j.Icon,{name:"PushPin",hoverable:!0,width:20,height:20,fill:"var(--builder-text-secondary)"})})]})},rc=({id:e,name:t,onClick:n,isDragging:s,icon:o})=>{const{activeBlock:r,setActiveBlock:a}=l.usePreviewStore(),{showPreview:c,hidePreview:u,showModal:h,hideModal:d,clearHideTimeout:p,startHideTimeout:v,hoverBlockId:m,isModalVisible:_}=l.useSubmodalStore(),{setPositionBlock:g}=l.useLayersStore(),[x,y]=f.useState(!1),[w,b]=f.useState(!1),[A,C]=f.useState(!1),[k,S]=f.useState(!1),[N,M]=f.useState(null),$=f.useRef(null),{attributes:R,listeners:D,setNodeRef:P,transform:T,transition:z}=Ts({id:e}),X={transform:Ye.Transform.toString(T),transition:z},{setTitle:E,setDescription:H,setOnConfirm:re}=l.useConfirmationModalStore(),{pages:we,currentPage:Le}=l.usePagesStore(),{removeBlock:K}=l.useLayersStore(),ie=L=>{L.stopPropagation(),$.current&&clearTimeout($.current),a({id:e,neededScroll:!0}),_&&d(),c(e),p()},de=(L,$e=!0)=>{L.stopPropagation(),u(),h(e),p(),g(e,$e)},Re=L=>{L.stopPropagation(),a({id:null,neededScroll:!1}),_?v():u()};return f.useEffect(()=>{C(!1),y(!1),b(!1),S(!1)},[s]),f.useEffect(()=>{_||(b(!1),y(!1))},[_]),i.jsxs("div",{ref:P,style:X,className:l.clx(Y.wrapper,{[Y.draggingWrapper]:s&&r.id===e}),onClick:L=>{L.stopPropagation(),n(e)},onMouseEnter:ie,onMouseLeave:Re,...R,...D,children:[i.jsxs("div",{className:l.clx(Y.block,{[Y.dragging]:s&&r.id===e,[Y.active]:!s&&r.id===e}),children:[o?i.jsx(o,{width:20,height:20}):i.jsx(j.Icon,{name:"Cards",width:20,height:20}),i.jsx("span",{className:Y.nameBlock,children:t}),m===e&&!s&&i.jsx("div",{className:l.clx(Y.addTop,{[Y.visible]:w}),onMouseEnter:()=>{b(!0)},onMouseLeave:()=>{b(!1)},children:i.jsxs("button",{className:Y.button,onClick:L=>de(L,!1),onMouseEnter:()=>{const L=setTimeout(()=>{s||S(!0)},200);M(L)},onMouseLeave:()=>{N&&clearTimeout(N),S(!1)},children:[i.jsx(j.Icon,{name:"Plus",fill:"#fff"}),k&&i.jsx(l.Tooltip,{text:"Click to add a section"})]})}),m===e&&!s&&i.jsx("div",{className:l.clx(Y.add,{[Y.visible]:x}),onMouseEnter:()=>{y(!0)},onMouseLeave:()=>{y(!1)},children:i.jsxs("button",{className:Y.button,onClick:L=>de(L),onMouseEnter:()=>{const L=setTimeout(()=>{s||C(!0)},200);M(L)},onMouseLeave:()=>{N&&clearTimeout(N),C(!1)},children:[i.jsx(j.Icon,{name:"Plus",fill:"#fff"}),A&&i.jsx(l.Tooltip,{text:"Click to add a section"})]})})]}),m===e&&!s&&i.jsxs("div",{className:Y.actions,children:[i.jsx(j.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20}),i.jsx("div",{className:Y.deleteButton,onClick:L=>{L.stopPropagation(),E("Remove Block"),H(`Are you sure you want to delete ${t||"this"} block? Once you delete this block, any content visible will also be deleted. This is irreversible.`),re(()=>{we&&K(we[Le].path,e)})},children:i.jsx(j.Icon,{name:"Trash",fill:"#C12A2A",hoverable:!0,width:20,height:20})})]})]})},ic=()=>{const{blocks:e,setCurrentBlock:t,currentBlock:n,moveBlock:s,isLoadingLayers:o,announcement:r}=l.useLayersStore(),{currentPage:a,pages:c}=l.usePagesStore(),{setMouseOverModal:u,setHoverBlockId:h}=l.useSubmodalStore(),{sourceBlocks:d}=l.useBlocksStore();function p(y){t(y),u(!1),h(null)}const v=ds(us(Rt,{activationConstraint:{distance:5}})),[m,_]=f.useState(!1),g=()=>{_(!0)},x=y=>{_(!1);const{active:w,over:b}=y;if(b&&w.id!==b.id&&c&&c[a]){const A=c[a].path,C=e[A].order,k=C.indexOf(w.id),S=C.indexOf(b.id);k!==-1&&S!==-1&&s(A,k,S)}};return i.jsx("div",{className:Y.layers,children:o?i.jsx("div",{className:Y.loader,children:i.jsx(l.Loader,{})}):i.jsxs(i.Fragment,{children:[r&&i.jsx(Xt,{id:"announcement"}),i.jsx(Xt,{id:"header"}),!n&&i.jsx(ks,{sensors:v,onDragEnd:x,onDragStart:g,children:c&&c[a]&&e[c[a].path]&&i.jsx(Es,{items:e[c[a].path].order,strategy:Ns,children:e[c[a].path].order.map((y,w)=>i.jsx(rc,{id:y,name:l.getDisplayName(e[c[a].path].data[y].name,d),index:w,onClick:p,isDragging:m,icon:l.blockIcons[e[c[a].path].data[y].name]},y))})}),i.jsx(Xt,{id:"footer"})]})})},ac="_loader_eyvkk_1",cc={loader:ac},lc=()=>{const{isLoadingSettings:e}=l.useSettingsStore();return e?i.jsx("div",{className:cc.loader,children:i.jsx(l.Loader,{})}):i.jsx(uc,{})},uc=()=>{const{settings:e}=l.useSettingsStore(),{settings:t,setSettingsInstance:n}=l.useBlocksStore();if(!e)return null;const{setError:s}=l.useErrorStore(),o=new t(e);f.useEffect(()=>{n(o)},[e]);try{return o.renderSettings()}catch(r){throw console.error("Error rendering settings:",r),s({message:"Error rendering settings",failedPageIds:[],failedThemeSettings:!1,failedSettings:!0}),r}},dc="_theme_8b5no_1",hc="_block_8b5no_9",fc="_name_8b5no_24",gc="_loader_8b5no_28",wt={theme:dc,block:hc,name:fc,loader:gc},pc=()=>{const e=l.useNavigate(),{isAntistock:t}=l.useGeneralStore(),{isLoadingThemeSettings:n,setActiveBlock:s}=l.useThemeSettingsStore(),o=[{icon:"PaintBrushBroad",name:"Colors"},{icon:"TextAa",name:"Fonts"},{icon:"CornersOut",name:"Borders"},{icon:"ArrowSquareIn",name:"Buttons"}];function r(a){switch(a==null?void 0:a.name){case"Colors":e("/admin/builder/theme/colors"),s(l.themeSettingsBlocks[0]);break;case"Fonts":e("/admin/builder/theme/fonts"),s(l.themeSettingsBlocks[1]);break;case"Borders":e("/admin/builder/theme/borders"),s(l.themeSettingsBlocks[2]);break;case"Buttons":e("/admin/builder/theme/buttons"),s(l.themeSettingsBlocks[3]);break;case"Inputs":e("/admin/builder/theme/inputs"),s(l.themeSettingsBlocks[4]);break}}return i.jsx("div",{className:wt.theme,children:n?i.jsx("div",{className:wt.loader,children:i.jsx(l.Loader,{})}):(t?o:l.themeSettingsBlocks).map(a=>i.jsxs("div",{onClick:()=>r(a),className:l.clx(wt.block),children:[i.jsx(j.Icon,{name:a.icon}),i.jsx("span",{className:wt.name,children:a.name}),i.jsx(j.Icon,{name:"CaretRight"})]},a.icon))})},mc="_render_1k1k0_9",vc="_open_1k1k0_24",bc="_close_1k1k0_51",xc="_clicked_1k1k0_55",Sc="_loading_1k1k0_72",yc="_settings_1k1k0_76",Ke={render:mc,open:vc,close:bc,clicked:xc,loading:Sc,settings:yc},_c=({block:e})=>{const{pageContext:t}=l.usePagesStore(),{setError:n}=l.useErrorStore();try{return e.renderSettings(t)}catch(s){throw console.error("Error rendering settings:",s),n({message:"Error rendering block settings",failedPageIds:[],failedThemeSettings:!1,failedSettings:!0}),s}},Cc="_wrapper_1xfvz_1",wc="_header_1xfvz_8",kc="_title_1xfvz_15",jc="_colorWrapper_1xfvz_21",Ac="_name_1xfvz_35",Nc="_color_1xfvz_21",Ic="_value_1xfvz_47",Bc="_length_1xfvz_51",se={wrapper:Cc,header:wc,title:kc,colorWrapper:jc,name:Ac,color:Nc,value:Ic,length:Bc},Ec=e=>{const{colors:t}=e,{themeSettings:n}=l.useThemeSettingsStore(),[s,o]=f.useState(!0);f.useEffect(()=>{t.length<=3&&o(!0)},[]);function r(a){const c=a.replace("--",""),[u,h]=c.split("-"),d=`${h.charAt(0).toUpperCase()+h.slice(1)} ${u.charAt(0).toUpperCase()+u.slice(1)}`,[p,v]=c.split("-");return{name:d,field:p,variable:v}}return i.jsxs("div",{className:se.wrapper,children:[i.jsxs("div",{className:se.header,children:[i.jsx("div",{className:se.title,children:"Section Colors"}),!s&&i.jsxs("div",{className:l.clx(se.value,se.length),onClick:()=>o(!0),children:["+",t.length]})]}),s&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:se.colors,children:t.map(a=>{const c=r(a),{variable:u,name:h,field:d}=c;return i.jsx(Dc,{color:n.colors[d][u],name:h})})}),t.length>3&&i.jsxs("div",{className:l.clx(se.value,se.length),onClick:()=>o(!1),children:["Hide ",t.length," colors"]})]})]})},Dc=e=>{const{name:t,color:n}=e,{setActiveLabel:s,setModalPosition:o,setInitialColor:r,setShowModal:a,setUpdate:c,setColor:u,setColorChange:h,colorChange:d,setIsGradientActive:p,setIsBlockSettings:v}=l.useColorPickerStore(),{updateColor:m}=l.useThemeSettingsStore(),_=(y,w)=>b=>{m(y,w,b)};f.useEffect(()=>{const y=()=>{a(!1),s(null),r(n),c(()=>{}),u(n),h(()=>{})};return document.body.addEventListener("click",y),()=>{document.body.removeEventListener("click",y)}},[]);const g=y=>{const w=t.split("/")[0],b=w.split(" ")[0].toLowerCase(),A=w.split(" ")[1].toLowerCase();y.stopPropagation(),a(!0),h(d),c(S=>_(A,b)(S)),r(n),u(n),v(!0),p(A==="surface");const{top:C,left:k}=l.getModalPosition(y,550,288,10,20,230,80);o({top:A==="surface"?C:C+125,left:k-200})};function x(y){return y.length>15?y.slice(0,15)+"...":y}return i.jsxs("div",{className:se.colorWrapper,onClick:g,children:[i.jsx("div",{className:se.color,style:{background:n}}),i.jsx("div",{className:se.name,children:t}),i.jsx("div",{className:se.value,children:x(n)})]})},Tc="_back_1rhiq_1",Mc="_title_1rhiq_9",Rc="_deleteButton_1rhiq_17",Pc="_backIcon_1rhiq_30",kt={back:Tc,title:Mc,deleteButton:Rc,backIcon:Pc},Oc=({onClick:e,setIsClicked:t,getDisplayName:n})=>{var v,m;const{activeBlock:s}=l.useBlocksStore(),{setTitle:o,setDescription:r,setOnConfirm:a}=l.useConfirmationModalStore(),{blocks:c,currentBlock:u,removeBlock:h}=l.useLayersStore(),{currentPage:d,pages:p}=l.usePagesStore();return i.jsxs("div",{className:kt.back,children:[i.jsx("div",{className:kt.backIcon,onClick:()=>e(),children:i.jsx(j.Icon,{name:"CaretLeft",hoverable:!0,width:20,height:20})}),i.jsx("h3",{className:kt.title,children:s&&n(s)||p&&p[d]&&c[p[d].path]&&u&&n((v=c[p[d].path].data[u])==null?void 0:v.name)||u&&l.formatLabel(u)||"Loading"}),u&&p&&!["header","footer","announcement"].includes(u)&&c[p[d].path].data[u]&&n((m=c[p[d].path].data[u])==null?void 0:m.name)!=="unknown name"&&i.jsx("button",{onClick:_=>{var g;_.stopPropagation(),o("Remove Block"),r(`Are you sure you want to delete ${n((g=c[p[d].path].data[u])==null?void 0:g.name)||"this"} block? Once you delete this block, any content visible will also be deleted. This is irreversible.`),a(()=>{t(!0),h(p[d].path,u),e(!0)})},className:kt.deleteButton,children:i.jsx(j.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A"})})]})},Lc=()=>{const e=l.useNavigate(),[t,n]=f.useState(!1),{header:s,footer:o,announcement:r,sourceBlocks:a,activeBlock:c,setActiveBlock:u,currentInstance:h,setCurrentInstance:d}=l.useBlocksStore(),{setActiveBlock:p}=l.usePreviewStore(),{blocks:v,addBlock:m,editBlock:_,currentBlock:g,setCurrentBlock:x,header:y,footer:w,announcement:b,isLoadingLayers:A}=l.useLayersStore(),{currentPage:C,pages:k}=l.usePagesStore(),{past:S,future:N}=l.useHistoryStore();function M(D=!1){if(k&&h&&g&&!["header","footer","announcement"].includes(g)&&!D){const P={blockSettings:{}};Object.keys(h.blockSettings).filter(T=>!["displayName","isAddable"].includes(T)).map(T=>{P.blockSettings[T]=h.blockSettings[T]}),_(k[C].path,g,{name:v[k[C].path].data[g].name,value:P})}u(null),x(null),p({id:null,neededScroll:!1}),setTimeout(()=>{n(!1)},150),d(null)}function $(D){var X;if(!k||!C||!D)return null;if(D==="header"){const E=new s;return Object.keys(E.blockSettings).forEach(H=>{E.blockSettings[H]=y==null?void 0:y.blockSettings[H]}),Object.keys(E.blockColors).forEach(H=>{E.blockColors[H]=y==null?void 0:y.blockColors[H]}),E}if(D==="footer"){const E=new o;return Object.keys(E.blockSettings).forEach(H=>{E.blockSettings[H]=w==null?void 0:w.blockSettings[H]}),Object.keys(E.blockColors).forEach(H=>{E.blockColors[H]=w==null?void 0:w.blockColors[H]}),E}if(D==="announcement"){const E=new r;return Object.keys(E.blockSettings).forEach(H=>{E.blockSettings[H]=b==null?void 0:b.blockSettings[H]}),Object.keys(E.blockColors).forEach(H=>{E.blockColors[H]=b==null?void 0:b.blockColors[H]}),E}const P=v[k[C].path];if(!P||!P.data[D])return null;const T=P.data[D];return!T||!a[T.name]?null:new a[T.name]((X=T.value)==null?void 0:X.blockSettings)}f.useEffect(()=>{if(g){const D=$(g);d(D)}else d(null)},[g,S,N,c]),f.useEffect(()=>{if(c&&k&&!g){const D={blockSettings:{},blockColors:{}},P=new a[c];d(P),Object.keys(P.blockSettings).filter(z=>!["displayName","isAddable"].includes(z)).map(z=>{D.blockSettings[z]=P.blockSettings[z]}),Object.keys(P.blockColors).filter(z=>!["displayName","isAddable"].includes(z)).map(z=>{D.blockColors[z]=P.blockColors[z]});const T=m(k[C].path,{name:c,value:D});p({id:T,neededScroll:!0}),x(T),e("/admin/builder")}},[c,S,N]);function R(D){if(!a)return"unknown name";if(!a[D])return g==="header"?y==null?void 0:y.blockSettings.displayName:g==="footer"?w==null?void 0:w.blockSettings.displayName:g==="announcement"?b==null?void 0:b.blockSettings.displayName:"unknown name";const P=new a[D];return!P.blockSettings||!P.blockSettings.displayName?"unknown name":P.blockSettings.displayName}return i.jsxs("div",{className:l.clx(Ke.render,{[Ke.open]:g,[Ke.close]:!g,[Ke.clicked]:t}),onClick:D=>D.stopPropagation(),style:{opacity:A?0:1},children:[i.jsx(Oc,{onClick:M,setIsClicked:n,getDisplayName:R}),i.jsxs("div",{className:Ke.settings,children:[h&&i.jsxs(i.Fragment,{children:[i.jsx(_c,{block:h}),i.jsx(Ec,{colors:h.blockColors})]}),!c&&!g&&i.jsx("div",{className:Ke.loading,children:"Loading"})]})]})},$c="_header_1u3yu_1",Fc="_title_1u3yu_9",zc="_backIcon_1u3yu_15",qt={header:$c,title:Fc,backIcon:zc},mt=({onClick:e,title:t})=>i.jsxs("div",{className:qt.header,children:[i.jsx("div",{className:qt.backIcon,onClick:e,children:i.jsx(j.Icon,{name:"CaretLeft",hoverable:!0,width:20,height:20})}),i.jsx("span",{className:qt.title,children:t})]}),Hc="_options_ymds7_1",Wc={options:Hc},Uc=()=>{var h,d;const{activeBlock:e,themeSettings:t,updateBorder:n,setActiveBlock:s}=l.useThemeSettingsStore();function o(p,v){n(v,p)}const r=l.useNavigate();function a(){s(null),r("/admin/builder/theme")}const c=f.useMemo(()=>t.borders,[t]),u=(e==null?void 0:e.name)==="Borders";return i.jsxs(l.AnimatedPanel,{isOpen:u,isClose:!u,children:[i.jsx(mt,{onClick:a,title:"Borders Style"}),i.jsxs("div",{className:Wc.options,children:[i.jsx(j.SelectSettings,{label:"Border Radius (px)",options:Object.keys(l.RadiusVariables),value:((h=Object.entries(l.RadiusVariables).find(([p,v])=>v===c.radius))==null?void 0:h[0])||"None",onChange:p=>o(l.RadiusVariables[p],"radius")}),i.jsx(j.SelectSettings,{label:"Border Thickness (px)",options:Object.keys(l.ThicknessVariables),value:((d=Object.entries(l.ThicknessVariables).find(([p,v])=>v===c.thickness))==null?void 0:d[0])||"None",onChange:p=>o(l.ThicknessVariables[p],"thickness")})]})]})},Vc="_options_1gneb_1",Kc="_alignments_1gneb_9",Gc="_blocks_1gneb_15",Yc="_alignment_1gneb_9",Xc="_active_1gneb_34",qc="_chargeTypes_1gneb_41",Jc="_charge_1gneb_41",Qc="_chargeActive_1gneb_69",Zc="_sliderContainer_1gneb_83",el="_shadowInputs_1gneb_91",tl="_label_1gneb_102",nl="_shadowInputsRow_1gneb_111",sl="_shadowInputsOpen_1gneb_119",q={options:Vc,alignments:Kc,blocks:Gc,alignment:Yc,active:Xc,chargeTypes:qc,charge:Jc,chargeActive:Qc,sliderContainer:Zc,shadowInputs:el,label:tl,shadowInputsRow:nl,shadowInputsOpen:sl},ol=["left","center","right"],rl=()=>{const{activeBlock:e,themeSettings:t,updateButton:n,setActiveBlock:s}=l.useThemeSettingsStore(),{fonts:o}=l.useFontsStore(),[r,a]=f.useState("primary");function c(g,x){n(r,x,g)}const[u,h]=f.useState(!1),d=t.buttons[r],p=l.useNavigate();function v(){s(null),p("/admin/builder/theme")}const m=(e==null?void 0:e.name)==="Buttons";function _(g,x){c({...d.boxShadow,[g]:x},"boxShadow")}return i.jsxs(l.AnimatedPanel,{isOpen:m,isClose:!m,children:[i.jsx(mt,{onClick:v,title:"Buttons Style"}),i.jsx("div",{className:q.chargeTypes,style:{marginBottom:"10px"},children:["primary","secondary","tertiary"].map(g=>i.jsx("div",{className:l.clx(q.charge,{[q.chargeActive]:r===g}),onClick:()=>a(g),children:g.charAt(0).toUpperCase()+g.slice(1)},g))}),d&&i.jsxs("div",{className:q.options,children:[i.jsx(j.InputSettings,{label:"Height (px)",value:String(d.height),onChange:g=>c(Number(g),"height"),type:"number",min:0}),i.jsx(j.SelectSettings,{label:"Font Size (px)",value:String(d.size),onChange:g=>c(Number(g),"size"),options:l.sizeOptions}),i.jsx(j.InputSettings,{label:"Border Radius (px)",value:String(d.radius),onChange:g=>c(Number(g),"radius"),type:"number",min:0}),i.jsx(j.SelectSettings,{label:"Font",value:d.font,onChange:g=>c(g,"font"),options:[...o.filter(g=>g.name!==d.font).map(g=>g.name)]}),i.jsx(l.ColorPicker,{initialColor:d.color,onChange:g=>c(g,"color"),title:"Text Color",labelStyle:"secondary",isGradientActive:!1}),i.jsx(l.ColorPicker,{initialColor:d.background,onChange:g=>c(g,"background"),title:"Background Color",labelStyle:"secondary",isGradientActive:!0}),i.jsxs("div",{className:q.sliderContainer,children:[i.jsx("h4",{className:q.label,children:"Shadow"}),i.jsx(j.ButtonSettings,{type:"Secondary",onClick:()=>h(!u),style:{padding:5,display:"flex"},children:i.jsx(j.Icon,{name:"CaretUp",style:{rotate:u?"0deg":"-180deg",transition:"0.3s rotate ease"}})})]}),i.jsxs("div",{className:l.clx(q.shadowInputs,{[q.shadowInputsOpen]:u}),children:[i.jsxs("div",{className:q.shadowInputsRow,children:[i.jsx(j.InputSettings,{label:"Left (px)",value:String(d.boxShadow.left),onChange:g=>_("left",Number(g)),type:"number"}),i.jsx(j.InputSettings,{label:"Top (px)",value:String(d.boxShadow.top),onChange:g=>_("top",Number(g)),type:"number"}),i.jsx(j.InputSettings,{label:"Blur (px)",value:String(d.boxShadow.blur),onChange:g=>_("blur",Number(g)),type:"number"}),i.jsx("div",{style:{flex:1,whiteSpace:"nowrap"},children:i.jsx(j.InputSettings,{label:"Spread (px)",value:String(d.boxShadow.spread),onChange:g=>_("spread",Number(g)),type:"number"})})]}),i.jsx(l.ColorPicker,{initialColor:d.boxShadow.color,onChange:g=>_("color",g),title:"Color",labelStyle:"secondary",isGradientActive:!1})]}),i.jsxs("div",{className:q.alignments,children:[i.jsx("h4",{className:q.label,children:"Alignment Type"}),i.jsx("div",{className:q.blocks,children:ol.map(g=>i.jsx("div",{className:l.clx(q.alignment,{[q.active]:d.alignment===g}),onClick:()=>{c(g,"alignment")},children:i.jsx(j.Icon,{name:g==="center"?"AlignCenterHorizontal":g==="left"?"AlignLeft":"AlignRight",fill:d.alignment===g?"#252525":"#757575"})},g))})]}),i.jsx(j.Switch,{label:"Enable Hover",onChange:g=>c(g,"hover"),current:d.hover}),d.hover&&i.jsxs(i.Fragment,{children:[i.jsx(l.ColorPicker,{initialColor:d.colorHover,onChange:g=>c(g,"colorHover"),title:"Hover Text Color",labelStyle:"secondary",isGradientActive:!1}),i.jsx(l.ColorPicker,{initialColor:d.backgroundHover,onChange:g=>c(g,"backgroundHover"),title:"Hover Background Color",labelStyle:"secondary",isGradientActive:!0})]})]})]})},il="_category_daart_1",al="_categoryTitle_daart_19",Jt={category:il,categoryTitle:al},cl=()=>{const{themeSettings:e,setActiveColorCategory:t}=l.useThemeSettingsStore();function n(s){t(s)}return i.jsx("div",{className:Jt.wrapper,children:Object.keys(e.colors).map(s=>s==="icon"?i.jsx(i.Fragment,{}):i.jsxs("div",{className:Jt.category,onClick:()=>n(s),children:[i.jsxs("h2",{className:Jt.categoryTitle,children:[s==="text"?"Text & Icon":l.formatLabel(s)," Colors"]}),i.jsx(j.Icon,{name:"CaretRight",width:24,height:24})]},s))})},ll="_options_rwzk3_38",ul={options:ll},dl=()=>{const{activeBlock:e,setActiveFont:t,activeFont:n,themeSettings:s,updateFont:o}=l.useThemeSettingsStore(),{fonts:r}=l.useFontsStore(),[a,c]=f.useState(null);function u(){t(null)}function h(g,x){a&&n&&o("desktop",a,n,x,g)}const[d,p]=f.useState([]),v=f.useMemo(()=>n?s.fonts.desktop.heading[n]?(c("heading"),s.fonts.desktop.heading[n]):s.fonts.desktop.body[n]?(c("body"),s.fonts.desktop.body[n]):(c(null),null):null,[n,s]);f.useEffect(()=>{if(v){const g=r.find(x=>x.name===v.font);g&&(p(g.weights),g.weights.includes(v.boldWeight)||h("400","boldWeight"),g.weights.includes(v.weight)||h("400","weight"))}},[v,n]);const m=!!((e==null?void 0:e.name)==="Fonts"&&n),_=(e==null?void 0:e.name)!=="Fonts"||!n;return i.jsxs(l.AnimatedPanel,{isOpen:m,isClose:_,children:[i.jsx(mt,{onClick:u,title:"Font Style"}),n&&v&&i.jsxs("div",{className:ul.options,children:[i.jsx(j.SelectSettings,{label:"Font",value:v.font,onChange:g=>h(g,"font"),options:[...r.filter(g=>g.name!==v.font).map(g=>g.name)]}),i.jsx(j.SelectSettings,{label:"Size",value:String(v.size),onChange:g=>h(g,"size"),options:l.sizeOptions}),i.jsx(j.SelectSettings,{label:"Default Weight",value:String(v.weight),onChange:g=>h(g,"weight"),options:d}),i.jsx(j.SelectSettings,{label:"Bold Weight",value:String(v.boldWeight),onChange:g=>h(g,"boldWeight"),options:d}),i.jsx(j.SelectSettings,{label:"Case",value:String(v.case).charAt(0).toUpperCase()+String(v.case).slice(1),onChange:g=>h(g.toLowerCase(),"case"),options:["Normal","Uppercase","Lowercase","Capitalize"].filter(g=>g.toLowerCase()!==String(v.case))})]})]})},hl="_wrapper_mkmxa_1",fl="_category_mkmxa_5",gl="_categoryTitle_mkmxa_11",pl="_font_mkmxa_17",ml="_content_mkmxa_32",vl="_icon_mkmxa_39",bl="_paragraph_mkmxa_50",_e={wrapper:hl,category:fl,categoryTitle:gl,font:pl,content:ml,icon:vl,paragraph:bl},xl={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",h7:"h7",lg:"large",md:"medium",sm:"small"},Sl=e=>{const{font:t,size:n,id:s,category:o}=e,{setActiveFont:r}=l.useThemeSettingsStore();return i.jsxs("div",{className:_e.font,onClick:()=>r(s),children:[i.jsx("div",{className:l.clx(_e.icon,{[_e.paragraph]:o==="paragraph"}),children:i.jsx(j.Icon,{name:o==="paragraph"?"TextB":"TextH"})}),i.jsxs("div",{className:_e.content,children:[i.jsx("h2",{className:_e.categoryTitle,children:l.formatLabel(xl[s])}),i.jsx("span",{className:_e.value,children:`${t}, ${n}px`})]})]})},yl=()=>{const{themeSettings:e,setActiveFont:t,activeBlock:n}=l.useThemeSettingsStore();f.useEffect(()=>(s(),()=>{s()}),[]);function s(){t(null)}if(n!=null&&n.name)return i.jsx("div",{className:_e.wrapper,children:Object.entries(e.fonts.desktop).sort(([o],[r])=>o==="heading"?-1:r==="heading"?1:0).map(([o,r])=>i.jsxs("div",{className:_e.category,children:[i.jsx("h2",{className:_e.categoryTitle,children:l.formatLabel(o)}),Object.entries(r).map(([a,c])=>i.jsx(Sl,{id:a,category:o,...c},a))]},o))})},_l="_wrapper_16ym0_2",Cl="_categoryTitle_16ym0_12",wl="_title_16ym0_74",kl="_field_16ym0_82",jl="_alignments_16ym0_92",Al="_lineField_16ym0_98",Nl="_style_16ym0_106",Il="_header_16ym0_113",le={wrapper:_l,categoryTitle:Cl,title:wl,field:kl,alignments:jl,lineField:Al,style:Nl,header:Il},Bl=["left","center","right"],El=["solid","dashed"],it=e=>{const{title:t,children:n,rightAddon:s}=e;return i.jsxs("div",{className:le.field,children:[i.jsxs("div",{className:le.header,children:[i.jsx("h4",{className:le.categoryTitle,children:t}),s]}),n]})},Dl=()=>{const{themeSettings:e,updateInput:t}=l.useThemeSettingsStore(),n=f.useMemo(()=>e.inputs,[e]),s=(r,a,c)=>{t(r,a,c)},o=r=>a=>{t(r,a,"color")};return i.jsxs("div",{className:le.wrapper,children:[i.jsxs(it,{title:"General",children:[i.jsx(j.InputSettings,{label:"Height (px)",value:String(n.general.height),onChange:r=>s("general",r,"height"),type:"number",min:0}),i.jsx(j.SelectSettings,{label:"Font Size (px)",onChange:r=>s("general",r,"size"),value:String(n.general.size),options:l.sizeOptions}),i.jsx(l.ColorPicker,{initialColor:l.formatLabel(n.general.color),onChange:o("general"),title:"Font Color",labelStyle:"secondary",isGradientActive:!1})]}),i.jsx(it,{title:"Field Fill",rightAddon:i.jsx("div",{className:le.switch,children:i.jsx(j.Switch,{onChange:r=>s("field",r,"active"),current:n.field.active})}),children:i.jsx(l.ColorPicker,{initialColor:n.field.color,onChange:o("field"),title:"Color",labelStyle:"secondary"})}),i.jsx(it,{title:"Placeholder",children:i.jsx(l.ColorPicker,{initialColor:l.formatLabel(n.placeholder.color),onChange:o("placeholder"),title:"Font Color",labelStyle:"secondary",isGradientActive:!1})}),i.jsxs(it,{title:"Border",rightAddon:i.jsx("div",{className:le.switch,children:i.jsx(j.Switch,{onChange:r=>s("border",r,"active"),current:n.border.active})}),children:[i.jsxs("div",{className:le.lineField,children:[i.jsxs("div",{className:le.style,children:[i.jsx("span",{className:le.title,children:"Style"}),i.jsx(l.Picker,{items:El,selectedItem:n.border.style,onSelect:r=>s("border",r,"style"),getIconName:r=>r==="solid"?"Minus":"Selection"})]}),i.jsx(j.InputSettings,{label:"Radius (px)",value:String(n.border.radius),onChange:r=>s("border",r,"radius"),type:"number",min:0})]}),i.jsx(j.InputSettings,{label:"Thickness (px)",value:String(n.border.thickness),onChange:r=>s("border",r,"thickness"),type:"number",min:0}),i.jsx(l.ColorPicker,{initialColor:l.formatLabel(n.border.color),onChange:o("border"),title:"Color",labelStyle:"secondary",isGradientActive:!1})]}),i.jsxs(it,{title:"Label",children:[i.jsx(j.InputSettings,{label:"Line Height (px)",value:String(n.label.height),onChange:r=>s("label",r,"height"),type:"number",min:0}),i.jsx(j.SelectSettings,{label:"Font Size (px)",onChange:r=>s("label",r,"size"),value:String(n.label.size),options:l.sizeOptions}),i.jsx(l.ColorPicker,{initialColor:l.formatLabel(n.label.color),onChange:o("label"),title:"Color",labelStyle:"secondary",isGradientActive:!1}),i.jsxs("div",{className:le.alignments,children:[i.jsx("h4",{className:le.title,children:"Alignment Type"}),i.jsx(l.Picker,{items:Bl,selectedItem:n.label.alignment,onSelect:r=>s("label",r,"alignment"),getIconName:r=>r==="center"?"AlignCenterHorizontal":r==="left"?"AlignLeft":"AlignRight"})]})]})]})},Tl="_wrapper_lyrvk_2",Ml="_color_lyrvk_24",Rl="_content_lyrvk_33",Pl="_preview_lyrvk_42",Ol="_container_lyrvk_52",Ll="_buttonWrapper_lyrvk_62",$l="_button_lyrvk_62",Fl="_buttonBorder_lyrvk_80",zl="_buttonBackground_lyrvk_83",Hl="_text_lyrvk_87",Wl="_textText_lyrvk_93",Ul="_icon_lyrvk_97",Vl="_iconIcon_lyrvk_100",Kl="_annotation_lyrvk_104",Gl="_annotationText_lyrvk_111",Yl="_label_lyrvk_116",Xl="_circle_lyrvk_127",ql="_line_lyrvk_140",Jl="_circle1_lyrvk_154",Ql="_circle2_lyrvk_159",Zl="_annotationIcon_lyrvk_164",eu="_annotationBorder_lyrvk_192",tu="_line1_lyrvk_203",nu="_line2_lyrvk_210",su="_circle3_lyrvk_227",ou="_circle4_lyrvk_232",ru="_annotationSurface_lyrvk_237",I={wrapper:Tl,color:Ml,content:Rl,preview:Pl,container:Ol,buttonWrapper:Ll,button:$l,buttonBorder:Fl,buttonBackground:zl,text:Hl,textText:Wl,icon:Ul,iconIcon:Vl,annotation:Kl,annotationText:Gl,label:Yl,circle:Xl,line:ql,circle1:Jl,circle2:Ql,annotationIcon:Zl,annotationBorder:eu,line1:tu,line2:nu,circle3:su,circle4:ou,annotationSurface:ru},iu=()=>{const{activeColorCategory:e}=l.useThemeSettingsStore();return i.jsx("div",{className:I.container,children:i.jsxs("div",{className:I.buttonWrapper,children:[i.jsxs("div",{className:l.clx(I.button,{[I.buttonBorder]:e==="border",[I.buttonBackground]:e==="surface"}),children:[i.jsx(j.Icon,{name:"Smiley",className:l.clx(I.icon,{[I.iconIcon]:e==="text"}),width:22,height:22,fill:"#757575"}),i.jsx("span",{className:l.clx(I.text,{[I.textText]:e==="text"}),children:"Button Example"})]}),e==="text"&&i.jsxs("div",{className:l.clx(I.annotation,I.annotationText),children:[i.jsx("div",{className:I.label,children:"Text Color"}),i.jsx("div",{className:I.line}),i.jsx("div",{className:l.clx(I.circle,I.circle1)}),i.jsx("div",{className:l.clx(I.circle,I.circle2)})]}),e==="text"&&i.jsxs("div",{className:l.clx(I.annotation,I.annotationIcon),children:[i.jsx("div",{className:I.label,children:"Icon Color"}),i.jsx("div",{className:I.line}),i.jsx("div",{className:l.clx(I.circle,I.circle1)}),i.jsx("div",{className:l.clx(I.circle,I.circle2)})]}),e==="border"&&i.jsxs("div",{className:l.clx(I.annotation,I.annotationBorder),children:[i.jsx("div",{className:I.label,children:"Border Color"}),i.jsx("div",{className:l.clx(I.line,I.line1)}),i.jsx("div",{className:l.clx(I.line,I.line2)}),i.jsx("div",{className:l.clx(I.circle,I.circle1)}),i.jsx("div",{className:l.clx(I.circle,I.circle2)}),i.jsx("div",{className:l.clx(I.circle,I.circle3)}),i.jsx("div",{className:l.clx(I.circle,I.circle4)})]}),e==="surface"&&i.jsxs("div",{className:l.clx(I.annotation,I.annotationSurface),children:[i.jsx("div",{className:I.label,children:"Surface Color"}),i.jsx("div",{className:I.line}),i.jsx("div",{className:l.clx(I.circle,I.circle1)}),i.jsx("div",{className:l.clx(I.circle,I.circle2)})]})]})})},au={text:["primary","secondary","tertiary","inverted","action","action-hover","disabled","warning","error","success","information","link"],border:["primary","secondary","action","actionHover","disabled","warning","error","success","information","focus"],surface:["primary","secondary","action1","action1Hover","action2","action2Hover","disabled","warning","error","success","information","modal"]},cu=()=>{const{activeBlock:e,setActiveColorCategory:t,activeColorCategory:n,themeSettings:s,updateColor:o}=l.useThemeSettingsStore();function r(){t(null)}function a(d,p,v){o(d,p,v)}const c=!!((e==null?void 0:e.name)==="Colors"&&n),u=(e==null?void 0:e.name)!=="Colors"||!n,h=n?au[n]:[];return i.jsxs(l.AnimatedPanel,{isOpen:c,isClose:u,children:[i.jsx(mt,{onClick:r,title:n==="text"?"Text & Icon Colors":`${l.formatLabel(n)} Colors`}),n&&i.jsxs("div",{className:I.wrapper,children:[i.jsx(iu,{}),h.map(d=>{const p=s.colors[n][d];return typeof p!="string"?null:i.jsx("div",{className:I.color,children:i.jsxs("div",{className:I.content,children:[i.jsx("div",{className:I.preview,style:{background:p}}),i.jsx(l.ColorPicker,{title:l.formatLabel(d),initialColor:p,onChange:v=>a(n,d,v),isGradientActive:n==="surface"})]})},d)})]})]})},lu="_loader_1p5lr_1",uu={loader:lu},du=()=>{const{activeBlock:e,themeSettings:t,isLoadingThemeSettings:n}=l.useThemeSettingsStore();return i.jsx(i.Fragment,{children:n?i.jsx("div",{className:uu.loader,children:i.jsx(l.Loader,{})}):i.jsxs(i.Fragment,{children:[(e==null?void 0:e.name)==="Fonts"&&t.fonts&&i.jsx(yl,{}),(e==null?void 0:e.name)==="Fonts"&&t.fonts&&i.jsx(dl,{}),(e==null?void 0:e.name)==="Colors"&&t.colors&&i.jsx(cl,{}),(e==null?void 0:e.name)==="Colors"&&t.colors&&i.jsx(cu,{}),(e==null?void 0:e.name)==="Inputs"&&t.inputs&&i.jsx(Dl,{}),(e==null?void 0:e.name)==="Borders"&&t.borders&&i.jsx(Uc,{}),(e==null?void 0:e.name)==="Buttons"&&t.buttons&&i.jsx(rl,{})]})})},hu=()=>{const{activeBlock:e,setActiveBlock:t}=l.useThemeSettingsStore(),{activeBlock:n}=l.useNavbarStore(),s=l.useNavigate();function o(){t(null),s("/admin/builder/theme")}const r=!!e,a=!e||n.name!=="Theme";return i.jsxs(l.AnimatedPanel,{isOpen:r,isClose:a,children:[i.jsx(mt,{onClick:o,title:(e==null?void 0:e.name)||""}),i.jsx(du,{})]})},fu=()=>{const{activeBlock:e}=l.useNavbarStore(),{showTooltip:t}=l.useTooltipStore();function n(){switch(e.name){case"Layers":return"Layers";case"Add":return"Add Sections";case"Theme":return"Theme Settings";case"Settings":return"Settings"}}return i.jsxs("div",{className:qn.sidebar,style:{zIndex:t?50:"auto"},children:[i.jsx("h3",{className:qn.title,children:n()}),e.name==="Layers"&&i.jsx(ic,{}),e.name==="Add"&&i.jsx(Rs,{}),i.jsx(Lc,{}),i.jsx(hu,{}),e.name==="Theme"&&i.jsx(pc,{}),e.name==="Settings"&&i.jsx(lc,{})]})},gu="_wrapper_1a3e7_1",pu="_header_1a3e7_12",mu="_content_1a3e7_23",vu="_buttons_1a3e7_44",bu="_label_1a3e7_51",xu="_description_1a3e7_52",Su="_preview_1a3e7_60",yu="_block_1a3e7_66",_u="_slug_1a3e7_75",Cu="_title_1a3e7_81",wu="_closeIcon_1a3e7_87",ce={wrapper:gu,header:pu,content:mu,buttons:vu,label:bu,description:xu,preview:Su,block:yu,slug:_u,title:Cu,closeIcon:wu},ku=()=>{var $,R,D,P,T,z,X;const{setIsOpenModal:e,pages:t,createPage:n,updatePage:s,isEdit:o,setIsEdit:r,editedPage:a,setEditedPage:c,pageContext:u}=l.usePagesStore(),{setIsOpen:h}=l.useModalStore(),{isAntistock:d}=l.useGeneralStore(),{createPage:p,updatePage:v}=l.useLayersStore(),[m,_]=f.useState(a?t&&(($=t[a])==null?void 0:$.path):""),[g,x]=f.useState(a?t&&((R=t[a])==null?void 0:R.name):""),[y,w]=f.useState(a?t&&((D=t[a])==null?void 0:D.seo)&&((T=(P=t[a])==null?void 0:P.seo)==null?void 0:T.pageDescription)||"":`${u.general.info.name} is powered by the ${d?"Antistock.io":"Billgang.com"} platform which allows them to sell their digital products online for free.`),[b,A]=f.useState(a&&t&&(z=t[a])!=null&&z.isPrivate?"private":"public");function C(){_(""),x(""),w(""),A("public"),r(!1),c(null)}function k(){h(!1),setTimeout(()=>{C(),e(!1),h(!0)},300)}f.useEffect(()=>()=>{k()},[]);function S(E){return E[0]==="/"?E:"/"+E}function N(){n({path:S(m),name:g||m||"",icon:"File",seo:{pageTitle:g||"",pageDescription:y||""},visibility:b||"public"}),p(S(m)),k()}function M(){t&&(l.defaultPagePaths.includes(t[a].path)||Ms(t[a].path),v(t[a].path||"",m||""),s(a,{path:S(m),name:g||m,icon:t[a].icon||"File",seo:{pageTitle:g||"",pageDescription:y||""},visibility:b||"public"})),k()}return i.jsxs("div",{className:ce.wrapper,onClick:E=>E.stopPropagation(),children:[i.jsxs("div",{className:ce.header,children:[i.jsx("h2",{children:o?"Edit Page":"Create New Page"}),i.jsx("div",{className:ce.closeIcon,children:i.jsx(j.Icon,{name:"X",fill:"#757575",hoverable:!0,onClick:k})})]}),i.jsxs("div",{className:ce.content,children:[i.jsx(j.InputSettings,{label:"Page Slug",onChange:E=>_(E),value:m,placeholder:"path-to-page",disabled:!!(a&&t&&((X=t[a])!=null&&X.name)&&l.defaultPagePaths.includes(t[a].path)),required:!0,regex:"^.+$"}),i.jsx(j.InputSettings,{label:"Page Title",onChange:E=>{x(E)},value:g.charAt(0).toUpperCase()+g.slice(1),placeholder:"Contact us"}),i.jsx(j.TextareaSettings,{label:"Description",onChange:E=>w(E),value:y,placeholder:`${u.general.info.name} is powered by the ${d?"Antistock.io":"Billgang.com"} platform which allows them to sell their digital products online for free.`,maxLength:150}),i.jsxs("div",{className:ce.preview,children:[i.jsx("span",{className:ce.label,children:"Preview"}),i.jsxs("div",{className:ce.block,children:[i.jsx("span",{className:ce.slug,children:m||"yoursite.url"}),i.jsx("span",{className:ce.title,children:g||"My Blank Page"}),i.jsx("span",{className:ce.description,children:y||"It is My Description"})]})]})]}),i.jsxs("div",{className:ce.buttons,children:[i.jsx(j.ButtonSettings,{onClick:k,type:"Secondary",children:"Cancel"}),i.jsx(j.ButtonSettings,{onClick:o?M:N,disabled:m.length===0,type:"Primary",children:o?"Update":"Create"})]})]})};exports.CSS=Ye;exports.DndContext=ks;exports.Fuse=Oe;exports.Header=Gi;exports.ModifyPage=ku;exports.Navbar=na;exports.PointerSensor=Rt;exports.Preview=$a;exports.RenderAnnouncement=fn;exports.RenderBlock=Tt;exports.RenderFooter=dn;exports.RenderHeader=hn;exports.Sidebar=fu;exports.SortableContext=Es;exports.index=Us;exports.useSensor=us;exports.useSensors=ds;exports.useSortable=Ts;exports.verticalListSortingStrategy=Ns;
|
|
5
|
+
`},Wo={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Uo(e){let{announcements:t=Wo,container:n,hiddenTextDescribedById:s,screenReaderInstructions:o=Ho}=e;const{announce:r,announcement:a}=$o(),c=pt("DndLiveRegion"),[u,h]=f.useState(!1);if(f.useEffect(()=>{h(!0)},[]),Fo(f.useMemo(()=>({onDragStart(p){let{active:v}=p;r(t.onDragStart({active:v}))},onDragMove(p){let{active:v,over:m}=p;t.onDragMove&&r(t.onDragMove({active:v,over:m}))},onDragOver(p){let{active:v,over:m}=p;r(t.onDragOver({active:v,over:m}))},onDragEnd(p){let{active:v,over:m}=p;r(t.onDragEnd({active:v,over:m}))},onDragCancel(p){let{active:v,over:m}=p;r(t.onDragCancel({active:v,over:m}))}}),[r,t])),!u)return null;const d=f.createElement(f.Fragment,null,f.createElement(Oo,{id:s,value:o.draggable}),f.createElement(Lo,{id:c,announcement:a}));return n?at.createPortal(d,n):d}var W;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(W||(W={}));function Et(){}function us(e,t){return f.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function ds(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return f.useMemo(()=>[...t].filter(s=>s!=null),[...t])}const ue=Object.freeze({x:0,y:0});function Vo(e,t){let{data:{value:n}}=e,{data:{value:s}}=t;return s-n}function Ko(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Go(e,t){const n=Math.max(t.top,e.top),s=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),r=Math.min(t.top+t.height,e.top+e.height),a=o-s,c=r-n;if(s<o&&n<r){const u=t.width*t.height,h=e.width*e.height,d=a*c,p=d/(u+h-d);return Number(p.toFixed(4))}return 0}const Yo=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:s}=e;const o=[];for(const r of s){const{id:a}=r,c=n.get(a);if(c){const u=Go(c,t);u>0&&o.push({id:a,data:{droppableContainer:r,value:u}})}}return o.sort(Vo)};function Xo(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function hs(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ue}function qo(e){return function(n){for(var s=arguments.length,o=new Array(s>1?s-1:0),r=1;r<s;r++)o[r-1]=arguments[r];return o.reduce((a,c)=>({...a,top:a.top+e*c.y,bottom:a.bottom+e*c.y,left:a.left+e*c.x,right:a.right+e*c.x}),{...n})}}const Jo=qo(1);function Qo(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Zo(e,t,n){const s=Qo(t);if(!s)return e;const{scaleX:o,scaleY:r,x:a,y:c}=s,u=e.left-a-(1-o)*parseFloat(n),h=e.top-c-(1-r)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o:e.width,p=r?e.height/r:e.height;return{width:d,height:p,top:h,right:u+d,bottom:h+p,left:u}}const er={ignoreTransform:!1};function Je(e,t){t===void 0&&(t=er);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:h,transformOrigin:d}=J(e).getComputedStyle(e);h&&(n=Zo(n,h,d))}const{top:s,left:o,width:r,height:a,bottom:c,right:u}=n;return{top:s,left:o,width:r,height:a,bottom:c,right:u}}function Pn(e){return Je(e,{ignoreTransform:!0})}function tr(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function nr(e,t){return t===void 0&&(t=J(e).getComputedStyle(e)),t.position==="fixed"}function sr(e,t){t===void 0&&(t=J(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const r=t[o];return typeof r=="string"?n.test(r):!1})}function xn(e,t){const n=[];function s(o){if(t!=null&&n.length>=t||!o)return n;if(mn(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!ft(o)||as(o)||n.includes(o))return n;const r=J(e).getComputedStyle(o);return o!==e&&sr(o,r)&&n.push(o),nr(o,r)?n:s(o.parentNode)}return e?s(e):n}function fs(e){const[t]=xn(e,1);return t??null}function Wt(e){return!Mt||!e?null:Xe(e)?e:pn(e)?mn(e)||e===qe(e).scrollingElement?window:ft(e)?e:null:null}function gs(e){return Xe(e)?e.scrollX:e.scrollLeft}function ps(e){return Xe(e)?e.scrollY:e.scrollTop}function an(e){return{x:gs(e),y:ps(e)}}var U;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(U||(U={}));function ms(e){return!Mt||!e?!1:e===document.scrollingElement}function vs(e){const t={x:0,y:0},n=ms(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},s={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,r=e.scrollLeft<=t.x,a=e.scrollTop>=s.y,c=e.scrollLeft>=s.x;return{isTop:o,isLeft:r,isBottom:a,isRight:c,maxScroll:s,minScroll:t}}const or={x:.2,y:.2};function rr(e,t,n,s,o){let{top:r,left:a,right:c,bottom:u}=n;s===void 0&&(s=10),o===void 0&&(o=or);const{isTop:h,isBottom:d,isLeft:p,isRight:v}=vs(e),m={x:0,y:0},_={x:0,y:0},g={height:t.height*o.y,width:t.width*o.x};return!h&&r<=t.top+g.height?(m.y=U.Backward,_.y=s*Math.abs((t.top+g.height-r)/g.height)):!d&&u>=t.bottom-g.height&&(m.y=U.Forward,_.y=s*Math.abs((t.bottom-g.height-u)/g.height)),!v&&c>=t.right-g.width?(m.x=U.Forward,_.x=s*Math.abs((t.right-g.width-c)/g.width)):!p&&a<=t.left+g.width&&(m.x=U.Backward,_.x=s*Math.abs((t.left+g.width-a)/g.width)),{direction:m,speed:_}}function ir(e){if(e===document.scrollingElement){const{innerWidth:r,innerHeight:a}=window;return{top:0,left:0,right:r,bottom:a,width:r,height:a}}const{top:t,left:n,right:s,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:s,bottom:o,width:e.clientWidth,height:e.clientHeight}}function bs(e){return e.reduce((t,n)=>Ge(t,an(n)),ue)}function ar(e){return e.reduce((t,n)=>t+gs(n),0)}function cr(e){return e.reduce((t,n)=>t+ps(n),0)}function lr(e,t){if(t===void 0&&(t=Je),!e)return;const{top:n,left:s,bottom:o,right:r}=t(e);fs(e)&&(o<=0||r<=0||n>=window.innerHeight||s>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ur=[["x",["left","right"],ar],["y",["top","bottom"],cr]];class Sn{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const s=xn(n),o=bs(s);this.rect={...t},this.width=t.width,this.height=t.height;for(const[r,a,c]of ur)for(const u of a)Object.defineProperty(this,u,{get:()=>{const h=c(s),d=o[r]-h;return this.rect[u]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ct{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var s;return(s=this.target)==null?void 0:s.removeEventListener(...n)})},this.target=t}add(t,n,s){var o;(o=this.target)==null||o.addEventListener(t,n,s),this.listeners.push([t,n,s])}}function dr(e){const{EventTarget:t}=J(e);return e instanceof t?e:qe(e)}function Ut(e,t){const n=Math.abs(e.x),s=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+s**2)>t:"x"in t&&"y"in t?n>t.x&&s>t.y:"x"in t?n>t.x:"y"in t?s>t.y:!1}var oe;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(oe||(oe={}));function On(e){e.preventDefault()}function hr(e){e.stopPropagation()}var O;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(O||(O={}));const xs={start:[O.Space,O.Enter],cancel:[O.Esc],end:[O.Space,O.Enter,O.Tab]},fr=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case O.Right:return{...n,x:n.x+25};case O.Left:return{...n,x:n.x-25};case O.Down:return{...n,y:n.y+25};case O.Up:return{...n,y:n.y-25}}};class Ss{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new ct(qe(n)),this.windowListeners=new ct(J(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(oe.Resize,this.handleCancel),this.windowListeners.add(oe.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(oe.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,s=t.node.current;s&&lr(s),n(ue)}handleKeyDown(t){if(bn(t)){const{active:n,context:s,options:o}=this.props,{keyboardCodes:r=xs,coordinateGetter:a=fr,scrollBehavior:c="smooth"}=o,{code:u}=t;if(r.end.includes(u)){this.handleEnd(t);return}if(r.cancel.includes(u)){this.handleCancel(t);return}const{collisionRect:h}=s.current,d=h?{x:h.left,y:h.top}:ue;this.referenceCoordinates||(this.referenceCoordinates=d);const p=a(t,{active:n,context:s.current,currentCoordinates:d});if(p){const v=Bt(p,d),m={x:0,y:0},{scrollableAncestors:_}=s.current;for(const g of _){const x=t.code,{isTop:y,isRight:w,isLeft:b,isBottom:A,maxScroll:C,minScroll:k}=vs(g),S=ir(g),N={x:Math.min(x===O.Right?S.right-S.width/2:S.right,Math.max(x===O.Right?S.left:S.left+S.width/2,p.x)),y:Math.min(x===O.Down?S.bottom-S.height/2:S.bottom,Math.max(x===O.Down?S.top:S.top+S.height/2,p.y))},M=x===O.Right&&!w||x===O.Left&&!b,$=x===O.Down&&!A||x===O.Up&&!y;if(M&&N.x!==p.x){const R=g.scrollLeft+v.x,D=x===O.Right&&R<=C.x||x===O.Left&&R>=k.x;if(D&&!v.y){g.scrollTo({left:R,behavior:c});return}D?m.x=g.scrollLeft-R:m.x=x===O.Right?g.scrollLeft-C.x:g.scrollLeft-k.x,m.x&&g.scrollBy({left:-m.x,behavior:c});break}else if($&&N.y!==p.y){const R=g.scrollTop+v.y,D=x===O.Down&&R<=C.y||x===O.Up&&R>=k.y;if(D&&!v.x){g.scrollTo({top:R,behavior:c});return}D?m.y=g.scrollTop-R:m.y=x===O.Down?g.scrollTop-C.y:g.scrollTop-k.y,m.y&&g.scrollBy({top:-m.y,behavior:c});break}}this.handleMove(t,Ge(Bt(p,this.referenceCoordinates),m))}}}handleMove(t,n){const{onMove:s}=this.props;t.preventDefault(),s(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Ss.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:s=xs,onActivation:o}=t,{active:r}=n;const{code:a}=e.nativeEvent;if(s.start.includes(a)){const c=r.activatorNode.current;return c&&e.target!==c?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function Ln(e){return!!(e&&"distance"in e)}function $n(e){return!!(e&&"delay"in e)}class yn{constructor(t,n,s){var o;s===void 0&&(s=dr(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:r}=t,{target:a}=r;this.props=t,this.events=n,this.document=qe(a),this.documentListeners=new ct(this.document),this.listeners=new ct(s),this.windowListeners=new ct(J(a)),this.initialCoordinates=(o=rn(r))!=null?o:ue,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:s}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(oe.Resize,this.handleCancel),this.windowListeners.add(oe.DragStart,On),this.windowListeners.add(oe.VisibilityChange,this.handleCancel),this.windowListeners.add(oe.ContextMenu,On),this.documentListeners.add(oe.Keydown,this.handleKeydown),n){if(s!=null&&s({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if($n(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Ln(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:s,onPending:o}=this.props;o(s,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(oe.Click,hr,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(oe.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:s,initialCoordinates:o,props:r}=this,{onMove:a,options:{activationConstraint:c}}=r;if(!o)return;const u=(n=rn(t))!=null?n:ue,h=Bt(o,u);if(!s&&c){if(Ln(c)){if(c.tolerance!=null&&Ut(h,c.tolerance))return this.handleCancel();if(Ut(h,c.distance))return this.handleStart()}if($n(c)&&Ut(h,c.tolerance))return this.handleCancel();this.handlePending(c,h);return}t.cancelable&&t.preventDefault(),a(u)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===O.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const gr={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Rt extends yn{constructor(t){const{event:n}=t,s=qe(n.target);super(t,gr,s)}}Rt.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;return!n.isPrimary||n.button!==0?!1:(s==null||s({event:n}),!0)}}];const pr={move:{name:"mousemove"},end:{name:"mouseup"}};var cn;(function(e){e[e.RightClick=2]="RightClick"})(cn||(cn={}));class mr extends yn{constructor(t){super(t,pr,qe(t.event.target))}}mr.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;return n.button===cn.RightClick?!1:(s==null||s({event:n}),!0)}}];const Vt={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class vr extends yn{constructor(t){super(t,Vt)}static setup(){return window.addEventListener(Vt.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Vt.move.name,t)};function t(){}}}vr.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:s}=t;const{touches:o}=n;return o.length>1?!1:(s==null||s({event:n}),!0)}}];var lt;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(lt||(lt={}));var Dt;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Dt||(Dt={}));function br(e){let{acceleration:t,activator:n=lt.Pointer,canScroll:s,draggingRect:o,enabled:r,interval:a=5,order:c=Dt.TreeOrder,pointerCoordinates:u,scrollableAncestors:h,scrollableAncestorRects:d,delta:p,threshold:v}=e;const m=Sr({delta:p,disabled:!r}),[_,g]=Do(),x=f.useRef({x:0,y:0}),y=f.useRef({x:0,y:0}),w=f.useMemo(()=>{switch(n){case lt.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case lt.DraggableRect:return o}},[n,o,u]),b=f.useRef(null),A=f.useCallback(()=>{const k=b.current;if(!k)return;const S=x.current.x*y.current.x,N=x.current.y*y.current.y;k.scrollBy(S,N)},[]),C=f.useMemo(()=>c===Dt.TreeOrder?[...h].reverse():h,[c,h]);f.useEffect(()=>{if(!r||!h.length||!w){g();return}for(const k of C){if((s==null?void 0:s(k))===!1)continue;const S=h.indexOf(k),N=d[S];if(!N)continue;const{direction:M,speed:$}=rr(k,N,w,t,v);for(const R of["x","y"])m[R][M[R]]||($[R]=0,M[R]=0);if($.x>0||$.y>0){g(),b.current=k,_(A,a),x.current=$,y.current=M;return}}x.current={x:0,y:0},y.current={x:0,y:0},g()},[t,A,s,g,r,a,JSON.stringify(w),JSON.stringify(m),_,h,C,d,JSON.stringify(v)])}const xr={x:{[U.Backward]:!1,[U.Forward]:!1},y:{[U.Backward]:!1,[U.Forward]:!1}};function Sr(e){let{delta:t,disabled:n}=e;const s=on(t);return gt(o=>{if(n||!s||!o)return xr;const r={x:Math.sign(t.x-s.x),y:Math.sign(t.y-s.y)};return{x:{[U.Backward]:o.x[U.Backward]||r.x===-1,[U.Forward]:o.x[U.Forward]||r.x===1},y:{[U.Backward]:o.y[U.Backward]||r.y===-1,[U.Forward]:o.y[U.Forward]||r.y===1}}},[n,t,s])}function yr(e,t){const n=t!=null?e.get(t):void 0,s=n?n.node.current:null;return gt(o=>{var r;return t==null?null:(r=s??o)!=null?r:null},[s,t])}function _r(e,t){return f.useMemo(()=>e.reduce((n,s)=>{const{sensor:o}=s,r=o.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,s)}));return[...n,...r]},[]),[e,t])}var ht;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(ht||(ht={}));var ln;(function(e){e.Optimized="optimized"})(ln||(ln={}));const Fn=new Map;function Cr(e,t){let{dragging:n,dependencies:s,config:o}=t;const[r,a]=f.useState(null),{frequency:c,measure:u,strategy:h}=o,d=f.useRef(e),p=x(),v=dt(p),m=f.useCallback(function(y){y===void 0&&(y=[]),!v.current&&a(w=>w===null?y:w.concat(y.filter(b=>!w.includes(b))))},[v]),_=f.useRef(null),g=gt(y=>{if(p&&!n)return Fn;if(!y||y===Fn||d.current!==e||r!=null){const w=new Map;for(let b of e){if(!b)continue;if(r&&r.length>0&&!r.includes(b.id)&&b.rect.current){w.set(b.id,b.rect.current);continue}const A=b.node.current,C=A?new Sn(u(A),A):null;b.rect.current=C,C&&w.set(b.id,C)}return w}return y},[e,r,n,p,u]);return f.useEffect(()=>{d.current=e},[e]),f.useEffect(()=>{p||m()},[n,p]),f.useEffect(()=>{r&&r.length>0&&a(null)},[JSON.stringify(r)]),f.useEffect(()=>{p||typeof c!="number"||_.current!==null||(_.current=setTimeout(()=>{m(),_.current=null},c))},[c,p,m,...s]),{droppableRects:g,measureDroppableContainers:m,measuringScheduled:r!=null};function x(){switch(h){case ht.Always:return!1;case ht.BeforeDragging:return n;default:return!n}}}function ys(e,t){return gt(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function wr(e,t){return ys(e,t)}function kr(e){let{callback:t,disabled:n}=e;const s=vn(t),o=f.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:r}=window;return new r(s)},[s,n]);return f.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Pt(e){let{callback:t,disabled:n}=e;const s=vn(t),o=f.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:r}=window;return new r(s)},[n]);return f.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function jr(e){return new Sn(Je(e),e)}function zn(e,t,n){t===void 0&&(t=jr);const[s,o]=f.useState(null);function r(){o(u=>{if(!e)return null;if(e.isConnected===!1){var h;return(h=u??n)!=null?h:null}const d=t(e);return JSON.stringify(u)===JSON.stringify(d)?u:d})}const a=kr({callback(u){if(e)for(const h of u){const{type:d,target:p}=h;if(d==="childList"&&p instanceof HTMLElement&&p.contains(e)){r();break}}}}),c=Pt({callback:r});return be(()=>{r(),e?(c==null||c.observe(e),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(c==null||c.disconnect(),a==null||a.disconnect())},[e]),s}function Ar(e){const t=ys(e);return hs(e,t)}const Hn=[];function Nr(e){const t=f.useRef(e),n=gt(s=>e?s&&s!==Hn&&e&&t.current&&e.parentNode===t.current.parentNode?s:xn(e):Hn,[e]);return f.useEffect(()=>{t.current=e},[e]),n}function Ir(e){const[t,n]=f.useState(null),s=f.useRef(e),o=f.useCallback(r=>{const a=Wt(r.target);a&&n(c=>c?(c.set(a,an(a)),new Map(c)):null)},[]);return f.useEffect(()=>{const r=s.current;if(e!==r){a(r);const c=e.map(u=>{const h=Wt(u);return h?(h.addEventListener("scroll",o,{passive:!0}),[h,an(h)]):null}).filter(u=>u!=null);n(c.length?new Map(c):null),s.current=e}return()=>{a(e),a(r)};function a(c){c.forEach(u=>{const h=Wt(u);h==null||h.removeEventListener("scroll",o)})}},[o,e]),f.useMemo(()=>e.length?t?Array.from(t.values()).reduce((r,a)=>Ge(r,a),ue):bs(e):ue,[e,t])}function Wn(e,t){t===void 0&&(t=[]);const n=f.useRef(null);return f.useEffect(()=>{n.current=null},t),f.useEffect(()=>{const s=e!==ue;s&&!n.current&&(n.current=e),!s&&n.current&&(n.current=null)},[e]),n.current?Bt(e,n.current):ue}function Br(e){f.useEffect(()=>{if(!Mt)return;const t=e.map(n=>{let{sensor:s}=n;return s.setup==null?void 0:s.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function Er(e,t){return f.useMemo(()=>e.reduce((n,s)=>{let{eventName:o,handler:r}=s;return n[o]=a=>{r(a,t)},n},{}),[e,t])}function _s(e){return f.useMemo(()=>e?tr(e):null,[e])}const Un=[];function Dr(e,t){t===void 0&&(t=Je);const[n]=e,s=_s(n?J(n):null),[o,r]=f.useState(Un);function a(){r(()=>e.length?e.map(u=>ms(u)?s:new Sn(t(u),u)):Un)}const c=Pt({callback:a});return be(()=>{c==null||c.disconnect(),a(),e.forEach(u=>c==null?void 0:c.observe(u))},[e]),o}function Tr(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ft(t)?t:e}function Mr(e){let{measure:t}=e;const[n,s]=f.useState(null),o=f.useCallback(h=>{for(const{target:d}of h)if(ft(d)){s(p=>{const v=t(d);return p?{...p,width:v.width,height:v.height}:v});break}},[t]),r=Pt({callback:o}),a=f.useCallback(h=>{const d=Tr(h);r==null||r.disconnect(),d&&(r==null||r.observe(d)),s(d?t(d):null)},[t,r]),[c,u]=It(a);return f.useMemo(()=>({nodeRef:c,rect:n,setRef:u}),[n,c,u])}const Rr=[{sensor:Rt,options:{}},{sensor:Ss,options:{}}],Pr={current:{}},jt={draggable:{measure:Pn},droppable:{measure:Pn,strategy:ht.WhileDragging,frequency:ln.Optimized},dragOverlay:{measure:Je}};class ut extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,s;return(n=(s=this.get(t))==null?void 0:s.node.current)!=null?n:void 0}}const Or={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ut,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Et},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:jt,measureDroppableContainers:Et,windowRect:null,measuringScheduled:!1},Lr={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Et,draggableNodes:new Map,over:null,measureDroppableContainers:Et},Ot=f.createContext(Lr),Cs=f.createContext(Or);function $r(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ut}}}function Fr(e,t){switch(t.type){case W.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case W.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case W.DragEnd:case W.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case W.RegisterDroppable:{const{element:n}=t,{id:s}=n,o=new ut(e.droppable.containers);return o.set(s,n),{...e,droppable:{...e.droppable,containers:o}}}case W.SetDroppableDisabled:{const{id:n,key:s,disabled:o}=t,r=e.droppable.containers.get(n);if(!r||s!==r.key)return e;const a=new ut(e.droppable.containers);return a.set(n,{...r,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case W.UnregisterDroppable:{const{id:n,key:s}=t,o=e.droppable.containers.get(n);if(!o||s!==o.key)return e;const r=new ut(e.droppable.containers);return r.delete(n),{...e,droppable:{...e.droppable,containers:r}}}default:return e}}function zr(e){let{disabled:t}=e;const{active:n,activatorEvent:s,draggableNodes:o}=f.useContext(Ot),r=on(s),a=on(n==null?void 0:n.id);return f.useEffect(()=>{if(!t&&!s&&r&&a!=null){if(!bn(r)||document.activeElement===r.target)return;const c=o.get(a);if(!c)return;const{activatorNode:u,node:h}=c;if(!u.current&&!h.current)return;requestAnimationFrame(()=>{for(const d of[u.current,h.current]){if(!d)continue;const p=Ro(d);if(p){p.focus();break}}})}},[s,t,o,a,r]),null}function Hr(e,t){let{transform:n,...s}=t;return e!=null&&e.length?e.reduce((o,r)=>r({transform:o,...s}),n):n}function Wr(e){return f.useMemo(()=>({draggable:{...jt.draggable,...e==null?void 0:e.draggable},droppable:{...jt.droppable,...e==null?void 0:e.droppable},dragOverlay:{...jt.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Ur(e){let{activeNode:t,measure:n,initialRect:s,config:o=!0}=e;const r=f.useRef(!1),{x:a,y:c}=typeof o=="boolean"?{x:o,y:o}:o;be(()=>{if(!a&&!c||!t){r.current=!1;return}if(r.current||!s)return;const h=t==null?void 0:t.node.current;if(!h||h.isConnected===!1)return;const d=n(h),p=hs(d,s);if(a||(p.x=0),c||(p.y=0),r.current=!0,Math.abs(p.x)>0||Math.abs(p.y)>0){const v=fs(h);v&&v.scrollBy({top:p.y,left:p.x})}},[t,a,c,s,n])}const ws=f.createContext({...ue,scaleX:1,scaleY:1});var Te;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Te||(Te={}));const ks=f.memo(function(t){var n,s,o,r;let{id:a,accessibility:c,autoScroll:u=!0,children:h,sensors:d=Rr,collisionDetection:p=Yo,measuring:v,modifiers:m,..._}=t;const g=f.useReducer(Fr,void 0,$r),[x,y]=g,[w,b]=zo(),[A,C]=f.useState(Te.Uninitialized),k=A===Te.Initialized,{draggable:{active:S,nodes:N,translate:M},droppable:{containers:$}}=x,R=S!=null?N.get(S):null,D=f.useRef({initial:null,translated:null}),P=f.useMemo(()=>{var G;return S!=null?{id:S,data:(G=R==null?void 0:R.data)!=null?G:Pr,rect:D}:null},[S,R]),T=f.useRef(null),[z,X]=f.useState(null),[E,H]=f.useState(null),re=dt(_,Object.values(_)),we=pt("DndDescribedBy",a),Le=f.useMemo(()=>$.getEnabled(),[$]),K=Wr(v),{droppableRects:ie,measureDroppableContainers:de,measuringScheduled:Re}=Cr(Le,{dragging:k,dependencies:[M.x,M.y],config:K.droppable}),L=yr(N,S),$e=f.useMemo(()=>E?rn(E):null,[E]),ke=Ws(),xe=wr(L,K.draggable.measure);Ur({activeNode:S!=null?N.get(S):null,config:ke.layoutShiftCompensation,initialRect:xe,measure:K.draggable.measure});const F=zn(L,K.draggable.measure,xe),Qe=zn(L?L.parentElement:null),he=f.useRef({activatorEvent:null,active:null,activeNode:L,collisionRect:null,collisions:null,droppableRects:ie,draggableNodes:N,draggingNode:null,draggingNodeRect:null,droppableContainers:$,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Fe=$.getNodeFor((n=he.current.over)==null?void 0:n.id),Se=Mr({measure:K.dragOverlay.measure}),ze=(s=Se.nodeRef.current)!=null?s:L,He=k?(o=Se.rect)!=null?o:F:null,_n=!!(Se.nodeRef.current&&Se.rect),Cn=Ar(_n?null:F),Lt=_s(ze?J(ze):null),je=Nr(k?Fe??L:null),vt=Dr(je),bt=Hr(m,{transform:{x:M.x-Cn.x,y:M.y-Cn.y,scaleX:1,scaleY:1},activatorEvent:E,active:P,activeNodeRect:F,containerNodeRect:Qe,draggingNodeRect:He,over:he.current.over,overlayNodeRect:Se.rect,scrollableAncestors:je,scrollableAncestorRects:vt,windowRect:Lt}),wn=$e?Ge($e,M):null,kn=Ir(je),Ps=Wn(kn),Os=Wn(kn,[F]),We=Ge(bt,Ps),Ue=He?Jo(He,bt):null,Ze=P&&Ue?p({active:P,collisionRect:Ue,droppableRects:ie,droppableContainers:Le,pointerCoordinates:wn}):null,jn=Ko(Ze,"id"),[Ae,An]=f.useState(null),Ls=_n?bt:Ge(bt,Os),$s=Xo(Ls,(r=Ae==null?void 0:Ae.rect)!=null?r:null,F),$t=f.useRef(null),Nn=f.useCallback((G,Q)=>{let{sensor:Z,options:Ne}=Q;if(T.current==null)return;const ne=N.get(T.current);if(!ne)return;const ee=G.nativeEvent,fe=new Z({active:T.current,activeNode:ne,event:ee,options:Ne,context:he,onAbort(V){if(!N.get(V))return;const{onDragAbort:ge}=re.current,ye={id:V};ge==null||ge(ye),w({type:"onDragAbort",event:ye})},onPending(V,Ie,ge,ye){if(!N.get(V))return;const{onDragPending:tt}=re.current,Be={id:V,constraint:Ie,initialCoordinates:ge,offset:ye};tt==null||tt(Be),w({type:"onDragPending",event:Be})},onStart(V){const Ie=T.current;if(Ie==null)return;const ge=N.get(Ie);if(!ge)return;const{onDragStart:ye}=re.current,et={activatorEvent:ee,active:{id:Ie,data:ge.data,rect:D}};at.unstable_batchedUpdates(()=>{ye==null||ye(et),C(Te.Initializing),y({type:W.DragStart,initialCoordinates:V,active:Ie}),w({type:"onDragStart",event:et}),X($t.current),H(ee)})},onMove(V){y({type:W.DragMove,coordinates:V})},onEnd:Ve(W.DragEnd),onCancel:Ve(W.DragCancel)});$t.current=fe;function Ve(V){return async function(){const{active:ge,collisions:ye,over:et,scrollAdjustedTranslate:tt}=he.current;let Be=null;if(ge&&tt){const{cancelDrop:nt}=re.current;Be={activatorEvent:ee,active:ge,collisions:ye,delta:tt,over:et},V===W.DragEnd&&typeof nt=="function"&&await Promise.resolve(nt(Be))&&(V=W.DragCancel)}T.current=null,at.unstable_batchedUpdates(()=>{y({type:V}),C(Te.Uninitialized),An(null),X(null),H(null),$t.current=null;const nt=V===W.DragEnd?"onDragEnd":"onDragCancel";if(Be){const Ft=re.current[nt];Ft==null||Ft(Be),w({type:nt,event:Be})}})}}},[N]),Fs=f.useCallback((G,Q)=>(Z,Ne)=>{const ne=Z.nativeEvent,ee=N.get(Ne);if(T.current!==null||!ee||ne.dndKit||ne.defaultPrevented)return;const fe={active:ee};G(Z,Q.options,fe)===!0&&(ne.dndKit={capturedBy:Q.sensor},T.current=Ne,Nn(Z,Q))},[N,Nn]),In=_r(d,Fs);Br(d),be(()=>{F&&A===Te.Initializing&&C(Te.Initialized)},[F,A]),f.useEffect(()=>{const{onDragMove:G}=re.current,{active:Q,activatorEvent:Z,collisions:Ne,over:ne}=he.current;if(!Q||!Z)return;const ee={active:Q,activatorEvent:Z,collisions:Ne,delta:{x:We.x,y:We.y},over:ne};at.unstable_batchedUpdates(()=>{G==null||G(ee),w({type:"onDragMove",event:ee})})},[We.x,We.y]),f.useEffect(()=>{const{active:G,activatorEvent:Q,collisions:Z,droppableContainers:Ne,scrollAdjustedTranslate:ne}=he.current;if(!G||T.current==null||!Q||!ne)return;const{onDragOver:ee}=re.current,fe=Ne.get(jn),Ve=fe&&fe.rect.current?{id:fe.id,rect:fe.rect.current,data:fe.data,disabled:fe.disabled}:null,V={active:G,activatorEvent:Q,collisions:Z,delta:{x:ne.x,y:ne.y},over:Ve};at.unstable_batchedUpdates(()=>{An(Ve),ee==null||ee(V),w({type:"onDragOver",event:V})})},[jn]),be(()=>{he.current={activatorEvent:E,active:P,activeNode:L,collisionRect:Ue,collisions:Ze,droppableRects:ie,draggableNodes:N,draggingNode:ze,draggingNodeRect:He,droppableContainers:$,over:Ae,scrollableAncestors:je,scrollAdjustedTranslate:We},D.current={initial:He,translated:Ue}},[P,L,Ze,Ue,N,ze,He,ie,$,Ae,je,We]),br({...ke,delta:M,draggingRect:Ue,pointerCoordinates:wn,scrollableAncestors:je,scrollableAncestorRects:vt});const zs=f.useMemo(()=>({active:P,activeNode:L,activeNodeRect:F,activatorEvent:E,collisions:Ze,containerNodeRect:Qe,dragOverlay:Se,draggableNodes:N,droppableContainers:$,droppableRects:ie,over:Ae,measureDroppableContainers:de,scrollableAncestors:je,scrollableAncestorRects:vt,measuringConfiguration:K,measuringScheduled:Re,windowRect:Lt}),[P,L,F,E,Ze,Qe,Se,N,$,ie,Ae,de,je,vt,K,Re,Lt]),Hs=f.useMemo(()=>({activatorEvent:E,activators:In,active:P,activeNodeRect:F,ariaDescribedById:{draggable:we},dispatch:y,draggableNodes:N,over:Ae,measureDroppableContainers:de}),[E,In,P,F,y,we,N,Ae,de]);return f.createElement(ls.Provider,{value:b},f.createElement(Ot.Provider,{value:Hs},f.createElement(Cs.Provider,{value:zs},f.createElement(ws.Provider,{value:$s},h)),f.createElement(zr,{disabled:(c==null?void 0:c.restoreFocus)===!1})),f.createElement(Uo,{...c,hiddenTextDescribedById:we}));function Ws(){const G=(z==null?void 0:z.autoScrollEnabled)===!1,Q=typeof u=="object"?u.enabled===!1:u===!1,Z=k&&!G&&!Q;return typeof u=="object"?{...u,enabled:Z}:{enabled:Z}}}),Vr=f.createContext(null),Vn="button",Kr="Draggable";function Gr(e){let{id:t,data:n,disabled:s=!1,attributes:o}=e;const r=pt(Kr),{activators:a,activatorEvent:c,active:u,activeNodeRect:h,ariaDescribedById:d,draggableNodes:p,over:v}=f.useContext(Ot),{role:m=Vn,roleDescription:_="draggable",tabIndex:g=0}=o??{},x=(u==null?void 0:u.id)===t,y=f.useContext(x?ws:Vr),[w,b]=It(),[A,C]=It(),k=Er(a,t),S=dt(n);be(()=>(p.set(t,{id:t,key:r,node:w,activatorNode:A,data:S}),()=>{const M=p.get(t);M&&M.key===r&&p.delete(t)}),[p,t]);const N=f.useMemo(()=>({role:m,tabIndex:g,"aria-disabled":s,"aria-pressed":x&&m===Vn?!0:void 0,"aria-roledescription":_,"aria-describedby":d.draggable}),[s,m,g,x,_,d.draggable]);return{active:u,activatorEvent:c,activeNodeRect:h,attributes:N,isDragging:x,listeners:s?void 0:k,node:w,over:v,setNodeRef:b,setActivatorNodeRef:C,transform:y}}function Yr(){return f.useContext(Cs)}const Xr="Droppable",qr={timeout:25};function Jr(e){let{data:t,disabled:n=!1,id:s,resizeObserverConfig:o}=e;const r=pt(Xr),{active:a,dispatch:c,over:u,measureDroppableContainers:h}=f.useContext(Ot),d=f.useRef({disabled:n}),p=f.useRef(!1),v=f.useRef(null),m=f.useRef(null),{disabled:_,updateMeasurementsFor:g,timeout:x}={...qr,...o},y=dt(g??s),w=f.useCallback(()=>{if(!p.current){p.current=!0;return}m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{h(Array.isArray(y.current)?y.current:[y.current]),m.current=null},x)},[x]),b=Pt({callback:w,disabled:_||!a}),A=f.useCallback((N,M)=>{b&&(M&&(b.unobserve(M),p.current=!1),N&&b.observe(N))},[b]),[C,k]=It(A),S=dt(t);return f.useEffect(()=>{!b||!C.current||(b.disconnect(),p.current=!1,b.observe(C.current))},[C,b]),f.useEffect(()=>(c({type:W.RegisterDroppable,element:{id:s,key:r,disabled:n,node:C,rect:v,data:S}}),()=>c({type:W.UnregisterDroppable,key:r,id:s})),[s]),f.useEffect(()=>{n!==d.current.disabled&&(c({type:W.SetDroppableDisabled,id:s,key:r,disabled:n}),d.current.disabled=n)},[s,r,n,c]),{active:a,rect:v,isOver:(u==null?void 0:u.id)===s,node:C,over:u,setNodeRef:k}}function js(e,t,n){const s=e.slice();return s.splice(n<0?s.length+n:n,0,s.splice(t,1)[0]),s}function Qr(e,t){return e.reduce((n,s,o)=>{const r=t.get(s);return r&&(n[o]=r),n},Array(e.length))}function St(e){return e!==null&&e>=0}function Zr(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function ei(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const As=e=>{let{rects:t,activeIndex:n,overIndex:s,index:o}=e;const r=js(t,s,n),a=t[o],c=r[o];return!c||!a?null:{x:c.left-a.left,y:c.top-a.top,scaleX:c.width/a.width,scaleY:c.height/a.height}},yt={scaleX:1,scaleY:1},Ns=e=>{var t;let{activeIndex:n,activeNodeRect:s,index:o,rects:r,overIndex:a}=e;const c=(t=r[n])!=null?t:s;if(!c)return null;if(o===n){const h=r[a];return h?{x:0,y:n<a?h.top+h.height-(c.top+c.height):h.top-c.top,...yt}:null}const u=ti(r,o,n);return o>n&&o<=a?{x:0,y:-c.height-u,...yt}:o<n&&o>=a?{x:0,y:c.height+u,...yt}:{x:0,y:0,...yt}};function ti(e,t,n){const s=e[t],o=e[t-1],r=e[t+1];return s?n<t?o?s.top-(o.top+o.height):r?r.top-(s.top+s.height):0:r?r.top-(s.top+s.height):o?s.top-(o.top+o.height):0:0}const Is="Sortable",Bs=f.createContext({activeIndex:-1,containerId:Is,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:As,disabled:{draggable:!1,droppable:!1}});function Es(e){let{children:t,id:n,items:s,strategy:o=As,disabled:r=!1}=e;const{active:a,dragOverlay:c,droppableRects:u,over:h,measureDroppableContainers:d}=Yr(),p=pt(Is,n),v=c.rect!==null,m=f.useMemo(()=>s.map(k=>typeof k=="object"&&"id"in k?k.id:k),[s]),_=a!=null,g=a?m.indexOf(a.id):-1,x=h?m.indexOf(h.id):-1,y=f.useRef(m),w=!Zr(m,y.current),b=x!==-1&&g===-1||w,A=ei(r);be(()=>{w&&_&&d(m)},[w,m,_,d]),f.useEffect(()=>{y.current=m},[m]);const C=f.useMemo(()=>({activeIndex:g,containerId:p,disabled:A,disableTransforms:b,items:m,overIndex:x,useDragOverlay:v,sortedRects:Qr(m,u),strategy:o}),[g,p,A.draggable,A.droppable,b,m,x,u,v,o]);return f.createElement(Bs.Provider,{value:C},t)}const ni=e=>{let{id:t,items:n,activeIndex:s,overIndex:o}=e;return js(n,s,o).indexOf(t)},si=e=>{let{containerId:t,isSorting:n,wasDragging:s,index:o,items:r,newIndex:a,previousItems:c,previousContainerId:u,transition:h}=e;return!h||!s||c!==r&&o===a?!1:n?!0:a!==o&&t===u},oi={duration:200,easing:"ease"},Ds="transform",ri=Ye.Transition.toString({property:Ds,duration:0,easing:"linear"}),ii={roleDescription:"sortable"};function ai(e){let{disabled:t,index:n,node:s,rect:o}=e;const[r,a]=f.useState(null),c=f.useRef(n);return be(()=>{if(!t&&n!==c.current&&s.current){const u=o.current;if(u){const h=Je(s.current,{ignoreTransform:!0}),d={x:u.left-h.left,y:u.top-h.top,scaleX:u.width/h.width,scaleY:u.height/h.height};(d.x||d.y)&&a(d)}}n!==c.current&&(c.current=n)},[t,n,s,o]),f.useEffect(()=>{r&&a(null)},[r]),r}function Ts(e){let{animateLayoutChanges:t=si,attributes:n,disabled:s,data:o,getNewIndex:r=ni,id:a,strategy:c,resizeObserverConfig:u,transition:h=oi}=e;const{items:d,containerId:p,activeIndex:v,disabled:m,disableTransforms:_,sortedRects:g,overIndex:x,useDragOverlay:y,strategy:w}=f.useContext(Bs),b=ci(s,m),A=d.indexOf(a),C=f.useMemo(()=>({sortable:{containerId:p,index:A,items:d},...o}),[p,o,A,d]),k=f.useMemo(()=>d.slice(d.indexOf(a)),[d,a]),{rect:S,node:N,isOver:M,setNodeRef:$}=Jr({id:a,data:C,disabled:b.droppable,resizeObserverConfig:{updateMeasurementsFor:k,...u}}),{active:R,activatorEvent:D,activeNodeRect:P,attributes:T,setNodeRef:z,listeners:X,isDragging:E,over:H,setActivatorNodeRef:re,transform:we}=Gr({id:a,data:C,attributes:{...ii,...n},disabled:b.draggable}),Le=Eo($,z),K=!!R,ie=K&&!_&&St(v)&&St(x),de=!y&&E,Re=de&&ie?we:null,$e=ie?Re??(c??w)({rects:g,activeNodeRect:P,activeIndex:v,overIndex:x,index:A}):null,ke=St(v)&&St(x)?r({id:a,items:d,activeIndex:v,overIndex:x}):A,xe=R==null?void 0:R.id,F=f.useRef({activeId:xe,items:d,newIndex:ke,containerId:p}),Qe=d!==F.current.items,he=t({active:R,containerId:p,isDragging:E,isSorting:K,id:a,index:A,items:d,newIndex:F.current.newIndex,previousItems:F.current.items,previousContainerId:F.current.containerId,transition:h,wasDragging:F.current.activeId!=null}),Fe=ai({disabled:!he,index:A,node:N,rect:S});return f.useEffect(()=>{K&&F.current.newIndex!==ke&&(F.current.newIndex=ke),p!==F.current.containerId&&(F.current.containerId=p),d!==F.current.items&&(F.current.items=d)},[K,ke,p,d]),f.useEffect(()=>{if(xe===F.current.activeId)return;if(xe!=null&&F.current.activeId==null){F.current.activeId=xe;return}const ze=setTimeout(()=>{F.current.activeId=xe},50);return()=>clearTimeout(ze)},[xe]),{active:R,activeIndex:v,attributes:T,data:C,rect:S,index:A,newIndex:ke,items:d,isOver:M,isSorting:K,isDragging:E,listeners:X,node:N,overIndex:x,over:H,setNodeRef:Le,setActivatorNodeRef:re,setDroppableNodeRef:$,setDraggableNodeRef:z,transform:Fe??$e,transition:Se()};function Se(){if(Fe||Qe&&F.current.newIndex===A)return ri;if(!(de&&!bn(D)||!h)&&(K||he))return Ye.Transition.toString({...h,property:Ds})}}function ci(e,t){var n,s;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(s=e==null?void 0:e.droppable)!=null?s:t.droppable}}O.Down,O.Right,O.Up,O.Left;const li="_header_17vny_1",ui="_left_17vny_14",di="_right_17vny_15",_t={header:li,left:ui,right:di},hi="_buttons_12xlr_1",fi="_button_12xlr_1",gi="_disabled_12xlr_20",st={buttons:hi,button:fi,disabled:gi},pi=()=>{const{undo:e,redo:t,past:n,future:s}=l.useHistoryStore(),[o,r]=f.useState(!1),[a,c]=f.useState(!1),[u,h]=f.useState(!1),[d,p]=f.useState(!1),[v,m]=f.useState(null),{notifications:_,setNotifications:g}=l.useNotificationStore();return f.useEffect(()=>{r(n.length===0)},[n]),f.useEffect(()=>{c(s.length===0)},[s]),i.jsxs("div",{className:st.buttons,children:[i.jsxs("div",{className:l.clx(st.button,{[st.disabled]:o}),onMouseEnter:()=>{const x=setTimeout(()=>{p(!0),h(!1)},200);m(x)},onMouseLeave:()=>{v&&clearTimeout(v),p(!1),h(!1)},children:[i.jsx(j.Icon,{name:"ArrowUUpLeft",width:20,height:20,onClick:()=>{o||(e(),g([..._,{id:l.v4(),message:"Changes undone",status:"success"}]))},fill:o?"#757575":"#252525"}),d&&i.jsx(l.Tooltip,{text:o?"Nothing to undo":"Click to undo changes"})]}),i.jsxs("div",{className:l.clx(st.button,{[st.disabled]:a}),onMouseEnter:()=>{const x=setTimeout(()=>{h(!0),p(!1)},200);m(x)},onMouseLeave:()=>{v&&clearTimeout(v),h(!1),p(!1)},children:[i.jsx(j.Icon,{name:"ArrowUUpRight",width:20,height:20,onClick:()=>{a||(t(),g([..._,{id:l.v4(),message:"Changes redone",status:"success"}]))},fill:a?"#757575":"#252525"}),u&&i.jsx(l.Tooltip,{text:a?"Nothing to redo":"Click to redo changes"})]})]})},mi="_devices_vftsw_1",vi="_device_vftsw_1",bi="_active_vftsw_27",un={devices:mi,device:vi,active:bi},xi=()=>i.jsx("div",{className:un.devices,children:l.devices.map(e=>i.jsx(Si,{device:e}))}),Si=e=>{const{device:t}=e,{currentDevice:n,setCurrentDevice:s}=l.useDeviceStore(),[o,r]=f.useState(!1),[a,c]=f.useState(null);return i.jsxs("div",{className:l.clx(un.device,{[un.active]:n.value===t.value}),onClick:()=>s(t),onMouseEnter:()=>{const u=setTimeout(()=>{r(!0)},200);c(u)},onMouseLeave:()=>{a&&clearTimeout(a),r(!1)},children:[i.jsx(j.Icon,{name:t.icon,fill:n.value===t.value?"var(--builder-text-primary)":"var(--builder-text-secondary)",width:20,height:20}),o&&i.jsx(l.Tooltip,{text:`Switch to ${t.value} view`})]},t.value)},yi="_preview_1hcqg_2",_i="_active_1hcqg_19",Kt={preview:yi,active:_i},Ci=()=>{const{onPreview:e}=l.usePreviewStore(),[t,n]=f.useState(!1),[s,o]=f.useState(null);return i.jsxs("a",{href:"/",className:l.clx(Kt.preview,{[Kt.active]:e}),target:"_blank",onMouseEnter:()=>{const r=setTimeout(()=>{n(!0)},200);o(r)},onMouseLeave:()=>{s&&clearTimeout(s),n(!1)},children:[i.jsx(j.Icon,{name:"ArrowUpRight",width:20,height:20}),i.jsx("span",{className:Kt.text,children:"Preview"}),t&&i.jsx(l.Tooltip,{text:"Open draft theme in new tab"})]})},wi="_settings_u4cv4_1",ki={settings:wi},ji="_pages_ws1ac_1",Ai="_text_ws1ac_21",Ni="_modal_ws1ac_27",Ii="_open_ws1ac_46",Bi="_page_ws1ac_1",Ei="_hoverable_ws1ac_61",Di="_separator_ws1ac_65",Ti="_button_ws1ac_70",Mi="_items_ws1ac_85",ae={pages:ji,default:"_default_ws1ac_5",text:Ai,modal:Ni,open:Ii,page:Bi,hoverable:Ei,separator:Di,button:Ti,items:Mi},Ms=async e=>{const t=localStorage.getItem("shopId")||void 0,n=localStorage.getItem("draftId"),o=`${l.useApiStore.getState().apiUrls.api}/v2/builder/shops/${t}/drafts/${n}/pages/${encodeURIComponent(e)}`;return await l.request({url:o,withToken:!0,method:"delete"})},Ri=()=>{const{currentPage:e,setCurrentPage:t,setIsOpenModal:n,pages:s,setIsEdit:o,setEditedPage:r,deletePage:a,setIsOpenSelectModal:c}=l.usePagesStore(),{deletePage:u,setCurrentBlock:h}=l.useLayersStore(),[d,p]=f.useState(null),{setTitle:v,setDescription:m,setOnConfirm:_}=l.useConfirmationModalStore(),[g,x]=f.useState(!1),y=f.useRef(null);j.useOnClickOutside(y,()=>{g&&x(!1)}),f.useEffect(()=>{g?c(!0):setTimeout(()=>{c(!1)},300)},[g]);const w=b=>b?b.replace(/_/g," ").split(" ").map(A=>A.charAt(0).toUpperCase()+A.slice(1)).join(" "):"";return i.jsxs("div",{className:ae.pages,ref:y,children:[i.jsxs("div",{className:ae.default,onClick:b=>{b.stopPropagation(),x(A=>!A)},children:[i.jsx(j.Icon,{name:s&&s[e]&&s[e].icon||"File",fill:"var(--builder-text-primary)",width:20,height:20}),i.jsx("span",{className:ae.text,children:s&&s[e]&&l.defaultPagePaths.includes(s[e].path)?`${w(s[e].name)} page`:s&&s[e]&&s[e].name}),i.jsx("div",{style:{transform:g?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.3s ease",display:"flex"},children:i.jsx(j.Icon,{name:"CaretDown",width:20,height:20})})]}),i.jsxs("div",{className:l.clx(ae.modal,{[ae.open]:g}),onClick:b=>b.stopPropagation(),children:[s&&i.jsx("div",{className:ae.items,children:Object.keys(s).map(b=>{const A=s[b];return i.jsxs("div",{className:l.clx(ae.page,{[ae.hoverable]:d===b}),onMouseEnter:()=>p(b),onMouseLeave:()=>p(null),onClick:()=>{p(null),o(!1),h(null),t(b),x(!1)},children:[i.jsx(j.Icon,{name:A.icon,fill:"#252525"}),i.jsx("span",{className:ae.text,children:l.defaultPagePaths.includes(A.path)?`${w(A.name)} page`:A.name}),d===b&&i.jsxs(i.Fragment,{children:[i.jsx(j.Icon,{name:"Gear",fill:"#757575",onClick:C=>{C.stopPropagation(),o(!0),r(b),n(!0)}}),!l.defaultPagePaths.includes(A.path)&&i.jsx(j.Icon,{name:"Trash",fill:"#C12A2A",onClick:C=>{C.stopPropagation(),v("Delete Page"),m(`Are you sure you want to delete ${A.name||"this"} page? Once you delete this page, any content visible will also be deleted. This is irreversible.`),_(()=>{C.stopPropagation(),s[e].path===A.path&&t(Object.keys(s)[0]),a(b),u(A.name),Ms(A.path)})}})]}),s[e]&&s[e].name===A.name&&i.jsx(j.Icon,{name:"Check",fill:"var(--brand-color)"})]},b)})}),i.jsx("div",{className:ae.separator}),i.jsxs(j.ButtonSettings,{className:ae.button,onClick:b=>{b.stopPropagation(),n(!0)},size:"l",children:[i.jsx(j.Icon,{name:"Plus",fill:"var(--brand-color)"}),i.jsx("span",{children:"Create New Page"})]})]})]})},Pi="_zoom_16goq_1",Kn={zoom:Pi},Oi=()=>{const{zoomLevel:e,setZoomLevel:t}=l.usePreviewStore();return i.jsxs("label",{htmlFor:"zoom",className:Kn.zoom,children:[i.jsx("label",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center"},htmlFor:"zoom",children:i.jsx(j.Icon,{name:"MagnifyingGlassMinus",width:20,height:20})}),i.jsx("input",{id:"zoom",type:"number",min:25,max:250,value:(e*100).toFixed(0),onChange:n=>{const s=Number(n.target.value);t(s/100)},className:Kn.input}),i.jsx("span",{children:"%"})]})},Li=()=>i.jsxs("div",{className:ki.settings,children:[i.jsx(Ri,{}),i.jsx(Oi,{})]}),$i="_theme_8ncc1_1",Fi="_text_8ncc1_13",Gn={theme:$i,text:Fi},zi=()=>i.jsx("div",{className:Gn.theme,children:i.jsx("div",{className:Gn.text,children:"Live Theme"})}),Hi=async(e,t,n)=>{const s=localStorage.getItem("shopId")||void 0,o=localStorage.getItem("draftId"),a=`${l.useApiStore.getState().apiUrls.api}/v2/builder/shops/${s}/drafts/${o}/${t}`;return await l.request({url:a,withToken:!0,method:e,body:n})};function ot(e,t){var n;try{const s=[],o=(a,c)=>{const u=[],h=d=>{if(!(!d||typeof d!="object")){if(Array.isArray(d)){d.forEach(h);return}Object.entries(d).forEach(([p,v])=>{p===c&&u.push(v),v&&typeof v=="object"&&h(v)})}};return h(a),u};for(const a of t){if(!((n=a==null?void 0:a.value)!=null&&n.blockSettings))continue;const c=a.value.blockSettings,u=Object.values(c).filter(d=>d&&d.type===e).flatMap(d=>d.value);s.push(...u);const h=o(c,e);s.push(...h)}let r=s.filter(a=>a!=null).map(a=>e==="ListingIds"?(a==null?void 0:a.listingId)??a:typeof a=="object"&&a!==null&&Object.prototype.hasOwnProperty.call(a,e)?a[e]:a);if(r.length>0)if(typeof r[0]!="object")r=Array.from(new Set(r));else{const a=new Set;r=r.filter(c=>{const u=JSON.stringify(c);return a.has(u)?!1:(a.add(u),!0)})}return r}catch{return[]}}function Wi(e,t,n){return Ui(e,t)?(n.reviews||[]).length*3:0}function Ui(e,t){return t.map(s=>{if(!s.value||!s.value.blockSettings){console.error("block.value or block.value.blockSettings is undefined.");return}return Object.values(s.value.blockSettings).filter(r=>r&&r.type===e).map(r=>{if(r.value===void 0)throw new Error("item.value is undefined.");return r.value}).flat()}).flat().filter(s=>s).length>0}function Vi(e,t){if(t){const n=Object.keys(t).find(s=>t[s].path===e);if(n)return t[n]}return null}const Ki=({setIsLoading:e,isLoading:t})=>{const{themeSettings:n}=l.useThemeSettingsStore(),{settings:s}=l.useSettingsStore(),[o,r]=f.useState(null),[a,c]=f.useState(!1),{setNotifications:u,notifications:h}=l.useNotificationStore(),{header:d,footer:p,announcement:v,blocks:m}=l.useLayersStore(),{pageContext:_}=l.usePagesStore(),{pages:g}=l.usePagesStore(),x=async()=>{if(a)o&&clearTimeout(o);else{e(!0);const w=Object.keys(m).map(C=>{const k=Vi(C,g);return m[C]&&m[C].data&&(k!=null&&k.path)?{id:k?k.id:C,name:k?k.name:C,path:k.path,layout:{...m[C]},neededProductIds:[...ot("ProductId",Object.values(m[C].data))],neededCategoryIds:[...ot("CategoryId",Object.values(m[C].data))],neededAnnouncementIds:[...ot("AnnouncementId",Object.values(m[C].data))],neededListingIds:[...ot("ListingIds",Object.values(m[C].data))],neededFaqIds:[...ot("FaqsIds",Object.values(m[C].data))],neededReviewCount:Wi("ReviewCount",Object.values(m[C].data),_),neededVouchCount:Object.values(m[C].data).some(S=>S.name==="Vouches")?1e3:void 0,includeLiveStats:Object.values(m[C].data).some(S=>S.name==="LiveActivity"),includeFaqs:Object.values(m[C].data).some(S=>S.name==="FAQ"),seo:{pageTitle:k&&k.seo&&k.seo.pageTitle?k.seo.pageTitle:"",pageDescription:k&&k.seo&&k.seo.pageDescription?k.seo.pageDescription:""},isPrivate:!!(k&&k.visibility==="private")}:null}).filter(C=>C),b={settings:{...s},header:d,footer:p,announcement:v},{status:A}=await Hi("post","save",{themeSettings:n,settings:b,updatedPages:w});u([...h,{id:l.v4(),message:A===200?"Settings saved":"Error",status:A===200?"success":"error"}]),e(!1)}c(!0);const y=setTimeout(()=>{c(!1)},2e3);r(y)};return i.jsx(j.ButtonSettings,{onClick:x,disabled:t,type:"Primary",children:i.jsx("span",{style:{userSelect:"none"},children:"Save"})})},Gi=()=>{const{isOpenSelectModal:e}=l.usePagesStore(),[t,n]=f.useState(!1),{showTooltip:s}=l.useTooltipStore();return i.jsxs("div",{className:_t.header,style:{zIndex:e?5e4:s?501:50},children:[i.jsxs("div",{className:_t.left,children:[i.jsx(xi,{}),i.jsx(Ci,{})]}),i.jsx("div",{className:_t.center,children:i.jsx(Li,{})}),i.jsxs("div",{className:_t.right,children:[i.jsx(zi,{}),i.jsx(pi,{}),i.jsx(Ki,{setIsLoading:n,isLoading:t}),t&&i.jsx(l.Loader,{})]})]})},Yi="_exit_ovvox_1",Xi="_text_ovvox_11",qi="_exitLink_ovvox_16",Gt={exit:Yi,text:Xi,exitLink:qi},Ji=()=>i.jsx("div",{className:Gt.exit,children:i.jsxs("a",{href:location.origin,className:Gt.exitLink,children:[i.jsx(j.Icon,{name:"SignOut",width:20,height:20}),i.jsx("span",{className:Gt.text,children:"Exit"})]})}),Qi="_navbar_1lnmu_1",Zi="_main_1lnmu_8",ea="_block_1lnmu_15",ta="_active_1lnmu_31",Ct={navbar:Qi,main:Zi,block:ea,active:ta},na=()=>{const{activeBlock:e}=l.useNavbarStore(),{setActiveBlock:t}=l.useBlocksStore(),{setCurrentBlock:n}=l.useLayersStore(),{setActiveBlock:s}=l.useThemeSettingsStore(),{setActiveBlock:o}=l.usePreviewStore(),r=l.useNavigate();function a(c){switch(t(null),n(null),s(null),o({id:null,neededScroll:!1}),c.name){case"Layers":r("/admin/builder");break;case"Add":r("/admin/builder/add");break;case"Theme":r("/admin/builder/theme");break;case"Settings":r("/admin/builder/settings");break}}return i.jsxs("div",{className:Ct.navbar,children:[i.jsx(Ji,{}),i.jsx("div",{className:Ct.main,children:l.navbarBlocks.map(c=>i.jsxs("div",{className:l.clx(Ct.block,{[Ct.active]:e.icon===c.icon}),onClick:()=>a(c),children:[i.jsx(j.Icon,{name:c.icon,fill:e.icon===c.icon?"var(--builder-text-primary)":"var(--builder-text-secondary)"}),i.jsx("span",{children:c.name})]},c.icon))})]})},sa="_preview_ltg9y_1",oa="_main_ltg9y_15",ra="_content_ltg9y_25",ia="_loading_ltg9y_34",aa="_previewLoading_ltg9y_65",rt={preview:sa,main:oa,content:ra,loading:ia,previewLoading:aa},ca="_header_17siy_2",la="_circles_17siy_16",ua="_circle_17siy_16",da="_red_17siy_32",ha="_green_17siy_36",fa="_yellow_17siy_40",ga="_input_17siy_44",pa="_main_17siy_55",ma="_text_17siy_63",va="_copy_17siy_75",pe={header:ca,circles:la,circle:ua,red:da,green:ha,yellow:fa,input:ga,main:pa,text:ma,copy:va},ba=["red","yellow","green"],xa=()=>{const{currentDevice:e}=l.useDeviceStore(),t=(o,r)=>o.length>r?o.slice(0,r)+"...":o,{notifications:n,setNotifications:s}=l.useNotificationStore();return i.jsxs("div",{className:pe.header,children:[i.jsx("div",{className:pe.circles,children:ba.map(o=>i.jsx("div",{className:l.clx(pe.circle,{[pe.red]:o==="red",[pe.yellow]:o==="yellow",[pe.green]:o==="green"})},o))}),i.jsx("div",{className:pe.input,children:i.jsxs("div",{className:pe.main,children:[i.jsx(j.Icon,{name:"Lock",fill:"#757575",width:15,height:16}),i.jsx("span",{className:pe.text,children:e.value==="mobile"?t(window.location.origin,35):e.value==="desktop"?t(window.location.origin,200):t(window.location.origin,100)})]})}),i.jsx(j.ButtonSettings,{type:"Secondary",style:{padding:"8px"},onClick:()=>{navigator.clipboard.writeText(window.location.origin),s([...n,{id:l.v4(),status:"success",message:"Domain copied to clipboard"}])},className:pe.copy,children:i.jsx(j.Icon,{name:"Copy",width:20,height:20,fill:"#252525"})})]})},Sa="_content_s4v4v_1",ya="_main_s4v4v_12",_a="_block_s4v4v_16",Ca="_active_s4v4v_22",wa="_name_s4v4v_32",ka="_addSection_s4v4v_109",ja="_addSectionTop_s4v4v_117",Ee={content:Sa,main:ya,block:_a,active:Ca,name:wa,addSection:ka,addSectionTop:ja},Aa="_sidebar_p1ojw_1",Na="_content_p1ojw_14",Ia="_button_p1ojw_24",Ba="_moveButton_p1ojw_40",Ea="_deleteButton_p1ojw_49",me={sidebar:Aa,content:Na,button:Ia,moveButton:Ba,deleteButton:Ea},Da=()=>{var C;const{activeBlock:e,setActiveBlock:t}=l.usePreviewStore(),{blocks:n,removeBlock:s,moveBlock:o,duplicateBlock:r,setCurrentBlock:a}=l.useLayersStore(),{currentPage:c,pages:u}=l.usePagesStore(),{setTitle:h,setDescription:d,setOnConfirm:p}=l.useConfirmationModalStore(),{setActiveBlock:v}=l.useBlocksStore(),m=(C=u==null?void 0:u[c])==null?void 0:C.path,_=m?n[m]:null,g=(_==null?void 0:_.order)||[],x=g.indexOf(e.id),y=k=>{k.stopPropagation(),x>0&&m&&(o(m,x,x-1),t({id:e.id,neededScroll:!0}),setTimeout(()=>{t({id:e.id,neededScroll:!1})},100))},w=k=>{k.stopPropagation(),x<g.length-1&&m&&(o(m,x,x+1),t({id:e.id,neededScroll:!0}),setTimeout(()=>{t({id:e.id,neededScroll:!1})},100))},b=k=>{k.stopPropagation(),m&&r(m,e.id)},A=()=>{m&&(s(m,e.id),a(null),v(null),t({id:null,neededScroll:!1}))};return i.jsx("div",{className:me.sidebar,children:i.jsxs("div",{className:me.content,children:[i.jsx("button",{onClick:y,className:l.clx(me.button,me.moveButton),disabled:x===0,children:i.jsx(j.Icon,{name:"ArrowUp"})}),i.jsx("button",{onClick:w,className:l.clx(me.button,me.moveButton),disabled:x===g.length-1,children:i.jsx(j.Icon,{name:"ArrowDown"})}),i.jsx("button",{onClick:b,className:l.clx(me.button,me.moveButton),children:i.jsx(j.Icon,{name:"Copy"})}),i.jsx("button",{className:l.clx(me.button,me.deleteButton),onClick:k=>{k.stopPropagation(),h("Remove Block"),d(`Are you sure you want to delete ${(_==null?void 0:_.data[e.id].name)||"this"} block? Once you delete this block, any content visible will also be deleted. This is irreversible.`),p(A)},children:i.jsx(j.Icon,{name:"Trash",hoverable:!0,fill:"#C12A2A"})})]})})},Ta=f.memo(({scrollableRef:e})=>{const{setActiveBlock:t,activeBlock:n,zoomLevel:s}=l.usePreviewStore(),{blocks:o,sourceBlocks:r}=l.useBlocksStore(),{blocks:a,setCurrentBlock:c,currentBlock:u,setPositionBlock:h,announcement:d}=l.useLayersStore(),{settings:p}=l.useSettingsStore(),{currentPage:v,pages:m,pageContext:_}=l.usePagesStore(),{activeBlock:g,setActiveBlock:x}=l.useThemeSettingsStore(),{setError:y}=l.useErrorStore(),{setActiveBlock:w}=l.useBlocksStore(),b=f.useRef(n.id),A=f.useRef({});f.useEffect(()=>{if(n.id&&n.neededScroll&&A.current[n.id]){const S=A.current[n.id];if(S&&e.current){const N=S.offsetTop;e.current.scrollTo({top:N-30,behavior:"smooth"})}}},[n,e]);const C=l.useNavigate();f.useEffect(()=>{b.current=n.id},[n.id]);const k=S=>{if(!S||!S.name)return y({message:"Block or block.name is undefined.",failedSettings:!1,failedThemeSettings:!1,failedPageIds:m&&m[v].id?[m[v].id]:[]}),i.jsx(j.ErrorableBlock,{error:"Block or block.name is undefined."});if(!o||!o[S.name])return y({message:'Block "${block.name}" does not exist in blocks.',failedSettings:!1,failedThemeSettings:!1,failedPageIds:m&&m[v].id?[m[v].id]:[]}),i.jsx(j.ErrorableBlock,{error:`Block "${S.name}" does not exist in blocks.`});const N=new o[S.name];return S.value&&Object.assign(N,S.value),N.renderBlock(p,_)};return i.jsxs("div",{onClick:S=>{S.stopPropagation()},className:Ee.content,style:{width:"100%",height:"100%",zoom:`${s}`},ref:e,children:[d&&i.jsx(fn,{}),i.jsx(hn,{}),i.jsx("div",{className:Ee.main,children:m&&m[v]&&a[m[v].path]&&a[m[v].path].data&&a[m[v].path].order.map(S=>i.jsxs("div",{ref:N=>A.current[S]=N,onClick:N=>{N.stopPropagation(),w(null),g&&x(null),t({id:S,neededScroll:!0}),setTimeout(()=>{t({id:S,neededScroll:!1})},100),c(null),u?setTimeout(()=>{c(n.id)},100):c(n.id)},onMouseEnter:N=>{N.stopPropagation(),n.neededScroll||t({id:S,neededScroll:!1})},onMouseLeave:N=>{N.stopPropagation(),n.neededScroll||t({id:null,neededScroll:!1})},className:l.clx(Ee.block),children:[(n.id===S||u===S)&&i.jsx("div",{className:Ee.active}),(n.id===S||u===S)&&i.jsx("div",{className:Ee.name,children:l.getDisplayName(a[m[v].path].data[S].name,r)}),(n.id===S||u===S)&&l.getDisplayName(a[m[v].path].data[S].name,r)!=="unknown name"&&i.jsx(Da,{}),(n.id===S||u===S)&&l.getDisplayName(a[m[v].path].data[S].name,r)!=="unknown name"&&i.jsx("div",{className:Ee.addSection,children:i.jsx(j.ButtonSettings,{type:"Primary",onClick:N=>{N.stopPropagation(),h(S,!0),c(null),t({id:null,neededScroll:!1}),w(null),C("/admin/builder/add")},children:"Add Section"})}),(n.id===S||u===S)&&l.getDisplayName(a[m[v].path].data[S].name,r)!=="unknown name"&&i.jsx("div",{className:l.clx(Ee.addSection,Ee.addSectionTop),children:i.jsx(j.ButtonSettings,{type:"Primary",onClick:N=>{N.stopPropagation(),h(S,!1),c(null),t({id:null,neededScroll:!1}),w(null),C("/admin/builder/add")},children:"Add Section"})}),o&&i.jsx(Tt,{render:k,block:a[m[v].path].data[S]})]},S))}),i.jsx(dn,{})]})}),Ma="_results_1pahy_1",Yn={results:Ma};function Ra(e,t){return t?new t[e]().blockSettings.isAddable:!1}function Xn(e,t){return e?Object.keys(e||{}).reduce((n,s)=>(Ra(s,t)&&n.push({name:s,displayName:l.getDisplayName(s,t)}),n),[]):[]}const Pa="_product_wgb53_1",Oa="_name_wgb53_15",Yt={product:Pa,name:Oa},La=e=>{const{blockId:t,setSearchValue:n}=e,{sourceBlocks:s,setActiveBlock:o}=l.useBlocksStore(),{hideModal:r,hoverBlockId:a,isModalVisible:c,showPreview:u,hidePreview:h,clearHideTimeout:d,startHideTimeout:p,setHoverBlockTopPosition:v}=l.useSubmodalStore();function m(x){n(""),o(x),r("keyBlock")}function _(x,y){const w=window.innerHeight,b=400,A=10;let C=y.clientY-120;C+b>w&&(C=w-b-A),C<A&&(C=A),a||r("keyBlock"),u(x,"keyBlock"),d(),v(C)}function g(){c?p("keyBlock"):h("keyBlock"),v(null)}return i.jsxs("div",{className:Yt.product,onClick:()=>m(t),onMouseEnter:x=>_(t,x),onMouseLeave:g,children:[(()=>{const x=l.blockIcons[t];return x?i.jsx(x,{className:Yt.icon}):i.jsx(j.Icon,{name:"Cards"})})(),i.jsx("span",{className:Yt.name,children:l.getDisplayName(t,s)}),i.jsx(j.Icon,{name:"CaretRight",width:20,height:20})]},t)},Rs=()=>{const{blocks:e,sourceBlocks:t}=l.useBlocksStore(),[n,s]=f.useState(""),[o,r]=f.useState([]),a=f.useMemo(()=>Xn(e,t),[e,t]),c=f.useMemo(()=>new Oe(a,{keys:["displayName"],threshold:.4}),[a]);return f.useEffect(()=>{if(n.trim()==="")r(Xn(e,t));else{const u=c.search(n);r(u.map(h=>h.item))}},[n,c]),i.jsxs(i.Fragment,{children:[i.jsx(j.InputSettings,{type:"text",placeholder:"Search for sections",isSearch:!0,onChange:s,value:n,style:{marginBottom:10}}),i.jsx("div",{className:Yn.results,children:o.length>0?o.map(u=>i.jsx(La,{blockId:u.name,setSearchValue:s})):i.jsx("div",{className:Yn.noResults,children:"No sections found"})})]})},$a=()=>{const{onPreview:e,zoomLevel:t}=l.usePreviewStore(),{keyBlock:n,hoverBlockId:s,isModalVisible:o,hoverBlockTopPosition:r}=l.useSubmodalStore(),{settings:a}=l.useSettingsStore(),{sourceBlocks:c}=l.useBlocksStore(),{pageContext:u}=l.usePagesStore(),{showModal:h}=l.useColorPickerStore(),{currentDevice:d}=l.useDeviceStore(),{isLoadingThemeSettings:p}=l.useThemeSettingsStore(),{isLoadingLayers:v}=l.useLayersStore(),m=b=>b?!c||!c[b]?i.jsx(j.ErrorableBlock,{error:`Block "${b}" does not exist in blocks.`}):new c[b]().renderPreview(a,u):i.jsx(j.ErrorableBlock,{error:"Block or block.name is undefined."});function _(){if(d.value==="desktop")return t>=1?"100%":`${(t*100).toFixed(2)}%`;{const b=d.value==="tablet"?768:425;return t>=1?`${b}px`:`${(b*t).toFixed(2)}px`}}function g(){switch(d.value){case"desktop":return"100%";case"tablet":return 768;case"mobile":return 425;default:return"100%"}}const{isOpenSelectModal:x}=l.usePagesStore(),y=f.useRef(null),w=b=>{y.current&&(y.current.scrollTop+=b.deltaY)};return i.jsxs("div",{className:rt.preview,style:{zIndex:h&&!x?5e3:500},onWheel:b=>{b.stopPropagation(),w(b)},children:[o&&i.jsx(l.AddSectionSubmodal,{children:i.jsx(Rs,{})}),i.jsxs(l.Submodal,{positionTop:r,positionLeft:!s&&n?void 0:250,children:[!p&&!v&&i.jsx(Tt,{render:m,block:n},n),(p||!n||v)&&i.jsx("div",{className:rt.previewLoading,children:i.jsx(l.Loader,{})})]}),h&&i.jsx(l.ColorPickerModal,{}),e&&i.jsxs("div",{className:rt.main,style:{width:g()},children:[i.jsx(xa,{}),i.jsx("div",{style:{borderLeft:_()==="100%"?"none":"var(--default-border)",borderRight:_()==="100%"?"none":"var(--default-border)",width:"100%",display:"flex",flexDirection:"column",alignItems:"center",height:"calc(100vh - 160px)",overflowY:"scroll",overflowX:"hidden"},onScroll:b=>{b.stopPropagation()},onWheel:b=>{b.stopPropagation()},children:!p&&!v?i.jsx("div",{className:rt.content,style:{width:_()},children:i.jsx(Ta,{scrollableRef:y})}):i.jsx("div",{className:rt.loading,children:i.jsx(l.Loader,{})})})]})]})},Fa="_sidebar_zs8s9_1",za="_title_zs8s9_13",qn={sidebar:Fa,title:za},Ha="_layers_1ai1e_1",Wa="_wrapper_1ai1e_10",Ua="_draggingWrapper_1ai1e_18",Va="_block_1ai1e_22",Ka="_dragging_1ai1e_18",Ga="_active_1ai1e_57",Ya="_add_1ai1e_64",Xa="_addTop_1ai1e_80",qa="_visible_1ai1e_96",Ja="_button_1ai1e_100",Qa="_nameBlock_1ai1e_159",Za="_loader_1ai1e_163",ec="_actions_1ai1e_172",tc="_deleteButton_1ai1e_180",Y={layers:Ha,wrapper:Wa,draggingWrapper:Ua,block:Va,dragging:Ka,active:Ga,add:Ya,addTop:Xa,visible:qa,button:Ja,nameBlock:Qa,loader:Za,actions:ec,deleteButton:tc},nc="_block_owmqd_1",sc="_title_owmqd_17",oc="_actions_owmqd_21",De={block:nc,title:sc,actions:oc},Jn={header:"Header",footer:"Footer",announcement:"Announcement"},Xt=({id:e})=>{const{setCurrentBlock:t}=l.useLayersStore(),{activeBlock:n}=l.usePreviewStore(),[s,o]=f.useState(!1);function r(a){t(a)}return i.jsxs("div",{className:l.clx(De.block,{[De.active]:n.id===e,[De.header]:e==="header",[De.footer]:e==="footer",[De.announcement]:e==="announcement"}),onClick:()=>r(e),onMouseOver:()=>o(!0),onMouseLeave:()=>o(!1),children:[(()=>{const a=l.blockIcons[Jn[e]];return a?i.jsx(a,{width:20,height:20,className:De.icon}):i.jsx(j.Icon,{name:"Cards",width:20,height:20})})(),i.jsx("span",{className:De.title,children:Jn[e]}),i.jsx("div",{className:De.actions,children:i.jsx(j.Icon,{name:"PushPin",hoverable:!0,width:20,height:20,fill:"var(--builder-text-secondary)"})})]})},rc=({id:e,name:t,onClick:n,isDragging:s,icon:o})=>{const{activeBlock:r,setActiveBlock:a}=l.usePreviewStore(),{showPreview:c,hidePreview:u,showModal:h,hideModal:d,clearHideTimeout:p,startHideTimeout:v,hoverBlockId:m,isModalVisible:_}=l.useSubmodalStore(),{setPositionBlock:g}=l.useLayersStore(),[x,y]=f.useState(!1),[w,b]=f.useState(!1),[A,C]=f.useState(!1),[k,S]=f.useState(!1),[N,M]=f.useState(null),$=f.useRef(null),{attributes:R,listeners:D,setNodeRef:P,transform:T,transition:z}=Ts({id:e}),X={transform:Ye.Transform.toString(T),transition:z},{setTitle:E,setDescription:H,setOnConfirm:re}=l.useConfirmationModalStore(),{pages:we,currentPage:Le}=l.usePagesStore(),{removeBlock:K}=l.useLayersStore(),ie=L=>{L.stopPropagation(),$.current&&clearTimeout($.current),a({id:e,neededScroll:!0}),_&&d(),c(e),p()},de=(L,$e=!0)=>{L.stopPropagation(),u(),h(e),p(),g(e,$e)},Re=L=>{L.stopPropagation(),a({id:null,neededScroll:!1}),_?v():u()};return f.useEffect(()=>{C(!1),y(!1),b(!1),S(!1)},[s]),f.useEffect(()=>{_||(b(!1),y(!1))},[_]),i.jsxs("div",{ref:P,style:X,className:l.clx(Y.wrapper,{[Y.draggingWrapper]:s&&r.id===e}),onClick:L=>{L.stopPropagation(),n(e)},onMouseEnter:ie,onMouseLeave:Re,...R,...D,children:[i.jsxs("div",{className:l.clx(Y.block,{[Y.dragging]:s&&r.id===e,[Y.active]:!s&&r.id===e}),children:[o?i.jsx(o,{width:20,height:20}):i.jsx(j.Icon,{name:"Cards",width:20,height:20}),i.jsx("span",{className:Y.nameBlock,children:t}),m===e&&!s&&i.jsx("div",{className:l.clx(Y.addTop,{[Y.visible]:w}),onMouseEnter:()=>{b(!0)},onMouseLeave:()=>{b(!1)},children:i.jsxs("button",{className:Y.button,onClick:L=>de(L,!1),onMouseEnter:()=>{const L=setTimeout(()=>{s||S(!0)},200);M(L)},onMouseLeave:()=>{N&&clearTimeout(N),S(!1)},children:[i.jsx(j.Icon,{name:"Plus",fill:"#fff"}),k&&i.jsx(l.Tooltip,{text:"Click to add a section"})]})}),m===e&&!s&&i.jsx("div",{className:l.clx(Y.add,{[Y.visible]:x}),onMouseEnter:()=>{y(!0)},onMouseLeave:()=>{y(!1)},children:i.jsxs("button",{className:Y.button,onClick:L=>de(L),onMouseEnter:()=>{const L=setTimeout(()=>{s||C(!0)},200);M(L)},onMouseLeave:()=>{N&&clearTimeout(N),C(!1)},children:[i.jsx(j.Icon,{name:"Plus",fill:"#fff"}),A&&i.jsx(l.Tooltip,{text:"Click to add a section"})]})})]}),m===e&&!s&&i.jsxs("div",{className:Y.actions,children:[i.jsx(j.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20}),i.jsx("div",{className:Y.deleteButton,onClick:L=>{L.stopPropagation(),E("Remove Block"),H(`Are you sure you want to delete ${t||"this"} block? Once you delete this block, any content visible will also be deleted. This is irreversible.`),re(()=>{we&&K(we[Le].path,e)})},children:i.jsx(j.Icon,{name:"Trash",fill:"#C12A2A",hoverable:!0,width:20,height:20})})]})]})},ic=()=>{const{blocks:e,setCurrentBlock:t,currentBlock:n,moveBlock:s,isLoadingLayers:o,announcement:r}=l.useLayersStore(),{currentPage:a,pages:c}=l.usePagesStore(),{setMouseOverModal:u,setHoverBlockId:h}=l.useSubmodalStore(),{sourceBlocks:d}=l.useBlocksStore();function p(y){t(y),u(!1),h(null)}const v=ds(us(Rt,{activationConstraint:{distance:5}})),[m,_]=f.useState(!1),g=()=>{_(!0)},x=y=>{_(!1);const{active:w,over:b}=y;if(b&&w.id!==b.id&&c&&c[a]){const A=c[a].path,C=e[A].order,k=C.indexOf(w.id),S=C.indexOf(b.id);k!==-1&&S!==-1&&s(A,k,S)}};return i.jsx("div",{className:Y.layers,children:o?i.jsx("div",{className:Y.loader,children:i.jsx(l.Loader,{})}):i.jsxs(i.Fragment,{children:[r&&i.jsx(Xt,{id:"announcement"}),i.jsx(Xt,{id:"header"}),!n&&i.jsx(ks,{sensors:v,onDragEnd:x,onDragStart:g,children:c&&c[a]&&e[c[a].path]&&i.jsx(Es,{items:e[c[a].path].order,strategy:Ns,children:e[c[a].path].order.map((y,w)=>i.jsx(rc,{id:y,name:l.getDisplayName(e[c[a].path].data[y].name,d),index:w,onClick:p,isDragging:m,icon:l.blockIcons[e[c[a].path].data[y].name]},y))})}),i.jsx(Xt,{id:"footer"})]})})},ac="_loader_eyvkk_1",cc={loader:ac},lc=()=>{const{isLoadingSettings:e}=l.useSettingsStore();return e?i.jsx("div",{className:cc.loader,children:i.jsx(l.Loader,{})}):i.jsx(uc,{})},uc=()=>{const{settings:e}=l.useSettingsStore(),{settings:t,setSettingsInstance:n}=l.useBlocksStore();if(!e)return null;const{setError:s}=l.useErrorStore(),o=new t(e);f.useEffect(()=>{n(o)},[e]);try{return o.renderSettings()}catch(r){throw console.error("Error rendering settings:",r),s({message:"Error rendering settings",failedPageIds:[],failedThemeSettings:!1,failedSettings:!0}),r}},dc="_theme_8b5no_1",hc="_block_8b5no_9",fc="_name_8b5no_24",gc="_loader_8b5no_28",wt={theme:dc,block:hc,name:fc,loader:gc},pc=()=>{const e=l.useNavigate(),{isAntistock:t}=l.useGeneralStore(),{isLoadingThemeSettings:n,setActiveBlock:s}=l.useThemeSettingsStore(),o=[{icon:"PaintBrushBroad",name:"Colors"},{icon:"TextAa",name:"Fonts"},{icon:"CornersOut",name:"Borders"},{icon:"ArrowSquareIn",name:"Buttons"}];function r(a){switch(a==null?void 0:a.name){case"Colors":e("/admin/builder/theme/colors"),s(l.themeSettingsBlocks[0]);break;case"Fonts":e("/admin/builder/theme/fonts"),s(l.themeSettingsBlocks[1]);break;case"Borders":e("/admin/builder/theme/borders"),s(l.themeSettingsBlocks[2]);break;case"Buttons":e("/admin/builder/theme/buttons"),s(l.themeSettingsBlocks[3]);break;case"Inputs":e("/admin/builder/theme/inputs"),s(l.themeSettingsBlocks[4]);break}}return i.jsx("div",{className:wt.theme,children:n?i.jsx("div",{className:wt.loader,children:i.jsx(l.Loader,{})}):(t?o:l.themeSettingsBlocks).map(a=>i.jsxs("div",{onClick:()=>r(a),className:l.clx(wt.block),children:[i.jsx(j.Icon,{name:a.icon}),i.jsx("span",{className:wt.name,children:a.name}),i.jsx(j.Icon,{name:"CaretRight"})]},a.icon))})},mc="_render_1k1k0_9",vc="_open_1k1k0_24",bc="_close_1k1k0_51",xc="_clicked_1k1k0_55",Sc="_loading_1k1k0_72",yc="_settings_1k1k0_76",Ke={render:mc,open:vc,close:bc,clicked:xc,loading:Sc,settings:yc},_c=({block:e})=>{const{pageContext:t}=l.usePagesStore(),{setError:n}=l.useErrorStore();try{return e.renderSettings(t)}catch(s){throw console.error("Error rendering settings:",s),n({message:"Error rendering block settings",failedPageIds:[],failedThemeSettings:!1,failedSettings:!0}),s}},Cc="_wrapper_1xfvz_1",wc="_header_1xfvz_8",kc="_title_1xfvz_15",jc="_colorWrapper_1xfvz_21",Ac="_name_1xfvz_35",Nc="_color_1xfvz_21",Ic="_value_1xfvz_47",Bc="_length_1xfvz_51",se={wrapper:Cc,header:wc,title:kc,colorWrapper:jc,name:Ac,color:Nc,value:Ic,length:Bc},Ec=e=>{const{colors:t}=e,{themeSettings:n}=l.useThemeSettingsStore(),[s,o]=f.useState(!0);f.useEffect(()=>{t.length<=3&&o(!0)},[]);function r(a){const c=a.replace("--",""),[u,h]=c.split("-"),d=`${h.charAt(0).toUpperCase()+h.slice(1)} ${u.charAt(0).toUpperCase()+u.slice(1)}`,[p,v]=c.split("-");return{name:d,field:p,variable:v}}return i.jsxs("div",{className:se.wrapper,children:[i.jsxs("div",{className:se.header,children:[i.jsx("div",{className:se.title,children:"Section Colors"}),!s&&i.jsxs("div",{className:l.clx(se.value,se.length),onClick:()=>o(!0),children:["+",t.length]})]}),s&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:se.colors,children:t.map(a=>{const c=r(a),{variable:u,name:h,field:d}=c;return i.jsx(Dc,{color:n.colors[d][u],name:h})})}),t.length>3&&i.jsxs("div",{className:l.clx(se.value,se.length),onClick:()=>o(!1),children:["Hide ",t.length," colors"]})]})]})},Dc=e=>{const{name:t,color:n}=e,{setActiveLabel:s,setModalPosition:o,setInitialColor:r,setShowModal:a,setUpdate:c,setColor:u,setColorChange:h,colorChange:d,setIsGradientActive:p,setIsBlockSettings:v}=l.useColorPickerStore(),{updateColor:m}=l.useThemeSettingsStore(),_=(y,w)=>b=>{m(y,w,b)};f.useEffect(()=>{const y=()=>{a(!1),s(null),r(n),c(()=>{}),u(n),h(()=>{})};return document.body.addEventListener("click",y),()=>{document.body.removeEventListener("click",y)}},[]);const g=y=>{const w=t.split("/")[0],b=w.split(" ")[0].toLowerCase(),A=w.split(" ")[1].toLowerCase();y.stopPropagation(),a(!0),h(d),c(S=>_(A,b)(S)),r(n),u(n),v(!0),p(A==="surface");const{top:C,left:k}=l.getModalPosition(y,550,288,10,20,230,80);o({top:A==="surface"?C:C+125,left:k-200})};function x(y){return y.length>15?y.slice(0,15)+"...":y}return i.jsxs("div",{className:se.colorWrapper,onClick:g,children:[i.jsx("div",{className:se.color,style:{background:n}}),i.jsx("div",{className:se.name,children:t}),i.jsx("div",{className:se.value,children:x(n)})]})},Tc="_back_1rhiq_1",Mc="_title_1rhiq_9",Rc="_deleteButton_1rhiq_17",Pc="_backIcon_1rhiq_30",kt={back:Tc,title:Mc,deleteButton:Rc,backIcon:Pc},Oc=({onClick:e,setIsClicked:t,getDisplayName:n})=>{var v,m;const{activeBlock:s}=l.useBlocksStore(),{setTitle:o,setDescription:r,setOnConfirm:a}=l.useConfirmationModalStore(),{blocks:c,currentBlock:u,removeBlock:h}=l.useLayersStore(),{currentPage:d,pages:p}=l.usePagesStore();return i.jsxs("div",{className:kt.back,children:[i.jsx("div",{className:kt.backIcon,onClick:()=>e(),children:i.jsx(j.Icon,{name:"CaretLeft",hoverable:!0,width:20,height:20})}),i.jsx("h3",{className:kt.title,children:s&&n(s)||p&&p[d]&&c[p[d].path]&&u&&n((v=c[p[d].path].data[u])==null?void 0:v.name)||u&&l.formatLabel(u)||"Loading"}),u&&p&&!["header","footer","announcement"].includes(u)&&c[p[d].path].data[u]&&n((m=c[p[d].path].data[u])==null?void 0:m.name)!=="unknown name"&&i.jsx("button",{onClick:_=>{var g;_.stopPropagation(),o("Remove Block"),r(`Are you sure you want to delete ${n((g=c[p[d].path].data[u])==null?void 0:g.name)||"this"} block? Once you delete this block, any content visible will also be deleted. This is irreversible.`),a(()=>{t(!0),h(p[d].path,u),e(!0)})},className:kt.deleteButton,children:i.jsx(j.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A"})})]})},Lc=()=>{const e=l.useNavigate(),[t,n]=f.useState(!1),{header:s,footer:o,announcement:r,sourceBlocks:a,activeBlock:c,setActiveBlock:u,currentInstance:h,setCurrentInstance:d}=l.useBlocksStore(),{setActiveBlock:p}=l.usePreviewStore(),{blocks:v,addBlock:m,editBlock:_,currentBlock:g,setCurrentBlock:x,header:y,footer:w,announcement:b,isLoadingLayers:A}=l.useLayersStore(),{currentPage:C,pages:k}=l.usePagesStore(),{past:S,future:N}=l.useHistoryStore();function M(D=!1){if(k&&h&&g&&!["header","footer","announcement"].includes(g)&&!D){const P={blockSettings:{}};Object.keys(h.blockSettings).filter(T=>!["displayName","isAddable"].includes(T)).map(T=>{P.blockSettings[T]=h.blockSettings[T]}),_(k[C].path,g,{name:v[k[C].path].data[g].name,value:P})}u(null),x(null),p({id:null,neededScroll:!1}),setTimeout(()=>{n(!1)},150),d(null)}function $(D){var X;if(!k||!C||!D)return null;if(D==="header"){const E=new s;return Object.keys(E.blockSettings).forEach(H=>{E.blockSettings[H]=y==null?void 0:y.blockSettings[H]}),Object.keys(E.blockColors).forEach(H=>{E.blockColors[H]=y==null?void 0:y.blockColors[H]}),E}if(D==="footer"){const E=new o;return Object.keys(E.blockSettings).forEach(H=>{E.blockSettings[H]=w==null?void 0:w.blockSettings[H]}),Object.keys(E.blockColors).forEach(H=>{E.blockColors[H]=w==null?void 0:w.blockColors[H]}),E}if(D==="announcement"){const E=new r;return Object.keys(E.blockSettings).forEach(H=>{E.blockSettings[H]=b==null?void 0:b.blockSettings[H]}),Object.keys(E.blockColors).forEach(H=>{E.blockColors[H]=b==null?void 0:b.blockColors[H]}),E}const P=v[k[C].path];if(!P||!P.data[D])return null;const T=P.data[D];return!T||!a[T.name]?null:new a[T.name]((X=T.value)==null?void 0:X.blockSettings)}f.useEffect(()=>{if(g){const D=$(g);d(D)}else d(null)},[g,S,N,c]),f.useEffect(()=>{if(c&&k&&!g){const D={blockSettings:{},blockColors:{}},P=new a[c];d(P),Object.keys(P.blockSettings).filter(z=>!["displayName","isAddable"].includes(z)).map(z=>{D.blockSettings[z]=P.blockSettings[z]}),Object.keys(P.blockColors).filter(z=>!["displayName","isAddable"].includes(z)).map(z=>{D.blockColors[z]=P.blockColors[z]});const T=m(k[C].path,{name:c,value:D});p({id:T,neededScroll:!0}),x(T),e("/admin/builder")}},[c,S,N]);function R(D){if(!a)return"unknown name";if(!a[D])return g==="header"?y==null?void 0:y.blockSettings.displayName:g==="footer"?w==null?void 0:w.blockSettings.displayName:g==="announcement"?b==null?void 0:b.blockSettings.displayName:"unknown name";const P=new a[D];return!P.blockSettings||!P.blockSettings.displayName?"unknown name":P.blockSettings.displayName}return i.jsxs("div",{className:l.clx(Ke.render,{[Ke.open]:g,[Ke.close]:!g,[Ke.clicked]:t}),onClick:D=>D.stopPropagation(),style:{opacity:A?0:1},children:[i.jsx(Oc,{onClick:M,setIsClicked:n,getDisplayName:R}),i.jsxs("div",{className:Ke.settings,children:[h&&i.jsxs(i.Fragment,{children:[i.jsx(_c,{block:h}),i.jsx(Ec,{colors:h.blockColors})]}),!c&&!g&&i.jsx("div",{className:Ke.loading,children:"Loading"})]})]})},$c="_header_1u3yu_1",Fc="_title_1u3yu_9",zc="_backIcon_1u3yu_15",qt={header:$c,title:Fc,backIcon:zc},mt=({onClick:e,title:t})=>i.jsxs("div",{className:qt.header,children:[i.jsx("div",{className:qt.backIcon,onClick:e,children:i.jsx(j.Icon,{name:"CaretLeft",hoverable:!0,width:20,height:20})}),i.jsx("span",{className:qt.title,children:t})]}),Hc="_options_ymds7_1",Wc={options:Hc},Uc=()=>{var h,d;const{activeBlock:e,themeSettings:t,updateBorder:n,setActiveBlock:s}=l.useThemeSettingsStore();function o(p,v){n(v,p)}const r=l.useNavigate();function a(){s(null),r("/admin/builder/theme")}const c=f.useMemo(()=>t.borders,[t]),u=(e==null?void 0:e.name)==="Borders";return i.jsxs(l.AnimatedPanel,{isOpen:u,isClose:!u,children:[i.jsx(mt,{onClick:a,title:"Borders Style"}),i.jsxs("div",{className:Wc.options,children:[i.jsx(j.SelectSettings,{label:"Border Radius (px)",options:Object.keys(l.RadiusVariables),value:((h=Object.entries(l.RadiusVariables).find(([p,v])=>v===c.radius))==null?void 0:h[0])||"None",onChange:p=>o(l.RadiusVariables[p],"radius")}),i.jsx(j.SelectSettings,{label:"Border Thickness (px)",options:Object.keys(l.ThicknessVariables),value:((d=Object.entries(l.ThicknessVariables).find(([p,v])=>v===c.thickness))==null?void 0:d[0])||"None",onChange:p=>o(l.ThicknessVariables[p],"thickness")})]})]})},Vc="_options_1gneb_1",Kc="_alignments_1gneb_9",Gc="_blocks_1gneb_15",Yc="_alignment_1gneb_9",Xc="_active_1gneb_34",qc="_chargeTypes_1gneb_41",Jc="_charge_1gneb_41",Qc="_chargeActive_1gneb_69",Zc="_sliderContainer_1gneb_83",el="_shadowInputs_1gneb_91",tl="_label_1gneb_102",nl="_shadowInputsRow_1gneb_111",sl="_shadowInputsOpen_1gneb_119",q={options:Vc,alignments:Kc,blocks:Gc,alignment:Yc,active:Xc,chargeTypes:qc,charge:Jc,chargeActive:Qc,sliderContainer:Zc,shadowInputs:el,label:tl,shadowInputsRow:nl,shadowInputsOpen:sl},ol=["left","center","right"],rl=()=>{const{activeBlock:e,themeSettings:t,updateButton:n,setActiveBlock:s}=l.useThemeSettingsStore(),{fonts:o}=l.useFontsStore(),[r,a]=f.useState("primary");function c(g,x){n(r,x,g)}const[u,h]=f.useState(!1),d=t.buttons[r],p=l.useNavigate();function v(){s(null),p("/admin/builder/theme")}const m=(e==null?void 0:e.name)==="Buttons";function _(g,x){c({...d.boxShadow,[g]:x},"boxShadow")}return i.jsxs(l.AnimatedPanel,{isOpen:m,isClose:!m,children:[i.jsx(mt,{onClick:v,title:"Buttons Style"}),i.jsx("div",{className:q.chargeTypes,style:{marginBottom:"10px"},children:["primary","secondary","tertiary"].map(g=>i.jsx("div",{className:l.clx(q.charge,{[q.chargeActive]:r===g}),onClick:()=>a(g),children:g.charAt(0).toUpperCase()+g.slice(1)},g))}),d&&i.jsxs("div",{className:q.options,children:[i.jsx(j.InputSettings,{label:"Height (px)",value:String(d.height),onChange:g=>c(Number(g),"height"),type:"number",min:0}),i.jsx(j.SelectSettings,{label:"Font Size (px)",value:String(d.size),onChange:g=>c(Number(g),"size"),options:l.sizeOptions}),i.jsx(j.InputSettings,{label:"Border Radius (px)",value:String(d.radius),onChange:g=>c(Number(g),"radius"),type:"number",min:0}),i.jsx(j.SelectSettings,{label:"Font",value:d.font,onChange:g=>c(g,"font"),options:[...o.filter(g=>g.name!==d.font).map(g=>g.name)]}),i.jsx(l.ColorPicker,{initialColor:d.color,onChange:g=>c(g,"color"),title:"Text Color",labelStyle:"secondary",isGradientActive:!1}),i.jsx(l.ColorPicker,{initialColor:d.background,onChange:g=>c(g,"background"),title:"Background Color",labelStyle:"secondary",isGradientActive:!0}),i.jsxs("div",{className:q.sliderContainer,children:[i.jsx("h4",{className:q.label,children:"Shadow"}),i.jsx(j.ButtonSettings,{type:"Secondary",onClick:()=>h(!u),style:{padding:5,display:"flex"},children:i.jsx(j.Icon,{name:"CaretUp",style:{rotate:u?"0deg":"-180deg",transition:"0.3s rotate ease"}})})]}),i.jsxs("div",{className:l.clx(q.shadowInputs,{[q.shadowInputsOpen]:u}),children:[i.jsxs("div",{className:q.shadowInputsRow,children:[i.jsx(j.InputSettings,{label:"Left (px)",value:String(d.boxShadow.left),onChange:g=>_("left",Number(g)),type:"number"}),i.jsx(j.InputSettings,{label:"Top (px)",value:String(d.boxShadow.top),onChange:g=>_("top",Number(g)),type:"number"}),i.jsx(j.InputSettings,{label:"Blur (px)",value:String(d.boxShadow.blur),onChange:g=>_("blur",Number(g)),type:"number"}),i.jsx("div",{style:{flex:1,whiteSpace:"nowrap"},children:i.jsx(j.InputSettings,{label:"Spread (px)",value:String(d.boxShadow.spread),onChange:g=>_("spread",Number(g)),type:"number"})})]}),i.jsx(l.ColorPicker,{initialColor:d.boxShadow.color,onChange:g=>_("color",g),title:"Color",labelStyle:"secondary",isGradientActive:!1})]}),i.jsxs("div",{className:q.alignments,children:[i.jsx("h4",{className:q.label,children:"Alignment Type"}),i.jsx("div",{className:q.blocks,children:ol.map(g=>i.jsx("div",{className:l.clx(q.alignment,{[q.active]:d.alignment===g}),onClick:()=>{c(g,"alignment")},children:i.jsx(j.Icon,{name:g==="center"?"AlignCenterHorizontal":g==="left"?"AlignLeft":"AlignRight",fill:d.alignment===g?"#252525":"#757575"})},g))})]}),i.jsx(j.Switch,{label:"Enable Hover",onChange:g=>c(g,"hover"),current:d.hover}),d.hover&&i.jsxs(i.Fragment,{children:[i.jsx(l.ColorPicker,{initialColor:d.colorHover,onChange:g=>c(g,"colorHover"),title:"Hover Text Color",labelStyle:"secondary",isGradientActive:!1}),i.jsx(l.ColorPicker,{initialColor:d.backgroundHover,onChange:g=>c(g,"backgroundHover"),title:"Hover Background Color",labelStyle:"secondary",isGradientActive:!0})]})]})]})},il="_category_daart_1",al="_categoryTitle_daart_19",Jt={category:il,categoryTitle:al},cl=()=>{const{themeSettings:e,setActiveColorCategory:t}=l.useThemeSettingsStore();function n(s){t(s)}return i.jsx("div",{className:Jt.wrapper,children:Object.keys(e.colors).map(s=>s==="icon"?i.jsx(i.Fragment,{}):i.jsxs("div",{className:Jt.category,onClick:()=>n(s),children:[i.jsxs("h2",{className:Jt.categoryTitle,children:[s==="text"?"Text & Icon":l.formatLabel(s)," Colors"]}),i.jsx(j.Icon,{name:"CaretRight",width:24,height:24})]},s))})},ll="_options_rwzk3_38",ul={options:ll},dl=()=>{const{activeBlock:e,setActiveFont:t,activeFont:n,themeSettings:s,updateFont:o}=l.useThemeSettingsStore(),{fonts:r}=l.useFontsStore(),[a,c]=f.useState(null);function u(){t(null)}function h(g,x){a&&n&&o("desktop",a,n,x,g)}const[d,p]=f.useState([]),v=f.useMemo(()=>n?s.fonts.desktop.heading[n]?(c("heading"),s.fonts.desktop.heading[n]):s.fonts.desktop.body[n]?(c("body"),s.fonts.desktop.body[n]):(c(null),null):null,[n,s]);f.useEffect(()=>{if(v){const g=r.find(x=>x.name===v.font);g&&(p(g.weights),g.weights.includes(v.boldWeight)||h("400","boldWeight"),g.weights.includes(v.weight)||h("400","weight"))}},[v,n]);const m=!!((e==null?void 0:e.name)==="Fonts"&&n),_=(e==null?void 0:e.name)!=="Fonts"||!n;return i.jsxs(l.AnimatedPanel,{isOpen:m,isClose:_,children:[i.jsx(mt,{onClick:u,title:"Font Style"}),n&&v&&i.jsxs("div",{className:ul.options,children:[i.jsx(j.SelectSettings,{label:"Font",value:v.font,onChange:g=>h(g,"font"),options:[...r.filter(g=>g.name!==v.font).map(g=>g.name)]}),i.jsx(j.SelectSettings,{label:"Size",value:String(v.size),onChange:g=>h(g,"size"),options:l.sizeOptions}),i.jsx(j.SelectSettings,{label:"Default Weight",value:String(v.weight),onChange:g=>h(g,"weight"),options:d}),i.jsx(j.SelectSettings,{label:"Bold Weight",value:String(v.boldWeight),onChange:g=>h(g,"boldWeight"),options:d}),i.jsx(j.SelectSettings,{label:"Case",value:String(v.case).charAt(0).toUpperCase()+String(v.case).slice(1),onChange:g=>h(g.toLowerCase(),"case"),options:["Normal","Uppercase","Lowercase","Capitalize"].filter(g=>g.toLowerCase()!==String(v.case))})]})]})},hl="_wrapper_mkmxa_1",fl="_category_mkmxa_5",gl="_categoryTitle_mkmxa_11",pl="_font_mkmxa_17",ml="_content_mkmxa_32",vl="_icon_mkmxa_39",bl="_paragraph_mkmxa_50",_e={wrapper:hl,category:fl,categoryTitle:gl,font:pl,content:ml,icon:vl,paragraph:bl},xl={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",h7:"h7",lg:"large",md:"medium",sm:"small"},Sl=e=>{const{font:t,size:n,id:s,category:o}=e,{setActiveFont:r}=l.useThemeSettingsStore();return i.jsxs("div",{className:_e.font,onClick:()=>r(s),children:[i.jsx("div",{className:l.clx(_e.icon,{[_e.paragraph]:o==="paragraph"}),children:i.jsx(j.Icon,{name:o==="paragraph"?"TextB":"TextH"})}),i.jsxs("div",{className:_e.content,children:[i.jsx("h2",{className:_e.categoryTitle,children:l.formatLabel(xl[s])}),i.jsx("span",{className:_e.value,children:`${t}, ${n}px`})]})]})},yl=()=>{const{themeSettings:e,setActiveFont:t,activeBlock:n}=l.useThemeSettingsStore();f.useEffect(()=>(s(),()=>{s()}),[]);function s(){t(null)}if(n!=null&&n.name)return i.jsx("div",{className:_e.wrapper,children:Object.entries(e.fonts.desktop).sort(([o],[r])=>o==="heading"?-1:r==="heading"?1:0).map(([o,r])=>i.jsxs("div",{className:_e.category,children:[i.jsx("h2",{className:_e.categoryTitle,children:l.formatLabel(o)}),Object.entries(r).map(([a,c])=>i.jsx(Sl,{id:a,category:o,...c},a))]},o))})},_l="_wrapper_16ym0_2",Cl="_categoryTitle_16ym0_12",wl="_title_16ym0_74",kl="_field_16ym0_82",jl="_alignments_16ym0_92",Al="_lineField_16ym0_98",Nl="_style_16ym0_106",Il="_header_16ym0_113",le={wrapper:_l,categoryTitle:Cl,title:wl,field:kl,alignments:jl,lineField:Al,style:Nl,header:Il},Bl=["left","center","right"],El=["solid","dashed"],it=e=>{const{title:t,children:n,rightAddon:s}=e;return i.jsxs("div",{className:le.field,children:[i.jsxs("div",{className:le.header,children:[i.jsx("h4",{className:le.categoryTitle,children:t}),s]}),n]})},Dl=()=>{const{themeSettings:e,updateInput:t}=l.useThemeSettingsStore(),n=f.useMemo(()=>e.inputs,[e]),s=(r,a,c)=>{t(r,a,c)},o=r=>a=>{t(r,a,"color")};return i.jsxs("div",{className:le.wrapper,children:[i.jsxs(it,{title:"General",children:[i.jsx(j.InputSettings,{label:"Height (px)",value:String(n.general.height),onChange:r=>s("general",r,"height"),type:"number",min:0}),i.jsx(j.SelectSettings,{label:"Font Size (px)",onChange:r=>s("general",r,"size"),value:String(n.general.size),options:l.sizeOptions}),i.jsx(l.ColorPicker,{initialColor:l.formatLabel(n.general.color),onChange:o("general"),title:"Font Color",labelStyle:"secondary",isGradientActive:!1})]}),i.jsx(it,{title:"Field Fill",rightAddon:i.jsx("div",{className:le.switch,children:i.jsx(j.Switch,{onChange:r=>s("field",r,"active"),current:n.field.active})}),children:i.jsx(l.ColorPicker,{initialColor:n.field.color,onChange:o("field"),title:"Color",labelStyle:"secondary"})}),i.jsx(it,{title:"Placeholder",children:i.jsx(l.ColorPicker,{initialColor:l.formatLabel(n.placeholder.color),onChange:o("placeholder"),title:"Font Color",labelStyle:"secondary",isGradientActive:!1})}),i.jsxs(it,{title:"Border",rightAddon:i.jsx("div",{className:le.switch,children:i.jsx(j.Switch,{onChange:r=>s("border",r,"active"),current:n.border.active})}),children:[i.jsxs("div",{className:le.lineField,children:[i.jsxs("div",{className:le.style,children:[i.jsx("span",{className:le.title,children:"Style"}),i.jsx(l.Picker,{items:El,selectedItem:n.border.style,onSelect:r=>s("border",r,"style"),getIconName:r=>r==="solid"?"Minus":"Selection"})]}),i.jsx(j.InputSettings,{label:"Radius (px)",value:String(n.border.radius),onChange:r=>s("border",r,"radius"),type:"number",min:0})]}),i.jsx(j.InputSettings,{label:"Thickness (px)",value:String(n.border.thickness),onChange:r=>s("border",r,"thickness"),type:"number",min:0}),i.jsx(l.ColorPicker,{initialColor:l.formatLabel(n.border.color),onChange:o("border"),title:"Color",labelStyle:"secondary",isGradientActive:!1})]}),i.jsxs(it,{title:"Label",children:[i.jsx(j.InputSettings,{label:"Line Height (px)",value:String(n.label.height),onChange:r=>s("label",r,"height"),type:"number",min:0}),i.jsx(j.SelectSettings,{label:"Font Size (px)",onChange:r=>s("label",r,"size"),value:String(n.label.size),options:l.sizeOptions}),i.jsx(l.ColorPicker,{initialColor:l.formatLabel(n.label.color),onChange:o("label"),title:"Color",labelStyle:"secondary",isGradientActive:!1}),i.jsxs("div",{className:le.alignments,children:[i.jsx("h4",{className:le.title,children:"Alignment Type"}),i.jsx(l.Picker,{items:Bl,selectedItem:n.label.alignment,onSelect:r=>s("label",r,"alignment"),getIconName:r=>r==="center"?"AlignCenterHorizontal":r==="left"?"AlignLeft":"AlignRight"})]})]})]})},Tl="_wrapper_lyrvk_2",Ml="_color_lyrvk_24",Rl="_content_lyrvk_33",Pl="_preview_lyrvk_42",Ol="_container_lyrvk_52",Ll="_buttonWrapper_lyrvk_62",$l="_button_lyrvk_62",Fl="_buttonBorder_lyrvk_80",zl="_buttonBackground_lyrvk_83",Hl="_text_lyrvk_87",Wl="_textText_lyrvk_93",Ul="_icon_lyrvk_97",Vl="_iconIcon_lyrvk_100",Kl="_annotation_lyrvk_104",Gl="_annotationText_lyrvk_111",Yl="_label_lyrvk_116",Xl="_circle_lyrvk_127",ql="_line_lyrvk_140",Jl="_circle1_lyrvk_154",Ql="_circle2_lyrvk_159",Zl="_annotationIcon_lyrvk_164",eu="_annotationBorder_lyrvk_192",tu="_line1_lyrvk_203",nu="_line2_lyrvk_210",su="_circle3_lyrvk_227",ou="_circle4_lyrvk_232",ru="_annotationSurface_lyrvk_237",I={wrapper:Tl,color:Ml,content:Rl,preview:Pl,container:Ol,buttonWrapper:Ll,button:$l,buttonBorder:Fl,buttonBackground:zl,text:Hl,textText:Wl,icon:Ul,iconIcon:Vl,annotation:Kl,annotationText:Gl,label:Yl,circle:Xl,line:ql,circle1:Jl,circle2:Ql,annotationIcon:Zl,annotationBorder:eu,line1:tu,line2:nu,circle3:su,circle4:ou,annotationSurface:ru},iu=()=>{const{activeColorCategory:e}=l.useThemeSettingsStore();return i.jsx("div",{className:I.container,children:i.jsxs("div",{className:I.buttonWrapper,children:[i.jsxs("div",{className:l.clx(I.button,{[I.buttonBorder]:e==="border",[I.buttonBackground]:e==="surface"}),children:[i.jsx(j.Icon,{name:"Smiley",className:l.clx(I.icon,{[I.iconIcon]:e==="text"}),width:22,height:22,fill:"#757575"}),i.jsx("span",{className:l.clx(I.text,{[I.textText]:e==="text"}),children:"Button Example"})]}),e==="text"&&i.jsxs("div",{className:l.clx(I.annotation,I.annotationText),children:[i.jsx("div",{className:I.label,children:"Text Color"}),i.jsx("div",{className:I.line}),i.jsx("div",{className:l.clx(I.circle,I.circle1)}),i.jsx("div",{className:l.clx(I.circle,I.circle2)})]}),e==="text"&&i.jsxs("div",{className:l.clx(I.annotation,I.annotationIcon),children:[i.jsx("div",{className:I.label,children:"Icon Color"}),i.jsx("div",{className:I.line}),i.jsx("div",{className:l.clx(I.circle,I.circle1)}),i.jsx("div",{className:l.clx(I.circle,I.circle2)})]}),e==="border"&&i.jsxs("div",{className:l.clx(I.annotation,I.annotationBorder),children:[i.jsx("div",{className:I.label,children:"Border Color"}),i.jsx("div",{className:l.clx(I.line,I.line1)}),i.jsx("div",{className:l.clx(I.line,I.line2)}),i.jsx("div",{className:l.clx(I.circle,I.circle1)}),i.jsx("div",{className:l.clx(I.circle,I.circle2)}),i.jsx("div",{className:l.clx(I.circle,I.circle3)}),i.jsx("div",{className:l.clx(I.circle,I.circle4)})]}),e==="surface"&&i.jsxs("div",{className:l.clx(I.annotation,I.annotationSurface),children:[i.jsx("div",{className:I.label,children:"Surface Color"}),i.jsx("div",{className:I.line}),i.jsx("div",{className:l.clx(I.circle,I.circle1)}),i.jsx("div",{className:l.clx(I.circle,I.circle2)})]})]})})},au={text:["primary","secondary","tertiary","inverted","action","action-hover","disabled","warning","error","success","information","link"],border:["primary","secondary","action","actionHover","disabled","warning","error","success","information","focus"],surface:["primary","secondary","action1","action1Hover","action2","action2Hover","disabled","warning","error","success","information","modal"]},cu=()=>{const{activeBlock:e,setActiveColorCategory:t,activeColorCategory:n,themeSettings:s,updateColor:o}=l.useThemeSettingsStore();function r(){t(null)}function a(d,p,v){o(d,p,v)}const c=!!((e==null?void 0:e.name)==="Colors"&&n),u=(e==null?void 0:e.name)!=="Colors"||!n,h=n?au[n]:[];return i.jsxs(l.AnimatedPanel,{isOpen:c,isClose:u,children:[i.jsx(mt,{onClick:r,title:n==="text"?"Text & Icon Colors":`${l.formatLabel(n)} Colors`}),n&&i.jsxs("div",{className:I.wrapper,children:[i.jsx(iu,{}),h.map(d=>{const p=s.colors[n][d];return typeof p!="string"?null:i.jsx("div",{className:I.color,children:i.jsxs("div",{className:I.content,children:[i.jsx("div",{className:I.preview,style:{background:p}}),i.jsx(l.ColorPicker,{title:l.formatLabel(d),initialColor:p,onChange:v=>a(n,d,v),isGradientActive:n==="surface"})]})},d)})]})]})},lu="_loader_1p5lr_1",uu={loader:lu},du=()=>{const{activeBlock:e,themeSettings:t,isLoadingThemeSettings:n}=l.useThemeSettingsStore();return i.jsx(i.Fragment,{children:n?i.jsx("div",{className:uu.loader,children:i.jsx(l.Loader,{})}):i.jsxs(i.Fragment,{children:[(e==null?void 0:e.name)==="Fonts"&&t.fonts&&i.jsx(yl,{}),(e==null?void 0:e.name)==="Fonts"&&t.fonts&&i.jsx(dl,{}),(e==null?void 0:e.name)==="Colors"&&t.colors&&i.jsx(cl,{}),(e==null?void 0:e.name)==="Colors"&&t.colors&&i.jsx(cu,{}),(e==null?void 0:e.name)==="Inputs"&&t.inputs&&i.jsx(Dl,{}),(e==null?void 0:e.name)==="Borders"&&t.borders&&i.jsx(Uc,{}),(e==null?void 0:e.name)==="Buttons"&&t.buttons&&i.jsx(rl,{})]})})},hu=()=>{const{activeBlock:e,setActiveBlock:t}=l.useThemeSettingsStore(),{activeBlock:n}=l.useNavbarStore(),s=l.useNavigate();function o(){t(null),s("/admin/builder/theme")}const r=!!e,a=!e||n.name!=="Theme";return i.jsxs(l.AnimatedPanel,{isOpen:r,isClose:a,children:[i.jsx(mt,{onClick:o,title:(e==null?void 0:e.name)||""}),i.jsx(du,{})]})},fu=()=>{const{activeBlock:e}=l.useNavbarStore(),{showTooltip:t}=l.useTooltipStore();function n(){switch(e.name){case"Layers":return"Layers";case"Add":return"Add Sections";case"Theme":return"Theme Settings";case"Settings":return"Settings"}}return i.jsxs("div",{className:qn.sidebar,style:{zIndex:t?50:"auto"},children:[i.jsx("h3",{className:qn.title,children:n()}),e.name==="Layers"&&i.jsx(ic,{}),e.name==="Add"&&i.jsx(Rs,{}),i.jsx(Lc,{}),i.jsx(hu,{}),e.name==="Theme"&&i.jsx(pc,{}),e.name==="Settings"&&i.jsx(lc,{})]})},gu="_wrapper_1a3e7_1",pu="_header_1a3e7_12",mu="_content_1a3e7_23",vu="_buttons_1a3e7_44",bu="_label_1a3e7_51",xu="_description_1a3e7_52",Su="_preview_1a3e7_60",yu="_block_1a3e7_66",_u="_slug_1a3e7_75",Cu="_title_1a3e7_81",wu="_closeIcon_1a3e7_87",ce={wrapper:gu,header:pu,content:mu,buttons:vu,label:bu,description:xu,preview:Su,block:yu,slug:_u,title:Cu,closeIcon:wu},ku=()=>{var $,R,D,P,T,z,X;const{setIsOpenModal:e,pages:t,createPage:n,updatePage:s,isEdit:o,setIsEdit:r,editedPage:a,setEditedPage:c,pageContext:u}=l.usePagesStore(),{setIsOpen:h}=l.useModalStore(),{isAntistock:d}=l.useGeneralStore(),{createPage:p,updatePage:v}=l.useLayersStore(),[m,_]=f.useState(a?t&&(($=t[a])==null?void 0:$.path):""),[g,x]=f.useState(a?t&&((R=t[a])==null?void 0:R.name):""),[y,w]=f.useState(a?t&&((D=t[a])==null?void 0:D.seo)&&((T=(P=t[a])==null?void 0:P.seo)==null?void 0:T.pageDescription)||"":`${u.general.info.name} is powered by the ${d?"Antistock.io":"Billgang.com"} platform which allows them to sell their digital products online for free.`),[b,A]=f.useState(a&&t&&(z=t[a])!=null&&z.isPrivate?"private":"public");function C(){_(""),x(""),w(""),A("public"),r(!1),c(null)}function k(){h(!1),setTimeout(()=>{C(),e(!1),h(!0)},300)}f.useEffect(()=>()=>{k()},[]);function S(E){return E[0]==="/"?E:"/"+E}function N(){n({path:S(m),name:g||m||"",icon:"File",seo:{pageTitle:g||"",pageDescription:y||""},visibility:b||"public"}),p(S(m)),k()}function M(){t&&(l.defaultPagePaths.includes(t[a].path)||Ms(t[a].path),v(t[a].path||"",m||""),s(a,{path:S(m),name:g||m,icon:t[a].icon||"File",seo:{pageTitle:g||"",pageDescription:y||""},visibility:b||"public"})),k()}return i.jsxs("div",{className:ce.wrapper,onClick:E=>E.stopPropagation(),children:[i.jsxs("div",{className:ce.header,children:[i.jsx("h2",{children:o?"Edit Page":"Create New Page"}),i.jsx("div",{className:ce.closeIcon,children:i.jsx(j.Icon,{name:"X",fill:"#757575",hoverable:!0,onClick:k})})]}),i.jsxs("div",{className:ce.content,children:[i.jsx(j.InputSettings,{label:"Page Slug",onChange:E=>_(E),value:m,placeholder:"path-to-page",disabled:!!(a&&t&&((X=t[a])!=null&&X.name)&&l.defaultPagePaths.includes(t[a].path)),required:!0,regex:"^.+$"}),i.jsx(j.InputSettings,{label:"Page Title",onChange:E=>{x(E)},value:g.charAt(0).toUpperCase()+g.slice(1),placeholder:"Contact us"}),i.jsx(j.TextareaSettings,{label:"Description",onChange:E=>w(E),value:y,placeholder:`${u.general.info.name} is powered by the ${d?"Antistock.io":"Billgang.com"} platform which allows them to sell their digital products online for free.`,maxLength:150}),i.jsxs("div",{className:ce.preview,children:[i.jsx("span",{className:ce.label,children:"Preview"}),i.jsxs("div",{className:ce.block,children:[i.jsx("span",{className:ce.slug,children:m||"yoursite.url"}),i.jsx("span",{className:ce.title,children:g||"My Blank Page"}),i.jsx("span",{className:ce.description,children:y||"It is My Description"})]})]})]}),i.jsxs("div",{className:ce.buttons,children:[i.jsx(j.ButtonSettings,{onClick:k,type:"Secondary",children:"Cancel"}),i.jsx(j.ButtonSettings,{onClick:o?M:N,disabled:m.length===0,type:"Primary",children:o?"Update":"Create"})]})]})};exports.CSS=Ye;exports.DndContext=ks;exports.Fuse=Oe;exports.Header=Gi;exports.ModifyPage=ku;exports.Navbar=na;exports.PointerSensor=Rt;exports.Preview=$a;exports.RenderAnnouncement=fn;exports.RenderBlock=Tt;exports.RenderFooter=dn;exports.RenderHeader=hn;exports.Sidebar=fu;exports.SortableContext=Es;exports.index=Us;exports.useSensor=us;exports.useSensors=ds;exports.useSortable=Ts;exports.verticalListSortingStrategy=Ns;
|