@templatical/editor 0.0.5 → 0.1.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 (169) hide show
  1. package/LICENSE +56 -0
  2. package/README.md +69 -0
  3. package/dist/{AiChatSidebar-DwME3f-a.js → AiChatSidebar-DSbBLDkW.js} +9 -9
  4. package/dist/{AiFeatureMenu-DJvWL1GZ.js → AiFeatureMenu-d04gmgud.js} +5 -5
  5. package/dist/{CloudEditor-Fe0ssRgi.js → CloudEditor-CjO4tzbV.js} +218 -227
  6. package/dist/{CollaboratorBar-DTT0EkZn.js → CollaboratorBar-DYBSTuMW.js} +3 -3
  7. package/dist/{CommentsSidebar-DrJhQRXK.js → CommentsSidebar-CQvUh5xt.js} +9 -9
  8. package/dist/CountdownBlock-D3olfssJ.js +92 -0
  9. package/dist/CountdownToolbar-ClpBwFoX.js +210 -0
  10. package/dist/{DesignReferenceSidebar-DdOht5zn.js → DesignReferenceSidebar-BOfeETis.js} +5 -5
  11. package/dist/{LoadingTrack-vK8W2PJf.js → LoadingTrack-CdqDYVR-.js} +1 -1
  12. package/dist/{ModuleBrowserModal-CiV_jOEM.js → ModuleBrowserModal-DKSSQonv.js} +7 -7
  13. package/dist/{ModulePreviewCanvas-Bmy6Y1WE.js → ModulePreviewCanvas-CoLNuu1o.js} +32 -32
  14. package/dist/NumberWithSuffix-_0l3Q4jq.js +424 -0
  15. package/dist/{ParagraphEditor-CoQ3NlS7.js → ParagraphEditor-C9R2ou7x.js} +57 -56
  16. package/dist/{RichTextEditorContent-CHJlh7HJ.js → RichTextEditorContent-BcY3Rcp4.js} +2 -2
  17. package/dist/{SaveModuleDialog-CD2ZYq1o.js → SaveModuleDialog-DmFe4VUc.js} +3 -3
  18. package/dist/{SnapshotHistory-DltsKvhP.js → SnapshotHistory-CAhikAOr.js} +7 -7
  19. package/dist/{TemplateScoringPanel-DmnmUE3y.js → TemplateScoringPanel-b5DnyIll.js} +10 -10
  20. package/dist/{TestEmailModal-Dl633j9o.js → TestEmailModal-BmDIzGYz.js} +3 -3
  21. package/dist/{TitleEditor-C7fds2Nc.js → TitleEditor-DtRYx-LS.js} +11 -11
  22. package/dist/{TplModal-C5_CF-qn.js → TplModal-BLbMDMd6.js} +4 -4
  23. package/dist/{_plugin-vue_export-helper-B1-bu7yR.js → _plugin-vue_export-helper-BHUPLLh1.js} +2 -2
  24. package/dist/{blockTypeIcons-BrKZB10B.js → blockTypeIcons-CEU2dMe1.js} +2 -2
  25. package/dist/cdn/chunks/{AiFeatureMenu-C5UQmEgV.js → AiFeatureMenu-DWMSYD2J.js} +4 -4
  26. package/dist/cdn/chunks/{AiFeatureMenu-C5UQmEgV.js.map → AiFeatureMenu-DWMSYD2J.js.map} +1 -1
  27. package/dist/cdn/chunks/{CloudEditor-DeTolKnf.js → CloudEditor-HrfSfr3G.js} +179 -188
  28. package/dist/cdn/chunks/CloudEditor-HrfSfr3G.js.map +1 -0
  29. package/dist/cdn/chunks/{CollaboratorBar-DO1nxSrr.js → CollaboratorBar-Cfok52TZ.js} +4 -4
  30. package/dist/cdn/chunks/{CollaboratorBar-DO1nxSrr.js.map → CollaboratorBar-Cfok52TZ.js.map} +1 -1
  31. package/dist/cdn/chunks/CountdownBlock-CkV21NEM.js +93 -0
  32. package/dist/cdn/chunks/CountdownBlock-CkV21NEM.js.map +1 -0
  33. package/dist/cdn/chunks/CountdownToolbar-CEmbR7kt.js +212 -0
  34. package/dist/cdn/chunks/CountdownToolbar-CEmbR7kt.js.map +1 -0
  35. package/dist/cdn/chunks/{ModuleBrowserModal-ChBr3aXj.js → ModuleBrowserModal-sASaPRot.js} +7 -7
  36. package/dist/cdn/chunks/{ModuleBrowserModal-ChBr3aXj.js.map → ModuleBrowserModal-sASaPRot.js.map} +1 -1
  37. package/dist/cdn/chunks/{ModulePreviewCanvas-DkSvri9H.js → ModulePreviewCanvas-D8zsajMf.js} +19 -19
  38. package/dist/cdn/chunks/{ModulePreviewCanvas-DkSvri9H.js.map → ModulePreviewCanvas-D8zsajMf.js.map} +1 -1
  39. package/dist/cdn/chunks/NumberWithSuffix-k5Te7Tuw.js +425 -0
  40. package/dist/cdn/chunks/NumberWithSuffix-k5Te7Tuw.js.map +1 -0
  41. package/dist/cdn/chunks/{ParagraphEditor-DU3oUKA7.js → ParagraphEditor-C1vQWGzW.js} +37 -37
  42. package/dist/cdn/chunks/ParagraphEditor-C1vQWGzW.js.map +1 -0
  43. package/dist/cdn/chunks/{RichTextEditorContent-BrsW1p9s.js → RichTextEditorContent-CT8dBB0R.js} +5 -5
  44. package/dist/cdn/chunks/{RichTextEditorContent-BrsW1p9s.js.map → RichTextEditorContent-CT8dBB0R.js.map} +1 -1
  45. package/dist/cdn/chunks/{SaveModuleDialog-CjqKkTEc.js → SaveModuleDialog-BkwKrB0N.js} +5 -5
  46. package/dist/cdn/chunks/{SaveModuleDialog-CjqKkTEc.js.map → SaveModuleDialog-BkwKrB0N.js.map} +1 -1
  47. package/dist/cdn/chunks/{TitleEditor-C8FYbadT.js → TitleEditor-BXqt42Px.js} +11 -11
  48. package/dist/cdn/chunks/{TitleEditor-C8FYbadT.js.map → TitleEditor-BXqt42Px.js.map} +1 -1
  49. package/dist/cdn/chunks/{blockTypeIcons-5QwYklNq.js → blockTypeIcons-BS6pWyGO.js} +3 -3
  50. package/dist/cdn/chunks/{blockTypeIcons-5QwYklNq.js.map → blockTypeIcons-BS6pWyGO.js.map} +1 -1
  51. package/dist/cdn/chunks/{de-BvYD17KT.js → de-3exf7MYE.js} +1 -1
  52. package/dist/cdn/chunks/{de-BvYD17KT.js.map → de-3exf7MYE.js.map} +1 -1
  53. package/dist/cdn/chunks/{de-BB3dgVOc.js → de-C8LxVUsb.js} +1 -1
  54. package/dist/cdn/chunks/de-C8LxVUsb.js.map +1 -0
  55. package/dist/cdn/chunks/{dist-KYv9v_1z2.js → dist-BpOx-ugr.js} +10 -3
  56. package/dist/cdn/chunks/dist-BpOx-ugr.js.map +1 -0
  57. package/dist/cdn/chunks/{draggable-BQNU47zu.js → draggable-Bcb86AsV.js} +1591 -1563
  58. package/dist/cdn/chunks/draggable-Bcb86AsV.js.map +1 -0
  59. package/dist/cdn/chunks/{emojiData-BVEJHcNH.js → emojiData-DUHzsh4j.js} +1 -1
  60. package/dist/cdn/chunks/{emojiData-BVEJHcNH.js.map → emojiData-DUHzsh4j.js.map} +1 -1
  61. package/dist/cdn/chunks/{en-DeDcpnoS.js → en-BoEycuqw.js} +1 -1
  62. package/dist/cdn/chunks/en-BoEycuqw.js.map +1 -0
  63. package/dist/cdn/chunks/{en-CpotcOPr.js → en-KNPUKxYp.js} +1 -1
  64. package/dist/cdn/chunks/{en-CpotcOPr.js.map → en-KNPUKxYp.js.map} +1 -1
  65. package/dist/cdn/chunks/{extensions-Bj7USRLr.js → extensions-DBxH6pz0.js} +21 -21
  66. package/dist/cdn/chunks/{extensions-Bj7USRLr.js.map → extensions-DBxH6pz0.js.map} +1 -1
  67. package/dist/cdn/chunks/{features-Ds0XUfte.js → features-C3n7AeUc.js} +1338 -1422
  68. package/dist/cdn/chunks/features-C3n7AeUc.js.map +1 -0
  69. package/dist/cdn/chunks/{icons-fWsuSvgd.js → icons-Hmpb0_8s.js} +2 -2
  70. package/dist/cdn/chunks/icons-Hmpb0_8s.js.map +1 -0
  71. package/dist/cdn/chunks/{liquid.browser-C1VIYISn.js → liquid.browser-CEMn-ZqL.js} +24 -17
  72. package/dist/cdn/chunks/liquid.browser-CEMn-ZqL.js.map +1 -0
  73. package/dist/cdn/chunks/{media-library-BGQm_OyC.js → media-library-C1wCpRY1.js} +114 -110
  74. package/dist/cdn/chunks/media-library-C1wCpRY1.js.map +1 -0
  75. package/dist/cdn/chunks/{pusher-DJPhQnE8.js → pusher-DwSQn6BA.js} +11 -8
  76. package/dist/cdn/chunks/pusher-DwSQn6BA.js.map +1 -0
  77. package/dist/cdn/chunks/readableTextColor-Cd_cgWO_.js.map +1 -1
  78. package/dist/cdn/chunks/{rolldown-runtime-DPITmOBR.js → rolldown-runtime-BNuo_Jkg.js} +1 -1
  79. package/dist/cdn/chunks/{src-3i8rPuqd.js → src-BUszJqfd.js} +8 -8
  80. package/dist/cdn/chunks/{src-3i8rPuqd.js.map → src-BUszJqfd.js.map} +1 -1
  81. package/dist/cdn/chunks/{styleConstants-DFe3I4Op.js → styleConstants-DP1VOca8.js} +1 -1
  82. package/dist/cdn/chunks/{styleConstants-DFe3I4Op.js.map → styleConstants-DP1VOca8.js.map} +1 -1
  83. package/dist/cdn/chunks/{styles-Dgijy53u.js → styles-U2VFFgxC.js} +623 -1239
  84. package/dist/cdn/chunks/styles-U2VFFgxC.js.map +1 -0
  85. package/dist/cdn/chunks/{tiptap-BhxaWR8R.js → tiptap-w5IqC8oW.js} +1610 -1364
  86. package/dist/cdn/chunks/tiptap-w5IqC8oW.js.map +1 -0
  87. package/dist/cdn/editor.css +1 -1
  88. package/dist/cdn/editor.js +92 -97
  89. package/dist/cdn/editor.js.map +1 -1
  90. package/dist/{check-B7kDuZmP.js → check-BDE2uFIC.js} +1 -1
  91. package/dist/{chevron-down-DJLW2Q9Z.js → chevron-down-BL1DcOiT.js} +1 -1
  92. package/dist/{circle-alert-E2vYPs5r.js → circle-alert-1tetIFJU.js} +1 -1
  93. package/dist/{clock-lWIIQA3C.js → clock-CNc3isoG.js} +1 -1
  94. package/dist/{dist-DysAFIPy.js → dist-7SaUYnxo.js} +385 -357
  95. package/dist/{dist-DmOE-Ubp.js → dist-BKZ5gvJf.js} +5 -5
  96. package/dist/{dist-CG-vEqSU.js → dist-CLg2qE0p.js} +2 -2
  97. package/dist/dist-CdzaZZSx.js +5 -0
  98. package/dist/dist-Cl9giA3B.js +5 -0
  99. package/dist/{dist-C_ymrGFi.js → dist-CpHKN3mI.js} +541 -508
  100. package/dist/{dist-4LiM9FDd.js → dist-DMuaebdo.js} +2 -2
  101. package/dist/{dist-ChAGLpWo.js → dist-DW_4_uv3.js} +2 -2
  102. package/dist/{dist-C1BIRHCQ.js → dist-DYG6FL7b.js} +2 -2
  103. package/dist/{dist-DrvKRSU6.js → dist-DbFMBx8E.js} +2 -2
  104. package/dist/{dist-D_HQYSY-.js → dist-Dn9cOicG.js} +2 -2
  105. package/dist/{dist-Ci5lFuUy.js → dist-ENKQZrNg.js} +138 -132
  106. package/dist/{dist-Bu7veieH.js → dist-fEtcLxee.js} +15 -15
  107. package/dist/{extensions-DWx_jj8v.js → extensions-Y880c0sP.js} +3 -3
  108. package/dist/{image-up-X4xIq4ea.js → image-up-4ZmaHFga.js} +1 -1
  109. package/dist/index.d.ts +234 -0
  110. package/dist/{liquid.browser-BemTg3sZ.js → liquid.browser-DZ62L7up.js} +20 -15
  111. package/dist/{loader-circle-BTQQxC3l.js → loader-circle-C7YEH4do.js} +1 -1
  112. package/dist/{message-circle-Blgm6V_h.js → message-circle-B_lxRh4z.js} +1 -1
  113. package/dist/{refresh-cw-Bb4PEeW1.js → refresh-cw-DmZNoimV.js} +1 -1
  114. package/dist/rolldown-runtime-gEudmnaM.js +23 -0
  115. package/dist/{scan-line-7lZPfOdm.js → scan-line-Cc9KlXo5.js} +1 -1
  116. package/dist/{send-C0ltAQrv.js → send-CMwNWTPX.js} +1 -1
  117. package/dist/{shield-check-f-qv4RKs.js → shield-check-DZFf4LTh.js} +1 -1
  118. package/dist/{sparkles-KhBCGlqB.js → sparkles-D80W88H8.js} +1 -1
  119. package/dist/{styleConstants-Cxw88naD.js → styleConstants-Codo7aUT.js} +6 -45
  120. package/dist/styles-unyYKihg.js +2942 -0
  121. package/dist/templatical-editor.css +1 -1
  122. package/dist/templatical-editor.js +85 -90
  123. package/dist/text-align-start-Cje6pwo4.js +43 -0
  124. package/dist/{trash-2-OwjZ-guZ.js → trash-2-BWvxOB4Q.js} +1 -1
  125. package/dist/{triangle-alert-DOSRIUYZ.js → triangle-alert-C6y94qVX.js} +1 -1
  126. package/dist/{useEditorCore-DUGD6pq_.js → useEditorCore-CQwWl2js.js} +1143 -1247
  127. package/dist/{x-CGlq2XQe.js → x-IyhJ6V90.js} +1 -1
  128. package/package.json +70 -52
  129. package/dist/cdn/chunks/AiChatSidebar-X_Bv3Qys.js +0 -2
  130. package/dist/cdn/chunks/CloudEditor-DeTolKnf.js.map +0 -1
  131. package/dist/cdn/chunks/CommentsSidebar-4MTw_hue.js +0 -2
  132. package/dist/cdn/chunks/DesignReferenceSidebar-Bswh4Yx4.js +0 -2
  133. package/dist/cdn/chunks/ParagraphEditor-DU3oUKA7.js.map +0 -1
  134. package/dist/cdn/chunks/SnapshotHistory-KME4xmn_.js +0 -2
  135. package/dist/cdn/chunks/TemplateScoringPanel-DgB3xDN6.js +0 -2
  136. package/dist/cdn/chunks/TestEmailModal-DdpvRbYf.js +0 -2
  137. package/dist/cdn/chunks/de-BB3dgVOc.js.map +0 -1
  138. package/dist/cdn/chunks/dist-BF5c3Dr-.js +0 -2
  139. package/dist/cdn/chunks/dist-BGzvIxcJ.js +0 -2
  140. package/dist/cdn/chunks/dist-CFemF8rI.js +0 -2
  141. package/dist/cdn/chunks/dist-Co6uFhFK.js +0 -2
  142. package/dist/cdn/chunks/dist-DCikBY9K.js +0 -2
  143. package/dist/cdn/chunks/dist-DUILafAC.js +0 -2
  144. package/dist/cdn/chunks/dist-DghiKH0A.js +0 -2
  145. package/dist/cdn/chunks/dist-Dw8ckvfK.js +0 -2
  146. package/dist/cdn/chunks/dist-H07p0KAw.js +0 -2
  147. package/dist/cdn/chunks/dist-KYv9v_1z2.js.map +0 -1
  148. package/dist/cdn/chunks/dist-MjnKIc0W.js +0 -2
  149. package/dist/cdn/chunks/dist-odp0vGRv.js +0 -2
  150. package/dist/cdn/chunks/draggable-BQNU47zu.js.map +0 -1
  151. package/dist/cdn/chunks/en-DeDcpnoS.js.map +0 -1
  152. package/dist/cdn/chunks/features-Ds0XUfte.js.map +0 -1
  153. package/dist/cdn/chunks/icons-fWsuSvgd.js.map +0 -1
  154. package/dist/cdn/chunks/liquid.browser-C1VIYISn.js.map +0 -1
  155. package/dist/cdn/chunks/media-library-BGQm_OyC.js.map +0 -1
  156. package/dist/cdn/chunks/pusher-DJPhQnE8.js.map +0 -1
  157. package/dist/cdn/chunks/styles-Dgijy53u.js.map +0 -1
  158. package/dist/cdn/chunks/tiptap-BhxaWR8R.js.map +0 -1
  159. package/dist/dist-DkypH7qG.js +0 -5
  160. package/dist/dist-Dxnd0GRf.js +0 -5
  161. package/dist/styles-fdXNRqI3.js +0 -3556
  162. package/dist/templatical-editor.umd.cjs +0 -179
  163. /package/dist/cdn/chunks/{_rolldown_dynamic_import_helper-DMEI4TQ3.js → _rolldown_dynamic_import_helper-BRcA6nWq.js} +0 -0
  164. /package/dist/{de-D7TLGIPA.js → de-DCRASLfd.js} +0 -0
  165. /package/dist/{emojiData-BfWQS72m.js → emojiData-CyACq8qV.js} +0 -0
  166. /package/dist/{en-DvtiEMwP.js → en-BC0igPeg.js} +0 -0
  167. /package/dist/{formatRelativeTime-DX3FgqN9.js → formatRelativeTime-mRxw8HK8.js} +0 -0
  168. /package/dist/{readableTextColor-LDlmVEUv.js → readableTextColor-B809bF5J.js} +0 -0
  169. /package/dist/{useMergeTag-BZ3X0bNr.js → useMergeTag-CSXcnFBc.js} +0 -0
@@ -1,179 +0,0 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`vue`),require(`@templatical/core`),require(`@templatical/types`),require(`@templatical/core/cloud`)):typeof define==`function`&&define.amd?define([`exports`,`vue`,`@templatical/core`,`@templatical/types`,`@templatical/core/cloud`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.TemplaticalEditor={},e.Vue,e.TemplaticalCore,e.TemplaticalTypes,e.TemplaticalCoreCloud))})(this,function(e,t,n,r,i){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var a=Object.create,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,l=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,d=(e,t)=>()=>(e&&(t=e(e=0)),t),f=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),p=(e,t)=>{let n={};for(var r in e)o(n,r,{get:e[r],enumerable:!0});return t||o(n,Symbol.toStringTag,{value:`Module`}),n},m=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=c(t),a=0,l=i.length,d;a<l;a++)d=i[a],!u.call(e,d)&&d!==n&&o(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=s(t,d))||r.enumerable});return e},h=(e,t,n)=>(n=e==null?{}:a(l(e)),m(t||!e||!e.__esModule?o(n,`default`,{value:e,enumerable:!0}):n,e)),g=e=>u.call(e,`module.exports`)?e[`module.exports`]:m(o({},`__esModule`,{value:!0}),e),_,v,y=d((()=>{_=3e4,v=4e3}));function b(e,n){return(0,t.getCurrentScope)()?((0,t.onScopeDispose)(e,n),!0):!1}function x(){var e,t;return ce&&!!(!((e=window)==null||(e=e.navigator)==null)&&e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window)==null||(t=t.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function S(e,t){function n(...n){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(r).catch(i)})}return n}function C(e,n={}){let r,i,a=fe,o=e=>{clearTimeout(e),a(),a=fe},s;return c=>{let l=(0,t.toValue)(e),u=(0,t.toValue)(n.maxWait);return r&&o(r),l<=0||u!==void 0&&u<=0?(i&&=(o(i),void 0),Promise.resolve(c())):new Promise((e,t)=>{a=n.rejectOnCancel?t:e,s=c,u&&!i&&(i=setTimeout(()=>{r&&o(r),i=void 0,e(s())},u)),r=setTimeout(()=>{i&&o(i),i=void 0,e(c())},l)})}}function ee(e){return e.endsWith(`rem`)?Number.parseFloat(e)*16:Number.parseFloat(e)}function w(e){return Array.isArray(e)?e:[e]}function T(e){return e||(0,t.getCurrentInstance)()}function te(e,t=200,n={}){return S(C(t,n),e)}function E(e,n=!0,r){T(r)?(0,t.onMounted)(e,r):n?e():(0,t.nextTick)(e)}function ne(e,n=1e3,r={}){let{immediate:i=!0,immediateCallback:a=!1}=r,o=null,s=(0,t.shallowRef)(!1);function c(){o&&=(clearInterval(o),null)}function l(){s.value=!1,c()}function u(){let r=(0,t.toValue)(n);r<=0||(s.value=!0,a&&e(),c(),s.value&&(o=setInterval(e,r)))}return i&&ce&&u(),((0,t.isRef)(n)||typeof n==`function`)&&b((0,t.watch)(n,()=>{s.value&&ce&&u()})),b(l),{isActive:(0,t.shallowReadonly)(s),pause:l,resume:u}}function re(e,n,r={}){let{immediate:i=!0,immediateCallback:a=!1}=r,o=(0,t.shallowRef)(!1),s;function c(){s&&=(clearTimeout(s),void 0)}function l(){o.value=!1,c()}function u(...r){a&&e(),c(),o.value=!0,s=setTimeout(()=>{o.value=!1,s=void 0,e(...r)},(0,t.toValue)(n))}return i&&(o.value=!0,ce&&u()),b(l),{isPending:(0,t.shallowReadonly)(o),start:u,stop:l}}function ie(e=!1,n={}){let{truthyValue:r=!0,falsyValue:i=!1}=n,a=(0,t.isRef)(e),o=(0,t.shallowRef)(e);function s(e){if(arguments.length)return o.value=e,o.value;{let e=(0,t.toValue)(r);return o.value=o.value===e?(0,t.toValue)(i):e,o.value}}return a?s:[o,s]}function ae(e,n,r){return(0,t.watch)(e,n,{...r,immediate:!0})}var oe,se,ce,le,ue,de,fe,pe,me=d((()=>{oe=new WeakMap,se=(...e)=>{let n=e[0],r=(0,t.getCurrentInstance)()?.proxy??(0,t.getCurrentScope)();if(r==null&&!(0,t.hasInjectionContext)())throw Error(`injectLocal must be called in setup`);return r&&oe.has(r)&&n in oe.get(r)?oe.get(r)[n]:(0,t.inject)(...e)},ce=typeof window<`u`&&typeof document<`u`,typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope,le=e=>e!=null,ue=Object.prototype.toString,de=e=>ue.call(e)===`[object Object]`,fe=()=>{},pe=x()}));function he(e){let n=(0,t.toValue)(e);return n?.$el??n}function ge(...e){let n=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),r=(0,t.computed)(()=>{let n=w((0,t.toValue)(e[0])).filter(e=>e!=null);return n.every(e=>typeof e!=`string`)?n:void 0});return ae(()=>[r.value?.map(e=>he(e))??[Te].filter(e=>e!=null),w((0,t.toValue)(r.value?e[1]:e[0])),w((0,t.unref)(r.value?e[2]:e[1])),(0,t.toValue)(r.value?e[3]:e[2])],([e,t,r,i],a,o)=>{if(!e?.length||!t?.length||!r?.length)return;let s=de(i)?{...i}:i,c=e.flatMap(e=>t.flatMap(t=>r.map(r=>n(e,t,r,s))));o(()=>{c.forEach(e=>e())})},{flush:`post`})}function _e(e,n,r={}){let{window:i=Te,ignore:a=[],capture:o=!0,detectIframe:s=!1,controls:c=!1}=r;if(!i)return c?{stop:fe,cancel:fe,trigger:fe}:fe;if(pe&&!Ee){Ee=!0;let e={passive:!0};Array.from(i.document.body.children).forEach(t=>t.addEventListener(`click`,fe,e)),i.document.documentElement.addEventListener(`click`,fe,e)}let l=!0,u=e=>(0,t.toValue)(a).some(t=>{if(typeof t==`string`)return Array.from(i.document.querySelectorAll(t)).some(t=>t===e.target||e.composedPath().includes(t));{let n=he(t);return n&&(e.target===n||e.composedPath().includes(n))}});function d(e){let n=(0,t.toValue)(e);return n&&n.$.subTree.shapeFlag===16}function f(e,n){let r=(0,t.toValue)(e),i=r.$.subTree&&r.$.subTree.children;return i==null||!Array.isArray(i)?!1:i.some(e=>e.el===n.target||n.composedPath().includes(e.el))}let p=t=>{let r=he(e);if(t.target!=null&&!(!(r instanceof Element)&&d(e)&&f(e,t))&&!(!r||r===t.target||t.composedPath().includes(r))){if(`detail`in t&&t.detail===0&&(l=!u(t)),!l){l=!0;return}n(t)}},m=!1,h=[ge(i,`click`,e=>{m||(m=!0,setTimeout(()=>{m=!1},0),p(e))},{passive:!0,capture:o}),ge(i,`pointerdown`,t=>{let n=he(e);l=!u(t)&&!!(n&&!t.composedPath().includes(n))},{passive:!0}),s&&ge(i,`blur`,t=>{setTimeout(()=>{let r=he(e);i.document.activeElement?.tagName===`IFRAME`&&!r?.contains(i.document.activeElement)&&n(t)},0)},{passive:!0})].filter(Boolean),g=()=>h.forEach(e=>e());return c?{stop:g,cancel:()=>{l=!1},trigger:e=>{l=!0,p(e),l=!1}}:g}function ve(){let e=(0,t.shallowRef)(!1),n=(0,t.getCurrentInstance)();return n&&(0,t.onMounted)(()=>{e.value=!0},n),e}function ye(e){let n=ve();return(0,t.computed)(()=>(n.value,!!e()))}function be(e,n,r={}){let{window:i=Te,...a}=r,o,s=ye(()=>i&&`MutationObserver`in i),c=()=>{o&&=(o.disconnect(),void 0)},l=(0,t.watch)((0,t.computed)(()=>{let n=w((0,t.toValue)(e)).map(he).filter(le);return new Set(n)}),e=>{c(),s.value&&e.size&&(o=new MutationObserver(n),e.forEach(e=>o.observe(e,a)))},{immediate:!0,flush:`post`}),u=()=>o?.takeRecords(),d=()=>{l(),c()};return b(d),{isSupported:s,stop:d,takeRecords:u}}function xe(){let e=(0,t.hasInjectionContext)()?se(De,null):null;return typeof e==`number`?e:void 0}function Se(e,n={}){let{window:r=Te,ssrWidth:i=xe()}=n,a=ye(()=>r&&`matchMedia`in r&&typeof r.matchMedia==`function`),o=(0,t.shallowRef)(typeof i==`number`),s=(0,t.shallowRef)(),c=(0,t.shallowRef)(!1);return(0,t.watchEffect)(()=>{if(o.value){o.value=!a.value,c.value=(0,t.toValue)(e).split(`,`).some(e=>{let t=e.includes(`not all`),n=e.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),r=e.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),a=!!(n||r);return n&&a&&(a=i>=ee(n[1])),r&&a&&(a=i<=ee(r[1])),t?!a:a});return}a.value&&(s.value=r.matchMedia((0,t.toValue)(e)),c.value=s.value.matches)}),ge(s,`change`,e=>{c.value=e.matches},{passive:!0}),(0,t.computed)(()=>c.value)}function Ce(e,n,r={}){let{window:i=Te,...a}=r,o,s=ye(()=>i&&`ResizeObserver`in i),c=()=>{o&&=(o.disconnect(),void 0)},l=(0,t.watch)((0,t.computed)(()=>{let n=(0,t.toValue)(e);return Array.isArray(n)?n.map(e=>he(e)):[he(n)]}),e=>{if(c(),s.value&&i){o=new ResizeObserver(n);for(let t of e)t&&o.observe(t,a)}},{immediate:!0,flush:`post`}),u=()=>{c(),l()};return b(u),{isSupported:s,stop:u}}function we(e,n={}){let{reset:r=!0,windowResize:i=!0,windowScroll:a=!0,immediate:o=!0,updateTiming:s=`sync`}=n,c=(0,t.shallowRef)(0),l=(0,t.shallowRef)(0),u=(0,t.shallowRef)(0),d=(0,t.shallowRef)(0),f=(0,t.shallowRef)(0),p=(0,t.shallowRef)(0),m=(0,t.shallowRef)(0),h=(0,t.shallowRef)(0);function g(){let t=he(e);if(!t){r&&(c.value=0,l.value=0,u.value=0,d.value=0,f.value=0,p.value=0,m.value=0,h.value=0);return}let n=t.getBoundingClientRect();c.value=n.height,l.value=n.bottom,u.value=n.left,d.value=n.right,f.value=n.top,p.value=n.width,m.value=n.x,h.value=n.y}function _(){s===`sync`?g():s===`next-frame`&&requestAnimationFrame(()=>g())}return Ce(e,_),(0,t.watch)(()=>he(e),e=>!e&&_()),be(e,_,{attributeFilter:[`style`,`class`]}),a&&ge(`scroll`,_,{capture:!0,passive:!0}),i&&ge(`resize`,_,{passive:!0}),E(()=>{o&&_()}),{height:c,bottom:l,left:u,right:d,top:f,width:p,x:m,y:h,update:_}}var Te,Ee,De,Oe=d((()=>{me(),me(),Te=ce?window:void 0,ce&&window.document,ce&&window.navigator,ce&&window.location,Ee=!1,De=Symbol(`vueuse-ssr-width`)}));function ke(e,n){let r=(0,t.inject)(e,null);if(r==null)throw Error(`${n} requires a provider for ${e.description??`unknown key`}. Ensure it is a descendant of Editor or CloudEditor.`);return r}var Ae,je,Me,Ne,Pe,Fe,Ie,Le,Re,ze,Be,Ve,He,Ue,We,Ge,Ke,qe,Je,Ye,Xe,Ze,Qe,$e,D=d((()=>{Ae=Symbol(`translations`),je=Symbol(`editor`),Me=Symbol(`history`),Ne=Symbol(`blockActions`),Pe=Symbol(`conditionPreview`),Fe=Symbol(`fontsManager`),Ie=Symbol(`themeStyles`),Le=Symbol(`tplUiTheme`),Re=Symbol(`blockDefaults`),ze=Symbol(`blockRegistry`),Be=Symbol(`customBlockDefinitions`),Ve=Symbol(`mergeTags`),He=Symbol(`mergeTagSyntax`),Ue=Symbol(`onRequestMergeTag`),We=Symbol(`onRequestMedia`),Ge=Symbol(`displayConditions`),Ke=Symbol(`allowCustomConditions`),qe=Symbol(`capabilities`),Je=Symbol(`keyboardReorder`),Ye=Symbol(`authManager`),Xe=Symbol(`aiConfig`),Ze=Symbol(`comments`),Qe=Symbol(`savedModulesHeadless`),$e=Symbol(`scoring`)}));function O(e){let n=e??(0,t.inject)(Ae,null);if(!n)throw Error(`useI18n() requires a translations provider. Ensure the component is a descendant of Editor or CloudEditor.`);let r=(0,t.isRef)(n)?n.value:n;function i(e,t){return e.replace(/\{(\w+)\}/g,(e,n)=>n in t?String(t[n]):`{${n}}`)}return{t:r,format:i}}var k=d((()=>{D()}));function et(e,t){return t.blocks[e]??e}var tt=d((()=>{}));function nt(e,n){let r=(0,t.ref)(null),i=(0,t.ref)(``),a=null;function o(t){let n=e.content.value.blocks,r=n.findIndex(e=>e.id===t);if(r!==-1)return{index:r,total:n.length};for(let e of n){if(e.type!==`section`)continue;let n=e;for(let e=0;e<n.children.length;e++){let r=n.children[e],i=r.findIndex(e=>e.id===t);if(i!==-1)return{index:i,total:r.length,sectionId:n.id,columnIndex:e}}}return null}function s(t){let r=o(t);if(!r)return``;let i=(r.sectionId?c(r.sectionId,r.columnIndex??0):e.content.value.blocks)?.[r.index];return i?et(i.type,n.t):``}function c(t,n){return e.content.value.blocks.find(e=>e.id===t&&e.type===`section`)?.children[n]??null}function l(e){i.value=``,queueMicrotask(()=>{i.value=e})}function u(e){return r.value===e}function d(e){let t=o(e);t&&(r.value=e,a=t,l(n.format(n.t.blockActions.lifted,{block:s(e),position:String(t.index+1),total:String(t.total)})))}function f(t,r){let i=o(t);if(!i)return;let a=i.index+r;a<0||a>=i.total||(e.moveBlock(t,a,i.sectionId,i.columnIndex),l(n.format(n.t.blockActions.moved,{block:s(t),position:String(a+1),total:String(i.total)})))}function p(e){f(e,-1)}function m(e){f(e,1)}function h(e){let t=o(e);t&&l(n.format(n.t.blockActions.dropped,{block:s(e),position:String(t.index+1),total:String(t.total)})),r.value=null,a=null}function g(){let t=r.value;if(t&&a){let r=o(t);r&&r.index!==a.index&&e.moveBlock(t,a.index,a.sectionId,a.columnIndex),l(n.format(n.t.blockActions.cancelled,{block:s(t),position:String(a.index+1)}))}r.value=null,a=null}return{liftedBlockId:r,announcement:i,isLifted:u,lift:d,cancel:g,moveUp:p,moveDown:m,drop:h}}var rt=d((()=>{tt()}));function it(e){let n=Se(`(prefers-color-scheme: dark)`);return{resolvedTheme:(0,t.computed)(()=>e.value===`auto`?n.value?`dark`:`light`:e.value)}}var at=d((()=>{Oe()}));function ot({themeOverrides:e,resolvedTheme:n,extraStyles:r}){return{themeStyles:(0,t.computed)(()=>{let t={},i=e.value,a=n.value===`dark`?i.dark:i;if(a)for(let[e,n]of Object.entries(st)){let r=a[e];r&&(t[n]=r)}return r&&Object.assign(t,r()),t})}}var st,ct=d((()=>{st={bg:`--tpl-bg`,bgElevated:`--tpl-bg-elevated`,bgHover:`--tpl-bg-hover`,bgActive:`--tpl-bg-active`,border:`--tpl-border`,borderLight:`--tpl-border-light`,text:`--tpl-text`,textMuted:`--tpl-text-muted`,textDim:`--tpl-text-dim`,primary:`--tpl-primary`,primaryHover:`--tpl-primary-hover`,primaryLight:`--tpl-primary-light`,secondary:`--tpl-secondary`,secondaryHover:`--tpl-secondary-hover`,secondaryLight:`--tpl-secondary-light`,success:`--tpl-success`,successLight:`--tpl-success-light`,warning:`--tpl-warning`,warningLight:`--tpl-warning-light`,danger:`--tpl-danger`,dangerLight:`--tpl-danger-light`,canvasBg:`--tpl-canvas-bg`}}));function lt(){return typeof process<`u`&&process.env.NODE_ENV===`production`}var ut,dt,ft=d((()=>{ut=`[Templatical]`,dt={warn(...e){console.warn(ut,...e)},error(...e){console.error(ut,...e)},debug(...e){lt()||console.debug(ut,...e)},info(...e){lt()||console.info(ut,...e)}}})),pt=p({AssertionError:()=>Xi,AssignTag:()=>as,BlockTag:()=>ys,BreakTag:()=>ws,CaptureTag:()=>ls,CaseTag:()=>us,CommentTag:()=>ds,Context:()=>Do,ContinueTag:()=>Ts,CycleTag:()=>hs,DecrementTag:()=>ms,Drop:()=>Ri,EchoTag:()=>Es,Expression:()=>Xa,Filter:()=>po,ForTag:()=>cs,Hash:()=>fo,IfTag:()=>gs,IncludeTag:()=>ps,IncrementTag:()=>_s,InlineCommentTag:()=>Os,LayoutTag:()=>vs,Liquid:()=>As,LiquidError:()=>Ui,LiquidTag:()=>Ds,LookupType:()=>So,Output:()=>ho,ParseError:()=>Gi,ParseStream:()=>co,Parser:()=>wo,RawTag:()=>bs,RenderError:()=>Ki,RenderTag:()=>fs,TablerowTag:()=>Ss,Tag:()=>uo,TagToken:()=>ka,Token:()=>Li,TokenKind:()=>To,TokenizationError:()=>Wi,Tokenizer:()=>so,TypeGuards:()=>Eo,UndefinedVariableError:()=>Ji,UnlessTag:()=>Cs,Value:()=>mo,Variable:()=>_o,analyze:()=>Yn,analyzeSync:()=>Xn,assert:()=>Gt,createTrie:()=>Jt,defaultOperators:()=>Za,defaultOptions:()=>oo,evalQuotedToken:()=>hn,evalToken:()=>pn,filters:()=>is,isFalsy:()=>yn,isTruthy:()=>vn,tags:()=>ks,toPromise:()=>Zt,toValue:()=>M,toValueSync:()=>Qt,version:()=>js});function A(e){return typeof e==`string`}function mt(e){return typeof e==`function`}function ht(e){return e&&mt(e.then)}function gt(e){return e&&mt(e.next)&&mt(e.throw)&&mt(e.return)}function j(e){return e=M(e),A(e)?e:St(e)?``:wt(e)?e.map(e=>j(e)).join(``):String(e)}function _t(e){return e=M(e),wt(e)?e:A(e)&&e.length>0?[e]:Et(e)?Array.from(e):kt(e)?Object.keys(e).map(t=>[t,e[t]]):[]}function vt(e){return e=M(e),St(e)?[]:wt(e)?e:[e]}function M(e){return e instanceof Ri&&mt(e.valueOf)?e.valueOf():e}function yt(e){return+M(e)||0}function bt(e){return typeof e==`number`}function xt(e){return e&&mt(e.toLiquid)?xt(e.toLiquid()):e}function St(e){return e==null}function Ct(e){return e===void 0}function wt(e){return zi.call(e)===`[object Array]`}function Tt(e){return e&&bt(e.length)}function Et(e){return kt(e)&&Symbol.iterator in e}function Dt(e,t){e||={};for(let n in e)if(Vi.call(e,n)&&t(e[n],n,e)===!1)break;return e}function Ot(e){return e[e.length-1]}function kt(e){let t=typeof e;return e!==null&&(t===`object`||t===`function`)}function At(e,t,n=1){let r=[];for(let i=e;i<t;i+=n)r.push(i);return r}function jt(e,t,n=` `){return Nt(e,t,n,(e,t)=>t+e)}function Mt(e,t,n=` `){return Nt(e,t,n,(e,t)=>e+t)}function Nt(e,t,n,r){e=String(e);let i=t-e.length;for(;i-- >0;)e=r(e,n);return e}function Pt(e){return e}function Ft(e){return[...e].some(e=>e>=`a`&&e<=`z`)?e.toUpperCase():e.toLowerCase()}function It(e,t){return e.length>t?e.slice(0,t-3)+`...`:e}function Lt(e,t){return St(e)&&St(t)?0:St(e)?1:St(t)||e<t?-1:+(e>t)}function Rt(e,t){return St(e)&&St(t)?0:St(e)?1:St(t)||(e=Bi.call(e),t=Bi.call(t),e<t)?-1:+(e>t)}function zt(e){return function(...t){return e.call(this,...t.map(M))}}function Bt(e){return function(...t){return e.call(this,...t.map(yt))}}function*Vt(e){let t=new Set;for(let n of e){let e=JSON.stringify(n);t.has(e)||(t.add(e),yield n)}}function Ht(e){let[t,n]=e.getPosition(),r=e.input.split(`
2
- `),i=Math.max(t-2,1),a=Math.min(t+3,r.length);return At(i,a+1).map(e=>{let i=`${e===t?`>> `:` `}${jt(String(e),String(a).length)}| `,o=e===t?`
3
- `+jt(`^`,n+i.length):``;return i+=r[e-1],i+=o,i}).join(`
4
- `)}function Ut(e,t){t.file&&(e+=`, file:${t.file}`);let[n,r]=t.getPosition();return e+=`, line:${n}, col:${r}`,e}function Wt(e){let t=e.charCodeAt(0);return t>=128?!Zi[t]:!!(Zi[t]&Qi)}function Gt(e,t){if(!e)throw new Xi(typeof t==`function`?t():t||`expect ${e} to be true`)}function Kt(e,t=`unexpected ${JSON.stringify(e)}`){Gt(!e,t)}function qt(e){return e&&mt(e.equals)&&mt(e.gt)&&mt(e.geq)&&mt(e.lt)&&mt(e.leq)}function Jt(e){let t={};for(let[n,r]of Object.entries(e)){let e=t;for(let t=0;t<n.length;t++){let r=n[t];e[r]=e[r]||{},t===n.length-1&&Wt(n[t])&&(e[r].needBoundary=!0),e=e[r]}e.data=r,e.end=!0}return t}function Yt(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function Xt(e,t){let n=t||e;return(t,...r)=>t?n(...r):e(...r)}function Zt(e){return Yt(this,void 0,void 0,function*(){if(!gt(e))return e;let t,n=!1,r=`next`;do{let i=e[r](t);n=i.done,t=i.value,r=`next`;try{gt(t)&&(t=Zt(t)),ht(t)&&(t=yield t)}catch(e){r=`throw`,t=e}}while(!n);return t})}function Qt(e){if(!gt(e))return e;let t,n=!1,r=`next`;do{let i=e[r](t);if(n=i.done,t=i.value,r=`next`,gt(t))try{t=Qt(t)}catch(e){r=`throw`,t=e}}while(!n);return t}function $t(e){return[31,nn(e)?29:28,31,30,31,30,31,31,30,31,30,31]}function en(e){let t=0;for(let n=0;n<e.getMonth();++n)t+=$t(e)[n];return t+e.getDate()}function tn(e,t){let n=en(e)+(t-e.getDay()),r=7-new Date(e.getFullYear(),0,1).getDay()+t;return String(Math.floor((n-r)/7)+1)}function nn(e){let t=e.getFullYear();return!!(!(t&3)&&(t%100||t%400==0&&t))}function rn(e){let t=e.getDate();if([11,12,13].includes(t))return`th`;switch(t%10){case 1:return`st`;case 2:return`nd`;case 3:return`rd`;default:return`th`}}function an(e){return parseInt(e.getFullYear().toString().substring(0,2),10)}function on(e,t){let n=Math.abs(e.getTimezoneOffset()),r=Math.floor(n/60),i=n%60;return(e.getTimezoneOffset()>0?`-`:`+`)+jt(r,2,`0`)+(t.flags[`:`]?`:`:``)+jt(i,2,`0`)}function sn(e,t){let n=``,r=t,i;for(;i=ga.exec(r);)n+=r.slice(0,i.index),r=r.slice(i.index+i[0].length),n+=cn(e,i);return n+r}function cn(e,t){let[n,r=``,i,a,o]=t,s=ya[o];if(!s)return n;let c={};for(let e of r)c[e]=!0;let l=String(s(e,{flags:c,width:i,modifier:a})),u=va.has(o)?` `:`0`,d=i||_a[o]||0;return c[`^`]?l=l.toUpperCase():c[`#`]&&(l=Ft(l)),c._?u=` `:c[0]&&(u=`0`),c[`-`]&&(d=0),jt(l,d,u)}function ln(){return typeof Intl<`u`?Intl.DateTimeFormat:void 0}function un(e){let t=e.charCodeAt(0);return t>=97?t-87:t>=65?t-55:t-48}function dn(e){let t=``;for(let n=1;n<e.length-1;n++){if(e[n]!==`\\`){t+=e[n];continue}if(Ua[e[n+1]]!==void 0)t+=Ua[e[++n]];else if(e[n+1]===`u`){let r=0,i=n+2;for(;i<=n+5&&Va.test(e[i]);)r=r*16+un(e[i++]);n=i-1,t+=String.fromCharCode(r)}else if(!Ha.test(e[n+1]))t+=e[++n];else{let r=n+1,i=0;for(;r<=n+3&&Ha.test(e[r]);)i=i*8+un(e[r++]);n=r-1,t+=String.fromCharCode(i)}}return t}function fn(){return typeof global==`object`&&global.performance||typeof window==`object`&&window.performance||Ja}function*pn(e,t,n=!1){if(e){if(`content`in e)return e.content;if(ur(e))return yield mn(e,t,n);if(fr(e))return yield gn(e,t)}}function*mn(e,t,n){let r=[];for(let n of e.props)r.push(yield pn(n,t,!1));try{if(e.variable){let i=yield pn(e.variable,t,n);return yield t._getFromScope(i,r)}else return yield t._get(r)}catch(t){if(n&&t.name===`InternalUndefinedVariableError`)return null;throw new Ji(t,e)}}function hn(e){return e.content}function*gn(e,t){let n=yield pn(e.lhs,t),r=yield pn(e.rhs,t);return t.memoryLimit.use(r-n+1),At(+n,+r+1)}function*_n(e){let t=[];for(let n of e)if(rr(n)){for(;t.length&&t[t.length-1].getPrecedence()>n.getPrecedence();)yield t.pop();t.push(n)}else yield n;for(;t.length;)yield t.pop()}function vn(e,t){return!yn(e,t)}function yn(e,t){return e=M(e),t.opts.jsTruthy?!e:e===!1||e==null}function bn(e,t){return qt(e)?e.equals(t):qt(t)?t.equals(e):(e=M(e),t=M(t),wt(e)?wt(t)&&xn(e,t):e===t)}function xn(e,t){return e.length===t.length?!e.some((e,n)=>!bn(e,t[n])):!1}function Sn(e,t){return e.some(e=>bn(e,t))}function Cn(e,t){let n=document.createElement(`base`);n.href=e;let r=document.getElementsByTagName(`head`)[0];r.insertBefore(n,r.firstChild);let i=document.createElement(`a`);i.href=t;let a=i.href;return r.removeChild(n),a}function wn(e,t,n){return e.length&&Ot(e)!==`/`&&(e+=`/`),Cn(e,t).replace(/^(\w+:\/\/[^/]+)(\/[^?]+)/,(e,t,r)=>{let i=r.split(`/`).pop();return/\.\w+$/.test(i)?e:t+r+n})}function Tn(e){return Yt(this,void 0,void 0,function*(){return new Promise((t,n)=>{let r=new XMLHttpRequest;r.onload=()=>{r.status>=200&&r.status<300?t(r.responseText):n(Error(r.statusText))},r.onerror=()=>{n(Error(`An error occurred whilst receiving the response.`))},r.open(`GET`,e),r.send()})})}function En(e){let t=new XMLHttpRequest;if(t.open(`GET`,e,!1),t.send(),t.status<200||t.status>=300)throw Error(t.statusText);return t.responseText}function Dn(e){return Yt(this,void 0,void 0,function*(){return!0})}function On(e){return!0}function kn(e){return Cn(e,`.`)}function An(e,t,...n){return e=M(e),wt(e)||A(e)?e.length?e:t:e===!1&&new Map(n).get(`allow_false`)?!1:yn(e,this.context)?t:e}function jn(e,t=0){return JSON.stringify(e,null,t)}function Mn(e,t=0){let n=[];return JSON.stringify(e,function(e,t){if(typeof t!=`object`||!t)return t;for(;n.length>0&&n[n.length-1]!==this;)n.pop();return n.includes(t)?`[Circular]`:(n.push(t),t)},t)}function Nn(e){return Number(e)}function Pn(e){return e=j(e),this.context.memoryLimit.use(e.length),e.replace(/&|<|>|"|'/g,e=>no[e])}function Fn(e){return Pn.call(this,e)}function In(e){return e=j(e),this.context.memoryLimit.use(e.length),e.replace(/&(amp|lt|gt|#34|#39);/g,e=>ro[e])}function Ln(e){return Pn.call(this,In.call(this,e))}function Rn(e){let t=j(e);return this.context.memoryLimit.use(t.length),t.replace(/\r?\n/gm,`<br />
5
- `)}function zn(e){let t=j(e);return this.context.memoryLimit.use(t.length),t.replace(/<script[\s\S]*?<\/script>|<style[\s\S]*?<\/style>|<.*?>|<!--[\s\S]*?-->/g,``)}function Bn(e){if(e.hasOwnProperty(`root`)&&(e.hasOwnProperty(`partials`)||(e.partials=e.root),e.hasOwnProperty(`layouts`)||(e.layouts=e.root)),e.hasOwnProperty(`cache`)){let t;t=typeof e.cache==`number`?e.cache>0?new $a(e.cache):void 0:typeof e.cache==`object`?e.cache:e.cache?new $a(1024):void 0,e.cache=t}return e=Object.assign(Object.assign(Object.assign({},oo),e.jekyllInclude?{dynamicPartials:!1}:{}),e),(!e.fs.dirname||!e.fs.sep)&&e.relativeReference&&(console.warn("[LiquidJS] `fs.dirname` and `fs.sep` are required for relativeReference, set relativeReference to `false` to suppress this warning"),e.relativeReference=!1),e.root=Hn(e.root),e.partials=Hn(e.partials),e.layouts=Hn(e.layouts),e.outputEscape=e.outputEscape&&Vn(e.outputEscape),e.locale||=ln()?.().resolvedOptions().locale??`en-US`,e.templates&&(e.fs=new ao(e.templates),e.relativeReference=!0,e.root=e.partials=e.layouts=`.`),e}function Vn(e){return e===`escape`?Pn:e===`json`?to.json:(Gt(mt(e),"`outputEscape` need to be of type string or function"),e)}function Hn(e){let t=[];return wt(e)&&(t=e),A(e)&&(t=[e]),t}function Un(e,t){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];nr(i)&&(!n&&i.trimLeft&&Wn(e[r-1],t.greedy),or(i)&&(i.name===`raw`?n=!0:i.name===`endraw`&&(n=!1)),!n&&i.trimRight&&Gn(e[r+1],t.greedy))}}function Wn(e,t){if(!e||!ir(e))return;let n=t?$i:ta;for(;Zi[e.input.charCodeAt(e.end-1-e.trimRight)]&n;)e.trimRight++}function Gn(e,t){if(!e||!ir(e))return;let n=t?$i:ta;for(;Zi[e.input.charCodeAt(e.begin+e.trimLeft)]&n;)e.trimLeft++;e.input.charAt(e.begin+e.trimLeft)===`
6
- `&&e.trimLeft++}function Kn(e){return class extends uo{constructor(t,n,r){super(t,n,r),mt(e.parse)&&e.parse.call(this,t,n)}*render(t,n){let r=yield new fo(this.token.args,t.opts.keyValueSeparator).render(t);return yield e.render.call(this,t,n,r)}}}function qn(e){return wt(e)}function*Jn(e,t,n){let r=new vo,i=new vo,a=new vo,o=new bo(new Set),s=new Set;function c(e,t){r.push(e);let n=t.alias(e);if(n!==void 0){let e=n.segments[0];A(e)&&!o.has(e)&&i.push(n)}else{let n=e.segments[0];A(n)&&!t.has(n)&&i.push(e)}for(let n of e.segments)n instanceof _o&&c(n,t)}function*l(e,r){if(e.arguments)for(let t of e.arguments())for(let e of Zn(t))c(e,r);if(e.localScope)for(let t of e.localScope()){r.add(t.content),r.deleteAlias(t.content);let[e,n]=t.getPosition();a.push(new _o([t.content],{row:e,col:n,file:t.file}))}if(e.children)if(e.partialScope){let i=e.partialScope();if(i===void 0){for(let i of yield e.children(t,n))yield l(i,r);return}if(s.has(i.name))return;let a=new Set,o=i.isolated?new bo(a):r.push(a);for(let e of i.scope)if(A(e))a.add(e);else{let[t,n]=e;a.add(t);let r=Array.from(Zn(n));r.length&&o.setAlias(t,r[0].segments)}for(let r of yield e.children(t,n))yield l(r,o),s.add(i.name);o.pop()}else{e.blockScope&&r.push(new Set(e.blockScope()));for(let i of yield e.children(t,n))yield l(i,r);e.blockScope&&r.pop()}}for(let t of e)yield l(t,o);return{variables:r.asObject(),globals:i.asObject(),locals:a.asObject()}}function Yn(e,t={}){return Zt(Jn(e,Object.assign(Object.assign({},yo),t).partials,!1))}function Xn(e,t={}){return Qt(Jn(e,Object.assign(Object.assign({},yo),t).partials,!0))}function*Zn(e){pr(e)?yield*$n(e):e instanceof mo&&(yield*Qn(e))}function*Qn(e){for(let t of e.initial.postfix)pr(t)&&(yield*$n(t));for(let t of e.filters)for(let e of t.args)qn(e)&&e[1]?yield*$n(e[1]):pr(e)&&(yield*$n(e))}function*$n(e){fr(e)?(yield*$n(e.lhs),yield*$n(e.rhs)):ur(e)&&(yield er(e))}function er(e){let t=[],n=e.file,r=e.props[0];n||=r.file,sr(r)||lr(r)||dr(r)?t.push(r.content):ur(r)&&t.push(...er(r).segments);for(let r of e.props.slice(1))n||=r.file,sr(r)||lr(r)||dr(r)?t.push(r.content):ur(r)&&t.push(er(r));let[i,a]=e.getPosition();return new _o(t,{row:i,col:a,file:n})}function tr(e,t=!1){let n=[],r=e[0];A(r)&&(!t||r.match(xo)?n.push(`${r}`):n.push(`['${r}']`));for(let t of e.slice(1))t instanceof _o?n.push(`[${tr(t.segments)}]`):A(t)?t.match(xo)?n.push(`.${t}`):n.push(`['${t}']`):n.push(`[${t}]`);return n.join(``)}function nr(e){return!!(mr(e)&To.Delimited)}function rr(e){return mr(e)===To.Operator}function ir(e){return mr(e)===To.HTML}function ar(e){return mr(e)===To.Output}function or(e){return mr(e)===To.Tag}function sr(e){return mr(e)===To.Quoted}function cr(e){return mr(e)===To.Literal}function lr(e){return mr(e)===To.Number}function ur(e){return mr(e)===To.PropertyAccess}function dr(e){return mr(e)===To.Word}function fr(e){return mr(e)===To.Range}function pr(e){return(mr(e)&1667)>0}function mr(e){return e?e.kind:-1}function hr(e,t,n){if(!(n&&!Vi.call(e,t)&&!(e instanceof Ri)))return e[t]}function gr(e){return wt(e)?e[0]:e.first}function _r(e){return wt(e)?e[e.length-1]:e.last}function vr(e){if(Vi.call(e,`size`)||e.size!==void 0)return e.size;if(wt(e)||A(e))return e.length;if(typeof e==`object`)return Object.keys(e).length}function yr(e,t=0){e=yt(e),t=yt(t);let n=10**t,r=e*n;return Math.sign(e)*Math.round(Math.abs(r))/n}function br(e,t=`default`,n=!1){e=j(e);let r=Go[t];return r&&(t===`latin`&&(e=xr(e)),e=e.replace(r,`-`).replace(/^-|-$/g,``)),n?e:e.toLowerCase()}function xr(e){return e.replace(/[àáâãäå]/g,`a`).replace(/[æ]/g,`ae`).replace(/[ç]/g,`c`).replace(/[èéêë]/g,`e`).replace(/[ìíîï]/g,`i`).replace(/[ð]/g,`d`).replace(/[ñ]/g,`n`).replace(/[òóôõöø]/g,`o`).replace(/[ùúûü]/g,`u`).replace(/[ýÿ]/g,`y`).replace(/[ß]/g,`ss`).replace(/[œ]/g,`oe`).replace(/[þ]/g,`th`).replace(/[ẞ]/g,`SS`).replace(/[Œ]/g,`OE`).replace(/[Þ]/g,`TH`)}function*Sr(e,t,n){let r=[],i=vt(e);this.context.memoryLimit.use(i.length);for(let e of i)r.push([e,t?yield this.context._getFromScope(e,j(t).split(`.`),!1):e]);return r.sort((e,t)=>n(e[1],t[1])).map(e=>e[0])}function*Cr(e,t){return yield*Sr.call(this,e,t,Lt)}function*wr(e,t){return yield*Sr.call(this,e,t,Rt)}function*Tr(e,t){let n=[],r=vt(e);this.context.memoryLimit.use(r.length);for(let e of r)n.push(yield this.context._getFromScope(e,j(t),!1));return n}function*Er(e,t){let n=0,r=vt(e);for(let e of r){let r=Number(t?yield this.context._getFromScope(e,j(t),!1):e);n+=Number.isNaN(r)?0:r}return n}function Dr(e){let t=vt(e);return this.context.memoryLimit.use(t.length),t.filter(e=>!St(M(e)))}function Or(e,t=[]){let n=vt(e),r=vt(t);return this.context.memoryLimit.use(n.length+r.length),n.concat(r)}function kr(e,t){return Or.call(this,e,[t])}function Ar(e,t){let n=vt(e);this.context.memoryLimit.use(n.length);let r=[...n];return r.unshift(t),r}function jr(e){let t=[...vt(e)];return t.pop(),t}function Mr(e){let t=vt(e);this.context.memoryLimit.use(t.length);let n=[...t];return n.shift(),n}function Nr(e,t,n=1){return e=M(e),St(e)?[]:(wt(e)||(e=j(e)),t=t<0?e.length+t:t,this.context.memoryLimit.use(n),e.slice(t,t+n))}function Pr(e){return this.context.opts.jekyllWhere?t=>oa.is(e)?bn(t,e):wt(t)?Sn(t,e):bn(t,e):e===void 0?e=>vn(e,this.context):t=>bn(t,e)}function*Fr(e,t,n,r){let i=[];t=vt(t),this.context.memoryLimit.use(t.length);let a=new so(j(n)).readScopeValue();for(let e of t)i.push(yield pn(a,this.context.spawn(e)));let o=Pr.call(this,r);return t.filter((t,n)=>o(i[n])===e)}function*Ir(e,t,n,r){let i=[],a=new mo(j(r),this.liquid),o=vt(t);this.context.memoryLimit.use(o.length);for(let t of o){this.context.push({[n]:t});let r=yield a.value(this.context);this.context.pop(),r===e&&i.push(t)}return i}function*Lr(e,t,n){return yield*Fr.call(this,!0,e,t,n)}function*Rr(e,t,n){return yield*Fr.call(this,!1,e,t,n)}function*zr(e,t,n){return yield*Ir.call(this,!0,e,t,n)}function*Br(e,t,n){return yield*Ir.call(this,!1,e,t,n)}function*Vr(e,t){let n=new Map;e=_t(e);let r=new so(j(t)).readScopeValue();this.context.memoryLimit.use(e.length);for(let t of e){let e=yield pn(r,this.context.spawn(t));n.has(e)||n.set(e,[]),n.get(e).push(t)}return[...n.entries()].map(([e,t])=>({name:e,items:t}))}function*Hr(e,t,n){let r=new Map,i=new mo(j(n),this.liquid);e=_t(e),this.context.memoryLimit.use(e.length);for(let n of e){this.context.push({[t]:n});let e=yield i.value(this.context);this.context.pop(),r.has(e)||r.set(e,[]),r.get(e).push(n)}return[...r.entries()].map(([e,t])=>({name:e,items:t}))}function*Ur(e,t,n){let r=new so(j(t)).readScopeValue(),i=vt(e),a=Pr.call(this,n);for(let e=0;e<i.length;e++)if(a(yield pn(r,this.context.spawn(i[e]))))return[e,i[e]]}function*Wr(e,t,n){let r=new mo(j(n),this.liquid),i=vt(e);for(let e=0;e<i.length;e++){this.context.push({[t]:i[e]});let n=yield r.value(this.context);if(this.context.pop(),n)return[e,i[e]]}}function*Gr(e,t,n){return!!(yield*Ur.call(this,e,t,n))}function*Kr(e,t,n){return!!(yield*Wr.call(this,e,t,n))}function*qr(e,t,n){let r=yield*Ur.call(this,e,t,n);return r?r[0]:void 0}function*Jr(e,t,n){let r=yield*Wr.call(this,e,t,n);return r?r[0]:void 0}function*Yr(e,t,n){let r=yield*Ur.call(this,e,t,n);return r?r[1]:void 0}function*Xr(e,t,n){let r=yield*Wr.call(this,e,t,n);return r?r[1]:void 0}function Zr(e){return e=vt(e),this.context.memoryLimit.use(e.length),[...new Set(e)]}function Qr(e,t=1){if(e=M(e),St(e))return[];wt(e)||(e=j(e)),this.context.memoryLimit.use(t);let n=[...e].sort(()=>Math.random()-.5);return t===1?n[0]:n.slice(0,t)}function $r(e,t,n){let r=(e?.length??0)+(t?.length??0)+(n?.length??0);this.context.memoryLimit.use(r);let i=ai(e,this.context.opts,n);return i?(t=M(t),t=St(t)?this.context.opts.dateFormat:j(t),sn(i,t)):e}function ei(e){return $r.call(this,e,`%Y-%m-%dT%H:%M:%S%:z`)}function ti(e){return $r.call(this,e,`%a, %d %b %Y %H:%M:%S %z`)}function ni(e,t,n){return ii.call(this,e,`%b`,t,n)}function ri(e,t,n){return ii.call(this,e,`%B`,t,n)}function ii(e,t,n,r){let i=ai(e,this.context.opts);if(!i)return e;if(n===`ordinal`){let e=i.getDate();return r===`US`?sn(i,`${t} ${e}%q, %Y`):sn(i,`${e}%q ${t} %Y`)}return sn(i,`%d ${t} %Y`)}function ai(e,t,n){let r,i=n??t.timezoneOffset,a=t.locale;if(e=M(e),!St(e))return r=e===`now`||e===`today`?new Ea(Date.now(),a,i):bt(e)?new Ea(e*1e3,a,i):A(e)?/^\d+$/.test(e)?new Ea(e*1e3,a,i):t.preserveTimezones&&n===void 0?Ea.createDateFixedToTimezone(e,a):new Ea(e,a,i):new Ea(e,a,i),r.valid()?r:void 0}function oi(e,t){Gt(arguments.length===2,`append expect 2 arguments`);let n=j(e),r=j(t);return this.context.memoryLimit.use(n.length+r.length),n+r}function si(e,t){Gt(arguments.length===2,`prepend expect 2 arguments`);let n=j(e),r=j(t);return this.context.memoryLimit.use(n.length+r.length),r+n}function ci(e,t){let n=j(e);if(this.context.memoryLimit.use(n.length),t){t=j(t),this.context.memoryLimit.use(t.length);for(let e=0,r=new Set(t);e<n.length;e++)if(!r.has(n[e]))return n.slice(e);return``}return n.trimStart()}function li(e){let t=j(e);return this.context.memoryLimit.use(t.length),t.toLowerCase()}function ui(e){let t=j(e);return this.context.memoryLimit.use(t.length),j(t).toUpperCase()}function di(e,t){let n=j(e);return t=j(t),this.context.memoryLimit.use(n.length+t.length),n.split(t).join(``)}function fi(e,t){let n=j(e);return t=j(t),this.context.memoryLimit.use(n.length+t.length),n.replace(t,``)}function pi(e,t){let n=j(e),r=j(t);this.context.memoryLimit.use(n.length+r.length);let i=n.lastIndexOf(r);return i===-1?n:n.substring(0,i)+n.substring(i+r.length)}function mi(e,t){if(e=j(e),this.context.memoryLimit.use(e.length),t){t=j(t),this.context.memoryLimit.use(t.length);for(let n=e.length-1,r=new Set(t);n>=0;n--)if(!r.has(e[n]))return e.slice(0,n+1);return``}return e.trimEnd()}function hi(e,t){let n=j(e);this.context.memoryLimit.use(n.length);let r=n.split(j(t));for(;r.length&&r[r.length-1]===``;)r.pop();return r}function gi(e,t){let n=j(e);if(this.context.memoryLimit.use(n.length),t){let e=new Set(j(t));this.context.memoryLimit.use(e.size);let r=0,i=n.length-1;for(;e.has(n[r]);)r++;for(;i>=r&&e.has(n[i]);)i--;return n.slice(r,i+1)}return n.trim()}function _i(e){let t=j(e);return this.context.memoryLimit.use(t.length),t.replace(/\r?\n/gm,``)}function vi(e){return e=j(e),this.context.memoryLimit.use(e.length),e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function yi(e,t,n){let r=j(e);t=j(t),n=j(n);let i=r.split(t),a=r.length+(i.length-1)*(n.length-t.length);return this.context.memoryLimit.use(a),i.join(n)}function bi(e,t,n){let r=j(e);return t=j(t),n=j(n),this.context.memoryLimit.use(r.length+t.length+n.length),r.replace(t,()=>n)}function xi(e,t,n){let r=j(e),i=j(t),a=j(n);this.context.memoryLimit.use(r.length+i.length+a.length);let o=r.lastIndexOf(i);return o===-1?r:r.substring(0,o)+a+r.substring(o+i.length)}function Si(e,t=50,n=`...`){let r=j(e);return n=j(n),this.context.memoryLimit.use(r.length+n.length),r.length<=t?e:r.substring(0,t-n.length)+n}function Ci(e,t=15,n=`...`){let r=j(e);n=j(n),this.context.memoryLimit.use(r.length+n.length);let i=r.split(/\s+/);t<=0&&(t=1);let a=i.slice(0,t).join(` `);return i.length>=t&&(a+=n),a}function wi(e){let t=j(e);return this.context.memoryLimit.use(t.length),t.replace(/\s+/g,` `)}function Ti(e,t){let n=j(e);if(this.context.memoryLimit.use(n.length),e=n.trim(),!e)return 0;switch(t){case`cjk`:return(e.match(es)||[]).length+(e.match(ts)||[]).length;case`auto`:return es.test(e)?e.match(es).length+(e.match(ts)||[]).length:e.split(/\s+/).length;default:return e.split(/\s+/).length}}function Ei(e,t=`and`){switch(t=j(t),this.context.memoryLimit.use(e.length+t.length),e.length){case 0:return``;case 1:return e[0];case 2:return`${e[0]} ${t} ${e[1]}`;default:return`${e.slice(0,-1).join(`, `)}, ${t} ${e[e.length-1]}`}}function Di(e){return btoa(String.fromCharCode(...new TextEncoder().encode(e)))}function Oi(e){return new TextDecoder().decode(Uint8Array.from(atob(e),e=>e.charCodeAt(0)))}function ki(e){let t=j(e);return this.context.memoryLimit.use(t.length),Di(t)}function Ai(e){let t=j(e);return this.context.memoryLimit.use(t.length),Oi(t)}function ji(e){return[...e].reverse()}function Mi(e,t){return e.slice(t)}function Ni(e,t){return e.slice(0,t)}function Pi(e,t,n){if(t.options.dynamicPartials){let t=e.readValue();return e.assert(t,`illegal file path`),t.getText()===`none`?void 0:sr(t)?Fi(n.parse(hn(t))):t}let r=[...e.readFileNameTemplate(t.options)],i=Fi(n.parseTokens(r));return i===`none`?void 0:i}function Fi(e){return e.length===1&&ir(e[0].token)?e[0].token.getContent():e}function*Ii(e,t,n){return typeof e==`string`?e:Array.isArray(e)?n.renderer.renderTemplates(e,t):yield pn(e,t)}var Li,Ri,zi,Bi,Vi,Hi,Ui,Wi,Gi,Ki,qi,Ji,Yi,Xi,Zi,Qi,$i,ea,ta,na,ra,ia,aa,oa,sa,ca,la,ua,da,fa,pa,ma,ha,ga,_a,va,ya,ba,xa,Sa,Ca,wa,Ta,Ea,Da,Oa,ka,Aa,ja,Ma,Na,Pa,Fa,Ia,La,Ra,za,Ba,Va,Ha,Ua,Wa,Ga,Ka,qa,Ja,Ya,Xa,Za,Qa,$a,eo,to,no,ro,io,ao,oo,so,co,lo,uo,fo,po,mo,ho,go,_o,vo,yo,bo,xo,So,Co,wo,To,Eo,Do,Oo,ko,Ao,jo,Mo,No,Po,Fo,Io,Lo,Ro,zo,Bo,Vo,Ho,Uo,Wo,Go,Ko,qo,Jo,Yo,Xo,Zo,Qo,$o,es,ts,ns,rs,is,as,ss,cs,ls,us,ds,fs,ps,ms,hs,gs,_s,vs,ys,bs,xs,Ss,Cs,ws,Ts,Es,Ds,Os,ks,As,js,Ms=d((()=>{Li=class{constructor(e,t,n,r,i){this.kind=e,this.input=t,this.begin=n,this.end=r,this.file=i}getText(){return this.input.slice(this.begin,this.end)}getPosition(){let[e,t]=[1,1];for(let n=0;n<this.begin;n++)this.input[n]===`
7
- `?(e++,t=1):t++;return[e,t]}size(){return this.end-this.begin}},Ri=class{liquidMethodMissing(e,t){}},zi=Object.prototype.toString,Bi=String.prototype.toLowerCase,Vi=Object.hasOwnProperty,Hi=`__liquidClass__`,Ui=class extends Error{constructor(e,t){super(typeof e==`string`?e:e.message),this.context=``,typeof e!=`string`&&Object.defineProperty(this,`originalError`,{value:e,enumerable:!1}),Object.defineProperty(this,`token`,{value:t,enumerable:!1}),Object.defineProperty(this,Hi,{value:`LiquidError`,enumerable:!1})}update(){Object.defineProperty(this,`context`,{value:Ht(this.token),enumerable:!1}),this.message=Ut(this.message,this.token),this.stack=this.message+`
8
- `+this.context+`
9
- `+this.stack,this.originalError&&(this.stack+=`
10
- From `+this.originalError.stack)}static is(e){return e?.[Hi]===`LiquidError`}},Wi=class extends Ui{constructor(e,t){super(e,t),this.name=`TokenizationError`,super.update()}},Gi=class extends Ui{constructor(e,t){super(e,t),this.name=`ParseError`,this.message=e.message,super.update()}},Ki=class extends Ui{constructor(e,t){super(e,t.token),this.name=`RenderError`,this.message=e.message,super.update()}static is(e){return e.name===`RenderError`}},qi=class extends Ui{constructor(e){super(e[0],e[0].token),this.errors=e,this.name=`LiquidErrors`;let t=e.length>1?`s`:``;this.message=`${e.length} error${t} found`,super.update()}static is(e){return e.name===`LiquidErrors`}},Ji=class extends Ui{constructor(e,t){super(e,t),this.name=`UndefinedVariableError`,this.message=e.message,super.update()}},Yi=class extends Error{constructor(e){super(`undefined variable: ${e}`),this.name=`InternalUndefinedVariableError`,this.variableName=e}},Xi=class extends Error{constructor(e){super(e),this.name=`AssertionError`,this.message=e+``}},Zi=[0,0,0,0,0,0,0,0,0,20,4,4,4,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,2,8,0,0,0,0,8,0,0,0,64,0,65,0,0,33,33,33,33,33,33,33,33,33,33,0,0,2,2,2,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0],Qi=1,$i=4,ea=8,ta=16,na=32,ra=64,ia=128,Zi[160]=Zi[5760]=Zi[6158]=Zi[8192]=Zi[8193]=Zi[8194]=Zi[8195]=Zi[8196]=Zi[8197]=Zi[8198]=Zi[8199]=Zi[8200]=Zi[8201]=Zi[8202]=Zi[8232]=Zi[8233]=Zi[8239]=Zi[8287]=Zi[12288]=$i,Zi[8220]=Zi[8221]=ia,aa=class extends Ri{equals(e){return St(M(e))}gt(){return!1}geq(){return!1}lt(){return!1}leq(){return!1}valueOf(){return null}},oa=class e extends Ri{equals(t){return t instanceof e?!1:(t=M(t),A(t)||wt(t)?t.length===0:kt(t)?Object.keys(t).length===0:!1)}gt(){return!1}geq(){return!1}lt(){return!1}leq(){return!1}valueOf(){return``}static is(t){return t instanceof e}},sa=class e extends oa{equals(e){return e===!1||St(M(e))?!0:A(e)?/^\s*$/.test(e):super.equals(e)}static is(t){return t instanceof e}},ca=class extends Ri{constructor(e,t,n){super(),this.i=0,this.length=e,this.name=`${n}-${t}`}next(){this.i++}index0(){return this.i}index(){return this.i+1}first(){return this.i===0}last(){return this.i===this.length-1}rindex(){return this.length-this.i}rindex0(){return this.length-this.i-1}valueOf(){return JSON.stringify(this)}},la=class{constructor(){this.buffer=``}write(e){this.buffer+=j(e)}},ua=class{constructor(){throw this.buffer=``,this.stream=null,Error(`streaming not supported in browser`)}},da=class{constructor(){this.buffer=``}write(e){e=M(e),typeof e!=`string`&&this.buffer===``?this.buffer=e:this.buffer=j(this.buffer)+j(e)}},fa=class extends Ri{constructor(e=()=>``){super(),this.superBlockRender=e}*super(){let e=new la;return yield this.superBlockRender(e),e.buffer}},pa=new aa,ma={true:!0,false:!1,nil:pa,null:pa,empty:new oa,blank:new sa},ha=function(){return ha=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ha.apply(this,arguments)},ga=/%([-_0^#:]+)?(\d+)?([EO])?(.)/,_a={d:2,e:2,H:2,I:2,j:3,k:2,l:2,L:3,m:2,M:2,S:2,U:2,W:2},va=new Set(`aAbBceklpP`),ya={a:e=>e.getShortWeekdayName(),A:e=>e.getLongWeekdayName(),b:e=>e.getShortMonthName(),B:e=>e.getLongMonthName(),c:e=>e.toLocaleString(),C:e=>an(e),d:e=>e.getDate(),e:e=>e.getDate(),H:e=>e.getHours(),I:e=>String(e.getHours()%12||12),j:e=>en(e),k:e=>e.getHours(),l:e=>String(e.getHours()%12||12),L:e=>e.getMilliseconds(),m:e=>e.getMonth()+1,M:e=>e.getMinutes(),N:(e,t)=>{let n=Number(t.width)||9;return Mt(String(e.getMilliseconds()).slice(0,n),n,`0`)},p:e=>e.getHours()<12?`AM`:`PM`,P:e=>e.getHours()<12?`am`:`pm`,q:e=>rn(e),s:e=>Math.round(e.getTime()/1e3),S:e=>e.getSeconds(),u:e=>e.getDay()||7,U:e=>tn(e,0),w:e=>e.getDay(),W:e=>tn(e,1),x:e=>e.toLocaleDateString(),X:e=>e.toLocaleTimeString(),y:e=>e.getFullYear().toString().slice(2,4),Y:e=>e.getFullYear(),z:on,Z:(e,t)=>e.getTimeZoneName()||on(e,t),t:()=>` `,n:()=>`
11
- `,"%":()=>`%`},ya.h=ya.b,ba=6e4,xa=/([zZ]|([+-])(\d{2}):?(\d{2}))$/,Sa=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],Ca=Sa.map(e=>e.slice(0,3)),wa=[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],Ta=wa.map(e=>e.slice(0,3)),Ea=class e{constructor(t,n,r){this.locale=n,this.DateTimeFormat=ln(),this.date=new Date(t),this.timezoneFixed=r!==void 0,r===void 0&&(r=this.date.getTimezoneOffset()),this.timezoneOffset=A(r)?e.getTimezoneOffset(r,this.date):r,this.timezoneName=A(r)?r:``;let i=(this.date.getTimezoneOffset()-this.timezoneOffset)*ba,a=this.date.getTime()+i;this.displayDate=new Date(a)}getTime(){return this.displayDate.getTime()}getMilliseconds(){return this.displayDate.getMilliseconds()}getSeconds(){return this.displayDate.getSeconds()}getMinutes(){return this.displayDate.getMinutes()}getHours(){return this.displayDate.getHours()}getDay(){return this.displayDate.getDay()}getDate(){return this.displayDate.getDate()}getMonth(){return this.displayDate.getMonth()}getFullYear(){return this.displayDate.getFullYear()}toLocaleString(e,t){return t?.timeZone?this.date.toLocaleString(e,t):this.displayDate.toLocaleString(e,t)}toLocaleTimeString(e){return this.displayDate.toLocaleTimeString(e)}toLocaleDateString(e){return this.displayDate.toLocaleDateString(e)}getTimezoneOffset(){return this.timezoneOffset}getTimeZoneName(){if(this.timezoneFixed)return this.timezoneName;if(this.DateTimeFormat)return this.DateTimeFormat().resolvedOptions().timeZone}getLongMonthName(){return this.format({month:`long`})??Sa[this.getMonth()]}getShortMonthName(){return this.format({month:`short`})??Ca[this.getMonth()]}getLongWeekdayName(){return this.format({weekday:`long`})??wa[this.displayDate.getDay()]}getShortWeekdayName(){return this.format({weekday:`short`})??Ta[this.displayDate.getDay()]}valid(){return!isNaN(this.getTime())}format(e){return this.DateTimeFormat&&this.DateTimeFormat(this.locale,e).format(this.displayDate)}static createDateFixedToTimezone(t,n){let r=t.match(xa);if(r&&r[1]===`Z`)return new e(+new Date(t),n,0);if(r&&r[2]&&r[3]&&r[4]){let[,,i,a,o]=r,s=(i===`+`?-1:1)*(parseInt(a,10)*60+parseInt(o,10));return new e(+new Date(t),n,s)}return new e(t,n)}static getTimezoneOffset(e,t){let n=t.toLocaleString(`en-US`,{timeZone:e}),r=t.toLocaleString(`en-US`,{timeZone:`UTC`}),i=new Date(n);return(new Date(r)-+i)/(60*1e3)}},Da=class{constructor(e,t){this.base=0,this.message=`${e} limit exceeded`,this.limit=t}use(e){+e>0&&(Gt(this.base+ +e<=this.limit,this.message),this.base+=+e)}check(e){+e>0&&Gt(+e<=this.limit,this.message)}},Oa=class extends Li{constructor(e,[t,n],r,i,a,o,s,c){super(e,r,i,a,c),this.trimLeft=!1,this.trimRight=!1;let l=r[t]===`-`,u=r[n-1]===`-`,d=l?t+1:t,f=u?n-1:n;for(;d<f&&Zi[r.charCodeAt(d)]&$i;)d++;for(;f>d&&Zi[r.charCodeAt(f-1)]&$i;)f--;this.contentRange=[d,f],this.trimLeft=l||o,this.trimRight=u||s}get content(){return this.input.slice(this.contentRange[0],this.contentRange[1])}},ka=class extends Oa{constructor(e,t,n,r,i){let{trimTagLeft:a,trimTagRight:o,tagDelimiterLeft:s,tagDelimiterRight:c}=r,[l,u]=[t+s.length,n-c.length];super(To.Tag,[l,u],e,t,n,a,o,i),this.tokenizer=new so(e,r.operators,i,this.contentRange),this.name=this.tokenizer.readTagName(),this.tokenizer.assert(this.name,`illegal tag syntax, tag name expected`),this.tokenizer.skipBlank(),this.args=this.tokenizer.input.slice(this.tokenizer.p,this.contentRange[1])}},Aa=class extends Oa{constructor(e,t,n,r,i){let{trimOutputLeft:a,trimOutputRight:o,outputDelimiterLeft:s,outputDelimiterRight:c}=r,l=[t+s.length,n-c.length];super(To.Output,l,e,t,n,a,o,i)}},ja=class extends Li{constructor(e,t,n,r){super(To.HTML,e,t,n,r),this.input=e,this.begin=t,this.end=n,this.file=r,this.trimLeft=0,this.trimRight=0}getContent(){return this.input.slice(this.begin+this.trimLeft,this.end-this.trimRight)}},Ma=class extends Li{constructor(e,t,n,r){super(To.Number,e,t,n,r),this.input=e,this.begin=t,this.end=n,this.file=r,this.content=Number(this.getText())}},Na=class extends Li{constructor(e,t,n,r){super(To.Word,e,t,n,r),this.input=e,this.begin=t,this.end=n,this.file=r,this.content=this.getText()}},Pa=class extends Li{constructor(e,t,n,r){super(To.Literal,e,t,n,r),this.input=e,this.begin=t,this.end=n,this.file=r,this.literal=this.getText(),this.content=ma[this.literal]}},Fa={"==":2,"!=":2,">":2,"<":2,">=":2,"<=":2,contains:2,not:1,and:0,or:0},Ia={"==":0,"!=":0,">":0,"<":0,">=":0,"<=":0,contains:0,not:1,and:0,or:0},La=class extends Li{constructor(e,t,n,r){super(To.Operator,e,t,n,r),this.input=e,this.begin=t,this.end=n,this.file=r,this.operator=this.getText()}getPrecedence(){let e=this.getText();return e in Fa?Fa[e]:1}},Ra=class extends Li{constructor(e,t,n,r,i,a){super(To.PropertyAccess,n,r,i,a),this.variable=e,this.props=t}},za=class extends Li{constructor(e,t,n,r,i,a){super(To.Filter,n,r,i,a),this.name=e,this.args=t}},Ba=class extends Li{constructor(e,t,n,r,i,a){super(To.Hash,e,t,n,a),this.input=e,this.begin=t,this.end=n,this.name=r,this.value=i,this.file=a}},Va=/[\da-fA-F]/,Ha=/[0-7]/,Ua={b:`\b`,f:`\f`,n:`
12
- `,r:`\r`,t:` `,v:`\v`},Wa=class extends Li{constructor(e,t,n,r){super(To.Quoted,e,t,n,r),this.input=e,this.begin=t,this.end=n,this.file=r,this.content=dn(this.getText())}},Ga=class extends Li{constructor(e,t,n,r,i,a){super(To.Range,e,t,n,a),this.input=e,this.begin=t,this.end=n,this.lhs=r,this.rhs=i,this.file=a}},Ka=class extends Oa{constructor(e,t,n,r,i){super(To.Tag,[t,n],e,t,n,!1,!1,i),this.tokenizer=new so(e,r.operators,i,this.contentRange),this.name=this.tokenizer.readTagName(),this.tokenizer.assert(this.name,`illegal liquid tag syntax`),this.tokenizer.skipBlank()}get args(){return this.tokenizer.input.slice(this.tokenizer.p,this.contentRange[1])}},qa=class extends Li{constructor(e,t,n,r,i,a){super(To.FilteredValue,n,r,i,a),this.initial=e,this.filters=t,this.input=n,this.begin=r,this.end=i,this.file=a}},Ja={now:()=>Date.now()},Ya=class{renderTemplatesToNodeStream(e,t){let n=new ua;return Promise.resolve().then(()=>Zt(this.renderTemplates(e,t,n))).then(()=>n.end(),e=>n.error(e)),n.stream}*renderTemplates(e,t,n){n||=t.opts.keepOutputType?new da:new la;let r=[];for(let i of e){t.renderLimit.check(fn().now());try{let e=yield i.render(t,n);if(e&&n.write(e),t.breakCalled||t.continueCalled)break}catch(e){let n=Ui.is(e)?e:new Ki(e,i);if(t.opts.catchAllErrors)r.push(n);else throw n}}if(r.length)throw new qi(r);return n.buffer}},Xa=class{constructor(e){this.postfix=[..._n(e)]}*evaluate(e,t){Gt(e,`unable to evaluate: context not defined`);let n=[];for(let r of this.postfix)if(rr(r)){let t=n.pop(),i;if(Ia[r.operator]===1)i=yield e.opts.operators[r.operator](t,e);else{let a=n.pop();i=yield e.opts.operators[r.operator](a,t,e)}n.push(i)}else n.push(yield pn(r,e,t));return n[0]}valid(){return!!this.postfix.length}},Za={"==":bn,"!=":(e,t)=>!bn(e,t),">":(e,t)=>qt(e)?e.gt(t):qt(t)?t.lt(e):M(e)>M(t),"<":(e,t)=>qt(e)?e.lt(t):qt(t)?t.gt(e):M(e)<M(t),">=":(e,t)=>qt(e)?e.geq(t):qt(t)?t.leq(e):M(e)>=M(t),"<=":(e,t)=>qt(e)?e.leq(t):qt(t)?t.geq(e):M(e)<=M(t),contains:(e,t)=>(e=M(e),wt(e)?e.some(e=>bn(e,t)):mt(e?.indexOf)?e.indexOf(M(t))>-1:!1),not:(e,t)=>yn(M(e),t),and:(e,t,n)=>vn(M(e),n)&&vn(M(t),n),or:(e,t,n)=>vn(M(e),n)||vn(M(t),n)},Qa=class{constructor(e,t,n,r){this.key=e,this.value=t,this.next=n,this.prev=r}},$a=class{constructor(e,t=0){this.limit=e,this.size=t,this.cache={},this.head=new Qa(`HEAD`,null,null,null),this.tail=new Qa(`TAIL`,null,null,null),this.head.next=this.tail,this.tail.prev=this.head}write(e,t){if(this.cache[e])this.cache[e].value=t;else{let n=new Qa(e,t,this.head.next,this.head);this.head.next.prev=n,this.head.next=n,this.cache[e]=n,this.size++,this.ensureLimit()}}read(e){if(!this.cache[e])return;let{value:t}=this.cache[e];return this.remove(e),this.write(e,t),t}remove(e){let t=this.cache[e];t.prev.next=t.next,t.next.prev=t.prev,delete this.cache[e],this.size--}clear(){this.head.next=this.tail,this.tail.prev=this.head,this.size=0,this.cache={}}ensureLimit(){this.size>this.limit&&this.remove(this.tail.prev.key)}},eo=Object.freeze({__proto__:null,resolve:wn,readFile:Tn,readFileSync:En,exists:Dn,existsSync:On,dirname:kn,sep:`/`}),to={default:An,raw:{raw:!0,handler:Pt},jsonify:jn,to_integer:Nn,json:jn,inspect:Mn},no={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&#34;`,"'":`&#39;`},ro={"&amp;":`&`,"&lt;":`<`,"&gt;":`>`,"&#34;":`"`,"&#39;":`'`},io=Object.freeze({__proto__:null,escape:Pn,xml_escape:Fn,escape_once:Ln,newline_to_br:Rn,strip_html:zn}),ao=class{constructor(e){this.mapping=e,this.sep=`/`}exists(e){return Yt(this,void 0,void 0,function*(){return this.existsSync(e)})}existsSync(e){return!St(this.mapping[e])}readFile(e){return Yt(this,void 0,void 0,function*(){return this.readFileSync(e)})}readFileSync(e){let t=this.mapping[e];if(St(t))throw Error(`ENOENT: ${e}`);return t}dirname(e){let t=e.split(this.sep);return t.pop(),t.join(this.sep)}resolve(e,t,n){if(t+=n,e===`.`)return t;let r=e.split(/\/+/);for(let e of t.split(this.sep))if(e===`.`||e===``)continue;else e===`..`?(r.length>1||r[0]!==``)&&r.pop():r.push(e);return r.join(this.sep)}},oo={root:[`.`],layouts:[`.`],partials:[`.`],relativeReference:!0,jekyllInclude:!1,keyValueSeparator:`:`,cache:void 0,extname:``,fs:eo,dynamicPartials:!0,jsTruthy:!1,dateFormat:`%A, %B %-e, %Y at %-l:%M %P %z`,locale:``,trimTagRight:!1,trimTagLeft:!1,trimOutputRight:!1,trimOutputLeft:!1,greedy:!0,tagDelimiterLeft:`{%`,tagDelimiterRight:`%}`,outputDelimiterLeft:`{{`,outputDelimiterRight:`}}`,preserveTimezones:!1,strictFilters:!1,strictVariables:!1,ownPropertyOnly:!0,lenientIf:!1,globals:{},keepOutputType:!1,operators:Za,memoryLimit:1/0,parseLimit:1/0,renderLimit:1/0},so=class{constructor(e,t=oo.operators,n,r){this.input=e,this.file=n,this.rawBeginAt=-1,this.p=r?r[0]:0,this.N=r?r[1]:e.length,this.opTrie=Jt(t),this.literalTrie=Jt(ma)}readExpression(){return new Xa(this.readExpressionTokens())}*readExpressionTokens(){for(;this.p<this.N;){let e=this.readOperator();if(e){yield e;continue}let t=this.readValue();if(t){yield t;continue}return}}readOperator(){this.skipBlank();let e=this.matchTrie(this.opTrie);if(e!==-1)return new La(this.input,this.p,this.p=e,this.file)}matchTrie(e){let t=e,n=this.p,r;for(;t[this.input[n]]&&n<this.N;)t=t[this.input[n++]],t.end&&(r=t);return!r||r.needBoundary&&Wt(this.peek(n-this.p))?-1:n}readFilteredValue(){let e=this.p,t=this.readExpression();return this.assert(t.valid(),`invalid value expression: ${this.snapshot()}`),new qa(t,this.readFilters(),this.input,e,this.p,this.file)}readFilters(){let e=[];for(;;){let t=this.readFilter();if(!t)return e;e.push(t)}}readFilter(){if(this.skipBlank(),this.end())return null;this.assert(this.read()===`|`,`expected "|" before filter`);let e=this.readIdentifier();if(!e.size())return this.assert(this.end(),`expected filter name`),null;let t=[];if(this.skipBlank(),this.peek()===`:`)do{++this.p;let e=this.readFilterArg();e&&t.push(e),this.skipBlank(),this.assert(this.end()||this.peek()===`,`||this.peek()===`|`,()=>`unexpected character ${this.snapshot()}`)}while(this.peek()===`,`);else if(!(this.peek()===`|`||this.end()))throw this.error(`expected ":" after filter name`);return new za(e.getText(),t,this.input,e.begin,this.p,this.file)}readFilterArg(){let e=this.readValue();if(!e)return;if(this.skipBlank(),this.peek()!==`:`)return e;++this.p;let t=this.readValue();return[e.getText(),t]}readTopLevelTokens(e=oo){let t=[];for(;this.p<this.N;){let n=this.readTopLevelToken(e);t.push(n)}return Un(t,e),t}readTopLevelToken(e){let{tagDelimiterLeft:t,outputDelimiterLeft:n}=e;return this.rawBeginAt>-1?this.readEndrawOrRawContent(e):this.match(t)?this.readTagToken(e):this.match(n)?this.readOutputToken(e):this.readHTMLToken([t,n])}readHTMLToken(e){let t=this.p;for(;this.p<this.N&&!e.some(e=>this.match(e));)++this.p;return new ja(this.input,t,this.p,this.file)}readTagToken(e){let{file:t,input:n}=this,r=this.p;if(this.readToDelimiter(e.tagDelimiterRight)===-1)throw this.error(`tag ${this.snapshot(r)} not closed`,r);let i=new ka(n,r,this.p,e,t);return i.name===`raw`&&(this.rawBeginAt=r),i}readToDelimiter(e,t=!1){for(this.skipBlank();this.p<this.N;){if(t&&this.peekType()&ea){this.readQuoted();continue}if(++this.p,this.rmatch(e))return this.p}return-1}readOutputToken(e=oo){let{file:t,input:n}=this,{outputDelimiterRight:r}=e,i=this.p;if(this.readToDelimiter(r,!0)===-1)throw this.error(`output ${this.snapshot(i)} not closed`,i);return new Aa(n,i,this.p,e,t)}readEndrawOrRawContent(e){let{tagDelimiterLeft:t,tagDelimiterRight:n}=e,r=this.p,i=this.readTo(t)-t.length;for(;this.p<this.N;){if(this.readIdentifier().getText()!==`endraw`){i=this.readTo(t)-t.length;continue}for(;this.p<=this.N;){if(this.rmatch(n)){let t=this.p;return r===i?(this.rawBeginAt=-1,new ka(this.input,r,t,e,this.file)):(this.p=i,new ja(this.input,r,i,this.file))}if(this.rmatch(t))break;this.p++}}throw this.error(`raw ${this.snapshot(this.rawBeginAt)} not closed`,r)}readLiquidTagTokens(e=oo){let t=[];for(;this.p<this.N;){let n=this.readLiquidTagToken(e);n&&t.push(n)}return t}readLiquidTagToken(e){if(this.skipBlank(),this.end())return;let t=this.p;this.readToDelimiter(`
13
- `);let n=this.p;return new Ka(this.input,t,n,e,this.file)}error(e,t=this.p){return new Wi(e,new Na(this.input,t,this.N,this.file))}assert(e,t,n){if(!e)throw this.error(typeof t==`function`?t():t,n)}snapshot(e=this.p){return JSON.stringify(It(this.input.slice(e,this.N),32))}readWord(){return this.readIdentifier()}readIdentifier(){this.skipBlank();let e=this.p;for(;!this.end()&&Wt(this.peek());)++this.p;return new Na(this.input,e,this.p,this.file)}readNonEmptyIdentifier(){let e=this.readIdentifier();return e.size()?e:void 0}readTagName(){return this.skipBlank(),this.input[this.p]===`#`?this.input.slice(this.p,++this.p):this.readIdentifier().getText()}readHashes(e){let t=[];for(;;){let n=this.readHash(e);if(!n)return t;t.push(n)}}readHash(e){this.skipBlank(),this.peek()===`,`&&++this.p;let t=this.p,n=this.readNonEmptyIdentifier();if(!n)return;let r;this.skipBlank();let i=A(e)?e:e?`=`:`:`;return this.peek()===i&&(++this.p,r=this.readValue()),new Ba(this.input,t,this.p,n,r,this.file)}remaining(){return this.input.slice(this.p,this.N)}advance(e=1){this.p+=e}end(){return this.p>=this.N}read(){return this.input[this.p++]}readTo(e){for(;this.p<this.N;)if(++this.p,this.rmatch(e))return this.p;return-1}readValue(){this.skipBlank();let e=this.p,t=this.readLiteral()||this.readQuoted()||this.readRange()||this.readNumber(),n=this.readProperties(!t);return n.length?new Ra(t,n,this.input,e,this.p):t}readScopeValue(){this.skipBlank();let e=this.p,t=this.readProperties();if(t.length)return new Ra(void 0,t,this.input,e,this.p)}readProperties(e=!0){let t=[];for(;;){if(this.peek()===`[`){this.p++;let e=this.readValue()||new Na(this.input,this.p,this.p,this.file);this.assert(this.readTo(`]`)!==-1,`[ not closed`),t.push(e);continue}if(e&&!t.length){let e=this.readNonEmptyIdentifier();if(e){t.push(e);continue}}if(this.peek()===`.`&&this.peek(1)!==`.`){this.p++;let e=this.readNonEmptyIdentifier();if(!e)break;t.push(e);continue}break}return t}readNumber(){this.skipBlank();let e=!1,t=!1,n=0;for(this.peekType()&ra&&n++;this.p+n<=this.N;)if(this.peekType(n)&na)t=!0,n++;else if(this.peek(n)===`.`&&this.peek(n+1)!==`.`){if(e||!t)return;e=!0,n++}else break;if(t&&!Wt(this.peek(n))){let e=new Ma(this.input,this.p,this.p+n,this.file);return this.advance(n),e}}readLiteral(){this.skipBlank();let e=this.matchTrie(this.literalTrie);if(e===-1)return;let t=new Pa(this.input,this.p,e,this.file);return this.p=e,t}readRange(){this.skipBlank();let e=this.p;if(this.peek()!==`(`)return;++this.p;let t=this.readValueOrThrow();this.skipBlank(),this.assert(this.read()===`.`&&this.read()===`.`,`invalid range syntax`);let n=this.readValueOrThrow();return this.skipBlank(),this.assert(this.read()===`)`,`invalid range syntax`),new Ga(this.input,e,this.p,t,n,this.file)}readValueOrThrow(){let e=this.readValue();return this.assert(e,()=>`unexpected token ${this.snapshot()}, value expected`),e}readQuoted(){this.skipBlank();let e=this.p;if(!(this.peekType()&ea))return;++this.p;let t=!1;for(;this.p<this.N&&(++this.p,!(this.input[this.p-1]===this.input[e]&&!t));)t?t=!1:this.input[this.p-1]===`\\`&&(t=!0);return new Wa(this.input,e,this.p,this.file)}*readFileNameTemplate(e){let{outputDelimiterLeft:t}=e,n=[`,`,` `,`\r`,`
14
- `,` `,t],r=new Set(n);for(;this.p<this.N&&!r.has(this.peek());)yield this.match(t)?this.readOutputToken(e):this.readHTMLToken(n)}match(e){for(let t=0;t<e.length;t++)if(e[t]!==this.input[this.p+t])return!1;return!0}rmatch(e){for(let t=0;t<e.length;t++)if(e[e.length-1-t]!==this.input[this.p-1-t])return!1;return!0}peekType(e=0){return this.p+e>=this.N?0:Zi[this.input.charCodeAt(this.p+e)]}peek(e=0){return this.p+e>=this.N?``:this.input[this.p+e]}skipBlank(){for(;this.peekType()&$i;)++this.p}},co=class{constructor(e,t){this.handlers={},this.stopRequested=!1,this.tokens=e,this.parseToken=t}on(e,t){return this.handlers[e]=t,this}trigger(e,t){let n=this.handlers[e];return n?(n.call(this,t),!0):!1}start(){this.trigger(`start`);let e;for(;!this.stopRequested&&(e=this.tokens.shift());){if(this.trigger(`token`,e)||or(e)&&this.trigger(`tag:${e.name}`,e))continue;let t=this.parseToken(e,this.tokens);this.trigger(`template`,t)}return this.stopRequested||this.trigger(`end`),this}stop(){return this.stopRequested=!0,this}},lo=class{constructor(e){this.token=e}},uo=class extends lo{constructor(e,t,n){super(e),this.name=e.name,this.liquid=n,this.tokenizer=e.tokenizer}},fo=class{constructor(e,t){this.hash={};let n=e instanceof so?e:new so(e,{});for(let e of n.readHashes(t))this.hash[e.name.content]=e.value}*render(e){let t={};for(let n of Object.keys(this.hash))t[n]=this.hash[n]===void 0?!0:yield pn(this.hash[n],e);return t}},po=class{constructor(e,t,n){this.token=e,this.name=e.name,this.handler=mt(t)?t:mt(t?.handler)?t.handler:Pt,this.raw=!mt(t)&&!!t?.raw,this.args=e.args,this.liquid=n}*render(e,t){let n=[];for(let e of this.args)qn(e)?n.push([e[0],yield pn(e[1],t)]):n.push(yield pn(e,t));return yield this.handler.apply({context:t,token:this.token,liquid:this.liquid},[e,...n])}},mo=class{constructor(e,t){this.filters=[];let n=typeof e==`string`?new so(e,t.options.operators).readFilteredValue():e;this.initial=n.initial,this.filters=n.filters.map(e=>new po(e,this.getFilter(t,e.name),t))}*value(e,t){t||=e.opts.lenientIf&&this.filters.length>0&&this.filters[0].name===`default`;let n=yield this.initial.evaluate(e,t);for(let t of this.filters)n=yield t.render(n,e);return n}getFilter(e,t){let n=e.filters[t];return Gt(n||!e.options.strictFilters,()=>`undefined filter: ${t}`),n}},ho=class extends lo{constructor(e,t){super(e),this.value=new mo(new so(e.input,t.options.operators,e.file,e.contentRange).readFilteredValue(),t);let n=this.value.filters,r=t.options.outputEscape;if(!n[n.length-1]?.raw&&r){let e=new za(toString.call(r),[],``,0,0);n.push(new po(e,r,t))}}*render(e,t){let n=yield this.value.value(e,!1);t.write(n)}*arguments(){yield this.value}},go=class extends lo{constructor(e){super(e),this.str=e.getContent()}*render(e,t){t.write(this.str)}},_o=class e{constructor(e,t){this.segments=e,this.location=t}toString(){return tr(this.segments,!0)}toArray(){function*t(...n){for(let r of n)r instanceof e?yield Array.from(t(...r.segments)):yield r}return Array.from(t(...this.segments))}},vo=class{constructor(){this.map=new Map}get(e){let t=tr([e.segments[0]]);return this.map.has(t)||this.map.set(t,[]),this.map.get(t)}has(e){return this.map.has(tr([e.segments[0]]))}push(e){this.get(e).push(e)}asObject(){return Object.fromEntries(this.map)}},yo={partials:!0},bo=class{constructor(e){this.stack=[{names:e,aliases:new Map}]}has(e){for(let t of this.stack)if(t.names.has(e))return!0;return!1}push(e){return this.stack.push({names:e,aliases:new Map}),this}pop(){return this.stack.pop()?.names}add(e){this.stack[0].names.add(e)}alias(e){let t=e.segments[0];if(!A(t))return;let n=this.getAlias(t);if(n!==void 0)return new _o([...n,...e.segments.slice(1)],e.location)}setAlias(e,t){this.stack[this.stack.length-1].aliases.set(e,t)}deleteAlias(e){this.stack[this.stack.length-1].aliases.delete(e)}getAlias(e){for(let t of this.stack){if(t.aliases.has(e))return t.aliases.get(e);if(t.names.has(e))return}}},xo=/^[\u0080-\uFFFFa-zA-Z_][\u0080-\uFFFFa-zA-Z0-9_-]*$/,(function(e){e.Partials=`partials`,e.Layouts=`layouts`,e.Root=`root`})(So||={}),Co=class{constructor(e){if(this.options=e,e.relativeReference){let t=e.fs.sep;Gt(t,"`fs.sep` is required for relative reference");let n=[`.`+t,`..`+t,`./`,`../`];this.shouldLoadRelative=e=>n.some(t=>e.startsWith(t))}else this.shouldLoadRelative=e=>!1;let t=e.fs;this.contains=Xt(t.contains?.bind(t)||(()=>Yt(this,void 0,void 0,function*(){return!0})),t.containsSync?.bind(t)||(()=>!0)),this.exists=Xt(t.exists?.bind(t)||(()=>Yt(this,void 0,void 0,function*(){return!1})),t.existsSync?.bind(t))}*lookup(e,t,n,r){let i=this.options[t];for(let t of this.candidates(e,i,r)){let e=!1;for(let r of i)if(yield this.contains(!!n,r,t)){e=!0;break}if(e&&(yield this.exists(!!n,t)))return t}throw this.lookupError(e,i)}*candidates(e,t,n){let{fs:r,extname:i}=this.options;this.shouldLoadRelative(e)&&n&&(yield r.resolve(this.dirname(n),e,i));for(let n of t)yield r.resolve(n,e,i);if(r.fallback!==void 0){let t=r.fallback(e);t!==void 0&&(yield t)}}dirname(e){let t=this.options.fs;return Gt(t.dirname,"`fs.dirname` is required for relative reference"),t.dirname(e)}lookupError(e,t){let n=Error(`ENOENT`);return n.message=`ENOENT: Failed to lookup "${e}" in "${t}"`,n.code=`ENOENT`,n}},wo=class{constructor(e){this.liquid=e,this.cache=this.liquid.options.cache,this.fs=this.liquid.options.fs,this.parseFile=this.cache?this._parseFileCached:this._parseFile,this.loader=new Co(this.liquid.options),this.parseLimit=new Da(`parse length`,e.options.parseLimit),this.readFile=Xt(this.fs.readFile?.bind(this.fs)||(()=>Yt(this,void 0,void 0,function*(){throw Error(`readFile not implemented`)})),this.fs.readFileSync?.bind(this.fs))}parse(e,t){e=String(e),this.parseLimit.use(e.length);let n=new so(e,this.liquid.options.operators,t).readTopLevelTokens(this.liquid.options);return this.parseTokens(n)}parseTokens(e){let t,n=[],r=[];for(;t=e.shift();)try{n.push(this.parseToken(t,e))}catch(e){if(this.liquid.options.catchAllErrors)r.push(e);else throw e}if(r.length)throw new qi(r);return n}parseToken(e,t){try{if(or(e)){let n=this.liquid.tags[e.name];return Gt(n,`tag "${e.name}" not found`),new n(e,t,this.liquid,this)}return ar(e)?new ho(e,this.liquid):new go(e)}catch(t){throw Ui.is(t)?t:new Gi(t,e)}}parseStream(e){return new co(e,(e,t)=>this.parseToken(e,t))}*_parseFileCached(e,t,n=So.Root,r){let i=this.cache,a=this.loader.shouldLoadRelative(e)?r+`,`+e:n+`:`+e,o=yield i.read(a);if(o)return o;let s=this._parseFile(e,t,n,r),c=t?yield s:Zt(s);i.write(a,c);try{return yield c}catch(e){throw i.remove(a),e}}*_parseFile(e,t,n=So.Root,r){let i=yield this.loader.lookup(e,n,t,r);return this.parse(yield this.readFile(!!t,i),i)}},(function(e){e[e.Number=1]=`Number`,e[e.Literal=2]=`Literal`,e[e.Tag=4]=`Tag`,e[e.Output=8]=`Output`,e[e.HTML=16]=`HTML`,e[e.Filter=32]=`Filter`,e[e.Hash=64]=`Hash`,e[e.PropertyAccess=128]=`PropertyAccess`,e[e.Word=256]=`Word`,e[e.Range=512]=`Range`,e[e.Quoted=1024]=`Quoted`,e[e.Operator=2048]=`Operator`,e[e.FilteredValue=4096]=`FilteredValue`,e[e.Delimited=12]=`Delimited`})(To||={}),Eo=Object.freeze({__proto__:null,isDelimitedToken:nr,isOperatorToken:rr,isHTMLToken:ir,isOutputToken:ar,isTagToken:or,isQuotedToken:sr,isLiteralToken:cr,isNumberToken:lr,isPropertyAccessToken:ur,isWordToken:dr,isRangeToken:fr,isValueToken:pr}),Do=class e{constructor(e={},t=oo,n={},{memoryLimit:r,renderLimit:i}={}){this.scopes=[{}],this.registers={},this.breakCalled=!1,this.continueCalled=!1,this.sync=!!n.sync,this.opts=t,this.globals=n.globals??t.globals,this.environments=kt(e)?e:Object(e),this.strictVariables=n.strictVariables??this.opts.strictVariables,this.ownPropertyOnly=n.ownPropertyOnly??t.ownPropertyOnly,this.memoryLimit=r??new Da(`memory alloc`,n.memoryLimit??t.memoryLimit),this.renderLimit=i??new Da(`template render`,fn().now()+(n.renderLimit??t.renderLimit))}getRegister(e){return this.registers[e]=this.registers[e]||{}}setRegister(e,t){return this.registers[e]=t}saveRegister(...e){return e.map(e=>[e,this.getRegister(e)])}restoreRegister(e){return e.forEach(([e,t])=>this.setRegister(e,t))}getAll(){return[this.globals,this.environments,...this.scopes].reduce((e,t)=>ha(e,t),{})}get(e){return this.getSync(e)}getSync(e){return Qt(this._get(e))}*_get(e){let t=this.findScope(e[0]);return yield this._getFromScope(t,e)}getFromScope(e,t){return Qt(this._getFromScope(e,t))}*_getFromScope(e,t,n=this.strictVariables){A(t)&&(t=t.split(`.`));for(let r=0;r<t.length;r++)if(e=yield this.readProperty(e,t[r]),n&&Ct(e))throw new Yi(t.slice(0,r+1).join(`.`));return e}push(e){return this.scopes.push(e)}pop(){return this.scopes.pop()}bottom(){return this.scopes[0]}spawn(t={}){return new e(t,this.opts,{sync:this.sync,globals:this.globals,strictVariables:this.strictVariables},{renderLimit:this.renderLimit,memoryLimit:this.memoryLimit})}findScope(e){for(let t=this.scopes.length-1;t>=0;t--){let n=this.scopes[t];if(e in n)return n}return e in this.environments?this.environments:this.globals}readProperty(e,t){if(e=xt(e),t=M(t),St(e))return e;if(wt(e)&&t<0)return e[e.length+ +t];let n=hr(e,t,this.ownPropertyOnly);return n===void 0&&e instanceof Ri?e.liquidMethodMissing(t,this):mt(n)?n.call(e):t===`size`?vr(e):t===`first`?gr(e):t===`last`?_r(e):n}},(function(e){e[e.OUTPUT=0]=`OUTPUT`,e[e.STORE=1]=`STORE`})(Oo||={}),ko=Bt(Math.abs),Ao=Bt(Math.max),jo=Bt(Math.min),Mo=Bt(Math.ceil),No=Bt((e,t,n=!1)=>n?Math.floor(e/t):e/t),Po=Bt(Math.floor),Fo=Bt((e,t)=>e-t),Io=Bt((e,t)=>e+t),Lo=Bt((e,t)=>e%t),Ro=Bt((e,t)=>e*t),zo=Object.freeze({__proto__:null,abs:ko,at_least:Ao,at_most:jo,ceil:Mo,divided_by:No,floor:Po,minus:Fo,plus:Io,modulo:Lo,times:Ro,round:yr}),Bo=e=>decodeURIComponent(j(e)).replace(/\+/g,` `),Vo=e=>encodeURIComponent(j(e)).replace(/%20/g,`+`),Ho=e=>encodeURIComponent(j(e)).replace(/%20/g,`+`).replace(/[!'()*]/g,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase()),Uo=e=>encodeURI(j(e)).replace(/%5B/g,`[`).replace(/%5D/g,`]`),Wo=/[^\p{M}\p{L}\p{Nd}]+/gu,Go={raw:/\s+/g,default:Wo,pretty:/[^\p{M}\p{L}\p{Nd}._~!$&'()+,;=@]+/gu,ascii:/[^A-Za-z0-9]+/g,latin:Wo,none:null},Ko=Object.freeze({__proto__:null,url_decode:Bo,url_encode:Vo,cgi_escape:Ho,uri_escape:Uo,slugify:br}),qo=zt(function(e,t){let n=vt(e),r=St(t)?` `:j(t),i=n.length*(1+r.length);return this.context.memoryLimit.use(i),n.join(r)}),Jo=zt(e=>Tt(e)?Ot(e):``),Yo=zt(e=>Tt(e)?e[0]:``),Xo=zt(function(e){let t=vt(e);return this.context.memoryLimit.use(t.length),[...t].reverse()}),Zo=e=>e&&e.length||0,Qo=Object.freeze({__proto__:null,join:qo,last:Jo,first:Yo,reverse:Xo,sort:Cr,sort_natural:wr,size:Zo,map:Tr,sum:Er,compact:Dr,concat:Or,push:kr,unshift:Ar,pop:jr,shift:Mr,slice:Nr,where:Lr,reject:Rr,where_exp:zr,reject_exp:Br,group_by:Vr,group_by_exp:Hr,has:Gr,has_exp:Kr,find_index:qr,find_index_exp:Jr,find:Yr,find_exp:Xr,uniq:Zr,sample:Qr}),$o=Object.freeze({__proto__:null,date:$r,date_to_xmlschema:ei,date_to_rfc822:ti,date_to_string:ni,date_to_long_string:ri}),es=/[\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF]/gu,ts=/[^\u4E00-\u9FFF\uF900-\uFAFF\u3400-\u4DBF\u3040-\u309F\u30A0-\u30FF\uAC00-\uD7AF\s]+/gu,ns=Object.freeze({__proto__:null,append:oi,prepend:si,lstrip:ci,downcase:li,upcase:ui,remove:di,remove_first:fi,remove_last:pi,rstrip:mi,split:hi,strip:gi,strip_newlines:_i,capitalize:vi,replace:yi,replace_first:bi,replace_last:xi,truncate:Si,truncatewords:Ci,normalize_whitespace:wi,number_of_words:Ti,array_to_sentence_string:Ei}),rs=Object.freeze({__proto__:null,base64_encode:ki,base64_decode:Ai}),is=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},io),zo),Ko),Qo),$o),ns),rs),to),as=class extends uo{constructor(e,t,n){super(e,t,n),this.identifier=this.tokenizer.readIdentifier(),this.key=this.identifier.content,this.tokenizer.assert(this.key,`expected variable name`),this.tokenizer.skipBlank(),this.tokenizer.assert(this.tokenizer.peek()===`=`,`expected "="`),this.tokenizer.advance(),this.value=new mo(this.tokenizer.readFilteredValue(),this.liquid)}*render(e){e.bottom()[this.key]=yield this.value.value(e,this.liquid.options.lenientIf)}*arguments(){yield this.value}*localScope(){yield this.identifier}},ss=[`offset`,`limit`,`reversed`],cs=class extends uo{constructor(e,t,n,r){super(e,t,n);let i=this.tokenizer.readIdentifier(),a=this.tokenizer.readIdentifier(),o=this.tokenizer.readValue();if(!i.size()||a.content!==`in`||!o)throw Error(`illegal tag: ${e.getText()}`);this.variable=i.content,this.collection=o,this.hash=new fo(this.tokenizer,n.options.keyValueSeparator),this.templates=[],this.elseTemplates=[];let s,c=r.parseStream(t).on(`start`,()=>s=this.templates).on(`tag:else`,e=>{Kt(e.args),s=this.elseTemplates}).on(`tag:endfor`,e=>{Kt(e.args),c.stop()}).on(`template`,e=>s.push(e)).on(`end`,()=>{throw Error(`tag ${e.getText()} not closed`)});c.start()}*render(e,t){let n=this.liquid.renderer,r=_t(yield pn(this.collection,e));if(!r.length){yield n.renderTemplates(this.elseTemplates,e,t);return}let i=`continue-`+this.variable+`-`+this.collection.getText();e.push({continue:e.getRegister(i)});let a=yield this.hash.render(e);e.pop(),r=(this.liquid.options.orderedFilterParameters?Object.keys(a).filter(e=>ss.includes(e)):ss.filter(e=>a[e]!==void 0)).reduce((e,t)=>t===`offset`?Mi(e,a.offset):t===`limit`?Ni(e,a.limit):ji(e),r),e.setRegister(i,(a.offset||0)+r.length);let o={forloop:new ca(r.length,this.collection.getText(),this.variable)};e.push(o);for(let i of r){if(o[this.variable]=i,e.continueCalled=e.breakCalled=!1,yield n.renderTemplates(this.templates,e,t),e.breakCalled)break;o.forloop.next()}e.continueCalled=e.breakCalled=!1,e.pop()}*children(){let e=this.templates.slice();return this.elseTemplates&&e.push(...this.elseTemplates),e}*arguments(){yield this.collection;for(let e of Object.values(this.hash.hash))pr(e)&&(yield e)}blockScope(){return[this.variable,`forloop`]}},ls=class extends uo{constructor(e,t,n,r){for(super(e,t,n),this.templates=[],this.identifier=this.readVariable(),this.variable=this.identifier.content;t.length;){let e=t.shift();if(or(e)&&e.name===`endcapture`)return;this.templates.push(r.parseToken(e,t))}throw Error(`tag ${e.getText()} not closed`)}readVariable(){let e=this.tokenizer.readIdentifier();if(e.content||(e=this.tokenizer.readQuoted(),e))return e;throw this.tokenizer.error(`invalid capture name`)}*render(e){let t=yield this.liquid.renderer.renderTemplates(this.templates,e);e.bottom()[this.variable]=t}*children(){return this.templates}*localScope(){yield this.identifier}},us=class extends uo{constructor(e,t,n,r){super(e,t,n),this.branches=[],this.elseTemplates=[],this.value=new mo(this.tokenizer.readFilteredValue(),this.liquid),this.elseTemplates=[];let i=[],a=0,o=r.parseStream(t).on(`tag:when`,e=>{if(a>0)return;i=[];let t=[];for(;!e.tokenizer.end();)t.push(e.tokenizer.readValueOrThrow()),e.tokenizer.skipBlank(),e.tokenizer.peek()===`,`?e.tokenizer.readTo(`,`):e.tokenizer.readTo(`or`);this.branches.push({values:t,templates:i})}).on(`tag:else`,()=>{a++,i=this.elseTemplates}).on(`tag:endcase`,()=>o.stop()).on(`template`,e=>{(i!==this.elseTemplates||a===1)&&i.push(e)}).on(`end`,()=>{throw Error(`tag ${e.getText()} not closed`)});o.start()}*render(e,t){let n=this.liquid.renderer,r=M(yield this.value.value(e,e.opts.lenientIf)),i=!1;for(let a of this.branches)for(let o of a.values)if(bn(r,yield pn(o,e,e.opts.lenientIf))){yield n.renderTemplates(a.templates,e,t),i=!0;break}i||(yield n.renderTemplates(this.elseTemplates,e,t))}*arguments(){yield this.value,yield*this.branches.flatMap(e=>e.values)}*children(){let e=this.branches.flatMap(e=>e.templates);return this.elseTemplates&&e.push(...this.elseTemplates),e}},ds=class extends uo{constructor(e,t,n){for(super(e,t,n);t.length;){let e=t.shift();if(or(e)&&e.name===`endcomment`)return}throw Error(`tag ${e.getText()} not closed`)}render(){}},fs=class extends uo{constructor(e,t,n,r){super(e,t,n);let i=this.tokenizer;for(this.file=Pi(i,this.liquid,r),this.currentFile=e.file;!i.end();){i.skipBlank();let e=i.p,t=i.readIdentifier();if((t.content===`with`||t.content===`for`)&&(i.skipBlank(),i.peek()!==`:`)){let e=i.readValue();if(e){let n=i.p,r=i.readIdentifier(),a;r.content===`as`?a=i.readIdentifier():i.p=n,this[t.content]={value:e,alias:a&&a.content},i.skipBlank(),i.peek()===`,`&&i.advance();continue}}i.p=e;break}this.hash=new fo(i,n.options.keyValueSeparator)}*render(e,t){let{liquid:n,hash:r}=this,i=yield Ii(this.file,e,n);Gt(i,()=>`illegal file path "${i}"`);let a=e.spawn(),o=a.bottom();if(ha(o,yield r.render(e)),this.with){let{value:t,alias:n}=this.with;o[n||i]=yield pn(t,e)}if(this.for){let{value:r,alias:s}=this.for,c=_t(yield pn(r,e));o.forloop=new ca(c.length,r.getText(),s);for(let e of c){o[s]=e;let r=yield n._parsePartialFile(i,a.sync,this.currentFile);yield n.renderer.renderTemplates(r,a,t),o.forloop.next()}}else{let e=yield n._parsePartialFile(i,a.sync,this.currentFile);yield n.renderer.renderTemplates(e,a,t)}}*children(e,t){return e&&A(this.file)?yield this.liquid._parsePartialFile(this.file,t,this.currentFile):[]}partialScope(){if(A(this.file)){let e=Object.keys(this.hash.hash);if(this.with){let{value:t,alias:n}=this.with;A(n)?e.push([n,t]):A(this.file)&&e.push([this.file,t])}if(this.for){let{value:t,alias:n}=this.for;A(n)?e.push([n,t]):A(this.file)&&e.push([this.file,t])}return{name:this.file,isolated:!0,scope:e}}}*arguments(){for(let e of Object.values(this.hash.hash))pr(e)&&(yield e);if(this.with){let{value:e}=this.with;pr(e)&&(yield e)}if(this.for){let{value:e}=this.for;pr(e)&&(yield e)}}},ps=class extends uo{constructor(e,t,n,r){super(e,t,n);let{tokenizer:i}=e;this.file=Pi(i,this.liquid,r),this.currentFile=e.file;let a=i.p;i.readIdentifier().content===`with`?(i.skipBlank(),i.peek()===`:`?i.p=a:this.withVar=i.readValue()):i.p=a,this.hash=new fo(i,n.options.jekyllInclude||n.options.keyValueSeparator)}*render(e,t){let{liquid:n,hash:r,withVar:i}=this,{renderer:a}=n,o=yield Ii(this.file,e,n);Gt(o,()=>`illegal file path "${o}"`);let s=e.saveRegister(`blocks`,`blockMode`);e.setRegister(`blocks`,{}),e.setRegister(`blockMode`,Oo.OUTPUT);let c=yield r.render(e);i&&(c[o]=yield pn(i,e));let l=yield n._parsePartialFile(o,e.sync,this.currentFile);e.push(e.opts.jekyllInclude?{include:c}:c),yield a.renderTemplates(l,e,t),e.pop(),e.restoreRegister(s)}*children(e,t){return e&&A(this.file)?yield this.liquid._parsePartialFile(this.file,t,this.currentFile):[]}partialScope(){if(A(this.file)){let e;return this.liquid.options.jekyllInclude?e=[`include`]:(e=Object.keys(this.hash.hash),this.withVar&&e.push([this.file,this.withVar])),{name:this.file,isolated:!1,scope:e}}}*arguments(){yield*Object.values(this.hash.hash).filter(pr),pr(this.file)&&(yield this.file),pr(this.withVar)&&(yield this.withVar)}},ms=class extends uo{constructor(e,t,n){super(e,t,n),this.identifier=this.tokenizer.readIdentifier(),this.variable=this.identifier.content}render(e,t){let n=e.environments;bt(n[this.variable])||(n[this.variable]=0),t.write(j(--n[this.variable]))}*localScope(){yield this.identifier}},hs=class extends uo{constructor(e,t,n){super(e,t,n),this.candidates=[];let r=this.tokenizer.readValue();for(this.tokenizer.skipBlank(),r&&(this.tokenizer.peek()===`:`?(this.group=r,this.tokenizer.advance()):this.candidates.push(r));!this.tokenizer.end();){let e=this.tokenizer.readValue();e&&this.candidates.push(e),this.tokenizer.readTo(`,`)}this.tokenizer.assert(this.candidates.length,()=>`empty candidates: "${e.getText()}"`)}*render(e,t){let n=`cycle:${yield pn(this.group,e)}:`+this.candidates.join(`,`),r=e.getRegister(`cycle`),i=r[n];i===void 0&&(i=r[n]=0);let a=this.candidates[i];return i=(i+1)%this.candidates.length,r[n]=i,yield pn(a,e)}*arguments(){yield*this.candidates,this.group&&(yield this.group)}},gs=class extends uo{constructor(e,t,n,r){super(e,t,n),this.branches=[];let i=[];r.parseStream(t).on(`start`,()=>this.branches.push({value:new mo(e.tokenizer.readFilteredValue(),this.liquid),templates:i=[]})).on(`tag:elsif`,e=>{Gt(!this.elseTemplates,`unexpected elsif after else`),this.branches.push({value:new mo(e.tokenizer.readFilteredValue(),this.liquid),templates:i=[]})}).on(`tag:else`,e=>{Kt(e.args),Gt(!this.elseTemplates,`duplicated else`),i=this.elseTemplates=[]}).on(`tag:endif`,function(e){Kt(e.args),this.stop()}).on(`template`,e=>i.push(e)).on(`end`,()=>{throw Error(`tag ${e.getText()} not closed`)}).start()}*render(e,t){let n=this.liquid.renderer;for(let{value:r,templates:i}of this.branches)if(vn(yield r.value(e,e.opts.lenientIf),e)){yield n.renderTemplates(i,e,t);return}yield n.renderTemplates(this.elseTemplates||[],e,t)}*children(){let e=this.branches.flatMap(e=>e.templates);return this.elseTemplates&&e.push(...this.elseTemplates),e}arguments(){return this.branches.map(e=>e.value)}},_s=class extends uo{constructor(e,t,n){super(e,t,n),this.identifier=this.tokenizer.readIdentifier(),this.variable=this.identifier.content}render(e,t){let n=e.environments;bt(n[this.variable])||(n[this.variable]=0);let r=n[this.variable];n[this.variable]++,t.write(j(r))}*localScope(){yield this.identifier}},vs=class extends uo{constructor(e,t,n,r){super(e,t,n),this.file=Pi(this.tokenizer,this.liquid,r),this.currentFile=e.file,this.args=new fo(this.tokenizer,n.options.keyValueSeparator),this.templates=r.parseTokens(t)}*render(e,t){let{liquid:n,args:r,file:i}=this,{renderer:a}=n;if(i===void 0){e.setRegister(`blockMode`,Oo.OUTPUT),yield a.renderTemplates(this.templates,e,t);return}let o=yield Ii(this.file,e,n);Gt(o,()=>`illegal file path "${o}"`);let s=yield n._parseLayoutFile(o,e.sync,this.currentFile);e.setRegister(`blockMode`,Oo.STORE);let c=yield a.renderTemplates(this.templates,e),l=e.getRegister(`blocks`);l[``]===void 0&&(l[``]=(e,t)=>t.write(c)),e.setRegister(`blockMode`,Oo.OUTPUT),e.push(yield r.render(e)),yield a.renderTemplates(s,e,t),e.pop()}*children(e){let t=this.templates.slice();return e&&A(this.file)&&t.push(...yield this.liquid._parsePartialFile(this.file,!0,this.currentFile)),t}*arguments(){for(let e of Object.values(this.args.hash))pr(e)&&(yield e);pr(this.file)&&(yield this.file)}partialScope(){if(A(this.file))return{name:this.file,isolated:!1,scope:Object.keys(this.args.hash)}}},ys=class extends uo{constructor(e,t,n,r){super(e,t,n),this.templates=[];let i=/\w+/.exec(e.args);for(this.block=i?i[0]:``;t.length;){let e=t.shift();if(or(e)&&e.name===`endblock`)return;let n=r.parseToken(e,t);this.templates.push(n)}throw Error(`tag ${e.getText()} not closed`)}*render(e,t){let n=this.getBlockRender(e);e.getRegister(`blockMode`)===Oo.STORE?e.getRegister(`blocks`)[this.block]=n:yield n(new fa,t)}getBlockRender(e){let{liquid:t,templates:n}=this,r=e.getRegister(`blocks`)[this.block],i=function*(r,i){e.push({block:r}),yield t.renderer.renderTemplates(n,e,i),e.pop()};return r?(e,t)=>r(new fa(t=>i(e,t)),t):i}*children(){return this.templates}blockScope(){return[`block`]}},bs=class extends uo{constructor(e,t,n){for(super(e,t,n),this.tokens=[];t.length;){let e=t.shift();if(or(e)&&e.name===`endraw`)return;this.tokens.push(e)}throw Error(`tag ${e.getText()} not closed`)}render(){return this.tokens.map(e=>e.getText()).join(``)}},xs=class extends ca{constructor(e,t,n,r){super(e,n,r),this.length=e,this.cols=t}row(){return Math.floor(this.i/this.cols)+1}col0(){return this.i%this.cols}col(){return this.col0()+1}col_first(){return this.col0()===0}col_last(){return this.col()===this.cols}},Ss=class extends uo{constructor(e,t,n,r){super(e,t,n);let i=this.tokenizer.readIdentifier();this.tokenizer.skipBlank();let a=this.tokenizer.readIdentifier(),o=this.tokenizer.readValue();if(a.content!==`in`||!o)throw Error(`illegal tag: ${e.getText()}`);this.variable=i.content,this.collection=o,this.args=new fo(this.tokenizer,n.options.keyValueSeparator),this.templates=[];let s,c=r.parseStream(t).on(`start`,()=>s=this.templates).on(`tag:endtablerow`,()=>c.stop()).on(`template`,e=>s.push(e)).on(`end`,()=>{throw Error(`tag ${e.getText()} not closed`)});c.start()}*render(e,t){let n=_t(yield pn(this.collection,e)),r=yield this.args.render(e),i=r.offset||0,a=r.limit===void 0?n.length:r.limit;n=n.slice(i,i+a);let o=r.cols||n.length,s=this.liquid.renderer,c=new xs(n.length,o,this.collection.getText(),this.variable),l={tablerowloop:c};e.push(l);for(let r=0;r<n.length;r++,c.next())l[this.variable]=n[r],c.col0()===0&&(c.row()!==1&&t.write(`</tr>`),t.write(`<tr class="row${c.row()}">`)),t.write(`<td class="col${c.col()}">`),yield s.renderTemplates(this.templates,e,t),t.write(`</td>`);n.length&&t.write(`</tr>`),e.pop()}*children(){return this.templates}*arguments(){yield this.collection;for(let e of Object.values(this.args.hash))pr(e)&&(yield e)}blockScope(){return[this.variable,`tablerowloop`]}},Cs=class extends uo{constructor(e,t,n,r){super(e,t,n),this.branches=[],this.elseTemplates=[];let i=[],a=0;r.parseStream(t).on(`start`,()=>this.branches.push({value:new mo(e.tokenizer.readFilteredValue(),this.liquid),test:yn,templates:i=[]})).on(`tag:elsif`,e=>{if(a>0){i=[];return}this.branches.push({value:new mo(e.tokenizer.readFilteredValue(),this.liquid),test:vn,templates:i=[]})}).on(`tag:else`,()=>{a++,i=this.elseTemplates}).on(`tag:endunless`,function(){this.stop()}).on(`template`,e=>{(i!==this.elseTemplates||a===1)&&i.push(e)}).on(`end`,()=>{throw Error(`tag ${e.getText()} not closed`)}).start()}*render(e,t){let n=this.liquid.renderer;for(let{value:r,test:i,templates:a}of this.branches)if(i(yield r.value(e,e.opts.lenientIf),e)){yield n.renderTemplates(a,e,t);return}yield n.renderTemplates(this.elseTemplates,e,t)}*children(){let e=this.branches.flatMap(e=>e.templates);return this.elseTemplates&&e.push(...this.elseTemplates),e}arguments(){return this.branches.map(e=>e.value)}},ws=class extends uo{render(e,t){e.breakCalled=!0}},Ts=class extends uo{render(e,t){e.continueCalled=!0}},Es=class extends uo{constructor(e,t,n){super(e,t,n),this.tokenizer.skipBlank(),this.tokenizer.end()||(this.value=new mo(this.tokenizer.readFilteredValue(),this.liquid))}*render(e,t){if(!this.value)return;let n=yield this.value.value(e,!1);t.write(n)}*arguments(){this.value&&(yield this.value)}},Ds=class extends uo{constructor(e,t,n,r){super(e,t,n);let i=this.tokenizer.readLiquidTagTokens(this.liquid.options);this.templates=r.parseTokens(i)}*render(e,t){yield this.liquid.renderer.renderTemplates(this.templates,e,t)}*children(){return this.templates}},Os=class extends uo{constructor(e,t,n){if(super(e,t,n),e.args.search(/\n\s*[^#\s]/g)!==-1)throw Error(`every line of an inline comment must start with a '#' character`)}render(){}},ks={assign:as,for:cs,capture:ls,case:us,comment:ds,include:ps,render:fs,decrement:ms,increment:_s,cycle:hs,if:gs,layout:vs,block:ys,raw:bs,tablerow:Ss,unless:Cs,break:ws,continue:Ts,echo:Es,liquid:Ds,"#":Os},As=class e{constructor(e={}){this.renderer=new Ya,this.filters={},this.tags={},this.options=Bn(e),this.parser=new wo(this),Dt(ks,(e,t)=>this.registerTag(t,e)),Dt(is,(e,t)=>this.registerFilter(t,e))}parse(e,t){return new wo(this).parse(e,t)}_render(e,t,n){let r=t instanceof Do?t:new Do(t,this.options,n);return this.renderer.renderTemplates(e,r)}render(e,t,n){return Yt(this,void 0,void 0,function*(){return Zt(this._render(e,t,Object.assign(Object.assign({},n),{sync:!1})))})}renderSync(e,t,n){return Qt(this._render(e,t,Object.assign(Object.assign({},n),{sync:!0})))}renderToNodeStream(e,t,n={}){let r=new Do(t,this.options,n);return this.renderer.renderTemplatesToNodeStream(e,r)}_parseAndRender(e,t,n){let r=this.parse(e);return this._render(r,t,n)}parseAndRender(e,t,n){return Yt(this,void 0,void 0,function*(){return Zt(this._parseAndRender(e,t,Object.assign(Object.assign({},n),{sync:!1})))})}parseAndRenderSync(e,t,n){return Qt(this._parseAndRender(e,t,Object.assign(Object.assign({},n),{sync:!0})))}_parsePartialFile(e,t,n){return new wo(this).parseFile(e,t,So.Partials,n)}_parseLayoutFile(e,t,n){return new wo(this).parseFile(e,t,So.Layouts,n)}_parseFile(e,t,n,r){return new wo(this).parseFile(e,t,n,r)}parseFile(e,t){return Yt(this,void 0,void 0,function*(){return Zt(new wo(this).parseFile(e,!1,t))})}parseFileSync(e,t){return Qt(new wo(this).parseFile(e,!0,t))}*_renderFile(e,t,n){let r=yield this._parseFile(e,n.sync,n.lookupType);return yield this._render(r,t,n)}renderFile(e,t,n){return Yt(this,void 0,void 0,function*(){return Zt(this._renderFile(e,t,Object.assign(Object.assign({},n),{sync:!1})))})}renderFileSync(e,t,n){return Qt(this._renderFile(e,t,Object.assign(Object.assign({},n),{sync:!0})))}renderFileToNodeStream(e,t,n){return Yt(this,void 0,void 0,function*(){let r=yield this.parseFile(e);return this.renderToNodeStream(r,t,n)})}_evalValue(e,t){let n=new mo(e,this),r=t instanceof Do?t:new Do(t,this.options);return n.value(r)}evalValue(e,t){return Yt(this,void 0,void 0,function*(){return Zt(this._evalValue(e,t))})}evalValueSync(e,t){return Qt(this._evalValue(e,t))}registerFilter(e,t){this.filters[e]=t}registerTag(e,t){this.tags[e]=mt(t)?t:Kn(t)}plugin(t){return t.call(this,e)}express(){let e=this,t=!0;return function(n,r,i){if(t){t=!1;let n=Hn(this.root);e.options.root.unshift(...n),e.options.layouts.unshift(...n),e.options.partials.unshift(...n)}e.renderFile(n,r).then(e=>i(null,e),i)}}analyze(e,t={}){return Yt(this,void 0,void 0,function*(){return Yn(e,t)})}analyzeSync(e,t={}){return Xn(e,t)}parseAndAnalyze(e,t,n={}){return Yt(this,void 0,void 0,function*(){return Yn(this.parse(e,t),n)})}parseAndAnalyzeSync(e,t,n={}){return Xn(this.parse(e,t),n)}variables(e,t={}){return Yt(this,void 0,void 0,function*(){let n=yield Yn(A(e)?this.parse(e):e,t);return Object.keys(n.variables)})}variablesSync(e,t={}){let n=Xn(A(e)?this.parse(e):e,t);return Object.keys(n.variables)}fullVariables(e,t={}){return Yt(this,void 0,void 0,function*(){let n=yield Yn(A(e)?this.parse(e):e,t);return Array.from(new Set(Object.values(n.variables).flatMap(e=>e.map(e=>String(e)))))})}fullVariablesSync(e,t={}){let n=Xn(A(e)?this.parse(e):e,t);return Array.from(new Set(Object.values(n.variables).flatMap(e=>e.map(e=>String(e)))))}variableSegments(e,t={}){return Yt(this,void 0,void 0,function*(){let n=yield Yn(A(e)?this.parse(e):e,t);return Array.from(Vt(Object.values(n.variables).flatMap(e=>e.map(e=>e.toArray()))))})}variableSegmentsSync(e,t={}){let n=Xn(A(e)?this.parse(e):e,t);return Array.from(Vt(Object.values(n.variables).flatMap(e=>e.map(e=>e.toArray()))))}globalVariables(e,t={}){return Yt(this,void 0,void 0,function*(){let n=yield Yn(A(e)?this.parse(e):e,t);return Object.keys(n.globals)})}globalVariablesSync(e,t={}){let n=Xn(A(e)?this.parse(e):e,t);return Object.keys(n.globals)}globalFullVariables(e,t={}){return Yt(this,void 0,void 0,function*(){let n=yield Yn(A(e)?this.parse(e):e,t);return Array.from(new Set(Object.values(n.globals).flatMap(e=>e.map(e=>String(e)))))})}globalFullVariablesSync(e,t={}){let n=Xn(A(e)?this.parse(e):e,t);return Array.from(new Set(Object.values(n.globals).flatMap(e=>e.map(e=>String(e)))))}globalVariableSegments(e,t={}){return Yt(this,void 0,void 0,function*(){let n=yield Yn(A(e)?this.parse(e):e,t);return Array.from(Vt(Object.values(n.globals).flatMap(e=>e.map(e=>e.toArray()))))})}globalVariableSegmentsSync(e,t={}){let n=Xn(A(e)?this.parse(e):e,t);return Array.from(Vt(Object.values(n.globals).flatMap(e=>e.map(e=>e.toArray()))))}},js=`[VI]{version}[/VI]`}));function Ns(){let e=(0,t.shallowRef)(new Map);function n(n,r){e.value.set(n,r),(0,t.triggerRef)(e)}function i(n,i){let a=`custom:${n.type}`,o={component:i,createBlock:()=>(0,r.createCustomBlock)(n),sidebarItem:{type:a,label:n.name,icon:n.icon,description:n.description,isCustom:!0},definition:n};e.value.set(a,o),(0,t.triggerRef)(e)}function a(t){if(t.type===`custom`){let n=`custom:${t.customType}`;return e.value.get(n)?.component}return e.value.get(t.type)?.component}function o(t){return e.value.get(t)?.createBlock()}function s(){let t=[],n=[];for(let r of e.value.values())r.sidebarItem.isCustom?n.push(r.sidebarItem):t.push(r.sidebarItem);return[...t,...n]}function c(t){let n=`custom:${t}`;return e.value.get(n)?.definition}function l(e){return`<div style="color: var(--tpl-text-muted); padding: 16px; text-align: center; border: 1px dashed var(--tpl-border); border-radius: var(--tpl-radius-sm); font-family: var(--tpl-font-family); font-size: 14px;">${e}</div>`}async function u(e){let t=c(e.customType);if(!t)return l(`Block definition not found`);try{let{Liquid:n}=await Promise.resolve().then(()=>(Ms(),pt));return await new n({strictVariables:!1,strictFilters:!1}).parseAndRender(t.template,e.fieldValues)}catch(t){return dt.error(`Failed to render custom block "${e.customType}":`,t),l(`Render error: ${e.customType}`)}}function d(t){return e.value.has(t)}return{registerBuiltIn:n,registerCustom:i,getComponent:a,createBlock:o,getSidebarItems:s,getDefinition:c,renderCustomBlock:u,isRegistered:d}}var Ps=d((()=>{ft()}));function Fs(e,t){for(let n of Is){let r=t[n.type];r&&e.registerBuiltIn(n.type,{component:r,createBlock:n.createBlock,sidebarItem:{type:n.type,label:n.label,isCustom:!1}})}}var Is,Ls=d((()=>{Is=[{type:`section`,label:`Section`,createBlock:r.createSectionBlock},{type:`title`,label:`Title`,createBlock:r.createTitleBlock},{type:`paragraph`,label:`Paragraph`,createBlock:r.createParagraphBlock},{type:`image`,label:`Image`,createBlock:r.createImageBlock},{type:`button`,label:`Button`,createBlock:r.createButtonBlock},{type:`divider`,label:`Divider`,createBlock:r.createDividerBlock},{type:`video`,label:`Video`,createBlock:r.createVideoBlock},{type:`social`,label:`Social`,createBlock:r.createSocialIconsBlock},{type:`menu`,label:`Menu`,createBlock:r.createMenuBlock},{type:`table`,label:`Table`,createBlock:r.createTableBlock},{type:`spacer`,label:`Spacer`,createBlock:r.createSpacerBlock},{type:`html`,label:`HTML`,createBlock:r.createHtmlBlock},{type:`countdown`,label:`Countdown`,createBlock:r.createCountdownBlock}]}));function Rs(e){let t=e.target;return t.isContentEditable||t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.tagName===`SELECT`}function zs(e,t){let n=e.metaKey||e.ctrlKey;if(n&&e.key===`s`){e.preventDefault(),t.onSave?.();return}if(n&&e.key.toLowerCase()===`z`){if(Rs(e))return;e.preventDefault(),e.shiftKey?t.history.redo():(t.onBeforeUndo?.(),t.history.undo());return}if(e.key===`Escape`){t.selectBlock(null);return}(e.key===`Delete`||e.key===`Backspace`)&&t.getSelectedBlockId()&&!Rs(e)&&(e.preventDefault(),t.history.record(),t.removeBlock(t.getSelectedBlockId()))}var Bs=d((()=>{})),Vs,Hs,Us,Ws=d((()=>{Vs={class:`tpl:text-center`},Hs=[`href`],Us=(0,t.defineComponent)({__name:`ButtonBlock`,props:{block:{},viewport:{}},setup(e){let n=e,r=(0,t.computed)(()=>{let e={display:`inline-block`,padding:`${n.block.buttonPadding.top}px ${n.block.buttonPadding.right}px ${n.block.buttonPadding.bottom}px ${n.block.buttonPadding.left}px`,backgroundColor:n.block.backgroundColor,color:n.block.textColor,fontSize:`${n.block.fontSize}px`,fontWeight:`bold`,textDecoration:`none`,borderRadius:`${n.block.borderRadius}px`,textAlign:`center`};return n.block.fontFamily&&(e.fontFamily=n.block.fontFamily),e});return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Vs,[(0,t.createElementVNode)(`a`,{href:e.block.url||`#`,style:(0,t.normalizeStyle)(r.value),class:`tpl:cursor-default`,onClick:i[0]||=(0,t.withModifiers)(()=>{},[`prevent`])},(0,t.toDisplayString)(e.block.text),13,Hs)]))}})})),Gs,Ks=d((()=>{Ws(),Ws(),Gs=Us})),qs,Js,Ys,Xs,Zs=d((()=>{Oe(),k(),qs={key:0,class:`tpl:flex tpl:items-center tpl:justify-center tpl:py-8 tpl:text-sm tpl:text-[var(--tpl-text-dim)]`},Js={key:1,class:`tpl:flex tpl:items-center tpl:justify-center tpl:py-4 tpl:text-xs tpl:text-[var(--tpl-text-dim)] tpl:opacity-50`},Ys={class:`tpl:text-center`},Xs=(0,t.defineComponent)({__name:`CountdownBlock`,props:{block:{},viewport:{}},setup(e){let n=e,{t:r}=O(),i=(0,t.ref)(Date.now());ne(()=>{i.value=Date.now()},1e3);let a=(0,t.computed)(()=>{if(!n.block.targetDate)return null;let e=new Date(n.block.targetDate);return isNaN(e.getTime())?null:e.getTime()}),o=(0,t.computed)(()=>a.value?i.value>=a.value:!1),s=(0,t.computed)(()=>{if(!a.value||o.value)return{days:0,hours:0,minutes:0,seconds:0};let e=a.value-i.value,t=Math.floor(e/1e3);return{days:Math.floor(t/86400),hours:Math.floor(t%86400/3600),minutes:Math.floor(t%3600/60),seconds:t%60}}),c=(0,t.computed)(()=>{let e=[];return n.block.showDays&&e.push({value:String(s.value.days).padStart(2,`0`),label:n.block.labelDays}),n.block.showHours&&e.push({value:String(s.value.hours).padStart(2,`0`),label:n.block.labelHours}),n.block.showMinutes&&e.push({value:String(s.value.minutes).padStart(2,`0`),label:n.block.labelMinutes}),n.block.showSeconds&&e.push({value:String(s.value.seconds).padStart(2,`0`),label:n.block.labelSeconds}),e}),l=(0,t.computed)(()=>({backgroundColor:n.block.backgroundColor,fontFamily:n.block.fontFamily||`inherit`})),u=(0,t.computed)(()=>({fontSize:`${n.block.digitFontSize}px`,fontWeight:`bold`,color:n.block.digitColor,lineHeight:`1.2`})),d=(0,t.computed)(()=>({fontSize:`${n.block.labelFontSize}px`,color:n.block.labelColor,marginTop:`4px`})),f=(0,t.computed)(()=>({fontSize:`${n.block.digitFontSize}px`,color:n.block.digitColor,fontFamily:n.block.fontFamily||`inherit`}));return(n,i)=>e.block.targetDate?o.value&&e.block.hideOnExpiry?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Js,(0,t.toDisplayString)((0,t.unref)(r).countdown.hidden),1)):o.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:2,style:(0,t.normalizeStyle)(l.value),class:`tpl:py-4 tpl:text-center`},[(0,t.createElementVNode)(`span`,{style:(0,t.normalizeStyle)({fontSize:`${e.block.digitFontSize}px`,color:e.block.digitColor})},(0,t.toDisplayString)(e.block.expiredMessage),5)],4)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:3,style:(0,t.normalizeStyle)(l.value),class:`tpl:flex tpl:items-center tpl:justify-center tpl:gap-2 tpl:py-4`},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(c.value,(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:n.label},[r>0?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,style:(0,t.normalizeStyle)(f.value),class:`tpl:self-start`},(0,t.toDisplayString)(e.block.separator),5)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,Ys,[(0,t.createElementVNode)(`div`,{style:(0,t.normalizeStyle)(u.value)},(0,t.toDisplayString)(n.value),5),(0,t.createElementVNode)(`div`,{style:(0,t.normalizeStyle)(d.value)},(0,t.toDisplayString)(n.label),5)])],64))),128))],4)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,qs,(0,t.toDisplayString)((0,t.unref)(r).countdown.setDate),1))}})})),Qs,$s=d((()=>{Zs(),Zs(),Qs=Xs})),ec,tc=d((()=>{ec=e=>e===``})),nc,rc=d((()=>{nc=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim()})),ic,ac=d((()=>{ic=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()})),oc,sc=d((()=>{oc=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase())})),cc,lc=d((()=>{sc(),cc=e=>{let t=oc(e);return t.charAt(0).toUpperCase()+t.slice(1)}})),uc,dc=d((()=>{uc={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`}}));function fc(){return(0,t.inject)(pc,{})}var pc,mc=d((()=>{pc=Symbol(`lucide-icons`)})),hc,gc=d((()=>{tc(),rc(),ac(),lc(),dc(),mc(),hc=({name:e,iconNode:n,absoluteStrokeWidth:r,"absolute-stroke-width":i,strokeWidth:a,"stroke-width":o,size:s,color:c,...l},{slots:u})=>{let{size:d,color:f,strokeWidth:p=2,absoluteStrokeWidth:m=!1,class:h=``}=fc(),g=(0,t.computed)(()=>{let e=ec(r)||ec(i)||r===!0||i===!0||m===!0,t=a||o||p||uc[`stroke-width`];return e?Number(t)*24/Number(s??d??uc.width):t});return(0,t.h)(`svg`,{...uc,...l,width:s??d??uc.width,height:s??d??uc.height,stroke:c??f??uc.stroke,"stroke-width":g.value,class:nc(`lucide`,h,...e?[`lucide-${ic(cc(e))}-icon`,`lucide-${ic(e)}`]:[`lucide-icon`])},[...n.map(e=>(0,t.h)(...e)),...u.default?[u.default()]:[]])}})),N,P=d((()=>{gc(),N=(e,n)=>(r,{slots:i,attrs:a})=>(0,t.h)(hc,{...a,...r,iconNode:n,name:e},i)})),_c,vc,yc=d((()=>{P(),_c=[[`path`,{d:`M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8`,key:`mg9rjx`}]],vc=N(`bold`,_c)})),bc,xc,Sc=d((()=>{P(),bc=[[`path`,{d:`M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z`,key:`oz39mx`}]],xc=N(`bookmark`,bc)})),Cc,wc,Tc=d((()=>{P(),Cc=[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]],wc=N(`box`,Cc)})),Ec,Dc,Oc=d((()=>{P(),Ec=[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]],Dc=N(`check`,Ec)})),kc,Ac,jc=d((()=>{P(),kc=[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]],Ac=N(`chevron-down`,kc)})),Mc,Nc,Pc=d((()=>{P(),Mc=[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]],Nc=N(`chevron-left`,Mc)})),Fc,Ic,Lc=d((()=>{P(),Fc=[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]],Ic=N(`chevron-up`,Fc)})),Rc,zc,Bc=d((()=>{P(),Rc=[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]],zc=N(`chevron-right`,Rc)})),Vc,Hc,Uc=d((()=>{P(),Vc=[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],Hc=N(`circle-alert`,Vc)})),Wc,Gc,Kc=d((()=>{P(),Wc=[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]],Gc=N(`circle-check`,Wc)})),qc,Jc,Yc=d((()=>{P(),qc=[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]],Jc=N(`circle`,qc)})),Xc,Zc,Qc=d((()=>{P(),Xc=[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]],Zc=N(`clock`,Xc)})),$c,el,tl=d((()=>{P(),$c=[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]],el=N(`code`,$c)})),nl,rl,il=d((()=>{P(),nl=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]],rl=N(`columns-3`,nl)})),al,ol,sl=d((()=>{P(),al=[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]],ol=N(`copy`,al)})),cl,ll,ul=d((()=>{P(),cl=[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]],ll=N(`eye-off`,cl)})),dl,fl,pl=d((()=>{P(),dl=[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]],fl=N(`eye`,dl)})),ml,hl,gl=d((()=>{P(),ml=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]],hl=N(`file-image`,ml)})),_l,vl,yl=d((()=>{P(),_l=[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]],vl=N(`file-text`,_l)})),bl,xl,Sl=d((()=>{P(),bl=[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]],xl=N(`funnel`,bl)})),Cl,wl,Tl=d((()=>{P(),Cl=[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]],wl=N(`grip-vertical`,Cl)})),El,Dl,Ol=d((()=>{P(),El=[[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M6 20V4`,key:`1w1bmo`}],[`path`,{d:`M18 20V4`,key:`o2hl4u`}]],Dl=N(`heading`,El)})),kl,Al,jl=d((()=>{P(),kl=[[`path`,{d:`M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21`,key:`9csbqa`}],[`path`,{d:`m14 19.5 3-3 3 3`,key:`9vmjn0`}],[`path`,{d:`M17 22v-5.5`,key:`1aa6fl`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]],Al=N(`image-up`,kl)})),Ml,Nl,Pl=d((()=>{P(),Ml=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]],Nl=N(`image`,Ml)})),Fl,Il,Ll=d((()=>{P(),Fl=[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]],Il=N(`info`,Fl)})),Rl,zl,Bl=d((()=>{P(),Rl=[[`line`,{x1:`19`,x2:`10`,y1:`4`,y2:`4`,key:`15jd3p`}],[`line`,{x1:`14`,x2:`5`,y1:`20`,y2:`20`,key:`bu0au3`}],[`line`,{x1:`15`,x2:`9`,y1:`4`,y2:`20`,key:`uljnxc`}]],zl=N(`italic`,Rl)})),Vl,Hl,Ul=d((()=>{P(),Vl=[[`rect`,{width:`18`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`f1a2em`}],[`rect`,{width:`9`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`jqznyg`}],[`rect`,{width:`5`,height:`7`,x:`16`,y:`14`,rx:`1`,key:`q5h2i8`}]],Hl=N(`layout-template`,Vl)})),Wl,Gl,Kl=d((()=>{P(),Wl=[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]],Gl=N(`link`,Wl)})),ql,Jl,Yl=d((()=>{P(),ql=[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]],Jl=N(`list-ordered`,ql)})),Xl,Zl,Ql=d((()=>{P(),Xl=[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]],Zl=N(`list`,Xl)})),$l,eu,tu=d((()=>{P(),$l=[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],eu=N(`loader-circle`,$l)})),nu,ru,iu=d((()=>{P(),nu=[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`,key:`1mm8w8`}]],ru=N(`lock-open`,nu)})),au,ou,su=d((()=>{P(),au=[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]],ou=N(`lock`,au)})),cu,lu,uu=d((()=>{P(),cu=[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]],lu=N(`message-circle`,cu)})),du,fu,pu=d((()=>{P(),du=[[`path`,{d:`M5 12h14`,key:`1ays0h`}]],fu=N(`minus`,du)})),mu,hu,gu=d((()=>{P(),mu=[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]],hu=N(`monitor`,mu)})),_u,vu,yu=d((()=>{P(),_u=[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]],vu=N(`moon`,_u)})),bu,xu,Su=d((()=>{P(),bu=[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`m8 18 4 4 4-4`,key:`bh5tu3`}],[`path`,{d:`m8 6 4-4 4 4`,key:`ybng9g`}]],xu=N(`move-vertical`,bu)})),Cu,wu,Tu=d((()=>{P(),Cu=[[`polygon`,{points:`3 11 22 2 13 21 11 13 3 11`,key:`1ltx0t`}]],wu=N(`navigation`,Cu)})),Eu,Du,Ou=d((()=>{P(),Eu=[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]],Du=N(`package`,Eu)})),ku,Au,ju=d((()=>{P(),ku=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]],Au=N(`panel-top`,ku)})),Mu,Nu,Pu=d((()=>{P(),Mu=[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]],Nu=N(`pencil`,Mu)})),Fu,Iu,Lu=d((()=>{P(),Fu=[[`path`,{d:`M13 4v16`,key:`8vvj80`}],[`path`,{d:`M17 4v16`,key:`7dpous`}],[`path`,{d:`M19 4H9.5a4.5 4.5 0 0 0 0 9H13`,key:`sh4n9v`}]],Iu=N(`pilcrow`,Fu)})),Ru,zu,Bu=d((()=>{P(),Ru=[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]],zu=N(`play`,Ru)})),Vu,Hu,Uu=d((()=>{P(),Vu=[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]],Hu=N(`plus`,Vu)})),Wu,Gu,Ku=d((()=>{P(),Wu=[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]],Gu=N(`puzzle`,Wu)})),qu,Ju,Yu=d((()=>{P(),qu=[[`rect`,{width:`20`,height:`12`,x:`2`,y:`6`,rx:`2`,key:`9lu3g6`}]],Ju=N(`rectangle-horizontal`,qu)})),Xu,Zu,Qu=d((()=>{P(),Xu=[[`path`,{d:`m15 14 5-5-5-5`,key:`12vg1m`}],[`path`,{d:`M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13`,key:`6uklza`}]],Zu=N(`redo-2`,Xu)})),$u,ed,td=d((()=>{P(),$u=[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]],ed=N(`refresh-cw`,$u)})),nd,rd,id=d((()=>{P(),nd=[[`path`,{d:`M4 7V4h16v3`,key:`9msm58`}],[`path`,{d:`M5 20h6`,key:`1h6pxn`}],[`path`,{d:`M13 4 8 20`,key:`kqq6aj`}],[`path`,{d:`m15 15 5 5`,key:`me55sn`}],[`path`,{d:`m20 15-5 5`,key:`11p7ol`}]],rd=N(`remove-formatting`,nd)})),ad,od,sd=d((()=>{P(),ad=[[`path`,{d:`M20 18v-2a4 4 0 0 0-4-4H4`,key:`5vmcpk`}],[`path`,{d:`m9 17-5-5 5-5`,key:`nvlc11`}]],od=N(`reply`,ad)})),cd,ld,ud=d((()=>{P(),cd=[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]],ld=N(`rotate-ccw`,cd)})),dd,fd,pd=d((()=>{P(),dd=[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]],fd=N(`save`,dd)})),md,hd,gd=d((()=>{P(),md=[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`path`,{d:`M7 12h10`,key:`b7w52i`}]],hd=N(`scan-line`,md)})),_d,vd,yd=d((()=>{P(),_d=[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]],vd=N(`search`,_d)})),bd,xd,Sd=d((()=>{P(),bd=[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]],xd=N(`send`,bd)})),Cd,wd,Td=d((()=>{P(),Cd=[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]],wd=N(`settings`,Cd)})),Ed,Dd,Od=d((()=>{P(),Ed=[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]],Dd=N(`share-2`,Ed)})),kd,Ad,jd=d((()=>{P(),kd=[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]],Ad=N(`shield-check`,kd)})),Md,Nd,Pd=d((()=>{P(),Md=[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m14.5 9.5-5 5`,key:`17q4r4`}],[`path`,{d:`m9.5 9.5 5 5`,key:`18nt4w`}]],Nd=N(`shield-x`,Md)})),Fd,Id,Ld=d((()=>{P(),Fd=[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]],Id=N(`smartphone`,Fd)})),Rd,zd,Bd=d((()=>{P(),Rd=[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 14s1.5 2 4 2 4-2 4-2`,key:`1y1vjs`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]],zd=N(`smile`,Rd)})),Vd,Hd,Ud=d((()=>{P(),Vd=[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],Hd=N(`sparkles`,Vd)})),Wd,Gd,Kd=d((()=>{P(),Wd=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}],[`path`,{d:`M12 8v8`,key:`napkw2`}]],Gd=N(`square-plus`,Wd)})),qd,Jd,Yd=d((()=>{P(),qd=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]],Jd=N(`square`,qd)})),Xd,Zd,Qd=d((()=>{P(),Xd=[[`path`,{d:`M16 4H9a3 3 0 0 0-2.83 4`,key:`43sutm`}],[`path`,{d:`M14 12a4 4 0 0 1 0 8H6`,key:`nlfj13`}],[`line`,{x1:`4`,x2:`20`,y1:`12`,y2:`12`,key:`1e0a9i`}]],Zd=N(`strikethrough`,Xd)})),$d,ef,tf=d((()=>{P(),$d=[[`path`,{d:`m4 5 8 8`,key:`1eunvl`}],[`path`,{d:`m12 5-8 8`,key:`1ah0jp`}],[`path`,{d:`M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07`,key:`e8ta8j`}]],ef=N(`subscript`,$d)})),nf,rf,af=d((()=>{P(),nf=[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]],rf=N(`sun`,nf)})),of,sf,cf=d((()=>{P(),of=[[`path`,{d:`m4 19 8-8`,key:`hr47gm`}],[`path`,{d:`m12 19-8-8`,key:`1dhhmo`}],[`path`,{d:`M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06`,key:`1dfcux`}]],sf=N(`superscript`,of)})),lf,uf,df=d((()=>{P(),lf=[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]],uf=N(`table`,lf)})),ff,pf,mf=d((()=>{P(),ff=[[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,ry:`2`,key:`76otgf`}],[`line`,{x1:`12`,x2:`12.01`,y1:`18`,y2:`18`,key:`1dp563`}]],pf=N(`tablet`,ff)})),hf,gf,_f=d((()=>{P(),hf=[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M17 12H7`,key:`16if0g`}],[`path`,{d:`M19 19H5`,key:`vjpgq2`}]],gf=N(`text-align-center`,hf)})),vf,yf,bf=d((()=>{P(),vf=[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M21 19H7`,key:`4cu937`}]],yf=N(`text-align-end`,vf)})),xf,Sf,Cf=d((()=>{P(),xf=[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]],Sf=N(`text-align-start`,xf)})),wf,Tf,Ef=d((()=>{P(),wf=[[`line`,{x1:`10`,x2:`14`,y1:`2`,y2:`2`,key:`14vaq8`}],[`line`,{x1:`12`,x2:`15`,y1:`14`,y2:`11`,key:`17fdiu`}],[`circle`,{cx:`12`,cy:`14`,r:`8`,key:`1e1u0o`}]],Tf=N(`timer`,wf)})),Df,Of,kf=d((()=>{P(),Df=[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],Of=N(`trash-2`,Df)})),Af,jf,Mf=d((()=>{P(),Af=[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],jf=N(`triangle-alert`,Af)})),Nf,Pf,Ff=d((()=>{P(),Nf=[[`path`,{d:`M6 4v6a6 6 0 0 0 12 0V4`,key:`9kb039`}],[`line`,{x1:`4`,x2:`20`,y1:`20`,y2:`20`,key:`nun2al`}]],Pf=N(`underline`,Nf)})),If,Lf,Rf=d((()=>{P(),If=[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]],Lf=N(`undo-2`,If)})),zf,Bf,Vf=d((()=>{P(),zf=[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]],Bf=N(`upload`,zf)})),Hf,Uf,Wf=d((()=>{P(),Hf=[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]],Uf=N(`video`,Hf)})),Gf,Kf,qf=d((()=>{P(),Gf=[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]],Kf=N(`wifi-off`,Gf)})),Jf,Yf,Xf=d((()=>{P(),Jf=[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]],Yf=N(`wifi`,Jf)})),Zf,Qf,$f=d((()=>{P(),Zf=[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]],Qf=N(`x`,Zf)})),ep,tp,np=d((()=>{P(),ep=[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]],tp=N(`zap`,ep)})),F=d((()=>{P(),Uc(),Kc(),il(),Sl(),tu(),iu(),Pd(),Ud(),Kd(),_f(),bf(),Cf(),Mf(),yc(),Sc(),Tc(),Oc(),jc(),Pc(),Bc(),Lc(),Yc(),Qc(),tl(),sl(),ul(),pl(),gl(),yl(),Tl(),Ol(),jl(),Pl(),Ll(),Bl(),Ul(),Kl(),Yl(),Ql(),su(),uu(),pu(),gu(),yu(),Su(),Tu(),Ou(),ju(),Pu(),Lu(),Bu(),Uu(),Ku(),Yu(),Qu(),td(),id(),sd(),ud(),pd(),gd(),yd(),Sd(),Td(),Od(),jd(),Ld(),Bd(),Yd(),Qd(),tf(),af(),cf(),df(),mf(),Ef(),kf(),Ff(),Rf(),Vf(),Wf(),qf(),Xf(),$f(),np(),mc(),gc()})),rp,ip,ap,op=d((()=>{F(),rp=[`innerHTML`],ip=[`src`,`width`,`height`],ap=(0,t.defineComponent)({__name:`CustomBlockIcon`,props:{icon:{},size:{}},setup(e){let n=e,r=(0,t.computed)(()=>n.size??20),i=(0,t.computed)(()=>n.icon&&(n.icon.trimStart().startsWith(`<svg`)||n.icon.trimStart().startsWith(`<SVG`))),a=(0,t.computed)(()=>n.icon&&!i.value&&(n.icon.startsWith(`http`)||n.icon.startsWith(`/`)));return(n,o)=>i.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,class:`tpl:inline-flex tpl:items-center tpl:justify-center`,style:(0,t.normalizeStyle)({width:`${r.value}px`,height:`${r.value}px`}),innerHTML:e.icon},null,12,rp)):a.value?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:1,src:e.icon,width:r.value,height:r.value,class:`tpl:inline-block`,alt:``},null,8,ip)):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(wc),{key:2,size:r.value,"stroke-width":1.5},null,8,[`size`]))}})})),sp,cp=d((()=>{op(),op(),sp=ap})),lp=d((()=>{})),up,dp=d((()=>{up=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n}}));function fp(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,mp)}var pp,mp,hp,gp=d((()=>{lp(),dp(),pp={},mp={class:`tpl-loading-track`},hp=up(pp,[[`render`,fp],[`__scopeId`,`data-v-1ed538ec`]])}));function _p(e,n){let r=null,i=null;function a(){return e.value?Array.from(e.value.querySelectorAll(vp)).filter(e=>e.offsetParent!==null):[]}function o(e){if(e.key!==`Tab`)return;let t=a();if(t.length===0)return;let n=t[0],r=t[t.length-1];e.shiftKey?document.activeElement===n&&(e.preventDefault(),r.focus()):document.activeElement===r&&(e.preventDefault(),n.focus())}function s(){r=document.activeElement,requestAnimationFrame(()=>{let t=a();t.length>0&&(e.value?.querySelector(`[autofocus], input:not([disabled])`)??t[0]).focus()}),i=ge(e,`keydown`,o)}function c(){i?.(),i=null,r&&r.focus&&(r.focus(),r=null)}let l=(0,t.watch)([n,e],([e,t])=>{e&&t?s():c()},{flush:`post`});(0,t.onScopeDispose)(()=>{l(),c()})}var vp,yp=d((()=>{Oe(),vp=`a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`}));function bp(){let e=(0,t.inject)(Ve,[]),n=(0,t.inject)(He,r.SYNTAX_PRESETS.liquid),i=(0,t.inject)(Ue,null),a=(0,t.ref)(!1);function o(e){return(0,r.isMergeTagValue)(e,n)}function s(t){return(0,r.getMergeTagLabel)(t,e)}async function c(){if(!i)return null;a.value=!0;try{return await i()}finally{a.value=!1}}return{mergeTags:e,isRequesting:a,isEnabled:e.length>0||!!i,syntax:n,isMergeTagValue:o,getMergeTagLabel:s,requestMergeTag:c}}var xp=d((()=>{D()})),Sp=p({emojiCategories:()=>Cp}),Cp,wp=d((()=>{Cp=[{key:`smileys`,emojis:`😀.😃.😄.😁.😅.😂.🤣.😊.😇.🙂.😉.😍.🥰.😘.😋.😎.🤩.🥳.😏.😢.😭.😤.😡.🤯.😱.🤔.🤫.🤗.🫡.👋`.split(`.`)},{key:`gestures`,emojis:`👍.👎.👏.🙌.🤝.✌️.🤞.🫶.❤️.🧡.💛.💚.💙.💜.🖤.💯.✨.⭐.🌟.💫.🔥.💥.💪.👀.👁️.🎉.🎊.🎁.🏆.🥇`.split(`.`)},{key:`objects`,emojis:`📧.✉️.📨.📩.📬.📱.💻.🖥️.📊.📈.📉.📅.🗓️.⏰.⏳.💡.🔔.📢.🎯.✅.❌.⚠️.💲.💵.💰.🛒.🛍️.📦.🚀.✈️`.split(`.`)}]}));function Tp(){let[e,n]=ie(!1),r=(0,t.shallowRef)([]);(0,t.watch)(e,async e=>{if(e&&r.value.length===0){let{emojiCategories:e}=await Promise.resolve().then(()=>(wp(),Sp));r.value=e}});function i(){n()}function a(){e.value=!1}return{categories:r,isOpen:e,toggle:i,close:a}}var Ep=d((()=>{Oe()}));function Dp(e){let{onBlockMove:n,onBlockAdd:r}=e,i=(0,t.ref)(!1),a=(0,t.ref)(null),o=(0,t.ref)(null);function s(e){i.value=!0,a.value=e}function c(){i.value=!1,a.value=null,o.value=null}function l(e){o.value=e}function u(e,t,i,o){a.value&&(e.findIndex(e=>e.id===a.value.id)===-1?r(a.value,i,o):n(a.value.id,t,i,o),c())}function d(e,t,r){return{group:e,animation:150,ghostClass:`tpl-ghost`,dragClass:`tpl-drag`,handle:`.tpl-drag-handle`,onStart:e=>{e.item.dataset.blockId&&(i.value=!0)},onEnd:()=>{c()},onAdd:e=>{let i=e.item.dataset.blockId;i&&n(i,e.newIndex,t,r)},onUpdate:e=>{let i=e.item.dataset.blockId;i&&n(i,e.newIndex,t,r)}}}return{isDragging:i,draggedBlock:a,dropTargetId:o,startDrag:s,endDrag:c,setDropTarget:l,handleDrop:u,getSortableOptions:d}}var Op=d((()=>{}));function kp(e){let n=(0,t.ref)(e?.customFonts??[]),r=(0,t.ref)(!0),i=(0,t.ref)(!1),a=(0,t.computed)(()=>e?.defaultFallback??Mp);function o(e){r.value=e}let s=(0,t.computed)(()=>{let e=[...Ap];if(!r.value)return e.sort((e,t)=>e.label.localeCompare(t.label));let t=n.value.map(e=>({value:e.name,label:e.name,isCustom:!0})),i=[...e,...t];return i.sort((e,t)=>e.label.localeCompare(t.label)),i});function c(e){return s.value.some(t=>t.label.toLowerCase()===e.toLowerCase()||t.value.toLowerCase().startsWith(e.toLowerCase()))}function l(e){return Ap.some(t=>t.label.toLowerCase()===e.toLowerCase()||t.value.toLowerCase().startsWith(e.toLowerCase()))}function u(){if(e?.defaultFont){if(!r.value&&!l(e.defaultFont))return Mp;if(c(e.defaultFont)){let t=s.value.find(t=>t.label.toLowerCase()===e.defaultFont.toLowerCase()||t.value.toLowerCase().startsWith(e.defaultFont.toLowerCase()));if(t)return t.value}}return Mp}let d=(0,t.computed)(()=>u());function f(e){if(!e)return a.value;let t=n.value.find(t=>t.name.toLowerCase()===e.toLowerCase());if(t){let e=t.fallback??a.value;return`'${t.name}', ${e}`}return jp[e.toLowerCase()]||(e.includes(`,`)?e:`${e}, ${a.value}`)}let p=[];async function m(){if(n.value.length===0){i.value=!0;return}let e=n.value.map(async e=>{try{if(document.querySelector(`link[data-custom-font="${CSS.escape(e.name)}"]`))return;let t=document.createElement(`link`);t.rel=`stylesheet`,t.href=e.url,t.setAttribute(`data-custom-font`,e.name),await new Promise((n,r)=>{t.onload=()=>n(),t.onerror=()=>r(Error(`Failed to load font: ${e.name}`)),document.head.appendChild(t)}),p.push(t)}catch(t){dt.warn(`Failed to load custom font "${e.name}":`,t)}});await Promise.allSettled(e),i.value=!0}function h(){for(let e of p)e.remove();p.length=0}return(0,t.getCurrentScope)()&&(0,t.onScopeDispose)(h),{fonts:s,defaultFont:d,defaultFallback:a,customFonts:n,customFontsEnabled:r,isLoaded:i,setCustomFontsEnabled:o,loadCustomFonts:m,cleanupFontLinks:h,getFontWithFallback:f,getDefaultFont:u}}var Ap,jp,Mp,Np=d((()=>{ft(),Ap=[{value:`Arial`,label:`Arial`},{value:`Helvetica`,label:`Helvetica`},{value:`Georgia`,label:`Georgia`},{value:`Times New Roman`,label:`Times New Roman`},{value:`Verdana`,label:`Verdana`},{value:`Trebuchet MS`,label:`Trebuchet MS`},{value:`Courier New`,label:`Courier New`}],jp={arial:`Arial, sans-serif`,helvetica:`Helvetica, sans-serif`,georgia:`Georgia, serif`,"times new roman":`'Times New Roman', serif`,verdana:`Verdana, sans-serif`,"trebuchet ms":`'Trebuchet MS', sans-serif`,"courier new":`'Courier New', monospace`},Mp=`Arial, sans-serif`}));function Pp(e){let n=(0,t.ref)(!1),r=(0,t.ref)(``),i=(0,t.ref)(null);_p(i,n);function a(){r.value=e.value?.getAttributes(`link`).href||``,n.value=!0}function o(){if(r.value){let t=r.value.startsWith(`http`)?r.value:`https://${r.value}`;e.value?.chain().focus().extendMarkRange(`link`).setLink({href:t}).run()}c()}function s(){e.value?.chain().focus().extendMarkRange(`link`).unsetLink().run(),c()}function c(){n.value=!1,r.value=``}function l(e){e.key===`Enter`?(e.preventDefault(),o()):e.key===`Escape`&&c()}return{showLinkDialog:n,linkUrl:r,linkDialogRef:i,openLinkDialog:a,insertLink:o,removeLink:s,closeLinkDialog:c,handleLinkKeydown:l}}var Fp=d((()=>{yp()}));function Ip(e){let n=(0,t.inject)(je,null),{mergeTags:r,isEnabled:i,isRequesting:a,requestMergeTag:o,syntax:s}=bp(),c=(0,t.shallowRef)(null),{showLinkDialog:l,linkUrl:u,linkDialogRef:d,openLinkDialog:f,insertLink:p,removeLink:m,closeLinkDialog:h,handleLinkKeydown:g}=Pp(c),{start:_,stop:v}=re(()=>c.value?.commands.focus(`end`),0,{immediate:!1}),y=(0,t.shallowRef)(null),b=(0,t.ref)(!0),x=(0,t.ref)(null);async function S(){x.value=null,b.value=!0;try{let{TiptapEditor:t,EC:i,extensions:a}=await e.loadExtensions({mergeTags:r,syntax:s});y.value=i;let o=new Map;a.forEach((e,t)=>o.set(e.name,t)),c.value=new t({extensions:a.filter((e,t)=>o.get(e.name)===t),content:e.blockContent(),editable:!0,onUpdate:({editor:t})=>{n&&n.updateBlock(e.blockId(),{content:t.getHTML()})}}),b.value=!1,_()}catch(t){dt.error(`[${e.editorName??`RichTextEditor`}] Failed to initialize TipTap editor:`,t),x.value=t instanceof Error?t.message:`Failed to load editor`,b.value=!1}}function C(){c.value?.destroy(),c.value=null,S()}S();let ee=(0,t.watch)(()=>e.blockContent(),e=>{c.value&&c.value.getHTML()!==e&&c.value.commands.setContent(e,{emitUpdate:!1})});function w(t){if(a.value)return;let n=t.target;e.onClickOutsideSideEffect?.(n),!(n.closest(`.tpl-text-editor-wrapper`)||n.closest(`.tpl-text-toolbar`)||n.closest(`.tpl-link-dialog`))&&e.onDone()}ge(document,`mousedown`,w),(0,t.onBeforeUnmount)(()=>{ee(),v(),c.value?.destroy()});async function T(){let e=await o();e&&c.value?c.value.chain().focus().insertMergeTag({label:e.label,value:e.value}).run():c.value?.commands.focus()}return{editor:c,EditorContent:y,isLoading:b,initError:x,retry:C,showLinkDialog:l,linkUrl:u,linkDialogRef:d,mergeTags:r,mergeTagEnabled:i,isRequestingMergeTag:a,syntax:s,openLinkDialog:f,insertLink:p,removeLink:m,closeLinkDialog:h,handleLinkKeydown:g,handleAddMergeTag:T}}var Lp=d((()=>{Oe(),D(),xp(),Fp(),ft()})),Rp=d((()=>{yp(),k(),xp(),Ep(),Ps(),Op(),Np(),ct(),Lp(),sB()})),zp,Bp,Vp,Hp,Up,Wp,Gp,Kp,qp,Jp=d((()=>{cp(),gp(),Rp(),Oe(),F(),D(),zp={class:`tpl:w-full`},Bp={key:0,class:`tpl:flex tpl:min-h-[80px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:border-[var(--tpl-warning)] tpl:bg-[var(--tpl-warning-light)]`},Vp={class:`tpl:text-sm tpl:text-[var(--tpl-text-muted)]`},Hp={key:1,class:`tpl:flex tpl:min-h-[80px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:border-[var(--tpl-danger)] tpl:bg-[var(--tpl-danger-light)]`},Up={class:`tpl:text-sm tpl:text-[var(--tpl-text-muted)]`},Wp={key:2,class:`tpl:relative`},Gp=[`innerHTML`],Kp={key:0,class:`tpl:absolute tpl:inset-0 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:rounded tpl:backdrop-blur-[2px]`,style:{"background-color":`color-mix(in srgb, var(--tpl-bg) 80%, transparent)`}},qp=(0,t.defineComponent)({__name:`CustomBlock`,props:{block:{},viewport:{}},emits:[`fetchData`],setup(e,{emit:r}){let i=e,a=r,{t:o}=O(),s=(0,t.inject)(ze,null),c=(0,t.ref)(``),l=(0,t.ref)(!1),u=(0,t.computed)(()=>s?.getDefinition(i.block.customType)),d=(0,t.computed)(()=>!!u.value),{isFetching:f,fetch:p,needsFetch:m,hasDataSource:h}=(0,n.useDataSourceFetch)({definition:u,block:(0,t.computed)(()=>i.block),onUpdate:(e,t)=>{a(`fetchData`,{fieldValues:e,dataSourceFetched:t})}});async function g(){if(s){l.value=!1;try{let e=await s.renderCustomBlock(i.block);e.includes(`Template render error:`)&&(l.value=!0),c.value=e}catch{l.value=!0,c.value=``}}}let _=te(g,150);return(0,t.onMounted)(()=>{g()}),(0,t.watch)(()=>i.block.fieldValues,()=>{_()},{deep:!0}),(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,zp,[d.value?l.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Hp,[(0,t.createVNode)((0,t.unref)(jf),{size:24,class:`tpl:text-[var(--tpl-danger)]`}),(0,t.createElementVNode)(`span`,Up,(0,t.toDisplayString)((0,t.unref)(o).customBlocks.renderError),1)])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Wp,[(0,t.createElementVNode)(`div`,{innerHTML:c.value},null,8,Gp),(0,t.unref)(h)&&(0,t.unref)(m)?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Kp,[(0,t.unref)(f)?((0,t.openBlock)(),(0,t.createBlock)(hp,{key:1,class:`tpl:w-48`})):((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,class:`tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-2 tpl:text-sm tpl:font-semibold tpl:shadow-sm tpl:transition-all tpl:duration-150 hover:tpl:border-[var(--tpl-primary)] hover:tpl:shadow-md tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary-hover)]`,onClick:n[0]||=(0,t.withModifiers)((...e)=>(0,t.unref)(p)&&(0,t.unref)(p)(...e),[`stop`])},[u.value?.icon?((0,t.openBlock)(),(0,t.createBlock)(sp,{key:0,icon:u.value.icon,size:16},null,8,[`icon`])):(0,t.createCommentVNode)(``,!0),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(u.value?.dataSource?.label||(0,t.unref)(o).customBlocks.dataSource.fetchButton),1)]))])):(0,t.createCommentVNode)(``,!0)])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Bp,[(0,t.createVNode)((0,t.unref)(Gu),{size:24,class:`tpl:text-[var(--tpl-warning)]`}),(0,t.createElementVNode)(`span`,Vp,(0,t.toDisplayString)((0,t.unref)(o).customBlocks.definitionNotFound),1)]))]))}})})),Yp,Xp=d((()=>{Jp(),Jp(),Yp=qp})),Zp,Qp,$p=d((()=>{Zp={class:`tpl:w-full`},Qp=(0,t.defineComponent)({__name:`DividerBlock`,props:{block:{},viewport:{}},setup(e){let n=e,r=(0,t.computed)(()=>({borderTop:`${n.block.thickness}px ${n.block.lineStyle} ${n.block.color}`,width:n.block.width===`full`?`100%`:`${n.block.width}px`,margin:n.block.width===`full`?`0`:`0 auto`}));return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Zp,[(0,t.createElementVNode)(`hr`,{class:`tpl:m-0 tpl:border-none`,style:(0,t.normalizeStyle)(r.value)},null,4)]))}})})),em,tm=d((()=>{$p(),$p(),em=Qp})),nm,rm,im,am,om,sm=d((()=>{k(),F(),nm={class:`tpl:w-full`},rm={class:`tpl:flex tpl:min-h-[80px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)]`},im={key:0,class:`tpl:text-sm tpl:text-[var(--tpl-text-muted)]`},am={key:1,class:`tpl:text-sm tpl:text-[var(--tpl-text-dim)]`},om=(0,t.defineComponent)({__name:`HtmlBlock`,props:{block:{},viewport:{}},setup(e){let n=e,{t:r}=O(),i=(0,t.computed)(()=>n.block.content.trim().length>0);return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,nm,[(0,t.createElementVNode)(`div`,rm,[(0,t.createVNode)((0,t.unref)(el),{size:24,class:`tpl:text-[var(--tpl-text-dim)]`}),i.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,im,(0,t.toDisplayString)((0,t.unref)(r).html.preview),1)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,am,(0,t.toDisplayString)((0,t.unref)(r).html.empty),1))])]))}})})),cm,lm=d((()=>{sm(),sm(),cm=om})),um,dm,fm,pm,mm,hm,gm,_m,vm,ym,bm,xm=d((()=>{k(),xp(),F(),D(),um=[`href`],dm=[`src`,`alt`],fm=[`src`,`alt`],pm={class:`tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)]`,style:{opacity:`0.7`}},mm=[`href`],hm=[`src`,`alt`],gm=[`src`,`alt`],_m={key:3,class:`tpl:flex tpl:min-h-[100px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-sm tpl:border-[var(--tpl-border-light)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-dim)]`},vm=[`aria-label`],ym={key:1},bm=(0,t.defineComponent)({__name:`ImageBlock`,props:{block:{},viewport:{}},emits:[`update`],setup(e,{emit:n}){let i=e,a=n,{t:o}=O(),{syntax:s}=bp(),c=(0,t.inject)(We,null),l=(0,t.computed)(()=>!!c);async function u(){let e=await c?.({accept:[`images`]});if(e){let t={src:e.url};e.alt&&(t.alt=e.alt),a(`update`,t)}}let d=(0,t.computed)(()=>({textAlign:i.block.align})),f=(0,t.computed)(()=>({maxWidth:`100%`,width:i.block.width===`full`?`100%`:`${i.block.width}px`,display:`block`,margin:i.block.align===`center`?`0 auto`:void 0,marginLeft:i.block.align===`right`?`auto`:void 0})),p=(0,t.computed)(()=>(0,r.containsMergeTag)(i.block.src,s));return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`tpl:w-full`,style:(0,t.normalizeStyle)(d.value)},[e.block.src&&p.value&&e.block.placeholderUrl?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[e.block.linkUrl?((0,t.openBlock)(),(0,t.createElementBlock)(`a`,{key:0,href:e.block.linkUrl,target:`_blank`,rel:`noopener noreferrer`,onClick:r[0]||=(0,t.withModifiers)(()=>{},[`prevent`])},[(0,t.createElementVNode)(`img`,{class:`tpl:border-0`,loading:`lazy`,src:e.block.placeholderUrl,alt:e.block.alt||(0,t.unref)(o).image.altTextPlaceholder,style:(0,t.normalizeStyle)(f.value)},null,12,dm)],8,um)):((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:1,class:`tpl:border-0`,src:e.block.placeholderUrl,alt:e.block.alt,style:(0,t.normalizeStyle)(f.value)},null,12,fm))],64)):e.block.src&&p.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:`tpl:!flex tpl:min-h-[120px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-center tpl:bg-[var(--tpl-bg-elevated)]`,style:(0,t.normalizeStyle)([{"border-color":`color-mix(in srgb, var(--tpl-primary) 40%, transparent)`},f.value])},[(0,t.createVNode)((0,t.unref)(Nl),{size:32,"stroke-width":1.5,class:`tpl:text-[var(--tpl-primary)]`,style:{opacity:`0.5`}}),(0,t.createElementVNode)(`span`,pm,(0,t.toDisplayString)(e.block.src),1)],4)):e.block.src?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:2},[e.block.linkUrl?((0,t.openBlock)(),(0,t.createElementBlock)(`a`,{key:0,href:e.block.linkUrl,target:`_blank`,rel:`noopener noreferrer`,onClick:r[1]||=(0,t.withModifiers)(()=>{},[`prevent`])},[(0,t.createElementVNode)(`img`,{class:`tpl:border-0`,loading:`lazy`,src:e.block.src,alt:e.block.alt||(0,t.unref)(o).image.altTextPlaceholder,style:(0,t.normalizeStyle)(f.value)},null,12,hm)],8,mm)):((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:1,class:`tpl:border-0`,src:e.block.src,alt:e.block.alt,style:(0,t.normalizeStyle)(f.value)},null,12,gm))],64)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,_m,[l.value?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,"aria-label":(0,t.unref)(o).image.browseMedia,class:`tpl:flex tpl:items-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150 tpl:cursor-pointer tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-primary)] tpl:bg-[var(--tpl-bg)]`,onClick:(0,t.withModifiers)(u,[`stop`])},[(0,t.createVNode)((0,t.unref)(Nl),{size:14,"stroke-width":1.5}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(o).image.browseMedia),1)],8,vm)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,ym,(0,t.toDisplayString)((0,t.unref)(o).image.clickToAdd),1))]))],4))}})})),Sm,Cm=d((()=>{xm(),xm(),Sm=bm})),wm,Tm,Em,Dm,Om=d((()=>{k(),F(),wm={class:`tpl:w-full`},Tm=[`href`],Em={key:1,class:`tpl:flex tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:text-sm tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text-dim)]`},Dm=(0,t.defineComponent)({__name:`MenuBlock`,props:{block:{},viewport:{}},setup(e){let n=e,{t:r}=O(),i=(0,t.computed)(()=>({display:`flex`,flexWrap:`wrap`,gap:`0 ${n.block.spacing}px`,justifyContent:n.block.textAlign===`left`?`flex-start`:n.block.textAlign===`right`?`flex-end`:`center`,fontSize:`${n.block.fontSize}px`,fontFamily:n.block.fontFamily||`inherit`,alignItems:`center`})),a=(0,t.computed)(()=>n.block.items.length>0);function o(e){return e||n.block.linkColor||n.block.color}return(n,s)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,wm,[a.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,style:(0,t.normalizeStyle)(i.value)},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.block.items,(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:n.id},[(0,t.createElementVNode)(`a`,{href:n.url||`#`,class:`tpl:cursor-default tpl:no-underline`,style:(0,t.normalizeStyle)({color:o(n.color),fontWeight:n.bold?`bold`:`normal`,textDecoration:n.underline?`underline`:`none`}),onClick:s[0]||=(0,t.withModifiers)(()=>{},[`prevent`])},(0,t.toDisplayString)(n.text||`...`),13,Tm),r<e.block.items.length-1?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,style:(0,t.normalizeStyle)({color:e.block.separatorColor,padding:`0 ${e.block.spacing}px`})},(0,t.toDisplayString)(e.block.separator),5)):(0,t.createCommentVNode)(``,!0)],64))),128))],4)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Em,[(0,t.createVNode)((0,t.unref)(wu),{size:16}),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(r).menu.addLinks),1)]))]))}})})),km,Am=d((()=>{Om(),Om(),km=Dm}));function jm(e){let n=(0,t.inject)(Ve,[]),{syntax:i}=bp(),a=(0,t.computed)(()=>(0,r.resolveHtmlLogicMergeTagLabels)((0,r.resolveHtmlMergeTagLabels)(e(),n),i)),o=(0,t.ref)(!1),s=(0,t.ref)(null),{top:c,left:l}=we(s),u=(0,t.computed)(()=>({top:c.value-8,left:l.value}));function d(){o.value=!0}function f(){o.value=!1}return{isEditing:o,blockRef:s,toolbarPosition:u,resolvedContent:a,handleDoubleClick:d,handleEditorDone:f}}var Mm=d((()=>{Oe(),D(),xp()})),Nm,Pm,Fm,Im,Lm,Rm,zm=d((()=>{Rp(),yp(),Oe(),F(),Nm=[`aria-label`,`title`,`aria-expanded`],Pm=[`aria-label`],Fm={class:`tpl:mb-1.5 tpl:text-[10px] tpl:font-medium tpl:tracking-wide tpl:text-[var(--tpl-text-muted)] tpl:uppercase`},Im={class:`tpl:grid tpl:grid-cols-10 tpl:gap-0.5`},Lm=[`aria-label`,`onClick`],Rm=(0,t.defineComponent)({__name:`EmojiPickerDropdown`,emits:[`insert`],setup(e,{emit:n}){let r=n,{categories:i,isOpen:a,toggle:o,close:s}=Tp(),{t:c,format:l}=O(),u=(0,t.ref)(null),d=(0,t.ref)(null);_p(u,(0,t.computed)(()=>a.value)),_e(d,()=>{a.value&&s()});function f(e){r(`insert`,e),s()}return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`rootRef`,ref:d,class:`tpl:relative`},[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`tpl-text-toolbar-btn`,{"tpl-text-toolbar-btn--active":(0,t.unref)(a)}]),"aria-label":(0,t.unref)(c).paragraphEditor.insertEmoji,title:(0,t.unref)(c).paragraphEditor.insertEmoji,"aria-expanded":(0,t.unref)(a),"aria-haspopup":`dialog`,"aria-controls":`tpl-emoji-picker`,onClick:n[0]||=(...e)=>(0,t.unref)(o)&&(0,t.unref)(o)(...e)},[(0,t.createVNode)((0,t.unref)(zd),{size:16,"stroke-width":2})],10,Nm),(0,t.unref)(a)?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,id:`tpl-emoji-picker`,ref_key:`pickerRef`,ref:u,role:`dialog`,"aria-modal":`false`,"aria-label":(0,t.unref)(c).paragraphEditor.insertEmoji,tabindex:`-1`,class:`tpl-emoji-picker tpl:absolute tpl:top-full tpl:left-0 tpl:z-10 tpl:mt-2 tpl:w-72 tpl:rounded-lg tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-2 tpl:shadow-lg`,onKeydown:n[1]||=(0,t.withKeys)((0,t.withModifiers)((...e)=>(0,t.unref)(s)&&(0,t.unref)(s)(...e),[`stop`,`prevent`]),[`esc`])},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(i),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.key,class:`tpl:mb-2 tpl:last:mb-0`},[(0,t.createElementVNode)(`div`,Fm,(0,t.toDisplayString)((0,t.unref)(c).emoji[e.key]),1),(0,t.createElementVNode)(`div`,Im,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.emojis,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e,type:`button`,"aria-label":(0,t.unref)(l)((0,t.unref)(c).paragraphEditor.emojiItemLabel,{emoji:e}),class:`tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:text-base tpl:transition-all tpl:duration-100 tpl:hover:scale-125 tpl:hover:bg-[var(--tpl-bg-active)]`,onClick:t=>f(e)},(0,t.toDisplayString)(e),9,Lm))),128))])]))),128))],40,Pm)):(0,t.createCommentVNode)(``,!0)],512))}})})),Bm,Vm=d((()=>{zm(),zm(),Bm=Rm})),Hm,Um,Wm=d((()=>{Hm=[`aria-label`,`title`,`aria-pressed`],Um=(0,t.defineComponent)({__name:`ToolbarIconButton`,props:{icon:{},label:{},active:{type:Boolean},strokeWidth:{},size:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{type:`button`,class:(0,t.normalizeClass)([`tpl-text-toolbar-btn`,{"tpl-text-toolbar-btn--active":e.active}]),"aria-label":e.label,title:e.label,"aria-pressed":e.active?`true`:`false`},[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.icon),{size:e.size??16,"stroke-width":e.strokeWidth??2},null,8,[`size`,`stroke-width`]))],10,Hm))}})})),Gm,Km=d((()=>{Wm(),Wm(),Gm=Um}));function qm(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`span`,Ym)}var Jm,Ym,Xm,Zm=d((()=>{dp(),Jm={},Ym={class:`tpl:mx-1 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]`,"aria-hidden":`true`},Xm=up(Jm,[[`render`,qm]])})),Qm,$m,eh,th,nh=d((()=>{Qm=[`value`,`aria-label`,`title`],$m={value:``},eh=[`value`],th=(0,t.defineComponent)({__name:`ToolbarSelect`,props:{modelValue:{},options:{},label:{},placeholder:{},widthClass:{}},emits:[`update:modelValue`],setup(e,{emit:n}){let r=n;function i(e){r(`update:modelValue`,e.target.value)}function a(e){return typeof e==`string`?e:e.value}function o(e){return typeof e==`string`?e:e.label}return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`select`,{class:(0,t.normalizeClass)([`tpl:h-8 tpl:cursor-pointer tpl:rounded tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-2 tpl:text-xs tpl:text-[var(--tpl-text)] tpl:outline-none`,e.widthClass??`tpl:w-20`]),value:e.modelValue,"aria-label":e.label,title:e.label,onChange:i},[(0,t.createElementVNode)(`option`,$m,(0,t.toDisplayString)(e.placeholder??``),1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.options,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:a(e),value:a(e)},(0,t.toDisplayString)(o(e)),9,eh))),128))],42,Qm))}})})),rh,ih=d((()=>{nh(),nh(),rh=th})),I,ah,oh,sh,ch,lh,uh,dh,fh,ph,mh,hh,gh,_h,vh,yh=d((()=>{I=`tpl:block tpl:mb-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]`,ah=`tpl:w-full tpl:h-10 tpl:px-3.5 tpl:py-1.5 tpl:text-sm tpl:border tpl:rounded-[var(--tpl-radius-sm)] tpl:shadow-xs tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)] tpl:border-[var(--tpl-border)] tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:outline-none focus:tpl:border-[var(--tpl-primary)] focus:tpl:shadow-[var(--tpl-ring)] placeholder:tpl:text-[var(--tpl-text-dim)]`,oh=`tpl:w-full tpl:h-10 tpl:px-3.5 tpl:py-1.5 tpl:text-sm tpl:border tpl:rounded-l-[var(--tpl-radius-sm)] tpl:rounded-r-none tpl:border-r-0 tpl:shadow-xs tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)] tpl:border-[var(--tpl-border)] tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:outline-none focus:tpl:border-[var(--tpl-primary)] focus:tpl:shadow-[var(--tpl-ring)] placeholder:tpl:text-[var(--tpl-text-dim)]`,sh=`tpl:flex tpl:items-center tpl:px-2.5 tpl:text-xs tpl:border tpl:border-l-0 tpl:text-[var(--tpl-text-dim)] tpl:bg-[var(--tpl-bg-hover)] tpl:border-[var(--tpl-border)] tpl:rounded-r-[var(--tpl-radius-sm)]`,ch=`tpl:flex-1 tpl:h-10 tpl:px-3.5 tpl:py-1.5 tpl:text-xs tpl:font-mono tpl:border tpl:rounded-[var(--tpl-radius-sm)] tpl:shadow-xs tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)] tpl:border-[var(--tpl-border)] tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:outline-none focus:tpl:border-[var(--tpl-primary)] focus:tpl:shadow-[var(--tpl-ring)]`,lh=`tpl:rounded-[var(--tpl-radius)] tpl:bg-[var(--tpl-bg-elevated)] tpl:p-4 tpl:border tpl:border-[var(--tpl-border)] tpl:transition-colors tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-bg-hover)]`,uh=`tpl:flex tpl:size-8 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-danger)] tpl:hover:bg-[var(--tpl-danger-light)] tpl:hover:text-[var(--tpl-danger)]`,dh=`tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-dashed tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-primary)] tpl:hover:text-[var(--tpl-primary)]`,fh=`tpl:w-full tpl:resize-y tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-2.5 tpl:py-2 tpl:font-mono tpl:text-xs tpl:text-[var(--tpl-text)] tpl:outline-none tpl:transition-all tpl:duration-150 tpl:placeholder:text-[var(--tpl-text-dim)] tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[0_0_0_3px_var(--tpl-primary-light)]`,ph=`tpl-btn tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:px-3.5 tpl:py-2 tpl:text-sm tpl:font-medium tpl:whitespace-nowrap tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-primary)] hover:tpl:text-[var(--tpl-bg)] tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50`,mh=[`10px`,`12px`,`14px`,`16px`,`18px`,`20px`,`24px`,`28px`,`32px`,`36px`,`48px`,`64px`],hh=[`1`,`1.2`,`1.4`,`1.5`,`1.6`,`1.8`,`2`,`2.5`],gh=[{label:`Normal`,value:`normal`},{label:`-0.5px`,value:`-0.5px`},{label:`0.5px`,value:`0.5px`},{label:`1px`,value:`1px`},{label:`1.5px`,value:`1.5px`},{label:`2px`,value:`2px`},{label:`3px`,value:`3px`}],_h=`#000000`,vh=`#ffffff`})),bh,xh,Sh,Ch,wh,Th,Eh,Dh,Oh,kh,Ah=d((()=>{Vm(),Km(),Zm(),ih(),Rp(),F(),D(),yh(),bh=[`data-tpl-theme`,`aria-label`],xh={class:`tpl:flex tpl:items-center tpl:gap-1`},Sh={class:`tpl:relative`},Ch=[`value`,`aria-label`,`title`],wh={class:`tpl:relative`},Th=[`value`,`aria-label`,`title`],Eh={class:`tpl:flex tpl:items-center tpl:gap-1`},Dh=[`aria-label`,`title`],Oh={key:1,class:`tpl:flex tpl:items-center tpl:gap-2 tpl:px-2 tpl:text-xs tpl:text-[var(--tpl-text-dim)]`},kh=(0,t.defineComponent)({__name:`ParagraphToolbar`,props:{editor:{},toolbarPosition:{},isLoading:{type:Boolean},mergeTagEnabled:{type:Boolean}},emits:[`open-link-dialog`,`add-merge-tag`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.inject)(Ie,null),o=(0,t.inject)(Le,null),s=ke(Fe,`ParagraphToolbar`),{t:c}=O(),l=s.fonts;function u(e){r.editor?.chain().focus().insertContent(e).run()}function d(e){return r.editor?.getAttributes(`textStyle`)[e]||``}function f(e){let t=r.editor?.chain().focus();e?t?.setFontFamily(e).run():t?.unsetFontFamily().run()}function p(e){let t=r.editor?.chain().focus();e?t?.setFontSize(e).run():t?.unsetFontSize().run()}function m(e){let t=r.editor?.chain().focus();e?t?.setColor(e).run():t?.unsetColor().run()}function h(){return r.editor?.getAttributes(`paragraph`).lineHeight||``}function g(e){let t=r.editor?.chain().focus();e?t?.setLineHeight(e).run():t?.unsetLineHeight().run()}function _(e){let t=r.editor?.chain().focus();e&&e!==`normal`?t?.setLetterSpacing(e).run():t?.unsetLetterSpacing().run()}function v(){return r.editor?.getAttributes(`highlight`).color||``}function y(e){let t=r.editor?.chain().focus();e?t?.setHighlight({color:e}).run():t?.unsetHighlight().run()}return(n,r)=>((0,t.openBlock)(),(0,t.createBlock)(t.Teleport,{to:`body`},[(0,t.createElementVNode)(`div`,{"data-tpl-theme":(0,t.unref)(o),role:`toolbar`,"aria-label":(0,t.unref)(c).paragraphEditor.toolbar,class:`tpl tpl-text-toolbar tpl:fixed tpl:z-popover tpl:flex tpl:gap-1 tpl:rounded-lg tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 tpl:shadow-lg`,style:(0,t.normalizeStyle)({...(0,t.unref)(a),top:`${e.toolbarPosition.top}px`,left:`${e.toolbarPosition.left}px`,transform:`translateY(-100%)`,flexDirection:`column`})},[!e.isLoading&&e.editor?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createElementVNode)(`div`,xh,[(0,t.createVNode)(rh,{"model-value":d(`fontFamily`),options:(0,t.unref)(l),label:(0,t.unref)(c).paragraphEditor.fontFamily,placeholder:(0,t.unref)(c).paragraphEditor.defaultFont,"width-class":`tpl:w-32`,"onUpdate:modelValue":f},null,8,[`model-value`,`options`,`label`,`placeholder`]),(0,t.createVNode)(rh,{"model-value":d(`fontSize`),options:(0,t.unref)(mh),label:(0,t.unref)(c).paragraphEditor.fontSize,placeholder:(0,t.unref)(c).paragraphEditor.defaultSize,"width-class":`tpl:w-20`,"onUpdate:modelValue":p},null,8,[`model-value`,`options`,`label`,`placeholder`]),(0,t.createVNode)(Xm),(0,t.createElementVNode)(`div`,Sh,[(0,t.createElementVNode)(`input`,{type:`color`,class:`tpl:size-8 tpl:cursor-pointer tpl:rounded tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-1`,value:d(`color`)||(0,t.unref)(`#000000`),"aria-label":(0,t.unref)(c).paragraphEditor.textColor,title:(0,t.unref)(c).paragraphEditor.textColor,onInput:r[0]||=e=>m(e.target.value)},null,40,Ch)]),(0,t.createElementVNode)(`div`,wh,[(0,t.createElementVNode)(`input`,{type:`color`,class:`tpl:size-8 tpl:cursor-pointer tpl:rounded tpl:border tpl:border-[var(--tpl-border)] tpl:p-1`,style:(0,t.normalizeStyle)({backgroundColor:v()||`var(--tpl-bg)`}),value:v()||(0,t.unref)(`#ffff00`),"aria-label":(0,t.unref)(c).paragraphEditor.highlightColor,title:(0,t.unref)(c).paragraphEditor.highlightColor,onInput:r[1]||=e=>y(e.target.value)},null,44,Th)]),(0,t.createVNode)(Xm),(0,t.createVNode)(Gm,{icon:(0,t.unref)(vc),label:(0,t.unref)(c).paragraphEditor.bold,active:e.editor.isActive(`bold`),"stroke-width":2.5,onClick:r[2]||=t=>e.editor.chain().focus().toggleBold().run()},null,8,[`icon`,`label`,`active`]),(0,t.createVNode)(Gm,{icon:(0,t.unref)(zl),label:(0,t.unref)(c).paragraphEditor.italic,active:e.editor.isActive(`italic`),onClick:r[3]||=t=>e.editor.chain().focus().toggleItalic().run()},null,8,[`icon`,`label`,`active`]),(0,t.createVNode)(Gm,{icon:(0,t.unref)(Pf),label:(0,t.unref)(c).paragraphEditor.underline,active:e.editor.isActive(`underline`),onClick:r[4]||=t=>e.editor.chain().focus().toggleUnderline().run()},null,8,[`icon`,`label`,`active`]),(0,t.createVNode)(Gm,{icon:(0,t.unref)(Zd),label:(0,t.unref)(c).paragraphEditor.strikethrough,active:e.editor.isActive(`strike`),onClick:r[5]||=t=>e.editor.chain().focus().toggleStrike().run()},null,8,[`icon`,`label`,`active`]),(0,t.createVNode)(Xm),(0,t.createVNode)(Gm,{icon:(0,t.unref)(ef),label:(0,t.unref)(c).paragraphEditor.subscript,active:e.editor.isActive(`subscript`),onClick:r[6]||=t=>e.editor.chain().focus().toggleSubscript().run()},null,8,[`icon`,`label`,`active`]),(0,t.createVNode)(Gm,{icon:(0,t.unref)(sf),label:(0,t.unref)(c).paragraphEditor.superscript,active:e.editor.isActive(`superscript`),onClick:r[7]||=t=>e.editor.chain().focus().toggleSuperscript().run()},null,8,[`icon`,`label`,`active`]),(0,t.createVNode)(Xm),(0,t.createVNode)(Gm,{icon:(0,t.unref)(Gl),label:(0,t.unref)(c).paragraphEditor.addLink,active:e.editor.isActive(`link`),onClick:r[8]||=e=>i(`open-link-dialog`)},null,8,[`icon`,`label`,`active`])]),(0,t.createElementVNode)(`div`,Eh,[(0,t.createVNode)(Gm,{icon:(0,t.unref)(Zl),label:(0,t.unref)(c).paragraphEditor.bulletList,active:e.editor.isActive(`bulletList`),onClick:r[9]||=t=>e.editor.chain().focus().toggleBulletList().run()},null,8,[`icon`,`label`,`active`]),(0,t.createVNode)(Gm,{icon:(0,t.unref)(Jl),label:(0,t.unref)(c).paragraphEditor.numberedList,active:e.editor.isActive(`orderedList`),onClick:r[10]||=t=>e.editor.chain().focus().toggleOrderedList().run()},null,8,[`icon`,`label`,`active`]),(0,t.createVNode)(Xm),(0,t.createVNode)(Gm,{icon:(0,t.unref)(Sf),label:(0,t.unref)(c).paragraphEditor.alignLeft,active:e.editor.isActive({textAlign:`left`}),onClick:r[11]||=t=>e.editor.chain().focus().setTextAlign(`left`).run()},null,8,[`icon`,`label`,`active`]),(0,t.createVNode)(Gm,{icon:(0,t.unref)(gf),label:(0,t.unref)(c).paragraphEditor.alignCenter,active:e.editor.isActive({textAlign:`center`}),onClick:r[12]||=t=>e.editor.chain().focus().setTextAlign(`center`).run()},null,8,[`icon`,`label`,`active`]),(0,t.createVNode)(Gm,{icon:(0,t.unref)(yf),label:(0,t.unref)(c).paragraphEditor.alignRight,active:e.editor.isActive({textAlign:`right`}),onClick:r[13]||=t=>e.editor.chain().focus().setTextAlign(`right`).run()},null,8,[`icon`,`label`,`active`]),(0,t.createVNode)(Xm),(0,t.createVNode)(rh,{"model-value":h(),options:(0,t.unref)(hh),label:(0,t.unref)(c).paragraphEditor.lineHeight,placeholder:`LH`,"width-class":`tpl:w-16`,"onUpdate:modelValue":g},null,8,[`model-value`,`options`,`label`]),(0,t.createVNode)(rh,{"model-value":d(`letterSpacing`),options:(0,t.unref)(gh),label:(0,t.unref)(c).paragraphEditor.letterSpacing,placeholder:`LS`,"width-class":`tpl:w-20`,"onUpdate:modelValue":_},null,8,[`model-value`,`options`,`label`]),(0,t.createVNode)(Xm),(0,t.createVNode)(Gm,{icon:(0,t.unref)(rd),label:(0,t.unref)(c).paragraphEditor.clearFormatting,onClick:r[14]||=t=>e.editor.chain().focus().clearNodes().unsetAllMarks().run()},null,8,[`icon`,`label`]),(0,t.createVNode)(Xm),(0,t.createVNode)(Bm,{onInsert:u}),e.mergeTagEnabled?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createVNode)(Xm),(0,t.createElementVNode)(`button`,{type:`button`,class:`tpl:flex tpl:h-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded tpl:border-none tpl:bg-transparent tpl:px-2.5 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]`,"aria-label":(0,t.unref)(c).mergeTag.add,title:(0,t.unref)(c).mergeTag.add,onClick:r[15]||=e=>i(`add-merge-tag`)},[(0,t.createVNode)((0,t.unref)(hd),{size:16,"stroke-width":2}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(c).mergeTag.add),1)],8,Dh)],64)):(0,t.createCommentVNode)(``,!0)])],64)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Oh,[(0,t.createVNode)((0,t.unref)(eu),{class:`tpl-spinner`,size:14,"stroke-width":2}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(c).errors.editorLoading),1)]))],12,bh)]))}})})),jh,Mh=d((()=>{Ah(),Ah(),jh=kh})),Nh,Ph,Fh,Ih,Lh,Rh,zh,Bh,Vh,Hh,Uh,Wh=d((()=>{k(),F(),D(),Nh=[`data-tpl-theme`],Ph={class:`tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-5 tpl:py-4`},Fh={id:`tpl-link-dialog-title`,class:`tpl:m-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]`},Ih=[`aria-label`],Lh={class:`tpl:p-5`},Rh={class:`tpl:mb-4 tpl:last:mb-0`},zh={for:`tpl-link-dialog-url`,class:`tpl:mb-1.5 tpl:block tpl:text-xs tpl:font-medium tpl:tracking-wide tpl:text-[var(--tpl-text-muted)] tpl:uppercase`},Bh=[`placeholder`],Vh={class:`tpl:flex tpl:items-center tpl:justify-between tpl:border-t tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:px-5 tpl:py-4`},Hh={class:`tpl:ml-auto tpl:flex tpl:gap-2`},Uh=(0,t.defineComponent)({__name:`RichTextLinkDialog`,props:(0,t.mergeModels)({visible:{type:Boolean},isEditingLink:{type:Boolean}},{linkUrl:{required:!0},linkUrlModifiers:{},dialogRef:{required:!0},dialogRefModifiers:{}}),emits:(0,t.mergeModels)([`close`,`insert`,`remove`,`keydown`],[`update:linkUrl`,`update:dialogRef`]),setup(e,{emit:n}){let r=(0,t.useModel)(e,`linkUrl`),i=(0,t.useModel)(e,`dialogRef`),a=n,o=(0,t.inject)(Ie,null),s=(0,t.inject)(Le,null),{t:c}=O();return(n,l)=>((0,t.openBlock)(),(0,t.createBlock)(t.Teleport,{to:`body`},[e.visible?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,"data-tpl-theme":(0,t.unref)(s),class:`tpl tpl-link-dialog tpl:fixed tpl:inset-0 tpl:z-modal tpl:flex tpl:items-center tpl:justify-center`,style:(0,t.normalizeStyle)((0,t.unref)(o)),onClick:l[6]||=(0,t.withModifiers)(e=>a(`close`),[`self`])},[(0,t.createElementVNode)(`div`,{ref:e=>i.value=e,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`tpl-link-dialog-title`,class:`tpl:w-[400px] tpl:overflow-hidden tpl:rounded-lg tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:shadow-lg`},[(0,t.createElementVNode)(`div`,Ph,[(0,t.createElementVNode)(`h4`,Fh,(0,t.toDisplayString)(e.isEditingLink?(0,t.unref)(c).linkDialog.editLink:(0,t.unref)(c).linkDialog.insertLink),1),(0,t.createElementVNode)(`button`,{type:`button`,"aria-label":(0,t.unref)(c).linkDialog.cancel,class:`tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text-muted)] tpl:hover:bg-[var(--tpl-bg-hover)] tpl:hover:text-[var(--tpl-text)]`,onClick:l[0]||=e=>a(`close`)},[(0,t.createVNode)((0,t.unref)(Qf),{size:16,"stroke-width":2})],8,Ih)]),(0,t.createElementVNode)(`div`,Lh,[(0,t.createElementVNode)(`div`,Rh,[(0,t.createElementVNode)(`label`,zh,(0,t.toDisplayString)((0,t.unref)(c).linkDialog.urlLabel),1),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{id:`tpl-link-dialog-url`,"onUpdate:modelValue":l[1]||=e=>r.value=e,type:`url`,class:`tpl:w-full tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2.5 tpl:text-sm tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:outline-none tpl:placeholder:text-[var(--tpl-text-dim)] tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[0_0_0_3px_var(--tpl-primary-light)]`,placeholder:(0,t.unref)(c).linkDialog.urlPlaceholder,autofocus:``,onKeydown:l[2]||=e=>a(`keydown`,e)},null,40,Bh),[[t.vModelText,r.value]])])]),(0,t.createElementVNode)(`div`,Vh,[e.isEditingLink?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,class:`tpl:inline-flex tpl:cursor-pointer tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-danger)] tpl:bg-transparent tpl:px-4 tpl:py-2 tpl:text-[13px] tpl:font-medium tpl:text-[var(--tpl-danger)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-danger-light)]`,onClick:l[3]||=e=>a(`remove`)},(0,t.toDisplayString)((0,t.unref)(c).linkDialog.removeLink),1)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,Hh,[(0,t.createElementVNode)(`button`,{type:`button`,class:`tpl:inline-flex tpl:cursor-pointer tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-transparent tpl:px-4 tpl:py-2 tpl:text-[13px] tpl:font-medium tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-hover)] tpl:hover:text-[var(--tpl-text)]`,onClick:l[4]||=e=>a(`close`)},(0,t.toDisplayString)((0,t.unref)(c).linkDialog.cancel),1),(0,t.createElementVNode)(`button`,{type:`button`,class:`tpl:inline-flex tpl:cursor-pointer tpl:items-center tpl:rounded-md tpl:border-none tpl:bg-[var(--tpl-primary)] tpl:px-4 tpl:py-2 tpl:text-[13px] tpl:font-medium tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-primary-hover)] tpl:text-[var(--tpl-bg)]`,onClick:l[5]||=e=>a(`insert`)},(0,t.toDisplayString)(e.isEditingLink?(0,t.unref)(c).linkDialog.updateLink:(0,t.unref)(c).linkDialog.insertLink),1)])])],512)],12,Nh)):(0,t.createCommentVNode)(``,!0)]))}})})),Gh,Kh=d((()=>{Wh(),Wh(),Gh=Uh})),qh,Jh,Yh,Xh,Zh=d((()=>{k(),qh={key:0,class:`tpl-text-editable tpl:min-h-[1.5em] tpl:rounded tpl:border tpl:border-dashed tpl:border-[var(--tpl-primary)] tpl:p-2`},Jh={class:`tpl:animate-pulse tpl:text-[var(--tpl-text-dim)]`},Yh={key:1,class:`tpl-text-editable tpl:min-h-[1.5em] tpl:rounded tpl:border tpl:border-dashed tpl:p-2 tpl:text-center tpl:text-xs tpl:border-[var(--tpl-danger)] tpl:text-[var(--tpl-text-muted)]`},Xh=(0,t.defineComponent)({__name:`RichTextEditorContent`,props:{editor:{},editorContent:{},isLoading:{type:Boolean},initError:{}},emits:[`retry`],setup(e,{emit:n}){let r=n,{t:i}=O();return(n,a)=>e.isLoading?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,qh,[(0,t.createElementVNode)(`div`,Jh,(0,t.toDisplayString)((0,t.unref)(i).errors.editorLoading),1)])):e.initError?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Yh,[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(i).errors.editorLoadFailed)+` `,1),(0,t.createElementVNode)(`button`,{class:`tpl:ml-1 tpl:cursor-pointer tpl:border-none tpl:bg-transparent tpl:p-0 tpl:underline tpl:text-[var(--tpl-primary)]`,onClick:a[0]||=e=>r(`retry`)},(0,t.toDisplayString)((0,t.unref)(i).errors.retry),1)])):e.editorContent&&e.editor?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.editorContent),{key:2,editor:e.editor,class:`tpl-text-editable tpl:min-h-[1.5em] tpl:rounded tpl:border tpl:border-dashed tpl:border-[var(--tpl-primary)] tpl:p-2`},null,8,[`editor`])):(0,t.createCommentVNode)(``,!0)}})})),Qh,$h=d((()=>{Zh(),Zh(),Qh=Xh}));function eg(e){this.content=e}var tg=d((()=>{eg.prototype={constructor:eg,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new eg(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new eg(n)},addToStart:function(e,t){return new eg([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new eg(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new eg(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=eg.from(e),e.size?new eg(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=eg.from(e),e.size?new eg(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=eg.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},eg.from=function(e){if(e instanceof eg)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new eg(t)}}));function ng(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=ng(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function rg(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=rg(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}function ig(e,t){return Yg.index=e,Yg.offset=t,Yg}function ag(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!ag(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!ag(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}function og(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(og(a.content,t-i-1,n-i-1)))}function sg(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),o=e.maybeChild(i);if(a==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=sg(o.content,t-a-1,n,o);return s&&e.replaceChild(i,o.copy(s))}function cg(e,t,n){if(n.openStart>e.depth)throw new Zg(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Zg(`Inconsistent open depths`);return lg(e,t,n,0)}function lg(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=lg(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return mg(a,gg(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return mg(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=_g(n,e);return mg(a,hg(e,i,o,t,r))}}function ug(e,t){if(!t.type.compatibleContent(e.type))throw new Zg(`Cannot join `+t.type.name+` onto `+e.type.name)}function dg(e,t,n){let r=e.node(n);return ug(r,t.node(n)),r}function fg(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function pg(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(fg(e.nodeAfter,r),a++));for(let e=a;e<o;e++)fg(i.child(e),r);t&&t.depth==n&&t.textOffset&&fg(t.nodeBefore,r)}function mg(e,t){return e.type.checkContent(t),e.copy(t)}function hg(e,t,n,r,i){let a=e.depth>i&&dg(e,t,i+1),o=r.depth>i&&dg(n,r,i+1),s=[];return pg(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(ug(a,o),fg(mg(a,hg(e,t,n,r,i+1)),s)):(a&&fg(mg(a,gg(e,t,i+1)),s),pg(t,n,i,s),o&&fg(mg(o,gg(n,r,i+1)),s)),pg(r,null,i,s),new L(s)}function gg(e,t,n){let r=[];return pg(null,e,n,r),e.depth>n&&fg(mg(dg(e,t,n+1),gg(e,t,n+1)),r),pg(t,null,n,r),new L(r)}function _g(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(L.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}function vg(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}function yg(e){let t=[];do t.push(bg(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function bg(e){let t=[];do t.push(xg(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function xg(e){let t=Tg(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=Cg(e,t);else break;return t}function Sg(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function Cg(e,t){let n=Sg(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:Sg(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function wg(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function Tg(e){if(e.eat(`(`)){let t=yg(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}else if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=wg(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function Eg(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function Dg(e,t){return t-e}function Og(e,t){let n=[];return r(t),n.sort(Dg);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function kg(e){let t=Object.create(null);return n(Og(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);Og(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new o_(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(Dg);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function Ag(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function jg(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function Mg(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function Ng(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function Pg(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new l_(e,r,t[r]);return n}function Fg(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}function Ig(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function Lg(e){return e.tag!=null}function Rg(e){return e.style!=null}function zg(e,t,n){return t==null?e&&e.whitespace==`pre`?g_|__:n&~v_:(t?g_:0)|(t===`full`?__:0)}function Bg(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&h_.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function Vg(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Hg(e){let t={};for(let n in e)t[n]=e[n];return t}function Ug(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}function Wg(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Gg(e){return e.document||window.document}function Kg(e){let t=S_.get(e);return t===void 0&&S_.set(e,t=qg(e)),t}function qg(e){let t=null;function n(e){if(e&&typeof e==`object`)if(Array.isArray(e))if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}function Jg(e,t,n,r){if(typeof t==`string`)return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=Kg(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}else{let{dom:t,contentDOM:i}=Jg(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var L,Yg,Xg,Zg,R,Qg,$g,e_,t_,n_,r_,i_,a_,o_,s_,c_,l_,u_,d_,f_,p_,m_,h_,g_,__,v_,y_,b_,x_,S_,C_=d((()=>{tg(),L=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return ng(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return rg(this,e,t,n)}findIndex(e){if(e==0)return ig(0,e);if(e==this.size)return ig(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?ig(t+1,i):ig(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return new e(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}},L.empty=new L([],0),Yg={index:0,offset:0},Xg=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else !n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&ag(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(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].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}},Xg.none=[],Zg=class extends Error{},R=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=sg(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(og(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(L.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}},R.empty=new R(L.empty,0,0),Qg=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Xg.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new n_(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=t_.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else t_.set(t,r=new $g);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%e_,i}},$g=class{constructor(){this.elts=[],this.i=0}},e_=12,t_=new WeakMap,n_=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},r_=Object.create(null),i_=class e{constructor(e,t,n,r=Xg.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||L.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&ag(this.attrs,t||e.defaultAttrs||r_)&&Xg.sameSet(this.marks,n||Xg.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return R.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new R(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return cg(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return Qg.resolveCached(this,e)}resolveNoCache(e){return Qg.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),vg(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=L.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Xg.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!Xg.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=L.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}},i_.prototype.text=void 0,a_=class e extends i_{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):vg(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}},o_=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new s_(t,n);if(r.next==null)return e.empty;let i=yg(r);r.next&&r.err(`Unexpected trailing text`);let a=kg(Eg(i));return Ag(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return L.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
15
- `)}},o_.empty=new o_(!0),s_=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}},c_=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=Pg(e,n.attrs),this.defaultAttrs=jg(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==o_.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Mg(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new i_(this,this.computeAttrs(e),L.from(t),Xg.setFrom(n))}createChecked(e=null,t,n){return t=L.from(t),this.checkContent(t),new i_(this,this.computeAttrs(e),t,Xg.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=L.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(L.empty,!0);return i?new i_(this,e,t.append(i),Xg.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Ng(this.attrs,e,`node`,this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:Xg.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}},l_=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?Fg(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},u_=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=Pg(e,r.attrs),this.excluded=null;let i=jg(this.attrs);this.instance=i?new Xg(this,i):null}create(e=null){return!e&&this.instance?this.instance:new Xg(this,Mg(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Ng(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},d_=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=eg.from(e.nodes),t.marks=eg.from(e.marks||{}),this.nodes=c_.compile(this.spec.nodes,this),this.marks=u_.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=o_.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?Ig(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:Ig(this,n.split(` `))}this.nodeFromJSON=e=>i_.fromJSON(this,e),this.markFromJSON=e=>Xg.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof c_))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new a_(n,n.defaultAttrs,e,Xg.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}},f_=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(Lg(e))this.tags.push(e);else if(Rg(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new b_(this,t,!1);return n.addAll(e,Xg.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new b_(this,t,!0);return n.addAll(e,Xg.none,t.from,t.to),R.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(Vg(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Hg(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Hg(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},p_={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},m_={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},h_={ol:!0,ul:!0},g_=1,__=2,v_=4,y_=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=Xg.none,this.match=i||(a&v_?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(L.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&g_)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=L.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(L.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!p_.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},b_=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=zg(null,t.preserveWhitespace,0)|(n?v_:0);i=r?new y_(r.type,r.attrs,Xg.none,!0,t.topMatch||r.type.contentMatch,a):n?new y_(null,null,Xg.none,!0,null,a):new y_(e.schema.topNodeType,null,Xg.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&__?`full`:this.localPreserveWS||(r.options&g_)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
16
- `);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;h_.hasOwnProperty(a)&&this.parser.normalizeLists&&Bg(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:m_.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(p_.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
17
- `),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=Xg.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):Ug(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=zg(e,i,a.options);a.options&v_&&a.content.length==0&&(o|=v_);let s=Xg.none;return n=n.filter(t=>(a.type?a.type.allowsMarkType(t.type):Ug(t.type,e))?(s=t.addToSet(s),!1):!0),this.nodes.push(new y_(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=g_);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}else{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}},x_=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=Gg(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=Jg(Gg(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&Jg(Gg(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return Jg(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=Wg(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return Wg(e.marks)}},S_=new WeakMap}));function w_(e,t){return e+t*hv}function T_(e){return e&mv}function E_(e){return(e-(e&mv))/hv}function D_(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(D_(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return L.fromArray(r)}function O_(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function k_(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new Dv(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new Ev(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function A_(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof u_){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new Dv(t.from,t.to,t.style)))}function j_(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new Av(s,l,R.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new Dv(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new R(L.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new Av(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(L.empty,!0);e.replace(s,s,new R(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function M_(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function N_(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!M_(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function P_(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=L.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=L.from(r.node(e).copy(u)),d++):c--;let f=L.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=L.from(i.node(e).copy(f)),p++):l++;e.step(new jv(c,l,o,s,new R(u.append(f),d,p),u.size-d,!0))}function F_(e,t,n=null,r=e){let i=L_(e,t),a=i&&R_(r,t);return a?i.map(I_).concat({type:t,attrs:n}).concat(a.map(I_)):null}function I_(e){return{type:e,attrs:null}}function L_(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function R_(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function z_(e,t,n){let r=L.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=L.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new jv(i,a,i,a,new R(r,0,0),n.length,!0))}function B_(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&U_(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&H_(e,t,n,a),j_(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new jv(c,l,c+1,l-1,new R(L.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&V_(e,t,n,a),!1}})}function V_(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function H_(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
18
- `))}})}function U_(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function W_(e,t,n,r,i){let a=e.doc.nodeAt(t);if(!a)throw RangeError(`No node at given position`);n||=a.type;let o=n.create(r,null,i||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw RangeError(`Invalid content for node type `+n.name);e.step(new jv(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new R(L.from(o),0,0),1,!0))}function G_(e,t,n=1,r){let i=e.resolve(t),a=i.depth-n,o=r&&r[r.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>a;e--,t--){let n=i.node(e),a=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(a,n.childCount),s=r&&r[t+1];s&&(o=o.replaceChild(0,s.type.create(s.attrs)));let c=r&&r[t]||n;if(!n.canReplace(a+1,n.childCount)||!c.type.validContent(o))return!1}let s=i.indexAfter(a),c=r&&r[0];return i.node(a).canReplaceWith(s,s,c?c.type:i.node(a+1).type)}function K_(e,t,n=1,r){let i=e.doc.resolve(t),a=L.empty,o=L.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=L.from(i.node(e).copy(a));let t=r&&r[s];o=L.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new Av(t,t,new R(a.append(o),n,n),!0))}function q_(e,t){let n=e.resolve(t),r=n.index();return Y_(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function J_(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let a=t.child(i),o=a.type==r?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function Y_(e,t){return!!(e&&t&&!e.isLeaf&&J_(e,t))}function X_(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,a,o=r.index(e);if(e==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(e+1),o++,a=r.node(e).maybeChild(o)):(i=r.node(e).maybeChild(o-1),a=r.node(e+1)),i&&!i.isTextblock&&Y_(i,a)&&r.node(e).canReplace(o,o+1))return t;if(e==0)break;t=n<0?r.before(e):r.after(e)}}function Z_(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(i&&o.inlineContent){let e=o.whitespace==`pre`,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s=e.steps.length;if(r===!1){let r=e.doc.resolve(t+n);H_(e,r.node(),r.before(),s)}o.inlineContent&&j_(e,t+n-1,o,a.node().contentMatchAt(a.index()),r==null);let c=e.mapping.slice(s),l=c.map(t-n);if(e.step(new Av(l,c.map(t+n,-1),R.empty,!0)),r===!0){let t=e.doc.resolve(l);V_(e,t.node(),t.before(),e.steps.length)}return e}function Q_(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}function $_(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(n.openStart==0&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+ +(n>0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e&&o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function ev(e,t,n=t,r=R.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return tv(i,a,r)?new Av(t,n,r):new Mv(i,a,r).fit()}function tv(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}function nv(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(nv(e.firstChild.content,t-1,n)))}function rv(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(rv(e.lastChild.content,t-1,n)))}function iv(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function av(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,av(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(L.empty,!0)))),e.copy(r)}function ov(e,t,n,r,i){let a=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let s=r.fillBefore(a.content,!0,o);return s&&!sv(n,a.content,o)?s:null}function sv(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function cv(e){return e.spec.defining||e.spec.definingForContent}function lv(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(tv(i,a,r))return e.step(new Av(t,n,r));let o=pv(i,a);o[o.length-1]==0&&o.pop();let s=-(i.depth+1);o.unshift(s);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;o.indexOf(e)>-1?s=e:i.before(e)==t&&o.splice(1,0,-e)}let c=o.indexOf(s),l=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(l.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=l[e],n=cv(t.type);if(n&&!t.sameMarkup(i.node(Math.abs(s)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let s=(t+u+1)%(r.openStart+1),d=l[s];if(d)for(let t=0;t<o.length;t++){let l=o[(t+c)%o.length],u=!0;l<0&&(u=!1,l=-l);let f=i.node(l-1),p=i.index(l-1);if(f.canReplaceWith(p,p,d.type,d.marks))return e.replace(i.before(l),u?a.after(l):n,new R(uv(r.content,0,r.openStart,s),s,r.openEnd))}}let d=e.steps.length;for(let s=o.length-1;s>=0&&(e.replace(t,n,r),!(e.steps.length>d));s--){let e=o[s];e<0||(t=i.before(e),n=a.after(e))}}function uv(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(uv(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(L.empty,!0))}return e}function dv(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=Q_(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new R(L.from(r),0,0))}function fv(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),a=pv(r,i);for(let t=0;t<a.length;t++){let n=a[t],o=t==a.length-1;if(o&&n==0||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function pv(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}var mv,hv,gv,_v,vv,yv,bv,xv,Sv,Cv,wv,Tv,Ev,Dv,Ov,kv,Av,jv,Mv,Nv,Pv,Fv,Iv,Lv=d((()=>{C_(),mv=65535,hv=2**16,gv=1,_v=2,vv=4,yv=8,bv=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&yv)>0}get deletedBefore(){return(this.delInfo&(gv|vv))>0}get deletedAfter(){return(this.delInfo&(_v|vv))>0}get deletedAcross(){return(this.delInfo&vv)>0}},xv=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=T_(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+E_(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:w_(o/3,e-s),f=e==s?_v:e==u?gv:vv;return(t<0?e!=s:e!=u)&&(f|=yv),new bv(a,f,d)}r+=l-c}return n?e+r:new bv(e+r,0,null)}touches(e,t){let n=0,r=T_(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}},xv.empty=new xv([]),Sv=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new bv(e,r,null)}},Cv=Object.create(null),wv=class{getMap(){return xv.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=Cv[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Cv)throw RangeError(`Duplicate use of step JSON ID `+e);return Cv[e]=t,t.prototype.jsonID=e,t}},Tv=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof Zg)return e.fail(t.message);throw t}}},Ev=class e extends wv{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new R(D_(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return Tv.fromReplace(e,this.from,this.to,i)}invert(){return new Dv(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}},wv.jsonID(`addMark`,Ev),Dv=class e extends wv{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new R(D_(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return Tv.fromReplace(e,this.from,this.to,n)}invert(){return new Ev(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}},wv.jsonID(`removeMark`,Dv),Ov=class e extends wv{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Tv.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Tv.fromReplace(e,this.pos,this.pos+1,new R(L.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new kv(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}},wv.jsonID(`addNodeMark`,Ov),kv=class e extends wv{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Tv.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Tv.fromReplace(e,this.pos,this.pos+1,new R(L.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Ov(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}},wv.jsonID(`removeNodeMark`,kv),Av=class e extends wv{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&O_(e,this.from,this.to)?Tv.fail(`Structure replace would overwrite content`):Tv.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new xv([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new e(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?R.empty:new R(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?R.empty:new R(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,R.fromJSON(t,n.slice),!!n.structure)}},wv.jsonID(`replace`,Av),jv=class e extends wv{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(O_(e,this.from,this.gapFrom)||O_(e,this.gapTo,this.to)))return Tv.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Tv.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?Tv.fromReplace(e,this.from,this.to,n):Tv.fail(`Content does not fit in gap`)}getMap(){return new xv([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,R.fromJSON(t,n.slice),n.insert,!!n.structure)}},wv.jsonID(`replaceAround`,jv),Mv=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=L.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=L.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,a=n.depth,o=r.depth;for(;a&&o&&i.childCount==1;)i=i.firstChild.content,a--,o--;let s=new R(i,a,o);return e>-1?new jv(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new Av(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=iv(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let{type:a,match:o}=this.frontier[e],s,c=null;if(t==1&&(i?o.matchType(i.type)||(c=o.fillBefore(L.from(i),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:c};if(t==2&&i&&(s=o.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:s};if(r&&o.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=iv(e,t);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new R(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=iv(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new R(nv(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new R(nv(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let a=this.unplaced,o=n?n.content:a.content,s=a.openStart-e,c=0,l=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));u=u.matchFragment(r)}let f=o.size+e-(a.content.size-a.openEnd);for(;c<o.childCount;){let e=o.child(c),t=u.matchType(e.type);if(!t)break;c++,(c>1||s==0||e.content.size)&&(u=t,l.push(av(e.mark(d.allowedMarks(e.marks)),c==1?s:0,c==o.childCount?f:-1)))}let p=c==o.childCount;p||(f=-1),this.placed=rv(this.placed,t,L.from(l)),this.frontier[t].match=u,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?e==0?R.empty:new R(nv(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new R(nv(a.content,e,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!ov(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){scan:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=ov(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=ov(e,n,r,t,!0);if(!i||i.childCount)continue scan}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=rv(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=rv(this.placed,this.depth,L.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(L.empty,!0);e.childCount&&(this.placed=rv(this.placed,this.frontier.length,e))}},Nv=class e extends wv{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Tv.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return Tv.fromReplace(e,this.pos,this.pos+1,new R(L.from(r),0,+!t.isLeaf))}getMap(){return xv.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:`attr`,pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}},wv.jsonID(`attr`,Nv),Pv=class e extends wv{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Tv.ok(n)}getMap(){return xv.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}},wv.jsonID(`docAttr`,Pv),Fv=class extends Error{},Fv=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},Fv.prototype=Object.create(Error.prototype),Fv.prototype.constructor=Fv,Fv.prototype.name=`TransformError`,Iv=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Sv}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Fv(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,a)=>{e=Math.min(e,i),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=R.empty){let r=ev(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new R(L.from(n),0,0))}delete(e,t){return this.replace(e,t,R.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return lv(this,e,t,n),this}replaceRangeWith(e,t,n){return dv(this,e,t,n),this}deleteRange(e,t){return fv(this,e,t),this}lift(e,t){return P_(this,e,t),this}join(e,t=1){return Z_(this,e,t),this}wrap(e,t){return z_(this,e,t),this}setBlockType(e,t=e,n,r=null){return B_(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return W_(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new Nv(e,t,n)),this}setDocAttribute(e,t){return this.step(new Pv(e,t)),this}addNodeMark(e,t){return this.step(new Ov(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof Xg)t.isInSet(n.marks)&&this.step(new kv(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new kv(e,i)),r=i.removeFromSet(r);for(let e=a.length-1;e>=0;e--)this.step(a[e])}return this}split(e,t=1,n){return K_(this,e,t,n),this}addMark(e,t,n){return k_(this,e,t,n),this}removeMark(e,t,n){return A_(this,e,t,n),this}clearIncompatible(e,t,n){return j_(this,e,t,n),this}}})),Rv=d((()=>{Lv()}));function zv(e){!qv&&!e.parent.inlineContent&&(qv=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}function Bv(e,t,n,r,i,a=!1){if(t.inlineContent)return B.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=Bv(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&V.isSelectable(r))return V.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function Vv(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Av||i instanceof jv))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(z.near(e.doc.resolve(o),n))}function Hv(e,t){return!t||!e?e:e.bind(t)}function Uv(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=Uv(i,t,{})),n[r]=i}return n}function Wv(e){return e in sy?e+`$`+ ++sy[e]:(sy[e]=0,e+`$`)}var Gv,z,Kv,qv,B,Jv,V,Yv,Xv,Zv,Qv,$v,ey,ty,ny,ry,iy,ay,oy,sy,cy,ly=d((()=>{C_(),Lv(),Gv=Object.create(null),z=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Kv(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=R.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?R.empty:t),o==0&&Vv(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),Vv(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new B(e):Bv(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?Bv(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):Bv(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Xv(e.node(0))}static atStart(e){return Bv(e,e,0,0,1)||new Xv(e)}static atEnd(e){return Bv(e,e,e.content.size,e.childCount,-1)||new Xv(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=Gv[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Gv)throw RangeError(`Duplicate use of selection JSON ID `+e);return Gv[e]=t,t.prototype.jsonID=e,t}getBookmark(){return B.between(this.$anchor,this.$head).getBookmark()}},z.prototype.visible=!0,Kv=class{constructor(e,t){this.$from=e,this.$to=t}},qv=!1,B=class e extends z{constructor(e,t=e){zv(e),zv(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return z.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=R.empty){if(super.replace(e,t),t==R.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Jv(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=z.findFrom(n,r,!0)||z.findFrom(n,-r,!0);if(e)n=e.$head;else return z.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(z.findFrom(t,-r,!0)||z.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}},z.jsonID(`text`,B),Jv=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return B.between(e.resolve(this.anchor),e.resolve(this.head))}},V=class e extends z{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?z.near(a):new e(a)}content(){return new R(L.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new Yv(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}},V.prototype.visible=!1,z.jsonID(`node`,V),Yv=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Jv(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&V.isSelectable(n)?new V(t):z.near(t)}},Xv=class e extends z{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=R.empty){if(t==R.empty){e.delete(0,e.doc.content.size);let t=z.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:`all`}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return Zv}},z.jsonID(`all`,Xv),Zv={map(){return this},resolve(e){return new Xv(e)}},Qv=1,$v=2,ey=4,ty=class extends Iv{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError(`Selection passed to setSelection must point at the current document`);return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Qv)&~$v,this.storedMarks=null,this}get selectionSet(){return(this.updated&Qv)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=$v,this}ensureMarks(e){return Xg.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&$v)>0}addStep(e,t){super.addStep(e,t),this.updated&=~$v,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Xg.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(n??=t,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(z.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e==`string`?e:e.key]=t,this}getMeta(e){return this.meta[typeof e==`string`?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=ey,this}get scrolledIntoView(){return(this.updated&ey)>0}},ny=class{constructor(e,t,n){this.name=e,this.init=Hv(t.init,n),this.apply=Hv(t.apply,n)}},ry=[new ny(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new ny(`selection`,{init(e,t){return e.selection||z.atStart(t.doc)},apply(e){return e.selection}}),new ny(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new ny(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],iy=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=ry.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError(`Adding different instances of a keyed plugin (`+e.key+`)`);this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new ny(e.key,e.spec.state,e))})}},ay=class e{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let a=0;a<this.config.plugins.length;a++){let o=this.config.plugins[a];if(o.spec.appendTransaction){let s=r?r[a].n:0,c=r?r[a].state:this,l=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,c,n);if(l&&n.filterTransaction(l,a)){if(l.setMeta(`appendedTransaction`,e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<a?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),i=!0}r&&(r[a]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError(`Applying a mismatched transaction`);let n=new e(this.config),r=this.config.fields;for(let e=0;e<r.length;e++){let i=r[e];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new ty(this)}static create(t){let n=new iy(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n);for(let e=0;e<n.fields.length;e++)r[n.fields[e].name]=n.fields[e].init(t,r);return r}reconfigure(t){let n=new iy(this.schema,t.plugins),r=n.fields,i=new e(n);for(let e=0;e<r.length;e++){let n=r[e].name;i[n]=this.hasOwnProperty(n)?this[n]:r[e].init(t,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&typeof e==`object`)for(let n in e){if(n==`doc`||n==`selection`)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(t,n,r){if(!n)throw RangeError(`Invalid input for EditorState.fromJSON`);if(!t.schema)throw RangeError(`Required config field 'schema' missing`);let i=new iy(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=i_.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=z.fromJSON(a.doc,n.selection);else if(e.name==`storedMarks`)n.storedMarks&&(a.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let i in r){let o=r[i],s=o.spec.state;if(o.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){a[e.name]=s.fromJSON.call(o,t,n[i],a);return}}a[e.name]=e.init(t,a)}}),a}},oy=class{constructor(e){this.spec=e,this.props={},e.props&&Uv(e.props,this,this.props),this.key=e.key?e.key.key:Wv(`plugin`)}getState(e){return e[this.key]}},sy=Object.create(null),cy=class{constructor(e=`key`){this.key=Wv(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}}));function uy(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}function dy(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let a=t.nodeAfter,o=t.pos+1;for(;!a.isTextblock;o++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let s=ev(e.doc,i,o,R.empty);if(!s||s.from!=i||s instanceof Av&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(B.create(t.doc,i)),n(t.scrollIntoView())}return!0}function fy(e,t,n=!1){for(let r=e;r;r=t==`start`?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}function py(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function my(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}function hy(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}function gy(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function _y(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof V&&t.selection.node.isBlock)return!r.parentOffset||!G_(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let a=[],o,s,c=!1,l=!1;for(let t=r.depth;;t--)if(r.node(t).isBlock){c=r.end(t)==r.pos+(r.depth-t),l=r.start(t)==r.pos-(r.depth-t),s=gy(r.node(t-1).contentMatchAt(r.indexAfter(t-1)));let n=e&&e(i.parent,c,r);a.unshift(n||(c&&s?{type:s}:null)),o=t;break}else{if(t==1)return!1;a.unshift(null)}let u=t.tr;(t.selection instanceof B||t.selection instanceof Xv)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=G_(u.doc,d,a.length,a);if(f||=(a[0]=s?{type:s}:null,G_(u.doc,d,a.length,a)),!f)return!1;if(u.split(d,a.length,a),!c&&l&&r.node(o).type!=s){let e=u.mapping.map(r.before(o)),t=u.doc.resolve(e);s&&r.node(o-1).canReplaceWith(t.index(),t.index()+1,s)&&u.setNodeMarkup(u.mapping.map(r.before(o)),s)}return n&&n(u.scrollIntoView()),!0}}function vy(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||q_(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function yy(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&vy(e,t,n))return!0;let l=!c&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,s=L.empty;for(let e=o.length-1;e>=0;e--)s=L.from(o[e].create(null,s));s=L.from(i.copy(s));let c=e.tr.step(new jv(t.pos-1,r,t.pos,r,new R(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&q_(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:z.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&N_(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&fy(a,`start`,!0)&&fy(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let s=a,c=1;for(;!s.isTextblock;s=s.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=L.empty;for(let e=o.length-1;e>=0;e--)r=L.from(o[e].copy(r));n(e.tr.step(new jv(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new R(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function by(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(n&&n(t.tr.setSelection(B.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}function xy(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&F_(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function Sy(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(a,o,(r,a)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)i=!0;else{let t=n.doc.resolve(a),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(a,o,e,t)}r(i.scrollIntoView())}return!0}}function Cy(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}var wy,Ty,Ey,Dy,Oy,ky,Ay,jy,My,Ny,Py,Fy,Iy,Ly,Ry,zy,By,Vy,Hy,Uy,Wy,Gy,Ky,qy=d((()=>{Lv(),C_(),ly(),wy=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0),Ty=(e,t,n)=>{let r=uy(e,n);if(!r)return!1;let i=py(r);if(!i){let n=r.blockRange(),i=n&&N_(n);return i==null?!1:(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(yy(e,i,t,-1))return!0;if(r.parent.content.size==0&&(fy(a,`end`)||V.isSelectable(a)))for(let n=r.depth;;n--){let o=ev(e.doc,r.before(n),r.after(n),R.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(fy(a,`end`)?z.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):V.create(n.doc,i.pos-a.nodeSize)),t(n.scrollIntoView())}return!0}if(n==1||r.node(n-1).childCount>1)break}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},Ey=(e,t,n)=>{let r=uy(e,n);if(!r)return!1;let i=py(r);return i?dy(e,i,t):!1},Dy=(e,t,n)=>{let r=my(e,n);if(!r)return!1;let i=hy(r);return i?dy(e,i,t):!1},Oy=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`backward`,e):r.parentOffset>0)return!1;a=py(r)}let o=a&&a.nodeBefore;return!o||!V.isSelectable(o)?!1:(t&&t(e.tr.setSelection(V.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)},ky=(e,t,n)=>{let r=my(e,n);if(!r)return!1;let i=hy(r);if(!i)return!1;let a=i.nodeAfter;if(yy(e,i,t,1))return!0;if(r.parent.content.size==0&&(fy(a,`start`)||V.isSelectable(a))){let n=ev(e.doc,r.before(),r.after(),R.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(fy(a,`start`)?z.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):V.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+a.nodeSize).scrollIntoView()),!0):!1},Ay=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`forward`,e):r.parentOffset<r.parent.content.size)return!1;a=hy(r)}let o=a&&a.nodeAfter;return!o||!V.isSelectable(o)?!1:(t&&t(e.tr.setSelection(V.create(e.doc,a.pos)).scrollIntoView()),!0)},jy=(e,t)=>{let n=e.selection,r=n instanceof V,i;if(r){if(n.node.isTextblock||!q_(e.doc,n.from))return!1;i=n.from}else if(i=X_(e.doc,n.from,-1),i==null)return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(V.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},My=(e,t)=>{let n=e.selection,r;if(n instanceof V){if(n.node.isTextblock||!q_(e.doc,n.to))return!1;r=n.to}else if(r=X_(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},Ny=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&N_(i);return a==null?!1:(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},Py=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
19
- `).scrollIntoView()),!0)},Fy=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),a=n.indexAfter(-1),o=gy(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(z.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},Iy=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Xv||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=gy(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,a.createAndFill());o.setSelection(B.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},Ly=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(G_(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&N_(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)},Ry=_y(),zy=(e,t)=>{let{$from:n,to:r}=e.selection,i,a=n.sharedDepth(r);return a==0?!1:(i=n.before(a),t&&t(e.tr.setSelection(V.create(e.doc,i))),!0)},By=(e,t)=>(t&&t(e.tr.setSelection(new Xv(e.doc))),!0),Vy=by(-1),Hy=by(1),Uy=Cy(wy,Ty,Oy),Wy=Cy(wy,ky,Ay),Gy={Enter:Cy(Py,Iy,Ly,Ry),"Mod-Enter":Fy,Backspace:Uy,"Mod-Backspace":Uy,"Shift-Backspace":Uy,Delete:Wy,"Mod-Delete":Wy,"Mod-a":By},Ky={"Ctrl-h":Gy.Backspace,"Alt-Backspace":Gy[`Mod-Backspace`],"Ctrl-d":Gy.Delete,"Ctrl-Alt-Backspace":Gy[`Mod-Delete`],"Alt-Delete":Gy[`Mod-Delete`],"Alt-d":Gy[`Mod-Delete`],"Ctrl-a":Vy,"Ctrl-e":Hy};for(let e in Gy)Ky[e]=Gy[e];typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform()})),Jy=d((()=>{qy()})),Yy=d((()=>{ly()})),Xy=d((()=>{C_()}));function Zy(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a);if(!o)return!1;let s=r?n.tr:null;return Qy(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function Qy(e,t,n,r=null){let i=!1,a=t,o=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let e=o.resolve(t.start-2);a=new n_(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new n_(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=F_(a,n,r,t);return s?(e&&$y(e,t,s,i,n),!0):!1}function $y(e,t,n,r,i){let a=L.empty;for(let e=n.length-1;e>=0;e--)a=L.from(n[e].type.create(n[e].attrs,a));e.step(new jv(t.start-(r?2:0),t.end,t.start,t.end,new R(a,0,0),n.length,!0));let o=0;for(let e=0;e<n.length;e++)n[e].type==i&&(o=e+1);let s=n.length-o,c=t.start+n.length-(r?2:0),l=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&G_(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function eb(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?tb(t,n,e,a):nb(t,n,a):!0:!1}}function tb(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new jv(a-1,o,a,o,new R(L.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new n_(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=N_(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return q_(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function nb(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,a=n.startIndex;t>a;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let a=r.doc.resolve(n.start),o=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,c=n.endIndex==i.childCount,l=a.node(-1),u=a.index(-1);if(!l.canReplace(u+ +!s,u+1,o.content.append(c?L.empty:L.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new jv(d-+!!s,f+ +!!c,d+1,f-1,new R((s?L.empty:L.from(i.copy(L.empty))).append(c?L.empty:L.from(i.copy(L.empty))),+!s,+!c),+!s)),t(r.scrollIntoView()),!0}function rb(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let s=a.parent,c=s.child(o-1);if(c.type!=e)return!1;if(n){let r=c.lastChild&&c.lastChild.type==s.type,i=L.from(r?e.create():null),o=new R(L.from(e.create(null,L.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new jv(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}var ib=d((()=>{Lv(),C_()})),ab=d((()=>{ib()}));function ob(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:sb(e))){let n=e.parentNode;if(!n||n.nodeType!=1||db(e)||lC.test(e.nodeName)||e.contentEditable==`false`)return!1;t=rC(e)+(i<0?0:1),e=n}else if(e.nodeType==1){let n=e.childNodes[t+(i<0?-1:0)];if(n.nodeType==1&&n.contentEditable==`false`)if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1;else e=n,t=i<0?sb(e):0}else return!1}}function sb(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function cb(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=sb(e)}else if(e.parentNode&&!db(e))t=rC(e),e=e.parentNode;else return null}}function lb(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable==`false`)return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!db(e))t=rC(e)+1,e=e.parentNode;else return null}}function ub(e,t,n){for(let r=t==0,i=t==sb(e);r||i;){if(e==n)return!0;let t=rC(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==sb(e)}}function db(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}function fb(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function pb(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function mb(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(sb(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(sb(r.startContainer),r.startOffset)}}}function hb(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function gb(e,t){return typeof e==`number`?e:e[t]}function _b(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function vb(e,t,n){let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(o.nodeType!=1){o=iC(o);continue}let e=o,n=e==a.body,s=n?hb(a):_b(e),c=0,l=0;if(t.top<s.top+gb(r,`top`)?l=-(s.top-t.top+gb(i,`top`)):t.bottom>s.bottom-gb(r,`bottom`)&&(l=t.bottom-t.top>s.bottom-s.top?t.top+gb(i,`top`)-s.top:t.bottom-s.bottom+gb(i,`bottom`)),t.left<s.left+gb(r,`left`)?c=-(s.left-t.left+gb(i,`left`)):t.right>s.right-gb(r,`right`)&&(c=t.right-s.right+gb(i,`right`)),c||l)if(n)a.defaultView.scrollBy(c,l);else{let n=e.scrollLeft,r=e.scrollTop;l&&(e.scrollTop+=l),c&&(e.scrollLeft+=c);let i=e.scrollLeft-n,a=e.scrollTop-r;t={left:t.left-i,top:t.top-a,right:t.right-i,bottom:t.bottom-a}}let u=n?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(u))break;o=u==`absolute`?o.offsetParent:iC(o)}}function yb(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let a=(t.left+t.right)/2,o=n+1;o<Math.min(innerHeight,t.bottom);o+=5){let t=e.root.elementFromPoint(a,o);if(!t||t==e.dom||!e.dom.contains(t))continue;let s=t.getBoundingClientRect();if(s.top>=n-20){r=t,i=s.top;break}}return{refDOM:r,refTop:i,stack:bb(e.dom)}}function bb(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=iC(r));return t}function xb({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;Sb(n,r==0?0:r-t)}function Sb(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:a}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=a&&(r.scrollLeft=a)}}function Cb(e){if(e.setActive)return e.setActive();if(AC)return e.focus(AC);let t=bb(e);e.focus(AC==null?{get preventScroll(){return AC={preventScroll:!0},!0}}:void 0),AC||(AC=!1,Sb(t,0))}function wb(e,t){let n,r=2e8,i,a=0,o=t.top,s=t.top,c,l;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let e;if(u.nodeType==1)e=u.getClientRects();else if(u.nodeType==3)e=oC(u).getClientRects();else continue;for(let f=0;f<e.length;f++){let p=e[f];if(p.top<=o&&p.bottom>=s){o=Math.max(p.bottom,o),s=Math.min(p.top,s);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<r){n=u,r=e,i=e&&n.nodeType==3?{left:p.right<t.left?p.right:p.left,top:t.top}:t,u.nodeType==1&&e&&(a=d+ +(t.left>=(p.left+p.right)/2));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=d+1)}}return!n&&c&&(n=c,i=l,r=0),n&&n.nodeType==3?Tb(n,i):!n||r&&n.nodeType==1?{node:e,offset:a}:wb(n,i)}function Tb(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let a=0;a<n;a++){r.setEnd(e,a+1),r.setStart(e,a);let n=Nb(r,1);if(n.top!=n.bottom&&Eb(t,n)){i={node:e,offset:a+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}function Eb(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Db(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function Ob(e,t,n){let{node:r,offset:i}=wb(t,n),a=-1;if(r.nodeType==1&&!r.firstChild){let e=r.getBoundingClientRect();a=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,a)}function kb(e,t,n,r){let i=-1;for(let n=t,a=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(t.dom.nodeType==1&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!a&&o.left>r.left||o.top>r.top?i=t.posBefore:(!a&&o.right<r.left||o.bottom<r.top)&&(i=t.posAfter),a=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(o.top+o.bottom)/2:r.left<(o.left+o.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function Ab(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),a=i;;){let n=e.childNodes[a];if(n.nodeType==1){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(Eb(t,i))return Ab(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function jb(e,t){let n=e.dom.ownerDocument,r,i=0,a=mb(n,t.left,t.top);a&&({node:r,offset:i}=a);let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!o||!e.dom.contains(o.nodeType==1?o:o.parentNode)){let n=e.dom.getBoundingClientRect();if(!Eb(t,n)||(o=Ab(e.dom,t,n),!o))return null}if(CC)for(let e=o;r&&e;e=iC(e))e.draggable&&(r=void 0);if(o=Db(o,t),r){if(yC&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let e=r.childNodes[i],n;e.nodeName==`IMG`&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&i++}let n;OC&&i&&r.nodeType==1&&(n=r.childNodes[i-1]).nodeType==1&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!=`BR`)&&(s=kb(e,r,i,t))}s??=Ob(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function Mb(e){return e.top<e.bottom||e.left<e.right}function Nb(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(Mb(e))return e}return Array.prototype.find.call(n,Mb)||e.getBoundingClientRect()}function Pb(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=OC||yC;if(r.nodeType==3)if(o&&(jC.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=Nb(oC(r,i,i),n);if(yC&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=Nb(oC(r,i-1,i-1),-1);if(t.top==e.top){let n=Nb(oC(r,i,i+1),-1);if(n.top!=e.top)return Fb(n,n.left<t.left)}}return e}else{let e=i,t=i,a=n<0?1:-1;return n<0&&!i?(t++,a=-1):n>=0&&i==r.nodeValue.length?(e--,a=1):n<0?e--:t++,Fb(Nb(oC(r,e,t),a),a<0)}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==sb(r))){let e=r.childNodes[i-1];if(e.nodeType==1)return Ib(e.getBoundingClientRect(),!1)}if(a==null&&i<sb(r)){let e=r.childNodes[i];if(e.nodeType==1)return Ib(e.getBoundingClientRect(),!0)}return Ib(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==sb(r))){let e=r.childNodes[i-1],t=e.nodeType==3?oC(e,sb(e)-+!o):e.nodeType==1&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return Fb(Nb(t,1),!1)}if(a==null&&i<sb(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?e.nodeType==3?oC(e,0,+!o):e.nodeType==1?e:null:null;if(t)return Fb(Nb(t,-1),!0)}return Fb(Nb(r.nodeType==3?oC(r):r,-n),n>=0)}function Fb(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function Ib(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Lb(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function Rb(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return Lb(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,n==`up`?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=Pb(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(e.nodeType==1)t=e.getClientRects();else if(e.nodeType==3)t=oC(e,0,e.nodeValue.length).getClientRects();else continue;for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&(n==`up`?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})}function zb(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,a=!i,o=i==r.parent.content.size,s=e.domSelection();return s?!MC.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:Lb(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:a,anchorOffset:o}=e.domSelectionRange(),c=s.caretBidiLevel;s.modify(`move`,n,`character`);let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),f=u&&!l.contains(u.nodeType==1?u:u.parentNode)||t==u&&i==d;try{s.collapse(a,o),t&&(t!=a||i!=o)&&s.extend&&s.extend(t,i)}catch{}return c!=null&&(s.caretBidiLevel=c),f}):r.pos==r.start()||r.pos==r.end()}function Bb(e,t,n){return NC==t&&PC==n?FC:(NC=t,PC=n,FC=n==`up`||n==`down`?Rb(e,t,n):zb(e,t,n))}function Vb(e,t,n,r,i){Kb(r,t,e);let a=new WC(void 0,e,t,n,r,r,r,i,0);return a.contentDOM&&a.updateChildren(i,0),a}function Hb(e,t,n){let r=e.firstChild,i=!1;for(let a=0;a<t.length;a++){let o=t[a],s=o.dom;if(s.parentNode==e){for(;s!=r;)r=Jb(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof UC){let t=r?r.previousSibling:e.lastChild;Hb(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=Jb(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}function Ub(e,t,n){if(e.length==0)return YC;let r=n?YC[0]:new JC,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o){o.nodeName&&i.push(r=new JC(o.nodeName));for(let e in o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new JC(t.isInline?`span`:`div`)),e==`class`?r.class=(r.class?r.class+` `:``)+a:e==`style`?r.style=(r.style?r.style+`;`:``)+a:e!=`nodeName`&&(r[e]=a))}}}return i}function Wb(e,t,n,r){if(n==YC&&r==YC)return t;let i=t;for(let t=0;t<r.length;t++){let a=r[t],o=n[t];if(t){let t;o&&o.nodeName==a.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==a.nodeName?i=t:(t=document.createElement(a.nodeName),t.pmIsDeco=!0,t.appendChild(i),o=YC[0],i=t)}Gb(i,o||YC[0],a)}return i}function Gb(e,t,n){for(let r in t)r!=`class`&&r!=`style`&&r!=`nodeName`&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!=`class`&&r!=`style`&&r!=`nodeName`&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(` `).filter(Boolean):[],i=n.class?n.class.split(` `).filter(Boolean):[];for(let t=0;t<r.length;t++)i.indexOf(r[t])==-1&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)r.indexOf(i[t])==-1&&e.classList.add(i[t]);e.classList.length==0&&e.removeAttribute(`class`)}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}function Kb(e,t,n){return Wb(e,e,YC,Ub(t,n,e.nodeType!=1))}function qb(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function Jb(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}function Yb(e,t){let n=t,r=n.children.length,i=e.childCount,a=new Map,o=[];outer:for(;i>0;){let s;for(;;)if(r){let e=n.children[r-1];if(e instanceof UC)n=e,r=e.children.length;else{s=e,r--;break}}else if(n==t)break outer;else r=n.parent.children.indexOf(n),n=n.parent;let c=s.node;if(c){if(c!=e.child(i-1))break;--i,a.set(s,i),o.push(s)}}return{index:i,matched:a,matches:o.reverse()}}function Xb(e,t){return e.type.side-t.type.side}function Zb(e,t,n,r){let i=t.locals(e),a=0;if(i.length==0){for(let n=0;n<e.childCount;n++){let o=e.child(n);r(o,i,t.forChild(a,o),n),a+=o.nodeSize}return}let o=0,s=[],c=null;for(let l=0;;){let u,d;for(;o<i.length&&i[o].to==a;){let e=i[o++];e.widget&&(u?(d||=[u]).push(e):u=e)}if(u)if(d){d.sort(Xb);for(let e=0;e<d.length;e++)n(d[e],l,!!c)}else n(u,l,!!c);let f,p;if(c)p=-1,f=c,c=null;else if(l<e.childCount)p=l,f=e.child(l++);else break;for(let e=0;e<s.length;e++)s[e].to<=a&&s.splice(e--,1);for(;o<i.length&&i[o].from<=a&&i[o].to>a;)s.push(i[o++]);let m=a+f.nodeSize;if(f.isText){let e=m;o<i.length&&i[o].from<e&&(e=i[o].from);for(let t=0;t<s.length;t++)s[t].to<e&&(e=s[t].to);e<m&&(c=f.cut(e-a),f=f.cut(0,e-a),m=e,p=-1)}else for(;o<i.length&&i[o].to<m;)o++;let h=f.isInline&&!f.isLeaf?s.filter(e=>!e.inline):s.slice();r(f,h,t.forChild(a,f),p),a=m}}function Qb(e){if(e.nodeName==`UL`||e.nodeName==`OL`){let t=e.style.cssText;e.style.cssText=t+`; list-style: square !important`,window.getComputedStyle(e).listStyle,e.style.cssText=t}}function $b(e,t,n,r){for(let i=0,a=0;i<e.childCount&&a<=r;){let o=e.child(i++),s=a;if(a+=o.nodeSize,!o.isText)continue;let c=o.text;for(;i<e.childCount;){let t=e.child(i++);if(a+=t.nodeSize,!t.isText)break;c+=t.text}if(a>=n){if(a>=r&&c.slice(r-t.length-s,r-s)==t)return r-t.length;let e=s<r?c.lastIndexOf(t,r-s-1):-1;if(e>=0&&e+t.length+s>=n)return s+e;if(n==r&&c.length>=r+t.length-s&&c.slice(r-s,r-s+t.length)==t)return r}}return-1}function ex(e,t,n,r,i){let a=[];for(let o=0,s=0;o<e.length;o++){let c=e[o],l=s,u=s+=c.size;l>=n||u<=t?a.push(c):(l<t&&a.push(c.slice(0,t-l,r)),i&&=(a.push(i),void 0),u>n&&a.push(c.slice(n-l,c.size,r)))}return a}function tx(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),a=i&&i.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let s=r.resolve(o),c,l;if(uC(n)){for(c=o;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&V.isSelectable(e)&&i.parent&&!(e.isInline&&ub(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new V(o==e?s:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=o,i=o;for(let r=0;r<n.rangeCount;r++){let a=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(a.startContainer,a.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(a.endContainer,a.endOffset,-1))}if(t<0)return null;[c,o]=i==e.state.selection.anchor?[i,t]:[t,i],s=r.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!l){let n=t==`pointer`||e.state.selection.head<s.pos&&!a?1:-1;l=dx(e,u,s,n)}return l}function nx(e){return e.editable?e.hasFocus():px(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function rx(e,t=!1){let n=e.state.selection;if(lx(e,n),nx(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&xC){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&cC(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)cx(e);else{let{anchor:r,head:i}=n,a,o;ZC&&!(n instanceof B)&&(n.$from.parent.inlineContent||(a=ix(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=ix(e,n.to))),e.docView.setSelection(r,i,e,t),ZC&&(a&&ox(a),o&&ox(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&sx(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}function ix(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,a=r?n.childNodes[r-1]:null;if(CC&&i&&i.contentEditable==`false`)return ax(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return ax(i);if(a)return ax(a)}}function ax(e){return e.contentEditable=`true`,CC&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function ox(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function sx(e){let t=e.dom.ownerDocument;t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener(`selectionchange`,e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard),setTimeout(()=>{(!nx(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function cx(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,rC(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&_C&&vC<=11&&(n.disabled=!0,n.disabled=!1)}function lx(e,t){if(t instanceof V){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(ux(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else ux(e)}function ux(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function dx(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||B.between(t,n,r)}function fx(e){return e.editable&&!e.hasFocus()?!1:px(e)}function px(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function mx(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return cC(t.node,t.offset,n.anchorNode,n.anchorOffset)}function hx(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&z.findFrom(a,t)}function gx(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function _x(e,t,n){let r=e.state.selection;if(r instanceof B){if(n.indexOf(`s`)>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return gx(e,new B(r.$anchor,a))}else if(!r.empty)return!1;else if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=hx(e.state,t);return n&&n instanceof V?gx(e,n):!1}else if(!(TC&&n.indexOf(`m`)>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,a;if(!i||i.isText)return!1;let o=t<0?n.pos-i.nodeSize:n.pos;return i.isAtom||(a=e.docView.descAt(o))&&!a.contentDOM?V.isSelectable(i)?gx(e,new V(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):OC?gx(e,new B(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1:!1}}else if(r instanceof V&&r.node.isInline)return gx(e,new B(t>0?r.$to:r.$from));else{let n=hx(e.state,t);return n?gx(e,n):!1}}function vx(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function yx(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`)}function bx(e,t){return t<0?xx(e):Sx(e)}function xx(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(yC&&n.nodeType==1&&r<vx(n)&&yx(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let e=n.childNodes[r-1];if(yx(e,-1))i=n,a=--r;else if(e.nodeType==3)n=e,r=n.nodeValue.length;else break}}else if(Cx(n))break;else{let t=n.previousSibling;for(;t&&yx(t,-1);)i=n.parentNode,a=rC(t),t=t.previousSibling;if(t)n=t,r=vx(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?Ex(e,n,r):i&&Ex(e,i,a)}function Sx(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=vx(n),a,o;for(;;)if(r<i){if(n.nodeType!=1)break;let e=n.childNodes[r];if(yx(e,1))a=n,o=++r;else break}else if(Cx(n))break;else{let t=n.nextSibling;for(;t&&yx(t,1);)a=t.parentNode,o=rC(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=vx(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&Ex(e,a,o)}function Cx(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function wx(e,t){for(;e&&t==e.childNodes.length&&!db(e);)t=rC(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=0}}function Tx(e,t){for(;e&&!t&&!db(e);)t=rC(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=e.childNodes.length}}function Ex(e,t,n){if(t.nodeType!=3){let e,r;(r=wx(t,n))?(t=r,n=0):(e=Tx(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(uC(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&rx(e)},50)}function Dx(e,t){let n=e.state.doc.resolve(t);if(!(xC||EC)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?`ltr`:`rtl`}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?`ltr`:`rtl`}}return getComputedStyle(e.dom).direction==`rtl`?`rtl`:`ltr`}function Ox(e,t,n){let r=e.state.selection;if(r instanceof B&&!r.empty||n.indexOf(`s`)>-1||TC&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=hx(e.state,t);if(n&&n instanceof V)return gx(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof Xv?z.near(n,t):z.findFrom(n,t);return o?gx(e,o):!1}return!1}function kx(e,t){if(!(e.state.selection instanceof B))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let r=e.state.tr;return t<0?r.delete(n.pos-a.nodeSize,n.pos):r.delete(n.pos,n.pos+a.nodeSize),e.dispatch(r),!0}return!1}function Ax(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function jx(e){if(!CC||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable==`false`){let n=t.firstChild;Ax(e,n,`true`),setTimeout(()=>Ax(e,n,`false`),20)}return!1}function Mx(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function Nx(e,t){let n=t.keyCode,r=Mx(t);if(n==8||TC&&n==72&&r==`c`)return kx(e,-1)||bx(e,-1);if(n==46&&!t.shiftKey||TC&&n==68&&r==`c`)return kx(e,1)||bx(e,1);if(n==13||n==27)return!0;if(n==37||TC&&n==66&&r==`c`){let t=n==37?Dx(e,e.state.selection.from)==`ltr`?-1:1:-1;return _x(e,t,r)||bx(e,t)}else if(n==39||TC&&n==70&&r==`c`){let t=n==39?Dx(e,e.state.selection.from)==`ltr`?1:-1:1;return _x(e,t,r)||bx(e,t)}else if(n==38||TC&&n==80&&r==`c`)return Ox(e,-1,r)||bx(e,-1);else if(n==40||TC&&n==78&&r==`c`)return jx(e)||Ox(e,1,r)||bx(e,1);else if(r==(TC?`m`:`c`)&&(n==66||n==73||n==89||n==90))return!0;return!1}function Px(e,t){e.someProp(`transformCopied`,n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:a}=t;for(;i>1&&a>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,a--;let e=r.firstChild;n.push(e.type.name,e.attrs==e.type.defaultAttrs?null:e.attrs),r=e.content}let o=e.someProp(`clipboardSerializer`)||x_.fromSchema(e.state.schema),s=Hx(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&l.nodeType==1&&(u=$C[l.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=s.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),d++}l=c.firstChild}return l&&l.nodeType==1&&l.setAttribute(`data-pm-slice`,`${i} ${a}${d?` -${d}`:``} ${JSON.stringify(n)}`),{dom:c,text:e.someProp(`clipboardTextSerializer`,n=>n(t,e))||t.content.textBetween(0,t.content.size,`
20
-
21
- `),slice:t}}function Fx(e,t,n,r,i){let a=i.parent.type.spec.code,o,s;if(!n&&!t)return null;let c=!!t&&(r||a||!n);if(c){if(e.someProp(`transformPastedText`,n=>{t=n(t,a||r,e)}),a)return s=new R(L.from(e.state.schema.text(t.replace(/\r\n?/g,`
22
- `))),0,0),e.someProp(`transformPasted`,t=>{s=t(s,e,!0)}),s;let n=e.someProp(`clipboardTextParser`,n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,a=x_.fromSchema(r);o=document.createElement(`div`),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement(`p`));e&&t.appendChild(a.serializeNode(r.text(e,n)))})}}else e.someProp(`transformPastedHTML`,t=>{n=t(n,e)}),o=Wx(n),OC&&Gx(o);let l=o&&o.querySelector(`[data-pm-slice]`),u=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute(`data-pm-slice`)||``);if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&e.nodeType!=1;)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||f_.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!QC.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=Kx(Vx(s,+u[1],+u[2]),u[4]);else if(s=R.maxOpen(Ix(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=Vx(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e,c)}),s}function Ix(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(e=>{if(!a)return;let t=r.findWrapping(e.type),n;if(!t)return a=null;if(n=a.length&&i.length&&Rx(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=zx(a[a.length-1],i.length));let n=Lx(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return L.from(a)}return e}function Lx(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,L.from(e));return e}function Rx(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=Rx(e,t,n,r.lastChild,i+1);if(a)return r.copy(r.content.replaceChild(r.childCount-1,a));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(L.from(Lx(n,e,i+1))))}}function zx(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,zx(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(L.empty,!0);return e.copy(n.append(r))}function Bx(e,t,n,r,i,a){let o=t<0?e.firstChild:e.lastChild,s=o.content;return e.childCount>1&&(a=0),i<r-1&&(s=Bx(s,t,n,r,i+1,a)),i>=n&&(s=t<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(L.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function Vx(e,t,n){return t<e.openStart&&(e=new R(Bx(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new R(Bx(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}function Hx(){return ew||=document.implementation.createHTMLDocument(`title`)}function Ux(e){let t=window.trustedTypes;return t?(tw||=t.defaultPolicy||t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e}),tw.createHTML(e)):e}function Wx(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=Hx().createElement(`div`),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&$C[r[1].toLowerCase()])&&(e=i.map(e=>`<`+e+`>`).join(``)+e+i.map(e=>`</`+e+`>`).reverse().join(``)),n.innerHTML=Ux(e),i)for(let e=0;e<i.length;e++)n=n.querySelector(i[e])||n;return n}function Gx(e){let t=e.querySelectorAll(xC?`span:not([class]):not([style])`:`span.Apple-converted-space`);for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==`\xA0`&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(` `),r)}}function Kx(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:a,openEnd:o}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;i=L.from(t.create(r[e+1],i)),a++,o++}return new R(i,a,o)}function qx(e){for(let t in nw){let n=nw[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{Qx(e,t)&&!Zx(e,t)&&(e.editable||!(t.type in rw))&&n(e,t)},iw[t]?{passive:!0}:void 0)}CC&&e.dom.addEventListener(`input`,()=>null),Xx(e)}function Jx(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Yx(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function Xx(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Zx(e,t))})}function Zx(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function Qx(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function $x(e,t){!Zx(e,t)&&nw[t.type]&&(e.editable||!(t.type in rw))&&nw[t.type](e,t)}function eS(e){return{left:e.clientX,top:e.clientY}}function tS(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function nS(e,t,n,r,i){if(r==-1)return!1;let a=e.state.doc.resolve(r);for(let r=a.depth+1;r>0;r--)if(e.someProp(t,t=>r>a.depth?t(e,n,a.nodeAfter,a.before(r),i,!0):t(e,n,a.node(r),a.before(r),i,!1)))return!0;return!1}function rS(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);n==`pointer`&&r.setMeta(`pointer`,!0),e.dispatch(r)}function iS(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&V.isSelectable(r)?(rS(e,new V(n),`pointer`),!0):!1}function aS(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof V&&(r=n.node);let a=e.state.doc.resolve(t);for(let e=a.depth+1;e>0;e--){let t=e>a.depth?a.nodeAfter:a.node(e);if(V.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?a.before(n.$from.depth):a.before(e);break}}return i==null?!1:(rS(e,V.create(e.state.doc,i),`pointer`),!0)}function oS(e,t,n,r,i){return nS(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?aS(e,n):iS(e,n))}function sS(e,t,n,r){return nS(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function cS(e,t,n,r){return nS(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||lS(e,n,r)}function lS(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(rS(e,B.create(r,0,r.content.size),`pointer`),!0):!1;let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),a=i.before(t);if(n.inlineContent)rS(e,B.create(r,a+1,a+1+n.content.size),`pointer`);else if(V.isSelectable(n))rS(e,V.create(r,a),`pointer`);else continue;return!0}}function uS(e){return _S(e)}function dS(e,t){return e.composing?!0:CC&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}function fS(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable==`false`}function pS(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>_S(e),t))}function mS(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=gS());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function hS(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=cb(t.focusNode,t.focusOffset),r=lb(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return r}}return n||r}function gS(){let e=document.createEvent(`Event`);return e.initEvent(`event`,!0,!0),e.timeStamp}function _S(e,t=!1){if(!(DC&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),mS(e),t||e.docView&&e.docView.dirty){let n=tx(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function vS(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement(`div`));n.appendChild(t),n.style.cssText=`position: fixed; left: -10000px; top: 10px`;let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}function yS(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function bS(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?`textarea`:`div`));n||(r.contentEditable=`true`),r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?xS(e,r.value,null,i,t):xS(e,r.textContent,r.innerHTML,i,t)},50)}function xS(e,t,n,r,i){let a=Fx(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||R.empty)))return!0;if(!a)return!1;let o=yS(a),s=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(a);return e.dispatch(s.scrollIntoView().setMeta(`paste`,!0).setMeta(`uiEvent`,`paste`)),!0}function SS(e){let t=e.getData(`text/plain`)||e.getData(`Text`);if(t)return t;let n=e.getData(`text/uri-list`);return n?n.replace(/\r?\n/g,` `):``}function CS(e,t){return e.someProp(`dragCopies`,e=>!e(t))??!t[dw]}function wS(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(eS(t));if(!r)return;let i=e.state.doc.resolve(r.pos),a=n&&n.slice;a?e.someProp(`transformPasted`,t=>{a=t(a,e,!1)}):a=Fx(e,SS(t.dataTransfer),lw?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&CS(e,t));if(e.someProp(`handleDrop`,n=>n(e,t,a||R.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?$_(e.state.doc,i.pos,a):i.pos;s??=i.pos;let c=e.state.tr;if(o){let{node:e}=n;e?e.replace(c):c.deleteSelection()}let l=c.mapping.map(s),u=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(u?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let f=c.doc.resolve(l);if(u&&V.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new V(f));else{let t=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),c.setSelection(dx(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}function TS(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}function ES(e,t,n,r,i,a,o){let s=e.slice();for(let e=0,t=a;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,a)=>{let o=a-i-(n-e);for(let i=0;i<s.length;i+=3){let a=s[i+1];if(a<0||e>a+t-r)continue;let c=s[i]+t-r;n>=c?s[i+1]=e<=c?-2:-1:e>=t&&o&&(s[i]+=o,s[i+1]+=o)}r+=o}),t=n.maps[e].map(t,-1)}let c=!1;for(let t=0;t<s.length;t+=3)if(s[t+1]<0){if(s[t+1]==-2){c=!0,s[t+1]=-1;continue}let l=n.map(e[t]+a),u=l-i;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(e[t+1]+a,-1)-i,{index:f,offset:p}=r.content.findIndex(u),m=r.maybeChild(f);if(m&&p==u&&p+m.nodeSize==d){let r=s[t+2].mapInner(n,m,l+1,e[t]+a+1,o);r==yw?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=jS(OS(s,e,t,n,i,a,o),r,0,o);t=c.local;for(let e=0;e<s.length;e+=3)s[e+1]<0&&(s.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<s.length&&s[t]<n;)t+=3;s.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new vw(t.sort(MS),s)}function DS(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new hw(i.from+t,i.to+t,i.type))}return n}function OS(e,t,n,r,i,a,o){function s(e,t){for(let a=0;a<e.local.length;a++){let s=e.local[a].map(r,i,t);s?n.push(s):o.onRemove&&o.onRemove(e.local[a].spec)}for(let n=0;n<e.children.length;n+=3)s(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)e[n+1]==-1&&s(e[n+2],t[n]+a+1);return n}function kS(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,a;t<e.length;t++)(a=e[t])&&a.from>n&&a.to<r&&((i||=[]).push(a),e[t]=null);return i}function AS(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function jS(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=kS(e,t,o+n);if(s){a=!0;let e=jS(s,t,n+o+1,r);e!=yw&&i.push(o,o+t.nodeSize,e)}});let o=DS(a?AS(e):e,-n).sort(MS);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||(r.onRemove&&r.onRemove(o[e].spec),o.splice(e--,1));return o.length||i.length?new vw(o,i):yw}function MS(e,t){return e.from-t.from||e.to-t.to}function NS(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let a=t[i];if(a.from==r.from){a.to!=r.to&&(t==e&&(t=e.slice()),t[i]=a.copy(a.from,r.to),PS(t,i+1,a.copy(r.to,a.to)));continue}else{a.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,a.from),PS(t,i,r.copy(a.from,r.to)));break}}}return t}function PS(e,t,n){for(;t<e.length&&MS(n,e[t])>0;)t++;e.splice(t,0,n)}function FS(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=yw&&t.push(r)}),e.cursorWrapper&&t.push(vw.create(e.state.doc,[e.cursorWrapper.deco])),bw.from(t)}function IS(e){if(!Tw.has(e)&&(Tw.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=yC,Ew)return;console.warn(`ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.`),Ew=!0}}function LS(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return cC(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function RS(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return LS(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener(`beforeinput`,r,!0),document.execCommand(`indent`),e.dom.removeEventListener(`beforeinput`,r,!0),n?LS(e,n):null}function zS(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function BS(e,t){let{focusNode:n,focusOffset:r}=e.domSelectionRange();for(let i of t)if(i.parentNode?.nodeName==`TR`){let t=i.nextSibling;for(;t&&t.nodeName!=`TD`&&t.nodeName!=`TH`;)t=t.nextSibling;if(t){let a=t;for(;;){let e=a.firstChild;if(!e||e.nodeType!=1||e.contentEditable==`false`||/^(BR|IMG)$/.test(e.nodeName))break;a=e}a.insertBefore(i,a.firstChild),n==i&&e.domSelection().collapse(i,r)}else i.parentNode.removeChild(i)}}function VS(e,t,n){let{node:r,fromOffset:i,toOffset:a,from:o,to:s}=e.docView.parseRange(t,n),c=e.domSelectionRange(),l,u=c.anchorNode;if(u&&e.dom.contains(u.nodeType==1?u:u.parentNode)&&(l=[{node:u,offset:c.anchorOffset}],uC(c)||l.push({node:c.focusNode,offset:c.focusOffset})),xC&&e.input.lastKeyCode===8)for(let e=a;e>i;e--){let t=r.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){a=e;break}if(!n||n.size)break}let d=e.state.doc,f=e.someProp(`domParser`)||f_.fromSchema(e.state.schema),p=d.resolve(o),m=null,h=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:a,preserveWhitespace:p.parent.type.whitespace==`pre`?`full`:!0,findPositions:l,ruleFromNode:HS,context:p});if(l&&l[0].pos!=null){let e=l[0].pos,t=l[1]&&l[1].pos;t??=e,m={anchor:e+o,head:t+o}}return{doc:h,sel:m,from:o,to:s}}function HS(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName==`BR`&&e.parentNode){if(CC&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement(`div`);return e.appendChild(document.createElement(`li`)),{skip:e}}else if(e.parentNode.lastChild==e||CC&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName==`IMG`&&e.getAttribute(`mark-placeholder`))return{ignore:!0};return null}function US(e,t,n,r,i){let a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=tx(e,t);if(n&&!e.state.selection.eq(n)){if(xC&&DC&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,fb(13,`Enter`))))return;let r=e.state.tr.setSelection(n);t==`pointer`?r.setMeta(`pointer`,!0):t==`key`&&r.scrollIntoView(),a&&r.setMeta(`composition`,a),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let c=e.state.selection,l=VS(e,t,n),u=e.state.doc,d=u.slice(l.from,l.to),f,p;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,p=`end`):(f=e.state.selection.from,p=`start`),e.input.lastKeyCode=null;let m=JS(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(wC&&e.input.lastIOSEnter>Date.now()-225||DC)&&i.some(e=>e.nodeType==1&&!Dw.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,fb(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof B&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(l.sel){let t=WS(e,e.state.doc,l.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta(`composition`,a),e.dispatch(n)}}return}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof B&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),_C&&vC<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>l.from&&l.doc.textBetween(m.start-l.from-1,m.start-l.from+1)==` \xA0`&&(m.start--,m.endA--,m.endB--);let h=l.doc.resolveNoCache(m.start-l.from),g=l.doc.resolveNoCache(m.endB-l.from),_=u.resolve(m.start),v=h.sameParent(g)&&h.parent.inlineContent&&_.end()>=m.endA;if((wC&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&h.pos<l.doc.content.size&&(!h.sameParent(g)||!h.parent.inlineContent)&&h.pos<g.pos&&!/\S/.test(l.doc.textBetween(h.pos,g.pos,``,``)))&&e.someProp(`handleKeyDown`,t=>t(e,fb(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&KS(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,fb(8,`Backspace`)))){DC&&xC&&e.domObserver.suppressSelectionUpdates();return}xC&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),DC&&!v&&h.start()!=g.start()&&g.parentOffset==0&&h.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==m.endA&&(m.endB-=2,g=l.doc.resolveNoCache(m.endB-l.from),setTimeout(()=>{e.someProp(`handleKeyDown`,function(t){return t(e,fb(13,`Enter`))})},20));let y=m.start,b=m.endA,x=t=>{let n=t||e.state.tr.replace(y,b,l.doc.slice(m.start-l.from,m.endB-l.from));if(l.sel){let t=WS(e,n.doc,l.sel);t&&!(xC&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==y||t.head==n.mapping.map(b)-1)||_C&&t.empty&&t.head==y)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},S;if(v)if(h.pos==g.pos){_C&&vC<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>rx(e),20));let t=x(e.state.tr.delete(y,b)),n=u.resolve(m.start).marksAcross(u.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(S=GS(h.parent.content.cut(h.parentOffset,g.parentOffset),_.parent.content.cut(_.parentOffset,m.endA-_.start())))){let t=x(e.state.tr);S.type==`add`?t.addMark(y,b,S.mark):t.removeMark(y,b,S.mark),e.dispatch(t)}else if(h.parent.child(h.index()).isText&&h.index()==g.index()-+!g.textOffset){let t=h.parent.textBetween(h.parentOffset,g.parentOffset),n=()=>x(e.state.tr.insertText(t,y,b));e.someProp(`handleTextInput`,r=>r(e,y,b,t,n))||e.dispatch(n())}else e.dispatch(x());else e.dispatch(x())}function WS(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:dx(e,t.resolve(n.anchor),t.resolve(n.head))}function GS(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,a=r,o,s,c;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)a=n[e].removeFromSet(a);if(i.length==1&&a.length==0)s=i[0],o=`add`,c=e=>e.mark(s.addToSet(e.marks));else if(i.length==0&&a.length==1)s=a[0],o=`remove`,c=e=>e.mark(s.removeFromSet(e.marks));else return null;let l=[];for(let e=0;e<t.childCount;e++)l.push(c(t.child(e)));if(L.from(l).eq(e))return{mark:s,type:o}}function KS(e,t,n,r,i){if(n-t<=i.pos-r.pos||qS(r,!0,!1)<i.pos)return!1;let a=e.resolve(t);if(!r.parent.isTextblock){let e=a.nodeAfter;return e!=null&&n==t+e.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let o=e.resolve(qS(a,!0,!0));return!o.parent.isTextblock||o.pos>n||qS(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function qS(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function JS(e,t,n,r,i){let a=e.findDiffStart(t,n);if(a==null)return null;let{a:o,b:s}=e.findDiffEnd(t,n+e.size,n+t.size);if(i==`end`){let e=Math.max(0,a-Math.min(o,s));r-=o+e-a}if(o<a&&e.size<t.size){let e=r<=a&&r>=o?a-r:0;a-=e,a&&a<t.size&&YS(t.textBetween(a-1,a+1))&&(a+=e?1:-1),s=a+(s-o),o=a}else if(s<a){let t=r<=a&&r>=s?a-r:0;a-=t,a&&a<e.size&&YS(e.textBetween(a-1,a+1))&&(a+=t?1:-1),o=a+(o-s),s=a}return{start:a,endA:o,endB:s}}function YS(e){if(e.length!=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}function XS(e){let t=Object.create(null);return t.class=`ProseMirror`,t.contenteditable=String(e.editable),e.someProp(`attributes`,n=>{if(typeof n==`function`&&(n=n(e.state)),n)for(let e in n)e==`class`?t.class+=` `+n[e]:e==`style`?t.style=(t.style?t.style+`;`:``)+n[e]:!t[e]&&e!=`contenteditable`&&e!=`nodeName`&&(t[e]=String(n[e]))}),t.translate||=`no`,[hw.node(0,e.state.doc.content.size,t)]}function ZS(e){if(e.markCursor){let t=document.createElement(`img`);t.className=`ProseMirror-separator`,t.setAttribute(`mark-placeholder`,`true`),t.setAttribute(`alt`,``),e.cursorWrapper={dom:t,deco:hw.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function QS(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function $S(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function eC(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp(`nodeViews`,n),e.someProp(`markViews`,n),t}function tC(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r}function nC(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError(`Plugins passed directly to the view must not have a state component`)}var rC,iC,aC,oC,sC,cC,lC,uC,dC,fC,pC,mC,hC,gC,_C,vC,yC,bC,xC,SC,CC,wC,TC,EC,DC,OC,kC,AC,jC,MC,NC,PC,FC,IC,LC,RC,zC,BC,VC,HC,UC,WC,GC,KC,qC,JC,YC,XC,ZC,QC,$C,ew,tw,nw,rw,iw,aw,ow,sw,cw,lw,uw,dw,fw,pw,mw,hw,gw,_w,vw,yw,bw,xw,Sw,Cw,ww,Tw,Ew,Dw,Ow,kw=d((()=>{ly(),C_(),Lv(),rC=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},iC=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},aC=null,oC=function(e,t,n){let r=aC||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},sC=function(){aC=null},cC=function(e,t,n,r){return n&&(ob(e,t,n,r,-1)||ob(e,t,n,r,1))},lC=/^(img|br|input|textarea|hr)$/i,uC=function(e){return e.focusNode&&cC(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)},dC=typeof navigator<`u`?navigator:null,fC=typeof document<`u`?document:null,pC=dC&&dC.userAgent||``,mC=/Edge\/(\d+)/.exec(pC),hC=/MSIE \d/.exec(pC),gC=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(pC),_C=!!(hC||gC||mC),vC=hC?document.documentMode:gC?+gC[1]:mC?+mC[1]:0,yC=!_C&&/gecko\/(\d+)/i.test(pC),yC&&+(/Firefox\/(\d+)/.exec(pC)||[0,0])[1],bC=!_C&&/Chrome\/(\d+)/.exec(pC),xC=!!bC,SC=bC?+bC[1]:0,CC=!_C&&!!dC&&/Apple Computer/.test(dC.vendor),wC=CC&&(/Mobile\/\w+/.test(pC)||!!dC&&dC.maxTouchPoints>2),TC=wC||(dC?/Mac/.test(dC.platform):!1),EC=dC?/Win/.test(dC.platform):!1,DC=/Android \d/.test(pC),OC=!!fC&&`webkitFontSmoothing`in fC.documentElement.style,kC=OC?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,AC=null,jC=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,MC=/[\u0590-\u08ac]/,NC=null,PC=null,FC=!1,IC=0,LC=1,RC=2,zC=3,BC=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=IC,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}else{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}let r;if(e==this.dom&&this.contentDOM)r=t>rC(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),a;if(i&&(!t||i.node))if(n&&(a=i.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))n=!1;else return i}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],a=t+i.size;if(a>e||i instanceof KC){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof VC&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,!(!e||e.dom.parentNode==this.contentDOM);n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?rC(e.dom)+1:0}}else{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,!(!e||e.dom.parentNode==this.contentDOM);n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?rC(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let a=n,o=0;;o++){let n=this.children[o],s=a+n.size;if(r==-1&&e<=s){let i=a+n.border;if(e>=i&&t<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=a;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=rC(n.dom)+1;break}e-=n.size}r==-1&&(r=0)}if(r>-1&&(s>t||o==this.children.length-1)){t=s;for(let e=o+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=rC(n.dom);break}t+=n.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=s}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(t.nodeType!=1||n==t.childNodes.length)throw RangeError(`No node after pos `+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),a=Math.max(e,t);for(let o=0,s=0;o<this.children.length;o++){let c=this.children[o],l=s+c.size;if(i>s&&a<l)return c.setSelection(e-s-c.border,t-s-c.border,n,r);s=l}let o=this.domFromPos(e,e?-1:1),s=t==e?o:this.domFromPos(t,t?-1:1),c=n.root.getSelection(),l=n.domSelectionRange(),u=!1;if((yC||CC)&&e==t){let{node:e,offset:t}=o;if(e.nodeType==3){if(u=!!(t&&e.nodeValue[t-1]==`
23
- `),u&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){n.nodeName==`BR`&&(o=s={node:n.parentNode,offset:rC(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&(n.nodeName==`BR`||n.contentEditable==`false`)}}if(yC&&l.focusNode&&l.focusNode!=s.node&&l.focusNode.nodeType==1){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&CC)&&cC(o.node,o.offset,l.anchorNode,l.anchorOffset)&&cC(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(u&&yC)){c.collapse(o.node,o.offset);try{e!=t&&c.extend(s.node,s.offset),d=!0}catch{}}if(!d){if(e>t){let e=o;o=s,s=e}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&e.type!=`selection`}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],a=n+i.size;if(n==a?e<=a&&t>=n:e<a&&t>n){let r=n+i.border,o=a-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==a?RC:LC,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=zC:i.markDirty(e-r,t-r);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?RC:zC}n=a}this.dirty=RC}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?RC:LC;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},VC=class extends BC{constructor(e,t,n,r){let i,a=t.type.toDOM;if(typeof a==`function`&&(a=a(n,()=>{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){if(a.nodeType!=1){let e=document.createElement(`span`);e.appendChild(a),a=e}a.contentEditable=`false`,a.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==IC&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!=`selection`||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},HC=class extends BC{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e==this.textDOM?this.posAtStart+t:this.posAtStart+(t?this.size:0)}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type===`characterData`&&e.target.nodeValue==e.oldValue}},UC=class e extends BC{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(t,n,r,i){let a=i.nodeViews[n.type.name],o=a&&a(n,i,r);return(!o||!o.dom)&&(o=x_.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&zC||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=zC&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=IC){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=IC}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=ex(a,n,o,r)),t>0&&(a=ex(a,0,t,r));for(let e=0;e<a.length;e++)a[e].parent=i;return i.children=a,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},WC=class e extends BC{constructor(e,t,n,r,i,a,o,s,c){super(e,[],i,a),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create(t,n,r,i,a,o){let s=a.nodeViews[n.type.name],c,l=s&&s(n,a,()=>{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=l&&l.dom,d=l&&l.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=x_.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:u,contentDOM:d}=e)}!d&&!n.isText&&u.nodeName!=`BR`&&(u.hasAttribute(`contenteditable`)||(u.contentEditable=`false`),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=Kb(u,r,n),l?c=new qC(t,n,r,i,u,d||null,f,l,a,o+1):n.isText?new GC(t,n,r,i,u,f,a):new e(t,n,r,i,u,d||null,f,a,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==`pre`&&(e.preserveWhitespace=`full`),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>L.empty)}return e}matchesNode(e,t,n){return this.dirty==IC&&e.eq(this.node)&&qb(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,o=i&&i.pos<0,s=new XC(this,a&&a.node,e);Zb(this.node,this.innerDeco,(t,i,a)=>{t.spec.marks?s.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!a&&s.syncToMarks(i==this.node.childCount?Xg.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,c,l)=>{s.syncToMarks(t.marks,n,e,l);let u;s.findNodeMatch(t,a,c,l)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,a,c,u,e)||s.updateNextNode(t,a,c,e,l,r)||s.addNode(t,a,c,e,r),r+=t.nodeSize}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==RC)&&(a&&this.protectLocalComposition(e,a),Hb(this.contentDOM,this.children,e),wC&&Qb(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof B)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,a=$b(this.node.content,e,n-t,r-t);return a<0?null:{node:i,pos:a,text:e}}else return{node:i,pos:-1,text:``}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&=void 0}let a=new HC(this,i,t,r);e.input.compositionNodes.push(a),this.children=ex(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==zC||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=IC}updateOuterDeco(e){if(qb(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=Wb(this.dom,this.nodeDOM,Ub(this.outerDeco,this.node,t),Ub(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute(`draggable`))}get domAtom(){return this.node.isAtom}},GC=class e extends WC{constructor(e,t,n,r,i,a,o){super(e,t,n,r,i,null,a,o,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return this.dirty==zC||this.dirty!=IC&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=IC||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=IC,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!=`characterData`&&e.type!=`selection`}slice(t,n,r){let i=this.node.cut(t,n),a=document.createTextNode(i.text);return new e(this.parent,i,this.outerDeco,this.innerDeco,a,a,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=zC)}get domAtom(){return!1}isText(e){return this.node.text==e}},KC=class extends BC{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==IC&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},qC=class extends WC{constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,c,l),this.spec=s}update(e,t,n,r){if(this.dirty==zC)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}else if(!this.contentDOM&&!e.isLeaf)return!1;else return super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}},JC=function(e){e&&(this.nodeName=e)},JC.prototype=Object.create(null),YC=[new JC],XC=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Yb(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let i=0,a=this.stack.length>>1,o=Math.min(a,e.length);for(;i<o&&(i==a-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<a;)this.destroyRest(),this.top.dirty=IC,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<e.length;){this.stack.push(this.top,this.index+1);let i=-1,o=this.top.children.length;r<this.preMatch.index&&(o=Math.min(this.index+3,o));for(let t=this.index;t<o;t++){let n=this.top.children[t];if(n.matchesMark(e[a])&&!this.isLocked(n.dom)){i=t;break}}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=UC.create(this.top,e[a],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,a++}}findNodeMatch(e,t,n,r){let i=-1,a;if(r>=this.preMatch.index&&(a=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,n))i=this.top.children.indexOf(a,this.index);else for(let r=this.index,a=Math.min(this.top.children.length,r+5);r<a;r++){let a=this.top.children[r];if(a.matchesNode(e,t,n)&&!this.preMatch.matched.has(a)){i=r;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let a=this.top.children[r];return a.dirty==zC&&a.dom==a.contentDOM&&(a.dirty=RC),a.update(e,t,n,i)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return-1}e=t}}updateNextNode(e,t,n,r,i,a){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof WC){let c=this.preMatch.matched.get(s);if(c!=null&&c!=i)return!1;let l=s.dom,u,d=this.isLocked(l)&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=zC&&qb(t,s.outerDeco));if(!d&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(s,e,t,n,r,a)))return this.destroyBetween(this.index,o),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=RC,u.updateChildren(r,a+1),u.dirty=IC),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,a){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!qb(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=WC.create(this.top,t,n,r,i,a);if(o.contentDOM){o.children=e.children,e.children=[];for(let e of o.children)e.parent=o}return e.destroy(),o}addNode(e,t,n,r,i){let a=WC.create(this.top,e,t,n,r,i);a.contentDOM&&a.updateChildren(r,i+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new VC(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof UC;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof GC)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((CC||xC)&&e&&e.dom.contentEditable==`false`&&this.addHackNode(`IMG`,t),this.addHackNode(`BR`,this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e==`IMG`&&(n.className=`ProseMirror-separator`,n.alt=``),e==`BR`&&(n.className=`ProseMirror-trailingBreak`);let r=new KC(this.top,[],n,null);t==this.top?t.children.splice(this.index++,0,r):t.children.push(r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}},ZC=CC||xC&&SC<63,QC=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i,$C={thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]},ew=null,tw=null,nw={},rw={},iw={touchstart:!0,touchmove:!0},aw=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:``,button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}},rw.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!dS(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(DC&&xC&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),wC&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp(`handleKeyDown`,t=>t(e,fb(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||Nx(e,n)?n.preventDefault():Jx(e,`key`)},rw.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},rw.keypress=(e,t)=>{let n=t;if(dS(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||TC&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof B)||!r.$from.sameParent(r.$to)){let t=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp(`handleTextInput`,n=>n(e,r.$from.pos,r.$to.pos,t,i))&&e.dispatch(i()),n.preventDefault()}},ow=TC?`metaKey`:`ctrlKey`,nw.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=uS(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&tS(n,e.input.lastClick)&&!n[ow]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type==`singleClick`?a=`doubleClick`:e.input.lastClick.type==`doubleClick`&&(a=`tripleClick`)),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:a,button:n.button};let o=e.posAtCoords(eS(n));o&&(a==`singleClick`?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new sw(e,o,n,!!r)):(a==`doubleClick`?sS:cS)(e,o.pos,o.inside,n)?n.preventDefault():Jx(e,`pointer`))},sw=class{constructor(e,t,n,r){this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[ow],this.allowDefault=n.shiftKey;let i,a;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,a=n.depth?n.before():0}let o=r?null:n.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&s.nodeDOM.nodeType==1?s.nodeDOM:null;let{selection:c}=e.state;(n.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof V&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&yC&&!this.target.hasAttribute(`contentEditable`))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute(`contentEditable`,`false`)},20),this.view.domObserver.start()),e.root.addEventListener(`mouseup`,this.up=this.up.bind(this)),e.root.addEventListener(`mousemove`,this.move=this.move.bind(this)),Jx(e,`pointer`)}done(){this.view.root.removeEventListener(`mouseup`,this.up),this.view.root.removeEventListener(`mousemove`,this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute(`draggable`),this.mightDrag.setUneditable&&this.target.removeAttribute(`contentEditable`),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>rx(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(eS(e))),this.updateAllowDefault(e),this.allowDefault||!t?Jx(this.view,`pointer`):oS(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||CC&&this.mightDrag&&!this.mightDrag.node.isAtom||xC&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(rS(this.view,z.near(this.view.state.doc.resolve(t.pos)),`pointer`),e.preventDefault()):Jx(this.view,`pointer`)}move(e){this.updateAllowDefault(e),Jx(this.view,`pointer`),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}},nw.touchstart=e=>{e.input.lastTouch=Date.now(),uS(e),Jx(e,`pointer`)},nw.touchmove=e=>{e.input.lastTouch=Date.now(),Jx(e,`pointer`)},nw.contextmenu=e=>uS(e),cw=DC?5e3:-1,rw.compositionstart=rw.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof B&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||xC&&EC&&fS(e)))e.markCursor=e.state.storedMarks||n.marks(),_S(e,!0),e.markCursor=null;else if(_S(e,!t.selection.empty),yC&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&n.nodeType==1&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(t.nodeType==3){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}else n=t,r=-1}}e.input.composing=!0}pS(e,cw)},rw.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,pS(e,20))},lw=_C&&vC<15||wC&&kC<604,nw.copy=rw.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=lw?null:n.clipboardData,{dom:o,text:s}=Px(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):vS(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))},rw.paste=(e,t)=>{let n=t;if(e.composing&&!DC)return;let r=lw?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&xS(e,SS(r),r.getData(`text/html`),i,n)?n.preventDefault():bS(e,n)},uw=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},dw=TC?`altKey`:`ctrlKey`,nw.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,a=i.empty?null:e.posAtCoords(eS(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof V?i.to-1:i.to))){if(r&&r.mightDrag)o=V.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=V.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=Px(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!xC||SC>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(lw?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,lw||n.dataTransfer.setData(`text/plain`,c),e.dragging=new uw(l,CS(e,n),o)},nw.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},rw.dragover=rw.dragenter=(e,t)=>t.preventDefault(),rw.drop=(e,t)=>{try{wS(e,t,e.dragging)}finally{e.dragging=null}},nw.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add(`ProseMirror-focused`),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&rx(e)},20))},nw.blur=(e,t)=>{let n=t;e.focused&&=(e.domObserver.stop(),e.dom.classList.remove(`ProseMirror-focused`),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),!1)},nw.beforeinput=(e,t)=>{if(xC&&DC&&t.inputType==`deleteContentBackward`){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp(`handleKeyDown`,t=>t(e,fb(8,`Backspace`)))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let e in rw)nw[e]=rw[e];fw=class e{constructor(e,t){this.toDOM=e,this.spec=t||_w,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:a}=e.mapResult(t.from+r,this.side<0?-1:1);return a?null:new hw(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&TS(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},pw=class e{constructor(e,t){this.attrs=e,this.spec=t||_w}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,a=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=a?null:new hw(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&TS(this.attrs,t.attrs)&&TS(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},mw=class e{constructor(e,t){this.attrs=e,this.spec=t||_w}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let a=e.mapResult(t.to+r,-1);return a.deleted||a.pos<=i.pos?null:new hw(i.pos-n,a.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(t){return this==t||t instanceof e&&TS(this.attrs,t.attrs)&&TS(this.spec,t.spec)}destroy(){}},hw=class e{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(t,n){return new e(t,n,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(t,n,r){return new e(t,t,new fw(n,r))}static inline(t,n,r,i){return new e(t,n,new pw(r,i))}static node(t,n,r,i){return new e(t,n,new mw(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof pw}get widget(){return this.type instanceof fw}},gw=[],_w={},vw=class e{constructor(e,t){this.local=e.length?e:gw,this.children=t.length?t:gw}static create(e,t){return t.length?jS(t,e,0,_w):yw}find(e,t,n){let r=[];return this.findInner(e??0,t??1e9,r,0,n),r}findInner(e,t,n,r,i){for(let a=0;a<this.local.length;a++){let o=this.local[a];o.from<=t&&o.to>=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let o=this.children[a]+1;this.children[a+2].findInner(e-o,t-o,n,r+o,i)}}map(e,t,n){return this==yw||e.maps.length==0?this:this.mapInner(e,t,0,0,n||_w)}mapInner(t,n,r,i,a){let o;for(let e=0;e<this.local.length;e++){let s=this.local[e].map(t,r,i);s&&s.type.valid(n,s)?(o||=[]).push(s):a.onRemove&&a.onRemove(this.local[e].spec)}return this.children.length?ES(this.children,o||[],t,n,r,i,a):o?new e(o.sort(MS),gw):yw}add(t,n){return n.length?this==yw?e.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,a=0;t.forEach((e,t)=>{let o=t+r,s;if(s=kS(n,e,o)){for(i||=this.children.slice();a<i.length&&i[a]<t;)a+=3;i[a]==t?i[a+2]=i[a+2].addInner(e,s,o+1):i.splice(a,0,t,t+e.nodeSize,jS(s,e,o+1,_w)),a+=3}});let o=DS(a?AS(n):n,-r);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||o.splice(e--,1);return new e(o.length?this.local.concat(o).sort(MS):this.local,i||this.children)}remove(e){return e.length==0||this==yw?this:this.removeInner(e,0)}removeInner(t,n){let r=this.children,i=this.local;for(let e=0;e<r.length;e+=3){let i,a=r[e]+n,o=r[e+1]+n;for(let e=0,n;e<t.length;e++)(n=t[e])&&n.from>a&&n.to<o&&(t[e]=null,(i||=[]).push(n));if(!i)continue;r==this.children&&(r=this.children.slice());let s=r[e+2].removeInner(i,a+1);s==yw?(r.splice(e,3),e-=3):r[e+2]=s}if(i.length){for(let e=0,r;e<t.length;e++)if(r=t[e])for(let e=0;e<i.length;e++)i[e].eq(r,n)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new e(i,r):yw}forChild(t,n){if(this==yw)return this;if(n.isLeaf)return e.empty;let r,i;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(r=this.children[e+2]);break}let a=t+1,o=a+n.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>a&&t.type instanceof pw){let e=Math.max(a,t.from)-a,n=Math.min(o,t.to)-a;e<n&&(i||=[]).push(t.copy(e,n))}}if(i){let t=new e(i.sort(MS),gw);return r?new bw([t,r]):t}return r||yw}eq(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(e){return NS(this.localsInner(e))}localsInner(e){if(this==yw)return gw;if(e.inlineContent||!this.local.some(pw.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof pw||t.push(this.local[e]);return t}forEachSet(e){e(this)}},vw.empty=new vw([],[]),vw.removeOverlap=NS,yw=vw.empty,bw=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,_w));return e.from(r)}forChild(t,n){if(n.isLeaf)return vw.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=yw&&(a instanceof e?r=r.concat(a.members):r.push(a))}return e.from(r)}eq(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(!t)t=i;else{n&&=(t=t.slice(),!1);for(let e=0;e<i.length;e++)t.push(i[e])}}return t?NS(n?t:t.sort(MS)):gw}static from(t){switch(t.length){case 0:return yw;case 1:return t[0];default:return new e(t.every(e=>e instanceof vw)?t:t.reduce((e,t)=>e.concat(t instanceof vw?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}},xw={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Sw=_C&&vC<=11,Cw=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},ww=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Cw,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);_C&&vC<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():CC&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),Sw&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,xw)),this.onCharData&&this.view.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener(`selectionchange`,this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener(`selectionchange`,this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(fx(this.view)){if(this.suppressingSelectionUpdates)return rx(this.view);if(_C&&vC<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&cC(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=iC(n))t.add(n);for(let r=e.anchorNode;r;r=iC(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&fx(e)&&!this.ignoreSelectionChange(n),i=-1,a=-1,o=!1,s=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],s);n&&(i=i<0?n.from:Math.min(n.from,i),a=a<0?n.to:Math.max(n.to,a),n.typeOver&&(o=!0))}if(s.some(e=>e.nodeName==`BR`)&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let e of s)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;for(;t&&t.nodeType==1;){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(yC&&s.length){let t=s.filter(e=>e.nodeName==`BR`);if(t.length==2){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;t&&t.nodeName==`LI`&&(!n||zS(e,n)!=t)&&r.remove()}}}let c=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&uC(n)&&(c=tx(e))&&c.eq(z.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,rx(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),IS(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,BS(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||rx(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type==`attributes`&&(n==this.view.docView||e.attributeName==`contenteditable`||e.attributeName==`style`&&!e.oldValue&&!e.target.getAttribute(`style`))||!n||n.ignoreMutation(e))return null;if(e.type==`childList`){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),r.nodeType==3&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(_C&&vC<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:a}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!a||Array.prototype.indexOf.call(e.addedNodes,a)<0)&&(i=a)}let a=r&&r.parentNode==e.target?rC(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?rC(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,s,1)}}else if(e.type==`attributes`)return{from:n.posAtStart-n.border,to:n.posAtEnd+n.border};else return this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}},Tw=new WeakMap,Ew=!1,Dw=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i,Ow=class{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new aw,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(nC),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement(`div`),e&&(e.appendChild?e.appendChild(this.dom):typeof e==`function`?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=QS(this),ZS(this),this.nodeViews=eC(this),this.docView=Vb(this.state.doc,XS(this),FS(this),this.dom,this),this.domObserver=new ww(this,(e,t,n,r)=>US(this,e,t,n,r)),this.domObserver.start(),qx(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Xx(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(nC),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(mS(this),i=!0),this.state=e;let a=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=eC(this);tC(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&Xx(this),this.editable=QS(this),ZS(this);let o=FS(this),s=XS(this),c=n.plugins!=e.plugins&&!n.doc.eq(e.doc)?`reset`:e.scrollToSelection>n.scrollToSelection?`to selection`:`preserve`,l=r||!this.docView.matchesNode(e.doc,s,o);(l||!e.selection.eq(n.selection))&&(i=!0);let u=c==`preserve`&&i&&this.dom.style.overflowAnchor==null&&yb(this);if(i){this.domObserver.stop();let t=l&&(_C||xC)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&$S(n.selection,e.selection);if(l){let n=xC?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=hS(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=Vb(e.doc,s,o,this.dom,this)),n&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&mx(this))?rx(this,t):(lx(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),this.dragging?.node&&!n.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,n),c==`reset`?this.dom.scrollTop=0:c==`to selection`?this.scrollToSelection():u&&xb(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))&&!this.someProp(`handleScrollToSelection`,e=>e(this)))if(this.state.selection instanceof V){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&vb(this,t.getBoundingClientRect(),e)}else vb(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new uw(e.slice,e.move,r<0?void 0:V.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(n!=null&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(i!=null&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let a=i[n].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if(_C){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable==`false`)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Cb(this.dom),rx(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return jb(this,e)}coordsAtPos(e,t=1){return Pb(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(r==null)throw RangeError(`DOM position not inside the editor`);return r}endOfTextblock(e,t){return Bb(this,t||this.state,e)}pasteHTML(e,t){return xS(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return xS(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return Px(this,e)}destroy(){this.docView&&(Yx(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],FS(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,sC())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return $x(this,e)}domSelectionRange(){let e=this.domSelection();return e?CC&&this.root.nodeType===11&&pb(this.dom.ownerDocument)==this.dom&&RS(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}},Ow.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}})),Aw=d((()=>{kw()}));function jw(e){var t=!(Pw&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Fw&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?Nw:Mw)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var Mw,Nw,Pw,Fw,Iw,Lw=d((()=>{for(Mw={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},Nw={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},Pw=typeof navigator<`u`&&/Mac/.test(navigator.platform),Fw=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Iw=0;Iw<10;Iw++)Mw[48+Iw]=Mw[96+Iw]=String(Iw);for(Iw=1;Iw<=24;Iw++)Mw[Iw+111]=`F`+Iw;for(Iw=65;Iw<=90;Iw++)Mw[Iw]=String.fromCharCode(Iw+32),Nw[Iw]=String.fromCharCode(Iw);for(var e in Mw)Nw.hasOwnProperty(e)||(Nw[e]=Mw[e])}));function Rw(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e++){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))Uw?o=!0:i=!0;else throw Error(`Unrecognized modifier name: `+n)}return r&&(n=`Alt-`+n),i&&(n=`Ctrl-`+n),o&&(n=`Meta-`+n),a&&(n=`Shift-`+n),n}function zw(e){let t=Object.create(null);for(let n in e)t[Rw(n)]=e[n];return t}function Bw(e,t,n=!0){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n&&t.shiftKey&&(e=`Shift-`+e),e}function Vw(e){return new oy({props:{handleKeyDown:Hw(e)}})}function Hw(e){let t=zw(e);return function(e,n){let r=jw(n),i,a=t[Bw(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[Bw(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(Ww&&n.ctrlKey&&n.altKey)&&(i=Mw[n.keyCode])&&i!=r){let r=t[Bw(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var Uw,Ww,Gw=d((()=>{Lw(),ly(),Uw=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Ww=typeof navigator<`u`&&/Win/.test(navigator.platform)})),Kw=d((()=>{Gw()}));function qw(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:a}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,a=n.storedMarks,n}}}function Jw(e,t){if(typeof e==`string`){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function Yw(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function Xw(e,t,n={strict:!0}){let r=Object.keys(t);return r.length?r.every(r=>n.strict?t[r]===e[r]:Yw(t[r])?t[r].test(e[r]):t[r]===e[r]):!0}function Zw(e,t,n={}){return e.find(e=>e.type===t&&Xw(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function Qw(e,t,n={}){return!!Zw(e,t,n)}function $w(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(e=>e.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t))return;if(!n){let e=r.node.marks.find(e=>e.type===t);e&&(n=e.attrs)}if(!Zw([...r.node.marks],t,n))return;let i=r.index,a=e.start()+r.offset,o=i+1,s=a+r.node.nodeSize;for(;i>0&&Qw([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&Qw([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}function eT(e,t){if(typeof e==`string`){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}function tT(e){return e instanceof B}function nT(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function rT(e,t=null){if(!t)return null;let n=z.atStart(e),r=z.atEnd(e);if(t===`start`||t===!0)return n;if(t===`end`)return r;let i=n.from,a=r.to;return t===`all`?B.create(e,nT(0,i,a),nT(e.content.size,i,a)):B.create(e,nT(t,i,a),nT(t,i,a))}function iT(){return navigator.platform===`Android`||/android/i.test(navigator.userAgent)}function aT(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}function oT(){return typeof navigator<`u`?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}function sT(e){if(typeof window>`u`)throw Error(`[tiptap error]: there is no window object available, so this function cannot be used`);let t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,`text/html`).body;return yD(n)}function cT(e,t,n){if(e instanceof i_||e instanceof L)return e;n={slice:!0,parseOptions:{},...n};let r=typeof e==`object`&&!!e,i=typeof e==`string`;if(r)try{if(Array.isArray(e)&&e.length>0)return L.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error(`[tiptap error]: Invalid JSON content`,{cause:r});return console.warn(`[tiptap warn]: Invalid content.`,`Passed value:`,e,`Error:`,r),cT(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new d_({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:`inline*`,group:`block`,parseDOM:[{tag:`*`,getAttrs:e=>(r=!0,i=typeof e==`string`?e:e.outerHTML,null)}]}})});if(n.slice?f_.fromSchema(a).parseSlice(sT(e),n.parseOptions):f_.fromSchema(a).parse(sT(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=f_.fromSchema(t);return n.slice?r.parseSlice(sT(e),n.parseOptions).content:r.parse(sT(e),n.parseOptions)}return cT(``,t,n)}function lT(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Av||i instanceof jv))return;let a=e.mapping.maps[r],o=0;a.forEach((e,t,n,r)=>{o===0&&(o=r)}),e.setSelection(z.near(e.doc.resolve(o),n))}function uT(){return typeof navigator<`u`?/Mac/.test(navigator.platform):!1}function dT(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n===`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e+=1){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))aT()||uT()?o=!0:i=!0;else throw Error(`Unrecognized modifier name: ${n}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}function fT(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?Jw(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize);s.push({node:e,from:n,to:a})});let c=i-r,l=s.filter(e=>o?o.name===e.node.type.name:!0).filter(e=>Xw(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}function pT(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function mT(e,t){let n=typeof t==`string`?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}function hT(e,t,n={},r={}){return cT(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}function gT(e,t){let n=eT(t,e.schema),{from:r,to:i,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{o.push(...e.marks)});let s=o.find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}function _T(e,t){let n=new Iv(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function vT(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function yT(e,t){let n=[];return e.descendants((e,r)=>{t(e)&&n.push({node:e,pos:r})}),n}function bT(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function xT(e,t){for(let n=e.depth;n>0;--n){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function ST(e){return t=>xT(t.$from,e)}function H(e,t,n){return e.config[t]===void 0&&e.parent?H(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?H(e.parent,t,n):null}):e.config[t]}function CT(e){return e.map(e=>{let t=H(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...CT(t())]:e}).flat(10)}function wT(e,t){let n=x_.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function TT(e){return typeof e==`function`}function U(e,t=void 0,...n){return TT(e)?t?e.bind(t)(...n):e(...n):e}function ET(e={}){return Object.keys(e).length===0&&e.constructor===Object}function DT(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function OT(e){let t=[],{nodeExtensions:n,markExtensions:r}=DT(e),i=[...n,...r],a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(e=>e.name!==`text`).map(e=>e.name),s=r.map(e=>e.name),c=[...o,...s];return e.forEach(e=>{let n=H(e,`addGlobalAttributes`,{name:e.name,options:e.options,storage:e.storage,extensions:i});n&&n().forEach(e=>{let n;n=Array.isArray(e.types)?e.types:e.types===`*`?c:e.types===`nodes`?o:e.types===`marks`?s:[],n.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...a,...r}})})})})}),i.forEach(e=>{let n=H(e,`addAttributes`,{name:e.name,options:e.options,storage:e.storage});if(!n)return;let r=n();Object.entries(r).forEach(([n,r])=>{let i={...a,...r};typeof i?.default==`function`&&(i.default=i.default()),i?.isRequired&&i?.default===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function kT(e){let t=[],n=``,r=!1,i=!1,a=0,o=e.length;for(let s=0;s<o;s+=1){let o=e[s];if(o===`'`&&!i){r=!r,n+=o;continue}if(o===`"`&&!r){i=!i,n+=o;continue}if(!r&&!i){if(o===`(`){a+=1,n+=o;continue}if(o===`)`&&a>0){--a,n+=o;continue}if(o===`;`&&a===0){t.push(n),n=``;continue}}n+=o}return n&&t.push(n),t}function AT(e){let t=[],n=kT(e||``),r=n.length;for(let e=0;e<r;e+=1){let r=n[e],i=r.indexOf(`:`);if(i===-1)continue;let a=r.slice(0,i).trim(),o=r.slice(i+1).trim();a&&o&&t.push([a,o])}return t}function jT(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(!n[e]){n[e]=t;return}if(e===`class`){let r=t?String(t).split(` `):[],i=n[e]?n[e].split(` `):[],a=r.filter(e=>!i.includes(e));n[e]=[...i,...a].join(` `)}else if(e===`style`){let r=new Map([...AT(n[e]),...AT(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function MT(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>jT(e,t),{})}function NT(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`?!0:e===`false`?!1:e:e}function PT(e,t){return`style`in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;let i=t.reduce((e,t)=>{let r=t.attribute.parseHTML?t.attribute.parseHTML(n):NT(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function FT(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&ET(t)?!1:t!=null))}function IT(e){let t={};return!e?.attribute?.isRequired&&`default`in(e?.attribute||{})&&(t.default=e.attribute.default),e?.attribute?.validate!==void 0&&(t.validate=e.attribute.validate),[e.name,t]}function LT(e,t){let n=OT(e),{nodeExtensions:r,markExtensions:i}=DT(e);return new d_({topNode:r.find(e=>H(e,`topNode`))?.name,nodes:Object.fromEntries(r.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=FT({...e.reduce((e,t)=>{let n=H(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:U(H(r,`content`,a)),marks:U(H(r,`marks`,a)),group:U(H(r,`group`,a)),inline:U(H(r,`inline`,a)),atom:U(H(r,`atom`,a)),selectable:U(H(r,`selectable`,a)),draggable:U(H(r,`draggable`,a)),code:U(H(r,`code`,a)),whitespace:U(H(r,`whitespace`,a)),linebreakReplacement:U(H(r,`linebreakReplacement`,a)),defining:U(H(r,`defining`,a)),isolating:U(H(r,`isolating`,a)),attrs:Object.fromEntries(i.map(IT))}),s=U(H(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>PT(e,i)));let c=H(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:MT(e,i)}));let l=H(r,`renderText`,a);return l&&(o.toText=l),[r.name,o]})),marks:Object.fromEntries(i.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=FT({...e.reduce((e,t)=>{let n=H(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:U(H(r,`inclusive`,a)),excludes:U(H(r,`excludes`,a)),group:U(H(r,`group`,a)),spanning:U(H(r,`spanning`,a)),code:U(H(r,`code`,a)),attrs:Object.fromEntries(i.map(IT))}),s=U(H(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>PT(e,i)));let c=H(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:MT(e,i)})),[r.name,o]}))})}function RT(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function zT(e){return e.sort((e,t)=>{let n=H(e,`priority`)||100,r=H(t,`priority`)||100;return n>r?-1:+(n<r)})}function BT(e){let t=zT(CT(e)),n=RT(t.map(e=>e.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(`, `)}]. This can lead to issues.`),t}function VT(e,t){return LT(BT(e),t)}function HT(e,t){let n=VT(t);return wT(i_.fromJSON(n,e).content,n)}function UT(e,t){let n=VT(t),r=sT(e);return f_.fromSchema(n).parse(r).toJSON()}function WT(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=`
24
-
25
- `,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a);let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1;e.isText&&(s+=(e?.text)?.slice(Math.max(r,n)-n,i-n))}),s}function GT(e,t){return WT(e,{from:0,to:e.content.size},t)}function KT(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function qT(e,t,n){let{blockSeparator:r=`
26
-
27
- `,textSerializers:i={}}=n||{},a=VT(t);return GT(i_.fromJSON(a,e),{blockSeparator:r,textSerializers:{...KT(a),...i}})}function JT(e,t){let n=Jw(t,e.schema),{from:r,to:i}=e.selection,a=[];e.doc.nodesBetween(r,i,e=>{a.push(e)});let o=a.reverse().find(e=>e.type.name===n.name);return o?{...o.attrs}:{}}function YT(e,t){let n=pT(typeof t==`string`?t:t.name,e.schema);return n===`node`?JT(e,t):n===`mark`?gT(e,t):{}}function XT(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function ZT(e){let t=XT(e);return t.length===1?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function QT(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,i)=>{let a=[];if(e.ranges.length)e.forEach((e,t)=>{a.push({from:e,to:t})});else{let{from:e,to:t}=n[i];if(e===void 0||t===void 0)return;a.push({from:e,to:t})}a.forEach(({from:e,to:n})=>{let a=t.slice(i).map(e,-1),o=t.slice(i).map(n),s=t.invert().map(a,-1),c=t.invert().map(o);r.push({oldRange:{from:s,to:c},newRange:{from:a,to:o}})})}),ZT(r)}function $T(e,t=0){let n=e.type===e.type.schema.topNodeType?0:1,r=t,i=r+e.nodeSize,a=e.marks.map(e=>{let t={type:e.type.name};return Object.keys(e.attrs).length&&(t.attrs={...e.attrs}),t}),o={...e.attrs},s={type:e.type.name,from:r,to:i};return Object.keys(o).length&&(s.attrs=o),a.length&&(s.marks=a),e.content.childCount&&(s.content=[],e.forEach((e,r)=>{var i;(i=s.content)==null||i.push($T(e,t+r+n))})),e.text&&(s.text=e.text),s}function eE(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=$w(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{!e||e?.nodeSize===void 0||r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}function tE(e,t){return t.nodes[e]||t.marks[e]||null}function nE(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return r?r.attribute.keepOnSplit:!1}))}function rE(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?eT(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>a?a.name===e.type.name:!0).find(e=>Xw(e.attrs,n,{strict:!1}));let o=0,s=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(a&&e.inlineContent&&!e.type.allowsMarkType(a))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),c=Math.min(i,t+e.nodeSize),l=c-n;o+=l,s.push(...e.marks.map(e=>({mark:e,from:n,to:c})))})}),o===0)return!1;let c=s.filter(e=>a?a.name===e.mark.type.name:!0).filter(e=>Xw(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=s.filter(e=>a?e.mark.type!==a&&e.mark.type.excludes(a):!0).reduce((e,t)=>e+t.to-t.from,0);return(c>0?c+l:c)>=o}function iE(e,t,n={}){if(!t)return fT(e,null,n)||rE(e,null,n);let r=pT(t,e.schema);return r===`node`?fT(e,t,n):r===`mark`?rE(e,t,n):!1}function aE(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function oE(e,t){let{nodeExtensions:n}=DT(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=U(H(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`?i.split(` `).includes(`list`):!1}function sE(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name===`hardBreak`)return!0;if(e.isText)return!/\S/.test(e.text??``)}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(e=>{r!==!1&&(sE(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function cE(e){return e instanceof V}function lE(e,t){let n=t.mapping.mapResult(e.position);return{position:new JD(n.pos),mapResult:n}}function uE(e){return new JD(e)}function dE(e,t,n){let r=e.state.doc.content.size,i=nT(t,0,r),a=nT(n,0,r),o=e.coordsAtPos(i),s=e.coordsAtPos(a,-1),c=Math.min(o.top,s.top),l=Math.max(o.bottom,s.bottom),u=Math.min(o.left,s.left),d=Math.max(o.right,s.right),f={top:c,bottom:l,left:u,right:d,width:d-u,height:l-c,x:u,y:c};return{...f,toJSON:()=>f}}function fE({json:e,validMarks:t,validNodes:n,options:r,rewrittenContent:i=[]}){return e.marks&&Array.isArray(e.marks)&&(e.marks=e.marks.filter(e=>{let n=typeof e==`string`?e:e.type;return t.has(n)?!0:(i.push({original:JSON.parse(JSON.stringify(e)),unsupported:n}),!1)})),e.content&&Array.isArray(e.content)&&(e.content=e.content.map(e=>fE({json:e,validMarks:t,validNodes:n,options:r,rewrittenContent:i}).json).filter(e=>e!=null)),e.type&&!n.has(e.type)?(i.push({original:JSON.parse(JSON.stringify(e)),unsupported:e.type}),e.content&&Array.isArray(e.content)&&r?.fallbackToParagraph!==!1?(e.type=`paragraph`,{json:e,rewrittenContent:i}):{json:null,rewrittenContent:i}):{json:e,rewrittenContent:i}}function pE(e,t,n){return fE({json:e,validNodes:new Set(Object.keys(t.nodes)),validMarks:new Set(Object.keys(t.marks)),options:n})}function mE(e,t,n){let{selection:r}=t,i=null;if(tT(r)&&(i=r.$cursor),i){let t=e.storedMarks??i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:a}=r;return a.some(({$from:t,$to:r})=>{let i=t.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),a=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&a}return!i}),i})}function hE(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>t?.includes(e.type.name));e.tr.ensureMarks(r)}}function gE(e){let{editor:t,from:n,to:r,text:i,rules:a,plugin:o}=e,{view:s}=t;if(s.composing)return!1;let c=s.state.doc.resolve(n);if(c.parent.type.spec.code||(c.nodeBefore||c.nodeAfter)?.marks.find(e=>e.type.spec.code))return!1;let l=!1,u=GD(c)+i;return a.forEach(e=>{if(l)return;let a=yO(u,e.find);if(!a)return;let c=s.state.tr,d=qw({state:s.state,transaction:c}),f={from:n-(a[0].length-i.length),to:r},{commands:p,chain:m,can:h}=new eD({editor:t,state:d});e.handler({state:d,range:f,match:a,commands:p,chain:m,can:h})===null||!c.steps.length||(e.undoable&&c.setMeta(o,{transform:c,from:n,to:r,text:i}),s.dispatch(c),l=!0)}),l}function _E(e){let{editor:t,rules:n}=e,r=new oy({state:{init(){return null},apply(e,i,a){let o=e.getMeta(r);if(o)return o;let s=e.getMeta(`applyInputRules`);return s&&setTimeout(()=>{let{text:e}=s;e=typeof e==`string`?e:wT(L.from(e),a.schema);let{from:i}=s;gE({editor:t,from:i,to:i+e.length,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput(e,i,a,o){return gE({editor:t,from:i,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&gE({editor:t,from:i.pos,to:i.pos,text:``,rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if(i.key!==`Enter`)return!1;let{$cursor:a}=e.state.selection;return a?gE({editor:t,from:a.pos,to:a.pos,text:`
28
- `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function vE(e){return Object.prototype.toString.call(e).slice(8,-1)}function yE(e){return vE(e)===`Object`?e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype:!1}function bE(e,t){let n={...e};return yE(e)&&yE(t)&&Object.keys(t).forEach(r=>{yE(t[r])&&yE(e[r])?n[r]=bE(e[r],t[r]):n[r]=t[r]}),n}function xE(e){return typeof e==`number`}function SE(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new eD({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{if(e.type?.spec?.code||!(e.isText||e.isTextblock||e.isInline))return;let f=e.content?.size??e.nodeSize??0,p=Math.max(r,t),m=Math.min(i,t+f);p>=m||CO(e.isText?e.text||``:e.textBetween(p-t,m-t,void 0,``),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=p+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},f=a.handler({state:n,range:i,match:e,commands:c,chain:l,can:u,pasteEvent:o,dropEvent:s});d.push(f)})}),d.every(e=>e!==null)}function CE(e){let{editor:t,rules:n}=e,r=null,i=!1,a=!1,o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,s;try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}let c=({state:e,from:n,to:r,rule:i,pasteEvt:a})=>{let c=e.tr;if(!(!SE({editor:t,state:qw({state:e,transaction:c}),from:Math.max(n-1,0),to:r.b-1,rule:i,pasteEvent:a,dropEvent:s})||!c.steps.length)){try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}return o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,c}};return n.map(e=>new oy({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(wO=t)},i=()=>{wO&&=null};return window.addEventListener(`dragstart`,n),window.addEventListener(`dragend`,i),{destroy(){window.removeEventListener(`dragstart`,n),window.removeEventListener(`dragend`,i)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(a=r===e.dom.parentElement,s=t,!a){let e=wO;e?.isEditable&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{let n=t.clipboardData?.getData(`text/html`);return o=t,i=!!n?.includes(`data-pm-slice`),!1}}},appendTransaction:(t,n,r)=>{let s=t[0],l=s.getMeta(`uiEvent`)===`paste`&&!i,u=s.getMeta(`uiEvent`)===`drop`&&!a,d=s.getMeta(`applyPasteRules`),f=!!d;if(!l&&!u&&!f)return;if(f){let{text:t}=d;t=typeof t==`string`?t:wT(L.from(t),r.schema);let{from:n}=d,i=n+t.length,a=TO(t);return c({rule:e,state:r,from:n,to:{b:i},pasteEvt:a})}let p=n.doc.content.findDiffStart(r.doc.content),m=n.doc.content.findDiffEnd(r.doc.content);if(!(!xE(p)||!m||p===m.b))return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}function wE(e,t,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:``}]`);if(r!==null)return r;let i=document.createElement(`style`);return t&&i.setAttribute(`nonce`,t),i.setAttribute(`data-tiptap-style${n?`-${n}`:``}`,``),i.innerHTML=e,document.getElementsByTagName(`head`)[0].appendChild(i),i}function TE(e){return new vO({find:e.find,handler:({state:t,range:n,match:r})=>{let i=U(e.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:a}=t,o=r[r.length-1],s=r[0];if(o){let r=s.search(/\S/),c=n.from+s.indexOf(o),l=c+o.length;if(eE(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>c).length)return null;l<n.to&&a.delete(l,n.to),c>n.from&&a.delete(n.from+r,c);let u=n.from+r+o.length;a.addMark(n.from+r,u,e.type.create(i||{})),a.removeStoredMark(e.type)}},undoable:e.undoable})}function EE(e){return new vO({find:e.find,handler:({state:t,range:n,match:r})=>{let i=U(e.getAttributes,void 0,r)||{},{tr:a}=t,o=n.from,s=n.to,c=e.type.create(i);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);e>s?e=s:s=e+r[1].length;let t=r[0][r[0].length-1];a.insertText(t,o+r[0].length-1),a.replaceWith(e,s,c)}else if(r[0]){let t=e.type.isInline?o:o-1;a.insert(t,e.type.create(i)).delete(a.mapping.map(o),a.mapping.map(s))}a.scrollIntoView()},undoable:e.undoable})}function DE(e){return new vO({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=U(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,a)},undoable:e.undoable})}function OE(e){return new vO({find:e.find,handler:({state:t,range:n,match:r})=>{let i=e.replace,a=n.from,o=n.to;if(r[1]){let e=r[0].lastIndexOf(r[1]);i+=r[0].slice(e+r[1].length),a+=e;let t=a-o;t>0&&(i=r[0].slice(e-t,e)+i,a=o)}t.tr.insertText(i,a,o)},undoable:e.undoable})}function kE(e){return new vO({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=U(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&F_(s,e.type,a);if(!c)return null;if(o.wrap(s,c),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,a=r||n.$to.parentOffset&&n.$from.marks();if(a){let e=a.filter(e=>i.includes(e.type.name));o.ensureMarks(e)}}if(e.keepAttributes){let t=e.type.name===`bulletList`||e.type.name===`orderedList`?`listItem`:`taskList`;i().updateAttributes(t,a).run()}let l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&q_(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)},undoable:e.undoable})}function AE(e){return e.children}function jE(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof V){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;--i}return!1}function ME(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)}function NE(e){return e.replace(/&lt;/g,`<`).replace(/&gt;/g,`>`).replace(/&quot;/g,`"`).replace(/&amp;/g,`&`)}function PE(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function FE(){return typeof navigator<`u`?/Firefox/.test(navigator.userAgent):!1}function IE(e){return typeof e==`string`}function LE(e){if(!e?.trim())return{};let t={},n=[],r=e.replace(/["']([^"']*)["']/g,e=>(n.push(e),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);i&&(t.class=i.map(e=>e.trim().slice(1)).join(` `));let a=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);a&&(t.id=a[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,e,r])=>{let i=n[parseInt(r.match(/__QUOTED_(\d+)__/)?.[1]||`0`,10)];i&&(t[e]=i.slice(1,-1))});let o=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,``).replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,``).replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,``).trim();return o&&o.split(/\s+/).filter(Boolean).forEach(e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}),t}function RE(e){if(!e||Object.keys(e).length===0)return``;let t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(e=>t.push(`.${e}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([e,n])=>{e===`class`||e===`id`||(n===!0?t.push(e):n!==!1&&n!=null&&t.push(`${e}="${String(n)}"`))}),t.join(` `)}function zE(e){let{nodeName:t,name:n,parseAttributes:r=LE,serializeAttributes:i=RE,defaultAttributes:a={},requiredAttributes:o=[],allowedAttributes:s}=e,c=n||t,l=e=>{if(!s)return e;let t={};return s.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let r={...a,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${c}(?:\\s|$)`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,i){let a=RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),s=e.match(a);if(!s)return;let l=r(s[1]||``);if(!o.find(e=>!(e in l)))return{type:t,raw:s[0],attributes:l}}},renderMarkdown:e=>{let t=i(l(e.attrs||{}));return`:::${c}${t?` {${t}}`:``} :::`}}}function BE(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=LE,serializeAttributes:a=RE,defaultAttributes:o={},content:s=`block`,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let i;if(r){let t=r(e);i=typeof t==`string`?[{type:`text`,text:t}]:t}else i=s===`block`?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);let a={...o,...e.attributes};return n.createNode(t,a,i)},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${l}`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),o=e.match(a);if(!o)return;let[c,u=``]=o,d=i(u),f=1,p=c.length,m=``,h=/^:::([\w-]*)(\s.*)?/gm,g=e.slice(p);for(h.lastIndex=0;;){let n=h.exec(g);if(n===null)break;let i=n.index,a=n[1];if(!n[2]?.endsWith(`:::`)){if(a)f+=1;else if(--f,f===0){let a=g.slice(0,i);m=a.trim();let o=e.slice(0,p+i+n[0].length),c=[];if(m)if(s===`block`)for(c=r.blockTokens(a),c.forEach(e=>{e.text&&(!e.tokens||e.tokens.length===0)&&(e.tokens=r.inlineTokens(e.text))});c.length>0;){let e=c[c.length-1];if(e.type===`paragraph`&&(!e.text||e.text.trim()===``))c.pop();else break}else c=r.inlineTokens(m);return{type:t,raw:o,attributes:d,content:m,tokens:c}}}}}},renderMarkdown:(e,t)=>{let n=a(u(e.attrs||{}));return`:::${l}${n?` {${n}}`:``}
29
-
30
- ${t.renderChildren(e.content||[],`
31
-
32
- `)}
33
-
34
- :::`}}}function VE(e){if(!e.trim())return{};let t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;r!==null;){let[,i,a,o]=r;t[i]=a||o,r=n.exec(e)}return t}function HE(e){return Object.entries(e).filter(([,e])=>e!=null).map(([e,t])=>`${e}="${t}"`).join(` `)}function UE(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=VE,serializeAttributes:a=HE,defaultAttributes:o={},selfClosing:s=!1,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{let r=typeof n==`string`?n:n.name,i=typeof n==`string`?void 0:n.skipIfDefault;if(r in e){let n=e[r];if(i!==void 0&&n===i)return;t[r]=n}}),t},d=l.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return{parseMarkdown:(e,n)=>{let i={...o,...e.attributes};if(s)return n.createNode(t,i);let a=r?r(e):e.content||``;return a?n.createNode(t,i,[n.createTextNode(a)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:`inline`,start(e){let t=RegExp(s?`\\[${d}\\s*[^\\]]*\\]`:`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(s?`^\\[${d}\\s*([^\\]]*)\\]`:`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),o=e.match(a);if(!o)return;let c=``,l=``;if(s){let[,e]=o;l=e}else{let[,e,t]=o;l=e,c=t||``}let u=i(l.trim());return{type:t,raw:o[0],content:c.trim(),attributes:u}}},renderMarkdown:e=>{let t=``;r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(e=>e.type===`text`).map(e=>e.text).join(``));let n=a(u(e.attrs||{})),i=n?` ${n}`:``;return s?`[${l}${i}]`:`[${l}${i}]${t}[/${l}]`}}}function WE(e,t,n){let r=e.split(`
35
- `),i=[],a=``,o=0,s=t.baseIndentSize||2;for(;o<r.length;){let e=r[o],c=e.match(t.itemPattern);if(!c){if(i.length>0)break;if(e.trim()===``){o+=1,a=`${a}${e}
36
- `;continue}else return}let l=t.extractItemData(c),{indentLevel:u,mainContent:d}=l;a=`${a}${e}
37
- `;let f=[d];for(o+=1;o<r.length;){let e=r[o];if(e.trim()===``){let t=r.slice(o+1).findIndex(e=>e.trim()!==``);if(t===-1)break;if((r[o+1+t].match(/^(\s*)/)?.[1]?.length||0)>u){f.push(e),a=`${a}${e}
38
- `,o+=1;continue}else break}if((e.match(/^(\s*)/)?.[1]?.length||0)>u)f.push(e),a=`${a}${e}
39
- `,o+=1;else break}let p,m=f.slice(1);if(m.length>0){let e=m.map(e=>e.slice(u+s)).join(`
40
- `);e.trim()&&(p=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}let h=t.createToken(l,p);i.push(h)}if(i.length!==0)return{items:i,raw:a}}function GE(e,t,n,r){if(!e||!Array.isArray(e.content))return``;let i=typeof n==`function`?n(r):n,[a,...o]=e.content,s=`${i}${t.renderChildren([a])}`;return o&&o.length>0&&o.forEach((e,n)=>{let r=t.renderChild?.call(t,e,n+1)??t.renderChildren([e]);if(r!=null){let n=r.split(`
41
- `).map(e=>e?t.indent(e):t.indent(``)).join(`
42
- `);s+=e.type===`paragraph`?`
43
-
44
- ${n}`:`
45
- ${n}`}}),s}function KE(e,t){let n=qO.get(e);if(!n){let t={callbacks:new Set,rafId:null,handler:()=>{t.rafId!==null&&cancelAnimationFrame(t.rafId),t.rafId=requestAnimationFrame(()=>{t.rafId=null,t.callbacks.forEach(e=>e())})}};qO.set(e,t),e.on(`update`,t.handler),n=t}n.callbacks.add(t)}function qE(e,t){let n=qO.get(e);n&&(n.callbacks.delete(t),n.callbacks.size===0&&(n.rafId!==null&&cancelAnimationFrame(n.rafId),e.off(`update`,n.handler),qO.delete(e)))}function JE(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants((t,r)=>{let i=a.mapping.map(r),s=a.mapping.map(r)+t.nodeSize,c=null;if(t.marks.forEach(e=>{if(e!==o)return!1;c=e}),!c)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==c.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});a.removeMark(i,s,e.type),a.addMark(i,s,t)}}),a.docChanged&&t.view.dispatch(a)}function YE(e){return new SO({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=U(e.getAttributes,void 0,r,i);if(a===!1||a===null)return null;let{tr:o}=t,s=r[r.length-1],c=r[0],l=n.to;if(s){let r=c.search(/\S/),i=n.from+c.indexOf(s),u=i+s.length;if(eE(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>i).length)return null;u<n.to&&o.delete(u,n.to),i>n.from&&o.delete(n.from+r,i),l=n.from+r+s.length,o.addMark(n.from+r,l,e.type.create(a||{})),o.removeStoredMark(e.type)}}})}function XE(e){return new SO({find:e.find,handler({match:t,chain:n,range:r,pasteEvent:i}){let a=U(e.getAttributes,void 0,t,i),o=U(e.getContent,void 0,a);if(a===!1||a===null)return null;let s={type:e.type.name,attrs:a};o&&(s.content=o),t.input&&n().deleteRange(r).insertContentAt(r.from,s)}})}function ZE(e){return new SO({find:e.find,handler:({state:t,range:n,match:r})=>{let i=e.replace,a=n.from,o=n.to;if(r[1]){let e=r[0].lastIndexOf(r[1]);i+=r[0].slice(e+r[1].length),a+=e;let t=a-o;t>0&&(i=r[0].slice(e-t,e)+i,a=o)}t.tr.insertText(i,a,o)}})}var QE,$E,eD,tD,nD,rD,iD,aD,oD,sD,cD,lD,uD,dD,fD,pD,mD,hD,gD,_D,vD,yD,bD,xD,SD,CD,wD,TD,ED,DD,OD,kD,AD,jD,MD,ND,PD,FD,ID,LD,RD,zD,BD,VD,HD,UD,WD,GD,KD,qD,JD,YD,XD,ZD,QD,$D,eO,tO,nO,rO,iO,aO,oO,sO,cO,lO,uO,dO,fO,pO,mO,hO,gO,_O,vO,yO,bO,xO,SO,CO,wO,TO,EO,DO,W,OO,kO,AO,jO,MO,NO,PO,FO,IO,LO,RO,zO,BO,VO,HO,UO,WO,GO,KO,qO,JO,YO,XO,ZO,QO=d((()=>{Rv(),Jy(),Yy(),Xy(),ab(),Aw(),Kw(),QE=Object.defineProperty,$E=(e,t)=>{for(var n in t)QE(e,n,{get:t[n],enumerable:!0})},eD=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,a=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(a);return!i.getMeta(`preventDispatch`)&&!this.hasCustomState&&r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o=[],s=!!e,c=e||i.tr,l=()=>(!s&&t&&!c.getMeta(`preventDispatch`)&&!this.hasCustomState&&a.dispatch(c),o.every(e=>e===!0)),u={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(c,t),i=n(...e)(r);return o.push(i),u}])),run:l};return u}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:qw({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(o)]))}};return o}},tD={},$E(tD,{blur:()=>nD,clearContent:()=>rD,clearNodes:()=>iD,command:()=>aD,createParagraphNear:()=>oD,cut:()=>sD,deleteCurrentNode:()=>cD,deleteNode:()=>lD,deleteRange:()=>uD,deleteSelection:()=>dD,enter:()=>fD,exitCode:()=>pD,extendMarkRange:()=>mD,first:()=>hD,focus:()=>gD,forEach:()=>_D,insertContent:()=>vD,insertContentAt:()=>xD,joinBackward:()=>wD,joinDown:()=>CD,joinForward:()=>TD,joinItemBackward:()=>ED,joinItemForward:()=>DD,joinTextblockBackward:()=>OD,joinTextblockForward:()=>kD,joinUp:()=>SD,keyboardShortcut:()=>AD,lift:()=>jD,liftEmptyBlock:()=>MD,liftListItem:()=>ND,newlineInCode:()=>PD,resetAttributes:()=>FD,scrollIntoView:()=>ID,selectAll:()=>LD,selectNodeBackward:()=>RD,selectNodeForward:()=>zD,selectParentNode:()=>BD,selectTextblockEnd:()=>VD,selectTextblockStart:()=>HD,setContent:()=>UD,setMark:()=>YD,setMeta:()=>XD,setNode:()=>ZD,setNodeSelection:()=>QD,setTextDirection:()=>$D,setTextSelection:()=>eO,sinkListItem:()=>tO,splitBlock:()=>nO,splitListItem:()=>rO,toggleList:()=>oO,toggleMark:()=>sO,toggleNode:()=>cO,toggleWrap:()=>lO,undoInputRule:()=>uO,unsetAllMarks:()=>dO,unsetMark:()=>fO,unsetTextDirection:()=>pO,updateAttributes:()=>mO,wrapIn:()=>hO,wrapInList:()=>gO}),nD=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),rD=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),iD=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,a=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),s=a.blockRange(o);if(!s)return;let c=N_(s);if(e.type.isTextblock){let{defaultType:e}=a.parent.contentMatchAt(a.index());t.setNodeMarkup(s.start,e)}(c||c===0)&&t.lift(s,c)})}),!0},aD=e=>t=>e(t),oD=()=>({state:e,dispatch:t})=>Iy(e,t),sD=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,a=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let o=r.mapping.map(t);return r.insert(o,a.content),r.setSelection(new B(r.doc.resolve(Math.max(o-1,0)))),!0},cD=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;--n)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1},lD=e=>({tr:t,state:n,dispatch:r})=>{let i=Jw(e,n.schema),a=t.selection.$anchor;for(let e=a.depth;e>0;--e)if(a.node(e).type===i){if(r){let n=a.before(e),r=a.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},uD=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},dD=()=>({state:e,dispatch:t})=>wy(e,t),fD=()=>({commands:e})=>e.keyboardShortcut(`Enter`),pD=()=>({state:e,dispatch:t})=>Fy(e,t),mD=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=eT(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=$w(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=B.create(o,e.from,e.to);n.setSelection(t)}}return!0},hD=e=>t=>{let n=typeof e==`function`?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1},gD=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(aT()||iT())&&r.dom.focus(),oT()&&!aT()&&!iT()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(a&&e===null&&!tT(n.state.selection))return o(),!0;let s=rT(i.doc,e)||n.state.selection,c=n.state.selection.eq(s);return a&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},_D=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),vD=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),yD=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;--n){let r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&yD(r)}return e},bD=e=>!(`type`in e),xD=(e,t,n)=>({tr:r,dispatch:i,editor:a})=>{if(i){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let i,o=e=>{a.emit(`contentError`,{editor:a,error:e,disableCollaboration:()=>{`collaboration`in a.storage&&typeof a.storage.collaboration==`object`&&a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},s={preserveWhitespace:`full`,...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{cT(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=cT(t,a.schema,{parseOptions:s,errorOnInvalidContent:n.errorOnInvalidContent??a.options.enableContentCheck})}catch(e){return o(e),!1}let{from:c,to:l}=typeof e==`number`?{from:e,to:e}:{from:e.from,to:e.to},u=!0,d=!0;if((bD(i)?i:[i]).forEach(e=>{e.check(),u=u?e.isText&&e.marks.length===0:!1,d=d?e.isBlock:!1}),c===l&&d){let{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(--c,l+=1)}let f;if(u){if(Array.isArray(t))f=t.map(e=>e.text||``).join(``);else if(t instanceof L){let e=``;t.forEach(t=>{t.text&&(e+=t.text)}),f=e}else f=typeof t==`object`&&t&&t.text?t.text:t;r.insertText(f,c,l)}else{f=i;let e=r.doc.resolve(c),t=e.node(),n=e.parentOffset===0,a=t.isText||t.isTextblock,o=t.content.size>0;n&&a&&o&&(c=Math.max(0,c-1)),r.replaceWith(c,l,f)}n.updateSelection&&lT(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:f}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:f})}return!0},SD=()=>({state:e,dispatch:t})=>jy(e,t),CD=()=>({state:e,dispatch:t})=>My(e,t),wD=()=>({state:e,dispatch:t})=>Ty(e,t),TD=()=>({state:e,dispatch:t})=>ky(e,t),ED=()=>({state:e,dispatch:t,tr:n})=>{try{let r=X_(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},DD=()=>({state:e,dispatch:t,tr:n})=>{try{let r=X_(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},OD=()=>({state:e,dispatch:t})=>Ey(e,t),kD=()=>({state:e,dispatch:t})=>Dy(e,t),AD=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=dT(e).split(/-(?!$)/),o=a.find(e=>![`Alt`,`Ctrl`,`Meta`,`Shift`].includes(e)),s=new KeyboardEvent(`keydown`,{key:o===`Space`?` `:o,altKey:a.includes(`Alt`),ctrlKey:a.includes(`Ctrl`),metaKey:a.includes(`Meta`),shiftKey:a.includes(`Shift`),bubbles:!0,cancelable:!0});return t.captureTransaction(()=>{n.someProp(`handleKeyDown`,e=>e(n,s))})?.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0},jD=(e,t={})=>({state:n,dispatch:r})=>fT(n,Jw(e,n.schema),t)?Ny(n,r):!1,MD=()=>({state:e,dispatch:t})=>Ly(e,t),ND=e=>({state:t,dispatch:n})=>eb(Jw(e,t.schema))(t,n),PD=()=>({state:e,dispatch:t})=>Py(e,t),FD=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=pT(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=Jw(e,r.schema)),s===`mark`&&(o=eT(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,mT(e.attrs,t))),o&&e.marks.length&&e.marks.forEach(a=>{o===a.type&&(c=!0,i&&n.addMark(r,r+e.nodeSize,o.create(mT(a.attrs,t))))})})}),c},ID=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),LD=()=>({tr:e,dispatch:t})=>{if(t){let t=new Xv(e.doc);e.setSelection(t)}return!0},RD=()=>({state:e,dispatch:t})=>Oy(e,t),zD=()=>({state:e,dispatch:t})=>Ay(e,t),BD=()=>({state:e,dispatch:t})=>zy(e,t),VD=()=>({state:e,dispatch:t})=>Hy(e,t),HD=()=>({state:e,dispatch:t})=>Vy(e,t),UD=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:a,dispatch:o,commands:s})=>{let{doc:c}=a;if(r.preserveWhitespace!==`full`){let s=hT(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});return o&&a.replaceWith(0,c.content.size,s).setMeta(`preventUpdate`,!n),!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})},WD=(e,t,n,r=20)=>{let i=e.doc.resolve(n),a=r,o=null;for(;a>0&&o===null;){let e=i.node(a);e?.type.name===t?o=e:--a}return[o,a]},GD=(e,t=500)=>{let n=``,r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,a)=>{var o;let s=(o=e.type.spec).toText?.call(o,{node:e,pos:t,parent:i,index:a})||e.textContent||`%leaf%`;n+=e.isAtom&&!e.isText?s:s.slice(0,Math.max(0,r-t))}),n},KD=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=ST(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},qD=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)},JD=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}},YD=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=eT(e,r.schema);if(i)if(o){let e=gT(r,c);n.addStoredMark(c.create({...e,...t}))}else s.forEach(e=>{let i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,(e,r)=>{let o=Math.max(r,i),s=Math.min(r+e.nodeSize,a);e.marks.find(e=>e.type===c)?e.marks.forEach(e=>{c===e.type&&n.addMark(o,s,c.create({...e.attrs,...t}))}):n.addMark(o,s,c.create(t))})});return mE(r,n,c)},XD=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),ZD=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=Jw(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>Sy(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>Sy(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},QD=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=nT(e,0,n.content.size),i=V.create(n,r);t.setSelection(i)}return!0},$D=(e,t)=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=r,o,s;return typeof t==`number`?(o=t,s=t):t&&`from`in t&&`to`in t?(o=t.from,s=t.to):(o=a.from,s=a.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},eO=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=B.atStart(n).from,o=B.atEnd(n).to,s=nT(r,a,o),c=nT(i,a,o),l=B.create(n,s,c);t.setSelection(l)}return!0},tO=e=>({state:t,dispatch:n})=>rb(Jw(e,t.schema))(t,n),nO=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:a,doc:o}=t,{$from:s,$to:c}=a,l=i.extensionManager.attributes,u=nE(l,s.node().type.name,s.node().attrs);if(a instanceof V&&a.node.isBlock)return!s.parentOffset||!G_(o,s.pos)?!1:(r&&(e&&hE(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;let d=c.parentOffset===c.parent.content.size,f=s.depth===0?void 0:vT(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=G_(t.doc,t.mapping.map(s.pos),1,p);if(!p&&!m&&G_(t.doc,t.mapping.map(s.pos),1,f?[{type:f}]:void 0)&&(m=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(m&&(a instanceof B&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,p),f&&!d&&!s.parentOffset&&s.parent.type!==f)){let e=t.mapping.map(s.before()),n=t.doc.resolve(e);s.node(-1).canReplaceWith(n.index(),n.index()+1,f)&&t.setNodeMarkup(t.mapping.map(s.before()),f)}e&&hE(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},rO=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=Jw(e,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let u=s.node(-1);if(u.type!==o)return!1;let d=a.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==o||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let e=L.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=L.from(s.node(t).copy(e));let i=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,a={...nE(d,s.node().type.name,s.node().attrs),...t},c=o.contentMatch.defaultType?.createAndFill(a)||void 0;e=e.append(L.from(o.createAndFill(null,c)||void 0));let l=s.before(s.depth-(r-1));n.replace(l,s.after(-i),new R(e,4-r,0));let u=-1;n.doc.nodesBetween(l,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&e.content.size===0&&(u=t+1)}),u>-1&&n.setSelection(B.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...nE(d,u.type.name,u.attrs),...t},m={...nE(d,s.node().type.name,s.node().attrs),...t};n.delete(s.pos,c.pos);let h=f?[{type:o,attrs:p},{type:f,attrs:m}]:[{type:o,attrs:p}];if(!G_(n.doc,s.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:o}=a.extensionManager,c=t||e.$to.parentOffset&&e.$from.marks();if(n.split(s.pos,2,h).scrollIntoView(),!c||!i)return!0;let l=c.filter(e=>o.includes(e.type.name));n.ensureMarks(l)}return!0},iO=(e,t)=>{let n=ST(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&q_(e.doc,n.pos)&&e.join(n.pos),!0},aO=(e,t)=>{let n=ST(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&q_(e.doc,r)&&e.join(r),!0},oO=(e,t,n,r={})=>({editor:i,tr:a,state:o,dispatch:s,chain:c,commands:l,can:u})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=Jw(e,o.schema),m=Jw(t,o.schema),{selection:h,storedMarks:g}=o,{$from:_,$to:v}=h,y=_.blockRange(v),b=g||h.$to.parentOffset&&h.$from.marks();if(!y)return!1;let x=ST(e=>oE(e.type.name,d))(h);if(y.depth>=1&&x&&y.depth-x.depth<=1){if(x.node.type===p)return l.liftListItem(m);if(oE(x.node.type.name,d)&&p.validContent(x.node.content)&&s)return c().command(()=>(a.setNodeMarkup(x.pos,p),!0)).command(()=>iO(a,p)).command(()=>aO(a,p)).run()}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>iO(a,p)).command(()=>aO(a,p)).run():c().command(()=>{let e=u().wrapInList(p,r),t=b.filter(e=>f.includes(e.type.name));return a.ensureMarks(t),e?!0:l.clearNodes()}).wrapInList(p,r).command(()=>iO(a,p)).command(()=>aO(a,p)).run()},sO=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=eT(e,r.schema);return rE(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},cO=(e,t,n={})=>({state:r,commands:i})=>{let a=Jw(e,r.schema),o=Jw(t,r.schema),s=fT(r,a,n),c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),s?i.setNode(o,c):i.setNode(a,{...c,...n})},lO=(e,t={})=>({state:n,commands:r})=>{let i=Jw(e,n.schema);return fT(n,i,t)?r.lift(i):r.wrapIn(i,t)},uO=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i=n[r],a;if(i.spec.isInputRules&&(a=i.getState(e))){if(t){let t=e.tr,n=a.transform;for(let e=n.steps.length-1;e>=0;--e)t.step(n.steps[e].invert(n.docs[e]));if(a.text){let n=t.doc.resolve(a.from).marks();t.replaceWith(a.from,a.to,e.schema.text(a.text,n))}else t.delete(a.from,a.to)}return!0}}return!1},dO=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0},fO=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=eT(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=$w(c,s,c.marks().find(e=>e.type===s)?.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,s)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,s)});return n.removeStoredMark(s),!0},pO=e=>({tr:t,state:n,dispatch:r})=>{let{selection:i}=n,a,o;return typeof e==`number`?(a=e,o=e):e&&`from`in e&&`to`in e?(a=e.from,o=e.to):(a=i.from,o=i.to),r&&t.doc.nodesBetween(a,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},mO=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=pT(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=Jw(e,r.schema)),s===`mark`&&(o=eT(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{let s=e.$from.pos,l=e.$to.pos,u,d,f,p;n.selection.empty?r.doc.nodesBetween(s,l,(e,t)=>{a&&a===e.type&&(c=!0,f=Math.max(t,s),p=Math.min(t+e.nodeSize,l),u=t,d=e)}):r.doc.nodesBetween(s,l,(e,r)=>{r<s&&a&&a===e.type&&(c=!0,f=Math.max(r,s),p=Math.min(r+e.nodeSize,l),u=r,d=e),r>=s&&r<=l&&(a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),o&&e.marks.length&&e.marks.forEach(a=>{if(o===a.type&&(c=!0,i)){let i=Math.max(r,s),c=Math.min(r+e.nodeSize,l);n.addMark(i,c,o.create({...a.attrs,...t}))}}))}),d&&(u!==void 0&&i&&n.setNodeMarkup(u,void 0,{...d.attrs,...t}),o&&d.marks.length&&d.marks.forEach(e=>{o===e.type&&i&&n.addMark(f,p,o.create({...e.attrs,...t}))}))}),c},hO=(e,t={})=>({state:n,dispatch:r})=>xy(Jw(e,n.schema),t)(n,r),gO=(e,t={})=>({state:n,dispatch:r})=>Zy(Jw(e,n.schema),t)(n,r),_O=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},vO=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},yO=(e,t)=>{if(Yw(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn(`[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".`),r.push(n.replaceWith)),r},bO=class{constructor(e={}){this.type=`extendable`,this.parent=null,this.child=null,this.name=``,this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...U(H(this,`addOptions`,{name:this.name}))||{}}}get storage(){return{...U(H(this,`addStorage`,{name:this.name,options:this.options}))||{}}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>bE(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name=`name`in e?e.name:t.parent.name,t}},xO=class e extends bO{constructor(){super(...arguments),this.type=`mark`}static create(t={}){return new e(typeof t==`function`?t():t)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>e?.type.name===t.name))return!1;let a=i.find(e=>e?.type.name===t.name);return a&&n.removeStoredMark(a),n.insertText(` `,r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},SO=class{constructor(e){this.find=e.find,this.handler=e.handler}},CO=(e,t,n)=>{if(Yw(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn(`[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".`),n.push(t.replaceWith)),n}):[]},wO=null,TO=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n},EO=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=BT(e),this.schema=LT(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=H(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:tE(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this;return zT([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:tE(t.name,this.schema)},r=[],i=H(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`&&H(t,`exitable`,n)&&(a.ArrowRight=()=>xO.handleExit({editor:e,mark:t})),i){let t=Object.fromEntries(Object.entries(i()).map(([t,n])=>[t,()=>n({editor:e})]));a={...a,...t}}let o=Vw(a);r.push(o);let s=H(t,`addInputRules`,n);if(aE(t,e.options.enableInputRules)&&s){let t=s();if(t&&t.length){let n=_E({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let c=H(t,`addPasteRules`,n);if(aE(t,e.options.enablePasteRules)&&c){let t=c();if(t&&t.length){let n=CE({editor:e,rules:t});r.push(...n)}}let l=H(t,`addProseMirrorPlugins`,n);if(l){let e=l();r.push(...e)}return r})}get attributes(){return OT(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=DT(this.extensions);return Object.fromEntries(t.filter(e=>!!H(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=H(t,`addNodeView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Jw(t.name,this.schema)});if(!r)return[];let i=r();return i?[t.name,(r,a,o,s,c)=>i({node:r,view:a,getPos:o,decorations:s,innerDecorations:c,editor:e,extension:t,HTMLAttributes:MT(r,n)})]:[]}))}dispatchTransaction(e){let{editor:t}=this;return zT([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:tE(n.name,this.schema)},i=H(n,`dispatchTransaction`,r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return zT([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:tE(n.name,this.schema)},i=H(n,`transformPastedHTML`,r);return i?(t,n)=>{let a=e(t,n);return i.call(r,a)}:e},e||(e=>e))}get markViews(){let{editor:e}=this,{markExtensions:t}=DT(this.extensions);return Object.fromEntries(t.filter(e=>!!H(e,`addMarkView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=H(t,`addMarkView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:eT(t.name,this.schema)});return r?[t.name,(i,a,o)=>{let s=MT(i,n);return r()({mark:i,view:a,inline:o,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{JE(i,e,t)}})}]:[]}))}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{let t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:tE(e.name,this.schema)};e.type===`mark`&&(U(H(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name);let n=H(e,`onBeforeCreate`,t),r=H(e,`onCreate`,t),i=H(e,`onUpdate`,t),a=H(e,`onSelectionUpdate`,t),o=H(e,`onTransaction`,t),s=H(e,`onFocus`,t),c=H(e,`onBlur`,t),l=H(e,`onDestroy`,t);n&&this.editor.on(`beforeCreate`,n),r&&this.editor.on(`create`,r),i&&this.editor.on(`update`,i),a&&this.editor.on(`selectionUpdate`,a),o&&this.editor.on(`transaction`,o),s&&this.editor.on(`focus`,s),c&&this.editor.on(`blur`,c),l&&this.editor.on(`destroy`,l)})}},EO.resolve=BT,EO.sort=zT,EO.flatten=CT,DO={},$E(DO,{ClipboardTextSerializer:()=>OO,Commands:()=>kO,Delete:()=>AO,Drop:()=>jO,Editable:()=>MO,FocusEvents:()=>PO,Keymap:()=>FO,Paste:()=>IO,Tabindex:()=>LO,TextDirection:()=>RO,focusEventsPluginKey:()=>NO}),W=class e extends bO{constructor(){super(...arguments),this.type=`extension`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},OO=W.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new oy({key:new cy(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:a}=i,o=Math.min(...a.map(e=>e.$from.pos)),s=Math.max(...a.map(e=>e.$to.pos)),c=KT(n);return WT(r,{from:o,to:s},{...this.options.blockSeparator===void 0?{}:{blockSeparator:this.options.blockSeparator},textSerializers:c})}}})]}}),kO=W.create({name:`commands`,addCommands(){return{...tD}}}),AO=W.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){let n=()=>{var n;if(((n=this.editor.options.coreExtensionOptions?.delete)?.filterTransaction)?.call(n,e)??e.getMeta(`y-sync$`))return;let r=_T(e.before,[e,...t]);QT(r).forEach(t=>{r.mapping.mapResult(t.oldRange.from).deletedAfter&&r.mapping.mapResult(t.oldRange.to).deletedBefore&&r.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,i)=>{let a=i+n.nodeSize-2,o=t.oldRange.from<=i&&a<=t.oldRange.to;this.editor.emit(`delete`,{type:`node`,node:n,from:i,to:a,newFrom:r.mapping.map(i),newTo:r.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:r})})});let i=r.mapping;r.steps.forEach((t,n)=>{if(t instanceof Dv){let a=i.slice(n).map(t.from,-1),o=i.slice(n).map(t.to),s=i.invert().map(a,-1),c=i.invert().map(o),l=a>0?r.doc.nodeAt(a-1)?.marks.some(e=>e.eq(t.mark)):!1,u=r.doc.nodeAt(o)?.marks.some(e=>e.eq(t.mark));this.editor.emit(`delete`,{type:`mark`,mark:t.mark,from:t.from,to:t.to,deletedRange:{from:s,to:c},newRange:{from:a,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:r})}})};this.editor.options.coreExtensionOptions?.delete?.async??!0?setTimeout(n,0):n()}}),jO=W.create({name:`drop`,addProseMirrorPlugins(){return[new oy({key:new cy(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),MO=W.create({name:`editable`,addProseMirrorPlugins(){return[new oy({key:new cy(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),NO=new cy(`focusEvents`),PO=W.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new oy({key:NO,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta(`focus`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta(`blur`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1}}}})]}}),FO=W.create({name:`keymap`,addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:a}=n,{pos:o,parent:s}=a,c=a.parent.isTextblock&&o>0?t.doc.resolve(o-1):a,l=c.parent.type.spec.isolating,u=a.pos-a.parentOffset,d=l&&c.parent.childCount===1?u===a.pos:z.atStart(r).from===o;return!i||!s.type.isTextblock||s.textContent.length||!d||d&&a.parent.type.name===`paragraph`?!1:e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return aT()||uT()?i:r},addProseMirrorPlugins(){return[new oy({key:new cy(`clearDocument`),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta(`composition`)))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta(`preventClearDocument`));if(!r||i)return;let{empty:a,from:o,to:s}=t.selection,c=z.atStart(t.doc).from,l=z.atEnd(t.doc).to;if(a||!(o===c&&s===l)||!sE(n.doc))return;let u=n.tr,d=qw({state:n,transaction:u}),{commands:f}=new eD({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),IO=W.create({name:`paste`,addProseMirrorPlugins(){return[new oy({key:new cy(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),LO=W.create({name:`tabindex`,addProseMirrorPlugins(){return[new oy({key:new cy(`tabindex`),props:{attributes:()=>this.editor.isEditable?{tabindex:`0`}:{}}})]}}),RO=W.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=DT(this.extensions);return[{types:e.filter(e=>e.name!==`text`).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute(`dir`);return t&&(t===`ltr`||t===`rtl`||t===`auto`)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new oy({key:new cy(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),zO=class e{constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){return this.actualDepth??this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+ +!this.node.isText}get parent(){if(this.depth===0)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1);return new e(this.resolvedPos.doc.resolve(t),this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,a=n.isAtom&&!n.isText,o=n.isInline,s=this.pos+r+ +!a;if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;let c=this.resolvedPos.doc.resolve(s);if(!i&&!o&&c.depth<=this.depth)return;let l=new e(c,this.editor,i,i||o?n:null);i&&(l.actualDepth=this.depth+1),t.push(l)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e)if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==t[i])break}}else n=r;r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||this.children.length===0)return r;let i=Object.keys(t);return this.children.forEach(a=>{n&&r.length>0||(a.node.type.name===e&&i.every(e=>t[e]===a.node.attrs[e])&&r.push(a),!(n&&r.length>0)&&(r=r.concat(a.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},BO=`.ProseMirror {
46
- position: relative;
47
- }
48
-
49
- .ProseMirror {
50
- word-wrap: break-word;
51
- white-space: pre-wrap;
52
- white-space: break-spaces;
53
- -webkit-font-variant-ligatures: none;
54
- font-variant-ligatures: none;
55
- font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
56
- }
57
-
58
- .ProseMirror [contenteditable="false"] {
59
- white-space: normal;
60
- }
61
-
62
- .ProseMirror [contenteditable="false"] [contenteditable="true"] {
63
- white-space: pre-wrap;
64
- }
65
-
66
- .ProseMirror pre {
67
- white-space: pre-wrap;
68
- }
69
-
70
- img.ProseMirror-separator {
71
- display: inline !important;
72
- border: none !important;
73
- margin: 0 !important;
74
- width: 0 !important;
75
- height: 0 !important;
76
- }
77
-
78
- .ProseMirror-gapcursor {
79
- display: none;
80
- pointer-events: none;
81
- position: absolute;
82
- margin: 0;
83
- }
84
-
85
- .ProseMirror-gapcursor:after {
86
- content: "";
87
- display: block;
88
- position: absolute;
89
- top: -2px;
90
- width: 20px;
91
- border-top: 1px solid black;
92
- animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
93
- }
94
-
95
- @keyframes ProseMirror-cursor-blink {
96
- to {
97
- visibility: hidden;
98
- }
99
- }
100
-
101
- .ProseMirror-hideselection *::selection {
102
- background: transparent;
103
- }
104
-
105
- .ProseMirror-hideselection *::-moz-selection {
106
- background: transparent;
107
- }
108
-
109
- .ProseMirror-hideselection * {
110
- caret-color: transparent;
111
- }
112
-
113
- .ProseMirror-focused .ProseMirror-gapcursor {
114
- display: block;
115
- }`,VO=class extends _O{constructor(e={}){super(),this.css=null,this.className=`tiptap`,this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<`u`?document.createElement(`div`):null,content:``,injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:lE,createMappablePosition:uE},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on(`beforeCreate`,this.options.onBeforeCreate),this.emit(`beforeCreate`,{editor:this}),this.on(`mount`,this.options.onMount),this.on(`unmount`,this.options.onUnmount),this.on(`contentError`,this.options.onContentError),this.on(`create`,this.options.onCreate),this.on(`update`,this.options.onUpdate),this.on(`selectionUpdate`,this.options.onSelectionUpdate),this.on(`transaction`,this.options.onTransaction),this.on(`focus`,this.options.onFocus),this.on(`blur`,this.options.onBlur),this.on(`destroy`,this.options.onDestroy),this.on(`drop`,({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on(`paste`,({event:e,slice:t})=>this.options.onPaste(e,t)),this.on(`delete`,this.options.onDelete);let t=this.createDoc(),n=rT(t,this.options.autofocus);this.editorState=ay.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>`u`)throw Error(`[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.`);this.createView(e),this.emit(`mount`,{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit(`create`,{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){let e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove==`function`?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn(`Failed to remove CSS element:`,e)}this.css=null,this.emit(`unmount`,{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<`u`&&(this.css=wE(BO,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit(`update`,{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t===`state`)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=TT(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t=typeof e==`string`?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){this.extensionManager=new EO([...this.options.enableCoreExtensions?[MO,OO.configure({blockSeparator:this.options.coreExtensionOptions?.clipboardTextSerializer?.blockSeparator}),kO,PO,FO,LO,jO,IO,AO,RO.configure({direction:this.options.textDirection})].filter(e=>typeof this.options.enableCoreExtensions==`object`?this.options.enableCoreExtensions[e.name]!==!1:!0):[],...this.options.extensions].filter(e=>[`extension`,`node`,`mark`].includes(e?.type)),this)}createCommandManager(){this.commandManager=new eD({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=hT(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||![`[tiptap error]: Invalid JSON content`,`[tiptap error]: Invalid HTML content`].includes(t.message))throw t;this.emit(`contentError`,{editor:this,error:t,disableCollaboration:()=>{`collaboration`in this.storage&&typeof this.storage.collaboration==`object`&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>e.name!==`collaboration`),this.createExtensionManager()}}),e=hT(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,a=t.transformPastedHTML,o=this.extensionManager.transformPastedHTML(a);this.editorView=new Ow(e,{...t,attributes:{role:`textbox`,...t?.attributes},dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.prependClass(),this.injectCSS();let c=this.view.dom;c.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(e=>this.capturedTransaction?.step(e));return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),a=this.state;if(this.emit(`beforeTransaction`,{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit(`transaction`,{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit(`selectionUpdate`,{editor:this,transaction:e});let o=n.findLast(e=>e.getMeta(`focus`)||e.getMeta(`blur`)),s=o?.getMeta(`focus`),c=o?.getMeta(`blur`);s&&this.emit(`focus`,{editor:this,event:s.event,transaction:o}),c&&this.emit(`blur`,{editor:this,event:c.event,transaction:o}),!(e.getMeta(`preventUpdate`)||!n.some(e=>e.docChanged)||a.doc.eq(t.doc))&&this.emit(`update`,{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return YT(this.state,e)}isActive(e,t){let n=typeof e==`string`?e:null,r=typeof e==`string`?t:e;return iE(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return wT(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=`
116
-
117
- `,textSerializers:n={}}=e||{};return GT(this.state.doc,{blockSeparator:t,textSerializers:{...KT(this.schema),...n}})}get isEmpty(){return sE(this.state.doc)}destroy(){this.emit(`destroy`),this.unmount(),this.removeAllListeners()}get isDestroyed(){return this.editorView?.isDestroyed??!0}$node(e,t){return this.$doc?.querySelector(e,t)||null}$nodes(e,t){return this.$doc?.querySelectorAll(e,t)||null}$pos(e){return new zO(this.state.doc.resolve(e),this)}get $doc(){return this.$pos(0)}},HO=(e,t)=>{if(e===`slot`)return 0;if(e instanceof Function)return e(t);let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);return[e,r,n]},UO=e=>`touches`in e,WO=class{constructor(e){this.directions=[`bottom-left`,`bottom-right`,`top-left`,`top-right`],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:``,wrapper:``,handle:``,resizing:``},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.clientX-this.startX,n=e.clientY-this.startY;this.handleResize(t,n)},this.handleTouchMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.touches[0];if(!t)return;let n=t.clientX-this.startX,r=t.clientY-this.startY;this.handleResize(n,r)},this.handleMouseUp=()=>{if(!this.isResizing)return;let e=this.element.offsetWidth,t=this.element.offsetHeight;this.onCommit(e,t),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp)},this.handleKeyDown=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!1)},this.node=e.node,this.editor=e.editor,this.element=e.element,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,e.options?.min&&(this.minSize={...this.minSize,...e.options.min}),e.options?.max&&(this.maxSize=e.options.max),e?.options?.directions&&(this.directions=e.options.directions),e.options?.preserveAspectRatio&&(this.preserveAspectRatio=e.options.preserveAspectRatio),e.options?.className&&(this.classNames={container:e.options.className.container||``,wrapper:e.options.className.wrapper||``,handle:e.options.className.handle||``,resizing:e.options.className.resizing||``}),e.options?.createCustomHandle&&(this.createCustomHandle=e.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on(`update`,this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){return this.contentElement??null}handleEditorUpdate(){let e=this.editor.isEditable;e!==this.lastEditableState&&(this.lastEditableState=e,e?e&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(e,t,n){return e.type===this.node.type?(this.node=e,this.onUpdate?this.onUpdate(e,t,n):!0):!1}destroy(){this.isResizing&&(this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off(`update`,this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){let e=document.createElement(`div`);return e.dataset.resizeContainer=``,e.dataset.node=this.node.type.name,e.style.display=this.node.type.isInline?`inline-flex`:`flex`,this.classNames.container&&(e.className=this.classNames.container),e.appendChild(this.wrapper),e}createWrapper(){let e=document.createElement(`div`);return e.style.position=`relative`,e.style.display=`block`,e.dataset.resizeWrapper=``,this.classNames.wrapper&&(e.className=this.classNames.wrapper),e.appendChild(this.element),e}createHandle(e){let t=document.createElement(`div`);return t.dataset.resizeHandle=e,t.style.position=`absolute`,this.classNames.handle&&(t.className=this.classNames.handle),t}positionHandle(e,t){let n=t.includes(`top`),r=t.includes(`bottom`),i=t.includes(`left`),a=t.includes(`right`);n&&(e.style.top=`0`),r&&(e.style.bottom=`0`),i&&(e.style.left=`0`),a&&(e.style.right=`0`),(t===`top`||t===`bottom`)&&(e.style.left=`0`,e.style.right=`0`),(t===`left`||t===`right`)&&(e.style.top=`0`,e.style.bottom=`0`)}attachHandles(){this.directions.forEach(e=>{let t;t=this.createCustomHandle?this.createCustomHandle(e):this.createHandle(e),t instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${e}") did not return an HTMLElement. Falling back to default handle.`),t=this.createHandle(e)),this.createCustomHandle||this.positionHandle(t,e),t.addEventListener(`mousedown`,t=>this.handleResizeStart(t,e)),t.addEventListener(`touchstart`,t=>this.handleResizeStart(t,e)),this.handleMap.set(e,t),this.wrapper.appendChild(t)})}removeHandles(){this.handleMap.forEach(e=>e.remove()),this.handleMap.clear()}applyInitialSize(){let e=this.node.attrs.width,t=this.node.attrs.height;e?(this.element.style.width=`${e}px`,this.initialWidth=e):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height=`${t}px`,this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(e,t){e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.activeHandle=t,UO(e)?(this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY):(this.startX=e.clientX,this.startY=e.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState=`true`,this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener(`mousemove`,this.handleMouseMove),document.addEventListener(`touchmove`,this.handleTouchMove),document.addEventListener(`mouseup`,this.handleMouseUp),document.addEventListener(`keydown`,this.handleKeyDown),document.addEventListener(`keyup`,this.handleKeyUp)}handleResize(e,t){if(!this.activeHandle)return;let n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:i}=this.calculateNewDimensions(this.activeHandle,e,t),a=this.applyConstraints(r,i,n);this.element.style.width=`${a.width}px`,this.element.style.height=`${a.height}px`,this.onResize&&this.onResize(a.width,a.height)}calculateNewDimensions(e,t,n){let r=this.startWidth,i=this.startHeight,a=e.includes(`right`),o=e.includes(`left`),s=e.includes(`bottom`),c=e.includes(`top`);return a?r=this.startWidth+t:o&&(r=this.startWidth-t),s?i=this.startHeight+n:c&&(i=this.startHeight-n),(e===`right`||e===`left`)&&(r=this.startWidth+(a?t:-t)),(e===`top`||e===`bottom`)&&(i=this.startHeight+(s?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,i,e):{width:r,height:i}}applyConstraints(e,t,n){if(!n){let n=Math.max(this.minSize.width,e),r=Math.max(this.minSize.height,t);return this.maxSize?.width&&(n=Math.min(this.maxSize.width,n)),this.maxSize?.height&&(r=Math.min(this.maxSize.height,r)),{width:n,height:r}}let r=e,i=t;return r<this.minSize.width&&(r=this.minSize.width,i=r/this.aspectRatio),i<this.minSize.height&&(i=this.minSize.height,r=i*this.aspectRatio),this.maxSize?.width&&r>this.maxSize.width&&(r=this.maxSize.width,i=r/this.aspectRatio),this.maxSize?.height&&i>this.maxSize.height&&(i=this.maxSize.height,r=i*this.aspectRatio),{width:r,height:i}}applyAspectRatio(e,t,n){return n===`left`||n===`right`?{width:e,height:e/this.aspectRatio}:n===`top`||n===`bottom`?{width:t*this.aspectRatio,height:t}:{width:e,height:e/this.aspectRatio}}},GO=WO,KO={},$E(KO,{createAtomBlockMarkdownSpec:()=>zE,createBlockMarkdownSpec:()=>BE,createInlineMarkdownSpec:()=>UE,parseAttributes:()=>LE,parseIndentedBlocks:()=>WE,renderNestedMarkdownContent:()=>GE,serializeAttributes:()=>RE}),qO=new WeakMap,JO=class{constructor(e,t,n){this.component=e,this.editor=t.editor,this.options={...n},this.mark=t.mark,this.HTMLAttributes=t.HTMLAttributes}get dom(){return this.editor.view.dom}get contentDOM(){return null}updateAttributes(e,t){JE(t||this.mark,this.editor,e)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation==`function`?this.options.ignoreMutation({mutation:e}):e.type===`selection`||this.dom.contains(e.target)&&e.type===`childList`&&(aT()||iT())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable)?!1:this.contentDOM===e.target&&e.type===`attributes`?!0:!this.contentDOM.contains(e.target)}},YO=class e extends bO{constructor(){super(...arguments),this.type=`node`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},XO=class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t;let{view:n}=this.editor,r=e.target,i=r.nodeType===3?r.parentElement?.closest(`[data-drag-handle]`):r.closest(`[data-drag-handle]`);if(!this.dom||this.contentDOM?.contains(r)||!i)return;let a=0,o=0;if(this.dom!==i){let t=this.dom.getBoundingClientRect(),n=i.getBoundingClientRect(),r=e.offsetX??e.nativeEvent?.offsetX,s=e.offsetY??e.nativeEvent?.offsetY;a=n.x-t.x+r,o=n.y-t.y+s}let s=this.dom.cloneNode(!0);try{let e=this.dom.getBoundingClientRect();s.style.width=`${Math.round(e.width)}px`,s.style.height=`${Math.round(e.height)}px`,s.style.boxSizing=`border-box`,s.style.pointerEvents=`none`}catch{}let c=null;try{c=document.createElement(`div`),c.style.position=`absolute`,c.style.top=`-9999px`,c.style.left=`-9999px`,c.style.pointerEvents=`none`,c.appendChild(s),document.body.appendChild(c),(t=e.dataTransfer)==null||t.setDragImage(s,a,o)}finally{c&&setTimeout(()=>{try{c?.remove()}catch{}},0)}let l=this.getPos();if(typeof l!=`number`)return;let u=V.create(n.state.doc,l),d=n.state.tr.setSelection(u);n.dispatch(d)}stopEvent(e){if(!this.dom)return!1;if(typeof this.options.stopEvent==`function`)return this.options.stopEvent({event:e});let t=e.target;if(!(this.dom.contains(t)&&!this.contentDOM?.contains(t)))return!1;let n=e.type.startsWith(`drag`),r=e.type===`dragover`||e.type===`dragenter`,i=e.type===`drop`;if(([`INPUT`,`BUTTON`,`SELECT`,`TEXTAREA`].includes(t.tagName)||t.isContentEditable)&&!i&&!n)return!0;let{isEditable:a}=this.editor,{isDragging:o}=this,s=!!this.node.type.spec.draggable,c=V.isSelectable(this.node),l=e.type===`copy`,u=e.type===`paste`,d=e.type===`cut`,f=e.type===`mousedown`;if(!s&&c&&n&&e.target===this.dom&&e.preventDefault(),s&&n&&!o&&e.target===this.dom)return e.preventDefault(),!1;if(s&&a&&!o&&f){let e=t.closest(`[data-drag-handle]`);e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener(`dragend`,()=>{this.isDragging=!1},{once:!0}),document.addEventListener(`drop`,()=>{this.isDragging=!1},{once:!0}),document.addEventListener(`mouseup`,()=>{this.isDragging=!1},{once:!0}))}return!(o||r||i||l||u||d||f&&c)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation==`function`?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type===`selection`||this.dom.contains(e.target)&&e.type===`childList`&&(aT()||iT())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable)?!1:this.contentDOM===e.target&&e.type===`attributes`?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:t})=>{let n=this.getPos();return typeof n==`number`?(t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0):!1})}deleteNode(){let e=this.getPos();if(typeof e!=`number`)return;let t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}},ZO=class{constructor(e){this.transaction=e,this.currentStep=this.transaction.steps.length}map(e){let t=!1;return{position:this.transaction.steps.slice(this.currentStep).reduce((e,n)=>{let r=n.getMap().mapResult(e);return r.deleted&&(t=!0),r.pos},e),deleted:t}}}})),$O=p({CommandManager:()=>eD,Editor:()=>rk,EditorContent:()=>ik,Extendable:()=>bO,Extension:()=>W,Fragment:()=>AE,InputRule:()=>vO,MappablePosition:()=>JD,Mark:()=>xO,MarkView:()=>JO,MarkViewContent:()=>uk,Node:()=>YO,NodePos:()=>zO,NodeView:()=>XO,NodeViewContent:()=>ak,NodeViewWrapper:()=>ok,PasteRule:()=>SO,ResizableNodeView:()=>WO,ResizableNodeview:()=>GO,Tracker:()=>ZO,VueMarkView:()=>dk,VueMarkViewRenderer:()=>tk,VueNodeViewRenderer:()=>nk,VueRenderer:()=>ck,callOrReturn:()=>U,canInsertNode:()=>jE,cancelPositionCheck:()=>qE,combineTransactionSteps:()=>_T,commands:()=>tD,createAtomBlockMarkdownSpec:()=>zE,createBlockMarkdownSpec:()=>BE,createChainableState:()=>qw,createDocument:()=>hT,createElement:()=>HO,createInlineMarkdownSpec:()=>UE,createMappablePosition:()=>uE,createNodeFromContent:()=>cT,createStyleTag:()=>wE,decodeHtmlEntities:()=>NE,defaultBlockAt:()=>vT,deleteProps:()=>mT,elementFromString:()=>sT,encodeHtmlEntities:()=>PE,escapeForRegEx:()=>ME,extensions:()=>DO,findChildren:()=>yT,findChildrenInRange:()=>bT,findDuplicates:()=>RT,findParentNode:()=>ST,findParentNodeClosestToPos:()=>xT,flattenExtensions:()=>CT,fromString:()=>NT,generateHTML:()=>HT,generateJSON:()=>UT,generateText:()=>qT,getAttributes:()=>YT,getAttributesFromExtensions:()=>OT,getChangedRanges:()=>QT,getDebugJSON:()=>$T,getExtensionField:()=>H,getHTMLFromFragment:()=>wT,getMarkAttributes:()=>gT,getMarkRange:()=>$w,getMarkType:()=>eT,getMarksBetween:()=>eE,getNodeAtPosition:()=>WD,getNodeAttributes:()=>JT,getNodeType:()=>Jw,getRenderedAttributes:()=>MT,getSchema:()=>VT,getSchemaByResolvedExtensions:()=>LT,getSchemaTypeByName:()=>tE,getSchemaTypeNameByName:()=>pT,getSplittedAttributes:()=>nE,getText:()=>GT,getTextBetween:()=>WT,getTextContentFromNodes:()=>GD,getTextSerializersFromSchema:()=>KT,getUpdatedPosition:()=>lE,h:()=>HO,injectExtensionAttributesToParseRule:()=>PT,inputRulesPlugin:()=>_E,isActive:()=>iE,isAndroid:()=>iT,isAtEndOfNode:()=>KD,isAtStartOfNode:()=>qD,isEmptyObject:()=>ET,isExtensionRulesEnabled:()=>aE,isFirefox:()=>FE,isFunction:()=>TT,isList:()=>oE,isMacOS:()=>uT,isMarkActive:()=>rE,isNodeActive:()=>fT,isNodeEmpty:()=>sE,isNodeSelection:()=>cE,isNumber:()=>xE,isPlainObject:()=>yE,isRegExp:()=>Yw,isSafari:()=>oT,isString:()=>IE,isTextSelection:()=>tT,isiOS:()=>aT,markInputRule:()=>TE,markPasteRule:()=>YE,markViewProps:()=>lk,markdown:()=>KO,mergeAttributes:()=>jT,mergeDeep:()=>bE,minMax:()=>nT,nodeInputRule:()=>EE,nodePasteRule:()=>XE,nodeViewProps:()=>fk,objectIncludes:()=>Xw,parseAttributes:()=>LE,parseIndentedBlocks:()=>WE,pasteRulesPlugin:()=>CE,posToDOMRect:()=>dE,removeDuplicates:()=>XT,renderNestedMarkdownContent:()=>GE,resolveExtensions:()=>BT,resolveFocusPosition:()=>rT,rewriteUnknownContent:()=>pE,schedulePositionCheck:()=>KE,selectionToInsertionEnd:()=>lT,serializeAttributes:()=>RE,sortExtensions:()=>zT,splitExtensions:()=>DT,textInputRule:()=>OE,textPasteRule:()=>ZE,textblockTypeInputRule:()=>DE,updateMarkViewAttributes:()=>JE,useEditor:()=>sk,wrappingInputRule:()=>kE});function ek(e){return(0,t.customRef)((t,n)=>({get(){return t(),e},set(t){e=t,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}function tk(e,t={}){return n=>n.editor.contentComponent?new dk(e,n,t):{}}function nk(e,t){return n=>n.editor.contentComponent?new pk(typeof e==`function`&&`__vccOpts`in e?e.__vccOpts:e,n,t):{}}var rk,ik,ak,ok,sk,ck,lk,uk,dk,fk,pk,mk=d((()=>{QO(),QO(),rk=class extends VO{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=ek(this.view.state),this.reactiveExtensionStorage=ek(this.extensionStorage),this.on(`beforeTransaction`,({nextState:e})=>{this.reactiveState.value=e,this.reactiveExtensionStorage.value=this.extensionStorage}),(0,t.markRaw)(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,t){let n=super.registerPlugin(e,t);return this.reactiveState&&(this.reactiveState.value=n),n}unregisterPlugin(e){let t=super.unregisterPlugin(e);return this.reactiveState&&t&&(this.reactiveState.value=t),t}},ik=(0,t.defineComponent)({name:`EditorContent`,props:{editor:{default:null,type:Object}},setup(e){let n=(0,t.ref)(),r=(0,t.getCurrentInstance)();return(0,t.watchEffect)(()=>{let i=e.editor;i&&i.options.element&&n.value&&(0,t.nextTick)(()=>{if(!n.value||!i.view.dom?.parentNode)return;let e=(0,t.unref)(n.value);n.value.append(...i.view.dom.parentNode.childNodes),i.contentComponent=r.ctx._,r&&(i.appContext={...r.appContext,provides:r.provides}),i.setOptions({element:e}),i.createNodeViews()})}),(0,t.onBeforeUnmount)(()=>{let t=e.editor;t&&(t.contentComponent=null,t.appContext=null)}),{rootEl:n}},render(){return(0,t.h)(`div`,{ref:e=>{this.rootEl=e}})}}),ak=(0,t.defineComponent)({name:`NodeViewContent`,props:{as:{type:String,default:`div`}},render(){return(0,t.h)(this.as,{style:{whiteSpace:`pre-wrap`},"data-node-view-content":``})}}),ok=(0,t.defineComponent)({name:`NodeViewWrapper`,props:{as:{type:String,default:`div`}},inject:[`onDragStart`,`decorationClasses`],render(){var e;return(0,t.h)(this.as,{class:this.decorationClasses,style:{whiteSpace:`normal`},"data-node-view-wrapper":``,onDragstart:this.onDragStart},(e=this.$slots).default?.call(e))}}),sk=(e={})=>{let n=(0,t.shallowRef)();return(0,t.onMounted)(()=>{n.value=new rk(e)}),(0,t.onBeforeUnmount)(()=>{var e,t;let r=n.value?.view.dom?.parentNode,i=r?.cloneNode(!0);(e=r?.parentNode)==null||e.replaceChild(i,r),(t=n.value)==null||t.destroy()}),n},ck=class{constructor(e,{props:n={},editor:r}){this.destroyed=!1,this.editor=r,this.component=(0,t.markRaw)(e),this.el=document.createElement(`div`),this.props=(0,t.reactive)(n),this.renderedComponent=this.renderComponent()}get element(){return this.renderedComponent.el}get ref(){return this.renderedComponent.vNode?.component?.exposed?this.renderedComponent.vNode.component.exposed:this.renderedComponent.vNode?.component?.proxy}renderComponent(){if(this.destroyed)return this.renderedComponent;let e=(0,t.h)(this.component,this.props);return this.editor.appContext&&(e.appContext=this.editor.appContext),typeof document<`u`&&this.el&&(0,t.render)(e,this.el),{vNode:e,destroy:()=>{this.el&&(0,t.render)(null,this.el),this.el=null,e=null},el:this.el?this.el.firstElementChild:null}}updateProps(e={}){this.destroyed||(Object.entries(e).forEach(([e,t])=>{this.props[e]=t}),this.renderComponent())}destroy(){this.destroyed||(this.destroyed=!0,this.renderedComponent.destroy())}},lk={editor:{type:Object,required:!0},mark:{type:Object,required:!0},extension:{type:Object,required:!0},inline:{type:Boolean,required:!0},view:{type:Object,required:!0},updateAttributes:{type:Function,required:!0},HTMLAttributes:{type:Object,required:!0}},uk=(0,t.defineComponent)({name:`MarkViewContent`,props:{as:{type:String,default:`span`}},render(){return(0,t.h)(this.as,{style:{whiteSpace:`inherit`},"data-mark-view-content":``})}}),dk=class extends JO{constructor(e,n,r){super(e,n,r);let i={...n,updateAttributes:this.updateAttributes.bind(this)};this.renderer=new ck((0,t.defineComponent)({extends:{...e},props:Object.keys(i),template:this.component.template,setup:t=>e.setup?.call(e,t,{expose:()=>void 0}),__scopeId:e.__scopeId,__cssModules:e.__cssModules,__name:e.__name,__file:e.__file}),{editor:this.editor,props:i})}get dom(){return this.renderer.element}get contentDOM(){return this.dom.querySelector(`[data-mark-view-content]`)}updateAttributes(e){let n=(0,t.toRaw)(this.mark);super.updateAttributes(e,n)}destroy(){this.renderer.destroy()}},fk={editor:{type:Object,required:!0},node:{type:Object,required:!0},decorations:{type:Object,required:!0},selected:{type:Boolean,required:!0},extension:{type:Object,required:!0},getPos:{type:Function,required:!0},updateAttributes:{type:Function,required:!0},deleteNode:{type:Function,required:!0},view:{type:Object,required:!0},innerDecorations:{type:Object,required:!0},HTMLAttributes:{type:Object,required:!0}},pk=class extends XO{constructor(){super(...arguments),this.positionCheckCallback=null,this.cachedExtensionWithSyncedStorage=null}get extensionWithSyncedStorage(){if(!this.cachedExtensionWithSyncedStorage){let e=this.editor,t=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(t,{get(n,r,i){return r===`storage`?e.storage[t.name]??{}:Reflect.get(n,r,i)}})}return this.cachedExtensionWithSyncedStorage}mount(){let e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode()},n=this.onDragStart.bind(this);this.decorationClasses=(0,t.ref)(this.getDecorationClasses());let r=(0,t.defineComponent)({extends:{...this.component},props:Object.keys(e),template:this.component.template,setup:e=>{var r;return(0,t.provide)(`onDragStart`,n),(0,t.provide)(`decorationClasses`,this.decorationClasses),(r=this.component).setup?.call(r,e,{expose:()=>void 0})},__scopeId:this.component.__scopeId,__cssModules:this.component.__cssModules,__name:this.component.__name,__file:this.component.__file});this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.editor.on(`selectionUpdate`,this.handleSelectionUpdate),this.currentPos=this.getPos(),this.positionCheckCallback=()=>{if(!this.renderer)return;let e=this.getPos();typeof e!=`number`||e===this.currentPos||(this.currentPos=e,this.renderer.updateProps({getPos:()=>this.getPos()}))},KE(this.editor,this.positionCheckCallback),this.renderer=new ck(r,{editor:this.editor,props:e})}get dom(){if(!this.renderer.element||!this.renderer.element.hasAttribute(`data-node-view-wrapper`))throw Error(`Please use the NodeViewWrapper component for your node view.`);return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.dom.querySelector(`[data-node-view-content]`)}handleSelectionUpdate(){let{from:e,to:t}=this.editor.state.selection,n=this.getPos();if(typeof n==`number`)if(e<=n&&t>=n+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(e,t,n){let r=e=>{this.decorationClasses.value=this.getDecorationClasses(),this.renderer.updateProps(e)};if(typeof this.options.update==`function`){let i=this.node,a=this.decorations,o=this.innerDecorations;return this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=this.getPos(),this.options.update({oldNode:i,oldDecorations:a,newNode:e,newDecorations:t,oldInnerDecorations:o,innerDecorations:n,updateProps:()=>r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage})})}if(e.type!==this.node.type)return!1;let i=this.getPos();return e===this.node&&this.decorations===t&&this.innerDecorations===n?i===this.currentPos?!0:(this.currentPos=i,r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage,getPos:()=>this.getPos()}),!0):(this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=i,r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage}),!0)}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element&&this.renderer.element.classList.add(`ProseMirror-selectednode`)}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element&&this.renderer.element.classList.remove(`ProseMirror-selectednode`)}getDecorationClasses(){return this.decorations.flatMap(e=>e.type.attrs.class).join(` `)}destroy(){this.renderer.destroy(),this.editor.off(`selectionUpdate`,this.handleSelectionUpdate),this.positionCheckCallback&&=(qE(this.editor,this.positionCheckCallback),null)}}})),hk,gk=d((()=>{hk=(e,t)=>{if(e===`slot`)return 0;if(e instanceof Function)return e(t);let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);return[e,r,n]}})),_k=d((()=>{gk()})),vk,yk,bk=d((()=>{QO(),_k(),vk=/^\s*>\s$/,yk=YO.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return hk(`blockquote`,{...jT(this.options.HTMLAttributes,e),children:hk(`slot`,{})})},parseMarkdown:(e,t)=>{let n=t.parseBlockChildren??t.parseChildren;return t.createNode(`blockquote`,void 0,n(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return``;let n=[];return e.content.forEach((e,r)=>{let i=(t.renderChild?.call(t,e,r)??t.renderChildren([e])).split(`
118
- `).map(e=>e.trim()===``?`>`:`> ${e}`);n.push(i.join(`
119
- `))}),n.join(`
120
- >
121
- `)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[kE({find:vk,type:this.type})]}})})),xk,Sk,Ck,wk,Tk,Ek=d((()=>{QO(),_k(),xk=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Sk=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Ck=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,wk=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Tk=xO.create({name:`bold`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`strong`},{tag:`b`,getAttrs:e=>e.style.fontWeight!==`normal`&&null},{style:`font-weight=400`,clearMark:e=>e.type.name===this.name},{style:`font-weight`,getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return hk(`strong`,{...jT(this.options.HTMLAttributes,e),children:hk(`slot`,{})})},markdownTokenName:`strong`,parseMarkdown:(e,t)=>t.applyMark(`bold`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<strong>`,close:`</strong>`}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[TE({find:xk,type:this.type}),TE({find:Ck,type:this.type})]},addPasteRules(){return[YE({find:Sk,type:this.type}),YE({find:wk,type:this.type})]}})})),Dk,Ok,kk,Ak=d((()=>{QO(),Dk=/(^|[^`])`([^`]+)`(?!`)$/,Ok=/(^|[^`])`([^`]+)`(?!`)/g,kk=xO.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,jT(this.options.HTMLAttributes,e),0]},markdownTokenName:`codespan`,parseMarkdown:(e,t)=>t.applyMark(`code`,[{type:`text`,text:e.text||``}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:``,addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[TE({find:Dk,type:this.type})]},addPasteRules(){return[YE({find:Ok,type:this.type})]}})})),jk,Mk,Nk,Pk,Fk=d((()=>{QO(),Yy(),jk=4,Mk=/^```([a-z]+)?[\s\n]$/,Nk=/^~~~([a-z]+)?[\s\n]$/,Pk=YO.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:jk,HTMLAttributes:{}}},content:`text*`,marks:``,group:`block`,code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{let{languageClassPrefix:t}=this.options;return t&&[...e.firstElementChild?.classList||[]].filter(e=>e.startsWith(t)).map(e=>e.replace(t,``))[0]||null},rendered:!1}}},parseHTML(){return[{tag:`pre`,preserveWhitespace:`full`}]},renderHTML({node:e,HTMLAttributes:t}){return[`pre`,jT(this.options.HTMLAttributes,t),[`code`,{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:`code`,parseMarkdown:(e,t)=>e.raw?.startsWith("```")===!1&&e.raw?.startsWith(`~~~`)===!1&&e.codeBlockStyle!==`indented`?[]:t.createNode(`codeBlock`,{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[]),renderMarkdown:(e,t)=>{let n=``,r=e.attrs?.language||``;return n=e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join(`
122
- `):`\`\`\`${r}
123
-
124
- \`\`\``,n},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,`paragraph`,e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??jk,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;if(i.parent.type!==this.type)return!1;let o=` `.repeat(t);return a?e.commands.insertContent(o):e.commands.command(({tr:e})=>{let{from:t,to:i}=r,a=n.doc.textBetween(t,i,`
125
- `,`
126
- `).split(`
127
- `).map(e=>o+e).join(`
128
- `);return e.replaceWith(t,i,n.schema.text(a)),!0})},"Shift-Tab":({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??jk,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;return i.parent.type===this.type?a?e.commands.command(({tr:e})=>{let{pos:r}=i,a=i.start(),o=i.end(),s=n.doc.textBetween(a,o,`
129
- `,`
130
- `).split(`
131
- `),c=0,l=0,u=r-a;for(let e=0;e<s.length;e+=1){if(l+s[e].length>=u){c=e;break}l+=s[e].length+1}let d=s[c].match(/^ */)?.[0]||``,f=Math.min(d.length,t);if(f===0)return!0;let p=a;for(let e=0;e<c;e+=1)p+=s[e].length+1;return e.delete(p,p+f),r-p<=f&&e.setSelection(B.create(e.doc,p)),!0}):e.commands.command(({tr:e})=>{let{from:i,to:a}=r,o=n.doc.textBetween(i,a,`
132
- `,`
133
- `).split(`
134
- `).map(e=>{let n=e.match(/^ */)?.[0]||``,r=Math.min(n.length,t);return e.slice(r)}).join(`
135
- `);return e.replaceWith(i,a,n.schema.text(o)),!0}):!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let a=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
136
-
137
- `);return!a||!o?!1:e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:a}=n;if(!a||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let o=i.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:e})=>(e.setSelection(z.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[DE({find:Mk,type:this.type,getAttributes:e=>({language:e[1]})}),DE({find:Nk,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new oy({key:new cy(`codeBlockVSCodeHandler`),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData(`text/plain`),r=t.clipboardData.getData(`vscode-editor-data`),i=(r?JSON.parse(r):void 0)?.mode;if(!n||!i)return!1;let{tr:a,schema:o}=e.state,s=o.text(n.replace(/\r\n?/g,`
138
- `));return a.replaceSelectionWith(this.type.create({language:i},s)),a.selection.$from.parent.type!==this.type&&a.setSelection(B.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta(`paste`,!0),e.dispatch(a),!0}}})]}})})),Ik,Lk=d((()=>{QO(),Ik=YO.create({name:`doc`,topNode:!0,content:`block+`,renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
139
-
140
- `):``})})),Rk,zk=d((()=>{QO(),Rk=YO.create({name:`hardBreak`,markdownTokenName:`br`,addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:`inline`,selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:`br`}]},renderHTML({HTMLAttributes:e}){return[`br`,jT(this.options.HTMLAttributes,e)]},renderText(){return`
141
- `},renderMarkdown:()=>`
142
- `,parseMarkdown:()=>({type:`hardBreak`}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,s=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&s&&a){let t=s.filter(e=>o.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}})})),Bk,Vk=d((()=>{QO(),Bk=YO.create({name:`heading`,addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:`inline*`,group:`block`,defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,jT(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode(`heading`,{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{let n=e.attrs?.level?parseInt(e.attrs.level,10):1,r=`#`.repeat(n);return e.content?`${r} ${t.renderChildren(e.content)}`:``},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,`paragraph`,e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>DE({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}})})),Hk,Uk=d((()=>{QO(),Yy(),Hk=YO.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,jT(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!jE(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return cE(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(B.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(V.create(t.doc,n.pos)):t.setSelection(B.create(t.doc,n.pos));else{let i=(e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType)?.create();i&&(t.insert(r,i),t.setSelection(B.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[EE({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}})})),Wk,Gk,Kk,qk,Jk,Yk=d((()=>{QO(),Wk=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Gk=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Kk=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,qk=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Jk=xO.create({name:`italic`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`em`},{tag:`i`,getAttrs:e=>e.style.fontStyle!==`normal`&&null},{style:`font-style=normal`,clearMark:e=>e.type.name===this.name},{style:`font-style=italic`}]},renderHTML({HTMLAttributes:e}){return[`em`,jT(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:`em`,parseMarkdown:(e,t)=>t.applyMark(`italic`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<em>`,close:`</em>`}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[TE({find:Wk,type:this.type}),TE({find:Kk,type:this.type})]},addPasteRules(){return[YE({find:Gk,type:this.type}),YE({find:qk,type:this.type})]}})}));function Xk(e,t){return e in t||(t[e]=[]),t[e]}function Zk(e,t,n){t[yA]&&(t[SA]=!0,t[CA]=!0),t[bA]&&(t[SA]=!0,t[xA]=!0),t[SA]&&(t[CA]=!0),t[xA]&&(t[CA]=!0),t[CA]&&(t[wA]=!0),t[TA]&&(t[wA]=!0);for(let r in t){let t=Xk(r,n);t.indexOf(e)<0&&t.push(e)}}function Qk(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function $k(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}function eA(e=[]){let t={};$k.groups=t;let n=new $k;Uj??=iA(_A),Wj??=iA(vA),K(n,`'`,oj),K(n,`{`,UA),K(n,`}`,WA),K(n,`[`,GA),K(n,`]`,KA),K(n,`(`,qA),K(n,`)`,JA),K(n,`<`,YA),K(n,`>`,XA),K(n,`(`,ZA),K(n,`)`,QA),K(n,`「`,$A),K(n,`」`,ej),K(n,`『`,tj),K(n,`』`,nj),K(n,`<`,rj),K(n,`>`,ij),K(n,`&`,aj),K(n,`*`,sj),K(n,`@`,cj),K(n,"`",uj),K(n,`^`,dj),K(n,`:`,fj),K(n,`,`,pj),K(n,`$`,mj),K(n,`.`,hj),K(n,`=`,gj),K(n,`!`,_j),K(n,`-`,vj),K(n,`%`,yj),K(n,`|`,bj),K(n,`+`,xj),K(n,`#`,Sj),K(n,`?`,Cj),K(n,`"`,wj),K(n,`/`,Dj),K(n,`;`,Ej),K(n,`~`,Oj),K(n,`_`,kj),K(n,`\\`,lj),K(n,`・`,Tj);let r=kA(n,Ij,BA,{[yA]:!0});kA(r,Ij,r);let i=kA(r,Nj,NA,{[SA]:!0}),a=kA(r,Pj,PA,{[CA]:!0}),o=kA(n,Nj,jA,{[bA]:!0});kA(o,Ij,i),kA(o,Nj,o),kA(i,Ij,i),kA(i,Nj,i);let s=kA(n,Pj,MA,{[xA]:!0});kA(s,Nj),kA(s,Ij,a),kA(s,Pj,s),kA(a,Ij,a),kA(a,Nj),kA(a,Pj,a);let c=K(n,zj,HA,{[OA]:!0}),l=K(n,Rj,VA,{[OA]:!0}),u=kA(n,Lj,VA,{[OA]:!0});K(n,Hj,u),K(l,zj,c),K(l,Hj,u),kA(l,Lj,u),K(u,Rj),K(u,zj),kA(u,Lj,u),K(u,Hj,u);let d=kA(n,Fj,Aj,{[TA]:!0});K(d,`#`),kA(d,Fj,d),K(d,Bj,d);let f=K(d,Vj);K(f,`#`),kA(f,Fj,d);let p=[[Nj,o],[Ij,i]],m=[[Nj,null],[Pj,s],[Ij,a]];for(let e=0;e<Uj.length;e++)rA(n,Uj[e],IA,jA,p);for(let e=0;e<Wj.length;e++)rA(n,Wj[e],LA,MA,m);Zk(IA,{tld:!0,ascii:!0},t),Zk(LA,{utld:!0,alpha:!0},t),rA(n,`file`,RA,jA,p),rA(n,`mailto`,RA,jA,p),rA(n,`http`,zA,jA,p),rA(n,`https`,zA,jA,p),rA(n,`ftp`,zA,jA,p),rA(n,`ftps`,zA,jA,p),Zk(RA,{scheme:!0,ascii:!0},t),Zk(zA,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],i=e[t][1]?{[EA]:!0}:{[DA]:!0};r.indexOf(`-`)>=0?i[wA]=!0:Nj.test(r)?Ij.test(r)?i[SA]=!0:i[bA]=!0:i[yA]=!0,AA(n,r,r,i)}return AA(n,`localhost`,FA,{ascii:!0}),n.jd=new $k(jj),{start:n,tokens:Object.assign({groups:t},Mj)}}function tA(e,t){let n=nA(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],a=0,o=0;for(;o<r;){let s=e,c=null,l=0,u=null,d=-1,f=-1;for(;o<r&&(c=s.go(n[o]));)s=c,s.accepts()?(d=0,f=0,u=s):d>=0&&(d+=n[o].length,f++),l+=n[o].length,a+=n[o].length,o++;a-=d,o-=f,l-=d,i.push({t:u.t,v:t.slice(a-l,a),s:a-l,e:a})}return i}function nA(e){let t=[],n=e.length,r=0;for(;r<n;){let i=e.charCodeAt(r),a,o=i<55296||i>56319||r+1===n||(a=e.charCodeAt(r+1))<56320||a>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function rA(e,t,n,r,i){let a,o=t.length;for(let n=0;n<o-1;n++){let o=t[n];e.j[o]?a=e.j[o]:(a=new $k(r),a.jr=i.slice(),e.j[o]=a),e=a}return a=new $k(n),a.jr=i.slice(),e.j[t[o-1]]=a,a}function iA(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;`0123456789`.indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(``));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}function aA(e,t=null){let n=Object.assign({},Gj);e&&(n=Object.assign(n,e instanceof aA?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}function oA(e){return e}function sA(e,t){this.t=`token`,this.v=e,this.tk=t}function cA(e,t){class n extends sA{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}function lA({groups:e}){let t=e.domain.concat([aj,sj,cj,lj,uj,dj,mj,gj,vj,BA,yj,bj,xj,Sj,Dj,jj,Oj,kj]),n=[oj,fj,pj,hj,_j,yj,Cj,wj,Ej,YA,XA,UA,WA,KA,GA,qA,JA,ZA,QA,$A,ej,tj,nj,rj,ij],r=[aj,oj,sj,lj,uj,dj,mj,gj,vj,UA,WA,yj,bj,xj,Sj,Cj,Dj,jj,Oj,kj],i=Xj(),a=K(i,Oj);G(a,r,a),G(a,e.domain,a);let o=Xj(),s=Xj(),c=Xj();G(i,e.domain,o),G(i,e.scheme,s),G(i,e.slashscheme,c),G(o,r,a),G(o,e.domain,o);let l=K(o,cj);K(a,cj,l),K(s,cj,l),K(c,cj,l);let u=K(a,hj);G(u,r,a),G(u,e.domain,a);let d=Xj();G(l,e.domain,d),G(d,e.domain,d);let f=K(d,hj);G(f,e.domain,d);let p=Xj(Kj);G(f,e.tld,p),G(f,e.utld,p),K(l,FA,p);let m=K(d,vj);K(m,vj,m),G(m,e.domain,d),G(p,e.domain,d),K(p,hj,f),K(p,vj,m),G(K(p,fj),e.numeric,Kj);let h=K(o,vj),g=K(o,hj);K(h,vj,h),G(h,e.domain,o),G(g,r,a),G(g,e.domain,o);let _=Xj(Yj);G(g,e.tld,_),G(g,e.utld,_),G(_,e.domain,o),G(_,r,a),K(_,hj,g),K(_,vj,h),K(_,cj,l);let v=K(_,fj),y=Xj(Yj);G(v,e.numeric,y);let b=Xj(Yj),x=Xj();G(b,t,b),G(b,n,x),G(x,t,b),G(x,n,x),K(_,Dj,b),K(y,Dj,b);let S=K(s,fj),C=K(K(K(c,fj),Dj),Dj);G(s,e.domain,o),K(s,hj,g),K(s,vj,h),G(c,e.domain,o),K(c,hj,g),K(c,vj,h),G(S,e.domain,b),K(S,Dj,b),K(S,Cj,b),G(C,e.domain,b),G(C,t,b),K(C,Dj,b);let ee=[[UA,WA],[GA,KA],[qA,JA],[YA,XA],[ZA,QA],[$A,ej],[tj,nj],[rj,ij]];for(let e=0;e<ee.length;e++){let[r,i]=ee[e],a=K(b,r);K(x,r,a),K(a,i,b);let o=Xj(Yj);G(a,t,o);let s=Xj();G(a,n),G(o,t,o),G(o,n,s),G(s,t,o),G(s,n,s),K(o,i,b),K(s,i,b)}return K(i,FA,_),K(i,HA,Jj),{start:i,tokens:Mj}}function uA(e,t,n){let r=n.length,i=0,a=[],o=[];for(;i<r;){let s=e,c=null,l=null,u=0,d=null,f=-1;for(;i<r&&!(c=s.go(n[i].t));)o.push(n[i++]);for(;i<r&&(l=c||s.go(n[i].t));)c=null,s=l,s.accepts()?(f=0,d=s):f>=0&&f++,i++,u++;if(f<0)i-=u,i<r&&(o.push(n[i]),i++);else{o.length>0&&(a.push(dA(qj,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(dA(e,t,r))}}return o.length>0&&a.push(dA(qj,t,o)),a}function dA(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}function fA(){return $k.groups={},$j.scanner=null,$j.parser=null,$j.tokenQueue=[],$j.pluginQueue=[],$j.customSchemes=[],$j.initialized=!1,$j}function pA(e,t=!1){if($j.initialized&&Zj(`linkifyjs: already initialized - will not register custom scheme "${e}" ${Qj}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
143
- 1. Must only contain digits, lowercase ASCII letters or "-"
144
- 2. Cannot start or end with "-"
145
- 3. "-" cannot repeat`);$j.customSchemes.push([e,t])}function mA(){$j.scanner=eA($j.customSchemes);for(let e=0;e<$j.tokenQueue.length;e++)$j.tokenQueue[e][1]({scanner:$j.scanner});$j.parser=lA($j.scanner.tokens);for(let e=0;e<$j.pluginQueue.length;e++)$j.pluginQueue[e][1]({scanner:$j.scanner,parser:$j.parser});return $j.initialized=!0,$j}function hA(e){return $j.initialized||mA(),uA($j.parser.start,e,tA($j.scanner.start,e))}function gA(e,t=null,n=null){if(t&&typeof t==`object`){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new aA(n),i=hA(e),a=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&a.push(n.toFormattedObject(r))}return a}var _A,vA,yA,bA,xA,SA,CA,wA,TA,EA,DA,OA,G,kA,AA,K,jA,MA,NA,PA,FA,IA,LA,RA,zA,BA,VA,HA,UA,WA,GA,KA,qA,JA,YA,XA,ZA,QA,$A,ej,tj,nj,rj,ij,aj,oj,sj,cj,lj,uj,dj,fj,pj,mj,hj,gj,_j,vj,yj,bj,xj,Sj,Cj,wj,Tj,Ej,Dj,Oj,kj,Aj,jj,Mj,Nj,Pj,Fj,Ij,Lj,Rj,zj,Bj,Vj,Hj,Uj,Wj,Gj,Kj,qj,Jj,Yj,Xj,Zj,Qj,$j,eM=d((()=>{_A=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,vA=`ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2`,yA=`numeric`,bA=`ascii`,xA=`alpha`,SA=`asciinumeric`,CA=`alphanumeric`,wA=`domain`,TA=`emoji`,EA=`scheme`,DA=`slashscheme`,OA=`whitespace`,$k.groups={},$k.prototype={accepts(){return!!this.t},go(e){let t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){let r=t.jr[n][0],i=t.jr[n][1];if(i&&r.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r||=$k.groups;let i;return t&&t.j?i=t:(i=new $k(t),n&&r&&Zk(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,a=e.length;if(!a)return i;for(let t=0;t<a-1;t++)i=i.tt(e[t]);return i.tt(e[a-1],t,n,r)},tt(e,t,n,r){r||=$k.groups;let i=this;if(t&&t.j)return i.j[e]=t,t;let a=t,o,s=i.go(e);return s?(o=new $k,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new $k,a&&(r&&(o.t&&typeof o.t==`string`?Zk(a,Object.assign(Qk(o.t,r),n),r):n&&Zk(a,n,r)),o.t=a),i.j[e]=o,o}},G=(e,t,n,r,i)=>e.ta(t,n,r,i),kA=(e,t,n,r,i)=>e.tr(t,n,r,i),AA=(e,t,n,r,i)=>e.ts(t,n,r,i),K=(e,t,n,r,i)=>e.tt(t,n,r,i),jA=`WORD`,MA=`UWORD`,NA=`ASCIINUMERICAL`,PA=`ALPHANUMERICAL`,FA=`LOCALHOST`,IA=`TLD`,LA=`UTLD`,RA=`SCHEME`,zA=`SLASH_SCHEME`,BA=`NUM`,VA=`WS`,HA=`NL`,UA=`OPENBRACE`,WA=`CLOSEBRACE`,GA=`OPENBRACKET`,KA=`CLOSEBRACKET`,qA=`OPENPAREN`,JA=`CLOSEPAREN`,YA=`OPENANGLEBRACKET`,XA=`CLOSEANGLEBRACKET`,ZA=`FULLWIDTHLEFTPAREN`,QA=`FULLWIDTHRIGHTPAREN`,$A=`LEFTCORNERBRACKET`,ej=`RIGHTCORNERBRACKET`,tj=`LEFTWHITECORNERBRACKET`,nj=`RIGHTWHITECORNERBRACKET`,rj=`FULLWIDTHLESSTHAN`,ij=`FULLWIDTHGREATERTHAN`,aj=`AMPERSAND`,oj=`APOSTROPHE`,sj=`ASTERISK`,cj=`AT`,lj=`BACKSLASH`,uj=`BACKTICK`,dj=`CARET`,fj=`COLON`,pj=`COMMA`,mj=`DOLLAR`,hj=`DOT`,gj=`EQUALS`,_j=`EXCLAMATION`,vj=`HYPHEN`,yj=`PERCENT`,bj=`PIPE`,xj=`PLUS`,Sj=`POUND`,Cj=`QUERY`,wj=`QUOTE`,Tj=`FULLWIDTHMIDDLEDOT`,Ej=`SEMI`,Dj=`SLASH`,Oj=`TILDE`,kj=`UNDERSCORE`,Aj=`EMOJI`,jj=`SYM`,Mj=Object.freeze({__proto__:null,ALPHANUMERICAL:PA,AMPERSAND:aj,APOSTROPHE:oj,ASCIINUMERICAL:NA,ASTERISK:sj,AT:cj,BACKSLASH:lj,BACKTICK:uj,CARET:dj,CLOSEANGLEBRACKET:XA,CLOSEBRACE:WA,CLOSEBRACKET:KA,CLOSEPAREN:JA,COLON:fj,COMMA:pj,DOLLAR:mj,DOT:hj,EMOJI:Aj,EQUALS:gj,EXCLAMATION:_j,FULLWIDTHGREATERTHAN:ij,FULLWIDTHLEFTPAREN:ZA,FULLWIDTHLESSTHAN:rj,FULLWIDTHMIDDLEDOT:Tj,FULLWIDTHRIGHTPAREN:QA,HYPHEN:vj,LEFTCORNERBRACKET:$A,LEFTWHITECORNERBRACKET:tj,LOCALHOST:FA,NL:HA,NUM:BA,OPENANGLEBRACKET:YA,OPENBRACE:UA,OPENBRACKET:GA,OPENPAREN:qA,PERCENT:yj,PIPE:bj,PLUS:xj,POUND:Sj,QUERY:Cj,QUOTE:wj,RIGHTCORNERBRACKET:ej,RIGHTWHITECORNERBRACKET:nj,SCHEME:RA,SEMI:Ej,SLASH:Dj,SLASH_SCHEME:zA,SYM:jj,TILDE:Oj,TLD:IA,UNDERSCORE:kj,UTLD:LA,UWORD:MA,WORD:jA,WS:VA}),Nj=/[a-z]/,Pj=/\p{L}/u,Fj=/\p{Emoji}/u,Ij=/\d/,Lj=/\s/,Rj=`\r`,zj=`
146
- `,Bj=`️`,Vj=`‍`,Hj=``,Uj=null,Wj=null,Gj={defaultProtocol:`http`,events:null,format:oA,formatHref:oA,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null},aA.prototype={o:Gj,ignoreTags:[],defaultRender(e){return e},check(e){return this.get(`validate`,e.toString(),e)},get(e,t,n){let r=t!=null,i=this.o[e];return i&&(typeof i==`object`?(i=n.t in i?i[n.t]:Gj[e],typeof i==`function`&&r&&(i=i(t,n))):typeof i==`function`&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r==`function`&&t!=null&&(r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get(`render`,null,e)||this.defaultRender)(t,e.t,e)}},sA.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get(`truncate`,t,this),r=e.get(`format`,t,this);return n&&r.length>n?r.substring(0,n)+`…`:r},toFormattedHref(e){return e.get(`formatHref`,this.toHref(e.get(`defaultProtocol`)),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=Gj.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get(`validate`,this.toString(),this)},render(e){let t=this,n=this.toHref(e.get(`defaultProtocol`)),r=e.get(`formatHref`,n,this),i=e.get(`tagName`,n,t),a=this.toFormattedString(e),o={},s=e.get(`className`,n,t),c=e.get(`target`,n,t),l=e.get(`rel`,n,t),u=e.getObj(`attributes`,n,t),d=e.getObj(`events`,n,t);return o.href=r,s&&(o.class=s),c&&(o.target=c),l&&(o.rel=l),u&&Object.assign(o,u),{tagName:i,attributes:o,content:a,eventListeners:d}}},Kj=cA(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),qj=cA(`text`),Jj=cA(`nl`),Yj=cA(`url`,{isLink:!0,toHref(e=Gj.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==FA&&e[1].t===fj}}),Xj=e=>new $k(e),Zj=typeof console<`u`&&console&&console.warn||(()=>{}),Qj=`until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,$j={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1},hA.scan=tA})),tM=p({Link:()=>fM,default:()=>pM,isAllowedUri:()=>oM,pasteRegex:()=>dM});function nM(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function rM(e){return new oy({key:new cy(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r;if(QT(_T(n.doc,[...t])).forEach(({newRange:t})=>{let n=bT(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!lM.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(cM).filter(Boolean);if(t.length<=0)return!1;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return!1;let c=hA(n).map(t=>t.toObject(e.defaultProtocol));if(!nM(c))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>r.schema.marks.code?!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code):!0).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{eE(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function iM(e){return new oy({key:new cy(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.editor.view.dom;i=t.closest(`a`),i&&!n.contains(i)&&(i=null)}if(!i)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){let n=YT(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}function aM(e){return new oy({key:new cy(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i}=e,{state:a}=t,{selection:o}=a,{empty:s}=o;if(s)return!1;let c=``;r.content.forEach(e=>{c+=e.textContent});let l=gA(c,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===c);return!c||!l||i!==void 0&&!i(l.value)?!1:e.editor.commands.setMark(e.type,{href:l.href})}}})}function oM(e,t){let n=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`];return t&&t.forEach(e=>{let t=typeof e==`string`?e:e.scheme;t&&n.push(t)}),!e||e.replace(uM,``).match(RegExp(`^(?:(?:${n.join(`|`)}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,`i`))}var sM,cM,lM,uM,dM,fM,pM,mM=d((()=>{QO(),eM(),Yy(),sM=`[\0- \xA0 ᠎ -\u2029  ]`,cM=new RegExp(sM),lM=RegExp(`${sM}$`),uM=new RegExp(sM,`g`),dM=/https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z]{2,}\b(?:[-a-zA-Z0-9@:%._+~#=?!&/]*)(?:[-a-zA-Z0-9@:%._+~#=?!&/]*)/gi,fM=xO.create({name:`link`,priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e==`string`){pA(e);return}pA(e.scheme,e.optionalSlashes)})},onDestroy(){fA()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,class:null},isAllowedUri:(e,t)=>!!oM(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes(`@`))return!0;let r=(e.includes(`@`)?e.split(`@`).pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute(`href`)}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:`a[href]`,getAttrs:e=>{let t=e.getAttribute(`href`);return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!oM(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!oM(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,jT(this.options.HTMLAttributes,e),0]:[`a`,jT(this.options.HTMLAttributes,{...e,href:``}),0]},markdownTokenName:`link`,parseMarkdown:(e,t)=>t.applyMark(`link`,t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{let n=e.attrs?.href??``,r=e.attrs?.title??``,i=t.renderChildren(e);return r?`[${i}](${n} "${r}")`:`[${i}](${n})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:e=>!!oM(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta(`preventAutolink`,!0).run():!1},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!oM(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()}},addPasteRules(){return[YE({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,i=gA(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!oM(e,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t},type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(rM({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!oM(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(iM({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(aM({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),pM=fM}));function hM(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],a=i.match(LM);if(!a)break;let[,o,s,c]=a,l=o.length,u=c,d=n+1,f=[i];for(;d<e.length;){let t=e[d];if(t.match(LM))break;if(t.trim()===``)f.push(t),u+=`
147
- `,d+=1;else if(t.match(RM))f.push(t),u+=`
148
- ${t.slice(l+2)}`,d+=1;else break}t.push({indent:l,number:parseInt(s,10),content:u.trim(),raw:f.join(`
149
- `)}),r=d,n=d}return[t,r]}function gM(e,t,n){let r=[],i=0;for(;i<e.length;){let a=e[i];if(a.indent===t){let o=a.content.split(`
150
- `),s=o[0]?.trim()||``,c=[];s&&c.push({type:`paragraph`,raw:s,tokens:n.inlineTokens(s)});let l=o.slice(1).join(`
151
- `).trim();if(l){let e=n.blockTokens(l);c.push(...e)}let u=i+1,d=[];for(;u<e.length&&e[u].indent>t;)d.push(e[u]),u+=1;if(d.length>0){let e=gM(d,Math.min(...d.map(e=>e.indent)),n);c.push({type:`list`,ordered:!0,start:d[0].number,items:e,raw:d.map(e=>e.raw).join(`
152
- `)})}r.push({type:`list_item`,raw:a.raw,tokens:c}),i=u}else i+=1}return r}function _M(e,t){return e.map(e=>{if(e.type!==`list_item`)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if(e.type===`paragraph`||e.type===`list`||e.type===`blockquote`||e.type===`code`)n.push(...t.parseChildren([e]));else if(e.type===`text`&&e.tokens){let r=t.parseChildren([e]);n.push({type:`paragraph`,content:r})}else{let r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:`listItem`,content:n}})}var vM,yM,bM,xM,SM,CM,wM,TM,EM,DM,OM,kM,AM,jM,MM,NM,PM,FM,IM,LM,RM,zM,BM,VM,HM,UM,WM,GM,KM=d((()=>{QO(),vM=Object.defineProperty,yM=(e,t)=>{for(var n in t)vM(e,n,{get:t[n],enumerable:!0})},bM=`listItem`,xM=`textStyle`,SM=/^\s*([-+*])\s$/,CM=YO.create({name:`bulletList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul`}]},renderHTML({HTMLAttributes:e}){return[`ul`,jT(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>e.type!==`list`||e.ordered?[]:{type:`bulletList`,content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
153
- `):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(bM,this.editor.getAttributes(xM)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=kE({find:SM,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=kE({find:SM,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(xM),editor:this.editor})),[e]}}),wM=YO.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,jT(this.options.HTMLAttributes,e),0]},markdownTokenName:`list_item`,parseMarkdown:(e,t)=>{if(e.type!==`list_item`)return[];let n=t.parseBlockChildren??t.parseChildren,r=[];if(e.tokens&&e.tokens.length>0)if(e.tokens.some(e=>e.type===`paragraph`))r=n(e.tokens);else{let i=e.tokens[0];if(i&&i.type===`text`&&i.tokens&&i.tokens.length>0){if(r=[{type:`paragraph`,content:t.parseInline(i.tokens)}],e.tokens.length>1){let t=n(e.tokens.slice(1));r.push(...t)}}else r=n(e.tokens)}return r.length===0&&(r=[{type:`paragraph`,content:[]}]),{type:`listItem`,content:r}},renderMarkdown:(e,t,n)=>GE(e,t,e=>e.parentType===`bulletList`?`- `:e.parentType===`orderedList`?`${(e.meta?.parentAttrs?.start||1)+e.index}. `:`- `,n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),TM={},yM(TM,{findListItemPos:()=>EM,getNextListDepth:()=>DM,handleBackspace:()=>jM,handleDelete:()=>PM,hasListBefore:()=>OM,hasListItemAfter:()=>FM,hasListItemBefore:()=>kM,listItemHasSubList:()=>AM,nextListIsDeeper:()=>MM,nextListIsHigher:()=>NM}),EM=(e,t)=>{let{$from:n}=t.selection,r=Jw(e,t.schema),i=null,a=n.depth,o=n.pos,s=null;for(;a>0&&s===null;)i=n.node(a),i.type===r?s=a:(--a,--o);return s===null?null:{$pos:t.doc.resolve(o),depth:s}},DM=(e,t)=>{let n=EM(e,t);if(!n)return!1;let[,r]=WD(t,e,n.$pos.pos+4);return r},OM=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),a=e.doc.resolve(i).node();return!(!a||!n.includes(a.type.name))},kM=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-2);return!(r.index()===0||r.nodeBefore?.type.name!==e)},AM=(e,t,n)=>{if(!n)return!1;let r=Jw(e,t.schema),i=!1;return n.descendants(e=>{e.type===r&&(i=!0)}),i},jM=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!fT(e.state,t)&&OM(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let a=i.at(-1);if(!a)return!1;let o=e.state.doc.resolve(r.start()+a.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},o.end()).joinForward().run()}if(!fT(e.state,t)||!qD(e.state))return!1;let r=EM(t,e.state);if(!r)return!1;let i=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),a=AM(t,e.state,i);return kM(t,e.state)&&!a?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},MM=(e,t)=>{let n=DM(e,t),r=EM(e,t);return!r||!n?!1:n>r.depth},NM=(e,t)=>{let n=DM(e,t),r=EM(e,t);return!r||!n?!1:n<r.depth},PM=(e,t)=>{if(!fT(e.state,t)||!KD(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:MM(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():NM(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},FM=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-n.parentOffset-2);return!(r.index()===r.parent.childCount-1||r.nodeAfter?.type.name!==e)},IM=W.create({name:`listKeymap`,addOptions(){return{listTypes:[{itemName:`listItem`,wrapperNames:[`bulletList`,`orderedList`]},{itemName:`taskItem`,wrapperNames:[`taskList`]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&PM(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&PM(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&jM(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&jM(e,n,r)&&(t=!0)}),t}}}}),LM=/^(\s*)(\d+)\.\s+(.*)$/,RM=/^\s/,zM=`listItem`,BM=`textStyle`,VM=/^(\d+)\.\s$/,HM=YO.create({name:`orderedList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute(`start`)?parseInt(e.getAttribute(`start`)||``,10):1},type:{default:null,parseHTML:e=>e.getAttribute(`type`)}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,...n}=e;return t===1?[`ol`,jT(this.options.HTMLAttributes,n),0]:[`ol`,jT(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>{if(e.type!==`list`||!e.ordered)return[];let n=e.start||1,r=e.items?_M(e.items,t):[];return n===1?{type:`orderedList`,content:r}:{type:`orderedList`,attrs:{start:n},content:r}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
154
- `):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:e=>{let t=e.match(/^(\s*)(\d+)\.\s+/)?.index;return t===void 0?-1:t},tokenize:(e,t,n)=>{let r=e.split(`
155
- `),[i,a]=hM(r);if(i.length===0)return;let o=gM(i,0,n);if(o.length!==0)return{type:`list`,ordered:!0,start:i[0]?.number||1,items:o,raw:r.slice(0,a).join(`
156
- `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(zM,this.editor.getAttributes(BM)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=kE({find:VM,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=kE({find:VM,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(BM)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),UM=/^\s*(\[([( |x])?\])\s$/,WM=YO.create({name:`taskItem`,addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:`taskList`,a11y:void 0}},content(){return this.options.nested?`paragraph block*`:`paragraph+`},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute(`data-checked`);return t===``||t===`true`},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,jT(this.options.HTMLAttributes,t,{"data-type":this.name}),[`label`,[`input`,{type:`checkbox`,checked:e.attrs.checked?`checked`:null}],[`span`]],[`div`,0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode(`paragraph`,{},t.parseInline(e.tokens))):e.text?n.push(t.createNode(`paragraph`,{},[t.createNode(`text`,{text:e.text})])):n.push(t.createNode(`paragraph`,{},[])),e.nestedTokens&&e.nestedTokens.length>0){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode(`taskItem`,{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>GE(e,t,`- [${e.attrs?.checked?`x`:` `}] `),addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement(`li`),a=document.createElement(`label`),o=document.createElement(`span`),s=document.createElement(`input`),c=document.createElement(`div`),l=e=>{var t;s.ariaLabel=((t=this.options.a11y)?.checkboxLabel)?.call(t,e,s.checked)||`Task item checkbox for ${e.textContent||`empty task item`}`};l(e),a.contentEditable=`false`,s.type=`checkbox`,s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`change`,t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}let{checked:i}=t.target;r.isEditable&&typeof n==`function`&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if(typeof t!=`number`)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...r?.attrs,checked:i}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,i)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,a.append(s,o),i.append(a,c),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)});let u=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,l(e);let t=r.extensionManager.attributes,n=MT(e,t),a=new Set(Object.keys(n)),o=this.options.HTMLAttributes;return u.forEach(e=>{a.has(e)||(e in o?i.setAttribute(e,o[e]):i.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{t==null?e in o?i.setAttribute(e,o[e]):i.removeAttribute(e):i.setAttribute(e,t)}),u=a,!0}}}},addInputRules(){return[kE({find:UM,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),GM=YO.create({name:`taskList`,addOptions(){return{itemTypeName:`taskItem`,HTMLAttributes:{}}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return[`ul`,jT(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode(`taskList`,{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
157
- `):``,markdownTokenizer:{name:`taskList`,level:`block`,start(e){let t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return t===void 0?-1:t},tokenize(e,t,n){let r=e=>{let t=WE(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);return t?[{type:`taskList`,raw:t.raw,items:t.items}]:n.blockTokens(e)},i=WE(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:`taskList`,raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),W.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(CM.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(wM.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(IM.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(HM.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(WM.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(GM.configure(this.options.taskList)),e}})})),qM,JM,YM,XM=d((()=>{QO(),qM=`&nbsp;`,JM=`\xA0`,YM=YO.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,jT(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1&&n[0].type===`image`)return t.parseChildren([n[0]]);let r=t.parseInline(n);return n.length===1&&n[0].type===`text`&&(n[0].raw===qM||n[0].text===qM||n[0].raw===JM||n[0].text===JM)&&r.length===1&&r[0].type===`text`&&(r[0].text===qM||r[0].text===JM)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return``;let r=Array.isArray(e.content)?e.content:[];if(r.length===0){let e=Array.isArray(n?.previousNode?.content)?n.previousNode.content:[];return n?.previousNode?.type===`paragraph`&&e.length===0?qM:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}})})),ZM,QM,$M,eN=d((()=>{QO(),ZM=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,QM=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,$M=xO.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,jT(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[TE({find:ZM,type:this.type})]},addPasteRules(){return[YE({find:QM,type:this.type})]}})})),tN,nN=d((()=>{QO(),tN=YO.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``})})),rN=p({Underline:()=>iN,default:()=>aN}),iN,aN,oN=d((()=>{QO(),iN=xO.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,jT(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),aN=iN}));function sN(e={}){return new oy({view(t){return new cN(t,e)}})}var cN,lN=d((()=>{ly(),Lv(),cN=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=$_(this.editorView.state.doc,e,this.editorView.dragging.slice);t!=null&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}})),uN=d((()=>{lN()}));function dN(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function fN(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||dN(e.type))return!0;if(e.inlineContent)return!1}}return!0}function pN(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||dN(e.type))return!0;if(e.inlineContent)return!1}}return!0}function mN(){return new oy({props:{decorations:vN,createSelectionBetween(e,t,n){return t.pos==n.pos&&yN.valid(n)?new yN(n):null},handleClick:gN,handleKeyDown:xN,handleDOMEvents:{beforeinput:_N}}})}function hN(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof B){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=yN.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new yN(c))),!0):!1}}function gN(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!yN.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&V.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new yN(r))),!0)}function _N(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof yN))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=L.empty;for(let e=r.length-1;e>=0;e--)i=L.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new R(i,0,0));return a.setSelection(B.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function vN(e){if(!(e.selection instanceof yN))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,vw.create(e.doc,[hw.widget(e.selection.head,t,{key:`gapcursor`})])}var yN,bN,xN,SN=d((()=>{Gw(),ly(),C_(),kw(),yN=class e extends z{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):z.near(r)}content(){return R.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new bN(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!fN(e)||!pN(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}else if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!V.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}},yN.prototype.visible=!1,yN.findFrom=yN.findGapCursorFrom,z.jsonID(`gapcursor`,yN),bN=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return yN.valid(t)?new yN(t):z.near(t)}},xN=Hw({ArrowLeft:hN(`horiz`,-1),ArrowRight:hN(`horiz`,1),ArrowUp:hN(`vert`,-1),ArrowDown:hN(`vert`,1)})})),CN=d((()=>{SN()})),wN,TN,EN,DN,ON=d((()=>{wN=200,TN=function(){},TN.prototype.append=function(e){return e.length?(e=TN.from(e),!this.length&&e||e.length<wN&&this.leafAppend(e)||this.length<wN&&e.leafPrepend(this)||this.appendInner(e)):this},TN.prototype.prepend=function(e){return e.length?TN.from(e).append(this):this},TN.prototype.appendInner=function(e){return new DN(this,e)},TN.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?TN.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},TN.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},TN.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},TN.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},TN.from=function(e){return e instanceof TN?e:e&&e.length?new EN(e):TN.empty},EN=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=wN)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=wN)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(TN),TN.empty=new EN([]),DN=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(TN)}));function kN(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}function AN(e,t,n,r){let i=n.getMeta(GN),a;if(i)return i.historyState;n.getMeta(KN)&&(e=new VN(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(GN))return o.getMeta(GN).redo?new VN(e.done.addTransform(n,void 0,r,FN(t)),e.undone,MN(n.mapping.maps),e.prevTime,e.prevComposition):new VN(e.done,e.undone.addTransform(n,void 0,r,FN(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!jN(n,e.prevRanges)),s=o?NN(e.prevRanges,n.mapping):MN(n.mapping.maps);return new VN(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,FN(t)),zN.empty,s,n.time,i??e.prevComposition)}else if(a=n.getMeta(`rebased`))return new VN(e.done.rebased(n,a),e.undone.rebased(n,a),NN(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new VN(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),NN(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function jN(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function MN(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function NN(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function PN(e,t,n){let r=FN(t),i=GN.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new VN(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(GN,{redo:n,historyState:c})}function FN(e){let t=e.plugins;if(WN!=t){UN=!1,WN=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){UN=!0;break}}return UN}function IN(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new oy({key:GN,state:{init(){return new VN(zN.empty,zN.empty,null,0,-1)},apply(t,n,r){return AN(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?qN:n==`historyRedo`?JN:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function LN(e,t){return(n,r)=>{let i=GN.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=PN(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var RN,zN,BN,VN,HN,UN,WN,GN,KN,qN,JN,YN=d((()=>{ON(),Lv(),ly(),RN=500,zN=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new BN(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new BN(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new BN(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>HN&&(s=kN(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new Sv;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new BN(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new BN(i,o,l))}else r.push(new BN(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new BN(a.maps[e]));let u=new e(this.items.slice(0,i).append(l).append(r),s);return u.emptyItemCount()>RN&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new BN(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(TN.from(i.reverse()),a)}},zN.empty=new zN(TN.empty,0),BN=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},VN=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},HN=20,UN=!1,WN=null,GN=new cy(`history`),KN=new cy(`closeHistory`),qN=LN(!1,!0),JN=LN(!0,!0)})),XN=d((()=>{YN()}));function ZN(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}function QN({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var $N,eP,tP,nP,rP,iP=d((()=>{QO(),Yy(),uN(),Aw(),CN(),XN(),W.create({name:`characterCount`,addOptions(){return{limit:null,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new oy({key:new cy(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit;if(i==null||i===0){e=!0;return}let a=this.storage.characters({node:r.doc});if(a>i){let t=a-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}}),$N=W.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[sN(this.options)]}}),W.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new oy({key:new cy(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return vw.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(hw.node(t,t+e.nodeSize,{class:this.options.className}))}),vw.create(e,a)}}})]}}),eP=W.create({name:`gapCursor`,addProseMirrorPlugins(){return[mN()]},extendNodeSchema(e){return{allowGapCursor:U(H(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),tP=`placeholder`,W.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:tP,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){let e=this.options.dataAttribute?`data-${ZN(this.options.dataAttribute)}`:`data-${tP}`;return[new oy({key:new cy(`placeholder`),props:{decorations:({doc:t,selection:n})=>{let r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,a=[];if(!r)return null;let o=this.editor.isEmpty;return t.descendants((t,n)=>{let r=i>=n&&i<=n+t.nodeSize,s=!t.isLeaf&&sE(t);if(!t.type.isTextblock)return this.options.includeChildren;if((r||!this.options.showOnlyCurrent)&&s){let i=[this.options.emptyNodeClass];o&&i.push(this.options.emptyEditorClass);let s=hw.node(n,n+t.nodeSize,{class:i.join(` `),[e]:typeof this.options.placeholder==`function`?this.options.placeholder({editor:this.editor,node:t,pos:n,hasAnchor:r}):this.options.placeholder});a.push(s)}return this.options.includeChildren}),vw.create(t,a)}}})]}}),W.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new oy({key:new cy(`selection`),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||cE(n.selection)||e.view.dragging?null:vw.create(n.doc,[hw.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}}),nP=W.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new cy(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new oy({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(!n.some(e=>e.getMeta(`skipTrailingNode`))&&c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!QN({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!QN({node:r,types:n})}}})]}}),rP=W.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>qN(e,t),redo:()=>({state:e,dispatch:t})=>JN(e,t)}},addProseMirrorPlugins(){return[IN(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}})})),aP=p({StarterKit:()=>oP,default:()=>sP}),oP,sP,cP=d((()=>{QO(),bk(),Ek(),Ak(),Fk(),Lk(),zk(),Vk(),Uk(),Yk(),mM(),KM(),XM(),eN(),nN(),oN(),iP(),oP=W.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(Tk.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(yk.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(CM.configure(this.options.bulletList)),this.options.code!==!1&&e.push(kk.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(Pk.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(Ik.configure(this.options.document)),this.options.dropcursor!==!1&&e.push($N.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(eP.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(Rk.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(Bk.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(rP.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(Hk.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(Jk.configure(this.options.italic)),this.options.listItem!==!1&&e.push(wM.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(IM.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(fM.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(HM.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(YM.configure(this.options.paragraph)),this.options.strike!==!1&&e.push($M.configure(this.options.strike)),this.options.text!==!1&&e.push(tN.configure(this.options.text)),this.options.underline!==!1&&e.push(iN.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(nP.configure(this.options?.trailingNode)),e}}),sP=oP})),lP=p({Subscript:()=>uP,default:()=>dP}),uP,dP,fP=d((()=>{QO(),uP=xO.create({name:`subscript`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`sub`},{style:`vertical-align`,getAttrs(e){return e===`sub`?null:!1}}]},renderHTML({HTMLAttributes:e}){return[`sub`,jT(this.options.HTMLAttributes,e),0]},addCommands(){return{setSubscript:()=>({commands:e})=>e.setMark(this.name),toggleSubscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSubscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),dP=uP})),pP=p({Superscript:()=>mP,default:()=>hP}),mP,hP,gP=d((()=>{QO(),mP=xO.create({name:`superscript`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`sup`},{style:`vertical-align`,getAttrs(e){return e===`super`?null:!1}}]},renderHTML({HTMLAttributes:e}){return[`sup`,jT(this.options.HTMLAttributes,e),0]},addCommands(){return{setSuperscript:()=>({commands:e})=>e.setMark(this.name),toggleSuperscript:()=>({commands:e})=>e.toggleMark(this.name),unsetSuperscript:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),hP=mP})),_P=p({TextAlign:()=>vP,default:()=>yP}),vP,yP,bP=d((()=>{QO(),vP=W.create({name:`textAlign`,addOptions(){return{types:[],alignments:[`left`,`center`,`right`,`justify`],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{let t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>this.options.alignments.includes(e)?this.options.types.map(n=>t.updateAttributes(n,{textAlign:e})).some(e=>e):!1,unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,`textAlign`)).some(e=>e),toggleTextAlign:e=>({editor:t,commands:n})=>this.options.alignments.includes(e)?t.isActive({textAlign:e})?n.unsetTextAlign():n.setTextAlign(e):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign(`left`),"Mod-Shift-e":()=>this.editor.commands.setTextAlign(`center`),"Mod-Shift-r":()=>this.editor.commands.setTextAlign(`right`),"Mod-Shift-j":()=>this.editor.commands.setTextAlign(`justify`)}}}),yP=vP})),xP=p({BackgroundColor:()=>EP,Color:()=>DP,FontFamily:()=>OP,FontSize:()=>kP,LineHeight:()=>AP,TextStyle:()=>TP,TextStyleKit:()=>jP}),SP,CP,wP,TP,EP,DP,OP,kP,AP,jP,MP=d((()=>{QO(),SP=20,CP=(e,t=0)=>{let n=[];return!e.children.length||t>SP||Array.from(e.children).forEach(e=>{e.tagName===`SPAN`?n.push(e):e.children.length&&n.push(...CP(e,t+1))}),n},wP=e=>{if(!e.children.length)return;let t=CP(e);t&&t.forEach(e=>{let t=e.getAttribute(`style`),n=(e.parentElement?.closest(`span`))?.getAttribute(`style`);e.setAttribute(`style`,`${n};${t}`)})},TP=xO.create({name:`textStyle`,priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!0}},parseHTML(){return[{tag:`span`,consuming:!1,getAttrs:e=>e.hasAttribute(`style`)?(this.options.mergeNestedSpanStyles&&wP(e),{}):!1}]},renderHTML({HTMLAttributes:e}){return[`span`,jT(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleTextStyle:e=>({commands:t})=>t.toggleMark(this.name,e),removeEmptyTextStyle:()=>({tr:e})=>{let{selection:t}=e;return e.doc.nodesBetween(t.from,t.to,(t,n)=>{if(t.isTextblock)return!0;t.marks.filter(e=>e.type===this.type).some(e=>Object.values(e.attrs).some(e=>!!e))||e.removeMark(n,n+t.nodeSize,this.type)}),!0}}}}),EP=W.create({name:`backgroundColor`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:e=>{let t=e.getAttribute(`style`);if(t){let e=t.split(`;`).map(e=>e.trim()).filter(Boolean);for(let t=e.length-1;t>=0;--t){let n=e[t].split(`:`);if(n.length>=2){let e=n[0].trim().toLowerCase(),t=n.slice(1).join(`:`).trim();if(e===`background-color`)return t.replace(/['"]+/g,``)}}}return e.style.backgroundColor?.replace(/['"]+/g,``)},renderHTML:e=>e.backgroundColor?{style:`background-color: ${e.backgroundColor}`}:{}}}}]},addCommands(){return{setBackgroundColor:e=>({chain:t})=>t().setMark(`textStyle`,{backgroundColor:e}).run(),unsetBackgroundColor:()=>({chain:e})=>e().setMark(`textStyle`,{backgroundColor:null}).removeEmptyTextStyle().run()}}}),DP=W.create({name:`color`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>{let t=e.getAttribute(`style`);if(t){let e=t.split(`;`).map(e=>e.trim()).filter(Boolean);for(let t=e.length-1;t>=0;--t){let n=e[t].split(`:`);if(n.length>=2){let e=n[0].trim().toLowerCase(),t=n.slice(1).join(`:`).trim();if(e===`color`)return t.replace(/['"]+/g,``)}}}return e.style.color?.replace(/['"]+/g,``)},renderHTML:e=>e.color?{style:`color: ${e.color}`}:{}}}}]},addCommands(){return{setColor:e=>({chain:t})=>t().setMark(`textStyle`,{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark(`textStyle`,{color:null}).removeEmptyTextStyle().run()}}}),OP=W.create({name:`fontFamily`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:e=>e.style.fontFamily,renderHTML:e=>e.fontFamily?{style:`font-family: ${e.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:e=>({chain:t})=>t().setMark(`textStyle`,{fontFamily:e}).run(),unsetFontFamily:()=>({chain:e})=>e().setMark(`textStyle`,{fontFamily:null}).removeEmptyTextStyle().run()}}}),kP=W.create({name:`fontSize`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:e=>e.style.fontSize,renderHTML:e=>e.fontSize?{style:`font-size: ${e.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:e=>({chain:t})=>t().setMark(`textStyle`,{fontSize:e}).run(),unsetFontSize:()=>({chain:e})=>e().setMark(`textStyle`,{fontSize:null}).removeEmptyTextStyle().run()}}}),AP=W.create({name:`lineHeight`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:e=>e.style.lineHeight,renderHTML:e=>e.lineHeight?{style:`line-height: ${e.lineHeight}`}:{}}}}]},addCommands(){return{setLineHeight:e=>({chain:t})=>t().setMark(`textStyle`,{lineHeight:e}).run(),unsetLineHeight:()=>({chain:e})=>e().setMark(`textStyle`,{lineHeight:null}).removeEmptyTextStyle().run()}}}),jP=W.create({name:`textStyleKit`,addExtensions(){let e=[];return this.options.backgroundColor!==!1&&e.push(EP.configure(this.options.backgroundColor)),this.options.color!==!1&&e.push(DP.configure(this.options.color)),this.options.fontFamily!==!1&&e.push(OP.configure(this.options.fontFamily)),this.options.fontSize!==!1&&e.push(kP.configure(this.options.fontSize)),this.options.lineHeight!==!1&&e.push(AP.configure(this.options.lineHeight)),this.options.textStyle!==!1&&e.push(TP.configure(this.options.textStyle)),e}})})),NP=p({Color:()=>DP,default:()=>PP}),PP,FP=d((()=>{MP(),PP=DP})),IP=p({FontFamily:()=>OP,default:()=>LP}),LP,RP=d((()=>{MP(),LP=OP})),zP=p({Highlight:()=>HP,default:()=>UP,inputRegex:()=>BP,pasteRegex:()=>VP}),BP,VP,HP,UP,WP=d((()=>{QO(),BP=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,VP=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,HP=xO.create({name:`highlight`,addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute(`data-color`)||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:`mark`}]},renderHTML({HTMLAttributes:e}){return[`mark`,jT(this.options.HTMLAttributes,e),0]},renderMarkdown:(e,t)=>`==${t.renderChildren(e)}==`,parseMarkdown:(e,t)=>t.applyMark(`highlight`,t.parseInline(e.tokens||[])),markdownTokenizer:{name:`highlight`,level:`inline`,start:e=>e.indexOf(`==`),tokenize(e,t,n){let r=/^(==)([^=]+)(==)/.exec(e);if(r){let e=r[2].trim(),t=n.inlineTokens(e);return{type:`highlight`,raw:r[0],text:e,tokens:t}}}},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[TE({find:BP,type:this.type})]},addPasteRules(){return[YE({find:VP,type:this.type})]}}),UP=HP})),GP,KP=d((()=>{QO(),GP=W.create({name:`fontSize`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:e=>e.style.fontSize?.replace(/['"]+/g,``)||null,renderHTML:e=>e.fontSize?{style:`font-size: ${e.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:e=>({chain:t})=>t().setMark(`textStyle`,{fontSize:e}).run(),unsetFontSize:()=>({chain:e})=>e().setMark(`textStyle`,{fontSize:null}).removeEmptyTextStyle().run()}}})})),qP,JP=d((()=>{QO(),qP=W.create({name:`letterSpacing`,addOptions(){return{types:[`textStyle`]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{letterSpacing:{default:null,parseHTML:e=>e.style.letterSpacing?.replace(/['"]+/g,``)||null,renderHTML:e=>e.letterSpacing?{style:`letter-spacing: ${e.letterSpacing}`}:{}}}}]},addCommands(){return{setLetterSpacing:e=>({chain:t})=>t().setMark(`textStyle`,{letterSpacing:e}).run(),unsetLetterSpacing:()=>({chain:e})=>e().setMark(`textStyle`,{letterSpacing:null}).removeEmptyTextStyle().run()}}})})),YP,XP=d((()=>{QO(),YP=W.create({name:`lineHeight`,addOptions(){return{types:[`paragraph`],defaultLineHeight:`1.5`}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:e=>e.style.lineHeight||null,renderHTML:e=>e.lineHeight?{style:`line-height: ${e.lineHeight}`}:{}}}}]},addCommands(){return{setLineHeight:e=>({commands:t})=>this.options.types.every(n=>t.updateAttributes(n,{lineHeight:e})),unsetLineHeight:()=>({commands:e})=>this.options.types.every(t=>e.resetAttributes(t,`lineHeight`))}}})})),ZP,QP,$P,eF,tF=d((()=>{k(),xp(),mk(),ZP=[`aria-label`,`data-tooltip`,`onKeydown`],QP=[`aria-label`,`onKeydown`],$P=[`aria-label`],eF=(0,t.defineComponent)({__name:`LogicMergeTagNodeView`,props:{node:{},editor:{},getPos:{type:Function},deleteNode:{type:Function},updateAttributes:{type:Function}},setup(e){let n=e,{syntax:i}=bp(),{t:a}=O(),o=(0,t.computed)(()=>(0,r.isLogicMergeTagValue)(n.node.attrs.value,i)),s=(0,t.computed)(()=>(0,r.getLogicMergeTagKeyword)(n.node.attrs.value,i)),c=(0,t.ref)(!1),l=(0,t.ref)(``),u=(0,t.ref)(null),d=!1;function f(){l.value=n.node.attrs.value,d=!1,c.value=!0,(0,t.nextTick)(()=>{u.value?.focus(),u.value?.select()})}function p(){if(d)return;d=!0;let e=l.value.trim();if(!e){c.value=!1;return}e!==n.node.attrs.value&&n.updateAttributes({value:e,keyword:(0,r.isLogicMergeTagValue)(e,i)?(0,r.getLogicMergeTagKeyword)(e,i):``}),c.value=!1}function m(e){e.key===`Enter`?(e.preventDefault(),p()):e.key===`Escape`&&(c.value=!1)}return(n,r)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(ok),{as:`span`,class:(0,t.normalizeClass)(o.value?`tpl-logic-merge-tag-node tpl:group tpl:mx-0.5 tpl:inline-flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[0.8em] tpl:font-bold tpl:tracking-wide tpl:uppercase tpl:select-none`:``),style:(0,t.normalizeStyle)(o.value?`background-color: transparent; border: 1.5px solid color-mix(in srgb, var(--tpl-primary) 50%, transparent); color: var(--tpl-primary);`:``),contenteditable:`false`},{default:(0,t.withCtx)(()=>[c.value?(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{key:0,ref_key:`inputRef`,ref:u,"onUpdate:modelValue":r[0]||=e=>l.value=e,type:`text`,class:`tpl:w-40 tpl:rounded tpl:border-none tpl:bg-transparent tpl:px-0.5 tpl:py-0 tpl:text-[1em] tpl:font-medium tpl:normal-case tpl:outline-none tpl:text-[var(--tpl-primary)]`,onBlur:p,onKeydown:m},null,544)),[[t.vModelText,l.value]]):o.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,role:`button`,tabindex:`0`,"aria-label":(0,t.unref)(a).mergeTag.editValue,class:`tpl-tooltip tpl:cursor-pointer`,"data-tooltip":e.node.attrs.value,onClick:(0,t.withModifiers)(f,[`stop`]),onKeydown:[(0,t.withKeys)((0,t.withModifiers)(f,[`stop`]),[`enter`]),(0,t.withKeys)((0,t.withModifiers)(f,[`prevent`,`stop`]),[`space`])]},(0,t.toDisplayString)(s.value),41,ZP)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:2,role:`button`,tabindex:`0`,"aria-label":(0,t.unref)(a).mergeTag.editValue,onClick:(0,t.withModifiers)(f,[`stop`]),onKeydown:[(0,t.withKeys)((0,t.withModifiers)(f,[`stop`]),[`enter`]),(0,t.withKeys)((0,t.withModifiers)(f,[`prevent`,`stop`]),[`space`])]},(0,t.toDisplayString)(e.node.attrs.value),41,QP)),o.value?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:3,type:`button`,"aria-label":(0,t.unref)(a).mergeTag.deleteMergeTag,class:`tpl-merge-tag-delete tpl:flex tpl:size-5 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-none tpl:bg-transparent tpl:p-0 tpl:opacity-60 tpl:transition-all hover:tpl:opacity-100 tpl:text-[var(--tpl-primary)]`,contenteditable:`false`,onClick:r[1]||=(0,t.withModifiers)((...t)=>e.deleteNode&&e.deleteNode(...t),[`stop`,`prevent`])},[...r[2]||=[(0,t.createElementVNode)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`3`,"aria-hidden":`true`},[(0,t.createElementVNode)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,t.createElementVNode)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]],8,$P)):(0,t.createCommentVNode)(``,!0)]),_:1},8,[`class`,`style`]))}})})),nF,rF=d((()=>{tF(),tF(),nF=eF}));function iF(e,t){let{selection:n}=e.state,{$from:r,$to:i}=n,a=!1;return e.state.doc.nodesBetween(r.pos,i.pos,e=>{if(e.type.name===t)return a=!0,!1}),!!(a||r.pos>0&&r.nodeBefore?.type.name===t||r.nodeAfter?.type.name===t)}var aF=d((()=>{}));function oF(e){return nk(e)}var sF=d((()=>{mk()})),cF,lF=d((()=>{rF(),QO(),aF(),sF(),cF=YO.create({name:`logicMergeTagNode`,group:`inline`,inline:!0,atom:!0,addOptions(){return{syntax:r.SYNTAX_PRESETS.liquid}},addAttributes(){return{value:{default:``,parseHTML:e=>e.getAttribute(`data-logic-merge-tag`)||``},keyword:{default:``,parseHTML:e=>e.getAttribute(`data-keyword`)||e.textContent||``}}},parseHTML(){return[{tag:`span[data-logic-merge-tag]`}]},renderHTML({node:e,HTMLAttributes:t}){if(!(0,r.isLogicMergeTagValue)(e.attrs.value,this.options.syntax))return[`span`,{},e.attrs.value];let n=(0,r.getLogicMergeTagKeyword)(e.attrs.value,this.options.syntax);return[`span`,jT(t,{"data-logic-merge-tag":e.attrs.value,"data-keyword":n}),n]},addNodeView(){return oF(nF)},addKeyboardShortcuts(){return{Backspace:()=>iF(this.editor,this.name),Delete:()=>iF(this.editor,this.name)}},addInputRules(){return[new vO({find:RegExp(this.options.syntax.logic.source+`$`,``),handler:({state:e,range:t,match:n})=>{let i=n[0];if(!(0,r.isLogicMergeTagValue)(i,this.options.syntax))return;let a=(0,r.getLogicMergeTagKeyword)(i,this.options.syntax),o=this.type.create({value:i,keyword:a});e.tr.replaceWith(t.from,t.to,o)}})]},addPasteRules(){return[new SO({find:new RegExp(this.options.syntax.logic.source,`g`),handler:({state:e,range:t,match:n})=>{let i=n[0];if(!(0,r.isLogicMergeTagValue)(i,this.options.syntax))return;let a=(0,r.getLogicMergeTagKeyword)(i,this.options.syntax),o=this.type.create({value:i,keyword:a});e.tr.replaceWith(t.from,t.to,o)}})]}})})),uF,dF,fF,pF=d((()=>{k(),xp(),mk(),uF=[`aria-label`,`data-tooltip`,`onKeydown`],dF=[`aria-label`],fF=(0,t.defineComponent)({__name:`MergeTagNodeView`,props:{node:{},deleteNode:{type:Function},updateAttributes:{type:Function}},setup(e){let n=e,{getMergeTagLabel:r}=bp(),{t:i}=O(),a=(0,t.computed)(()=>r(n.node.attrs.value)),o=(0,t.ref)(!1),s=(0,t.ref)(``),c=(0,t.ref)(null);function l(){s.value=n.node.attrs.value,o.value=!0,(0,t.nextTick)(()=>{c.value?.focus(),c.value?.select()})}function u(){let e=s.value.trim();e&&e!==n.node.attrs.value&&n.updateAttributes({value:e,label:r(e)}),o.value=!1}function d(e){e.key===`Enter`?(e.preventDefault(),u()):e.key===`Escape`&&(o.value=!1)}return(n,r)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(ok),{as:`span`,class:`tpl-merge-tag-node tpl:group tpl:mx-0.5 tpl:inline-flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[0.9em] tpl:font-medium tpl:select-none tpl:text-[var(--tpl-primary)]`,style:{"background-color":`color-mix(in srgb, var(--tpl-primary) 20%, transparent)`},contenteditable:`false`},{default:(0,t.withCtx)(()=>[o.value?(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{key:0,ref_key:`inputRef`,ref:c,"onUpdate:modelValue":r[0]||=e=>s.value=e,type:`text`,class:`tpl:w-32 tpl:rounded tpl:border-none tpl:bg-transparent tpl:px-0.5 tpl:py-0 tpl:text-[1em] tpl:font-medium tpl:outline-none tpl:text-[var(--tpl-primary)]`,onBlur:u,onKeydown:d},null,544)),[[t.vModelText,s.value]]):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,role:`button`,tabindex:`0`,"aria-label":(0,t.unref)(i).mergeTag.editValue,class:`tpl-tooltip tpl:cursor-pointer`,"data-tooltip":e.node.attrs.value,onClick:(0,t.withModifiers)(l,[`stop`]),onKeydown:[(0,t.withKeys)((0,t.withModifiers)(l,[`stop`]),[`enter`]),(0,t.withKeys)((0,t.withModifiers)(l,[`prevent`,`stop`]),[`space`])]},(0,t.toDisplayString)(a.value),41,uF)),(0,t.createElementVNode)(`button`,{type:`button`,"aria-label":(0,t.unref)(i).mergeTag.deleteMergeTag,class:`tpl-merge-tag-delete tpl:flex tpl:size-5 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-none tpl:bg-transparent tpl:p-0 tpl:opacity-60 tpl:transition-all hover:tpl:opacity-100 tpl:text-[var(--tpl-primary)]`,contenteditable:`false`,onClick:r[1]||=(0,t.withModifiers)((...t)=>e.deleteNode&&e.deleteNode(...t),[`stop`,`prevent`])},[...r[2]||=[(0,t.createElementVNode)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`3`,"aria-hidden":`true`},[(0,t.createElementVNode)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,t.createElementVNode)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]],8,dF)]),_:1}))}})})),mF,hF=d((()=>{pF(),pF(),mF=fF})),gF,_F=d((()=>{hF(),QO(),aF(),sF(),gF=YO.create({name:`mergeTagNode`,group:`inline`,inline:!0,atom:!0,addOptions(){return{mergeTags:[],syntax:r.SYNTAX_PRESETS.liquid}},addAttributes(){return{label:{default:``,parseHTML:e=>e.getAttribute(`data-label`)||e.textContent||``},value:{default:``,parseHTML:e=>e.getAttribute(`data-merge-tag`)||``}}},parseHTML(){return[{tag:`span[data-merge-tag]`}]},renderHTML({node:e,HTMLAttributes:t}){let n=(0,r.getMergeTagLabel)(e.attrs.value,this.options.mergeTags);return[`span`,jT(t,{"data-merge-tag":e.attrs.value,"data-label":n}),n]},addNodeView(){return oF(mF)},addCommands(){return{insertMergeTag:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addKeyboardShortcuts(){return{Backspace:()=>iF(this.editor,this.name),Delete:()=>iF(this.editor,this.name)}},addInputRules(){return[new vO({find:RegExp(this.options.syntax.value.source+`$`,``),handler:({state:e,range:t,match:n})=>{let i=n[0],a=(0,r.getMergeTagLabel)(i,this.options.mergeTags),o=this.type.create({label:a,value:i});e.tr.replaceWith(t.from,t.to,o)}})]},addPasteRules(){return[new SO({find:new RegExp(this.options.syntax.value.source,`g`),handler:({state:e,range:t,match:n})=>{let i=n[0],a=(0,r.getMergeTagLabel)(i,this.options.mergeTags),o=this.type.create({label:a,value:i});e.tr.replaceWith(t.from,t.to,o)}})]}})})),vF=p({FontSize:()=>GP,LetterSpacing:()=>qP,LineHeight:()=>YP,LogicMergeTagNode:()=>cF,MergeTagNode:()=>gF}),yF=d((()=>{KP(),JP(),XP(),lF(),_F()})),bF,xF,SF=d((()=>{Lp(),Mh(),Kh(),$h(),bF={class:`tpl-text-editor-wrapper tpl:relative`},xF=(0,t.defineComponent)({__name:`ParagraphEditor`,props:{block:{},toolbarPosition:{}},emits:[`done`],setup(e,{emit:n}){let r=e,i=n,{editor:a,EditorContent:o,isLoading:s,initError:c,retry:l,showLinkDialog:u,linkUrl:d,linkDialogRef:f,mergeTagEnabled:p,openLinkDialog:m,insertLink:h,removeLink:g,closeLinkDialog:_,handleLinkKeydown:v,handleAddMergeTag:y}=Ip({blockId:()=>r.block.id,blockContent:()=>r.block.content,onDone:()=>i(`done`),editorName:`ParagraphEditor`,async loadExtensions({mergeTags:e,syntax:t}){let[{Editor:n,EditorContent:r},{default:i},{default:a},{default:o},{default:s},{default:c},{default:l},{TextStyle:u},{default:d},{default:f},{default:p},{MergeTagNode:m,LogicMergeTagNode:h,FontSize:g,LineHeight:_,LetterSpacing:v}]=await Promise.all([Promise.resolve().then(()=>(mk(),$O)),Promise.resolve().then(()=>(cP(),aP)),Promise.resolve().then(()=>(mM(),tM)),Promise.resolve().then(()=>(oN(),rN)),Promise.resolve().then(()=>(fP(),lP)),Promise.resolve().then(()=>(gP(),pP)),Promise.resolve().then(()=>(bP(),_P)),Promise.resolve().then(()=>(MP(),xP)),Promise.resolve().then(()=>(FP(),NP)),Promise.resolve().then(()=>(RP(),IP)),Promise.resolve().then(()=>(WP(),zP)),Promise.resolve().then(()=>(yF(),vF))]);return{TiptapEditor:n,EC:r,extensions:[i.configure({heading:!1,codeBlock:!1,blockquote:!1,horizontalRule:!1}),o,s,c,a.configure({openOnClick:!1,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`}}),l.configure({types:[`paragraph`]}),u,d,f,p.configure({multicolor:!0}),g,_,v,m.configure({mergeTags:e,syntax:t}),h.configure({syntax:t})]}}});return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,bF,[(0,t.createVNode)(jh,{editor:(0,t.unref)(a),"toolbar-position":e.toolbarPosition,"is-loading":(0,t.unref)(s),"merge-tag-enabled":(0,t.unref)(p),onOpenLinkDialog:(0,t.unref)(m),onAddMergeTag:(0,t.unref)(y)},null,8,[`editor`,`toolbar-position`,`is-loading`,`merge-tag-enabled`,`onOpenLinkDialog`,`onAddMergeTag`]),(0,t.createVNode)(Qh,{editor:(0,t.unref)(a),"editor-content":(0,t.unref)(o),"is-loading":(0,t.unref)(s),"init-error":(0,t.unref)(c),onRetry:(0,t.unref)(l)},null,8,[`editor`,`editor-content`,`is-loading`,`init-error`,`onRetry`]),(0,t.createVNode)(Gh,{visible:(0,t.unref)(u),"is-editing-link":(0,t.unref)(a)?.isActive(`link`)??!1,"dialog-ref":(0,t.unref)(f),"onUpdate:dialogRef":r[0]||=e=>(0,t.isRef)(f)?f.value=e:null,"link-url":(0,t.unref)(d),"onUpdate:linkUrl":r[1]||=e=>(0,t.isRef)(d)?d.value=e:null,onClose:(0,t.unref)(_),onInsert:(0,t.unref)(h),onRemove:(0,t.unref)(g),onKeydown:(0,t.unref)(v)},null,8,[`visible`,`is-editing-link`,`dialog-ref`,`link-url`,`onClose`,`onInsert`,`onRemove`,`onKeydown`])]))}})})),CF=p({default:()=>wF}),wF,TF=d((()=>{SF(),SF(),wF=xF})),EF,DF,OF=d((()=>{Mm(),EF=[`innerHTML`],DF=(0,t.defineComponent)({__name:`ParagraphBlock`,props:{block:{},viewport:{}},setup(e){let n=e,r=(0,t.defineAsyncComponent)(()=>Promise.resolve().then(()=>(TF(),CF))),{isEditing:i,blockRef:a,toolbarPosition:o,resolvedContent:s,handleDoubleClick:c,handleEditorDone:l}=jm(()=>n.block.content);return(n,u)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`blockRef`,ref:a,class:`tpl:min-h-[1em] tpl:w-full`,onDblclick:u[0]||=(...e)=>(0,t.unref)(c)&&(0,t.unref)(c)(...e)},[(0,t.unref)(i)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(r),{key:0,block:e.block,"toolbar-position":(0,t.unref)(o),onDone:(0,t.unref)(l)},null,8,[`block`,`toolbar-position`,`onDone`])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:`tpl-text-content tpl:outline-none [&_a]:tpl:underline [&_li]:tpl:my-1 [&_ol]:tpl:my-2 [&_ol]:tpl:pl-6 [&_p]:tpl:m-0 [&_p]:tpl:mb-2 [&_p:last-child]:tpl:mb-0 [&_s]:tpl:line-through [&_sub]:tpl:align-sub [&_sub]:tpl:text-[0.75em] [&_sup]:tpl:align-super [&_sup]:tpl:text-[0.75em] [&_ul]:tpl:my-2 [&_ul]:tpl:pl-6`,innerHTML:(0,t.unref)(s)},null,8,EF))],544))}})})),kF,AF=d((()=>{OF(),OF(),kF=DF}));function jF(e,t,n){if(t){let n=t.getComponent(e);if(n)return n}return n[e.type]??null}function MF(e){let{padding:t,margin:n,backgroundColor:r}=e.styles;return{padding:`${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`,margin:`${n.top}px ${n.right}px ${n.bottom}px ${n.left}px`,backgroundColor:r||`transparent`}}var NF=d((()=>{})),PF,FF,IF,LF,RF,zF,BF,VF,HF,UF,WF,GF,KF,qF=d((()=>{k(),F(),NF(),D(),PF=[`data-block-id`,`data-block-type`],FF=[`aria-label`],IF=[`aria-label`,`aria-pressed`,`title`],LF=[`aria-label`,`title`],RF=[`aria-label`,`title`],zF=[`aria-label`,`title`],BF={key:1,class:`tpl-block-hidden-overlay tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-[5] tpl:flex tpl:items-center tpl:justify-center tpl:rounded-sm`},VF={class:`tpl:flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-2 tpl:py-1 tpl:text-[10px] tpl:font-medium tpl:bg-[var(--tpl-bg-elevated)] tpl:text-[var(--tpl-text-muted)] tpl:shadow-[var(--tpl-shadow-sm)]`},HF={key:2,class:`tpl:absolute tpl:-left-1 tpl:top-1/2 tpl:z-[5] tpl:-translate-x-full tpl:-translate-y-1/2`},UF=[`aria-label`,`title`],WF={key:3,class:`tpl:absolute tpl:-right-1 tpl:-top-1 tpl:z-[5] tpl:translate-x-full`},GF=[`aria-label`],KF=(0,t.defineComponent)({__name:`BlockWrapper`,props:{block:{},isSelected:{type:Boolean},viewport:{},previewMode:{type:Boolean}},emits:[`select`],setup(e,{emit:n}){let r=e,i=n,{t:a,format:o}=O(),s=(0,t.inject)(Je,null),c=(0,t.ref)(null),l=(0,t.computed)(()=>s?.liftedBlockId.value===r.block.id),u=(0,t.computed)(()=>l.value?o(a.blockActions.dragLifted,{block:r.block.type}):a.blockActions.drag);async function d(){await(0,t.nextTick)(),c.value?.focus()}function f(e){if(s){if(e.key===` `||e.key===`Enter`){e.preventDefault(),e.stopPropagation(),l.value?s.drop(r.block.id):s.lift(r.block.id);return}if(l.value){if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),s.cancel(),d();return}if(e.key===`ArrowUp`){e.preventDefault(),e.stopPropagation(),s.moveUp(r.block.id),d();return}e.key===`ArrowDown`&&(e.preventDefault(),e.stopPropagation(),s.moveDown(r.block.id),d())}}}let p=(0,t.computed)(()=>!r.viewport||!r.block.visibility?!1:r.block.visibility[r.viewport]===!1),m=(0,t.computed)(()=>r.viewport?{desktop:a.viewport.desktop,tablet:a.viewport.tablet,mobile:a.viewport.mobile}[r.viewport]??r.viewport:``),h=(0,t.computed)(()=>!!r.block.displayCondition),g=(0,t.inject)(Ne,null),_=(0,t.inject)(Pe,null),v=(0,t.inject)(qe,{}),y=(0,t.computed)(()=>!!v.savedModules),b=(0,t.computed)(()=>v.comments?.getBlockCount(r.block.id)??0),x=(0,t.computed)(()=>MF(r.block));function S(e){r.previewMode||(e.stopPropagation(),i(`select`))}function C(){g?.deleteBlock(r.block.id)}function ee(){g?.duplicateBlock(r.block)}function w(){v.savedModules?.openSaveDialog(r.block.id)}function T(){_?.toggleBlock(r.block.id)}return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`tpl-block tpl:group tpl:relative tpl:cursor-pointer tpl:rounded-sm tpl:transition-shadow tpl:duration-150`,{"tpl-block--selected":e.isSelected,"tpl-block--idle":!e.isSelected,"tpl-block--lifted":l.value}]),style:(0,t.normalizeStyle)(x.value),"data-block-id":e.block.id,"data-block-type":e.block.type,draggable:`false`,onClick:S},[e.isSelected?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,role:`toolbar`,"aria-label":(0,t.unref)(a).blockActions.drag,class:`tpl-block-actions tpl-fade-in tpl:absolute tpl:-right-2 tpl:top-1/2 tpl:z-10 tpl:flex tpl:-translate-y-1/2 tpl:translate-x-full tpl:gap-0.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1 tpl:bg-[var(--tpl-bg-elevated)] tpl:shadow-[var(--tpl-shadow-md)] tpl:border tpl:border-[var(--tpl-border)]`},[(0,t.createElementVNode)(`button`,{ref_key:`dragButtonRef`,ref:c,class:`tpl-block-btn tpl-block-action-btn tpl:flex tpl:size-7 tpl:cursor-grab tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors tpl:duration-150 tpl:active:cursor-grabbing`,"aria-label":u.value,"aria-pressed":l.value,"aria-keyshortcuts":`Space Enter ArrowUp ArrowDown Escape`,title:(0,t.unref)(a).blockActions.drag,onKeydown:f},[(0,t.createVNode)((0,t.unref)(wl),{size:14,"stroke-width":1.5})],40,IF),(0,t.createElementVNode)(`button`,{class:`tpl-block-action-btn tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors tpl:duration-150`,"aria-label":(0,t.unref)(a).blockActions.duplicate,title:(0,t.unref)(a).blockActions.duplicate,onClick:(0,t.withModifiers)(ee,[`stop`])},[(0,t.createVNode)((0,t.unref)(ol),{size:14,"stroke-width":1.5})],8,LF),y.value?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,class:`tpl-block-action-btn tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors tpl:duration-150`,"aria-label":(0,t.unref)(a).blockActions.saveAsModule,title:(0,t.unref)(a).blockActions.saveAsModule,onClick:(0,t.withModifiers)(w,[`stop`])},[(0,t.createVNode)((0,t.unref)(xc),{size:14,"stroke-width":1.5})],8,RF)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`button`,{class:`tpl-block-action-btn tpl-block-delete-btn tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors tpl:duration-150`,"aria-label":(0,t.unref)(a).blockActions.delete,title:(0,t.unref)(a).blockActions.delete,onClick:(0,t.withModifiers)(C,[`stop`])},[(0,t.createVNode)((0,t.unref)(Of),{size:14,"stroke-width":1.5})],8,zF)],8,FF)):(0,t.createCommentVNode)(``,!0),p.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,BF,[(0,t.createElementVNode)(`span`,VF,[(0,t.createVNode)((0,t.unref)(ll),{size:12,"stroke-width":1.5}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(o)((0,t.unref)(a).blockActions.hiddenOnViewport,{viewport:m.value})),1)])])):(0,t.createCommentVNode)(``,!0),h.value&&!p.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,HF,[(0,t.createElementVNode)(`button`,{class:`tpl-condition-toggle tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:p-1 tpl:transition-colors tpl:duration-150 tpl:bg-[var(--tpl-bg-elevated)] tpl:text-[var(--tpl-primary)] tpl:border tpl:border-[var(--tpl-border)]`,"aria-label":(0,t.unref)(a).blockActions.conditionToggle,title:e.block.displayCondition?.label,onClick:(0,t.withModifiers)(T,[`stop`])},[(0,t.createVNode)((0,t.unref)(xl),{size:12,"stroke-width":2})],8,UF)])):(0,t.createCommentVNode)(``,!0),b.value>0&&!p.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,WF,[(0,t.createElementVNode)(`button`,{class:`tpl-comment-indicator tpl:flex tpl:min-h-6 tpl:min-w-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-0.5 tpl:rounded-full tpl:border-none tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-semibold tpl:transition-colors tpl:duration-150 tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary)]`,"aria-label":(0,t.unref)(o)((0,t.unref)(a).blockActions.comments,{count:String(b.value)}),onClick:r[0]||=(0,t.withModifiers)(n=>(0,t.unref)(v).comments?.openForBlock(e.block.id),[`stop`])},[(0,t.createVNode)((0,t.unref)(lu),{size:12,"stroke-width":2.5}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(b.value),1)],8,GF)])):(0,t.createCommentVNode)(``,!0),(0,t.renderSlot)(n.$slots,`default`,{},void 0,!0)],14,PF))}})})),JF=d((()=>{})),YF,XF=d((()=>{qF(),qF(),JF(),dp(),YF=up(KF,[[`__scopeId`,`data-v-8d0416c4`]])})),ZF,QF,$F,eI,tI,nI,rI,iI,aI,oI=d((()=>{Rp(),Lp(),F(),D(),Kh(),$h(),ZF={class:`tpl-text-editor-wrapper tpl:relative`},QF=[`data-tpl-theme`,`aria-label`],$F=[`aria-label`,`title`],eI=[`aria-label`,`title`],tI=[`aria-label`,`title`],nI={key:0,class:`tpl:mx-1.5 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]`},rI=[`aria-label`,`title`],iI={key:1,class:`tpl:flex tpl:items-center tpl:gap-2 tpl:px-2 tpl:text-xs tpl:text-[var(--tpl-text-dim)]`},aI=(0,t.defineComponent)({__name:`TitleEditor`,props:{block:{},toolbarPosition:{}},emits:[`done`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.inject)(Ie,null),o=(0,t.inject)(Le,null),{t:s}=O(),{editor:c,EditorContent:l,isLoading:u,initError:d,retry:f,showLinkDialog:p,linkUrl:m,linkDialogRef:h,mergeTagEnabled:g,openLinkDialog:_,insertLink:v,removeLink:y,closeLinkDialog:b,handleLinkKeydown:x,handleAddMergeTag:S}=Ip({blockId:()=>r.block.id,blockContent:()=>r.block.content,onDone:()=>i(`done`),editorName:`TitleEditor`,async loadExtensions({mergeTags:e,syntax:t}){let[{Editor:n,EditorContent:r},{default:i},{default:a},{MergeTagNode:o,LogicMergeTagNode:s}]=await Promise.all([Promise.resolve().then(()=>(mk(),$O)),Promise.resolve().then(()=>(cP(),aP)),Promise.resolve().then(()=>(mM(),tM)),Promise.resolve().then(()=>(yF(),vF))]);return{TiptapEditor:n,EC:r,extensions:[i.configure({heading:!1,codeBlock:!1,blockquote:!1,horizontalRule:!1,bulletList:!1,orderedList:!1,listItem:!1,strike:!1}),a.configure({openOnClick:!1,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`}}),o.configure({mergeTags:e,syntax:t}),s.configure({syntax:t})]}}});return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ZF,[((0,t.openBlock)(),(0,t.createBlock)(t.Teleport,{to:`body`},[(0,t.createElementVNode)(`div`,{"data-tpl-theme":(0,t.unref)(o),role:`toolbar`,"aria-label":(0,t.unref)(s).titleEditor.toolbar,class:`tpl tpl-text-toolbar tpl:fixed tpl:z-popover tpl:flex tpl:items-center tpl:gap-1 tpl:rounded-lg tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 tpl:shadow-lg`,style:(0,t.normalizeStyle)({...(0,t.unref)(a),top:`${e.toolbarPosition.top}px`,left:`${e.toolbarPosition.left}px`,transform:`translateY(-100%)`})},[!(0,t.unref)(u)&&(0,t.unref)(c)?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`tpl-text-toolbar-btn`,{"tpl-text-toolbar-btn--active":(0,t.unref)(c)?.isActive(`bold`)}]),"aria-label":(0,t.unref)(s).titleEditor.bold,title:(0,t.unref)(s).titleEditor.bold,onClick:r[0]||=e=>(0,t.unref)(c)?.chain().focus().toggleBold().run()},[(0,t.createVNode)((0,t.unref)(vc),{size:16,"stroke-width":2.5})],10,$F),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`tpl-text-toolbar-btn`,{"tpl-text-toolbar-btn--active":(0,t.unref)(c)?.isActive(`italic`)}]),"aria-label":(0,t.unref)(s).titleEditor.italic,title:(0,t.unref)(s).titleEditor.italic,onClick:r[1]||=e=>(0,t.unref)(c)?.chain().focus().toggleItalic().run()},[(0,t.createVNode)((0,t.unref)(zl),{size:16,"stroke-width":2})],10,eI),r[6]||=(0,t.createElementVNode)(`span`,{class:`tpl:mx-1.5 tpl:h-6 tpl:w-px tpl:bg-[var(--tpl-border)]`,"aria-hidden":`true`},null,-1),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`tpl-text-toolbar-btn`,{"tpl-text-toolbar-btn--active":(0,t.unref)(c)?.isActive(`link`)}]),"aria-label":(0,t.unref)(s).titleEditor.addLink,title:(0,t.unref)(s).titleEditor.addLink,onClick:r[2]||=(...e)=>(0,t.unref)(_)&&(0,t.unref)(_)(...e)},[(0,t.createVNode)((0,t.unref)(Gl),{size:16,"stroke-width":2})],10,tI),(0,t.unref)(g)?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,nI)):(0,t.createCommentVNode)(``,!0),(0,t.unref)(g)?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:1,type:`button`,class:`tpl:flex tpl:h-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded tpl:border-none tpl:bg-transparent tpl:px-2.5 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)]`,"aria-label":(0,t.unref)(s).mergeTag.add,title:(0,t.unref)(s).mergeTag.add,onClick:r[3]||=(...e)=>(0,t.unref)(S)&&(0,t.unref)(S)(...e)},[(0,t.createVNode)((0,t.unref)(hd),{size:16,"stroke-width":2}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(s).mergeTag.add),1)],8,rI)):(0,t.createCommentVNode)(``,!0)],64)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,iI,[(0,t.createVNode)((0,t.unref)(eu),{class:`tpl-spinner`,size:14,"stroke-width":2}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(s).errors.editorLoading),1)]))],12,QF)])),(0,t.createVNode)(Qh,{editor:(0,t.unref)(c),"editor-content":(0,t.unref)(l),"is-loading":(0,t.unref)(u),"init-error":(0,t.unref)(d),onRetry:(0,t.unref)(f)},null,8,[`editor`,`editor-content`,`is-loading`,`init-error`,`onRetry`]),(0,t.createVNode)(Gh,{visible:(0,t.unref)(p),"is-editing-link":(0,t.unref)(c)?.isActive(`link`)??!1,"dialog-ref":(0,t.unref)(h),"onUpdate:dialogRef":r[4]||=e=>(0,t.isRef)(h)?h.value=e:null,"link-url":(0,t.unref)(m),"onUpdate:linkUrl":r[5]||=e=>(0,t.isRef)(m)?m.value=e:null,onClose:(0,t.unref)(b),onInsert:(0,t.unref)(v),onRemove:(0,t.unref)(y),onKeydown:(0,t.unref)(x)},null,8,[`visible`,`is-editing-link`,`dialog-ref`,`link-url`,`onClose`,`onInsert`,`onRemove`,`onKeydown`])]))}})})),sI=p({default:()=>cI}),cI,lI=d((()=>{oI(),oI(),cI=aI})),uI,dI,fI=d((()=>{Mm(),uI=[`innerHTML`],dI=(0,t.defineComponent)({__name:`TitleBlock`,props:{block:{},viewport:{}},setup(e){let n=e,i=(0,t.defineAsyncComponent)(()=>Promise.resolve().then(()=>(lI(),sI))),{isEditing:a,blockRef:o,toolbarPosition:s,resolvedContent:c,handleDoubleClick:l,handleEditorDone:u}=jm(()=>n.block.content),d=(0,t.computed)(()=>{let e={fontSize:`${r.HEADING_LEVEL_FONT_SIZE[n.block.level]}px`,color:n.block.color,textAlign:n.block.textAlign};return n.block.fontFamily&&(e.fontFamily=n.block.fontFamily),e});return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`blockRef`,ref:o,class:`tpl:min-h-[1em] tpl:w-full`,style:(0,t.normalizeStyle)(d.value),onDblclick:r[0]||=(...e)=>(0,t.unref)(l)&&(0,t.unref)(l)(...e)},[(0,t.unref)(a)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(i),{key:0,block:e.block,"toolbar-position":(0,t.unref)(s),onDone:(0,t.unref)(u)},null,8,[`block`,`toolbar-position`,`onDone`])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:`tpl-text-content tpl:outline-none [&_a]:tpl:underline [&_p]:tpl:m-0 [&_p]:tpl:mb-2 [&_p:last-child]:tpl:mb-0`,innerHTML:(0,t.unref)(c)},null,8,uI))],36))}})})),pI,mI=d((()=>{fI(),fI(),pI=dI})),hI=p({MultiDrag:()=>CL,Sortable:()=>X,Swap:()=>xL,default:()=>X});function gI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _I(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?gI(Object(n),!0).forEach(function(t){yI(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function vI(e){"@babel/helpers - typeof";return vI=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},vI(e)}function yI(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bI(){return bI=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bI.apply(this,arguments)}function xI(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function SI(e,t){if(e==null)return{};var n=xI(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function CI(e){return wI(e)||TI(e)||EI(e)||OI()}function wI(e){if(Array.isArray(e))return DI(e)}function TI(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function EI(e,t){if(e){if(typeof e==`string`)return DI(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return DI(e,t)}}function DI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function OI(){throw TypeError(`Invalid attempt to spread non-iterable instance.
158
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kI(e){if(typeof window<`u`&&window.navigator)return!!navigator.userAgent.match(e)}function q(e,t,n){e.addEventListener(t,n,!OL&&PL)}function J(e,t,n){e.removeEventListener(t,n,!OL&&PL)}function AI(e,t){if(t){if(t[0]===`>`&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function jI(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function MI(e,t,n,r){if(e){n||=document;do{if(t!=null&&(t[0]===`>`?e.parentNode===n&&AI(e,t):AI(e,t))||r&&e===n)return e;if(e===n)break}while(e=jI(e))}return null}function NI(e,t,n){e&&t&&(e.classList?e.classList[n?`add`:`remove`](t):e.className=((` `+e.className+` `).replace(FL,` `).replace(` `+t+` `,` `)+(n?` `+t:``)).replace(FL,` `))}function Y(e,t,n){var r=e&&e.style;if(r){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,``):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in r)&&t.indexOf(`webkit`)===-1&&(t=`-webkit-`+t),r[t]=n+(typeof n==`string`?``:`px`)}}function PI(e,t){var n=``;if(typeof e==`string`)n=e;else do{var r=Y(e,`transform`);r&&r!==`none`&&(n=r+` `+n)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function FI(e,t,n){if(e){var r=e.getElementsByTagName(t),i=0,a=r.length;if(n)for(;i<a;i++)n(r[i],i);return r}return[]}function II(){return document.scrollingElement||document.documentElement}function LI(e,t,n,r,i){if(!(!e.getBoundingClientRect&&e!==window)){var a,o,s,c,l,u,d;if(e!==window&&e.parentNode&&e!==II()?(a=e.getBoundingClientRect(),o=a.top,s=a.left,c=a.bottom,l=a.right,u=a.height,d=a.width):(o=0,s=0,c=window.innerHeight,l=window.innerWidth,u=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(i||=e.parentNode,!OL))do if(i&&i.getBoundingClientRect&&(Y(i,`transform`)!==`none`||n&&Y(i,`position`)!==`static`)){var f=i.getBoundingClientRect();o-=f.top+parseInt(Y(i,`border-top-width`)),s-=f.left+parseInt(Y(i,`border-left-width`)),c=o+a.height,l=s+a.width;break}while(i=i.parentNode);if(r&&e!==window){var p=PI(i||e),m=p&&p.a,h=p&&p.d;p&&(o/=h,s/=m,d/=m,u/=h,c=o+u,l=s+d)}return{top:o,left:s,bottom:c,right:l,width:d,height:u}}}function RI(e,t,n){for(var r=WI(e,!0),i=LI(e)[t];r;){var a=LI(r)[n],o=void 0;if(o=n===`top`||n===`left`?i>=a:i<=a,!o)return r;if(r===II())break;r=WI(r,!1)}return!1}function zI(e,t,n,r){for(var i=0,a=0,o=e.children;a<o.length;){if(o[a].style.display!==`none`&&o[a]!==X.ghost&&(r||o[a]!==X.dragged)&&MI(o[a],n.draggable,e,!1)){if(i===t)return o[a];i++}a++}return null}function BI(e,t){for(var n=e.lastElementChild;n&&(n===X.ghost||Y(n,`display`)===`none`||t&&!AI(n,t));)n=n.previousElementSibling;return n||null}function VI(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!==`TEMPLATE`&&e!==X.clone&&(!t||AI(e,t))&&n++;return n}function HI(e){var t=0,n=0,r=II();if(e)do{var i=PI(e),a=i.a,o=i.d;t+=e.scrollLeft*a,n+=e.scrollTop*o}while(e!==r&&(e=e.parentNode));return[t,n]}function UI(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var r in t)if(t.hasOwnProperty(r)&&t[r]===e[n][r])return Number(n)}return-1}function WI(e,t){if(!e||!e.getBoundingClientRect)return II();var n=e,r=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=Y(n);if(n.clientWidth<n.scrollWidth&&(i.overflowX==`auto`||i.overflowX==`scroll`)||n.clientHeight<n.scrollHeight&&(i.overflowY==`auto`||i.overflowY==`scroll`)){if(!n.getBoundingClientRect||n===document.body)return II();if(r||t)return n;r=!0}}while(n=n.parentNode);return II()}function GI(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function KI(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}function qI(e,t){return function(){if(!IL){var n=arguments,r=this;n.length===1?e.call(r,n[0]):e.apply(r,n),IL=setTimeout(function(){IL=void 0},t)}}}function JI(){clearTimeout(IL),IL=void 0}function YI(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function XI(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}function ZI(e,t){Y(e,`position`,`absolute`),Y(e,`top`,t.top),Y(e,`left`,t.left),Y(e,`width`,t.width),Y(e,`height`,t.height)}function QI(e){Y(e,`position`,``),Y(e,`top`,``),Y(e,`left`,``),Y(e,`width`,``),Y(e,`height`,``)}function $I(){var e=[],t;return{captureAnimationState:function(){e=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(t){if(!(Y(t,`display`)===`none`||t===X.ghost)){e.push({target:t,rect:LI(t)});var n=_I({},e[e.length-1].rect);if(t.thisAnimationDuration){var r=PI(t,!0);r&&(n.top-=r.f,n.left-=r.e)}t.fromRect=n}})},addAnimationState:function(t){e.push(t)},removeAnimationState:function(t){e.splice(UI(e,{target:t}),1)},animateAll:function(n){var r=this;if(!this.options.animation){clearTimeout(t),typeof n==`function`&&n();return}var i=!1,a=0;e.forEach(function(e){var t=0,n=e.target,o=n.fromRect,s=LI(n),c=n.prevFromRect,l=n.prevToRect,u=e.rect,d=PI(n,!0);d&&(s.top-=d.f,s.left-=d.e),n.toRect=s,n.thisAnimationDuration&&KI(c,s)&&!KI(o,s)&&(u.top-s.top)/(u.left-s.left)===(o.top-s.top)/(o.left-s.left)&&(t=tL(u,c,l,r.options)),KI(s,o)||(n.prevFromRect=o,n.prevToRect=s,t||=r.options.animation,r.animate(n,u,s,t)),t&&(i=!0,a=Math.max(a,t),clearTimeout(n.animationResetTimer),n.animationResetTimer=setTimeout(function(){n.animationTime=0,n.prevFromRect=null,n.fromRect=null,n.prevToRect=null,n.thisAnimationDuration=null},t),n.thisAnimationDuration=t)}),clearTimeout(t),i?t=setTimeout(function(){typeof n==`function`&&n()},a):typeof n==`function`&&n(),e=[]},animate:function(e,t,n,r){if(r){Y(e,`transition`,``),Y(e,`transform`,``);var i=PI(this.el),a=i&&i.a,o=i&&i.d,s=(t.left-n.left)/(a||1),c=(t.top-n.top)/(o||1);e.animatingX=!!s,e.animatingY=!!c,Y(e,`transform`,`translate3d(`+s+`px,`+c+`px,0)`),this.forRepaintDummy=eL(e),Y(e,`transition`,`transform `+r+`ms`+(this.options.easing?` `+this.options.easing:``)),Y(e,`transform`,`translate3d(0,0,0)`),typeof e.animated==`number`&&clearTimeout(e.animated),e.animated=setTimeout(function(){Y(e,`transition`,``),Y(e,`transform`,``),e.animated=!1,e.animatingX=!1,e.animatingY=!1},r)}}}}function eL(e){return e.offsetWidth}function tL(e,t,n,r){return Math.sqrt((t.top-e.top)**2+(t.left-e.left)**2)/Math.sqrt((t.top-n.top)**2+(t.left-n.left)**2)*r.animation}function nL(e){var t=e.sortable,n=e.rootEl,r=e.name,i=e.targetEl,a=e.cloneEl,o=e.toEl,s=e.fromEl,c=e.oldIndex,l=e.newIndex,u=e.oldDraggableIndex,d=e.newDraggableIndex,f=e.originalEvent,p=e.putSortable,m=e.extraEventProperties;if(t||=n&&n[LL],t){var h,g=t.options,_=`on`+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!OL&&!kL?h=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(h=document.createEvent(`Event`),h.initEvent(r,!0,!0)),h.to=o||n,h.from=s||n,h.item=i||n,h.clone=a,h.oldIndex=c,h.newIndex=l,h.oldDraggableIndex=u,h.newDraggableIndex=d,h.originalEvent=f,h.pullMode=p?p.lastPutMode:void 0;var v=_I(_I({},m),BL.getEventProperties(r,t));for(var y in v)h[y]=v[y];n&&n.dispatchEvent(h),g[_]&&g[_].call(t,h)}}function rL(e){nL(_I({putSortable:eR,cloneEl:qL,targetEl:Z,rootEl:WL,oldIndex:YL,oldDraggableIndex:ZL,newIndex:XL,newDraggableIndex:QL},e))}function X(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw`Sortable: \`el\` must be an HTMLElement, not ${{}.toString.call(e)}`;this.el=e,this.options=t=bI({},t),e[LL]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?`>li`:`>*`,swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return TR(e,this.options)},ghostClass:`sortable-ghost`,chosenClass:`sortable-chosen`,dragClass:`sortable-drag`,ignore:`a, img`,filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData(`Text`,t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:`data-id`,delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:`sortable-fallback`,fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:X.supportPointer!==!1&&`PointerEvent`in window&&!jL,emptyInsertThreshold:5};for(var r in BL.initializePlugins(this,e,n),n)!(r in t)&&(t[r]=n[r]);for(var i in OR(t),this)i.charAt(0)===`_`&&typeof this[i]==`function`&&(this[i]=this[i].bind(this));this.nativeDraggable=t.forceFallback?!1:CR,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?q(e,`pointerdown`,this._onTapStart):(q(e,`mousedown`,this._onTapStart),q(e,`touchstart`,this._onTapStart)),this.nativeDraggable&&(q(e,`dragover`,this),q(e,`dragenter`,this)),rR.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),bI(this,$I())}function iL(e){e.dataTransfer&&(e.dataTransfer.dropEffect=`move`),e.cancelable&&e.preventDefault()}function aL(e,t,n,r,i,a,o,s){var c,l=e[LL],u=l.options.onMove,d;return window.CustomEvent&&!OL&&!kL?c=new CustomEvent(`move`,{bubbles:!0,cancelable:!0}):(c=document.createEvent(`Event`),c.initEvent(`move`,!0,!0)),c.to=t,c.from=e,c.dragged=n,c.draggedRect=r,c.related=i||t,c.relatedRect=a||LI(t),c.willInsertAfter=s,c.originalEvent=o,e.dispatchEvent(c),u&&(d=u.call(l,c,o)),d}function oL(e){e.draggable=!1}function sL(){vR=!1}function cL(e,t,n){var r=LI(zI(n.el,0,n.options,!0)),i=10;return t?e.clientX<r.left-i||e.clientY<r.top&&e.clientX<r.right:e.clientY<r.top-i||e.clientY<r.bottom&&e.clientX<r.left}function lL(e,t,n){var r=LI(BI(n.el,n.options.draggable)),i=10;return t?e.clientX>r.right+i||e.clientX<=r.right&&e.clientY>r.bottom&&e.clientX>=r.left:e.clientX>r.right&&e.clientY>r.top||e.clientX<=r.right&&e.clientY>r.bottom+i}function uL(e,t,n,r,i,a,o,s){var c=r?e.clientY:e.clientX,l=r?n.height:n.width,u=r?n.top:n.left,d=r?n.bottom:n.right,f=!1;if(!o){if(s&&hR<l*i){if(!pR&&(fR===1?c>u+l*a/2:c<d-l*a/2)&&(pR=!0),pR)f=!0;else if(fR===1?c<u+hR:c>d-hR)return-fR}else if(c>u+l*(1-i)/2&&c<d-l*(1-i)/2)return dL(t)}return f||=o,f&&(c<u+l*a/2||c>d-l*a/2)?c>u+l/2?1:-1:0}function dL(e){return VI(Z)<VI(e)?1:-1}function fL(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,r=0;n--;)r+=t.charCodeAt(n);return r.toString(36)}function pL(e){yR.length=0;for(var t=e.getElementsByTagName(`input`),n=t.length;n--;){var r=t[n];r.checked&&yR.push(r)}}function mL(e){return setTimeout(e,0)}function hL(e){return clearTimeout(e)}function gL(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)e.charAt(0)===`_`&&typeof this[e]==`function`&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?q(document,`dragover`,this._handleAutoScroll):this.options.supportPointer?q(document,`pointermove`,this._handleFallbackAutoScroll):t.touches?q(document,`touchmove`,this._handleFallbackAutoScroll):q(document,`mousemove`,this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;!this.options.dragOverBubble&&!t.rootEl&&this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?J(document,`dragover`,this._handleAutoScroll):(J(document,`pointermove`,this._handleFallbackAutoScroll),J(document,`touchmove`,this._handleFallbackAutoScroll),J(document,`mousemove`,this._handleFallbackAutoScroll)),vL(),_L(),JI()},nulling:function(){zR=FR=PR=IR=BR=LR=RR=null,NR.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var n=this,r=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,a=document.elementFromPoint(r,i);if(zR=e,t||this.options.forceAutoScrollFallback||kL||OL||jL){VR(e,this.options,a,t);var o=WI(a,!0);IR&&(!BR||r!==LR||i!==RR)&&(BR&&vL(),BR=setInterval(function(){var a=WI(document.elementFromPoint(r,i),!0);a!==o&&(o=a,_L()),VR(e,n.options,a,t)},10),LR=r,RR=i)}else{if(!this.options.bubbleScroll||WI(a,!0)===II()){_L();return}VR(e,this.options,WI(a,!1),!1)}}},bI(e,{pluginName:`scroll`,initializeByDefault:!0})}function _L(){NR.forEach(function(e){clearInterval(e.pid)}),NR=[]}function vL(){clearInterval(BR)}function yL(){}function bL(){}function xL(){function e(){this.defaults={swapClass:`sortable-swap-highlight`}}return e.prototype={dragStart:function(e){UR=e.dragEl},dragOverValid:function(e){var t=e.completed,n=e.target,r=e.onMove,i=e.activeSortable,a=e.changed,o=e.cancel;if(i.options.swap){var s=this.sortable.el,c=this.options;if(n&&n!==s){var l=UR;r(n)===!1?UR=null:(NI(n,c.swapClass,!0),UR=n),l&&l!==UR&&NI(l,c.swapClass,!1)}a(),t(!0),o()}},drop:function(e){var t=e.activeSortable,n=e.putSortable,r=e.dragEl,i=n||this.sortable,a=this.options;UR&&NI(UR,a.swapClass,!1),UR&&(a.swap||n&&n.options.swap)&&r!==UR&&(i.captureAnimationState(),i!==t&&t.captureAnimationState(),SL(r,UR),i.animateAll(),i!==t&&t.animateAll())},nulling:function(){UR=null}},bI(e,{pluginName:`swap`,eventProperties:function(){return{swapItem:UR}}})}function SL(e,t){var n=e.parentNode,r=t.parentNode,i,a;!n||!r||n.isEqualNode(t)||r.isEqualNode(e)||(i=VI(e),a=VI(t),n.isEqualNode(r)&&i<a&&a++,n.insertBefore(t,n.children[i]),r.insertBefore(e,r.children[a]))}function CL(){function e(e){for(var t in this)t.charAt(0)===`_`&&typeof this[t]==`function`&&(this[t]=this[t].bind(this));e.options.supportPointer?q(document,`pointerup`,this._deselectMultiDrag):(q(document,`mouseup`,this._deselectMultiDrag),q(document,`touchend`,this._deselectMultiDrag)),q(document,`keydown`,this._checkKeyDown),q(document,`keyup`,this._checkKeyUp),this.defaults={selectedClass:`sortable-selected`,multiDragKey:null,setData:function(t,n){var r=``;$.length&&KR===e?$.forEach(function(e,t){r+=(t?`, `:``)+e.textContent}):r=n.textContent,t.setData(`Text`,r)}}}return e.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal:function(e){XR=e.dragEl},delayEnded:function(){this.isMultiDrag=~$.indexOf(XR)},setupClone:function(e){var t=e.sortable,n=e.cancel;if(this.isMultiDrag){for(var r=0;r<$.length;r++)WR.push(XI($[r])),WR[r].sortableIndex=$[r].sortableIndex,WR[r].draggable=!1,WR[r].style[`will-change`]=``,NI(WR[r],this.options.selectedClass,!1),$[r]===XR&&NI(WR[r],this.options.chosenClass,!1);t._hideClone(),n()}},clone:function(e){var t=e.sortable,n=e.rootEl,r=e.dispatchSortableEvent,i=e.cancel;this.isMultiDrag&&(this.options.removeCloneOnHide||$.length&&KR===t&&(TL(!0,n),r(`clone`),i()))},showClone:function(e){var t=e.cloneNowShown,n=e.rootEl,r=e.cancel;this.isMultiDrag&&(TL(!1,n),WR.forEach(function(e){Y(e,`display`,``)}),t(),QR=!1,r())},hideClone:function(e){var t=this;e.sortable;var n=e.cloneNowHidden,r=e.cancel;this.isMultiDrag&&(WR.forEach(function(e){Y(e,`display`,`none`),t.options.removeCloneOnHide&&e.parentNode&&e.parentNode.removeChild(e)}),n(),QR=!0,r())},dragStartGlobal:function(e){e.sortable,!this.isMultiDrag&&KR&&KR.multiDrag._deselectMultiDrag(),$.forEach(function(e){e.sortableIndex=VI(e)}),$=$.sort(function(e,t){return e.sortableIndex-t.sortableIndex}),YR=!0},dragStarted:function(e){var t=this,n=e.sortable;if(this.isMultiDrag){if(this.options.sort&&(n.captureAnimationState(),this.options.animation)){$.forEach(function(e){e!==XR&&Y(e,`position`,`absolute`)});var r=LI(XR,!1,!0,!0);$.forEach(function(e){e!==XR&&ZI(e,r)}),JR=!0,qR=!0}n.animateAll(function(){JR=!1,qR=!1,t.options.animation&&$.forEach(function(e){QI(e)}),t.options.sort&&EL()})}},dragOver:function(e){var t=e.target,n=e.completed,r=e.cancel;JR&&~$.indexOf(t)&&(n(!1),r())},revert:function(e){var t=e.fromSortable,n=e.rootEl,r=e.sortable,i=e.dragRect;$.length>1&&($.forEach(function(e){r.addAnimationState({target:e,rect:JR?LI(e):i}),QI(e),e.fromRect=i,t.removeAnimationState(e)}),JR=!1,wL(!this.options.removeCloneOnHide,n))},dragOverCompleted:function(e){var t=e.sortable,n=e.isOwner,r=e.insertion,i=e.activeSortable,a=e.parentEl,o=e.putSortable,s=this.options;if(r){if(n&&i._hideClone(),qR=!1,s.animation&&$.length>1&&(JR||!n&&!i.options.sort&&!o)){var c=LI(XR,!1,!0,!0);$.forEach(function(e){e!==XR&&(ZI(e,c),a.appendChild(e))}),JR=!0}if(!n)if(JR||EL(),$.length>1){var l=QR;i._showClone(t),i.options.animation&&!QR&&l&&WR.forEach(function(e){i.addAnimationState({target:e,rect:ZR}),e.fromRect=ZR,e.thisAnimationDuration=null})}else i._showClone(t)}},dragOverAnimationCapture:function(e){var t=e.dragRect,n=e.isOwner,r=e.activeSortable;if($.forEach(function(e){e.thisAnimationDuration=null}),r.options.animation&&!n&&r.multiDrag.isMultiDrag){ZR=bI({},t);var i=PI(XR,!0);ZR.top-=i.f,ZR.left-=i.e}},dragOverAnimationComplete:function(){JR&&(JR=!1,EL())},drop:function(e){var t=e.originalEvent,n=e.rootEl,r=e.parentEl,i=e.sortable,a=e.dispatchSortableEvent,o=e.oldIndex,s=e.putSortable,c=s||this.sortable;if(t){var l=this.options,u=r.children;if(!YR)if(l.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),NI(XR,l.selectedClass,!~$.indexOf(XR)),~$.indexOf(XR))$.splice($.indexOf(XR),1),GR=null,nL({sortable:i,rootEl:n,name:`deselect`,targetEl:XR,originalEvt:t});else{if($.push(XR),nL({sortable:i,rootEl:n,name:`select`,targetEl:XR,originalEvt:t}),t.shiftKey&&GR&&i.el.contains(GR)){var d=VI(GR),f=VI(XR);if(~d&&~f&&d!==f){var p,m;for(f>d?(m=d,p=f):(m=f,p=d+1);m<p;m++)~$.indexOf(u[m])||(NI(u[m],l.selectedClass,!0),$.push(u[m]),nL({sortable:i,rootEl:n,name:`select`,targetEl:u[m],originalEvt:t}))}}else GR=XR;KR=c}if(YR&&this.isMultiDrag){if(JR=!1,(r[LL].options.sort||r!==n)&&$.length>1){var h=LI(XR),g=VI(XR,`:not(.`+this.options.selectedClass+`)`);if(!qR&&l.animation&&(XR.thisAnimationDuration=null),c.captureAnimationState(),!qR&&(l.animation&&(XR.fromRect=h,$.forEach(function(e){if(e.thisAnimationDuration=null,e!==XR){var t=JR?LI(e):h;e.fromRect=t,c.addAnimationState({target:e,rect:t})}})),EL(),$.forEach(function(e){u[g]?r.insertBefore(e,u[g]):r.appendChild(e),g++}),o===VI(XR))){var _=!1;$.forEach(function(e){if(e.sortableIndex!==VI(e)){_=!0;return}}),_&&a(`update`)}$.forEach(function(e){QI(e)}),c.animateAll()}KR=c}(n===r||s&&s.lastPutMode!==`clone`)&&WR.forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)})}},nullingGlobal:function(){this.isMultiDrag=YR=!1,WR.length=0},destroyGlobal:function(){this._deselectMultiDrag(),J(document,`pointerup`,this._deselectMultiDrag),J(document,`mouseup`,this._deselectMultiDrag),J(document,`touchend`,this._deselectMultiDrag),J(document,`keydown`,this._checkKeyDown),J(document,`keyup`,this._checkKeyUp)},_deselectMultiDrag:function(e){if(!(YR!==void 0&&YR)&&KR===this.sortable&&!(e&&MI(e.target,this.options.draggable,this.sortable.el,!1))&&!(e&&e.button!==0))for(;$.length;){var t=$[0];NI(t,this.options.selectedClass,!1),$.shift(),nL({sortable:this.sortable,rootEl:this.sortable.el,name:`deselect`,targetEl:t,originalEvt:e})}},_checkKeyDown:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},bI(e,{pluginName:`multiDrag`,utils:{select:function(e){var t=e.parentNode[LL];!t||!t.options.multiDrag||~$.indexOf(e)||(KR&&KR!==t&&(KR.multiDrag._deselectMultiDrag(),KR=t),NI(e,t.options.selectedClass,!0),$.push(e))},deselect:function(e){var t=e.parentNode[LL],n=$.indexOf(e);!t||!t.options.multiDrag||!~n||(NI(e,t.options.selectedClass,!1),$.splice(n,1))}},eventProperties:function(){var e=this,t=[],n=[];return $.forEach(function(r){t.push({multiDragElement:r,index:r.sortableIndex});var i=JR&&r!==XR?-1:JR?VI(r,`:not(.`+e.options.selectedClass+`)`):VI(r);n.push({multiDragElement:r,index:i})}),{items:CI($),clones:[].concat(WR),oldIndicies:t,newIndicies:n}},optionListeners:{multiDragKey:function(e){return e=e.toLowerCase(),e===`ctrl`?e=`Control`:e.length>1&&(e=e.charAt(0).toUpperCase()+e.substr(1)),e}}})}function wL(e,t){$.forEach(function(n,r){var i=t.children[n.sortableIndex+(e?Number(r):0)];i?t.insertBefore(n,i):t.appendChild(n)})}function TL(e,t){WR.forEach(function(n,r){var i=t.children[n.sortableIndex+(e?Number(r):0)];i?t.insertBefore(n,i):t.appendChild(n)})}function EL(){$.forEach(function(e){e!==XR&&e.parentNode&&e.parentNode.removeChild(e)})}var DL,OL,kL,AL,jL,ML,NL,PL,FL,IL,LL,RL,zL,BL,VL,HL,Z,UL,Q,WL,GL,KL,qL,JL,YL,XL,ZL,QL,$L,eR,tR,nR,rR,iR,aR,oR,sR,cR,lR,uR,dR,fR,pR,mR,hR,gR,_R,vR,yR,bR,xR,SR,CR,wR,TR,ER,DR,OR,kR,AR,jR,MR,NR,PR,FR,IR,LR,RR,zR,BR,VR,HR,UR,$,WR,GR,KR,qR,JR,YR,XR,ZR,QR,$R=d((()=>{DL=`1.14.0`,OL=kI(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),kL=kI(/Edge/i),AL=kI(/firefox/i),jL=kI(/safari/i)&&!kI(/chrome/i)&&!kI(/android/i),ML=kI(/iP(ad|od|hone)/i),NL=kI(/chrome/i)&&kI(/android/i),PL={capture:!1,passive:!1},FL=/\s+/g,LL=`Sortable`+new Date().getTime(),RL=[],zL={initializeByDefault:!0},BL={mount:function(e){for(var t in zL)zL.hasOwnProperty(t)&&!(t in e)&&(e[t]=zL[t]);RL.forEach(function(t){if(t.pluginName===e.pluginName)throw`Sortable: Cannot mount plugin ${e.pluginName} more than once`}),RL.push(e)},pluginEvent:function(e,t,n){var r=this;this.eventCanceled=!1,n.cancel=function(){r.eventCanceled=!0};var i=e+`Global`;RL.forEach(function(r){t[r.pluginName]&&(t[r.pluginName][i]&&t[r.pluginName][i](_I({sortable:t},n)),t.options[r.pluginName]&&t[r.pluginName][e]&&t[r.pluginName][e](_I({sortable:t},n)))})},initializePlugins:function(e,t,n,r){for(var i in RL.forEach(function(r){var i=r.pluginName;if(!(!e.options[i]&&!r.initializeByDefault)){var a=new r(e,t,e.options);a.sortable=e,a.options=e.options,e[i]=a,bI(n,a.defaults)}}),e.options)if(e.options.hasOwnProperty(i)){var a=this.modifyOption(e,i,e.options[i]);a!==void 0&&(e.options[i]=a)}},getEventProperties:function(e,t){var n={};return RL.forEach(function(r){typeof r.eventProperties==`function`&&bI(n,r.eventProperties.call(t[r.pluginName],e))}),n},modifyOption:function(e,t,n){var r;return RL.forEach(function(i){e[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[t]==`function`&&(r=i.optionListeners[t].call(e[i.pluginName],n))}),r}},VL=[`evt`],HL=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.evt,i=SI(n,VL);BL.pluginEvent.bind(X)(e,t,_I({dragEl:Z,parentEl:UL,ghostEl:Q,rootEl:WL,nextEl:GL,lastDownEl:KL,cloneEl:qL,cloneHidden:JL,dragStarted:uR,putSortable:eR,activeSortable:X.active,originalEvent:r,oldIndex:YL,oldDraggableIndex:ZL,newIndex:XL,newDraggableIndex:QL,hideGhostForTarget:kR,unhideGhostForTarget:AR,cloneNowHidden:function(){JL=!0},cloneNowShown:function(){JL=!1},dispatchSortableEvent:function(e){rL({sortable:t,name:e,originalEvent:r})}},i))},tR=!1,nR=!1,rR=[],pR=!1,mR=!1,_R=[],vR=!1,yR=[],bR=typeof document<`u`,xR=ML,SR=kL||OL?`cssFloat`:`float`,CR=bR&&!NL&&!ML&&`draggable`in document.createElement(`div`),wR=function(){if(bR){if(OL)return!1;var e=document.createElement(`x`);return e.style.cssText=`pointer-events:auto`,e.style.pointerEvents===`auto`}}(),TR=function(e,t){var n=Y(e),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=zI(e,0,t),a=zI(e,1,t),o=i&&Y(i),s=a&&Y(a),c=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+LI(i).width,l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+LI(a).width;if(n.display===`flex`)return n.flexDirection===`column`||n.flexDirection===`column-reverse`?`vertical`:`horizontal`;if(n.display===`grid`)return n.gridTemplateColumns.split(` `).length<=1?`vertical`:`horizontal`;if(i&&o.float&&o.float!==`none`){var u=o.float===`left`?`left`:`right`;return a&&(s.clear===`both`||s.clear===u)?`vertical`:`horizontal`}return i&&(o.display===`block`||o.display===`flex`||o.display===`table`||o.display===`grid`||c>=r&&n[SR]===`none`||a&&n[SR]===`none`&&c+l>r)?`vertical`:`horizontal`},ER=function(e,t,n){var r=n?e.left:e.top,i=n?e.right:e.bottom,a=n?e.width:e.height,o=n?t.left:t.top,s=n?t.right:t.bottom,c=n?t.width:t.height;return r===o||i===s||r+a/2===o+c/2},DR=function(e,t){var n;return rR.some(function(r){var i=r[LL].options.emptyInsertThreshold;if(!(!i||BI(r))){var a=LI(r),o=e>=a.left-i&&e<=a.right+i,s=t>=a.top-i&&t<=a.bottom+i;if(o&&s)return n=r}}),n},OR=function(e){function t(e,n){return function(r,i,a,o){var s=r.options.group.name&&i.options.group.name&&r.options.group.name===i.options.group.name;if(e==null&&(n||s))return!0;if(e==null||e===!1)return!1;if(n&&e===`clone`)return e;if(typeof e==`function`)return t(e(r,i,a,o),n)(r,i,a,o);var c=(n?r:i).options.group.name;return e===!0||typeof e==`string`&&e===c||e.join&&e.indexOf(c)>-1}}var n={},r=e.group;(!r||vI(r)!=`object`)&&(r={name:r}),n.name=r.name,n.checkPull=t(r.pull,!0),n.checkPut=t(r.put),n.revertClone=r.revertClone,e.group=n},kR=function(){!wR&&Q&&Y(Q,`display`,`none`)},AR=function(){!wR&&Q&&Y(Q,`display`,``)},bR&&document.addEventListener(`click`,function(e){if(nR)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),nR=!1,!1},!0),jR=function(e){if(Z){e=e.touches?e.touches[0]:e;var t=DR(e.clientX,e.clientY);if(t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[LL]._onDragOver(n)}}},MR=function(e){Z&&Z.parentNode[LL]._isOutsideThisEl(e.target)},X.prototype={constructor:X,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(dR=null)},_getDirection:function(e,t){return typeof this.options.direction==`function`?this.options.direction.call(this,e,t,Z):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,r=this.options,i=r.preventOnFilter,a=e.type,o=e.touches&&e.touches[0]||e.pointerType&&e.pointerType===`touch`&&e,s=(o||e).target,c=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,l=r.filter;if(pL(n),!Z&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||r.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&jL&&s&&s.tagName.toUpperCase()===`SELECT`)&&(s=MI(s,r.draggable,n,!1),!(s&&s.animated)&&KL!==s)){if(YL=VI(s),ZL=VI(s,r.draggable),typeof l==`function`){if(l.call(this,e,s,this)){rL({sortable:t,rootEl:c,name:`filter`,targetEl:s,toEl:n,fromEl:n}),HL(`filter`,t,{evt:e}),i&&e.cancelable&&e.preventDefault();return}}else if(l&&(l=l.split(`,`).some(function(r){if(r=MI(c,r.trim(),n,!1),r)return rL({sortable:t,rootEl:r,name:`filter`,targetEl:s,fromEl:n,toEl:n}),HL(`filter`,t,{evt:e}),!0}),l)){i&&e.cancelable&&e.preventDefault();return}r.handle&&!MI(c,r.handle,n,!1)||this._prepareDragStart(e,o,s)}}},_prepareDragStart:function(e,t,n){var r=this,i=r.el,a=r.options,o=i.ownerDocument,s;if(n&&!Z&&n.parentNode===i){var c=LI(n);if(WL=i,Z=n,UL=Z.parentNode,GL=Z.nextSibling,KL=n,$L=a.group,X.dragged=Z,iR={target:Z,clientX:(t||e).clientX,clientY:(t||e).clientY},cR=iR.clientX-c.left,lR=iR.clientY-c.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,Z.style[`will-change`]=`all`,s=function(){if(HL(`delayEnded`,r,{evt:e}),X.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!AL&&r.nativeDraggable&&(Z.draggable=!0),r._triggerDragStart(e,t),rL({sortable:r,name:`choose`,originalEvent:e}),NI(Z,a.chosenClass,!0)},a.ignore.split(`,`).forEach(function(e){FI(Z,e.trim(),oL)}),q(o,`dragover`,jR),q(o,`mousemove`,jR),q(o,`touchmove`,jR),q(o,`mouseup`,r._onDrop),q(o,`touchend`,r._onDrop),q(o,`touchcancel`,r._onDrop),AL&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Z.draggable=!0),HL(`delayStart`,this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(kL||OL))){if(X.eventCanceled){this._onDrop();return}q(o,`mouseup`,r._disableDelayedDrag),q(o,`touchend`,r._disableDelayedDrag),q(o,`touchcancel`,r._disableDelayedDrag),q(o,`mousemove`,r._delayedDragTouchMoveHandler),q(o,`touchmove`,r._delayedDragTouchMoveHandler),a.supportPointer&&q(o,`pointermove`,r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(s,a.delay)}else s()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Z&&oL(Z),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;J(e,`mouseup`,this._disableDelayedDrag),J(e,`touchend`,this._disableDelayedDrag),J(e,`touchcancel`,this._disableDelayedDrag),J(e,`mousemove`,this._delayedDragTouchMoveHandler),J(e,`touchmove`,this._delayedDragTouchMoveHandler),J(e,`pointermove`,this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t||=e.pointerType==`touch`&&e,!this.nativeDraggable||t?this.options.supportPointer?q(document,`pointermove`,this._onTouchMove):t?q(document,`touchmove`,this._onTouchMove):q(document,`mousemove`,this._onTouchMove):(q(Z,`dragend`,this),q(WL,`dragstart`,this._onDragStart));try{document.selection?mL(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(tR=!1,WL&&Z){HL(`dragStarted`,this,{evt:t}),this.nativeDraggable&&q(document,`dragover`,MR);var n=this.options;!e&&NI(Z,n.dragClass,!1),NI(Z,n.ghostClass,!0),X.active=this,e&&this._appendGhost(),rL({sortable:this,name:`start`,originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(aR){this._lastX=aR.clientX,this._lastY=aR.clientY,kR();for(var e=document.elementFromPoint(aR.clientX,aR.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(aR.clientX,aR.clientY),e!==t);)t=e;if(Z.parentNode[LL]._isOutsideThisEl(e),t)do{if(t[LL]){var n=void 0;if(n=t[LL]._onDragOver({clientX:aR.clientX,clientY:aR.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);AR()}},_onTouchMove:function(e){if(iR){var t=this.options,n=t.fallbackTolerance,r=t.fallbackOffset,i=e.touches?e.touches[0]:e,a=Q&&PI(Q,!0),o=Q&&a&&a.a,s=Q&&a&&a.d,c=xR&&gR&&HI(gR),l=(i.clientX-iR.clientX+r.x)/(o||1)+(c?c[0]-_R[0]:0)/(o||1),u=(i.clientY-iR.clientY+r.y)/(s||1)+(c?c[1]-_R[1]:0)/(s||1);if(!X.active&&!tR){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(Q){a?(a.e+=l-(oR||0),a.f+=u-(sR||0)):a={a:1,b:0,c:0,d:1,e:l,f:u};var d=`matrix(${a.a},${a.b},${a.c},${a.d},${a.e},${a.f})`;Y(Q,`webkitTransform`,d),Y(Q,`mozTransform`,d),Y(Q,`msTransform`,d),Y(Q,`transform`,d),oR=l,sR=u,aR=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!Q){var e=this.options.fallbackOnBody?document.body:WL,t=LI(Z,!0,xR,!0,e),n=this.options;if(xR){for(gR=e;Y(gR,`position`)===`static`&&Y(gR,`transform`)===`none`&&gR!==document;)gR=gR.parentNode;gR!==document.body&&gR!==document.documentElement?(gR===document&&(gR=II()),t.top+=gR.scrollTop,t.left+=gR.scrollLeft):gR=II(),_R=HI(gR)}Q=Z.cloneNode(!0),NI(Q,n.ghostClass,!1),NI(Q,n.fallbackClass,!0),NI(Q,n.dragClass,!0),Y(Q,`transition`,``),Y(Q,`transform`,``),Y(Q,`box-sizing`,`border-box`),Y(Q,`margin`,0),Y(Q,`top`,t.top),Y(Q,`left`,t.left),Y(Q,`width`,t.width),Y(Q,`height`,t.height),Y(Q,`opacity`,`0.8`),Y(Q,`position`,xR?`absolute`:`fixed`),Y(Q,`zIndex`,`100000`),Y(Q,`pointerEvents`,`none`),X.ghost=Q,e.appendChild(Q),Y(Q,`transform-origin`,cR/parseInt(Q.style.width)*100+`% `+lR/parseInt(Q.style.height)*100+`%`)}},_onDragStart:function(e,t){var n=this,r=e.dataTransfer,i=n.options;if(HL(`dragStart`,this,{evt:e}),X.eventCanceled){this._onDrop();return}HL(`setupClone`,this),X.eventCanceled||(qL=XI(Z),qL.draggable=!1,qL.style[`will-change`]=``,this._hideClone(),NI(qL,this.options.chosenClass,!1),X.clone=qL),n.cloneId=mL(function(){HL(`clone`,n),!X.eventCanceled&&(n.options.removeCloneOnHide||WL.insertBefore(qL,Z),n._hideClone(),rL({sortable:n,name:`clone`}))}),!t&&NI(Z,i.dragClass,!0),t?(nR=!0,n._loopId=setInterval(n._emulateDragOver,50)):(J(document,`mouseup`,n._onDrop),J(document,`touchend`,n._onDrop),J(document,`touchcancel`,n._onDrop),r&&(r.effectAllowed=`move`,i.setData&&i.setData.call(n,r,Z)),q(document,`drop`,n),Y(Z,`transform`,`translateZ(0)`)),tR=!0,n._dragStartId=mL(n._dragStarted.bind(n,t,e)),q(document,`selectstart`,n),uR=!0,jL&&Y(document.body,`user-select`,`none`)},_onDragOver:function(e){var t=this.el,n=e.target,r,i,a,o=this.options,s=o.group,c=X.active,l=$L===s,u=o.sort,d=eR||c,f,p=this,m=!1;if(vR)return;function h(o,s){HL(o,p,_I({evt:e,isOwner:l,axis:f?`vertical`:`horizontal`,revert:a,dragRect:r,targetRect:i,canSort:u,fromSortable:d,target:n,completed:_,onMove:function(n,i){return aL(WL,t,Z,r,n,LI(n),e,i)},changed:v},s))}function g(){h(`dragOverAnimationCapture`),p.captureAnimationState(),p!==d&&d.captureAnimationState()}function _(r){return h(`dragOverCompleted`,{insertion:r}),r&&(l?c._hideClone():c._showClone(p),p!==d&&(NI(Z,eR?eR.options.ghostClass:c.options.ghostClass,!1),NI(Z,o.ghostClass,!0)),eR!==p&&p!==X.active?eR=p:p===X.active&&eR&&(eR=null),d===p&&(p._ignoreWhileAnimating=n),p.animateAll(function(){h(`dragOverAnimationComplete`),p._ignoreWhileAnimating=null}),p!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(n===Z&&!Z.animated||n===t&&!n.animated)&&(dR=null),!o.dragoverBubble&&!e.rootEl&&n!==document&&(Z.parentNode[LL]._isOutsideThisEl(e.target),!r&&jR(e)),!o.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),m=!0}function v(){XL=VI(Z),QL=VI(Z,o.draggable),rL({sortable:p,name:`change`,toEl:t,newIndex:XL,newDraggableIndex:QL,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),n=MI(n,o.draggable,t,!0),h(`dragOver`),X.eventCanceled)return m;if(Z.contains(e.target)||n.animated&&n.animatingX&&n.animatingY||p._ignoreWhileAnimating===n)return _(!1);if(nR=!1,c&&!o.disabled&&(l?u||(a=UL!==WL):eR===this||(this.lastPutMode=$L.checkPull(this,c,Z,e))&&s.checkPut(this,c,Z,e))){if(f=this._getDirection(e,n)===`vertical`,r=LI(Z),h(`dragOverValid`),X.eventCanceled)return m;if(a)return UL=WL,g(),this._hideClone(),h(`revert`),X.eventCanceled||(GL?WL.insertBefore(Z,GL):WL.appendChild(Z)),_(!0);var y=BI(t,o.draggable);if(!y||lL(e,f,this)&&!y.animated){if(y===Z)return _(!1);if(y&&t===e.target&&(n=y),n&&(i=LI(n)),aL(WL,t,Z,r,n,i,e,!!n)!==!1)return g(),t.appendChild(Z),UL=t,v(),_(!0)}else if(y&&cL(e,f,this)){var b=zI(t,0,o,!0);if(b===Z)return _(!1);if(n=b,i=LI(n),aL(WL,t,Z,r,n,i,e,!1)!==!1)return g(),t.insertBefore(Z,b),UL=t,v(),_(!0)}else if(n.parentNode===t){i=LI(n);var x=0,S,C=Z.parentNode!==t,ee=!ER(Z.animated&&Z.toRect||r,n.animated&&n.toRect||i,f),w=f?`top`:`left`,T=RI(n,`top`,`top`)||RI(Z,`top`,`top`),te=T?T.scrollTop:void 0;dR!==n&&(S=i[w],pR=!1,mR=!ee&&o.invertSwap||C),x=uL(e,n,i,f,ee?1:o.swapThreshold,o.invertedSwapThreshold==null?o.swapThreshold:o.invertedSwapThreshold,mR,dR===n);var E;if(x!==0){var ne=VI(Z);do ne-=x,E=UL.children[ne];while(E&&(Y(E,`display`)===`none`||E===Q))}if(x===0||E===n)return _(!1);dR=n,fR=x;var re=n.nextElementSibling,ie=!1;ie=x===1;var ae=aL(WL,t,Z,r,n,i,e,ie);if(ae!==!1)return(ae===1||ae===-1)&&(ie=ae===1),vR=!0,setTimeout(sL,30),g(),ie&&!re?t.appendChild(Z):n.parentNode.insertBefore(Z,ie?re:n),T&&YI(T,0,te-T.scrollTop),UL=Z.parentNode,S!==void 0&&!mR&&(hR=Math.abs(S-LI(n)[w])),v(),_(!0)}if(t.contains(Z))return _(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){J(document,`mousemove`,this._onTouchMove),J(document,`touchmove`,this._onTouchMove),J(document,`pointermove`,this._onTouchMove),J(document,`dragover`,jR),J(document,`mousemove`,jR),J(document,`touchmove`,jR)},_offUpEvents:function(){var e=this.el.ownerDocument;J(e,`mouseup`,this._onDrop),J(e,`touchend`,this._onDrop),J(e,`pointerup`,this._onDrop),J(e,`touchcancel`,this._onDrop),J(document,`selectstart`,this)},_onDrop:function(e){var t=this.el,n=this.options;if(XL=VI(Z),QL=VI(Z,n.draggable),HL(`drop`,this,{evt:e}),UL=Z&&Z.parentNode,XL=VI(Z),QL=VI(Z,n.draggable),X.eventCanceled){this._nulling();return}tR=!1,mR=!1,pR=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),hL(this.cloneId),hL(this._dragStartId),this.nativeDraggable&&(J(document,`drop`,this),J(t,`dragstart`,this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),jL&&Y(document.body,`user-select`,``),Y(Z,`transform`,``),e&&(uR&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),Q&&Q.parentNode&&Q.parentNode.removeChild(Q),(WL===UL||eR&&eR.lastPutMode!==`clone`)&&qL&&qL.parentNode&&qL.parentNode.removeChild(qL),Z&&(this.nativeDraggable&&J(Z,`dragend`,this),oL(Z),Z.style[`will-change`]=``,uR&&!tR&&NI(Z,eR?eR.options.ghostClass:this.options.ghostClass,!1),NI(Z,this.options.chosenClass,!1),rL({sortable:this,name:`unchoose`,toEl:UL,newIndex:null,newDraggableIndex:null,originalEvent:e}),WL===UL?XL!==YL&&XL>=0&&(rL({sortable:this,name:`update`,toEl:UL,originalEvent:e}),rL({sortable:this,name:`sort`,toEl:UL,originalEvent:e})):(XL>=0&&(rL({rootEl:UL,name:`add`,toEl:UL,fromEl:WL,originalEvent:e}),rL({sortable:this,name:`remove`,toEl:UL,originalEvent:e}),rL({rootEl:UL,name:`sort`,toEl:UL,fromEl:WL,originalEvent:e}),rL({sortable:this,name:`sort`,toEl:UL,originalEvent:e})),eR&&eR.save()),X.active&&((XL==null||XL===-1)&&(XL=YL,QL=ZL),rL({sortable:this,name:`end`,toEl:UL,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){HL(`nulling`,this),WL=Z=UL=Q=GL=qL=KL=JL=iR=aR=uR=XL=QL=YL=ZL=dR=fR=eR=$L=X.dragged=X.ghost=X.clone=X.active=null,yR.forEach(function(e){e.checked=!0}),yR.length=oR=sR=0},handleEvent:function(e){switch(e.type){case`drop`:case`dragend`:this._onDrop(e);break;case`dragenter`:case`dragover`:Z&&(this._onDragOver(e),iL(e));break;case`selectstart`:e.preventDefault();break}},toArray:function(){for(var e=[],t,n=this.el.children,r=0,i=n.length,a=this.options;r<i;r++)t=n[r],MI(t,a.draggable,this.el,!1)&&e.push(t.getAttribute(a.dataIdAttr)||fL(t));return e},sort:function(e,t){var n={},r=this.el;this.toArray().forEach(function(e,t){var i=r.children[t];MI(i,this.options.draggable,r,!1)&&(n[e]=i)},this),t&&this.captureAnimationState(),e.forEach(function(e){n[e]&&(r.removeChild(n[e]),r.appendChild(n[e]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return MI(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(t===void 0)return n[e];var r=BL.modifyOption(this,e,t);r===void 0?n[e]=t:n[e]=r,e===`group`&&OR(n)},destroy:function(){HL(`destroy`,this);var e=this.el;e[LL]=null,J(e,`mousedown`,this._onTapStart),J(e,`touchstart`,this._onTapStart),J(e,`pointerdown`,this._onTapStart),this.nativeDraggable&&(J(e,`dragover`,this),J(e,`dragenter`,this)),Array.prototype.forEach.call(e.querySelectorAll(`[draggable]`),function(e){e.removeAttribute(`draggable`)}),this._onDrop(),this._disableDelayedDragEvents(),rR.splice(rR.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!JL){if(HL(`hideClone`,this),X.eventCanceled)return;Y(qL,`display`,`none`),this.options.removeCloneOnHide&&qL.parentNode&&qL.parentNode.removeChild(qL),JL=!0}},_showClone:function(e){if(e.lastPutMode!==`clone`){this._hideClone();return}if(JL){if(HL(`showClone`,this),X.eventCanceled)return;Z.parentNode==WL&&!this.options.group.revertClone?WL.insertBefore(qL,Z):GL?WL.insertBefore(qL,GL):WL.appendChild(qL),this.options.group.revertClone&&this.animate(Z,qL),Y(qL,`display`,``),JL=!1}}},bR&&q(document,`touchmove`,function(e){(X.active||tR)&&e.cancelable&&e.preventDefault()}),X.utils={on:q,off:J,css:Y,find:FI,is:function(e,t){return!!MI(e,t,e,!1)},extend:GI,throttle:qI,closest:MI,toggleClass:NI,clone:XI,index:VI,nextTick:mL,cancelNextTick:hL,detectDirection:TR,getChild:zI},X.get=function(e){return e[LL]},X.mount=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(e){if(!e.prototype||!e.prototype.constructor)throw`Sortable: Mounted plugin must be a constructor function, not ${{}.toString.call(e)}`;e.utils&&(X.utils=_I(_I({},X.utils),e.utils)),BL.mount(e)})},X.create=function(e,t){return new X(e,t)},X.version=DL,NR=[],IR=!1,VR=qI(function(e,t,n,r){if(t.scroll){var i=(e.touches?e.touches[0]:e).clientX,a=(e.touches?e.touches[0]:e).clientY,o=t.scrollSensitivity,s=t.scrollSpeed,c=II(),l=!1,u;FR!==n&&(FR=n,_L(),PR=t.scroll,u=t.scrollFn,PR===!0&&(PR=WI(n,!0)));var d=0,f=PR;do{var p=f,m=LI(p),h=m.top,g=m.bottom,_=m.left,v=m.right,y=m.width,b=m.height,x=void 0,S=void 0,C=p.scrollWidth,ee=p.scrollHeight,w=Y(p),T=p.scrollLeft,te=p.scrollTop;p===c?(x=y<C&&(w.overflowX===`auto`||w.overflowX===`scroll`||w.overflowX===`visible`),S=b<ee&&(w.overflowY===`auto`||w.overflowY===`scroll`||w.overflowY===`visible`)):(x=y<C&&(w.overflowX===`auto`||w.overflowX===`scroll`),S=b<ee&&(w.overflowY===`auto`||w.overflowY===`scroll`));var E=x&&(Math.abs(v-i)<=o&&T+y<C)-(Math.abs(_-i)<=o&&!!T),ne=S&&(Math.abs(g-a)<=o&&te+b<ee)-(Math.abs(h-a)<=o&&!!te);if(!NR[d])for(var re=0;re<=d;re++)NR[re]||(NR[re]={});(NR[d].vx!=E||NR[d].vy!=ne||NR[d].el!==p)&&(NR[d].el=p,NR[d].vx=E,NR[d].vy=ne,clearInterval(NR[d].pid),(E!=0||ne!=0)&&(l=!0,NR[d].pid=setInterval(function(){r&&this.layer===0&&X.active._onTouchMove(zR);var t=NR[this.layer].vy?NR[this.layer].vy*s:0,n=NR[this.layer].vx?NR[this.layer].vx*s:0;typeof u==`function`&&u.call(X.dragged.parentNode[LL],n,t,e,zR,NR[this.layer].el)!==`continue`||YI(NR[this.layer].el,n,t)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&f!==c&&(f=WI(f,!1)));IR=l}},30),HR=function(e){var t=e.originalEvent,n=e.putSortable,r=e.dragEl,i=e.activeSortable,a=e.dispatchSortableEvent,o=e.hideGhostForTarget,s=e.unhideGhostForTarget;if(t){var c=n||i;o();var l=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,u=document.elementFromPoint(l.clientX,l.clientY);s(),c&&!c.el.contains(u)&&(a(`spill`),this.onSpill({dragEl:r,putSortable:n}))}},yL.prototype={startIndex:null,dragStart:function(e){this.startIndex=e.oldDraggableIndex},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var r=zI(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(t,r):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:HR},bI(yL,{pluginName:`revertOnSpill`}),bL.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:HR},bI(bL,{pluginName:`removeOnSpill`}),$=[],WR=[],qR=!1,JR=!1,YR=!1,X.mount(new gL),X.mount(bL,yL)})),ez=f(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r(require(`vue`),($R(),g(hI))):typeof define==`function`&&define.amd?define([,`sortablejs`],r):typeof e==`object`?e.vuedraggable=r(require(`vue`),($R(),g(hI))):n.vuedraggable=r(n.Vue,n.Sortable)})(typeof self<`u`?self:e,function(e,t){return(function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,`__esModule`,{value:!0})},n.t=function(e,t){if(t&1&&(e=n(e)),t&8||t&4&&typeof e==`object`&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,`default`,{enumerable:!0,value:e}),t&2&&typeof e!=`string`)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=`fb15`)})({"00ee":(function(e,t,n){var r=n(`b622`)(`toStringTag`),i={};i[r]=`z`,e.exports=String(i)===`[object z]`}),"0366":(function(e,t,n){var r=n(`1c0b`);e.exports=function(e,t,n){if(r(e),t===void 0)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}}),"057f":(function(e,t,n){var r=n(`fc6a`),i=n(`241c`).f,a={}.toString,o=typeof window==`object`&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(e){try{return i(e)}catch{return o.slice()}};e.exports.f=function(e){return o&&a.call(e)==`[object Window]`?s(e):i(r(e))}}),"06cf":(function(e,t,n){var r=n(`83ab`),i=n(`d1e7`),a=n(`5c6c`),o=n(`fc6a`),s=n(`c04e`),c=n(`5135`),l=n(`0cfb`),u=Object.getOwnPropertyDescriptor;t.f=r?u:function(e,t){if(e=o(e),t=s(t,!0),l)try{return u(e,t)}catch{}if(c(e,t))return a(!i.f.call(e,t),e[t])}}),"0cfb":(function(e,t,n){var r=n(`83ab`),i=n(`d039`),a=n(`cc12`);e.exports=!r&&!i(function(){return Object.defineProperty(a(`div`),`a`,{get:function(){return 7}}).a!=7})}),"13d5":(function(e,t,n){"use strict";var r=n(`23e7`),i=n(`d58f`).left,a=n(`a640`),o=n(`ae40`),s=a(`reduce`),c=o(`reduce`,{1:0});r({target:`Array`,proto:!0,forced:!s||!c},{reduce:function(e){return i(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}})}),"14c3":(function(e,t,n){var r=n(`c6b6`),i=n(`9263`);e.exports=function(e,t){var n=e.exec;if(typeof n==`function`){var a=n.call(e,t);if(typeof a!=`object`)throw TypeError(`RegExp exec method returned something other than an Object or null`);return a}if(r(e)!==`RegExp`)throw TypeError(`RegExp#exec called on incompatible receiver`);return i.call(e,t)}}),"159b":(function(e,t,n){var r=n(`da84`),i=n(`fdbc`),a=n(`17c2`),o=n(`9112`);for(var s in i){var c=r[s],l=c&&c.prototype;if(l&&l.forEach!==a)try{o(l,`forEach`,a)}catch{l.forEach=a}}}),"17c2":(function(e,t,n){"use strict";var r=n(`b727`).forEach,i=n(`a640`),a=n(`ae40`),o=i(`forEach`),s=a(`forEach`);e.exports=!o||!s?function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}:[].forEach}),"1be4":(function(e,t,n){e.exports=n(`d066`)(`document`,`documentElement`)}),"1c0b":(function(e,t){e.exports=function(e){if(typeof e!=`function`)throw TypeError(String(e)+` is not a function`);return e}}),"1c7e":(function(e,t,n){var r=n(`b622`)(`iterator`),i=!1;try{var a=0,o={next:function(){return{done:!!a++}},return:function(){i=!0}};o[r]=function(){return this},Array.from(o,function(){throw 2})}catch{}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var a={};a[r]=function(){return{next:function(){return{done:n=!0}}}},e(a)}catch{}return n}}),"1d80":(function(e,t){e.exports=function(e){if(e==null)throw TypeError(`Can't call method on `+e);return e}}),"1dde":(function(e,t,n){var r=n(`d039`),i=n(`b622`),a=n(`2d00`),o=i(`species`);e.exports=function(e){return a>=51||!r(function(){var t=[],n=t.constructor={};return n[o]=function(){return{foo:1}},t[e](Boolean).foo!==1})}}),"23cb":(function(e,t,n){var r=n(`a691`),i=Math.max,a=Math.min;e.exports=function(e,t){var n=r(e);return n<0?i(n+t,0):a(n,t)}}),"23e7":(function(e,t,n){var r=n(`da84`),i=n(`06cf`).f,a=n(`9112`),o=n(`6eeb`),s=n(`ce4e`),c=n(`e893`),l=n(`94ca`);e.exports=function(e,t){var n=e.target,u=e.global,d=e.stat,f,p=u?r:d?r[n]||s(n,{}):(r[n]||{}).prototype,m,h,g,_;if(p)for(m in t){if(g=t[m],e.noTargetGet?(_=i(p,m),h=_&&_.value):h=p[m],f=l(u?m:n+(d?`.`:`#`)+m,e.forced),!f&&h!==void 0){if(typeof g==typeof h)continue;c(g,h)}(e.sham||h&&h.sham)&&a(g,`sham`,!0),o(p,m,g,e)}}}),"241c":(function(e,t,n){var r=n(`ca84`),i=n(`7839`).concat(`length`,`prototype`);t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}}),"25f0":(function(e,t,n){"use strict";var r=n(`6eeb`),i=n(`825a`),a=n(`d039`),o=n(`ad6d`),s=`toString`,c=RegExp.prototype,l=c[s],u=a(function(){return l.call({source:`a`,flags:`b`})!=`/a/b`}),d=l.name!=s;(u||d)&&r(RegExp.prototype,s,function(){var e=i(this),t=String(e.source),n=e.flags,r=String(n===void 0&&e instanceof RegExp&&!(`flags`in c)?o.call(e):n);return`/`+t+`/`+r},{unsafe:!0})}),"2ca0":(function(e,t,n){"use strict";var r=n(`23e7`),i=n(`06cf`).f,a=n(`50c4`),o=n(`5a34`),s=n(`1d80`),c=n(`ab13`),l=n(`c430`),u=``.startsWith,d=Math.min,f=c(`startsWith`);r({target:`String`,proto:!0,forced:!(!l&&!f&&function(){var e=i(String.prototype,`startsWith`);return e&&!e.writable}())&&!f},{startsWith:function(e){var t=String(s(this));o(e);var n=a(d(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return u?u.call(t,r,n):t.slice(n,n+r.length)===r}})}),"2d00":(function(e,t,n){var r=n(`da84`),i=n(`342f`),a=r.process,o=a&&a.versions,s=o&&o.v8,c,l;s?(c=s.split(`.`),l=c[0]+c[1]):i&&(c=i.match(/Edge\/(\d+)/),(!c||c[1]>=74)&&(c=i.match(/Chrome\/(\d+)/),c&&(l=c[1]))),e.exports=l&&+l}),"342f":(function(e,t,n){e.exports=n(`d066`)(`navigator`,`userAgent`)||``}),"35a1":(function(e,t,n){var r=n(`f5df`),i=n(`3f8c`),a=n(`b622`)(`iterator`);e.exports=function(e){if(e!=null)return e[a]||e[`@@iterator`]||i[r(e)]}}),"37e8":(function(e,t,n){var r=n(`83ab`),i=n(`9bf2`),a=n(`825a`),o=n(`df75`);e.exports=r?Object.defineProperties:function(e,t){a(e);for(var n=o(t),r=n.length,s=0,c;r>s;)i.f(e,c=n[s++],t[c]);return e}}),"3bbe":(function(e,t,n){var r=n(`861d`);e.exports=function(e){if(!r(e)&&e!==null)throw TypeError(`Can't set `+String(e)+` as a prototype`);return e}}),"3ca3":(function(e,t,n){"use strict";var r=n(`6547`).charAt,i=n(`69f3`),a=n(`7dd0`),o=`String Iterator`,s=i.set,c=i.getterFor(o);a(String,`String`,function(e){s(this,{type:o,string:String(e),index:0})},function(){var e=c(this),t=e.string,n=e.index,i;return n>=t.length?{value:void 0,done:!0}:(i=r(t,n),e.index+=i.length,{value:i,done:!1})})}),"3f8c":(function(e,t){e.exports={}}),4160:(function(e,t,n){"use strict";var r=n(`23e7`),i=n(`17c2`);r({target:`Array`,proto:!0,forced:[].forEach!=i},{forEach:i})}),"428f":(function(e,t,n){e.exports=n(`da84`)}),"44ad":(function(e,t,n){var r=n(`d039`),i=n(`c6b6`),a=``.split;e.exports=r(function(){return!Object(`z`).propertyIsEnumerable(0)})?function(e){return i(e)==`String`?a.call(e,``):Object(e)}:Object}),"44d2":(function(e,t,n){var r=n(`b622`),i=n(`7c73`),a=n(`9bf2`),o=r(`unscopables`),s=Array.prototype;s[o]??a.f(s,o,{configurable:!0,value:i(null)}),e.exports=function(e){s[o][e]=!0}}),"44e7":(function(e,t,n){var r=n(`861d`),i=n(`c6b6`),a=n(`b622`)(`match`);e.exports=function(e){var t;return r(e)&&((t=e[a])===void 0?i(e)==`RegExp`:!!t)}}),4930:(function(e,t,n){var r=n(`d039`);e.exports=!!Object.getOwnPropertySymbols&&!r(function(){return!String(Symbol())})}),"4d64":(function(e,t,n){var r=n(`fc6a`),i=n(`50c4`),a=n(`23cb`),o=function(e){return function(t,n,o){var s=r(t),c=i(s.length),l=a(o,c),u;if(e&&n!=n){for(;c>l;)if(u=s[l++],u!=u)return!0}else for(;c>l;l++)if((e||l in s)&&s[l]===n)return e||l||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}}),"4de4":(function(e,t,n){"use strict";var r=n(`23e7`),i=n(`b727`).filter,a=n(`1dde`),o=n(`ae40`),s=a(`filter`),c=o(`filter`);r({target:`Array`,proto:!0,forced:!s||!c},{filter:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})}),"4df4":(function(e,t,n){"use strict";var r=n(`0366`),i=n(`7b0b`),a=n(`9bdd`),o=n(`e95a`),s=n(`50c4`),c=n(`8418`),l=n(`35a1`);e.exports=function(e){var t=i(e),n=typeof this==`function`?this:Array,u=arguments.length,d=u>1?arguments[1]:void 0,f=d!==void 0,p=l(t),m=0,h,g,_,v,y,b;if(f&&(d=r(d,u>2?arguments[2]:void 0,2)),p!=null&&!(n==Array&&o(p)))for(v=p.call(t),y=v.next,g=new n;!(_=y.call(v)).done;m++)b=f?a(v,d,[_.value,m],!0):_.value,c(g,m,b);else for(h=s(t.length),g=new n(h);h>m;m++)b=f?d(t[m],m):t[m],c(g,m,b);return g.length=m,g}}),"4fad":(function(e,t,n){var r=n(`23e7`),i=n(`6f53`).entries;r({target:`Object`,stat:!0},{entries:function(e){return i(e)}})}),"50c4":(function(e,t,n){var r=n(`a691`),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}}),5135:(function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}}),5319:(function(e,t,n){"use strict";var r=n(`d784`),i=n(`825a`),a=n(`7b0b`),o=n(`50c4`),s=n(`a691`),c=n(`1d80`),l=n(`8aa5`),u=n(`14c3`),d=Math.max,f=Math.min,p=Math.floor,m=/\$([$&'`]|\d\d?|<[^>]*>)/g,h=/\$([$&'`]|\d\d?)/g,g=function(e){return e===void 0?e:String(e)};r(`replace`,2,function(e,t,n,r){var _=r.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,v=r.REPLACE_KEEPS_$0,y=_?`$`:`$0`;return[function(n,r){var i=c(this),a=n?.[e];return a===void 0?t.call(String(i),n,r):a.call(n,i,r)},function(e,r){if(!_&&v||typeof r==`string`&&r.indexOf(y)===-1){var a=n(t,e,this,r);if(a.done)return a.value}var c=i(e),p=String(this),m=typeof r==`function`;m||(r=String(r));var h=c.global;if(h){var x=c.unicode;c.lastIndex=0}for(var S=[];;){var C=u(c,p);if(C===null||(S.push(C),!h))break;String(C[0])===``&&(c.lastIndex=l(p,o(c.lastIndex),x))}for(var ee=``,w=0,T=0;T<S.length;T++){C=S[T];for(var te=String(C[0]),E=d(f(s(C.index),p.length),0),ne=[],re=1;re<C.length;re++)ne.push(g(C[re]));var ie=C.groups;if(m){var ae=[te].concat(ne,E,p);ie!==void 0&&ae.push(ie);var oe=String(r.apply(void 0,ae))}else oe=b(te,p,E,ne,ie,r);E>=w&&(ee+=p.slice(w,E)+oe,w=E+te.length)}return ee+p.slice(w)}];function b(e,n,r,i,o,s){var c=r+e.length,l=i.length,u=h;return o!==void 0&&(o=a(o),u=m),t.call(s,u,function(t,a){var s;switch(a.charAt(0)){case`$`:return`$`;case`&`:return e;case"`":return n.slice(0,r);case`'`:return n.slice(c);case`<`:s=o[a.slice(1,-1)];break;default:var u=+a;if(u===0)return t;if(u>l){var d=p(u/10);return d===0?t:d<=l?i[d-1]===void 0?a.charAt(1):i[d-1]+a.charAt(1):t}s=i[u-1]}return s===void 0?``:s})}})}),5692:(function(e,t,n){var r=n(`c430`),i=n(`c6cd`);(e.exports=function(e,t){return i[e]||(i[e]=t===void 0?{}:t)})(`versions`,[]).push({version:`3.6.5`,mode:r?`pure`:`global`,copyright:`© 2020 Denis Pushkarev (zloirock.ru)`})}),"56ef":(function(e,t,n){var r=n(`d066`),i=n(`241c`),a=n(`7418`),o=n(`825a`);e.exports=r(`Reflect`,`ownKeys`)||function(e){var t=i.f(o(e)),n=a.f;return n?t.concat(n(e)):t}}),"5a34":(function(e,t,n){var r=n(`44e7`);e.exports=function(e){if(r(e))throw TypeError(`The method doesn't accept regular expressions`);return e}}),"5c6c":(function(e,t){e.exports=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}}}),"5db7":(function(e,t,n){"use strict";var r=n(`23e7`),i=n(`a2bf`),a=n(`7b0b`),o=n(`50c4`),s=n(`1c0b`),c=n(`65f0`);r({target:`Array`,proto:!0},{flatMap:function(e){var t=a(this),n=o(t.length),r;return s(e),r=c(t,0),r.length=i(r,t,t,n,0,1,e,arguments.length>1?arguments[1]:void 0),r}})}),6547:(function(e,t,n){var r=n(`a691`),i=n(`1d80`),a=function(e){return function(t,n){var a=String(i(t)),o=r(n),s=a.length,c,l;return o<0||o>=s?e?``:void 0:(c=a.charCodeAt(o),c<55296||c>56319||o+1===s||(l=a.charCodeAt(o+1))<56320||l>57343?e?a.charAt(o):c:e?a.slice(o,o+2):(c-55296<<10)+(l-56320)+65536)}};e.exports={codeAt:a(!1),charAt:a(!0)}}),"65f0":(function(e,t,n){var r=n(`861d`),i=n(`e8b5`),a=n(`b622`)(`species`);e.exports=function(e,t){var n;return i(e)&&(n=e.constructor,typeof n==`function`&&(n===Array||i(n.prototype))?n=void 0:r(n)&&(n=n[a],n===null&&(n=void 0))),new(n===void 0?Array:n)(t===0?0:t)}}),"69f3":(function(e,t,n){var r=n(`7f9a`),i=n(`da84`),a=n(`861d`),o=n(`9112`),s=n(`5135`),c=n(`f772`),l=n(`d012`),u=i.WeakMap,d,f,p,m=function(e){return p(e)?f(e):d(e,{})},h=function(e){return function(t){var n;if(!a(t)||(n=f(t)).type!==e)throw TypeError(`Incompatible receiver, `+e+` required`);return n}};if(r){var g=new u,_=g.get,v=g.has,y=g.set;d=function(e,t){return y.call(g,e,t),t},f=function(e){return _.call(g,e)||{}},p=function(e){return v.call(g,e)}}else{var b=c(`state`);l[b]=!0,d=function(e,t){return o(e,b,t),t},f=function(e){return s(e,b)?e[b]:{}},p=function(e){return s(e,b)}}e.exports={set:d,get:f,has:p,enforce:m,getterFor:h}}),"6eeb":(function(e,t,n){var r=n(`da84`),i=n(`9112`),a=n(`5135`),o=n(`ce4e`),s=n(`8925`),c=n(`69f3`),l=c.get,u=c.enforce,d=String(String).split(`String`);(e.exports=function(e,t,n,s){var c=s?!!s.unsafe:!1,l=s?!!s.enumerable:!1,f=s?!!s.noTargetGet:!1;if(typeof n==`function`&&(typeof t==`string`&&!a(n,`name`)&&i(n,`name`,t),u(n).source=d.join(typeof t==`string`?t:``)),e===r){l?e[t]=n:o(t,n);return}else c?!f&&e[t]&&(l=!0):delete e[t];l?e[t]=n:i(e,t,n)})(Function.prototype,`toString`,function(){return typeof this==`function`&&l(this).source||s(this)})}),"6f53":(function(e,t,n){var r=n(`83ab`),i=n(`df75`),a=n(`fc6a`),o=n(`d1e7`).f,s=function(e){return function(t){for(var n=a(t),s=i(n),c=s.length,l=0,u=[],d;c>l;)d=s[l++],(!r||o.call(n,d))&&u.push(e?[d,n[d]]:n[d]);return u}};e.exports={entries:s(!0),values:s(!1)}}),"73d9":(function(e,t,n){n(`44d2`)(`flatMap`)}),7418:(function(e,t){t.f=Object.getOwnPropertySymbols}),"746f":(function(e,t,n){var r=n(`428f`),i=n(`5135`),a=n(`e538`),o=n(`9bf2`).f;e.exports=function(e){var t=r.Symbol||={};i(t,e)||o(t,e,{value:a.f(e)})}}),7839:(function(e,t){e.exports=[`constructor`,`hasOwnProperty`,`isPrototypeOf`,`propertyIsEnumerable`,`toLocaleString`,`toString`,`valueOf`]}),"7b0b":(function(e,t,n){var r=n(`1d80`);e.exports=function(e){return Object(r(e))}}),"7c73":(function(e,t,n){var r=n(`825a`),i=n(`37e8`),a=n(`7839`),o=n(`d012`),s=n(`1be4`),c=n(`cc12`),l=n(`f772`),u=`>`,d=`<`,f=`prototype`,p=`script`,m=l(`IE_PROTO`),h=function(){},g=function(e){return d+p+u+e+d+`/`+p+u},_=function(e){e.write(g(``)),e.close();var t=e.parentWindow.Object;return e=null,t},v=function(){var e=c(`iframe`),t=`java`+p+`:`,n;return e.style.display=`none`,s.appendChild(e),e.src=String(t),n=e.contentWindow.document,n.open(),n.write(g(`document.F=Object`)),n.close(),n.F},y,b=function(){try{y=document.domain&&new ActiveXObject(`htmlfile`)}catch{}b=y?_(y):v();for(var e=a.length;e--;)delete b[f][a[e]];return b()};o[m]=!0,e.exports=Object.create||function(e,t){var n;return e===null?n=b():(h[f]=r(e),n=new h,h[f]=null,n[m]=e),t===void 0?n:i(n,t)}}),"7dd0":(function(e,t,n){"use strict";var r=n(`23e7`),i=n(`9ed3`),a=n(`e163`),o=n(`d2bb`),s=n(`d44e`),c=n(`9112`),l=n(`6eeb`),u=n(`b622`),d=n(`c430`),f=n(`3f8c`),p=n(`ae93`),m=p.IteratorPrototype,h=p.BUGGY_SAFARI_ITERATORS,g=u(`iterator`),_=`keys`,v=`values`,y=`entries`,b=function(){return this};e.exports=function(e,t,n,u,p,x,S){i(n,t,u);var C=function(e){if(e===p&&E)return E;if(!h&&e in T)return T[e];switch(e){case _:return function(){return new n(this,e)};case v:return function(){return new n(this,e)};case y:return function(){return new n(this,e)}}return function(){return new n(this)}},ee=t+` Iterator`,w=!1,T=e.prototype,te=T[g]||T[`@@iterator`]||p&&T[p],E=!h&&te||C(p),ne=t==`Array`&&T.entries||te,re,ie,ae;if(ne&&(re=a(ne.call(new e)),m!==Object.prototype&&re.next&&(!d&&a(re)!==m&&(o?o(re,m):typeof re[g]!=`function`&&c(re,g,b)),s(re,ee,!0,!0),d&&(f[ee]=b))),p==v&&te&&te.name!==v&&(w=!0,E=function(){return te.call(this)}),(!d||S)&&T[g]!==E&&c(T,g,E),f[t]=E,p)if(ie={values:C(v),keys:x?E:C(_),entries:C(y)},S)for(ae in ie)(h||w||!(ae in T))&&l(T,ae,ie[ae]);else r({target:t,proto:!0,forced:h||w},ie);return ie}}),"7f9a":(function(e,t,n){var r=n(`da84`),i=n(`8925`),a=r.WeakMap;e.exports=typeof a==`function`&&/native code/.test(i(a))}),"825a":(function(e,t,n){var r=n(`861d`);e.exports=function(e){if(!r(e))throw TypeError(String(e)+` is not an object`);return e}}),"83ab":(function(e,t,n){e.exports=!n(`d039`)(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})}),8418:(function(e,t,n){"use strict";var r=n(`c04e`),i=n(`9bf2`),a=n(`5c6c`);e.exports=function(e,t,n){var o=r(t);o in e?i.f(e,o,a(0,n)):e[o]=n}}),"861d":(function(e,t){e.exports=function(e){return typeof e==`object`?e!==null:typeof e==`function`}}),8875:(function(e,t,n){var r,i,a;(function(n,o){i=[],r=o,a=typeof r==`function`?r.apply(t,i):r,a!==void 0&&(e.exports=a)})(typeof self<`u`?self:this,function(){function e(){var t=Object.getOwnPropertyDescriptor(document,`currentScript`);if(!t&&`currentScript`in document&&document.currentScript||t&&t.get!==e&&document.currentScript)return document.currentScript;try{throw Error()}catch(e){var n=/.*at [^(]*\((.*):(.+):(.+)\)$/gi.exec(e.stack)||/@([^@]*):(\d+):(\d+)\s*$/gi.exec(e.stack),r=n&&n[1]||!1,i=n&&n[2]||!1,a=document.location.href.replace(document.location.hash,``),o,s,c,l=document.getElementsByTagName(`script`);r===a&&(o=document.documentElement.outerHTML,s=RegExp(`(?:[^\\n]+?\\n){0,`+(i-2)+`}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*`,`i`),c=o.replace(s,`$1`).trim());for(var u=0;u<l.length;u++)if(l[u].readyState===`interactive`||l[u].src===r||r===a&&l[u].innerHTML&&l[u].innerHTML.trim()===c)return l[u];return null}}return e})}),8925:(function(e,t,n){var r=n(`c6cd`),i=Function.toString;typeof r.inspectSource!=`function`&&(r.inspectSource=function(e){return i.call(e)}),e.exports=r.inspectSource}),"8aa5":(function(e,t,n){"use strict";var r=n(`6547`).charAt;e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}}),"8bbf":(function(t,n){t.exports=e}),"90e3":(function(e,t){var n=0,r=Math.random();e.exports=function(e){return`Symbol(`+String(e===void 0?``:e)+`)_`+(++n+r).toString(36)}}),9112:(function(e,t,n){var r=n(`83ab`),i=n(`9bf2`),a=n(`5c6c`);e.exports=r?function(e,t,n){return i.f(e,t,a(1,n))}:function(e,t,n){return e[t]=n,e}}),9263:(function(e,t,n){"use strict";var r=n(`ad6d`),i=n(`9f7f`),a=RegExp.prototype.exec,o=String.prototype.replace,s=a,c=(function(){var e=/a/,t=/b*/g;return a.call(e,`a`),a.call(t,`a`),e.lastIndex!==0||t.lastIndex!==0})(),l=i.UNSUPPORTED_Y||i.BROKEN_CARET,u=/()??/.exec(``)[1]!==void 0;(c||u||l)&&(s=function(e){var t=this,n,i,s,d,f=l&&t.sticky,p=r.call(t),m=t.source,h=0,g=e;return f&&(p=p.replace(`y`,``),p.indexOf(`g`)===-1&&(p+=`g`),g=String(e).slice(t.lastIndex),t.lastIndex>0&&(!t.multiline||t.multiline&&e[t.lastIndex-1]!==`
159
- `)&&(m=`(?: `+m+`)`,g=` `+g,h++),i=RegExp(`^(?:`+m+`)`,p)),u&&(i=RegExp(`^`+m+`$(?!\\s)`,p)),c&&(n=t.lastIndex),s=a.call(f?i:t,g),f?s?(s.input=s.input.slice(h),s[0]=s[0].slice(h),s.index=t.lastIndex,t.lastIndex+=s[0].length):t.lastIndex=0:c&&s&&(t.lastIndex=t.global?s.index+s[0].length:n),u&&s&&s.length>1&&o.call(s[0],i,function(){for(d=1;d<arguments.length-2;d++)arguments[d]===void 0&&(s[d]=void 0)}),s}),e.exports=s}),"94ca":(function(e,t,n){var r=n(`d039`),i=/#|\.prototype\./,a=function(e,t){var n=s[o(e)];return n==l?!0:n==c?!1:typeof t==`function`?r(t):!!t},o=a.normalize=function(e){return String(e).replace(i,`.`).toLowerCase()},s=a.data={},c=a.NATIVE=`N`,l=a.POLYFILL=`P`;e.exports=a}),"99af":(function(e,t,n){"use strict";var r=n(`23e7`),i=n(`d039`),a=n(`e8b5`),o=n(`861d`),s=n(`7b0b`),c=n(`50c4`),l=n(`8418`),u=n(`65f0`),d=n(`1dde`),f=n(`b622`),p=n(`2d00`),m=f(`isConcatSpreadable`),h=9007199254740991,g=`Maximum allowed index exceeded`,_=p>=51||!i(function(){var e=[];return e[m]=!1,e.concat()[0]!==e}),v=d(`concat`),y=function(e){if(!o(e))return!1;var t=e[m];return t===void 0?a(e):!!t};r({target:`Array`,proto:!0,forced:!_||!v},{concat:function(e){var t=s(this),n=u(t,0),r=0,i,a,o,d,f;for(i=-1,o=arguments.length;i<o;i++)if(f=i===-1?t:arguments[i],y(f)){if(d=c(f.length),r+d>h)throw TypeError(g);for(a=0;a<d;a++,r++)a in f&&l(n,r,f[a])}else{if(r>=h)throw TypeError(g);l(n,r++,f)}return n.length=r,n}})}),"9bdd":(function(e,t,n){var r=n(`825a`);e.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var a=e.return;throw a!==void 0&&r(a.call(e)),t}}}),"9bf2":(function(e,t,n){var r=n(`83ab`),i=n(`0cfb`),a=n(`825a`),o=n(`c04e`),s=Object.defineProperty;t.f=r?s:function(e,t,n){if(a(e),t=o(t,!0),a(n),i)try{return s(e,t,n)}catch{}if(`get`in n||`set`in n)throw TypeError(`Accessors not supported`);return`value`in n&&(e[t]=n.value),e}}),"9ed3":(function(e,t,n){"use strict";var r=n(`ae93`).IteratorPrototype,i=n(`7c73`),a=n(`5c6c`),o=n(`d44e`),s=n(`3f8c`),c=function(){return this};e.exports=function(e,t,n){var l=t+` Iterator`;return e.prototype=i(r,{next:a(1,n)}),o(e,l,!1,!0),s[l]=c,e}}),"9f7f":(function(e,t,n){"use strict";var r=n(`d039`);function i(e,t){return RegExp(e,t)}t.UNSUPPORTED_Y=r(function(){var e=i(`a`,`y`);return e.lastIndex=2,e.exec(`abcd`)!=null}),t.BROKEN_CARET=r(function(){var e=i(`^r`,`gy`);return e.lastIndex=2,e.exec(`str`)!=null})}),a2bf:(function(e,t,n){"use strict";var r=n(`e8b5`),i=n(`50c4`),a=n(`0366`),o=function(e,t,n,s,c,l,u,d){for(var f=c,p=0,m=u?a(u,d,3):!1,h;p<s;){if(p in n){if(h=m?m(n[p],p,t):n[p],l>0&&r(h))f=o(e,t,h,i(h.length),f,l-1)-1;else{if(f>=9007199254740991)throw TypeError(`Exceed the acceptable array length`);e[f]=h}f++}p++}return f};e.exports=o}),a352:(function(e,n){e.exports=t}),a434:(function(e,t,n){"use strict";var r=n(`23e7`),i=n(`23cb`),a=n(`a691`),o=n(`50c4`),s=n(`7b0b`),c=n(`65f0`),l=n(`8418`),u=n(`1dde`),d=n(`ae40`),f=u(`splice`),p=d(`splice`,{ACCESSORS:!0,0:0,1:2}),m=Math.max,h=Math.min,g=9007199254740991,_=`Maximum allowed length exceeded`;r({target:`Array`,proto:!0,forced:!f||!p},{splice:function(e,t){var n=s(this),r=o(n.length),u=i(e,r),d=arguments.length,f,p,v,y,b,x;if(d===0?f=p=0:d===1?(f=0,p=r-u):(f=d-2,p=h(m(a(t),0),r-u)),r+f-p>g)throw TypeError(_);for(v=c(n,p),y=0;y<p;y++)b=u+y,b in n&&l(v,y,n[b]);if(v.length=p,f<p){for(y=u;y<r-p;y++)b=y+p,x=y+f,b in n?n[x]=n[b]:delete n[x];for(y=r;y>r-p+f;y--)delete n[y-1]}else if(f>p)for(y=r-p;y>u;y--)b=y+p-1,x=y+f-1,b in n?n[x]=n[b]:delete n[x];for(y=0;y<f;y++)n[y+u]=arguments[y+2];return n.length=r-p+f,v}})}),a4d3:(function(e,t,n){"use strict";var r=n(`23e7`),i=n(`da84`),a=n(`d066`),o=n(`c430`),s=n(`83ab`),c=n(`4930`),l=n(`fdbf`),u=n(`d039`),d=n(`5135`),f=n(`e8b5`),p=n(`861d`),m=n(`825a`),h=n(`7b0b`),g=n(`fc6a`),_=n(`c04e`),v=n(`5c6c`),y=n(`7c73`),b=n(`df75`),x=n(`241c`),S=n(`057f`),C=n(`7418`),ee=n(`06cf`),w=n(`9bf2`),T=n(`d1e7`),te=n(`9112`),E=n(`6eeb`),ne=n(`5692`),re=n(`f772`),ie=n(`d012`),ae=n(`90e3`),oe=n(`b622`),se=n(`e538`),ce=n(`746f`),le=n(`d44e`),ue=n(`69f3`),de=n(`b727`).forEach,fe=re(`hidden`),pe=`Symbol`,me=`prototype`,he=oe(`toPrimitive`),ge=ue.set,_e=ue.getterFor(pe),ve=Object[me],ye=i.Symbol,be=a(`JSON`,`stringify`),xe=ee.f,Se=w.f,Ce=S.f,we=T.f,Te=ne(`symbols`),Ee=ne(`op-symbols`),De=ne(`string-to-symbol-registry`),Oe=ne(`symbol-to-string-registry`),ke=ne(`wks`),Ae=i.QObject,je=!Ae||!Ae[me]||!Ae[me].findChild,Me=s&&u(function(){return y(Se({},`a`,{get:function(){return Se(this,`a`,{value:7}).a}})).a!=7})?function(e,t,n){var r=xe(ve,t);r&&delete ve[t],Se(e,t,n),r&&e!==ve&&Se(ve,t,r)}:Se,Ne=function(e,t){var n=Te[e]=y(ye[me]);return ge(n,{type:pe,tag:e,description:t}),s||(n.description=t),n},Pe=l?function(e){return typeof e==`symbol`}:function(e){return Object(e)instanceof ye},Fe=function(e,t,n){e===ve&&Fe(Ee,t,n),m(e);var r=_(t,!0);return m(n),d(Te,r)?(n.enumerable?(d(e,fe)&&e[fe][r]&&(e[fe][r]=!1),n=y(n,{enumerable:v(0,!1)})):(d(e,fe)||Se(e,fe,v(1,{})),e[fe][r]=!0),Me(e,r,n)):Se(e,r,n)},Ie=function(e,t){m(e);var n=g(t);return de(b(n).concat(Ve(n)),function(t){(!s||Re.call(n,t))&&Fe(e,t,n[t])}),e},Le=function(e,t){return t===void 0?y(e):Ie(y(e),t)},Re=function(e){var t=_(e,!0),n=we.call(this,t);return this===ve&&d(Te,t)&&!d(Ee,t)?!1:n||!d(this,t)||!d(Te,t)||d(this,fe)&&this[fe][t]?n:!0},ze=function(e,t){var n=g(e),r=_(t,!0);if(!(n===ve&&d(Te,r)&&!d(Ee,r))){var i=xe(n,r);return i&&d(Te,r)&&!(d(n,fe)&&n[fe][r])&&(i.enumerable=!0),i}},Be=function(e){var t=Ce(g(e)),n=[];return de(t,function(e){!d(Te,e)&&!d(ie,e)&&n.push(e)}),n},Ve=function(e){var t=e===ve,n=Ce(t?Ee:g(e)),r=[];return de(n,function(e){d(Te,e)&&(!t||d(ve,e))&&r.push(Te[e])}),r};c||(ye=function(){if(this instanceof ye)throw TypeError(`Symbol is not a constructor`);var e=!arguments.length||arguments[0]===void 0?void 0:String(arguments[0]),t=ae(e),n=function(e){this===ve&&n.call(Ee,e),d(this,fe)&&d(this[fe],t)&&(this[fe][t]=!1),Me(this,t,v(1,e))};return s&&je&&Me(ve,t,{configurable:!0,set:n}),Ne(t,e)},E(ye[me],`toString`,function(){return _e(this).tag}),E(ye,`withoutSetter`,function(e){return Ne(ae(e),e)}),T.f=Re,w.f=Fe,ee.f=ze,x.f=S.f=Be,C.f=Ve,se.f=function(e){return Ne(oe(e),e)},s&&(Se(ye[me],`description`,{configurable:!0,get:function(){return _e(this).description}}),o||E(ve,`propertyIsEnumerable`,Re,{unsafe:!0}))),r({global:!0,wrap:!0,forced:!c,sham:!c},{Symbol:ye}),de(b(ke),function(e){ce(e)}),r({target:pe,stat:!0,forced:!c},{for:function(e){var t=String(e);if(d(De,t))return De[t];var n=ye(t);return De[t]=n,Oe[n]=t,n},keyFor:function(e){if(!Pe(e))throw TypeError(e+` is not a symbol`);if(d(Oe,e))return Oe[e]},useSetter:function(){je=!0},useSimple:function(){je=!1}}),r({target:`Object`,stat:!0,forced:!c,sham:!s},{create:Le,defineProperty:Fe,defineProperties:Ie,getOwnPropertyDescriptor:ze}),r({target:`Object`,stat:!0,forced:!c},{getOwnPropertyNames:Be,getOwnPropertySymbols:Ve}),r({target:`Object`,stat:!0,forced:u(function(){C.f(1)})},{getOwnPropertySymbols:function(e){return C.f(h(e))}}),be&&r({target:`JSON`,stat:!0,forced:!c||u(function(){var e=ye();return be([e])!=`[null]`||be({a:e})!=`{}`||be(Object(e))!=`{}`})},{stringify:function(e,t,n){for(var r=[e],i=1,a;arguments.length>i;)r.push(arguments[i++]);if(a=t,!(!p(t)&&e===void 0||Pe(e)))return f(t)||(t=function(e,t){if(typeof a==`function`&&(t=a.call(this,e,t)),!Pe(t))return t}),r[1]=t,be.apply(null,r)}}),ye[me][he]||te(ye[me],he,ye[me].valueOf),le(ye,pe),ie[fe]=!0}),a630:(function(e,t,n){var r=n(`23e7`),i=n(`4df4`);r({target:`Array`,stat:!0,forced:!n(`1c7e`)(function(e){Array.from(e)})},{from:i})}),a640:(function(e,t,n){"use strict";var r=n(`d039`);e.exports=function(e,t){var n=[][e];return!!n&&r(function(){n.call(null,t||function(){throw 1},1)})}}),a691:(function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}}),ab13:(function(e,t,n){var r=n(`b622`)(`match`);e.exports=function(e){var t=/./;try{`/./`[e](t)}catch{try{return t[r]=!1,`/./`[e](t)}catch{}}return!1}}),ac1f:(function(e,t,n){"use strict";var r=n(`23e7`),i=n(`9263`);r({target:`RegExp`,proto:!0,forced:/./.exec!==i},{exec:i})}),ad6d:(function(e,t,n){"use strict";var r=n(`825a`);e.exports=function(){var e=r(this),t=``;return e.global&&(t+=`g`),e.ignoreCase&&(t+=`i`),e.multiline&&(t+=`m`),e.dotAll&&(t+=`s`),e.unicode&&(t+=`u`),e.sticky&&(t+=`y`),t}}),ae40:(function(e,t,n){var r=n(`83ab`),i=n(`d039`),a=n(`5135`),o=Object.defineProperty,s={},c=function(e){throw e};e.exports=function(e,t){if(a(s,e))return s[e];t||={};var n=[][e],l=a(t,`ACCESSORS`)?t.ACCESSORS:!1,u=a(t,0)?t[0]:c,d=a(t,1)?t[1]:void 0;return s[e]=!!n&&!i(function(){if(l&&!r)return!0;var e={length:-1};l?o(e,1,{enumerable:!0,get:c}):e[1]=1,n.call(e,u,d)})}}),ae93:(function(e,t,n){"use strict";var r=n(`e163`),i=n(`9112`),a=n(`5135`),o=n(`b622`),s=n(`c430`),c=o(`iterator`),l=!1,u=function(){return this},d,f,p;[].keys&&(p=[].keys(),`next`in p?(f=r(r(p)),f!==Object.prototype&&(d=f)):l=!0),d??={},!s&&!a(d,c)&&i(d,c,u),e.exports={IteratorPrototype:d,BUGGY_SAFARI_ITERATORS:l}}),b041:(function(e,t,n){"use strict";var r=n(`00ee`),i=n(`f5df`);e.exports=r?{}.toString:function(){return`[object `+i(this)+`]`}}),b0c0:(function(e,t,n){var r=n(`83ab`),i=n(`9bf2`).f,a=Function.prototype,o=a.toString,s=/^\s*function ([^ (]*)/,c=`name`;r&&!(c in a)&&i(a,c,{configurable:!0,get:function(){try{return o.call(this).match(s)[1]}catch{return``}}})}),b622:(function(e,t,n){var r=n(`da84`),i=n(`5692`),a=n(`5135`),o=n(`90e3`),s=n(`4930`),c=n(`fdbf`),l=i(`wks`),u=r.Symbol,d=c?u:u&&u.withoutSetter||o;e.exports=function(e){return a(l,e)||(s&&a(u,e)?l[e]=u[e]:l[e]=d(`Symbol.`+e)),l[e]}}),b64b:(function(e,t,n){var r=n(`23e7`),i=n(`7b0b`),a=n(`df75`);r({target:`Object`,stat:!0,forced:n(`d039`)(function(){a(1)})},{keys:function(e){return a(i(e))}})}),b727:(function(e,t,n){var r=n(`0366`),i=n(`44ad`),a=n(`7b0b`),o=n(`50c4`),s=n(`65f0`),c=[].push,l=function(e){var t=e==1,n=e==2,l=e==3,u=e==4,d=e==6,f=e==5||d;return function(p,m,h,g){for(var _=a(p),v=i(_),y=r(m,h,3),b=o(v.length),x=0,S=g||s,C=t?S(p,b):n?S(p,0):void 0,ee,w;b>x;x++)if((f||x in v)&&(ee=v[x],w=y(ee,x,_),e)){if(t)C[x]=w;else if(w)switch(e){case 3:return!0;case 5:return ee;case 6:return x;case 2:c.call(C,ee)}else if(u)return!1}return d?-1:l||u?u:C}};e.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6)}}),c04e:(function(e,t,n){var r=n(`861d`);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&typeof(n=e.toString)==`function`&&!r(i=n.call(e))||typeof(n=e.valueOf)==`function`&&!r(i=n.call(e))||!t&&typeof(n=e.toString)==`function`&&!r(i=n.call(e)))return i;throw TypeError(`Can't convert object to primitive value`)}}),c430:(function(e,t){e.exports=!1}),c6b6:(function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}}),c6cd:(function(e,t,n){var r=n(`da84`),i=n(`ce4e`),a=`__core-js_shared__`;e.exports=r[a]||i(a,{})}),c740:(function(e,t,n){"use strict";var r=n(`23e7`),i=n(`b727`).findIndex,a=n(`44d2`),o=n(`ae40`),s=`findIndex`,c=!0,l=o(s);s in[]&&[,][s](function(){c=!1}),r({target:`Array`,proto:!0,forced:c||!l},{findIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a(s)}),c8ba:(function(e,t){var n=(function(){return this})();try{n||=Function(`return this`)()}catch{typeof window==`object`&&(n=window)}e.exports=n}),c975:(function(e,t,n){"use strict";var r=n(`23e7`),i=n(`4d64`).indexOf,a=n(`a640`),o=n(`ae40`),s=[].indexOf,c=!!s&&1/[1].indexOf(1,-0)<0,l=a(`indexOf`),u=o(`indexOf`,{ACCESSORS:!0,1:0});r({target:`Array`,proto:!0,forced:c||!l||!u},{indexOf:function(e){return c?s.apply(this,arguments)||0:i(this,e,arguments.length>1?arguments[1]:void 0)}})}),ca84:(function(e,t,n){var r=n(`5135`),i=n(`fc6a`),a=n(`4d64`).indexOf,o=n(`d012`);e.exports=function(e,t){var n=i(e),s=0,c=[],l;for(l in n)!r(o,l)&&r(n,l)&&c.push(l);for(;t.length>s;)r(n,l=t[s++])&&(~a(c,l)||c.push(l));return c}}),caad:(function(e,t,n){"use strict";var r=n(`23e7`),i=n(`4d64`).includes,a=n(`44d2`);r({target:`Array`,proto:!0,forced:!n(`ae40`)(`indexOf`,{ACCESSORS:!0,1:0})},{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a(`includes`)}),cc12:(function(e,t,n){var r=n(`da84`),i=n(`861d`),a=r.document,o=i(a)&&i(a.createElement);e.exports=function(e){return o?a.createElement(e):{}}}),ce4e:(function(e,t,n){var r=n(`da84`),i=n(`9112`);e.exports=function(e,t){try{i(r,e,t)}catch{r[e]=t}return t}}),d012:(function(e,t){e.exports={}}),d039:(function(e,t){e.exports=function(e){try{return!!e()}catch{return!0}}}),d066:(function(e,t,n){var r=n(`428f`),i=n(`da84`),a=function(e){return typeof e==`function`?e:void 0};e.exports=function(e,t){return arguments.length<2?a(r[e])||a(i[e]):r[e]&&r[e][t]||i[e]&&i[e][t]}}),d1e7:(function(e,t,n){"use strict";var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor;t.f=i&&!r.call({1:2},1)?function(e){var t=i(this,e);return!!t&&t.enumerable}:r}),d28b:(function(e,t,n){n(`746f`)(`iterator`)}),d2bb:(function(e,t,n){var r=n(`825a`),i=n(`3bbe`);e.exports=Object.setPrototypeOf||(`__proto__`in{}?function(){var e=!1,t={},n;try{n=Object.getOwnPropertyDescriptor(Object.prototype,`__proto__`).set,n.call(t,[]),e=t instanceof Array}catch{}return function(t,a){return r(t),i(a),e?n.call(t,a):t.__proto__=a,t}}():void 0)}),d3b7:(function(e,t,n){var r=n(`00ee`),i=n(`6eeb`),a=n(`b041`);r||i(Object.prototype,`toString`,a,{unsafe:!0})}),d44e:(function(e,t,n){var r=n(`9bf2`).f,i=n(`5135`),a=n(`b622`)(`toStringTag`);e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,a)&&r(e,a,{configurable:!0,value:t})}}),d58f:(function(e,t,n){var r=n(`1c0b`),i=n(`7b0b`),a=n(`44ad`),o=n(`50c4`),s=function(e){return function(t,n,s,c){r(n);var l=i(t),u=a(l),d=o(l.length),f=e?d-1:0,p=e?-1:1;if(s<2)for(;;){if(f in u){c=u[f],f+=p;break}if(f+=p,e?f<0:d<=f)throw TypeError(`Reduce of empty array with no initial value`)}for(;e?f>=0:d>f;f+=p)f in u&&(c=n(c,u[f],f,l));return c}};e.exports={left:s(!1),right:s(!0)}}),d784:(function(e,t,n){"use strict";n(`ac1f`);var r=n(`6eeb`),i=n(`d039`),a=n(`b622`),o=n(`9263`),s=n(`9112`),c=a(`species`),l=!i(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:`7`},e},``.replace(e,`$<a>`)!==`7`}),u=(function(){return`a`.replace(/./,`$0`)===`$0`})(),d=a(`replace`),f=(function(){return/./[d]?/./[d](`a`,`$0`)===``:!1})(),p=!i(function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n=`ab`.split(e);return n.length!==2||n[0]!==`a`||n[1]!==`b`});e.exports=function(e,t,n,d){var m=a(e),h=!i(function(){var t={};return t[m]=function(){return 7},``[e](t)!=7}),g=h&&!i(function(){var t=!1,n=/a/;return e===`split`&&(n={},n.constructor={},n.constructor[c]=function(){return n},n.flags=``,n[m]=/./[m]),n.exec=function(){return t=!0,null},n[m](``),!t});if(!h||!g||e===`replace`&&!(l&&u&&!f)||e===`split`&&!p){var _=/./[m],v=n(m,``[e],function(e,t,n,r,i){return t.exec===o?h&&!i?{done:!0,value:_.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}},{REPLACE_KEEPS_$0:u,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:f}),y=v[0],b=v[1];r(String.prototype,e,y),r(RegExp.prototype,m,t==2?function(e,t){return b.call(e,this,t)}:function(e){return b.call(e,this)})}d&&s(RegExp.prototype[m],`sham`,!0)}}),d81d:(function(e,t,n){"use strict";var r=n(`23e7`),i=n(`b727`).map,a=n(`1dde`),o=n(`ae40`),s=a(`map`),c=o(`map`);r({target:`Array`,proto:!0,forced:!s||!c},{map:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})}),da84:(function(e,t,n){(function(t){var n=function(e){return e&&e.Math==Math&&e};e.exports=n(typeof globalThis==`object`&&globalThis)||n(typeof window==`object`&&window)||n(typeof self==`object`&&self)||n(typeof t==`object`&&t)||Function(`return this`)()}).call(this,n(`c8ba`))}),dbb4:(function(e,t,n){var r=n(`23e7`),i=n(`83ab`),a=n(`56ef`),o=n(`fc6a`),s=n(`06cf`),c=n(`8418`);r({target:`Object`,stat:!0,sham:!i},{getOwnPropertyDescriptors:function(e){for(var t=o(e),n=s.f,r=a(t),i={},l=0,u,d;r.length>l;)d=n(t,u=r[l++]),d!==void 0&&c(i,u,d);return i}})}),dbf1:(function(e,t,n){"use strict";(function(e){n.d(t,`a`,function(){return i});function r(){return typeof window<`u`?window.console:e.console}var i=r()}).call(this,n(`c8ba`))}),ddb0:(function(e,t,n){var r=n(`da84`),i=n(`fdbc`),a=n(`e260`),o=n(`9112`),s=n(`b622`),c=s(`iterator`),l=s(`toStringTag`),u=a.values;for(var d in i){var f=r[d],p=f&&f.prototype;if(p){if(p[c]!==u)try{o(p,c,u)}catch{p[c]=u}if(p[l]||o(p,l,d),i[d]){for(var m in a)if(p[m]!==a[m])try{o(p,m,a[m])}catch{p[m]=a[m]}}}}}),df75:(function(e,t,n){var r=n(`ca84`),i=n(`7839`);e.exports=Object.keys||function(e){return r(e,i)}}),e01a:(function(e,t,n){"use strict";var r=n(`23e7`),i=n(`83ab`),a=n(`da84`),o=n(`5135`),s=n(`861d`),c=n(`9bf2`).f,l=n(`e893`),u=a.Symbol;if(i&&typeof u==`function`&&(!(`description`in u.prototype)||u().description!==void 0)){var d={},f=function(){var e=arguments.length<1||arguments[0]===void 0?void 0:String(arguments[0]),t=this instanceof f?new u(e):e===void 0?u():u(e);return e===``&&(d[t]=!0),t};l(f,u);var p=f.prototype=u.prototype;p.constructor=f;var m=p.toString,h=String(u(`test`))==`Symbol(test)`,g=/^Symbol\((.*)\)[^)]+$/;c(p,`description`,{configurable:!0,get:function(){var e=s(this)?this.valueOf():this,t=m.call(e);if(o(d,e))return``;var n=h?t.slice(7,-1):t.replace(g,`$1`);return n===``?void 0:n}}),r({global:!0,forced:!0},{Symbol:f})}}),e163:(function(e,t,n){var r=n(`5135`),i=n(`7b0b`),a=n(`f772`),o=n(`e177`),s=a(`IE_PROTO`),c=Object.prototype;e.exports=o?Object.getPrototypeOf:function(e){return e=i(e),r(e,s)?e[s]:typeof e.constructor==`function`&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?c:null}}),e177:(function(e,t,n){e.exports=!n(`d039`)(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})}),e260:(function(e,t,n){"use strict";var r=n(`fc6a`),i=n(`44d2`),a=n(`3f8c`),o=n(`69f3`),s=n(`7dd0`),c=`Array Iterator`,l=o.set,u=o.getterFor(c);e.exports=s(Array,`Array`,function(e,t){l(this,{type:c,target:r(e),index:0,kind:t})},function(){var e=u(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):n==`keys`?{value:r,done:!1}:n==`values`?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}},`values`),a.Arguments=a.Array,i(`keys`),i(`values`),i(`entries`)}),e439:(function(e,t,n){var r=n(`23e7`),i=n(`d039`),a=n(`fc6a`),o=n(`06cf`).f,s=n(`83ab`),c=i(function(){o(1)});r({target:`Object`,stat:!0,forced:!s||c,sham:!s},{getOwnPropertyDescriptor:function(e,t){return o(a(e),t)}})}),e538:(function(e,t,n){t.f=n(`b622`)}),e893:(function(e,t,n){var r=n(`5135`),i=n(`56ef`),a=n(`06cf`),o=n(`9bf2`);e.exports=function(e,t){for(var n=i(t),s=o.f,c=a.f,l=0;l<n.length;l++){var u=n[l];r(e,u)||s(e,u,c(t,u))}}}),e8b5:(function(e,t,n){var r=n(`c6b6`);e.exports=Array.isArray||function(e){return r(e)==`Array`}}),e95a:(function(e,t,n){var r=n(`b622`),i=n(`3f8c`),a=r(`iterator`),o=Array.prototype;e.exports=function(e){return e!==void 0&&(i.Array===e||o[a]===e)}}),f5df:(function(e,t,n){var r=n(`00ee`),i=n(`c6b6`),a=n(`b622`)(`toStringTag`),o=i(function(){return arguments}())==`Arguments`,s=function(e,t){try{return e[t]}catch{}};e.exports=r?i:function(e){var t,n,r;return e===void 0?`Undefined`:e===null?`Null`:typeof(n=s(t=Object(e),a))==`string`?n:o?i(t):(r=i(t))==`Object`&&typeof t.callee==`function`?`Arguments`:r}}),f772:(function(e,t,n){var r=n(`5692`),i=n(`90e3`),a=r(`keys`);e.exports=function(e){return a[e]||(a[e]=i(e))}}),fb15:(function(e,t,n){"use strict";if(n.r(t),typeof window<`u`){var r=window.document.currentScript,i=n(`8875`);r=i(),`currentScript`in document||Object.defineProperty(document,`currentScript`,{get:i});var a=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);a&&(n.p=a[1])}n(`99af`),n(`4de4`),n(`4160`),n(`c975`),n(`d81d`),n(`a434`),n(`159b`),n(`a4d3`),n(`e439`),n(`dbb4`),n(`b64b`);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?s(Object(n),!0).forEach(function(t){o(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function l(e){if(Array.isArray(e))return e}n(`e01a`),n(`d28b`),n(`e260`),n(`d3b7`),n(`3ca3`),n(`ddb0`);function u(e,t){if(!(typeof Symbol>`u`||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return!=null&&o.return()}finally{if(i)throw a}}return n}}n(`a630`),n(`fb6a`),n(`b0c0`),n(`25f0`);function d(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function f(e,t){if(e){if(typeof e==`string`)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}}function p(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
160
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function m(e,t){return l(e)||u(e,t)||f(e,t)||p()}function h(e){if(Array.isArray(e))return d(e)}function g(e){if(typeof Symbol<`u`&&Symbol.iterator in Object(e))return Array.from(e)}function _(){throw TypeError(`Invalid attempt to spread non-iterable instance.
161
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v(e){return h(e)||g(e)||f(e)||_()}var y=n(`a352`),b=n.n(y);function x(e){e.parentElement!==null&&e.parentElement.removeChild(e)}function S(e,t,n){var r=n===0?e.children[0]:e.children[n-1].nextSibling;e.insertBefore(t,r)}var C=n(`dbf1`);n(`13d5`),n(`4fad`),n(`ac1f`),n(`5319`);function ee(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var w=/-(\w)/g,T=ee(function(e){return e.replace(w,function(e,t){return t.toUpperCase()})});n(`5db7`),n(`73d9`);var te=[`Start`,`Add`,`Remove`,`Update`,`End`],E=[`Choose`,`Unchoose`,`Sort`,`Filter`,`Clone`],ne=[`Move`],re=[ne,te,E].flatMap(function(e){return e}).map(function(e){return`on${e}`}),ie={manage:ne,manageAndEmit:te,emit:E};function ae(e){return re.indexOf(e)!==-1}n(`caad`),n(`2ca0`);var oe=`a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.link.main.map.mark.math.menu.menuitem.meta.meter.nav.noscript.object.ol.optgroup.option.output.p.param.picture.pre.progress.q.rb.rp.rt.rtc.ruby.s.samp.script.section.select.slot.small.source.span.strong.style.sub.summary.sup.svg.table.tbody.td.template.textarea.tfoot.th.thead.time.title.tr.track.u.ul.var.video.wbr`.split(`.`);function se(e){return oe.includes(e)}function ce(e){return[`transition-group`,`TransitionGroup`].includes(e)}function le(e){return[`id`,`class`,`role`,`style`].includes(e)||e.startsWith(`data-`)||e.startsWith(`aria-`)||e.startsWith(`on`)}function ue(e){return e.reduce(function(e,t){var n=m(t,2),r=n[0];return e[r]=n[1],e},{})}function de(e){var t=e.$attrs,n=e.componentData,r=n===void 0?{}:n;return c(c({},ue(Object.entries(t).filter(function(e){var t=m(e,2),n=t[0];return t[1],le(n)}))),r)}function fe(e){var t=e.$attrs,n=e.callBackBuilder,r=ue(pe(t));Object.entries(n).forEach(function(e){var t=m(e,2),n=t[0],i=t[1];ie[n].forEach(function(e){r[`on${e}`]=i(e)})});var i=`[data-draggable]${r.draggable||``}`;return c(c({},r),{},{draggable:i})}function pe(e){return Object.entries(e).filter(function(e){var t=m(e,2),n=t[0];return t[1],!le(n)}).map(function(e){var t=m(e,2),n=t[0],r=t[1];return[T(n),r]}).filter(function(e){var t=m(e,2),n=t[0];return t[1],!ae(n)})}n(`c740`);function me(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function he(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ge(e,t,n){return t&&he(e.prototype,t),n&&he(e,n),e}var _e=function(e){return e.el},ve=function(e,t){return e.__draggable_context=t},ye=function(e){return e.__draggable_context},be=function(){function e(t){var n=t.nodes,r=n.header,i=n.default,a=n.footer,o=t.root,s=t.realList;me(this,e),this.defaultNodes=i,this.children=[].concat(v(r),v(i),v(a)),this.externalComponent=o.externalComponent,this.rootTransition=o.transition,this.tag=o.tag,this.realList=s}return ge(e,[{key:`render`,value:function(e,t){var n=this.tag,r=this.children;return e(n,t,this._isRootComponent?{default:function(){return r}}:r)}},{key:`updated`,value:function(){var e=this.defaultNodes,t=this.realList;e.forEach(function(e,n){ve(_e(e),{element:t[n],index:n})})}},{key:`getUnderlyingVm`,value:function(e){return ye(e)}},{key:`getVmIndexFromDomIndex`,value:function(e,t){var n=this.defaultNodes,r=n.length,i=t.children,a=i.item(e);if(a===null)return r;var o=ye(a);if(o)return o.index;if(r===0)return 0;var s=_e(n[0]);return e<v(i).findIndex(function(e){return e===s})?0:r}},{key:`_isRootComponent`,get:function(){return this.externalComponent||this.rootTransition}}]),e}(),xe=n(`8bbf`);function Se(e,t){var n=e[t];return n?n():[]}function Ce(e){var t=e.$slots,n=e.realList,r=e.getKey,i=n||[],a=m([`header`,`footer`].map(function(e){return Se(t,e)}),2),o=a[0],s=a[1],l=t.item;if(!l)throw Error(`draggable element must have an item slot`);var u=i.flatMap(function(e,t){return l({element:e,index:t}).map(function(t){return t.key=r(e),t.props=c(c({},t.props||{}),{},{"data-draggable":!0}),t})});if(u.length!==i.length)throw Error(`Item slot must have only one child`);return{header:o,footer:s,default:u}}function we(e){var t=ce(e),n=!se(e)&&!t;return{transition:t,externalComponent:n,tag:n?(0,xe.resolveComponent)(e):t?xe.TransitionGroup:e}}function Te(e){var t=e.$slots,n=e.tag,r=e.realList,i=e.getKey;return new be({nodes:Ce({$slots:t,realList:r,getKey:i}),root:we(n),realList:r})}function Ee(e,t){var n=this;(0,xe.nextTick)(function(){return n.$emit(e.toLowerCase(),t)})}function De(e){var t=this;return function(n,r){if(t.realList!==null)return t[`onDrag${e}`](n,r)}}function Oe(e){var t=this,n=De.call(this,e);return function(r,i){n.call(t,r,i),Ee.call(t,e,r)}}var ke=null,Ae={list:{type:Array,required:!1,default:null},modelValue:{type:Array,required:!1,default:null},itemKey:{type:[String,Function],required:!0},clone:{type:Function,default:function(e){return e}},tag:{type:String,default:`div`},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null}},je=[`update:modelValue`,`change`].concat(v([].concat(v(ie.manageAndEmit),v(ie.emit)).map(function(e){return e.toLowerCase()})));t.default=(0,xe.defineComponent)({name:`draggable`,inheritAttrs:!1,props:Ae,emits:je,data:function(){return{error:!1}},render:function(){try{this.error=!1;var e=this.$slots,t=this.$attrs,n=this.tag,r=this.componentData,i=this.realList,a=this.getKey,o=Te({$slots:e,tag:n,realList:i,getKey:a});this.componentStructure=o;var s=de({$attrs:t,componentData:r});return o.render(xe.h,s)}catch(e){return this.error=!0,(0,xe.h)(`pre`,{style:{color:`red`}},e.stack)}},created:function(){this.list!==null&&this.modelValue!==null&&C.a.error(`modelValue and list props are mutually exclusive! Please set one or another.`)},mounted:function(){var e=this;if(!this.error){var t=this.$attrs,n=this.$el;this.componentStructure.updated();var r=fe({$attrs:t,callBackBuilder:{manageAndEmit:function(t){return Oe.call(e,t)},emit:function(t){return Ee.bind(e,t)},manage:function(t){return De.call(e,t)}}}),i=n.nodeType===1?n:n.parentElement;this._sortable=new b.a(i,r),this.targetDomElement=i,i.__draggable_component__=this}},updated:function(){this.componentStructure.updated()},beforeUnmount:function(){this._sortable!==void 0&&this._sortable.destroy()},computed:{realList:function(){return this.list||this.modelValue},getKey:function(){var e=this.itemKey;return typeof e==`function`?e:function(t){return t[e]}}},watch:{$attrs:{handler:function(e){var t=this._sortable;t&&pe(e).forEach(function(e){var n=m(e,2),r=n[0],i=n[1];t.option(r,i)})},deep:!0}},methods:{getUnderlyingVm:function(e){return this.componentStructure.getUnderlyingVm(e)||null},getUnderlyingPotencialDraggableComponent:function(e){return e.__draggable_component__},emitChanges:function(e){var t=this;(0,xe.nextTick)(function(){return t.$emit(`change`,e)})},alterList:function(e){if(this.list){e(this.list);return}var t=v(this.modelValue);e(t),this.$emit(`update:modelValue`,t)},spliceList:function(){var e=arguments;this.alterList(function(t){return t.splice.apply(t,v(e))})},updatePosition:function(e,t){this.alterList(function(n){return n.splice(t,0,n.splice(e,1)[0])})},getRelatedContextFromMoveEvent:function(e){var t=e.to,n=e.related,r=this.getUnderlyingPotencialDraggableComponent(t);if(!r)return{component:r};var i=r.realList,a={list:i,component:r};return t!==n&&i?c(c({},r.getUnderlyingVm(n)||{}),a):a},getVmIndexFromDomIndex:function(e){return this.componentStructure.getVmIndexFromDomIndex(e,this.targetDomElement)},onDragStart:function(e){this.context=this.getUnderlyingVm(e.item),e.item._underlying_vm_=this.clone(this.context.element),ke=e.item},onDragAdd:function(e){var t=e.item._underlying_vm_;if(t!==void 0){x(e.item);var n=this.getVmIndexFromDomIndex(e.newIndex);this.spliceList(n,0,t);var r={element:t,newIndex:n};this.emitChanges({added:r})}},onDragRemove:function(e){if(S(this.$el,e.item,e.oldIndex),e.pullMode===`clone`){x(e.clone);return}var t=this.context,n=t.index,r=t.element;this.spliceList(n,1);var i={element:r,oldIndex:n};this.emitChanges({removed:i})},onDragUpdate:function(e){x(e.item),S(e.from,e.item,e.oldIndex);var t=this.context.index,n=this.getVmIndexFromDomIndex(e.newIndex);this.updatePosition(t,n);var r={element:this.context.element,oldIndex:t,newIndex:n};this.emitChanges({moved:r})},computeFutureIndex:function(e,t){if(!e.element)return 0;var n=v(t.to.children).filter(function(e){return e.style.display!==`none`}),r=n.indexOf(t.related),i=e.component.getVmIndexFromDomIndex(r);return n.indexOf(ke)!==-1||!t.willInsertAfter?i:i+1},onDragMove:function(e,t){var n=this.move,r=this.realList;if(!n||!r)return!0;var i=this.getRelatedContextFromMoveEvent(e),a=this.computeFutureIndex(i,e),o=c(c({},this.context),{},{futureIndex:a});return n(c(c({},e),{},{relatedContext:i,draggedContext:o}),t)},onDragEnd:function(){ke=null}}})}),fb6a:(function(e,t,n){"use strict";var r=n(`23e7`),i=n(`861d`),a=n(`e8b5`),o=n(`23cb`),s=n(`50c4`),c=n(`fc6a`),l=n(`8418`),u=n(`b622`),d=n(`1dde`),f=n(`ae40`),p=d(`slice`),m=f(`slice`,{ACCESSORS:!0,0:0,1:2}),h=u(`species`),g=[].slice,_=Math.max;r({target:`Array`,proto:!0,forced:!p||!m},{slice:function(e,t){var n=c(this),r=s(n.length),u=o(e,r),d=o(t===void 0?r:t,r),f,p,m;if(a(n)&&(f=n.constructor,typeof f==`function`&&(f===Array||a(f.prototype))?f=void 0:i(f)&&(f=f[h],f===null&&(f=void 0)),f===Array||f===void 0))return g.call(n,u,d);for(p=new(f===void 0?Array:f)(_(d-u,0)),m=0;u<d;u++,m++)u in n&&l(p,m,n[u]);return p.length=m,p}})}),fc6a:(function(e,t,n){var r=n(`44ad`),i=n(`1d80`);e.exports=function(e){return r(i(e))}}),fdbc:(function(e,t){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}}),fdbf:(function(e,t,n){e.exports=n(`4930`)&&!Symbol.sham&&typeof Symbol.iterator==`symbol`})}).default})})),tz,nz,rz,iz,az,oz=d((()=>{XF(),Ks(),Xp(),tm(),Cm(),mI(),AF(),Rp(),NF(),tz=h(ez(),1),D(),nz={class:`tpl:w-full`},rz={class:`tpl:flex tpl:gap-0`},iz={key:0,"data-testid":`section-drop-hint`,class:`tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:flex tpl:items-center tpl:justify-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]`},az=(0,t.defineComponent)({__name:`SectionBlock`,props:{block:{},viewport:{}},setup(e){let n={title:pI,paragraph:kF,image:Sm,button:Gs,divider:em,custom:Yp},r=e,{t:i}=O(),a=ke(je,`SectionBlock`),o=(0,t.inject)(Pe,null),s=(0,t.inject)(ze,null),c=(0,t.computed)(()=>{switch(r.block.columns){case`2`:return[`50%`,`50%`];case`3`:return[`33.33%`,`33.33%`,`33.33%`];case`1-2`:return[`33.33%`,`66.67%`];case`2-1`:return[`66.67%`,`33.33%`];default:return[`100%`]}}),l=(0,t.computed)(()=>{let e=c.value.length,t=[...r.block.children];for(;t.length<e;)t.push([]);return t.slice(0,e)});function u(e){return l.value[e]||[]}function d(e,t){let n=[...r.block.children];for(;n.length<=e;)n.push([]);n[e]=t,a.updateBlock(r.block.id,{children:n})}function f(e){return jF(e,s,n)}function p(e,t){e.type===`custom`&&a.updateBlock(e.id,{fieldValues:t.fieldValues,dataSourceFetched:t.dataSourceFetched})}return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,nz,[(0,t.createElementVNode)(`div`,rz,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(l.value,(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:r,class:(0,t.normalizeClass)([`tpl:relative tpl:min-h-[60px] tpl:rounded`,u(r).length===0?`tpl:border tpl:border-dashed tpl:border-[var(--tpl-border)]`:``]),style:(0,t.normalizeStyle)({width:c.value[r]})},[(0,t.createVNode)((0,t.unref)(tz.default),{"model-value":u(r),group:{name:`blocks`,pull:!0,put:(e,t,n)=>n.dataset.blockType!==`section`},"item-key":`id`,animation:150,"ghost-class":`tpl-ghost`,"empty-insert-threshold":20,class:`tpl:min-h-[60px]`,"onUpdate:modelValue":e=>d(r,e)},{item:(0,t.withCtx)(({element:n})=>[(0,t.withDirectives)((0,t.createElementVNode)(`div`,null,[(0,t.createVNode)(YF,{block:n,"is-selected":(0,t.unref)(a).state.selectedBlockId===n.id,viewport:e.viewport,onSelect:e=>(0,t.unref)(a).selectBlock(n.id)},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(f(n)),{block:n,viewport:e.viewport,onFetchData:e=>p(n,e)},null,40,[`block`,`viewport`,`onFetchData`]))]),_:2},1032,[`block`,`is-selected`,`viewport`,`onSelect`])],512),[[t.vShow,!(0,t.unref)(o)?.isHidden(n.id)]])]),_:1},8,[`model-value`,`group`,`onUpdate:modelValue`]),u(r).length===0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,iz,[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(i).section.dropHere),1)])):(0,t.createCommentVNode)(``,!0)],6))),128))])]))}})})),sz,cz=d((()=>{oz(),oz(),sz=az})),lz,uz,dz,fz=d((()=>{lz={facebook:{name:`Facebook`,color:`#1877F2`,path:`M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z`},twitter:{name:`X`,color:`#000000`,path:`M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z`},instagram:{name:`Instagram`,color:`#E4405F`,path:`M12 0C8.74 0 8.333.015 7.053.072 5.775.132 4.905.333 4.14.63c-.789.306-1.459.717-2.126 1.384S.935 3.35.63 4.14C.333 4.905.131 5.775.072 7.053.012 8.333 0 8.74 0 12s.015 3.667.072 4.947c.06 1.277.261 2.148.558 2.913.306.788.717 1.459 1.384 2.126.667.666 1.336 1.079 2.126 1.384.766.296 1.636.499 2.913.558C8.333 23.988 8.74 24 12 24s3.667-.015 4.947-.072c1.277-.06 2.148-.262 2.913-.558.788-.306 1.459-.718 2.126-1.384.666-.667 1.079-1.335 1.384-2.126.296-.765.499-1.636.558-2.913.06-1.28.072-1.687.072-4.947s-.015-3.667-.072-4.947c-.06-1.277-.262-2.149-.558-2.913-.306-.789-.718-1.459-1.384-2.126C21.319 1.347 20.651.935 19.86.63c-.765-.297-1.636-.499-2.913-.558C15.667.012 15.26 0 12 0zm0 2.16c3.203 0 3.585.016 4.85.071 1.17.055 1.805.249 2.227.415.562.217.96.477 1.382.896.419.42.679.819.896 1.381.164.422.36 1.057.413 2.227.057 1.266.07 1.646.07 4.85s-.015 3.585-.074 4.85c-.061 1.17-.256 1.805-.421 2.227-.224.562-.479.96-.899 1.382-.419.419-.824.679-1.38.896-.42.164-1.065.36-2.235.413-1.274.057-1.649.07-4.859.07-3.211 0-3.586-.015-4.859-.074-1.171-.061-1.816-.256-2.236-.421-.569-.224-.96-.479-1.379-.899-.421-.419-.69-.824-.9-1.38-.165-.42-.359-1.065-.42-2.235-.045-1.26-.061-1.649-.061-4.844 0-3.196.016-3.586.061-4.861.061-1.17.255-1.814.42-2.234.21-.57.479-.96.9-1.381.419-.419.81-.689 1.379-.898.42-.166 1.051-.361 2.221-.421 1.275-.045 1.65-.06 4.859-.06l.045.03zm0 3.678c-3.405 0-6.162 2.76-6.162 6.162 0 3.405 2.76 6.162 6.162 6.162 3.405 0 6.162-2.76 6.162-6.162 0-3.405-2.76-6.162-6.162-6.162zM12 16c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4zm7.846-10.405c0 .795-.646 1.44-1.44 1.44-.795 0-1.44-.646-1.44-1.44 0-.794.646-1.439 1.44-1.439.793-.001 1.44.645 1.44 1.439z`},linkedin:{name:`LinkedIn`,color:`#0A66C2`,path:`M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z`},youtube:{name:`YouTube`,color:`#FF0000`,path:`M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z`},tiktok:{name:`TikTok`,color:`#000000`,path:`M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z`},pinterest:{name:`Pinterest`,color:`#BD081C`,path:`M12 0C5.373 0 0 5.372 0 12c0 5.084 3.163 9.426 7.627 11.174-.105-.949-.2-2.405.042-3.441.218-.937 1.407-5.965 1.407-5.965s-.359-.719-.359-1.782c0-1.668.967-2.914 2.171-2.914 1.023 0 1.518.769 1.518 1.69 0 1.029-.655 2.568-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.133 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.138.893 2.738.098.119.112.224.083.345l-.333 1.36c-.053.22-.174.267-.402.161-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.359-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146C9.57 23.812 10.763 24 12 24c6.627 0 12-5.373 12-12 0-6.628-5.373-12-12-12z`},email:{name:`Email`,color:`#6B7280`,path:`M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z`},whatsapp:{name:`WhatsApp`,color:`#25D366`,path:`M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z`},telegram:{name:`Telegram`,color:`#26A5E4`,path:`M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z`},discord:{name:`Discord`,color:`#5865F2`,path:`M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189z`},snapchat:{name:`Snapchat`,color:`#FFFC00`,path:`M12.017 0C5.396 0 .029 5.367.029 11.987c0 5.079 3.158 9.417 7.618 11.162-.105-.949-.199-2.403.041-3.439.219-.937 1.406-5.957 1.406-5.957s-.359-.72-.359-1.781c0-1.668.967-2.914 2.171-2.914 1.023 0 1.518.769 1.518 1.69 0 1.029-.655 2.568-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.133 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.138.893 2.738a.36.36 0 01.083.345l-.333 1.36c-.053.22-.174.267-.402.161-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.359-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146 1.124.347 2.317.535 3.554.535 6.627 0 12.017-5.373 12.017-12.001C24.034 5.367 18.644 0 12.017 0z`},reddit:{name:`Reddit`,color:`#FF4500`,path:`M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm5.01 4.744c.688 0 1.25.561 1.25 1.249a1.25 1.25 0 0 1-2.498.056l-2.597-.547-.8 3.747c1.824.07 3.48.632 4.674 1.488.308-.309.73-.491 1.207-.491.968 0 1.754.786 1.754 1.754 0 .716-.435 1.333-1.01 1.614a3.111 3.111 0 0 1 .042.52c0 2.694-3.13 4.87-7.004 4.87-3.874 0-7.004-2.176-7.004-4.87 0-.183.015-.366.043-.534A1.748 1.748 0 0 1 4.028 12c0-.968.786-1.754 1.754-1.754.463 0 .898.196 1.207.49 1.207-.883 2.878-1.43 4.744-1.487l.885-4.182a.342.342 0 0 1 .14-.197.35.35 0 0 1 .238-.042l2.906.617a1.214 1.214 0 0 1 1.108-.701zM9.25 12C8.561 12 8 12.562 8 13.25c0 .687.561 1.248 1.25 1.248.687 0 1.248-.561 1.248-1.249 0-.688-.561-1.249-1.249-1.249zm5.5 0c-.687 0-1.248.561-1.248 1.25 0 .687.561 1.248 1.249 1.248.688 0 1.249-.561 1.249-1.249 0-.687-.562-1.249-1.25-1.249zm-5.466 3.99a.327.327 0 0 0-.231.094.33.33 0 0 0 0 .463c.842.842 2.484.913 2.961.913.477 0 2.105-.056 2.961-.913a.361.361 0 0 0 .029-.463.33.33 0 0 0-.464 0c-.547.533-1.684.73-2.512.73-.828 0-1.979-.196-2.512-.73a.326.326 0 0 0-.232-.095z`},github:{name:`GitHub`,color:`#181717`,path:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`},dribbble:{name:`Dribbble`,color:`#EA4C89`,path:`M12 24C5.385 24 0 18.615 0 12S5.385 0 12 0s12 5.385 12 12-5.385 12-12 12zm10.12-10.358c-.35-.11-3.17-.953-6.384-.438 1.34 3.684 1.887 6.684 1.992 7.308 2.3-1.555 3.936-4.02 4.392-6.87zm-6.115 7.808c-.153-.9-.75-4.032-2.19-7.77l-.066.02c-5.79 2.015-7.86 6.025-8.04 6.4 1.73 1.358 3.92 2.166 6.29 2.166 1.42 0 2.77-.29 4-.814zm-11.62-2.58c.232-.4 3.045-5.055 8.332-6.765.135-.045.27-.084.405-.12-.26-.585-.54-1.167-.832-1.74C7.17 11.775 2.206 11.71 1.756 11.7l-.004.312c0 2.633.998 5.037 2.634 6.855zm-2.42-8.955c.46.008 4.683.026 9.477-1.248-1.698-3.018-3.53-5.558-3.8-5.928-2.868 1.35-5.01 3.99-5.676 7.17zM9.6 2.052c.282.38 2.145 2.914 3.822 6 3.645-1.365 5.19-3.44 5.373-3.702-1.81-1.61-4.19-2.586-6.795-2.586-.825 0-1.63.1-2.4.285zm10.335 3.483c-.218.29-1.935 2.493-5.724 4.04.24.49.47.985.68 1.486.08.18.15.36.22.53 3.41-.43 6.8.26 7.14.33-.02-2.42-.88-4.64-2.31-6.38z`},behance:{name:`Behance`,color:`#1769FF`,path:`M22 7h-7V5h7v2zm1.726 10c-.442 1.297-2.029 3-5.101 3-3.074 0-5.564-1.729-5.564-5.675 0-3.91 2.325-5.92 5.466-5.92 3.082 0 4.964 1.782 5.375 4.426.078.506.109 1.188.095 2.14H15.97c.13 3.211 3.483 3.312 4.588 2.029h3.168zm-7.686-4h4.965c-.105-1.547-1.136-2.219-2.477-2.219-1.466 0-2.277.768-2.488 2.219zm-9.574 6.988H0V5.021h6.953c5.476.081 5.58 5.444 2.72 6.906 3.461 1.26 3.577 8.061-3.207 8.061zM3 11h3.584c2.508 0 2.906-3-.312-3H3v3zm3.391 3H3v3.016h3.341c3.055 0 2.868-3.016.05-3.016z`}},uz={small:24,medium:32,large:48},dz=[`facebook`,`twitter`,`instagram`,`linkedin`,`youtube`,`tiktok`,`pinterest`,`email`,`whatsapp`,`telegram`,`discord`,`snapchat`,`reddit`,`github`,`dribbble`,`behance`]})),pz,mz,hz,gz=d((()=>{fz(),pz=[`width`,`height`,`fill`],mz=[`d`],hz=(0,t.defineComponent)({__name:`SocialIconSvg`,props:{platform:{},iconStyle:{},iconSize:{}},setup(e){let n=e,r=(0,t.computed)(()=>lz[n.platform]),i=(0,t.computed)(()=>uz[n.iconSize]),a=(0,t.computed)(()=>{let e={display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:`${i.value}px`,height:`${i.value}px`};switch(n.iconStyle){case`solid`:return{...e,backgroundColor:r.value.color,borderRadius:`4px`};case`outlined`:return{...e,backgroundColor:`transparent`,border:`2px solid ${r.value.color}`,borderRadius:`4px`};case`rounded`:return{...e,backgroundColor:r.value.color,borderRadius:`8px`};case`square`:return{...e,backgroundColor:r.value.color,borderRadius:`0`};case`circle`:return{...e,backgroundColor:r.value.color,borderRadius:`50%`};default:return e}}),o=(0,t.computed)(()=>Math.floor(i.value*.6)),s=(0,t.computed)(()=>n.iconStyle===`outlined`?r.value.color:`#ffffff`);return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{style:(0,t.normalizeStyle)(a.value)},[((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,{width:o.value,height:o.value,viewBox:`0 0 24 24`,fill:s.value,xmlns:`http://www.w3.org/2000/svg`},[(0,t.createElementVNode)(`path`,{d:r.value.path},null,8,mz)],8,pz))],4))}})})),_z,vz=d((()=>{gz(),gz(),_z=hz})),yz,bz,xz,Sz,Cz=d((()=>{vz(),k(),F(),yz={class:`tpl:w-full`},bz=[`href`],xz={key:1,class:`tpl:flex tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:text-sm tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text-dim)]`},Sz=(0,t.defineComponent)({__name:`SocialIconsBlock`,props:{block:{},viewport:{}},setup(e){let n=e,{t:r}=O(),i=(0,t.computed)(()=>({display:`flex`,flexWrap:`wrap`,gap:`${n.block.spacing}px`,justifyContent:n.block.align===`left`?`flex-start`:n.block.align===`right`?`flex-end`:`center`})),a=(0,t.computed)(()=>n.block.icons.length>0);return(n,o)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,yz,[a.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,style:(0,t.normalizeStyle)(i.value)},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.block.icons,n=>((0,t.openBlock)(),(0,t.createElementBlock)(`a`,{key:n.id,href:n.url||`#`,class:`tpl:cursor-default`,onClick:o[0]||=(0,t.withModifiers)(()=>{},[`prevent`])},[(0,t.createVNode)(_z,{platform:n.platform,"icon-style":e.block.iconStyle,"icon-size":e.block.iconSize},null,8,[`platform`,`icon-style`,`icon-size`])],8,bz))),128))],4)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,xz,[(0,t.createVNode)((0,t.unref)(Dd),{size:16}),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(r).social.addIcons),1)]))]))}})})),wz,Tz=d((()=>{Cz(),Cz(),wz=Sz})),Ez,Dz,Oz,kz=d((()=>{D(),Ez={class:`tpl:w-full`},Dz={key:0,class:`tpl:absolute tpl:rounded tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium`,style:{"background-color":`var(--tpl-bg-hover)`,color:`var(--tpl-text-dim)`}},Oz=(0,t.defineComponent)({__name:`SpacerBlock`,props:{block:{},viewport:{}},setup(e){let n=e,r=ke(je,`SpacerBlock`),i=(0,t.computed)(()=>({height:`${n.block.height}px`,minHeight:`${n.block.height}px`,...r.state.previewMode?{}:{borderColor:`var(--tpl-border)`}}));return(n,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Ez,[(0,t.createElementVNode)(`div`,{style:(0,t.normalizeStyle)(i.value),class:(0,t.normalizeClass)([`tpl:relative tpl:flex tpl:items-center tpl:justify-center`,{"tpl:border-y tpl:border-dashed":!(0,t.unref)(r).state.previewMode}])},[(0,t.unref)(r).state.previewMode?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Dz,(0,t.toDisplayString)(e.block.height)+`px `,1))],6)]))}})})),Az,jz=d((()=>{kz(),kz(),Az=Oz})),Mz,Nz,Pz,Fz,Iz,Lz,Rz=d((()=>{k(),F(),D(),Mz={class:`tpl:w-full`},Nz={key:0},Pz=[`aria-label`,`data-placeholder`,`onBlur`,`textContent`],Fz=[`aria-label`,`data-placeholder`,`onBlur`,`textContent`],Iz={key:1,class:`tpl:flex tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:text-sm tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text-dim)]`},Lz=(0,t.defineComponent)({__name:`TableBlock`,props:{block:{},viewport:{}},setup(e){let n=e,{t:r}=O(),i=ke(je,`TableBlock`),a=(0,t.computed)(()=>n.block.rows.length>0),o=(0,t.computed)(()=>({width:`100%`,borderCollapse:`collapse`,fontSize:`${n.block.fontSize}px`,color:n.block.color,textAlign:n.block.textAlign,fontFamily:n.block.fontFamily||`inherit`})),s=(0,t.computed)(()=>({border:`${n.block.borderWidth}px solid ${n.block.borderColor}`,padding:`${n.block.cellPadding}px`,textAlign:n.block.textAlign})),c=(0,t.computed)(()=>({...s.value,fontWeight:`bold`,backgroundColor:n.block.headerBackgroundColor||`transparent`})),l=(0,t.computed)(()=>n.block.hasHeaderRow&&n.block.rows.length>0?n.block.rows[0]:null),u=(0,t.computed)(()=>n.block.hasHeaderRow?n.block.rows.slice(1):n.block.rows);function d(){i.selectBlock(n.block.id)}function f(e,t,r){let a=r.target.innerText.trim(),o=n.block.rows.map(n=>n.id===e?{...n,cells:n.cells.map(e=>e.id===t?{...e,content:a}:e)}:n);i.updateBlock(n.block.id,{rows:o})}return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Mz,[a.value?((0,t.openBlock)(),(0,t.createElementBlock)(`table`,{key:0,style:(0,t.normalizeStyle)(o.value),class:`tpl-table-editable`},[l.value?((0,t.openBlock)(),(0,t.createElementBlock)(`thead`,Nz,[(0,t.createElementVNode)(`tr`,null,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(l.value.cells,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`th`,{key:e.id,style:(0,t.normalizeStyle)(c.value),"aria-label":(0,t.unref)(r).table.cellPlaceholder,contenteditable:`true`,"data-placeholder":(0,t.unref)(r).table.cellPlaceholder,onBlur:t=>f(l.value.id,e.id,t),onKeydown:n[0]||=(0,t.withKeys)((0,t.withModifiers)(e=>e.target.blur(),[`prevent`]),[`enter`]),onClick:(0,t.withModifiers)(d,[`stop`]),textContent:(0,t.toDisplayString)(e.content)},null,44,Pz))),128))])])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`tbody`,null,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(u.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`tr`,{key:e.id},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.cells,i=>((0,t.openBlock)(),(0,t.createElementBlock)(`td`,{key:i.id,style:(0,t.normalizeStyle)(s.value),"aria-label":(0,t.unref)(r).table.cellPlaceholder,contenteditable:`true`,"data-placeholder":(0,t.unref)(r).table.cellPlaceholder,onBlur:t=>f(e.id,i.id,t),onKeydown:n[1]||=(0,t.withKeys)((0,t.withModifiers)(e=>e.target.blur(),[`prevent`]),[`enter`]),onClick:(0,t.withModifiers)(d,[`stop`]),textContent:(0,t.toDisplayString)(i.content)},null,44,Fz))),128))]))),128))])],4)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Iz,[(0,t.createVNode)((0,t.unref)(uf),{size:16}),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(r).table.empty),1)]))]))}})})),zz=d((()=>{})),Bz,Vz=d((()=>{Rz(),Rz(),zz(),dp(),Bz=up(Lz,[[`__scopeId`,`data-v-dfc60174`]])})),Hz,Uz=d((()=>{Hz=(0,t.defineComponent)({__name:`VideoPlayButton`,props:{hoverEffect:{type:Boolean,default:!1}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`tpl:absolute tpl:inset-0 tpl:flex tpl:items-center tpl:justify-center tpl:bg-black/30`,e.hoverEffect&&`tpl:transition-opacity tpl:group-hover:bg-black/40`])},[...r[0]||=[(0,t.createElementVNode)(`div`,{class:`tpl:flex tpl:size-16 tpl:items-center tpl:justify-center tpl:rounded-full tpl:bg-white/90 tpl:shadow-lg`},[(0,t.createElementVNode)(`svg`,{class:`tpl:ml-1 tpl:text-[var(--tpl-danger)]`,width:`28`,height:`28`,viewBox:`0 0 24 24`,fill:`currentColor`},[(0,t.createElementVNode)(`polygon`,{points:`5,3 19,12 5,21`})])],-1)]],2))}})})),Wz,Gz=d((()=>{Uz(),Uz(),Wz=Hz}));function Kz(e){if(!e)return{platform:`unknown`,videoId:null,thumbnailUrl:null};for(let t of[/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_-]{11})/,/youtube\.com\/shorts\/([a-zA-Z0-9_-]{11})/]){let n=e.match(t);if(n){let e=n[1];return{platform:`youtube`,videoId:e,thumbnailUrl:`https://img.youtube.com/vi/${e}/maxresdefault.jpg`}}}let t=e.match(/vimeo\.com\/(?:video\/)?(\d+)/);if(t){let e=t[1];return{platform:`vimeo`,videoId:e,thumbnailUrl:`https://vumbnail.com/${e}.jpg`}}return{platform:`unknown`,videoId:null,thumbnailUrl:null}}function qz(e,t){return t||Kz(e).thumbnailUrl}var Jz=d((()=>{})),Yz,Xz,Zz,Qz,$z,eB,tB,nB=d((()=>{Gz(),Rp(),Jz(),F(),Yz=[`src`,`alt`],Xz={class:`tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)]`,style:{opacity:`0.7`}},Zz=[`href`],Qz=[`src`,`alt`],$z=[`src`,`alt`],eB={key:3,class:`tpl:flex tpl:min-h-[150px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-sm tpl:border-[var(--tpl-border-light)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-dim)]`},tB=(0,t.defineComponent)({__name:`VideoBlock`,props:{block:{},viewport:{}},setup(e){let n=e,{t:i}=O(),{syntax:a}=bp(),o=(0,t.computed)(()=>(0,r.containsMergeTag)(n.block.url,a)||(0,r.containsMergeTag)(n.block.thumbnailUrl,a)),s=(0,t.computed)(()=>o.value?null:qz(n.block.url,n.block.thumbnailUrl)),c=(0,t.computed)(()=>({textAlign:n.block.align})),l=(0,t.computed)(()=>({maxWidth:`100%`,width:n.block.width===`full`?`100%`:`${n.block.width}px`,display:`block`,margin:n.block.align===`center`?`0 auto`:void 0,marginLeft:n.block.align===`right`?`auto`:void 0})),u=(0,t.computed)(()=>(0,r.containsMergeTag)(n.block.url,a)?n.block.url:n.block.thumbnailUrl);return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`tpl:w-full`,style:(0,t.normalizeStyle)(c.value)},[o.value&&e.block.placeholderUrl?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`tpl:relative tpl:inline-block`,style:(0,t.normalizeStyle)(l.value)},[(0,t.createElementVNode)(`img`,{class:`tpl:w-full tpl:border-0`,src:e.block.placeholderUrl,alt:e.block.alt},null,8,Yz),(0,t.createVNode)(Wz)],4)):o.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:`tpl:relative tpl:!flex tpl:min-h-[150px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-center tpl:bg-[var(--tpl-bg-elevated)]`,style:(0,t.normalizeStyle)([{"border-color":`color-mix(in srgb, var(--tpl-primary) 40%, transparent)`},l.value])},[(0,t.createVNode)((0,t.unref)(Uf),{size:36,"stroke-width":1.5,class:`tpl:text-[var(--tpl-primary)]`,style:{opacity:`0.5`}}),(0,t.createElementVNode)(`span`,Xz,(0,t.toDisplayString)(u.value),1)],4)):s.value?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:2},[e.block.url?((0,t.openBlock)(),(0,t.createElementBlock)(`a`,{key:0,href:e.block.url,target:`_blank`,rel:`noopener noreferrer`,class:`tpl:group tpl:relative tpl:inline-block`,style:(0,t.normalizeStyle)(l.value),onClick:r[0]||=(0,t.withModifiers)(()=>{},[`prevent`])},[(0,t.createElementVNode)(`img`,{class:`tpl:w-full tpl:border-0`,src:s.value,alt:e.block.alt},null,8,Qz),(0,t.createVNode)(Wz,{"hover-effect":``})],12,Zz)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:`tpl:relative tpl:inline-block`,style:(0,t.normalizeStyle)(l.value)},[(0,t.createElementVNode)(`img`,{class:`tpl:w-full tpl:border-0`,src:s.value,alt:e.block.alt},null,8,$z),(0,t.createVNode)(Wz)],4))],64)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,eB,[(0,t.createVNode)((0,t.unref)(Uf),{size:40,"stroke-width":1.5,class:`tpl:text-[var(--tpl-border-light)]`}),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(i).video.addVideo),1)]))],4))}})})),rB,iB=d((()=>{nB(),nB(),rB=tB}));function aB(e){let{editor:i,config:a,translations:o,fontsManager:s}=e,{t:c,format:l}=O(o);i.setUiTheme(a.uiTheme??`auto`);let{resolvedTheme:u}=it((0,t.computed)(()=>i.state.uiTheme)),d=(0,t.ref)(a.theme??{}),{themeStyles:f}=ot({themeOverrides:d,resolvedTheme:u,extraStyles:e.themeExtraStyles}),p=(0,n.useHistory)({content:i.content,setContent:(e,t)=>i.setContent(e,t),...e.historyOptions});(0,n.useHistoryInterceptor)(i,p);let m=(0,n.useBlockActions)({addBlock:i.addBlock,removeBlock:i.removeBlock,updateBlock:i.updateBlock,selectBlock:i.selectBlock,blockDefaults:a.blockDefaults}),h=(0,n.useConditionPreview)(i),g=e.autoSaveOptions!==null&&e.autoSaveOptions!==void 0?(0,n.useAutoSave)({content:i.content,isDirty:()=>i.state.isDirty,...e.autoSaveOptions}):null,_=null;g&&(_=(0,t.watch)(p.isNavigating,e=>{e?g.pause():g.resume()}));let v=nt(i,{t:c,format:l}),y=Ns();if(Fs(y,oB),a.customBlocks?.length)for(let e of a.customBlocks)y.registerCustom(e,Yp);function b(e){for(let t of e)y.registerCustom(t,Yp)}function x(t){zs(t,{history:p,selectBlock:e=>i.selectBlock(e),getSelectedBlockId:()=>i.state.selectedBlockId,removeBlock:e=>i.removeBlock(e),onSave:a.onSave,onBeforeUndo:e.keyboardOptions?.onBeforeUndo})}ge(document,`keydown`,x),(0,t.provide)(Ae,o),(0,t.provide)(je,i),(0,t.provide)(Me,p),(0,t.provide)(Ne,m),(0,t.provide)(Pe,h),(0,t.provide)(Fe,s),(0,t.provide)(Ie,f),(0,t.provide)(Le,u),(0,t.provide)(Re,a.blockDefaults),(0,t.provide)(ze,y),(0,t.provide)(Be,a.customBlocks??[]);let S=(0,r.resolveSyntax)(a.mergeTags?.syntax);(0,t.provide)(Ve,a.mergeTags?.tags??[]),(0,t.provide)(He,S),(0,t.provide)(Ue,a.mergeTags?.onRequest??null),(0,t.provide)(We,a.onRequestMedia??null),(0,t.provide)(Ge,a.displayConditions?.conditions??[]),(0,t.provide)(Ke,a.displayConditions?.allowCustom??!1),(0,t.provide)(qe,e.capabilities??{}),(0,t.provide)(Je,v);function C(){_?.(),g?.destroy(),p.destroy()}return{t:c,format:l,history:p,blockActions:m,conditionPreview:h,autoSave:g,resolvedTheme:u,themeStyles:f,themeOverrides:d,registry:y,keyboardReorder:v,registerCustomBlocks:b,destroy:C}}var oB,sB=d((()=>{Oe(),D(),k(),rt(),at(),ct(),Ps(),Ls(),Bs(),Ks(),$s(),Xp(),tm(),lm(),Cm(),Am(),AF(),cz(),Tz(),jz(),Vz(),mI(),iB(),oB={section:sz,title:pI,paragraph:kF,image:Sm,button:Gs,divider:em,video:rB,social:wz,menu:km,table:Bz,spacer:Az,html:cm,countdown:Qs}}));function cB(e,t={}){let n=t.light??`#ffffff`,r=t.dark??`#1f1f1f`,i=lB(e);if(!i)return n;let a=uB(i),o=lB(n),s=lB(r),c=o?uB(o):1,l=s?uB(s):0;return dB(a,c)>=dB(a,l)?n:r}function lB(e){let t=e.trim().match(/^#?([\da-f]{3}|[\da-f]{6})$/i);if(!t)return null;let n=t[1];return n.length===3&&(n=n.split(``).map(e=>e+e).join(``)),[parseInt(n.slice(0,2),16),parseInt(n.slice(2,4),16),parseInt(n.slice(4,6),16)]}function uB([e,t,n]){let r=e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4};return .2126*r(e)+.7152*r(t)+.0722*r(n)}function dB(e,t){let[n,r]=e>=t?[e,t]:[t,e];return(n+.05)/(r+.05)}var fB=d((()=>{})),pB,mB,hB,gB,_B,vB,yB,bB,xB,SB,CB,wB=d((()=>{k(),F(),D(),pB=h(ez(),1),NF(),fB(),XF(),cz(),mI(),AF(),Cm(),Ks(),tm(),jz(),lm(),Tz(),Am(),Vz(),Xp(),iB(),$s(),mB=[`aria-label`],hB={class:`tpl:relative`},gB={class:`tpl:inline-flex tpl:size-3 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-[8px] tpl:font-bold`,style:{"background-color":`color-mix(
162
- in srgb,
163
- var(--tpl-bg) 30%,
164
- transparent
165
- )`}},_B={key:0,class:`tpl-canvas-empty tpl:m-6 tpl:flex tpl:min-h-[400px] tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded-xl tpl:border-2 tpl:border-dashed tpl:px-10 tpl:py-12 tpl:text-center tpl:border-[var(--tpl-primary)] tpl:bg-[var(--tpl-bg-elevated)] tpl:font-[var(--tpl-font-family)]`},vB={class:`tpl-canvas-empty-icon tpl:mb-4 tpl:text-[var(--tpl-primary)]`},yB={class:`tpl-canvas-empty-title tpl:m-0 tpl:mb-2 tpl:text-base tpl:font-semibold tpl:text-[var(--tpl-primary)]`},bB={class:`tpl-canvas-empty-text tpl:m-0 tpl:text-sm tpl:text-[var(--tpl-text-dim)]`},xB={key:0,class:`tpl:m-0 tpl:mt-2 tpl:flex tpl:flex-wrap tpl:items-center tpl:justify-center tpl:gap-x-1 tpl:gap-y-0.5 tpl:text-sm tpl:text-[var(--tpl-text-dim)]`},SB={key:1,class:`tpl:m-0 tpl:mt-4 tpl:flex tpl:flex-wrap tpl:items-center tpl:justify-center tpl:gap-x-1 tpl:gap-y-0.5 tpl:text-sm tpl:text-[var(--tpl-text-dim)]`},CB=(0,t.defineComponent)({__name:`Canvas`,props:{viewport:{},content:{},selectedBlockId:{},darkMode:{type:Boolean},previewMode:{type:Boolean},lockedBlocks:{}},emits:[`select-block`,`open-ai-chat`,`open-design-reference`],setup(e,{emit:n}){let r={section:sz,title:pI,paragraph:kF,image:Sm,button:Gs,divider:em,spacer:Az,html:cm,social:wz,menu:km,table:Bz,video:rB,countdown:Qs,custom:Yp},i=e,a=n,{t:o}=O(),s=ke(je,`Canvas`),c=(0,t.inject)(Pe,null),l=(0,t.inject)(ze,null),u=(0,t.inject)(qe,{}),d=(0,t.computed)(()=>(u.plan?.hasFeature(`ai_generation`)??!1)&&(u.ai?.isFeatureEnabled(`chat`)??!1)),f=(0,t.computed)(()=>(u.plan?.hasFeature(`ai_generation`)??!1)&&(u.ai?.isFeatureEnabled(`designToTemplate`)??!1)),p=(0,t.computed)({get:()=>i.content.blocks,set:e=>{s.setContent({...i.content,blocks:e})}}),m=(0,t.computed)(()=>{switch(i.viewport){case`mobile`:return 375;case`tablet`:return 768;default:return i.content.settings.width}}),h=(0,t.computed)(()=>({backgroundColor:i.content.settings.backgroundColor,fontFamily:i.content.settings.fontFamily}));function g(e){i.previewMode||e.target===e.currentTarget&&a(`select-block`,null)}function _(e){return jF(e,l,r)}function v(e){return i.lockedBlocks?.get(e)??null}function y(e,t){e.type===`custom`&&s.updateBlock(e.id,{fieldValues:t.fieldValues,dataSourceFetched:t.dataSourceFetched})}return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{"data-testid":`canvas-wrapper`,role:`region`,"aria-label":(0,t.unref)(o).landmarks.canvas,class:`tpl-canvas-wrapper tpl:rounded-lg`,style:(0,t.normalizeStyle)({width:`${m.value}px`,backgroundColor:e.content.settings.backgroundColor,boxShadow:e.darkMode?`none`:`var(--tpl-shadow-xl)`,filter:e.darkMode?`invert(1) hue-rotate(180deg)`:`none`,transition:`width 300ms cubic-bezier(0.34, 1.56, 0.64, 1), filter 300ms ease`})},[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`tpl-canvas tpl:rounded-lg`,{"tpl-canvas--dark-mode":e.darkMode,"tpl-preview-mode":e.previewMode}]),style:(0,t.normalizeStyle)(h.value),onClick:g},[(0,t.createVNode)((0,t.unref)(pB.default),{modelValue:p.value,"onUpdate:modelValue":r[2]||=e=>p.value=e,group:`blocks`,"item-key":`id`,animation:150,"ghost-class":`tpl-ghost`,"drag-class":`tpl-dragging`,handle:`.tpl-block-btn`,"invert-swap":!0,"inverted-swap-threshold":.65,disabled:e.previewMode,class:`tpl-canvas-blocks`},{item:(0,t.withCtx)(({element:n})=>[(0,t.withDirectives)((0,t.createElementVNode)(`div`,null,[(0,t.createElementVNode)(`div`,hB,[v(n.id)?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`tpl-collab-lock tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-[4] tpl:rounded-sm`,style:(0,t.normalizeStyle)({outline:`2px solid ${v(n.id).color}`,outlineOffset:`-1px`})},[(0,t.createElementVNode)(`span`,{class:`tpl:absolute tpl:-top-0.5 tpl:left-1/2 tpl:z-[5] tpl:flex tpl:-translate-x-1/2 tpl:-translate-y-full tpl:items-center tpl:gap-1 tpl:rounded-full tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:whitespace-nowrap`,style:(0,t.normalizeStyle)({backgroundColor:v(n.id).color,color:(0,t.unref)(cB)(v(n.id).color)})},[(0,t.createElementVNode)(`span`,gB,(0,t.toDisplayString)(v(n.id).name.charAt(0)),1),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(v(n.id).name),1)],4)],4)):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)(YF,{block:n,"is-selected":!e.previewMode&&e.selectedBlockId===n.id&&!v(n.id),viewport:e.viewport,"preview-mode":e.previewMode,onSelect:t=>e.previewMode||v(n.id)?void 0:a(`select-block`,n.id)},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(_(n)),{block:n,viewport:e.viewport,onFetchData:e=>y(n,e),onUpdate:e=>(0,t.unref)(s).updateBlock(n.id,e)},null,40,[`block`,`viewport`,`onFetchData`,`onUpdate`]))]),_:2},1032,[`block`,`is-selected`,`viewport`,`preview-mode`,`onSelect`])])],512),[[t.vShow,!(0,t.unref)(c)?.isHidden(n.id)]])]),footer:(0,t.withCtx)(()=>[p.value.length===0&&!e.previewMode?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,_B,[(0,t.createElementVNode)(`div`,vB,[(0,t.createVNode)((0,t.unref)(Gd),{size:48,"stroke-width":1})]),(0,t.createElementVNode)(`p`,yB,(0,t.toDisplayString)((0,t.unref)(o).canvas.noBlocks),1),(0,t.createElementVNode)(`p`,bB,(0,t.toDisplayString)((0,t.unref)(o).canvas.dragHint),1),d.value?((0,t.openBlock)(),(0,t.createElementBlock)(`p`,xB,[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(o).canvas.aiHintChat)+` `,1),(0,t.createElementVNode)(`button`,{class:`tpl:inline-flex tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:whitespace-nowrap tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-2 tpl:py-0.5 tpl:text-sm tpl:font-semibold tpl:transition-colors tpl:duration-150 tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary-hover)]`,onClick:r[0]||=e=>a(`open-ai-chat`)},[(0,t.createVNode)((0,t.unref)(Hd),{size:14,"stroke-width":2}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(o).aiMenu.aiAssistant),1)]),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(o).canvas.aiHintChatSuffix),1)])):(0,t.createCommentVNode)(``,!0),f.value?((0,t.openBlock)(),(0,t.createElementBlock)(`p`,SB,[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(o).canvas.aiHintDesign)+` `,1),(0,t.createElementVNode)(`button`,{class:`tpl:inline-flex tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:whitespace-nowrap tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-2 tpl:py-0.5 tpl:text-sm tpl:font-semibold tpl:transition-colors tpl:duration-150 tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary-hover)]`,onClick:r[1]||=e=>a(`open-design-reference`)},[(0,t.createVNode)((0,t.unref)(Al),{size:14,"stroke-width":2}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(o).aiMenu.designToTemplate),1)]),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(o).canvas.aiHintDesignSuffix),1)])):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0)]),_:1},8,[`modelValue`,`disabled`])],6)],12,mB))}})})),TB=d((()=>{})),EB,DB=d((()=>{wB(),wB(),TB(),dp(),EB=up(CB,[[`__scopeId`,`data-v-43f4b3a0`]])})),OB,kB=d((()=>{F(),OB={section:rl,title:Dl,paragraph:Iu,image:Nl,button:Ju,divider:fu,video:zu,social:Dd,menu:wu,table:uf,spacer:xu,countdown:Tf,html:el}})),AB,jB,MB,NB,PB,FB,IB,LB,RB,zB,BB=d((()=>{k(),F(),AB=h(ez(),1),cp(),kB(),tt(),D(),jB=[`aria-label`],MB={key:0,class:`tpl:border-b tpl:px-1 tpl:pb-1 tpl:border-[var(--tpl-border)]`},NB=[`aria-label`],PB={key:0,class:`tpl:flex-1 tpl:truncate tpl:text-sm tpl:font-medium`},FB={key:1,class:`tpl:shrink-0 tpl:rounded-full tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)]`},IB=[`data-palette-type`,`aria-label`,`onClick`,`onKeydown`],LB={class:`tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-center tpl:transition-transform tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:scale-105`},RB={key:0,class:`tpl:truncate tpl:text-sm tpl:font-medium`},zB=(0,t.defineComponent)({__name:`Sidebar`,setup(e){let{t:n,format:i}=O(),a=(0,t.inject)(Be,[]),o=(0,t.inject)(Re,void 0),s=(0,t.inject)(je,null),c=(0,t.inject)(qe,{}),l=(0,t.computed)(()=>(c.savedModules?.moduleCount.value??0)>0),u=(0,t.ref)(!1),d=[`section`,`image`,`title`,`paragraph`,`button`,`divider`,`video`,`social`,`menu`,`table`,`spacer`,`html`],f=(0,t.computed)(()=>{let e=d.map(e=>({type:e,label:et(e,n)}));return c.plan&&e.splice(-1,0,{type:`countdown`,label:et(`countdown`,n)}),e}),p=(0,t.computed)(()=>a.map(e=>({type:`custom:${e.type}`,label:e.name,isCustom:!0,icon:e.icon}))),m=(0,t.computed)(()=>[...f.value,...p.value]);function h(e){if(e.isCustom){let t=e.type.replace(`custom:`,``),n=a.find(e=>e.type===t);if(n)return(0,r.createCustomBlock)(n)}return(0,r.createBlock)(e.type,o)}function g(e){if(!s)return;let t=h(e);s.addBlock(t),s.selectBlock(t.id)}function _(e,t){(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),g(t))}return(e,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`aside`,{"aria-label":(0,t.unref)(n).sidebarNav.palette,class:`tpl-sidebar-rail tpl:absolute tpl:top-14 tpl:bottom-0 tpl:left-0 tpl:z-40 tpl:overflow-hidden`,style:(0,t.normalizeStyle)({width:u.value?`200px`:`48px`,backgroundColor:`var(--tpl-bg-elevated)`,borderRight:`1px solid var(--tpl-border)`,boxShadow:u.value?`var(--tpl-shadow-lg)`:`none`,transition:`width 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1)`}),onMouseenter:r[1]||=e=>u.value=!0,onMouseleave:r[2]||=e=>u.value=!1,onFocusin:r[3]||=e=>u.value=!0,onFocusout:r[4]||=e=>u.value=!1},[l.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,MB,[(0,t.createElementVNode)(`button`,{type:`button`,"aria-label":(0,t.unref)(n).sidebarNav.browseModules,class:`tpl:flex tpl:h-10 tpl:w-full tpl:cursor-pointer tpl:items-center tpl:gap-3 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:px-3 tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-[120ms] hover:tpl:bg-[var(--tpl-primary-light)] hover:tpl:text-[var(--tpl-primary)]`,style:(0,t.normalizeStyle)({justifyContent:u.value?`flex-start`:`center`}),onClick:r[0]||=e=>(0,t.unref)(c).savedModules?.openBrowser()},[(0,t.createVNode)((0,t.unref)(Du),{size:20,"stroke-width":1.5,class:`tpl:shrink-0`}),u.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,PB,(0,t.toDisplayString)((0,t.unref)(n).modules.title),1)):(0,t.createCommentVNode)(``,!0),u.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,FB,(0,t.toDisplayString)((0,t.unref)(c).savedModules?.moduleCount.value??0),1)):(0,t.createCommentVNode)(``,!0)],12,NB)])):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)((0,t.unref)(AB.default),{list:m.value,group:{name:`blocks`,pull:`clone`,put:!1},clone:h,sort:!1,"item-key":`type`,animation:150,"ghost-class":`tpl-ghost`,class:`tpl:flex tpl:flex-col tpl:gap-0.5 tpl:p-1`},{item:(0,t.withCtx)(({element:e})=>[(0,t.createElementVNode)(`button`,{type:`button`,"data-palette-type":e.type,"aria-label":(0,t.unref)(i)((0,t.unref)(n).sidebarNav.insertBlock,{block:e.label}),class:`tpl:flex tpl:h-10 tpl:w-full tpl:cursor-grab tpl:items-center tpl:gap-3 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:px-3 tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-primary-light)] hover:tpl:text-[var(--tpl-primary)] active:tpl:cursor-grabbing`,style:(0,t.normalizeStyle)({justifyContent:u.value?`flex-start`:`center`}),onClick:t=>g(e),onKeydown:t=>_(t,e)},[(0,t.createElementVNode)(`div`,LB,[(0,t.unref)(OB)[e.type]?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)((0,t.unref)(OB)[e.type]),{key:0,size:20,"stroke-width":1.5})):e.isCustom?((0,t.openBlock)(),(0,t.createBlock)(sp,{key:1,icon:e.icon,size:20},null,8,[`icon`])):(0,t.createCommentVNode)(``,!0)]),u.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,RB,(0,t.toDisplayString)(e.label),1)):(0,t.createCommentVNode)(``,!0)],44,IB)]),_:1},8,[`list`])],44,jB))}})})),VB,HB=d((()=>{BB(),BB(),VB=zB})),UB,WB,GB=d((()=>{UB=(e,t=0,n=1)=>e>n?n:e<t?t:e,WB=(e,t=0,n=10**t)=>Math.round(n*e)/n})),KB,qB,JB,YB,XB,ZB,QB,$B,eV,tV=d((()=>{GB(),360/(Math.PI*2),KB=e=>eV(qB(e)),qB=e=>(e[0]===`#`&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?WB(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?WB(parseInt(e.substring(6,8),16)/255,2):1}),JB=e=>$B(ZB(e)),YB=({h:e,s:t,v:n,a:r})=>{let i=(200-t)*n/100;return{h:WB(e),s:WB(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:WB(i/2),a:WB(r,2)}},XB=e=>{let{h:t,s:n,l:r}=YB(e);return`hsl(${t}, ${n}%, ${r}%)`},ZB=({h:e,s:t,v:n,a:r})=>{e=e/360*6,t/=100,n/=100;let i=Math.floor(e),a=n*(1-t),o=n*(1-(e-i)*t),s=n*(1-(1-e+i)*t),c=i%6;return{r:WB([n,o,a,a,s,n][c]*255),g:WB([s,n,n,o,a,a][c]*255),b:WB([a,a,s,n,n,o][c]*255),a:WB(r,2)}},QB=e=>{let t=e.toString(16);return t.length<2?`0`+t:t},$B=({r:e,g:t,b:n,a:r})=>{let i=r<1?QB(WB(r*255)):``;return`#`+QB(e)+QB(t)+QB(n)+i},eV=({r:e,g:t,b:n,a:r})=>{let i=Math.max(e,t,n),a=i-Math.min(e,t,n),o=a?i===e?(t-n)/a:i===t?2+(n-e)/a:4+(e-t)/a:0;return{h:WB(60*(o<0?o+6:o)),s:WB(i?a/i*100:0),v:WB(i/255*100),a:r}}})),nV,rV,iV=d((()=>{tV(),nV=(e,t)=>{if(e===t)return!0;for(let n in e)if(e[n]!==t[n])return!1;return!0},rV=(e,t)=>e.toLowerCase()===t.toLowerCase()?!0:nV(qB(e),qB(t))})),aV,oV,sV,cV=d((()=>{aV={},oV=e=>{let t=aV[e];return t||(t=document.createElement(`template`),t.innerHTML=e,aV[e]=t),t},sV=(e,t,n)=>{e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n}))}})),lV,uV,dV,fV,pV,mV,hV=d((()=>{cV(),GB(),lV=!1,uV=e=>`touches`in e,dV=e=>lV&&!uV(e)?!1:(lV||=uV(e),!0),fV=(e,t)=>{let n=uV(t)?t.touches[0]:t,r=e.el.getBoundingClientRect();sV(e.el,`move`,e.getMove({x:UB((n.pageX-(r.left+window.pageXOffset))/r.width),y:UB((n.pageY-(r.top+window.pageYOffset))/r.height)}))},pV=(e,t)=>{let n=t.keyCode;n>40||e.xy&&n<37||n<33||(t.preventDefault(),sV(e.el,`move`,e.getMove({x:n===39?.01:n===37?-.01:n===34?.05:n===33?-.05:n===35?1:n===36?-1:0,y:n===40?.01:n===38?-.01:0},!0)))},mV=class{constructor(e,t,n,r){let i=oV(`<div role="slider" tabindex="0" part="${t}" ${n}><div part="${t}-pointer"></div></div>`);e.appendChild(i.content.cloneNode(!0));let a=e.querySelector(`[part=${t}]`);a.addEventListener(`mousedown`,this),a.addEventListener(`touchstart`,this),a.addEventListener(`keydown`,this),this.el=a,this.xy=r,this.nodes=[a.firstChild,a]}set dragging(e){let t=e?document.addEventListener:document.removeEventListener;t(lV?`touchmove`:`mousemove`,this),t(lV?`touchend`:`mouseup`,this)}handleEvent(e){switch(e.type){case`mousedown`:case`touchstart`:if(e.preventDefault(),!dV(e)||!lV&&e.button!=0)return;this.el.focus(),fV(this,e),this.dragging=!0;break;case`mousemove`:case`touchmove`:e.preventDefault(),fV(this,e);break;case`mouseup`:case`touchend`:this.dragging=!1;break;case`keydown`:pV(this,e);break}}style(e){e.forEach((e,t)=>{for(let n in e)this.nodes[t].style.setProperty(n,e[n])})}}})),gV,_V=d((()=>{hV(),tV(),GB(),gV=class extends mV{constructor(e){super(e,`hue`,`aria-label="Hue" aria-valuemin="0" aria-valuemax="360"`,!1)}update({h:e}){this.h=e,this.style([{left:`${e/360*100}%`,color:XB({h:e,s:100,v:100,a:1})}]),this.el.setAttribute(`aria-valuenow`,`${WB(e)}`)}getMove(e,t){return{h:t?UB(this.h+e.x*360,0,360):360*e.x}}}})),vV,yV=d((()=>{hV(),tV(),GB(),vV=class extends mV{constructor(e){super(e,`saturation`,`aria-label="Color"`,!0)}update(e){this.hsva=e,this.style([{top:`${100-e.v}%`,left:`${e.s}%`,color:XB(e)},{"background-color":XB({h:e.h,s:100,v:100,a:1})}]),this.el.setAttribute(`aria-valuetext`,`Saturation ${WB(e.s)}%, Brightness ${WB(e.v)}%`)}getMove(e,t){return{s:t?UB(this.hsva.s+e.x*100,0,100):e.x*100,v:t?UB(this.hsva.v-e.y*100,0,100):Math.round(100-e.y*100)}}}})),bV,xV=d((()=>{bV=`:host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:"";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}`})),SV,CV=d((()=>{SV=`[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}`})),wV,TV=d((()=>{wV=`[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}`})),EV,DV,OV,kV,AV,jV,MV,NV,PV=d((()=>{iV(),cV(),_V(),yV(),xV(),CV(),TV(),EV=Symbol(`same`),DV=Symbol(`color`),OV=Symbol(`hsva`),kV=Symbol(`update`),AV=Symbol(`parts`),jV=Symbol(`css`),MV=Symbol(`sliders`),NV=class extends HTMLElement{static get observedAttributes(){return[`color`]}get[jV](){return[bV,SV,wV]}get[MV](){return[vV,gV]}get color(){return this[DV]}set color(e){if(!this[EV](e)){let t=this.colorModel.toHsva(e);this[kV](t),this[DV]=e}}constructor(){super();let e=oV(`<style>${this[jV].join(``)}</style>`),t=this.attachShadow({mode:`open`});t.appendChild(e.content.cloneNode(!0)),t.addEventListener(`move`,this),this[AV]=this[MV].map(e=>new e(t))}connectedCallback(){if(this.hasOwnProperty(`color`)){let e=this.color;delete this.color,this.color=e}else this.color||=this.colorModel.defaultColor}attributeChangedCallback(e,t,n){let r=this.colorModel.fromAttr(n);this[EV](r)||(this.color=r)}handleEvent(e){let t=this[OV],n={...t,...e.detail};this[kV](n);let r;!nV(n,t)&&!this[EV](r=this.colorModel.fromHsva(n))&&(this[DV]=r,sV(this,`color-changed`,{value:r}))}[EV](e){return this.color&&this.colorModel.equal(e,this.color)}[kV](e){this[OV]=e,this[AV].forEach(t=>t.update(e))}}})),FV,IV,LV=d((()=>{PV(),tV(),iV(),FV={defaultColor:`#000`,toHsva:KB,fromHsva:({h:e,s:t,v:n})=>JB({h:e,s:t,v:n,a:1}),equal:rV,fromAttr:e=>e},IV=class extends NV{get colorModel(){return FV}}})),RV,zV=d((()=>{LV(),RV=class extends IV{},customElements.define(`hex-color-picker`,RV)})),BV,VV,HV,UV,WV=d((()=>{Oe(),k(),yh(),zV(),BV=[`disabled`,`aria-label`,`aria-expanded`],VV=[`value`,`placeholder`,`disabled`,`aria-label`],HV=[`color`,`aria-label`],UV=(0,t.defineComponent)({__name:`ColorPicker`,props:{modelValue:{},placeholder:{default:_h},size:{default:`default`},swatchOnly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:[`update:modelValue`],setup(e,{emit:n}){let r=e,i=n,{t:a}=O(),o=(0,t.ref)(!1),s=(0,t.ref)(),c=(0,t.ref)();_e(s,()=>{o.value=!1},{ignore:[c]});let l=(0,t.computed)({get:()=>r.modelValue||`#000000`,set:e=>i(`update:modelValue`,e)});function u(e){l.value=e.detail.value}function d(e){l.value=e.target.value}return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`tpl:flex tpl:gap-2 tpl:relative`,e.disabled&&`tpl:opacity-60 tpl:cursor-not-allowed`])},[(0,t.createElementVNode)(`button`,{ref_key:`swatchRef`,ref:c,type:`button`,disabled:e.disabled,"aria-label":(0,t.unref)(a).colorPicker.pickColor,"aria-expanded":o.value,class:(0,t.normalizeClass)([`tpl:shrink-0 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-0.5 tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]`,e.disabled?`tpl:cursor-not-allowed`:`tpl:cursor-pointer`,o.value?`tpl:border-[var(--tpl-primary)] tpl:shadow-[var(--tpl-ring)]`:!e.disabled&&`hover:tpl:border-[var(--tpl-text-dim)]`,e.size===`large`?`tpl:size-12`:`tpl:size-10`]),onClick:r[0]||=t=>!e.disabled&&(o.value=!o.value)},[(0,t.createElementVNode)(`span`,{class:`tpl:block tpl:size-full tpl:rounded-[calc(var(--tpl-radius-sm)-2px)]`,style:(0,t.normalizeStyle)({backgroundColor:l.value})},null,4)],10,BV),e.swatchOnly?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{key:0,type:`text`,class:(0,t.normalizeClass)((0,t.unref)(ch)),value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled,"aria-label":(0,t.unref)(a).colorPicker.hexValue,onInput:d},null,42,VV)),(0,t.createVNode)(t.Transition,{"enter-active-class":`tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]`,"enter-from-class":`tpl:opacity-0 tpl:scale-95 tpl:translate-y-1`,"enter-to-class":`tpl:opacity-100 tpl:scale-100 tpl:translate-y-0`,"leave-active-class":`tpl:transition-all tpl:duration-[80ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]`,"leave-from-class":`tpl:opacity-100 tpl:scale-100 tpl:translate-y-0`,"leave-to-class":`tpl:opacity-0 tpl:scale-95 tpl:translate-y-1`},{default:(0,t.withCtx)(()=>[o.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,ref_key:`popoverRef`,ref:s,class:`tpl:absolute tpl:left-0 tpl:top-full tpl:z-50 tpl:mt-2 tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:p-3 tpl:shadow-lg`},[(0,t.createElementVNode)(`hex-color-picker`,{color:l.value,"aria-label":(0,t.unref)(a).colorPicker.pickColor,onColorChanged:u,onKeydown:r[1]||=(0,t.withKeys)(e=>o.value=!1,[`escape`])},null,40,HV)],512)):(0,t.createCommentVNode)(``,!0)]),_:1})],2))}})})),GV=d((()=>{})),KV,qV=d((()=>{WV(),WV(),GV(),KV=UV}));function JV(e){let{modelValue:n,emit:i,elementRef:a}=e,{isEnabled:o,isRequesting:s,isMergeTagValue:c,getMergeTagLabel:l,requestMergeTag:u,syntax:d}=bp(),f=(0,t.ref)(!1),p=!1,m=(0,t.computed)(()=>{let e=n();if(!e)return[];let t=[],i=`(${d.value.source}|${d.logic.source})`,a=new RegExp(i,`g`),o=0,s;for(;(s=a.exec(e))!==null;){s.index>o&&t.push({type:`text`,value:e.slice(o,s.index)});let n=s[0];c(n)?t.push({type:`mergeTag`,value:n,label:l(n)}):(0,r.isLogicMergeTagValue)(n,d)?t.push({type:`logicMergeTag`,value:n,keyword:(0,r.getLogicMergeTagKeyword)(n,d)}):t.push({type:`text`,value:n}),o=s.index+n.length}return o<e.length&&t.push({type:`text`,value:e.slice(o)}),t}),h=(0,t.computed)(()=>m.value.some(e=>e.type===`mergeTag`||e.type===`logicMergeTag`));function g(){f.value=!0,(0,t.nextTick)(()=>{a.value?.focus();let e=n()?.length||0;a.value?.setSelectionRange(e,e)})}function _(){p||(f.value=!1)}function v(e){i(e.target.value)}function y(){i(``)}async function b(){let e=f.value&&a.value?a.value.selectionStart??n().length:n().length;p=!0;let r=await u();if(p=!1,r){let o=n().slice(0,e),s=n().slice(e);i(o+r.value+s),f.value=!0,(0,t.nextTick)(()=>{let t=e+r.value.length;a.value?.focus(),a.value?.setSelectionRange(t,t)})}}return{segments:m,hasMergeTags:h,mergeTagEnabled:o,isRequestingMergeTag:s,isEditing:f,startEditing:g,stopEditing:_,handleInput:v,clearValue:y,insertMergeTag:b}}var YV=d((()=>{xp()})),XV,ZV,QV,$V,eH,tH,nH=d((()=>{k(),F(),XV=[`aria-label`,`onKeydown`],ZV=[`data-tooltip`],QV=[`data-tooltip`],$V={key:2,class:`tpl:text-sm tpl:text-[var(--tpl-text)]`},eH=[`aria-label`,`title`],tH=(0,t.defineComponent)({__name:`MergeTagSegments`,props:{segments:{},displayClass:{},pulse:{type:Boolean}},emits:[`edit`,`clear`],setup(e,{emit:n}){let r=n,{t:i}=O();function a(){r(`edit`)}return(n,o)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{role:`button`,tabindex:`0`,"aria-label":(0,t.unref)(i).mergeTag.clickToEdit,class:(0,t.normalizeClass)([e.displayClass,{"tpl-pulse-fill":e.pulse}]),onClick:a,onKeydown:[(0,t.withKeys)(a,[`enter`]),(0,t.withKeys)((0,t.withModifiers)(a,[`prevent`]),[`space`])]},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.segments,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:`${e.type}-${n}-${e.value}`},[e.type===`mergeTag`?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,class:`tpl-tooltip tpl:inline-flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[0.9em] tpl:font-medium`,"data-tooltip":e.value,style:{"background-color":`color-mix(
166
- in srgb,
167
- var(--tpl-primary) 20%,
168
- transparent
169
- )`,color:`var(--tpl-primary)`}},(0,t.toDisplayString)(e.label),9,ZV)):e.type===`logicMergeTag`?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,class:`tpl-tooltip tpl:inline-flex tpl:items-center tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[0.8em] tpl:font-bold tpl:tracking-wide tpl:uppercase`,"data-tooltip":e.value,style:{"background-color":`transparent`,border:`1.5px solid
170
- color-mix(in srgb, var(--tpl-primary) 50%, transparent)`,color:`var(--tpl-primary)`}},(0,t.toDisplayString)(e.keyword),9,QV)):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,$V,(0,t.toDisplayString)(e.value),1))],64))),128)),(0,t.createElementVNode)(`button`,{type:`button`,class:`tpl:ml-auto tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text-dim)] tpl:opacity-60 tpl:transition-all hover:tpl:text-[var(--tpl-danger)] hover:tpl:opacity-100`,"aria-label":(0,t.unref)(i).mergeTag.remove,title:(0,t.unref)(i).mergeTag.remove,onClick:o[0]||=(0,t.withModifiers)(e=>r(`clear`),[`stop`])},[(0,t.createVNode)((0,t.unref)(Qf),{size:12,"stroke-width":2.5})],8,eH)],42,XV))}})})),rH,iH=d((()=>{nH(),nH(),rH=tH})),aH,oH,sH,cH=d((()=>{k(),F(),aH=[`aria-label`,`title`,`disabled`],oH=`tpl:flex tpl:items-center tpl:justify-center tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:px-2 tpl:py-1 tpl:text-xs tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-[120ms] hover:tpl:bg-[var(--tpl-primary-light)] hover:tpl:text-[var(--tpl-primary)] hover:tpl:border-[var(--tpl-primary)]`,sH=(0,t.defineComponent)({__name:`MergeTagInsertButton`,props:{disabled:{type:Boolean}},emits:[`insert`],setup(e){let{t:n}=O();return(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{type:`button`,class:(0,t.normalizeClass)([oH,`tpl:mt-1.5`]),"aria-label":(0,t.unref)(n).mergeTag.insert,title:(0,t.unref)(n).mergeTag.insert,disabled:e.disabled,onClick:i[0]||=e=>r.$emit(`insert`)},[(0,t.createVNode)((0,t.unref)(hd),{size:12,"stroke-width":2}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(n).mergeTag.insert),1)],10,aH))}})})),lH,uH=d((()=>{cH(),cH(),lH=sH})),dH,fH,pH,mH,hH,gH,_H=d((()=>{YV(),iH(),uH(),dH={key:0},fH={key:1},pH=[`value`,`placeholder`,`rows`],mH=`tpl:w-full tpl:resize-y tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:shadow-xs tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 tpl:text-sm tpl:text-[var(--tpl-text)] tpl:outline-none tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:placeholder:text-[var(--tpl-text-dim)] tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)]`,hH=`tpl:flex tpl:w-full tpl:min-h-[5rem] tpl:cursor-pointer tpl:items-start tpl:flex-wrap tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:shadow-xs tpl:bg-[var(--tpl-bg)] tpl:border-[var(--tpl-border)] tpl:px-3 tpl:py-2 tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]`,gH=(0,t.defineComponent)({__name:`MergeTagTextarea`,props:{modelValue:{},placeholder:{default:``},rows:{default:3}},emits:[`update:modelValue`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.ref)(null),{segments:o,hasMergeTags:s,mergeTagEnabled:c,isRequestingMergeTag:l,isEditing:u,startEditing:d,stopEditing:f,handleInput:p,clearValue:m,insertMergeTag:h}=JV({modelValue:()=>r.modelValue,emit:e=>i(`update:modelValue`,e),elementRef:a});return(n,r)=>(0,t.unref)(s)&&!(0,t.unref)(u)?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,dH,[(0,t.createVNode)(rH,{segments:(0,t.unref)(o),"display-class":hH,onEdit:(0,t.unref)(d),onClear:(0,t.unref)(m)},null,8,[`segments`,`onEdit`,`onClear`]),(0,t.unref)(c)?((0,t.openBlock)(),(0,t.createBlock)(lH,{key:0,disabled:(0,t.unref)(l),onInsert:(0,t.unref)(h)},null,8,[`disabled`,`onInsert`])):(0,t.createCommentVNode)(``,!0)])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,fH,[(0,t.createElementVNode)(`textarea`,{ref_key:`textareaRef`,ref:a,class:(0,t.normalizeClass)(mH),value:e.modelValue,placeholder:e.placeholder,rows:e.rows,onInput:r[0]||=(...e)=>(0,t.unref)(p)&&(0,t.unref)(p)(...e),onBlur:r[1]||=(...e)=>(0,t.unref)(f)&&(0,t.unref)(f)(...e),onKeydown:r[2]||=(0,t.withKeys)((...e)=>(0,t.unref)(f)&&(0,t.unref)(f)(...e),[`escape`])},null,40,pH),(0,t.unref)(c)?((0,t.openBlock)(),(0,t.createBlock)(lH,{key:0,disabled:(0,t.unref)(l),onInsert:(0,t.unref)(h)},null,8,[`disabled`,`onInsert`])):(0,t.createCommentVNode)(``,!0)]))}})})),vH,yH=d((()=>{_H(),_H(),vH=gH})),bH,xH,SH,CH,wH,TH,EH,DH,OH,kH,AH,jH,MH,NH,PH,FH,IH,LH,RH,zH,BH,VH,HH,UH,WH=d((()=>{qV(),yH(),k(),yh(),F(),D(),bH={class:`tpl:flex tpl:w-full tpl:flex-1 tpl:flex-col tpl:bg-[var(--tpl-bg-elevated)]`},xH={class:`tpl:flex tpl:flex-1 tpl:flex-col tpl:gap-3 tpl:overflow-y-auto tpl:p-4`},SH={class:`tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]`},CH={class:`tpl:mb-3.5`},wH={class:`tpl:grid tpl:grid-cols-4 tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1 tpl:bg-[var(--tpl-bg-hover)]`},TH=[`onClick`],EH={class:`tpl:flex tpl:items-stretch`},DH=[`value`],OH={class:`tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]`},kH={class:`tpl:mb-3.5`},AH=[`value`],jH=[`value`],MH={class:`tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]`},NH={class:`tpl:mt-1 tpl:flex tpl:items-start tpl:justify-between tpl:gap-2`},PH={class:`tpl:text-xs tpl:leading-relaxed tpl:text-[var(--tpl-text-dim)]`},FH={class:`tpl:shrink-0 tpl:text-xs tpl:tabular-nums tpl:text-[var(--tpl-text-dim)]`},IH={class:`tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-3`},LH={class:`tpl:mb-2.5 tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text-muted)]`},RH={class:`tpl:m-0 tpl:pl-[18px] tpl:text-xs tpl:leading-relaxed tpl:text-[var(--tpl-text-dim)]`},zH={class:`tpl:mb-1 tpl:last:mb-0`},BH={class:`tpl:mb-1 tpl:last:mb-0`},VH={class:`tpl:mb-1 tpl:last:mb-0`},HH=150,UH=(0,t.defineComponent)({__name:`TemplateSettings`,props:{settings:{}},emits:[`update`],setup(e,{emit:n}){let r=e,i=n,{t:a}=O(),o=ke(Fe,`TemplateSettings`),s=(0,t.computed)(()=>o.fonts.value),c=(0,t.computed)(()=>s.value.some(e=>e.value===r.settings.fontFamily)?r.settings.fontFamily:o.defaultFont.value),l=[{value:480,label:`480px`},{value:600,label:`600px`},{value:700,label:`700px`},{value:800,label:`800px`}];return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`aside`,bH,[(0,t.createElementVNode)(`div`,xH,[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)((0,t.unref)(lh))},[(0,t.createElementVNode)(`div`,SH,[(0,t.createVNode)((0,t.unref)(Jd),{class:`tpl:text-[var(--tpl-text-muted)]`,size:14,"stroke-width":2}),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(a).templateSettings.layout),1)]),(0,t.createElementVNode)(`div`,CH,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(a).templateSettings.widthPreset),3),(0,t.createElementVNode)(`div`,wH,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(l,n=>(0,t.createElementVNode)(`button`,{key:n.value,class:`tpl:cursor-pointer tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-2 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]`,style:(0,t.normalizeStyle)({backgroundColor:e.settings.width===n.value?`var(--tpl-bg)`:`transparent`,color:e.settings.width===n.value?`var(--tpl-primary)`:`var(--tpl-text-muted)`,boxShadow:e.settings.width===n.value?`var(--tpl-shadow)`:`none`}),onClick:e=>i(`update`,{width:n.value})},(0,t.toDisplayString)(n.label),13,TH)),64))])]),(0,t.createElementVNode)(`div`,null,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(a).templateSettings.customWidth),3),(0,t.createElementVNode)(`div`,EH,[(0,t.createElementVNode)(`input`,{type:`number`,class:(0,t.normalizeClass)((0,t.unref)(oh)),value:e.settings.width,min:`300`,max:`900`,onInput:r[0]||=e=>i(`update`,{width:Number(e.target.value)})},null,42,DH),(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)((0,t.unref)(sh))},`px`,2)])])],2),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)((0,t.unref)(lh))},[(0,t.createElementVNode)(`div`,OH,[(0,t.createVNode)((0,t.unref)(Jc),{class:`tpl:text-[var(--tpl-text-muted)]`,size:14,"stroke-width":2}),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(a).templateSettings.appearance),1)]),(0,t.createElementVNode)(`div`,kH,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(a).templateSettings.backgroundColor),3),(0,t.createVNode)(KV,{"model-value":e.settings.backgroundColor,placeholder:(0,t.unref)(vh),"onUpdate:modelValue":r[1]||=e=>i(`update`,{backgroundColor:e})},null,8,[`model-value`,`placeholder`])]),(0,t.createElementVNode)(`div`,null,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(a).templateSettings.fontFamily),3),(0,t.createElementVNode)(`select`,{class:(0,t.normalizeClass)((0,t.unref)(ah)),value:c.value,onChange:r[2]||=e=>i(`update`,{fontFamily:e.target.value})},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(s.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e.value,value:e.value},(0,t.toDisplayString)(e.label),9,jH))),128))],42,AH)])],2),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)((0,t.unref)(lh))},[(0,t.createElementVNode)(`div`,MH,[(0,t.createVNode)((0,t.unref)(fl),{class:`tpl:text-[var(--tpl-text-muted)]`,size:14,"stroke-width":2}),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(a).templateSettings.preheaderText),1)]),(0,t.createElementVNode)(`div`,null,[(0,t.createVNode)(vH,{"model-value":e.settings.preheaderText??``,placeholder:(0,t.unref)(a).templateSettings.preheaderTextPlaceholder,rows:2,"onUpdate:modelValue":r[3]||=e=>i(`update`,{preheaderText:e.replace(/[\r\n]/g,` `)||void 0})},null,8,[`model-value`,`placeholder`]),(0,t.createElementVNode)(`div`,NH,[(0,t.createElementVNode)(`span`,PH,(0,t.toDisplayString)((0,t.unref)(a).templateSettings.preheaderTextHint),1),(0,t.createElementVNode)(`span`,FH,(0,t.toDisplayString)((e.settings.preheaderText??``).length)+`/`+(0,t.toDisplayString)(HH),1)])])],2),(0,t.createElementVNode)(`div`,IH,[(0,t.createElementVNode)(`div`,LH,[(0,t.createVNode)((0,t.unref)(Il),{size:14,"stroke-width":2}),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(a).templateSettings.tips),1)]),(0,t.createElementVNode)(`ul`,RH,[(0,t.createElementVNode)(`li`,zH,(0,t.toDisplayString)((0,t.unref)(a).templateSettings.tip1),1),(0,t.createElementVNode)(`li`,BH,(0,t.toDisplayString)((0,t.unref)(a).templateSettings.tip2),1),(0,t.createElementVNode)(`li`,VH,(0,t.toDisplayString)((0,t.unref)(a).templateSettings.tip3),1)])])])]))}})})),GH,KH=d((()=>{WH(),WH(),GH=UH})),qH,JH,YH,XH,ZH,QH=d((()=>{YV(),yh(),iH(),uH(),qH={key:0},JH={key:1},YH=[`type`,`value`,`placeholder`],XH=`tpl:flex tpl:w-full tpl:min-h-10 tpl:cursor-pointer tpl:items-center tpl:flex-wrap tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:shadow-xs tpl:bg-[var(--tpl-bg)] tpl:border-[var(--tpl-border)] tpl:px-3.5 tpl:py-1.5 tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]`,ZH=(0,t.defineComponent)({__name:`MergeTagInput`,props:{modelValue:{},type:{default:`text`},placeholder:{default:``},pulse:{type:Boolean,default:!1}},emits:[`update:modelValue`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.ref)(null),{segments:o,hasMergeTags:s,mergeTagEnabled:c,isRequestingMergeTag:l,isEditing:u,startEditing:d,stopEditing:f,handleInput:p,clearValue:m,insertMergeTag:h}=JV({modelValue:()=>r.modelValue,emit:e=>i(`update:modelValue`,e),elementRef:a});return(n,r)=>(0,t.unref)(s)&&!(0,t.unref)(u)?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,qH,[(0,t.createVNode)(rH,{segments:(0,t.unref)(o),"display-class":XH,pulse:e.pulse,onEdit:(0,t.unref)(d),onClear:(0,t.unref)(m)},null,8,[`segments`,`pulse`,`onEdit`,`onClear`]),(0,t.unref)(c)?((0,t.openBlock)(),(0,t.createBlock)(lH,{key:0,disabled:(0,t.unref)(l),onInsert:(0,t.unref)(h)},null,8,[`disabled`,`onInsert`])):(0,t.createCommentVNode)(``,!0)])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,JH,[(0,t.createElementVNode)(`input`,{ref_key:`inputRef`,ref:a,type:e.type,class:(0,t.normalizeClass)([(0,t.unref)(ah),{"tpl-pulse-fill":e.pulse}]),value:e.modelValue,placeholder:e.placeholder,onInput:r[0]||=(...e)=>(0,t.unref)(p)&&(0,t.unref)(p)(...e),onBlur:r[1]||=(...e)=>(0,t.unref)(f)&&(0,t.unref)(f)(...e),onKeydown:r[2]||=(0,t.withKeys)((...e)=>(0,t.unref)(f)&&(0,t.unref)(f)(...e),[`escape`])},null,42,YH),(0,t.unref)(c)?((0,t.openBlock)(),(0,t.createBlock)(lH,{key:0,disabled:(0,t.unref)(l),onInsert:(0,t.unref)(h)},null,8,[`disabled`,`onInsert`])):(0,t.createCommentVNode)(``,!0)]))}})})),$H=d((()=>{})),eU,tU=d((()=>{QH(),QH(),$H(),dp(),eU=up(ZH,[[`__scopeId`,`data-v-b982cc87`]])})),nU,rU,iU,aU,oU,sU,cU,lU,uU,dU,fU,pU,mU,hU,gU,_U,vU,yU,bU,xU=d((()=>{qV(),tU(),k(),yh(),nU={class:`tpl:mb-3.5`},rU=[`value`],iU={value:``},aU=[`value`],oU={class:`tpl:mb-3.5`},sU={class:`tpl:mb-3.5`},cU={key:0,class:`tpl:mt-2 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]`},lU=[`checked`],uU={class:`tpl:grid tpl:grid-cols-2 tpl:gap-3`},dU={class:`tpl:mb-3.5`},fU={class:`tpl:mb-3.5`},pU={class:`tpl:grid tpl:grid-cols-2 tpl:gap-3`},mU={class:`tpl:mb-3.5`},hU={class:`tpl:flex tpl:items-stretch`},gU=[`value`],_U={class:`tpl:mb-3.5`},vU={class:`tpl:flex tpl:items-stretch`},yU=[`value`],bU=(0,t.defineComponent)({__name:`ButtonToolbar`,props:{block:{},fontFamilies:{}},emits:[`update`],setup(e,{emit:n}){let r=n,{t:i}=O();function a(e,t){r(`update`,{[e]:t})}return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,[(0,t.createElementVNode)(`div`,nU,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(i).button.fontFamily),3),(0,t.createElementVNode)(`select`,{class:(0,t.normalizeClass)((0,t.unref)(ah)),value:e.block.fontFamily||``,onChange:r[0]||=e=>a(`fontFamily`,e.target.value||void 0)},[(0,t.createElementVNode)(`option`,iU,(0,t.toDisplayString)((0,t.unref)(i).button.inheritFont),1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.fontFamilies,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e.value,value:e.value},(0,t.toDisplayString)(e.label),9,aU))),128))],42,rU)]),(0,t.createElementVNode)(`div`,oU,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(i).button.text),3),(0,t.createVNode)(eU,{"model-value":e.block.text,type:`text`,"onUpdate:modelValue":r[1]||=e=>a(`text`,e)},null,8,[`model-value`])]),(0,t.createElementVNode)(`div`,sU,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(i).button.url),3),(0,t.createVNode)(eU,{"model-value":e.block.url,type:`url`,placeholder:(0,t.unref)(i).button.urlPlaceholder,"onUpdate:modelValue":r[2]||=e=>a(`url`,e)},null,8,[`model-value`,`placeholder`]),e.block.url?((0,t.openBlock)(),(0,t.createElementBlock)(`label`,cU,[(0,t.createElementVNode)(`input`,{type:`checkbox`,class:`tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]`,checked:e.block.openInNewTab??!1,onChange:r[3]||=e=>a(`openInNewTab`,e.target.checked)},null,40,lU),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(i).button.openInNewTab),1)])):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`div`,uU,[(0,t.createElementVNode)(`div`,dU,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(i).button.background),3),(0,t.createVNode)(KV,{"model-value":e.block.backgroundColor,"onUpdate:modelValue":r[4]||=e=>a(`backgroundColor`,e)},null,8,[`model-value`])]),(0,t.createElementVNode)(`div`,fU,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(i).button.textColor),3),(0,t.createVNode)(KV,{"model-value":e.block.textColor,"onUpdate:modelValue":r[5]||=e=>a(`textColor`,e)},null,8,[`model-value`])])]),(0,t.createElementVNode)(`div`,pU,[(0,t.createElementVNode)(`div`,mU,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(i).button.borderRadius),3),(0,t.createElementVNode)(`div`,hU,[(0,t.createElementVNode)(`input`,{type:`number`,class:(0,t.normalizeClass)((0,t.unref)(oh)),value:e.block.borderRadius,min:`0`,max:`50`,onInput:r[6]||=e=>a(`borderRadius`,Number(e.target.value))},null,42,gU),(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)((0,t.unref)(sh))},`px`,2)])]),(0,t.createElementVNode)(`div`,_U,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(i).button.fontSize),3),(0,t.createElementVNode)(`div`,vU,[(0,t.createElementVNode)(`input`,{type:`number`,class:(0,t.normalizeClass)((0,t.unref)(oh)),value:e.block.fontSize,min:`10`,max:`36`,onInput:r[7]||=e=>a(`fontSize`,Number(e.target.value))},null,42,yU),(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)((0,t.unref)(sh))},`px`,2)])])])],64))}})})),SU,CU=d((()=>{xU(),xU(),SU=bU})),wU,TU,EU,DU,OU,kU,AU,jU,MU,NU,PU,FU,IU,LU,RU,zU,BU,VU,HU,UU,WU,GU,KU,qU,JU=d((()=>{k(),F(),wU={class:`spacing-control`},TU={class:`tpl:mb-2 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]`},EU={class:`tpl:flex tpl:flex-col tpl:items-center tpl:gap-1.5`},DU={class:`tpl:flex tpl:items-center`},OU=[`aria-label`],kU=[`value`,`aria-label`],AU=[`aria-label`],jU={class:`tpl:flex tpl:items-center tpl:gap-2`},MU={class:`tpl:flex tpl:items-center`},NU=[`aria-label`],PU=[`value`,`aria-label`],FU=[`aria-label`],IU=[`aria-label`,`title`],LU={class:`tpl:flex tpl:items-center`},RU=[`aria-label`],zU=[`value`,`aria-label`],BU=[`aria-label`],VU={class:`tpl:flex tpl:items-center`},HU=[`aria-label`],UU=[`value`,`aria-label`],WU=[`aria-label`],GU=`tpl:flex tpl:items-center tpl:justify-center tpl:w-8 tpl:h-8 tpl:text-[var(--tpl-text-muted)] tpl:bg-[var(--tpl-bg)] tpl:border tpl:border-[var(--tpl-border)] tpl:cursor-pointer tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-bg-hover)] hover:tpl:text-[var(--tpl-text)] active:tpl:bg-[var(--tpl-bg-active)]`,KU=`tpl:w-10 tpl:h-8 tpl:text-center tpl:text-xs tpl:font-medium tpl:border-y tpl:border-x-0 tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)] tpl:outline-none tpl:transition-all tpl:duration-[120ms] focus:tpl:border-[var(--tpl-primary)] focus:tpl:shadow-[var(--tpl-ring)]`,qU=(0,t.defineComponent)({__name:`SpacingControl`,props:{modelValue:{},label:{}},emits:[`update:modelValue`],setup(e,{emit:n}){let r=e,i=n,{t:a}=O(),o=(0,t.computed)(()=>r.modelValue.top===r.modelValue.right&&r.modelValue.right===r.modelValue.bottom&&r.modelValue.bottom===r.modelValue.left),s=(0,t.ref)(o.value);(0,t.watch)(o,e=>{!e&&s.value&&(s.value=!1)});function c(e,t){let n=r.modelValue[e],a=Math.max(0,n+t);s.value?i(`update:modelValue`,{top:a,right:a,bottom:a,left:a}):i(`update:modelValue`,{...r.modelValue,[e]:a})}function l(e,t){let n=Math.max(0,t);s.value?i(`update:modelValue`,{top:n,right:n,bottom:n,left:n}):i(`update:modelValue`,{...r.modelValue,[e]:n})}function u(){if(s.value=!s.value,s.value){let e=r.modelValue.top;i(`update:modelValue`,{top:e,right:e,bottom:e,left:e})}}return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,wU,[(0,t.createElementVNode)(`label`,TU,(0,t.toDisplayString)(e.label),1),(0,t.createElementVNode)(`div`,EU,[(0,t.createElementVNode)(`div`,DU,[(0,t.createElementVNode)(`button`,{"aria-label":(0,t.unref)(a).spacingControl.decreaseTop,class:(0,t.normalizeClass)([GU,`tpl:rounded-l-[var(--tpl-radius-sm)]`]),onClick:r[0]||=e=>c(`top`,-1)},[(0,t.createVNode)((0,t.unref)(fu),{size:12,"stroke-width":2})],10,OU),(0,t.createElementVNode)(`input`,{type:`number`,class:(0,t.normalizeClass)(KU),value:e.modelValue.top,"aria-label":(0,t.unref)(a).spacingControl.top,min:`0`,onInput:r[1]||=e=>l(`top`,Number(e.target.value))},null,40,kU),(0,t.createElementVNode)(`button`,{"aria-label":(0,t.unref)(a).spacingControl.increaseTop,class:(0,t.normalizeClass)([GU,`tpl:rounded-r-[var(--tpl-radius-sm)]`]),onClick:r[2]||=e=>c(`top`,1)},[(0,t.createVNode)((0,t.unref)(Hu),{size:12,"stroke-width":2})],10,AU)]),(0,t.createElementVNode)(`div`,jU,[(0,t.createElementVNode)(`div`,MU,[(0,t.createElementVNode)(`button`,{"aria-label":(0,t.unref)(a).spacingControl.decreaseLeft,class:(0,t.normalizeClass)([GU,`tpl:rounded-l-[var(--tpl-radius-sm)]`]),onClick:r[3]||=e=>c(`left`,-1)},[(0,t.createVNode)((0,t.unref)(fu),{size:12,"stroke-width":2})],10,NU),(0,t.createElementVNode)(`input`,{type:`number`,class:(0,t.normalizeClass)(KU),value:e.modelValue.left,"aria-label":(0,t.unref)(a).spacingControl.left,min:`0`,onInput:r[4]||=e=>l(`left`,Number(e.target.value))},null,40,PU),(0,t.createElementVNode)(`button`,{"aria-label":(0,t.unref)(a).spacingControl.increaseLeft,class:(0,t.normalizeClass)([GU,`tpl:rounded-r-[var(--tpl-radius-sm)]`]),onClick:r[5]||=e=>c(`left`,1)},[(0,t.createVNode)((0,t.unref)(Hu),{size:12,"stroke-width":2})],10,FU)]),(0,t.createElementVNode)(`button`,{class:(0,t.normalizeClass)([`tpl:flex tpl:h-8 tpl:w-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]`,s.value?`tpl:border-[var(--tpl-primary)] tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary)]`:`tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] hover:tpl:bg-[var(--tpl-bg-hover)]`]),"aria-label":s.value?(0,t.unref)(a).spacingControl.unlock:(0,t.unref)(a).spacingControl.lockAll,title:s.value?(0,t.unref)(a).spacingControl.unlock:(0,t.unref)(a).spacingControl.lockAll,onClick:u},[s.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(ou),{key:0,size:14,"stroke-width":2})):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(ru),{key:1,size:14,"stroke-width":2}))],10,IU),(0,t.createElementVNode)(`div`,LU,[(0,t.createElementVNode)(`button`,{"aria-label":(0,t.unref)(a).spacingControl.decreaseRight,class:(0,t.normalizeClass)([GU,`tpl:rounded-l-[var(--tpl-radius-sm)]`]),onClick:r[6]||=e=>c(`right`,-1)},[(0,t.createVNode)((0,t.unref)(fu),{size:12,"stroke-width":2})],10,RU),(0,t.createElementVNode)(`input`,{type:`number`,class:(0,t.normalizeClass)(KU),value:e.modelValue.right,"aria-label":(0,t.unref)(a).spacingControl.right,min:`0`,onInput:r[7]||=e=>l(`right`,Number(e.target.value))},null,40,zU),(0,t.createElementVNode)(`button`,{"aria-label":(0,t.unref)(a).spacingControl.increaseRight,class:(0,t.normalizeClass)([GU,`tpl:rounded-r-[var(--tpl-radius-sm)]`]),onClick:r[8]||=e=>c(`right`,1)},[(0,t.createVNode)((0,t.unref)(Hu),{size:12,"stroke-width":2})],10,BU)])]),(0,t.createElementVNode)(`div`,VU,[(0,t.createElementVNode)(`button`,{"aria-label":(0,t.unref)(a).spacingControl.decreaseBottom,class:(0,t.normalizeClass)([GU,`tpl:rounded-l-[var(--tpl-radius-sm)]`]),onClick:r[9]||=e=>c(`bottom`,-1)},[(0,t.createVNode)((0,t.unref)(fu),{size:12,"stroke-width":2})],10,HU),(0,t.createElementVNode)(`input`,{type:`number`,class:(0,t.normalizeClass)(KU),value:e.modelValue.bottom,"aria-label":(0,t.unref)(a).spacingControl.bottom,min:`0`,onInput:r[10]||=e=>l(`bottom`,Number(e.target.value))},null,40,UU),(0,t.createElementVNode)(`button`,{"aria-label":(0,t.unref)(a).spacingControl.increaseBottom,class:(0,t.normalizeClass)([GU,`tpl:rounded-r-[var(--tpl-radius-sm)]`]),onClick:r[11]||=e=>c(`bottom`,1)},[(0,t.createVNode)((0,t.unref)(Hu),{size:12,"stroke-width":2})],10,WU)])])]))}})})),YU=d((()=>{})),XU,ZU=d((()=>{JU(),JU(),YU(),dp(),XU=up(qU,[[`__scopeId`,`data-v-9a9c8a07`]])})),QU,$U,eW=d((()=>{F(),QU={class:`tpl:mt-3`},$U=(0,t.defineComponent)({__name:`CollapsibleSection`,props:{title:{},open:{type:Boolean},noBorder:{type:Boolean}},emits:[`toggle`],setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`tpl:py-3`,e.noBorder?``:`tpl:border-t tpl:border-[var(--tpl-border)]`])},[(0,t.createElementVNode)(`button`,{type:`button`,class:`tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:gap-1.5 tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]`,onClick:r[0]||=e=>n.$emit(`toggle`)},[(0,t.createVNode)((0,t.unref)(Ac),{class:(0,t.normalizeClass)([`tpl:transition-transform tpl:duration-200`,e.open?`tpl:rotate-0`:`tpl:-rotate-90`]),size:12,"stroke-width":2},null,8,[`class`]),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(e.title),1)]),(0,t.withDirectives)((0,t.createElementVNode)(`div`,QU,[(0,t.renderSlot)(n.$slots,`default`)],512),[[t.vShow,e.open]])],2))}})})),tW,nW=d((()=>{eW(),eW(),tW=$U})),rW,iW,aW,oW,sW,cW,lW,uW,dW,fW,pW,mW,hW,gW,_W,vW,yW,bW,xW,SW,CW,wW=d((()=>{qV(),ZU(),nW(),k(),yh(),F(),D(),rW={class:`tpl:mt-4`},iW={class:`tpl:space-y-2`},aW=[`checked`,`onChange`],oW=[`value`,`placeholder`],sW={class:`tpl:space-y-2`},cW=[`value`],lW={value:``},uW=[`label`],dW=[`value`],fW=[`value`],pW={key:0,value:`__custom__`},mW={key:0,class:`tpl:space-y-2`},hW={class:`tpl:mb-1 tpl:block tpl:text-[11px] tpl:font-medium tpl:text-[var(--tpl-text-muted)]`},gW={class:`tpl:mb-1 tpl:block tpl:text-[11px] tpl:font-medium tpl:text-[var(--tpl-text-muted)]`},_W={class:`tpl:flex tpl:justify-end`},vW=[`disabled`],yW={key:0,class:`tpl:text-[11px] tpl:text-[var(--tpl-text-muted)]`},bW={class:`tpl:space-y-1`},xW={class:`tpl:m-0 tpl:overflow-x-auto tpl:rounded tpl:bg-[var(--tpl-bg)] tpl:p-2 tpl:font-mono tpl:text-[10px] tpl:text-[var(--tpl-text-muted)]`},SW={key:0,class:`tpl:m-0 tpl:overflow-x-auto tpl:rounded tpl:bg-[var(--tpl-bg)] tpl:p-2 tpl:font-mono tpl:text-[10px] tpl:text-[var(--tpl-text-muted)]`},CW=(0,t.defineComponent)({__name:`CommonBlockSettings`,props:{block:{},isFirstSection:{type:Boolean}},emits:[`update`],setup(e,{emit:n}){let r=e,i=n,{t:a}=O(),o=(0,t.inject)(Ge,[]),s=(0,t.inject)(Ke,!1),c=(0,t.reactive)(new Set),l=(0,t.ref)(!1),u=(0,t.ref)(``),d=(0,t.ref)(``),f=[{key:`desktop`,icon:hu,labelKey:`showOnDesktop`},{key:`tablet`,icon:pf,labelKey:`showOnTablet`},{key:`mobile`,icon:Id,labelKey:`showOnMobile`}];function p(e){c.has(e)?c.delete(e):c.add(e)}let m=(0,t.computed)(()=>o.length>0||s),h=(0,t.computed)(()=>r.block.displayCondition?!o.some(e=>e.label===r.block.displayCondition?.label):!1);function g(){l.value=!0,h.value&&r.block.displayCondition?(u.value=r.block.displayCondition.before,d.value=r.block.displayCondition.after??``):(u.value=``,d.value=``)}function _(){u.value.trim()&&(i(`update`,{displayCondition:{label:a.blockSettings.customCondition,before:u.value.trim(),after:d.value.trim()}}),l.value=!1,u.value=``,d.value=``)}(0,t.watch)(()=>r.block.displayCondition,e=>{if(!e){l.value=!1,u.value=``,d.value=``;return}h.value&&(u.value=e.before,d.value=e.after??``)},{immediate:!0});let v=(0,t.computed)(()=>{let e={};for(let t of o){let n=t.group??``;e[n]||(e[n]=[]),e[n].push(t)}return e});function y(e,t){i(`update`,{styles:{...r.block.styles,[e]:t}})}function b(e){return r.block.visibility?.[e]!==!1}function x(e){let t={desktop:b(`desktop`),tablet:b(`tablet`),mobile:b(`mobile`)};t[e]=!t[e],i(`update`,{visibility:t})}return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`tpl:flex tpl:flex-col`,e.isFirstSection?``:`tpl:mt-4`])},[(0,t.createVNode)(tW,{title:(0,t.unref)(a).blockSettings.spacing,open:c.has(`spacing`),"no-border":e.isFirstSection,onToggle:r[2]||=e=>p(`spacing`)},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(XU,{label:(0,t.unref)(a).blockSettings.padding,"model-value":e.block.styles.padding,"onUpdate:modelValue":r[0]||=e=>y(`padding`,e)},null,8,[`label`,`model-value`]),(0,t.createElementVNode)(`div`,rW,[(0,t.createVNode)(XU,{label:(0,t.unref)(a).blockSettings.margin,"model-value":e.block.styles.margin,"onUpdate:modelValue":r[1]||=e=>y(`margin`,e)},null,8,[`label`,`model-value`])])]),_:1},8,[`title`,`open`,`no-border`]),(0,t.createVNode)(tW,{title:(0,t.unref)(a).blockSettings.background,open:c.has(`bg`),onToggle:r[4]||=e=>p(`bg`)},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(a).blockSettings.color),3),(0,t.createVNode)(KV,{size:`large`,"model-value":e.block.styles.backgroundColor||(0,t.unref)(`#ffffff`),"onUpdate:modelValue":r[3]||=e=>y(`backgroundColor`,e)},null,8,[`model-value`])]),_:1},8,[`title`,`open`]),(0,t.createVNode)(tW,{title:(0,t.unref)(a).blockSettings.display,open:c.has(`display`),onToggle:r[5]||=e=>p(`display`)},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,iW,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(f,e=>(0,t.createElementVNode)(`label`,{key:e.key,class:`tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-xs tpl:text-[var(--tpl-text)]`},[(0,t.createElementVNode)(`input`,{type:`checkbox`,class:`tpl:accent-[var(--tpl-primary)]`,checked:b(e.key),onChange:t=>x(e.key)},null,40,aW),((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.icon),{size:14,"stroke-width":1.5})),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(a).blockSettings[e.labelKey]),1)])),64))])]),_:1},8,[`title`,`open`]),(0,t.createVNode)(tW,{title:(0,t.unref)(a).blockSettings.customCss,open:c.has(`css`),onToggle:r[7]||=e=>p(`css`)},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(a).blockSettings.css),3),(0,t.createElementVNode)(`textarea`,{value:e.block.customCss||``,placeholder:(0,t.unref)(a).blockSettings.cssPlaceholder,rows:`3`,class:(0,t.normalizeClass)((0,t.unref)(fh)),onInput:r[6]||=e=>i(`update`,{customCss:e.target.value})},null,42,oW)]),_:1},8,[`title`,`open`]),m.value?((0,t.openBlock)(),(0,t.createBlock)(tW,{key:0,title:(0,t.unref)(a).blockSettings.displayCondition,open:c.has(`condition`),onToggle:r[11]||=e=>p(`condition`)},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,sW,[(0,t.createElementVNode)(`select`,{class:(0,t.normalizeClass)([`tpl:w-full tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-2 tpl:text-xs tpl:outline-none tpl:transition-all tpl:duration-150 tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[0_0_0_3px_var(--tpl-primary-light)]`,e.block.displayCondition?`tpl:border-[var(--tpl-primary)] tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-text)]`:`tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]`]),value:l.value||h.value?`__custom__`:e.block.displayCondition?.label??``,onChange:r[8]||=e=>{let n=e.target.value;if(n===`__custom__`){g();return}if(l.value=!1,!n){i(`update`,{displayCondition:void 0});return}let r=(0,t.unref)(o).find(e=>e.label===n);r&&i(`update`,{displayCondition:r})}},[(0,t.createElementVNode)(`option`,lW,(0,t.toDisplayString)((0,t.unref)(a).blockSettings.noCondition),1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(v.value,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:n},[n?((0,t.openBlock)(),(0,t.createElementBlock)(`optgroup`,{key:0,label:String(n)},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e.label,value:e.label},(0,t.toDisplayString)(e.label),9,dW))),128))],8,uW)):((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:1},(0,t.renderList)(e,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e.label,value:e.label},(0,t.toDisplayString)(e.label),9,fW))),128))],64))),128)),(0,t.unref)(s)?((0,t.openBlock)(),(0,t.createElementBlock)(`option`,pW,(0,t.toDisplayString)((0,t.unref)(a).blockSettings.customCondition),1)):(0,t.createCommentVNode)(``,!0)],42,cW),l.value||h.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,mW,[(0,t.createElementVNode)(`div`,null,[(0,t.createElementVNode)(`label`,hW,(0,t.toDisplayString)((0,t.unref)(a).blockSettings.customConditionBefore),1),(0,t.withDirectives)((0,t.createElementVNode)(`textarea`,{"onUpdate:modelValue":r[9]||=e=>u.value=e,rows:`2`,class:(0,t.normalizeClass)((0,t.unref)(fh))},null,2),[[t.vModelText,u.value]])]),(0,t.createElementVNode)(`div`,null,[(0,t.createElementVNode)(`label`,gW,(0,t.toDisplayString)((0,t.unref)(a).blockSettings.customConditionAfter),1),(0,t.withDirectives)((0,t.createElementVNode)(`textarea`,{"onUpdate:modelValue":r[10]||=e=>d.value=e,rows:`2`,class:(0,t.normalizeClass)((0,t.unref)(fh))},null,2),[[t.vModelText,d.value]])]),(0,t.createElementVNode)(`div`,_W,[(0,t.createElementVNode)(`button`,{type:`button`,class:`tpl:cursor-pointer tpl:rounded-md tpl:border-none tpl:bg-[var(--tpl-primary)] tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-bg)] tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:opacity-50`,disabled:!u.value.trim(),onClick:_},(0,t.toDisplayString)((0,t.unref)(a).blockSettings.applyCondition),9,vW)])])):e.block.displayCondition&&!h.value?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[e.block.displayCondition.description?((0,t.openBlock)(),(0,t.createElementBlock)(`p`,yW,(0,t.toDisplayString)(e.block.displayCondition.description),1)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,bW,[(0,t.createElementVNode)(`pre`,xW,(0,t.toDisplayString)(e.block.displayCondition.before),1),e.block.displayCondition.after?((0,t.openBlock)(),(0,t.createElementBlock)(`pre`,SW,(0,t.toDisplayString)(e.block.displayCondition.after),1)):(0,t.createCommentVNode)(``,!0)])],64)):(0,t.createCommentVNode)(``,!0)])]),_:1},8,[`title`,`open`])):(0,t.createCommentVNode)(``,!0)],2))}})})),TW,EW=d((()=>{wW(),wW(),TW=CW})),DW,OW,kW,AW=d((()=>{DW=[`aria-checked`,`aria-label`,`title`,`onClick`],OW={key:1},kW=(0,t.defineComponent)({__name:`SlidingPillSelect`,props:{options:{},modelValue:{}},emits:[`update:modelValue`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.computed)(()=>{let e=r.options.findIndex(e=>e.value===r.modelValue);return`translateX(${Math.max(e,0)*100}%)`});return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{role:`radiogroup`,class:`tpl:relative tpl:grid tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1`,style:(0,t.normalizeStyle)({gridTemplateColumns:`repeat(${e.options.length}, 1fr)`,backgroundColor:`var(--tpl-bg-hover)`})},[(0,t.createElementVNode)(`div`,{class:`tpl:absolute tpl:inset-y-1 tpl:rounded-[var(--tpl-radius-sm)]`,style:(0,t.normalizeStyle)({left:`4px`,width:`calc((100% - 8px) / ${e.options.length})`,transform:a.value,backgroundColor:`var(--tpl-bg)`,boxShadow:`var(--tpl-shadow)`,transition:`transform 120ms cubic-bezier(0.16, 1, 0.3, 1)`})},null,4),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.options,n=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:n.value,role:`radio`,"aria-checked":e.modelValue===n.value,"aria-label":n.label,class:`tpl:relative tpl:z-10 tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:px-2.5 tpl:py-[5px] tpl:text-xs tpl:font-medium`,style:(0,t.normalizeStyle)({color:e.modelValue===n.value?`var(--tpl-primary)`:`var(--tpl-text-muted)`,transition:`color 120ms cubic-bezier(0.16, 1, 0.3, 1)`}),title:n.label,onClick:e=>i(`update:modelValue`,n.value)},[n.icon?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(n.icon),{key:0,size:14,"stroke-width":2})):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,OW,(0,t.toDisplayString)(n.label),1))],12,DW))),128))],4))}})})),jW,MW=d((()=>{AW(),AW(),jW=kW})),NW,PW,FW=d((()=>{yh(),NW={class:`tpl:mb-3.5`},PW=(0,t.defineComponent)({__name:`FieldRow`,props:{label:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,NW,[e.label?((0,t.openBlock)(),(0,t.createElementBlock)(`label`,{key:0,class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)(e.label),3)):(0,t.createCommentVNode)(``,!0),(0,t.renderSlot)(n.$slots,`default`)]))}})})),IW,LW=d((()=>{FW(),FW(),IW=PW})),RW,zW,BW,VW=d((()=>{RW={class:`tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text)]`},zW=[`checked`],BW=(0,t.defineComponent)({__name:`CheckboxItem`,props:{modelValue:{type:Boolean},label:{}},emits:[`update:modelValue`],setup(e,{emit:n}){let r=n;return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`label`,RW,[(0,t.createElementVNode)(`input`,{type:`checkbox`,class:`tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]`,checked:e.modelValue,onChange:i[0]||=e=>r(`update:modelValue`,e.target.checked)},null,40,zW),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.label),1)]))}})})),HW,UW=d((()=>{VW(),VW(),HW=BW})),WW,GW,KW,qW=d((()=>{yh(),WW={class:`tpl:flex tpl:items-stretch`},GW=[`value`,`min`,`max`],KW=(0,t.defineComponent)({__name:`NumberWithSuffix`,props:{modelValue:{},min:{},max:{},suffix:{}},emits:[`update:modelValue`],setup(e,{emit:n}){let r=n;return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,WW,[(0,t.createElementVNode)(`input`,{type:`number`,class:(0,t.normalizeClass)((0,t.unref)(oh)),value:e.modelValue,min:e.min,max:e.max,onInput:i[0]||=e=>r(`update:modelValue`,Number(e.target.value))},null,42,GW),(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)((0,t.unref)(sh))},(0,t.toDisplayString)(e.suffix),3)]))}})})),JW,YW=d((()=>{qW(),qW(),JW=KW})),XW,ZW,QW,$W,eG,tG,nG,rG,iG,aG,oG,sG,cG,lG,uG=d((()=>{qV(),MW(),LW(),UW(),YW(),k(),yh(),XW=[`value`],ZW=[`value`],QW=[`value`],$W={class:`tpl:grid tpl:grid-cols-2 tpl:gap-2`},eG=[`value`],tG={value:``},nG=[`value`],rG={class:`tpl:grid tpl:grid-cols-2 tpl:gap-3`},iG={class:`tpl:grid tpl:grid-cols-2 tpl:gap-3`},aG={class:`tpl:grid tpl:grid-cols-2 tpl:gap-2`},oG=[`value`,`placeholder`,`onInput`],sG=[`value`,`placeholder`],cG=[`value`],lG=(0,t.defineComponent)({__name:`CountdownToolbar`,props:{block:{},fontFamilies:{}},emits:[`update`],setup(e,{emit:n}){let r=n,{t:i}=O(),a=[`UTC`,`America/New_York`,`America/Chicago`,`America/Denver`,`America/Los_Angeles`,`Europe/London`,`Europe/Berlin`,`Europe/Paris`,`Europe/Moscow`,`Asia/Dubai`,`Asia/Kolkata`,`Asia/Shanghai`,`Asia/Tokyo`,`Australia/Sydney`,`Pacific/Auckland`],o=[{value:`:`,label:`:`},{value:`-`,label:`-`},{value:` `,label:`␣`}],s=[`Days`,`Hours`,`Minutes`,`Seconds`],c=(0,t.computed)(()=>s.map(e=>({unit:e,showKey:`show${e}`,labelKey:`label${e}`,translationKey:e.toLowerCase()})));function l(e,t){r(`update`,{[e]:t})}return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,[(0,t.createVNode)(IW,{label:(0,t.unref)(i).countdown.targetDate},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`input`,{type:`datetime-local`,class:(0,t.normalizeClass)((0,t.unref)(ah)),value:e.block.targetDate,onInput:r[0]||=e=>l(`targetDate`,e.target.value)},null,42,XW)]),_:1},8,[`label`]),(0,t.createVNode)(IW,{label:(0,t.unref)(i).countdown.timezone},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`select`,{class:(0,t.normalizeClass)((0,t.unref)(ah)),value:e.block.timezone,onChange:r[1]||=e=>l(`timezone`,e.target.value)},[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(a,e=>(0,t.createElementVNode)(`option`,{key:e,value:e},(0,t.toDisplayString)(e),9,QW)),64))],42,ZW)]),_:1},8,[`label`]),(0,t.createVNode)(IW,{label:(0,t.unref)(i).countdown.display},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,$W,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(c.value,n=>((0,t.openBlock)(),(0,t.createBlock)(HW,{key:n.unit,"model-value":e.block[n.showKey],label:(0,t.unref)(i).countdown[n.translationKey],"onUpdate:modelValue":e=>l(n.showKey,e)},null,8,[`model-value`,`label`,`onUpdate:modelValue`]))),128))])]),_:1},8,[`label`]),(0,t.createVNode)(IW,{label:(0,t.unref)(i).countdown.separator},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(jW,{options:o,"model-value":e.block.separator,"onUpdate:modelValue":r[2]||=e=>l(`separator`,e)},null,8,[`model-value`])]),_:1},8,[`label`]),(0,t.createVNode)(IW,{label:(0,t.unref)(i).countdown.fontFamily},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`select`,{class:(0,t.normalizeClass)((0,t.unref)(ah)),value:e.block.fontFamily||``,onChange:r[3]||=e=>l(`fontFamily`,e.target.value||void 0)},[(0,t.createElementVNode)(`option`,tG,(0,t.toDisplayString)((0,t.unref)(i).countdown.inheritFont),1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.fontFamilies,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e.value,value:e.value},(0,t.toDisplayString)(e.label),9,nG))),128))],42,eG)]),_:1},8,[`label`]),(0,t.createElementVNode)(`div`,rG,[(0,t.createVNode)(IW,{label:(0,t.unref)(i).countdown.digitFontSize},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(JW,{"model-value":e.block.digitFontSize,min:12,max:72,suffix:`px`,"onUpdate:modelValue":r[4]||=e=>l(`digitFontSize`,e)},null,8,[`model-value`])]),_:1},8,[`label`]),(0,t.createVNode)(IW,{label:(0,t.unref)(i).countdown.labelFontSize},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(JW,{"model-value":e.block.labelFontSize,min:8,max:24,suffix:`px`,"onUpdate:modelValue":r[5]||=e=>l(`labelFontSize`,e)},null,8,[`model-value`])]),_:1},8,[`label`])]),(0,t.createElementVNode)(`div`,iG,[(0,t.createVNode)(IW,{label:(0,t.unref)(i).countdown.digitColor},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(KV,{"model-value":e.block.digitColor,"onUpdate:modelValue":r[6]||=e=>l(`digitColor`,e)},null,8,[`model-value`])]),_:1},8,[`label`]),(0,t.createVNode)(IW,{label:(0,t.unref)(i).countdown.labelColor},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(KV,{"model-value":e.block.labelColor,"onUpdate:modelValue":r[7]||=e=>l(`labelColor`,e)},null,8,[`model-value`])]),_:1},8,[`label`])]),(0,t.createVNode)(IW,{label:(0,t.unref)(i).countdown.background},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(KV,{"model-value":e.block.backgroundColor,"onUpdate:modelValue":r[8]||=e=>l(`backgroundColor`,e)},null,8,[`model-value`])]),_:1},8,[`label`]),(0,t.createVNode)(IW,{label:(0,t.unref)(i).countdown.labels},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,aG,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(c.value,n=>((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{key:n.unit,type:`text`,class:(0,t.normalizeClass)((0,t.unref)(ah)),value:e.block[n.labelKey],placeholder:(0,t.unref)(i).countdown[n.translationKey],onInput:e=>l(n.labelKey,e.target.value)},null,42,oG))),128))])]),_:1},8,[`label`]),(0,t.createVNode)(IW,{label:(0,t.unref)(i).countdown.expiry},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`input`,{type:`text`,class:(0,t.normalizeClass)((0,t.unref)(ah)),value:e.block.expiredMessage,placeholder:(0,t.unref)(i).countdown.expiredMessagePlaceholder,onInput:r[9]||=e=>l(`expiredMessage`,e.target.value)},null,42,sG)]),_:1},8,[`label`]),(0,t.createVNode)(IW,{label:(0,t.unref)(i).countdown.expiredImageUrl},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`input`,{type:`url`,class:(0,t.normalizeClass)((0,t.unref)(ah)),value:e.block.expiredImageUrl,placeholder:`https://...`,onInput:r[10]||=e=>l(`expiredImageUrl`,e.target.value)},null,42,cG)]),_:1},8,[`label`]),(0,t.createVNode)(HW,{"model-value":e.block.hideOnExpiry,label:(0,t.unref)(i).countdown.hideOnExpiry,class:`tpl:mb-3.5`,"onUpdate:modelValue":r[11]||=e=>l(`hideOnExpiry`,e)},null,8,[`model-value`,`label`])],64))}})})),dG,fG=d((()=>{uG(),uG(),dG=lG})),pG,mG,hG,gG,_G,vG=d((()=>{k(),F(),pG=[`title`],mG={class:`tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]`},hG={key:1,class:`tpl:text-[var(--tpl-danger)]`},gG=[`aria-checked`,`aria-label`,`disabled`],_G=(0,t.defineComponent)({__name:`BooleanField`,props:{field:{},modelValue:{type:Boolean},readOnly:{type:Boolean}},emits:[`update:modelValue`],setup(e,{emit:n}){let r=n,{t:i}=O();return(n,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`tpl:mb-3.5`,title:e.readOnly?(0,t.unref)(i).customBlocks.dataSource.readOnlyTooltip:void 0},[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)([`tpl:flex tpl:items-center tpl:justify-between tpl:gap-2`,e.readOnly?`tpl:cursor-not-allowed`:`tpl:cursor-pointer`])},[(0,t.createElementVNode)(`span`,mG,[(0,t.createTextVNode)((0,t.toDisplayString)(e.field.label)+` `,1),e.readOnly?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(ou),{key:0,size:12,class:`tpl:inline tpl:text-[var(--tpl-text-dim)]`})):(0,t.createCommentVNode)(``,!0),e.field.required?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,hG,` * `)):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`button`,{type:`button`,role:`switch`,"aria-checked":e.modelValue,"aria-label":e.field.label,class:(0,t.normalizeClass)([`tpl:relative tpl:inline-flex tpl:h-5 tpl:w-9 tpl:shrink-0 tpl:rounded-full tpl:border-2 tpl:border-transparent tpl:transition-colors tpl:duration-200`,e.modelValue?`tpl:bg-[var(--tpl-primary)]`:`tpl:bg-[var(--tpl-border)]`,e.readOnly?`tpl:opacity-60 tpl:cursor-not-allowed`:`tpl:cursor-pointer`]),disabled:e.readOnly,onClick:a[0]||=t=>!e.readOnly&&r(`update:modelValue`,!e.modelValue)},[(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)([`tpl:pointer-events-none tpl:inline-block tpl:size-4 tpl:rounded-full tpl:bg-[var(--tpl-bg)] tpl:shadow tpl:transition-transform tpl:duration-200`,e.modelValue?`tpl:translate-x-4`:`tpl:translate-x-0`])},null,2)],10,gG)],2)],8,pG))}})})),yG,bG=d((()=>{vG(),vG(),yG=_G})),xG,SG,CG,wG=d((()=>{yh(),F(),xG={class:`tpl:mb-3.5`},SG={key:1,class:`tpl:text-[var(--tpl-danger)]`},CG=(0,t.defineComponent)({__name:`FieldWrapper`,props:{label:{},required:{type:Boolean},readOnly:{type:Boolean}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,xG,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},[(0,t.createTextVNode)((0,t.toDisplayString)(e.label)+` `,1),e.readOnly?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(ou),{key:0,size:12,class:`tpl:inline tpl:text-[var(--tpl-text-dim)]`})):(0,t.createCommentVNode)(``,!0),e.required?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,SG,`*`)):(0,t.createCommentVNode)(``,!0)],2),(0,t.renderSlot)(n.$slots,`default`)]))}})})),TG,EG=d((()=>{wG(),wG(),TG=CG})),DG,OG=d((()=>{k(),yh(),EG(),qV(),DG=(0,t.defineComponent)({__name:`ColorField`,props:{field:{},modelValue:{},readOnly:{type:Boolean}},emits:[`update:modelValue`],setup(e,{emit:n}){let r=n,{t:i}=O();return(n,a)=>((0,t.openBlock)(),(0,t.createBlock)(TG,{label:e.field.label,required:e.field.required,"read-only":e.readOnly},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(KV,{"model-value":e.modelValue||(0,t.unref)(`#000000`),placeholder:e.field.placeholder||(0,t.unref)(`#000000`),disabled:e.readOnly,title:e.readOnly?(0,t.unref)(i).customBlocks.dataSource.readOnlyTooltip:void 0,"onUpdate:modelValue":a[0]||=e=>r(`update:modelValue`,e)},null,8,[`model-value`,`placeholder`,`disabled`,`title`])]),_:1},8,[`label`,`required`,`read-only`]))}})})),kG,AG=d((()=>{OG(),OG(),kG=DG})),jG,MG,NG,PG=d((()=>{k(),yh(),F(),D(),EG(),jG=[`value`,`placeholder`,`title`],MG=[`value`,`placeholder`],NG=(0,t.defineComponent)({__name:`ImageField`,props:{field:{},modelValue:{},readOnly:{type:Boolean}},emits:[`update:modelValue`],setup(e,{emit:n}){let r=n,{t:i}=O(),a=(0,t.inject)(We,null),o=(0,t.computed)(()=>!!a);async function s(){let e=await a?.({accept:[`images`]});e&&r(`update:modelValue`,e.url)}return(n,a)=>((0,t.openBlock)(),(0,t.createBlock)(TG,{label:e.field.label,required:e.field.required,"read-only":e.readOnly},{default:(0,t.withCtx)(()=>[e.readOnly?((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{key:0,type:`url`,class:(0,t.normalizeClass)([(0,t.unref)(ah),`tpl:opacity-60 tpl:cursor-not-allowed`]),value:e.modelValue,placeholder:e.field.placeholder||`https://...`,disabled:``,title:(0,t.unref)(i).customBlocks.dataSource.readOnlyTooltip},null,10,jG)):((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{key:1,type:`url`,class:(0,t.normalizeClass)((0,t.unref)(ah)),value:e.modelValue,placeholder:e.field.placeholder||`https://...`,onInput:a[0]||=e=>r(`update:modelValue`,e.target.value)},null,42,MG)),o.value&&!e.readOnly?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:2,class:`tpl:mt-2 tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150 tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-primary)] tpl:bg-[var(--tpl-bg)]`,onClick:a[1]||=e=>s()},[(0,t.createVNode)((0,t.unref)(Nl),{size:14,"stroke-width":1.5}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(i).image.browseMedia),1)])):(0,t.createCommentVNode)(``,!0)]),_:1},8,[`label`,`required`,`read-only`]))}})})),FG,IG=d((()=>{PG(),PG(),FG=NG})),LG,RG,zG=d((()=>{k(),yh(),EG(),LG=[`value`,`placeholder`,`min`,`max`,`step`,`disabled`,`title`],RG=(0,t.defineComponent)({__name:`NumberField`,props:{field:{},modelValue:{},readOnly:{type:Boolean}},emits:[`update:modelValue`],setup(e,{emit:n}){let r=n,{t:i}=O();return(n,a)=>((0,t.openBlock)(),(0,t.createBlock)(TG,{label:e.field.label,required:e.field.required,"read-only":e.readOnly},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`input`,{type:`number`,class:(0,t.normalizeClass)([(0,t.unref)(ah),e.readOnly&&`tpl:opacity-60 tpl:cursor-not-allowed`]),value:e.modelValue,placeholder:e.field.placeholder,min:e.field.min,max:e.field.max,step:e.field.step,disabled:e.readOnly,title:e.readOnly?(0,t.unref)(i).customBlocks.dataSource.readOnlyTooltip:void 0,onInput:a[0]||=t=>!e.readOnly&&r(`update:modelValue`,Number(t.target.value))},null,42,LG)]),_:1},8,[`label`,`required`,`read-only`]))}})})),BG,VG=d((()=>{zG(),zG(),BG=RG})),HG,UG,WG,GG,KG,qG,JG=d((()=>{k(),F(),gK(),EG(),yh(),HG={class:`tpl:flex tpl:flex-col tpl:gap-2`},UG={class:`tpl:mb-2 tpl:flex tpl:items-center tpl:justify-between`},WG={class:`tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-dim)]`},GG=[`title`,`onClick`],KG={key:1,class:`tpl:m-0 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]`},qG=(0,t.defineComponent)({__name:`RepeatableField`,props:{field:{},modelValue:{},readOnly:{type:Boolean}},emits:[`update:modelValue`],setup(e,{emit:n}){let r=e,i=n,{t:a}=O(),o=(0,t.computed)(()=>r.modelValue||[]),s=(0,t.computed)(()=>!r.field.maxItems||o.value.length<r.field.maxItems),c=(0,t.computed)(()=>!r.field.minItems||o.value.length>r.field.minItems);function l(){if(!s.value||r.readOnly)return;let e={};for(let t of r.field.fields)e[t.key]=t.default??``;i(`update:modelValue`,[...o.value,e])}function u(e){if(!c.value||r.readOnly)return;let t=[...o.value];t.splice(e,1),i(`update:modelValue`,t)}function d(e,t,n){i(`update:modelValue`,o.value.map((r,i)=>i===e?{...r,[t]:n}:r))}return(n,r)=>((0,t.openBlock)(),(0,t.createBlock)(TG,{label:e.field.label,required:e.field.required,"read-only":e.readOnly},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,HG,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(o.value,(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:`${e.field.key}-${r}`,class:`tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:p-3`},[(0,t.createElementVNode)(`div`,UG,[(0,t.createElementVNode)(`span`,WG,` #`+(0,t.toDisplayString)(r+1),1),c.value&&!e.readOnly?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,class:`tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-danger)] tpl:hover:bg-[var(--tpl-danger-light)] tpl:hover:text-[var(--tpl-danger)]`,title:(0,t.unref)(a).customBlocks.fields.removeItem,onClick:e=>u(r)},[(0,t.createVNode)((0,t.unref)(Of),{size:12,"stroke-width":2})],8,GG)):(0,t.createCommentVNode)(``,!0)]),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.field.fields,i=>((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)((0,t.unref)(mK)(i.type)),{key:i.key,field:i,"model-value":n[i.key],"read-only":e.readOnly,"onUpdate:modelValue":e=>d(r,i.key,e)},null,8,[`field`,`model-value`,`read-only`,`onUpdate:modelValue`]))),128))]))),128)),s.value&&!e.readOnly?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,class:(0,t.normalizeClass)((0,t.unref)(dh)),onClick:l},[(0,t.createVNode)((0,t.unref)(Hu),{size:14,"stroke-width":2}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(a).customBlocks.fields.addItem),1)],2)):(0,t.createCommentVNode)(``,!0),!s.value&&!e.readOnly?((0,t.openBlock)(),(0,t.createElementBlock)(`p`,KG,(0,t.toDisplayString)((0,t.unref)(a).customBlocks.fields.maxItemsReached),1)):(0,t.createCommentVNode)(``,!0)])]),_:1},8,[`label`,`required`,`read-only`]))}})})),YG,XG=d((()=>{JG(),JG(),YG=qG})),ZG,QG,$G,eK=d((()=>{k(),yh(),EG(),ZG=[`value`,`disabled`,`title`],QG=[`value`],$G=(0,t.defineComponent)({__name:`SelectField`,props:{field:{},modelValue:{},readOnly:{type:Boolean}},emits:[`update:modelValue`],setup(e,{emit:n}){let r=n,{t:i}=O();return(n,a)=>((0,t.openBlock)(),(0,t.createBlock)(TG,{label:e.field.label,required:e.field.required,"read-only":e.readOnly},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`select`,{class:(0,t.normalizeClass)([(0,t.unref)(ah),e.readOnly&&`tpl:opacity-60 tpl:cursor-not-allowed`]),value:e.modelValue,disabled:e.readOnly,title:e.readOnly?(0,t.unref)(i).customBlocks.dataSource.readOnlyTooltip:void 0,onChange:a[0]||=t=>!e.readOnly&&r(`update:modelValue`,t.target.value)},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.field.options,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e.value,value:e.value},(0,t.toDisplayString)(e.label),9,QG))),128))],42,ZG)]),_:1},8,[`label`,`required`,`read-only`]))}})})),tK,nK=d((()=>{eK(),eK(),tK=$G})),rK,iK,aK=d((()=>{k(),yh(),EG(),tU(),rK=[`value`,`placeholder`,`title`],iK=(0,t.defineComponent)({__name:`TextField`,props:{field:{},modelValue:{},readOnly:{type:Boolean}},emits:[`update:modelValue`],setup(e,{emit:n}){let r=n,{t:i}=O();return(n,a)=>((0,t.openBlock)(),(0,t.createBlock)(TG,{label:e.field.label,required:e.field.required,"read-only":e.readOnly},{default:(0,t.withCtx)(()=>[e.readOnly?((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{key:0,type:`text`,class:(0,t.normalizeClass)([(0,t.unref)(ah),`tpl:opacity-60 tpl:cursor-not-allowed`]),value:e.modelValue,placeholder:e.field.placeholder,disabled:``,title:(0,t.unref)(i).customBlocks.dataSource.readOnlyTooltip},null,10,rK)):((0,t.openBlock)(),(0,t.createBlock)(eU,{key:1,"model-value":e.modelValue,placeholder:e.field.placeholder,"onUpdate:modelValue":a[0]||=e=>r(`update:modelValue`,e)},null,8,[`model-value`,`placeholder`]))]),_:1},8,[`label`,`required`,`read-only`]))}})})),oK,sK=d((()=>{aK(),aK(),oK=iK})),cK,lK,uK,dK=d((()=>{k(),EG(),yH(),cK=[`value`,`placeholder`,`title`],lK=`tpl:w-full tpl:resize-y tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 tpl:text-sm tpl:text-[var(--tpl-text)] tpl:outline-none tpl:opacity-60 tpl:cursor-not-allowed`,uK=(0,t.defineComponent)({__name:`TextareaField`,props:{field:{},modelValue:{},readOnly:{type:Boolean}},emits:[`update:modelValue`],setup(e,{emit:n}){let r=n,{t:i}=O();return(n,a)=>((0,t.openBlock)(),(0,t.createBlock)(TG,{label:e.field.label,required:e.field.required,"read-only":e.readOnly},{default:(0,t.withCtx)(()=>[e.readOnly?((0,t.openBlock)(),(0,t.createElementBlock)(`textarea`,{key:0,value:e.modelValue,placeholder:e.field.placeholder,rows:`3`,disabled:``,title:(0,t.unref)(i).customBlocks.dataSource.readOnlyTooltip,class:(0,t.normalizeClass)(lK)},null,8,cK)):((0,t.openBlock)(),(0,t.createBlock)(vH,{key:1,"model-value":e.modelValue,placeholder:e.field.placeholder,"onUpdate:modelValue":a[0]||=e=>r(`update:modelValue`,e)},null,8,[`model-value`,`placeholder`]))]),_:1},8,[`label`,`required`,`read-only`]))}})})),fK,pK=d((()=>{dK(),dK(),fK=uK}));function mK(e){return hK[e]??oK}var hK,gK=d((()=>{bG(),AG(),IG(),VG(),XG(),nK(),sK(),pK(),hK={text:oK,textarea:fK,image:FG,color:kG,number:BG,select:tK,boolean:yG,repeatable:YG}})),_K,vK,yK,bK,xK,SK,CK,wK,TK,EK=d((()=>{k(),F(),D(),gK(),_K={key:0,class:`tpl:p-4`},vK={class:`tpl:m-0 tpl:text-center tpl:text-sm tpl:text-[var(--tpl-text-muted)]`},yK={key:1},bK={key:0,class:`tpl:m-0 tpl:mb-3 tpl:text-xs tpl:text-[var(--tpl-text-dim)]`},xK={key:1,class:`tpl:mb-4`},SK={key:1,class:`tpl:flex tpl:h-[32px] tpl:items-center`},CK={key:0,class:`tpl:w-full tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-muted)]`},wK={key:2,class:`tpl:m-0 tpl:mt-2 tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-danger)]`},TK=(0,t.defineComponent)({__name:`CustomBlockToolbar`,props:{block:{}},emits:[`updateFieldValues`,`updateDataSourceFetched`],setup(e,{emit:r}){let i=e,a=r,{t:o}=O(),s=(0,t.inject)(Be,[]),c=(0,t.computed)(()=>s.find(e=>e.type===i.block.customType)),{isFetching:l,fetchError:u,fetch:d,hasDataSource:f,needsFetch:p}=(0,n.useDataSourceFetch)({definition:c,block:(0,t.computed)(()=>i.block),onUpdate:(e,t)=>{a(`updateFieldValues`,e),a(`updateDataSourceFetched`,t)}});function m(e){return e.readOnly===!0&&f.value&&!!i.block.dataSourceFetched}function h(e,t){a(`updateFieldValues`,{...i.block.fieldValues,[e]:t})}return(n,r)=>c.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,yK,[c.value.description?((0,t.openBlock)(),(0,t.createElementBlock)(`p`,bK,(0,t.toDisplayString)(c.value.description),1)):(0,t.createCommentVNode)(``,!0),(0,t.unref)(f)?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,xK,[(0,t.unref)(p)&&!(0,t.unref)(l)?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,class:`tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded-md tpl:px-3 tpl:py-2.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-bg)] tpl:transition-all tpl:duration-150 tpl:bg-[var(--tpl-primary)]`,onClick:r[0]||=(...e)=>(0,t.unref)(d)&&(0,t.unref)(d)(...e)},(0,t.toDisplayString)(c.value?.dataSource?.label||(0,t.unref)(o).customBlocks.dataSource.fetchButton),1)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,SK,[(0,t.unref)(l)?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,CK,(0,t.toDisplayString)((0,t.unref)(o).customBlocks.dataSource.fetching),1)):((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:1,type:`button`,class:`tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-primary)] tpl:hover:text-[var(--tpl-primary)]`,onClick:r[1]||=(...e)=>(0,t.unref)(d)&&(0,t.unref)(d)(...e)},[(0,t.createVNode)((0,t.unref)(ed),{size:12}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(o).customBlocks.dataSource.changeButton),1)]))])),(0,t.unref)(u)?((0,t.openBlock)(),(0,t.createElementBlock)(`p`,wK,[(0,t.createVNode)((0,t.unref)(Hc),{size:14,class:`tpl:shrink-0`}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(o).customBlocks.dataSource.fetchError),1)])):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(c.value.fields,n=>((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)((0,t.unref)(mK)(n.type)),{key:n.key,field:n,"model-value":e.block.fieldValues[n.key],"read-only":m(n),"onUpdate:modelValue":e=>h(n.key,e)},null,8,[`field`,`model-value`,`read-only`,`onUpdate:modelValue`]))),128))])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,_K,[(0,t.createElementVNode)(`p`,vK,(0,t.toDisplayString)((0,t.unref)(o).customBlocks.toolbar.noDefinition),1)]))}})})),DK,OK=d((()=>{EK(),EK(),DK=TK})),kK,AK,jK,MK,NK,PK,FK=d((()=>{qV(),MW(),k(),yh(),kK={class:`tpl:mb-3.5`},AK={class:`tpl:mb-3.5`},jK={class:`tpl:mb-3.5`},MK={class:`tpl:flex tpl:items-stretch`},NK=[`value`],PK=(0,t.defineComponent)({__name:`DividerToolbar`,props:{block:{}},emits:[`update`],setup(e,{emit:n}){let r=n,{t:i}=O();function a(e,t){r(`update`,{[e]:t})}return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,[(0,t.createElementVNode)(`div`,kK,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(i).divider.style),3),(0,t.createVNode)(jW,{options:[{value:`solid`,label:(0,t.unref)(i).divider.solid},{value:`dashed`,label:(0,t.unref)(i).divider.dashed},{value:`dotted`,label:(0,t.unref)(i).divider.dotted}],"model-value":e.block.lineStyle,"onUpdate:modelValue":r[0]||=e=>a(`lineStyle`,e)},null,8,[`options`,`model-value`])]),(0,t.createElementVNode)(`div`,AK,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(i).divider.color),3),(0,t.createVNode)(KV,{"model-value":e.block.color,"onUpdate:modelValue":r[1]||=e=>a(`color`,e)},null,8,[`model-value`])]),(0,t.createElementVNode)(`div`,jK,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(i).divider.thickness),3),(0,t.createElementVNode)(`div`,MK,[(0,t.createElementVNode)(`input`,{type:`number`,class:(0,t.normalizeClass)((0,t.unref)(oh)),value:e.block.thickness,min:`1`,max:`10`,onInput:r[2]||=e=>a(`thickness`,Number(e.target.value))},null,42,NK),(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)((0,t.unref)(sh))},`px`,2)])])],64))}})})),IK,LK=d((()=>{FK(),FK(),IK=PK})),RK,zK,BK,VK,HK=d((()=>{k(),yh(),F(),RK={class:`tpl:mb-3.5`},zK=[`value`],BK={class:`tpl:mt-1.5 tpl:flex tpl:items-start tpl:gap-1.5 tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]`},VK=(0,t.defineComponent)({__name:`HtmlToolbar`,props:{block:{}},emits:[`update`],setup(e,{emit:n}){let r=n,{t:i}=O();return(n,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,RK,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(i).html.content),3),(0,t.createElementVNode)(`textarea`,{value:e.block.content,placeholder:`<div>...</div>`,rows:`10`,class:(0,t.normalizeClass)((0,t.unref)(fh)),onInput:a[0]||=e=>r(`update`,{content:e.target.value})},null,42,zK),(0,t.createElementVNode)(`p`,BK,[(0,t.createVNode)((0,t.unref)(Il),{size:12,class:`tpl:mt-0.5 tpl:shrink-0`}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(i).html.sanitizationHint),1)])]))}})})),UK,WK=d((()=>{HK(),HK(),UK=VK})),GK,KK,qK,JK,YK,XK,ZK,QK,$K,eq,tq,nq,rq=d((()=>{tU(),MW(),k(),yh(),F(),D(),Oe(),GK={class:`tpl:mb-3.5`},KK={key:0,class:`tpl:mb-3.5`},qK=[`value`,`placeholder`],JK={class:`tpl:mb-3.5`},YK={class:`tpl:mb-3.5`},XK=[`value`],ZK={value:`full`},QK={class:`tpl:mb-3.5`},$K={class:`tpl:mb-3.5`},eq={key:0,class:`tpl:mt-2 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]`},tq=[`checked`],nq=(0,t.defineComponent)({__name:`ImageToolbar`,props:{block:{}},emits:[`update`],setup(e,{emit:n}){let i=n,{t:a}=O(),o=(0,t.inject)(We,null),s=(0,t.inject)(He,r.SYNTAX_PRESETS.liquid),c=(0,t.computed)(()=>!!o),l=(0,t.ref)(!1),u=(0,t.ref)(!1),{start:d}=re(()=>{l.value=!1},1e3,{immediate:!1});function f(e,t){i(`update`,{[e]:t})}async function p(){let e=await o?.({accept:[`images`]});e&&(f(`src`,e.url),e.alt&&(f(`alt`,e.alt),u.value=!0),l.value=!0,d())}return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,[(0,t.createElementVNode)(`div`,GK,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(a).image.imageUrl),3),(0,t.createVNode)(eU,{"model-value":e.block.src,type:`url`,placeholder:(0,t.unref)(a).image.imageUrlPlaceholder,pulse:l.value,"onUpdate:modelValue":i[0]||=e=>f(`src`,e)},null,8,[`model-value`,`placeholder`,`pulse`]),c.value?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,class:`tpl:mt-2 tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150`,style:{"border-color":`var(--tpl-border)`,color:`var(--tpl-primary)`,"background-color":`var(--tpl-bg)`},onClick:p},[(0,t.createVNode)((0,t.unref)(Nl),{size:14,"stroke-width":1.5}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(a).image.browseMedia),1)])):(0,t.createCommentVNode)(``,!0)]),(0,t.unref)(r.containsMergeTag)(e.block.src,(0,t.unref)(s))?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,KK,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},[(0,t.createTextVNode)((0,t.toDisplayString)((0,t.unref)(a).image.placeholderUrl)+` `,1),i[7]||=(0,t.createElementVNode)(`span`,{class:`tpl:font-normal tpl:text-[var(--tpl-text-dim)]`},(0,t.toDisplayString)(`(optional)`),-1)],2),(0,t.createElementVNode)(`input`,{type:`url`,class:(0,t.normalizeClass)((0,t.unref)(ah)),value:e.block.placeholderUrl||``,placeholder:(0,t.unref)(a).image.placeholderUrlPlaceholder,onInput:i[1]||=e=>f(`placeholderUrl`,e.target.value)},null,42,qK)])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,JK,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(a).image.altText),3),(0,t.createVNode)(eU,{"model-value":e.block.alt,type:`text`,placeholder:(0,t.unref)(a).image.altTextPlaceholder,pulse:u.value,"onUpdate:modelValue":i[2]||=e=>f(`alt`,e)},null,8,[`model-value`,`placeholder`,`pulse`])]),(0,t.createElementVNode)(`div`,YK,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(a).image.width),3),(0,t.createElementVNode)(`select`,{class:(0,t.normalizeClass)((0,t.unref)(ah)),value:e.block.width,onChange:i[3]||=e=>f(`width`,e.target.value===`full`?`full`:Number(e.target.value))},[(0,t.createElementVNode)(`option`,ZK,(0,t.toDisplayString)((0,t.unref)(a).image.fullWidth),1),i[8]||=(0,t.createElementVNode)(`option`,{value:`300`},`300px`,-1),i[9]||=(0,t.createElementVNode)(`option`,{value:`400`},`400px`,-1),i[10]||=(0,t.createElementVNode)(`option`,{value:`500`},`500px`,-1)],42,XK)]),(0,t.createElementVNode)(`div`,QK,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(a).title.align),3),(0,t.createVNode)(jW,{options:[{value:`left`,label:(0,t.unref)(a).title.alignLeft},{value:`center`,label:(0,t.unref)(a).title.alignCenter},{value:`right`,label:(0,t.unref)(a).title.alignRight}],"model-value":e.block.align,"onUpdate:modelValue":i[4]||=e=>f(`align`,e)},null,8,[`options`,`model-value`])]),(0,t.createElementVNode)(`div`,$K,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(a).image.linkUrl),3),(0,t.createVNode)(eU,{"model-value":e.block.linkUrl||``,type:`url`,placeholder:(0,t.unref)(a).image.imageUrlPlaceholder,"onUpdate:modelValue":i[5]||=e=>f(`linkUrl`,e)},null,8,[`model-value`,`placeholder`]),e.block.linkUrl?((0,t.openBlock)(),(0,t.createElementBlock)(`label`,eq,[(0,t.createElementVNode)(`input`,{type:`checkbox`,class:`tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]`,checked:e.block.linkOpenInNewTab??!1,onChange:i[6]||=e=>f(`linkOpenInNewTab`,e.target.checked)},null,40,tq),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(a).image.openInNewTab),1)])):(0,t.createCommentVNode)(``,!0)])],64))}})})),iq,aq=d((()=>{rq(),rq(),iq=nq})),oq,sq,cq,lq,uq,dq,fq,pq,mq,hq,gq,_q,vq=d((()=>{qV(),tU(),MW(),LW(),YW(),k(),yh(),F(),oq={class:`tpl:flex tpl:flex-col tpl:gap-2`},sq={class:`tpl:flex tpl:items-center tpl:gap-2`},cq=[`value`,`placeholder`,`onInput`],lq=[`title`,`onClick`],uq={class:`tpl:flex tpl:items-center tpl:gap-3 tpl:text-xs tpl:text-[var(--tpl-text-muted)]`},dq=[`checked`,`onChange`],fq={class:`tpl:flex tpl:items-center tpl:gap-2`},pq=[`value`],mq={value:``},hq=[`value`],gq=[`value`],_q=(0,t.defineComponent)({__name:`MenuToolbar`,props:{block:{},fontFamilies:{}},emits:[`update`],setup(e,{emit:n}){let i=e,a=n,{t:o}=O(),s=(0,t.computed)(()=>[{key:`openInNewTab`,label:o.menu.openInNewTab},{key:`bold`,label:o.menu.bold},{key:`underline`,label:o.menu.underline}]),c=(0,t.computed)(()=>[{value:`left`,label:o.title.alignLeft,icon:Sf},{value:`center`,label:o.title.alignCenter,icon:gf},{value:`right`,label:o.title.alignRight,icon:yf}]);function l(e,t){a(`update`,{[e]:t})}function u(){let e={id:(0,r.generateId)(),text:``,url:``,openInNewTab:!1,bold:!1,underline:!1};a(`update`,{items:[...i.block.items,e]})}function d(e,t,n){a(`update`,{items:i.block.items.map(r=>r.id===e?{...r,[t]:n}:r)})}function f(e){a(`update`,{items:i.block.items.filter(t=>t.id!==e)})}return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,[(0,t.createVNode)(IW,{label:(0,t.unref)(o).menu.items},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,oq,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.block.items,n=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n.id,class:`tpl:flex tpl:flex-col tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:p-2`},[(0,t.createElementVNode)(`div`,sq,[(0,t.createElementVNode)(`input`,{type:`text`,class:(0,t.normalizeClass)([(0,t.unref)(ah),`tpl:flex-1`]),value:n.text,placeholder:(0,t.unref)(o).menu.text,onInput:e=>d(n.id,`text`,e.target.value)},null,42,cq),(0,t.createElementVNode)(`button`,{class:(0,t.normalizeClass)((0,t.unref)(uh)),title:(0,t.unref)(o).menu.removeItem,onClick:e=>f(n.id)},[(0,t.createVNode)((0,t.unref)(Qf),{size:14,"stroke-width":2})],10,lq)]),(0,t.createVNode)(eU,{"model-value":n.url,type:`url`,placeholder:(0,t.unref)(o).menu.urlPlaceholder,"onUpdate:modelValue":e=>d(n.id,`url`,e)},null,8,[`model-value`,`placeholder`,`onUpdate:modelValue`]),(0,t.createElementVNode)(`div`,uq,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(s.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`label`,{key:e.key,class:`tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1`},[(0,t.createElementVNode)(`input`,{type:`checkbox`,checked:n[e.key],class:`tpl:accent-[var(--tpl-primary)]`,onChange:t=>d(n.id,e.key,t.target.checked)},null,40,dq),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.label),1)]))),128))]),(0,t.createElementVNode)(`div`,fq,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)([(0,t.unref)(I),`tpl:!mb-0`])},(0,t.toDisplayString)((0,t.unref)(o).menu.color),3),(0,t.createVNode)(KV,{"swatch-only":``,"model-value":n.color||e.block.linkColor||e.block.color,"onUpdate:modelValue":e=>d(n.id,`color`,e)},null,8,[`model-value`,`onUpdate:modelValue`])])]))),128)),(0,t.createElementVNode)(`button`,{class:(0,t.normalizeClass)((0,t.unref)(dh)),onClick:u},[(0,t.createVNode)((0,t.unref)(Hu),{size:14,"stroke-width":2}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(o).menu.addItem),1)],2)])]),_:1},8,[`label`]),(0,t.createVNode)(IW,{label:(0,t.unref)(o).menu.fontFamily},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`select`,{class:(0,t.normalizeClass)((0,t.unref)(ah)),value:e.block.fontFamily||``,onChange:r[0]||=e=>l(`fontFamily`,e.target.value||void 0)},[(0,t.createElementVNode)(`option`,mq,(0,t.toDisplayString)((0,t.unref)(o).title.inheritFont),1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.fontFamilies,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e.value,value:e.value},(0,t.toDisplayString)(e.label),9,hq))),128))],42,pq)]),_:1},8,[`label`]),(0,t.createVNode)(IW,{label:(0,t.unref)(o).menu.fontSize},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(JW,{"model-value":e.block.fontSize,min:8,max:48,suffix:`px`,"onUpdate:modelValue":r[1]||=e=>l(`fontSize`,e)},null,8,[`model-value`])]),_:1},8,[`label`]),(0,t.createVNode)(IW,{label:(0,t.unref)(o).menu.color},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(KV,{"model-value":e.block.color,"onUpdate:modelValue":r[2]||=e=>l(`color`,e)},null,8,[`model-value`])]),_:1},8,[`label`]),(0,t.createVNode)(IW,{label:(0,t.unref)(o).menu.linkColor},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(KV,{"model-value":e.block.linkColor||e.block.color,"onUpdate:modelValue":r[3]||=e=>l(`linkColor`,e||void 0)},null,8,[`model-value`])]),_:1},8,[`label`]),(0,t.createVNode)(IW,{label:(0,t.unref)(o).menu.textAlign},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(jW,{options:c.value,"model-value":e.block.textAlign,"onUpdate:modelValue":r[4]||=e=>l(`textAlign`,e)},null,8,[`options`,`model-value`])]),_:1},8,[`label`]),(0,t.createVNode)(IW,{label:(0,t.unref)(o).menu.separator},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`input`,{type:`text`,class:(0,t.normalizeClass)((0,t.unref)(ah)),value:e.block.separator,onInput:r[5]||=e=>l(`separator`,e.target.value)},null,42,gq)]),_:1},8,[`label`]),(0,t.createVNode)(IW,{label:(0,t.unref)(o).menu.separatorColor},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(KV,{"model-value":e.block.separatorColor,"onUpdate:modelValue":r[6]||=e=>l(`separatorColor`,e)},null,8,[`model-value`])]),_:1},8,[`label`]),(0,t.createVNode)(IW,{label:(0,t.unref)(o).menu.spacing},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(JW,{"model-value":e.block.spacing,min:0,max:50,suffix:`px`,"onUpdate:modelValue":r[7]||=e=>l(`spacing`,e)},null,8,[`model-value`])]),_:1},8,[`label`])],64))}})})),yq,bq=d((()=>{vq(),vq(),yq=_q})),xq,Sq,Cq,wq,Tq=d((()=>{k(),yh(),xq={class:`tpl:mb-3.5`},Sq=[`value`],Cq=[`value`],wq=(0,t.defineComponent)({__name:`SectionToolbar`,props:{block:{}},emits:[`update`],setup(e,{emit:n}){let r=n,{t:i}=O(),a=(0,t.computed)(()=>[{value:`1`,label:i.section.column1},{value:`2`,label:i.section.column2},{value:`3`,label:i.section.column3},{value:`1-2`,label:i.section.ratio12},{value:`2-1`,label:i.section.ratio21}]);return(n,o)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,xq,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(i).section.columns),3),(0,t.createElementVNode)(`select`,{class:(0,t.normalizeClass)((0,t.unref)(ah)),value:e.block.columns,onChange:o[0]||=e=>r(`update`,{columns:e.target.value})},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(a.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e.value,value:e.value},(0,t.toDisplayString)(e.label),9,Cq))),128))],42,Sq)]))}})})),Eq,Dq=d((()=>{Tq(),Tq(),Eq=wq})),Oq,kq,Aq,jq,Mq,Nq,Pq,Fq,Iq,Lq,Rq,zq,Bq,Vq=d((()=>{tU(),MW(),k(),yh(),fz(),F(),Oq={class:`tpl:mb-3.5`},kq={class:`tpl:flex tpl:flex-col tpl:gap-2`},Aq={class:`tpl:flex tpl:items-center tpl:gap-2`},jq=[`value`,`onChange`],Mq=[`value`],Nq=[`title`,`onClick`],Pq={class:`tpl:mb-3.5`},Fq={class:`tpl:mb-3.5`},Iq={class:`tpl:mb-3.5`},Lq={class:`tpl:flex tpl:items-stretch`},Rq=[`value`],zq={class:`tpl:mb-3.5`},Bq=(0,t.defineComponent)({__name:`SocialToolbar`,props:{block:{}},emits:[`update`],setup(e,{emit:n}){let i=e,a=n,{t:o}=O();function s(e,t){a(`update`,{[e]:t})}function c(){let e={id:(0,r.generateId)(),platform:`facebook`,url:``};a(`update`,{icons:[...i.block.icons,e]})}function l(e,t,n){a(`update`,{icons:i.block.icons.map(r=>r.id===e?{...r,[t]:n}:r)})}function u(e){a(`update`,{icons:i.block.icons.filter(t=>t.id!==e)})}return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,[(0,t.createElementVNode)(`div`,Oq,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(o).social.icons),3),(0,t.createElementVNode)(`div`,kq,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.block.icons,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.id,class:`tpl:flex tpl:flex-col tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:p-2`},[(0,t.createElementVNode)(`div`,Aq,[(0,t.createElementVNode)(`select`,{class:(0,t.normalizeClass)([(0,t.unref)(ah),`tpl:flex-1`]),value:e.platform,onChange:t=>l(e.id,`platform`,t.target.value)},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(dz),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e,value:e},(0,t.toDisplayString)((0,t.unref)(lz)[e].name),9,Mq))),128))],42,jq),(0,t.createElementVNode)(`button`,{class:(0,t.normalizeClass)((0,t.unref)(uh)),title:(0,t.unref)(o).social.removeIcon,onClick:t=>u(e.id)},[(0,t.createVNode)((0,t.unref)(Qf),{size:14,"stroke-width":2})],10,Nq)]),(0,t.createVNode)(eU,{"model-value":e.url,type:`url`,placeholder:(0,t.unref)(o).social.urlPlaceholder,"onUpdate:modelValue":t=>l(e.id,`url`,t)},null,8,[`model-value`,`placeholder`,`onUpdate:modelValue`])]))),128)),(0,t.createElementVNode)(`button`,{class:(0,t.normalizeClass)((0,t.unref)(dh)),onClick:c},[(0,t.createVNode)((0,t.unref)(Hu),{size:14,"stroke-width":2}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(o).social.addIcon),1)],2)])]),(0,t.createElementVNode)(`div`,Pq,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(o).social.style),3),(0,t.createVNode)(jW,{options:[{value:`solid`,label:(0,t.unref)(o).social.styleSolid},{value:`outlined`,label:(0,t.unref)(o).social.styleOutlined},{value:`rounded`,label:(0,t.unref)(o).social.styleRounded},{value:`square`,label:(0,t.unref)(o).social.styleSquare},{value:`circle`,label:(0,t.unref)(o).social.styleCircle}],"model-value":e.block.iconStyle,"onUpdate:modelValue":r[0]||=e=>s(`iconStyle`,e)},null,8,[`options`,`model-value`])]),(0,t.createElementVNode)(`div`,Fq,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(o).social.size),3),(0,t.createVNode)(jW,{options:[{value:`small`,label:(0,t.unref)(o).social.sizeSmall},{value:`medium`,label:(0,t.unref)(o).social.sizeMedium},{value:`large`,label:(0,t.unref)(o).social.sizeLarge}],"model-value":e.block.iconSize,"onUpdate:modelValue":r[1]||=e=>s(`iconSize`,e)},null,8,[`options`,`model-value`])]),(0,t.createElementVNode)(`div`,Iq,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(o).social.spacing),3),(0,t.createElementVNode)(`div`,Lq,[(0,t.createElementVNode)(`input`,{type:`number`,class:(0,t.normalizeClass)((0,t.unref)(oh)),value:e.block.spacing,min:`0`,max:`50`,onInput:r[2]||=e=>s(`spacing`,Number(e.target.value))},null,42,Rq),(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)((0,t.unref)(sh))},`px`,2)])]),(0,t.createElementVNode)(`div`,zq,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(o).social.align),3),(0,t.createVNode)(jW,{options:[{value:`left`,label:(0,t.unref)(o).title.alignLeft,icon:(0,t.unref)(Sf)},{value:`center`,label:(0,t.unref)(o).title.alignCenter,icon:(0,t.unref)(gf)},{value:`right`,label:(0,t.unref)(o).title.alignRight,icon:(0,t.unref)(yf)}],"model-value":e.block.align,"onUpdate:modelValue":r[3]||=e=>s(`align`,e)},null,8,[`options`,`model-value`])])],64))}})})),Hq,Uq=d((()=>{Vq(),Vq(),Hq=Bq})),Wq,Gq,Kq,qq,Jq,Yq=d((()=>{k(),yh(),Wq={class:`tpl:mb-3.5`},Gq={class:`tpl:flex tpl:items-stretch`},Kq=[`value`],qq=[`value`],Jq=(0,t.defineComponent)({__name:`SpacerToolbar`,props:{block:{}},emits:[`update`],setup(e,{emit:n}){let r=n,{t:i}=O();return(n,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Wq,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(i).spacer.height),3),(0,t.createElementVNode)(`div`,Gq,[(0,t.createElementVNode)(`input`,{type:`number`,class:(0,t.normalizeClass)((0,t.unref)(oh)),value:e.block.height,min:`10`,max:`100`,onInput:a[0]||=e=>r(`update`,{height:Number(e.target.value)})},null,42,Kq),(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)((0,t.unref)(sh))},`px`,2)]),(0,t.createElementVNode)(`input`,{type:`range`,class:`tpl:mt-2 tpl:w-full tpl:accent-[var(--tpl-primary)]`,value:e.block.height,min:`10`,max:`100`,onInput:a[1]||=e=>r(`update`,{height:Number(e.target.value)})},null,40,qq)]))}})})),Xq,Zq=d((()=>{Yq(),Yq(),Xq=Jq})),Qq,$q,eJ,tJ,nJ,rJ,iJ,aJ,oJ,sJ,cJ,lJ,uJ,dJ,fJ,pJ,mJ,hJ,gJ,_J,vJ,yJ,bJ,xJ,SJ,CJ,wJ,TJ,EJ,DJ,OJ,kJ,AJ,jJ=d((()=>{qV(),MW(),k(),yh(),F(),Qq={class:`tpl:mb-3.5`},$q={class:`tpl:flex tpl:items-center tpl:gap-3`},eJ={class:`tpl:flex tpl:flex-1 tpl:items-center tpl:gap-1.5`},tJ={class:`tpl:text-xs tpl:text-[var(--tpl-text-muted)]`},nJ={class:`tpl:flex tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]`},rJ=[`disabled`],iJ={class:`tpl:min-w-[20px] tpl:text-center tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)]`},aJ={class:`tpl:flex tpl:flex-1 tpl:items-center tpl:gap-1.5`},oJ={class:`tpl:text-xs tpl:text-[var(--tpl-text-muted)]`},sJ={class:`tpl:flex tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]`},cJ=[`disabled`],lJ={class:`tpl:min-w-[20px] tpl:text-center tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)]`},uJ={class:`tpl:mb-3.5`},dJ={class:`tpl:mb-1.5 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]`},fJ=[`checked`],pJ={key:0,class:`tpl:mb-3.5`},mJ={class:`tpl:mb-3.5`},hJ={class:`tpl:mb-3.5`},gJ={class:`tpl:flex tpl:items-stretch`},_J=[`value`],vJ={class:`tpl:mb-3.5`},yJ={class:`tpl:flex tpl:items-stretch`},bJ=[`value`],xJ={class:`tpl:mb-3.5`},SJ=[`value`],CJ={value:``},wJ=[`value`],TJ={class:`tpl:mb-3.5`},EJ={class:`tpl:flex tpl:items-stretch`},DJ=[`value`],OJ={class:`tpl:mb-3.5`},kJ={class:`tpl:mb-3.5`},AJ=(0,t.defineComponent)({__name:`TableToolbar`,props:{block:{},fontFamilies:{}},emits:[`update`],setup(e,{emit:n}){let i=e,a=n,{t:o}=O(),s=(0,t.computed)(()=>i.block.rows.length>0?i.block.rows[0].cells.length:0);function c(e,t){a(`update`,{[e]:t})}function l(){let e=i.block.rows.length>0?i.block.rows[0].cells.length:3,t={id:(0,r.generateId)(),cells:Array.from({length:e},()=>({id:(0,r.generateId)(),content:``}))};a(`update`,{rows:[...i.block.rows,t]})}function u(e){a(`update`,{rows:i.block.rows.filter(t=>t.id!==e)})}function d(){a(`update`,{rows:i.block.rows.map(e=>({...e,cells:[...e.cells,{id:(0,r.generateId)(),content:``}]}))})}function f(e){a(`update`,{rows:i.block.rows.map(t=>({...t,cells:t.cells.filter((t,n)=>n!==e)}))})}return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,[(0,t.createElementVNode)(`div`,Qq,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(o).table.dimensions),3),(0,t.createElementVNode)(`div`,$q,[(0,t.createElementVNode)(`div`,eJ,[(0,t.createElementVNode)(`span`,tJ,(0,t.toDisplayString)((0,t.unref)(o).table.rows),1),(0,t.createElementVNode)(`div`,nJ,[(0,t.createElementVNode)(`button`,{class:`tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:duration-150 tpl:hover:text-[var(--tpl-primary)] tpl:disabled:opacity-30`,disabled:e.block.rows.length<=1,onClick:r[0]||=t=>u(e.block.rows[e.block.rows.length-1].id)},[(0,t.createVNode)((0,t.unref)(fu),{size:12,"stroke-width":2})],8,rJ),(0,t.createElementVNode)(`span`,iJ,(0,t.toDisplayString)(e.block.rows.length),1),(0,t.createElementVNode)(`button`,{class:`tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:duration-150 tpl:hover:text-[var(--tpl-primary)]`,onClick:l},[(0,t.createVNode)((0,t.unref)(Hu),{size:12,"stroke-width":2})])])]),(0,t.createElementVNode)(`div`,aJ,[(0,t.createElementVNode)(`span`,oJ,(0,t.toDisplayString)((0,t.unref)(o).table.columns),1),(0,t.createElementVNode)(`div`,sJ,[(0,t.createElementVNode)(`button`,{class:`tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:duration-150 tpl:hover:text-[var(--tpl-primary)] tpl:disabled:opacity-30`,disabled:s.value<=1,onClick:r[1]||=e=>f(s.value-1)},[(0,t.createVNode)((0,t.unref)(fu),{size:12,"stroke-width":2})],8,cJ),(0,t.createElementVNode)(`span`,lJ,(0,t.toDisplayString)(s.value),1),(0,t.createElementVNode)(`button`,{class:`tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:duration-150 tpl:hover:text-[var(--tpl-primary)]`,onClick:d},[(0,t.createVNode)((0,t.unref)(Hu),{size:12,"stroke-width":2})])])])])]),(0,t.createElementVNode)(`div`,uJ,[(0,t.createElementVNode)(`label`,dJ,[(0,t.createElementVNode)(`input`,{type:`checkbox`,checked:e.block.hasHeaderRow,class:`tpl:accent-[var(--tpl-primary)]`,onChange:r[2]||=e=>c(`hasHeaderRow`,e.target.checked)},null,40,fJ),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(o).table.hasHeaderRow),1)])]),e.block.hasHeaderRow?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,pJ,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(o).table.headerBackgroundColor),3),(0,t.createVNode)(KV,{"model-value":e.block.headerBackgroundColor||(0,t.unref)(`#f2f2f2`),placeholder:(0,t.unref)(o).table.noHeaderBg,"onUpdate:modelValue":r[3]||=e=>c(`headerBackgroundColor`,e||null)},null,8,[`model-value`,`placeholder`])])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,mJ,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(o).table.borderColor),3),(0,t.createVNode)(KV,{"model-value":e.block.borderColor,"onUpdate:modelValue":r[4]||=e=>c(`borderColor`,e)},null,8,[`model-value`])]),(0,t.createElementVNode)(`div`,hJ,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(o).table.borderWidth),3),(0,t.createElementVNode)(`div`,gJ,[(0,t.createElementVNode)(`input`,{type:`number`,class:(0,t.normalizeClass)((0,t.unref)(oh)),value:e.block.borderWidth,min:`0`,max:`10`,onInput:r[5]||=e=>c(`borderWidth`,Number(e.target.value))},null,42,_J),(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)((0,t.unref)(sh))},`px`,2)])]),(0,t.createElementVNode)(`div`,vJ,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(o).table.cellPadding),3),(0,t.createElementVNode)(`div`,yJ,[(0,t.createElementVNode)(`input`,{type:`number`,class:(0,t.normalizeClass)((0,t.unref)(oh)),value:e.block.cellPadding,min:`0`,max:`30`,onInput:r[6]||=e=>c(`cellPadding`,Number(e.target.value))},null,42,bJ),(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)((0,t.unref)(sh))},`px`,2)])]),(0,t.createElementVNode)(`div`,xJ,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(o).table.fontFamily),3),(0,t.createElementVNode)(`select`,{class:(0,t.normalizeClass)((0,t.unref)(ah)),value:e.block.fontFamily||``,onChange:r[7]||=e=>c(`fontFamily`,e.target.value||void 0)},[(0,t.createElementVNode)(`option`,CJ,(0,t.toDisplayString)((0,t.unref)(o).title.inheritFont),1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.fontFamilies,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e.value,value:e.value},(0,t.toDisplayString)(e.label),9,wJ))),128))],42,SJ)]),(0,t.createElementVNode)(`div`,TJ,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(o).table.fontSize),3),(0,t.createElementVNode)(`div`,EJ,[(0,t.createElementVNode)(`input`,{type:`number`,class:(0,t.normalizeClass)((0,t.unref)(oh)),value:e.block.fontSize,min:`10`,max:`32`,onInput:r[8]||=e=>c(`fontSize`,Number(e.target.value))},null,42,DJ),(0,t.createElementVNode)(`span`,{class:(0,t.normalizeClass)((0,t.unref)(sh))},`px`,2)])]),(0,t.createElementVNode)(`div`,OJ,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(o).table.color),3),(0,t.createVNode)(KV,{"model-value":e.block.color,"onUpdate:modelValue":r[9]||=e=>c(`color`,e)},null,8,[`model-value`])]),(0,t.createElementVNode)(`div`,kJ,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(o).table.textAlign),3),(0,t.createVNode)(jW,{options:[{value:`left`,label:(0,t.unref)(o).title.alignLeft,icon:(0,t.unref)(Sf)},{value:`center`,label:(0,t.unref)(o).title.alignCenter,icon:(0,t.unref)(gf)},{value:`right`,label:(0,t.unref)(o).title.alignRight,icon:(0,t.unref)(yf)}],"model-value":e.block.textAlign,"onUpdate:modelValue":r[10]||=e=>c(`textAlign`,e)},null,8,[`options`,`model-value`])])],64))}})})),MJ,NJ=d((()=>{jJ(),jJ(),MJ=AJ})),PJ,FJ,IJ,LJ,RJ,zJ,BJ,VJ,HJ,UJ,WJ,GJ,KJ,qJ=d((()=>{qV(),MW(),k(),yh(),F(),PJ={class:`tpl:mb-3.5`},FJ=[`value`],IJ={value:1},LJ={value:2},RJ={value:3},zJ={value:4},BJ={class:`tpl:mb-3.5`},VJ=[`value`],HJ={value:``},UJ=[`value`],WJ={class:`tpl:mb-3.5`},GJ={class:`tpl:mb-3.5`},KJ=(0,t.defineComponent)({__name:`TitleToolbar`,props:{block:{},fontFamilies:{}},emits:[`update`],setup(e,{emit:n}){let r=n,{t:i}=O();function a(e,t){r(`update`,{[e]:t})}return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,[(0,t.createElementVNode)(`div`,PJ,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(i).title.level),3),(0,t.createElementVNode)(`select`,{class:(0,t.normalizeClass)((0,t.unref)(ah)),value:e.block.level,onChange:r[0]||=e=>a(`level`,Number(e.target.value))},[(0,t.createElementVNode)(`option`,IJ,(0,t.toDisplayString)((0,t.unref)(i).title.heading1),1),(0,t.createElementVNode)(`option`,LJ,(0,t.toDisplayString)((0,t.unref)(i).title.heading2),1),(0,t.createElementVNode)(`option`,RJ,(0,t.toDisplayString)((0,t.unref)(i).title.heading3),1),(0,t.createElementVNode)(`option`,zJ,(0,t.toDisplayString)((0,t.unref)(i).title.heading4),1)],42,FJ)]),(0,t.createElementVNode)(`div`,BJ,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(i).title.fontFamily),3),(0,t.createElementVNode)(`select`,{class:(0,t.normalizeClass)((0,t.unref)(ah)),value:e.block.fontFamily||``,onChange:r[1]||=e=>a(`fontFamily`,e.target.value||void 0)},[(0,t.createElementVNode)(`option`,HJ,(0,t.toDisplayString)((0,t.unref)(i).title.inheritFont),1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.fontFamilies,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e.value,value:e.value},(0,t.toDisplayString)(e.label),9,UJ))),128))],42,VJ)]),(0,t.createElementVNode)(`div`,WJ,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(i).title.color),3),(0,t.createVNode)(KV,{"model-value":e.block.color,"onUpdate:modelValue":r[2]||=e=>a(`color`,e)},null,8,[`model-value`])]),(0,t.createElementVNode)(`div`,GJ,[(0,t.createElementVNode)(`label`,{class:(0,t.normalizeClass)((0,t.unref)(I))},(0,t.toDisplayString)((0,t.unref)(i).title.align),3),(0,t.createVNode)(jW,{options:[{value:`left`,label:(0,t.unref)(i).title.alignLeft,icon:(0,t.unref)(Sf)},{value:`center`,label:(0,t.unref)(i).title.alignCenter,icon:(0,t.unref)(gf)},{value:`right`,label:(0,t.unref)(i).title.alignRight,icon:(0,t.unref)(yf)}],"model-value":e.block.textAlign,"onUpdate:modelValue":r[3]||=e=>a(`textAlign`,e)},null,8,[`options`,`model-value`])])],64))}})})),JJ,YJ=d((()=>{qJ(),qJ(),JJ=KJ})),XJ,ZJ,QJ,$J,eY,tY,nY,rY,iY,aY=d((()=>{CU(),EW(),fG(),OK(),LK(),WK(),aq(),bq(),Dq(),Uq(),Zq(),NJ(),YJ(),k(),F(),kB(),tt(),D(),XJ=[`aria-label`],ZJ={class:`tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3.5`},QJ={class:`tpl:flex tpl:items-center tpl:gap-2 tpl:text-[var(--tpl-primary)]`},$J={class:`tpl:m-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]`},eY={class:`tpl:flex tpl:gap-1`},tY=[`title`],nY=[`title`],rY={class:`tpl:flex-1 tpl:overflow-y-auto tpl:p-4`},iY=(0,t.defineComponent)({__name:`Toolbar`,props:{block:{}},emits:[`update`,`delete`,`duplicate`],setup(e,{emit:n}){let i=e,a=n,{t:o}=O(),s=ke(Fe,`Toolbar`),c=(0,t.inject)(Be,[]),l=(0,t.computed)(()=>i.block.type),u=(0,t.computed)(()=>(0,r.isCustomBlock)(i.block)),d=(0,t.computed)(()=>{if(u.value)return c.find(e=>e.type===i.block.customType)}),f=(0,t.computed)(()=>u.value?d.value?.name??i.block.customType:et(l.value,o)),p=s.fonts;function m(e){a(`update`,e)}return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`aside`,{"aria-label":(0,t.unref)(o).landmarks.blockToolbar,class:`tpl:flex tpl:w-full tpl:flex-1 tpl:flex-col tpl:bg-[var(--tpl-bg-elevated)]`},[(0,t.createElementVNode)(`div`,ZJ,[(0,t.createElementVNode)(`div`,QJ,[(0,t.unref)(OB)[l.value]?((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)((0,t.unref)(OB)[l.value]),{key:0,size:16,"stroke-width":1.5})):u.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(el),{key:1,size:16,"stroke-width":1.5})):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`h3`,$J,(0,t.toDisplayString)(f.value),1)]),(0,t.createElementVNode)(`div`,eY,[(0,t.createElementVNode)(`button`,{class:`tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)] tpl:hover:text-[var(--tpl-text)]`,title:(0,t.unref)(o).toolbar.duplicate,onClick:r[0]||=e=>a(`duplicate`)},[(0,t.createVNode)((0,t.unref)(ol),{size:14,"stroke-width":2})],8,tY),(0,t.createElementVNode)(`button`,{class:`tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-danger)] tpl:hover:bg-[var(--tpl-danger-light)] tpl:hover:text-[var(--tpl-danger)]`,title:(0,t.unref)(o).toolbar.delete,onClick:r[1]||=e=>a(`delete`)},[(0,t.createVNode)((0,t.unref)(Of),{size:14,"stroke-width":2})],8,nY)])]),(0,t.createElementVNode)(`div`,rY,[u.value?((0,t.openBlock)(),(0,t.createBlock)(DK,{key:0,block:e.block,onUpdateFieldValues:r[2]||=e=>a(`update`,{fieldValues:e}),onUpdateDataSourceFetched:r[3]||=e=>a(`update`,{dataSourceFetched:e})},null,8,[`block`])):l.value===`section`?((0,t.openBlock)(),(0,t.createBlock)(Eq,{key:1,block:e.block,onUpdate:m},null,8,[`block`])):l.value===`title`?((0,t.openBlock)(),(0,t.createBlock)(JJ,{key:2,block:e.block,"font-families":(0,t.unref)(p),onUpdate:m},null,8,[`block`,`font-families`])):l.value===`paragraph`?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:3},[],64)):l.value===`image`?((0,t.openBlock)(),(0,t.createBlock)(iq,{key:4,block:e.block,onUpdate:m},null,8,[`block`])):l.value===`button`?((0,t.openBlock)(),(0,t.createBlock)(SU,{key:5,block:e.block,"font-families":(0,t.unref)(p),onUpdate:m},null,8,[`block`,`font-families`])):l.value===`divider`?((0,t.openBlock)(),(0,t.createBlock)(IK,{key:6,block:e.block,onUpdate:m},null,8,[`block`])):l.value===`social`?((0,t.openBlock)(),(0,t.createBlock)(Hq,{key:7,block:e.block,onUpdate:m},null,8,[`block`])):l.value===`menu`?((0,t.openBlock)(),(0,t.createBlock)(yq,{key:8,block:e.block,"font-families":(0,t.unref)(p),onUpdate:m},null,8,[`block`,`font-families`])):l.value===`table`?((0,t.openBlock)(),(0,t.createBlock)(MJ,{key:9,block:e.block,"font-families":(0,t.unref)(p),onUpdate:m},null,8,[`block`,`font-families`])):l.value===`spacer`?((0,t.openBlock)(),(0,t.createBlock)(Xq,{key:10,block:e.block,onUpdate:m},null,8,[`block`])):l.value===`html`?((0,t.openBlock)(),(0,t.createBlock)(UK,{key:11,block:e.block,onUpdate:m},null,8,[`block`])):l.value===`countdown`?((0,t.openBlock)(),(0,t.createBlock)(dG,{key:12,block:e.block,"font-families":(0,t.unref)(p),onUpdate:m},null,8,[`block`,`font-families`])):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)(TW,{block:e.block,"is-first-section":l.value===`paragraph`,onUpdate:m},null,8,[`block`,`is-first-section`])])],8,XJ))}})})),oY=d((()=>{})),sY,cY=d((()=>{aY(),aY(),oY(),dp(),sY=up(iY,[[`__scopeId`,`data-v-fb6efed6`]])})),lY,uY,dY,fY,pY,mY,hY,gY,_Y,vY,yY,bY=d((()=>{KH(),cY(),k(),F(),lY=[`aria-label`],uY={role:`tablist`,class:`tpl:relative tpl:flex tpl:border-b tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)]`},dY=[`aria-selected`],fY=[`aria-selected`],pY={key:0,id:`tpl-tabpanel-content`,role:`tabpanel`,"aria-labelledby":`tpl-tab-content`,class:`tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-y-auto`},mY={key:1,class:`tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:px-6 tpl:py-10 tpl:text-center tpl:text-[var(--tpl-text-muted)]`},hY={class:`tpl:mb-4 tpl:text-[var(--tpl-text-dim)]`},gY={class:`tpl:m-0 tpl:mb-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]`},_Y={class:`tpl:m-0 tpl:text-sm tpl:leading-normal`},vY={key:1,id:`tpl-tabpanel-settings`,role:`tabpanel`,"aria-labelledby":`tpl-tab-settings`,class:`tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-y-auto`},yY=(0,t.defineComponent)({__name:`RightSidebar`,props:{selectedBlock:{},settings:{},shiftedLeft:{type:Boolean}},emits:[`update-block`,`delete-block`,`duplicate-block`,`update-settings`],setup(e,{emit:n}){let r=e,i=n,{t:a}=O(),o=(0,t.ref)(`content`),s=(0,t.computed)(()=>o.value===`content`?`tpl:translate-x-0`:`tpl:translate-x-full`);return(0,t.watch)(()=>r.selectedBlock,e=>{e&&(o.value=`content`)}),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`aside`,{"aria-label":(0,t.unref)(a).landmarks.rightSidebar,class:(0,t.normalizeClass)([`tpl-right-sidebar tpl:absolute tpl:top-14 tpl:bottom-0 tpl:z-40 tpl:flex tpl:w-[320px] tpl:flex-col tpl:bg-[var(--tpl-bg-elevated)] tpl:transition-all tpl:duration-200 tpl:border-l tpl:border-[var(--tpl-border)]`,e.shiftedLeft?`tpl:right-[360px]`:`tpl:right-0`])},[(0,t.createElementVNode)(`div`,uY,[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`tpl:absolute tpl:bottom-0 tpl:left-0 tpl:h-full tpl:w-1/2 tpl:p-1.5 tpl:transition-transform tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]`,s.value])},[...r[6]||=[(0,t.createElementVNode)(`div`,{class:`tpl:h-full tpl:w-full tpl:rounded-[var(--tpl-radius-sm)] tpl:bg-[var(--tpl-bg)] tpl:shadow-[var(--tpl-shadow)]`},null,-1)]],2),(0,t.createElementVNode)(`button`,{id:`tpl-tab-content`,role:`tab`,"aria-selected":o.value===`content`,"aria-controls":`tpl-tabpanel-content`,class:(0,t.normalizeClass)([`tpl:relative tpl:z-10 tpl:flex tpl:flex-1 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:border-none tpl:bg-transparent tpl:px-4 tpl:py-3 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-[120ms]`,o.value===`content`?`tpl:text-[var(--tpl-primary)]`:`tpl:text-[var(--tpl-text-muted)] hover:tpl:text-[var(--tpl-text)]`]),onClick:r[0]||=e=>o.value=`content`},[(0,t.createVNode)((0,t.unref)(Au),{size:14,"stroke-width":2}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(a).sidebar.content),1)],10,dY),(0,t.createElementVNode)(`button`,{id:`tpl-tab-settings`,role:`tab`,"aria-selected":o.value===`settings`,"aria-controls":`tpl-tabpanel-settings`,class:(0,t.normalizeClass)([`tpl:relative tpl:z-10 tpl:flex tpl:flex-1 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:border-none tpl:bg-transparent tpl:px-4 tpl:py-3 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-[120ms]`,o.value===`settings`?`tpl:text-[var(--tpl-primary)]`:`tpl:text-[var(--tpl-text-muted)] hover:tpl:text-[var(--tpl-text)]`]),onClick:r[1]||=e=>o.value=`settings`},[(0,t.createVNode)((0,t.unref)(wd),{size:14,"stroke-width":1.5}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(a).sidebar.settings),1)],10,fY)]),o.value===`content`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,pY,[e.selectedBlock?((0,t.openBlock)(),(0,t.createBlock)(sY,{key:0,block:e.selectedBlock,onUpdate:r[2]||=e=>i(`update-block`,e),onDelete:r[3]||=e=>i(`delete-block`),onDuplicate:r[4]||=e=>i(`duplicate-block`)},null,8,[`block`])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,mY,[(0,t.createElementVNode)(`div`,hY,[(0,t.createVNode)((0,t.unref)(Hl),{size:40,"stroke-width":1.5})]),(0,t.createElementVNode)(`h3`,gY,(0,t.toDisplayString)((0,t.unref)(a).sidebar.noSelection),1),(0,t.createElementVNode)(`p`,_Y,(0,t.toDisplayString)((0,t.unref)(a).sidebar.noSelectionHint),1)]))])):(0,t.createCommentVNode)(``,!0),o.value===`settings`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,vY,[(0,t.createVNode)(GH,{settings:e.settings,onUpdate:r[5]||=e=>i(`update-settings`,e)},null,8,[`settings`])])):(0,t.createCommentVNode)(``,!0)],10,lY))}})})),xY,SY=d((()=>{bY(),bY(),xY=yY})),CY,wY,TY,EY=d((()=>{k(),F(),CY=[`aria-label`],wY=[`aria-checked`,`aria-label`,`title`,`onClick`],TY=(0,t.defineComponent)({__name:`ViewportToggle`,props:{viewport:{}},emits:[`change`],setup(e,{emit:n}){let r=e,i=n,{t:a}=O(),o=(0,t.computed)(()=>[{value:`desktop`,label:a.viewport.desktop},{value:`tablet`,label:a.viewport.tablet},{value:`mobile`,label:a.viewport.mobile}]),s=(0,t.computed)(()=>`translateX(${o.value.findIndex(e=>e.value===r.viewport)*100}%)`);return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{role:`radiogroup`,"aria-label":(0,t.unref)(a).viewport.label,class:`tpl:relative tpl:grid tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1`,style:(0,t.normalizeStyle)({gridTemplateColumns:`repeat(${o.value.length}, 1fr)`,backgroundColor:`var(--tpl-bg-hover)`})},[(0,t.createElementVNode)(`div`,{class:`tpl:absolute tpl:inset-y-1 tpl:rounded-[var(--tpl-radius-sm)]`,style:(0,t.normalizeStyle)({left:`4px`,width:`calc((100% - 8px) / ${o.value.length})`,transform:s.value,backgroundColor:`var(--tpl-bg)`,boxShadow:`var(--tpl-shadow)`,transition:`transform 120ms cubic-bezier(0.16, 1, 0.3, 1)`})},null,4),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(o.value,n=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:n.value,role:`radio`,"aria-checked":e.viewport===n.value,"aria-label":n.label,class:`tpl:relative tpl:z-10 tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border-none tpl:bg-transparent tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium`,style:(0,t.normalizeStyle)({color:e.viewport===n.value?`var(--tpl-primary)`:`var(--tpl-text-muted)`,transition:`color 120ms cubic-bezier(0.16, 1, 0.3, 1)`}),title:n.label,onClick:e=>i(`change`,n.value)},[n.value===`desktop`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(hu),{key:0,size:18,"stroke-width":1.5})):n.value===`tablet`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(pf),{key:1,size:18,"stroke-width":1.5})):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Id),{key:2,size:18,"stroke-width":1.5})),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(n.label),1)],12,wY))),128))],12,CY))}})})),DY,OY=d((()=>{EY(),EY(),DY=TY})),kY,AY,jY=d((()=>{k(),F(),kY=[`aria-label`,`title`,`aria-pressed`],AY=(0,t.defineComponent)({__name:`PreviewToggle`,props:{previewMode:{type:Boolean}},emits:[`change`],setup(e,{emit:n}){let r=n,{t:i}=O();return(n,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{class:`tpl-preview-toggle tpl:relative tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:p-2 tpl:transition-all tpl:duration-150`,style:(0,t.normalizeStyle)({color:e.previewMode?`var(--tpl-primary)`:`var(--tpl-text-muted)`,backgroundColor:e.previewMode?`var(--tpl-primary-light)`:`transparent`}),"aria-label":e.previewMode?(0,t.unref)(i).previewMode.disable:(0,t.unref)(i).previewMode.enable,title:e.previewMode?(0,t.unref)(i).previewMode.disable:(0,t.unref)(i).previewMode.enable,"aria-pressed":e.previewMode,onClick:a[0]||=t=>r(`change`,!e.previewMode)},[(0,t.createVNode)(t.Transition,{"enter-active-class":`tpl-icon-enter-active`,"leave-active-class":`tpl-icon-leave-active`,"enter-from-class":`tpl-icon-enter-from`,"leave-to-class":`tpl-icon-leave-to`,mode:`out-in`},{default:(0,t.withCtx)(()=>[e.previewMode?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(fl),{key:`eye`,size:18,"stroke-width":1.5})):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(ll),{key:`eye-off`,size:18,"stroke-width":1.5}))]),_:1})],12,kY))}})})),MY=d((()=>{})),NY,PY=d((()=>{jY(),jY(),MY(),dp(),NY=up(AY,[[`__scopeId`,`data-v-af87d02a`]])})),FY,IY,LY=d((()=>{k(),F(),FY=[`aria-label`,`title`,`aria-pressed`],IY=(0,t.defineComponent)({__name:`DarkModeToggle`,props:{darkMode:{type:Boolean}},emits:[`change`],setup(e,{emit:n}){let r=n,{t:i}=O();return(n,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{class:`tpl-dark-mode-toggle tpl:relative tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:p-2 tpl:transition-all tpl:duration-150`,style:(0,t.normalizeStyle)({color:e.darkMode?`var(--tpl-primary)`:`var(--tpl-text-muted)`,backgroundColor:e.darkMode?`var(--tpl-primary-light)`:`transparent`}),"aria-label":e.darkMode?(0,t.unref)(i).darkMode.disable:(0,t.unref)(i).darkMode.enable,title:e.darkMode?(0,t.unref)(i).darkMode.disable:(0,t.unref)(i).darkMode.enable,"aria-pressed":e.darkMode,onClick:a[0]||=t=>r(`change`,!e.darkMode)},[(0,t.createVNode)(t.Transition,{"enter-active-class":`tpl-icon-enter-active`,"leave-active-class":`tpl-icon-leave-active`,"enter-from-class":`tpl-icon-enter-from`,"leave-to-class":`tpl-icon-leave-to`,mode:`out-in`},{default:(0,t.withCtx)(()=>[e.darkMode?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(vu),{key:`moon`,size:18,"stroke-width":1.5})):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(rf),{key:`sun`,size:18,"stroke-width":1.5}))]),_:1})],12,FY))}})})),RY=d((()=>{})),zY,BY=d((()=>{LY(),LY(),RY(),dp(),zY=up(IY,[[`__scopeId`,`data-v-f8694f76`]])})),VY,HY,UY,WY=d((()=>{k(),VY={class:`tpl:pointer-events-auto tpl:flex tpl:items-center tpl:gap-1.5 tpl:rounded-tl-lg tpl:p-1`,style:{"background-color":`color-mix(
171
- in srgb,
172
- var(--tpl-canvas-bg) 85%,
173
- transparent
174
- )`,"backdrop-filter":`blur(8px)`,"-webkit-backdrop-filter":`blur(8px)`}},HY={href:`https://github.com/templatical/sdk`,target:`_blank`,rel:`noopener noreferrer`,class:`tpl:transition-colors tpl:duration-150 hover:tpl:opacity-80 tpl:text-[var(--tpl-text-dim)]`,style:{"text-decoration":`none`}},UY=(0,t.defineComponent)({__name:`EditorFooter`,props:{positionClass:{}},setup(e){let{t:n}=O();return(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`footer`,{class:(0,t.normalizeClass)([`tpl:pointer-events-none tpl:absolute tpl:bottom-0 tpl:z-50 tpl:flex tpl:h-8 tpl:items-center tpl:justify-end tpl:pr-4 tpl:text-[9px] tpl:opacity-90 tpl:transition-all tpl:duration-300 tpl:text-[var(--tpl-text-dim)]`,e.positionClass])},[(0,t.createElementVNode)(`div`,VY,[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(n).footer.poweredBy),1),i[0]||=(0,t.createElementVNode)(`a`,{href:`https://templatical.com`,target:`_blank`,rel:`noopener noreferrer`,class:`tpl:inline-flex tpl:items-center tpl:gap-1 tpl:font-medium tpl:transition-colors tpl:duration-150 hover:tpl:opacity-80 tpl:text-[var(--tpl-text-muted)]`,style:{"text-decoration":`none`}},[(0,t.createElementVNode)(`img`,{width:`14`,height:`14`,src:`https://templatical.com/logo.svg`,alt:``}),(0,t.createTextVNode)(` Templatical `)],-1),i[1]||=(0,t.createElementVNode)(`span`,{class:`tpl:text-[var(--tpl-border)]`},`·`,-1),(0,t.createElementVNode)(`a`,HY,(0,t.toDisplayString)((0,t.unref)(n).footer.openSource),1)])],2))}})})),GY,KY=d((()=>{WY(),WY(),GY=UY})),qY=d((()=>{}));y(),sB(),F(),DB(),HB(),SY(),OY(),PY(),BY(),KY(),qY();var JY=[`data-tpl-theme`],YY={class:`tpl-header tpl:absolute tpl:top-0 tpl:right-0 tpl:left-0 tpl:z-50 tpl:grid tpl:h-14 tpl:grid-cols-[1fr_auto_1fr] tpl:items-center tpl:px-4 tpl:shadow-[var(--tpl-shadow-md)] tpl:border-b tpl:border-[var(--tpl-border)]`,style:{"background-color":`color-mix(in srgb, var(--tpl-bg) 80%, transparent)`,"backdrop-filter":`blur(12px)`,"-webkit-backdrop-filter":`blur(12px)`}},XY={class:`tpl:flex tpl:items-center tpl:gap-2.5`},ZY={class:`tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]`,style:{"letter-spacing":`-0.01em`}},QY={class:`tpl:flex tpl:items-center tpl:justify-center tpl:gap-10`},$Y={class:`tpl:sticky tpl:top-0 tpl:z-40 tpl:h-0`},eX={class:`tpl:flex tpl:justify-center tpl:p-8`},tX=[`aria-label`],nX=(0,t.defineComponent)({__name:`Editor`,props:{config:{},translations:{},fontsManager:{}},setup(e,{expose:r}){let i=e,a=(0,n.useEditor)({content:i.config.content,templateDefaults:i.config.templateDefaults}),o=aB({editor:a,config:{uiTheme:i.config.uiTheme,theme:i.config.theme,blockDefaults:i.config.blockDefaults,customBlocks:i.config.customBlocks,mergeTags:i.config.mergeTags,displayConditions:i.config.displayConditions,onRequestMedia:i.config.onRequestMedia,onSave:i.config.onSave?()=>i.config.onSave(JSON.parse(JSON.stringify(a.state.content))):void 0},translations:i.translations,fontsManager:i.fontsManager,autoSaveOptions:i.config.onChange?{onChange:()=>i.config.onChange(JSON.parse(JSON.stringify(a.state.content)))}:null});return(0,t.onMounted)(async()=>{await i.fontsManager.loadCustomFonts()}),(0,t.onUnmounted)(()=>{i.fontsManager.cleanupFontLinks(),o.destroy()}),r({getContent:()=>a.content.value,setContent:e=>a.setContent(e),setTheme:e=>a.setUiTheme(e)}),(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`tpl tpl:relative tpl:h-full tpl:overflow-hidden`,{"tpl:dark":(0,t.unref)(a).state.darkMode}]),"data-tpl-theme":(0,t.unref)(o).resolvedTheme.value,style:(0,t.normalizeStyle)((0,t.unref)(o).themeStyles.value)},[(0,t.createElementVNode)(`header`,YY,[(0,t.createElementVNode)(`div`,XY,[n[5]||=(0,t.createElementVNode)(`img`,{width:`24`,height:`24`,src:`https://templatical.com/logo.svg`,alt:`Templatical`},null,-1),(0,t.createElementVNode)(`span`,ZY,(0,t.toDisplayString)((0,t.unref)(o).t.header.title),1)]),(0,t.createElementVNode)(`div`,QY,[(0,t.createVNode)(DY,{viewport:(0,t.unref)(a).state.viewport,onChange:(0,t.unref)(a).setViewport},null,8,[`viewport`,`onChange`]),(0,t.createVNode)(zY,{"dark-mode":(0,t.unref)(a).state.darkMode,onChange:(0,t.unref)(a).setDarkMode},null,8,[`dark-mode`,`onChange`]),(0,t.createVNode)(NY,{"preview-mode":(0,t.unref)(a).state.previewMode,onChange:(0,t.unref)(a).setPreviewMode},null,8,[`preview-mode`,`onChange`])]),n[6]||=(0,t.createElementVNode)(`div`,{class:`tpl:flex tpl:min-w-[200px] tpl:items-center tpl:justify-end tpl:gap-3`},null,-1)]),(0,t.withDirectives)((0,t.createVNode)(VB,null,null,512),[[t.vShow,!(0,t.unref)(a).state.previewMode]]),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`tpl-body tpl:absolute tpl:bottom-0 tpl:overflow-auto tpl:bg-[var(--tpl-canvas-bg)]`,[(0,t.unref)(a).state.previewMode?`tpl:left-0 tpl:right-0`:`tpl:left-12 tpl:right-[320px]`,`tpl:top-14`]]),style:{transition:`all 300ms cubic-bezier(0.34, 1.56, 0.64, 1)`}},[(0,t.createElementVNode)(`div`,$Y,[(0,t.createVNode)(t.Transition,{name:`tpl-restore-btn`},{default:(0,t.withCtx)(()=>[(0,t.unref)(o).conditionPreview.hasHiddenBlocks.value?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,class:`tpl:absolute tpl:left-1/2 tpl:top-2 tpl:-translate-x-1/2 tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-full tpl:border tpl:px-3.5 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:whitespace-nowrap tpl:shadow-md tpl:hover:opacity-80 tpl:bg-[var(--tpl-warning-light)] tpl:text-[var(--tpl-warning)] tpl:border-[var(--tpl-warning)]`,style:{"backdrop-filter":`blur(8px)`},onClick:n[0]||=e=>(0,t.unref)(o).conditionPreview.reset()},[(0,t.createVNode)((0,t.unref)(ld),{size:13,"stroke-width":2}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(o).t.blockSettings.restoreHiddenBlocks),1)])):(0,t.createCommentVNode)(``,!0)]),_:1})]),(0,t.createElementVNode)(`div`,eX,[(0,t.createVNode)(EB,{viewport:(0,t.unref)(a).state.viewport,content:(0,t.unref)(a).content.value,"selected-block-id":(0,t.unref)(a).state.selectedBlockId,"dark-mode":(0,t.unref)(a).state.darkMode,"preview-mode":(0,t.unref)(a).state.previewMode,onSelectBlock:(0,t.unref)(a).selectBlock},null,8,[`viewport`,`content`,`selected-block-id`,`dark-mode`,`preview-mode`,`onSelectBlock`])])],2),(0,t.createVNode)(GY,{"position-class":[(0,t.unref)(a).state.previewMode?`tpl:left-0 tpl:right-0`:`tpl:left-12 tpl:right-[320px]`]},null,8,[`position-class`]),(0,t.createElementVNode)(`div`,{class:`tpl-sr-only`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,"aria-label":(0,t.unref)(o).t.landmarks.reorderAnnouncements},(0,t.toDisplayString)((0,t.unref)(o).keyboardReorder.announcement.value),9,tX),(0,t.withDirectives)((0,t.createVNode)(xY,{"selected-block":(0,t.unref)(a).selectedBlock.value,settings:(0,t.unref)(a).content.value.settings,onUpdateBlock:n[1]||=e=>(0,t.unref)(a).updateBlock((0,t.unref)(a).state.selectedBlockId,e),onDeleteBlock:n[2]||=()=>{(0,t.unref)(a).state.selectedBlockId&&(0,t.unref)(o).blockActions.deleteBlock((0,t.unref)(a).state.selectedBlockId)},onDuplicateBlock:n[3]||=()=>{(0,t.unref)(a).selectedBlock.value&&(0,t.unref)(o).blockActions.duplicateBlock((0,t.unref)(a).selectedBlock.value)},onUpdateSettings:n[4]||=e=>(0,t.unref)(a).updateSettings(e)},null,8,[`selected-block`,`settings`]),[[t.vShow,!(0,t.unref)(a).state.previewMode]])],14,JY))}});dp();var rX=up(nX,[[`__scopeId`,`data-v-8c8f0453`]]),iX=(e,t,n)=>{let r=t.lastIndexOf(`?`),i=e[r===-1||r<t.lastIndexOf(`/`)?t:t.slice(0,r)];return i?typeof i==`function`?i():Promise.resolve(i):new Promise((e,r)=>{(typeof queueMicrotask==`function`?queueMicrotask:setTimeout)(r.bind(null,Error(`Unknown variable dynamic import: `+t+(t.split(`/`).length===n?``:`. Note that variables only represent file names one level deep.`))))})},aX=p({default:()=>oX}),oX,sX=d((()=>{oX={loading:{initializing:`Initialisieren...`},error:{title:`Etwas ist schiefgelaufen`,defaultMessage:`Der Editor konnte keine Verbindung zu Templatical herstellen. Überprüfen Sie Ihre Netzwerkverbindung und versuchen Sie es erneut.`,authFailed:`Authentifizierung fehlgeschlagen. Bitte überprüfen Sie Ihre Anmeldedaten.`,templateNotFound:`Die angeforderte Vorlage konnte nicht gefunden werden. Bitte überprüfen Sie die Vorlagen-ID.`,retry:`Erneut versuchen`},header:{title:`Templatical`,unsaved:`Nicht gespeichert`,saving:`Speichern...`,saved:`Gespeichert`,saveFailed:`Speichern fehlgeschlagen`,save:`Speichern`,templatesUsed:`{used}/{max} Vorlagen verwendet`},footer:{poweredBy:`Erstellt mit`,openSource:`Open Source`},snapshotPreview:{message:`Sie sehen einen früheren Snapshot dieser Vorlage.`,cancel:`Abbrechen`,restore:`Diesen Snapshot wiederherstellen`},history:{undo:`Rückgängig`,redo:`Wiederholen`,collabWarning:`Rückgängig machen kann die Änderungen anderer Mitarbeiter beeinflussen`},viewport:{label:`Ansichtsgröße`,desktop:`Desktop`,tablet:`Tablet`,mobile:`Mobil`},darkMode:{enable:`Dunkelmodus-Vorschau`,disable:`Hellmodus-Vorschau`},previewMode:{enable:`Vorschaumodus`,disable:`Vorschau beenden`},blocks:{section:`Abschnitt`,image:`Bild`,title:`Titel`,paragraph:`Absatz`,button:`Schaltfläche`,divider:`Trennlinie`,video:`Video`,social:`Sozial`,spacer:`Abstand`,html:`HTML`,menu:`Menü`,table:`Tabelle`,countdown:`Countdown`},sidebar:{content:`Inhalt`,settings:`Einstellungen`,noSelection:`Kein Element ausgewählt`,noSelectionHint:`Wählen Sie einen Block auf der Leinwand aus, um ihn zu bearbeiten`},toolbar:{duplicate:`Duplizieren`,delete:`Löschen`},titleEditor:{toolbar:`Titelformatierung`,bold:`Fett (Strg+B)`,italic:`Kursiv (Strg+I)`,addLink:`Link hinzufügen`},paragraphEditor:{toolbar:`Textformatierung`,bold:`Fett (Strg+B)`,italic:`Kursiv (Strg+I)`,underline:`Unterstrichen (Strg+U)`,strikethrough:`Durchgestrichen`,subscript:`Tiefgestellt`,superscript:`Hochgestellt`,addLink:`Link hinzufügen`,bulletList:`Aufzählungsliste`,numberedList:`Nummerierte Liste`,alignLeft:`Linksbündig`,alignCenter:`Zentriert`,alignRight:`Rechtsbündig`,clearFormatting:`Formatierung entfernen`,insertEmoji:`Emoji einfügen`,fontFamily:`Schriftart`,defaultFont:`Standard`,fontSize:`Schriftgröße`,defaultSize:`Standard`,textColor:`Textfarbe`,highlightColor:`Hervorhebungsfarbe`,lineHeight:`Zeilenhöhe`,letterSpacing:`Zeichenabstand`,emojiItemLabel:`Emoji {emoji} einfügen`,closeEmojiPicker:`Emoji-Auswahl schließen`},blockActions:{drag:`Zum Sortieren ziehen oder Leertaste drücken, um mit der Tastatur zu verschieben`,dragLifted:`{block} wird verschoben. Pfeiltasten zum Positionieren, Leer- oder Eingabetaste zum Ablegen, Esc zum Abbrechen.`,duplicate:`Block duplizieren`,delete:`Block löschen`,hiddenOnViewport:`Ausgeblendet auf {viewport}`,saveAsModule:`Als Modul speichern`,conditionToggle:`Anzeigebedingung umschalten`,comments:`Kommentare ({count})`,lifted:`{block} angehoben. Position {position} von {total}.`,moved:`{block} auf Position {position} von {total} verschoben.`,dropped:`{block} auf Position {position} von {total} abgelegt.`,cancelled:`Verschieben abgebrochen. {block} auf Position {position} zurückgesetzt.`},section:{dropHere:`Blöcke hierher ziehen`,columns:`Spalten`,column1:`1 Spalte`,column2:`2 Spalten`,column3:`3 Spalten`,ratio12:`1:2 Verhältnis`,ratio21:`2:1 Verhältnis`},linkDialog:{editLink:`Link bearbeiten`,insertLink:`Link einfügen`,updateLink:`Link aktualisieren`,removeLink:`Link entfernen`,cancel:`Abbrechen`,urlPlaceholder:`https://beispiel.de`,urlLabel:`URL`},title:{level:`Überschriftenebene`,heading1:`Überschrift 1 (36px)`,heading2:`Überschrift 2 (28px)`,heading3:`Überschrift 3 (22px)`,heading4:`Überschrift 4 (18px)`,fontFamily:`Schriftart`,inheritFont:`Vorlagenschrift verwenden`,color:`Farbe`,align:`Ausrichtung`,alignLeft:`Links`,alignCenter:`Zentriert`,alignRight:`Rechts`},emoji:{smileys:`Smileys`,gestures:`Gesten`,objects:`Objekte`},image:{imageUrl:`Bild-URL`,imageUrlPlaceholder:`https://...`,altText:`Alternativtext`,altTextPlaceholder:`Bildbeschreibung`,width:`Breite`,fullWidth:`Volle Breite`,linkUrl:`Link-URL`,openInNewTab:`In neuem Tab öffnen`,placeholderUrl:`Platzhalterbild`,placeholderUrlPlaceholder:`https://... (nur zur Gestaltung)`,placeholderUrlTooltip:`Da die Bild-URL einen Platzhalter verwendet, können Sie hier ein echtes Bild angeben, um das Layout während der Gestaltung in der Vorschau anzuzeigen. Dies wird nicht in die endgültige Ausgabe aufgenommen.`,clickToAdd:`Klicken Sie, um eine Bild-URL hinzuzufügen`,browseMedia:`Medien durchsuchen`},video:{videoUrl:`Video-URL`,videoUrlPlaceholder:`https://youtube.com/...`,youtube:`YouTube`,vimeo:`Vimeo`,detected:`Video erkannt — Vorschaubild wird automatisch generiert`,openInNewTab:`In neuem Tab öffnen`,customThumbnail:`Eigenes Vorschaubild`,optional:`(optional)`,thumbnailPlaceholder:`Automatisch aus Video-URL generiert`,altText:`Alternativtext`,altTextPlaceholder:`Videobeschreibung`,width:`Breite`,fullWidth:`Volle Breite`,placeholderUrl:`Platzhalter-Thumbnail`,placeholderUrlPlaceholder:`https://... (nur zur Gestaltung)`,placeholderUrlTooltip:`Da die Video-URL einen Platzhalter verwendet, können Sie hier ein echtes Thumbnail angeben, um das Layout während der Gestaltung in der Vorschau anzuzeigen. Dies wird nicht in die endgültige Ausgabe aufgenommen.`,addVideo:`Video-URL hinzufügen`},button:{fontFamily:`Schriftart`,inheritFont:`Vorlagenschrift verwenden`,text:`Text`,url:`URL`,urlPlaceholder:`https://...`,openInNewTab:`In neuem Tab öffnen`,background:`Hintergrund`,textColor:`Textfarbe`,borderRadius:`Eckenradius`,fontSize:`Schriftgröße`},divider:{style:`Stil`,solid:`Durchgehend`,dashed:`Gestrichelt`,dotted:`Gepunktet`,color:`Farbe`,thickness:`Stärke`},social:{icons:`Symbole`,addIcon:`Symbol hinzufügen`,addIcons:`Soziale Symbole hinzufügen`,removeIcon:`Entfernen`,platform:`Plattform`,url:`URL`,urlPlaceholder:`https://...`,style:`Stil`,styleSolid:`Gefüllt`,styleOutlined:`Umrandet`,styleRounded:`Abgerundet`,styleSquare:`Eckig`,styleCircle:`Rund`,size:`Größe`,sizeSmall:`K`,sizeMedium:`M`,sizeLarge:`G`,spacing:`Abstand`,align:`Ausrichtung`,platforms:{facebook:`Facebook`,twitter:`X (Twitter)`,instagram:`Instagram`,linkedin:`LinkedIn`,youtube:`YouTube`,tiktok:`TikTok`,pinterest:`Pinterest`,email:`E-Mail`,whatsapp:`WhatsApp`,telegram:`Telegram`,discord:`Discord`,snapchat:`Snapchat`,reddit:`Reddit`,github:`GitHub`,dribbble:`Dribbble`,behance:`Behance`}},menu:{items:`Menüpunkte`,addItem:`Punkt hinzufügen`,removeItem:`Entfernen`,text:`Text`,url:`URL`,urlPlaceholder:`https://beispiel.de`,openInNewTab:`In neuem Tab öffnen`,bold:`Fett`,underline:`Unterstrichen`,color:`Farbe`,linkColor:`Linkfarbe`,fontSize:`Schriftgröße`,fontFamily:`Schriftfamilie`,separator:`Trennzeichen`,separatorColor:`Trennzeichenfarbe`,spacing:`Abstand`,textAlign:`Ausrichtung`,addLinks:`Menülinks hinzufügen`},table:{dimensions:`Abmessungen`,rows:`Zeilen`,columns:`Spalten`,addRow:`Zeile hinzufügen`,removeRow:`Zeile entfernen`,addColumn:`Spalte hinzufügen`,removeColumn:`Spalte entfernen`,hasHeaderRow:`Kopfzeile`,headerBackgroundColor:`Kopfzeilen-Hintergrund`,noHeaderBg:`Kein Hintergrund`,borderColor:`Rahmenfarbe`,borderWidth:`Rahmenbreite`,cellPadding:`Zellenabstand`,fontFamily:`Schriftart`,fontSize:`Schriftgröße`,color:`Textfarbe`,textAlign:`Ausrichtung`,cellPlaceholder:`Text eingeben...`,empty:`Tabelle hinzufügen`},spacer:{height:`Höhe`},countdown:{targetDate:`Zieldatum`,timezone:`Zeitzone`,display:`Anzeige`,days:`Tage`,hours:`Stunden`,minutes:`Minuten`,seconds:`Sekunden`,separator:`Trennzeichen`,fontFamily:`Schriftart`,inheritFont:`Standard`,digitFontSize:`Zifferngröße`,digitColor:`Ziffernfarbe`,labelColor:`Beschriftungsfarbe`,labelFontSize:`Beschriftungsgröße`,background:`Hintergrund`,labels:`Beschriftungen`,expiry:`Ablaufnachricht`,expiredMessagePlaceholder:`Dieses Angebot ist abgelaufen`,expiredImageUrl:`Ablaufbild-URL`,hideOnExpiry:`Bei Ablauf ausblenden`,setDate:`Legen Sie ein Zieldatum im Einstellungsbereich fest`,hidden:`Ausgeblendet (abgelaufen)`},customBlocks:{definitionNotFound:`Unbekannter Blocktyp — dieser Block ist nicht registriert`,renderError:`Dieser Block konnte nicht gerendert werden. Überprüfen Sie die Block-Vorlage auf Fehler.`,fields:{required:`Pflichtfeld`,addItem:`Element hinzufügen`,removeItem:`Entfernen`,maxItemsReached:`Maximale Anzahl erreicht`,minItemsRequired:`Mindestens {count} Elemente erforderlich`},toolbar:{noDefinition:`Registrieren Sie diesen Blocktyp in Ihrer SDK-Konfiguration, um seine Eigenschaften zu bearbeiten`},dataSource:{fetchButton:`Inhalt laden`,changeButton:`Ändern`,fetching:`Wird geladen...`,readOnlyTooltip:`Dieser Wert wird aus Ihrer Datenquelle geladen`,fetchError:`Inhalt konnte nicht geladen werden`}},html:{content:`HTML-Inhalt`,preview:`Benutzerdefinierter HTML-Block`,empty:`HTML-Inhalt im Bereich hinzufügen`,sanitizationHint:`Skripte und unsichere Elemente werden beim Export entfernt.`},blockSettings:{spacing:`Abstände`,padding:`Innenabstand`,margin:`Außenabstand`,background:`Hintergrund`,color:`Farbe`,display:`Anzeige`,showOnDesktop:`Auf Desktop anzeigen`,showOnTablet:`Auf Tablet anzeigen`,showOnMobile:`Auf Mobilgerät anzeigen`,hiddenOnDevice:`Ausgeblendet auf {device}`,customCss:`Benutzerdefiniertes CSS`,css:`CSS`,cssPlaceholder:`/* Benutzerdefinierte Stile */`,displayCondition:`Anzeigebedingung`,selectCondition:`Bedingung auswählen`,removeCondition:`Bedingung entfernen`,noCondition:`Immer sichtbar`,conditionApplied:`Bedingung angewendet`,customCondition:`Eigene Bedingung`,customConditionLabel:`Bedingungsname`,customConditionBefore:`Vorher (öffnende Logik)`,customConditionAfter:`Nachher (schließende Logik)`,applyCondition:`Anwenden`,cancelCondition:`Abbrechen`,customBadge:`Eigene`,restoreHiddenBlocks:`Alle ausgeblendeten Blöcke anzeigen`},templateSettings:{layout:`Layout`,widthPreset:`Breitenvoreinstellung`,customWidth:`Benutzerdefinierte Breite`,appearance:`Erscheinungsbild`,backgroundColor:`Hintergrundfarbe`,fontFamily:`Schriftfamilie`,preheaderText:`Preheader-Text`,preheaderTextPlaceholder:`Vorschautext, der nach der Betreffzeile im Posteingang angezeigt wird...`,preheaderTextHint:`Dieser Text erscheint nach der Betreffzeile in der E-Mail-Vorschau. Unterstützt Platzhalter.`,tips:`Tipps`,tip1:`600px ist die Standardbreite für E-Mail-Vorlagen`,tip2:`Verwenden Sie websichere Schriften für beste Kompatibilität`,tip3:`Helle Hintergründe eignen sich am besten für die Lesbarkeit`},spacingControl:{lockAll:`Alle Seiten sperren`,unlock:`Seiten entsperren`,top:`Oben`,right:`Rechts`,bottom:`Unten`,left:`Links`,decreaseTop:`Oben verringern`,increaseTop:`Oben erhöhen`,decreaseLeft:`Links verringern`,increaseLeft:`Links erhöhen`,decreaseRight:`Rechts verringern`,increaseRight:`Rechts erhöhen`,decreaseBottom:`Unten verringern`,increaseBottom:`Unten erhöhen`},colorPicker:{pickColor:`Farbe auswählen`,hexValue:`Hex-Farbwert`},mergeTag:{clickToEdit:`Zum Bearbeiten klicken`,remove:`Merge-Tag entfernen`,insert:`Merge-Tag einfügen`,add:`Merge-Tag hinzufügen`,editValue:`Merge-Tag-Wert bearbeiten`,deleteMergeTag:`Merge-Tag löschen`},snapshotHistory:{tooltip:`Versionsverlauf`,dropdownTitle:`Versionsverlauf`,noSnapshots:`Noch keine Versionen`,auto:`auto`,justNow:`Gerade eben`,minutesAgo:`vor {minutes} Min.`,hoursAgo:`vor {hours} Std.`,daysAgo:`vor {days} Tagen`,olderSnapshot:`Ältere Version`,newerSnapshot:`Neuere Version`},canvas:{noBlocks:`Noch keine Blöcke`,dragHint:`Beginnen Sie von Grund auf, indem Sie Blöcke aus der Seitenleiste ziehen`,dropHere:`Hier ablegen`,aiHintChat:`oder lassen Sie`,aiHintChatSuffix:`in Sekunden eine komplette Vorlage für Sie erstellen`,aiHintDesign:`Haben Sie ein bestehendes Design? Laden Sie einen Screenshot, ein Bild oder PDF hoch und`,aiHintDesignSuffix:`erstellt es sofort nach`},mediaLibrary:{title:`Medienbibliothek`,searchPlaceholder:`Dateien suchen...`,allFiles:`Alle Dateien`,filterAll:`Alle Typen`,filterImages:`Bilder`,filterDocuments:`Dokumente`,filterVideos:`Videos`,filterAudio:`Audio`,newFolder:`Neuer Ordner`,folderName:`Ordnername`,noFiles:`Keine Dateien gefunden`,dropOrClick:`Dateien hierher ziehen oder klicken zum Hochladen`,acceptedFormats:`Bilder, PDF, Video, Audio, Dokumente (max. 10 MB)`,uploading:`Wird hochgeladen...`,uploadingProgress:`{current} von {total} wird hochgeladen...`,selectImage:`Bild auswählen`,selectFile:`Datei auswählen`,deleteSelected:`Löschen`,copyUrl:`URL kopieren`,copied:`Kopiert!`,browseMedia:`Medienbibliothek durchsuchen`,renameFolder:`Ordner umbenennen`,addSubfolder:`Unterordner hinzufügen`,subfolderName:`Unterordnername`,sortNewest:`Neueste zuerst`,sortOldest:`Älteste zuerst`,sortNameAsc:`Name A-Z`,sortNameDesc:`Name Z-A`,sortSizeAsc:`Kleinste zuerst`,sortSizeDesc:`Größte zuerst`,moveSelected:`Verschieben`,moveToRoot:`Alle Dateien`,currentFolder:`(aktuell)`,confirmDelete:`Diese Datei löschen?`,renameFile:`Umbenennen`,editFile:`Datei bearbeiten`,fileName:`Dateiname`,altText:`Alternativtext`,altTextPlaceholder:`Bildbeschreibung für Barrierefreiheit`,saveChanges:`Speichern`,cancel:`Abbrechen`,frequentlyUsed:`Häufig verwendet`,deleteWarningTitle:`Datei löschen`,deleteWarningMessage:`Diese Datei wird dauerhaft gelöscht und kann nicht wiederhergestellt werden.`,deleteWarningUsageNote:`Die folgenden Dateien werden in Vorlagen verwendet. Das Löschen kann diese Vorlagen beschädigen.`,deleteAnyway:`Datei löschen`,usedInTemplates:`In {count} Vorlage(n) verwendet`,viewGrid:`Rasteransicht`,viewList:`Listenansicht`,showFolders:`Ordner anzeigen`,hideFolders:`Ordner ausblenden`,importFromUrl:`Von URL importieren`,importUrlPlaceholder:`https://example.com/image.jpg`,import:`Importieren`,importing:`Wird importiert...`,importError:`Import von URL fehlgeschlagen`,conversionLabel:`Groesse`,conversionOriginal:`Original`,conversionSmall:`Klein (150px)`,conversionMedium:`Mittel (600px)`,conversionLarge:`Gross (1200px)`,replaceFile:`Datei ersetzen`,replaceWarningTitle:`Datei ersetzen`,replaceWarningMessage:`Sie sind dabei, diese Datei zu ersetzen. Die Ersatzdatei muss dieselbe Dateierweiterung haben ({extension}).`,replaceWarningUsageNote:`Diese Datei wird in {count} Vorlage(n) verwendet. Das Ersetzen aktualisiert alle Verweise.`,replaceSelectFile:`Ersatzdatei auswählen`,replace:`Ersetzen`,replacing:`Wird ersetzt...`,replaceError:`Ersetzen der Datei fehlgeschlagen`,saving:`Wird gespeichert...`,cropAspectRatio:`Seitenverhältnis`,cropFree:`Frei`,cropSquare:`1:1`,cropLandscape43:`4:3`,cropLandscape169:`16:9`,cropOriginal:`Original`,cropMaxWidth:`Max. Breite`,cropMaxHeight:`Max. Höhe`,cropOutputSize:`Ausgabegröße`,cropPixels:`px`,cropOptional:`(optional)`,storageTooltip:`{used} von {total} verwendet ({remaining} verfügbar)`},testEmail:{title:`Test-E-Mail senden`,recipientLabel:`Empfänger`,send:`Senden`,sending:`Wird gesendet...`,cancel:`Abbrechen`,success:`Test-E-Mail erfolgreich gesendet`,button:`Test`},aiRewrite:{title:`KI-Umschreibung`,tone:`Tonalität`,length:`Länge`,clarity:`Klarheit`,professional:`Professionell`,casual:`Locker`,friendly:`Freundlich`,urgent:`Dringend`,persuasive:`Überzeugend`,shorter:`Kürzer`,longer:`Länger`,summarize:`Zusammenfassen`,simplify:`Vereinfachen`,fixGrammar:`Grammatik korrigieren`,improveReadability:`Lesbarkeit verbessern`,customInstruction:`Eigene Anweisung`,customPlaceholder:`Beschreiben Sie die gewünschte Umschreibung...`,rewrite:`Umschreiben`,rewriting:`Wird umgeschrieben...`,undo:`Rückgängig`,redo:`Wiederholen`,refine:`Weiter verfeinern`,error:`Text konnte nicht umgeschrieben werden`},aiChat:{title:`KI-Assistent`,button:`KI`,inputPlaceholder:`Beschreiben Sie Ihre E-Mail-Vorlage...`,send:`Senden`,generating:`Wird generiert...`,applied:`Änderungen auf Vorlage angewendet.`,applyFailed:`Änderungen konnten nicht auf die Vorlage angewendet werden. Bitte versuchen Sie es erneut.`,revert:`Änderungen rückgängig`,reapply:`Änderungen erneut anwenden`,error:`Vorlage konnte nicht generiert werden`,clear:`Chat leeren`,placeholder:`Beschreiben Sie die E-Mail-Vorlage, die Sie erstellen möchten, oder bitten Sie um Änderungen an der aktuellen.`,loadingHistory:`Konversation wird geladen...`},scoring:{button:`Bewertung`,title:`Vorlagenbewertung`,rescore:`Neu bewerten`,scoring:`Vorlage wird analysiert...`,overallScore:`Gesamtbewertung`,categories:{spam:`Spam-Risiko`,readability:`Lesbarkeit`,accessibility:`Barrierefreiheit`,bestPractices:`Best Practices`},severity:{high:`Hoch`,medium:`Mittel`,low:`Niedrig`},fix:`Mit KI beheben`,fixing:`Wird behoben...`,fixed:`Behoben`,findings:`Ergebnisse`,noFindings:`Keine Probleme gefunden`,error:`Vorlage konnte nicht analysiert werden`,fixError:`Korrektur konnte nicht angewendet werden`,emptyState:`Bewerten Sie Ihre Vorlage, um umsetzbare Rückmeldungen zu Spam-Risiko, Lesbarkeit, Barrierefreiheit und Best Practices zu erhalten.`},aiMenu:{aiAssistant:`KI-Assistent`,aiAssistantDesc:`Mit KI chatten, um Ihre Vorlage zu erstellen oder zu ändern`,designToTemplate:`Design zu Vorlage`,designToTemplateDesc:`Vorlage aus einem Bild oder PDF generieren`,templateScore:`Vorlagenbewertung`,templateScoreDesc:`Qualität, Spam-Risiko und Barrierefreiheit analysieren`,disclaimer:`KI kann Fehler machen. Bitte überprüfen Sie die Ergebnisse vor der Genehmigung.`},comments:{title:`Kommentare`,placeholder:`Kommentar schreiben...`,replyPlaceholder:`Antwort schreiben...`,reply:`Antworten`,resolve:`Lösen`,unresolve:`Wiedereröffnen`,resolved:`Gelöst`,delete:`Löschen`,edit:`Bearbeiten`,cancel:`Abbrechen`,save:`Speichern`,noComments:`Noch keine Kommentare`,noCommentsHint:`Starten Sie eine Konversation, indem Sie einen Kommentar zur Vorlage oder einem bestimmten Block hinzufügen.`,addComment:`Kommentar hinzufügen`,deleteConfirm:`Diesen Kommentar löschen?`,filterAll:`Alle`,filterUnresolved:`Ungelöst`,filterBlock:`Dieser Block`,ownedByYou:`Sie`,edited:`bearbeitet`,resolvedBy:`Gelöst von {name}`,replyOne:`{count} Antwort`,replyMany:`{count} Antworten`,missingBlock:`Fehlender Block`,saveTemplateFirst:`Speichern Sie die Vorlage, bevor Sie diesen Block kommentieren.`,button:`Kommentare`},collaboration:{connected:`Zusammenarbeit aktiv`,disconnected:`Zusammenarbeit getrennt`,reconnecting:`Verbindung wird wiederhergestellt...`,blockLockedBy:`Wird bearbeitet von {name}`,usersOnline:`{count} Benutzer online`},sidebarNav:{browseModules:`Gespeicherte Module durchsuchen`,expandSidebar:`Block-Seitenleiste erweitern`,palette:`Blockpalette`,insertBlock:`{block}-Block einfügen`},landmarks:{canvas:`E-Mail-Leinwand`,blockToolbar:`Blockeigenschaften`,rightSidebar:`Blockeigenschaften und Vorlageneinstellungen`,reorderAnnouncements:`Block-Neuanordnungsmeldungen`},modules:{title:`Gespeicherte Module`,saveAsModule:`Als Modul speichern`,moduleName:`Modulname`,moduleNamePlaceholder:`z.B. Header, Footer, CTA...`,selectBlocks:`Blöcke auswählen`,save:`Modul speichern`,saving:`Wird gespeichert...`,cancel:`Abbrechen`,noModules:`Noch keine gespeicherten Module`,noModulesHint:`Speichern Sie Blöcke aus Ihren Vorlagen, um sie später wiederzuverwenden.`,search:`Module suchen...`,insert:`Einfügen`,delete:`Löschen`,deleteConfirm:`Dieses Modul löschen?`,blockCount:`{count} Block/Blöcke`,browse:`Module durchsuchen`,selectToPreview:`Modul auswählen für Vorschau`,insertAtBeginning:`Am Anfang`,insertAfterBlock:`Nach {block}`,insertAtEnd:`Am Ende`,insertPosition:`Einfügeposition`,close:`Schließen`},designReference:{title:`Designvorlage`,button:`Design`,uploadImage:`Bild`,uploadPdf:`PDF`,dropHint:`Datei hierher ziehen oder klicken zum Durchsuchen`,acceptedImages:`PNG, JPG, WebP (max. 10 MB)`,acceptedPdf:`PDF (max. 10 MB)`,promptLabel:`Anweisungen (optional)`,promptPlaceholder:`Beschreiben Sie Anpassungen oder Wünsche für die generierte Vorlage...`,generate:`Aus Design generieren`,generating:`Design wird analysiert und Vorlage generiert...`,replaceWarning:`Die Generierung aus einer Designvorlage ersetzt den vorhandenen Vorlageninhalt.`,replaceConfirm:`Ersetzen und generieren`,replaceCancel:`Abbrechen`,error:`Vorlage konnte nicht aus Design generiert werden`,fileTooLarge:`Datei ist zu groß. Maximale Größe ist 10 MB.`,invalidFileType:`Dieser Dateityp wird nicht unterstützt. Laden Sie eine PNG-, JPG-, WebP- oder PDF-Datei hoch.`},errors:{editorLoading:`Editor wird geladen...`,editorLoadFailed:`Editor konnte nicht geladen werden.`,retry:`Erneut versuchen`}}})),cX=p({default:()=>lX}),lX,uX=d((()=>{lX={loading:{initializing:`Initializing...`},error:{title:`Something went wrong`,defaultMessage:`The editor could not connect to Templatical. Check your network connection and try again.`,authFailed:`Authentication failed. Please check your credentials.`,templateNotFound:`The requested template could not be found. Please verify the template ID is correct.`,retry:`Try Again`},header:{title:`Templatical`,unsaved:`Unsaved`,saving:`Saving...`,saved:`Saved`,saveFailed:`Save failed`,save:`Save`,templatesUsed:`{used}/{max} templates used`},footer:{poweredBy:`Powered by`,openSource:`Open Source`},snapshotPreview:{message:`You are previewing a previous snapshot of this template.`,cancel:`Cancel`,restore:`Restore this snapshot`},history:{undo:`Undo`,redo:`Redo`,collabWarning:`Undo may affect collaborators' recent changes`},viewport:{label:`Viewport`,desktop:`Desktop`,tablet:`Tablet`,mobile:`Mobile`},darkMode:{enable:`Dark Mode Preview`,disable:`Light Mode Preview`},previewMode:{enable:`Preview Mode`,disable:`Exit Preview`},blocks:{section:`Section`,image:`Image`,title:`Title`,paragraph:`Paragraph`,button:`Button`,divider:`Divider`,video:`Video`,social:`Social`,spacer:`Spacer`,html:`HTML`,menu:`Menu`,table:`Table`,countdown:`Countdown`},sidebar:{content:`Content`,settings:`Settings`,noSelection:`No element selected`,noSelectionHint:`Select a block on the canvas to edit it`},toolbar:{duplicate:`Duplicate`,delete:`Delete`},titleEditor:{toolbar:`Title formatting`,bold:`Bold (Ctrl+B)`,italic:`Italic (Ctrl+I)`,addLink:`Add Link`},paragraphEditor:{toolbar:`Text formatting`,bold:`Bold (Ctrl+B)`,italic:`Italic (Ctrl+I)`,underline:`Underline (Ctrl+U)`,strikethrough:`Strikethrough`,subscript:`Subscript`,superscript:`Superscript`,addLink:`Add Link`,bulletList:`Bullet List`,numberedList:`Numbered List`,alignLeft:`Align Left`,alignCenter:`Align Center`,alignRight:`Align Right`,clearFormatting:`Clear Formatting`,insertEmoji:`Insert Emoji`,fontFamily:`Font Family`,defaultFont:`Default`,fontSize:`Font Size`,defaultSize:`Default`,textColor:`Text Color`,highlightColor:`Highlight Color`,lineHeight:`Line Height`,letterSpacing:`Letter Spacing`,emojiItemLabel:`Insert emoji {emoji}`,closeEmojiPicker:`Close emoji picker`},blockActions:{drag:`Drag to reorder, or press Space to move with keyboard`,dragLifted:`Moving {block}. Use up and down arrow keys to reposition, Space or Enter to drop, Escape to cancel.`,duplicate:`Duplicate block`,delete:`Delete block`,hiddenOnViewport:`Hidden on {viewport}`,saveAsModule:`Save as Module`,conditionToggle:`Toggle display condition`,comments:`Comments ({count})`,lifted:`{block} lifted. Position {position} of {total}.`,moved:`{block} moved to position {position} of {total}.`,dropped:`{block} dropped at position {position} of {total}.`,cancelled:`Move cancelled. {block} returned to position {position}.`},section:{dropHere:`Drop blocks here`,columns:`Columns`,column1:`1 Column`,column2:`2 Columns`,column3:`3 Columns`,ratio12:`1:2 Ratio`,ratio21:`2:1 Ratio`},linkDialog:{editLink:`Edit Link`,insertLink:`Insert Link`,updateLink:`Update Link`,removeLink:`Remove Link`,cancel:`Cancel`,urlPlaceholder:`https://example.com`,urlLabel:`URL`},title:{level:`Heading Level`,heading1:`Heading 1 (36px)`,heading2:`Heading 2 (28px)`,heading3:`Heading 3 (22px)`,heading4:`Heading 4 (18px)`,fontFamily:`Font Family`,inheritFont:`Use template font`,color:`Color`,align:`Align`,alignLeft:`Left`,alignCenter:`Center`,alignRight:`Right`},emoji:{smileys:`Smileys`,gestures:`Gestures`,objects:`Objects`},image:{imageUrl:`Image URL`,imageUrlPlaceholder:`https://...`,altText:`Alt Text`,altTextPlaceholder:`Image description`,width:`Width`,fullWidth:`Full Width`,linkUrl:`Link URL`,openInNewTab:`Open in new tab`,placeholderUrl:`Placeholder Image`,placeholderUrlPlaceholder:`https://... (design-time only)`,placeholderUrlTooltip:`Since the image URL uses a placeholder, you can provide a real image here to preview the layout while designing. This is not included in the final output.`,clickToAdd:`Click to add image URL`,browseMedia:`Browse Media`},video:{videoUrl:`Video URL`,videoUrlPlaceholder:`https://youtube.com/...`,youtube:`YouTube`,vimeo:`Vimeo`,detected:`Video detected — thumbnail will be generated automatically`,openInNewTab:`Open in new tab`,customThumbnail:`Custom Thumbnail`,optional:`(optional)`,thumbnailPlaceholder:`Auto-generated from video URL`,altText:`Alt Text`,altTextPlaceholder:`Video description`,width:`Width`,fullWidth:`Full Width`,placeholderUrl:`Placeholder Thumbnail`,placeholderUrlPlaceholder:`https://... (design-time only)`,placeholderUrlTooltip:`Since the video URL uses a placeholder, you can provide a real thumbnail here to preview the layout while designing. This is not included in the final output.`,addVideo:`Add a video URL`},button:{fontFamily:`Font Family`,inheritFont:`Use template font`,text:`Text`,url:`URL`,urlPlaceholder:`https://...`,openInNewTab:`Open in new tab`,background:`Background`,textColor:`Text Color`,borderRadius:`Border Radius`,fontSize:`Font Size`},divider:{style:`Style`,solid:`Solid`,dashed:`Dashed`,dotted:`Dotted`,color:`Color`,thickness:`Thickness`},social:{icons:`Icons`,addIcon:`Add Icon`,addIcons:`Add social icons`,removeIcon:`Remove`,platform:`Platform`,url:`URL`,urlPlaceholder:`https://...`,style:`Style`,styleSolid:`Solid`,styleOutlined:`Outlined`,styleRounded:`Rounded`,styleSquare:`Square`,styleCircle:`Circle`,size:`Size`,sizeSmall:`S`,sizeMedium:`M`,sizeLarge:`L`,spacing:`Spacing`,align:`Alignment`,platforms:{facebook:`Facebook`,twitter:`X (Twitter)`,instagram:`Instagram`,linkedin:`LinkedIn`,youtube:`YouTube`,tiktok:`TikTok`,pinterest:`Pinterest`,email:`Email`,whatsapp:`WhatsApp`,telegram:`Telegram`,discord:`Discord`,snapchat:`Snapchat`,reddit:`Reddit`,github:`GitHub`,dribbble:`Dribbble`,behance:`Behance`}},menu:{items:`Menu Items`,addItem:`Add Item`,removeItem:`Remove`,text:`Text`,url:`URL`,urlPlaceholder:`https://example.com`,openInNewTab:`Open in new tab`,bold:`Bold`,underline:`Underline`,color:`Color`,linkColor:`Link Color`,fontSize:`Font Size`,fontFamily:`Font Family`,separator:`Separator`,separatorColor:`Separator Color`,spacing:`Spacing`,textAlign:`Alignment`,addLinks:`Add menu links`},table:{dimensions:`Dimensions`,rows:`Rows`,columns:`Columns`,addRow:`Add Row`,removeRow:`Remove Row`,addColumn:`Add Column`,removeColumn:`Remove Column`,hasHeaderRow:`Header row`,headerBackgroundColor:`Header Background`,noHeaderBg:`No background`,borderColor:`Border Color`,borderWidth:`Border Width`,cellPadding:`Cell Padding`,fontFamily:`Font Family`,fontSize:`Font Size`,color:`Text Color`,textAlign:`Alignment`,cellPlaceholder:`Enter text...`,empty:`Add a table`},spacer:{height:`Height`},countdown:{targetDate:`Target Date`,timezone:`Timezone`,display:`Display`,days:`Days`,hours:`Hours`,minutes:`Minutes`,seconds:`Seconds`,separator:`Separator`,fontFamily:`Font Family`,inheritFont:`Default`,digitFontSize:`Digit Size`,digitColor:`Digit Color`,labelColor:`Label Color`,labelFontSize:`Label Size`,background:`Background`,labels:`Labels`,expiry:`Expired Message`,expiredMessagePlaceholder:`This offer has expired`,expiredImageUrl:`Expired Image URL`,hideOnExpiry:`Hide when expired`,setDate:`Set a target date in the settings panel`,hidden:`Hidden (expired)`},customBlocks:{definitionNotFound:`Unknown block type — this block is not registered`,renderError:`This block could not be rendered. Check the block template for errors.`,fields:{required:`Required`,addItem:`Add item`,removeItem:`Remove`,maxItemsReached:`Maximum items reached`,minItemsRequired:`Minimum {count} items required`},toolbar:{noDefinition:`Register this block type in your SDK configuration to edit its properties`},dataSource:{fetchButton:`Load content`,changeButton:`Change`,fetching:`Loading...`,readOnlyTooltip:`This value is loaded from your data source`,fetchError:`Failed to load content`}},html:{content:`HTML Content`,preview:`Custom HTML block`,empty:`Add HTML content in the panel`,sanitizationHint:`Scripts and unsafe elements are removed on export.`},blockSettings:{spacing:`Spacing`,padding:`Padding`,margin:`Margin`,background:`Background`,color:`Color`,display:`Display`,showOnDesktop:`Show on desktop`,showOnTablet:`Show on tablet`,showOnMobile:`Show on mobile`,hiddenOnDevice:`Hidden on {device}`,customCss:`Custom CSS`,css:`CSS`,cssPlaceholder:`/* Custom styles */`,displayCondition:`Display Condition`,selectCondition:`Select condition`,removeCondition:`Remove condition`,noCondition:`Always visible`,conditionApplied:`Condition applied`,customCondition:`Custom condition`,customConditionLabel:`Condition name`,customConditionBefore:`Before (opening logic)`,customConditionAfter:`After (closing logic)`,applyCondition:`Apply`,cancelCondition:`Cancel`,customBadge:`Custom`,restoreHiddenBlocks:`Show all hidden blocks`},templateSettings:{layout:`Layout`,widthPreset:`Width Preset`,customWidth:`Custom Width`,appearance:`Appearance`,backgroundColor:`Background Color`,fontFamily:`Font Family`,preheaderText:`Preheader Text`,preheaderTextPlaceholder:`Preview text shown after subject line in inbox...`,preheaderTextHint:`This text appears after the subject line in email client previews. Supports placeholders.`,tips:`Tips`,tip1:`600px is the standard width for email templates`,tip2:`Use web-safe fonts for best compatibility`,tip3:`Light backgrounds work best for readability`},spacingControl:{lockAll:`Lock all sides`,unlock:`Unlock sides`,top:`Top`,right:`Right`,bottom:`Bottom`,left:`Left`,decreaseTop:`Decrease top`,increaseTop:`Increase top`,decreaseLeft:`Decrease left`,increaseLeft:`Increase left`,decreaseRight:`Decrease right`,increaseRight:`Increase right`,decreaseBottom:`Decrease bottom`,increaseBottom:`Increase bottom`},colorPicker:{pickColor:`Pick a color`,hexValue:`Hex color value`},mergeTag:{clickToEdit:`Click to edit`,remove:`Remove merge tag`,insert:`Insert merge tag`,add:`Add merge tag`,editValue:`Edit merge tag value`,deleteMergeTag:`Delete merge tag`},snapshotHistory:{tooltip:`Version history`,dropdownTitle:`Version History`,noSnapshots:`No versions yet`,auto:`auto`,justNow:`Just now`,minutesAgo:`{minutes}m ago`,hoursAgo:`{hours}h ago`,daysAgo:`{days}d ago`,olderSnapshot:`Older version`,newerSnapshot:`Newer version`},canvas:{noBlocks:`No blocks yet`,dragHint:`Start from scratch by dragging blocks from the sidebar`,dropHere:`Drop here`,aiHintChat:`or let`,aiHintChatSuffix:`generate a complete template for you in seconds`,aiHintDesign:`Have an existing design? Upload a screenshot, image, or PDF and`,aiHintDesignSuffix:`will instantly recreate it`},mediaLibrary:{title:`Media Library`,searchPlaceholder:`Search files...`,allFiles:`All Files`,filterAll:`All Types`,filterImages:`Images`,filterDocuments:`Documents`,filterVideos:`Videos`,filterAudio:`Audio`,newFolder:`New Folder`,folderName:`Folder name`,noFiles:`No files found`,dropOrClick:`Drop files here or click to upload`,acceptedFormats:`Images, PDF, Video, Audio, Documents (max 10MB)`,uploading:`Uploading...`,uploadingProgress:`Uploading {current} of {total}...`,selectImage:`Select Image`,selectFile:`Select File`,deleteSelected:`Delete`,copyUrl:`Copy URL`,copied:`Copied!`,browseMedia:`Browse Media Library`,renameFolder:`Rename folder`,addSubfolder:`Add subfolder`,subfolderName:`Subfolder name`,sortNewest:`Newest First`,sortOldest:`Oldest First`,sortNameAsc:`Name A-Z`,sortNameDesc:`Name Z-A`,sortSizeAsc:`Smallest First`,sortSizeDesc:`Largest First`,moveSelected:`Move`,moveToRoot:`All Files`,currentFolder:`(current)`,confirmDelete:`Delete this file?`,renameFile:`Rename`,editFile:`Edit File`,fileName:`Filename`,altText:`Alt Text`,altTextPlaceholder:`Describe this image for accessibility`,saveChanges:`Save`,cancel:`Cancel`,frequentlyUsed:`Frequently Used`,deleteWarningTitle:`Delete File`,deleteWarningMessage:`This file will be permanently deleted and cannot be recovered.`,deleteWarningUsageNote:`The following files are used in templates. Deleting them may break those templates.`,deleteAnyway:`Delete file`,usedInTemplates:`Used in {count} template(s)`,viewGrid:`Grid view`,viewList:`List view`,showFolders:`Show folders`,hideFolders:`Hide folders`,importFromUrl:`Import from URL`,importUrlPlaceholder:`https://example.com/image.jpg`,import:`Import`,importing:`Importing...`,importError:`Failed to import from URL`,conversionLabel:`Size`,conversionOriginal:`Original`,conversionSmall:`Small (150px)`,conversionMedium:`Medium (600px)`,conversionLarge:`Large (1200px)`,replaceFile:`Replace File`,replaceWarningTitle:`Replace File`,replaceWarningMessage:`You are about to replace this file. The replacement must have the same file extension ({extension}).`,replaceWarningUsageNote:`This file is used in {count} template(s). Replacing it will update all references.`,replaceSelectFile:`Select replacement file`,replace:`Replace`,replacing:`Replacing...`,replaceError:`Failed to replace file`,saving:`Saving...`,cropAspectRatio:`Aspect Ratio`,cropFree:`Free`,cropSquare:`1:1`,cropLandscape43:`4:3`,cropLandscape169:`16:9`,cropOriginal:`Original`,cropMaxWidth:`Max Width`,cropMaxHeight:`Max Height`,cropOutputSize:`Output Size`,cropPixels:`px`,cropOptional:`(optional)`,storageTooltip:`{used} of {total} used ({remaining} remaining)`},testEmail:{title:`Send Test Email`,recipientLabel:`Recipient`,send:`Send`,sending:`Sending...`,cancel:`Cancel`,success:`Test email sent successfully`,button:`Test`},aiRewrite:{title:`AI Rewrite`,tone:`Tone`,length:`Length`,clarity:`Clarity`,professional:`Professional`,casual:`Casual`,friendly:`Friendly`,urgent:`Urgent`,persuasive:`Persuasive`,shorter:`Shorter`,longer:`Longer`,summarize:`Summarize`,simplify:`Simplify`,fixGrammar:`Fix grammar`,improveReadability:`Improve readability`,customInstruction:`Custom instruction`,customPlaceholder:`Describe how to rewrite...`,rewrite:`Rewrite`,rewriting:`Rewriting...`,undo:`Undo`,redo:`Redo`,refine:`Refine further`,error:`Failed to rewrite text`},aiChat:{title:`AI Assistant`,button:`AI`,inputPlaceholder:`Describe your email template...`,send:`Send`,generating:`Generating...`,applied:`Changes applied to template.`,applyFailed:`Could not apply changes to template. Please try again.`,revert:`Revert changes`,reapply:`Re-apply changes`,error:`Failed to generate template`,clear:`Clear chat`,placeholder:`Describe the email template you want to create, or ask to modify the current one.`,loadingHistory:`Loading conversation...`},scoring:{button:`Score`,title:`Template Score`,rescore:`Re-score`,scoring:`Analyzing template...`,overallScore:`Overall Score`,categories:{spam:`Spam Risk`,readability:`Readability`,accessibility:`Accessibility`,bestPractices:`Best Practices`},severity:{high:`High`,medium:`Medium`,low:`Low`},fix:`Fix with AI`,fixing:`Fixing...`,fixed:`Fixed`,findings:`findings`,noFindings:`No issues found`,error:`Failed to analyze template`,fixError:`Failed to apply fix`,emptyState:`Score your template to get actionable feedback on spam risk, readability, accessibility, and best practices.`},aiMenu:{aiAssistant:`AI Assistant`,aiAssistantDesc:`Chat with AI to create or modify your template`,designToTemplate:`Design to Template`,designToTemplateDesc:`Generate a template from an image or PDF`,templateScore:`Template Score`,templateScoreDesc:`Analyze quality, spam risk, and accessibility`,disclaimer:`AI can make mistakes. Please verify before approving.`},comments:{title:`Comments`,placeholder:`Write a comment...`,replyPlaceholder:`Write a reply...`,reply:`Reply`,resolve:`Resolve`,unresolve:`Unresolve`,resolved:`Resolved`,delete:`Delete`,edit:`Edit`,cancel:`Cancel`,save:`Save`,noComments:`No comments yet`,noCommentsHint:`Start a conversation by adding a comment to the template or a specific block.`,addComment:`Add comment`,deleteConfirm:`Delete this comment?`,filterAll:`All`,filterUnresolved:`Unresolved`,filterBlock:`This block`,ownedByYou:`You`,edited:`edited`,resolvedBy:`Resolved by {name}`,replyOne:`{count} Reply`,replyMany:`{count} Replies`,missingBlock:`Missing block`,saveTemplateFirst:`Save the template before commenting on this block.`,button:`Comments`},collaboration:{connected:`Collaboration mode active`,disconnected:`Collaboration disconnected`,reconnecting:`Reconnecting...`,blockLockedBy:`Editing by {name}`,usersOnline:`{count} users online`},sidebarNav:{browseModules:`Browse saved modules`,expandSidebar:`Expand block sidebar`,palette:`Block palette`,insertBlock:`Insert {block} block`},landmarks:{canvas:`Email canvas`,blockToolbar:`Block properties`,rightSidebar:`Block properties and template settings`,reorderAnnouncements:`Block reorder announcements`},modules:{title:`Saved Modules`,saveAsModule:`Save as Module`,moduleName:`Module Name`,moduleNamePlaceholder:`e.g. Header, Footer, CTA...`,selectBlocks:`Select Blocks`,save:`Save Module`,saving:`Saving...`,cancel:`Cancel`,noModules:`No saved modules yet`,noModulesHint:`Save blocks from your templates to reuse them later.`,search:`Search modules...`,insert:`Insert`,delete:`Delete`,deleteConfirm:`Delete this module?`,blockCount:`{count} block(s)`,browse:`Browse Modules`,selectToPreview:`Select a module to preview`,insertAtBeginning:`At beginning`,insertAfterBlock:`After {block}`,insertAtEnd:`At end`,insertPosition:`Insert position`,close:`Close`},designReference:{title:`Design Reference`,button:`Design`,uploadImage:`Image`,uploadPdf:`PDF`,dropHint:`Drop a file here or click to browse`,acceptedImages:`PNG, JPG, WebP (max 10MB)`,acceptedPdf:`PDF (max 10MB)`,promptLabel:`Instructions (optional)`,promptPlaceholder:`Describe any adjustments or preferences for the generated template...`,generate:`Generate from design`,generating:`Analyzing design and generating template...`,replaceWarning:`Generating from a design reference will replace the existing template content.`,replaceConfirm:`Replace and generate`,replaceCancel:`Cancel`,error:`Failed to generate template from design`,fileTooLarge:`File is too large. Maximum size is 10MB.`,invalidFileType:`This file type is not supported. Upload a PNG, JPG, WebP, or PDF.`},errors:{editorLoading:`Loading editor...`,editorLoadFailed:`Failed to load editor.`,retry:`Retry`}}})),dX=[`en`,`de`];function fX(e){return e.split(`-`)[0].toLowerCase()}async function pX(e){let t=fX(e),n=dX.includes(t)?t:`en`;return(await iX(Object.assign({"./locales/de.ts":()=>Promise.resolve().then(()=>(sX(),aX)),"./locales/en.ts":()=>Promise.resolve().then(()=>(uX(),cX))}),`./locales/${n}.ts`,3)).default}function mX(e){let{authManager:n,editor:r,history:a,conditionPreview:o,autoSave:s,onError:c}=e,l=(0,t.shallowRef)(null),u=(0,t.ref)(null),d=(0,t.ref)(null),f=(0,t.computed)(()=>u.value!==null),p=(0,t.computed)(()=>l.value?.snapshots.value??[]),m=(0,t.computed)(()=>l.value?.isLoading.value??!1),h=(0,t.computed)(()=>l.value?.isRestoring.value??!1);function g(){r.state.template?.id&&!l.value&&(l.value=(0,i.useSnapshotHistory)({authManager:n,templateId:r.state.template.id,onRestore:_,onError:c}),l.value.loadSnapshots())}function _(e){r.setContent(e.content,!1),a.clear(),o.reset()}async function v(e){if(u.value){u.value=e,r.setContent(e.content,!1);return}r.state.isDirty&&r.hasTemplate()&&await r.createSnapshot(),d.value=structuredClone(r.content.value),s?.pause(),u.value=e,r.setContent(e.content,!1)}async function y(){if(!(!u.value||!l.value))try{await l.value.restoreSnapshot(u.value.id),await l.value.loadSnapshots()}finally{u.value=null,d.value=null,s?.resume()}}function b(){!u.value||!d.value||(r.setContent(d.value,!1),u.value=null,d.value=null,s?.resume())}async function x(){l.value&&await l.value.loadSnapshots()}return{snapshotHistoryInstance:l,previewingSnapshot:u,contentBeforePreview:d,isPreviewingSnapshot:f,snapshotHistorySnapshots:p,snapshotHistoryIsLoading:m,snapshotHistoryIsRestoring:h,initSnapshotHistory:g,handleRestore:_,handleSnapshotNavigate:v,confirmRestoreSnapshot:y,cancelPreview:b,loadSnapshotHistory:x}}var hX=d((()=>{}));function gX(){let e=(0,t.ref)(null),n=(0,t.computed)({get:()=>e.value===`ai-chat`,set:t=>e.value=t?`ai-chat`:null}),r=(0,t.computed)({get:()=>e.value===`scoring`,set:t=>e.value=t?`scoring`:null}),i=(0,t.computed)({get:()=>e.value===`design-reference`,set:t=>e.value=t?`design-reference`:null}),a=(0,t.computed)({get:()=>e.value===`comments`,set:t=>e.value=t?`comments`:null}),o=(0,t.ref)(!1),s=(0,t.ref)(!1),c=(0,t.ref)(void 0),l=(0,t.ref)(!1),u=(0,t.ref)(null),d=(0,t.computed)(()=>e.value!==null),f=(0,t.computed)(()=>{let t=e.value;return t===`ai-chat`||t===`design-reference`||t===`scoring`?t:null}),p=(0,t.computed)(()=>l.value||e.value===`ai-chat`||e.value===`design-reference`||e.value===`scoring`);function m(){l.value=!l.value}function h(t){l.value=!1,e.value=e.value===t?null:t}return _e(u,()=>{l.value=!1}),{activePanel:e,aiChatOpen:n,scoringPanelOpen:r,designReferenceOpen:i,commentsOpen:a,testEmailModalOpen:o,mediaLibraryOpen:s,mediaLibraryAccept:c,aiMenuOpen:l,aiMenuRef:u,rightPanelOpen:d,activeAiFeature:f,aiButtonActive:p,toggleAiMenu:m,handleAiFeatureSelect:h}}var _X=d((()=>{Oe()}));function vX(e){let{isCollaborationEnabled:n,getCollaboratorCount:r,canUndo:i}=e,a=(0,t.ref)(!1),o=(0,t.ref)(!1),{start:s}=re(()=>{o.value=!1},v,{immediate:!1});function c(){a.value||!n.value||r()===0||!i.value||(a.value=!0,o.value=!0,s())}return{collabUndoWarningVisible:o,showCollabUndoWarning:c}}var yX=d((()=>{Oe()}));function bX(e){let{planConfigInstance:n,aiConfig:r,editor:i}=e,a=(0,t.computed)(()=>n.hasFeature(`ai_generation`)&&r.hasAnyMenuFeature.value),o=(0,t.computed)(()=>n.hasFeature(`test_email`)),s=(0,t.computed)(()=>!!i.state.template?.id),c=(0,t.computed)(()=>n.hasFeature(`white_label`)),l=(0,t.computed)(()=>n.config.value?.limits.max_templates??null),u=(0,t.computed)(()=>n.config.value?.template_count??0),d=(0,t.ref)(!1),f=(0,t.ref)(`idle`),p=(0,t.ref)(``),{start:m}=re(()=>{f.value=`idle`},3e3,{immediate:!1});return{canUseAiGeneration:a,canSendTestEmail:o,hasTemplateSaved:s,isWhiteLabeled:c,templateLimit:l,templateCount:u,isSaveExporting:d,saveStatus:f,saveErrorMessage:p,startSaveStatusClear:m}}var xX=d((()=>{Oe()}));function SX(e){let{onRequestMedia:n,mediaLibraryOpen:r,mediaLibraryAccept:i}=e,a=null;async function o(){if(n){let e=await n({accept:[`images`]});return e?{url:e.url,alt:e.alt_text||void 0}:null}return i.value=[`images`],r.value=!0,new Promise(e=>{a=t=>{e(t)}})}function s(e){r.value=!1,a?.({url:e.url,alt:e.alt_text||void 0}),a=null}function c(){r.value=!1,a?.(null),a=null}return(0,t.onScopeDispose)(()=>{a&&=(a(null),null)}),{handleRequestMedia:o,handleMediaSelect:s,handleMediaLibraryClose:c}}var CX=d((()=>{}));function wX(e){let{config:n,translations:r,fontsManager:a,emit:o,getCommentsSidebar:s}=e,c=(0,t.ref)(!0),l=(0,t.ref)(!1),u=(0,t.ref)(null),d=!1,f={value:null},p=null,m=null,h=new i.AuthManager({...n.auth,onError:n.onError}),g=(0,i.usePlanConfig)({authManager:h,onError:n.onError}),_=(0,t.ref)(new Map),v=(0,i.useEditor)({authManager:h,defaultFontFamily:n.fonts?.defaultFont,templateDefaults:n.templateDefaults,onError:n.onError,lockedBlocks:_}),y=(0,i.useWebSocket)({authManager:h,onError:n.onError});n.mcp?.enabled&&(0,i.useMcpListener)({editor:v,channel:y.channel,onOperation:n.mcp.onOperation});let b=null;n.collaboration?.enabled&&(b=(0,i.useCollaboration)({authManager:h,editor:v,channel:y.channel,onError:n.onError,onCollaboratorJoined:n.collaboration.onCollaboratorJoined,onCollaboratorLeft:n.collaboration.onCollaboratorLeft,onBlockLocked:n.collaboration.onBlockLocked,onBlockUnlocked:n.collaboration.onBlockUnlocked}),(0,t.watch)(()=>b.lockedBlocks.value,e=>{_.value=e},{immediate:!0}),(0,i.useCollaborationBroadcast)(v,b));let x=(0,t.computed)(()=>!!n.collaboration?.enabled&&g.hasFeature(`collaboration`)),S=aB({editor:v,config:{uiTheme:n.uiTheme,theme:void 0,blockDefaults:n.blockDefaults,customBlocks:[],mergeTags:n.mergeTags,displayConditions:n.displayConditions,onRequestMedia:null,onSave:()=>{f.value?.().catch(e=>{n.onError?.(e)})}},translations:r,fontsManager:a,historyOptions:b?{isRemoteOperation:()=>b._isProcessingRemoteOperation()}:void 0,autoSaveOptions:{onChange:async()=>{v.hasTemplate()&&(await v.createSnapshot(),p?.snapshotHistoryInstance.value?.loadSnapshots())},debounce:n.autoSaveDebounce??5e3,enabled:()=>n.autoSave!==!1&&g.hasFeature(`auto_save`)},themeExtraStyles:()=>({"--tpl-drop-text":`"${r.canvas.dropHere}"`}),keyboardOptions:{onBeforeUndo:()=>m?.showCollabUndoWarning()}}),C=vX({isCollaborationEnabled:x,getCollaboratorCount:()=>b?.collaborators.value.length??0,canUndo:S.history.canUndo});m=C;let ee=mX({authManager:h,editor:v,history:S.history,conditionPreview:S.conditionPreview,autoSave:S.autoSave,onError:n.onError});p=ee;let w=gX(),T=(0,i.useAiConfig)(n.ai),te=bX({planConfigInstance:g,aiConfig:T,editor:v}),E=SX({onRequestMedia:n.onRequestMedia,mediaLibraryOpen:w.mediaLibraryOpen,mediaLibraryAccept:w.mediaLibraryAccept});Dp({onBlockMove:v.moveBlock,onBlockAdd:v.addBlock});let ne=(0,i.useExport)({authManager:h,getFontsConfig:()=>n.fonts,canUseCustomFonts:()=>g.hasFeature(`custom_fonts`)}),re=(0,i.useTestEmail)({authManager:h,getTemplateId:()=>v.state.template?.id??null,save:()=>v.save(),exportHtml:e=>ne.exportHtml(e),onError:n.onError,isAuthReady:l,onBeforeTestEmail:n.onBeforeTestEmail}),ie=(0,i.useComments)({authManager:h,getTemplateId:()=>v.state.template?.id??null,getSocketId:()=>y.getSocketId(),onComment:n.onComment,onError:n.onError,isAuthReady:l,hasCommentingFeature:()=>n.commenting!==!1&&g.hasFeature(`commenting`)});(0,i.useCommentListener)({comments:ie,channel:y.channel});let ae=(0,i.useSavedModules)({authManager:h,onError:n.onError}),oe=(0,t.ref)(!1),se=(0,t.ref)(null),ce=(0,t.ref)(!1),le=(0,i.useTemplateScoring)({authManager:h,getTemplateId:()=>v.state.template?.id??null});function ue(e){w.commentsOpen.value=!0,queueMicrotask(()=>{s()?.filterByBlock(e)})}(0,t.provide)(We,E.handleRequestMedia),(0,t.provide)(Ye,h),(0,t.provide)(Xe,T),(0,t.provide)(Ze,ie),(0,t.provide)(Qe,ae),(0,t.provide)($e,le),(0,t.provide)(qe,{plan:g,ai:T,comments:{getBlockCount:e=>ie.commentCountByBlock.value.get(e)??0,openForBlock:ue},savedModules:{openSaveDialog:e=>{se.value=e??null,oe.value=!0},openBrowser:()=>{ce.value=!0},moduleCount:(0,t.computed)(()=>ae.modules.value.length)}});function de(e){g.hasFeature(`theme_customization`)&&(S.themeOverrides.value=e)}function fe(e){v.setUiTheme(e)}async function pe(){c.value=!0,u.value=null;try{if(await h.initialize(),d)return;l.value=!0;let e=await(0,i.performHealthCheck)({authManager:h});if(d)return;if(!e.api.ok)throw Error(`Health check failed: API is not reachable`);if(!e.auth.ok)throw Error(`Health check failed: authentication error${e.auth.error?` - ${e.auth.error}`:``}`);if(e.websocket.ok||dt.warn(`WebSocket health check failed:`,e.websocket.error??`unknown error`,`-- real-time features will be disabled.`),await g.fetchConfig(),d)return;a.setCustomFontsEnabled(g.hasFeature(`custom_fonts`)),n.customBlocks?.length&&g.hasFeature(`custom_blocks`)&&S.registerCustomBlocks(n.customBlocks),n.theme&&g.hasFeature(`theme_customization`)&&(S.themeOverrides.value=n.theme),n.modules!==!1&&g.hasFeature(`saved_modules`)&&ae.loadModules(),o(`ready`)}catch(e){if(d)return;let t=e instanceof Error?e:Error(`Initialization failed`,{cause:e});u.value=t,n.onError?.(t)}finally{d||(c.value=!1)}}function me(){d=!0,a.cleanupFontLinks(),y.disconnect(),S.destroy(),n.onUnmount?.()}return{isInitializing:c,isAuthReady:l,initError:u,isDestroyed:()=>d,authManager:h,planConfigInstance:g,websocket:y,collaboration:b,isCollaborationEnabled:x,editor:v,core:S,aiConfig:T,featureFlags:te,mediaLib:E,exporter:ne,testEmail:re,commentsInstance:ie,savedModulesHeadless:ae,scoringInstance:le,panelState:w,snapshotPreview:ee,collabWarning:C,showSaveModuleDialog:oe,showModuleBrowserModal:ce,saveModulePreSelectedBlockId:se,onSaveHook:f,initialize:pe,destroy:me,setThemeOverrides:de,setUiTheme:fe,openCommentsForBlock:ue}}var TX=d((()=>{sB(),Op(),D(),y(),ft(),hX(),_X(),yX(),xX(),CX()}));async function EX(e,t){let n=async e=>{if((0,r.isCustomBlock)(e)){let n=e;try{n.renderedHtml=await t.renderCustomBlock(n)}catch{n.renderedHtml=`<!-- Custom block render error: ${n.customType} -->`}}if(e.type===`section`&&`children`in e){let t=e;for(let e of t.children)for(let t of e)await n(t)}};for(let t of e.blocks)await n(t)}var DX=d((()=>{}));function OX(e){let{config:t,editor:n,websocket:r,planConfigInstance:a,snapshotPreview:o,core:s,exporter:c,featureFlags:l,isDestroyed:u}=e;function d(){return(0,i.resolveWebSocketConfig)(a.config.value.websocket)}async function f(e){let i=await n.create(e);return u()?i:(t.onCreate?.(i),o.initSnapshotHistory(),r.connect(i.id,d()),i)}async function p(e){let i=await n.load(e);return u()?i:(t.onLoad?.(i),o.initSnapshotHistory(),r.connect(i.id,d()),i)}async function m(){l.isSaveExporting.value=!0,l.saveStatus.value=`idle`;try{if(await EX(n.content.value,s.registry),u())throw Error(`Component unmounted during save`);let e=await n.save();if(u())throw Error(`Component unmounted during save`);o.initSnapshotHistory(),o.snapshotHistoryInstance.value?.loadSnapshots();let r=await c.exportHtml(e.id);if(u())throw Error(`Component unmounted during save`);let i={templateId:e.id,html:r.html,mjml:r.mjml,content:e.content};return t.onSave?.(i),l.saveStatus.value=`saved`,l.startSaveStatusClear(),i}catch(e){throw u()||(l.saveStatus.value=`error`,l.saveErrorMessage.value=e instanceof Error?e.message:`Save failed`),e}finally{u()||(l.isSaveExporting.value=!1)}}return{createTemplate:f,loadTemplate:p,saveTemplate:m}}var kX=d((()=>{DX()})),AX,jX,MX,NX,PX,FX,IX,LX=d((()=>{Rp(),F(),fB(),AX={class:`tpl-collaborator-bar tpl:flex tpl:items-center tpl:gap-2`},jX=[`title`],MX={key:0,class:`tpl:flex tpl:items-center tpl:-space-x-1.5`},NX=[`title`],PX=[`title`],FX=3,IX=(0,t.defineComponent)({__name:`CollaboratorBar`,props:{collaborators:{},isConnected:{type:Boolean}},setup(e){let n=e,{t:r}=O(),i=(0,t.computed)(()=>n.collaborators.slice(0,FX)),a=(0,t.computed)(()=>n.collaborators.slice(FX)),o=(0,t.computed)(()=>a.value.length),s=(0,t.computed)(()=>a.value.map(e=>e.name).join(`
175
- `));function c(e){let t=e.trim().split(/\s+/);return t.length>=2?(t[0].charAt(0)+t[t.length-1].charAt(0)).toUpperCase():e.charAt(0).toUpperCase()}return(n,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,AX,[(0,t.createElementVNode)(`div`,{class:`tpl:flex tpl:items-center tpl:gap-1 tpl:text-[11px]`,style:(0,t.normalizeStyle)({color:e.isConnected?`var(--tpl-success)`:`var(--tpl-text-muted)`}),title:e.isConnected?(0,t.unref)(r).collaboration.connected:(0,t.unref)(r).collaboration.disconnected},[e.isConnected?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Yf),{key:0,size:12,"stroke-width":2})):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Kf),{key:1,size:12,"stroke-width":2}))],12,jX),e.collaborators.length>0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,MX,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(i.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.id,class:`tpl-collaborator-avatar tpl:relative tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-2 tpl:text-[10px] tpl:font-bold tpl:transition-transform tpl:duration-150 tpl:hover:z-10 tpl:hover:scale-110 tpl:border-[var(--tpl-bg)]`,style:(0,t.normalizeStyle)({backgroundColor:e.color,color:(0,t.unref)(cB)(e.color)}),title:e.name},(0,t.toDisplayString)(c(e.name)),13,NX))),128)),o.value>0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`tpl:relative tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-2 tpl:text-[9px] tpl:font-bold tpl:border-[var(--tpl-bg)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)]`,title:s.value},` +`+(0,t.toDisplayString)(o.value),9,PX)):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0)]))}})})),RX=p({default:()=>zX}),zX,BX=d((()=>{LX(),LX(),zX=IX}));function VX(e,t,n,r){let i=new Date(e),a=Date.now()-i.getTime(),o=Math.floor(a/HX),s=Math.floor(a/UX),c=Math.floor(a/WX);return o<1?t.justNow:o<60?n?n(t.minutesAgo,{minutes:o}):t.minutesAgo.replace(`{minutes}`,String(o)):s<24?n?n(t.hoursAgo,{hours:s}):t.hoursAgo.replace(`{hours}`,String(s)):r!==void 0&&c>=r?null:n?n(t.daysAgo,{days:c}):t.daysAgo.replace(`{days}`,String(c))}var HX,UX,WX,GX=d((()=>{HX=6e4,UX=36e5,WX=864e5})),KX,qX,JX,YX,XX,ZX,QX,$X,eZ,tZ,nZ,rZ,iZ,aZ=d((()=>{Rp(),GX(),Oe(),F(),KX=[`disabled`,`title`],qX=[`title`],JX={key:0,class:`tpl-scale-in tpl:absolute tpl:top-full tpl:left-1/2 tpl:z-50 tpl:mt-2 tpl:w-72 tpl:-translate-x-1/2 tpl:overflow-hidden tpl:rounded-[var(--tpl-radius)] tpl:bg-[var(--tpl-bg-elevated)] tpl:border tpl:border-[var(--tpl-border)] tpl:shadow-[var(--tpl-shadow-lg)]`,style:{"backdrop-filter":`blur(8px)`,"-webkit-backdrop-filter":`blur(8px)`}},YX={class:`tpl:border-b tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-semibold tpl:text-[var(--tpl-text)] tpl:border-[var(--tpl-border)]`},XX={key:0,class:`tpl:flex tpl:items-center tpl:justify-center tpl:py-8`},ZX={key:1,class:`tpl:px-3 tpl:py-6 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-muted)]`},QX={key:2,class:`tpl:max-h-64 tpl:overflow-y-auto`},$X=[`disabled`,`onClick`],eZ={class:`tpl:flex tpl:flex-col tpl:gap-0.5`},tZ={class:`tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)]`},nZ={key:0,class:`tpl:rounded tpl:px-1 tpl:py-0.5 tpl:text-[10px] tpl:font-normal tpl:bg-[var(--tpl-bg-active)] tpl:text-[var(--tpl-text-muted)]`},rZ=[`disabled`,`title`],iZ=(0,t.defineComponent)({__name:`SnapshotHistory`,props:{snapshots:{},isLoading:{type:Boolean},isRestoring:{type:Boolean}},emits:[`load`,`navigate`],setup(e,{emit:n}){let r=e,i=n,{t:a,format:o}=O(),s=(0,t.ref)(!1),c=(0,t.ref)(null),l=(0,t.ref)(-1);(0,t.watch)(()=>r.snapshots.length,()=>{l.value=-1});let u=(0,t.computed)(()=>l.value>0&&r.snapshots.length>0&&!r.isRestoring),d=(0,t.computed)(()=>l.value<r.snapshots.length-1&&r.snapshots.length>0&&!r.isRestoring);function f(){u.value&&(l.value--,i(`navigate`,r.snapshots[l.value]))}function p(){d.value&&(l.value++,i(`navigate`,r.snapshots[l.value]))}function m(){s.value=!s.value,s.value&&r.snapshots.length===0&&i(`load`)}function h(e){let t=r.snapshots.findIndex(t=>t.id===e);t!==-1&&(l.value=t,i(`navigate`,r.snapshots[t])),s.value=!1}function g(e){let t=VX(e,a.snapshotHistory,o,7);return t===null?new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}):t}return _e(c,()=>{s.value=!1}),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{ref_key:`dropdownRef`,ref:c,class:`tpl:relative tpl:flex tpl:items-center tpl:gap-0.5`},[(0,t.createElementVNode)(`button`,{class:`tpl:flex tpl:size-7 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:transition-colors tpl:duration-150 hover:tpl:bg-[var(--tpl-bg-hover)] disabled:tpl:cursor-not-allowed disabled:tpl:opacity-30 disabled:hover:tpl:bg-transparent tpl:text-[var(--tpl-text-muted)]`,disabled:!d.value,title:(0,t.unref)(a).snapshotHistory.olderSnapshot,onClick:(0,t.withModifiers)(p,[`stop`])},[(0,t.createVNode)((0,t.unref)(Nc),{size:14,"stroke-width":2})],8,KX),(0,t.createElementVNode)(`button`,{class:`tpl:flex tpl:h-7 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:gap-0.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:px-1.5 tpl:transition-colors tpl:duration-150 hover:tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)]`,title:(0,t.unref)(a).snapshotHistory.tooltip,onClick:(0,t.withModifiers)(m,[`stop`])},[(0,t.createVNode)((0,t.unref)(Zc),{size:16,"stroke-width":1.5}),(0,t.createVNode)((0,t.unref)(Ac),{class:(0,t.normalizeClass)([`tpl:transition-transform tpl:duration-150`,{"tpl:rotate-180":s.value}]),size:10,"stroke-width":2},null,8,[`class`])],8,qX),(0,t.createVNode)(t.Transition,{name:`tpl-dropdown`},{default:(0,t.withCtx)(()=>[s.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,JX,[(0,t.createElementVNode)(`div`,YX,(0,t.toDisplayString)((0,t.unref)(a).snapshotHistory.dropdownTitle),1),e.isLoading?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,XX,[(0,t.createVNode)((0,t.unref)(eu),{class:`tpl:animate-spin tpl:text-[var(--tpl-primary)]`,size:20,"stroke-width":2})])):e.snapshots.length===0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ZX,(0,t.toDisplayString)((0,t.unref)(a).snapshotHistory.noSnapshots),1)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,QX,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.snapshots,n=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:n.id,class:`tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:border-b tpl:border-b-[var(--tpl-border-light)] tpl:border-l-2 tpl:border-l-transparent tpl:px-3 tpl:py-2.5 tpl:text-left tpl:transition-all tpl:duration-150 last:tpl:border-b-0 hover:tpl:border-l-[var(--tpl-primary)] hover:tpl:bg-[var(--tpl-bg-hover)]`,style:{"background-color":`transparent`},disabled:e.isRestoring,onClick:e=>h(n.id)},[(0,t.createElementVNode)(`div`,eZ,[(0,t.createElementVNode)(`div`,tZ,[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(g(n.created_at)),1),n.is_autosave?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,nZ,(0,t.toDisplayString)((0,t.unref)(a).snapshotHistory.auto),1)):(0,t.createCommentVNode)(``,!0)])])],8,$X))),128))]))])):(0,t.createCommentVNode)(``,!0)]),_:1}),(0,t.createElementVNode)(`button`,{class:`tpl:flex tpl:size-7 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:transition-colors tpl:duration-150 hover:tpl:bg-[var(--tpl-bg-hover)] disabled:tpl:cursor-not-allowed disabled:tpl:opacity-30 disabled:hover:tpl:bg-transparent tpl:text-[var(--tpl-text-muted)]`,disabled:!u.value,title:(0,t.unref)(a).snapshotHistory.newerSnapshot,onClick:(0,t.withModifiers)(f,[`stop`])},[(0,t.createVNode)((0,t.unref)(zc),{size:14,"stroke-width":2})],8,rZ)],512))}})})),oZ=p({default:()=>sZ}),sZ,cZ=d((()=>{aZ(),aZ(),sZ=iZ})),lZ,uZ,dZ,fZ,pZ,mZ,hZ=d((()=>{Rp(),D(),F(),lZ={class:`tpl-ai-feature-menu tpl:w-[280px] tpl:overflow-hidden tpl:rounded-[var(--tpl-radius)] tpl:py-1 tpl:bg-[var(--tpl-bg-elevated)] tpl:border tpl:border-[var(--tpl-border)] tpl:shadow-[var(--tpl-shadow-lg)]`,style:{"backdrop-filter":`blur(8px)`,"-webkit-backdrop-filter":`blur(8px)`}},uZ=[`onClick`],dZ={class:`tpl:flex tpl:min-w-0 tpl:flex-col tpl:gap-0.5`},fZ={class:`tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text)]`},pZ={class:`tpl:text-xs tpl:leading-snug tpl:text-[var(--tpl-text-muted)]`},mZ=(0,t.defineComponent)({__name:`AiFeatureMenu`,props:{activeFeature:{}},emits:[`select`],setup(e,{emit:n}){let r=n,{t:i}=O(),a=ke(Xe,`AiFeatureMenu`),o={"ai-chat":`chat`,"design-reference":`designToTemplate`,scoring:`scoring`},s=[{key:`ai-chat`,icon:Hd},{key:`design-reference`,icon:Al},{key:`scoring`,icon:Ad}],c=(0,t.computed)(()=>s.filter(e=>a.isFeatureEnabled(o[e.key])));function l(e){return e===`ai-chat`?i.aiMenu.aiAssistant:e===`design-reference`?i.aiMenu.designToTemplate:i.aiMenu.templateScore}function u(e){return e===`ai-chat`?i.aiMenu.aiAssistantDesc:e===`design-reference`?i.aiMenu.designToTemplateDesc:i.aiMenu.templateScoreDesc}return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,lZ,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(c.value,n=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:n.key,class:`tpl-ai-feature-menu-item tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-start tpl:gap-3 tpl:border-none tpl:px-3 tpl:py-2.5 tpl:text-left tpl:transition-colors tpl:duration-100`,style:(0,t.normalizeStyle)({backgroundColor:e.activeFeature===n.key?`var(--tpl-primary-light)`:`transparent`}),onClick:e=>r(`select`,n.key)},[(0,t.createElementVNode)(`div`,{class:`tpl:mt-0.5 tpl:flex tpl:size-7 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)]`,style:(0,t.normalizeStyle)({backgroundColor:e.activeFeature===n.key?`var(--tpl-primary)`:`var(--tpl-bg-active)`,color:e.activeFeature===n.key?`var(--tpl-bg)`:`var(--tpl-text-muted)`})},[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(n.icon),{size:15,"stroke-width":2}))],4),(0,t.createElementVNode)(`div`,dZ,[(0,t.createElementVNode)(`span`,fZ,(0,t.toDisplayString)(l(n.key)),1),(0,t.createElementVNode)(`span`,pZ,(0,t.toDisplayString)(u(n.key)),1)])],12,uZ))),128))]))}})})),gZ=d((()=>{})),_Z=p({default:()=>vZ}),vZ,yZ=d((()=>{hZ(),hZ(),gZ(),dp(),vZ=up(mZ,[[`__scopeId`,`data-v-638e1be2`]])})),bZ,xZ,SZ,CZ,wZ,TZ,EZ,DZ,OZ,kZ,AZ,jZ,MZ,NZ,PZ,FZ,IZ,LZ,RZ=d((()=>{F(),yh(),OY(),PY(),BY(),bZ={class:`tpl-header tpl:absolute tpl:top-0 tpl:right-0 tpl:left-0 tpl:z-50 tpl:grid tpl:h-14 tpl:grid-cols-[1fr_auto_1fr] tpl:items-center tpl:px-4`,style:{"background-color":`color-mix(in srgb, var(--tpl-bg) 80%, transparent)`,"backdrop-filter":`blur(12px)`,"-webkit-backdrop-filter":`blur(12px)`,"box-shadow":`var(--tpl-shadow-md)`,"border-bottom":`1px solid var(--tpl-border)`}},xZ={class:`tpl-header-left tpl:flex tpl:min-w-[200px] tpl:items-center tpl:gap-3`},SZ={key:0,class:`tpl-logo tpl:flex tpl:items-center tpl:gap-2.5 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]`},CZ=[`src`],wZ={style:{"letter-spacing":`-0.01em`}},TZ={key:1,class:`tpl:text-xs tpl:opacity-60 tpl:text-[var(--tpl-text-muted)]`},EZ={class:`tpl-header-center tpl:flex tpl:items-center tpl:justify-center tpl:gap-10`},DZ={class:`tpl-header-right tpl:flex tpl:min-w-[200px] tpl:items-center tpl:justify-end tpl:gap-3`},OZ=[`data-tooltip`],kZ={key:1,"aria-live":`polite`,class:`tpl-status tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-success)]`},AZ={key:2,"aria-live":`polite`,class:`tpl-status tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-text-muted)]`},jZ=[`aria-label`,`aria-expanded`],MZ={key:0,class:`tpl:inline-flex tpl:size-4.5 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-[10px] tpl:font-semibold tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]`},NZ=[`aria-expanded`],PZ={key:0,class:`tpl:absolute tpl:right-0 tpl:top-full tpl:z-50 tpl:mt-1 tpl:origin-top-right`},FZ=[`disabled`],IZ=[`disabled`],LZ=(0,t.defineComponent)({__name:`CloudHeader`,props:{editor:{},core:{},authManager:{},featureFlags:{},panelState:{},snapshotPreview:{},commentsInstance:{},testEmail:{},websocket:{},collaboration:{},isCollaborationEnabled:{type:Boolean},isSaveDisabled:{type:Boolean},isSaving:{type:Boolean}},emits:[`save`],setup(e){let n=(0,t.defineAsyncComponent)(()=>Promise.resolve().then(()=>(BX(),RX))),r=(0,t.defineAsyncComponent)(()=>Promise.resolve().then(()=>(cZ(),oZ))),i=(0,t.defineAsyncComponent)(()=>Promise.resolve().then(()=>(yZ(),_Z)));return(a,o)=>((0,t.openBlock)(),(0,t.createElementBlock)(`header`,bZ,[(0,t.createElementVNode)(`div`,xZ,[e.featureFlags.isWhiteLabeled.value?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,SZ,[(0,t.createElementVNode)(`img`,{src:e.authManager.resolveUrl(`/logo.svg`),alt:`Templatical`,width:`24`,height:`24`,class:`tpl:shrink-0`},null,8,CZ),(0,t.createElementVNode)(`span`,wZ,(0,t.toDisplayString)(e.core.t.header.title),1)])),e.featureFlags.templateLimit.value===null?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,TZ,(0,t.toDisplayString)(e.core.format(e.core.t.header.templatesUsed,{used:e.featureFlags.templateCount.value,max:e.featureFlags.templateLimit.value})),1))]),(0,t.createElementVNode)(`div`,EZ,[(0,t.createVNode)(DY,{viewport:e.editor.state.viewport,onChange:e.editor.setViewport},null,8,[`viewport`,`onChange`]),(0,t.createVNode)(zY,{"dark-mode":e.editor.state.darkMode,onChange:e.editor.setDarkMode},null,8,[`dark-mode`,`onChange`]),(0,t.createVNode)(NY,{"preview-mode":e.editor.state.previewMode,onChange:e.editor.setPreviewMode},null,8,[`preview-mode`,`onChange`]),e.collaboration&&e.isCollaborationEnabled?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n),{key:0,collaborators:e.collaboration.collaborators.value,"is-connected":e.websocket.isConnected.value},null,8,[`collaborators`,`is-connected`])):(0,t.createCommentVNode)(``,!0),e.snapshotPreview.snapshotHistoryInstance.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(r),{key:1,snapshots:e.snapshotPreview.snapshotHistorySnapshots.value,"is-loading":e.snapshotPreview.snapshotHistoryIsLoading.value,"is-restoring":e.snapshotPreview.snapshotHistoryIsRestoring.value,onLoad:e.snapshotPreview.loadSnapshotHistory,onNavigate:e.snapshotPreview.handleSnapshotNavigate},null,8,[`snapshots`,`is-loading`,`is-restoring`,`onLoad`,`onNavigate`])):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`div`,DZ,[e.featureFlags.saveStatus.value===`error`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,"aria-live":`assertive`,class:`tpl-tooltip tpl-status tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-danger)]`,"data-tooltip":e.featureFlags.saveErrorMessage.value},[(0,t.createVNode)((0,t.unref)(Hc),{size:12,"stroke-width":2.5}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.core.t.header.saveFailed),1)],8,OZ)):e.featureFlags.saveStatus.value===`saved`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,kZ,[(0,t.createVNode)((0,t.unref)(Dc),{size:12,"stroke-width":2.5}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.core.t.header.saved),1)])):e.editor.state.isDirty?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,AZ,[o[4]||=(0,t.createElementVNode)(`span`,{class:`tpl-pulse tpl:size-1.5 tpl:rounded-full tpl:bg-[var(--tpl-primary)]`},null,-1),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.core.t.header.unsaved),1)])):(0,t.createCommentVNode)(``,!0),e.commentsInstance.isEnabled.value&&e.featureFlags.hasTemplateSaved.value?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:3,"aria-label":e.commentsInstance.unresolvedCount.value>0?`${e.core.t.comments.button} (${e.commentsInstance.unresolvedCount.value})`:e.core.t.comments.button,"aria-expanded":e.panelState.commentsOpen.value,class:(0,t.normalizeClass)((0,t.unref)(ph)),style:(0,t.normalizeStyle)({backgroundColor:e.panelState.commentsOpen.value?`var(--tpl-primary)`:`transparent`,color:e.panelState.commentsOpen.value?`var(--tpl-bg)`:`var(--tpl-primary)`,borderColor:`var(--tpl-primary)`}),onClick:o[0]||=t=>e.panelState.commentsOpen.value=!e.panelState.commentsOpen.value},[(0,t.createVNode)((0,t.unref)(lu),{size:16,"stroke-width":2}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.core.t.comments.button)+` `,1),e.commentsInstance.unresolvedCount.value>0&&!e.panelState.commentsOpen.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,MZ,(0,t.toDisplayString)(e.commentsInstance.unresolvedCount.value),1)):(0,t.createCommentVNode)(``,!0)],14,jZ)):(0,t.createCommentVNode)(``,!0),e.featureFlags.canUseAiGeneration.value&&e.featureFlags.hasTemplateSaved.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:4,ref:t=>e.panelState.aiMenuRef.value=t,class:`tpl:relative`},[(0,t.createElementVNode)(`button`,{"aria-expanded":e.panelState.aiMenuOpen.value,class:(0,t.normalizeClass)([`tpl-ai-btn tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-4 tpl:py-2 tpl:text-sm tpl:font-semibold tpl:whitespace-nowrap tpl:transition-all tpl:duration-200`,e.panelState.aiButtonActive.value?`tpl-ai-btn--active`:`tpl-ai-btn--idle`]),onClick:o[1]||=(0,t.withModifiers)((...t)=>e.panelState.toggleAiMenu&&e.panelState.toggleAiMenu(...t),[`stop`])},[(0,t.createVNode)((0,t.unref)(Hd),{size:16,"stroke-width":2,class:`tpl-ai-btn-icon`}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.core.t.aiChat.button),1)],10,NZ),(0,t.createVNode)(t.Transition,{"enter-active-class":`tpl:transition-all tpl:duration-150 tpl:ease-out`,"enter-from-class":`tpl:scale-95 tpl:opacity-0`,"enter-to-class":`tpl:scale-100 tpl:opacity-100`,"leave-active-class":`tpl:transition-all tpl:duration-100 tpl:ease-in`,"leave-from-class":`tpl:scale-100 tpl:opacity-100`,"leave-to-class":`tpl:scale-95 tpl:opacity-0`},{default:(0,t.withCtx)(()=>[e.panelState.aiMenuOpen.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,PZ,[(0,t.createVNode)((0,t.unref)(i),{"active-feature":e.panelState.activeAiFeature.value,onSelect:e.panelState.handleAiFeatureSelect},null,8,[`active-feature`,`onSelect`])])):(0,t.createCommentVNode)(``,!0)]),_:1})],512)):(0,t.createCommentVNode)(``,!0),e.testEmail.isEnabled.value&&e.featureFlags.canSendTestEmail.value?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:5,class:(0,t.normalizeClass)((0,t.unref)(ph)),style:{"background-color":`transparent`,color:`var(--tpl-primary)`,"border-color":`var(--tpl-primary)`},disabled:e.testEmail.isSending.value||!e.featureFlags.hasTemplateSaved.value,onClick:o[2]||=t=>e.panelState.testEmailModalOpen.value=!0},[e.testEmail.isSending.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(eu),{key:1,class:`tpl-spinner`,size:16,"stroke-width":2})):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(xd),{key:0,size:16,"stroke-width":2})),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.core.t.testEmail.button),1)],10,FZ)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`button`,{class:(0,t.normalizeClass)((0,t.unref)(ph)),style:{"background-color":`transparent`,color:`var(--tpl-primary)`,"border-color":`var(--tpl-primary)`},disabled:e.isSaveDisabled,onClick:o[3]||=e=>a.$emit(`save`)},[e.isSaving?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(eu),{key:1,class:`tpl-spinner`,size:16,"stroke-width":2})):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(fd),{key:0,size:16,"stroke-width":2})),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(e.isSaving?e.core.t.header.saving:e.core.t.header.save),1)],10,IZ)])]))}})})),zZ,BZ=d((()=>{RZ(),RZ(),zZ=LZ}));function VZ(){let e={alive:!0};return(0,t.onBeforeUnmount)(()=>{e.alive=!1}),e}var HZ=d((()=>{})),UZ,WZ,GZ,KZ,qZ,JZ,YZ,XZ,ZZ,QZ,$Z,eQ,tQ,nQ,rQ,iQ,aQ,oQ,sQ,cQ,lQ,uQ,dQ,fQ,pQ=d((()=>{gp(),D(),HZ(),F(),Oe(),UZ={key:0,class:`tpl-ai-sidebar tpl:absolute tpl:top-14 tpl:right-0 tpl:bottom-0 tpl:z-panel tpl:flex tpl:w-[360px] tpl:flex-col tpl:border-l tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)]`},WZ={class:`tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3`},GZ={class:`tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-primary)]`},KZ={class:`tpl:flex tpl:items-center tpl:gap-1`},qZ=[`title`],JZ={class:`tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col`},YZ={key:0,class:`tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center`},XZ={class:`tpl:text-sm tpl:text-[var(--tpl-text-muted)]`},ZZ={key:1,class:`tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center`},QZ={class:`tpl:max-w-[240px] tpl:text-sm tpl:text-[var(--tpl-text-muted)]`},$Z={key:2,class:`tpl:flex tpl:flex-col tpl:gap-4`},eQ={key:0,class:`tpl:self-end tpl:rounded-[var(--tpl-radius-sm)] tpl:px-3.5 tpl:py-2.5 tpl:text-sm`,style:{"background-color":`var(--tpl-primary-light)`,color:`var(--tpl-text)`,"max-width":`85%`,"box-shadow":`var(--tpl-shadow)`}},tQ={key:1,class:`tpl:flex tpl:flex-col tpl:gap-2`},nQ={key:1,class:`tpl:rounded-[var(--tpl-radius-sm)] tpl:px-3.5 tpl:py-2.5 tpl:text-sm tpl:whitespace-pre-wrap`,style:{"max-width":`85%`,"background-color":`var(--tpl-bg)`,color:`var(--tpl-text)`,"box-shadow":`var(--tpl-shadow)`}},rQ={key:0,class:`tpl:mx-3 tpl:mb-2 tpl:flex tpl:items-start tpl:gap-2 tpl:rounded-lg tpl:px-3 tpl:py-2 tpl:text-xs`,style:{"background-color":`var(--tpl-danger-light)`,color:`var(--tpl-danger)`}},iQ={key:1,class:`tpl:absolute tpl:right-0 tpl:bottom-0 tpl:left-0 tpl:z-10 tpl:px-3 tpl:pb-3`,style:{"background-color":`color-mix(
176
- in srgb,
177
- var(--tpl-bg) 50%,
178
- transparent
179
- )`,"backdrop-filter":`blur(2px)`}},aQ={class:`tpl:flex tpl:flex-col tpl:gap-1.5`},oQ=[`onClick`],sQ={class:`tpl:border-t tpl:p-3 tpl:border-[var(--tpl-border)]`},cQ={class:`tpl-ai-input-wrapper tpl:flex tpl:items-end tpl:gap-2 tpl:rounded-[var(--tpl-radius)] tpl:border tpl:px-3 tpl:py-2 tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]`},lQ=[`placeholder`,`disabled`],uQ=[`disabled`],dQ={class:`tpl:m-0 tpl:px-1 tpl:pt-2 tpl:text-center tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]`},fQ=(0,t.defineComponent)({__name:`AiChatSidebar`,props:{visible:{type:Boolean},onApply:{type:Function}},emits:[`close`],setup(e,{emit:n}){let r=e,a=n,o=ke(Ae,`AiChatSidebar`),s=ke(je,`AiChatSidebar`),c=ke(Ye,`AiChatSidebar`),l=(0,t.inject)(Ve,[]),u=VZ(),d=(0,i.useAiChat)({authManager:c,getTemplateId:()=>s.state.template?.id??null,onApply:r.onApply,onError:void 0}),f=(0,t.ref)(``),p=(0,t.ref)(null),m=(0,t.ref)(!1),h=(0,t.ref)(0),{pause:g,resume:_}=ne(()=>{let e=d.suggestions.value?.length??0;h.value<e?h.value++:g()},150,{immediate:!1}),{start:v}=re(()=>_(),100,{immediate:!1});(0,t.watch)(()=>d.suggestions.value?.length??0,e=>{if(g(),e===0){h.value=0;return}h.value=0,v()});function y(){(0,t.nextTick)(()=>{p.value&&(p.value.scrollTop=p.value.scrollHeight)})}(0,t.watch)(()=>d.messages.value?.length??0,()=>y()),(0,t.watch)(()=>r.visible,async e=>{if(e&&!m.value){if(m.value=!0,await d.loadConversation(),!u.alive)return;(d.messages.value?.length??0)===0&&s.content.value.blocks.length===0&&d.loadSuggestions(s.content.value,l)}});async function b(){let e=f.value.trim();!e||d.isGenerating.value||(f.value=``,d.error.value=null,d.failedPrompt.value=null,y(),await d.sendPrompt(e,s.content.value,l),u.alive&&(d.failedPrompt.value&&(f.value=d.failedPrompt.value),y()))}function x(e){return e.replace(/```json[\s\S]*?```/g,``).replace(/```json[\s\S]*/g,``).trim()}function S(e){g(),f.value=e,b()}function C(e){e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),b())}return(n,r)=>((0,t.openBlock)(),(0,t.createBlock)(t.Transition,{"enter-active-class":`tpl-ai-slide-enter-active`,"enter-from-class":`tpl:translate-x-full`,"enter-to-class":`tpl:translate-x-0`,"leave-active-class":`tpl-ai-slide-leave-active`,"leave-from-class":`tpl:translate-x-0`,"leave-to-class":`tpl:translate-x-full`},{default:(0,t.withCtx)(()=>[e.visible?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,UZ,[(0,t.createElementVNode)(`div`,WZ,[(0,t.createElementVNode)(`div`,GZ,[(0,t.createVNode)((0,t.unref)(Hd),{size:13,"stroke-width":2}),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(o).aiChat.title),1)]),(0,t.createElementVNode)(`div`,KZ,[((0,t.unref)(d).messages.value?.length??0)>0?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,class:`tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]`,title:(0,t.unref)(o).aiChat.clear,onClick:r[0]||=e=>(0,t.unref)(d).clearChat()},[(0,t.createVNode)((0,t.unref)(Of),{size:14,"stroke-width":2})],8,qZ)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`button`,{class:`tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]`,onClick:r[1]||=e=>a(`close`)},[(0,t.createVNode)((0,t.unref)(Qf),{size:14,"stroke-width":2})])])]),(0,t.createElementVNode)(`div`,JZ,[(0,t.createElementVNode)(`div`,{ref_key:`messagesContainer`,ref:p,class:`tpl:flex-1 tpl:overflow-y-auto tpl:p-4`},[(0,t.unref)(d).isLoadingHistory.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,YZ,[(0,t.createVNode)((0,t.unref)(eu),{class:`tpl-spinner tpl:text-[var(--tpl-text-muted)]`,size:24,"stroke-width":2}),(0,t.createElementVNode)(`p`,XZ,(0,t.toDisplayString)((0,t.unref)(o).aiChat.loadingHistory),1)])):((0,t.unref)(d).messages.value?.length??0)===0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ZZ,[(0,t.createVNode)((0,t.unref)(Hd),{size:32,"stroke-width":1.5,class:`tpl:text-[var(--tpl-text-dim)]`}),(0,t.createElementVNode)(`p`,QZ,(0,t.toDisplayString)((0,t.unref)(o).aiChat.placeholder),1)])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,$Z,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(d).messages.value,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.id,class:`tpl:flex tpl:flex-col tpl:gap-2`},[e.role===`user`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,eQ,(0,t.toDisplayString)(e.content),1)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,tQ,[!x(e.content)&&(0,t.unref)(d).isGenerating.value&&n===((0,t.unref)(d).messages.value?.length??0)-1?((0,t.openBlock)(),(0,t.createBlock)(hp,{key:0})):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,nQ,(0,t.toDisplayString)(x(e.content)||(0,t.unref)(o).aiChat.applied),1)),e.id===(0,t.unref)(d).lastApplyMessageId.value&&!(0,t.unref)(d).isGenerating.value?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:2,class:`tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:self-start tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150`,style:{"border-color":`var(--tpl-border)`,color:`var(--tpl-text-muted)`,"background-color":`transparent`},onClick:r[2]||=e=>(0,t.unref)(d).toggleLastRevert()},[(0,t.unref)(d).isLastChangeReverted.value?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createVNode)((0,t.unref)(Zu),{size:12,"stroke-width":2}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(o).aiChat.reapply),1)],64)):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createVNode)((0,t.unref)(Lf),{size:12,"stroke-width":2}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(o).aiChat.revert),1)],64))])):(0,t.createCommentVNode)(``,!0)]))]))),128))]))],512),(0,t.unref)(d).error.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,rQ,[(0,t.createVNode)((0,t.unref)(Hc),{size:14,"stroke-width":2,class:`tpl:mt-0.5 tpl:shrink-0`}),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(d).error.value===`ai_apply_failed`?(0,t.unref)(o).aiChat.applyFailed:(0,t.unref)(o).aiChat.error),1)])):(0,t.createCommentVNode)(``,!0),((0,t.unref)(d).suggestions.value?.length??0)>0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,iQ,[(0,t.createElementVNode)(`div`,aQ,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(d).suggestions.value??[],(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:n,class:(0,t.normalizeClass)([`tpl-suggestion-btn tpl:cursor-pointer tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:px-3 tpl:py-2 tpl:text-left tpl:text-xs tpl:leading-snug tpl:transition-all tpl:duration-300 tpl:ease-out`,((0,t.unref)(d).suggestions.value?.length??0)-1-n<h.value?`tpl:translate-y-0 tpl:opacity-100`:`tpl:pointer-events-none tpl:-translate-y-2 tpl:opacity-0`]),style:{"border-color":`var(--tpl-border)`,color:`var(--tpl-primary)`,"background-color":`var(--tpl-bg)`,"box-shadow":`var(--tpl-shadow)`},onClick:t=>S(e)},(0,t.toDisplayString)(e),11,oQ))),128))])])):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`div`,sQ,[(0,t.createElementVNode)(`div`,cQ,[(0,t.withDirectives)((0,t.createElementVNode)(`textarea`,{"onUpdate:modelValue":r[3]||=e=>f.value=e,class:`tpl:max-h-32 tpl:min-h-[64px] tpl:flex-1 tpl:resize-none tpl:border-none tpl:bg-transparent tpl:font-sans tpl:text-sm tpl:outline-none tpl:text-[var(--tpl-text)]`,placeholder:(0,t.unref)(o).aiChat.inputPlaceholder,disabled:(0,t.unref)(d).isGenerating.value,rows:`3`,onKeydown:C},null,40,lQ),[[t.vModelText,f.value]]),(0,t.createElementVNode)(`button`,{class:`tpl-ai-send-btn tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-md tpl:p-1.5 tpl:transition-all tpl:duration-150 tpl:disabled:opacity-40 tpl:text-[var(--tpl-primary)]`,disabled:!f.value.trim()||(0,t.unref)(d).isGenerating.value,onClick:b},[(0,t.createVNode)((0,t.unref)(xd),{size:16,"stroke-width":2})],8,uQ)]),(0,t.createElementVNode)(`p`,dQ,(0,t.toDisplayString)((0,t.unref)(o).aiMenu.disclaimer),1)])])):(0,t.createCommentVNode)(``,!0)]),_:1}))}})})),mQ=d((()=>{})),hQ=p({default:()=>gQ}),gQ,_Q=d((()=>{pQ(),pQ(),mQ(),dp(),gQ=up(fQ,[[`__scopeId`,`data-v-da2a9f9a`]])})),vQ,yQ,bQ,xQ,SQ,CQ,wQ,TQ,EQ,DQ,OQ,kQ,AQ,jQ,MQ,NQ,PQ,FQ,IQ,LQ,RQ,zQ,BQ,VQ,HQ,UQ,WQ,GQ,KQ,qQ,JQ,YQ,XQ,ZQ,QQ,$Q,e$,t$,n$,r$,i$,a$,o$,s$,c$,l$,u$,d$,f$,p$,m$,h$,g$,_$,v$,y$,b$,x$,S$,C$,w$,T$,E$=d((()=>{GX(),D(),k(),F(),vQ={key:0,class:`tpl-comments-sidebar tpl:absolute tpl:top-14 tpl:right-0 tpl:bottom-0 tpl:z-panel tpl:flex tpl:w-[360px] tpl:flex-col tpl:border-l tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)]`},yQ={class:`tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3`},bQ={class:`tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text)]`},xQ={key:0,class:`tpl:ml-1 tpl:inline-flex tpl:size-5 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-[10px] tpl:font-semibold tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]`},SQ={class:`tpl:flex tpl:gap-1 tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-2`},CQ={class:`tpl:flex-1 tpl:overflow-y-auto`},wQ={key:0,class:`tpl:flex tpl:h-full tpl:items-center tpl:justify-center`},TQ={key:1,class:`tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:px-6 tpl:text-center`},EQ={class:`tpl:max-w-[240px] tpl:text-sm tpl:text-[var(--tpl-text-muted)]`},DQ={key:2,class:`tpl:flex tpl:flex-col tpl:gap-3 tpl:p-3`},OQ={class:`tpl-comment-card tpl:rounded-lg tpl:border tpl:px-3.5 tpl:py-3`},kQ={class:`tpl:flex tpl:items-start tpl:justify-between tpl:gap-2`},AQ={class:`tpl:flex tpl:items-center tpl:gap-1.5`},jQ={class:`tpl:text-xs tpl:font-semibold tpl:text-[var(--tpl-text)]`},MQ={class:`tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]`},NQ={key:0,class:`tpl:text-[10px] tpl:italic tpl:text-[var(--tpl-text-dim)]`},PQ={class:`tpl:flex tpl:items-center tpl:gap-0.5`},FQ=[`title`,`onClick`],IQ=[`title`,`onClick`],LQ=[`title`,`onClick`],RQ={key:0,class:`tpl:mt-1 tpl:flex tpl:items-center tpl:gap-1 tpl:text-[10px] tpl:text-[var(--tpl-primary)]`},zQ={key:0,class:`tpl:mt-1 tpl:inline-flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:bg-[var(--tpl-warning-light)] tpl:text-[var(--tpl-warning)]`},BQ=[`onClick`],VQ={key:2,class:`tpl:mt-2`},HQ=[`onKeydown`],UQ={class:`tpl:mt-1.5 tpl:flex tpl:gap-1.5`},WQ=[`disabled`,`onClick`],GQ={key:3,class:`tpl:mt-1.5 tpl:text-xs tpl:leading-relaxed tpl:whitespace-pre-wrap tpl:text-[var(--tpl-text)]`},KQ={key:4,class:`tpl:mt-2 tpl:flex tpl:items-center tpl:gap-2 tpl:rounded-md tpl:px-2.5 tpl:py-2 tpl:text-xs tpl:bg-[var(--tpl-danger-light)] tpl:text-[var(--tpl-danger)]`},qQ={class:`tpl:flex-1`},JQ=[`onClick`],YQ={key:5,class:`tpl:mt-2 tpl:flex tpl:items-center tpl:gap-2`},XQ=[`title`,`onClick`],ZQ=[`onClick`],QQ={key:0,class:`tpl-comment-replies tpl:ml-5 tpl:pl-3 tpl:pt-2`},$Q={class:`tpl:flex tpl:items-start tpl:justify-between tpl:gap-2`},e$={class:`tpl:flex tpl:items-center tpl:gap-1.5`},t$={class:`tpl:text-xs tpl:font-semibold tpl:text-[var(--tpl-text)]`},n$={class:`tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]`},r$={key:0,class:`tpl:text-[10px] tpl:italic tpl:text-[var(--tpl-text-dim)]`},i$={class:`tpl:flex tpl:items-center tpl:gap-0.5`},a$=[`title`,`onClick`],o$=[`title`,`onClick`],s$={key:0,class:`tpl:mt-1.5`},c$=[`onKeydown`],l$={class:`tpl:mt-1.5 tpl:flex tpl:gap-1.5`},u$=[`disabled`,`onClick`],d$={key:1,class:`tpl:mt-1 tpl:text-xs tpl:leading-relaxed tpl:whitespace-pre-wrap tpl:text-[var(--tpl-text)]`},f$={key:2,class:`tpl:mt-2 tpl:flex tpl:items-center tpl:gap-2 tpl:rounded-md tpl:px-2.5 tpl:py-2 tpl:text-xs tpl:bg-[var(--tpl-danger-light)] tpl:text-[var(--tpl-danger)]`},p$={class:`tpl:flex-1`},m$=[`onClick`],h$={key:0,class:`tpl-comment-replies tpl:ml-5 tpl:pl-3 tpl:pt-2`},g$={class:`tpl:flex tpl:items-end tpl:gap-2`},_$=[`placeholder`,`onKeydown`],v$={class:`tpl:flex tpl:shrink-0 tpl:flex-col tpl:gap-1`},y$=[`disabled`,`onClick`],b$={class:`tpl:border-t tpl:p-3 tpl:border-[var(--tpl-border)]`},x$={key:0,class:`tpl:flex tpl:min-h-[68px] tpl:items-center tpl:rounded-md tpl:px-3 tpl:py-2 tpl:text-xs tpl:bg-[var(--tpl-warning-light)] tpl:text-[var(--tpl-warning)]`},S$={key:1,class:`tpl-comments-input-wrapper tpl:flex tpl:min-h-[68px] tpl:items-end tpl:gap-2 tpl:rounded-[var(--tpl-radius)] tpl:border tpl:px-3 tpl:py-2 tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]`},C$=[`placeholder`,`disabled`],w$=[`disabled`],T$=(0,t.defineComponent)({__name:`CommentsSidebar`,props:{visible:{type:Boolean}},emits:[`close`,`filterBlock`],setup(e,{expose:n,emit:r}){let i=e,a=r,{t:o,format:s}=O(),c=ke(je,`CommentsSidebar`),l=ke(Ye,`CommentsSidebar`),u=ke(Ze,`CommentsSidebar`),d=(0,t.ref)(`unresolved`),f=(0,t.ref)(null),p=(0,t.ref)(``),m=(0,t.ref)(null),h=(0,t.ref)(``),g=(0,t.ref)(null),_=(0,t.ref)(``),v=(0,t.ref)(new Set),y=(0,t.ref)(null),b=(0,t.ref)(null),x=(0,t.computed)(()=>l.userConfig?.id??null),S=(0,t.computed)(()=>{let e=new Set;for(let t of c.content.value.blocks)if(e.add(t.id),t.type===`section`)for(let n of t.children)for(let t of n)e.add(t.id);return e});function C(e){return e?!S.value.has(e):!1}let ee=(0,t.computed)(()=>d.value!==`block`||!f.value?!1:!(c.savedBlockIds?.value.has(f.value)??!0)),w=(0,t.computed)(()=>{let e=u.comments.value;return d.value===`unresolved`?e=e.filter(e=>!e.resolved_at):d.value===`block`&&f.value&&(e=e.filter(e=>e.block_id===f.value)),e});(0,t.watch)(()=>i.visible,e=>{e&&u.loadComments()}),(0,t.watch)(()=>c.state.selectedBlockId,e=>{d.value===`block`&&e&&(f.value=e)});function T(e,t){d.value=e,f.value=e===`block`?t??null:null}function te(e){T(`block`,e),a(`filterBlock`,e)}function E(e){v.value.has(e)?v.value.delete(e):v.value.add(e)}function ne(e){m.value=e,h.value=``,g.value=null,v.value.has(e)||v.value.add(e)}function re(){m.value=null,h.value=``}function ie(e){g.value=e.id,_.value=e.body,m.value=null}function ae(){g.value=null,_.value=``}function oe(e){y.value=e}function se(){y.value=null}async function ce(){let e=p.value.trim();if(!e)return;let t=d.value===`block`?f.value:void 0;await u.addComment(e,t??void 0),p.value=``}async function le(e){let t=h.value.trim();if(!t)return;let n=u.comments.value.find(t=>t.id===e);await u.addComment(t,n?.block_id??void 0,e),m.value=null,h.value=``}async function ue(e){let t=_.value.trim();t&&(await u.editComment(e,t),g.value=null,_.value=``)}async function de(e){await u.removeComment(e),y.value=null}async function fe(e){await u.toggleResolve(e)}function pe(e){return e.author_identifier===x.value}function me(e){return VX(e,o.snapshotHistory)??e}function he(e){e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),ce())}function ge(e,t){e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),le(t))}function _e(e,t){e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),ue(t)),e.key===`Escape`&&ae()}function ve(){(0,t.nextTick)(()=>{b.value?.focus()})}return n({filterByBlock:te,focusNewComment:ve}),(n,r)=>((0,t.openBlock)(),(0,t.createBlock)(t.Transition,{"enter-active-class":`tpl-comments-slide-enter-active`,"enter-from-class":`tpl:translate-x-full`,"enter-to-class":`tpl:translate-x-0`,"leave-active-class":`tpl-comments-slide-leave-active`,"leave-from-class":`tpl:translate-x-0`,"leave-to-class":`tpl:translate-x-full`},{default:(0,t.withCtx)(()=>[e.visible?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,vQ,[(0,t.createElementVNode)(`div`,yQ,[(0,t.createElementVNode)(`div`,bQ,[(0,t.createVNode)((0,t.unref)(lu),{size:13,"stroke-width":2}),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(o).comments.title),1),(0,t.unref)(u).unresolvedCount.value>0?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,xQ,(0,t.toDisplayString)((0,t.unref)(u).unresolvedCount.value),1)):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`button`,{class:`tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]`,onClick:r[0]||=e=>a(`close`)},[(0,t.createVNode)((0,t.unref)(Qf),{size:14,"stroke-width":2})])]),(0,t.createElementVNode)(`div`,SQ,[(0,t.createElementVNode)(`button`,{class:(0,t.normalizeClass)([`tpl-comment-filter tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-150`,d.value===`unresolved`?`tpl-comment-filter--active`:``]),onClick:r[1]||=e=>T(`unresolved`)},(0,t.toDisplayString)((0,t.unref)(o).comments.filterUnresolved),3),(0,t.createElementVNode)(`button`,{class:(0,t.normalizeClass)([`tpl-comment-filter tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-150`,d.value===`all`?`tpl-comment-filter--active`:``]),onClick:r[2]||=e=>T(`all`)},(0,t.toDisplayString)((0,t.unref)(o).comments.filterAll),3),(0,t.unref)(c).state.selectedBlockId?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,class:(0,t.normalizeClass)([`tpl-comment-filter tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-150`,d.value===`block`?`tpl-comment-filter--active`:``]),onClick:r[3]||=e=>T(`block`,(0,t.unref)(c).state.selectedBlockId??void 0)},(0,t.toDisplayString)((0,t.unref)(o).comments.filterBlock),3)):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`div`,CQ,[(0,t.unref)(u).isLoading.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,wQ,[(0,t.createVNode)((0,t.unref)(eu),{class:`tpl-spinner tpl:text-[var(--tpl-text-muted)]`,size:24,"stroke-width":2})])):w.value.length===0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,TQ,[(0,t.createVNode)((0,t.unref)(lu),{size:32,"stroke-width":1.5,class:`tpl:text-[var(--tpl-text-dim)]`}),(0,t.createElementVNode)(`p`,EQ,(0,t.toDisplayString)(d.value===`all`?(0,t.unref)(o).comments.noCommentsHint:(0,t.unref)(o).comments.noComments),1)])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,DQ,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(w.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.id,class:`tpl-comment-thread`},[(0,t.createElementVNode)(`div`,OQ,[(0,t.createElementVNode)(`div`,kQ,[(0,t.createElementVNode)(`div`,AQ,[(0,t.createElementVNode)(`span`,jQ,(0,t.toDisplayString)(pe(e)?(0,t.unref)(o).comments.ownedByYou:e.author_name),1),(0,t.createElementVNode)(`span`,MQ,(0,t.toDisplayString)(me(e.created_at)),1),e.updated_at===e.created_at?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,NQ,` (`+(0,t.toDisplayString)((0,t.unref)(o).comments.edited)+`) `,1))]),(0,t.createElementVNode)(`div`,PQ,[(0,t.createElementVNode)(`button`,{class:`tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150`,title:e.resolved_at?(0,t.unref)(o).comments.unresolve:(0,t.unref)(o).comments.resolve,onClick:t=>fe(e.id)},[(0,t.createVNode)((0,t.unref)(Gc),{size:13,"stroke-width":2,class:`tpl-resolve-icon`,style:(0,t.normalizeStyle)({color:e.resolved_at?`var(--tpl-primary)`:void 0})},null,8,[`style`])],8,FQ),pe(e)?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,class:`tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150`,title:(0,t.unref)(o).comments.edit,onClick:t=>ie(e)},[(0,t.createVNode)((0,t.unref)(Nu),{size:12,"stroke-width":2})],8,IQ)):(0,t.createCommentVNode)(``,!0),pe(e)?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:1,class:`tpl-comment-action tpl-comment-delete tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150`,title:(0,t.unref)(o).comments.delete,onClick:t=>oe(e.id)},[(0,t.createVNode)((0,t.unref)(Of),{size:12,"stroke-width":2})],8,LQ)):(0,t.createCommentVNode)(``,!0)])]),(0,t.createVNode)(t.Transition,{name:`tpl-resolve`},{default:(0,t.withCtx)(()=>[e.resolved_at?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,RQ,[(0,t.createVNode)((0,t.unref)(Dc),{size:10,"stroke-width":2.5}),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(s)((0,t.unref)(o).comments.resolvedBy,{name:e.resolved_by_name??``})),1)])):(0,t.createCommentVNode)(``,!0)]),_:2},1024),e.block_id&&C(e.block_id)?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,zQ,(0,t.toDisplayString)((0,t.unref)(o).comments.missingBlock),1)):e.block_id?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:1,class:`tpl:mt-1 tpl:inline-flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:transition-colors tpl:duration-150 tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)]`,onClick:n=>(0,t.unref)(c).selectBlock(e.block_id??``)},` Block `,8,BQ)):(0,t.createCommentVNode)(``,!0),g.value===e.id?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,VQ,[(0,t.withDirectives)((0,t.createElementVNode)(`textarea`,{"onUpdate:modelValue":r[4]||=e=>_.value=e,class:`tpl:w-full tpl:resize-none tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-2 tpl:font-sans tpl:text-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]`,rows:`3`,onKeydown:t=>_e(t,e.id)},null,40,HQ),[[t.vModelText,_.value]]),(0,t.createElementVNode)(`div`,UQ,[(0,t.createElementVNode)(`button`,{class:`tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-150 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]`,disabled:!_.value.trim()||(0,t.unref)(u).isSubmitting.value,onClick:t=>ue(e.id)},(0,t.toDisplayString)((0,t.unref)(o).comments.save),9,WQ),(0,t.createElementVNode)(`button`,{class:`tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]`,onClick:r[5]||=e=>ae()},(0,t.toDisplayString)((0,t.unref)(o).comments.cancel),1)])])):((0,t.openBlock)(),(0,t.createElementBlock)(`p`,GQ,(0,t.toDisplayString)(e.body),1)),y.value===e.id?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,KQ,[(0,t.createElementVNode)(`span`,qQ,(0,t.toDisplayString)((0,t.unref)(o).comments.deleteConfirm),1),(0,t.createElementVNode)(`button`,{class:`tpl:rounded tpl:px-2 tpl:py-0.5 tpl:text-xs tpl:font-medium tpl:bg-[var(--tpl-danger)] tpl:text-[var(--tpl-bg)]`,onClick:t=>de(e.id)},(0,t.toDisplayString)((0,t.unref)(o).comments.delete),9,JQ),(0,t.createElementVNode)(`button`,{class:`tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]`,onClick:r[6]||=e=>se()},(0,t.toDisplayString)((0,t.unref)(o).comments.cancel),1)])):(0,t.createCommentVNode)(``,!0),g.value!==e.id&&y.value!==e.id?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,YQ,[(0,t.createElementVNode)(`button`,{class:`tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150`,title:(0,t.unref)(o).comments.reply,onClick:t=>ne(e.id)},[(0,t.createVNode)((0,t.unref)(od),{size:13,"stroke-width":2,class:`tpl:text-[var(--tpl-primary)]`})],8,XQ),(e.replies?.length??0)>0?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,class:`tpl:flex tpl:items-center tpl:gap-0.5 tpl:text-[11px] tpl:font-medium tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]`,onClick:t=>E(e.id)},[v.value.has(e.id)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Ic),{key:0,size:11,"stroke-width":2})):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Ac),{key:1,size:11,"stroke-width":2})),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((e.replies?.length??0)===1?(0,t.unref)(s)((0,t.unref)(o).comments.replyOne,{count:String(e.replies?.length??0)}):(0,t.unref)(s)((0,t.unref)(o).comments.replyMany,{count:String(e.replies?.length??0)})),1)],8,ZQ)):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0)]),(0,t.createVNode)(t.Transition,{name:`tpl-replies`},{default:(0,t.withCtx)(()=>[v.value.has(e.id)&&(e.replies?.length??0)>0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,QQ,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.replies,(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n.id,class:(0,t.normalizeClass)([`tpl-comment-reply-card tpl:relative tpl:rounded-lg tpl:border tpl:px-3.5 tpl:py-2.5`,i<(e.replies?.length??0)-1?`tpl:mb-2`:``])},[(0,t.createElementVNode)(`div`,$Q,[(0,t.createElementVNode)(`div`,e$,[(0,t.createElementVNode)(`span`,t$,(0,t.toDisplayString)(pe(n)?(0,t.unref)(o).comments.ownedByYou:n.author_name),1),(0,t.createElementVNode)(`span`,n$,(0,t.toDisplayString)(me(n.created_at)),1),n.updated_at===n.created_at?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,r$,` (`+(0,t.toDisplayString)((0,t.unref)(o).comments.edited)+`) `,1))]),(0,t.createElementVNode)(`div`,i$,[pe(n)?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,class:`tpl-comment-action tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150`,title:(0,t.unref)(o).comments.edit,onClick:e=>ie(n)},[(0,t.createVNode)((0,t.unref)(Nu),{size:11,"stroke-width":2})],8,a$)):(0,t.createCommentVNode)(``,!0),pe(n)?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:1,class:`tpl-comment-action tpl-comment-delete tpl:rounded tpl:p-1 tpl:transition-colors tpl:duration-150`,title:(0,t.unref)(o).comments.delete,onClick:e=>oe(n.id)},[(0,t.createVNode)((0,t.unref)(Of),{size:11,"stroke-width":2})],8,o$)):(0,t.createCommentVNode)(``,!0)])]),g.value===n.id?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,s$,[(0,t.withDirectives)((0,t.createElementVNode)(`textarea`,{"onUpdate:modelValue":r[7]||=e=>_.value=e,class:`tpl:w-full tpl:resize-none tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-2 tpl:font-sans tpl:text-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]`,rows:`2`,onKeydown:e=>_e(e,n.id)},null,40,c$),[[t.vModelText,_.value]]),(0,t.createElementVNode)(`div`,l$,[(0,t.createElementVNode)(`button`,{class:`tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]`,disabled:!_.value.trim()||(0,t.unref)(u).isSubmitting.value,onClick:e=>ue(n.id)},(0,t.toDisplayString)((0,t.unref)(o).comments.save),9,u$),(0,t.createElementVNode)(`button`,{class:`tpl:rounded-md tpl:px-2.5 tpl:py-1 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]`,onClick:r[8]||=e=>ae()},(0,t.toDisplayString)((0,t.unref)(o).comments.cancel),1)])])):((0,t.openBlock)(),(0,t.createElementBlock)(`p`,d$,(0,t.toDisplayString)(n.body),1)),y.value===n.id?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,f$,[(0,t.createElementVNode)(`span`,p$,(0,t.toDisplayString)((0,t.unref)(o).comments.deleteConfirm),1),(0,t.createElementVNode)(`button`,{class:`tpl:rounded tpl:px-2 tpl:py-0.5 tpl:text-xs tpl:font-medium tpl:bg-[var(--tpl-danger)] tpl:text-[var(--tpl-bg)]`,onClick:e=>de(n.id)},(0,t.toDisplayString)((0,t.unref)(o).comments.delete),9,m$),(0,t.createElementVNode)(`button`,{class:`tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]`,onClick:r[9]||=e=>se()},(0,t.toDisplayString)((0,t.unref)(o).comments.cancel),1)])):(0,t.createCommentVNode)(``,!0)],2))),128))])):(0,t.createCommentVNode)(``,!0)]),_:2},1024),(0,t.createVNode)(t.Transition,{name:`tpl-replies`},{default:(0,t.withCtx)(()=>[m.value===e.id?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,h$,[(0,t.createElementVNode)(`div`,g$,[(0,t.withDirectives)((0,t.createElementVNode)(`textarea`,{"onUpdate:modelValue":r[10]||=e=>h.value=e,class:`tpl:flex-1 tpl:resize-none tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-2 tpl:font-sans tpl:text-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]`,placeholder:(0,t.unref)(o).comments.replyPlaceholder,rows:`2`,onKeydown:t=>ge(t,e.id)},null,40,_$),[[t.vModelText,h.value]]),(0,t.createElementVNode)(`div`,v$,[(0,t.createElementVNode)(`button`,{class:`tpl:flex tpl:items-center tpl:justify-center tpl:rounded-md tpl:p-1.5 tpl:transition-colors tpl:duration-150 tpl:disabled:opacity-40 tpl:text-[var(--tpl-primary)]`,disabled:!h.value.trim()||(0,t.unref)(u).isSubmitting.value,onClick:t=>le(e.id)},[(0,t.createVNode)((0,t.unref)(xd),{size:14,"stroke-width":2})],8,y$),(0,t.createElementVNode)(`button`,{class:`tpl:flex tpl:items-center tpl:justify-center tpl:rounded-md tpl:p-1.5 tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]`,onClick:r[11]||=e=>re()},[(0,t.createVNode)((0,t.unref)(Qf),{size:14,"stroke-width":2})])])])])):(0,t.createCommentVNode)(``,!0)]),_:2},1024)]))),128))]))]),(0,t.createElementVNode)(`div`,b$,[ee.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,x$,(0,t.toDisplayString)((0,t.unref)(o).comments.saveTemplateFirst),1)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,S$,[(0,t.withDirectives)((0,t.createElementVNode)(`textarea`,{ref_key:`newCommentInput`,ref:b,"onUpdate:modelValue":r[12]||=e=>p.value=e,class:`tpl:max-h-24 tpl:min-h-[48px] tpl:flex-1 tpl:resize-none tpl:border-none tpl:bg-transparent tpl:font-sans tpl:text-xs tpl:outline-none tpl:text-[var(--tpl-text)]`,placeholder:(0,t.unref)(o).comments.placeholder,disabled:(0,t.unref)(u).isSubmitting.value,rows:`2`,onKeydown:he},null,40,C$),[[t.vModelText,p.value]]),(0,t.createElementVNode)(`button`,{class:`tpl-comments-send-btn tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-md tpl:p-1.5 tpl:transition-all tpl:duration-150 tpl:disabled:opacity-40 tpl:text-[var(--tpl-primary)]`,disabled:!p.value.trim()||(0,t.unref)(u).isSubmitting.value,onClick:ce},[(0,t.unref)(u).isSubmitting.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(eu),{key:0,class:`tpl-spinner`,size:16,"stroke-width":2})):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(xd),{key:1,size:16,"stroke-width":2}))],8,w$)]))])])):(0,t.createCommentVNode)(``,!0)]),_:1}))}})})),D$=d((()=>{})),O$=p({default:()=>k$}),k$,A$=d((()=>{E$(),E$(),D$(),dp(),k$=up(T$,[[`__scopeId`,`data-v-5e7fbab3`]])})),j$,M$,N$,P$,F$,I$,L$,R$,z$,B$,V$,H$,U$,W$,G$,K$,q$,J$,Y$,X$,Z$,Q$,$$,e1,t1,n1,r1,i1=d((()=>{y(),gp(),D(),k(),F(),j$={key:0,class:`tpl-design-sidebar tpl:absolute tpl:top-14 tpl:right-0 tpl:bottom-0 tpl:z-panel tpl:flex tpl:w-[360px] tpl:flex-col tpl:border-l tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)]`},M$={class:`tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3`},N$={class:`tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-primary)]`},P$={class:`tpl:flex-1 tpl:overflow-y-auto tpl:p-4`},F$={key:0,class:`tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center`},I$={class:`tpl:flex tpl:w-full tpl:flex-col tpl:items-center tpl:gap-3`},L$={class:`tpl:text-sm tpl:text-[var(--tpl-text-muted)]`},R$={key:1,class:`tpl:flex tpl:flex-col tpl:gap-4`},z$={class:`tpl:flex tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1 tpl:bg-[var(--tpl-bg-hover)]`},B$={key:0,class:`tpl:flex tpl:flex-col tpl:gap-2`},V$={class:`tpl:relative tpl:overflow-hidden tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]`},H$=[`src`,`alt`],U$={key:1,class:`tpl:flex tpl:h-32 tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2`},W$={class:`tpl:text-xs tpl:text-[var(--tpl-text-muted)]`},G$={class:`tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-muted)]`},K$={class:`tpl:text-center tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]`},q$=[`accept`],J$={class:`tpl:flex tpl:flex-col tpl:gap-1.5`},Y$={class:`tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]`},X$=[`placeholder`],Z$={key:0,class:`tpl:flex tpl:flex-col tpl:gap-2 tpl:rounded-[var(--tpl-radius)] tpl:px-3 tpl:py-3 tpl:bg-[var(--tpl-warning-light)] tpl:border tpl:border-[var(--tpl-warning)]`},Q$={class:`tpl:text-xs tpl:leading-snug tpl:text-[var(--tpl-text)]`},$$={class:`tpl:flex tpl:gap-2`},e1={key:1,class:`tpl:flex tpl:items-start tpl:gap-2 tpl:rounded-lg tpl:px-3 tpl:py-2 tpl:text-xs tpl:bg-[var(--tpl-danger-light)] tpl:text-[var(--tpl-danger)]`},t1=[`disabled`],n1={class:`tpl:m-0 tpl:pt-1 tpl:text-center tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]`},r1=(0,t.defineComponent)({__name:`DesignReferenceSidebar`,props:{visible:{type:Boolean},hasExistingBlocks:{type:Boolean}},emits:[`close`,`apply`],setup(e,{emit:n}){let r=e,a=n,{t:o}=O(),s=ke(je,`DesignReferenceSidebar`),c=(0,i.useDesignReference)({authManager:ke(Ye,`DesignReferenceSidebar`),getTemplateId:()=>s.state.template?.id??null,onApply:e=>a(`apply`,e)}),l=(0,t.ref)(null),u=(0,t.ref)(`image`),d=(0,t.ref)(null),f=(0,t.ref)(``),p=(0,t.ref)(null),m=(0,t.ref)(!1),h=(0,t.ref)(!1),g=(0,t.computed)(()=>c.isGenerating.value?!1:d.value!==null);function _(e){u.value=e,b()}function v(e){let t=e.target,n=t.files?.[0];n&&y(n),t.value=``}function y(e){if(e.size>10485760){c.error.value=o.designReference.fileTooLarge;return}if(u.value===`image`){if(![`image/png`,`image/jpeg`,`image/jpg`,`image/webp`].includes(e.type)){c.error.value=o.designReference.invalidFileType;return}}else if(u.value===`pdf`&&e.type!==`application/pdf`){c.error.value=o.designReference.invalidFileType;return}d.value=e,c.error.value=null,p.value&&URL.revokeObjectURL(p.value),e.type.startsWith(`image/`)?p.value=URL.createObjectURL(e):p.value=null}function b(){p.value&&=(URL.revokeObjectURL(p.value),null),d.value=null}function x(e){e.preventDefault(),h.value=!0}function S(){h.value=!1}function C(e){e.preventDefault(),h.value=!1;let t=e.dataTransfer?.files?.[0];t&&y(t)}function ee(){if(!g.value)return;if(r.hasExistingBlocks&&!m.value){m.value=!0;return}m.value=!1;let e={};f.value.trim()&&(e.prompt=f.value.trim()),u.value===`image`&&d.value?e.imageUpload=d.value:u.value===`pdf`&&d.value&&(e.pdfUpload=d.value),c.generate(e)}function w(){m.value=!1}return(0,t.watch)(()=>r.visible,e=>{e||(m.value=!1)}),(n,r)=>((0,t.openBlock)(),(0,t.createBlock)(t.Transition,{"enter-active-class":`tpl-design-slide-enter-active`,"enter-from-class":`tpl:translate-x-full`,"enter-to-class":`tpl:translate-x-0`,"leave-active-class":`tpl-design-slide-leave-active`,"leave-from-class":`tpl:translate-x-0`,"leave-to-class":`tpl:translate-x-full`},{default:(0,t.withCtx)(()=>[e.visible?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,j$,[(0,t.createElementVNode)(`div`,M$,[(0,t.createElementVNode)(`div`,N$,[(0,t.createVNode)((0,t.unref)(Al),{size:13,"stroke-width":2}),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(o).designReference.title),1)]),(0,t.createElementVNode)(`button`,{class:`tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]`,onClick:r[0]||=e=>a(`close`)},[(0,t.createVNode)((0,t.unref)(Qf),{size:14,"stroke-width":2})])]),(0,t.createElementVNode)(`div`,P$,[(0,t.unref)(c).isGenerating.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,F$,[(0,t.createElementVNode)(`div`,I$,[(0,t.createVNode)(hp),(0,t.createElementVNode)(`p`,L$,(0,t.toDisplayString)((0,t.unref)(o).designReference.generating),1)])])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,R$,[(0,t.createElementVNode)(`div`,z$,[(0,t.createElementVNode)(`button`,{class:`tpl:flex tpl:flex-1 tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:px-2 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150`,style:(0,t.normalizeStyle)({backgroundColor:u.value===`image`?`var(--tpl-bg)`:`transparent`,color:u.value===`image`?`var(--tpl-primary)`:`var(--tpl-text-muted)`,boxShadow:u.value===`image`?`var(--tpl-shadow)`:`none`}),onClick:r[1]||=e=>_(`image`)},[(0,t.createVNode)((0,t.unref)(hl),{size:12,"stroke-width":2}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(o).designReference.uploadImage),1)],4),(0,t.createElementVNode)(`button`,{class:`tpl:flex tpl:flex-1 tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:px-2 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150`,style:(0,t.normalizeStyle)({backgroundColor:u.value===`pdf`?`var(--tpl-bg)`:`transparent`,color:u.value===`pdf`?`var(--tpl-primary)`:`var(--tpl-text-muted)`,boxShadow:u.value===`pdf`?`var(--tpl-shadow)`:`none`}),onClick:r[2]||=e=>_(`pdf`)},[(0,t.createVNode)((0,t.unref)(vl),{size:12,"stroke-width":2}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(o).designReference.uploadPdf),1)],4)]),(0,t.createElementVNode)(`div`,null,[d.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,B$,[(0,t.createElementVNode)(`div`,V$,[p.value?((0,t.openBlock)(),(0,t.createElementBlock)(`img`,{key:0,src:p.value,alt:d.value.name,class:`tpl:h-auto tpl:max-h-48 tpl:w-full tpl:object-contain`},null,8,H$)):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,U$,[(0,t.createVNode)((0,t.unref)(vl),{size:32,"stroke-width":1.5,class:`tpl:text-[var(--tpl-text-dim)]`}),(0,t.createElementVNode)(`span`,W$,(0,t.toDisplayString)(d.value.name),1)])),(0,t.createElementVNode)(`button`,{class:`tpl:absolute tpl:top-2 tpl:right-2 tpl:rounded-full tpl:p-1 tpl:transition-colors tpl:duration-150 tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] tpl:shadow-[var(--tpl-shadow)]`,onClick:b},[(0,t.createVNode)((0,t.unref)(Qf),{size:12,"stroke-width":2})])])])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:`tpl-design-dropzone tpl:flex tpl:cursor-pointer tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded-[var(--tpl-radius)] tpl:border-2 tpl:border-dashed tpl:px-4 tpl:py-8 tpl:transition-colors tpl:duration-150`,style:(0,t.normalizeStyle)({borderColor:h.value?`var(--tpl-primary)`:`var(--tpl-border-light)`,backgroundColor:h.value?`var(--tpl-primary-light)`:`var(--tpl-bg)`}),onClick:r[3]||=e=>l.value?.click(),onDragover:x,onDragleave:S,onDrop:C},[(0,t.createVNode)((0,t.unref)(Bf),{size:24,"stroke-width":1.5,class:`tpl:text-[var(--tpl-text-dim)]`}),(0,t.createElementVNode)(`span`,G$,(0,t.toDisplayString)((0,t.unref)(o).designReference.dropHint),1),(0,t.createElementVNode)(`span`,K$,(0,t.toDisplayString)(u.value===`image`?(0,t.unref)(o).designReference.acceptedImages:(0,t.unref)(o).designReference.acceptedPdf),1)],36)),(0,t.createElementVNode)(`input`,{ref_key:`fileInput`,ref:l,type:`file`,class:`tpl:hidden`,accept:u.value===`image`?`image/png,image/jpeg,image/webp`:`application/pdf`,onChange:v},null,40,q$)]),(0,t.createElementVNode)(`div`,J$,[(0,t.createElementVNode)(`label`,Y$,(0,t.toDisplayString)((0,t.unref)(o).designReference.promptLabel),1),(0,t.withDirectives)((0,t.createElementVNode)(`textarea`,{"onUpdate:modelValue":r[4]||=e=>f.value=e,class:(0,t.normalizeClass)([`tpl:min-h-[72px] tpl:w-full tpl:resize-none tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:px-3 tpl:py-2 tpl:font-sans tpl:text-sm tpl:outline-none tpl:transition-colors tpl:duration-150 tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)]`,[`tpl-design-prompt-input`]]),placeholder:(0,t.unref)(o).designReference.promptPlaceholder,rows:`3`},null,8,X$),[[t.vModelText,f.value]])]),m.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Z$,[(0,t.createElementVNode)(`p`,Q$,(0,t.toDisplayString)((0,t.unref)(o).designReference.replaceWarning),1),(0,t.createElementVNode)(`div`,$$,[(0,t.createElementVNode)(`button`,{class:`tpl:flex-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150 tpl:text-[var(--tpl-text-muted)] tpl:border tpl:border-[var(--tpl-border)]`,style:{"background-color":`transparent`},onClick:w},(0,t.toDisplayString)((0,t.unref)(o).designReference.replaceCancel),1),(0,t.createElementVNode)(`button`,{class:`tpl:flex-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]`,onClick:ee},(0,t.toDisplayString)((0,t.unref)(o).designReference.replaceConfirm),1)])])):(0,t.createCommentVNode)(``,!0),(0,t.unref)(c).error.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,e1,[(0,t.createVNode)((0,t.unref)(Hc),{size:14,"stroke-width":2,class:`tpl:mt-0.5 tpl:shrink-0`}),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(o).designReference.error),1)])):(0,t.createCommentVNode)(``,!0),m.value?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:2,class:`tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded-[var(--tpl-radius-sm)] tpl:px-4 tpl:py-2.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]`,disabled:!g.value,onClick:ee},[(0,t.createVNode)((0,t.unref)(Al),{size:16,"stroke-width":2}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(o).designReference.generate),1)],8,t1)),(0,t.createElementVNode)(`p`,n1,(0,t.toDisplayString)((0,t.unref)(o).aiMenu.disclaimer),1)]))])])):(0,t.createCommentVNode)(``,!0)]),_:1}))}})})),a1=d((()=>{})),o1=p({default:()=>s1}),s1,c1=d((()=>{i1(),i1(),a1(),dp(),s1=up(r1,[[`__scopeId`,`data-v-d70ec3cf`]])}));function l1(e){return e>=80?`var(--tpl-success)`:e>=60?`var(--tpl-warning)`:`var(--tpl-danger)`}function u1(e){return e>=80?`var(--tpl-success-light)`:e>=60?`var(--tpl-warning-light)`:`var(--tpl-danger-light)`}function d1(e){return e===`high`?`var(--tpl-danger)`:e===`medium`?`var(--tpl-warning)`:`var(--tpl-text-muted)`}function f1(e){return e===`high`?`var(--tpl-danger-light)`:e===`medium`?`var(--tpl-warning-light)`:`var(--tpl-bg-hover)`}var p1=d((()=>{})),m1,h1,g1,_1,v1,y1,b1,x1,S1,C1,w1,T1,E1,D1,O1,k1,A1,j1,M1,N1,P1,F1,I1,L1,R1,z1,B1,V1,H1,U1,W1,G1=d((()=>{gp(),D(),p1(),k(),F(),m1={key:0,class:`tpl-scoring-panel tpl:absolute tpl:top-14 tpl:right-0 tpl:bottom-0 tpl:z-panel tpl:flex tpl:w-[360px] tpl:flex-col tpl:border-l tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)]`},h1={class:`tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3`},g1={class:`tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-primary)]`},_1={class:`tpl:flex tpl:items-center tpl:gap-1`},v1=[`title`],y1={class:`tpl:flex-1 tpl:overflow-y-auto tpl:p-4`},b1={key:0,class:`tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center`},x1={class:`tpl:text-sm tpl:text-[var(--tpl-text-muted)]`},S1={key:1,class:`tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center`},C1={class:`tpl:max-w-[240px] tpl:text-sm tpl:text-[var(--tpl-text-muted)]`},w1={key:2,class:`tpl:flex tpl:flex-col tpl:gap-4`},T1={class:`tpl:text-xs tpl:font-medium tpl:uppercase tpl:tracking-wider tpl:text-[var(--tpl-text-muted)]`},E1={key:0,class:`tpl:text-xs tpl:text-[var(--tpl-text-dim)]`},D1={key:0,class:`tpl:flex tpl:items-start tpl:gap-2 tpl:rounded-lg tpl:px-3 tpl:py-2 tpl:text-xs tpl:bg-[var(--tpl-danger-light)] tpl:text-[var(--tpl-danger)]`},O1=[`onClick`],k1={class:`tpl:flex-1 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)]`},A1={key:0,class:`tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]`},j1={key:0,class:`tpl:border-t tpl:border-[var(--tpl-border)]`},M1={key:0,class:`tpl:px-3 tpl:py-3 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]`},N1={class:`tpl:flex tpl:items-start tpl:gap-2`},P1={class:`tpl:flex-1 tpl:min-w-0`},F1={class:`tpl:flex tpl:items-start tpl:gap-1.5`},I1={class:`tpl:text-xs tpl:leading-snug tpl:text-[var(--tpl-text)]`},L1={key:0,class:`tpl:mt-1 tpl:text-[11px] tpl:leading-snug tpl:text-[var(--tpl-text-dim)]`},R1={key:1,class:`tpl:mt-2 tpl:flex tpl:justify-center`},z1=[`disabled`,`onClick`],B1={key:0,class:`tpl:mt-1.5 tpl:text-[11px] tpl:text-[var(--tpl-danger)]`},V1={key:3,class:`tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center`},H1={class:`tpl:max-w-[240px] tpl:text-sm tpl:text-[var(--tpl-text-muted)]`},U1={class:`tpl:m-0 tpl:px-4 tpl:pb-2 tpl:pt-2 tpl:text-center tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]`},W1=(0,t.defineComponent)({__name:`TemplateScoringPanel`,props:{visible:{type:Boolean}},emits:[`close`],setup(e,{emit:n}){let r=e,i=n,{t:a}=O(),o=ke(je,`TemplateScoringPanel`),s=ke($e,`TemplateScoringPanel`),c=(0,t.inject)(Ve,[]),l=(0,t.ref)({spam:!0,readability:!0,accessibility:!0,bestPractices:!0});function u(e){l.value[e]=!l.value[e]}let d=[`spam`,`readability`,`accessibility`,`bestPractices`],f={spam:Nd,readability:fl,accessibility:Hd,bestPractices:tp};function p(){s.score(o.content.value,c)}(0,t.watch)(()=>r.visible,e=>{e&&!s.scoringResult.value&&!s.isScoring.value&&p()});async function m(e){if(!e.blockId)return;let t=o.content.value.blocks.find(t=>t.id===e.blockId);if(!t)return;let n=t.content;if(!n)return;let r=await s.fixFinding(n,e,c);r&&(o.updateBlock(e.blockId,{content:r}),s.removeFinding(e.category,e.id))}function h(){return s.scoringResult.value?d.reduce((e,t)=>e+(s.scoringResult.value?.categories[t]?.findings.length??0),0):0}return(n,r)=>((0,t.openBlock)(),(0,t.createBlock)(t.Transition,{"enter-active-class":`tpl-scoring-slide-enter-active`,"enter-from-class":`tpl:translate-x-full`,"enter-to-class":`tpl:translate-x-0`,"leave-active-class":`tpl-scoring-slide-leave-active`,"leave-from-class":`tpl:translate-x-0`,"leave-to-class":`tpl:translate-x-full`},{default:(0,t.withCtx)(()=>[e.visible?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,m1,[(0,t.createElementVNode)(`div`,h1,[(0,t.createElementVNode)(`div`,g1,[(0,t.createVNode)((0,t.unref)(Ad),{size:13,"stroke-width":2}),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(a).scoring.title),1)]),(0,t.createElementVNode)(`div`,_1,[(0,t.unref)(s).scoringResult.value&&!(0,t.unref)(s).isScoring.value?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,class:`tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]`,title:(0,t.unref)(a).scoring.rescore,onClick:r[0]||=e=>p()},[(0,t.createVNode)((0,t.unref)(ed),{size:14,"stroke-width":2})],8,v1)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`button`,{class:`tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]`,onClick:r[1]||=e=>i(`close`)},[(0,t.createVNode)((0,t.unref)(Qf),{size:14,"stroke-width":2})])])]),(0,t.createElementVNode)(`div`,y1,[(0,t.unref)(s).isScoring.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,b1,[(0,t.createElementVNode)(`p`,x1,(0,t.toDisplayString)((0,t.unref)(a).scoring.scoring),1),(0,t.createVNode)(hp,{class:`tpl:w-3/4`})])):(0,t.unref)(s).error.value&&!(0,t.unref)(s).scoringResult.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,S1,[(0,t.createVNode)((0,t.unref)(Hc),{size:32,"stroke-width":1.5,class:`tpl:text-[var(--tpl-danger)]`}),(0,t.createElementVNode)(`p`,C1,(0,t.toDisplayString)((0,t.unref)(a).scoring.error),1),(0,t.createElementVNode)(`button`,{class:`tpl:mt-2 tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150 tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text-muted)]`,onClick:r[2]||=e=>p()},[(0,t.createVNode)((0,t.unref)(ed),{size:12,"stroke-width":2}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(a).scoring.rescore),1)])])):(0,t.unref)(s).scoringResult.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,w1,[(0,t.createElementVNode)(`div`,{class:`tpl:flex tpl:flex-col tpl:items-center tpl:gap-2 tpl:rounded-[var(--tpl-radius)] tpl:p-5`,style:(0,t.normalizeStyle)({backgroundColor:(0,t.unref)(u1)((0,t.unref)(s).scoringResult.value.score)})},[(0,t.createElementVNode)(`span`,{class:`tpl:text-4xl tpl:font-bold tpl:tabular-nums`,style:(0,t.normalizeStyle)({color:(0,t.unref)(l1)((0,t.unref)(s).scoringResult.value.score)})},(0,t.toDisplayString)((0,t.unref)(s).scoringResult.value.score),5),(0,t.createElementVNode)(`span`,T1,(0,t.toDisplayString)((0,t.unref)(a).scoring.overallScore),1),h()>0?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,E1,(0,t.toDisplayString)(h())+` `+(0,t.toDisplayString)((0,t.unref)(a).scoring.findings),1)):(0,t.createCommentVNode)(``,!0)],4),(0,t.unref)(s).fixError.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,D1,[(0,t.createVNode)((0,t.unref)(Hc),{size:14,"stroke-width":2,class:`tpl:mt-0.5 tpl:shrink-0`}),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(a).scoring.fixError),1)])):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(d,e=>(0,t.createElementVNode)(`div`,{key:e,class:`tpl:overflow-hidden tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)]`},[(0,t.createElementVNode)(`button`,{class:`tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:gap-2.5 tpl:px-3 tpl:py-2.5 tpl:text-left tpl:transition-colors tpl:duration-100 tpl:bg-[var(--tpl-bg)]`,onClick:t=>u(e)},[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(f[e]),{size:14,"stroke-width":2,style:(0,t.normalizeStyle)({color:(0,t.unref)(l1)((0,t.unref)(s).scoringResult.value.categories[e].score)})},null,8,[`style`])),(0,t.createElementVNode)(`span`,k1,(0,t.toDisplayString)((0,t.unref)(a).scoring.categories[e]),1),(0,t.createElementVNode)(`span`,{class:`tpl:rounded-full tpl:px-2 tpl:py-0.5 tpl:text-xs tpl:font-semibold tpl:tabular-nums`,style:(0,t.normalizeStyle)({color:(0,t.unref)(l1)((0,t.unref)(s).scoringResult.value.categories[e].score),backgroundColor:(0,t.unref)(u1)((0,t.unref)(s).scoringResult.value.categories[e].score)})},(0,t.toDisplayString)((0,t.unref)(s).scoringResult.value.categories[e].score),5),(0,t.unref)(s).scoringResult.value.categories[e].findings.length>0?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,A1,(0,t.toDisplayString)((0,t.unref)(s).scoringResult.value.categories[e].findings.length),1)):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)((0,t.unref)(Ac),{size:12,"stroke-width":2,class:(0,t.normalizeClass)([`tpl:transition-transform tpl:duration-200 tpl:text-[var(--tpl-text-dim)]`,l.value[e]?`tpl:rotate-0`:`tpl:-rotate-90`])},null,8,[`class`])],8,O1),l.value[e]?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,j1,[(0,t.unref)(s).scoringResult.value.categories[e].findings.length===0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,M1,(0,t.toDisplayString)((0,t.unref)(a).scoring.noFindings),1)):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)(s).scoringResult.value.categories[e].findings,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.id,class:`tpl:border-t tpl:px-3 tpl:py-2.5 first:tpl:border-t-0 tpl:border-[var(--tpl-border-light)]`},[(0,t.createElementVNode)(`div`,N1,[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.severity===`high`?(0,t.unref)(Hc):e.severity===`medium`?(0,t.unref)(jf):(0,t.unref)(Il)),{size:13,"stroke-width":2,class:`tpl:mt-0.5 tpl:shrink-0`,style:(0,t.normalizeStyle)({color:(0,t.unref)(d1)(e.severity)})},null,8,[`style`])),(0,t.createElementVNode)(`div`,P1,[(0,t.createElementVNode)(`div`,F1,[(0,t.createElementVNode)(`span`,{class:`tpl:mt-0.5 tpl:shrink-0 tpl:rounded tpl:px-1 tpl:py-px tpl:text-[10px] tpl:font-medium tpl:leading-tight`,style:(0,t.normalizeStyle)({color:(0,t.unref)(d1)(e.severity),backgroundColor:(0,t.unref)(f1)(e.severity)})},(0,t.toDisplayString)((0,t.unref)(a).scoring.severity[e.severity]),5),(0,t.createElementVNode)(`span`,I1,(0,t.toDisplayString)(e.message),1)]),e.suggestion?((0,t.openBlock)(),(0,t.createElementBlock)(`p`,L1,(0,t.toDisplayString)(e.suggestion),1)):(0,t.createCommentVNode)(``,!0),e.blockId?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,R1,[(0,t.createElementVNode)(`button`,{class:`tpl-scoring-fix-btn tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded tpl:border tpl:px-3 tpl:py-1.5 tpl:text-[11px] tpl:font-medium tpl:transition-all tpl:duration-150 tpl:disabled:opacity-50 tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-primary)]`,style:{"background-color":`transparent`},disabled:(0,t.unref)(s).fixingFindingId.value!==null,onClick:t=>m(e)},[(0,t.unref)(s).fixingFindingId.value===e.id?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(eu),{key:0,class:`tpl-spinner`,size:11,"stroke-width":2})):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Hd),{key:1,size:11,"stroke-width":2})),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(s).fixingFindingId.value===e.id?(0,t.unref)(a).scoring.fixing:(0,t.unref)(a).scoring.fix),1)],8,z1),(0,t.unref)(s).fixError.value?((0,t.openBlock)(),(0,t.createElementBlock)(`p`,B1,(0,t.toDisplayString)((0,t.unref)(s).fixError.value),1)):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0)])])]))),128))])):(0,t.createCommentVNode)(``,!0)])),64))])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,V1,[(0,t.createVNode)((0,t.unref)(Ad),{size:32,"stroke-width":1.5,class:`tpl:text-[var(--tpl-text-dim)]`}),(0,t.createElementVNode)(`p`,H1,(0,t.toDisplayString)((0,t.unref)(a).scoring.emptyState),1)])),(0,t.createElementVNode)(`p`,U1,(0,t.toDisplayString)((0,t.unref)(a).aiMenu.disclaimer),1)])])):(0,t.createCommentVNode)(``,!0)]),_:1}))}})})),K1=d((()=>{})),q1=p({default:()=>J1}),J1,Y1=d((()=>{G1(),G1(),K1(),dp(),J1=up(W1,[[`__scopeId`,`data-v-bb4db637`]])})),X1,Z1,Q1=d((()=>{Rp(),D(),X1=[`data-tpl-theme`],Z1=(0,t.defineComponent)({__name:`TplModal`,props:{visible:{type:Boolean}},emits:[`close`,`keydown`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.ref)(null);_p(a,(0,t.computed)(()=>r.visible));let o=(0,t.inject)(Le);function s(e){e.key===`Escape`&&i(`close`),i(`keydown`,e)}return(n,r)=>((0,t.openBlock)(),(0,t.createBlock)(t.Teleport,{to:`body`},[(0,t.createVNode)(t.Transition,{"enter-active-class":`tpl:transition tpl:duration-150`,"enter-from-class":`tpl:opacity-0`,"enter-to-class":`tpl:opacity-100`,"leave-active-class":`tpl:transition tpl:duration-100`,"leave-from-class":`tpl:opacity-100`,"leave-to-class":`tpl:opacity-0`},{default:(0,t.withCtx)(()=>[e.visible?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,"data-tpl-theme":(0,t.unref)(o),class:`tpl tpl:fixed tpl:inset-0 tpl:z-modal tpl:flex tpl:items-center tpl:justify-center`,style:{"background-color":`var(--tpl-overlay)`,"backdrop-filter":`blur(8px)`,"-webkit-backdrop-filter":`blur(8px)`},onClick:r[0]||=(0,t.withModifiers)(e=>i(`close`),[`self`]),onKeydown:s},[(0,t.createElementVNode)(`div`,{ref_key:`dialogRef`,ref:a},[(0,t.renderSlot)(n.$slots,`default`)],512)],40,X1)):(0,t.createCommentVNode)(``,!0)]),_:3})]))}})})),$1,e0=d((()=>{Q1(),Q1(),$1=Z1})),t0,n0,r0,i0,a0,o0,s0,c0,l0,u0,d0,f0,p0,m0,h0=d((()=>{e0(),Rp(),F(),t0=[`aria-busy`],n0={id:`tpl-test-email-title`,class:`tpl:mb-4 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]`},r0={class:`tpl:mb-3`},i0={class:`tpl:mb-1.5 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]`},a0=[`value`],o0=[`disabled`],s0=[`value`],c0={key:0,role:`alert`,class:`tpl:mb-3 tpl:text-xs tpl:text-[var(--tpl-danger)]`},l0={class:`tpl:flex tpl:justify-end tpl:gap-2`},u0=[`disabled`],d0=[`disabled`],f0={key:0,class:`tpl:flex tpl:items-center tpl:gap-1.5`},p0={key:1},m0=(0,t.defineComponent)({__name:`TestEmailModal`,props:{visible:{type:Boolean},allowedEmails:{},isSending:{type:Boolean},error:{}},emits:[`send`,`close`],setup(e,{emit:n}){let r=e,i=n,{t:a}=O(),o=(0,t.ref)(``);(0,t.watch)(()=>r.visible,e=>{e&&(o.value=r.allowedEmails[0]??``)});function s(){!o.value||r.isSending||i(`send`,o.value)}function c(){r.isSending||i(`close`)}function l(e){e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),s()),e.key===`Escape`&&c()}return(n,r)=>((0,t.openBlock)(),(0,t.createBlock)($1,{visible:e.visible,onClose:c,onKeydown:l},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-busy":e.isSending,"aria-labelledby":`tpl-test-email-title`,class:`tpl-scale-in tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5`,style:{"background-color":`var(--tpl-bg-elevated)`,"box-shadow":`var(--tpl-shadow-xl)`}},[(0,t.createElementVNode)(`h3`,n0,(0,t.toDisplayString)((0,t.unref)(a).testEmail.title),1),(0,t.createElementVNode)(`div`,r0,[(0,t.createElementVNode)(`label`,i0,(0,t.toDisplayString)((0,t.unref)(a).testEmail.recipientLabel),1),e.allowedEmails.length===1?((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{key:0,type:`text`,value:o.value,disabled:``,class:`tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1 tpl:text-sm tpl:opacity-70 tpl:shadow-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]`},null,8,a0)):(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`select`,{key:1,"onUpdate:modelValue":r[0]||=e=>o.value=e,class:`tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1 tpl:text-sm tpl:shadow-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]`,disabled:e.isSending},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.allowedEmails,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e,value:e},(0,t.toDisplayString)(e),9,s0))),128))],8,o0)),[[t.vModelSelect,o.value]])]),e.error?((0,t.openBlock)(),(0,t.createElementBlock)(`p`,c0,(0,t.toDisplayString)(e.error),1)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,l0,[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)]`,{"tpl:cursor-not-allowed tpl:opacity-50":e.isSending}]),disabled:e.isSending,onClick:c},(0,t.toDisplayString)((0,t.unref)(a).testEmail.cancel),11,u0),(0,t.createElementVNode)(`button`,{type:`button`,class:`tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]`,disabled:!o.value||e.isSending,onClick:s},[e.isSending?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,f0,[(0,t.createVNode)((0,t.unref)(eu),{class:`tpl:animate-spin`,size:12,"stroke-width":2}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(a).testEmail.sending),1)])):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,p0,(0,t.toDisplayString)((0,t.unref)(a).testEmail.send),1))],8,d0)])],8,t0)]),_:1},8,[`visible`]))}})})),g0=p({default:()=>_0}),_0,v0=d((()=>{h0(),h0(),_0=m0})),y0,b0,x0,S0,C0,w0,T0,E0,D0,O0,k0,A0,j0,M0,N0,P0,F0=d((()=>{e0(),Rp(),D(),F(),y0=[`aria-busy`],b0={id:`tpl-save-module-title`,class:`tpl:mb-4 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]`},x0={class:`tpl:mb-3`},S0={class:`tpl:mb-1.5 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]`},C0=[`placeholder`,`disabled`],w0={class:`tpl:mb-3`},T0={class:`tpl:mb-1.5 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]`},E0={class:`tpl:max-h-40 tpl:space-y-1 tpl:overflow-y-auto tpl:rounded-md tpl:border tpl:p-2 tpl:border-[var(--tpl-border)]`},D0=[`checked`,`disabled`,`onChange`],O0={key:0,role:`alert`,class:`tpl:mb-3 tpl:text-xs tpl:text-[var(--tpl-danger)]`},k0={class:`tpl:flex tpl:justify-end tpl:gap-2`},A0=[`disabled`],j0=[`disabled`],M0={key:0,class:`tpl:flex tpl:items-center tpl:gap-1.5`},N0={key:1},P0=(0,t.defineComponent)({__name:`SaveModuleDialog`,props:{visible:{type:Boolean},preSelectedBlockId:{}},emits:[`close`,`saved`],setup(e,{emit:n}){let r=e,i=n,{t:a}=O(),o=ke(je,`SaveModuleDialog`),s=ke(Qe,`SaveModuleDialog`),c=(0,t.ref)(``),l=(0,t.ref)(new Set),u=(0,t.ref)(!1),d=(0,t.ref)(null),f=(0,t.computed)(()=>o.content.value.blocks);function p(e,t){let n=e.type;return`${a.blocks[n]??e.type} ${t+1}`}(0,t.watch)(()=>r.visible,e=>{e&&(c.value=``,d.value=null,l.value=new Set(r.preSelectedBlockId?[r.preSelectedBlockId]:[]))});function m(e){let t=new Set(l.value);t.has(e)?t.delete(e):t.add(e),l.value=t}let h=(0,t.computed)(()=>c.value.trim().length>0&&l.value.size>0&&!u.value);async function g(){if(h.value){u.value=!0,d.value=null;try{let e=f.value.filter(e=>l.value.has(e.id));await s.createModule(c.value.trim(),e),i(`saved`),i(`close`)}catch(e){d.value=e.message}finally{u.value=!1}}}function _(){u.value||i(`close`)}function v(e){e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),g()),e.key===`Escape`&&_()}return(n,r)=>((0,t.openBlock)(),(0,t.createBlock)($1,{visible:e.visible,onClose:_,onKeydown:v},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-busy":u.value,"aria-labelledby":`tpl-save-module-title`,class:`tpl-scale-in tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5`,style:{"background-color":`var(--tpl-bg-elevated)`,"box-shadow":`var(--tpl-shadow-xl)`}},[(0,t.createElementVNode)(`h3`,b0,(0,t.toDisplayString)((0,t.unref)(a).modules.saveAsModule),1),(0,t.createElementVNode)(`div`,x0,[(0,t.createElementVNode)(`label`,S0,(0,t.toDisplayString)((0,t.unref)(a).modules.moduleName),1),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":r[0]||=e=>c.value=e,type:`text`,placeholder:(0,t.unref)(a).modules.moduleNamePlaceholder,class:`tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1 tpl:text-sm tpl:shadow-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]`,disabled:u.value},null,8,C0),[[t.vModelText,c.value]])]),(0,t.createElementVNode)(`div`,w0,[(0,t.createElementVNode)(`label`,T0,(0,t.toDisplayString)((0,t.unref)(a).modules.selectBlocks),1),(0,t.createElementVNode)(`div`,E0,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(f.value,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`label`,{key:e.id,class:`tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:rounded-sm tpl:px-2 tpl:py-1.5 tpl:text-sm tpl:transition-colors tpl:duration-100`,style:(0,t.normalizeStyle)({color:`var(--tpl-text)`,backgroundColor:l.value.has(e.id)?`var(--tpl-primary-light)`:`transparent`})},[(0,t.createElementVNode)(`input`,{type:`checkbox`,checked:l.value.has(e.id),class:`tpl:accent-[var(--tpl-primary)]`,disabled:u.value,onChange:t=>m(e.id)},null,40,D0),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(p(e,n)),1)],4))),128))])]),d.value?((0,t.openBlock)(),(0,t.createElementBlock)(`p`,O0,(0,t.toDisplayString)(d.value),1)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,k0,[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)]`,{"tpl:cursor-not-allowed tpl:opacity-50":u.value}]),disabled:u.value,onClick:_},(0,t.toDisplayString)((0,t.unref)(a).modules.cancel),11,A0),(0,t.createElementVNode)(`button`,{type:`button`,class:`tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]`,disabled:!h.value,onClick:g},[u.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,M0,[(0,t.createVNode)((0,t.unref)(eu),{class:`tpl:animate-spin`,size:12,"stroke-width":2}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(a).modules.saving),1)])):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,N0,(0,t.toDisplayString)((0,t.unref)(a).modules.save),1))],8,j0)])],8,y0)]),_:1},8,[`visible`]))}})})),I0=p({default:()=>L0}),L0,R0=d((()=>{F0(),F0(),L0=P0})),z0,B0,V0,H0=d((()=>{Ks(),Xp(),tm(),lm(),Cm(),Am(),Tz(),jz(),Vz(),mI(),AF(),iB(),NF(),D(),z0={class:`tpl:w-full`},B0={class:`tpl:flex tpl:gap-0`},V0=(0,t.defineComponent)({name:`PreviewSectionBlock`,__name:`PreviewSectionBlock`,props:{block:{},viewport:{}},setup(e){let n={title:pI,paragraph:kF,image:Sm,video:rB,button:Gs,divider:em,social:wz,menu:km,table:Bz,spacer:Az,html:cm,custom:Yp},r=e,i=(0,t.inject)(ze,null),a=(0,t.computed)(()=>{switch(r.block.columns){case`2`:return[`50%`,`50%`];case`3`:return[`33.33%`,`33.33%`,`33.33%`];case`1-2`:return[`33.33%`,`66.67%`];case`2-1`:return[`66.67%`,`33.33%`];default:return[`100%`]}}),o=(0,t.computed)(()=>{let e=a.value.length,t=[...r.block.children];for(;t.length<e;)t.push([]);return t.slice(0,e)});function s(e){return o.value[e]||[]}function c(e){return jF(e,i,n)}return(e,n)=>{let r=(0,t.resolveComponent)(`PreviewSectionBlock`,!0);return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,z0,[(0,t.createElementVNode)(`div`,B0,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(o.value,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:n,style:(0,t.normalizeStyle)({width:a.value[n]})},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(s(n),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.id,style:(0,t.normalizeStyle)((0,t.unref)(MF)(e))},[e.type===`section`?((0,t.openBlock)(),(0,t.createBlock)(r,{key:0,block:e,viewport:`desktop`},null,8,[`block`])):((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(c(e)),{key:1,block:e,viewport:`desktop`},null,8,[`block`]))],4))),128))],4))),128))])])}}})})),U0,W0=d((()=>{H0(),H0(),U0=V0})),G0,K0,q0=d((()=>{Ks(),Xp(),tm(),lm(),Cm(),Am(),W0(),Tz(),jz(),Vz(),mI(),AF(),iB(),D(),NF(),G0={class:`tpl:pointer-events-none tpl:mx-auto tpl:w-[600px] tpl:select-none tpl:rounded-lg`,style:{"background-color":`var(--tpl-canvas-bg)`,"box-shadow":`var(--tpl-shadow-sm)`}},K0=(0,t.defineComponent)({__name:`ModulePreviewCanvas`,props:{blocks:{}},setup(e){let n=(0,t.inject)(ze),r={section:U0,title:pI,paragraph:kF,image:Sm,video:rB,button:Gs,divider:em,social:wz,menu:km,table:Bz,spacer:Az,html:cm,custom:Yp};function i(e){return jF(e,n,r)}return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,G0,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.blocks,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.id,style:(0,t.normalizeStyle)((0,t.unref)(MF)(e))},[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(i(e)),{block:e,viewport:`desktop`},null,8,[`block`]))],4))),128))]))}})})),J0=p({default:()=>Y0}),Y0,X0=d((()=>{q0(),q0(),Y0=K0})),Z0,Q0,$0,e2,t2,n2,r2,i2,a2,o2,s2,c2,l2,u2,d2,f2,p2,m2,h2,g2,_2,v2,y2,b2,x2,S2,C2,w2,T2,E2,D2,O2,k2,A2=d((()=>{e0(),Rp(),kB(),D(),F(),Z0={role:`dialog`,"aria-modal":`true`,"aria-labelledby":`tpl-module-browser-title`,class:`tpl-scale-in tpl:mx-4 tpl:flex tpl:w-full tpl:max-w-[1000px] tpl:flex-col tpl:rounded-[var(--tpl-radius-lg)]`,style:{"background-color":`var(--tpl-bg-elevated)`,"box-shadow":`var(--tpl-shadow-xl)`,"max-height":`90vh`}},Q0={class:`tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-4 tpl:border-[var(--tpl-border)]`},$0={id:`tpl-module-browser-title`,class:`tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]`},e2=[`aria-label`],t2={class:`tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden`},n2={class:`tpl:flex tpl:w-[300px] tpl:shrink-0 tpl:flex-col tpl:overflow-hidden`},r2={class:`tpl:px-4 tpl:pt-4 tpl:pb-3`},i2={class:`tpl:relative`},a2=[`placeholder`],o2={class:`tpl:flex-1 tpl:overflow-y-auto tpl:px-4 tpl:pb-4`},s2={key:0,class:`tpl:flex tpl:flex-col tpl:gap-1`},c2=[`aria-pressed`,`onClick`],l2={class:`tpl:flex tpl:items-center tpl:gap-2`},u2={class:`tpl:flex-1 tpl:truncate tpl:text-xs tpl:font-semibold tpl:text-[var(--tpl-text)]`},d2={class:`tpl:shrink-0 tpl:rounded-full tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)]`},f2={class:`tpl:mt-1 tpl:flex tpl:items-center tpl:gap-1`},p2={key:0,class:`tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]`},m2=[`aria-label`,`onClick`],h2=[`aria-label`,`title`,`onClick`],g2={key:1,class:`tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:py-12`},_2={class:`tpl:mt-2 tpl:text-xs tpl:text-[var(--tpl-text-dim)]`},v2={class:`tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-hidden tpl:border-l tpl:border-[var(--tpl-border)]`},y2={key:0,class:`tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-hidden`},b2={class:`tpl:flex-1 tpl:overflow-y-auto tpl:p-4`},x2={key:1,class:`tpl:flex tpl:flex-1 tpl:flex-col tpl:items-center tpl:justify-center tpl:px-4`},S2={class:`tpl:mt-2 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]`},C2={class:`tpl:flex tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3 tpl:border-[var(--tpl-border)]`},w2={class:`tpl:flex tpl:items-center tpl:gap-2`},T2={class:`tpl:shrink-0 tpl:text-xs tpl:text-[var(--tpl-text-dim)]`},E2=[`value`],D2={class:`tpl:flex tpl:gap-2`},O2=[`disabled`],k2=(0,t.defineComponent)({__name:`ModuleBrowserModal`,props:{visible:{type:Boolean}},emits:[`close`,`insert`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.defineAsyncComponent)(()=>Promise.resolve().then(()=>(X0(),J0))),{t:o}=O(),s=ke(Qe,`ModuleBrowserModal`),c=ke(je,`ModuleBrowserModal`),l=(0,t.ref)(``),u=(0,t.ref)(null),d=(0,t.ref)(null),f=(0,t.ref)(`end`),p=(0,t.computed)(()=>{let e=s.modules.value;if(!l.value)return e;let t=l.value.toLowerCase();return e.filter(e=>e.name.toLowerCase().includes(t))}),m=(0,t.computed)(()=>u.value?s.modules.value.find(e=>e.id===u.value)??null:null),h=(0,t.computed)(()=>{let e=[{value:`beginning`,label:o.modules.insertAtBeginning}],t=c.content.value.blocks;for(let n=0;n<t.length;n++){let r=t[n],i=r.type,a=o.blocks[i]??r.type;e.push({value:r.id,label:o.modules.insertAfterBlock.replace(`{block}`,`${a} ${n+1}`)})}return e.push({value:`end`,label:o.modules.insertAtEnd}),e}),g=(0,t.computed)(()=>{if(f.value===`end`)return;if(f.value===`beginning`)return 0;let e=c.content.value.blocks.findIndex(e=>e.id===f.value);if(e!==-1)return e+1});(0,t.watch)(()=>r.visible,e=>{if(e){l.value=``,u.value=null,d.value=null;let e=c.state.selectedBlockId;e?f.value=c.content.value.blocks.findIndex(t=>t.id===e)===-1?`end`:e:f.value=`end`}});function _(e){let t=[],n=new Set;for(let r of e.content)if(!n.has(r.type)&&OB[r.type]&&(n.add(r.type),t.push({type:r.type,icon:OB[r.type]})),t.length>=5)break;return t}function v(e){let t=new Set(e.content.map(e=>e.type));return Math.max(0,t.size-5)}async function y(e){try{await s.deleteModule(e),u.value===e&&(u.value=null)}finally{d.value=null}}function b(){m.value&&i(`insert`,m.value,g.value)}function x(){i(`close`)}function S(e){e.key===`Escape`&&x(),e.key===`Enter`&&m.value&&(e.preventDefault(),b())}return(n,r)=>((0,t.openBlock)(),(0,t.createBlock)($1,{visible:e.visible,onClose:x,onKeydown:S},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,Z0,[(0,t.createElementVNode)(`div`,Q0,[(0,t.createElementVNode)(`h3`,$0,(0,t.toDisplayString)((0,t.unref)(o).modules.browse),1),(0,t.createElementVNode)(`button`,{"aria-label":(0,t.unref)(o).modules.close,class:`tpl:cursor-pointer tpl:rounded-md tpl:border-none tpl:bg-transparent tpl:p-1 tpl:transition-colors tpl:duration-100 tpl:text-[var(--tpl-text-dim)]`,onClick:x},[(0,t.createVNode)((0,t.unref)(Qf),{size:16,"stroke-width":2})],8,e2)]),(0,t.createElementVNode)(`div`,t2,[(0,t.createElementVNode)(`div`,n2,[(0,t.createElementVNode)(`div`,r2,[(0,t.createElementVNode)(`div`,i2,[(0,t.createVNode)((0,t.unref)(vd),{size:14,"stroke-width":2,class:`tpl:pointer-events-none tpl:absolute tpl:left-3 tpl:top-1/2 tpl:-translate-y-1/2 tpl:text-[var(--tpl-text-dim)]`}),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":r[0]||=e=>l.value=e,type:`text`,placeholder:(0,t.unref)(o).modules.search,class:`tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:pl-9 tpl:pr-3 tpl:text-sm tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]`},null,8,a2),[[t.vModelText,l.value]])])]),(0,t.createElementVNode)(`div`,o2,[p.value.length>0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,s2,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(p.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:e.id,type:`button`,"aria-pressed":u.value===e.id,class:`tpl:group/card tpl:w-full tpl:cursor-pointer tpl:rounded-[var(--tpl-radius-md)] tpl:border tpl:bg-transparent tpl:px-3 tpl:py-2 tpl:text-left tpl:transition-all tpl:duration-[120ms]`,style:(0,t.normalizeStyle)({borderColor:u.value===e.id?`var(--tpl-primary)`:`var(--tpl-border)`,backgroundColor:u.value===e.id?`var(--tpl-primary-light)`:`transparent`}),onClick:t=>u.value=e.id},[(0,t.createElementVNode)(`div`,l2,[(0,t.createElementVNode)(`span`,u2,(0,t.toDisplayString)(e.name),1),(0,t.createElementVNode)(`span`,d2,(0,t.toDisplayString)((0,t.unref)(o).modules.blockCount.replace(`{count}`,String(e.content.length))),1)]),(0,t.createElementVNode)(`div`,f2,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(_(e),e=>((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.icon),{key:e.type,size:14,"stroke-width":1.5,class:`tpl:text-[var(--tpl-text-dim)]`}))),128)),v(e)>0?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,p2,` +`+(0,t.toDisplayString)(v(e)),1)):(0,t.createCommentVNode)(``,!0),d.value===e.id?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:1,"aria-label":(0,t.unref)(o).modules.deleteConfirm,class:`tpl:ml-auto tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:transition-colors tpl:duration-100 tpl:border-[var(--tpl-danger)] tpl:text-[var(--tpl-danger)]`,style:{"background-color":`transparent`},onClick:(0,t.withModifiers)(t=>y(e.id),[`stop`])},(0,t.toDisplayString)((0,t.unref)(o).modules.deleteConfirm),9,m2)):((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:2,class:`tpl-module-delete-btn tpl:ml-auto tpl:cursor-pointer tpl:rounded-md tpl:border-none tpl:bg-transparent tpl:p-0.5 tpl:transition-colors tpl:duration-100 tpl:text-[var(--tpl-text-dim)]`,"aria-label":(0,t.unref)(o).modules.delete,title:(0,t.unref)(o).modules.delete,onClick:(0,t.withModifiers)(t=>d.value=e.id,[`stop`])},[(0,t.createVNode)((0,t.unref)(Of),{size:12,"stroke-width":1.5})],8,h2))])],12,c2))),128))])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,g2,[(0,t.createVNode)((0,t.unref)(Du),{size:32,"stroke-width":1,class:`tpl:text-[var(--tpl-text-dim)]`}),(0,t.createElementVNode)(`p`,_2,(0,t.toDisplayString)(l.value?(0,t.unref)(o).modules.noModules:(0,t.unref)(o).modules.noModulesHint),1)]))])]),(0,t.createElementVNode)(`div`,v2,[m.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,y2,[(0,t.createElementVNode)(`div`,b2,[(0,t.createVNode)((0,t.unref)(a),{blocks:m.value.content},null,8,[`blocks`])])])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,x2,[(0,t.createVNode)((0,t.unref)(Du),{size:32,"stroke-width":1,class:`tpl:text-[var(--tpl-text-dim)]`}),(0,t.createElementVNode)(`p`,S2,(0,t.toDisplayString)((0,t.unref)(o).modules.selectToPreview),1)]))])]),(0,t.createElementVNode)(`div`,C2,[(0,t.createElementVNode)(`div`,w2,[(0,t.createElementVNode)(`label`,T2,(0,t.toDisplayString)((0,t.unref)(o).modules.insertPosition),1),(0,t.withDirectives)((0,t.createElementVNode)(`select`,{"onUpdate:modelValue":r[1]||=e=>f.value=e,class:`tpl:h-7 tpl:max-w-[220px] tpl:rounded-md tpl:border tpl:px-2 tpl:text-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]`},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(h.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:e.value,value:e.value},(0,t.toDisplayString)(e.label),9,E2))),128))],512),[[t.vModelSelect,f.value]])]),(0,t.createElementVNode)(`div`,D2,[(0,t.createElementVNode)(`button`,{type:`button`,class:`tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)]`,onClick:x},(0,t.toDisplayString)((0,t.unref)(o).modules.close),1),(0,t.createElementVNode)(`button`,{type:`button`,class:`tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]`,disabled:!m.value,onClick:b},(0,t.toDisplayString)((0,t.unref)(o).modules.insert),9,O2)])])])]),_:1},8,[`visible`]))}})})),j2=d((()=>{})),M2=p({default:()=>N2}),N2,P2=d((()=>{A2(),A2(),j2(),N2=k2})),F2,I2=d((()=>{F2=(0,t.defineComponent)({__name:`CloudPanels`,props:{config:{},editor:{},core:{},panelState:{},planConfigInstance:{},testEmail:{},mediaLib:{},savedModulesHeadless:{},showSaveModuleDialog:{type:Boolean},saveModulePreSelectedBlockId:{},showModuleBrowserModal:{type:Boolean}},emits:[`update:showSaveModuleDialog`,`update:saveModulePreSelectedBlockId`,`update:showModuleBrowserModal`,`send-test-email`,`module-insert`],setup(e,{expose:n,emit:r}){let i=(0,t.defineAsyncComponent)(()=>Promise.resolve().then(()=>(_Q(),hQ))),a=(0,t.defineAsyncComponent)(()=>Promise.resolve().then(()=>(A$(),O$))),o=(0,t.defineAsyncComponent)(()=>Promise.resolve().then(()=>(c1(),o1))),s=(0,t.defineAsyncComponent)(()=>Promise.resolve().then(()=>(Y1(),q1))),c=(0,t.defineAsyncComponent)(()=>Promise.resolve().then(()=>(v0(),g0))),l=(0,t.defineAsyncComponent)(()=>Promise.resolve().then(()=>(R0(),I0))),u=(0,t.defineAsyncComponent)(()=>Promise.resolve().then(()=>(P2(),M2))),d=(0,t.defineAsyncComponent)(async()=>(await import(`@templatical/media-library`)).MediaLibraryModal),f=r;function p(e,t,n){t.history.record(),n.setContent(e),t.conditionPreview.reset()}let m=(0,t.ref)(null);function h(e){m.value?.filterByBlock(e)}return n({filterCommentsByBlock:h}),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,[(0,t.createVNode)((0,t.unref)(i),{visible:e.panelState.aiChatOpen.value,"on-apply":t=>p(t,e.core,e.editor),onClose:r[0]||=t=>e.panelState.aiChatOpen.value=!1},null,8,[`visible`,`on-apply`]),(0,t.createVNode)((0,t.unref)(s),{visible:e.panelState.scoringPanelOpen.value,onClose:r[1]||=t=>e.panelState.scoringPanelOpen.value=!1},null,8,[`visible`]),(0,t.createVNode)((0,t.unref)(o),{visible:e.panelState.designReferenceOpen.value,"has-existing-blocks":e.editor.content.value.blocks.length>0,onClose:r[2]||=t=>e.panelState.designReferenceOpen.value=!1,onApply:r[3]||=t=>p(t,e.core,e.editor)},null,8,[`visible`,`has-existing-blocks`]),(0,t.createVNode)((0,t.unref)(a),{ref_key:`commentsSidebar`,ref:m,visible:e.panelState.commentsOpen.value,onClose:r[4]||=t=>e.panelState.commentsOpen.value=!1},null,8,[`visible`]),(0,t.createVNode)((0,t.unref)(c),{visible:e.panelState.testEmailModalOpen.value,"allowed-emails":e.testEmail.allowedEmails.value,"is-sending":e.testEmail.isSending.value,error:e.testEmail.error.value,onSend:r[5]||=e=>f(`send-test-email`,e),onClose:r[6]||=t=>e.panelState.testEmailModalOpen.value=!1},null,8,[`visible`,`allowed-emails`,`is-sending`,`error`]),e.planConfigInstance.hasFeature(`saved_modules`)&&e.config.modules!==!1?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(l),{key:0,visible:e.showSaveModuleDialog,"pre-selected-block-id":e.saveModulePreSelectedBlockId,onClose:r[7]||=e=>{f(`update:showSaveModuleDialog`,!1),f(`update:saveModulePreSelectedBlockId`,null)},onSaved:r[8]||=t=>e.savedModulesHeadless.loadModules()},null,8,[`visible`,`pre-selected-block-id`])):(0,t.createCommentVNode)(``,!0),e.planConfigInstance.hasFeature(`saved_modules`)&&e.config.modules!==!1?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(u),{key:1,visible:e.showModuleBrowserModal,onClose:r[9]||=e=>f(`update:showModuleBrowserModal`,!1),onInsert:r[10]||=(e,t)=>f(`module-insert`,e,t)},null,8,[`visible`])):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)((0,t.unref)(d),{visible:e.panelState.mediaLibraryOpen.value,accept:e.panelState.mediaLibraryAccept.value,onSelect:e.mediaLib.handleMediaSelect,onClose:e.mediaLib.handleMediaLibraryClose},null,8,[`visible`,`accept`,`onSelect`,`onClose`])],64))}})})),L2,R2=d((()=>{I2(),I2(),L2=F2})),z2,B2,V2,H2,U2=d((()=>{z2={key:0,class:`tpl-loading tpl:absolute tpl:inset-0 tpl:z-overlay tpl:flex tpl:flex-col tpl:bg-[var(--tpl-bg)]`},B2={class:`tpl:flex tpl:flex-1 tpl:overflow-hidden`},V2={class:`tpl:flex tpl:w-12 tpl:shrink-0 tpl:flex-col tpl:items-center tpl:gap-4 tpl:py-5 tpl:border-r tpl:border-[var(--tpl-border)]`},H2=(0,t.defineComponent)({__name:`CloudLoadingOverlay`,props:{visible:{type:Boolean}},setup(e){return(n,r)=>e.visible?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,z2,[r[1]||=(0,t.createStaticVNode)(`<div class="tpl:flex tpl:h-14 tpl:shrink-0 tpl:items-center tpl:justify-between tpl:px-4 tpl:border-b tpl:border-[var(--tpl-border)]"><div class="tpl-shimmer tpl:h-5 tpl:w-28 tpl:rounded-[var(--tpl-radius-sm)]"></div><div class="tpl:flex tpl:gap-3"><div class="tpl-shimmer tpl:h-8 tpl:w-20 tpl:rounded-[var(--tpl-radius-sm)]"></div><div class="tpl-shimmer tpl:h-8 tpl:w-20 tpl:rounded-[var(--tpl-radius-sm)]"></div></div></div>`,1),(0,t.createElementVNode)(`div`,B2,[(0,t.createElementVNode)(`div`,V2,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(5,e=>(0,t.createElementVNode)(`div`,{key:e,class:`tpl-shimmer tpl:size-7 tpl:rounded-[var(--tpl-radius-sm)]`})),64))]),r[0]||=(0,t.createStaticVNode)(`<div class="tpl:flex tpl:flex-1 tpl:items-start tpl:justify-center tpl:overflow-auto tpl:p-8 tpl:bg-[var(--tpl-canvas-bg)]"><div class="tpl:w-full tpl:max-w-[600px] tpl:rounded-[var(--tpl-radius)] tpl:p-6 tpl:bg-[var(--tpl-bg)] tpl:shadow-[var(--tpl-shadow-sm)]"><div class="tpl:space-y-2 tpl:py-4"><div class="tpl-shimmer tpl:h-3 tpl:w-3/4 tpl:rounded"></div><div class="tpl-shimmer tpl:h-3 tpl:w-full tpl:rounded"></div><div class="tpl-shimmer tpl:h-3 tpl:w-5/6 tpl:rounded"></div></div><div class="tpl:py-4"><div class="tpl-shimmer tpl:h-44 tpl:w-full tpl:rounded-[var(--tpl-radius-sm)]"></div></div><div class="tpl:space-y-2 tpl:py-4"><div class="tpl-shimmer tpl:h-3 tpl:w-full tpl:rounded"></div><div class="tpl-shimmer tpl:h-3 tpl:w-2/3 tpl:rounded"></div></div><div class="tpl:flex tpl:justify-center tpl:py-4"><div class="tpl-shimmer tpl:h-10 tpl:w-36 tpl:rounded-[var(--tpl-radius-sm)]"></div></div><div class="tpl:space-y-2 tpl:py-4"><div class="tpl-shimmer tpl:mx-auto tpl:h-2.5 tpl:w-1/2 tpl:rounded"></div><div class="tpl-shimmer tpl:mx-auto tpl:h-2.5 tpl:w-1/3 tpl:rounded"></div></div></div></div><div class="tpl:flex tpl:w-[320px] tpl:shrink-0 tpl:flex-col tpl:gap-4 tpl:p-4 tpl:border-l tpl:border-[var(--tpl-border)]"><div class="tpl-shimmer tpl:h-8 tpl:rounded-[var(--tpl-radius-sm)]"></div><div class="tpl-shimmer tpl:h-32 tpl:rounded-[var(--tpl-radius)]"></div><div class="tpl-shimmer tpl:h-32 tpl:rounded-[var(--tpl-radius)]"></div></div>`,2)])])):(0,t.createCommentVNode)(``,!0)}})})),W2,G2=d((()=>{U2(),U2(),W2=H2})),K2,q2,J2,Y2,X2,Z2,Q2=d((()=>{F(),k(),K2={key:0,role:`alert`,class:`tpl-error tpl:absolute tpl:inset-0 tpl:z-overlay tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-6 tpl:px-8 tpl:bg-[var(--tpl-bg)]`},q2={class:`tpl:flex tpl:size-16 tpl:items-center tpl:justify-center tpl:rounded-full tpl:bg-[var(--tpl-danger-light)]`},J2={class:`tpl:flex tpl:flex-col tpl:items-center tpl:gap-2 tpl:text-center`},Y2={class:`tpl:text-lg tpl:font-semibold tpl:text-[var(--tpl-text)]`},X2={class:`tpl:max-w-md tpl:text-sm tpl:text-[var(--tpl-text-muted)]`},Z2=(0,t.defineComponent)({__name:`CloudErrorOverlay`,props:{error:{},visible:{type:Boolean}},emits:[`retry`],setup(e,{emit:n}){let r=n,{t:i}=O();function a(e){return`isUnauthorized`in e&&e.isUnauthorized?i.error.authFailed:`isNotFound`in e&&e.isNotFound?i.error.templateNotFound:i.error.defaultMessage}function o(e){return`isNotFound`in e&&!!e.isNotFound}return(n,s)=>e.visible&&e.error?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,K2,[(0,t.createElementVNode)(`div`,q2,[(0,t.createVNode)((0,t.unref)(Hc),{size:32,"stroke-width":1.5,class:`tpl:text-[var(--tpl-danger)]`})]),(0,t.createElementVNode)(`div`,J2,[(0,t.createElementVNode)(`h2`,Y2,(0,t.toDisplayString)((0,t.unref)(i).error.title),1),(0,t.createElementVNode)(`p`,X2,(0,t.toDisplayString)(a(e.error)),1)]),o(e.error)?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,class:`tpl-btn tpl-btn-primary tpl:inline-flex tpl:items-center tpl:gap-2 tpl:rounded-md tpl:px-4 tpl:py-2.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]`,onClick:s[0]||=e=>r(`retry`)},(0,t.toDisplayString)((0,t.unref)(i).error.retry),1))])):(0,t.createCommentVNode)(``,!0)}})})),$2,e4=d((()=>{Q2(),Q2(),$2=Z2})),t4,n4,r4,i4,a4=d((()=>{F(),k(),t4={key:0,class:`tpl-preview-banner tpl:absolute tpl:top-14 tpl:right-0 tpl:left-0 tpl:z-40 tpl:flex tpl:items-center tpl:justify-center tpl:gap-4 tpl:px-4 tpl:py-3 tpl:bg-[var(--tpl-primary-light)] tpl:border-b tpl:border-[var(--tpl-primary)]`},n4={class:`tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:text-[var(--tpl-text)]`},r4={class:`tpl:flex tpl:items-center tpl:gap-2`},i4=(0,t.defineComponent)({__name:`SnapshotPreviewBanner`,props:{visible:{type:Boolean}},emits:[`cancel`,`confirm`],setup(e,{emit:n}){let r=n,{t:i}=O();return(n,a)=>e.visible?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,t4,[(0,t.createElementVNode)(`div`,n4,[(0,t.createVNode)((0,t.unref)(Zc),{size:18,"stroke-width":2,class:`tpl:text-[var(--tpl-primary)]`}),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)((0,t.unref)(i).snapshotPreview.message),1)]),(0,t.createElementVNode)(`div`,r4,[(0,t.createElementVNode)(`button`,{class:`tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:duration-150 tpl:text-[var(--tpl-text-muted)] tpl:border tpl:border-[var(--tpl-border)]`,style:{"background-color":`transparent`},onClick:a[0]||=e=>r(`cancel`)},(0,t.toDisplayString)((0,t.unref)(i).snapshotPreview.cancel),1),(0,t.createElementVNode)(`button`,{class:`tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]`,onClick:a[1]||=e=>r(`confirm`)},(0,t.toDisplayString)((0,t.unref)(i).snapshotPreview.restore),1)])])):(0,t.createCommentVNode)(``,!0)}})})),o4,s4=d((()=>{a4(),a4(),o4=i4})),c4,l4,u4=d((()=>{k(),c4={key:0,role:`status`,"aria-live":`polite`,class:`tpl:absolute tpl:top-16 tpl:left-1/2 tpl:z-toast tpl:-translate-x-1/2 tpl:rounded-[var(--tpl-radius)] tpl:px-4 tpl:py-2.5 tpl:text-sm tpl:shadow-lg`,style:{"background-color":`var(--tpl-warning-light)`,color:`var(--tpl-text)`,border:`1px solid var(--tpl-warning)`}},l4=(0,t.defineComponent)({__name:`CollabUndoToast`,props:{visible:{type:Boolean}},setup(e){let{t:n}=O();return(r,i)=>e.visible?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,c4,(0,t.toDisplayString)((0,t.unref)(n).history.collabWarning),1)):(0,t.createCommentVNode)(``,!0)}})})),d4,f4=d((()=>{u4(),u4(),d4=l4})),p4,m4,h4,g4,_4,v4=d((()=>{F(),TX(),kX(),BZ(),R2(),KY(),DB(),HB(),SY(),G2(),e4(),s4(),f4(),qY(),p4=[`data-tpl-theme`],m4={class:`tpl:sticky tpl:top-0 tpl:z-40 tpl:h-0`},h4={class:`tpl-main tpl:flex tpl:justify-center tpl:p-8`},g4=[`aria-label`],_4=(0,t.defineComponent)({__name:`CloudEditor`,props:{config:{},translations:{},fontsManager:{}},emits:[`ready`],setup(e,{expose:n,emit:i}){let a=e,o=i,s=(0,t.ref)(null),c=wX({config:a.config,translations:a.translations,fontsManager:a.fontsManager,emit:o,getCommentsSidebar:()=>s.value?{filterByBlock:s.value.filterCommentsByBlock}:null}),{isInitializing:l,isAuthReady:u,initError:d,authManager:f,planConfigInstance:p,websocket:m,collaboration:h,isCollaborationEnabled:g,editor:_,core:v,featureFlags:y,mediaLib:b,exporter:x,testEmail:S,commentsInstance:C,savedModulesHeadless:ee,panelState:w,snapshotPreview:T,collabWarning:te,showSaveModuleDialog:E,showModuleBrowserModal:ne,saveModulePreSelectedBlockId:re,setThemeOverrides:ie,setUiTheme:ae}=c;async function oe(e){try{await S.sendTestEmail(e),w.testEmailModalOpen.value=!1}catch{}}function se(e,t){for(let n=0;n<e.content.length;n++){let i=(0,r.cloneBlock)(e.content[n]),a=t===void 0?void 0:t+n;_.addBlock(i,void 0,void 0,a)}ne.value=!1}let ce=OX({config:a.config,editor:_,websocket:m,planConfigInstance:p,snapshotPreview:T,core:v,exporter:x,featureFlags:y,isDestroyed:c.isDestroyed});return c.onSaveHook.value=ce.saveTemplate,(0,t.onMounted)(()=>{c.initialize()}),(0,t.onUnmounted)(()=>{c.destroy()}),n({getContent:()=>_.content.value,setContent:e=>_.setContent(e),setTheme:ae,setThemeOverrides:ie,create:ce.createTemplate,load:ce.loadTemplate,save:ce.saveTemplate,sendTestEmail:S.sendTestEmail}),(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`tpl tpl:relative tpl:h-full tpl:overflow-hidden`,{"tpl:dark":(0,t.unref)(_).state.darkMode}]),"data-tpl-theme":(0,t.unref)(v).resolvedTheme.value,style:(0,t.normalizeStyle)((0,t.unref)(v).themeStyles.value)},[(0,t.createVNode)(t.Transition,{"enter-active-class":`tpl:transition-opacity tpl:duration-200`,"enter-from-class":`tpl:opacity-100`,"enter-to-class":`tpl:opacity-100`,"leave-active-class":`tpl:transition-opacity tpl:duration-300`,"leave-from-class":`tpl:opacity-100`,"leave-to-class":`tpl:opacity-0`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(W2,{visible:(0,t.unref)(l)||(0,t.unref)(_).state.isLoading},null,8,[`visible`])]),_:1}),(0,t.createVNode)(t.Transition,{"enter-active-class":`tpl:transition-opacity tpl:duration-200`,"enter-from-class":`tpl:opacity-0`,"enter-to-class":`tpl:opacity-100`,"leave-active-class":`tpl:transition-opacity tpl:duration-300`,"leave-from-class":`tpl:opacity-100`,"leave-to-class":`tpl:opacity-0`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)($2,{error:(0,t.unref)(d),visible:!!(0,t.unref)(d)&&!(0,t.unref)(l),onRetry:(0,t.unref)(c).initialize},null,8,[`error`,`visible`,`onRetry`])]),_:1}),(0,t.createVNode)(zZ,{editor:(0,t.unref)(_),core:(0,t.unref)(v),"auth-manager":(0,t.unref)(f),"feature-flags":(0,t.unref)(y),"panel-state":(0,t.unref)(w),"snapshot-preview":(0,t.unref)(T),"comments-instance":(0,t.unref)(C),"test-email":(0,t.unref)(S),websocket:(0,t.unref)(m),collaboration:(0,t.unref)(h),"is-collaboration-enabled":(0,t.unref)(g),"is-saving":(0,t.unref)(_).state.isSaving||(0,t.unref)(y).isSaveExporting.value,"is-save-disabled":(0,t.unref)(_).state.isSaving||(0,t.unref)(y).isSaveExporting.value||!(0,t.unref)(_).state.isDirty,onSave:n[0]||=e=>(0,t.unref)(ce).saveTemplate().catch(e=>a.config.onError?.(e))},null,8,[`editor`,`core`,`auth-manager`,`feature-flags`,`panel-state`,`snapshot-preview`,`comments-instance`,`test-email`,`websocket`,`collaboration`,`is-collaboration-enabled`,`is-saving`,`is-save-disabled`]),(0,t.createVNode)(o4,{visible:(0,t.unref)(T).isPreviewingSnapshot.value,onCancel:(0,t.unref)(T).cancelPreview,onConfirm:(0,t.unref)(T).confirmRestoreSnapshot},null,8,[`visible`,`onCancel`,`onConfirm`]),(0,t.createVNode)(t.Transition,{"enter-active-class":`tpl:transition-all tpl:duration-200 tpl:ease-out`,"enter-from-class":`tpl:translate-y-[-8px] tpl:opacity-0`,"enter-to-class":`tpl:translate-y-0 tpl:opacity-100`,"leave-active-class":`tpl:transition-all tpl:duration-300 tpl:ease-in`,"leave-from-class":`tpl:translate-y-0 tpl:opacity-100`,"leave-to-class":`tpl:translate-y-[-8px] tpl:opacity-0`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(d4,{visible:(0,t.unref)(te).collabUndoWarningVisible.value},null,8,[`visible`])]),_:1}),(0,t.withDirectives)((0,t.createVNode)(VB,null,null,512),[[t.vShow,!(0,t.unref)(_).state.previewMode]]),(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`tpl-body tpl:absolute tpl:bottom-0 tpl:overflow-auto`,[(0,t.unref)(_).state.previewMode?`tpl:left-0 tpl:right-0`:(0,t.unref)(w).rightPanelOpen.value?`tpl:left-12 tpl:right-[680px]`:`tpl:left-12 tpl:right-[320px]`,(0,t.unref)(T).isPreviewingSnapshot.value?`tpl:top-[104px]`:`tpl:top-14`]]),style:{transition:`all 300ms cubic-bezier(0.34, 1.56, 0.64, 1)`,"background-color":`var(--tpl-canvas-bg)`}},[(0,t.createElementVNode)(`div`,m4,[(0,t.createVNode)(t.Transition,{name:`tpl-restore-btn`},{default:(0,t.withCtx)(()=>[(0,t.unref)(v).conditionPreview.hasHiddenBlocks.value?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,class:`tpl:absolute tpl:left-1/2 tpl:top-2 tpl:-translate-x-1/2 tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-full tpl:border tpl:px-3.5 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:whitespace-nowrap tpl:shadow-md tpl:hover:opacity-80`,style:{"background-color":`var(--tpl-warning-light)`,color:`var(--tpl-warning)`,"border-color":`var(--tpl-warning)`,"backdrop-filter":`blur(8px)`},onClick:n[1]||=e=>(0,t.unref)(v).conditionPreview.reset()},[(0,t.createVNode)((0,t.unref)(ld),{size:13,"stroke-width":2}),(0,t.createTextVNode)(` `+(0,t.toDisplayString)((0,t.unref)(v).t.blockSettings.restoreHiddenBlocks),1)])):(0,t.createCommentVNode)(``,!0)]),_:1})]),(0,t.createElementVNode)(`main`,h4,[(0,t.createVNode)(EB,{viewport:(0,t.unref)(_).state.viewport,content:(0,t.unref)(_).content.value,"selected-block-id":(0,t.unref)(_).state.selectedBlockId,"dark-mode":(0,t.unref)(_).state.darkMode,"preview-mode":(0,t.unref)(_).state.previewMode,"locked-blocks":(0,t.unref)(h)?.lockedBlocks.value??void 0,onSelectBlock:(0,t.unref)(_).selectBlock,onOpenAiChat:n[2]||=e=>(0,t.unref)(w).aiChatOpen.value=!0,onOpenDesignReference:n[3]||=e=>(0,t.unref)(w).designReferenceOpen.value=!0},null,8,[`viewport`,`content`,`selected-block-id`,`dark-mode`,`preview-mode`,`locked-blocks`,`onSelectBlock`])])],2),(0,t.unref)(y).isWhiteLabeled.value?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createBlock)(GY,{key:0,"position-class":[(0,t.unref)(_).state.previewMode?`tpl:left-0 tpl:right-0`:(0,t.unref)(w).rightPanelOpen.value?`tpl:left-12 tpl:right-[680px]`:`tpl:left-12 tpl:right-[320px]`]},null,8,[`position-class`])),(0,t.createElementVNode)(`div`,{class:`tpl-sr-only`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,"aria-label":(0,t.unref)(v).t.landmarks.reorderAnnouncements},(0,t.toDisplayString)((0,t.unref)(v).keyboardReorder.announcement.value),9,g4),(0,t.withDirectives)((0,t.createVNode)(xY,{"selected-block":(0,t.unref)(_).selectedBlock.value,settings:(0,t.unref)(_).content.value.settings,"shifted-left":(0,t.unref)(w).rightPanelOpen.value,onUpdateBlock:n[4]||=e=>(0,t.unref)(_).updateBlock((0,t.unref)(_).selectedBlock.value.id,e),onDeleteBlock:n[5]||=e=>(0,t.unref)(v).blockActions.deleteBlock((0,t.unref)(_).selectedBlock.value.id),onDuplicateBlock:n[6]||=e=>(0,t.unref)(v).blockActions.duplicateBlock((0,t.unref)(_).selectedBlock.value),onUpdateSettings:(0,t.unref)(_).updateSettings},null,8,[`selected-block`,`settings`,`shifted-left`,`onUpdateSettings`]),[[t.vShow,!(0,t.unref)(_).state.previewMode]]),!(0,t.unref)(l)&&(0,t.unref)(u)?((0,t.openBlock)(),(0,t.createBlock)(L2,{key:1,ref_key:`cloudPanelsRef`,ref:s,config:a.config,editor:(0,t.unref)(_),core:(0,t.unref)(v),"panel-state":(0,t.unref)(w),"plan-config-instance":(0,t.unref)(p),"test-email":(0,t.unref)(S),"media-lib":(0,t.unref)(b),"saved-modules-headless":(0,t.unref)(ee),"show-save-module-dialog":(0,t.unref)(E),"save-module-pre-selected-block-id":(0,t.unref)(re),"show-module-browser-modal":(0,t.unref)(ne),"onUpdate:showSaveModuleDialog":n[7]||=e=>E.value=e,"onUpdate:saveModulePreSelectedBlockId":n[8]||=e=>re.value=e,"onUpdate:showModuleBrowserModal":n[9]||=e=>ne.value=e,onSendTestEmail:oe,onModuleInsert:se},null,8,[`config`,`editor`,`core`,`panel-state`,`plan-config-instance`,`test-email`,`media-lib`,`saved-modules-headless`,`show-save-module-dialog`,`save-module-pre-selected-block-id`,`show-module-browser-modal`])):(0,t.createCommentVNode)(``,!0)],14,p4))}})})),y4=d((()=>{})),b4=p({default:()=>x4}),x4,S4=d((()=>{v4(),v4(),y4(),dp(),x4=up(_4,[[`__scopeId`,`data-v-4bccdddc`]])}));y(),Rp(),Np();var C4=null,w4=(0,t.ref)(null);async function T4(e){let n=typeof e.container==`string`?document.querySelector(e.container):e.container;if(!n)throw Error(`[Templatical] Container element not found: ${e.container}`);C4&&k4();let r=await pX(e.locale??`en`),i=kp(e.fonts);C4=(0,t.createApp)({setup(){return()=>(0,t.h)(rX,{config:e,translations:r,fontsManager:i,ref:w4})}}),C4.mount(n);let a={getContent(){return w4.value?JSON.parse(JSON.stringify(w4.value.getContent())):JSON.parse(JSON.stringify(e.content))},setContent(t){w4.value&&w4.value.setContent(t),e.content=t},setTheme(e){w4.value&&w4.value.setTheme(e)},unmount:k4};return j4(a),a}var E4=null,D4=(0,t.ref)(null);async function O4(e){let n=typeof e.container==`string`?document.querySelector(e.container):e.container;if(!n)throw Error(`[Templatical] Container element not found: ${e.container}`);E4&&A4();let{default:r}=await Promise.resolve().then(()=>(S4(),b4)),i=await pX(e.locale??`en`),a=kp(e.fonts);await new Promise((o,s)=>{let c=setTimeout(()=>{s(Error(`[Templatical] Cloud editor initialization timed out`))},_);E4=(0,t.createApp)({setup(){return()=>(0,t.h)(r,{config:e,translations:i,fontsManager:a,ref:D4,onReady:()=>{clearTimeout(c),o()}})}}),E4.mount(n)});let o={getContent(){return D4.value?JSON.parse(JSON.stringify(D4.value.getContent())):JSON.parse(JSON.stringify(e.content))},setContent(e){D4.value&&D4.value.setContent(e)},setTheme(e){D4.value&&D4.value.setTheme(e)},unmount:A4,create(e){return D4.value?D4.value.create(e):Promise.reject(Error(`[Templatical] Cloud editor not ready`))},load(e){return D4.value?D4.value.load(e):Promise.reject(Error(`[Templatical] Cloud editor not ready`))},save(){return D4.value?D4.value.save():Promise.reject(Error(`[Templatical] Cloud editor not ready`))}};return j4(o),o}function k4(){C4&&(C4.unmount(),C4=null,w4.value=null)}function A4(){E4&&(E4.unmount(),E4=null,D4.value=null)}function j4(e){import(`@templatical/renderer`).then(t=>{e.toMjml=()=>t.renderToMjml(e.getContent())}).catch(()=>{})}e.init=T4,e.initCloud=O4,e.unmount=k4,e.useFonts=kp});