@chaibuilder/sdk 4.0.0-beta.49 → 4.0.0-beta.51

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 (156) hide show
  1. package/README.md +35 -52
  2. package/dist/{2SSKDMRQ-CjvuNdPo.cjs → 2SSKDMRQ-BSYe_xPq.cjs} +1 -1
  3. package/dist/{2SSKDMRQ-Dvf9zadl.js → 2SSKDMRQ-Dv-C_YAA.js} +3 -3
  4. package/dist/{AP7HFJJL-DYFttFoI.cjs → AP7HFJJL-BJolKJBt.cjs} +1 -1
  5. package/dist/{AP7HFJJL-q4dJdyFs.js → AP7HFJJL-DhdVstVC.js} +1 -1
  6. package/dist/{IconPicker-Bf163F7t.js → IconPicker-BBkl0T8b.js} +13 -13
  7. package/dist/{IconPicker-JWhYq2Gp.cjs → IconPicker-C0WWlb8t.cjs} +1 -1
  8. package/dist/{WDYDFRGG-O9GIrtX0.js → WDYDFRGG-CJs2MxSq.js} +4 -4
  9. package/dist/{WDYDFRGG-BEksfGMC.cjs → WDYDFRGG-DRt6Zg7Q.cjs} +1 -1
  10. package/dist/{actions-registery-BHbZHkE3.cjs → actions-registery-CLL3KrNv.cjs} +2 -2
  11. package/dist/{actions-registery-gJb_wq2F.js → actions-registery-CrGIlqUX.js} +88 -88
  12. package/dist/actions.cjs +1 -1
  13. package/dist/actions.js +2 -2
  14. package/dist/{add-new-language-page-BfUp5Ua2.cjs → add-new-language-page-ByMSfRcN.cjs} +1 -1
  15. package/dist/{add-new-language-page-CRR93tLq.js → add-new-language-page-DtVoDNfI.js} +35 -35
  16. package/dist/{add-new-page-B8NGK6WS.cjs → add-new-page-CnuChfJz.cjs} +1 -1
  17. package/dist/add-new-page-DanzzvYo.js +31 -0
  18. package/dist/{ai-panel-default-lang-BXYQye3N.js → ai-panel-default-lang-BaPz2d_6.js} +35 -35
  19. package/dist/{ai-panel-default-lang-VhgmHFoQ.cjs → ai-panel-default-lang-CoIQSz_Y.cjs} +2 -2
  20. package/dist/{ai-panel-other-lang-DaCf-cq4.js → ai-panel-other-lang--i-5z4e2.js} +22 -22
  21. package/dist/{ai-panel-other-lang-Ds0EXeUC.cjs → ai-panel-other-lang-ChlMVodg.cjs} +1 -1
  22. package/dist/{ai-prompt-input-7iWk72w5.js → ai-prompt-input-BQi0VDJC.js} +77 -77
  23. package/dist/{ai-prompt-input-nZ5_Dm7X.cjs → ai-prompt-input-BT5426AB.cjs} +1 -1
  24. package/dist/{ai-translation-prompt-1OUs1P7n.js → ai-translation-prompt-BN78s33t.js} +8 -8
  25. package/dist/{ai-translation-prompt-B16cK-1Q.cjs → ai-translation-prompt-BQPaekp3.cjs} +1 -1
  26. package/dist/{apply-binding-CBSjMYSk.cjs → apply-binding-Cjh1kqMO.cjs} +1 -1
  27. package/dist/{apply-binding-vAuN-TGV.js → apply-binding-v_W4uR3U.js} +28 -28
  28. package/dist/{plugin-BSjgGgwo.js → chai-theme-helpers-BEf2rwE4.js} +83 -83
  29. package/dist/chai-theme-helpers-q3nwoNht.cjs +22 -0
  30. package/dist/{change-password-modal-D5eXjiYq.cjs → change-password-modal-DHUrrKw7.cjs} +1 -1
  31. package/dist/{change-password-modal-CdvJR1Ln.js → change-password-modal-pEp-nMNb.js} +30 -30
  32. package/dist/{code-display-DdWcOQ_i.js → code-display-BaLKScgW.js} +5 -5
  33. package/dist/{code-display-BR-gij5j.cjs → code-display-i7jb2kmw.cjs} +1 -1
  34. package/dist/{code-editor-CyLjDiEp.js → code-editor-CRoniyP0.js} +12 -12
  35. package/dist/{code-editor-SWbfFj1E.cjs → code-editor-gwFRjQ2_.cjs} +1 -1
  36. package/dist/core.cjs +1 -1
  37. package/dist/core.d.ts +0 -5
  38. package/dist/core.js +49 -49
  39. package/dist/{css-import-modal-Be47CBJn.js → css-import-modal-B3qxX9Iv.js} +14 -14
  40. package/dist/{css-import-modal-Bdwgd05S.cjs → css-import-modal-nAB5FSwn.cjs} +2 -2
  41. package/dist/{delete-page-C99K2qzS.js → delete-page-DbawNFf7.js} +13 -13
  42. package/dist/{delete-page-DLohaU-U.cjs → delete-page-YP1HEAoD.cjs} +1 -1
  43. package/dist/{digital-asset-manager-BZMb6sC7.js → digital-asset-manager-DTD5mf24.js} +388 -357
  44. package/dist/digital-asset-manager-kJnuMqpw.cjs +1 -0
  45. package/dist/{duplicate-page-D5Gtvqdv.cjs → duplicate-page-CxqW_EO7.cjs} +1 -1
  46. package/dist/{duplicate-page-CDc2X0eW.js → duplicate-page-DnRb1y6K.js} +19 -19
  47. package/dist/{dynamic-page-selector-DZHhX008.cjs → dynamic-page-selector-2EqJhUrB.cjs} +1 -1
  48. package/dist/{dynamic-page-selector-DvNBXo6o.js → dynamic-page-selector-D6VLDIN9.js} +17 -17
  49. package/dist/{get-chai-builder-tailwind-config-7CxFxEYL.cjs → get-chai-builder-tailwind-config-DNp8Vhme.cjs} +1 -1
  50. package/dist/{get-chai-builder-tailwind-config-DC4sDOYK.js → get-chai-builder-tailwind-config-k8l5sdcw.js} +3 -3
  51. package/dist/{get-chai-builder-theme-BpuwSLeS.js → get-chai-builder-theme-DLpviqPJ.js} +1 -1
  52. package/dist/get-chai-builder-theme-Du4ARJlw.cjs +1 -0
  53. package/dist/{image-editor-DwhTYkVR.cjs → image-editor-BQcOGsli.cjs} +1 -1
  54. package/dist/{image-editor-BBvvi9Vm.js → image-editor-CMf731xL.js} +15 -15
  55. package/dist/index-BYrRPW_c.cjs +5 -0
  56. package/dist/index-D-r_K4yA.cjs +160 -0
  57. package/dist/{index-OuHV9Ann.js → index-DPV6NiJ-.js} +5894 -6049
  58. package/dist/index-DqzFD1CG.js +4861 -0
  59. package/dist/{mark-as-template-CP_F9ZQ4.js → mark-as-template-D7jqSCXw.js} +28 -28
  60. package/dist/{mark-as-template-B9yLcasI.cjs → mark-as-template-DyB56HzI.cjs} +1 -1
  61. package/dist/{nested-path-selector-content-DmtCI3q9.js → nested-path-selector-content-dwSikrsV.js} +2 -2
  62. package/dist/{nested-path-selector-content-aTdu-o0e.cjs → nested-path-selector-content-g9_Tq_sR.cjs} +1 -1
  63. package/dist/no-language-page-content-BRITuyfN.js +43 -0
  64. package/dist/{no-language-page-content-C-MCdPXt.cjs → no-language-page-content-ZvMNVY-Y.cjs} +1 -1
  65. package/dist/{no-language-page-dialog-D4QIAHnE.cjs → no-language-page-dialog-Cndq8xRP.cjs} +1 -1
  66. package/dist/no-language-page-dialog-D7L9nVb9.js +10 -0
  67. package/dist/page-creator-BAIbU14q.js +652 -0
  68. package/dist/page-creator-qL3-M8g3.cjs +1 -0
  69. package/dist/{page-manager-new-ah6QYar2.cjs → page-manager-new-By3eGO3i.cjs} +1 -1
  70. package/dist/{page-manager-new-ttsrxdW9.js → page-manager-new-YRG89y4f.js} +63 -63
  71. package/dist/page-manager-search-and-filter-BbdgOU9V.cjs +1 -0
  72. package/dist/page-manager-search-and-filter-Cllju4CV.js +184 -0
  73. package/dist/pages.cjs +1 -1
  74. package/dist/pages.d.ts +0 -15
  75. package/dist/pages.js +20 -21
  76. package/dist/{publish-pages-content-KZVMHT6V.js → publish-pages-content-CG5LBUnY.js} +48 -48
  77. package/dist/{publish-pages-content-BrajJUcP.cjs → publish-pages-content-DxMiBxNU.cjs} +1 -1
  78. package/dist/{register-chai-top-bar-DyW9GPzV.cjs → register-chai-top-bar-CCssW5dL.cjs} +1 -1
  79. package/dist/{register-chai-top-bar-D6GjnauV.js → register-chai-top-bar-DWmJ2efT.js} +11 -11
  80. package/dist/render.cjs +1 -1
  81. package/dist/render.js +54 -54
  82. package/dist/{rte-widget-modal-CiTwsXTr.cjs → rte-widget-modal-CsTqFJc_.cjs} +1 -1
  83. package/dist/{rte-widget-modal-IU8JzPuZ.js → rte-widget-modal-DoeTMRtX.js} +2 -2
  84. package/dist/runtime-client.cjs +1 -1
  85. package/dist/runtime-client.js +1 -1
  86. package/dist/runtime.cjs +1 -1
  87. package/dist/runtime.js +1 -1
  88. package/dist/sdk.css +1 -1
  89. package/dist/{selected-block-display-CidmQ-wz.js → selected-block-display-Ck1kkNEi.js} +17 -28
  90. package/dist/{selected-block-display-CAFEOrLV.cjs → selected-block-display-DSow6N4b.cjs} +1 -1
  91. package/dist/seo-panel---mYZmLD.js +559 -0
  92. package/dist/seo-panel-mfX63fua.cjs +1 -0
  93. package/dist/{shared-json-ld-uvMmwCYp.js → shared-json-ld-B3I_RLE2.js} +46 -46
  94. package/dist/{shared-json-ld-CMH-eRUq.cjs → shared-json-ld-CGgwUOlW.cjs} +1 -1
  95. package/dist/{slug-input-DLWTMTsO.js → slug-input-DQ4t3-Tt.js} +5 -5
  96. package/dist/{slug-input-CiHC5l3r.cjs → slug-input-DaNbl597.cjs} +1 -1
  97. package/dist/supabase-actions.cjs +1 -1
  98. package/dist/supabase-actions.js +2 -2
  99. package/dist/types.d.ts +0 -96
  100. package/dist/{unmark-as-template-F7TdgWjI.cjs → unmark-as-template-CZ65AE4v.cjs} +1 -1
  101. package/dist/{unmark-as-template-C5ovsEBP.js → unmark-as-template-DvmoTbVu.js} +11 -11
  102. package/dist/unpublish-page-3--vO5b0.js +28 -0
  103. package/dist/{unpublish-page-CUr8Xub6.cjs → unpublish-page-B46TiWlU.cjs} +1 -1
  104. package/dist/{unpublished-partials-modal-BhNAub_z.js → unpublished-partials-modal-DVMz3q83.js} +18 -15
  105. package/dist/{unpublished-partials-modal-Cv5R9-hi.cjs → unpublished-partials-modal-U5lKBOSR.cjs} +1 -1
  106. package/dist/utils.cjs +1 -1
  107. package/dist/utils.js +2 -2
  108. package/dist/web-blocks.cjs +1 -1
  109. package/dist/web-blocks.js +2 -2
  110. package/dist/{web-preview-D9pXonAv.js → web-preview-D5o5XQo0.js} +2 -2
  111. package/dist/{web-preview-CuMYekVJ.cjs → web-preview-Da3RhcjQ.cjs} +1 -1
  112. package/package.json +1 -1
  113. package/dist/active-in-another-tab-B4Ur0JP7.js +0 -35
  114. package/dist/active-in-another-tab-BPdx4lWh.cjs +0 -1
  115. package/dist/add-new-page-Ppy5-y5j.js +0 -31
  116. package/dist/continue-editing-in-this-client-BrSvK-Ay.js +0 -25
  117. package/dist/continue-editing-in-this-client-Cmi-GkYZ.cjs +0 -1
  118. package/dist/design-token-usage-D1lWCJ3L.js +0 -114
  119. package/dist/design-token-usage-eY2wQ0l3.cjs +0 -1
  120. package/dist/digital-asset-manager-Z5aJxkq0.cjs +0 -1
  121. package/dist/get-chai-builder-theme-B5RkBTsB.cjs +0 -1
  122. package/dist/image-compression-DPFITwOL.js +0 -37
  123. package/dist/image-compression-UaU7Bwqe.cjs +0 -1
  124. package/dist/index-BVwFJWDq.cjs +0 -5
  125. package/dist/index-DCJDQs1a.cjs +0 -160
  126. package/dist/index-LBTm1Jmk.js +0 -5199
  127. package/dist/json-diff-viewer-Cb1CmRqP.cjs +0 -8
  128. package/dist/json-diff-viewer-DG6qMOBS.js +0 -261
  129. package/dist/lang-panel-B3USOxGq.js +0 -216
  130. package/dist/lang-panel-DxoJ0v4y.cjs +0 -1
  131. package/dist/manage-design-tokens-6YGIctip.js +0 -446
  132. package/dist/manage-design-tokens-modal-BSSCXH8Y.cjs +0 -1
  133. package/dist/manage-design-tokens-modal-CzsnN49F.js +0 -161
  134. package/dist/manage-design-tokens-udLBvkHA.cjs +0 -1
  135. package/dist/no-language-page-content-D8t5dfgh.js +0 -43
  136. package/dist/no-language-page-dialog-C_fHI2zI.js +0 -10
  137. package/dist/page-creator-Cz_ah-qE.cjs +0 -1
  138. package/dist/page-creator-DKEkuGCO.js +0 -796
  139. package/dist/page-lock-CwZKJ4IE.js +0 -30
  140. package/dist/page-lock-DdCvtA-I.cjs +0 -1
  141. package/dist/page-locked-dialog-CrTDBoC4.cjs +0 -1
  142. package/dist/page-locked-dialog-DqLlooUz.js +0 -136
  143. package/dist/page-manager-search-and-filter-D7AupT6_.cjs +0 -1
  144. package/dist/page-manager-search-and-filter-bsqZ6wnI.js +0 -210
  145. package/dist/page-revisions-content-B6hsIla7.cjs +0 -1
  146. package/dist/page-revisions-content-C5O8_Fms.js +0 -459
  147. package/dist/plugin-DHpuZZXz.cjs +0 -22
  148. package/dist/save-to-lib-DMnv7ENo.js +0 -429
  149. package/dist/save-to-lib-Dc700Aop.cjs +0 -1
  150. package/dist/seo-panel-Br8gxDxu.js +0 -789
  151. package/dist/seo-panel-CMY-adM-.cjs +0 -2
  152. package/dist/take-over-request-IRLgF1dG.cjs +0 -1
  153. package/dist/take-over-request-KdR1_h_K.js +0 -64
  154. package/dist/translation-warning-modal-CLZ9tC1F.cjs +0 -1
  155. package/dist/translation-warning-modal-CzNt6LDO.js +0 -27
  156. package/dist/unpublish-page-0fR1o0b7.js +0 -28
@@ -1,4 +1,4 @@
1
- "use strict";var ut=Object.defineProperty;var pt=(t,s,e)=>s in t?ut(t,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[s]=e;var _=(t,s,e)=>pt(t,typeof s!="symbol"?s+"":s,e);const k=require("./STRINGS-FNnfjF5H.cjs"),N=require("./common-functions-B3a4xKt_.cjs"),a=require("lodash-es"),$=require("himalaya"),z=require("./core-czmLeR0h.cjs"),dt=require("tailwind-merge"),X=t=>{if(t=t.replace(k.STYLES_KEY,""),!t)return{baseClasses:"",classes:""};const s=t.split(/,(?![^\[]*\])/);if(s.length===1)return{baseClasses:"",classes:s[0].trim()};const[e,...n]=s;return{baseClasses:e.trim(),classes:n.join(",").trim().replace(/ +(?= )/g,"")}};function ht(t,s,e){const n=a.get(e,"i18nProps",[]);if(a.isEmpty(s)||a.isEmpty(n))return t;const i=a.cloneDeep(t);return a.forEach(a.keys(i),r=>{if(a.includes(n,r)&&!a.isEmpty(s)){const o=a.get(i,r),l=a.get(i,`${r}-${s}`,"");a.isString(o)?i[r]=a.isString(l)&&!a.isEmpty(l.trim())&&l.trimStart()||o:i[r]=a.isEmpty(l)?o:l}}),i}const Z=(t,s)=>{const{baseClasses:e,classes:n}=X(t),r=n.split(" ").filter(l=>l.startsWith(k.DESIGN_TOKEN_PREFIX)).map(l=>{var p;return(p=s[l])==null?void 0:p.value}),o=n.split(" ").filter(l=>!l.startsWith(k.DESIGN_TOKEN_PREFIX)).join(" ");return dt.twMerge.apply(null,[e,...r,o])};function gt(t,s){return a.get(t,`${s}_attrs`,{})}function yt(t,s=!0,e={}){const n={};return Object.keys(t).forEach(i=>{if(a.isString(t[i])&&t[i].startsWith(k.STYLES_KEY)){const r=Z(t[i],e),o=gt(t,i);n[i]={...!a.isEmpty(r)&&{className:r},...o,...s?{"data-style-prop":i,"data-block-parent":t._id,"data-style-id":`${i}-${t._id}`}:{}}}}),n}const ft=a.memoize(t=>{var i;const s=z.getRegisteredChaiBlock(t),e=((i=s==null?void 0:s.props)==null?void 0:i.schema)||((s==null?void 0:s.schema)??{}),n=a.get(e,"properties",{});return Object.fromEntries(Object.entries(n).filter(([,r])=>a.get(r,"runtime",!1)))}),mt=(t,s)=>{if(!a.isArray(t))return t;let e=t,n;return typeof s.limit=="number"&&s.limit>0&&(n=s.limit),n!==void 0&&(e=e.slice(0,n)),e},_t=(t,s)=>{const e=a.cloneDeep(t);return a.forEach(a.keys(e),n=>{if(a.isString(e[n])&&!a.startsWith(n,"_")){let i=e[n];n==="repeaterItems"&&(e.repeaterItemsBinding=i);const r=/\{\{(.*?)\}\}/g,o=i.match(r);o&&o.forEach(l=>{let p=l.slice(2,-2);const c=a.get(s,p,l);i=a.isArray(c)?c:i.replace(l,c)}),e[n]=i}}),e},xt=t=>{const s=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,e=/(?:https?:\/\/)?(?:www\.)?(player)?.vimeo\.com/;return s.test(t)||e.test(t)},bt=t=>{if(a.isEmpty(t))return t;const s=/<video[^>]+src=['"]([^'">]+)['"]/,e=/<iframe[^>]+src=['"]([^'">]+)['"]/,n=t.match(s),i=t.match(e),r=n?n[1]:i?i[1]:null,o=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,l=/(?:https?:\/\/)?(?:www\.)?player.vimeo\.com/;return r&&(o.test(r)||l.test(r))?r:t},J=["chai-name","data-chai-name"],kt={img:{alt:"alt",width:"width",height:"height",src:"image"},video:{src:"url",autoplay:"controls.autoPlay",muted:"controls.muted",loop:"controls.loop",controls:"controls.widgets"},a:{href:"link.href",target:"link.target",type:""},input:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},textarea:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},select:{placeholder:"placeholder",required:"required",multiple:"multiple",name:"fieldName"},form:{action:"action"}},Tt=(t,s)=>{var e;return((e=t.children)==null?void 0:e.length)===1&&a.includes(["Heading","Paragraph","Span","ListItem","Button","Label","TableCell","Link","RichText"],s._type)},A=t=>t.map(s=>s.type==="text"?a.get(s,"content",""):a.isEmpty(s.children)?"":A(s.children||[])).join(""),D=t=>t===null?"":t,Q=t=>{const s=a.compact(a.map(t.split(/\s+/),a.trim)),e=a.find(s,l=>/^w-/.test(l)),n=a.find(s,l=>/^h-/.test(l));if(!n||!e)return{height:"",width:""};const i=l=>{if(!l)return;const p=l.match(/^[wh]-(?:\[(.*?)\]|(.+))$/);if(!p)return;if(p[1])return p[1];const c=p[2];return/^\d+(\.\d+)?$/.test(c)?`${Number(c)*4}px`:c==="auto"||a.includes(c,"%")?c:"16px"},r=i(e),o=i(n);return{width:a.includes(r,"px")?r:"16px",height:a.includes(o,"px")?o:"16px"}},G=t=>{if(t.tagName==="svg")return{};const s={},e=kt[t.tagName||""]||{},n=t.attributes||[];return a.forEach(n,({key:i,value:r})=>{var o;if(!a.includes(J,i))if(i==="bid"&&(s._bid=D(r)),e[i]){if(t.tagName==="img"&&i==="src"&&!r.startsWith("http")){const l=a.find(t.attributes,{key:"width"}),p=a.find(t.attributes,{key:"height"});l&&p?r=`https://picsum.photos/${l==null?void 0:l.value}x${p==null?void 0:p.value}`:r="https://picsum.photos/150x150"}else if(t.tagName==="a"){const l=a.find(t.attributes,{key:"href"});l&&typeof(l==null?void 0:l.value)=="string"&&((o=l==null?void 0:l.value)!=null&&o.startsWith("pageType:"))&&a.set(s,"link.type","pageType")}a.set(s,e[i],D(r))}else a.includes(["style","class","srcset","bid"],i)||(s.styles_attrs=s.styles_attrs||{},a.startsWith(i,"@")&&(i=i.replace("@","x-on:")),s.styles_attrs[`${i}`]=D(r))}),delete s.class,s},St=(t,s="styles")=>{if(!t.attributes)return{[s]:`${k.STYLES_KEY},`};const e=a.find(t.attributes,{key:"class"});if(e){const n=e.value;return{[s]:`${k.STYLES_KEY},${n}`}}return{[s]:`${k.STYLES_KEY},`}},vt=t=>{const s=a.get(t,"attributes",[]),e=s.find(c=>c.key==="data-chai-richtext"||c.key==="chai-richtext"),n=s.find(c=>c.key==="data-chai-lightbox"||c.key==="chai-lightbox"),i=s.find(c=>c.key==="data-chai-dropdown"||c.key==="chai-dropdown"),r=s.find(c=>c.key==="data-chai-dropdown-button"||c.key==="chai-dropdown-button"),o=s.find(c=>c.key==="data-chai-dropdown-content"||c.key==="chai-dropdown-content"),l=s.find(c=>c.key==="class"),p=l&&l.value.split(/\s+/).includes("rte");if(i)return{_type:"Dropdown"};if(r)return{_type:"DropdownButton"};if(o)return{_type:"DropdownContent"};if(e||p)return{_type:"Paragraph"};if(n)return{_type:"LightBoxLink"};switch(t.tagName){case"img":return{_type:"Image"};case"input":return{_type:"Input",showLabel:!1};case"hr":return{_type:"Divider"};case"br":return{_type:"LineBreak"};case"textarea":return{_type:"TextArea",showLabel:!1};case"audio":return{_type:"Audio"};case"canvas":return{_type:"Canvas"};case"video":case"iframe":return{_type:"CustomHTML"};case"svg":return{_type:"Icon"};case"select":return{_type:"Select",options:[]};case"option":return{_type:"Option"};case"ul":case"ol":case"dl":return{_type:"List",tag:t.tagName,_listType:t.tagName==="ol"?"list-decimal":"list-none"};case"li":case"dt":return{_type:"ListItem",tag:t.tagName};case"span":case"figcaption":case"legend":return{_type:"Span",tag:t.tagName};case"p":return{_type:"Paragraph",content:""};case"a":return{_type:"Link"};case"form":return{_type:"Form"};case"label":return{_type:"Label"};case"button":return{_type:"Button"};case"code":return{_type:"Box",_name:"Code"};case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return{_type:"Heading",tag:t.tagName};case"table":return{_type:"Table"};case"tr":return{_type:"TableRow"};case"td":case"th":return{_type:"TableCell",tag:t.tagName};case"thead":return{_type:"TableHead"};case"tbody":return{_type:"TableBody"};case"tfoot":return{_type:"TableFooter"};default:{const c=a.get(t,"children",[]).length>0?"Box":"EmptyBox";return{_type:c,tag:t.tagName,_name:c=="EmptyBox"||t.tagName==="div"?c:a.capitalize(t.tagName)}}}},P=(t,s=null)=>a.flatMapDeep(t,e=>{var v,x,S,T,w,Y,M,q,H,O;if(e.type==="comment")return[];let n={_id:N.generateUUID()};if(s&&(n._parent=s.block._id),e.type==="text")return a.isEmpty(a.get(e,"content",""))?[]:s&&Tt(s.node,s.block)?(a.set(s,"block.content",a.get(e,"content","")),[]):{...n,_type:"Text",content:a.get(e,"content","")};if(a.startsWith(e.tagName,"chai-")){const u=e.attributes||[],d=a.find(u,{key:"chai-type"}),g=(d==null?void 0:d.value)||a.startCase(a.camelCase(e.tagName||"")).replace(/ /g,"").replace(/\s+/g,"");n._type=g,a.forEach(u,({key:b,value:V})=>{if(b==="about-this-component"||b==="chai-type"||b==="can-move"||b==="can-delete")return;if(b==="id"){n._id=V;return}const ct=a.startsWith(b,"_")?b:a.camelCase(b);let B=D(V);typeof B=="string"&&a.startsWith(B,"#styles:")&&(B=B.replace("#styles:","#styles:,")),n[ct]=B});const m=P(e.children||[],{block:n,node:e});return[n,...m]}const i=a.get(e,"attributes",[]),r=e.tagName==="p"||i.find(u=>u.key==="data-chai-richtext"||u.key==="chai-richtext"),o=i.find(u=>u.key==="class"),l=o&&o.value.split(/\s+/).includes("rte"),p=i.find(u=>u.key==="data-chai-lightbox"||u.key==="chai-lightbox"),c=i.find(u=>u.key==="data-chai-dropdown"||u.key==="chai-dropdown"),f=i.find(u=>u.key==="data-chai-dropdown-button"||u.key==="chai-dropdown-button"),h=i.find(u=>u.key==="data-chai-dropdown-content"||u.key==="chai-dropdown-content");if(n={...n,...vt(e),...G(e),...St(e)},e.attributes){const u=e.attributes.find(d=>a.includes(J,d.key));u&&(n._name=u.value)}if(r||l)return n.content=`<p>${$.stringify(e.children||[])}</p>`,a.has(n,"styles_attrs.data-chai-richtext")&&delete n.styles_attrs["data-chai-richtext"],a.has(n,"styles_attrs.chai-richtext")&&delete n.styles_attrs["chai-richtext"],[n];if(p){const u=["data-chai-lightbox","chai-lightbox","data-vbtype","data-autoplay","data-maxwidth","data-overlay","data-gall","href"];n={...n,href:((v=i.find(d=>d.key==="href"))==null?void 0:v.value)||"",hrefType:((x=i.find(d=>d.key==="data-vbtype"))==null?void 0:x.value)||"video",autoplay:((S=i.find(d=>d.key==="data-autoplay"))==null?void 0:S.value)==="true"?"true":"false",maxWidth:((w=(T=i.find(d=>d.key==="data-maxwidth"))==null?void 0:T.value)==null?void 0:w.replace("px",""))||"",backdropColor:((Y=i.find(d=>d.key==="data-overlay"))==null?void 0:Y.value)||"",galleryName:((M=i.find(d=>d.key==="data-gall"))==null?void 0:M.value)||""},a.forEach(u,d=>{a.has(n,`styles_attrs.${d}`)&&delete n.styles_attrs[d]})}if(c&&(delete n.styles_attrs,n.showDropdown=!1),h&&delete n.styles_attrs,f){delete n.styles_attrs;const u=a.filter(e.children||[],g=>(g==null?void 0:g.tagName)!=="span");n.content=A(u);const d=a.find(e.children||[],g=>(g==null?void 0:g.tagName)==="span"&&a.some(g.children||[],m=>(m==null?void 0:m.tagName)==="svg"));if(d){const g=a.find(d.children||[],m=>(m==null?void 0:m.tagName)==="svg");if(g){n.icon=$.stringify([g]);const{height:m,width:b}=wt(g,"16px","16px");n.iconHeight=m,n.iconWidth=b}}return[n]}if(n._type==="Input"){const u=n.inputType||"text";u==="checkbox"?a.set(n,"_type","Checkbox"):u==="radio"&&a.set(n,"_type","Radio")}else if(e.tagName==="video"||e.tagName==="iframe"){const u=$.stringify([e]);return xt(u)&&(a.set(n,"_type","Video"),a.set(n,"url",bt(u)),a.set(n,"styles",`${k.STYLES_KEY},`),a.set(n,"controls",{autoPlay:!1,muted:!0,loop:!1,controls:!1})),n.content=u,[n]}else if(e.tagName==="svg"){const u=a.get(a.find(e.attributes,{key:"class"}),"value",""),{height:d,width:g}=Q(u);if(d&&g)n.styles=`${k.STYLES_KEY}, ${N.cn(`w-${g} h-${d}`,u)}`.trim(),n.height=d==null?void 0:d.replace("px",""),n.width=g==null?void 0:g.replace("px","");else{const m=(q=a.find(e.attributes,{key:"height"}))==null?void 0:q.value,b=(H=a.find(e.attributes,{key:"width"}))==null?void 0:H.value;m&&b?(n.styles=`${k.STYLES_KEY}, ${N.cn(`w-[${b}px] h-[${m}px]`,u)}`.trim(),n.height=m,n.width=b):n.styles=`${k.STYLES_KEY}, ${N.cn("w-full h-full",u)}`.trim()}return e.attributes=a.filter(e.attributes,m=>!a.includes(["style","width","height","class"],m.key)),n.icon=$.stringify([e]),[n]}else if(e.tagName=="option"&&s&&((O=s.block)==null?void 0:O._type)==="Select")return s.block.options.push({label:A(e.children||[]),...G(e)}),[];const y=P(e.children||[],{block:n,node:e});return[n,...y]}),wt=(t,s,e)=>{var p,c;const n=a.get(t,"attributes",[]),{height:i,width:r}=Q(a.get(a.find(n,{key:"class"}),"value",""));if(i&&r)return{height:`[${i}px]`,width:`[${r}px]`};const o=(p=a.find(n,{key:"height"}))==null?void 0:p.value,l=(c=a.find(n,{key:"width"}))==null?void 0:c.value;return{height:o?`[${o}px]`:e,width:l?`[${l}px]`:s}},Bt=t=>{t=t.replace(/(\w+)=\\?"(.*?)\\?"/g,(n,i,r)=>{let o=r.replace(/\\"/g,'"');return o=o.replace(/{([^}]+)}/g,l=>l.replace(/"/g,'\\"')),`${i}="${o.replace(/\\"/g,'"')}"`}),t=t.replace(/\\n/g," ").replace(/\\\\/g,"").replace(/\\([/<>])/g,"$1").replace(/\\./g,"").replace(/[\n\r\t\f\v]/g," "),t=t.replace(/\$name="[^"]*"/g,"");const s=t.match(/<body[^>]*>[\s\S]*?<\/body>/);return(s&&s.length>0?s[0].replace(/<body/,"<div").replace(/<\/body>/,"</div>"):t).replace(/\s+/g," ").replaceAll("> <","><").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").trim()},Et=(t,s)=>a.find(t,{_id:s}),$t=(t,s)=>a.isEmpty(s)?t.map(e=>(a.unset(e,"_bid"),e)):a.map(t,e=>{const n=a.isEmpty(e._bid)?void 0:Et(s,e._bid);if(n){n._type==="Icon"&&a.get(e,"icon","").match(/chai-default-svg/)&&delete e.icon;const i={...n,...e};return a.unset(i,"_bid"),i}return a.unset(e,"_bid"),e}),Nt=t=>{const s=$.parse(Bt(t));if(a.isEmpty(t))return[];const e=a.flatten(P(s));return z.syncBlocksWithDefaultProps(e)},It=(t,s)=>t.map(e=>{const n=a.keys(e).filter(i=>a.isString(e[i])&&e[i].startsWith(k.STYLES_KEY));return a.each(n,i=>{e[i]=`${k.STYLES_KEY},${Z(e[i],s)}`}),e}),Ct=t=>{const s=a.last(t);return t.map(e=>{const n=Object.keys(e);for(let i=0;i<n.length;i++)if(a.isString(e[n[i]])&&a.startsWith(n[i],"content")){const r=e===s?"":" ";e[n[i]]=`${e[n[i]].trim()}${r}`}return e})};var j=class extends Error{constructor(t){super(t),this.name="Eta Error"}},tt=class extends j{constructor(t){super(t),this.name="EtaParser Error"}},Lt=class extends j{constructor(t){super(t),this.name="EtaRuntime Error"}},Wt=class extends j{constructor(t){super(t),this.name="EtaNameResolution Error"}};function E(t,s,e){let n=s.slice(0,e).split(/\n/),i=n.length,r=n[i-1].length+1;throw t+=" at line "+i+" col "+r+`:
1
+ "use strict";var ut=Object.defineProperty;var pt=(t,s,e)=>s in t?ut(t,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[s]=e;var _=(t,s,e)=>pt(t,typeof s!="symbol"?s+"":s,e);const $=require("himalaya"),a=require("lodash-es"),k=require("./STRINGS-FNnfjF5H.cjs"),N=require("./common-functions-B3a4xKt_.cjs"),z=require("./core-czmLeR0h.cjs"),dt=require("tailwind-merge"),X=t=>{if(t=t.replace(k.STYLES_KEY,""),!t)return{baseClasses:"",classes:""};const s=t.split(/,(?![^\[]*\])/);if(s.length===1)return{baseClasses:"",classes:s[0].trim()};const[e,...n]=s;return{baseClasses:e.trim(),classes:n.join(",").trim().replace(/ +(?= )/g,"")}};function ht(t,s,e){const n=a.get(e,"i18nProps",[]);if(a.isEmpty(s)||a.isEmpty(n))return t;const i=a.cloneDeep(t);return a.forEach(a.keys(i),r=>{if(a.includes(n,r)&&!a.isEmpty(s)){const o=a.get(i,r),l=a.get(i,`${r}-${s}`,"");a.isString(o)?i[r]=a.isString(l)&&!a.isEmpty(l.trim())&&l.trimStart()||o:i[r]=a.isEmpty(l)?o:l}}),i}const Z=(t,s)=>{const{baseClasses:e,classes:n}=X(t),r=n.split(" ").filter(l=>l.startsWith(k.DESIGN_TOKEN_PREFIX)).map(l=>{var p;return(p=s[l])==null?void 0:p.value}),o=n.split(" ").filter(l=>!l.startsWith(k.DESIGN_TOKEN_PREFIX)).join(" ");return dt.twMerge.apply(null,[e,...r,o])};function gt(t,s){return a.get(t,`${s}_attrs`,{})}function yt(t,s=!0,e={}){const n={};return Object.keys(t).forEach(i=>{if(a.isString(t[i])&&t[i].startsWith(k.STYLES_KEY)){const r=Z(t[i],e),o=gt(t,i);n[i]={...!a.isEmpty(r)&&{className:r},...o,...s?{"data-style-prop":i,"data-block-parent":t._id,"data-style-id":`${i}-${t._id}`}:{}}}}),n}const ft=a.memoize(t=>{var i;const s=z.getRegisteredChaiBlock(t),e=((i=s==null?void 0:s.props)==null?void 0:i.schema)||((s==null?void 0:s.schema)??{}),n=a.get(e,"properties",{});return Object.fromEntries(Object.entries(n).filter(([,r])=>a.get(r,"runtime",!1)))}),mt=(t,s)=>{if(!a.isArray(t))return t;let e=t,n;return typeof s.limit=="number"&&s.limit>0&&(n=s.limit),n!==void 0&&(e=e.slice(0,n)),e},_t=(t,s)=>{const e=a.cloneDeep(t);return a.forEach(a.keys(e),n=>{if(a.isString(e[n])&&!a.startsWith(n,"_")){let i=e[n];n==="repeaterItems"&&(e.repeaterItemsBinding=i);const r=/\{\{(.*?)\}\}/g,o=i.match(r);o&&o.forEach(l=>{let p=l.slice(2,-2);const c=a.get(s,p,l);i=a.isArray(c)?c:i.replace(l,c)}),e[n]=i}}),e},xt=t=>{const s=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,e=/(?:https?:\/\/)?(?:www\.)?(player)?.vimeo\.com/;return s.test(t)||e.test(t)},bt=t=>{if(a.isEmpty(t))return t;const s=/<video[^>]+src=['"]([^'">]+)['"]/,e=/<iframe[^>]+src=['"]([^'">]+)['"]/,n=t.match(s),i=t.match(e),r=n?n[1]:i?i[1]:null,o=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,l=/(?:https?:\/\/)?(?:www\.)?player.vimeo\.com/;return r&&(o.test(r)||l.test(r))?r:t},J=["chai-name","data-chai-name"],kt={img:{alt:"alt",width:"width",height:"height",src:"image"},video:{src:"url",autoplay:"controls.autoPlay",muted:"controls.muted",loop:"controls.loop",controls:"controls.widgets"},a:{href:"link.href",target:"link.target",type:""},input:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},textarea:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},select:{placeholder:"placeholder",required:"required",multiple:"multiple",name:"fieldName"},form:{action:"action"}},Tt=(t,s)=>{var e;return((e=t.children)==null?void 0:e.length)===1&&a.includes(["Heading","Paragraph","Span","ListItem","Button","Label","TableCell","Link","RichText"],s._type)},A=t=>t.map(s=>s.type==="text"?a.get(s,"content",""):a.isEmpty(s.children)?"":A(s.children||[])).join(""),D=t=>t===null?"":t,Q=t=>{const s=a.compact(a.map(t.split(/\s+/),a.trim)),e=a.find(s,l=>/^w-/.test(l)),n=a.find(s,l=>/^h-/.test(l));if(!n||!e)return{height:"",width:""};const i=l=>{if(!l)return;const p=l.match(/^[wh]-(?:\[(.*?)\]|(.+))$/);if(!p)return;if(p[1])return p[1];const c=p[2];return/^\d+(\.\d+)?$/.test(c)?`${Number(c)*4}px`:c==="auto"||a.includes(c,"%")?c:"16px"},r=i(e),o=i(n);return{width:a.includes(r,"px")?r:"16px",height:a.includes(o,"px")?o:"16px"}},G=t=>{if(t.tagName==="svg")return{};const s={},e=kt[t.tagName||""]||{},n=t.attributes||[];return a.forEach(n,({key:i,value:r})=>{var o;if(!a.includes(J,i))if(i==="bid"&&(s._bid=D(r)),e[i]){if(t.tagName==="img"&&i==="src"&&!r.startsWith("http")){const l=a.find(t.attributes,{key:"width"}),p=a.find(t.attributes,{key:"height"});l&&p?r=`https://picsum.photos/${l==null?void 0:l.value}x${p==null?void 0:p.value}`:r="https://picsum.photos/150x150"}else if(t.tagName==="a"){const l=a.find(t.attributes,{key:"href"});l&&typeof(l==null?void 0:l.value)=="string"&&((o=l==null?void 0:l.value)!=null&&o.startsWith("pageType:"))&&a.set(s,"link.type","pageType")}a.set(s,e[i],D(r))}else a.includes(["style","class","srcset","bid"],i)||(s.styles_attrs=s.styles_attrs||{},a.startsWith(i,"@")&&(i=i.replace("@","x-on:")),s.styles_attrs[`${i}`]=D(r))}),delete s.class,s},St=(t,s="styles")=>{if(!t.attributes)return{[s]:`${k.STYLES_KEY},`};const e=a.find(t.attributes,{key:"class"});if(e){const n=e.value;return{[s]:`${k.STYLES_KEY},${n}`}}return{[s]:`${k.STYLES_KEY},`}},vt=t=>{const s=a.get(t,"attributes",[]),e=s.find(c=>c.key==="data-chai-richtext"||c.key==="chai-richtext"),n=s.find(c=>c.key==="data-chai-lightbox"||c.key==="chai-lightbox"),i=s.find(c=>c.key==="data-chai-dropdown"||c.key==="chai-dropdown"),r=s.find(c=>c.key==="data-chai-dropdown-button"||c.key==="chai-dropdown-button"),o=s.find(c=>c.key==="data-chai-dropdown-content"||c.key==="chai-dropdown-content"),l=s.find(c=>c.key==="class"),p=l&&l.value.split(/\s+/).includes("rte");if(i)return{_type:"Dropdown"};if(r)return{_type:"DropdownButton"};if(o)return{_type:"DropdownContent"};if(e||p)return{_type:"Paragraph"};if(n)return{_type:"LightBoxLink"};switch(t.tagName){case"img":return{_type:"Image"};case"input":return{_type:"Input",showLabel:!1};case"hr":return{_type:"Divider"};case"br":return{_type:"LineBreak"};case"textarea":return{_type:"TextArea",showLabel:!1};case"audio":return{_type:"Audio"};case"canvas":return{_type:"Canvas"};case"video":case"iframe":return{_type:"CustomHTML"};case"svg":return{_type:"Icon"};case"select":return{_type:"Select",options:[]};case"option":return{_type:"Option"};case"ul":case"ol":case"dl":return{_type:"List",tag:t.tagName,_listType:t.tagName==="ol"?"list-decimal":"list-none"};case"li":case"dt":return{_type:"ListItem",tag:t.tagName};case"span":case"figcaption":case"legend":return{_type:"Span",tag:t.tagName};case"p":return{_type:"Paragraph",content:""};case"a":return{_type:"Link"};case"form":return{_type:"Form"};case"label":return{_type:"Label"};case"button":return{_type:"Button"};case"code":return{_type:"Box",_name:"Code"};case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return{_type:"Heading",tag:t.tagName};case"table":return{_type:"Table"};case"tr":return{_type:"TableRow"};case"td":case"th":return{_type:"TableCell",tag:t.tagName};case"thead":return{_type:"TableHead"};case"tbody":return{_type:"TableBody"};case"tfoot":return{_type:"TableFooter"};default:{const c=a.get(t,"children",[]).length>0?"Box":"EmptyBox";return{_type:c,tag:t.tagName,_name:c=="EmptyBox"||t.tagName==="div"?c:a.capitalize(t.tagName)}}}},P=(t,s=null)=>a.flatMapDeep(t,e=>{var v,x,S,T,w,Y,M,q,H,O;if(e.type==="comment")return[];let n={_id:N.generateUUID()};if(s&&(n._parent=s.block._id),e.type==="text")return a.isEmpty(a.get(e,"content",""))?[]:s&&Tt(s.node,s.block)?(a.set(s,"block.content",a.get(e,"content","")),[]):{...n,_type:"Text",content:a.get(e,"content","")};if(a.startsWith(e.tagName,"chai-")){const u=e.attributes||[],d=a.find(u,{key:"chai-type"}),g=(d==null?void 0:d.value)||a.startCase(a.camelCase(e.tagName||"")).replace(/ /g,"").replace(/\s+/g,"");n._type=g,a.forEach(u,({key:b,value:V})=>{if(b==="about-this-component"||b==="chai-type"||b==="can-move"||b==="can-delete")return;if(b==="id"){n._id=V;return}const ct=a.startsWith(b,"_")?b:a.camelCase(b);let B=D(V);typeof B=="string"&&a.startsWith(B,"#styles:")&&(B=B.replace("#styles:","#styles:,")),n[ct]=B});const m=P(e.children||[],{block:n,node:e});return[n,...m]}const i=a.get(e,"attributes",[]),r=e.tagName==="p"||i.find(u=>u.key==="data-chai-richtext"||u.key==="chai-richtext"),o=i.find(u=>u.key==="class"),l=o&&o.value.split(/\s+/).includes("rte"),p=i.find(u=>u.key==="data-chai-lightbox"||u.key==="chai-lightbox"),c=i.find(u=>u.key==="data-chai-dropdown"||u.key==="chai-dropdown"),f=i.find(u=>u.key==="data-chai-dropdown-button"||u.key==="chai-dropdown-button"),h=i.find(u=>u.key==="data-chai-dropdown-content"||u.key==="chai-dropdown-content");if(n={...n,...vt(e),...G(e),...St(e)},e.attributes){const u=e.attributes.find(d=>a.includes(J,d.key));u&&(n._name=u.value)}if(r||l)return n.content=`<p>${$.stringify(e.children||[])}</p>`,a.has(n,"styles_attrs.data-chai-richtext")&&delete n.styles_attrs["data-chai-richtext"],a.has(n,"styles_attrs.chai-richtext")&&delete n.styles_attrs["chai-richtext"],[n];if(p){const u=["data-chai-lightbox","chai-lightbox","data-vbtype","data-autoplay","data-maxwidth","data-overlay","data-gall","href"];n={...n,href:((v=i.find(d=>d.key==="href"))==null?void 0:v.value)||"",hrefType:((x=i.find(d=>d.key==="data-vbtype"))==null?void 0:x.value)||"video",autoplay:((S=i.find(d=>d.key==="data-autoplay"))==null?void 0:S.value)==="true"?"true":"false",maxWidth:((w=(T=i.find(d=>d.key==="data-maxwidth"))==null?void 0:T.value)==null?void 0:w.replace("px",""))||"",backdropColor:((Y=i.find(d=>d.key==="data-overlay"))==null?void 0:Y.value)||"",galleryName:((M=i.find(d=>d.key==="data-gall"))==null?void 0:M.value)||""},a.forEach(u,d=>{a.has(n,`styles_attrs.${d}`)&&delete n.styles_attrs[d]})}if(c&&(delete n.styles_attrs,n.showDropdown=!1),h&&delete n.styles_attrs,f){delete n.styles_attrs;const u=a.filter(e.children||[],g=>(g==null?void 0:g.tagName)!=="span");n.content=A(u);const d=a.find(e.children||[],g=>(g==null?void 0:g.tagName)==="span"&&a.some(g.children||[],m=>(m==null?void 0:m.tagName)==="svg"));if(d){const g=a.find(d.children||[],m=>(m==null?void 0:m.tagName)==="svg");if(g){n.icon=$.stringify([g]);const{height:m,width:b}=wt(g,"16px","16px");n.iconHeight=m,n.iconWidth=b}}return[n]}if(n._type==="Input"){const u=n.inputType||"text";u==="checkbox"?a.set(n,"_type","Checkbox"):u==="radio"&&a.set(n,"_type","Radio")}else if(e.tagName==="video"||e.tagName==="iframe"){const u=$.stringify([e]);return xt(u)&&(a.set(n,"_type","Video"),a.set(n,"url",bt(u)),a.set(n,"styles",`${k.STYLES_KEY},`),a.set(n,"controls",{autoPlay:!1,muted:!0,loop:!1,controls:!1})),n.content=u,[n]}else if(e.tagName==="svg"){const u=a.get(a.find(e.attributes,{key:"class"}),"value",""),{height:d,width:g}=Q(u);if(d&&g)n.styles=`${k.STYLES_KEY}, ${N.cn(`w-${g} h-${d}`,u)}`.trim(),n.height=d==null?void 0:d.replace("px",""),n.width=g==null?void 0:g.replace("px","");else{const m=(q=a.find(e.attributes,{key:"height"}))==null?void 0:q.value,b=(H=a.find(e.attributes,{key:"width"}))==null?void 0:H.value;m&&b?(n.styles=`${k.STYLES_KEY}, ${N.cn(`w-[${b}px] h-[${m}px]`,u)}`.trim(),n.height=m,n.width=b):n.styles=`${k.STYLES_KEY}, ${N.cn("w-full h-full",u)}`.trim()}return e.attributes=a.filter(e.attributes,m=>!a.includes(["style","width","height","class"],m.key)),n.icon=$.stringify([e]),[n]}else if(e.tagName=="option"&&s&&((O=s.block)==null?void 0:O._type)==="Select")return s.block.options.push({label:A(e.children||[]),...G(e)}),[];const y=P(e.children||[],{block:n,node:e});return[n,...y]}),wt=(t,s,e)=>{var p,c;const n=a.get(t,"attributes",[]),{height:i,width:r}=Q(a.get(a.find(n,{key:"class"}),"value",""));if(i&&r)return{height:`[${i}px]`,width:`[${r}px]`};const o=(p=a.find(n,{key:"height"}))==null?void 0:p.value,l=(c=a.find(n,{key:"width"}))==null?void 0:c.value;return{height:o?`[${o}px]`:e,width:l?`[${l}px]`:s}},Bt=t=>{t=t.replace(/(\w+)=\\?"(.*?)\\?"/g,(n,i,r)=>{let o=r.replace(/\\"/g,'"');return o=o.replace(/{([^}]+)}/g,l=>l.replace(/"/g,'\\"')),`${i}="${o.replace(/\\"/g,'"')}"`}),t=t.replace(/\\n/g," ").replace(/\\\\/g,"").replace(/\\([/<>])/g,"$1").replace(/\\./g,"").replace(/[\n\r\t\f\v]/g," "),t=t.replace(/\$name="[^"]*"/g,"");const s=t.match(/<body[^>]*>[\s\S]*?<\/body>/);return(s&&s.length>0?s[0].replace(/<body/,"<div").replace(/<\/body>/,"</div>"):t).replace(/\s+/g," ").replaceAll("> <","><").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").trim()},Et=(t,s)=>a.find(t,{_id:s}),$t=(t,s)=>a.isEmpty(s)?t.map(e=>(a.unset(e,"_bid"),e)):a.map(t,e=>{const n=a.isEmpty(e._bid)?void 0:Et(s,e._bid);if(n){n._type==="Icon"&&a.get(e,"icon","").match(/chai-default-svg/)&&delete e.icon;const i={...n,...e};return a.unset(i,"_bid"),i}return a.unset(e,"_bid"),e}),Nt=t=>{const s=$.parse(Bt(t));if(a.isEmpty(t))return[];const e=a.flatten(P(s));return z.syncBlocksWithDefaultProps(e)},It=(t,s)=>t.map(e=>{const n=a.keys(e).filter(i=>a.isString(e[i])&&e[i].startsWith(k.STYLES_KEY));return a.each(n,i=>{e[i]=`${k.STYLES_KEY},${Z(e[i],s)}`}),e}),Ct=t=>{const s=a.last(t);return t.map(e=>{const n=Object.keys(e);for(let i=0;i<n.length;i++)if(a.isString(e[n[i]])&&a.startsWith(n[i],"content")){const r=e===s?"":" ";e[n[i]]=`${e[n[i]].trim()}${r}`}return e})};var j=class extends Error{constructor(t){super(t),this.name="Eta Error"}},tt=class extends j{constructor(t){super(t),this.name="EtaParser Error"}},Lt=class extends j{constructor(t){super(t),this.name="EtaRuntime Error"}},Wt=class extends j{constructor(t){super(t),this.name="EtaNameResolution Error"}};function E(t,s,e){let n=s.slice(0,e).split(/\n/),i=n.length,r=n[i-1].length+1;throw t+=" at line "+i+" col "+r+`:
2
2
 
3
3
  `+s.split(/\n/)[i-1]+`
4
4
  `+Array(r).join(" ")+"^",new tt(t)}function Dt(t,s,e,n){let i=s.split(`
@@ -1,10 +1,10 @@
1
1
  var Bt = Object.defineProperty;
2
2
  var St = (t, s, e) => s in t ? Bt(t, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[s] = e;
3
3
  var _ = (t, s, e) => St(t, typeof s != "symbol" ? s + "" : s, e);
4
- import { S as w, D as ot, C as Nt } from "./STRINGS-BExFecZW.js";
5
- import { g as Et, c as U } from "./common-functions-D2lMFR6K.js";
6
- import { memoize as It, get as y, cloneDeep as Q, forEach as W, keys as V, isString as C, startsWith as $, isArray as q, isEmpty as v, includes as E, flatten as Ct, flatMapDeep as At, set as N, find as b, startCase as Wt, camelCase as lt, has as z, filter as ct, some as Lt, capitalize as Pt, compact as Ft, map as ht, trim as Rt, unset as G, each as Dt, last as jt } from "lodash-es";
7
- import { parse as Mt, stringify as R } from "himalaya";
4
+ import { parse as Nt, stringify as R } from "himalaya";
5
+ import { memoize as Et, get as y, cloneDeep as Q, forEach as W, keys as V, isString as C, startsWith as $, isArray as q, isEmpty as v, includes as E, flatten as It, flatMapDeep as Ct, set as N, find as b, startCase as At, camelCase as ot, has as U, filter as lt, some as Wt, capitalize as Lt, compact as Pt, map as ht, trim as Ft, unset as z, each as Rt, last as Dt } from "lodash-es";
6
+ import { S as w, D as ct, C as jt } from "./STRINGS-BExFecZW.js";
7
+ import { g as Mt, c as G } from "./common-functions-D2lMFR6K.js";
8
8
  import { f as Ht, j as Ot } from "./core-nSRy3D7z.js";
9
9
  import { twMerge as Vt } from "tailwind-merge";
10
10
  const gt = (t) => {
@@ -62,10 +62,10 @@ function Ne(t, s, e) {
62
62
  }), n;
63
63
  }
64
64
  const yt = (t, s) => {
65
- const { baseClasses: e, classes: a } = gt(t), r = a.split(" ").filter((i) => i.startsWith(ot)).map((i) => {
65
+ const { baseClasses: e, classes: a } = gt(t), r = a.split(" ").filter((i) => i.startsWith(ct)).map((i) => {
66
66
  var p;
67
67
  return (p = s[i]) == null ? void 0 : p.value;
68
- }), o = a.split(" ").filter((i) => !i.startsWith(ot)).join(" ");
68
+ }), o = a.split(" ").filter((i) => !i.startsWith(ct)).join(" ");
69
69
  return Vt.apply(null, [e, ...r, o]);
70
70
  };
71
71
  function qt(t, s) {
@@ -88,7 +88,7 @@ function Ee(t, s = !0, e = {}) {
88
88
  }
89
89
  }), a;
90
90
  }
91
- const Ie = It((t) => {
91
+ const Ie = Et((t) => {
92
92
  var n;
93
93
  const s = Ht(t), e = ((n = s == null ? void 0 : s.props) == null ? void 0 : n.schema) || ((s == null ? void 0 : s.schema) ?? {}), a = y(e, "properties", {});
94
94
  return Object.fromEntries(Object.entries(a).filter(([, r]) => y(r, "runtime", !1)));
@@ -160,7 +160,7 @@ const Ie = It((t) => {
160
160
  s._type
161
161
  );
162
162
  }, X = (t) => t.map((s) => s.type === "text" ? y(s, "content", "") : v(s.children) ? "" : X(s.children || [])).join(""), O = (t) => t === null ? "" : t, mt = (t) => {
163
- const s = Ft(ht(t.split(/\s+/), Rt)), e = b(s, (i) => /^w-/.test(i)), a = b(s, (i) => /^h-/.test(i));
163
+ const s = Pt(ht(t.split(/\s+/), Ft)), e = b(s, (i) => /^w-/.test(i)), a = b(s, (i) => /^h-/.test(i));
164
164
  if (!a || !e) return { height: "", width: "" };
165
165
  const n = (i) => {
166
166
  if (!i) return;
@@ -297,25 +297,25 @@ const Ie = It((t) => {
297
297
  return {
298
298
  _type: l,
299
299
  tag: t.tagName,
300
- _name: l == "EmptyBox" || t.tagName === "div" ? l : Pt(t.tagName)
300
+ _name: l == "EmptyBox" || t.tagName === "div" ? l : Lt(t.tagName)
301
301
  };
302
302
  }
303
303
  }
304
- }, Y = (t, s = null) => At(t, (e) => {
304
+ }, Y = (t, s = null) => Ct(t, (e) => {
305
305
  var A, x, I, B, L, tt, et, st, nt, at;
306
306
  if (e.type === "comment") return [];
307
- let a = { _id: Et() };
307
+ let a = { _id: Mt() };
308
308
  if (s && (a._parent = s.block._id), e.type === "text")
309
309
  return v(y(e, "content", "")) ? [] : s && Xt(s.node, s.block) ? (N(s, "block.content", y(e, "content", "")), []) : { ...a, _type: "Text", content: y(e, "content", "") };
310
310
  if ($(e.tagName, "chai-")) {
311
- const c = e.attributes || [], u = b(c, { key: "chai-type" }), h = (u == null ? void 0 : u.value) || Wt(lt(e.tagName || "")).replace(/ /g, "").replace(/\s+/g, "");
311
+ const c = e.attributes || [], u = b(c, { key: "chai-type" }), h = (u == null ? void 0 : u.value) || At(ot(e.tagName || "")).replace(/ /g, "").replace(/\s+/g, "");
312
312
  a._type = h, W(c, ({ key: k, value: rt }) => {
313
313
  if (k === "about-this-component" || k === "chai-type" || k === "can-move" || k === "can-delete") return;
314
314
  if (k === "id") {
315
315
  a._id = rt;
316
316
  return;
317
317
  }
318
- const $t = $(k, "_") ? k : lt(k);
318
+ const $t = $(k, "_") ? k : ot(k);
319
319
  let P = O(rt);
320
320
  typeof P == "string" && $(P, "#styles:") && (P = P.replace("#styles:", "#styles:,")), a[$t] = P;
321
321
  });
@@ -341,7 +341,7 @@ const Ie = It((t) => {
341
341
  c && (a._name = c.value);
342
342
  }
343
343
  if (r || i)
344
- return a.content = `<p>${R(e.children || [])}</p>`, z(a, "styles_attrs.data-chai-richtext") && delete a.styles_attrs["data-chai-richtext"], z(a, "styles_attrs.chai-richtext") && delete a.styles_attrs["chai-richtext"], [a];
344
+ return a.content = `<p>${R(e.children || [])}</p>`, U(a, "styles_attrs.data-chai-richtext") && delete a.styles_attrs["data-chai-richtext"], U(a, "styles_attrs.chai-richtext") && delete a.styles_attrs["chai-richtext"], [a];
345
345
  if (p) {
346
346
  const c = [
347
347
  "data-chai-lightbox",
@@ -362,16 +362,16 @@ const Ie = It((t) => {
362
362
  backdropColor: ((tt = n.find((u) => u.key === "data-overlay")) == null ? void 0 : tt.value) || "",
363
363
  galleryName: ((et = n.find((u) => u.key === "data-gall")) == null ? void 0 : et.value) || ""
364
364
  }, W(c, (u) => {
365
- z(a, `styles_attrs.${u}`) && delete a.styles_attrs[u];
365
+ U(a, `styles_attrs.${u}`) && delete a.styles_attrs[u];
366
366
  });
367
367
  }
368
368
  if (l && (delete a.styles_attrs, a.showDropdown = !1), d && delete a.styles_attrs, f) {
369
369
  delete a.styles_attrs;
370
- const c = ct(e.children || [], (h) => (h == null ? void 0 : h.tagName) !== "span");
370
+ const c = lt(e.children || [], (h) => (h == null ? void 0 : h.tagName) !== "span");
371
371
  a.content = X(c);
372
372
  const u = b(
373
373
  e.children || [],
374
- (h) => (h == null ? void 0 : h.tagName) === "span" && Lt(h.children || [], (m) => (m == null ? void 0 : m.tagName) === "svg")
374
+ (h) => (h == null ? void 0 : h.tagName) === "span" && Wt(h.children || [], (m) => (m == null ? void 0 : m.tagName) === "svg")
375
375
  );
376
376
  if (u) {
377
377
  const h = b(u.children || [], (m) => (m == null ? void 0 : m.tagName) === "svg");
@@ -392,12 +392,12 @@ const Ie = It((t) => {
392
392
  } else if (e.tagName === "svg") {
393
393
  const c = y(b(e.attributes, { key: "class" }), "value", ""), { height: u, width: h } = mt(c);
394
394
  if (u && h)
395
- a.styles = `${w}, ${U(`w-${h} h-${u}`, c)}`.trim(), a.height = u == null ? void 0 : u.replace("px", ""), a.width = h == null ? void 0 : h.replace("px", "");
395
+ a.styles = `${w}, ${G(`w-${h} h-${u}`, c)}`.trim(), a.height = u == null ? void 0 : u.replace("px", ""), a.width = h == null ? void 0 : h.replace("px", "");
396
396
  else {
397
397
  const m = (st = b(e.attributes, { key: "height" })) == null ? void 0 : st.value, k = (nt = b(e.attributes, { key: "width" })) == null ? void 0 : nt.value;
398
- m && k ? (a.styles = `${w}, ${U(`w-[${k}px] h-[${m}px]`, c)}`.trim(), a.height = m, a.width = k) : a.styles = `${w}, ${U("w-full h-full", c)}`.trim();
398
+ m && k ? (a.styles = `${w}, ${G(`w-[${k}px] h-[${m}px]`, c)}`.trim(), a.height = m, a.width = k) : a.styles = `${w}, ${G("w-full h-full", c)}`.trim();
399
399
  }
400
- return e.attributes = ct(e.attributes, (m) => !E(["style", "width", "height", "class"], m.key)), a.icon = R([e]), [a];
400
+ return e.attributes = lt(e.attributes, (m) => !E(["style", "width", "height", "class"], m.key)), a.icon = R([e]), [a];
401
401
  } else if (e.tagName == "option" && s && ((at = s.block) == null ? void 0 : at._type) === "Select")
402
402
  return s.block.options.push({
403
403
  label: X(e.children || []),
@@ -427,22 +427,22 @@ const Ie = It((t) => {
427
427
  }), t = t.replace(/\\n/g, " ").replace(/\\\\/g, "").replace(/\\([/<>])/g, "$1").replace(/\\./g, "").replace(/[\n\r\t\f\v]/g, " "), t = t.replace(/\$name="[^"]*"/g, "");
428
428
  const s = t.match(/<body[^>]*>[\s\S]*?<\/body>/);
429
429
  return (s && s.length > 0 ? s[0].replace(/<body/, "<div").replace(/<\/body>/, "</div>") : t).replace(/\s+/g, " ").replaceAll("> <", "><").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "").trim();
430
- }, Kt = (t, s) => b(t, { _id: s }), We = (t, s) => v(s) ? t.map((e) => (G(e, "_bid"), e)) : ht(t, (e) => {
430
+ }, Kt = (t, s) => b(t, { _id: s }), We = (t, s) => v(s) ? t.map((e) => (z(e, "_bid"), e)) : ht(t, (e) => {
431
431
  const a = v(e._bid) ? void 0 : Kt(s, e._bid);
432
432
  if (a) {
433
433
  a._type === "Icon" && y(e, "icon", "").match(/chai-default-svg/) && delete e.icon;
434
434
  const n = { ...a, ...e };
435
- return G(n, "_bid"), n;
435
+ return z(n, "_bid"), n;
436
436
  }
437
- return G(e, "_bid"), e;
437
+ return z(e, "_bid"), e;
438
438
  }), Le = (t) => {
439
- const s = Mt(Qt(t));
439
+ const s = Nt(Qt(t));
440
440
  if (v(t)) return [];
441
- const e = Ct(Y(s));
441
+ const e = It(Y(s));
442
442
  return Ot(e);
443
443
  }, T = (t, s) => t.map((e) => {
444
444
  const a = V(e).filter((n) => C(e[n]) && e[n].startsWith(w));
445
- return Dt(a, (n) => {
445
+ return Rt(a, (n) => {
446
446
  e[n] = `${w},${yt(e[n], s)}`;
447
447
  }), e;
448
448
  });
@@ -565,7 +565,7 @@ import.meta.vitest && describe("applyDesignTokens", () => {
565
565
  });
566
566
  });
567
567
  const S = (t) => {
568
- const s = jt(t);
568
+ const s = Dt(t);
569
569
  return t.map((e) => {
570
570
  const a = Object.keys(e);
571
571
  for (let n = 0; n < a.length; n++)
@@ -924,7 +924,7 @@ const Z = /\{\{(.*?)\}\}/g, vt = /^[\w$][\w$.]*$/, me = new fe({
924
924
  return t;
925
925
  }, Fe = (t, s, { index: e, key: a }) => {
926
926
  let n = Q(t);
927
- return n.repeaterItems && (n.$repeaterItemsKey = n.repeaterItems, $(n.repeaterItems, `{{${Nt}`) && (n.$repeaterItemsKey = n.repeaterItems = `${n.repeaterItems.replace("}}", `/${n._id}}}`)}`), !v(n.repeaterItems) && n.pagination && (n.repeaterTotalItems = `${n.repeaterItems.replace("}}", `/${n._id}/totalItems}}`)}`)), J(n, s, { index: e, key: a });
927
+ return n.repeaterItems && (n.$repeaterItemsKey = n.repeaterItems, $(n.repeaterItems, `{{${jt}`) && (n.$repeaterItemsKey = n.repeaterItems = `${n.repeaterItems.replace("}}", `/${n._id}}}`)}`), !v(n.repeaterItems) && n.pagination && (n.repeaterTotalItems = `${n.repeaterItems.replace("}}", `/${n._id}/totalItems}}`)}`)), J(n, s, { index: e, key: a });
928
928
  };
929
929
  export {
930
930
  Fe as a,
@@ -1,6 +1,6 @@
1
- import { flatten as $, keys as b, uniqBy as s, get as v } from "lodash-es";
2
- import { a as B } from "./fonts-B3UYxuJI.js";
3
- import { g as _ } from "./_commonjsHelpers-C6fGbg64.js";
1
+ import { g as $ } from "./_commonjsHelpers-C6fGbg64.js";
2
+ import { uniqBy as s, get as b, flatten as v, keys as B } from "lodash-es";
3
+ import { a as _ } from "./fonts-B3UYxuJI.js";
4
4
  const x = {
5
5
  fontFamily: {
6
6
  "font-heading": "Arial",
@@ -100,8 +100,67 @@ const x = {
100
100
  popover: ["#FFFFFF", "#09090B"],
101
101
  "popover-foreground": ["#09090B", "#FFFFFF"]
102
102
  }
103
- }, O = (e) => ({
104
- fontFamily: e.fontFamily ? b(e.fontFamily).reduce(
103
+ };
104
+ var d = {}, c = {}, m;
105
+ function E() {
106
+ return m || (m = 1, (function(e) {
107
+ Object.defineProperty(e, "__esModule", {
108
+ value: !0
109
+ }), Object.defineProperty(e, "default", {
110
+ enumerable: !0,
111
+ get: function() {
112
+ return r;
113
+ }
114
+ });
115
+ function F(t, n) {
116
+ return {
117
+ handler: t,
118
+ config: n
119
+ };
120
+ }
121
+ F.withOptions = function(t, n = () => ({})) {
122
+ const o = function(a) {
123
+ return {
124
+ __options: a,
125
+ handler: t(a),
126
+ config: n(a)
127
+ };
128
+ };
129
+ return o.__isOptionsFunction = !0, o.__pluginFunction = t, o.__configFunction = n, o;
130
+ };
131
+ const r = F;
132
+ })(c)), c;
133
+ }
134
+ var p;
135
+ function A() {
136
+ return p || (p = 1, (function(e) {
137
+ Object.defineProperty(e, "__esModule", {
138
+ value: !0
139
+ }), Object.defineProperty(e, "default", {
140
+ enumerable: !0,
141
+ get: function() {
142
+ return t;
143
+ }
144
+ });
145
+ const F = /* @__PURE__ */ r(E());
146
+ function r(n) {
147
+ return n && n.__esModule ? n : {
148
+ default: n
149
+ };
150
+ }
151
+ const t = F.default;
152
+ })(d)), d;
153
+ }
154
+ var f, y;
155
+ function P() {
156
+ if (y) return f;
157
+ y = 1;
158
+ let e = A();
159
+ return f = (e.__esModule ? e : { default: e }).default, f;
160
+ }
161
+ var j = P();
162
+ const O = /* @__PURE__ */ $(j), S = (e) => ({
163
+ fontFamily: e.fontFamily ? B(e.fontFamily).reduce(
105
164
  (r, t) => ({
106
165
  ...r,
107
166
  [t.replace("font-", "")]: `var(--${t})`
@@ -113,12 +172,12 @@ const x = {
113
172
  md: "calc(var(--radius) - 2px)",
114
173
  sm: "calc(var(--radius) - 4px)"
115
174
  } : {},
116
- colors: e.colors ? $(e.colors.map((r) => Object.entries(r.items))).reduce(
175
+ colors: e.colors ? v(e.colors.map((r) => Object.entries(r.items))).reduce(
117
176
  (r, [t]) => ({ ...r, [t]: `hsl(var(--${t}))` }),
118
177
  {}
119
178
  ) : {}
120
179
  });
121
- function m(e) {
180
+ function h(e) {
122
181
  const F = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);
123
182
  let r = parseInt(F[1], 16), t = parseInt(F[2], 16), n = parseInt(F[3], 16);
124
183
  r /= 255, t /= 255, n /= 255;
@@ -144,25 +203,25 @@ function m(e) {
144
203
  }
145
204
  return `${Math.round(u * 360)} ${Math.round(l * 100)}% ${Math.round(g * 100)}%`;
146
205
  }
147
- const E = (e) => {
148
- const r = B().find((t) => t.family === e);
149
- return `"${e}", ${v(r, "fallback", "")}`;
150
- }, S = ({ theme: e }) => {
206
+ const C = (e) => {
207
+ const r = _().find((t) => t.family === e);
208
+ return `"${e}", ${b(r, "fallback", "")}`;
209
+ }, T = ({ theme: e }) => {
151
210
  const F = e;
152
211
  return `:root {
153
- ${e.fontFamily ? Object.entries(e.fontFamily).map(([r, t]) => `--font-${r}: ${E(t)};`).join(`
212
+ ${e.fontFamily ? Object.entries(e.fontFamily).map(([r, t]) => `--font-${r}: ${C(t)};`).join(`
154
213
  `) : ""}
155
214
  ${F.borderRadius ? `--radius: ${F.borderRadius};` : ""}
156
- ${F.colors ? Object.entries(F.colors).map(([r, t]) => `--${r}: ${m(t[0])};`).join(`
215
+ ${F.colors ? Object.entries(F.colors).map(([r, t]) => `--${r}: ${h(t[0])};`).join(`
157
216
  `) : ""}
158
217
  }
159
218
  .dark {
160
- ${F.colors ? Object.entries(F.colors).map(([r, t]) => `--${r}: ${m(t[1])};`).join(`
219
+ ${F.colors ? Object.entries(F.colors).map(([r, t]) => `--${r}: ${h(t[1])};`).join(`
161
220
  `) : ""}
162
221
  }`;
163
- }, T = (e) => !e || e.length === 0 ? "" : s(e, "family").map((F) => `<link rel="stylesheet" href="${F.url}" />`).join(`
164
- `), D = (e) => !e || e.length === 0 ? [] : s(e, "family").map((F) => F.url), I = (e) => !e || e.length === 0 ? "" : s(e, "family").map((F) => `@import url("${F.url}");`).join(`
165
- `), w = (e) => !e || e.length === 0 ? "" : s(e, "family").map(
222
+ }, D = (e) => !e || e.length === 0 ? "" : s(e, "family").map((F) => `<link rel="stylesheet" href="${F.url}" />`).join(`
223
+ `), I = (e) => !e || e.length === 0 ? [] : s(e, "family").map((F) => F.url), w = (e) => !e || e.length === 0 ? "" : s(e, "family").map((F) => `@import url("${F.url}");`).join(`
224
+ `), L = (e) => !e || e.length === 0 ? "" : s(e, "family").map(
166
225
  (F) => F.src.map(
167
226
  (r) => `@font-face {
168
227
  font-family: "${F.family}";
@@ -176,73 +235,14 @@ const E = (e) => {
176
235
  `)
177
236
  ).join(`
178
237
  `);
179
- var d = {}, c = {}, p;
180
- function A() {
181
- return p || (p = 1, (function(e) {
182
- Object.defineProperty(e, "__esModule", {
183
- value: !0
184
- }), Object.defineProperty(e, "default", {
185
- enumerable: !0,
186
- get: function() {
187
- return r;
188
- }
189
- });
190
- function F(t, n) {
191
- return {
192
- handler: t,
193
- config: n
194
- };
195
- }
196
- F.withOptions = function(t, n = () => ({})) {
197
- const o = function(a) {
198
- return {
199
- __options: a,
200
- handler: t(a),
201
- config: n(a)
202
- };
203
- };
204
- return o.__isOptionsFunction = !0, o.__pluginFunction = t, o.__configFunction = n, o;
205
- };
206
- const r = F;
207
- })(c)), c;
208
- }
209
- var y;
210
- function P() {
211
- return y || (y = 1, (function(e) {
212
- Object.defineProperty(e, "__esModule", {
213
- value: !0
214
- }), Object.defineProperty(e, "default", {
215
- enumerable: !0,
216
- get: function() {
217
- return t;
218
- }
219
- });
220
- const F = /* @__PURE__ */ r(A());
221
- function r(n) {
222
- return n && n.__esModule ? n : {
223
- default: n
224
- };
225
- }
226
- const t = F.default;
227
- })(d)), d;
228
- }
229
- var f, h;
230
- function j() {
231
- if (h) return f;
232
- h = 1;
233
- let e = P();
234
- return f = (e.__esModule ? e : { default: e }).default, f;
235
- }
236
- var C = j();
237
- const L = /* @__PURE__ */ _(C);
238
238
  export {
239
- D as a,
239
+ T as a,
240
240
  w as b,
241
- S as c,
241
+ D as c,
242
242
  x as d,
243
- I as e,
244
- T as f,
245
- O as g,
246
- q as h,
247
- L as p
243
+ q as e,
244
+ I as f,
245
+ S as g,
246
+ L as h,
247
+ O as p
248
248
  };
@@ -0,0 +1,22 @@
1
+ "use strict";const $=require("./_commonjsHelpers-DwGv2jUC.cjs"),a=require("lodash-es"),b=require("./fonts-D5fTqvSS.cjs"),B={fontFamily:{"font-heading":"Arial","font-body":"Arial"},borderRadius:"10px",colors:[{group:"Body",items:{background:["#FFFFFF","#121212"],foreground:["#121212","#FFFFFF"]}},{group:"Primary",items:{primary:["#2563EB","#3B82F6"],"primary-foreground":["#FFFFFF","#FFFFFF"]}},{group:"Secondary",items:{secondary:["#F3F4F6","#374151"],"secondary-foreground":["#1F2937","#F9FAFB"]}},{group:"Border, Input & Ring",items:{border:["#E5E7EB","#374151"],input:["#E5E7EB","#374151"],ring:["#2563EB","#3B82F6"]}},{group:"Card",items:{card:["#FFFFFF","#1F2937"],"card-foreground":["#121212","#FFFFFF"]}},{group:"Popover",items:{popover:["#FFFFFF","#1F2937"],"popover-foreground":["#121212","#FFFFFF"]}},{group:"Muted",items:{muted:["#F3F4F6","#374151"],"muted-foreground":["#6B7280","#9CA3AF"]}},{group:"Accent",items:{accent:["#F3F4F6","#374151"],"accent-foreground":["#1F2937","#FFFFFF"]}},{group:"Destructive",items:{destructive:["#DC2626","#EF4444"],"destructive-foreground":["#FFFFFF","#FFFFFF"]}}]},v={fontFamily:{heading:"Arial",body:"Arial"},borderRadius:"6px",colors:{background:["#FFFFFF","#09090B"],foreground:["#09090B","#FFFFFF"],primary:["#2563EB","#3B82F6"],"primary-foreground":["#FFFFFF","#FFFFFF"],secondary:["#F4F4F5","#27272A"],"secondary-foreground":["#09090B","#FFFFFF"],muted:["#F4F4F5","#27272A"],"muted-foreground":["#71717A","#A1A1AA"],accent:["#F4F4F5","#27272A"],"accent-foreground":["#09090B","#FFFFFF"],destructive:["#EF4444","#7F1D1D"],"destructive-foreground":["#FFFFFF","#FFFFFF"],border:["#E4E4E7","#27272A"],input:["#E4E4E7","#27272A"],ring:["#2563EB","#3B82F6"],card:["#FFFFFF","#09090B"],"card-foreground":["#09090B","#FFFFFF"],popover:["#FFFFFF","#09090B"],"popover-foreground":["#09090B","#FFFFFF"]}};var d={},c={},m;function _(){return m||(m=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return r}});function n(t,F){return{handler:t,config:F}}n.withOptions=function(t,F=()=>({})){const o=function(u){return{__options:u,handler:t(u),config:F(u)}};return o.__isOptionsFunction=!0,o.__pluginFunction=t,o.__configFunction=F,o};const r=n})(c)),c}var p;function E(){return p||(p=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});const n=r(_());function r(F){return F&&F.__esModule?F:{default:F}}const t=n.default})(d)),d}var f,h;function A(){if(h)return f;h=1;let e=E();return f=(e.__esModule?e:{default:e}).default,f}var C=A();const P=$.getDefaultExportFromCjs(C),j=e=>({fontFamily:e.fontFamily?a.keys(e.fontFamily).reduce((r,t)=>({...r,[t.replace("font-","")]:`var(--${t})`}),{}):{},borderRadius:e.borderRadius?{lg:"var(--radius)",md:"calc(var(--radius) - 2px)",sm:"calc(var(--radius) - 4px)"}:{},colors:e.colors?a.flatten(e.colors.map(r=>Object.entries(r.items))).reduce((r,[t])=>({...r,[t]:`hsl(var(--${t}))`}),{}):{}});function y(e){const n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);let r=parseInt(n[1],16),t=parseInt(n[2],16),F=parseInt(n[3],16);r/=255,t/=255,F/=255;const o=Math.max(r,t,F),u=Math.min(r,t,F);let i=0,l=0;const g=(o+u)/2;if(o==u)i=l=0;else{const s=o-u;switch(l=g>.5?s/(2-o-u):s/(o+u),o){case r:i=(t-F)/s+(t<F?6:0);break;case t:i=(F-r)/s+2;break;case F:i=(r-t)/s+4;break}i/=6}return`${Math.round(i*360)} ${Math.round(l*100)}% ${Math.round(g*100)}%`}const q=e=>{const r=b.getAllRegisteredFonts().find(t=>t.family===e);return`"${e}", ${a.get(r,"fallback","")}`},T=({theme:e})=>{const n=e;return`:root {
2
+ ${e.fontFamily?Object.entries(e.fontFamily).map(([r,t])=>`--font-${r}: ${q(t)};`).join(`
3
+ `):""}
4
+ ${n.borderRadius?`--radius: ${n.borderRadius};`:""}
5
+ ${n.colors?Object.entries(n.colors).map(([r,t])=>`--${r}: ${y(t[0])};`).join(`
6
+ `):""}
7
+ }
8
+ .dark {
9
+ ${n.colors?Object.entries(n.colors).map(([r,t])=>`--${r}: ${y(t[1])};`).join(`
10
+ `):""}
11
+ }`},M=e=>!e||e.length===0?"":a.uniqBy(e,"family").map(n=>`<link rel="stylesheet" href="${n.url}" />`).join(`
12
+ `),k=e=>!e||e.length===0?[]:a.uniqBy(e,"family").map(n=>n.url),R=e=>!e||e.length===0?"":a.uniqBy(e,"family").map(n=>`@import url("${n.url}");`).join(`
13
+ `),O=e=>!e||e.length===0?"":a.uniqBy(e,"family").map(n=>n.src.map(r=>`@font-face {
14
+ font-family: "${n.family}";
15
+ src: url("${r.url}") format("${r.format}");
16
+ font-display: swap;
17
+ ${r.fontWeight?`font-weight: ${r.fontWeight};`:""}
18
+ ${r.fontStyle?`font-style: ${r.fontStyle};`:""}
19
+ ${r.fontStretch?`font-stretch: ${r.fontStretch};`:""}
20
+ }`).join(`
21
+ `)).join(`
22
+ `);exports.defaultThemeOptions=B;exports.defaultThemeValues=v;exports.getChaiThemeCssVariables=T;exports.getChaiThemeOptions=j;exports.getThemeCustomFontFace=O;exports.getThemeFontsCSSImport=R;exports.getThemeFontsLinkMarkup=M;exports.getThemeFontsUrls=k;exports.plugin=P;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),l=require("./register-chai-top-bar-DyW9GPzV.cjs"),n=require("./index-DCJDQs1a.cjs"),u=require("./index-BVwFJWDq.cjs"),A=require("@tanstack/react-query"),F=require("lucide-react"),d=require("react"),k=require("react-i18next"),m=require("zod"),E=()=>{const r=u.useApiUrl(),o=u.useFetch();return A.useMutation({mutationKey:[u.ACTIONS.CHANGE_PASSWORD],mutationFn:async e=>{const t=await o(r,{action:u.ACTIONS.CHANGE_PASSWORD,data:e});return t==null?void 0:t.data}})},L=r=>m.z.object({oldPassword:m.z.string().min(1,r("Current password is required")),newPassword:m.z.string().min(8,r("Password must be at least 8 characters")).max(128,r("Password must be less than 128 characters")).regex(/[A-Z]/,r("Password must contain at least one uppercase letter")).regex(/[a-z]/,r("Password must contain at least one lowercase letter")).regex(/[0-9]/,r("Password must contain at least one number")).regex(/[!@#$%^&*(),.?":{}|<>]/,r("Password must contain at least one special character")),confirmPassword:m.z.string().min(1,r("Confirm password is required"))}).refine(o=>o.newPassword===o.confirmPassword,{message:r("New password and confirm password do not match"),path:["confirmPassword"]}).refine(o=>o.oldPassword!==o.newPassword,{message:r("New password must be different from current password"),path:["newPassword"]}),T=({open:r,onOpenChange:o})=>{const{t:e}=k.useTranslation(),t=u.usePagesProp("currentUser",null),{mutate:q,isPending:h,isSuccess:p,reset:P}=E(),[x,f]=d.useState(""),[j,C]=d.useState(""),[N,v]=d.useState(""),[b,i]=d.useState(null),S=d.useCallback(()=>{f(""),C(""),v(""),i(null),P()},[P]),w=d.useCallback(a=>{o(a),a||S()},[o,S]);d.useEffect(()=>{if(p){const a=setTimeout(()=>{w(!1)},2e3);return()=>clearTimeout(a)}},[p,w]);const D=()=>{var y;i(null);const a={oldPassword:x.trim(),newPassword:j.trim(),confirmPassword:N.trim()},c=L(e).safeParse(a);if(!c.success){i(((y=c.error.issues[0])==null?void 0:y.message)||e("Validation failed"));return}if(!(t!=null&&t.email)){i(e("User email not found"));return}q({email:t.email,oldPassword:c.data.oldPassword,newPassword:c.data.newPassword,confirmPassword:c.data.confirmPassword},{onError:g=>{i((g==null?void 0:g.message)||e("Failed to change password"))}})};return s.jsx(n.Dialog,{open:r,onOpenChange:w,children:s.jsx(n.DialogContent,{className:"sm:max-w-[425px]",children:h?s.jsx("div",{className:"flex h-[340px] items-center justify-center",children:s.jsx(F.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):p?s.jsxs("div",{className:"flex h-[340px] flex-col items-center justify-center gap-2",children:[s.jsx("div",{className:"rounded-full bg-green-100 p-3",children:s.jsx("svg",{className:"h-6 w-6 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),s.jsx("p",{className:"text-lg font-medium",children:e("Password updated successfully")})]}):s.jsxs(s.Fragment,{children:[s.jsxs(n.DialogHeader,{children:[s.jsx(n.DialogTitle,{children:e("Change Password")}),s.jsx(n.DialogDescription,{children:e("Enter your current password and a new password.")})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(n.Label,{htmlFor:"old-password",children:e("Current Password")}),s.jsx(l.Input,{id:"old-password",type:"password",value:x,onChange:a=>f(a.target.value),placeholder:e("Enter current password")})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(n.Label,{htmlFor:"new-password",children:e("New Password")}),s.jsx(l.Input,{id:"new-password",type:"password",value:j,onChange:a=>C(a.target.value),placeholder:e("Enter new password")})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(n.Label,{htmlFor:"confirm-password",children:e("Confirm Password")}),s.jsx(l.Input,{id:"confirm-password",type:"password",value:N,onChange:a=>v(a.target.value),placeholder:e("Confirm new password")})]}),b&&s.jsx("p",{className:"text-sm text-destructive",children:b})]}),s.jsxs(n.DialogFooter,{children:[s.jsx(l.Button,{variant:"outline",onClick:()=>w(!1),disabled:h,children:e("Cancel")}),s.jsx(l.Button,{onClick:D,disabled:h,children:e("Change Password")})]})]})})})};exports.ChangePasswordModal=T;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),A=require("lucide-react"),d=require("react"),F=require("react-i18next"),m=require("zod"),l=require("./register-chai-top-bar-CCssW5dL.cjs"),n=require("./index-D-r_K4yA.cjs"),u=require("./index-BYrRPW_c.cjs"),k=require("@tanstack/react-query"),E=()=>{const r=u.useApiUrl(),o=u.useFetch();return k.useMutation({mutationKey:[u.ACTIONS.CHANGE_PASSWORD],mutationFn:async e=>{const t=await o(r,{action:u.ACTIONS.CHANGE_PASSWORD,data:e});return t==null?void 0:t.data}})},L=r=>m.z.object({oldPassword:m.z.string().min(1,r("Current password is required")),newPassword:m.z.string().min(8,r("Password must be at least 8 characters")).max(128,r("Password must be less than 128 characters")).regex(/[A-Z]/,r("Password must contain at least one uppercase letter")).regex(/[a-z]/,r("Password must contain at least one lowercase letter")).regex(/[0-9]/,r("Password must contain at least one number")).regex(/[!@#$%^&*(),.?":{}|<>]/,r("Password must contain at least one special character")),confirmPassword:m.z.string().min(1,r("Confirm password is required"))}).refine(o=>o.newPassword===o.confirmPassword,{message:r("New password and confirm password do not match"),path:["confirmPassword"]}).refine(o=>o.oldPassword!==o.newPassword,{message:r("New password must be different from current password"),path:["newPassword"]}),T=({open:r,onOpenChange:o})=>{const{t:e}=F.useTranslation(),t=u.usePagesProp("currentUser",null),{mutate:q,isPending:h,isSuccess:p,reset:P}=E(),[x,f]=d.useState(""),[j,C]=d.useState(""),[N,v]=d.useState(""),[b,i]=d.useState(null),S=d.useCallback(()=>{f(""),C(""),v(""),i(null),P()},[P]),w=d.useCallback(a=>{o(a),a||S()},[o,S]);d.useEffect(()=>{if(p){const a=setTimeout(()=>{w(!1)},2e3);return()=>clearTimeout(a)}},[p,w]);const D=()=>{var y;i(null);const a={oldPassword:x.trim(),newPassword:j.trim(),confirmPassword:N.trim()},c=L(e).safeParse(a);if(!c.success){i(((y=c.error.issues[0])==null?void 0:y.message)||e("Validation failed"));return}if(!(t!=null&&t.email)){i(e("User email not found"));return}q({email:t.email,oldPassword:c.data.oldPassword,newPassword:c.data.newPassword,confirmPassword:c.data.confirmPassword},{onError:g=>{i((g==null?void 0:g.message)||e("Failed to change password"))}})};return s.jsx(n.Dialog,{open:r,onOpenChange:w,children:s.jsx(n.DialogContent,{className:"sm:max-w-[425px]",children:h?s.jsx("div",{className:"flex h-[340px] items-center justify-center",children:s.jsx(A.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):p?s.jsxs("div",{className:"flex h-[340px] flex-col items-center justify-center gap-2",children:[s.jsx("div",{className:"rounded-full bg-green-100 p-3",children:s.jsx("svg",{className:"h-6 w-6 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),s.jsx("p",{className:"text-lg font-medium",children:e("Password updated successfully")})]}):s.jsxs(s.Fragment,{children:[s.jsxs(n.DialogHeader,{children:[s.jsx(n.DialogTitle,{children:e("Change Password")}),s.jsx(n.DialogDescription,{children:e("Enter your current password and a new password.")})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(n.Label,{htmlFor:"old-password",children:e("Current Password")}),s.jsx(l.Input,{id:"old-password",type:"password",value:x,onChange:a=>f(a.target.value),placeholder:e("Enter current password")})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(n.Label,{htmlFor:"new-password",children:e("New Password")}),s.jsx(l.Input,{id:"new-password",type:"password",value:j,onChange:a=>C(a.target.value),placeholder:e("Enter new password")})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(n.Label,{htmlFor:"confirm-password",children:e("Confirm Password")}),s.jsx(l.Input,{id:"confirm-password",type:"password",value:N,onChange:a=>v(a.target.value),placeholder:e("Confirm new password")})]}),b&&s.jsx("p",{className:"text-sm text-destructive",children:b})]}),s.jsxs(n.DialogFooter,{children:[s.jsx(l.Button,{variant:"outline",onClick:()=>w(!1),disabled:h,children:e("Cancel")}),s.jsx(l.Button,{onClick:D,disabled:h,children:e("Change Password")})]})]})})})};exports.ChangePasswordModal=T;