@billgangcom/theme-lib 1.126.0 → 1.128.0

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.
Files changed (54) hide show
  1. package/dist/{builder-DBsJMF9w.js → builder-CNebwPFm.js} +890 -881
  2. package/dist/{builder-DkJBNEg1.cjs → builder-Dy7RSMJ7.cjs} +12 -12
  3. package/dist/builder-components-C-sRGuDw.cjs +5 -0
  4. package/dist/{builder-components-DGTJt9ox.js → builder-components-CvwDC4WU.js} +2322 -2391
  5. package/dist/builder.cjs.js +1 -1
  6. package/dist/builder.es.js +34 -34
  7. package/dist/{charge-BN36PrXv.cjs → charge-BaFC9CGT.cjs} +36 -36
  8. package/dist/{charge-y8fwB74G.js → charge-Bz7t9N9W.js} +4121 -3990
  9. package/dist/{checkout-DevWEPsS.js → checkout-DAO9n_bN.js} +5 -5
  10. package/dist/{checkout-D9svEu90.cjs → checkout-NyApNNAm.cjs} +1 -1
  11. package/dist/exports.cjs.js +1 -1
  12. package/dist/exports.es.js +6 -6
  13. package/dist/{index-DVe5g33P.cjs → index-BABt7BrX.cjs} +1 -1
  14. package/dist/{index-BZ6KfI9f.js → index-BHe4V2uc.js} +5 -5
  15. package/dist/{index-DfF9AVfR.cjs → index-Bkv9sQSH.cjs} +1 -1
  16. package/dist/index-C1JFjFgn.cjs +1 -0
  17. package/dist/{index-7EEpFwXA.js → index-CKUu7lB5.js} +5 -5
  18. package/dist/{index-C5gKuHuD.cjs → index-Cnx1ZMfy.cjs} +1 -1
  19. package/dist/{index-DATBvAXz.js → index-DN5QEFqV.js} +33 -32
  20. package/dist/{index-mleVDlM7.js → index-DPcCnjju.js} +5 -5
  21. package/dist/{index-_q2wAS59.js → index-DS0QHCBx.js} +1 -1
  22. package/dist/{index-5lYM_Npo.cjs → index-H3n_s-qw.cjs} +1 -1
  23. package/dist/{index-CAX8R1Ai.cjs → index-S8Pzv9Y6.cjs} +1 -1
  24. package/dist/{index-BhTDEgRV.js → index-TBAsOkdy.js} +2 -2
  25. package/dist/index.cjs.js +1 -1
  26. package/dist/index.es.js +6 -6
  27. package/dist/{order-CAn5Z3kA.cjs → order-D9bZsw6j.cjs} +1 -1
  28. package/dist/{order-DJLmMenp.js → order-FDCc_xoh.js} +5 -5
  29. package/dist/src/builder/components/Navbar/index.d.ts +1 -0
  30. package/dist/src/builder/constants/block-icons.d.ts +30 -0
  31. package/dist/src/pages/balance/bonus-tiers.d.ts +21 -0
  32. package/dist/src/pages/balance/bonus-utils.d.ts +23 -0
  33. package/dist/src/storefront/models/balance.d.ts +6 -0
  34. package/dist/src/ui/ButtonSettings/index.d.ts +1 -1
  35. package/dist/style.css +1 -1
  36. package/dist/{subscription-CTjy1Qe3.js → subscription-BCxznt8S.js} +5 -5
  37. package/dist/{subscription-BMKWk-uN.cjs → subscription-HzlEomWK.cjs} +1 -1
  38. package/dist/{ticket-BDF_cZI6.js → ticket-Bokxlwru.js} +6 -6
  39. package/dist/{ticket-DA-4PjkO.cjs → ticket-DbTulR68.cjs} +1 -1
  40. package/dist/{top-up-D-Zm8J9k.cjs → top-up-D55gc7sC.cjs} +1 -1
  41. package/dist/{top-up-DMiCkek_.js → top-up-DmvN2ae_.js} +5 -5
  42. package/dist/{ui-components-jL8ZEeBy.js → ui-components-C0algo6I.js} +1048 -1039
  43. package/dist/ui-components-CmbdJIOh.cjs +1 -0
  44. package/dist/ui.cjs.js +1 -1
  45. package/dist/ui.es.js +1 -1
  46. package/dist/{validation-BOrDBOgr.js → validation-BrJf4NbL.js} +5 -5
  47. package/dist/{validation-CsXFNprj.cjs → validation-maeHixvI.cjs} +1 -1
  48. package/package.json +1 -1
  49. package/dist/builder-components-5FvLD0Ee.cjs +0 -5
  50. package/dist/index-BTmOK4vU.cjs +0 -1
  51. package/dist/src/builder/components/HeaderSettings/index.d.ts +0 -4
  52. package/dist/src/builder/components/HeaderSwitchTheme/index.d.ts +0 -4
  53. package/dist/src/builder/components/PreviewHeader/index.d.ts +0 -2
  54. package/dist/ui-components-DU-EKx8i.cjs +0 -1
@@ -0,0 +1,5 @@
1
+ "use strict";const i=require("react/jsx-runtime"),g=require("react"),u=require("./builder-Dy7RSMJ7.cjs"),A=require("./ui-components-CmbdJIOh.cjs");require("./charge-BaFC9CGT.cjs");const at=require("react-dom");require("./ticket-DbTulR68.cjs");const Dt=({render:e,block:t})=>e(t),ln=({settings:e,pageContext:t})=>{const{footer:n}=u.useLayersStore(),{settings:s}=u.useSettingsStore(),{pageContext:o}=u.usePagesStore(),{footer:r}=u.useBlocksStore();if(!r||!n)return null;const c=new r;return Object.keys(n).map(a=>{c[a]=n[a]}),c.renderBlock((e==null?void 0:e.blockSettings)||s,t||o)},un=({settings:e,pageContext:t})=>{const{header:n}=u.useLayersStore(),{settings:s}=u.useSettingsStore(),{pageContext:o}=u.usePagesStore(),{header:r}=u.useBlocksStore();if(!r||!n)return null;const c=new r;return Object.keys(n).map(a=>{c[a]=n[a]}),c.renderBlock((e==null?void 0:e.blockSettings)||s,t||o)},dn=({settings:e,pageContext:t})=>{const{announcement:n}=u.useLayersStore(),{settings:s}=u.useSettingsStore(),{pageContext:o}=u.usePagesStore(),{announcement:r}=u.useBlocksStore();if(!r||!n)return null;const c=new r;return Object.keys(n).map(a=>{c[a]=n[a]}),c.renderBlock(e||s,t||o)},Fs=Object.freeze(Object.defineProperty({__proto__:null,RenderAnnouncement:dn,RenderBlock:Dt,RenderFooter:ln,RenderHeader:un},Symbol.toStringTag,{value:"Module"}));function Ce(e){return Array.isArray?Array.isArray(e):qn(e)==="[object Array]"}function zs(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Hs(e){return e==null?"":zs(e)}function me(e){return typeof e=="string"}function Gn(e){return typeof e=="number"}function Ws(e){return e===!0||e===!1||Us(e)&&qn(e)=="[object Boolean]"}function Xn(e){return typeof e=="object"}function Us(e){return Xn(e)&&e!==null}function ne(e){return e!=null}function Ft(e){return!e.trim().length}function qn(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Vs="Incorrect 'index' type",Ks=e=>`Invalid value for key ${e}`,Ys=e=>`Pattern length exceeds max of ${e}.`,Gs=e=>`Missing ${e} property in key`,Xs=e=>`Property 'weight' in key '${e}' must be a positive integer`,Nn=Object.prototype.hasOwnProperty;class qs{constructor(t){this._keys=[],this._keyMap={};let n=0;t.forEach(s=>{let o=Jn(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 Jn(e){let t=null,n=null,s=null,o=1,r=null;if(me(e)||Ce(e))s=e,t=In(e),n=Jt(e);else{if(!Nn.call(e,"name"))throw new Error(Gs("name"));const c=e.name;if(s=c,Nn.call(e,"weight")&&(o=e.weight,o<=0))throw new Error(Xs(c));t=In(c),n=Jt(c),r=e.getFn}return{path:t,id:n,weight:o,src:s,getFn:r}}function In(e){return Ce(e)?e:e.split(".")}function Jt(e){return Ce(e)?e.join("."):e}function Js(e,t){let n=[],s=!1;const o=(r,c,a)=>{if(ne(r))if(!c[a])n.push(r);else{let l=c[a];const d=r[l];if(!ne(d))return;if(a===c.length-1&&(me(d)||Gn(d)||Ws(d)))n.push(Hs(d));else if(Ce(d)){s=!0;for(let h=0,p=d.length;h<p;h+=1)o(d[h],c,a+1)}else c.length&&o(d,c,a+1)}};return o(e,me(t)?t.split("."):t,0),s?n:n[0]}const Qs={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Zs={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},eo={location:0,threshold:.6,distance:100},to={useExtendedSearch:!1,getFn:Js,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var B={...Zs,...Qs,...eo,...to};const no=/[^ ]+/g;function so(e=1,t=3){const n=new Map,s=Math.pow(10,t);return{get(o){const r=o.match(no).length;if(n.has(r))return n.get(r);const c=1/Math.pow(r,.5*e),a=parseFloat(Math.round(c*s)/s);return n.set(r,a),a},clear(){n.clear()}}}class hn{constructor({getFn:t=B.getFn,fieldNormWeight:n=B.fieldNormWeight}={}){this.norm=so(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,me(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();me(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(!ne(t)||Ft(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 c=o.getFn?o.getFn(t):this.getFn(t,o.path);if(ne(c)){if(Ce(c)){let a=[];const l=[{nestedArrIndex:-1,value:c}];for(;l.length;){const{nestedArrIndex:d,value:h}=l.pop();if(ne(h))if(me(h)&&!Ft(h)){let p={v:h,i:d,n:this.norm.get(h)};a.push(p)}else Ce(h)&&h.forEach((p,m)=>{l.push({nestedArrIndex:m,value:p})})}s.$[r]=a}else if(me(c)&&!Ft(c)){let a={v:c,n:this.norm.get(c)};s.$[r]=a}}}),this.records.push(s)}toJSON(){return{keys:this.keys,records:this.records}}}function Qn(e,t,{getFn:n=B.getFn,fieldNormWeight:s=B.fieldNormWeight}={}){const o=new hn({getFn:n,fieldNormWeight:s});return o.setKeys(e.map(Jn)),o.setSources(t),o.create(),o}function oo(e,{getFn:t=B.getFn,fieldNormWeight:n=B.fieldNormWeight}={}){const{keys:s,records:o}=e,r=new hn({getFn:t,fieldNormWeight:n});return r.setKeys(s),r.setIndexRecords(o),r}function St(e,{errors:t=0,currentLocation:n=0,expectedLocation:s=0,distance:o=B.distance,ignoreLocation:r=B.ignoreLocation}={}){const c=t/e.length;if(r)return c;const a=Math.abs(s-n);return o?c+a/o:a?1:c}function ro(e=[],t=B.minMatchCharLength){let n=[],s=-1,o=-1,r=0;for(let c=e.length;r<c;r+=1){let a=e[r];a&&s===-1?s=r:!a&&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 io(e,t,n,{location:s=B.location,distance:o=B.distance,threshold:r=B.threshold,findAllMatches:c=B.findAllMatches,minMatchCharLength:a=B.minMatchCharLength,includeMatches:l=B.includeMatches,ignoreLocation:d=B.ignoreLocation}={}){if(t.length>Pe)throw new Error(Ys(Pe));const h=t.length,p=e.length,m=Math.max(0,Math.min(s,p));let f=r,y=m;const v=a>1||l,S=v?Array(p):[];let C;for(;(C=e.indexOf(t,y))>-1;){let k=St(t,{currentLocation:C,expectedLocation:m,distance:o,ignoreLocation:d});if(f=Math.min(k,f),y=C+h,v){let N=0;for(;N<h;)S[C+N]=1,N+=1}}y=-1;let j=[],b=1,_=h+p;const w=1<<h-1;for(let k=0;k<h;k+=1){let N=0,M=_;for(;N<M;)St(t,{errors:k,currentLocation:m+M,expectedLocation:m,distance:o,ignoreLocation:d})<=f?N=M:_=M,M=Math.floor((_-N)/2+N);_=M;let $=Math.max(1,m-M+1),R=c?p:Math.min(m+M,p)+h,D=Array(R+2);D[R+1]=(1<<k)-1;for(let T=R;T>=$;T-=1){let z=T-1,q=n[e.charAt(z)];if(v&&(S[z]=+!!q),D[T]=(D[T+1]<<1|1)&q,k&&(D[T]|=(j[T+1]|j[T])<<1|1|j[T+1]),D[T]&w&&(b=St(t,{errors:k,currentLocation:z,expectedLocation:m,distance:o,ignoreLocation:d}),b<=f)){if(f=b,y=z,y<=m)break;$=Math.max(1,2*m-y)}}if(St(t,{errors:k+1,currentLocation:m,expectedLocation:m,distance:o,ignoreLocation:d})>f)break;j=D}const x={isMatch:y>=0,score:Math.max(.001,b)};if(v){const k=ro(S,a);k.length?l&&(x.indices=k):x.isMatch=!1}return x}function co(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 kt=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 Zn{constructor(t,{location:n=B.location,threshold:s=B.threshold,distance:o=B.distance,includeMatches:r=B.includeMatches,findAllMatches:c=B.findAllMatches,minMatchCharLength:a=B.minMatchCharLength,isCaseSensitive:l=B.isCaseSensitive,ignoreDiacritics:d=B.ignoreDiacritics,ignoreLocation:h=B.ignoreLocation}={}){if(this.options={location:n,threshold:s,distance:o,includeMatches:r,findAllMatches:c,minMatchCharLength:a,isCaseSensitive:l,ignoreDiacritics:d,ignoreLocation:h},t=l?t:t.toLowerCase(),t=d?kt(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const p=(f,y)=>{this.chunks.push({pattern:f,alphabet:co(f),startIndex:y})},m=this.pattern.length;if(m>Pe){let f=0;const y=m%Pe,v=m-y;for(;f<v;)p(this.pattern.substr(f,Pe),f),f+=Pe;if(y){const S=m-Pe;p(this.pattern.substr(S),S)}}else p(this.pattern,0)}searchIn(t){const{isCaseSensitive:n,ignoreDiacritics:s,includeMatches:o}=this.options;if(t=n?t:t.toLowerCase(),t=s?kt(t):t,this.pattern===t){let v={isMatch:!0,score:0};return o&&(v.indices=[[0,t.length-1]]),v}const{location:r,distance:c,threshold:a,findAllMatches:l,minMatchCharLength:d,ignoreLocation:h}=this.options;let p=[],m=0,f=!1;this.chunks.forEach(({pattern:v,alphabet:S,startIndex:C})=>{const{isMatch:j,score:b,indices:_}=io(t,v,S,{location:r+C,distance:c,threshold:a,findAllMatches:l,minMatchCharLength:d,includeMatches:o,ignoreLocation:h});j&&(f=!0),m+=b,j&&_&&(p=[...p,..._])});let y={isMatch:f,score:f?m/this.chunks.length:1};return f&&o&&(y.indices=p),y}}class Te{constructor(t){this.pattern=t}static isMultiMatch(t){return Bn(t,this.multiRegex)}static isSingleMatch(t){return Bn(t,this.singleRegex)}search(){}}function Bn(e,t){const n=e.match(t);return n?n[1]:null}class ao extends Te{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 lo extends Te{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 uo extends Te{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 ho extends Te{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 fo extends Te{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 go extends Te{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 es extends Te{constructor(t,{location:n=B.location,threshold:s=B.threshold,distance:o=B.distance,includeMatches:r=B.includeMatches,findAllMatches:c=B.findAllMatches,minMatchCharLength:a=B.minMatchCharLength,isCaseSensitive:l=B.isCaseSensitive,ignoreDiacritics:d=B.ignoreDiacritics,ignoreLocation:h=B.ignoreLocation}={}){super(t),this._bitapSearch=new Zn(t,{location:n,threshold:s,distance:o,includeMatches:r,findAllMatches:c,minMatchCharLength:a,isCaseSensitive:l,ignoreDiacritics:d,ignoreLocation:h})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class ts extends Te{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 c=!!o.length;return{isMatch:c,score:c?0:1,indices:o}}}const Qt=[ao,ts,uo,ho,go,fo,lo,es],En=Qt.length,po=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,mo="|";function vo(e,t={}){return e.split(mo).map(n=>{let s=n.trim().split(po).filter(r=>r&&!!r.trim()),o=[];for(let r=0,c=s.length;r<c;r+=1){const a=s[r];let l=!1,d=-1;for(;!l&&++d<En;){const h=Qt[d];let p=h.isMultiMatch(a);p&&(o.push(new h(p,t)),l=!0)}if(!l)for(d=-1;++d<En;){const h=Qt[d];let p=h.isSingleMatch(a);if(p){o.push(new h(p,t));break}}}return o})}const bo=new Set([es.type,ts.type]);class xo{constructor(t,{isCaseSensitive:n=B.isCaseSensitive,ignoreDiacritics:s=B.ignoreDiacritics,includeMatches:o=B.includeMatches,minMatchCharLength:r=B.minMatchCharLength,ignoreLocation:c=B.ignoreLocation,findAllMatches:a=B.findAllMatches,location:l=B.location,threshold:d=B.threshold,distance:h=B.distance}={}){this.query=null,this.options={isCaseSensitive:n,ignoreDiacritics:s,includeMatches:o,minMatchCharLength:r,findAllMatches:a,ignoreLocation:c,location:l,threshold:d,distance:h},t=n?t:t.toLowerCase(),t=s?kt(t):t,this.pattern=t,this.query=vo(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?kt(t):t;let c=0,a=[],l=0;for(let d=0,h=n.length;d<h;d+=1){const p=n[d];a.length=0,c=0;for(let m=0,f=p.length;m<f;m+=1){const y=p[m],{isMatch:v,indices:S,score:C}=y.search(t);if(v){if(c+=1,l+=C,s){const j=y.constructor.type;bo.has(j)?a=[...a,...S]:a.push(S)}}else{l=0,c=0,a.length=0;break}}if(c){let m={isMatch:!0,score:l/c};return s&&(m.indices=a),m}}return{isMatch:!1,score:1}}}const Zt=[];function So(...e){Zt.push(...e)}function en(e,t){for(let n=0,s=Zt.length;n<s;n+=1){let o=Zt[n];if(o.condition(e,t))return new o(e,t)}return new Zn(e,t)}const At={AND:"$and",OR:"$or"},tn={PATH:"$path",PATTERN:"$val"},nn=e=>!!(e[At.AND]||e[At.OR]),_o=e=>!!e[tn.PATH],Co=e=>!Ce(e)&&Xn(e)&&!nn(e),Dn=e=>({[At.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function ns(e,t,{auto:n=!0}={}){const s=o=>{let r=Object.keys(o);const c=_o(o);if(!c&&r.length>1&&!nn(o))return s(Dn(o));if(Co(o)){const l=c?o[tn.PATH]:r[0],d=c?o[tn.PATTERN]:o[l];if(!me(d))throw new Error(Ks(l));const h={keyId:Jt(l),pattern:d};return n&&(h.searcher=en(d,t)),h}let a={children:[],operator:r[0]};return r.forEach(l=>{const d=o[l];Ce(d)&&d.forEach(h=>{a.children.push(s(h))})}),a};return nn(e)||(e=Dn(e)),s(e)}function yo(e,{ignoreFieldNorm:t=B.ignoreFieldNorm}){e.forEach(n=>{let s=1;n.matches.forEach(({key:o,norm:r,score:c})=>{const a=o?o.weight:null;s*=Math.pow(c===0&&a?Number.EPSILON:c,(a||1)*(t?1:r))}),n.score=s})}function wo(e,t){const n=e.matches;t.matches=[],ne(n)&&n.forEach(s=>{if(!ne(s.indices)||!s.indices.length)return;const{indices:o,value:r}=s;let c={indices:o,value:r};s.key&&(c.key=s.key.src),s.idx>-1&&(c.refIndex=s.idx),t.matches.push(c)})}function jo(e,t){t.score=e.score}function ko(e,t,{includeMatches:n=B.includeMatches,includeScore:s=B.includeScore}={}){const o=[];return n&&o.push(wo),s&&o.push(jo),e.map(r=>{const{idx:c}=r,a={item:t[c],refIndex:c};return o.length&&o.forEach(l=>{l(r,a)}),a})}class Le{constructor(t,n={},s){this.options={...B,...n},this.options.useExtendedSearch,this._keyStore=new qs(this.options.keys),this.setCollection(t,s)}setCollection(t,n){if(this._docs=t,n&&!(n instanceof hn))throw new Error(Vs);this._myIndex=n||Qn(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){ne(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:c,ignoreFieldNorm:a}=this.options;let l=me(t)?me(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return yo(l,{ignoreFieldNorm:a}),r&&l.sort(c),Gn(n)&&n>-1&&(l=l.slice(0,n)),ko(l,this._docs,{includeMatches:s,includeScore:o})}_searchStringList(t){const n=en(t,this.options),{records:s}=this._myIndex,o=[];return s.forEach(({v:r,i:c,n:a})=>{if(!ne(r))return;const{isMatch:l,score:d,indices:h}=n.searchIn(r);l&&o.push({item:r,idx:c,matches:[{score:d,value:r,norm:a,indices:h}]})}),o}_searchLogical(t){const n=ns(t,this.options),s=(a,l,d)=>{if(!a.children){const{keyId:p,searcher:m}=a,f=this._findMatches({key:this._keyStore.get(p),value:this._myIndex.getValueForItemAtKeyId(l,p),searcher:m});return f&&f.length?[{idx:d,item:l,matches:f}]:[]}const h=[];for(let p=0,m=a.children.length;p<m;p+=1){const f=a.children[p],y=s(f,l,d);if(y.length)h.push(...y);else if(a.operator===At.AND)return[]}return h},o=this._myIndex.records,r={},c=[];return o.forEach(({$:a,i:l})=>{if(ne(a)){let d=s(n,a,l);d.length&&(r[l]||(r[l]={idx:l,item:a,matches:[]},c.push(r[l])),d.forEach(({matches:h})=>{r[l].matches.push(...h)}))}}),c}_searchObjectList(t){const n=en(t,this.options),{keys:s,records:o}=this._myIndex,r=[];return o.forEach(({$:c,i:a})=>{if(!ne(c))return;let l=[];s.forEach((d,h)=>{l.push(...this._findMatches({key:d,value:c[h],searcher:n}))}),l.length&&r.push({idx:a,item:c,matches:l})}),r}_findMatches({key:t,value:n,searcher:s}){if(!ne(n))return[];let o=[];if(Ce(n))n.forEach(({v:r,i:c,n:a})=>{if(!ne(r))return;const{isMatch:l,score:d,indices:h}=s.searchIn(r);l&&o.push({score:d,key:t,value:r,idx:c,norm:a,indices:h})});else{const{v:r,n:c}=n,{isMatch:a,score:l,indices:d}=s.searchIn(r);a&&o.push({score:l,key:t,value:r,norm:c,indices:d})}return o}}Le.version="7.1.0";Le.createIndex=Qn;Le.parseIndex=oo;Le.config=B;Le.parseQuery=ns;So(xo);function Ao(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return g.useMemo(()=>s=>{t.forEach(o=>o(s))},t)}const Tt=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 fn(e){return"nodeType"in e}function J(e){var t,n;return e?Xe(e)?e:fn(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function gn(e){const{Document:t}=J(e);return e instanceof t}function gt(e){return Xe(e)?!1:e instanceof J(e).HTMLElement}function ss(e){return e instanceof J(e).SVGElement}function qe(e){return e?Xe(e)?e.document:fn(e)?gn(e)?e:gt(e)||ss(e)?e.ownerDocument:document:document:document}const ve=Tt?g.useLayoutEffect:g.useEffect;function pn(e){const t=g.useRef(e);return ve(()=>{t.current=e}),g.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 No(){const e=g.useRef(null),t=g.useCallback((s,o)=>{e.current=setInterval(s,o)},[]),n=g.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function ht(e,t){t===void 0&&(t=[e]);const n=g.useRef(e);return ve(()=>{n.current!==e&&(n.current=e)},t),n}function pt(e,t){const n=g.useRef();return g.useMemo(()=>{const s=e(n.current);return n.current=s,s},[...t])}function Nt(e){const t=pn(e),n=g.useRef(null),s=g.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,s]}function sn(e){const t=g.useRef();return g.useEffect(()=>{t.current=e},[e]),t.current}let zt={};function mt(e,t){return g.useMemo(()=>{if(t)return t;const n=zt[e]==null?0:zt[e]+1;return zt[e]=n,e+"-"+n},[e,t])}function os(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,c)=>{const a=Object.entries(c);for(const[l,d]of a){const h=r[l];h!=null&&(r[l]=h+e*d)}return r},{...t})}}const Ye=os(1),It=os(-1);function Io(e){return"clientX"in e&&"clientY"in e}function mn(e){if(!e)return!1;const{KeyboardEvent:t}=J(e.target);return t&&e instanceof t}function Bo(e){if(!e)return!1;const{TouchEvent:t}=J(e.target);return t&&e instanceof t}function on(e){if(Bo(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 Io(e)?{x:e.clientX,y:e.clientY}:null}const Ge=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[Ge.Translate.toString(e),Ge.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:s}=e;return t+" "+n+"ms "+s}}}),Tn="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Eo(e){return e.matches(Tn)?e:e.querySelector(Tn)}const Do={display:"none"};function To(e){let{id:t,value:n}=e;return g.createElement("div",{id:t,style:Do},n)}function Mo(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 g.createElement("div",{id:t,style:o,role:"status","aria-live":s,"aria-atomic":!0},n)}function Ro(){const[e,t]=g.useState("");return{announce:g.useCallback(s=>{s!=null&&t(s)},[]),announcement:e}}const rs=g.createContext(null);function Po(e){const t=g.useContext(rs);g.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Lo(){const[e]=g.useState(()=>new Set),t=g.useCallback(s=>(e.add(s),()=>e.delete(s)),[e]);return[g.useCallback(s=>{let{type:o,event:r}=s;e.forEach(c=>{var a;return(a=c[o])==null?void 0:a.call(c,r)})},[e]),t]}const Oo={draggable:`
2
+ To pick up a draggable item, press the space bar.
3
+ While dragging, use the arrow keys to move the item.
4
+ Press space again to drop the item in its new position, or press escape to cancel.
5
+ `},$o={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 Fo(e){let{announcements:t=$o,container:n,hiddenTextDescribedById:s,screenReaderInstructions:o=Oo}=e;const{announce:r,announcement:c}=Ro(),a=mt("DndLiveRegion"),[l,d]=g.useState(!1);if(g.useEffect(()=>{d(!0)},[]),Po(g.useMemo(()=>({onDragStart(p){let{active:m}=p;r(t.onDragStart({active:m}))},onDragMove(p){let{active:m,over:f}=p;t.onDragMove&&r(t.onDragMove({active:m,over:f}))},onDragOver(p){let{active:m,over:f}=p;r(t.onDragOver({active:m,over:f}))},onDragEnd(p){let{active:m,over:f}=p;r(t.onDragEnd({active:m,over:f}))},onDragCancel(p){let{active:m,over:f}=p;r(t.onDragCancel({active:m,over:f}))}}),[r,t])),!l)return null;const h=g.createElement(g.Fragment,null,g.createElement(To,{id:s,value:o.draggable}),g.createElement(Mo,{id:a,announcement:c}));return n?at.createPortal(h,n):h}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 Bt(){}function is(e,t){return g.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function cs(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return g.useMemo(()=>[...t].filter(s=>s!=null),[...t])}const ue=Object.freeze({x:0,y:0});function zo(e,t){let{data:{value:n}}=e,{data:{value:s}}=t;return s-n}function Ho(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Wo(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),c=o-s,a=r-n;if(s<o&&n<r){const l=t.width*t.height,d=e.width*e.height,h=c*a,p=h/(l+d-h);return Number(p.toFixed(4))}return 0}const Uo=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:s}=e;const o=[];for(const r of s){const{id:c}=r,a=n.get(c);if(a){const l=Wo(a,t);l>0&&o.push({id:c,data:{droppableContainer:r,value:l}})}}return o.sort(zo)};function Vo(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function as(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ue}function Ko(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((c,a)=>({...c,top:c.top+e*a.y,bottom:c.bottom+e*a.y,left:c.left+e*a.x,right:c.right+e*a.x}),{...n})}}const Yo=Ko(1);function Go(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 Xo(e,t,n){const s=Go(t);if(!s)return e;const{scaleX:o,scaleY:r,x:c,y:a}=s,l=e.left-c-(1-o)*parseFloat(n),d=e.top-a-(1-r)*parseFloat(n.slice(n.indexOf(" ")+1)),h=o?e.width/o:e.width,p=r?e.height/r:e.height;return{width:h,height:p,top:d,right:l+h,bottom:d+p,left:l}}const qo={ignoreTransform:!1};function Je(e,t){t===void 0&&(t=qo);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:h}=J(e).getComputedStyle(e);d&&(n=Xo(n,d,h))}const{top:s,left:o,width:r,height:c,bottom:a,right:l}=n;return{top:s,left:o,width:r,height:c,bottom:a,right:l}}function Mn(e){return Je(e,{ignoreTransform:!0})}function Jo(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Qo(e,t){return t===void 0&&(t=J(e).getComputedStyle(e)),t.position==="fixed"}function Zo(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 vn(e,t){const n=[];function s(o){if(t!=null&&n.length>=t||!o)return n;if(gn(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!gt(o)||ss(o)||n.includes(o))return n;const r=J(e).getComputedStyle(o);return o!==e&&Zo(o,r)&&n.push(o),Qo(o,r)?n:s(o.parentNode)}return e?s(e):n}function ls(e){const[t]=vn(e,1);return t??null}function Ht(e){return!Tt||!e?null:Xe(e)?e:fn(e)?gn(e)||e===qe(e).scrollingElement?window:gt(e)?e:null:null}function us(e){return Xe(e)?e.scrollX:e.scrollLeft}function ds(e){return Xe(e)?e.scrollY:e.scrollTop}function rn(e){return{x:us(e),y:ds(e)}}var U;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(U||(U={}));function hs(e){return!Tt||!e?!1:e===document.scrollingElement}function fs(e){const t={x:0,y:0},n=hs(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,c=e.scrollTop>=s.y,a=e.scrollLeft>=s.x;return{isTop:o,isLeft:r,isBottom:c,isRight:a,maxScroll:s,minScroll:t}}const er={x:.2,y:.2};function tr(e,t,n,s,o){let{top:r,left:c,right:a,bottom:l}=n;s===void 0&&(s=10),o===void 0&&(o=er);const{isTop:d,isBottom:h,isLeft:p,isRight:m}=fs(e),f={x:0,y:0},y={x:0,y:0},v={height:t.height*o.y,width:t.width*o.x};return!d&&r<=t.top+v.height?(f.y=U.Backward,y.y=s*Math.abs((t.top+v.height-r)/v.height)):!h&&l>=t.bottom-v.height&&(f.y=U.Forward,y.y=s*Math.abs((t.bottom-v.height-l)/v.height)),!m&&a>=t.right-v.width?(f.x=U.Forward,y.x=s*Math.abs((t.right-v.width-a)/v.width)):!p&&c<=t.left+v.width&&(f.x=U.Backward,y.x=s*Math.abs((t.left+v.width-c)/v.width)),{direction:f,speed:y}}function nr(e){if(e===document.scrollingElement){const{innerWidth:r,innerHeight:c}=window;return{top:0,left:0,right:r,bottom:c,width:r,height:c}}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 gs(e){return e.reduce((t,n)=>Ye(t,rn(n)),ue)}function sr(e){return e.reduce((t,n)=>t+us(n),0)}function or(e){return e.reduce((t,n)=>t+ds(n),0)}function rr(e,t){if(t===void 0&&(t=Je),!e)return;const{top:n,left:s,bottom:o,right:r}=t(e);ls(e)&&(o<=0||r<=0||n>=window.innerHeight||s>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ir=[["x",["left","right"],sr],["y",["top","bottom"],or]];class bn{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=vn(n),o=gs(s);this.rect={...t},this.width=t.width,this.height=t.height;for(const[r,c,a]of ir)for(const l of c)Object.defineProperty(this,l,{get:()=>{const d=a(s),h=o[r]-d;return this.rect[l]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class lt{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 cr(e){const{EventTarget:t}=J(e);return e instanceof t?e:qe(e)}function Wt(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 re;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(re||(re={}));function Rn(e){e.preventDefault()}function ar(e){e.stopPropagation()}var L;(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"})(L||(L={}));const ps={start:[L.Space,L.Enter],cancel:[L.Esc],end:[L.Space,L.Enter,L.Tab]},lr=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case L.Right:return{...n,x:n.x+25};case L.Left:return{...n,x:n.x-25};case L.Down:return{...n,y:n.y+25};case L.Up:return{...n,y:n.y-25}}};class ms{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 lt(qe(n)),this.windowListeners=new lt(J(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(re.Resize,this.handleCancel),this.windowListeners.add(re.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(re.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,s=t.node.current;s&&rr(s),n(ue)}handleKeyDown(t){if(mn(t)){const{active:n,context:s,options:o}=this.props,{keyboardCodes:r=ps,coordinateGetter:c=lr,scrollBehavior:a="smooth"}=o,{code:l}=t;if(r.end.includes(l)){this.handleEnd(t);return}if(r.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:d}=s.current,h=d?{x:d.left,y:d.top}:ue;this.referenceCoordinates||(this.referenceCoordinates=h);const p=c(t,{active:n,context:s.current,currentCoordinates:h});if(p){const m=It(p,h),f={x:0,y:0},{scrollableAncestors:y}=s.current;for(const v of y){const S=t.code,{isTop:C,isRight:j,isLeft:b,isBottom:_,maxScroll:w,minScroll:x}=fs(v),k=nr(v),N={x:Math.min(S===L.Right?k.right-k.width/2:k.right,Math.max(S===L.Right?k.left:k.left+k.width/2,p.x)),y:Math.min(S===L.Down?k.bottom-k.height/2:k.bottom,Math.max(S===L.Down?k.top:k.top+k.height/2,p.y))},M=S===L.Right&&!j||S===L.Left&&!b,$=S===L.Down&&!_||S===L.Up&&!C;if(M&&N.x!==p.x){const R=v.scrollLeft+m.x,D=S===L.Right&&R<=w.x||S===L.Left&&R>=x.x;if(D&&!m.y){v.scrollTo({left:R,behavior:a});return}D?f.x=v.scrollLeft-R:f.x=S===L.Right?v.scrollLeft-w.x:v.scrollLeft-x.x,f.x&&v.scrollBy({left:-f.x,behavior:a});break}else if($&&N.y!==p.y){const R=v.scrollTop+m.y,D=S===L.Down&&R<=w.y||S===L.Up&&R>=x.y;if(D&&!m.x){v.scrollTo({top:R,behavior:a});return}D?f.y=v.scrollTop-R:f.y=S===L.Down?v.scrollTop-w.y:v.scrollTop-x.y,f.y&&v.scrollBy({top:-f.y,behavior:a});break}}this.handleMove(t,Ye(It(p,this.referenceCoordinates),f))}}}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()}}ms.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:s=ps,onActivation:o}=t,{active:r}=n;const{code:c}=e.nativeEvent;if(s.start.includes(c)){const a=r.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function Pn(e){return!!(e&&"distance"in e)}function Ln(e){return!!(e&&"delay"in e)}class xn{constructor(t,n,s){var o;s===void 0&&(s=cr(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:c}=r;this.props=t,this.events=n,this.document=qe(c),this.documentListeners=new lt(this.document),this.listeners=new lt(s),this.windowListeners=new lt(J(c)),this.initialCoordinates=(o=on(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(re.Resize,this.handleCancel),this.windowListeners.add(re.DragStart,Rn),this.windowListeners.add(re.VisibilityChange,this.handleCancel),this.windowListeners.add(re.ContextMenu,Rn),this.documentListeners.add(re.Keydown,this.handleKeydown),n){if(s!=null&&s({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Ln(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Pn(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(re.Click,ar,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(re.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:s,initialCoordinates:o,props:r}=this,{onMove:c,options:{activationConstraint:a}}=r;if(!o)return;const l=(n=on(t))!=null?n:ue,d=It(o,l);if(!s&&a){if(Pn(a)){if(a.tolerance!=null&&Wt(d,a.tolerance))return this.handleCancel();if(Wt(d,a.distance))return this.handleStart()}if(Ln(a)&&Wt(d,a.tolerance))return this.handleCancel();this.handlePending(a,d);return}t.cancelable&&t.preventDefault(),c(l)}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===L.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const ur={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Mt extends xn{constructor(t){const{event:n}=t,s=qe(n.target);super(t,ur,s)}}Mt.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 dr={move:{name:"mousemove"},end:{name:"mouseup"}};var cn;(function(e){e[e.RightClick=2]="RightClick"})(cn||(cn={}));class hr extends xn{constructor(t){super(t,dr,qe(t.event.target))}}hr.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 Ut={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class fr extends xn{constructor(t){super(t,Ut)}static setup(){return window.addEventListener(Ut.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Ut.move.name,t)};function t(){}}}fr.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 ut;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(ut||(ut={}));var Et;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Et||(Et={}));function gr(e){let{acceleration:t,activator:n=ut.Pointer,canScroll:s,draggingRect:o,enabled:r,interval:c=5,order:a=Et.TreeOrder,pointerCoordinates:l,scrollableAncestors:d,scrollableAncestorRects:h,delta:p,threshold:m}=e;const f=mr({delta:p,disabled:!r}),[y,v]=No(),S=g.useRef({x:0,y:0}),C=g.useRef({x:0,y:0}),j=g.useMemo(()=>{switch(n){case ut.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case ut.DraggableRect:return o}},[n,o,l]),b=g.useRef(null),_=g.useCallback(()=>{const x=b.current;if(!x)return;const k=S.current.x*C.current.x,N=S.current.y*C.current.y;x.scrollBy(k,N)},[]),w=g.useMemo(()=>a===Et.TreeOrder?[...d].reverse():d,[a,d]);g.useEffect(()=>{if(!r||!d.length||!j){v();return}for(const x of w){if((s==null?void 0:s(x))===!1)continue;const k=d.indexOf(x),N=h[k];if(!N)continue;const{direction:M,speed:$}=tr(x,N,j,t,m);for(const R of["x","y"])f[R][M[R]]||($[R]=0,M[R]=0);if($.x>0||$.y>0){v(),b.current=x,y(_,c),S.current=$,C.current=M;return}}S.current={x:0,y:0},C.current={x:0,y:0},v()},[t,_,s,v,r,c,JSON.stringify(j),JSON.stringify(f),y,d,w,h,JSON.stringify(m)])}const pr={x:{[U.Backward]:!1,[U.Forward]:!1},y:{[U.Backward]:!1,[U.Forward]:!1}};function mr(e){let{delta:t,disabled:n}=e;const s=sn(t);return pt(o=>{if(n||!s||!o)return pr;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 vr(e,t){const n=t!=null?e.get(t):void 0,s=n?n.node.current:null;return pt(o=>{var r;return t==null?null:(r=s??o)!=null?r:null},[s,t])}function br(e,t){return g.useMemo(()=>e.reduce((n,s)=>{const{sensor:o}=s,r=o.activators.map(c=>({eventName:c.eventName,handler:t(c.handler,s)}));return[...n,...r]},[]),[e,t])}var ft;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(ft||(ft={}));var an;(function(e){e.Optimized="optimized"})(an||(an={}));const On=new Map;function xr(e,t){let{dragging:n,dependencies:s,config:o}=t;const[r,c]=g.useState(null),{frequency:a,measure:l,strategy:d}=o,h=g.useRef(e),p=S(),m=ht(p),f=g.useCallback(function(C){C===void 0&&(C=[]),!m.current&&c(j=>j===null?C:j.concat(C.filter(b=>!j.includes(b))))},[m]),y=g.useRef(null),v=pt(C=>{if(p&&!n)return On;if(!C||C===On||h.current!==e||r!=null){const j=new Map;for(let b of e){if(!b)continue;if(r&&r.length>0&&!r.includes(b.id)&&b.rect.current){j.set(b.id,b.rect.current);continue}const _=b.node.current,w=_?new bn(l(_),_):null;b.rect.current=w,w&&j.set(b.id,w)}return j}return C},[e,r,n,p,l]);return g.useEffect(()=>{h.current=e},[e]),g.useEffect(()=>{p||f()},[n,p]),g.useEffect(()=>{r&&r.length>0&&c(null)},[JSON.stringify(r)]),g.useEffect(()=>{p||typeof a!="number"||y.current!==null||(y.current=setTimeout(()=>{f(),y.current=null},a))},[a,p,f,...s]),{droppableRects:v,measureDroppableContainers:f,measuringScheduled:r!=null};function S(){switch(d){case ft.Always:return!1;case ft.BeforeDragging:return n;default:return!n}}}function vs(e,t){return pt(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Sr(e,t){return vs(e,t)}function _r(e){let{callback:t,disabled:n}=e;const s=pn(t),o=g.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:r}=window;return new r(s)},[s,n]);return g.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Rt(e){let{callback:t,disabled:n}=e;const s=pn(t),o=g.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:r}=window;return new r(s)},[n]);return g.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Cr(e){return new bn(Je(e),e)}function $n(e,t,n){t===void 0&&(t=Cr);const[s,o]=g.useState(null);function r(){o(l=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=l??n)!=null?d:null}const h=t(e);return JSON.stringify(l)===JSON.stringify(h)?l:h})}const c=_r({callback(l){if(e)for(const d of l){const{type:h,target:p}=d;if(h==="childList"&&p instanceof HTMLElement&&p.contains(e)){r();break}}}}),a=Rt({callback:r});return ve(()=>{r(),e?(a==null||a.observe(e),c==null||c.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),c==null||c.disconnect())},[e]),s}function yr(e){const t=vs(e);return as(e,t)}const Fn=[];function wr(e){const t=g.useRef(e),n=pt(s=>e?s&&s!==Fn&&e&&t.current&&e.parentNode===t.current.parentNode?s:vn(e):Fn,[e]);return g.useEffect(()=>{t.current=e},[e]),n}function jr(e){const[t,n]=g.useState(null),s=g.useRef(e),o=g.useCallback(r=>{const c=Ht(r.target);c&&n(a=>a?(a.set(c,rn(c)),new Map(a)):null)},[]);return g.useEffect(()=>{const r=s.current;if(e!==r){c(r);const a=e.map(l=>{const d=Ht(l);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,rn(d)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),s.current=e}return()=>{c(e),c(r)};function c(a){a.forEach(l=>{const d=Ht(l);d==null||d.removeEventListener("scroll",o)})}},[o,e]),g.useMemo(()=>e.length?t?Array.from(t.values()).reduce((r,c)=>Ye(r,c),ue):gs(e):ue,[e,t])}function zn(e,t){t===void 0&&(t=[]);const n=g.useRef(null);return g.useEffect(()=>{n.current=null},t),g.useEffect(()=>{const s=e!==ue;s&&!n.current&&(n.current=e),!s&&n.current&&(n.current=null)},[e]),n.current?It(e,n.current):ue}function kr(e){g.useEffect(()=>{if(!Tt)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 Ar(e,t){return g.useMemo(()=>e.reduce((n,s)=>{let{eventName:o,handler:r}=s;return n[o]=c=>{r(c,t)},n},{}),[e,t])}function bs(e){return g.useMemo(()=>e?Jo(e):null,[e])}const Hn=[];function Nr(e,t){t===void 0&&(t=Je);const[n]=e,s=bs(n?J(n):null),[o,r]=g.useState(Hn);function c(){r(()=>e.length?e.map(l=>hs(l)?s:new bn(t(l),l)):Hn)}const a=Rt({callback:c});return ve(()=>{a==null||a.disconnect(),c(),e.forEach(l=>a==null?void 0:a.observe(l))},[e]),o}function Ir(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return gt(t)?t:e}function Br(e){let{measure:t}=e;const[n,s]=g.useState(null),o=g.useCallback(d=>{for(const{target:h}of d)if(gt(h)){s(p=>{const m=t(h);return p?{...p,width:m.width,height:m.height}:m});break}},[t]),r=Rt({callback:o}),c=g.useCallback(d=>{const h=Ir(d);r==null||r.disconnect(),h&&(r==null||r.observe(h)),s(h?t(h):null)},[t,r]),[a,l]=Nt(c);return g.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const Er=[{sensor:Mt,options:{}},{sensor:ms,options:{}}],Dr={current:{}},jt={draggable:{measure:Mn},droppable:{measure:Mn,strategy:ft.WhileDragging,frequency:an.Optimized},dragOverlay:{measure:Je}};class dt 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 Tr={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new dt,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Bt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:jt,measureDroppableContainers:Bt,windowRect:null,measuringScheduled:!1},Mr={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Bt,draggableNodes:new Map,over:null,measureDroppableContainers:Bt},Pt=g.createContext(Mr),xs=g.createContext(Tr);function Rr(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new dt}}}function Pr(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 dt(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 c=new dt(e.droppable.containers);return c.set(n,{...r,disabled:o}),{...e,droppable:{...e.droppable,containers:c}}}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 dt(e.droppable.containers);return r.delete(n),{...e,droppable:{...e.droppable,containers:r}}}default:return e}}function Lr(e){let{disabled:t}=e;const{active:n,activatorEvent:s,draggableNodes:o}=g.useContext(Pt),r=sn(s),c=sn(n==null?void 0:n.id);return g.useEffect(()=>{if(!t&&!s&&r&&c!=null){if(!mn(r)||document.activeElement===r.target)return;const a=o.get(c);if(!a)return;const{activatorNode:l,node:d}=a;if(!l.current&&!d.current)return;requestAnimationFrame(()=>{for(const h of[l.current,d.current]){if(!h)continue;const p=Eo(h);if(p){p.focus();break}}})}},[s,t,o,c,r]),null}function Or(e,t){let{transform:n,...s}=t;return e!=null&&e.length?e.reduce((o,r)=>r({transform:o,...s}),n):n}function $r(e){return g.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 Fr(e){let{activeNode:t,measure:n,initialRect:s,config:o=!0}=e;const r=g.useRef(!1),{x:c,y:a}=typeof o=="boolean"?{x:o,y:o}:o;ve(()=>{if(!c&&!a||!t){r.current=!1;return}if(r.current||!s)return;const d=t==null?void 0:t.node.current;if(!d||d.isConnected===!1)return;const h=n(d),p=as(h,s);if(c||(p.x=0),a||(p.y=0),r.current=!0,Math.abs(p.x)>0||Math.abs(p.y)>0){const m=ls(d);m&&m.scrollBy({top:p.y,left:p.x})}},[t,c,a,s,n])}const Ss=g.createContext({...ue,scaleX:1,scaleY:1});var De;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(De||(De={}));const _s=g.memo(function(t){var n,s,o,r;let{id:c,accessibility:a,autoScroll:l=!0,children:d,sensors:h=Er,collisionDetection:p=Uo,measuring:m,modifiers:f,...y}=t;const v=g.useReducer(Pr,void 0,Rr),[S,C]=v,[j,b]=Lo(),[_,w]=g.useState(De.Uninitialized),x=_===De.Initialized,{draggable:{active:k,nodes:N,translate:M},droppable:{containers:$}}=S,R=k!=null?N.get(k):null,D=g.useRef({initial:null,translated:null}),P=g.useMemo(()=>{var Y;return k!=null?{id:k,data:(Y=R==null?void 0:R.data)!=null?Y:Dr,rect:D}:null},[k,R]),T=g.useRef(null),[z,q]=g.useState(null),[E,H]=g.useState(null),ie=ht(y,Object.values(y)),ye=mt("DndDescribedBy",c),Oe=g.useMemo(()=>$.getEnabled(),[$]),K=$r(m),{droppableRects:ce,measureDroppableContainers:de,measuringScheduled:Me}=xr(Oe,{dragging:x,dependencies:[M.x,M.y],config:K.droppable}),O=vr(N,k),$e=g.useMemo(()=>E?on(E):null,[E]),we=$s(),be=Sr(O,K.draggable.measure);Fr({activeNode:k!=null?N.get(k):null,config:we.layoutShiftCompensation,initialRect:be,measure:K.draggable.measure});const F=$n(O,K.draggable.measure,be),Qe=$n(O?O.parentElement:null),he=g.useRef({activatorEvent:null,active:null,activeNode:O,collisionRect:null,collisions:null,droppableRects:ce,draggableNodes:N,draggingNode:null,draggingNodeRect:null,droppableContainers:$,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Fe=$.getNodeFor((n=he.current.over)==null?void 0:n.id),xe=Br({measure:K.dragOverlay.measure}),ze=(s=xe.nodeRef.current)!=null?s:O,He=x?(o=xe.rect)!=null?o:F:null,Sn=!!(xe.nodeRef.current&&xe.rect),_n=yr(Sn?null:F),Lt=bs(ze?J(ze):null),je=wr(x?Fe??O:null),bt=Nr(je),xt=Or(f,{transform:{x:M.x-_n.x,y:M.y-_n.y,scaleX:1,scaleY:1},activatorEvent:E,active:P,activeNodeRect:F,containerNodeRect:Qe,draggingNodeRect:He,over:he.current.over,overlayNodeRect:xe.rect,scrollableAncestors:je,scrollableAncestorRects:bt,windowRect:Lt}),Cn=$e?Ye($e,M):null,yn=jr(je),Ds=zn(yn),Ts=zn(yn,[F]),We=Ye(xt,Ds),Ue=He?Yo(He,xt):null,Ze=P&&Ue?p({active:P,collisionRect:Ue,droppableRects:ce,droppableContainers:Oe,pointerCoordinates:Cn}):null,wn=Ho(Ze,"id"),[ke,jn]=g.useState(null),Ms=Sn?xt:Ye(xt,Ts),Rs=Vo(Ms,(r=ke==null?void 0:ke.rect)!=null?r:null,F),Ot=g.useRef(null),kn=g.useCallback((Y,Q)=>{let{sensor:Z,options:Ae}=Q;if(T.current==null)return;const se=N.get(T.current);if(!se)return;const ee=Y.nativeEvent,fe=new Z({active:T.current,activeNode:se,event:ee,options:Ae,context:he,onAbort(V){if(!N.get(V))return;const{onDragAbort:ge}=ie.current,Se={id:V};ge==null||ge(Se),j({type:"onDragAbort",event:Se})},onPending(V,Ne,ge,Se){if(!N.get(V))return;const{onDragPending:tt}=ie.current,Ie={id:V,constraint:Ne,initialCoordinates:ge,offset:Se};tt==null||tt(Ie),j({type:"onDragPending",event:Ie})},onStart(V){const Ne=T.current;if(Ne==null)return;const ge=N.get(Ne);if(!ge)return;const{onDragStart:Se}=ie.current,et={activatorEvent:ee,active:{id:Ne,data:ge.data,rect:D}};at.unstable_batchedUpdates(()=>{Se==null||Se(et),w(De.Initializing),C({type:W.DragStart,initialCoordinates:V,active:Ne}),j({type:"onDragStart",event:et}),q(Ot.current),H(ee)})},onMove(V){C({type:W.DragMove,coordinates:V})},onEnd:Ve(W.DragEnd),onCancel:Ve(W.DragCancel)});Ot.current=fe;function Ve(V){return async function(){const{active:ge,collisions:Se,over:et,scrollAdjustedTranslate:tt}=he.current;let Ie=null;if(ge&&tt){const{cancelDrop:nt}=ie.current;Ie={activatorEvent:ee,active:ge,collisions:Se,delta:tt,over:et},V===W.DragEnd&&typeof nt=="function"&&await Promise.resolve(nt(Ie))&&(V=W.DragCancel)}T.current=null,at.unstable_batchedUpdates(()=>{C({type:V}),w(De.Uninitialized),jn(null),q(null),H(null),Ot.current=null;const nt=V===W.DragEnd?"onDragEnd":"onDragCancel";if(Ie){const $t=ie.current[nt];$t==null||$t(Ie),j({type:nt,event:Ie})}})}}},[N]),Ps=g.useCallback((Y,Q)=>(Z,Ae)=>{const se=Z.nativeEvent,ee=N.get(Ae);if(T.current!==null||!ee||se.dndKit||se.defaultPrevented)return;const fe={active:ee};Y(Z,Q.options,fe)===!0&&(se.dndKit={capturedBy:Q.sensor},T.current=Ae,kn(Z,Q))},[N,kn]),An=br(h,Ps);kr(h),ve(()=>{F&&_===De.Initializing&&w(De.Initialized)},[F,_]),g.useEffect(()=>{const{onDragMove:Y}=ie.current,{active:Q,activatorEvent:Z,collisions:Ae,over:se}=he.current;if(!Q||!Z)return;const ee={active:Q,activatorEvent:Z,collisions:Ae,delta:{x:We.x,y:We.y},over:se};at.unstable_batchedUpdates(()=>{Y==null||Y(ee),j({type:"onDragMove",event:ee})})},[We.x,We.y]),g.useEffect(()=>{const{active:Y,activatorEvent:Q,collisions:Z,droppableContainers:Ae,scrollAdjustedTranslate:se}=he.current;if(!Y||T.current==null||!Q||!se)return;const{onDragOver:ee}=ie.current,fe=Ae.get(wn),Ve=fe&&fe.rect.current?{id:fe.id,rect:fe.rect.current,data:fe.data,disabled:fe.disabled}:null,V={active:Y,activatorEvent:Q,collisions:Z,delta:{x:se.x,y:se.y},over:Ve};at.unstable_batchedUpdates(()=>{jn(Ve),ee==null||ee(V),j({type:"onDragOver",event:V})})},[wn]),ve(()=>{he.current={activatorEvent:E,active:P,activeNode:O,collisionRect:Ue,collisions:Ze,droppableRects:ce,draggableNodes:N,draggingNode:ze,draggingNodeRect:He,droppableContainers:$,over:ke,scrollableAncestors:je,scrollAdjustedTranslate:We},D.current={initial:He,translated:Ue}},[P,O,Ze,Ue,N,ze,He,ce,$,ke,je,We]),gr({...we,delta:M,draggingRect:Ue,pointerCoordinates:Cn,scrollableAncestors:je,scrollableAncestorRects:bt});const Ls=g.useMemo(()=>({active:P,activeNode:O,activeNodeRect:F,activatorEvent:E,collisions:Ze,containerNodeRect:Qe,dragOverlay:xe,draggableNodes:N,droppableContainers:$,droppableRects:ce,over:ke,measureDroppableContainers:de,scrollableAncestors:je,scrollableAncestorRects:bt,measuringConfiguration:K,measuringScheduled:Me,windowRect:Lt}),[P,O,F,E,Ze,Qe,xe,N,$,ce,ke,de,je,bt,K,Me,Lt]),Os=g.useMemo(()=>({activatorEvent:E,activators:An,active:P,activeNodeRect:F,ariaDescribedById:{draggable:ye},dispatch:C,draggableNodes:N,over:ke,measureDroppableContainers:de}),[E,An,P,F,C,ye,N,ke,de]);return g.createElement(rs.Provider,{value:b},g.createElement(Pt.Provider,{value:Os},g.createElement(xs.Provider,{value:Ls},g.createElement(Ss.Provider,{value:Rs},d)),g.createElement(Lr,{disabled:(a==null?void 0:a.restoreFocus)===!1})),g.createElement(Fo,{...a,hiddenTextDescribedById:ye}));function $s(){const Y=(z==null?void 0:z.autoScrollEnabled)===!1,Q=typeof l=="object"?l.enabled===!1:l===!1,Z=x&&!Y&&!Q;return typeof l=="object"?{...l,enabled:Z}:{enabled:Z}}}),zr=g.createContext(null),Wn="button",Hr="Draggable";function Wr(e){let{id:t,data:n,disabled:s=!1,attributes:o}=e;const r=mt(Hr),{activators:c,activatorEvent:a,active:l,activeNodeRect:d,ariaDescribedById:h,draggableNodes:p,over:m}=g.useContext(Pt),{role:f=Wn,roleDescription:y="draggable",tabIndex:v=0}=o??{},S=(l==null?void 0:l.id)===t,C=g.useContext(S?Ss:zr),[j,b]=Nt(),[_,w]=Nt(),x=Ar(c,t),k=ht(n);ve(()=>(p.set(t,{id:t,key:r,node:j,activatorNode:_,data:k}),()=>{const M=p.get(t);M&&M.key===r&&p.delete(t)}),[p,t]);const N=g.useMemo(()=>({role:f,tabIndex:v,"aria-disabled":s,"aria-pressed":S&&f===Wn?!0:void 0,"aria-roledescription":y,"aria-describedby":h.draggable}),[s,f,v,S,y,h.draggable]);return{active:l,activatorEvent:a,activeNodeRect:d,attributes:N,isDragging:S,listeners:s?void 0:x,node:j,over:m,setNodeRef:b,setActivatorNodeRef:w,transform:C}}function Ur(){return g.useContext(xs)}const Vr="Droppable",Kr={timeout:25};function Yr(e){let{data:t,disabled:n=!1,id:s,resizeObserverConfig:o}=e;const r=mt(Vr),{active:c,dispatch:a,over:l,measureDroppableContainers:d}=g.useContext(Pt),h=g.useRef({disabled:n}),p=g.useRef(!1),m=g.useRef(null),f=g.useRef(null),{disabled:y,updateMeasurementsFor:v,timeout:S}={...Kr,...o},C=ht(v??s),j=g.useCallback(()=>{if(!p.current){p.current=!0;return}f.current!=null&&clearTimeout(f.current),f.current=setTimeout(()=>{d(Array.isArray(C.current)?C.current:[C.current]),f.current=null},S)},[S]),b=Rt({callback:j,disabled:y||!c}),_=g.useCallback((N,M)=>{b&&(M&&(b.unobserve(M),p.current=!1),N&&b.observe(N))},[b]),[w,x]=Nt(_),k=ht(t);return g.useEffect(()=>{!b||!w.current||(b.disconnect(),p.current=!1,b.observe(w.current))},[w,b]),g.useEffect(()=>(a({type:W.RegisterDroppable,element:{id:s,key:r,disabled:n,node:w,rect:m,data:k}}),()=>a({type:W.UnregisterDroppable,key:r,id:s})),[s]),g.useEffect(()=>{n!==h.current.disabled&&(a({type:W.SetDroppableDisabled,id:s,key:r,disabled:n}),h.current.disabled=n)},[s,r,n,a]),{active:c,rect:m,isOver:(l==null?void 0:l.id)===s,node:w,over:l,setNodeRef:x}}function Cs(e,t,n){const s=e.slice();return s.splice(n<0?s.length+n:n,0,s.splice(t,1)[0]),s}function Gr(e,t){return e.reduce((n,s,o)=>{const r=t.get(s);return r&&(n[o]=r),n},Array(e.length))}function _t(e){return e!==null&&e>=0}function Xr(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 qr(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const ys=e=>{let{rects:t,activeIndex:n,overIndex:s,index:o}=e;const r=Cs(t,s,n),c=t[o],a=r[o];return!a||!c?null:{x:a.left-c.left,y:a.top-c.top,scaleX:a.width/c.width,scaleY:a.height/c.height}},Ct={scaleX:1,scaleY:1},ws=e=>{var t;let{activeIndex:n,activeNodeRect:s,index:o,rects:r,overIndex:c}=e;const a=(t=r[n])!=null?t:s;if(!a)return null;if(o===n){const d=r[c];return d?{x:0,y:n<c?d.top+d.height-(a.top+a.height):d.top-a.top,...Ct}:null}const l=Jr(r,o,n);return o>n&&o<=c?{x:0,y:-a.height-l,...Ct}:o<n&&o>=c?{x:0,y:a.height+l,...Ct}:{x:0,y:0,...Ct}};function Jr(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 js="Sortable",ks=g.createContext({activeIndex:-1,containerId:js,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:ys,disabled:{draggable:!1,droppable:!1}});function As(e){let{children:t,id:n,items:s,strategy:o=ys,disabled:r=!1}=e;const{active:c,dragOverlay:a,droppableRects:l,over:d,measureDroppableContainers:h}=Ur(),p=mt(js,n),m=a.rect!==null,f=g.useMemo(()=>s.map(x=>typeof x=="object"&&"id"in x?x.id:x),[s]),y=c!=null,v=c?f.indexOf(c.id):-1,S=d?f.indexOf(d.id):-1,C=g.useRef(f),j=!Xr(f,C.current),b=S!==-1&&v===-1||j,_=qr(r);ve(()=>{j&&y&&h(f)},[j,f,y,h]),g.useEffect(()=>{C.current=f},[f]);const w=g.useMemo(()=>({activeIndex:v,containerId:p,disabled:_,disableTransforms:b,items:f,overIndex:S,useDragOverlay:m,sortedRects:Gr(f,l),strategy:o}),[v,p,_.draggable,_.droppable,b,f,S,l,m,o]);return g.createElement(ks.Provider,{value:w},t)}const Qr=e=>{let{id:t,items:n,activeIndex:s,overIndex:o}=e;return Cs(n,s,o).indexOf(t)},Zr=e=>{let{containerId:t,isSorting:n,wasDragging:s,index:o,items:r,newIndex:c,previousItems:a,previousContainerId:l,transition:d}=e;return!d||!s||a!==r&&o===c?!1:n?!0:c!==o&&t===l},ei={duration:200,easing:"ease"},Ns="transform",ti=Ge.Transition.toString({property:Ns,duration:0,easing:"linear"}),ni={roleDescription:"sortable"};function si(e){let{disabled:t,index:n,node:s,rect:o}=e;const[r,c]=g.useState(null),a=g.useRef(n);return ve(()=>{if(!t&&n!==a.current&&s.current){const l=o.current;if(l){const d=Je(s.current,{ignoreTransform:!0}),h={x:l.left-d.left,y:l.top-d.top,scaleX:l.width/d.width,scaleY:l.height/d.height};(h.x||h.y)&&c(h)}}n!==a.current&&(a.current=n)},[t,n,s,o]),g.useEffect(()=>{r&&c(null)},[r]),r}function Is(e){let{animateLayoutChanges:t=Zr,attributes:n,disabled:s,data:o,getNewIndex:r=Qr,id:c,strategy:a,resizeObserverConfig:l,transition:d=ei}=e;const{items:h,containerId:p,activeIndex:m,disabled:f,disableTransforms:y,sortedRects:v,overIndex:S,useDragOverlay:C,strategy:j}=g.useContext(ks),b=oi(s,f),_=h.indexOf(c),w=g.useMemo(()=>({sortable:{containerId:p,index:_,items:h},...o}),[p,o,_,h]),x=g.useMemo(()=>h.slice(h.indexOf(c)),[h,c]),{rect:k,node:N,isOver:M,setNodeRef:$}=Yr({id:c,data:w,disabled:b.droppable,resizeObserverConfig:{updateMeasurementsFor:x,...l}}),{active:R,activatorEvent:D,activeNodeRect:P,attributes:T,setNodeRef:z,listeners:q,isDragging:E,over:H,setActivatorNodeRef:ie,transform:ye}=Wr({id:c,data:w,attributes:{...ni,...n},disabled:b.draggable}),Oe=Ao($,z),K=!!R,ce=K&&!y&&_t(m)&&_t(S),de=!C&&E,Me=de&&ce?ye:null,$e=ce?Me??(a??j)({rects:v,activeNodeRect:P,activeIndex:m,overIndex:S,index:_}):null,we=_t(m)&&_t(S)?r({id:c,items:h,activeIndex:m,overIndex:S}):_,be=R==null?void 0:R.id,F=g.useRef({activeId:be,items:h,newIndex:we,containerId:p}),Qe=h!==F.current.items,he=t({active:R,containerId:p,isDragging:E,isSorting:K,id:c,index:_,items:h,newIndex:F.current.newIndex,previousItems:F.current.items,previousContainerId:F.current.containerId,transition:d,wasDragging:F.current.activeId!=null}),Fe=si({disabled:!he,index:_,node:N,rect:k});return g.useEffect(()=>{K&&F.current.newIndex!==we&&(F.current.newIndex=we),p!==F.current.containerId&&(F.current.containerId=p),h!==F.current.items&&(F.current.items=h)},[K,we,p,h]),g.useEffect(()=>{if(be===F.current.activeId)return;if(be!=null&&F.current.activeId==null){F.current.activeId=be;return}const ze=setTimeout(()=>{F.current.activeId=be},50);return()=>clearTimeout(ze)},[be]),{active:R,activeIndex:m,attributes:T,data:w,rect:k,index:_,newIndex:we,items:h,isOver:M,isSorting:K,isDragging:E,listeners:q,node:N,overIndex:S,over:H,setNodeRef:Oe,setActivatorNodeRef:ie,setDroppableNodeRef:$,setDraggableNodeRef:z,transform:Fe??$e,transition:xe()};function xe(){if(Fe||Qe&&F.current.newIndex===_)return ti;if(!(de&&!mn(D)||!d)&&(K||he))return Ge.Transition.toString({...d,property:Ns})}}function oi(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}}L.Down,L.Right,L.Up,L.Left;const ri="_header_dr2i6_6",ii="_left_dr2i6_32",ci="_right_dr2i6_44",ai="_addressBar_dr2i6_58",li="_divider_dr2i6_71",ui="_chromeIcon_dr2i6_79",Re={header:ri,left:ii,right:ci,addressBar:ai,divider:li,chromeIcon:ui},di="_buttons_fuys6_3",hi="_button_fuys6_3",fi="_disabled_fuys6_33",st={buttons:di,button:hi,disabled:fi},gi=()=>{const{undo:e,redo:t,past:n,future:s}=u.useHistoryStore(),[o,r]=g.useState(!1),[c,a]=g.useState(!1),[l,d]=g.useState(!1),[h,p]=g.useState(!1),[m,f]=g.useState(null),{notifications:y,setNotifications:v}=u.useNotificationStore();return g.useEffect(()=>{r(n.length===0)},[n]),g.useEffect(()=>{a(s.length===0)},[s]),i.jsxs("div",{className:st.buttons,children:[i.jsxs("div",{className:u.clx(st.button,{[st.disabled]:o}),onMouseEnter:()=>{const S=setTimeout(()=>{p(!0),d(!1)},200);f(S)},onMouseLeave:()=>{m&&clearTimeout(m),p(!1),d(!1)},children:[i.jsx(A.Icon,{name:"ArrowUUpLeft",width:20,height:20,onClick:()=>{o||(e(),v([...y,{id:u.v4(),message:"Changes undone",status:"success"}]))},fill:o?"#757575":"#252525"}),h&&i.jsx(u.Tooltip,{text:o?"Nothing to undo":"Click to undo changes"})]}),i.jsxs("div",{className:u.clx(st.button,{[st.disabled]:c}),onMouseEnter:()=>{const S=setTimeout(()=>{d(!0),p(!1)},200);f(S)},onMouseLeave:()=>{m&&clearTimeout(m),d(!1),p(!1)},children:[i.jsx(A.Icon,{name:"ArrowUUpRight",width:20,height:20,onClick:()=>{c||(t(),v([...y,{id:u.v4(),message:"Changes redone",status:"success"}]))},fill:c?"#757575":"#252525"}),l&&i.jsx(u.Tooltip,{text:c?"Nothing to redo":"Click to redo changes"})]})]})},pi="_devices_1m4w5_3",mi="_device_1m4w5_3",vi="_iconWrap_1m4w5_28",Vt={devices:pi,device:mi,iconWrap:vi},bi=()=>{const{currentDevice:e,setCurrentDevice:t}=u.useDeviceStore(),[n,s]=g.useState(!1),o=g.useRef(null),r=u.devices.findIndex(l=>l.value===e.value),c=u.devices[(r+1)%u.devices.length],a=()=>{t(c)};return g.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]),i.jsxs("div",{className:Vt.devices,onMouseEnter:()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>s(!0),200)},onMouseLeave:()=>{o.current&&clearTimeout(o.current),s(!1)},children:[i.jsx("button",{type:"button",className:Vt.device,onClick:a,"aria-label":`Viewport: ${e.value} (click to switch to ${c.value})`,children:i.jsx("span",{className:Vt.iconWrap,children:i.jsx(A.Icon,{name:e.icon,fill:"currentColor",width:14,height:14})},e.value)}),n&&i.jsx(u.Tooltip,{text:e.value.charAt(0).toUpperCase()+e.value.slice(1)})]})},xi="_preview_18ijb_3",Si="_text_18ijb_33",_i="_active_18ijb_37",Kt={preview:xi,text:Si,active:_i},Ci=()=>{const{onPreview:e}=u.usePreviewStore(),[t,n]=g.useState(!1),[s,o]=g.useState(null);return i.jsxs("a",{href:"/",className:u.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(A.Icon,{name:"ArrowUpRight",width:20,height:20}),i.jsx("span",{className:Kt.text,children:"Preview"}),t&&i.jsx(u.Tooltip,{text:"Open draft theme in new tab"})]})},yi="_pages_o6ksn_3",wi="_text_o6ksn_30",ji="_modal_o6ksn_41",ki="_open_o6ksn_68",Ai="_items_o6ksn_76",Ni="_page_o6ksn_3",Ii="_hoverable_o6ksn_102",Bi="_current_o6ksn_107",Ei="_actions_o6ksn_118",Di="_actionIcon_o6ksn_125",Ti="_actionDanger_o6ksn_144",Mi="_separator_o6ksn_152",Ri="_button_o6ksn_158",G={pages:yi,default:"_default_o6ksn_9",text:wi,modal:ji,open:ki,items:Ai,page:Ni,hoverable:Ii,current:Bi,actions:Ei,actionIcon:Di,actionDanger:Ti,separator:Mi,button:Ri},Bs=async e=>{const t=localStorage.getItem("shopId")||void 0,n=localStorage.getItem("draftId"),o=`${u.useApiStore.getState().apiUrls.api}/v2/builder/shops/${t}/drafts/${n}/pages/${encodeURIComponent(e)}`;return await u.request({url:o,withToken:!0,method:"delete"})},Pi=()=>{const{currentPage:e,setCurrentPage:t,setIsOpenModal:n,pages:s,setIsEdit:o,setEditedPage:r,deletePage:c,setIsOpenSelectModal:a}=u.usePagesStore(),{setCurrentBlock:l,deletePage:d}=u.useLayersStore(),{setTitle:h,setDescription:p,setOnConfirm:m}=u.useConfirmationModalStore(),[f,y]=g.useState(null),[v,S]=g.useState(!1),C=g.useRef(null);A.useOnClickOutside(C,()=>{v&&S(!1)}),g.useEffect(()=>{v?a(!0):setTimeout(()=>{a(!1)},300)},[v]);const j=b=>{if(!b)return"/";const _=String(b).trim().toLowerCase();return _===""||_==="home"||_==="/"?"/":_.startsWith("/")?_:`/${_}`};return i.jsxs("div",{className:G.pages,ref:C,children:[i.jsxs("div",{className:G.default,onClick:b=>{b.stopPropagation(),S(_=>!_)},children:[i.jsx("span",{className:G.text,children:s&&s[e]?j(s[e].path):"/"}),i.jsx("div",{style:{transform:v?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.3s ease",display:"flex"},children:i.jsx(A.Icon,{name:"CaretDown",width:20,height:20})})]}),i.jsxs("div",{className:u.clx(G.modal,{[G.open]:v}),onClick:b=>b.stopPropagation(),children:[s&&i.jsx("div",{className:G.items,children:Object.keys(s).map(b=>{const _=s[b],w=s[e]&&s[e].name===_.name,x=u.defaultPagePaths.includes(_.path);return i.jsxs("div",{className:u.clx(G.page,{[G.hoverable]:f===b,[G.current]:w}),onMouseEnter:()=>y(b),onMouseLeave:()=>y(null),onClick:()=>{y(null),o(!1),l(null),t(b),S(!1)},children:[i.jsx("span",{className:G.text,children:j(_.path)}),f===b&&i.jsxs("div",{className:G.actions,children:[i.jsx("button",{type:"button",className:G.actionIcon,"aria-label":"Edit page",onClick:k=>{k.stopPropagation(),o(!0),r(b),n(!0),S(!1)},children:i.jsx(A.Icon,{name:"Gear",fill:"currentColor",width:14,height:14})}),!x&&i.jsx("button",{type:"button",className:u.clx(G.actionIcon,G.actionDanger),"aria-label":"Delete page",onClick:k=>{k.stopPropagation(),h("Delete Page"),p(`Are you sure you want to delete ${_.name||"this"} page? Once you delete this page, any content visible will also be deleted. This is irreversible.`),m(()=>{if(s[e]&&s[e].path===_.path){const N=Object.keys(s).find(M=>M!==b);N&&t(N)}c(b),d(_.name),Bs(_.path)})},children:i.jsx(A.Icon,{name:"Trash",fill:"currentColor",width:14,height:14})})]})]},b)})}),i.jsx("div",{className:G.separator}),i.jsxs(A.ButtonSettings,{className:G.button,onClick:b=>{b.stopPropagation(),n(!0)},size:"l",children:[i.jsx(A.Icon,{name:"Plus",fill:"var(--brand-color)"}),i.jsx("span",{children:"Create New Page"})]})]})]})},Li=async(e,t,n)=>{const s=localStorage.getItem("shopId")||void 0,o=localStorage.getItem("draftId"),c=`${u.useApiStore.getState().apiUrls.api}/v2/builder/shops/${s}/drafts/${o}/${t}`;return await u.request({url:c,withToken:!0,method:e,body:n})};function ot(e,t){var n;try{const s=[],o=(c,a)=>{const l=[],d=h=>{if(!(!h||typeof h!="object")){if(Array.isArray(h)){h.forEach(d);return}Object.entries(h).forEach(([p,m])=>{p===a&&l.push(m),m&&typeof m=="object"&&d(m)})}};return d(c),l};for(const c of t){if(!((n=c==null?void 0:c.value)!=null&&n.blockSettings))continue;const a=c.value.blockSettings,l=Object.values(a).filter(h=>h&&h.type===e).flatMap(h=>h.value);s.push(...l);const d=o(a,e);s.push(...d)}let r=s.filter(c=>c!=null).map(c=>e==="ListingIds"?(c==null?void 0:c.listingId)??c:typeof c=="object"&&c!==null&&Object.prototype.hasOwnProperty.call(c,e)?c[e]:c);if(r.length>0)if(typeof r[0]!="object")r=Array.from(new Set(r));else{const c=new Set;r=r.filter(a=>{const l=JSON.stringify(a);return c.has(l)?!1:(c.add(l),!0)})}return r}catch{return[]}}function Oi(e,t,n){return $i(e,t)?(n.reviews||[]).length*3:0}function $i(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 Fi(e,t){if(t){const n=Object.keys(t).find(s=>t[s].path===e);if(n)return t[n]}return null}const zi=({setIsLoading:e,isLoading:t})=>{const{themeSettings:n}=u.useThemeSettingsStore(),{settings:s}=u.useSettingsStore(),[o,r]=g.useState(null),[c,a]=g.useState(!1),{setNotifications:l,notifications:d}=u.useNotificationStore(),{header:h,footer:p,announcement:m,blocks:f}=u.useLayersStore(),{pageContext:y}=u.usePagesStore(),{pages:v}=u.usePagesStore(),S=async()=>{if(c)o&&clearTimeout(o);else{e(!0);const j=Object.keys(f).map(_=>{const w=Fi(_,v);return f[_]&&f[_].data&&(w!=null&&w.path)?{id:w?w.id:_,name:w?w.name:_,path:w.path,layout:{...f[_]},neededProductIds:[...ot("ProductId",Object.values(f[_].data))],neededCategoryIds:[...ot("CategoryId",Object.values(f[_].data))],neededAnnouncementIds:[...ot("AnnouncementId",Object.values(f[_].data))],neededListingIds:[...ot("ListingIds",Object.values(f[_].data))],neededFaqIds:[...ot("FaqsIds",Object.values(f[_].data))],neededReviewCount:Oi("ReviewCount",Object.values(f[_].data),y),neededVouchCount:Object.values(f[_].data).some(x=>x.name==="Vouches")?1e3:void 0,includeLiveStats:Object.values(f[_].data).some(x=>x.name==="LiveActivity"),includeFaqs:Object.values(f[_].data).some(x=>x.name==="FAQ"),seo:{pageTitle:w&&w.seo&&w.seo.pageTitle?w.seo.pageTitle:"",pageDescription:w&&w.seo&&w.seo.pageDescription?w.seo.pageDescription:""},isPrivate:!!(w&&w.visibility==="private")}:null}).filter(_=>_),b={settings:{...s},header:h,footer:p,announcement:m};try{const{status:_}=await Li("post","save",{themeSettings:n,settings:b,updatedPages:j});l([...d,{id:u.v4(),message:_===200?"Settings saved":"Error",status:_===200?"success":"error"}])}catch(_){const w=_ instanceof Error?_.message:"An unexpected error occurred";l([...d,{id:u.v4(),message:w,status:"error"}])}finally{e(!1)}}a(!0);const C=setTimeout(()=>{a(!1)},2e3);r(C)};return i.jsx(A.ButtonSettings,{onClick:S,disabled:t,type:"Primary",children:i.jsx("span",{style:{userSelect:"none"},children:"Save"})})},Hi=()=>i.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,width:"14",height:"14",children:i.jsx("path",{d:"M4 12a8 8 0 0114-5.3L20 9M20 4v5h-5M20 12a8 8 0 01-14 5.3L4 15M4 20v-5h5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Wi=()=>{const{isOpenSelectModal:e}=u.usePagesStore(),[t,n]=g.useState(!1),{showTooltip:s}=u.useTooltipStore(),[o,r]=g.useState(!1),c=g.useRef(null);g.useEffect(()=>()=>{c.current&&clearTimeout(c.current)},[]);const a=()=>{const l=document.querySelector("iframe");l?l.src=l.src:window.location.reload()};return i.jsxs("div",{className:Re.header,style:{zIndex:e?5e4:s?501:50},children:[i.jsx("div",{className:Re.left,children:i.jsxs("div",{className:Re.addressBar,children:[i.jsx(bi,{}),i.jsx("span",{className:Re.divider,"aria-hidden":!0}),i.jsx(Pi,{}),i.jsx("span",{className:Re.divider,"aria-hidden":!0}),i.jsx(Ci,{}),i.jsxs("button",{type:"button",className:Re.chromeIcon,onClick:a,"aria-label":"Reload preview",onMouseEnter:()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>r(!0),200)},onMouseLeave:()=>{c.current&&clearTimeout(c.current),r(!1)},children:[i.jsx(Hi,{}),o&&i.jsx(u.Tooltip,{text:"Reload"})]})]})}),i.jsxs("div",{className:Re.right,children:[i.jsx(gi,{}),i.jsx(zi,{setIsLoading:n,isLoading:t}),t&&i.jsx(u.Loader,{})]})]})},Ui="_exitLink_1bn4r_3",Vi={exitLink:Ui},Ki=()=>i.jsx("a",{href:location.origin,className:Vi.exitLink,"aria-label":"Exit builder",title:"Exit",children:i.jsx(A.Icon,{name:"SignOut",width:18,height:18})}),Yi="_navbar_13erj_3",Gi="_main_13erj_17",Xi="_footer_13erj_27",qi="_block_13erj_37",Ji="_active_13erj_88",rt={navbar:Yi,main:Gi,footer:Xi,block:qi,active:Ji},Qi=()=>{const{activeBlock:e}=u.useNavbarStore(),{setActiveBlock:t}=u.useBlocksStore(),{setCurrentBlock:n}=u.useLayersStore(),{setActiveBlock:s}=u.useThemeSettingsStore(),{setActiveBlock:o}=u.usePreviewStore(),r=u.useNavigate(),[c,a]=g.useState(null),l=g.useRef(null);g.useEffect(()=>()=>{l.current&&clearTimeout(l.current)},[]);function d(h){switch(t(null),n(null),s(null),o({id:null,neededScroll:!1}),h.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:rt.navbar,children:[i.jsx("div",{className:rt.main,children:u.navbarBlocks.map(h=>i.jsxs("div",{className:u.clx(rt.block,{[rt.active]:e.icon===h.icon}),onClick:()=>d(h),onMouseEnter:()=>{l.current&&clearTimeout(l.current),l.current=setTimeout(()=>a(h.icon),200)},onMouseLeave:()=>{l.current&&clearTimeout(l.current),a(null)},children:[i.jsx(A.Icon,{name:h.icon,fill:e.icon===h.icon?"var(--brand-color, #a13dff)":"var(--secondary-text-color, var(--builder-text-secondary))"}),c===h.icon&&i.jsx(u.Tooltip,{text:h.name})]},h.icon))}),i.jsx("div",{className:rt.footer,children:i.jsx(Ki,{})})]})},Zi="_preview_menhv_2",ec="_main_menhv_25",tc="_content_menhv_37",nc="_loading_menhv_46",sc="_previewLoading_menhv_80",it={preview:Zi,main:ec,content:tc,loading:nc,previewLoading:sc},oc="_content_kxo9a_2",rc="_main_kxo9a_13",ic="_block_kxo9a_17",cc="_active_kxo9a_24",ac="_name_kxo9a_49",lc="_addSection_kxo9a_137",uc="_addSectionTop_kxo9a_145",Be={content:oc,main:rc,block:ic,active:cc,name:ac,addSection:lc,addSectionTop:uc},dc="_sidebar_18lv6_5",hc="_content_18lv6_18",fc="_button_18lv6_31",gc="_moveButton_18lv6_61",pc="_deleteButton_18lv6_75",pe={sidebar:dc,content:hc,button:fc,moveButton:gc,deleteButton:pc},mc=()=>{var w;const{activeBlock:e,setActiveBlock:t}=u.usePreviewStore(),{blocks:n,removeBlock:s,moveBlock:o,duplicateBlock:r,setCurrentBlock:c}=u.useLayersStore(),{currentPage:a,pages:l}=u.usePagesStore(),{setTitle:d,setDescription:h,setOnConfirm:p}=u.useConfirmationModalStore(),{setActiveBlock:m}=u.useBlocksStore(),f=(w=l==null?void 0:l[a])==null?void 0:w.path,y=f?n[f]:null,v=(y==null?void 0:y.order)||[],S=v.indexOf(e.id),C=x=>{x.stopPropagation(),S>0&&f&&(o(f,S,S-1),t({id:e.id,neededScroll:!0}),setTimeout(()=>{t({id:e.id,neededScroll:!1})},100))},j=x=>{x.stopPropagation(),S<v.length-1&&f&&(o(f,S,S+1),t({id:e.id,neededScroll:!0}),setTimeout(()=>{t({id:e.id,neededScroll:!1})},100))},b=x=>{x.stopPropagation(),f&&r(f,e.id)},_=()=>{f&&(s(f,e.id),c(null),m(null),t({id:null,neededScroll:!1}))};return i.jsx("div",{className:pe.sidebar,children:i.jsxs("div",{className:pe.content,children:[i.jsx("button",{onClick:C,className:u.clx(pe.button,pe.moveButton),disabled:S===0,children:i.jsx(A.Icon,{name:"ArrowUp",fill:"currentColor",width:16,height:16})}),i.jsx("button",{onClick:j,className:u.clx(pe.button,pe.moveButton),disabled:S===v.length-1,children:i.jsx(A.Icon,{name:"ArrowDown",fill:"currentColor",width:16,height:16})}),i.jsx("button",{onClick:b,className:u.clx(pe.button,pe.moveButton),children:i.jsx(A.Icon,{name:"Copy",fill:"currentColor",width:16,height:16})}),i.jsx("button",{className:u.clx(pe.button,pe.deleteButton),onClick:x=>{x.stopPropagation(),d("Remove Block"),h(`Are you sure you want to delete ${(y==null?void 0:y.data[e.id].name)||"this"} block? Once you delete this block, any content visible will also be deleted. This is irreversible.`),p(_)},children:i.jsx(A.Icon,{name:"Trash",fill:"currentColor",width:16,height:16})})]})})},vc=g.memo(({scrollableRef:e})=>{const{setActiveBlock:t,activeBlock:n,zoomLevel:s}=u.usePreviewStore(),{blocks:o,sourceBlocks:r}=u.useBlocksStore(),{blocks:c,setCurrentBlock:a,currentBlock:l,setPositionBlock:d,announcement:h}=u.useLayersStore(),{settings:p}=u.useSettingsStore(),{currentPage:m,pages:f,pageContext:y}=u.usePagesStore(),{activeBlock:v,setActiveBlock:S}=u.useThemeSettingsStore(),{setActiveBlock:C}=u.useBlocksStore(),j=g.useRef(n.id),b=g.useRef({});g.useEffect(()=>{if(n.id&&n.neededScroll&&b.current[n.id]){const x=b.current[n.id];if(x&&e.current){const k=x.offsetTop;e.current.scrollTo({top:k-30,behavior:"smooth"})}}},[n,e]);const _=u.useNavigate();g.useEffect(()=>{j.current=n.id},[n.id]);const w=x=>{if(!x||!x.name)return i.jsx(A.ErrorableBlock,{error:"Block or block.name is undefined."});if(!o||!o[x.name])return i.jsx(A.ErrorableBlock,{error:`Block "${x.name}" does not exist in blocks.`});const k=new o[x.name];return x.value&&Object.assign(k,x.value),k.renderBlock(p,y)};return i.jsxs("div",{onClick:x=>{x.stopPropagation()},className:`${Be.content} theme-storefront`,style:{width:"100%",height:"100%",zoom:`${s}`},ref:e,children:[h&&i.jsx(dn,{}),i.jsx(un,{}),i.jsx("div",{className:Be.main,children:f&&f[m]&&c[f[m].path]&&c[f[m].path].data&&c[f[m].path].order.map((x,k)=>i.jsxs("div",{ref:N=>b.current[x]=N,onClick:N=>{N.stopPropagation(),C(null),v&&S(null),t({id:x,neededScroll:!0}),setTimeout(()=>{t({id:x,neededScroll:!1})},100),a(null),l?setTimeout(()=>{a(n.id)},100):a(n.id)},onMouseEnter:N=>{N.stopPropagation(),n.neededScroll||t({id:x,neededScroll:!1})},onMouseLeave:N=>{N.stopPropagation(),n.neededScroll||t({id:null,neededScroll:!1})},className:u.clx(Be.block),children:[(n.id===x||l===x)&&i.jsx("div",{className:Be.active}),(n.id===x||l===x)&&i.jsx("div",{className:Be.name,children:u.getDisplayName(c[f[m].path].data[x].name,r)}),(n.id===x||l===x)&&u.getDisplayName(c[f[m].path].data[x].name,r)!=="unknown name"&&i.jsx(mc,{}),(n.id===x||l===x)&&u.getDisplayName(c[f[m].path].data[x].name,r)!=="unknown name"&&i.jsx("div",{className:Be.addSection,children:i.jsx(A.ButtonSettings,{type:"Primary",onClick:N=>{N.stopPropagation(),d(x,!0),a(null),t({id:null,neededScroll:!1}),C(null),_("/admin/builder/add")},children:"Add Section"})}),k===0&&(n.id===x||l===x)&&u.getDisplayName(c[f[m].path].data[x].name,r)!=="unknown name"&&i.jsx("div",{className:u.clx(Be.addSection,Be.addSectionTop),children:i.jsx(A.ButtonSettings,{type:"Primary",onClick:N=>{N.stopPropagation(),d(x,!1),a(null),t({id:null,neededScroll:!1}),C(null),_("/admin/builder/add")},children:"Add Section"})}),o&&i.jsx(Dt,{render:w,block:c[f[m].path].data[x]})]},x))}),i.jsx(ln,{})]})}),bc="_results_druoj_2",xc="_noResults_druoj_14",Un={results:bc,noResults:xc};function Sc(e,t){return t?new t[e]().blockSettings.isAddable:!1}function Vn(e,t){return e?Object.keys(e||{}).reduce((n,s)=>(Sc(s,t)&&n.push({name:s,displayName:u.getDisplayName(s,t)}),n),[]):[]}const _c="_product_1jg2o_6",Cc="_icon_1jg2o_28",yc="_name_1jg2o_56",Yt={product:_c,icon:Cc,name:yc},wc=e=>{const{blockId:t,setSearchValue:n}=e,{sourceBlocks:s,setActiveBlock:o}=u.useBlocksStore(),{hideModal:r,hoverBlockId:c,isModalVisible:a,showPreview:l,hidePreview:d,clearHideTimeout:h,startHideTimeout:p,setHoverBlockTopPosition:m}=u.useSubmodalStore();function f(S){n(""),o(S),r("keyBlock")}function y(S,C){const j=window.innerHeight,b=400,_=10;let w=C.clientY-120;w+b>j&&(w=j-b-_),w<_&&(w=_),c||r("keyBlock"),l(S,"keyBlock"),h(),m(w)}function v(){a?p("keyBlock"):d("keyBlock"),m(null)}return i.jsxs("div",{className:Yt.product,onClick:()=>f(t),onMouseEnter:S=>y(t,S),onMouseLeave:v,children:[(()=>{const S=u.blockIcons[t];return S?i.jsx(S,{className:Yt.icon}):i.jsx(A.Icon,{name:"Cards"})})(),i.jsx("span",{className:Yt.name,children:u.getDisplayName(t,s)}),i.jsx(A.Icon,{name:"CaretRight",width:20,height:20})]},t)},Es=()=>{const{blocks:e,sourceBlocks:t}=u.useBlocksStore(),[n,s]=g.useState(""),[o,r]=g.useState([]),c=g.useMemo(()=>Vn(e,t),[e,t]),a=g.useMemo(()=>new Le(c,{keys:["displayName"],threshold:.4}),[c]);return g.useEffect(()=>{if(n.trim()==="")r(Vn(e,t));else{const l=a.search(n);r(l.map(d=>d.item))}},[n,a]),i.jsxs(i.Fragment,{children:[i.jsx(A.InputSettings,{type:"text",placeholder:"Search for sections",isSearch:!0,onChange:s,value:n}),i.jsx("div",{className:Un.results,children:o.length>0?o.map(l=>i.jsx(wc,{blockId:l.name,setSearchValue:s})):i.jsx("div",{className:Un.noResults,children:"No sections found"})})]})},jc=()=>{const{onPreview:e,zoomLevel:t}=u.usePreviewStore(),{keyBlock:n,hoverBlockId:s,isModalVisible:o,hoverBlockTopPosition:r}=u.useSubmodalStore(),{settings:c}=u.useSettingsStore(),{sourceBlocks:a}=u.useBlocksStore(),{pageContext:l}=u.usePagesStore(),{showModal:d}=u.useColorPickerStore(),{currentDevice:h}=u.useDeviceStore(),{isLoadingThemeSettings:p}=u.useThemeSettingsStore(),{isLoadingLayers:m}=u.useLayersStore(),f=b=>b?!a||!a[b]?i.jsx(A.ErrorableBlock,{error:`Block "${b}" does not exist in blocks.`}):new a[b]().renderPreview(c,l):i.jsx(A.ErrorableBlock,{error:"Block or block.name is undefined."});function y(){if(h.value==="desktop")return t>=1?"100%":`${(t*100).toFixed(2)}%`;{const b=h.value==="tablet"?768:425;return t>=1?`${b}px`:`${(b*t).toFixed(2)}px`}}function v(){switch(h.value){case"desktop":return"100%";case"tablet":return 768;case"mobile":return 425;default:return"100%"}}const{isOpenSelectModal:S}=u.usePagesStore(),C=g.useRef(null),j=b=>{C.current&&(C.current.scrollTop+=b.deltaY)};return i.jsxs("div",{className:it.preview,style:{zIndex:d&&!S?5e3:500},onWheel:b=>{b.stopPropagation(),j(b)},children:[o&&i.jsx(u.AddSectionSubmodal,{children:i.jsx(Es,{})}),i.jsxs(u.Submodal,{positionTop:r,positionLeft:!s&&n?void 0:250,children:[!p&&!m&&i.jsx(Dt,{render:f,block:n},n),(p||!n||m)&&i.jsx("div",{className:it.previewLoading,children:i.jsx(u.Loader,{})})]}),d&&i.jsx(u.ColorPickerModal,{}),e&&i.jsx("div",{className:it.main,style:{width:v()},children:i.jsx("div",{style:{borderLeft:y()==="100%"?"none":"var(--default-border)",borderRight:y()==="100%"?"none":"var(--default-border)",width:"100%",display:"flex",flexDirection:"column",alignItems:"center",height:"calc(100vh - 76px)",overflowY:"scroll",overflowX:"hidden"},onScroll:b=>{b.stopPropagation()},onWheel:b=>{b.stopPropagation()},children:!p&&!m?i.jsx("div",{className:it.content,style:{width:y()},children:i.jsx(vc,{scrollableRef:C})}):i.jsx("div",{className:it.loading,children:i.jsx(u.Loader,{})})})})]})},kc="_sidebar_1jwmc_1",Ac="_title_1jwmc_26",Kn={sidebar:kc,title:Ac},Nc="_layers_99kjm_2",Ic="_wrapper_99kjm_11",Bc="_draggingWrapper_99kjm_19",Ec="_block_99kjm_23",Dc="_dragging_99kjm_19",Tc="_active_99kjm_40",Mc="_add_99kjm_98",Rc="_addTop_99kjm_124",Pc="_visible_99kjm_151",Lc="_button_99kjm_158",Oc="_nameBlock_99kjm_226",$c="_loader_99kjm_230",Fc="_actions_99kjm_239",zc="_deleteButton_99kjm_247",X={layers:Nc,wrapper:Ic,draggingWrapper:Bc,block:Ec,dragging:Dc,active:Tc,add:Mc,addTop:Rc,visible:Pc,button:Lc,nameBlock:Oc,loader:$c,actions:Fc,deleteButton:zc},Hc="_block_gb1o2_5",Wc="_title_gb1o2_24",Uc="_actions_gb1o2_32",Ee={block:Hc,title:Wc,actions:Uc},Yn={header:"Header",footer:"Footer",announcement:"Announcement"},Gt=({id:e})=>{const{setCurrentBlock:t}=u.useLayersStore(),{activeBlock:n}=u.usePreviewStore(),[s,o]=g.useState(!1);function r(c){t(c)}return i.jsxs("div",{className:u.clx(Ee.block,{[Ee.active]:n.id===e,[Ee.header]:e==="header",[Ee.footer]:e==="footer",[Ee.announcement]:e==="announcement"}),onClick:()=>r(e),onMouseOver:()=>o(!0),onMouseLeave:()=>o(!1),children:[(()=>{const c=u.blockIcons[Yn[e]];return c?i.jsx(c,{width:20,height:20,className:Ee.icon}):i.jsx(A.Icon,{name:"Cards",width:20,height:20})})(),i.jsx("span",{className:Ee.title,children:Yn[e]}),i.jsx("div",{className:Ee.actions,children:i.jsx(A.Icon,{name:"PushPin",hoverable:!0,width:20,height:20,fill:"var(--builder-text-secondary)"})})]})},Vc=({id:e,name:t,onClick:n,isDragging:s,icon:o})=>{const{activeBlock:r,setActiveBlock:c}=u.usePreviewStore(),{showPreview:a,hidePreview:l,showModal:d,hideModal:h,clearHideTimeout:p,startHideTimeout:m,hoverBlockId:f,isModalVisible:y}=u.useSubmodalStore(),{setPositionBlock:v}=u.useLayersStore(),[S,C]=g.useState(!1),[j,b]=g.useState(!1),[_,w]=g.useState(!1),[x,k]=g.useState(!1),[N,M]=g.useState(null),$=g.useRef(null),{attributes:R,listeners:D,setNodeRef:P,transform:T,transition:z}=Is({id:e}),q={transform:Ge.Transform.toString(T),transition:z},{setTitle:E,setDescription:H,setOnConfirm:ie}=u.useConfirmationModalStore(),{pages:ye,currentPage:Oe}=u.usePagesStore(),{removeBlock:K}=u.useLayersStore(),ce=O=>{O.stopPropagation(),$.current&&clearTimeout($.current),c({id:e,neededScroll:!0}),y&&h(),a(e),p()},de=(O,$e=!0)=>{O.stopPropagation(),l(),d(e),p(),v(e,$e)},Me=O=>{O.stopPropagation(),c({id:null,neededScroll:!1}),y?m():l()};return g.useEffect(()=>{w(!1),C(!1),b(!1),k(!1)},[s]),g.useEffect(()=>{y||(b(!1),C(!1))},[y]),i.jsxs("div",{ref:P,style:q,className:u.clx(X.wrapper,{[X.draggingWrapper]:s&&r.id===e}),onClick:O=>{O.stopPropagation(),n(e)},onMouseEnter:ce,onMouseLeave:Me,...R,...D,children:[i.jsxs("div",{className:u.clx(X.block,{[X.dragging]:s&&r.id===e,[X.active]:!s&&r.id===e}),children:[o?i.jsx(o,{width:20,height:20}):i.jsx(A.Icon,{name:"Cards",width:20,height:20}),i.jsx("span",{className:X.nameBlock,children:t}),f===e&&!s&&i.jsx("div",{className:u.clx(X.addTop,{[X.visible]:j}),onMouseEnter:()=>{b(!0)},onMouseLeave:()=>{b(!1)},children:i.jsxs("button",{className:X.button,onClick:O=>de(O,!1),onMouseEnter:()=>{const O=setTimeout(()=>{s||k(!0)},200);M(O)},onMouseLeave:()=>{N&&clearTimeout(N),k(!1)},children:[i.jsx(A.Icon,{name:"Plus",fill:"#fff"}),x&&i.jsx(u.Tooltip,{text:"Click to add a section"})]})}),f===e&&!s&&i.jsx("div",{className:u.clx(X.add,{[X.visible]:S}),onMouseEnter:()=>{C(!0)},onMouseLeave:()=>{C(!1)},children:i.jsxs("button",{className:X.button,onClick:O=>de(O),onMouseEnter:()=>{const O=setTimeout(()=>{s||w(!0)},200);M(O)},onMouseLeave:()=>{N&&clearTimeout(N),w(!1)},children:[i.jsx(A.Icon,{name:"Plus",fill:"#fff"}),_&&i.jsx(u.Tooltip,{text:"Click to add a section"})]})})]}),f===e&&!s&&i.jsxs("div",{className:X.actions,children:[i.jsx(A.Icon,{name:"DotsSixVertical",hoverable:!0,width:20,height:20}),i.jsx("div",{className:X.deleteButton,onClick:O=>{O.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.`),ie(()=>{ye&&K(ye[Oe].path,e)})},children:i.jsx(A.Icon,{name:"Trash",fill:"#C12A2A",hoverable:!0,width:20,height:20})})]})]})},Kc=()=>{const{blocks:e,setCurrentBlock:t,currentBlock:n,moveBlock:s,isLoadingLayers:o,announcement:r}=u.useLayersStore(),{currentPage:c,pages:a}=u.usePagesStore(),{setMouseOverModal:l,setHoverBlockId:d}=u.useSubmodalStore(),{sourceBlocks:h}=u.useBlocksStore();function p(C){t(C),l(!1),d(null)}const m=cs(is(Mt,{activationConstraint:{distance:5}})),[f,y]=g.useState(!1),v=()=>{y(!0)},S=C=>{y(!1);const{active:j,over:b}=C;if(b&&j.id!==b.id&&a&&a[c]){const _=a[c].path,w=e[_].order,x=w.indexOf(j.id),k=w.indexOf(b.id);x!==-1&&k!==-1&&s(_,x,k)}};return i.jsx("div",{className:X.layers,children:o?i.jsx("div",{className:X.loader,children:i.jsx(u.Loader,{})}):i.jsxs(i.Fragment,{children:[r&&i.jsx(Gt,{id:"announcement"}),i.jsx(Gt,{id:"header"}),!n&&i.jsx(_s,{sensors:m,onDragEnd:S,onDragStart:v,children:a&&a[c]&&e[a[c].path]&&i.jsx(As,{items:e[a[c].path].order,strategy:ws,children:e[a[c].path].order.map((C,j)=>i.jsx(Vc,{id:C,name:u.getDisplayName(e[a[c].path].data[C].name,h),index:j,onClick:p,isDragging:f,icon:u.blockIcons[e[a[c].path].data[C].name]},C))})}),i.jsx(Gt,{id:"footer"})]})})},Yc="_loader_eyvkk_1",Gc={loader:Yc},Xc=()=>{const{isLoadingSettings:e}=u.useSettingsStore();return e?i.jsx("div",{className:Gc.loader,children:i.jsx(u.Loader,{})}):i.jsx(qc,{})},qc=()=>{const{settings:e}=u.useSettingsStore(),{settings:t,setSettingsInstance:n}=u.useBlocksStore();if(!e)return null;const s=new t(e);g.useEffect(()=>{n(s)},[e]);try{return s.renderSettings()}catch(o){throw console.error("Error rendering settings:",o),o}},Jc="_theme_bx8ze_2",Qc="_block_bx8ze_14",Zc="_name_bx8ze_35",ea="_loader_bx8ze_40",yt={theme:Jc,block:Qc,name:Zc,loader:ea},ta=()=>{const e=u.useNavigate(),{isAntistock:t}=u.useGeneralStore(),{isLoadingThemeSettings:n,setActiveBlock:s}=u.useThemeSettingsStore(),o=[{icon:"PaintBrushBroad",name:"Colors"},{icon:"TextAa",name:"Fonts"},{icon:"CornersOut",name:"Borders"},{icon:"ArrowSquareIn",name:"Buttons"}];function r(c){switch(c==null?void 0:c.name){case"Colors":e("/admin/builder/theme/colors"),s(u.themeSettingsBlocks[0]);break;case"Fonts":e("/admin/builder/theme/fonts"),s(u.themeSettingsBlocks[1]);break;case"Borders":e("/admin/builder/theme/borders"),s(u.themeSettingsBlocks[2]);break;case"Buttons":e("/admin/builder/theme/buttons"),s(u.themeSettingsBlocks[3]);break;case"Inputs":e("/admin/builder/theme/inputs"),s(u.themeSettingsBlocks[4]);break}}return i.jsx("div",{className:yt.theme,children:n?i.jsx("div",{className:yt.loader,children:i.jsx(u.Loader,{})}):(t?o:u.themeSettingsBlocks).map(c=>i.jsxs("div",{onClick:()=>r(c),className:u.clx(yt.block),children:[i.jsx(A.Icon,{name:c.icon}),i.jsx("span",{className:yt.name,children:c.name}),i.jsx(A.Icon,{name:"CaretRight"})]},c.icon))})},na="_render_59lur_16",sa="_open_59lur_33",oa="_close_59lur_69",ra="_clicked_59lur_74",ia="_loading_59lur_92",ca="_settings_59lur_96",Ke={render:na,open:sa,close:oa,clicked:ra,loading:ia,settings:ca},aa=({block:e})=>{const{pageContext:t}=u.usePagesStore();try{return e.renderSettings(t)}catch(n){throw console.error("Error rendering settings:",n),n}},la="_wrapper_1wsyp_6",ua="_header_1wsyp_13",da="_title_1wsyp_21",ha="_colorWrapper_1wsyp_31",fa="_name_1wsyp_48",ga="_color_1wsyp_31",pa="_value_1wsyp_63",ma="_length_1wsyp_69",oe={wrapper:la,header:ua,title:da,colorWrapper:ha,name:fa,color:ga,value:pa,length:ma},va=e=>{const{colors:t}=e,{themeSettings:n}=u.useThemeSettingsStore(),[s,o]=g.useState(!0);g.useEffect(()=>{t.length<=3&&o(!0)},[]);function r(c){const a=c.replace("--",""),[l,d]=a.split("-"),h=`${d.charAt(0).toUpperCase()+d.slice(1)} ${l.charAt(0).toUpperCase()+l.slice(1)}`,[p,m]=a.split("-");return{name:h,field:p,variable:m}}return i.jsxs("div",{className:oe.wrapper,children:[i.jsxs("div",{className:oe.header,children:[i.jsx("div",{className:oe.title,children:"Section Colors"}),!s&&i.jsxs("div",{className:u.clx(oe.value,oe.length),onClick:()=>o(!0),children:["+",t.length]})]}),s&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:oe.colors,children:t.map(c=>{const a=r(c),{variable:l,name:d,field:h}=a;return i.jsx(ba,{color:n.colors[h][l],name:d})})}),t.length>3&&i.jsxs("div",{className:u.clx(oe.value,oe.length),onClick:()=>o(!1),children:["Hide ",t.length," colors"]})]})]})},ba=e=>{const{name:t,color:n}=e,{setActiveLabel:s,setModalPosition:o,setInitialColor:r,setShowModal:c,setUpdate:a,setColor:l,setColorChange:d,colorChange:h,setIsGradientActive:p,setIsBlockSettings:m}=u.useColorPickerStore(),{updateColor:f}=u.useThemeSettingsStore(),y=(C,j)=>b=>{f(C,j,b)};g.useEffect(()=>{const C=()=>{c(!1),s(null),r(n),a(()=>{}),l(n),d(()=>{})};return document.body.addEventListener("click",C),()=>{document.body.removeEventListener("click",C)}},[]);const v=C=>{const j=t.split("/")[0],b=j.split(" ")[0].toLowerCase(),_=j.split(" ")[1].toLowerCase();C.stopPropagation(),c(!0),d(h),a(k=>y(_,b)(k)),r(n),l(n),m(!0),p(_==="surface");const{top:w,left:x}=u.getModalPosition(C,550,288,10,20,230,80);o({top:_==="surface"?w:w+125,left:x-200})};function S(C){return C.length>15?C.slice(0,15)+"...":C}return i.jsxs("div",{className:oe.colorWrapper,onClick:v,children:[i.jsx("div",{className:oe.color,style:{background:n}}),i.jsx("div",{className:oe.name,children:t}),i.jsx("div",{className:oe.value,children:S(n)})]})},xa="_back_1drj5_3",Sa="_title_1drj5_11",_a="_deleteButton_1drj5_22",Ca="_backIcon_1drj5_40",wt={back:xa,title:Sa,deleteButton:_a,backIcon:Ca},ya=({onClick:e,setIsClicked:t,getDisplayName:n})=>{var m,f;const{activeBlock:s}=u.useBlocksStore(),{setTitle:o,setDescription:r,setOnConfirm:c}=u.useConfirmationModalStore(),{blocks:a,currentBlock:l,removeBlock:d}=u.useLayersStore(),{currentPage:h,pages:p}=u.usePagesStore();return i.jsxs("div",{className:wt.back,children:[i.jsx("div",{className:wt.backIcon,onClick:()=>e(),children:i.jsx(A.Icon,{name:"CaretLeft",hoverable:!0,width:20,height:20})}),i.jsx("h3",{className:wt.title,children:s&&n(s)||p&&p[h]&&a[p[h].path]&&l&&n((m=a[p[h].path].data[l])==null?void 0:m.name)||l&&u.formatLabel(l)||"Loading"}),l&&p&&!["header","footer","announcement"].includes(l)&&a[p[h].path].data[l]&&n((f=a[p[h].path].data[l])==null?void 0:f.name)!=="unknown name"&&i.jsx("button",{onClick:y=>{var v;y.stopPropagation(),o("Remove Block"),r(`Are you sure you want to delete ${n((v=a[p[h].path].data[l])==null?void 0:v.name)||"this"} block? Once you delete this block, any content visible will also be deleted. This is irreversible.`),c(()=>{t(!0),d(p[h].path,l),e(!0)})},className:wt.deleteButton,children:i.jsx(A.Icon,{name:"Trash",hoverable:!0,width:20,height:20,fill:"#C12A2A"})})]})},wa=()=>{const e=u.useNavigate(),[t,n]=g.useState(!1),{header:s,footer:o,announcement:r,sourceBlocks:c,activeBlock:a,setActiveBlock:l,currentInstance:d,setCurrentInstance:h}=u.useBlocksStore(),{setActiveBlock:p}=u.usePreviewStore(),{blocks:m,addBlock:f,editBlock:y,currentBlock:v,setCurrentBlock:S,header:C,footer:j,announcement:b,isLoadingLayers:_}=u.useLayersStore(),{currentPage:w,pages:x}=u.usePagesStore(),{past:k,future:N}=u.useHistoryStore();function M(D=!1){if(x&&d&&v&&!["header","footer","announcement"].includes(v)&&!D){const P={blockSettings:{}};Object.keys(d.blockSettings).filter(T=>!["displayName","isAddable"].includes(T)).map(T=>{P.blockSettings[T]=d.blockSettings[T]}),y(x[w].path,v,{name:m[x[w].path].data[v].name,value:P})}l(null),S(null),p({id:null,neededScroll:!1}),setTimeout(()=>{n(!1)},150),h(null)}function $(D){var q;if(!x||!w||!D)return null;if(D==="header"){const E=new s;return Object.keys(E.blockSettings).forEach(H=>{E.blockSettings[H]=C==null?void 0:C.blockSettings[H]}),Object.keys(E.blockColors).forEach(H=>{E.blockColors[H]=C==null?void 0:C.blockColors[H]}),E}if(D==="footer"){const E=new o;return Object.keys(E.blockSettings).forEach(H=>{E.blockSettings[H]=j==null?void 0:j.blockSettings[H]}),Object.keys(E.blockColors).forEach(H=>{E.blockColors[H]=j==null?void 0:j.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=m[x[w].path];if(!P||!P.data[D])return null;const T=P.data[D];return!T||!c[T.name]?null:new c[T.name]((q=T.value)==null?void 0:q.blockSettings)}g.useEffect(()=>{if(v){const D=$(v);h(D)}else h(null)},[v,k,N,a]),g.useEffect(()=>{if(a&&x&&!v){const D={blockSettings:{},blockColors:{}},P=new c[a];h(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=f(x[w].path,{name:a,value:D});p({id:T,neededScroll:!0}),S(T),e("/admin/builder")}},[a,k,N]);function R(D){if(!c)return"unknown name";if(!c[D])return v==="header"?C==null?void 0:C.blockSettings.displayName:v==="footer"?j==null?void 0:j.blockSettings.displayName:v==="announcement"?b==null?void 0:b.blockSettings.displayName:"unknown name";const P=new c[D];return!P.blockSettings||!P.blockSettings.displayName?"unknown name":P.blockSettings.displayName}return i.jsxs("div",{className:u.clx(Ke.render,{[Ke.open]:v,[Ke.close]:!v,[Ke.clicked]:t}),onClick:D=>D.stopPropagation(),style:{opacity:_?0:1},children:[i.jsx(ya,{onClick:M,setIsClicked:n,getDisplayName:R}),i.jsxs("div",{className:Ke.settings,children:[d&&i.jsxs(i.Fragment,{children:[i.jsx(aa,{block:d}),i.jsx(va,{colors:d.blockColors})]}),!a&&!v&&i.jsx("div",{className:Ke.loading,children:"Loading"})]})]})},ja="_header_13gbr_6",ka="_title_13gbr_14",Aa="_backIcon_13gbr_22",Xt={header:ja,title:ka,backIcon:Aa},vt=({onClick:e,title:t})=>i.jsxs("div",{className:Xt.header,children:[i.jsx("div",{className:Xt.backIcon,onClick:e,children:i.jsx(A.Icon,{name:"CaretLeft",hoverable:!0,width:20,height:20})}),i.jsx("span",{className:Xt.title,children:t})]}),Na="_options_ymds7_1",Ia={options:Na},Ba=()=>{var d,h;const{activeBlock:e,themeSettings:t,updateBorder:n,setActiveBlock:s}=u.useThemeSettingsStore();function o(p,m){n(m,p)}const r=u.useNavigate();function c(){s(null),r("/admin/builder/theme")}const a=g.useMemo(()=>t.borders,[t]),l=(e==null?void 0:e.name)==="Borders";return i.jsxs(u.AnimatedPanel,{isOpen:l,isClose:!l,children:[i.jsx(vt,{onClick:c,title:"Borders Style"}),i.jsxs("div",{className:Ia.options,children:[i.jsx(A.SelectSettings,{label:"Border Radius (px)",options:Object.keys(u.RadiusVariables),value:((d=Object.entries(u.RadiusVariables).find(([p,m])=>m===a.radius))==null?void 0:d[0])||"None",onChange:p=>o(u.RadiusVariables[p],"radius")}),i.jsx(A.SelectSettings,{label:"Border Thickness (px)",options:Object.keys(u.ThicknessVariables),value:((h=Object.entries(u.ThicknessVariables).find(([p,m])=>m===a.thickness))==null?void 0:h[0])||"None",onChange:p=>o(u.ThicknessVariables[p],"thickness")})]})]})},Ea="_options_10idy_4",Da="_alignments_10idy_13",Ta="_blocks_10idy_19",Ma="_alignment_10idy_13",Ra="_active_10idy_47",Pa="_chargeTypes_10idy_59",La="_charge_10idy_59",Oa="_chargeActive_10idy_90",$a="_sliderContainer_10idy_105",Fa="_shadowInputs_10idy_116",za="_label_10idy_123",Ha="_shadowInputsRow_10idy_133",te={options:Ea,alignments:Da,blocks:Ta,alignment:Ma,active:Ra,chargeTypes:Pa,charge:La,chargeActive:Oa,sliderContainer:$a,shadowInputs:Fa,label:za,shadowInputsRow:Ha},Wa=["left","center","right"],Ua=()=>{const{activeBlock:e,themeSettings:t,updateButton:n,setActiveBlock:s}=u.useThemeSettingsStore(),{fonts:o}=u.useFontsStore(),[r,c]=g.useState("primary");function a(f,y){n(r,y,f)}const l=t.buttons[r],d=u.useNavigate();function h(){s(null),d("/admin/builder/theme")}const p=(e==null?void 0:e.name)==="Buttons";function m(f,y){a({...l.boxShadow,[f]:y},"boxShadow")}return i.jsxs(u.AnimatedPanel,{isOpen:p,isClose:!p,children:[i.jsx(vt,{onClick:h,title:"Buttons Style"}),i.jsx("div",{className:te.chargeTypes,style:{marginBottom:"10px"},children:["primary","secondary","tertiary"].map(f=>i.jsx("div",{className:u.clx(te.charge,{[te.chargeActive]:r===f}),onClick:()=>c(f),children:f.charAt(0).toUpperCase()+f.slice(1)},f))}),l&&i.jsxs("div",{className:te.options,children:[i.jsx(A.InputSettings,{label:"Height (px)",value:String(l.height),onChange:f=>a(Number(f),"height"),type:"number",min:0}),i.jsx(A.SelectSettings,{label:"Font Size (px)",value:String(l.size),onChange:f=>a(Number(f),"size"),options:u.sizeOptions}),i.jsx(A.InputSettings,{label:"Border Radius (px)",value:String(l.radius),onChange:f=>a(Number(f),"radius"),type:"number",min:0}),i.jsx(A.SelectSettings,{label:"Font",value:l.font,onChange:f=>a(f,"font"),options:[...o.filter(f=>f.name!==l.font).map(f=>f.name)]}),i.jsx(u.ColorPicker,{initialColor:l.color,onChange:f=>a(f,"color"),title:"Text Color",labelStyle:"secondary",isGradientActive:!1}),i.jsx(u.ColorPicker,{initialColor:l.background,onChange:f=>a(f,"background"),title:"Background Color",labelStyle:"secondary",isGradientActive:!0}),i.jsx("div",{className:te.sliderContainer,children:i.jsx("h4",{className:te.label,children:"Shadow"})}),i.jsxs("div",{className:te.shadowInputs,children:[i.jsxs("div",{className:te.shadowInputsRow,children:[i.jsx(A.InputSettings,{label:"Left (px)",value:String(l.boxShadow.left),onChange:f=>m("left",Number(f)),type:"number"}),i.jsx(A.InputSettings,{label:"Top (px)",value:String(l.boxShadow.top),onChange:f=>m("top",Number(f)),type:"number"}),i.jsx(A.InputSettings,{label:"Blur (px)",value:String(l.boxShadow.blur),onChange:f=>m("blur",Number(f)),type:"number"}),i.jsx("div",{style:{flex:1,whiteSpace:"nowrap"},children:i.jsx(A.InputSettings,{label:"Spread (px)",value:String(l.boxShadow.spread),onChange:f=>m("spread",Number(f)),type:"number"})})]}),i.jsx(u.ColorPicker,{initialColor:l.boxShadow.color,onChange:f=>m("color",f),title:"Color",labelStyle:"secondary",isGradientActive:!1})]}),i.jsxs("div",{className:te.alignments,children:[i.jsx("h4",{className:te.label,children:"Alignment Type"}),i.jsx("div",{className:te.blocks,children:Wa.map(f=>i.jsx("div",{className:u.clx(te.alignment,{[te.active]:l.alignment===f}),onClick:()=>{a(f,"alignment")},children:i.jsx(A.Icon,{name:f==="center"?"AlignCenterHorizontal":f==="left"?"AlignLeft":"AlignRight",fill:"currentColor"})},f))})]}),i.jsx(A.Switch,{label:"Enable Hover",onChange:f=>a(f,"hover"),current:l.hover}),l.hover&&i.jsxs(i.Fragment,{children:[i.jsx(u.ColorPicker,{initialColor:l.colorHover,onChange:f=>a(f,"colorHover"),title:"Hover Text Color",labelStyle:"secondary",isGradientActive:!1}),i.jsx(u.ColorPicker,{initialColor:l.backgroundHover,onChange:f=>a(f,"backgroundHover"),title:"Hover Background Color",labelStyle:"secondary",isGradientActive:!0})]})]})]})},Va="_category_33xub_4",Ka="_categoryTitle_33xub_22",qt={category:Va,categoryTitle:Ka},Ya=()=>{const{themeSettings:e,setActiveColorCategory:t}=u.useThemeSettingsStore();function n(s){t(s)}return i.jsx("div",{className:qt.wrapper,children:Object.keys(e.colors).map(s=>i.jsxs("div",{className:qt.category,onClick:()=>n(s),children:[i.jsxs("h2",{className:qt.categoryTitle,children:[u.formatLabel(s)," Colors"]}),i.jsx(A.Icon,{name:"CaretRight",width:24,height:24})]},s))})},Ga="_options_yegm7_52",Xa={options:Ga},qa=()=>{const{activeBlock:e,setActiveFont:t,activeFont:n,themeSettings:s,updateFont:o}=u.useThemeSettingsStore(),{fonts:r}=u.useFontsStore(),[c,a]=g.useState(null);function l(){t(null)}function d(v,S){c&&n&&o("desktop",c,n,S,v)}const[h,p]=g.useState([]),m=g.useMemo(()=>n?s.fonts.desktop.heading[n]?(a("heading"),s.fonts.desktop.heading[n]):s.fonts.desktop.body[n]?(a("body"),s.fonts.desktop.body[n]):(a(null),null):null,[n,s]);g.useEffect(()=>{if(m){const v=r.find(S=>S.name===m.font);v&&(p(v.weights),v.weights.includes(m.boldWeight)||d("400","boldWeight"),v.weights.includes(m.weight)||d("400","weight"))}},[m,n]);const f=!!((e==null?void 0:e.name)==="Fonts"&&n),y=(e==null?void 0:e.name)!=="Fonts"||!n;return i.jsxs(u.AnimatedPanel,{isOpen:f,isClose:y,children:[i.jsx(vt,{onClick:l,title:"Font Style"}),n&&m&&i.jsxs("div",{className:Xa.options,children:[i.jsx(A.SelectSettings,{label:"Font",value:m.font,onChange:v=>d(v,"font"),options:[...r.filter(v=>v.name!==m.font).map(v=>v.name)]}),i.jsx(A.SelectSettings,{label:"Size",value:String(m.size),onChange:v=>d(v,"size"),options:u.sizeOptions}),i.jsx(A.SelectSettings,{label:"Default Weight",value:String(m.weight),onChange:v=>d(v,"weight"),options:h}),i.jsx(A.SelectSettings,{label:"Bold Weight",value:String(m.boldWeight),onChange:v=>d(v,"boldWeight"),options:h}),i.jsx(A.SelectSettings,{label:"Case",value:String(m.case).charAt(0).toUpperCase()+String(m.case).slice(1),onChange:v=>d(v.toLowerCase(),"case"),options:["Normal","Uppercase","Lowercase","Capitalize"].filter(v=>v.toLowerCase()!==String(m.case))})]})]})},Ja="_wrapper_hb2bk_1",Qa="_category_hb2bk_5",Za="_categoryTitle_hb2bk_11",el="_font_hb2bk_19",tl="_content_hb2bk_38",nl="_icon_hb2bk_46",sl="_paragraph_hb2bk_59",_e={wrapper:Ja,category:Qa,categoryTitle:Za,font:el,content:tl,icon:nl,paragraph:sl},ol={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",h7:"h7",lg:"large",md:"medium",sm:"small"},rl=e=>{const{font:t,size:n,id:s,category:o}=e,{setActiveFont:r}=u.useThemeSettingsStore();return i.jsxs("div",{className:_e.font,onClick:()=>r(s),children:[i.jsx("div",{className:u.clx(_e.icon,{[_e.paragraph]:o==="paragraph"}),children:i.jsx(A.Icon,{name:o==="paragraph"?"TextB":"TextH"})}),i.jsxs("div",{className:_e.content,children:[i.jsx("h2",{className:_e.categoryTitle,children:u.formatLabel(ol[s])}),i.jsx("span",{className:_e.value,children:`${t}, ${n}px`})]})]})},il=()=>{const{themeSettings:e,setActiveFont:t,activeBlock:n}=u.useThemeSettingsStore();g.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:u.formatLabel(o)}),Object.entries(r).map(([c,a])=>i.jsx(rl,{id:c,category:o,...a},c))]},o))})},cl="_wrapper_1iotr_2",al="_categoryTitle_1iotr_12",ll="_title_1iotr_83",ul="_field_1iotr_92",dl="_alignments_1iotr_102",hl="_lineField_1iotr_108",fl="_style_1iotr_116",gl="_header_1iotr_123",le={wrapper:cl,categoryTitle:al,title:ll,field:ul,alignments:dl,lineField:hl,style:fl,header:gl},pl=["left","center","right"],ml=["solid","dashed"],ct=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]})},vl=()=>{const{themeSettings:e,updateInput:t}=u.useThemeSettingsStore(),n=g.useMemo(()=>e.inputs,[e]),s=(r,c,a)=>{t(r,c,a)},o=r=>c=>{t(r,c,"color")};return i.jsxs("div",{className:le.wrapper,children:[i.jsxs(ct,{title:"General",children:[i.jsx(A.InputSettings,{label:"Height (px)",value:String(n.general.height),onChange:r=>s("general",r,"height"),type:"number",min:0}),i.jsx(A.SelectSettings,{label:"Font Size (px)",onChange:r=>s("general",r,"size"),value:String(n.general.size),options:u.sizeOptions}),i.jsx(u.ColorPicker,{initialColor:u.formatLabel(n.general.color),onChange:o("general"),title:"Font Color",labelStyle:"secondary",isGradientActive:!1})]}),i.jsx(ct,{title:"Field Fill",rightAddon:i.jsx("div",{className:le.switch,children:i.jsx(A.Switch,{onChange:r=>s("field",r,"active"),current:n.field.active})}),children:i.jsx(u.ColorPicker,{initialColor:n.field.color,onChange:o("field"),title:"Color",labelStyle:"secondary"})}),i.jsx(ct,{title:"Placeholder",children:i.jsx(u.ColorPicker,{initialColor:u.formatLabel(n.placeholder.color),onChange:o("placeholder"),title:"Font Color",labelStyle:"secondary",isGradientActive:!1})}),i.jsxs(ct,{title:"Border",rightAddon:i.jsx("div",{className:le.switch,children:i.jsx(A.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(u.Picker,{items:ml,selectedItem:n.border.style,onSelect:r=>s("border",r,"style"),getIconName:r=>r==="solid"?"Minus":"Selection"})]}),i.jsx(A.InputSettings,{label:"Radius (px)",value:String(n.border.radius),onChange:r=>s("border",r,"radius"),type:"number",min:0})]}),i.jsx(A.InputSettings,{label:"Thickness (px)",value:String(n.border.thickness),onChange:r=>s("border",r,"thickness"),type:"number",min:0}),i.jsx(u.ColorPicker,{initialColor:u.formatLabel(n.border.color),onChange:o("border"),title:"Color",labelStyle:"secondary",isGradientActive:!1})]}),i.jsxs(ct,{title:"Label",children:[i.jsx(A.InputSettings,{label:"Line Height (px)",value:String(n.label.height),onChange:r=>s("label",r,"height"),type:"number",min:0}),i.jsx(A.SelectSettings,{label:"Font Size (px)",onChange:r=>s("label",r,"size"),value:String(n.label.size),options:u.sizeOptions}),i.jsx(u.ColorPicker,{initialColor:u.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(u.Picker,{items:pl,selectedItem:n.label.alignment,onSelect:r=>s("label",r,"alignment"),getIconName:r=>r==="center"?"AlignCenterHorizontal":r==="left"?"AlignLeft":"AlignRight"})]})]})]})},bl="_wrapper_1tbxr_2",xl="_color_1tbxr_32",Sl="_content_1tbxr_43",_l="_container_1tbxr_62",Cl="_buttonWrapper_1tbxr_72",yl="_button_1tbxr_72",wl="_buttonBorder_1tbxr_90",jl="_buttonBackground_1tbxr_93",kl="_text_1tbxr_97",Al="_textText_1tbxr_103",Nl="_icon_1tbxr_107",Il="_iconIcon_1tbxr_110",Bl="_annotation_1tbxr_114",El="_annotationText_1tbxr_121",Dl="_label_1tbxr_126",Tl="_circle_1tbxr_137",Ml="_line_1tbxr_150",Rl="_circle1_1tbxr_164",Pl="_circle2_1tbxr_169",Ll="_annotationIcon_1tbxr_174",Ol="_annotationBorder_1tbxr_202",$l="_line1_1tbxr_213",Fl="_line2_1tbxr_220",zl="_circle3_1tbxr_237",Hl="_circle4_1tbxr_242",Wl="_annotationSurface_1tbxr_247",I={wrapper:bl,color:xl,content:Sl,container:_l,buttonWrapper:Cl,button:yl,buttonBorder:wl,buttonBackground:jl,text:kl,textText:Al,icon:Nl,iconIcon:Il,annotation:Bl,annotationText:El,label:Dl,circle:Tl,line:Ml,circle1:Rl,circle2:Pl,annotationIcon:Ll,annotationBorder:Ol,line1:$l,line2:Fl,circle3:zl,circle4:Hl,annotationSurface:Wl},Ul=()=>{const{activeColorCategory:e}=u.useThemeSettingsStore();return i.jsx("div",{className:I.container,children:i.jsxs("div",{className:I.buttonWrapper,children:[i.jsxs("div",{className:u.clx(I.button,{[I.buttonBorder]:e==="border",[I.buttonBackground]:e==="surface"}),children:[i.jsx(A.Icon,{name:"Smiley",className:u.clx(I.icon,{[I.iconIcon]:e==="icon"}),width:22,height:22,fill:"#757575"}),i.jsx("span",{className:u.clx(I.text,{[I.textText]:e==="text"}),children:"Button Example"})]}),e==="text"&&i.jsxs("div",{className:u.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:u.clx(I.circle,I.circle1)}),i.jsx("div",{className:u.clx(I.circle,I.circle2)})]}),e==="icon"&&i.jsxs("div",{className:u.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:u.clx(I.circle,I.circle1)}),i.jsx("div",{className:u.clx(I.circle,I.circle2)})]}),e==="border"&&i.jsxs("div",{className:u.clx(I.annotation,I.annotationBorder),children:[i.jsx("div",{className:I.label,children:"Border Color"}),i.jsx("div",{className:u.clx(I.line,I.line1)}),i.jsx("div",{className:u.clx(I.line,I.line2)}),i.jsx("div",{className:u.clx(I.circle,I.circle1)}),i.jsx("div",{className:u.clx(I.circle,I.circle2)}),i.jsx("div",{className:u.clx(I.circle,I.circle3)}),i.jsx("div",{className:u.clx(I.circle,I.circle4)})]}),e==="surface"&&i.jsxs("div",{className:u.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:u.clx(I.circle,I.circle1)}),i.jsx("div",{className:u.clx(I.circle,I.circle2)})]})]})})},Vl={text:["primary","secondary","tertiary","inverted","action","action-hover","disabled","warning","error","success","information","link"],icon:["primary","secondary","tertiary","inverted","action","actionHover","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"]},Kl=()=>{const{activeBlock:e,setActiveColorCategory:t,activeColorCategory:n,themeSettings:s,updateColor:o}=u.useThemeSettingsStore();function r(){t(null)}function c(h,p,m){o(h,p,m)}const a=!!((e==null?void 0:e.name)==="Colors"&&n),l=(e==null?void 0:e.name)!=="Colors"||!n,d=n?Vl[n]:[];return i.jsxs(u.AnimatedPanel,{isOpen:a,isClose:l,children:[i.jsx(vt,{onClick:r,title:`${u.formatLabel(n)} Colors`}),n&&i.jsxs("div",{className:I.wrapper,children:[i.jsx(Ul,{}),d.map(h=>{const p=s.colors[n][h];return typeof p!="string"?null:i.jsx("div",{className:I.color,children:i.jsx("div",{className:I.content,children:i.jsx(u.ColorPicker,{title:u.formatLabel(h),initialColor:p,onChange:m=>c(n,h,m),isGradientActive:n==="surface"})})},h)})]})]})},Yl="_loader_1p5lr_1",Gl={loader:Yl},Xl=()=>{const{activeBlock:e,themeSettings:t,isLoadingThemeSettings:n}=u.useThemeSettingsStore();return i.jsx(i.Fragment,{children:n?i.jsx("div",{className:Gl.loader,children:i.jsx(u.Loader,{})}):i.jsxs(i.Fragment,{children:[(e==null?void 0:e.name)==="Fonts"&&t.fonts&&i.jsx(il,{}),(e==null?void 0:e.name)==="Fonts"&&t.fonts&&i.jsx(qa,{}),(e==null?void 0:e.name)==="Colors"&&t.colors&&i.jsx(Ya,{}),(e==null?void 0:e.name)==="Colors"&&t.colors&&i.jsx(Kl,{}),(e==null?void 0:e.name)==="Inputs"&&t.inputs&&i.jsx(vl,{}),(e==null?void 0:e.name)==="Borders"&&t.borders&&i.jsx(Ba,{}),(e==null?void 0:e.name)==="Buttons"&&t.buttons&&i.jsx(Ua,{})]})})},ql=()=>{const{activeBlock:e,setActiveBlock:t}=u.useThemeSettingsStore(),{activeBlock:n}=u.useNavbarStore(),s=u.useNavigate();function o(){t(null),s("/admin/builder/theme")}const r=!!e,c=!e||n.name!=="Theme";return i.jsxs(u.AnimatedPanel,{isOpen:r,isClose:c,children:[i.jsx(vt,{onClick:o,title:(e==null?void 0:e.name)||""}),i.jsx(Xl,{})]})},Jl=()=>{const{activeBlock:e}=u.useNavbarStore(),{showTooltip:t}=u.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:Kn.sidebar,style:{zIndex:t?50:"auto"},children:[i.jsx("h3",{className:Kn.title,children:n()}),e.name==="Layers"&&i.jsx(Kc,{}),e.name==="Add"&&i.jsx(Es,{}),i.jsx(wa,{}),i.jsx(ql,{}),e.name==="Theme"&&i.jsx(ta,{}),e.name==="Settings"&&i.jsx(Xc,{})]})},Ql="_wrapper_1e8wo_1",Zl="_header_1e8wo_15",eu="_content_1e8wo_28",tu="_buttons_1e8wo_40",nu="_label_1e8wo_47",su="_description_1e8wo_48",ou="_preview_1e8wo_56",ru="_block_1e8wo_62",iu="_slug_1e8wo_72",cu="_title_1e8wo_79",au="_closeIcon_1e8wo_87",ae={wrapper:Ql,header:Zl,content:eu,buttons:tu,label:nu,description:su,preview:ou,block:ru,slug:iu,title:cu,closeIcon:au},lu=()=>{var $,R,D,P,T,z,q;const{setIsOpenModal:e,pages:t,createPage:n,updatePage:s,isEdit:o,setIsEdit:r,editedPage:c,setEditedPage:a,pageContext:l}=u.usePagesStore(),{setIsOpen:d}=u.useModalStore(),{isAntistock:h}=u.useGeneralStore(),{createPage:p,updatePage:m}=u.useLayersStore(),[f,y]=g.useState(c?t&&(($=t[c])==null?void 0:$.path):""),[v,S]=g.useState(c?t&&((R=t[c])==null?void 0:R.name):""),[C,j]=g.useState(c?t&&((D=t[c])==null?void 0:D.seo)&&((T=(P=t[c])==null?void 0:P.seo)==null?void 0:T.pageDescription)||"":`${l.general.info.name} is powered by the ${h?"Antistock.io":"Billgang.com"} platform which allows them to sell their digital products online for free.`),[b,_]=g.useState(c&&t&&(z=t[c])!=null&&z.isPrivate?"private":"public");function w(){y(""),S(""),j(""),_("public"),r(!1),a(null)}function x(){d(!1),setTimeout(()=>{w(),e(!1),d(!0)},300)}g.useEffect(()=>()=>{x()},[]);function k(E){return E[0]==="/"?E:"/"+E}function N(){n({path:k(f),name:v||f||"",icon:"File",seo:{pageTitle:v||"",pageDescription:C||""},visibility:b||"public"}),p(k(f)),x()}function M(){t&&(u.defaultPagePaths.includes(t[c].path)||Bs(t[c].path),m(t[c].path||"",f||""),s(c,{path:k(f),name:v||f,icon:t[c].icon||"File",seo:{pageTitle:v||"",pageDescription:C||""},visibility:b||"public"})),x()}return i.jsxs("div",{className:ae.wrapper,onClick:E=>E.stopPropagation(),children:[i.jsxs("div",{className:ae.header,children:[i.jsx("h2",{children:o?"Edit Page":"Create New Page"}),i.jsx("div",{className:ae.closeIcon,children:i.jsx(A.Icon,{name:"X",fill:"#757575",hoverable:!0,onClick:x})})]}),i.jsxs("div",{className:ae.content,children:[i.jsx(A.InputSettings,{label:"Page Slug",onChange:E=>y(E),value:f,placeholder:"path-to-page",disabled:!!(c&&t&&((q=t[c])!=null&&q.name)&&u.defaultPagePaths.includes(t[c].path)),required:!0,regex:"^.+$"}),i.jsx(A.InputSettings,{label:"Page Title",onChange:E=>{S(E)},value:v.charAt(0).toUpperCase()+v.slice(1),placeholder:"Contact us"}),i.jsx(A.TextareaSettings,{label:"Description",onChange:E=>j(E),value:C,placeholder:`${l.general.info.name} is powered by the ${h?"Antistock.io":"Billgang.com"} platform which allows them to sell their digital products online for free.`,maxLength:150}),i.jsxs("div",{className:ae.preview,children:[i.jsx("span",{className:ae.label,children:"Preview"}),i.jsxs("div",{className:ae.block,children:[i.jsx("span",{className:ae.slug,children:f||"yoursite.url"}),i.jsx("span",{className:ae.title,children:v||"My Blank Page"}),i.jsx("span",{className:ae.description,children:C||"It is My Description"})]})]})]}),i.jsxs("div",{className:ae.buttons,children:[i.jsx(A.ButtonSettings,{onClick:x,type:"Secondary",children:"Cancel"}),i.jsx(A.ButtonSettings,{onClick:o?M:N,disabled:f.length===0,type:"Primary",children:o?"Update":"Create"})]})]})};exports.CSS=Ge;exports.DndContext=_s;exports.Fuse=Le;exports.Header=Wi;exports.ModifyPage=lu;exports.Navbar=Qi;exports.PointerSensor=Mt;exports.Preview=jc;exports.RenderAnnouncement=dn;exports.RenderBlock=Dt;exports.RenderFooter=ln;exports.RenderHeader=un;exports.Sidebar=Jl;exports.SortableContext=As;exports.index=Fs;exports.useSensor=is;exports.useSensors=cs;exports.useSortable=Is;exports.verticalListSortingStrategy=ws;