@panphora/clayjs 1.21.0 → 1.23.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 (192) hide show
  1. package/dist/all.js +1 -1
  2. package/dist/clay-dom.js +1 -1
  3. package/dist/clay-events.js +1 -1
  4. package/dist/clay-internals.js +1 -1
  5. package/dist/clay-options.js +1 -1
  6. package/dist/clay-router.js +1 -1
  7. package/dist/clay-ui.js +1 -1
  8. package/dist/clay-utils.js +1 -1
  9. package/dist/clay.js +1 -1
  10. package/dist/clay.standalone.js +8871 -8629
  11. package/dist/m/attrs/{save-freeze-MTFVVYV5.js → save-freeze-JZHKRQLR.js} +1 -1
  12. package/dist/m/{c-OABVRYOT.js → c-24PMUJIV.js} +1 -1
  13. package/dist/m/{c-EOCZ2YVL.js → c-2AYVYEI4.js} +1 -1
  14. package/dist/m/{c-UXEVJ63W.js → c-2L6O5PDS.js} +1 -1
  15. package/dist/m/{c-VBLFAQD2.js → c-2RYOGUQM.js} +1 -1
  16. package/dist/m/{c-LDUNOR57.js → c-2Z22FCFK.js} +13 -25
  17. package/dist/m/{c-NLZ5AN4L.js → c-2ZVOEU4M.js} +1 -1
  18. package/dist/m/{c-BJPZCWAV.js → c-37NAONZA.js} +1 -1
  19. package/dist/m/{c-ZE46QDIH.js → c-3TLG3OLG.js} +1 -1
  20. package/dist/m/{c-CSNE5EIF.js → c-4PO3YGDC.js} +1 -1
  21. package/dist/m/{c-OJYM642Q.js → c-5FKRZNJV.js} +1 -1
  22. package/dist/m/{c-SO63UGPQ.js → c-5OJ7YF2N.js} +1 -1
  23. package/dist/m/{c-CAWNFER6.js → c-5TIZ2I64.js} +1 -1
  24. package/dist/m/{c-7SXYQCN4.js → c-5WMXEKFH.js} +1 -1
  25. package/dist/m/{c-XQSXKIKM.js → c-6RDOKLN7.js} +1 -1
  26. package/dist/m/{c-BRLCTNMC.js → c-6TYGD5AB.js} +1 -1
  27. package/dist/m/c-A4IP6MBC.js +1 -0
  28. package/dist/m/{c-I2IFKJX2.js → c-ALDVFPWL.js} +1 -1
  29. package/dist/m/{c-LV5MABYD.js → c-AYVGD6A6.js} +1 -1
  30. package/dist/m/{c-LQU7TXIH.js → c-B6O7AJYG.js} +1 -1
  31. package/dist/m/{c-SBSMJIPC.js → c-BCGWJYXW.js} +1 -1
  32. package/dist/m/{c-RT3C74GY.js → c-BGKAT2FL.js} +1 -1
  33. package/dist/m/{c-N7Y52HJH.js → c-BXYSDKAN.js} +1 -1
  34. package/dist/m/c-CRPIDGXC.js +78 -0
  35. package/dist/m/c-CUMXGHVD.js +1 -0
  36. package/dist/m/{c-67ILSNPR.js → c-DTMZ3ZHI.js} +1 -1
  37. package/dist/m/{c-EZ7B5AZT.js → c-ELYIIYRS.js} +1 -1
  38. package/dist/m/{c-VAK7SG37.js → c-EUGJVHDD.js} +1 -1
  39. package/dist/m/{c-67LGZ52V.js → c-FCSZ3DC5.js} +1 -1
  40. package/dist/m/{c-JUE7B4OX.js → c-FQGHR32O.js} +1 -1
  41. package/dist/m/{c-ZJLU56DV.js → c-G4PWUDD5.js} +1 -1
  42. package/dist/m/{c-CJFDLD43.js → c-G6COVIZB.js} +1 -1
  43. package/dist/m/c-GBTVCJXC.js +1 -0
  44. package/dist/m/c-GC2HICFJ.js +1 -0
  45. package/dist/m/{c-44B5ODN7.js → c-HCNWJE4A.js} +2 -2
  46. package/dist/m/{c-BJ7YQ5QZ.js → c-IHUWUKIU.js} +1 -1
  47. package/dist/m/{c-LIBE4HPD.js → c-JCOQVZYS.js} +1 -1
  48. package/dist/m/{c-RG6XUZFA.js → c-JGHEACGK.js} +1 -1
  49. package/dist/m/{c-3GJ4XARY.js → c-JGLX6TBK.js} +1 -1
  50. package/dist/m/c-JNRKHYWO.js +1 -0
  51. package/dist/m/{c-PIVIYLTY.js → c-KDXIJEEF.js} +1 -1
  52. package/dist/m/{c-NFR673TL.js → c-L4KMT7FO.js} +2 -2
  53. package/dist/m/{c-E4IBSAQM.js → c-LCYPMULG.js} +1 -1
  54. package/dist/m/{c-SJPD46ZO.js → c-LIGQYZ7M.js} +4 -4
  55. package/dist/m/{c-U5X57T4L.js → c-LKIWEPAV.js} +1 -1
  56. package/dist/m/{c-EDSPKYMA.js → c-LUXAB2XI.js} +1 -1
  57. package/dist/m/{c-YSB6JKV2.js → c-LWIDDWAR.js} +2 -2
  58. package/dist/m/c-MPSKIU2I.js +1 -0
  59. package/dist/m/{c-DHXPDLW6.js → c-NK33MMYF.js} +1 -1
  60. package/dist/m/{c-GPGYKER7.js → c-NQLWOHLH.js} +1 -1
  61. package/dist/m/{c-LPUJXRXW.js → c-NTHUTABN.js} +1 -1
  62. package/dist/m/{c-Y33LUUIQ.js → c-NW54NHKE.js} +1 -1
  63. package/dist/m/{c-3AXJDL2P.js → c-OG6GFSUX.js} +1 -1
  64. package/dist/m/{c-MTQHWQC3.js → c-OKEGUICD.js} +1 -1
  65. package/dist/m/c-OPONJ2UK.js +128 -0
  66. package/dist/m/{c-3YH6JSIL.js → c-OWQWOGYI.js} +1 -1
  67. package/dist/m/{c-FDAXZ2PM.js → c-P6Q2ZTFQ.js} +1 -1
  68. package/dist/m/c-PKCCHJ5X.js +1 -0
  69. package/dist/m/c-PWJSJEJU.js +1 -0
  70. package/dist/m/{c-2ZZBC45O.js → c-PXLTUYZC.js} +1 -1
  71. package/dist/m/c-QEN6HZCA.js +1 -0
  72. package/dist/m/{c-JOH753EJ.js → c-QGAPG7OM.js} +1 -1
  73. package/dist/m/{c-W23KVGUO.js → c-QIR5CAKM.js} +1 -1
  74. package/dist/m/{c-GKEATME6.js → c-QM5LXRDT.js} +1 -1
  75. package/dist/m/c-QUGCKMWF.js +1 -0
  76. package/dist/m/{c-FNVQAACK.js → c-QYYUVLVG.js} +1 -1
  77. package/dist/m/c-RO73MKKR.js +1 -0
  78. package/dist/m/c-SBCBXKOZ.js +26 -0
  79. package/dist/m/{c-J3BXFTZS.js → c-SGRIYOAJ.js} +1 -1
  80. package/dist/m/c-SKF5HL4I.js +4 -0
  81. package/dist/m/{c-W3K23S72.js → c-SRPC3VBE.js} +1 -1
  82. package/dist/m/{c-K76AUL4I.js → c-T5NK2TVY.js} +1 -1
  83. package/dist/m/{c-EFD6QNTE.js → c-TANBH7FI.js} +1 -1
  84. package/dist/m/{c-5734MF2P.js → c-THGQQDYY.js} +1 -1
  85. package/dist/m/{c-YQUJ74R3.js → c-TSBVMWAH.js} +1 -1
  86. package/dist/m/{c-VY6XRBOW.js → c-UD5JZTDL.js} +1 -1
  87. package/dist/m/{c-M4FSPNQ2.js → c-UDGEFWNU.js} +1 -1
  88. package/dist/m/{c-ZSCBEB7I.js → c-UHUNXWKN.js} +1 -1
  89. package/dist/m/{c-BTLFLLML.js → c-VIRFF5HG.js} +1 -1
  90. package/dist/m/{c-2VB555FG.js → c-VYJ7O4RI.js} +1 -1
  91. package/dist/m/{c-TUGVINJR.js → c-W5E5P2TZ.js} +1 -1
  92. package/dist/m/{c-EOCKLMKX.js → c-W7IPVCAA.js} +1 -1
  93. package/dist/m/{c-5FEU5MMY.js → c-WJ5DRBHT.js} +1 -1
  94. package/dist/m/{c-V2J5C5MT.js → c-WQZTI5P2.js} +1 -1
  95. package/dist/m/c-X5WC4PX5.js +1 -0
  96. package/dist/m/{c-GVPNDIKJ.js → c-XCFQEWW6.js} +2 -2
  97. package/dist/m/c-XLQ3BDMM.js +1 -0
  98. package/dist/m/{c-XD5MOROJ.js → c-XX75FFNL.js} +1 -1
  99. package/dist/m/{c-JHJR5BQX.js → c-YK2L436K.js} +1 -1
  100. package/dist/m/{c-MEWUGR4D.js → c-YYMZWQLR.js} +1 -1
  101. package/dist/m/core/{admin-attrs-ZG7R5V3E.js → admin-attrs-U7IJNYBG.js} +1 -1
  102. package/dist/m/core/{autosave-VPORYJSE.js → autosave-F5YQCKVL.js} +1 -1
  103. package/dist/m/core/{conflict-notice-JMAZLVRX.js → conflict-notice-42H4ASLA.js} +1 -1
  104. package/dist/m/core/{persist-3OPWJKZS.js → persist-CJXIL7D4.js} +1 -1
  105. package/dist/m/core/{save-AOJBDSOK.js → save-ESPSQPLV.js} +1 -1
  106. package/dist/m/core/{save-core-IOCMXO5L.js → save-core-6SQHOR6W.js} +1 -1
  107. package/dist/m/core/snapshot-FJP5IJL3.js +1 -0
  108. package/dist/m/core/{unsaved-warning-U5VUJFOE.js → unsaved-warning-HNQVTA2D.js} +1 -1
  109. package/dist/m/internals/{index-HDRANDWE.js → index-NRPNDTSA.js} +1 -1
  110. package/dist/m/loader-FBDE2UAB.js +1 -0
  111. package/dist/m/manifest-1D2F5CA5.js +1 -0
  112. package/dist/m/manifest-edit-F7CC5CFD.js +1 -0
  113. package/dist/m/manifest.json +1139 -1069
  114. package/dist/m/page/{editor-EY2WAAGB.js → editor-OSKOW6RS.js} +2 -2
  115. package/dist/m/plugins/ai-edit-VV4QTINH.js +6 -0
  116. package/dist/m/plugins/cms-H7DTMUQX.js +2235 -0
  117. package/dist/m/plugins/{indicator-4VDXWYTD.js → indicator-WVPGMOZ7.js} +1 -1
  118. package/dist/m/plugins/{live-5EZN2EYP.js → live-DCUBKXY4.js} +1 -1
  119. package/dist/m/plugins/menu-Q4MFFQ6E.js +1 -0
  120. package/dist/m/plugins/{page-LVW5DWA4.js → page-OAWUJQEL.js} +2 -2
  121. package/dist/m/plugins/{page-view-5KQ76IJB.js → page-view-DZ26ZDDQ.js} +1 -1
  122. package/dist/m/plugins/{people-C7TVBBMR.js → people-5XRNRP5U.js} +1 -1
  123. package/dist/m/plugins/{quickcrop-BQ5YYFCH.js → quickcrop-WWF5I422.js} +2 -2
  124. package/dist/m/plugins/{richclay-KLGETK77.js → richclay-PGOOJ4OK.js} +2 -2
  125. package/dist/m/plugins/{sortable-WJZZBM7R.js → sortable-266HY6TR.js} +1 -1
  126. package/dist/m/plugins/{source-CCEUM3OR.js → source-6BKMK4PO.js} +1 -1
  127. package/dist/m/plugins/{upgrade-NW556WJD.js → upgrade-BNZVFHMZ.js} +1 -1
  128. package/dist/m/plugins/visitor-drafts-2AUYKAIJ.js +20 -0
  129. package/dist/m/plugins/{visitor-drafts-owner-MZP45XSG.js → visitor-drafts-owner-Z5B2OQBR.js} +1 -1
  130. package/dist/m/plugins/visitor-menu-4LQMKLPP.js +1 -0
  131. package/dist/m/plugins/{wire-VRYPY6EJ.js → wire-W2EV36KZ.js} +1 -1
  132. package/dist/m/{reader-core-2GXY7SHY.js → reader-core-POFQCKRV.js} +2 -2
  133. package/dist/m/sync/{live-sync-SKPMFYOO.js → live-sync-XGUPHI3I.js} +1 -1
  134. package/dist/m/ui/{index-QNIPDHXQ.js → index-VGYAKAKI.js} +1 -1
  135. package/dist/offline-manifest.json +666 -606
  136. package/docs/guide.md +38 -27
  137. package/package.json +2 -2
  138. package/src/core/save-replace.js +5 -2
  139. package/src/core/serialize-steps.js +10 -2
  140. package/src/core/snapshot.js +37 -1
  141. package/src/core/upgrade-run.js +16 -2
  142. package/src/loader-logic.js +10 -3
  143. package/src/plugins/ai-edit.js +6 -17
  144. package/src/plugins/cms.js +3 -6
  145. package/src/plugins/menu/dom-items.js +45 -0
  146. package/src/plugins/menu/looks.js +32 -0
  147. package/src/plugins/menu/shell-style.js +143 -0
  148. package/src/plugins/menu/shell.js +398 -0
  149. package/src/plugins/menu/style.js +15 -116
  150. package/src/plugins/menu/variants.js +56 -10
  151. package/src/plugins/menu/visitor.js +78 -0
  152. package/src/plugins/menu.js +21 -313
  153. package/src/plugins/visitor-drafts/inert.js +1 -0
  154. package/src/plugins/visitor-drafts/intro-style.js +6 -0
  155. package/src/plugins/visitor-drafts/intro.js +77 -25
  156. package/src/plugins/visitor-drafts/owner-chip.js +18 -23
  157. package/src/plugins/visitor-drafts/prompt.js +2 -2
  158. package/src/plugins/visitor-drafts/store.js +58 -5
  159. package/src/plugins/visitor-drafts.js +1 -0
  160. package/src/plugins/visitor-menu.js +13 -0
  161. package/src/sync/live-sync.js +2 -1
  162. package/src/sync/page-relay.js +2 -2
  163. package/src/ui/bevel.js +1 -1
  164. package/src/ui/page-colour.js +17 -9
  165. package/src/ui/skins/cms.js +1 -1
  166. package/src/ui/skins/quickcrop.js +1 -1
  167. package/src/ui/skins/richclay.js +1 -1
  168. package/src/vendor/hypercms.vendor.js +16 -69
  169. package/dist/m/c-AL4RBJF2.js +0 -1
  170. package/dist/m/c-DDDOKPI6.js +0 -3
  171. package/dist/m/c-EGTIAL6P.js +0 -1
  172. package/dist/m/c-FSWRGBVQ.js +0 -1
  173. package/dist/m/c-HDWZEJHM.js +0 -183
  174. package/dist/m/c-HMYWIHFG.js +0 -1
  175. package/dist/m/c-JH5FF4NL.js +0 -20
  176. package/dist/m/c-M6FNQCTQ.js +0 -1
  177. package/dist/m/c-MHI3GYKF.js +0 -1
  178. package/dist/m/c-MIL4B2JQ.js +0 -1
  179. package/dist/m/c-S5IEIZCN.js +0 -1
  180. package/dist/m/c-VSPAFOKU.js +0 -1
  181. package/dist/m/c-WFMRX5RZ.js +0 -1
  182. package/dist/m/core/snapshot-O7II2AGG.js +0 -1
  183. package/dist/m/loader-ZVPK4ZN3.js +0 -1
  184. package/dist/m/manifest-5498AFD3.js +0 -1
  185. package/dist/m/manifest-edit-62A5A00F.js +0 -1
  186. package/dist/m/plugins/ai-edit-J5VLSW5I.js +0 -6
  187. package/dist/m/plugins/cms-LRAOZHT7.js +0 -2293
  188. package/dist/m/plugins/menu-DM2JHPSR.js +0 -1
  189. package/dist/m/plugins/visitor-drafts-2AWNT23K.js +0 -20
  190. package/src/ui/skins/cms-toggle.js +0 -15
  191. /package/dist/m/plugins/{quickcrop-BQ5YYFCH.js.LEGAL.txt → quickcrop-WWF5I422.js.LEGAL.txt} +0 -0
  192. /package/dist/m/plugins/{richclay-KLGETK77.js.LEGAL.txt → richclay-PGOOJ4OK.js.LEGAL.txt} +0 -0
@@ -0,0 +1,2235 @@
1
+ import{b as Te,e as Hr}from"../c-JAX2667S.js";import{a as Ur}from"../c-5FKRZNJV.js";import"../c-IHUWUKIU.js";import"../c-4JZDZFF6.js";import"../c-EUGJVHDD.js";import"../c-PKCCHJ5X.js";import"../c-NUHP2XDB.js";import"../c-VHNSBD2M.js";var Vr=`@layer clay-skin{
2
+ :is(.hcms-shell):not([data-theme]),:is(.hcms-shell):not([data-theme]) *{--mirk-canvas:light-dark(#FDF8F0, #0B0C13) !important;--mirk-bg:light-dark(#FFFCF6, #11131E) !important;--mirk-fg:light-dark(#2B241B, #ECEAF2) !important;--mirk-accent:light-dark(#F4ECDF, #1A1D2C) !important;--mirk-destructive:light-dark(#A83A2C, #FF5566) !important;--mirk-focus-color:light-dark(#8F6310, #D9A445) !important;--mirk-bevel-bg:light-dark(#F1E7D4, #22273E) !important;--mirk-bevel-fg:light-dark(#2B241B, #ECEAF2) !important;--mirk-bevel-tl:light-dark(#FFF9ED, #3C4260) !important;--mirk-bevel-br:light-dark(#D6C3A5, #1B2033) !important;--mirk-bevel-hover-bg:color-mix(in srgb, light-dark(#F1E7D4, #22273E), light-dark(#FFF9ED, #3C4260) 45%) !important;--mirk-pill-inner-top:light-dark(#FFF9ED, #3C4260) !important;--mirk-input-border:light-dark(#D8C8AF, #353B52) !important;--mirk-placeholder-color:light-dark(#9A8A70, #6A7090) !important;--mirk-ctrl-bg:light-dark(#6B5942, #8A90AB) !important;--mirk-toggle-bg:light-dark(#FCF8F1, #4A5275) !important;--mirk-toggle-hi:light-dark(#FFF9ED, #6C759A) !important;--mirk-toggle-lo:light-dark(#D6C3A5, #1B2033) !important;--mirk-mark-fg:light-dark(#2B241B, #ECEAF2) !important;--mirk-sortable-dot:light-dark(#D8C8AF, #353B52) !important;--mirk-sortable-shadow:light-dark(#D6C3A5, #1B2033) !important;--mirk-sortable-label:light-dark(#6B5942, #8A90AB) !important;--mirk-sortable-placeholder:light-dark(#9A8A70, #6A7090) !important;--mirk-slider-fill:light-dark(#F0E4CC, #3A2F17) !important;--mirk-slider-nub-bg:light-dark(#FCF8F1, #4A5275) !important;--mirk-slider-nub-hi:light-dark(#FFF9ED, #6C759A) !important;--mirk-slider-nub-lo:light-dark(#D6C3A5, #1B2033) !important;--mirk-chip-surface:light-dark(#FFFCF6, #11131E) !important;--mirk-chip-edge:light-dark(#D8C8AF, #353B52) !important;--mirk-chip-primary-bg:light-dark(#2B241B, #ECEAF2) !important;--mirk-chip-primary-fg:light-dark(#FDF8F0, #0B0C13) !important;--mirk-chip-alert:light-dark(#A83A2C, #FF5566) !important;--mirk-radius:0px !important;--mirk-focus-offset:2px !important}
3
+ :is(.hcms-shell){font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace !important}
4
+ .hcms-shell .mirk-chip__actions .mirk-chip__action--primary{--mirk-bevel-bg:var(--mirk-chip-primary-bg) !important;--mirk-bevel-fg:var(--mirk-chip-primary-fg) !important;--mirk-bevel-tl:color-mix(in srgb, var(--mirk-chip-primary-bg), white 24%) !important;--mirk-bevel-br:color-mix(in srgb, var(--mirk-chip-primary-bg), black 32%) !important;--mirk-bevel-hover-bg:color-mix(in srgb, var(--mirk-chip-primary-bg), white 10%) !important}
5
+ }`;var Va=Object.defineProperty,rr=(e,t)=>{for(var r in t)Va(e,r,{get:t[r],enumerable:!0})},Di={};rr(Di,{cms:()=>jr,default:()=>bh});var Bi=["textContent","innerText","innerHTML","outerHTML","value","checked","selected","disabled","readOnly","type","tagName","nodeName","nodeType","nodeValue","childElementCount","id","className","classList","baseURI","offsetWidth","offsetHeight","clientWidth","clientHeight","scrollWidth","scrollHeight","dataset","currentSrc","duration","paused","title","documentURI","contentType"],Wa=new Set(Bi),Ga=new Set(["textContent","innerText","innerHTML","value","checked","selected","disabled","readOnly","type","id","className","title"]),Ii=new Set(["tagName","nodeName","nodeType","nodeValue","childElementCount","classList","baseURI","documentURI","contentType","offsetWidth","offsetHeight","clientWidth","clientHeight","scrollWidth","scrollHeight","currentSrc","duration","paused","dataset"]),Wr=new Set(["checked","selected","disabled","readOnly","paused"]);function Ja(e,t){return t==null?Wr.has(e)?!1:"":Wr.has(e)?t==="false"?!1:!!t:t}function P(e){let t=0,r=null,i=-1;for(let l=0;l<e.length;l++){let a=e[l];a==="\\"?l++:r?a===r&&(r=null):a==='"'||a==="'"?r=a:a==="["||a==="("?t++:a==="]"||a===")"?t>0&&t--:a==="@"&&t===0&&(i=l)}return i}function Xa(e){let t=P(e);return t===-1?{selector:e,prop:null}:{selector:e.slice(0,t),prop:e.slice(t+1)||null}}function Pi(e){let t=0,r=null,i=-1,l=!1;for(let a=0;a<e.length;a++){let o=e[a];o==="\\"?a++:r?o===r&&(r=null):o==='"'||o==="'"?r=o:o==="["||o==="("?t++:o==="]"||o===")"?t>0&&t--:t===0&&o===">"?i=a:t===0&&o===","&&(l=!0)}return l||i===-1||!Ka(e,i+1)?null:e.slice(0,i).trim()||null}function Ka(e,t){let r=t,i=e.replace(/\s+$/,"").length;for(;r<i&&/\s/.test(e[r]);)r++;let l=0,a=null;for(;r<i;r++){let o=e[r];if(o==="\\")r++;else if(a)o===a&&(a=null);else if(o==='"'||o==="'")a=o;else if(o==="["||o==="(")l++;else if(o==="]"||o===")")l>0&&l--;else if(l===0&&(o==="+"||o==="~"||/\s/.test(o)))return!1}return!0}var Hi={};rr(Hi,{EmptyListInsert:()=>$e,MAX_RULE_DEPTH:()=>pt,MaxRuleDepthExceeded:()=>lr,NoRulesTag:()=>eo,RuleTargetReadOnly:()=>Wi,RulesParseError:()=>ir,ShapeMismatch:()=>Vi,UnknownRulesVersion:()=>Ui,WriteNotRoundTripped:()=>Ya,WriteRefused:()=>Za,WriteRejected:()=>to});var ir=class extends Error{constructor(e,t){super(e),this.name="RulesParseError",this.cause=t}},Ui=class extends Error{constructor(e){super(`unknown rules version: ${e}. Library supports "1".`),this.name="UnknownRulesVersion",this.version=e}},pt=20,lr=class extends Error{constructor(e){super(`rule depth exceeded ${pt} at path: ${e.join(".")}`),this.name="MaxRuleDepthExceeded",this.path=e}},Vi=class extends Error{constructor(e){super(`shape mismatch: ${e.length} field(s) failed validation`),this.name="ShapeMismatch",this.mismatches=e}},$e=class extends Error{constructor(e,t){super(t?`cannot add items to empty list at "${e.join(".")}" \u2014 ${t}`:`cannot add items to empty list at "${e.join(".")}" \u2014 no sibling to clone as template. Seed the list with a hidden item first.`),this.name="EmptyListInsert",this.path=e}},Wi=class extends Error{constructor(e){super(`cannot write to read-only DOM property "${e}"`),this.name="RuleTargetReadOnly",this.target=e}},Za=class extends Error{constructor(e){super(`write refused: ${e.length} write(s) broke the content-only policy`),this.name="WriteRefused",this.refusals=e}};function Qa(e){return e.reduce((t,r)=>typeof r=="number"?`${t}[${r}]`:t?`${t}.${r}`:String(r),"")||"(root)"}var Ya=class extends Error{constructor(e){super(`write did not round-trip at "${Qa(e)}"`),this.name="WriteNotRoundTripped",this.path=e}},eo=class extends Error{constructor(e){super(`no <script data-rules-name~="${e}"> rules tag in this document`),this.name="NoRulesTag",this.token=e}},to=class extends Error{constructor(e,t){super(`write rejected: ${e.length} unknown key(s), ${t.length} rule(s) with no matching element`),this.name="WriteRejected",this.unknownKeys=e,this.unmatched=t}},ro=/^--[A-Za-z0-9_-]+$/;function Gi(e){return typeof e=="string"&&ro.test(e)}function Ji(e){let t=[],r=[],i=null,l=0;for(let a=0;a<e.length;a++){let o=e[a];if(i){o==="\\"?a++:o===i&&(i=null);continue}if(o==="/"&&e[a+1]==="*"){let n=e.indexOf("*/",a+2);a=n===-1?e.length:n+1;continue}o==='"'||o==="'"?i=o:o==="("?r.push(")"):o==="["?r.push("]"):o==="{"?r.push("}"):(o===")"||o==="]"||o==="}")&&r[r.length-1]===o?r.pop():o===";"&&r.length===0&&(t.push(e.slice(l,a)),l=a+1)}return t.push(e.slice(l)),t}function io(e){let t="",r=null;for(let i=0;i<e.length;i++){let l=e[i];if(r){t+=l,l==="\\"&&i+1<e.length?t+=e[++i]:l===r&&(r=null);continue}if(l==="/"&&e[i+1]==="*"){let a=e.indexOf("*/",i+2);i=a===-1?e.length:a+1,t+=" ";continue}(l==='"'||l==="'")&&(r=l),t+=l}return t}function Xi(e){e=io(e);let t=e.indexOf(":");if(t===-1)return null;let r=e.slice(0,t).trim(),i=e.slice(t+1).trim(),l=/!\s*important\s*$/i.exec(i);return l&&(i=i.slice(0,l.index).trim()),{name:r,value:i,important:!!l}}function Ki(e,t){if(e==null)return null;let r=null;for(let i of Ji(String(e))){let l=Xi(i);!l||l.name!==t||(!r||l.important||!r.important)&&(r=l)}return r?r.value:null}function lo(e,t,r){let i=e==null?"":String(e),l=r==null||r==="",a=Ji(i),o=a.map(Xi),n=o.some(f=>f&&f.name===t&&f.important),s=[],h=!1;a.forEach((f,m)=>{let u=o[m];if(!u||u.name!==t){s.push(f);return}if(l||h)return;let c=/^\s*/.exec(f)[0];s.push(`${c}${t}: ${r}${n?" !important":""}`),h=!0});let d=s.join(";");if(!l&&!h){let f=d.trimEnd();d=f===""?`${t}: ${r}`:`${f}${f.endsWith(";")?" ":"; "}${t}: ${r}`}return d.trim()===""?null:d}function ao(e,t,r,i){let l=e.attr(t,"style");if((Ki(l,r)??"")===i)return;let a=lo(l,r,i);a==null?e.removeAttr(t,"style"):e.attr(t,"style",a)}function Ft(e,t,r,i={}){if(Object.prototype.hasOwnProperty.call(i,"exclude")&&e.semanticExclude===!1)throw new Error("This adapter does not support semantic exclude queries; omit exclude or use the DOM adapter.");return Dt(e,t,r,{depth:0,path:[]},i)}function Dt(e,t,r,i,l){if(i.depth>pt)throw new lr(i.path);if(typeof r=="string")return oo(e,t,r,i,l);if(Array.isArray(r)){let[a,o]=r,n=e.find(t,a,l);return Zi(l,i,n),n.map((s,h)=>Dt(e,s,o,{depth:i.depth+1,path:[...i.path,h]},l))}if(typeof r=="object"&&r!==null){let a={};for(let[o,n]of Object.entries(r))a[o]=Dt(e,t,n,{depth:i.depth+1,path:[...i.path,o]},l);return a}return null}function oo(e,t,r,i,l){if(r.endsWith("[]")){let n=r.slice(0,-2),s=e.find(t,n,l);return Zi(l,i,s),s.map(h=>e.text(h))}if(r.startsWith("@"))return Gr(e,t,r.slice(1));let a=P(r);if(a!==-1){let n=r.slice(0,a),s=r.slice(a+1),h=n?e.find(t,n,l):[t];return h.length===0?null:Gr(e,h[0],s)}if(r===".")return e.text(t);let o=e.find(t,r,l);return o.length===0?null:e.text(o[0])}function Zi(e,t,r){if(typeof e.onRowsRead=="function")try{e.onRowsRead(t.path.slice(),r)}catch(i){console.warn(`[hyper-html-api] onRowsRead threw at "${t.path.join(".")||"(root)"}"`,i)}}function Gr(e,t,r){if(Gi(r))return Ki(e.attr(t,"style"),r);if(Wa.has(r)){let l=e.prop(t,r);return l==null?null:String(l)}return e.attr(t,r)??null}var ar=Object.freeze({data:Object.freeze({tokens:["no-data"],bundles:["editor-ui"]}),save:Object.freeze({tokens:["no-save"],bundles:["editor-ui"]}),snapshot:Object.freeze({tokens:["no-snapshot"],bundles:["editor-ui"]}),watch:Object.freeze({tokens:["no-watch"],bundles:["editor-ui"]}),undo:Object.freeze({tokens:["no-undo"],bundles:["editor-ui"]}),history:Object.freeze({tokens:[],bundles:["editor-ui"]})}),no=Object.freeze({"editor-ui":Object.freeze(["no-data","no-save","no-snapshot","no-watch","no-undo"])}),so=Object.freeze(["no-save","no-snapshot","no-trigger-autosave","no-dirty","no-watch","no-undo","no-data","freeze","editor-ui","live"]);function tt(e,t){if(!e||e.nodeType!==1)return!1;let r=e.getAttribute?.("clay");return!!(r&&r.split(/\s+/).includes(t)||e.hasAttribute?.(t))}function Qi(e,t){if(tt(e,t))return!0;for(let[r,i]of Object.entries(no))if(i.includes(t)&&tt(e,r))return!0;return!1}function Bt(e){let t=ar[e];if(!t)throw new Error(`Unknown region capability: ${e}`);return[...t.tokens,...t.bundles].flatMap(r=>[`[clay~="${r}"]`,`[${r}]`]).join(", ")}function co(e,t){let r=e&&e.nodeType===1?e:e?.parentElement;for(;r&&r.nodeType===1;){let i=ar[t];if(!i)throw new Error(`Unknown region capability: ${t}`);if(i.tokens.some(l=>Qi(r,l))||i.bundles.some(l=>tt(r,l)))return r;r=r.parentElement}return null}function ho(e,t){return!!co(e,t)}var uo=/:(?:focus(?:-within|-visible)?|hover|active|visited|defined)\b/i;function mo(e,t){if(!/^(INPUT|TEXTAREA|SELECT|OPTION)$/.test(e.tagName||""))return;let r=(e.getAttribute?.("type")||"").toLowerCase();"value"in e&&"value"in t&&e.tagName!=="OPTION"&&r!=="checkbox"&&r!=="radio"&&r!=="file"&&(t.value=e.value),e.tagName==="INPUT"&&(r==="checkbox"||r==="radio")&&(t.checked=e.checked),e.tagName==="OPTION"&&(t.selected=e.selected),"indeterminate"in e&&"indeterminate"in t&&(t.indeterminate=e.indeterminate)}function Jr(e,t,r,i){if(i)return!!e.closest?.(t);let l=e;for(;l?.nodeType===1;){if(l.matches(t))return!0;if(l===r)break;l=l.parentElement}return!1}function Xr(e,t,r,i,l,a){return(a?ho(e,t):Jr(e,r,l,!1))||!!(i&&(a&&e!==l?e.matches(i):Jr(e,i,l,a)))}function po(e,t){let r=ar[t];return r.tokens.some(i=>Qi(e,i))||r.bundles.some(i=>tt(e,i))}var fo=new Set(["INPUT","TEXTAREA","SELECT","OPTION"]);function Yi(e,t,r,i){if(e.nodeType===1&&i(e)){r.dropped.push(t);return}r.cloneToLive.set(t,e),r.liveToClone.set(e,t);let l=e,a=t;if(e.nodeType===1){if(fo.has(e.tagName)&&r.controls.push(e,t),e.tagName==="TEMPLATE"){for(;t.firstChild;)t.removeChild(t.firstChild);l=e.content,a=t.content,r.cloneToLive.set(a,l),r.liveToClone.set(l,a)}}else if(e.nodeType!==11)return;let o=a.firstChild;for(let n=l.firstChild;n&&o;n=n.nextSibling)Yi(n,o,r,i),o=o.nextSibling}function Ue(e,{capability:t="data",exclude:r=null,inherit:i=!0,provenance:l=null}={}){if(!e)throw new TypeError("createContentView requires a DOM context");let a=e.nodeType===9?e:e.ownerDocument;if(!a?.implementation?.createHTMLDocument)throw new TypeError("createContentView requires an HTML DOM implementation");let o=a.implementation.createHTMLDocument(""),n=l||new WeakMap,s=new WeakMap,h=e.nodeType===9?e.documentElement:e;r&&o.documentElement.matches(r);let d=Bt(t),f=i?c=>po(c,t)||!!(r&&c.matches(r)):c=>Xr(c,t,d,r,h,!1),m=null;if(h.nodeType!==1||!Xr(h,t,d,r,h,i)){m=o.importNode(h,!0);let c={cloneToLive:n,liveToClone:s,dropped:[],controls:[]};Yi(h,m,c,f);for(let p of c.dropped)p.remove();for(let p=0;p<c.controls.length;p+=2)mo(c.controls[p],c.controls[p+1])}e.nodeType===9&&m&&(o.replaceChild(m,o.documentElement),s.set(e,o),n.set(o,e));let u=c=>{if(uo.test(c))throw new Error(`Filtered content queries do not support stateful selector: ${c}`)};return{root:m,document:o,capability:t,selector:Bt(t),cloneToLive:n,liveToClone:s,original(c){return n.get(c)||null},cloneOf(c){return s.get(c)||null},query(c,p=m){return u(c),Array.from(p.querySelectorAll(c),b=>n.get(b)||b)},text(c=m){return(c===m?m:s.get(c))?.textContent||""},html(c=m){return(c===m?m:s.get(c))?.innerHTML??""},clone(c=m){let p=c===m?m:s.get(c);return p?o.importNode(p,!0):null}}}function el(e){return e&&e.nodeType===1&&e.tagName==="SCRIPT"&&e.hasAttribute&&e.hasAttribute("data-rules-name")}function go(e){return e?(e.nodeType===9||e.nodeType,e):null}function Kr(e,t,r){!e||e.nodeType!==1||(t==="value"&&e.tagName==="INPUT"?e.value=r===null?"":r:t==="checked"&&e.tagName==="INPUT"?e.checked=r!==null:t==="selected"&&e.tagName==="OPTION"&&(e.selected=r!==null))}function tl(e,t){e&&e.tagName==="TEXTAREA"&&(e.value=t)}function rl(e){if(!e||e.nodeType!==1)return;let t=[e,...e.querySelectorAll?e.querySelectorAll("textarea, input, option"):[]];for(let r of t)if(r.tagName==="TEXTAREA")r.value=r.defaultValue;else if(r.tagName==="INPUT"){let i=r.type;i!=="file"&&i!=="checkbox"&&i!=="radio"&&(r.value=r.defaultValue),r.checked=r.defaultChecked}else r.tagName==="OPTION"&&(r.selected=r.defaultSelected)}var F={semanticExclude:!0,find(e,t,r={}){let i=go(e);if(!i||!i.querySelectorAll)return[];let l=Array.from(i.querySelectorAll(t));r.includeRulesTag||(l=l.filter(n=>!el(n)));let a=[];r.skip&&a.push(r.skip);let o=r.templateAttr===null?null:r.templateAttr||"cms-template";if(o&&a.push("["+o+"]"),a.length){let n=a.join(", ");l=l.filter(s=>!s.closest||!s.closest(n))}return l},parent(e){return e?e.parentElement:null},children(e){return e?Array.from(e.children):[]},matches(e,t){return!!(e&&e.matches)&&e.matches(t)},text(e,t){if(t===void 0)return(e.textContent||"").trim();e.textContent=t,tl(e,t)},attr(e,t,r){if(r===void 0)return e.hasAttribute&&e.hasAttribute(t)?e.getAttribute(t):null;e.setAttribute(t,r),Kr(e,t,r)},removeAttr(e,t){e&&e.removeAttribute&&e.removeAttribute(t),Kr(e,t,null)},prop(e,t,r){if(r===void 0){let i=e?e[t]:void 0;return i!==void 0?i:null}e[t]=r},clone(e){let t=e.cloneNode(!0);return rl(t),t},insertAt(e,t,r){let i=e.children[r]||null;e.insertBefore(t,i)},insertBefore(e,t){e.parentNode.insertBefore(t,e)},insertAfter(e,t){e.parentNode.insertBefore(t,e.nextSibling)},identity(e){return e||null},remove(e){e&&e.parentNode&&e.parentNode.removeChild(e)},replaceWith(e,t){if(!e||!e.parentNode)throw new Error("dom.replaceWith: node has no parent");let r=e.ownerDocument.createElement("template");r.innerHTML=t;let i=r.content.firstElementChild;if(!i)throw new Error("dom.replaceWith: html did not parse to an element");return e.parentNode.replaceChild(i,e),i},stripIds(e){let t=0;return e.id&&(e.removeAttribute("id"),t++),(e.querySelectorAll?e.querySelectorAll("[id]"):[]).forEach(r=>{r.removeAttribute("id"),t++}),t},sameNode(e,t){return e===t}};function pe(e,t={}){if(t.exclude===null)return F;let r=[Bt("data"),t.exclude].filter(Boolean).join(", "),i=e.nodeType===9?e:e.ownerDocument||e,l=e.nodeType===9?e.documentElement:e;if(!t._write&&!l?.matches?.(r)&&!l?.querySelector?.(r)&&!i?.querySelector?.(r))return F;let a=e.nodeType===9||!e.isConnected?e:e.ownerDocument,o=e.nodeType===9?e:e.ownerDocument,n=null,s=()=>n||(n=Ue(a,{capability:"data",exclude:t.exclude||null})),h=c=>{let p=s();return c===e?p.cloneOf(e):p.cloneOf(c)||c},d=c=>n?.original(c)||c,f=(c,p)=>{s().liveToClone.set(c,p),s().cloneToLive.set(p,c);let b=c.childNodes||[],g=p.childNodes||[];for(let k=0;k<Math.min(b.length,g.length);k++)f(b[k],g[k])},m=(c,p,b,g)=>{let k=Array.from(c.childNodes).filter(E=>n.cloneOf(E)),y=k[0];for(;y&&k.includes(y);)y=y.nextSibling;for(let E of k)E.remove();if(b==="innerHTML"){let E=o.createElement("template");E.innerHTML=g;for(let O of Array.from(E.content.childNodes))c.insertBefore(O,y||null)}else c.insertBefore(o.createTextNode(g),y||null),tl(c,g);let _=Ue(c,{capability:"data",exclude:t.exclude||null});p.replaceChildren(...Array.from(_.root?.childNodes||[]));let A=E=>{let O=_.original(E);O&&(n.liveToClone.set(O,E),n.cloneToLive.set(E,O));for(let H of Array.from(E.childNodes||[]))A(H)};for(let E of Array.from(p.childNodes))A(E)},u={...F,find(c,p,b={}){let g=h(c);if(!g?.querySelectorAll)return[];let k=s().query(p,g);b.includeRulesTag||(k=k.filter(A=>!el(A)));let y=[];b.skip&&y.push(b.skip);let _=b.templateAttr===null?null:b.templateAttr||"cms-template";if(_&&y.push(`[${_}]`),y.length){let A=y.join(", ");k=k.filter(E=>!E.closest?.(A))}return k},parent(c){let p=h(c)?.parentElement;return p?d(p):null},children(c){return Array.from(h(c)?.children||[],d)},text(c,p){if(p===void 0){let k=d(c);return!k?.matches?.(r)&&!k?.querySelector?.(r)?F.text(k):(h(c)?.textContent||"").trim()}let b=d(c);if(!b?.matches?.(r)&&!b?.querySelector?.(r)&&!n){F.text(b,p);return}let g=s().cloneOf(b);g?m(b,g,"textContent",p):F.text(b,p)},attr(c,p,b){let g=d(c);if(b===void 0)return F.attr(g,p);F.attr(g,p,b);let k=n?.cloneOf(g);k&&(F.attr(k,p,b),Ue(g,{capability:"data",exclude:t.exclude||null}).root===null&&(k.remove(),n.liveToClone.delete(g),n.cloneToLive.delete(k)))},removeAttr(c,p){let b=d(c);F.removeAttr(b,p);let g=n?.cloneOf(b);g&&F.removeAttr(g,p)},prop(c,p,b){let g=d(c);if(b===void 0)return p==="innerHTML"||p==="outerHTML"||p==="textContent"||p==="innerText"?F.prop(h(g),p):F.prop(g,p);let k=p==="innerHTML"||p==="textContent"||p==="innerText",y=k?s().cloneOf(g):n?.cloneOf(g);y&&k?m(g,y,p,b):(F.prop(g,p,b),y&&F.prop(y,p,b))},clone(c){let p=h(c);if(p===c)return F.clone(c);let b=o.importNode(p,!0);return rl(b),b},insertAt(c,p,b){let g=d(c),k=u.children(g)[b]||(()=>{for(let A=g.children.length-1;A>=0;A--){let E=g.children[A];if(s().cloneOf(E))return E.nextElementSibling}return g.firstElementChild})(),y=d(p);g.insertBefore(y,k||null);let _=s().cloneOf(g);if(_){let A=s().cloneOf(y);A||(A=o.importNode(y,!0),f(y,A));let E=Array.from(_.children);_.insertBefore(A,E[b]||null)}},insertBefore(c,p){let b=d(c),g=d(p);b.parentNode.insertBefore(g,b);let k=s().cloneOf(b.parentNode);if(k){let y=s().cloneOf(g);y||(y=o.importNode(g,!0),f(g,y));let _=s().cloneOf(b);_?_.before(y):k.appendChild(y)}},insertAfter(c,p){let b=d(c),g=d(p);b.parentNode.insertBefore(g,b.nextSibling);let k=s().cloneOf(b.parentNode);if(k){let y=s().cloneOf(g);y||(y=o.importNode(g,!0),f(g,y));let _=s().cloneOf(b);_?_.after(y):k.appendChild(y)}},identity(c){return d(c)||null},remove(c){let p=d(c),b=s().cloneOf(p);F.remove(p),b&&F.remove(b)},replaceWith(c,p){let b=d(c),g=s().cloneOf(b),k=F.replaceWith(b,p);if(g){let y=Ue(k,{capability:"data",exclude:t.exclude||null});if(!y.root)g.remove();else{g.replaceWith(y.root);let _=A=>{let E=y.original(A);E&&(n.liveToClone.set(E,A),n.cloneToLive.set(A,E));for(let O of Array.from(A.childNodes||[]))_(O)};_(y.root)}}return k}};return u}var Ct=F;function bo(e){try{return JSON.parse(e)}catch(t){throw new ir(`Invalid strict JSON: ${t.message}`,t)}}function il(e){try{return JSON.parse(e)}catch{}let t={BRACE_OPEN:"{",BRACE_CLOSE:"}",BRACKET_OPEN:"[",BRACKET_CLOSE:"]",COLON:":",COMMA:",",STRING:"STRING",SELECTOR:"SELECTOR",IDENTIFIER:"IDENTIFIER",NUMBER:"NUMBER",BOOLEAN:"BOOLEAN"};function r(l){let a=[],o=0;for(;o<l.length;){let n=l[o];if(/\s/.test(n)){o++;continue}if("{}".includes(n)){a.push({type:n,value:n}),o++;continue}if(n==="["){let f=!1,m=o+1;for(;m<l.length&&/\s/.test(l[m]);)m++;if(m<l.length&&/[a-zA-Z_]/.test(l[m])&&(f=!0),!f){a.push({type:n,value:n}),o++;continue}}if(n==="]"){a.push({type:n,value:n}),o++;continue}if(n===":"){a.push({type:t.COLON,value:n}),o++;continue}if(n===","){a.push({type:t.COMMA,value:n}),o++;continue}if(n==='"'||n==="'"){let f=n,m=o+1;for(;m<l.length&&l[m]!==f;)l[m]==="\\"&&m++,m++;a.push({type:t.STRING,value:l.substring(o+1,m),quoted:!0,sourceQuote:f}),o=m+1;continue}let s=o,h;for(;s<l.length&&!/[{},]/.test(l[s]);)if(l[s]===":"){let f=[":first",":last",":nth-child",":nth-of-type",":first-child",":last-child",":first-of-type",":last-of-type",":only-child",":only-of-type",":hover",":focus",":active",":visited",":disabled",":enabled",":checked",":empty",":root",":target",":not",":before",":after",":nth-last-child",":nth-last-of-type"],m=!1;for(let u of f){let c=u.substring(1);if(l.substring(s+1,s+1+c.length)===c){m=!0,s+=c.length;break}}if(!m)break}else if(l[s]==="["){for(s++;s<l.length&&l[s]!=="]";){if(l[s]==='"'||l[s]==="'"){let f=l[s];for(s++;s<l.length&&l[s]!==f;)l[s]==="\\"&&s++,s++}s++}s<l.length&&l[s]==="]"&&s++}else s++;h=l.substring(o,s);let d=t.IDENTIFIER;/^-?\d+(\.\d+)?$/.test(h)?d=t.NUMBER:h==="true"||h==="false"||h==="null"?d=t.BOOLEAN:/^[.#@\[]|[.#@\[]| /.test(h)&&(d=t.SELECTOR),a.push({type:d,value:h,quoted:!1}),o=s}return a}function i(l){let a="";for(let o=0;o<l.length;o++){let n=l[o];if("{}".includes(n.type)||"[]".includes(n.type)){a+=n.value;continue}if(n.type===t.COLON){a+=n.value;continue}if(n.type===t.COMMA){let s=l[o+1];if(s&&(s.type==="}"||s.type==="]"))continue;a+=n.value;continue}if(n.type===t.STRING&&n.quoted){let s=n.value;n.sourceQuote==="'"&&(s=s.replace(/\\'/g,"'"),s=s.replace(/(\\*)"/g,(h,d)=>d.length%2===0?d+'\\"':h)),a+=`"${s}"`;continue}if(n.type===t.NUMBER||n.type===t.BOOLEAN){a+=n.value;continue}if(n.type===t.SELECTOR||n.type===t.IDENTIFIER){a+=`"${n.value}"`;continue}a+=`"${n.value}"`}return a}try{let l=r(e),a=i(l);return JSON.parse(a)}catch(l){throw new ir("Invalid extraction rules syntax: "+l.message,l)}}var ko="1",Zr=/^[a-zA-Z0-9_-]+$/;function ll(e,t,r){let i;if(r===void 0)i="script[data-rules-name]";else{if(typeof r!="string"||!Zr.test(r))throw new Error(`hyper-html-api: invalid rules token ${JSON.stringify(r)} (must match ${Zr})`);i=`script[data-rules-name~="${r}"]`}let l=e.find(t,i,{includeRulesTag:!0});if(l.length===0)return null;r!==void 0&&l.length>1&&console.warn(`hyper-html-api: ${l.length} rules tags match data-rules-name~="${r}"; using the first.`);let a=l[0],o=e.attr(a,"data-rules-version");if(o!==ko)throw new Ui(o);return{rules:il(e.text(a)),tagNode:a}}var _h=new Function("url","return import(url)");function vo(e,t,r,i){let l=e.length,a=t.length,o=new Array(l).fill(-1);if(i){let g=new Set;for(let k=0;k<l;k++){let y=i[k];!(y>=0&&y<a)||g.has(y)||(o[k]=y,g.add(y))}}if(l===0||a===0)return o;let n=e.map(g=>Qr(g,r)),s=t.map(g=>Qr(g,r)),h=new Array(a).fill(!1);for(let g of o)g>=0&&(h[g]=!0);let d=new Map;s.forEach((g,k)=>{h[k]||d.set(g,d.has(g)?-1:k)});let f=new Map;n.forEach((g,k)=>{o[k]>=0||f.set(g,(f.get(g)||0)+1)}),n.forEach((g,k)=>{if(o[k]>=0||f.get(g)!==1)return;let y=d.get(g);y===void 0||y===-1||h[y]||(o[k]=y,h[y]=!0)});let m=[];for(let g=0;g<l;g++)o[g]<0&&m.push(g);let u=[];for(let g=0;g<a;g++)h[g]||u.push(g);if(m.length===0||u.length===0)return o;let c=l*a+1,p=yo(e,t,r),b=(g,k)=>p(g,k)*c+Math.abs(g-k);for(let[g,k]of xo(m,u,b))o[g]=k;return o}var al=e=>typeof e=="object"&&e!==null;function Qr(e,t){if(!al(t))return e==null?" null":String(e);let r=Object.keys(t);return JSON.stringify(r.map(i=>{let l=JSON.stringify(e?.[i]);return l===void 0?" undef":l}))}function yo(e,t,r){if(!al(r))return(n,s)=>e[n]===t[s]?0:1;let i=Object.keys(r),l=n=>i.map(s=>JSON.stringify(n?.[s])),a=e.map(l),o=t.map(l);return(n,s)=>{let h=a[n],d=o[s],f=0;for(let m=0;m<i.length;m++)h[m]!==d[m]&&f++;return f}}function xo(e,t,r){return e.length<=t.length?Yr(e,t,r,!1):Yr(t,e,(i,l)=>r(l,i),!0)}function Yr(e,t,r,i){let l=e.length,a=t.length,o=[];for(let f=0;f<=l;f++)o.push(new Float64Array(a+1).fill(1/0));let n=[];for(let f=0;f<=l;f++)n.push(new Uint8Array(a+1));for(let f=0;f<=a;f++)o[l][f]=0;for(let f=l-1;f>=0;f--)for(let m=a-1;m>=0;m--){let u=r(e[f],t[m])+o[f+1][m+1],c=o[f][m+1];u<=c?(o[f][m]=u,n[f][m]=1):o[f][m]=c}let s=[],h=0,d=0;for(;h<l&&d<a;)n[h][d]&&(s.push(i?[t[d],e[h]]:[e[h],t[d]]),h++),d++;return s}function ol(e,t,r,i,l,a,o,n={}){let s=e.find(t,r,n);if(l.length===0){s.forEach(_=>e.remove(_)),It(n,"onRowsApplied",a.path,[]);return}let h=l.length>s.length,d=s[0]||null;if(h&&!d&&(d=Eo(e,t,r,n),!d))throw new $e(a.path);let f=s.map(_=>_o(e,_,i,n)),m=null;if(h&&d){m=e.clone(d),n.templateAttr&&e.removeAttr(m,n.templateAttr);let _=e.stripIds(m);_>0&&console.warn(`[hyper-html-api] stripped ${_} id attribute(s) from cloned template at "${a.path.join(".")||"(root)"}"`)}let u=vo(l,f,i,wo(e,s,l,a,n)),c=s.length>0?e.parent(s[0]):Ro(e,t,r,d,a,n),p=s.length>0?nl(e,c,s[0]):0,b=Lo(e,s),g=new Set,k=[],y=l.map((_,A)=>{let E=u[A];if(E>=0)return g.add(E),k.push(!1),s[E];k.push(!0);let O=e.clone(m);return e.stripIds(O),O});s.forEach((_,A)=>{g.has(A)||e.remove(_)}),b?Oo(e,c,p,y,k):$o(e,y,k,c,p),Ao(e,y,i,l,a,o,n),It(n,"onRowsApplied",a.path,y)}function It(e,t,r,i){if(typeof e[t]=="function")try{return e[t](r.slice(),i)}catch(l){console.warn(`[hyper-html-api] ${t} threw at "${r.join(".")||"(root)"}"`,l);return}}function wo(e,t,r,i,l){let a=It(l,"identifyRows",i.path,r);if(!Array.isArray(a))return null;let o=new Array(r.length).fill(-1),n=new Set,s=new Map(t.map((h,d)=>[e.identity(h),d]));for(let h=0;h<r.length;h++){if(!a[h])continue;let d=s.get(e.identity(a[h]));d===void 0||n.has(d)||(o[h]=d,n.add(d))}return o}function Ao(e,t,r,i,l,a,o){t.forEach((n,s)=>{if(r===null){let h=i[s],d=h==null?"":String(h);e.text(n)!==d&&e.text(n,d)}else{let h=a(e,n,r,i[s],{depth:l.depth+1,path:[...l.path,s]},o);h&&h!==n&&(t[s]=h)}})}function _o(e,t,r,i){return r===null?e.text(t):Ft(e,t,r,i.onRowsRead?{...i,onRowsRead:void 0}:i)}function nl(e,t,r){let i=e.children(t);for(let l=0;l<i.length;l++)if(e.sameNode(i[l],r))return l;return-1}function Eo(e,t,r,i){if(!i.templateAttr)return null;let l=/^\s*:scope\s*>\s*/.test(r),a=new RegExp(":not\\(\\["+i.templateAttr.replace(/[.*+?^${}()|[\]\\-]/g,"\\$&")+"\\]\\)","g"),o=r.replace(/^\s*:scope\s*>\s*/,"").replace(a,""),n=l?So(o):0,s=Pi(o),h=t;for(;h;){let d=e.find(h,o,{includeRulesTag:!1,templateAttr:null});for(let f of d)if(e.attr(f,i.templateAttr)!=null&&!(l&&!To(e,t,f,n))&&!(s&&!e.matches(e.parent(f),s)))return f;h=e.parent(h)}return null}function So(e){let t=0,r=null,i=1;for(let l=0;l<e.length;l++){let a=e[l];if(a==="\\")l++;else if(r)a===r&&(r=null);else if(a==='"'||a==="'")r=a;else if(a==="["||a==="(")t++;else if(a==="]"||a===")")t>0&&t--;else if(t===0&&a===">")i++;else{if(t===0&&(a==="+"||a==="~"))return null;if(t===0&&/\s/.test(a)){if(!Co(e,l))return null;for(;l+1<e.length&&/\s/.test(e[l+1]);)l++}}}return i}function Co(e,t){let r=t;for(;r<e.length&&/\s/.test(e[r]);)r++;let i=t>0?e[t-1]:"",l=r<e.length?e[r]:"";return ei(i)||ei(l)}function ei(e){return e===">"||e==="+"||e==="~"}function To(e,t,r,i){if(i===null)return!0;let l=r;for(let s=0;s<i;s++)if(l=e.parent(l),!l)return!1;let a=e.prop(t,"tagName");if(!a)return!0;let o=e.prop(l,"tagName");if(!o||String(o).toLowerCase()!==String(a).toLowerCase())return!1;let n=new Set(ti(e,l));return ti(e,t).every(s=>n.has(s))}function ti(e,t){let r=e.attr(t,"class");return r?String(r).split(/\s+/).filter(Boolean):[]}function Ro(e,t,r,i,l,a){let o=e.parent(i);if(o&&qo(e,t,o)&&!ii(e,o,a))return o;let n=Pi(r);if(!n)throw new $e(l.path,`the list selector "${r}" names no container to hold the new rows \u2014 write it as "container > row" (for example "ol.comments > li") so the cloned row lands in the list`);let s=(n===":scope"?e.prop(t,"tagName")?[t]:[]:e.find(t,n,a)).filter(h=>!ii(e,h,a));if(s.length===0)throw new $e(l.path,`no container matching "${n}" inside this context to hold the new rows`);if(s.length>1)throw new $e(l.path,`"${n}" matches ${s.length} containers inside this context, so the new rows have no single destination`);return s[0]}function qo(e,t,r){let i=r;for(;i;){if(e.sameNode(i,t))return!0;i=e.parent(i)}return e.parent(t)?!1:e.find(t,"*",{includeRulesTag:!0,templateAttr:null}).some(l=>e.sameNode(l,r))}var ri=["no-data","editor-ui"];function ii(e,t,r){let i=t;for(;i;){if(r.templateAttr&&e.attr(i,r.templateAttr)!=null||ri.some(a=>e.attr(i,a)!=null))return!0;let l=e.attr(i,"clay");if(l&&l.split(/\s+/).some(a=>ri.includes(a)))return!0;i=e.parent(i)}return!1}function Oo(e,t,r,i,l){let a=e.children(t),o=a.map(s=>e.identity(s)),n=!1;i.forEach((s,h)=>{let d=e.identity(s),f=r+h;if(o[f]===d)return;if(!l[h]){let u=o.indexOf(d);u!==-1&&(o.splice(u,1),a.splice(u,1))}let m=Math.min(f,a.length);m<a.length?e.insertBefore(a[m],s):a.length?n?e.insertAfter(a[a.length-1],s):(e.insertAt(t,s,f),n=!0):e.insertAt(t,s,0),o.splice(m,0,d),a.splice(m,0,s)})}function Lo(e,t){if(t.length<=1)return!0;let r=e.parent(t[0]);if(!r)return!1;let i=new Map(e.children(r).map((a,o)=>[e.identity(a),o])),l=[];for(let a of t){let o=i.get(e.identity(a));if(o===void 0)return!1;l.push(o)}return l.sort((a,o)=>a-o),l[l.length-1]-l[0]===l.length-1}function $o(e,t,r,i,l){let a=null,o=l;for(let n=0;n<t.length;n++){if(!r[n]){a=t[n];continue}let s=a?e.parent(a):i;if(!s)continue;let h=a?nl(e,s,a)+1:o++;e.insertAt(s,t[n],h),a=t[n]}}function li(e,t,r,i,l={}){if(Object.prototype.hasOwnProperty.call(l,"exclude")&&e.semanticExclude===!1)throw new Error("This adapter does not support semantic exclude queries; omit exclude or use the DOM adapter.");let a=[];if(Pt(r,i,[],a),a.length)throw new Vi(a);rt(e,t,r,i,{depth:0,path:[]},l)}function rt(e,t,r,i,l,a={}){if(l.depth>pt)throw new lr(l.path);if(i===void 0)return t;if(typeof r=="string")return jo(e,t,r,i,l,a);if(Array.isArray(r)){let[o,n]=r;return ol(e,t,o,n,i,l,rt,a),t}if(typeof r=="object"&&r!==null){for(let[o,n]of Object.entries(r)){let s=rt(e,t,n,i==null?i:i[o],{depth:l.depth+1,path:[...l.path,o]},a);s&&s!==t&&(t=s)}return t}return t}function jo(e,t,r,i,l,a){if(r.endsWith("[]")){let s=r.slice(0,-2);return ol(e,t,s,null,i,l,rt,a),t}if(r.startsWith("@"))return oi(e,t,r.slice(1),i);let o=P(r);if(o!==-1){let s=r.slice(0,o),h=r.slice(o+1),d=s?e.find(t,s,a):[t];return d.length===0||oi(e,d[0],h,i),t}if(r===".")return ai(e,t,i),t;let n=e.find(t,r,a);return n.length===0||ai(e,n[0],i),t}function ai(e,t,r){let i=r==null?"":String(r);e.text(t)!==i&&e.text(t,i)}function Mo(e,t,r,i){if(e.styleVar){e.styleVar(t,r,i);return}ao(e,t,r,i)}function oi(e,t,r,i){if(Gi(r))return Mo(e,t,r,i==null?"":String(i).trim()),t;if(Ii.has(r)){let l=e.prop(t,r);if(l===i||l!=null&&i!=null&&String(l)===String(i))return t;throw new Wi(r)}if(r==="outerHTML"){let l=i==null?"":String(i);return e.replaceWith(t,l)}if(Ga.has(r)){let l=Ja(r,i);return e.prop(t,r)!==l&&e.prop(t,r,l),t}if(i==null)e.attr(t,r)!=null&&e.removeAttr(t,r);else{let l=String(i);e.attr(t,r)!==l&&e.attr(t,r,l)}return t}function Pt(e,t,r,i){if(t!==void 0){if(typeof e=="string"){if(e.endsWith("[]")){Array.isArray(t)?t.forEach((l,a)=>{typeof l=="object"&&l!==null&&i.push({path:qe([...r,a]),expected:"scalar",got:Re(l)})}):i.push({path:qe(r),expected:"array",got:Re(t)});return}t!==null&&typeof t=="object"&&i.push({path:qe(r),expected:"scalar",got:Re(t)});return}if(Array.isArray(e)){if(!Array.isArray(t)){i.push({path:qe(r),expected:"array",got:Re(t)});return}let l=e[1];t.forEach((a,o)=>Pt(l,a,[...r,o],i));return}if(typeof e=="object"&&e!==null){if(t===null||Array.isArray(t)||typeof t!="object"){i.push({path:qe(r),expected:"object",got:Re(t)});return}for(let[l,a]of Object.entries(e))Pt(a,t[l],[...r,l],i)}}}function Re(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function qe(e){return e.join(".")}var No=Object.freeze({refusedRuleForms:["innerHTML","outerHTML"],refusedTargets:["script","style","template","noscript","iframe","object","embed","xmp","plaintext","noembed","noframes","meta","link","base","animate","set","animatemotion","animatetransform"],refusedAttributes:["style","srcdoc","is","http-equiv","sandbox","allow","nonce","integrity","charset","htmlclaytoken","htmlclayid","data-rules-name","data-rules-version","clay","contenteditable",...so],refusedAttributePrefixes:["on"],urlAttributes:["href","src","srcset","action","formaction","poster","cite","data","ping","background","longdesc","usemap","xlink:href","manifest","codebase","icon"],refusedSchemes:["javascript","vbscript","data"],customPropertyValues:Object.freeze({maxLength:200,refusedCharacters:[";","{","}","<",">","\\"],refusedFunctions:["url","src","image","image-set","-webkit-image-set","cross-fade","element","expression","paint"]})});function zo(e){if(/[\u0000-\u001f\u007f]/.test(e))return"control characters are not allowed in a custom property value";let t=[],r=null;for(let i=0;i<e.length;i++){let l=e[i];if(r){l===r&&(r=null);continue}if(l==='"'||l==="'")r=l;else{if(l==="/"&&e[i+1]==="*")return"comments are not allowed in a custom property value";if(l==="(")t.push(")");else if(l==="[")t.push("]");else if((l===")"||l==="]")&&t.pop()!==l)return`"${l}" does not close anything in this custom property value`}}return r?"a custom property value must close its quotes":t.length?"a custom property value must close its brackets":null}function Fo(e,t=No){let r=t.customPropertyValues,i=String(e);if(i.length>r.maxLength)return`custom property values are limited to ${r.maxLength} characters`;let l=r.refusedCharacters.find(s=>i.includes(s));if(l)return`${JSON.stringify(l)} is not allowed in a custom property value`;let a=zo(i);if(a)return a;let o=i.toLowerCase(),n=r.refusedFunctions.find(s=>new RegExp(`(^|[^a-z0-9_-])${s.replace(/[-]/g,"\\-")}\\s*\\(`).test(o));return n?`"${n}()" is not allowed in a custom property value`:null}function ni(e,t,r){if(r&&typeof r=="object")return{rules:r,tagNode:null};if(typeof r=="string"){let i=t&&t.ownerDocument?t.ownerDocument:t;return ll(e,i,r)}return null}var X={extract:(e,t,r={})=>Ft(pe(e,r),e,t,r),apply:(e,t,r,i={})=>li(pe(e,{...i,_write:!0}),e,t,r,i),findRulesIn:(e,t)=>ll(Ct,e,t),findRules:(e,t)=>ni(Ct,e,t),bind:(e,t,r={})=>{let i=ni(Ct,e,t);if(!i){let l=typeof t=="string"?`data-rules-name~="${t}"`:"the provided rules object";throw new Error(`hyper-html-api: could not resolve rules for ${l}`)}return{...i,get:()=>Ft(pe(e,r),e,i.rules,r),set:l=>li(pe(e,{...r,_write:!0}),e,i.rules,l,r)}},parseStrict:bo,parseRelaxed:il,ruleAttrIndex:P,splitRule:Xa,errors:Hi,DOM_PROPERTIES:Bi},sl={};rr(sl,{fromString:()=>be,getRuleAtPath:()=>Fe,getValueAtPath:()=>Bo,setAtPath:()=>Ht,toString:()=>Do});function Do(e){return e.map(String).join(".")}function be(e){return e===""?[]:e.split(".").map(t=>/^\d+$/.test(t)?Number(t):t)}function Fe(e,t){let r=e;for(let i of t){if(r==null)return;if(typeof r=="string"){if(r.endsWith("[]")&&(typeof i=="number"||i==="*")){r=r.slice(0,-2);continue}return}if(Array.isArray(r)){if(typeof i!="number"&&i!=="*")return;r=r[1];continue}if(typeof r=="object"){if(typeof i=="number"||!(i in r))return;r=r[i];continue}return}return r}function Bo(e,t){let r=e;for(let i of t){if(r==null)return;r=r[i]}return r}function Ht(e,t,r){if(t.length===0)return r;let[i,...l]=t;if(typeof i=="number"){let a=Array.isArray(e)?[...e]:[];return a[i]=Ht(a[i],l,r),a}return{...e&&typeof e=="object"?e:{},[i]:Ht((e||{})[i],l,r)}}function or(e){if(typeof e=="string")return e.endsWith("[]")?[]:"";if(Array.isArray(e))return[];if(typeof e=="object"&&e!==null){let t={};for(let[r,i]of Object.entries(e))t[r]=or(i);return t}return""}function cl(e,t,{ignoreActiveValue:r=!0}={}){Hr.morph(e,t,{morphStyle:"innerHTML",ignoreActiveValue:r,restoreFocus:!0,formStateSync:"property",policy:"raw"})}var hl=new WeakMap,Ut=e=>e.map(String).join(".");function Io(e){return typeof CSS<"u"&&CSS.escape?CSS.escape(e):String(e).replace(/[^a-zA-Z0-9_\-.*]/g,t=>"\\"+t)}function dl(e,t){if(!e||!e.querySelector)return null;let r=e.querySelector(`[data-hcms-path="${Io(t)}"]`),i=r&&r.querySelector(".hcms-array-items");return i?Array.from(i.children).filter(l=>l.matches&&l.matches("[data-hcms-card], [data-hcms-array-item]")):null}function ul(e,t,r){let i=dl(e,t);!i||i.length!==r.length||i.forEach((l,a)=>{r[a]&&hl.set(l,r[a])})}function ml(){let e=new Map;return{hooks:{onRowsRead(t,r){e.set(Ut(t),r)}},seed(t){for(let[r,i]of e)ul(t,r,i);e.clear()}}}function Po(e){return{identifyRows(t,r){let i=dl(e,Ut(t));return!i||i.length!==r.length?null:i.map(l=>hl.get(l)||null)},onRowsApplied(t,r){ul(e,Ut(t),r)}}}function oe(e){return e&&e.nodeType===9?e.body||e.documentElement:e}function pl(e,t){if(!t||t.nodeType!==9)return e;return r(e);function r(i){if(typeof i=="string")return i==="."?"body":i.startsWith("@")?`body${i}`:i;if(Array.isArray(i)||!i||typeof i!="object")return i;let l={};for(let[a,o]of Object.entries(i))l[a]=r(o);return l}}var si={skip:"[data-hcms-shell]",templateAttr:"cms-template"},Vt="data-hcms-rollback-ui",Ho=0;function Uo(e,t,r,i={}){return Vo(e,t,r,i)}function Vo(e,t,r,i){let{shellRoot:l,structural:a,structuralPath:o,formRoot:n}=i,s=n?{...si,...Po(n)}:si;if(!a)try{return X.apply(e,t,r,s),{ok:!0}}catch(m){return{ok:!1,error:m}}let h=Wo(e,t,o),d=h?Jo(h):null,f=h?null:Ko(oe(e),l);try{return X.apply(e,t,r,s),{ok:!0}}catch(m){return d?Xo(h,d):f&&Zo(oe(e),l,f),{ok:!1,error:m}}}function Wo(e,t,r){if(!r||!e)return null;let i=be(r),l=[],a=t;for(let o of i){if(typeof a=="string"||a==null||Array.isArray(a))break;if(typeof a=="object"&&o in a){if(l.push(o),a=a[o],Array.isArray(a)||typeof a=="string"&&a.endsWith("[]"))break}else return null}return!Array.isArray(a)&&!(typeof a=="string"&&a.endsWith("[]"))?null:Go(e,t,l)}function Go(e,t,r){if(r.length===0)return null;let i=e,l=t;for(let a=0;a<r.length;a++){let o=r[a];if(!l||typeof l!="object"||Array.isArray(l))return null;let n=l[o];if(n==null)return null;if(a===r.length-1){if(Array.isArray(n)){let[s]=n;return i.querySelector?.(s)?.parentElement||null}if(typeof n=="string"&&n.endsWith("[]")){let s=n.slice(0,-2);return i.querySelector?.(s)?.parentElement||null}return null}l=n}return null}function Jo(e){let t=[],r=[];for(let i of Array.from(e.childNodes))t.push(nr(i,r));return{nodes:t,retained:r}}function Xo(e,t){let r=e.cloneNode(!1);for(let i of t.nodes)r.appendChild(i);Te(e,Array.from(r.childNodes),gl()),fl(e,t.retained)}function Ko(e,t){let r=[],i=[];for(let l of Array.from(e.childNodes))l===t||t&&l.contains?.(t)||r.push(nr(l,i));return{nodes:r,retained:i}}function Zo(e,t,r){let i=e.cloneNode(!1);for(let l of r.nodes)i.appendChild(l);Te(e,Array.from(i.childNodes),gl()),fl(e,r.retained)}function nr(e,t){let r=e.cloneNode(!1);if(e.nodeType===1&&e.matches('[editor-ui],[clay~="editor-ui"]')){let a=String(++Ho);r.setAttribute(Vt,a),t.push({id:a,node:e})}let i=e.nodeType===1&&e.tagName==="TEMPLATE"?e.content:e,l=r.nodeType===1&&r.tagName==="TEMPLATE"?r.content:r;for(let a of Array.from(i.childNodes||[]))l.appendChild(nr(a,t));return r}function fl(e,t){for(let{id:r,node:i}of t){let l=e.querySelector(`[${Vt}="${r}"]`);l===i?i.removeAttribute(Vt):i.isConnected?l?.remove():l?.replaceWith(i)}}function gl(){return{morphStyle:"innerHTML",policy:"raw",restoreFocus:!1,scripts:{handle:!1,merge:!1}}}var Qo=/^--font-(size|weight|style|stretch|variant|feature-settings|variation-settings|optical-sizing|kerning|synthesis|smoothing|palette|size-adjust|display)(-|$)/;function De(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/[-_]/g," ").replace(/\s+/g," ").trim().replace(/^./,t=>t.toUpperCase())}var Yo='<div class="hcms-drag-handle mirk-sortable__grip" aria-hidden="true"><div class="mirk-sortable__dots"><span class="mirk-sortable__dot"></span><span class="mirk-sortable__dot"></span><span class="mirk-sortable__dot"></span><span class="mirk-sortable__dot"></span><span class="mirk-sortable__dot"></span><span class="mirk-sortable__dot"></span><span class="mirk-sortable__dot"></span><span class="mirk-sortable__dot"></span></div></div>',Ve='<svg class="hcms-x" viewBox="0 0 16 16" shape-rendering="crispEdges" aria-hidden="true"><path d="M4 4 L12 12 M12 4 L4 12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="square"></path></svg>',bl={"@scalar":`
6
+ <label class="hcms-field" data-hcms-shape="scalar">
7
+ <span class="hcms-label" data-hcms-label></span>
8
+ <textarea class="mirk-textarea" rows="1" data-hcms-field></textarea>
9
+ <div class="hcms-error" hidden></div>
10
+ </label>
11
+ `,"@object":`
12
+ <section class="hcms-object" data-hcms-shape="object">
13
+ <h3 class="hcms-object-title" data-hcms-label></h3>
14
+ <div class="hcms-object-fields"></div>
15
+ <div class="hcms-error" hidden></div>
16
+ </section>
17
+ `,"@scalar-array":`
18
+ <section class="hcms-array hcms-scalar-array" data-hcms-shape="scalar-array">
19
+ <header class="hcms-array-header">
20
+ <h3 class="hcms-array-title" data-hcms-label></h3>
21
+ </header>
22
+ <ul class="hcms-array-items"></ul>
23
+ <div class="hcms-error" hidden></div>
24
+ <button type="button" class="hcms-add mirk-button mirk-button--small" data-hcms-action="add"><span class="mirk-button__label">+ Add</span></button>
25
+ </section>
26
+ `,"@scalar-array-item":`
27
+ <li class="hcms-array-item" draggable="true">
28
+ <input class="mirk-input" data-hcms-field />
29
+ <button type="button" class="hcms-move hcms-move-up hcms-sr-only" data-hcms-action="move-up" aria-label="Move up">\u2191</button>
30
+ <button type="button" class="hcms-move hcms-move-down hcms-sr-only" data-hcms-action="move-down" aria-label="Move down">\u2193</button>
31
+ <button type="button" class="hcms-remove" data-hcms-action="remove" aria-label="Remove">\xD7</button>
32
+ <div class="hcms-error" hidden></div>
33
+ </li>
34
+ `,"@object-array":`
35
+ <section class="hcms-array hcms-object-array hcms-array--cards" data-hcms-shape="object-array">
36
+ <header class="hcms-array-header">
37
+ <h3 class="hcms-array-title" data-hcms-label></h3>
38
+ </header>
39
+ <div class="hcms-array-items"></div>
40
+ <div class="hcms-error" hidden></div>
41
+ <button type="button" class="hcms-add mirk-button mirk-button--small" data-hcms-action="add"><span class="mirk-button__label">+ Add</span></button>
42
+ </section>
43
+ `,"@object-array-item":`
44
+ <article class="hcms-card mirk-sortable__item" draggable="true">
45
+ ${Yo}
46
+ <div class="hcms-card-body mirk-sortable__body">
47
+ <div class="hcms-card-fields"></div>
48
+ <div class="hcms-card-controls">
49
+ <button type="button" class="hcms-move hcms-move-up hcms-sr-only" data-hcms-action="move-up" aria-label="Move up">\u2191</button>
50
+ <button type="button" class="hcms-move hcms-move-down hcms-sr-only" data-hcms-action="move-down" aria-label="Move down">\u2193</button>
51
+ <button type="button" class="hcms-remove hcms-remove--card" data-hcms-action="remove" aria-label="Remove">${Ve}</button>
52
+ </div>
53
+ </div>
54
+ <div class="hcms-error" hidden></div>
55
+ </article>
56
+ `,"@file":`
57
+ <div class="hcms-field hcms-upload hcms-upload--file" data-hcms-shape="scalar">
58
+ <span class="hcms-label" data-hcms-label></span>
59
+ <div class="mirk-file mirk-file--compact mirk-file--round">
60
+ <label class="mirk-button mirk-button--round mirk-button--small">
61
+ <input type="file" data-hcms-upload />
62
+ <span class="mirk-button__label">Choose</span>
63
+ </label>
64
+ <a class="mirk-file__name" data-hcms-field></a>
65
+ <button type="button" class="hcms-upload-clear" data-hcms-action="clear-upload" aria-label="Remove file">${Ve}</button>
66
+ </div>
67
+ <div class="hcms-error" hidden></div>
68
+ </div>
69
+ `,"@image":`
70
+ <div class="hcms-field hcms-upload hcms-upload--image" data-hcms-shape="scalar">
71
+ <span class="hcms-label" data-hcms-label></span>
72
+ <div class="mirk-image mirk-image--compact mirk-image--rounded">
73
+ <label class="mirk-button mirk-button--small mirk-image__upload">
74
+ <input type="file" accept="image/*" data-hcms-upload />
75
+ <span class="mirk-button__label">Upload image</span>
76
+ </label>
77
+ <figure class="mirk-image__thumb">
78
+ <span class="mirk-image__frame"><img class="mirk-image__preview" data-hcms-field alt="" /></span>
79
+ <button type="button" class="hcms-upload-clear hcms-upload-clear--badge" data-hcms-action="clear-upload" aria-label="Remove image">${Ve}</button>
80
+ </figure>
81
+ </div>
82
+ <div class="hcms-error" hidden></div>
83
+ </div>
84
+ `,"@checkbox":`
85
+ <div class="hcms-field hcms-field--row" data-hcms-shape="scalar">
86
+ <span class="hcms-label" data-hcms-label></span>
87
+ <label class="mirk-checkbox">
88
+ <input type="checkbox" class="mirk-sr-only" data-hcms-field />
89
+ <span class="mirk-checkbox__box"><span class="mirk-checkbox__mark"></span></span>
90
+ </label>
91
+ <div class="hcms-error" hidden></div>
92
+ </div>
93
+ `,"@toggle":`
94
+ <div class="hcms-field hcms-field--row" data-hcms-shape="scalar">
95
+ <span class="hcms-label" data-hcms-label></span>
96
+ <label class="mirk-toggle">
97
+ <input type="checkbox" role="switch" class="mirk-sr-only" data-hcms-field />
98
+ <span class="mirk-toggle__track"><span class="mirk-toggle__thumb"></span></span>
99
+ </label>
100
+ <div class="hcms-error" hidden></div>
101
+ </div>
102
+ `,"@select":`
103
+ <label class="hcms-field" data-hcms-shape="scalar">
104
+ <span class="hcms-label" data-hcms-label></span>
105
+ <div class="mirk-select">
106
+ <select class="mirk-select__field" data-hcms-field></select>
107
+ <span aria-hidden="true" class="mirk-select__chevron">\u203A</span>
108
+ </div>
109
+ <div class="hcms-error" hidden></div>
110
+ </label>
111
+ `,"@radio":`
112
+ <div class="hcms-field" data-hcms-shape="scalar">
113
+ <span class="hcms-label" data-hcms-label></span>
114
+ <div class="hcms-radio-row">
115
+ <label class="mirk-radio">
116
+ <input type="radio" class="mirk-sr-only" data-hcms-field />
117
+ <span class="mirk-radio__ring"><span class="mirk-radio__fill"></span><span class="mirk-radio__dot"></span></span>
118
+ <span class="mirk-radio__label"></span>
119
+ </label>
120
+ </div>
121
+ <div class="hcms-error" hidden></div>
122
+ </div>
123
+ `,"@textarea":`
124
+ <label class="hcms-field" data-hcms-shape="scalar">
125
+ <span class="hcms-label" data-hcms-label></span>
126
+ <textarea class="mirk-textarea" rows="3" data-hcms-field></textarea>
127
+ <div class="hcms-error" hidden></div>
128
+ </label>
129
+ `,"@richtext":`
130
+ <div class="hcms-field" data-hcms-shape="scalar">
131
+ <span class="hcms-label" data-hcms-label></span>
132
+ <div class="mirk-textarea hcms-richtext" contenteditable="true" data-hcms-field></div>
133
+ <div class="hcms-error" hidden></div>
134
+ </div>
135
+ `,"@number":`
136
+ <label class="hcms-field" data-hcms-shape="scalar">
137
+ <span class="hcms-label" data-hcms-label></span>
138
+ <input class="mirk-input" type="number" data-hcms-field />
139
+ <div class="hcms-error" hidden></div>
140
+ </label>
141
+ `,"@color":`
142
+ <div class="hcms-field hcms-color" data-hcms-shape="scalar">
143
+ <span class="hcms-label" data-hcms-label></span>
144
+ <input type="hidden" data-hcms-field />
145
+ <div class="hcms-color-row">
146
+ <button type="button" class="hcms-color-current" data-hcms-action="color-panel" aria-expanded="false">
147
+ <span class="hcms-color-chip"></span>
148
+ <span class="hcms-color-name"></span>
149
+ </button>
150
+ <button type="button" class="hcms-color-clear" data-hcms-action="color-clear" aria-label="Clear color">${Ve}</button>
151
+ </div>
152
+ <div class="hcms-color-panel" hidden>
153
+ <div class="hcms-color-grid"></div>
154
+ <div class="hcms-color-custom">
155
+ <input type="color" class="hcms-color-native" data-hcms-color-input="native" aria-label="Pick a custom color" />
156
+ <input class="mirk-input hcms-color-text" data-hcms-color-input="text" spellcheck="false" autocomplete="off" placeholder="Any CSS color" aria-label="Custom color" />
157
+ </div>
158
+ </div>
159
+ <div class="hcms-error" hidden></div>
160
+ </div>
161
+ `,"@font":`
162
+ <div class="hcms-field hcms-font" data-hcms-shape="scalar">
163
+ <span class="hcms-label" data-hcms-label></span>
164
+ <input type="hidden" data-hcms-field />
165
+ <button type="button" class="hcms-font-current" data-hcms-action="font-panel" aria-haspopup="listbox" aria-expanded="false">
166
+ <span class="hcms-font-name"></span>
167
+ <span aria-hidden="true" class="hcms-font-chevron">\u203A</span>
168
+ </button>
169
+ <div class="hcms-font-panel" hidden>
170
+ <div class="hcms-font-list" role="listbox"></div>
171
+ </div>
172
+ <div class="hcms-error" hidden></div>
173
+ </div>
174
+ `,"@variant":`
175
+ <div class="hcms-field hcms-variant" data-hcms-shape="scalar">
176
+ <span class="hcms-label" data-hcms-label></span>
177
+ <div class="hcms-variant-row" role="radiogroup">
178
+ <label class="hcms-variant-option">
179
+ <input type="radio" class="mirk-sr-only" data-hcms-field />
180
+ <span class="hcms-variant-icon"></span>
181
+ <span class="hcms-variant-label"></span>
182
+ </label>
183
+ </div>
184
+ <div class="hcms-error" hidden></div>
185
+ </div>
186
+ `,"@chips":`
187
+ <div class="hcms-field hcms-chips" data-hcms-shape="scalar-array">
188
+ <span class="hcms-label" data-hcms-label></span>
189
+ <div class="mirk-tags hcms-array-items"></div>
190
+ <button type="button" class="hcms-add mirk-button mirk-button--small" data-hcms-action="add"><span class="mirk-button__label">+ Add</span></button>
191
+ <div class="hcms-error" hidden></div>
192
+ </div>
193
+ `,"@chips-item":`
194
+ <span class="mirk-tags__chip" data-hcms-array-item>
195
+ <input class="hcms-chip-field" data-hcms-field aria-label="Item" placeholder="\u2026" />
196
+ <button type="button" class="hcms-remove" data-hcms-action="remove" aria-label="Remove">\xD7</button>
197
+ </span>
198
+ `},en=["@scalar","@object","@scalar-array","@scalar-array-item","@object-array","@object-array-item"];function kl(e){let t=e.head||e.documentElement;if(t)for(let r of en)Al(e,t,r)}function Tt(e,t){if(!bl[t])return null;let r=e&&(e.head||e.documentElement);return r?Al(e,r,t):null}var ci={src:"@image",checked:"@checkbox",innerHTML:"@richtext"},it={image:"@image",file:"@file",checkbox:"@checkbox",toggle:"@toggle",select:"@select",radio:"@radio",textarea:"@textarea",number:"@number",richtext:"@richtext",color:"@color",font:"@font",variant:"@variant"},tn=new Set([...Object.values(it),"@chips","@chips-item"]);function Ie(e,t,r,i){if(typeof e!="string")return"@scalar";let l=P(e),a=xl(e,l,r,i),o=ft(e,l,r,i,t,"data-hcms-component");if(o&&it[o]){let n=it[o],s=Array.isArray(r)&&r.some(h=>h==="*"||typeof h=="number");return n==="@number"&&!hi(e,l,t,s,a).every(nn)||(n==="@checkbox"||n==="@toggle")&&(l<0||e.slice(l+1)!=="checked")&&!hi(e,l,t,s,a).every(sn)?"@scalar":n}if(l>=0){let n=e.slice(l+1);if(ci[n])return ci[n];if(/^--color(-|$)/.test(n)&&n!=="--color-scheme")return"@color";if(/^--font(-|$)/.test(n)&&!Qo.test(n))return"@font"}return"@scalar"}function rn(e,t,r,i){if(typeof e!="string")return null;let l=P(e),a=ft(e,l,r,i,t,"data-hcms-component");return a&&it[a]||null}var ln=new Set(["@color","@font","@variant"]),an=new Set(["html","body",":root"]);function sr(e,t,r,i){if(typeof e!="string"||e.endsWith("[]")||!ln.has(Ie(e,t,r,i)))return null;let l=Array.isArray(r)&&r.some(o=>o==="*"||typeof o=="number"),a=yl(e,P(e)).trim();return!l&&an.has(a)?"page":"section"}var on=/^-?\d+(\.\d+)?([eE][+-]?\d+)?$/;function nn(e){return e==null||e===""?!0:on.test(String(e))}function sn(e){return e==null||e===""||e==="true"||e==="false"}function hi(e,t,r,i,l){if(!r||!r.querySelectorAll)return[];if(!l||l===".")return[];let a=null;try{a=r.querySelectorAll(l)}catch{return[]}let o=t>=0?e.slice(t+1):null,n=[];for(let s of a)if(!(s.closest&&s.closest("[cms-template], [data-hcms-shell]"))&&(o?o==="value"&&"value"in s?n.push(s.value):n.push(s.getAttribute?s.getAttribute(o):null):n.push((s.textContent||"").trim()),!i))break;return n}function cr(e,t){if(typeof e!="string"||!e.endsWith("[]")||!t||!t.querySelector)return null;let r=e.slice(0,-2).trim();if(!r)return null;let i=null;try{i=t.querySelector(r)}catch{return null}let l=i&&i.closest?i.closest("[data-hcms-component]"):null;return(l&&l.getAttribute?l.getAttribute("data-hcms-component"):null)==="chips"?{array:"@chips",item:"@chips-item"}:null}function xe(e,t,r){let i=e.join("."),l=e.map(a=>typeof a=="number"?"*":a).join(".");return i&&Q(r,i)||l&&l!==i&&Q(r,l)||Q(r,t)}function vl(e,t,r){let i=cr(e,r);if(!i)return null;let l=xe(t,i.array,r);return l&&l.getAttribute("data-hcms-tpl")===i.array?i:null}function Xe(e,t,r,i){if(typeof e!="string")return null;let l=P(e),a=ft(e,l,r,i,t,"data-hcms-options");if(a==null)return null;let o=a.trim().split(/\s+/).filter(Boolean);return o.length?o:null}function cn(e,t,r,i){if(typeof e!="string")return null;let l=P(e);return ft(e,l,r,i,t,"data-hcms-crop")}function yl(e,t){return t>=0?e.slice(0,t):e}function xl(e,t,r,i){let l=yl(e,t);return l&&l!=="."?l:hn(i,r)}function hn(e,t){if(e==null||!Array.isArray(t))return"";let r=[],i=e;for(let l of t){if(i==null||typeof i=="string")break;if(Array.isArray(i)){if(typeof i[0]!="string"||l!=="*"&&typeof l!="number")return"";r.push(i[0]),i=i[1];continue}if(typeof i!="object"||!Object.prototype.hasOwnProperty.call(i,l))return"";i=i[l]}return r.join(" ")}function di(e,t,r){if(!t||!t.querySelector||!e||e===".")return null;let i=null;try{i=t.querySelector(e)}catch{return null}return i&&i.getAttribute?i.getAttribute(r):null}function ft(e,t,r,i,l,a){let o=xl(e,t,r,i),n=t>=0?e.slice(t+1):null;if(n){let s=di(o,l,`${a}:${n}`);if(s!=null)return s;if(n.startsWith("--"))return null}return di(o,l,a)}function wl(e,t){if(!e||t==null)return;r(t,[]);function r(i,l){let a=Be(i);if(a==="scalar"){let o=Ie(i,e,l,t);tn.has(o)&&Tt(e,o);return}if(a==="scalar-array"){let o=cr(i,e);o&&(Tt(e,o.array),Tt(e,o.item));return}if(a==="object"){for(let[o,n]of Object.entries(i))r(n,[...l,o]);return}if(a==="object-array"){let o=i[1],n=[...l,"*"];if(o&&typeof o=="object"&&!Array.isArray(o))for(let[s,h]of Object.entries(o))r(h,[...n,s]);else r(o,n)}}}function Al(e,t,r){let i=Q(e,r);if(i)return i;let l=e.createElement("template");return l.setAttribute("data-hcms-tpl",r),l.setAttribute("save-remove",""),l.innerHTML=bl[r].trim(),t.appendChild(l),l}function Q(e,t){return!e||!e.querySelector?null:e.querySelector(`template[data-hcms-tpl="${dn(t)}"]`)}function dn(e){return typeof CSS<"u"&&CSS.escape?CSS.escape(e):String(e).replace(/[^a-zA-Z0-9_\-.*]/g,t=>"\\"+t)}function Be(e){return typeof e=="string"?e.endsWith("[]")?"scalar-array":"scalar":Array.isArray(e)?"object-array":typeof e=="object"&&e!==null?"object":"scalar"}function gt(e){return e?!!(e.content||e).querySelector("[data-hcms-field]"):!1}var ui={IMG:"src",A:"href"};function hr(e){return e.map(t=>typeof t=="number"||/^[0-9]+$/.test(String(t))?"*":String(t)).join(".")}function dr(e){if(!e)return"value";let t=(e.tagName||"").toUpperCase();return t==="INPUT"?(e.getAttribute("type")||"text").toLowerCase()==="checkbox"?"checked":"value":t==="TEXTAREA"||t==="SELECT"?"value":ui[t]?ui[t]:e.hasAttribute&&e.hasAttribute("contenteditable")?"innerHTML":null}function mi(e,t){let r=(e.tagName||"").toUpperCase(),i=(e.getAttribute&&e.getAttribute("type")||"").toLowerCase(),l=dr(e),a=`${_l(r,i)}[data-hcms-field="${ae(t)}"]`;return r==="INPUT"&&i==="radio"?`${a}:checked@value`:l?`${a}@${l}`:a}function un(e){let t=(e.tagName||"").toUpperCase(),r=(e.getAttribute&&e.getAttribute("type")||"").toLowerCase(),i=dr(e),l=`${_l(t,r)}[data-hcms-field]`;return t==="INPUT"&&r==="radio"?`${l}:checked@value`:i?`${l}@${i}`:l}function _l(e,t){return e==="INPUT"?t?`input[type="${t}"]`:"input":e==="TEXTAREA"?"textarea":e==="SELECT"?"select":e==="IMG"?"img":e==="A"?"a":':not([data-hcms-shape="scalar"]):not([data-hcms-shape="object"]):not([data-hcms-shape="object-array"]):not([data-hcms-shape="scalar-array"])'}function ae(e){return typeof CSS<"u"&&CSS.escape?CSS.escape(e):String(e).replace(/[^a-zA-Z0-9_\-.*]/g,t=>"\\"+t)}var pi=new Set(["__proto__","constructor","prototype"]);function mn(e){let t=new Map;return r(e,null),t;function r(i,l){if(typeof i=="string"){typeof l=="string"&&!i.endsWith("[]")&&t.set(l,(t.get(l)||0)+1);return}if(Array.isArray(i)){r(i[1],null);return}if(i&&typeof i=="object")for(let[a,o]of Object.entries(i))r(o,a)}}function El(e,t){let r=mn(e);return i(e,[]);function i(f,m){let u=Be(f);if(u==="scalar")return l(f,m);if(u==="scalar-array")return o(f,m);if(u==="object-array")return n(f,m);if(u==="object"){let c=Object.create(null);for(let[p,b]of Object.entries(f)){if(pi.has(p))throw new Error(`hypercms: rule key "${p}" is forbidden at "${m.join(".")||"<root>"}"`);c[p]=i(b,[...m,p])}return c}return null}function l(f,m){let u=m.length?m[m.length-1]:null,c=typeof u=="string"?u:"__value",p=d(m,c);if(p)return a(m,c,mi(p,c));let b=h(Ie(f,t,m,e),c);return b?a(m,c,mi(b,c)):a(m,c,`input[data-hcms-field="${ae(c)}"]@value`)}function a(f,m,u){if((r.get(m)||0)<2)return u;let c=`[data-hcms-path-shape="${ae(hr(f))}"]`,p=u.lastIndexOf("@"),b=p===-1?u:u.slice(0,p),g=p===-1?"":u.slice(p);return`${c} ${b}, ${b}${c}${g}`}function o(f,m){let u=vl(f,m,t),c=u&&h(u.item,null)||h("@scalar-array-item",null),p=c?un(c):"input[data-hcms-field]@value";return[s(m,"[data-hcms-array-item]"),p]}function n(f,m){let[,u]=f,c=[...m,"*"],p=s(m,"[data-hcms-card]");if(u&&typeof u=="object"&&!Array.isArray(u)){let b=Object.create(null);for(let[g,k]of Object.entries(u)){if(pi.has(g))throw new Error(`hypercms: rule key "${g}" is forbidden at "${c.join(".")}"`);b[g]=i(k,[...c,g])}return[p,b]}return[p,i(u,[...c,0])]}function s(f,m){let u=f.length?f[f.length-1]:"",c=f.some(b=>b==="*"),p=f.join(".");return`${c?`[data-hcms-field="${ae(u)}"]`:`[data-hcms-path="${ae(p)}"]`} > .hcms-array-items > ${m}`}function h(f,m){if(!t)return null;let u=Q(t,f);if(!u)return null;let c=u.content||u;if(m){let p=c.querySelector(`[data-hcms-field="${ae(m)}"]`);if(p)return p}return c.querySelector("[data-hcms-field]")}function d(f,m){if(!t)return null;let u=f.map(p=>typeof p=="number"?"*":p).join("."),c=[f.join("."),u];for(let p=f.length-1;p>=0;p--){let b=f.slice(0,p).map(g=>typeof g=="number"?"*":g);Be(Fe(e,b))==="object"&&c.push(b.join(".")),b.push("*"),c.push(b.join("."))}for(let p of c){if(!p)continue;let b=Q(t,p);if(!b||!gt(b))continue;let g=b.content||b,k=g.querySelector(`[data-hcms-field="${ae(m)}"]`)||g.querySelector("[data-hcms-field]");if(k)return k}return null}}var pn=["50","100","200","300","400","500","600","700","800","900","950"],fn=["red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose","slate","gray","zinc","neutral","stone","mauve","olive","mist","taupe"],je=Object.freeze([{id:"red-50",hue:"red",shade:"50",value:"oklch(97.1% 0.013 17.38)"},{id:"red-100",hue:"red",shade:"100",value:"oklch(93.6% 0.032 17.717)"},{id:"red-200",hue:"red",shade:"200",value:"oklch(88.5% 0.062 18.334)"},{id:"red-300",hue:"red",shade:"300",value:"oklch(80.8% 0.114 19.571)"},{id:"red-400",hue:"red",shade:"400",value:"oklch(70.4% 0.191 22.216)"},{id:"red-500",hue:"red",shade:"500",value:"oklch(63.7% 0.237 25.331)"},{id:"red-600",hue:"red",shade:"600",value:"oklch(57.7% 0.245 27.325)"},{id:"red-700",hue:"red",shade:"700",value:"oklch(50.5% 0.213 27.518)"},{id:"red-800",hue:"red",shade:"800",value:"oklch(44.4% 0.177 26.899)"},{id:"red-900",hue:"red",shade:"900",value:"oklch(39.6% 0.141 25.723)"},{id:"red-950",hue:"red",shade:"950",value:"oklch(25.8% 0.092 26.042)"},{id:"orange-50",hue:"orange",shade:"50",value:"oklch(98% 0.016 73.684)"},{id:"orange-100",hue:"orange",shade:"100",value:"oklch(95.4% 0.038 75.164)"},{id:"orange-200",hue:"orange",shade:"200",value:"oklch(90.1% 0.076 70.697)"},{id:"orange-300",hue:"orange",shade:"300",value:"oklch(83.7% 0.128 66.29)"},{id:"orange-400",hue:"orange",shade:"400",value:"oklch(75% 0.183 55.934)"},{id:"orange-500",hue:"orange",shade:"500",value:"oklch(70.5% 0.213 47.604)"},{id:"orange-600",hue:"orange",shade:"600",value:"oklch(64.6% 0.222 41.116)"},{id:"orange-700",hue:"orange",shade:"700",value:"oklch(55.3% 0.195 38.402)"},{id:"orange-800",hue:"orange",shade:"800",value:"oklch(47% 0.157 37.304)"},{id:"orange-900",hue:"orange",shade:"900",value:"oklch(40.8% 0.123 38.172)"},{id:"orange-950",hue:"orange",shade:"950",value:"oklch(26.6% 0.079 36.259)"},{id:"amber-50",hue:"amber",shade:"50",value:"oklch(98.7% 0.022 95.277)"},{id:"amber-100",hue:"amber",shade:"100",value:"oklch(96.2% 0.059 95.617)"},{id:"amber-200",hue:"amber",shade:"200",value:"oklch(92.4% 0.12 95.746)"},{id:"amber-300",hue:"amber",shade:"300",value:"oklch(87.9% 0.169 91.605)"},{id:"amber-400",hue:"amber",shade:"400",value:"oklch(82.8% 0.189 84.429)"},{id:"amber-500",hue:"amber",shade:"500",value:"oklch(76.9% 0.188 70.08)"},{id:"amber-600",hue:"amber",shade:"600",value:"oklch(66.6% 0.179 58.318)"},{id:"amber-700",hue:"amber",shade:"700",value:"oklch(55.5% 0.163 48.998)"},{id:"amber-800",hue:"amber",shade:"800",value:"oklch(47.3% 0.137 46.201)"},{id:"amber-900",hue:"amber",shade:"900",value:"oklch(41.4% 0.112 45.904)"},{id:"amber-950",hue:"amber",shade:"950",value:"oklch(27.9% 0.077 45.635)"},{id:"yellow-50",hue:"yellow",shade:"50",value:"oklch(98.7% 0.026 102.212)"},{id:"yellow-100",hue:"yellow",shade:"100",value:"oklch(97.3% 0.071 103.193)"},{id:"yellow-200",hue:"yellow",shade:"200",value:"oklch(94.5% 0.129 101.54)"},{id:"yellow-300",hue:"yellow",shade:"300",value:"oklch(90.5% 0.182 98.111)"},{id:"yellow-400",hue:"yellow",shade:"400",value:"oklch(85.2% 0.199 91.936)"},{id:"yellow-500",hue:"yellow",shade:"500",value:"oklch(79.5% 0.184 86.047)"},{id:"yellow-600",hue:"yellow",shade:"600",value:"oklch(68.1% 0.162 75.834)"},{id:"yellow-700",hue:"yellow",shade:"700",value:"oklch(55.4% 0.135 66.442)"},{id:"yellow-800",hue:"yellow",shade:"800",value:"oklch(47.6% 0.114 61.907)"},{id:"yellow-900",hue:"yellow",shade:"900",value:"oklch(42.1% 0.095 57.708)"},{id:"yellow-950",hue:"yellow",shade:"950",value:"oklch(28.6% 0.066 53.813)"},{id:"lime-50",hue:"lime",shade:"50",value:"oklch(98.6% 0.031 120.757)"},{id:"lime-100",hue:"lime",shade:"100",value:"oklch(96.7% 0.067 122.328)"},{id:"lime-200",hue:"lime",shade:"200",value:"oklch(93.8% 0.127 124.321)"},{id:"lime-300",hue:"lime",shade:"300",value:"oklch(89.7% 0.196 126.665)"},{id:"lime-400",hue:"lime",shade:"400",value:"oklch(84.1% 0.238 128.85)"},{id:"lime-500",hue:"lime",shade:"500",value:"oklch(76.8% 0.233 130.85)"},{id:"lime-600",hue:"lime",shade:"600",value:"oklch(64.8% 0.2 131.684)"},{id:"lime-700",hue:"lime",shade:"700",value:"oklch(53.2% 0.157 131.589)"},{id:"lime-800",hue:"lime",shade:"800",value:"oklch(45.3% 0.124 130.933)"},{id:"lime-900",hue:"lime",shade:"900",value:"oklch(40.5% 0.101 131.063)"},{id:"lime-950",hue:"lime",shade:"950",value:"oklch(27.4% 0.072 132.109)"},{id:"green-50",hue:"green",shade:"50",value:"oklch(98.2% 0.018 155.826)"},{id:"green-100",hue:"green",shade:"100",value:"oklch(96.2% 0.044 156.743)"},{id:"green-200",hue:"green",shade:"200",value:"oklch(92.5% 0.084 155.995)"},{id:"green-300",hue:"green",shade:"300",value:"oklch(87.1% 0.15 154.449)"},{id:"green-400",hue:"green",shade:"400",value:"oklch(79.2% 0.209 151.711)"},{id:"green-500",hue:"green",shade:"500",value:"oklch(72.3% 0.219 149.579)"},{id:"green-600",hue:"green",shade:"600",value:"oklch(62.7% 0.194 149.214)"},{id:"green-700",hue:"green",shade:"700",value:"oklch(52.7% 0.154 150.069)"},{id:"green-800",hue:"green",shade:"800",value:"oklch(44.8% 0.119 151.328)"},{id:"green-900",hue:"green",shade:"900",value:"oklch(39.3% 0.095 152.535)"},{id:"green-950",hue:"green",shade:"950",value:"oklch(26.6% 0.065 152.934)"},{id:"emerald-50",hue:"emerald",shade:"50",value:"oklch(97.9% 0.021 166.113)"},{id:"emerald-100",hue:"emerald",shade:"100",value:"oklch(95% 0.052 163.051)"},{id:"emerald-200",hue:"emerald",shade:"200",value:"oklch(90.5% 0.093 164.15)"},{id:"emerald-300",hue:"emerald",shade:"300",value:"oklch(84.5% 0.143 164.978)"},{id:"emerald-400",hue:"emerald",shade:"400",value:"oklch(76.5% 0.177 163.223)"},{id:"emerald-500",hue:"emerald",shade:"500",value:"oklch(69.6% 0.17 162.48)"},{id:"emerald-600",hue:"emerald",shade:"600",value:"oklch(59.6% 0.145 163.225)"},{id:"emerald-700",hue:"emerald",shade:"700",value:"oklch(50.8% 0.118 165.612)"},{id:"emerald-800",hue:"emerald",shade:"800",value:"oklch(43.2% 0.095 166.913)"},{id:"emerald-900",hue:"emerald",shade:"900",value:"oklch(37.8% 0.077 168.94)"},{id:"emerald-950",hue:"emerald",shade:"950",value:"oklch(26.2% 0.051 172.552)"},{id:"teal-50",hue:"teal",shade:"50",value:"oklch(98.4% 0.014 180.72)"},{id:"teal-100",hue:"teal",shade:"100",value:"oklch(95.3% 0.051 180.801)"},{id:"teal-200",hue:"teal",shade:"200",value:"oklch(91% 0.096 180.426)"},{id:"teal-300",hue:"teal",shade:"300",value:"oklch(85.5% 0.138 181.071)"},{id:"teal-400",hue:"teal",shade:"400",value:"oklch(77.7% 0.152 181.912)"},{id:"teal-500",hue:"teal",shade:"500",value:"oklch(70.4% 0.14 182.503)"},{id:"teal-600",hue:"teal",shade:"600",value:"oklch(60% 0.118 184.704)"},{id:"teal-700",hue:"teal",shade:"700",value:"oklch(51.1% 0.096 186.391)"},{id:"teal-800",hue:"teal",shade:"800",value:"oklch(43.7% 0.078 188.216)"},{id:"teal-900",hue:"teal",shade:"900",value:"oklch(38.6% 0.063 188.416)"},{id:"teal-950",hue:"teal",shade:"950",value:"oklch(27.7% 0.046 192.524)"},{id:"cyan-50",hue:"cyan",shade:"50",value:"oklch(98.4% 0.019 200.873)"},{id:"cyan-100",hue:"cyan",shade:"100",value:"oklch(95.6% 0.045 203.388)"},{id:"cyan-200",hue:"cyan",shade:"200",value:"oklch(91.7% 0.08 205.041)"},{id:"cyan-300",hue:"cyan",shade:"300",value:"oklch(86.5% 0.127 207.078)"},{id:"cyan-400",hue:"cyan",shade:"400",value:"oklch(78.9% 0.154 211.53)"},{id:"cyan-500",hue:"cyan",shade:"500",value:"oklch(71.5% 0.143 215.221)"},{id:"cyan-600",hue:"cyan",shade:"600",value:"oklch(60.9% 0.126 221.723)"},{id:"cyan-700",hue:"cyan",shade:"700",value:"oklch(52% 0.105 223.128)"},{id:"cyan-800",hue:"cyan",shade:"800",value:"oklch(45% 0.085 224.283)"},{id:"cyan-900",hue:"cyan",shade:"900",value:"oklch(39.8% 0.07 227.392)"},{id:"cyan-950",hue:"cyan",shade:"950",value:"oklch(30.2% 0.056 229.695)"},{id:"sky-50",hue:"sky",shade:"50",value:"oklch(97.7% 0.013 236.62)"},{id:"sky-100",hue:"sky",shade:"100",value:"oklch(95.1% 0.026 236.824)"},{id:"sky-200",hue:"sky",shade:"200",value:"oklch(90.1% 0.058 230.902)"},{id:"sky-300",hue:"sky",shade:"300",value:"oklch(82.8% 0.111 230.318)"},{id:"sky-400",hue:"sky",shade:"400",value:"oklch(74.6% 0.16 232.661)"},{id:"sky-500",hue:"sky",shade:"500",value:"oklch(68.5% 0.169 237.323)"},{id:"sky-600",hue:"sky",shade:"600",value:"oklch(58.8% 0.158 241.966)"},{id:"sky-700",hue:"sky",shade:"700",value:"oklch(50% 0.134 242.749)"},{id:"sky-800",hue:"sky",shade:"800",value:"oklch(44.3% 0.11 240.79)"},{id:"sky-900",hue:"sky",shade:"900",value:"oklch(39.1% 0.09 240.876)"},{id:"sky-950",hue:"sky",shade:"950",value:"oklch(29.3% 0.066 243.157)"},{id:"blue-50",hue:"blue",shade:"50",value:"oklch(97% 0.014 254.604)"},{id:"blue-100",hue:"blue",shade:"100",value:"oklch(93.2% 0.032 255.585)"},{id:"blue-200",hue:"blue",shade:"200",value:"oklch(88.2% 0.059 254.128)"},{id:"blue-300",hue:"blue",shade:"300",value:"oklch(80.9% 0.105 251.813)"},{id:"blue-400",hue:"blue",shade:"400",value:"oklch(70.7% 0.165 254.624)"},{id:"blue-500",hue:"blue",shade:"500",value:"oklch(62.3% 0.214 259.815)"},{id:"blue-600",hue:"blue",shade:"600",value:"oklch(54.6% 0.245 262.881)"},{id:"blue-700",hue:"blue",shade:"700",value:"oklch(48.8% 0.243 264.376)"},{id:"blue-800",hue:"blue",shade:"800",value:"oklch(42.4% 0.199 265.638)"},{id:"blue-900",hue:"blue",shade:"900",value:"oklch(37.9% 0.146 265.522)"},{id:"blue-950",hue:"blue",shade:"950",value:"oklch(28.2% 0.091 267.935)"},{id:"indigo-50",hue:"indigo",shade:"50",value:"oklch(96.2% 0.018 272.314)"},{id:"indigo-100",hue:"indigo",shade:"100",value:"oklch(93% 0.034 272.788)"},{id:"indigo-200",hue:"indigo",shade:"200",value:"oklch(87% 0.065 274.039)"},{id:"indigo-300",hue:"indigo",shade:"300",value:"oklch(78.5% 0.115 274.713)"},{id:"indigo-400",hue:"indigo",shade:"400",value:"oklch(67.3% 0.182 276.935)"},{id:"indigo-500",hue:"indigo",shade:"500",value:"oklch(58.5% 0.233 277.117)"},{id:"indigo-600",hue:"indigo",shade:"600",value:"oklch(51.1% 0.262 276.966)"},{id:"indigo-700",hue:"indigo",shade:"700",value:"oklch(45.7% 0.24 277.023)"},{id:"indigo-800",hue:"indigo",shade:"800",value:"oklch(39.8% 0.195 277.366)"},{id:"indigo-900",hue:"indigo",shade:"900",value:"oklch(35.9% 0.144 278.697)"},{id:"indigo-950",hue:"indigo",shade:"950",value:"oklch(25.7% 0.09 281.288)"},{id:"violet-50",hue:"violet",shade:"50",value:"oklch(96.9% 0.016 293.756)"},{id:"violet-100",hue:"violet",shade:"100",value:"oklch(94.3% 0.029 294.588)"},{id:"violet-200",hue:"violet",shade:"200",value:"oklch(89.4% 0.057 293.283)"},{id:"violet-300",hue:"violet",shade:"300",value:"oklch(81.1% 0.111 293.571)"},{id:"violet-400",hue:"violet",shade:"400",value:"oklch(70.2% 0.183 293.541)"},{id:"violet-500",hue:"violet",shade:"500",value:"oklch(60.6% 0.25 292.717)"},{id:"violet-600",hue:"violet",shade:"600",value:"oklch(54.1% 0.281 293.009)"},{id:"violet-700",hue:"violet",shade:"700",value:"oklch(49.1% 0.27 292.581)"},{id:"violet-800",hue:"violet",shade:"800",value:"oklch(43.2% 0.232 292.759)"},{id:"violet-900",hue:"violet",shade:"900",value:"oklch(38% 0.189 293.745)"},{id:"violet-950",hue:"violet",shade:"950",value:"oklch(28.3% 0.141 291.089)"},{id:"purple-50",hue:"purple",shade:"50",value:"oklch(97.7% 0.014 308.299)"},{id:"purple-100",hue:"purple",shade:"100",value:"oklch(94.6% 0.033 307.174)"},{id:"purple-200",hue:"purple",shade:"200",value:"oklch(90.2% 0.063 306.703)"},{id:"purple-300",hue:"purple",shade:"300",value:"oklch(82.7% 0.119 306.383)"},{id:"purple-400",hue:"purple",shade:"400",value:"oklch(71.4% 0.203 305.504)"},{id:"purple-500",hue:"purple",shade:"500",value:"oklch(62.7% 0.265 303.9)"},{id:"purple-600",hue:"purple",shade:"600",value:"oklch(55.8% 0.288 302.321)"},{id:"purple-700",hue:"purple",shade:"700",value:"oklch(49.6% 0.265 301.924)"},{id:"purple-800",hue:"purple",shade:"800",value:"oklch(43.8% 0.218 303.724)"},{id:"purple-900",hue:"purple",shade:"900",value:"oklch(38.1% 0.176 304.987)"},{id:"purple-950",hue:"purple",shade:"950",value:"oklch(29.1% 0.149 302.717)"},{id:"fuchsia-50",hue:"fuchsia",shade:"50",value:"oklch(97.7% 0.017 320.058)"},{id:"fuchsia-100",hue:"fuchsia",shade:"100",value:"oklch(95.2% 0.037 318.852)"},{id:"fuchsia-200",hue:"fuchsia",shade:"200",value:"oklch(90.3% 0.076 319.62)"},{id:"fuchsia-300",hue:"fuchsia",shade:"300",value:"oklch(83.3% 0.145 321.434)"},{id:"fuchsia-400",hue:"fuchsia",shade:"400",value:"oklch(74% 0.238 322.16)"},{id:"fuchsia-500",hue:"fuchsia",shade:"500",value:"oklch(66.7% 0.295 322.15)"},{id:"fuchsia-600",hue:"fuchsia",shade:"600",value:"oklch(59.1% 0.293 322.896)"},{id:"fuchsia-700",hue:"fuchsia",shade:"700",value:"oklch(51.8% 0.253 323.949)"},{id:"fuchsia-800",hue:"fuchsia",shade:"800",value:"oklch(45.2% 0.211 324.591)"},{id:"fuchsia-900",hue:"fuchsia",shade:"900",value:"oklch(40.1% 0.17 325.612)"},{id:"fuchsia-950",hue:"fuchsia",shade:"950",value:"oklch(29.3% 0.136 325.661)"},{id:"pink-50",hue:"pink",shade:"50",value:"oklch(97.1% 0.014 343.198)"},{id:"pink-100",hue:"pink",shade:"100",value:"oklch(94.8% 0.028 342.258)"},{id:"pink-200",hue:"pink",shade:"200",value:"oklch(89.9% 0.061 343.231)"},{id:"pink-300",hue:"pink",shade:"300",value:"oklch(82.3% 0.12 346.018)"},{id:"pink-400",hue:"pink",shade:"400",value:"oklch(71.8% 0.202 349.761)"},{id:"pink-500",hue:"pink",shade:"500",value:"oklch(65.6% 0.241 354.308)"},{id:"pink-600",hue:"pink",shade:"600",value:"oklch(59.2% 0.249 0.584)"},{id:"pink-700",hue:"pink",shade:"700",value:"oklch(52.5% 0.223 3.958)"},{id:"pink-800",hue:"pink",shade:"800",value:"oklch(45.9% 0.187 3.815)"},{id:"pink-900",hue:"pink",shade:"900",value:"oklch(40.8% 0.153 2.432)"},{id:"pink-950",hue:"pink",shade:"950",value:"oklch(28.4% 0.109 3.907)"},{id:"rose-50",hue:"rose",shade:"50",value:"oklch(96.9% 0.015 12.422)"},{id:"rose-100",hue:"rose",shade:"100",value:"oklch(94.1% 0.03 12.58)"},{id:"rose-200",hue:"rose",shade:"200",value:"oklch(89.2% 0.058 10.001)"},{id:"rose-300",hue:"rose",shade:"300",value:"oklch(81% 0.117 11.638)"},{id:"rose-400",hue:"rose",shade:"400",value:"oklch(71.2% 0.194 13.428)"},{id:"rose-500",hue:"rose",shade:"500",value:"oklch(64.5% 0.246 16.439)"},{id:"rose-600",hue:"rose",shade:"600",value:"oklch(58.6% 0.253 17.585)"},{id:"rose-700",hue:"rose",shade:"700",value:"oklch(51.4% 0.222 16.935)"},{id:"rose-800",hue:"rose",shade:"800",value:"oklch(45.5% 0.188 13.697)"},{id:"rose-900",hue:"rose",shade:"900",value:"oklch(41% 0.159 10.272)"},{id:"rose-950",hue:"rose",shade:"950",value:"oklch(27.1% 0.105 12.094)"},{id:"slate-50",hue:"slate",shade:"50",value:"oklch(98.4% 0.003 247.858)"},{id:"slate-100",hue:"slate",shade:"100",value:"oklch(96.8% 0.007 247.896)"},{id:"slate-200",hue:"slate",shade:"200",value:"oklch(92.9% 0.013 255.508)"},{id:"slate-300",hue:"slate",shade:"300",value:"oklch(86.9% 0.022 252.894)"},{id:"slate-400",hue:"slate",shade:"400",value:"oklch(70.4% 0.04 256.788)"},{id:"slate-500",hue:"slate",shade:"500",value:"oklch(55.4% 0.046 257.417)"},{id:"slate-600",hue:"slate",shade:"600",value:"oklch(44.6% 0.043 257.281)"},{id:"slate-700",hue:"slate",shade:"700",value:"oklch(37.2% 0.044 257.287)"},{id:"slate-800",hue:"slate",shade:"800",value:"oklch(27.9% 0.041 260.031)"},{id:"slate-900",hue:"slate",shade:"900",value:"oklch(20.8% 0.042 265.755)"},{id:"slate-950",hue:"slate",shade:"950",value:"oklch(12.9% 0.042 264.695)"},{id:"gray-50",hue:"gray",shade:"50",value:"oklch(98.5% 0.002 247.839)"},{id:"gray-100",hue:"gray",shade:"100",value:"oklch(96.7% 0.003 264.542)"},{id:"gray-200",hue:"gray",shade:"200",value:"oklch(92.8% 0.006 264.531)"},{id:"gray-300",hue:"gray",shade:"300",value:"oklch(87.2% 0.01 258.338)"},{id:"gray-400",hue:"gray",shade:"400",value:"oklch(70.7% 0.022 261.325)"},{id:"gray-500",hue:"gray",shade:"500",value:"oklch(55.1% 0.027 264.364)"},{id:"gray-600",hue:"gray",shade:"600",value:"oklch(44.6% 0.03 256.802)"},{id:"gray-700",hue:"gray",shade:"700",value:"oklch(37.3% 0.034 259.733)"},{id:"gray-800",hue:"gray",shade:"800",value:"oklch(27.8% 0.033 256.848)"},{id:"gray-900",hue:"gray",shade:"900",value:"oklch(21% 0.034 264.665)"},{id:"gray-950",hue:"gray",shade:"950",value:"oklch(13% 0.028 261.692)"},{id:"zinc-50",hue:"zinc",shade:"50",value:"oklch(98.5% 0 none)"},{id:"zinc-100",hue:"zinc",shade:"100",value:"oklch(96.7% 0.001 286.375)"},{id:"zinc-200",hue:"zinc",shade:"200",value:"oklch(92% 0.004 286.32)"},{id:"zinc-300",hue:"zinc",shade:"300",value:"oklch(87.1% 0.006 286.286)"},{id:"zinc-400",hue:"zinc",shade:"400",value:"oklch(70.5% 0.015 286.067)"},{id:"zinc-500",hue:"zinc",shade:"500",value:"oklch(55.2% 0.016 285.938)"},{id:"zinc-600",hue:"zinc",shade:"600",value:"oklch(44.2% 0.017 285.786)"},{id:"zinc-700",hue:"zinc",shade:"700",value:"oklch(37% 0.013 285.805)"},{id:"zinc-800",hue:"zinc",shade:"800",value:"oklch(27.4% 0.006 286.033)"},{id:"zinc-900",hue:"zinc",shade:"900",value:"oklch(21% 0.006 285.885)"},{id:"zinc-950",hue:"zinc",shade:"950",value:"oklch(14.1% 0.005 285.823)"},{id:"neutral-50",hue:"neutral",shade:"50",value:"oklch(98.5% 0 none)"},{id:"neutral-100",hue:"neutral",shade:"100",value:"oklch(97% 0 none)"},{id:"neutral-200",hue:"neutral",shade:"200",value:"oklch(92.2% 0 none)"},{id:"neutral-300",hue:"neutral",shade:"300",value:"oklch(87% 0 none)"},{id:"neutral-400",hue:"neutral",shade:"400",value:"oklch(70.8% 0 none)"},{id:"neutral-500",hue:"neutral",shade:"500",value:"oklch(55.6% 0 none)"},{id:"neutral-600",hue:"neutral",shade:"600",value:"oklch(43.9% 0 none)"},{id:"neutral-700",hue:"neutral",shade:"700",value:"oklch(37.1% 0 none)"},{id:"neutral-800",hue:"neutral",shade:"800",value:"oklch(26.9% 0 none)"},{id:"neutral-900",hue:"neutral",shade:"900",value:"oklch(20.5% 0 none)"},{id:"neutral-950",hue:"neutral",shade:"950",value:"oklch(14.5% 0 none)"},{id:"stone-50",hue:"stone",shade:"50",value:"oklch(98.5% 0.001 106.423)"},{id:"stone-100",hue:"stone",shade:"100",value:"oklch(97% 0.001 106.424)"},{id:"stone-200",hue:"stone",shade:"200",value:"oklch(92.3% 0.003 48.717)"},{id:"stone-300",hue:"stone",shade:"300",value:"oklch(86.9% 0.005 56.366)"},{id:"stone-400",hue:"stone",shade:"400",value:"oklch(70.9% 0.01 56.259)"},{id:"stone-500",hue:"stone",shade:"500",value:"oklch(55.3% 0.013 58.071)"},{id:"stone-600",hue:"stone",shade:"600",value:"oklch(44.4% 0.011 73.639)"},{id:"stone-700",hue:"stone",shade:"700",value:"oklch(37.4% 0.01 67.558)"},{id:"stone-800",hue:"stone",shade:"800",value:"oklch(26.8% 0.007 34.298)"},{id:"stone-900",hue:"stone",shade:"900",value:"oklch(21.6% 0.006 56.043)"},{id:"stone-950",hue:"stone",shade:"950",value:"oklch(14.7% 0.004 49.25)"},{id:"mauve-50",hue:"mauve",shade:"50",value:"oklch(98.5% 0 none)"},{id:"mauve-100",hue:"mauve",shade:"100",value:"oklch(96% 0.003 325.6)"},{id:"mauve-200",hue:"mauve",shade:"200",value:"oklch(92.2% 0.005 325.62)"},{id:"mauve-300",hue:"mauve",shade:"300",value:"oklch(86.5% 0.012 325.68)"},{id:"mauve-400",hue:"mauve",shade:"400",value:"oklch(71.1% 0.019 323.02)"},{id:"mauve-500",hue:"mauve",shade:"500",value:"oklch(54.2% 0.034 322.5)"},{id:"mauve-600",hue:"mauve",shade:"600",value:"oklch(43.5% 0.029 321.78)"},{id:"mauve-700",hue:"mauve",shade:"700",value:"oklch(36.4% 0.029 323.89)"},{id:"mauve-800",hue:"mauve",shade:"800",value:"oklch(26.3% 0.024 320.12)"},{id:"mauve-900",hue:"mauve",shade:"900",value:"oklch(21.2% 0.019 322.12)"},{id:"mauve-950",hue:"mauve",shade:"950",value:"oklch(14.5% 0.008 326)"},{id:"olive-50",hue:"olive",shade:"50",value:"oklch(98.8% 0.003 106.5)"},{id:"olive-100",hue:"olive",shade:"100",value:"oklch(96.6% 0.005 106.5)"},{id:"olive-200",hue:"olive",shade:"200",value:"oklch(93% 0.007 106.5)"},{id:"olive-300",hue:"olive",shade:"300",value:"oklch(88% 0.011 106.6)"},{id:"olive-400",hue:"olive",shade:"400",value:"oklch(73.7% 0.021 106.9)"},{id:"olive-500",hue:"olive",shade:"500",value:"oklch(58% 0.031 107.3)"},{id:"olive-600",hue:"olive",shade:"600",value:"oklch(46.6% 0.025 107.3)"},{id:"olive-700",hue:"olive",shade:"700",value:"oklch(39.4% 0.023 107.4)"},{id:"olive-800",hue:"olive",shade:"800",value:"oklch(28.6% 0.016 107.4)"},{id:"olive-900",hue:"olive",shade:"900",value:"oklch(22.8% 0.013 107.4)"},{id:"olive-950",hue:"olive",shade:"950",value:"oklch(15.3% 0.006 107.1)"},{id:"mist-50",hue:"mist",shade:"50",value:"oklch(98.7% 0.002 197.1)"},{id:"mist-100",hue:"mist",shade:"100",value:"oklch(96.3% 0.002 197.1)"},{id:"mist-200",hue:"mist",shade:"200",value:"oklch(92.5% 0.005 214.3)"},{id:"mist-300",hue:"mist",shade:"300",value:"oklch(87.2% 0.007 219.6)"},{id:"mist-400",hue:"mist",shade:"400",value:"oklch(72.3% 0.014 214.4)"},{id:"mist-500",hue:"mist",shade:"500",value:"oklch(56% 0.021 213.5)"},{id:"mist-600",hue:"mist",shade:"600",value:"oklch(45% 0.017 213.2)"},{id:"mist-700",hue:"mist",shade:"700",value:"oklch(37.8% 0.015 216)"},{id:"mist-800",hue:"mist",shade:"800",value:"oklch(27.5% 0.011 216.9)"},{id:"mist-900",hue:"mist",shade:"900",value:"oklch(21.8% 0.008 223.9)"},{id:"mist-950",hue:"mist",shade:"950",value:"oklch(14.8% 0.004 228.8)"},{id:"taupe-50",hue:"taupe",shade:"50",value:"oklch(98.6% 0.002 67.8)"},{id:"taupe-100",hue:"taupe",shade:"100",value:"oklch(96% 0.002 17.2)"},{id:"taupe-200",hue:"taupe",shade:"200",value:"oklch(92.2% 0.005 34.3)"},{id:"taupe-300",hue:"taupe",shade:"300",value:"oklch(86.8% 0.007 39.5)"},{id:"taupe-400",hue:"taupe",shade:"400",value:"oklch(71.4% 0.014 41.2)"},{id:"taupe-500",hue:"taupe",shade:"500",value:"oklch(54.7% 0.021 43.1)"},{id:"taupe-600",hue:"taupe",shade:"600",value:"oklch(43.8% 0.017 39.3)"},{id:"taupe-700",hue:"taupe",shade:"700",value:"oklch(36.7% 0.016 35.7)"},{id:"taupe-800",hue:"taupe",shade:"800",value:"oklch(26.8% 0.011 36.5)"},{id:"taupe-900",hue:"taupe",shade:"900",value:"oklch(21.4% 0.009 43.1)"},{id:"taupe-950",hue:"taupe",shade:"950",value:"oklch(14.7% 0.004 49.3)"}]),gn=12,fi=new Map(je.map(e=>[e.id,e])),bn=new Map(je.map(e=>[e.value,e])),kn=/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,vn=/^(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch|color|color-mix|light-dark)\(.*\)$/i,yn=/[;{}<>\\]|url\s*\(/i,gi=new WeakMap;function ur(e){let t=gi.get(e);return t||gi.set(e,t=new Set),t}function Sl(e,t){let r=String(e??"").trim();if(!r||yn.test(r)||Fo(r))return!1;let i=t?.defaultView?.CSS;return i&&typeof i.supports=="function"?i.supports("color",r):kn.test(r)||vn.test(r)||/^[a-z]+$/i.test(r)}function Cl(e){return`${e.hue[0].toUpperCase()}${e.hue.slice(1)} ${e.shade}`}function We(e){return{id:e.id,label:Cl(e),value:e.value}}function Tl(e){let t=String(e??"").trim(),r=bn.get(t);return r?Cl(r):t}function xn(e,t){if(!e||e.length===0)return{swatches:je.map(We),custom:!0,full:!0};let r=[],i=new Set,l=!1,a=o=>{i.has(o.value)||(i.add(o.value),r.push(o))};for(let o of e)o==="custom"?l=!0:fi.has(o)?a(We(fi.get(o))):fn.includes(o)?je.filter(n=>n.hue===o).forEach(n=>a(We(n))):pn.includes(o)?je.filter(n=>n.shade===o).forEach(n=>a(We(n))):Sl(o,t)?a({id:null,label:o,value:o}):console.warn(`[hypercms] color option "${o}" is not a Tailwind color, hue, shade, CSS color or "custom"; ignoring it`);return{swatches:r,custom:l,full:!1}}function wn(e,{value:t,tokens:r,path:i,doc:l}){let{swatches:a,custom:o,full:n}=xn(r,l),s=t==null?"":String(t).trim();s&&!a.some(m=>m.value===s)&&a.unshift({id:null,label:Tl(s),value:s});let h=a.length<=gn;e.setAttribute("data-hcms-color-path",i),e.classList.toggle("hcms-color--inline",h);let d=e.querySelector(".hcms-color-grid");if(d){d.classList.toggle("hcms-color-grid--full",n);for(let m of a){let u=l.createElement("button");u.type="button",u.className="hcms-color-swatch",u.setAttribute("data-hcms-action","color-pick"),u.setAttribute("data-hcms-color",m.value),u.setAttribute("aria-label",m.label),u.setAttribute("title",m.id||m.label),u.setAttribute("style",`--hcms-swatch: ${m.value}`),d.appendChild(u)}}o||e.querySelector(".hcms-color-custom")?.remove();let f=e.querySelector(".hcms-color-current");h&&f&&(f.removeAttribute("data-hcms-action"),f.removeAttribute("aria-expanded")),mr(e,h||ur(l).has(i)),Rl(e,s)}function Rl(e,t){let r=t==null?"":String(t).trim();e.toggleAttribute("data-hcms-color-empty",r==="");let i=e.querySelector(".hcms-color-chip");i&&(r?i.setAttribute("style",`--hcms-swatch: ${r}`):i.removeAttribute("style"));let l=e.querySelector(".hcms-color-name");l&&(l.textContent=r?Tl(r):"Not set"),e.querySelectorAll(".hcms-color-swatch").forEach(n=>{n.setAttribute("aria-pressed",String(n.getAttribute("data-hcms-color")===r))});let a=e.querySelector('[data-hcms-color-input="text"]');a&&a.ownerDocument?.activeElement!==a&&(a.value=r);let o=e.querySelector('[data-hcms-color-input="native"]');o&&/^#[0-9a-f]{6}$/i.test(r)&&(o.value=r.toLowerCase())}function mr(e,t){let r=e.querySelector(".hcms-color-panel");r&&(r.hidden=!t);let i=e.querySelector(".hcms-color-current[data-hcms-action]");i&&i.setAttribute("aria-expanded",String(t))}function bt(e){return e?.closest?e.closest("[data-hcms-color-path]"):null}function An(e){return e.querySelector('input[type="hidden"][data-hcms-field]')}function ql(e,t){let r=e.querySelector(":scope > .hcms-error");r&&(r.textContent=t||"",r.hidden=!t)}function pr(e,t){let r=An(e);return!r||(ql(e,null),Rl(e,t),r.value===t)?null:(r.value=t,r)}function _n(e){let t=bt(e);return t?(t.classList.contains("hcms-color--inline")||(ur(t.ownerDocument).delete(t.getAttribute("data-hcms-color-path")),mr(t,!1)),pr(t,e.getAttribute("data-hcms-color")||"")):null}function En(e){let t=bt(e);return t?pr(t,""):null}function Sn(e){let t=bt(e);if(!t)return;let r=t.getAttribute("data-hcms-color-path"),i=ur(t.ownerDocument),l=!i.has(r);l?i.add(r):i.delete(r),mr(t,l)}function Cn(e){let t=bt(e);if(!t)return null;let r=String(e.value||"").trim();return r!==""&&!Sl(r,t.ownerDocument)?(ql(t,`"${r}" is not a CSS color`),null):pr(t,r)}var Ol=["sans","serif","display","mono"],N="ui-sans-serif, system-ui, sans-serif",Z="ui-serif, Georgia, serif",de="ui-monospace, SFMono-Regular, Menlo, monospace",ee=Object.freeze([{slug:"inter",family:"Inter",group:"sans",fallback:N,request:"ital,wght@0,100..900;1,100..900"},{slug:"roboto",family:"Roboto",group:"sans",fallback:N,request:"ital,wght@0,100..900;1,100..900"},{slug:"open-sans",family:"Open Sans",group:"sans",fallback:N,request:"ital,wght@0,300..800;1,300..800"},{slug:"lato",family:"Lato",group:"sans",fallback:N,request:"ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900"},{slug:"montserrat",family:"Montserrat",group:"sans",fallback:N,request:"ital,wght@0,100..900;1,100..900"},{slug:"poppins",family:"Poppins",group:"sans",fallback:N,request:"ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900"},{slug:"nunito",family:"Nunito",group:"sans",fallback:N,request:"ital,wght@0,200..1000;1,200..1000"},{slug:"raleway",family:"Raleway",group:"sans",fallback:N,request:"ital,wght@0,100..900;1,100..900"},{slug:"dm-sans",family:"DM Sans",group:"sans",fallback:N,request:"ital,wght@0,100..1000;1,100..1000"},{slug:"work-sans",family:"Work Sans",group:"sans",fallback:N,request:"ital,wght@0,100..900;1,100..900"},{slug:"source-sans-3",family:"Source Sans 3",group:"sans",fallback:N,request:"ital,wght@0,200..900;1,200..900"},{slug:"noto-sans",family:"Noto Sans",group:"sans",fallback:N,request:"ital,wght@0,100..900;1,100..900"},{slug:"plus-jakarta-sans",family:"Plus Jakarta Sans",group:"sans",fallback:N,request:"ital,wght@0,200..800;1,200..800"},{slug:"manrope",family:"Manrope",group:"sans",fallback:N,request:"wght@200..800"},{slug:"outfit",family:"Outfit",group:"sans",fallback:N,request:"wght@100..900"},{slug:"space-grotesk",family:"Space Grotesk",group:"sans",fallback:N,request:"wght@300..700"},{slug:"rubik",family:"Rubik",group:"sans",fallback:N,request:"ital,wght@0,300..900;1,300..900"},{slug:"ubuntu",family:"Ubuntu",group:"sans",fallback:N,request:"ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700"},{slug:"merriweather",family:"Merriweather",group:"serif",fallback:Z,request:"ital,wght@0,300..900;1,300..900"},{slug:"lora",family:"Lora",group:"serif",fallback:Z,request:"ital,wght@0,400..700;1,400..700"},{slug:"playfair-display",family:"Playfair Display",group:"serif",fallback:Z,request:"ital,wght@0,400..900;1,400..900"},{slug:"libre-baskerville",family:"Libre Baskerville",group:"serif",fallback:Z,request:"ital,wght@0,400..700;1,400..700"},{slug:"source-serif-4",family:"Source Serif 4",group:"serif",fallback:Z,request:"ital,wght@0,200..900;1,200..900"},{slug:"pt-serif",family:"PT Serif",group:"serif",fallback:Z,request:"ital,wght@0,400;0,700;1,400;1,700"},{slug:"noto-serif",family:"Noto Serif",group:"serif",fallback:Z,request:"ital,wght@0,100..900;1,100..900"},{slug:"crimson-pro",family:"Crimson Pro",group:"serif",fallback:Z,request:"ital,wght@0,200..900;1,200..900"},{slug:"eb-garamond",family:"EB Garamond",group:"serif",fallback:Z,request:"ital,wght@0,400..800;1,400..800"},{slug:"cormorant-garamond",family:"Cormorant Garamond",group:"serif",fallback:Z,request:"ital,wght@0,300..700;1,300..700"},{slug:"bebas-neue",family:"Bebas Neue",group:"display",fallback:N,request:"wght@400"},{slug:"oswald",family:"Oswald",group:"display",fallback:N,request:"wght@200..700"},{slug:"anton",family:"Anton",group:"display",fallback:N,request:"wght@400"},{slug:"abril-fatface",family:"Abril Fatface",group:"display",fallback:Z,request:"wght@400"},{slug:"lobster",family:"Lobster",group:"display",fallback:"cursive",request:"wght@400"},{slug:"bungee",family:"Bungee",group:"display",fallback:N,request:"wght@400"},{slug:"roboto-mono",family:"Roboto Mono",group:"mono",fallback:de,request:"ital,wght@0,100..700;1,100..700"},{slug:"jetbrains-mono",family:"JetBrains Mono",group:"mono",fallback:de,request:"ital,wght@0,100..800;1,100..800"},{slug:"fira-code",family:"Fira Code",group:"mono",fallback:de,request:"wght@300..700"},{slug:"source-code-pro",family:"Source Code Pro",group:"mono",fallback:de,request:"ital,wght@0,200..900;1,200..900"},{slug:"ibm-plex-mono",family:"IBM Plex Mono",group:"mono",fallback:de,request:"ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700"},{slug:"space-mono",family:"Space Mono",group:"mono",fallback:de,request:"ital,wght@0,400;0,700;1,400;1,700"}]),Me=Object.freeze({slug:"system",family:null,group:"sans",fallback:"system-ui, sans-serif"}),Tn=new Map(ee.map(e=>[e.family.toLowerCase(),e])),Ch=new Map(ee.map(e=>[e.slug,e]));function Ke(e){return!e||e.slug==="system"?Me.fallback:`'${e.family}', ${e.fallback}`}function Ll(e){return e==null?null:String(e).split(",")[0].trim().replace(/^['"]|['"]$/g,"")||null}function Wt(e){let t=new Map;if(!e)return t;let r=String(e).split("?")[1]||"";for(let i of r.split("&")){if(!i.startsWith("family="))continue;let l=decodeURIComponent(i.slice(7).split(":")[0].replace(/\+/g," ")).trim();l&&t.set(l.toLowerCase(),i)}return t}function Rn(e,t){let r=Wt(e),i=Wt(t);return r.size===i.size&&[...r.keys()].every(l=>i.has(l))}function $l(e){let t=Ll(e);return t&&Tn.get(t.toLowerCase())||null}function jl(e,t=null){let r=Wt(t),i=new Map;for(let l of e||[]){let a=$l(l);if(a){i.set(a.family.toLowerCase(),`family=${a.family.replace(/ /g,"+")}:${a.request}`);continue}let o=Ll(l),n=o&&r.get(o.toLowerCase());n&&i.set(o.toLowerCase(),n)}return i.size===0?null:`https://fonts.googleapis.com/css2?${[...i.entries()].sort(([l],[a])=>l.localeCompare(a)).map(([,l])=>l).join("&")}&display=swap`}var qn={sans:"Sans",serif:"Serif",display:"Display",mono:"Mono"},On="link[data-hcms-font-preview]",bi=new WeakMap;function fr(e){let t=bi.get(e);return t||bi.set(e,t=new Set),t}function Ln(e){return String(e??"").trim()===Me.fallback}function Ml(e){let t=String(e??"").trim();if(!t)return"Not set";if(Ln(t))return"System";let r=$l(t);return r?r.family:"Current font"}function $n(e){if(!e||e.length===0)return{system:!0,fonts:[...ee]};let t=!1,r=new Set;for(let i of e)i==="system"?t=!0:Ol.includes(i)?ee.filter(l=>l.group===i).forEach(l=>r.add(l)):ee.some(l=>l.slug===i)?r.add(ee.find(l=>l.slug===i)):console.warn(`[hypercms] font option "${i}" is not a catalog font, a group or "system"; ignoring it`);return{system:t,fonts:ee.filter(i=>r.has(i))}}function Rt(e,{value:t,label:r,family:i}){let l=e.createElement("button");return l.type="button",l.className="hcms-font-option",l.setAttribute("role","option"),l.setAttribute("data-hcms-action","font-pick"),l.setAttribute("data-hcms-font",t),l.setAttribute("style",`font-family: ${i}`),l.textContent=r,l}function jn(e,{value:t,tokens:r,path:i,doc:l}){let{system:a,fonts:o}=$n(r),n=t==null?"":String(t).trim();e.setAttribute("data-hcms-font-path",i);let s=e.querySelector(".hcms-font-list");if(s){let h=new Set([...a?[Me.fallback]:[],...o.map(Ke)]);n&&!h.has(n)&&s.appendChild(Rt(l,{value:n,label:Ml(n),family:n})),a&&s.appendChild(Rt(l,{value:Me.fallback,label:"System",family:Me.fallback}));for(let d of Ol){let f=o.filter(u=>u.group===d);if(!f.length)continue;let m=l.createElement("div");m.className="hcms-font-group",m.textContent=qn[d],s.appendChild(m);for(let u of f)s.appendChild(Rt(l,{value:Ke(u),label:u.family,family:Ke(u)}))}}gr(e,fr(l).has(i)),Nl(e,n)}function Nl(e,t){let r=t==null?"":String(t).trim(),i=e.querySelector(".hcms-font-name");i&&(i.textContent=Ml(r),r?i.setAttribute("style",`font-family: ${r}`):i.removeAttribute("style")),e.querySelectorAll(".hcms-font-option").forEach(l=>{l.setAttribute("aria-selected",String(l.getAttribute("data-hcms-font")===r))})}function gr(e,t){let r=e.querySelector(".hcms-font-panel");r&&(r.hidden=!t),e.querySelector(".hcms-font-current")?.setAttribute("aria-expanded",String(t)),t&&Mn(e.ownerDocument)}function Mn(e){let t=e?.head;if(!t||t.querySelector(On))return;let r=jl(ee.map(Ke)),i=[...new Set(ee.map(a=>a.family).join(""))].join(""),l=e.createElement("link");l.rel="stylesheet",l.href=`${r}&text=${encodeURIComponent(i)}`,l.setAttribute("data-hcms-font-preview","");for(let a of["editor-ui","no-save","save-remove","snapshot-remove"])l.setAttribute(a,"");t.appendChild(l)}function zl(e){return e?.closest?e.closest("[data-hcms-font-path]"):null}function Nn(e){let t=zl(e);if(!t)return;let r=t.getAttribute("data-hcms-font-path"),i=fr(t.ownerDocument),l=!i.has(r);l?i.add(r):i.delete(r),gr(t,l)}function zn(e){let t=zl(e);if(!t)return null;let r=t.querySelector('input[type="hidden"][data-hcms-field]');if(!r)return null;fr(t.ownerDocument).delete(t.getAttribute("data-hcms-font-path")),gr(t,!1);let i=e.getAttribute("data-hcms-font")||"";return Nl(t,i),r.value===i?null:(r.value=i,r)}var G=e=>`<svg viewBox="0 0 32 20" width="32" height="20" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" aria-hidden="true">${e}</svg>`,z=(e,t,r,i,l="")=>`<rect x="${e}" y="${t}" width="${r}" height="${i}" rx="1"${l}/>`,B=(e,t,r)=>`<path d="M${e} ${t}H${r}"/>`,qt=' fill="currentColor" fill-opacity="0.3"',Fn=Object.freeze({"cols-1":{label:"One column",svg:G(z(2,2,28,16))},"cols-2":{label:"Two columns",svg:G(z(2,2,13,16)+z(17,2,13,16))},"cols-3":{label:"Three columns",svg:G(z(2,2,8,16)+z(12,2,8,16)+z(22,2,8,16))},"cols-4":{label:"Four columns",svg:G(z(2,2,5.5,16)+z(9.5,2,5.5,16)+z(17,2,5.5,16)+z(24.5,2,5.5,16))},"media-left":{label:"Image left",svg:G(z(2,3,12,14,qt)+B(18,6,30)+B(18,10,30)+B(18,14,26))},"media-right":{label:"Image right",svg:G(z(18,3,12,14,qt)+B(2,6,14)+B(2,10,14)+B(2,14,10))},"media-top":{label:"Image on top",svg:G(z(2,2,28,8,qt)+B(2,14,30)+B(2,17,22))},list:{label:"List",svg:G(B(3,5,4)+B(8,5,29)+B(3,10,4)+B(8,10,29)+B(3,15,4)+B(8,15,29))},cards:{label:"Cards",svg:G(z(2,2,13,7)+z(17,2,13,7)+z(2,11,13,7)+z(17,11,13,7))},centered:{label:"Centered",svg:G(B(6,5,26)+B(9,10,23)+B(11,15,21))},"card-flat":{label:"Flat",svg:G(z(5,3,22,14))},"card-raised":{label:"Raised",svg:G(z(7,5,22,14,' stroke-opacity="0.35"')+z(4,2,22,14,' fill="var(--mirk-bg, transparent)"'))}});function Dn(e){return(e||[]).map(t=>{let r=t.indexOf(":"),i=r===-1?t:t.slice(0,r),l=r===-1?t:t.slice(r+1),a=Fn[l]||null;return{value:i,icon:a,label:a?a.label:De(i)}})}function Bn(e,{tokens:t,value:r,name:i,doc:l}){let a=Dn(t),o=r==null?"":String(r);o!==""&&!a.some(s=>s.value===o)&&a.unshift({value:o,icon:null,label:De(o)});let n=e.querySelector(".hcms-variant-option");if(!n||!n.parentNode)return a.length;for(let s of a){let h=n.cloneNode(!0),d=h.querySelector('input[type="radio"]');d&&(d.value=s.value,d.name=i);let f=h.querySelector(".hcms-variant-icon");f&&(s.icon?f.innerHTML=s.icon.svg:f.remove());let m=h.querySelector(".hcms-variant-label");m&&(m.textContent=s.label),h.setAttribute("title",s.label),n.parentNode.insertBefore(h,n)}return n.remove(),a.length}function Fl(e){if(!e)return"";let t=String(e).split(/[?#]/)[0],r=t.split("/").pop()||t;try{return decodeURIComponent(r)}catch{return r}}function br({pageRules:e,formRules:t,data:r,doc:i}){let l=i.createDocumentFragment(),a=In(e,r,i);a&&l.appendChild(a);let o=kt(e,[],r,i,e);return o&&l.appendChild(o),l}function In(e,t,r){let i=[];if(s(e,t,[]),!i.length)return null;let l=Q(r,"@object");if(!l)return null;let a=se(l,r);a.setAttribute("data-hcms-page-style","");let o=a.querySelector("[data-hcms-label]");o&&(o.textContent="Page style");let n=a.querySelector(".hcms-object-fields")||a;for(let[h,d,f]of i){let m=kt(h,d,f,r,e);m&&n.appendChild(m)}return a;function s(h,d,f){if(typeof h=="string"){f.length&&sr(h,r,f,e)==="page"&&i.push([h,f,d]);return}if(!(!h||typeof h!="object"||Array.isArray(h))){if(f.length){let m=xe(f,"@object",r);if(m&&gt(m))return}for(let[m,u]of Object.entries(h))s(u,d==null?null:d[m],[...f,m])}}}function Dl(e,t,r,i){let l=[],a=[];for(let[o,n]of Object.entries(e)){let s=sr(n,r,[...t,o],i);s!=="page"&&(s?l:a).push([o,n])}return[...l,...a]}function Pn({shape:e,itemShape:t,pathArr:r,data:i,doc:l,itemKey:a,pageRules:o}){if(e==="object-array-item")return Pl(t,r,i,l,o);if(e==="scalar-array-item")return Hl(r,i,l,a||null);throw new Error(`hypercms: buildItem called with unknown shape "${e}"`)}function kt(e,t,r,i,l){let a=Be(e);return a==="scalar"?Hn(e,t,r,i,l):a==="object"?Wn(e,t,r,i,l):a==="object-array"?Gn(e,t,r,i,l):a==="scalar-array"?Jn(e,t,r,i):null}function Hn(e,t,r,i,l){let a=Ie(e,i,t,l),o=xe(t,a,i);if(!o)throw new Error(`hypercms: missing template for scalar at "${t.join(".")}"`);let n=rn(e,i,t,l);n==="@number"&&a==="@scalar"&&console.info(`[hypercms] field "${t.join(".")}" declares component "@number" but its value isn't a plain number; rendering a text input so the value is preserved`),(n==="@checkbox"||n==="@toggle")&&a==="@scalar"&&console.info(`[hypercms] field "${t.join(".")}" declares component "${n}" but its value isn't true/false; rendering a text input so the value is preserved`),Bl(o,n===a?n:null,t);let s=se(o,i);we(s,t);let h=o.getAttribute?.("data-hcms-tpl");if((a==="@select"||a==="@radio")&&h===a&&Un(s,e,t,r,i,a,l),a==="@variant"&&h==="@variant"){let d=Xe(e,i,t,l);d||Il(s,"data-hcms-options required (value:icon tokens)"),Bn(s,{tokens:d,value:r,name:kr(t.join(".")),doc:i})===0&&s.querySelector(".hcms-variant-option")?.remove()}if(a==="@image"&&h==="@image"){let d=cn(e,i,t,l);d!=null&&!s.hasAttribute("data-hcms-crop")&&s.setAttribute("data-hcms-crop",d)}return Xn(s,te(t)),vt(s,te(t)),yt(s,te(t)),Jl(s,r),a==="@color"&&h==="@color"&&wn(s,{value:r,tokens:Xe(e,i,t,l),path:t.join("."),doc:i}),a==="@font"&&h==="@font"&&jn(s,{value:r,tokens:Xe(e,i,t,l),path:t.join("."),doc:i}),a==="@file"&&Vn(s),s}function Bl(e,t,r){if(!t)return;let i=e.getAttribute?.("data-hcms-tpl");i&&i!==t&&console.info(`[hypercms] field "${r.join(".")}" declares component "${t}" but custom template "${i}" wins`)}function Un(e,t,r,i,l,a,o){let n=Xe(t,l,r,o),s=n?[...n]:[],h=i==null?"":String(i);if(h!==""&&!s.includes(h)&&s.unshift(h),!n&&(Il(e,"data-hcms-options required (space-separated values)"),s.length===0)){e.querySelector(".mirk-radio")?.remove();return}if(a==="@select"){let m=e.querySelector("select[data-hcms-field]");if(!m)return;for(let u of s){let c=l.createElement("option");c.value=u,c.textContent=De(u),m.appendChild(c)}return}let d=e.querySelector(".mirk-radio");if(!d||!d.parentNode)return;let f=kr(r.join("."));for(let m of s){let u=d.cloneNode(!0),c=u.querySelector('input[type="radio"]');c&&(c.value=m,c.name=f);let p=u.querySelector(".mirk-radio__label");p&&(p.textContent=De(m)),d.parentNode.insertBefore(u,d)}d.remove()}function kr(e){return"hcms-"+String(e).replace(/[^A-Za-z0-9_-]/g,"-")}function Il(e,t){let r=e.querySelector?e.querySelector(".hcms-error"):null;r&&(r.textContent=t,r.hidden=!1)}function Vn(e){let t=e.querySelector?e.querySelector("a.mirk-file__name[data-hcms-field]"):null;t&&(t.textContent=Fl(t.getAttribute("href")))}function Wn(e,t,r,i,l){let a=xe(t,"@object",i);if(!a)throw new Error(`hypercms: missing template for object at "${t.join(".")}"`);let o=se(a,i);if(we(o,t),vt(o,te(t)),yt(o,te(t)),gt(a))return Kl(o,e,t),Xl(o,e,r),o;let n=xt(o,".hcms-object-fields",a,t);for(let[s,h]of Dl(e,t,i,l)){let d=r==null?null:r[s],f=kt(h,[...t,s],d,i,l);f&&n.appendChild(f)}return t.length&&!n.children.length&&Object.keys(e).length?null:o}function Gn(e,t,r,i,l){let a=xe(t,"@object-array",i);if(!a)throw new Error(`hypercms: missing template for object-array at "${t.join(".")}"`);let o=se(a,i);we(o,t),vt(o,te(t)),yt(o,te(t)),Vl(o,a),Gl(o,a,t);let n=xt(o,".hcms-array-items",a,t),[,s]=e;return(Array.isArray(r)?r:[]).forEach((h,d)=>{let f=Pl(s,[...t,d],h,i,l);f&&n.appendChild(f)}),Wl(o),o}function Pl(e,t,r,i,l){let a=Ul(t,"object-array-item",i);if(!a)throw new Error(`hypercms: missing item template for "${t.join(".")}"`);let o=se(a,i);if(o.setAttribute("data-hcms-card",""),o.classList.contains("hcms-card")||o.classList.add("hcms-card"),we(o,t),gt(a))return e&&typeof e=="object"&&!Array.isArray(e)&&(Kl(o,e,t),Xl(o,e,r)),o;let n=xt(o,".hcms-card-fields",a,t);if(e&&typeof e=="object"&&!Array.isArray(e))for(let[s,h]of Dl(e,t,i,l)){let d=r==null?null:r[s],f=kt(h,[...t,s],d,i,l);f&&n.appendChild(f)}return o}function Jn(e,t,r,i){let l=cr(e,i),a=vl(e,t,i),o=l?l.array:"@scalar-array",n=xe(t,o,i);if(!n)throw new Error(`hypercms: missing template for scalar-array at "${t.join(".")}"`);Bl(n,l?l.array:null,t);let s=se(n,i);we(s,t),vt(s,te(t)),yt(s,te(t)),Vl(s,n),Gl(s,n,t),a&&s.setAttribute("data-hcms-item-tpl",a.item);let h=xt(s,".hcms-array-items",n,t);return(Array.isArray(r)?r:[]).forEach((d,f)=>{let m=Hl([...t,f],d,i,a?a.item:null);m&&h.appendChild(m)}),Wl(s),s}function Hl(e,t,r,i){let l=Ul(e,"scalar-array-item",r,i);if(!l)throw new Error(`hypercms: missing item template for "${e.join(".")}"`);let a=se(l,r);return a.setAttribute("data-hcms-array-item",""),a.classList.contains("hcms-array-item")||a.classList.add("hcms-array-item"),we(a,e),Jl(a,t),a}function Ul(e,t,r,i){let l=e.map(a=>typeof a=="number"?"*":a).join(".");return Q(r,l)||i&&Q(r,i)||Q(r,"@"+t)}function se(e,t){let r=e.content||e,i=t.createElement("div");return i.appendChild(r.cloneNode(!0)),i.firstElementChild||i}function we(e,t){e.setAttribute("data-hcms-path",t.join(".")),e.setAttribute("data-hcms-path-shape",hr(t))}function Xn(e,t){let r=t==null?"":String(t);if(e.matches&&e.matches("[data-hcms-field]")){e.getAttribute("data-hcms-field")||e.setAttribute("data-hcms-field",r);return}(e.querySelectorAll?e.querySelectorAll("[data-hcms-field]"):[]).forEach(i=>{i.getAttribute("data-hcms-field")||i.setAttribute("data-hcms-field",r)})}function vt(e,t){t==null||t===""||!e.setAttribute||e.hasAttribute?.("data-hcms-field")||e.setAttribute("data-hcms-field",String(t))}function yt(e,t){t==null||t===""||(e.querySelectorAll?e.querySelectorAll("[data-hcms-label]"):[]).forEach(r=>{(r.textContent||"").trim()===""&&(r.textContent=De(String(t)))})}function Vl(e,t){["data-hcms-no-add","data-hcms-no-remove","data-hcms-no-reorder"].forEach(r=>{t.hasAttribute(r)&&e.setAttribute(r,"")}),["data-hcms-min-items","data-hcms-max-items"].forEach(r=>{t.hasAttribute(r)&&e.setAttribute(r,t.getAttribute(r))})}function Wl(e){let t=e.querySelector?e.querySelector(".hcms-array-items"):null;if(!t)return;let r=Array.from(t.querySelectorAll(":scope > [data-hcms-card], :scope > [data-hcms-array-item]")),i=r.length,l=ki(e,"data-hcms-max-items"),a=ki(e,"data-hcms-min-items"),o=e.hasAttribute("data-hcms-no-add"),n=e.hasAttribute("data-hcms-no-remove"),s=e.hasAttribute("data-hcms-no-reorder"),h=e.querySelector('[data-hcms-action="add"]');h&&(h.hidden=o||l!=null&&i>=l),r.forEach((d,f)=>{let m=d.querySelector('[data-hcms-action="remove"]');m&&(m.hidden=n||a!=null&&i<=a);let u=d.querySelector('[data-hcms-action="move-up"]');u&&(u.hidden=s||f===0);let c=d.querySelector('[data-hcms-action="move-down"]');c&&(c.hidden=s||f===i-1)})}function ki(e,t){if(!e||!e.hasAttribute(t))return null;let r=parseInt(e.getAttribute(t),10);return Number.isFinite(r)?r:null}function Gl(e,t,r){if(e.hasAttribute("data-hcms-no-reorder")||t.hasAttribute("data-hcms-no-reorder"))return;let i=e.querySelector(".hcms-array-items");if(!i)return;let l="hcms-"+r.join(".");i.setAttribute("sortable",l),i.setAttribute("onsorted","hypercmsCommit && hypercmsCommit()")}function te(e){return e.length?e[e.length-1]:null}function Jl(e,t){let r=Kn(e);if(r.length!==0)for(let i of r)Zl(i,t)}function Kn(e){if(!e)return[];let t=[];return e.matches?.("[data-hcms-field]")&&Zn(e)&&t.push(e),(e.querySelectorAll?e.querySelectorAll("input[data-hcms-field], textarea[data-hcms-field], select[data-hcms-field], img[data-hcms-field], a[data-hcms-field], [contenteditable][data-hcms-field]"):[]).forEach(r=>t.push(r)),t}function Zn(e){let t=(e.tagName||"").toUpperCase();return!!(t==="INPUT"||t==="TEXTAREA"||t==="SELECT"||t==="IMG"||t==="A"||e.hasAttribute?.("contenteditable"))}function Xl(e,t,r){(e.querySelectorAll?e.querySelectorAll("[data-hcms-field]"):[]).forEach(i=>{let l=i.getAttribute("data-hcms-field");if(!l)return;if(!t||typeof t!="object"||!(l in t)){console.warn(`[hypercms] inline template field "${l}" is not in the rule shape; ignoring`);return}let a=r==null?null:r[l];Zl(i,a)})}function Kl(e,t,r){e.querySelectorAll&&e.querySelectorAll("[data-hcms-field]").forEach(i=>{let l=i.getAttribute("data-hcms-field");if(!l||t&&typeof t=="object"&&!(l in t))return;let a=[...r,l].join(".");i.setAttribute("data-hcms-path",a),i.setAttribute("data-hcms-path-shape",hr([...r,l]))})}function xt(e,t,r,i){if(!e.querySelector)return e;let l=e.querySelector(t);if(l)return l;let a=r?.getAttribute?.("data-hcms-tpl")||i.join(".");throw new Error(`hypercms: template "${a}" is in slotted mode but has no ${t} element`)}function Zl(e,t){let r=dr(e),i=(e.tagName||"").toUpperCase(),l=(e.getAttribute("type")||"").toLowerCase();if(i==="INPUT"&&l==="radio"){e.checked=e.value!=null&&String(e.value)===String(t??"");return}if(r==="checked"){e.checked=t===!0||t==="true";return}if(r){e[r]=t==null?"":String(t);return}e.textContent=t==null?"":String(t)}var Qn={Mutation:(e,t)=>e?.Mutation??t?.Mutation,undo:(e,t)=>e?.undo??t?.undo,onPrepareForSave:(e,t)=>e?.addDocumentTransform??t?.onPrepareForSave,onSnapshot:(e,t)=>e?.onSnapshot??t?.onSnapshot,consent:(e,t)=>e?.confirm??t?.consent,RichClay:(e,t)=>e?.RichClay??t?.RichClay,quickcrop:(e,t)=>e?.quickcrop??t?.quickcrop,upload:(e,t)=>e?.upload??(t?.uploadFileBasic?es(t.uploadFileBasic):null)},Yn={402:"payment-required",413:"too-large",415:"unsupported-type",401:"unauthorized",403:"forbidden",404:"not-found"},Ot=()=>({ok:!1,msg:"Upload cancelled",msgType:"skipped",code:"aborted",uploads:[]});function es(e){return async function(t,{onProgress:r,signal:i}={}){if(i?.aborted)return Ot();try{let l=await e(t,{onProgress:o=>{r?.({loaded:null,total:null,percent:o})}});if(i?.aborted)return Ot();let a=l&&l.uploads||[];return typeof a[0]?.url!="string"?{ok:!1,msg:"The host accepted the file but did not say where it put it",msgType:"error",code:"bad-response",uploads:[]}:{ok:!0,msg:l.msg||"Uploaded",msgType:l.msgType||"success",code:l.code||null,uploads:a}}catch(l){if(i?.aborted)return Ot();let a={};try{a=JSON.parse(l?.response||"{}")}catch{a={}}let o=a.code||Yn[l?.status]||"error";return{ok:!1,msg:l&&l.message||"Upload failed",msgType:"error",code:o,uploads:[]}}}}function V(e,t){let r=Qn[e];if(!r)throw new Error(`hypercms: unknown platform capability "${e}"`);let i=t||(typeof window<"u"?window:null);return i&&r(i.clay,i.hyperclay)||null}var ts=["clay:mutation-ready","hyperclay:mutation-ready"],rs=["clay:sync-applied","hyperclay:livesync-applied"],is=["clay:ready","hyperclay:ready"];function vr(e,t,r){let i=null,l=a=>{i!==null&&i!==a.type||(i=a.type,queueMicrotask(()=>{i=null}),r(a))};for(let a of t)e.addEventListener(a,l);return()=>{for(let a of t)e.removeEventListener(a,l)}}var re="data-hcms-bound",ke="data-hcms-bound-id",yr=new Map;function ls(e,t){yr.set(e,t)}function as(e){yr.delete(e)}function os(e){let t=e.getAttribute(ke);if(!t)return null;let r=yr.get(t);return!r||!r.restorable()?null:r.originalHTML}var ve="data-hcms-owns-richclay";function wt(e){return e&&e.richclay&&e.richclay.RichClay||V("RichClay",e)||(e&&typeof e.RichClay=="function"?e.RichClay:null)}function ns(e,t,r){!e||typeof e.setAttribute!="function"||(e.setAttribute(re,t?"rich":"plain"),r&&e.setAttribute(ve,"true"))}function ss(e,t){if(!e||typeof e.querySelectorAll!="function")return;let r=e.querySelectorAll(`[${re}]`);if(!r.length)return;let i=wt(t);if(i&&typeof i.stripFromClone=="function")try{i.stripFromClone(e)}catch(l){console.warn("[hypercms] richclay strip failed; editor state may reach the save",l)}for(let l of r)l.getAttribute(ve)==="true"&&l.removeAttribute("data-richclay"),l.removeAttribute(ve),l.removeAttribute(re)}function cs(e,t){if(!e||typeof e.removeAttribute!="function")return;let r=wt(t);if(r&&typeof r.stripElement=="function")try{r.stripElement(e)}catch(i){console.warn("[hypercms] richclay element strip failed; the clone stays editable",i)}else e.removeAttribute("contenteditable"),e.removeAttribute("no-undo");e.getAttribute(ve)==="true"&&e.removeAttribute("data-richclay"),e.removeAttribute(ve),e.removeAttribute(re),e.removeAttribute(ke)}function hs(e,t){if(!t||e==null)return e;return r(e);function r(i){if(typeof i=="string"){if(i.endsWith("[]")||P(i)!==-1)return i;let l=null;try{l=t.querySelector(i)}catch{return i}return l&&l.children.length>0?i+"@innerHTML":i}if(Array.isArray(i))return i;if(i&&typeof i=="object"){let l=Object.create(null);for(let[a,o]of Object.entries(i))l[a]=r(o);return l}return i}}function ds(e,t){if(!t||e==null)return e;return r(e,[t]);function r(i,l){if(typeof i=="string")return i.endsWith("[]")||P(i)!==-1?i:l.some(a=>us(a,i))?i+"@innerHTML":i;if(Array.isArray(i)){let[a,o]=i;if(typeof a!="string"||!a)return i;let n=ms(t,a);return n.length?[a,r(o,n)]:i}if(i&&typeof i=="object"){let a=Object.create(null);for(let[o,n]of Object.entries(i))a[o]=r(n,l);return a}return i}}function us(e,t){let r=null;try{r=e.querySelector(t)}catch{return!1}return r?r.hasAttribute(re)?r.getAttribute(re)==="rich":r.children.length>0:!1}function ms(e,t){try{return[...e.querySelectorAll(t)]}catch{return[]}}function lt(e){if(!e||e.tagName!=="TEXTAREA")return;let t=e.ownerDocument.defaultView||(typeof window<"u"?window:null);t&&t.CSS&&t.CSS.supports&&t.CSS.supports("field-sizing: content")||(e.style.height="auto",e.style.height=e.scrollHeight+"px")}function At(e,t,r=!0){if(!e||!e.querySelectorAll||(e.querySelectorAll("textarea[data-hcms-field]").forEach(lt),r===!1))return;let i=t&&t.defaultView||(typeof window<"u"?window:null),l=wt(i);l&&e.querySelectorAll("[contenteditable][data-hcms-field]").forEach(a=>{if(a.__hcmsRichclay)return;let o;try{o=new l(a,{inline:!0,hyperclay:!1,toolbar:["bold","italic","link","undo","redo"]})}catch(s){console.warn("[hypercms] richclay activation failed; field stays plain contenteditable",s);return}a.__hcmsRichclay=o;let n=o&&o.squire;n&&typeof n.addEventListener=="function"&&n.addEventListener("input",()=>{let s=i&&i.Event||Event;a.dispatchEvent(new s("input",{bubbles:!0}))})})}var Ql="link[data-hcms-fonts]",ps="link[data-hcms-fonts-preconnect]";function fs(e,t,r){let i=[],l=!1;return a(e,t,[]),{stacks:i,found:l};function a(o,n,s){if(typeof o=="string"){if(o.endsWith("[]")||Ie(o,r,s,e)!=="@font")return;l=!0,n!=null&&n!==""&&i.push(String(n));return}if(Array.isArray(o)){let h=Array.isArray(n)?n:[];h.forEach(d=>a(o[1],d,[...s,"*"])),h.length||a(o[1],void 0,[...s,"*"]);return}if(o&&typeof o=="object")for(let[h,d]of Object.entries(o))a(d,n?.[h],[...s,h])}}function gs(e,t){let r=e?.head;if(!r)return;let i=r.querySelector(Ql),l=r.querySelector(ps);if(!t){i?.remove(),l?.remove();return}l||(l=e.createElement("link"),l.setAttribute("rel","preconnect"),l.setAttribute("href","https://fonts.gstatic.com"),l.setAttribute("crossorigin",""),l.setAttribute("data-hcms-fonts-preconnect",""),l.setAttribute("no-undo",""),r.appendChild(l)),i||(i=e.createElement("link"),i.setAttribute("rel","stylesheet"),i.setAttribute("data-hcms-fonts",""),i.setAttribute("no-undo",""),l.after(i)),i.hasAttribute("no-undo")||i.setAttribute("no-undo",""),l.hasAttribute("no-undo")||l.setAttribute("no-undo",""),i.getAttribute("href")!==t&&i.setAttribute("href",t)}function xr(e,t){if(!e?.doc||e.pageRules==null)return;let{stacks:r,found:i}=fs(e.pageRules,t,e.doc);if(!i)return;let l=e.doc.head?.querySelector(Ql)?.getAttribute("href")||null,a=jl(r,l);a&&l&&Rn(l,a)||gs(e.doc,a)}var Lt=new WeakSet;function Pe(e,t){let r=V("undo");if(!r)return t();r.pause();try{let i=t();return i&&i.ok?r.commitCaptured(e):r.discardCaptured(),i}finally{r.resume()}}function Ae(e){let t=V("undo");if(!t)return e();t.pause();try{return e()}finally{t.discardCaptured(),t.resume()}}function Yl(e){let{formRoot:t}=e;if(!t||Lt.has(t))return;Lt.add(t);let r=o=>{let n=o.target;!n||!n.closest||n.closest("[data-hcms-form-root]")&&(n.matches("[data-hcms-color-input]")||n.matches("input, textarea, select, [contenteditable][data-hcms-field]")&&(n.tagName==="TEXTAREA"&&lt(n),!n.matches('input[type="file"]')&&(!n.closest("[data-hcms-field]")&&!n.hasAttribute?.("data-hcms-field")||Oe(n,e))))},i=o=>{let n=o.target;if(!(!n||!n.closest)&&n.closest("[data-hcms-form-root]")){if(n.matches("[data-hcms-color-input]")){let s=Cn(n);s&&Oe(s,e);return}if(n.matches('input[type="file"][data-hcms-upload]')){_s(n,e);return}n.matches('input[type="checkbox"], input[type="radio"], select')&&Oe(n,e)}},l=o=>{let n=o.target;if(!n||!n.closest)return;let s=n.closest("[data-hcms-action]");if(!s)return;let h=s.getAttribute("data-hcms-action");if(h==="add"||h==="remove"||h==="move-up"||h==="move-down"||h==="clear-upload"||h==="color-pick"||h==="color-clear"||h==="color-panel"||h==="font-pick"||h==="font-panel"){if(!s.closest("[data-hcms-form-root]"))return}else if(h==="close"&&!s.closest("[data-hcms-shell]"))return;if(h==="add"){let d=s.closest("[data-hcms-path]");if(!d)return;let f=d.getAttribute("data-hcms-path");wr(f,e)}else if(h==="remove"){let d=s.closest("[data-hcms-card], [data-hcms-array-item]");if(!d)return;ia(d,e)}else if(h==="move-up"||h==="move-down"){let d=s.closest("[data-hcms-card], [data-hcms-array-item]");if(!d)return;ra(d,h==="move-up"?-1:1,e)}else if(h==="clear-upload")Ts(s,e);else if(h==="color-pick"||h==="color-clear"){let d=h==="color-pick"?_n(s):En(s);d&&Oe(d,e)}else if(h==="color-panel")Sn(s);else if(h==="font-pick"){let d=zn(s);d&&Oe(d,e)}else h==="font-panel"?Nn(s):h==="close"&&e.onCloseRequested?.()},a=t.ownerDocument;a.addEventListener("input",r,!0),a.addEventListener("change",i,!0),a.addEventListener("click",l,!0),e.detachEvents=()=>{a.removeEventListener("input",r,!0),a.removeEventListener("change",i,!0),a.removeEventListener("click",l,!0),Lt.delete(t)}}var bs=new Set(["value","checked"]);function ks(e,t){if(!t)return null;let r=be(t);if(r.some(s=>typeof s=="number"||s==="*"))return null;let i=Fe(e.pageRules,r);if(typeof i!="string")return null;let l=X.ruleAttrIndex(i);if(l===-1)return null;let a=i.slice(l+1);if(!bs.has(a))return null;let o=i.slice(0,l),n=o?e.pageRoot.querySelector(o):oe(e.pageRoot);return n?{el:n,prop:a,oldValue:n[a]}:null}function Oe(e,t){let r=(e.closest("[data-hcms-field]")||e).closest("[data-hcms-path]")?.getAttribute("data-hcms-path")||"",i=ks(t,r);if(Y(J(t),{path:r,structural:!1},t),i){let l=V("undo");l&&typeof l.recordValue=="function"&&l.recordValue(i.el,{prop:i.prop,oldValue:i.oldValue,newValue:i.el[i.prop]})}}var vs={type:"image/webp",quality:.85,maxWidth:2048,maxHeight:2048};async function ys(e,t){let r=t&&t.getAttribute?t.getAttribute("data-hcms-crop"):null;if(r==null)return{file:e};let i=V("quickcrop");if(typeof i!="function")return{file:e};try{let l=typeof window<"u"&&(window.clay?.modal??window.themodal)||"auto",a=await i(e,{aspect:xs(r),modal:l,...vs});return a===null?null:{file:ws(a.blob,e.name),dataURL:a.dataURL}}catch(l){return ye(t,l&&l.message||"Crop failed"),null}}function xs(e){let t=String(e??"").trim().toLowerCase();if(t===""||t==="free")return null;let r=t.match(/^(\d+(?:\.\d+)?)\s*[:/]\s*(\d+(?:\.\d+)?)$/);if(!r)return null;let i=parseFloat(r[1]),l=parseFloat(r[2]);return!i||!l?null:i/l}function ws(e,t){let r=e.type==="image/webp"?".webp":e.type==="image/jpeg"?".jpg":".png",i=String(t||"image").replace(/\.[^.]+$/,"");try{return new File([e],i+r,{type:e.type})}catch{return e}}var As=new Set(["unsupported","payment-required"]);async function _s(e,t){let r=e.files&&e.files[0];if(!r)return;let i=e.closest("[data-hcms-path]");if(!i)return;let l=i.getAttribute("data-hcms-path")||"";ye(i,null);let a=await ys(r,i);if(!a||t.closed){ie(e);return}let o=a.file,n=a.dataURL||null,s=V("upload");if(typeof s!="function")return $t(e,i,t,l,await vi(o,n,i),o);ta(i,n),yi(i,0);let h=Ss(t),d;try{d=await s(o,{signal:h?.signal,onProgress:({percent:m})=>yi(i,m)})}finally{Cs(t,h),qs(i)}if(t.closed){ie(e);return}if(d.code==="aborted"){ie(e);return}if(d.ok)return $t(e,i,t,l,d.uploads[0].url,o);if(!As.has(d.code)){ye(i,d.msg||"Upload failed"),t.dispatch?.("hcms:error",{error:new Error(d.msg||"Upload failed"),code:d.code,path:l}),ie(e);return}let f=d.code==="payment-required"?"This file is stored in the page. Add a paid plan to upload files.":null;return $t(e,i,t,l,await vi(o,n,i),o,f)}function $t(e,t,r,i,l,a,o=null){if(r.closed){ie(e);return}if(ta(t,null),ye(t,null),!l){ie(e);return}ea(t,l,a.name),Y(J(r),{path:i,structural:!1},r),o&&ye(t,o,"info"),ie(e)}async function vi(e,t,r){return t||await Es(e,r)}function Es(e,t){let r=t?.ownerDocument?.defaultView?.FileReader||globalThis.FileReader;return r?new Promise(i=>{let l=new r;l.onload=()=>i(typeof l.result=="string"?l.result:""),l.onerror=()=>i("");try{l.readAsDataURL(e)}catch{i("")}}):Promise.resolve("")}function Ss(e){if(typeof AbortController!="function")return null;let t=new AbortController;return(e.uploads||(e.uploads=new Set)).add(t),t}function Cs(e,t){t&&e.uploads?.delete(t)}function Ts(e,t){let r=e.closest("[data-hcms-path]");if(!r)return;let i=r.getAttribute("data-hcms-path")||"";ea(r,"","");let l=r.querySelector('input[type="file"][data-hcms-upload]');l&&ie(l),ye(r,null),Y(J(t),{path:i,structural:!1},t)}function Rs(e){return e.querySelector?e.querySelector("img[data-hcms-field], a[data-hcms-field]"):null}function ea(e,t,r){let i=Rs(e);if(!i)return;let l=(i.tagName||"").toUpperCase();l==="IMG"?i.src=t||"":l==="A"&&(i.href=t||"",i.textContent=t?r||Fl(t):"")}function ie(e){try{e.value=""}catch{}}function ta(e,t){let r=e.querySelector?e.querySelector(".mirk-image__frame"):null;r&&(t?r.style.backgroundImage=`url("${t.replace(/"/g,"%22")}")`:r.style.removeProperty("background-image"))}function yi(e,t){let r=Math.max(0,Math.min(100,Number(t)||0));e.setAttribute("data-hcms-uploading",""),e.style?.setProperty?.("--hcms-upload-progress",`${r}%`)}function qs(e){e.removeAttribute("data-hcms-uploading"),e.style?.removeProperty?.("--hcms-upload-progress")}function ye(e,t,r="error"){let i=e.querySelector?e.querySelector(":scope > .hcms-error"):null;i&&(i.classList.toggle("hcms-error--info",!!t&&r==="info"),t?(i.textContent=t,i.hidden=!1):(i.textContent="",i.hidden=!0))}function wr(e,t){let{formRoot:r,pageRules:i}=t,l=r.querySelector(`[data-hcms-path="${_e(e)}"]`);if(!l)throw new Error(`hypercms: no element at path "${e}"`);let a=l.querySelector(".hcms-array-items");if(!a)throw new Error(`hypercms: array container missing .hcms-array-items at "${e}"`);let o=be(e),n=Ms(i,o),s=Array.isArray(n),h=typeof n=="string"&&n.endsWith("[]");if(!s&&!h)throw new Error(`hypercms: path "${e}" is not an array`);let d=at(l,"data-hcms-max-items"),f=a.querySelectorAll(":scope > [data-hcms-card], :scope > [data-hcms-array-item]");if(l.hasAttribute("data-hcms-no-add")||d!=null&&f.length>=d)return;let m=f.length,u=s?n[1]:n.replace(/\[\]$/,""),c=or(s?u:"string"),p=Pn({shape:s?"object-array-item":"scalar-array-item",itemShape:u,pathArr:[...o,m],data:c,doc:t.doc,itemKey:l.getAttribute("data-hcms-item-tpl")||null,pageRules:i});return a.appendChild(p),At(p,t.doc,t.view?.enhanceFormRichText!==!1),Ar(l),Pe(`Add ${e}`,()=>Y(J(t),{path:e,structural:!0},t))}function ra(e,t,r){let i=e.closest('[data-hcms-shape="object-array"], [data-hcms-shape="scalar-array"]');if(!i||i.hasAttribute("data-hcms-no-reorder"))return;let l=i.querySelector(".hcms-array-items");if(!l)return;let a=Array.from(l.querySelectorAll(":scope > [data-hcms-card], :scope > [data-hcms-array-item]")),o=a.indexOf(e);if(o<0)return;let n=o+t;if(n<0||n>=a.length)return;let s=e.querySelector(`[data-hcms-action="${t<0?"move-up":"move-down"}"]`);return t<0?l.insertBefore(e,a[n]):l.insertBefore(e,a[n].nextSibling),_r(l),Ar(i),s&&typeof s.focus=="function"&&e.querySelector(`[data-hcms-action="${t<0?"move-up":"move-down"}"]`)?.focus?.(),Pe(`Reorder ${i.getAttribute("data-hcms-path")||""}`,()=>Y(J(r),{path:i.getAttribute("data-hcms-path")||"",structural:!0},r))}var jt="Delete this item?";function Os(e,t){let r=e&&e.getAttribute("data-hcms-confirm-remove");if(r!=null)return/^(off|false|no|0)$/i.test(r.trim())?null:r||jt;let i=t&&t.confirmRemove;return i===!1?null:typeof i=="string"?i||jt:i===!0||e&&e.getAttribute("data-hcms-shape")==="object-array"?jt:null}function ia(e,t){let r=e.closest('[data-hcms-shape="object-array"], [data-hcms-shape="scalar-array"]'),i=Os(r,t);if(i==null)return Le(e,t);let l=V("consent")||typeof window<"u"&&window.consent;typeof l=="function"?Promise.resolve(l(i)).then(()=>{t.closed||Le(e,t)},()=>{}):typeof window<"u"&&typeof window.confirm=="function"?window.confirm(i)&&Le(e,t):Le(e,t)}function Le(e,t){let r=e.getAttribute("data-hcms-path")||"",i=e.parentElement,l=e.closest('[data-hcms-shape="object-array"], [data-hcms-shape="scalar-array"]');if(!l?.hasAttribute("data-hcms-no-remove")){if(l){let a=at(l,"data-hcms-min-items"),o=l.querySelector(".hcms-array-items"),n=o?o.querySelectorAll(":scope > [data-hcms-card], :scope > [data-hcms-array-item]").length:0;if(a!=null&&n<=a)return}return e.remove(),i&&_r(i),l&&Ar(l),Pe(`Remove ${r}`,()=>Y(J(t),{path:r,structural:!0},t))}}function Y(e,t,r){if(r.closed)return{ok:!1,skipped:!0,closed:!0};let i=ot(e);if(!t.structural&&i===r.lastFingerprint)return{ok:!0,skipped:!0};let l=Object.hasOwn(r,"writeRules")?r.writeRules:r.pageRules,a=Uo(r.pageRoot,l,e,{shellRoot:r.shellRoot,structural:!!t.structural,structuralPath:t.path||null,formRoot:r.formRoot});return a.ok?(r.lastFingerprint=i,r.lastData=e,xr(r,e),xi(r,null),r.dispatch?.("hcms:change",{data:e,path:t.path,structural:!!t.structural}),r.onChange?.(e,t)):(xi(r,js(a.error,t.path)),r.dispatch?.("hcms:error",{error:a.error,attemptedData:e}),r.onError?.(a.error)),a}function la(e,t){let r=_e(t),i=`[data-hcms-path="${r}"] input[data-hcms-field], [data-hcms-path="${r}"] textarea[data-hcms-field], [data-hcms-path="${r}"] select[data-hcms-field], [data-hcms-path="${r}"] img[data-hcms-field], [data-hcms-path="${r}"] a[data-hcms-field], [data-hcms-path="${r}"] [contenteditable][data-hcms-field], input[data-hcms-path="${r}"][data-hcms-field], textarea[data-hcms-path="${r}"][data-hcms-field], select[data-hcms-path="${r}"][data-hcms-field], img[data-hcms-path="${r}"][data-hcms-field], a[data-hcms-path="${r}"][data-hcms-field], [contenteditable][data-hcms-path="${r}"][data-hcms-field]`;return e.querySelector(i)}function aa(e,t,r,i){let l=(e.tagName||"").toUpperCase(),a=(e.getAttribute("type")||"").toLowerCase();if(l==="INPUT"&&a==="checkbox"){e.checked=t===!0||t==="true";return}if(l==="INPUT"&&a==="radio"){let o=_e(i),n=r.querySelectorAll(`[data-hcms-path="${o}"][data-hcms-field][type="radio"], [data-hcms-path="${o}"] [data-hcms-field][type="radio"]`);n.length?n.forEach(s=>{s.checked=String(s.value)===String(t??"")}):e.checked=String(e.value)===String(t??"");return}if(l==="IMG"){e.src=t==null?"":String(t);return}if(l==="A"){e.href=t==null?"":String(t);return}if(e.hasAttribute&&e.hasAttribute("contenteditable")){e.innerHTML=t==null?"":String(t);return}if("value"in e){e.value=t==null?"":String(t);return}e.textContent=t==null?"":String(t)}function J(e){let t=X.extract(e.formRoot,e.formRules,{exclude:null});return ne(t,e.formRules)}function ne(e,t){if(t==null||e==null)return e;if(typeof t=="string")return t.endsWith("@checked")?e===!0||e==="true":e;if(Array.isArray(t)){if(!Array.isArray(e))return e;let[,r]=t;return e.map(i=>ne(i,r))}if(typeof t=="object"){if(typeof e!="object"||Array.isArray(e))return e;let r={};for(let[i,l]of Object.entries(t))r[i]=ne(e[i],l);return r}return e}function xi(e,t){e.lastErrors=t&&t.length?t:null,oa(e)}function oa(e){if(Ls(e),e.errorEl&&(e.errorEl.textContent="",e.errorEl.hidden=!0),!e.lastErrors)return;let t=[];for(let{message:r,path:i}of e.lastErrors){if(i!=null&&i!==""){let l=$s(e.formRoot,i);if(l){l.textContent=l.textContent?`${l.textContent}
199
+ ${r}`:r,l.hidden=!1;continue}}t.push(r)}t.length&&e.errorEl&&(e.errorEl.textContent=t.join(`
200
+ `),e.errorEl.hidden=!1)}function Ls(e){if(e.formRoot)for(let t of e.formRoot.querySelectorAll(".hcms-error"))t.textContent="",t.hidden=!0}function $s(e,t){if(!e)return null;let r=t.split(".");for(;r.length>0;){let i=r.join("."),l=typeof CSS<"u"&&CSS.escape?CSS.escape(i):i.replace(/[^a-zA-Z0-9_\-.*]/g,o=>"\\"+o),a=e.querySelector(`[data-hcms-path="${l}"]`);if(a){for(let o of a.children)if(o.classList&&o.classList.contains("hcms-error"))return o}r.pop()}return null}function js(e,t){return e?e.name==="EmptyListInsert"?[{message:"Add a seed item in HTML first.",path:t}]:e.name==="ShapeMismatch"&&Array.isArray(e.mismatches)&&e.mismatches.length?e.mismatches.map(r=>({message:`Shape mismatch: expected ${r.expected}, got ${r.got}`,path:r.path})):[{message:e.message||String(e),path:t}]:[{message:"unknown error",path:t}]}function Ms(e,t){let r=e;for(let i of t){if(r==null||typeof r=="string")return;if(Array.isArray(r)){if(typeof i!="number"&&i!=="*")return;r=r[1];continue}if(typeof r=="object"){if(typeof i=="number"||!(i in r))return;r=r[i];continue}return}return r}function at(e,t){if(!e||!e.hasAttribute(t))return null;let r=parseInt(e.getAttribute(t),10);return Number.isFinite(r)?r:null}function Ar(e){if(!e)return;let t=e.querySelector(".hcms-array-items");if(!t)return;let r=Array.from(t.querySelectorAll(":scope > [data-hcms-card], :scope > [data-hcms-array-item]")),i=r.length,l=at(e,"data-hcms-max-items"),a=at(e,"data-hcms-min-items"),o=e.hasAttribute("data-hcms-no-add"),n=e.hasAttribute("data-hcms-no-remove"),s=e.hasAttribute("data-hcms-no-reorder"),h=e.querySelector(':scope > .hcms-add, :scope > * > .hcms-add, :scope > [data-hcms-action="add"]');h&&(h.hidden=o||l!=null&&i>=l),r.forEach((d,f)=>{let m=d.querySelector('[data-hcms-action="remove"]');m&&(m.hidden=n||a!=null&&i<=a);let u=d.querySelector('[data-hcms-action="move-up"]');u&&(u.hidden=s||f===0);let c=d.querySelector('[data-hcms-action="move-down"]');c&&(c.hidden=s||f===i-1)})}function na(e){!e||!e.querySelectorAll||e.querySelectorAll(".hcms-array-items").forEach(t=>_r(t))}function _r(e){let t=e.querySelectorAll?Array.from(e.querySelectorAll('input[type="radio"][data-hcms-field]'),i=>[i,i.checked]):[],r=0;for(let i of e.children){if(!i.matches?.("[data-hcms-card], [data-hcms-array-item]"))continue;let l=i.getAttribute("data-hcms-path");if(!l)continue;let a=l.split(".");a[a.length-1]=String(r);let o=a.join(".");o!==l&&Ns(i,l,o),r++}for(let[i,l]of t)i.checked!==l&&(i.checked=l)}function Ns(e,t,r){let i=e.querySelectorAll("[data-hcms-path]");e.setAttribute("data-hcms-path",r);for(let l of i){let a=l.getAttribute("data-hcms-path");a===t?l.setAttribute("data-hcms-path",r):a&&a.startsWith(t+".")&&l.setAttribute("data-hcms-path",r+a.slice(t.length))}zs(e)}function zs(e){for(let t of e.querySelectorAll('input[type="radio"][data-hcms-field]')){if(!t.name||!t.name.startsWith("hcms-"))continue;let r=t.closest("[data-hcms-path]");r&&(t.name=kr(r.getAttribute("data-hcms-path")))}}function ot(e){return JSON.stringify(e,(t,r)=>{if(r&&typeof r=="object"&&!Array.isArray(r)){let i=Object.create(null);for(let l of Object.keys(r).sort())i[l]=r[l];return i}return r})}function _e(e){return typeof CSS<"u"&&CSS.escape?CSS.escape(e):String(e).replace(/[^a-zA-Z0-9_\-.*]/g,t=>"\\"+t)}var Ze="hcms-shell-styles",Fs="hcms-bundled-styles-installed",Er="hcms-session-open",Ds='a[href], area[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',ue=new WeakSet,Gt="";function Bs(e){Gt=e}function nt(e){e?.body?.classList.add(Er)}function sa(e){e?.body?.classList.remove(Er)}var Is=0;function wi(e){return String(e).replace(/[&<>"]/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[t])}function Ps({mountTo:e,side:t="right",overlay:r=!1,showSaveButton:i=!1,title:l="Page content",eyebrow:a="Edit",theme:o=null,doc:n}){ca(n);let s=`hcms-shell-title-${++Is}`,h=n.createElement("div");h.setAttribute("data-hcms-shell",""),h.setAttribute("editor-ui",""),h.setAttribute("save-remove",""),h.setAttribute("save-ignore",""),h.setAttribute("tabindex","-1"),h.setAttribute("role","dialog"),h.setAttribute("aria-modal","true"),h.setAttribute("aria-labelledby",s);let d=o==="dark"?" dark":o==="light"?" light":"";h.className="hcms-shell pixel-quiet hcms-panel hcms-side-"+t+(r?" hcms-overlay":"")+d;let f=wi(l),m=wi(a);h.innerHTML=`
201
+ <div class="hcms-shell-minibar" aria-hidden="true">
202
+ <span class="hcms-shell-minibar-title">${f}</span>
203
+ <button type="button" class="hcms-shell-close mirk-button mirk-button--small" data-hcms-action="close" aria-label="Close">
204
+ <span class="mirk-button__label">\xD7</span>
205
+ </button>
206
+ </div>
207
+ <div class="hcms-shell-body">
208
+ <header class="hcms-shell-header">
209
+ <div class="hcms-shell-heading">
210
+ <div class="hcms-shell-eyebrow">${m}</div>
211
+ <h2 class="hcms-shell-title" id="${s}">${f}</h2>
212
+ </div>
213
+ <button type="button" class="hcms-shell-close mirk-button mirk-button--small" data-hcms-action="close" aria-label="Close">
214
+ <span class="mirk-button__label">\xD7</span>
215
+ </button>
216
+ </header>
217
+ <div class="hcms-shell-notice" role="status" hidden></div>
218
+ <div class="hcms-shell-error" role="alert" hidden></div>
219
+ <div data-hcms-form-root class="hcms-form"></div>
220
+ <footer class="hcms-shell-footer"${i?"":" hidden"}>
221
+ <button type="button" class="hcms-shell-save mirk-button" trigger-save>
222
+ <span class="mirk-button__label">Save</span>
223
+ </button>
224
+ </footer>
225
+ </div>
226
+ `,(e||n.body).appendChild(h);let u=n.body;u.classList.add("hcms-open"),nt(n),r&&u.classList.add("hcms-overlay"),t==="left"&&u.classList.add("hcms-side-left");let c=Us(h,n),p=Hs(h);return{root:h,formRoot:h.querySelector("[data-hcms-form-root]"),noticeEl:h.querySelector(".hcms-shell-notice"),errorEl:h.querySelector(".hcms-shell-error"),saveButton:h.querySelector(".hcms-shell-save"),destroy(){c.detach(),p.detach(),h.remove(),u.classList.remove("hcms-open","hcms-overlay","hcms-side-left"),sa(n)},restoreChrome(){_t(n),u.classList.add("hcms-open"),nt(n),r&&u.classList.add("hcms-overlay"),t==="left"&&u.classList.add("hcms-side-left")}}}function _t(e){e&&(e.getElementById(Ze)||e.querySelector("style[data-hcms-bundled-styles]")||(ue.delete(e),ca(e)))}function ca(e){if(e&&!ue.has(e)){if(e[Fs]){ue.add(e);return}if(e.getElementById(Ze)||e.querySelector("style[data-hcms-bundled-styles]")){ue.add(e);return}if(Gt){let t=e.createElement("style");t.id=Ze,t.setAttribute("save-remove",""),t.setAttribute("save-ignore",""),t.textContent=Gt,(e.head||e.documentElement).appendChild(t),ue.add(e);return}try{let t=new URL("./theme.generated.css",import.meta.url).href,r=e.createElement("link");r.rel="stylesheet",r.id=Ze,r.setAttribute("save-remove",""),r.setAttribute("save-ignore",""),r.href=t,(e.head||e.documentElement).appendChild(r),ue.add(e)}catch{let t=()=>{link.isConnected&&console.warn("hypercms: shell stylesheet not applied \u2014 cssText is empty and the co-located theme fallback is unavailable. Call installStyles(themeText) before opening the CMS.")};e.defaultView?.queueMicrotask?e.defaultView.queueMicrotask(t):t()}}}function Hs(e){let t=e.querySelector(".hcms-shell-body"),r=e.querySelector(".hcms-shell-header");if(!t||!r||typeof t.addEventListener!="function")return{detach(){}};let i=()=>{let l=(r.offsetHeight||0)-12;e.classList.toggle("is-condensed",t.scrollTop>l)};return t.addEventListener("scroll",i,{passive:!0}),i(),{detach(){t.removeEventListener("scroll",i)}}}function Us(e,t){function r(i){if(i.key!=="Tab"||!e.contains(t.activeElement))return;let l=Array.from(e.querySelectorAll(Ds));if(l.length===0)return;let a=l[0],o=l[l.length-1];i.shiftKey&&t.activeElement===a?(i.preventDefault(),o.focus()):!i.shiftKey&&t.activeElement===o&&(i.preventDefault(),a.focus())}return t.addEventListener("keydown",r),{detach:()=>t.removeEventListener("keydown",r)}}var Vs="[hypercms]",Ai={skip:"[data-hcms-shell]",templateAttr:"cms-template"},_i={skip:"[data-hcms-shell]",templateAttr:null},Ws=class extends Error{constructor(e,t,r){super(`hypercms: rule at "${e}" has an invalid CSS selector: "${t}"`),this.name="InvalidRuleSelector",this.path=e,this.selector=t,this.cause=r}};function ha(e,t){let r=[],i=[],l=[];return Xt(pe(e),e,t,[],r,i,l),{missing:Ei(r),twins:Zs(i),readOnly:Ei(l)}}function da(e){return Jt(e)}function Jt(e){if(typeof e=="string")return ua(e)?void 0:e;if(Array.isArray(e)){let[t,r]=e;return[t,Jt(r)]}if(e&&typeof e=="object"){let t={};for(let[r,i]of Object.entries(e)){let l=Jt(i);l!==void 0&&(t[r]=l)}return t}return e}function Xt(e,t,r,i,l,a,o){if(typeof r=="string"){let n=Gs(r),s=n?Ge(e,t,n,Ai,i):[];if(ua(r)){o.push(me(i));return}if(!n)return;if(r.endsWith("[]")){s.length===0&&Ge(e,t,n,_i,i).length===0&&l.push(me(i));return}s.length===0?l.push(me(i)):s.length>1&&a.push({path:me(i),count:s.length});return}if(Array.isArray(r)){let[n,s]=r;if(typeof n!="string"||!n)return;let h=Ge(e,t,n,Ai,i);if(h.length===0){Ge(e,t,n,_i,i).length===0&&l.push(me(i));return}for(let d of h)Xt(e,d,s,[...i,"*"],l,a,o);return}if(r&&typeof r=="object")for(let[n,s]of Object.entries(r))Xt(e,t,s,[...i,n],l,a,o)}function Ge(e,t,r,i,l){try{return e.find(t,r,i)}catch(a){throw new Ws(me(l),r,a)}}function Gs(e){if(e==="."||e.startsWith("@"))return null;if(e.endsWith("[]"))return e.slice(0,-2)||null;let t=P(e);return(t===-1?e:e.slice(0,t))||null}function Js(e){if(e.endsWith("[]"))return null;let t=P(e);return t===-1?null:e.slice(t+1)||null}function ua(e){let t=Js(e);return t!=null&&Ii.has(t)}function Sr(e){Xs(e),Ks(e)}function Xs(e){let t=e.noticeEl;if(!t)return;let r=e.unresolved&&e.unresolved.missing||[],i=e.unresolved&&e.unresolved.readOnly||[];if(r.length===0&&i.length===0){t.textContent="",t.hidden=!0;return}let l=[];if(r.length){let a=r.length===1?"1 field no longer matches this page":`${r.length} fields no longer match this page`;l.push(`${a}: ${r.join(", ")}`)}if(i.length){let a=i.length===1?"1 field reads a property the browser will not let anything write":`${i.length} fields read properties the browser will not let anything write`;l.push(`${a}: ${i.join(", ")}`)}t.textContent=l.join(`
227
+ `),t.hidden=!1}function Ks(e){let t=e.unresolved&&e.unresolved.twins||[],r=t.map(i=>`${i.path}:${i.count}`).join("|");if(r!==e.lastTwinSignature){e.lastTwinSignature=r;for(let{path:i,count:l}of t)console.warn(`${Vs} "${i}" matches ${l} elements; edits go to the first one.`)}}function Ei(e){return[...new Set(e)]}function Zs(e){let t=new Map;for(let r of e){let i=t.get(r.path);(!i||r.count>i.count)&&t.set(r.path,r)}return[...t.values()]}function me(e){return e.length?e.join("."):"(whole page)"}var Qs={skip:"[data-hcms-shell]",templateAttr:"cms-template"};function fe(e,{ignoreActiveValue:t}={}){return Ys(e,{ignoreActiveValue:t})}function Ys(e,{ignoreActiveValue:t}){let r=X.findRules(e.doc,e.rulesSource||"cms");r&&(e.pageRules=e.view.prepareRules(pl(r.rules,e.pageRoot)),e.rulesTagNode=r.tagNode),kl(e.doc),wl(e.doc,e.pageRules),e.formRules=El(e.pageRules,e.doc),e.writeRules=da(e.pageRules),e.unresolved=ha(e.pageRoot,e.pageRules);let i=ml(),l=ne(X.extract(e.pageRoot,e.pageRules,{...Qs,...i.hooks}),e.pageRules),a=br({pageRules:e.pageRules,formRules:e.formRules,data:l,doc:e.doc});cl(e.formRoot,a,{ignoreActiveValue:t}),xr(e,l),i.seed(e.formRoot),At(e.formRoot,e.doc,e.view?.enhanceFormRichText!==!1),oa(e),Sr(e),e.updateFingerprint&&e.updateFingerprint()}function ec({debounce:e=100,onRefresh:t}){let r=V("Mutation");if(!r||typeof r.onAnyChange!="function")throw new Error("hypercms: a mutation hub is required (clay.Mutation or hyperclay.Mutation). Load clayjs or hyperclayjs, or just the mutation utility, before initializing hypercms.");let i=r.onAnyChange({debounce:e},l=>{t(l)});return{unsubscribe:typeof i=="function"?i:()=>{}}}var tc='input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), select:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex="-1"])';function rc({doc:e,pageRoot:t,opts:r={}}){let i=r.richText!==!1,l=null;return{name:"sidebar",richText:i,enhanceFormRichText:!0,ctx:null,root:null,formRoot:null,errorEl:null,noticeEl:null,prepareRules(a){return i?hs(a,t):a},mount(a){let o=this.ctx;l=Ae(()=>Ps({mountTo:r.mountTo||e.body,side:r.side||"right",overlay:!!r.overlay,showSaveButton:!!r.showSaveButton,title:r.title,eyebrow:r.eyebrow,theme:r.theme,doc:e})),this.root=l.root,this.formRoot=l.formRoot,this.errorEl=l.errorEl,this.noticeEl=l.noticeEl;let n=br({pageRules:o.pageRules,formRules:o.formRules,data:a,doc:e});l.formRoot.appendChild(n),o.seeder.seed(l.formRoot),At(l.formRoot,e),Sr(o),Yl(o)},refresh(a){if(a==="livesync"){l?.restoreChrome?.(),fe(this.ctx,{ignoreActiveValue:!0});return}if(a==="undo"){fe(this.ctx,{ignoreActiveValue:!1});return}fe(this.ctx)},focusOnOpen(){let a=this.root&&this.root.querySelector(tc);a&&typeof a.focus=="function"&&a.focus()},destroy(){l?.destroy(),l=null}}}var ic="[cms-template], [data-hcms-shell]";function Qe(e){if(!e||typeof e.getBoundingClientRect!="function"||typeof e.closest=="function"&&e.closest(ic))return!1;let t=e.getBoundingClientRect();return t.width>=8&&t.height>=8}var lc={skip:"[data-hcms-shell]",templateAttr:"cms-template"},ac={skip:"[data-hcms-shell]",templateAttr:null},oc="text",nc="native",Si="handle",sc=new Set(["INPUT","TEXTAREA","SELECT"]),ma=new Set(["IMG","INPUT","TEXTAREA","SELECT","OPTION","BR","HR","VIDEO","AUDIO","IFRAME","EMBED","OBJECT","CANVAS","SOURCE","TRACK","AREA","COL","PARAM","BUTTON","STYLE","SCRIPT","LINK","META"]);function pa(e,t,r=null){let i=[],l=[],a=pe(e);return Kt(a,e,t,[],i,l,r?(o,n)=>sr(o,r,n,t):()=>null),{targets:i,lists:l}}function Kt(e,t,r,i,l,a,o){if(typeof r=="string"){if(r.endsWith("[]")){let f=r.slice(0,-2);if(!f)return;let m=Ye(e,t,f);m.forEach((u,c)=>{l.push(Ti([...i,c],u,r,null))}),a.push(Ci(e,t,i,f,m,!0));return}let n=P(r),s=n===-1?null:r.slice(n+1),h=n===-1?r:r.slice(0,n),d=!h||h==="."?t:Ye(e,t,h)[0];d&&l.push(Ti(i,d,r,s,o(r,i)));return}if(Array.isArray(r)){let[n,s]=r;if(typeof n!="string"||!n)return;let h=Ye(e,t,n);h.forEach((d,f)=>Kt(e,d,s,[...i,f],l,a,o)),a.push(Ci(e,t,i,n,h,typeof s=="string"));return}if(r&&typeof r=="object")for(let[n,s]of Object.entries(r))Kt(e,t,s,[...i,n],l,a,o)}function Ci(e,t,r,i,l,a){let o=l[0]?l[0].parentElement:null;if(!o){let n=Ye(e,t,i,ac)[0];o=n?n.parentElement:null}return{path:r,items:l,container:o,scalar:a}}function Ti(e,t,r,i,l=null){return{path:e,el:t,rule:r,attr:i,kind:cc(t,i),icon:dc(t,i),style:l}}function cc(e,t){let r=(e.tagName||"").toUpperCase();return!t||t==="innerHTML"?ma.has(r)?Si:oc:t==="value"&&sc.has(r)&&!e.readOnly&&!hc(e)?nc:Si}function hc(e){return e.disabled?!0:typeof e.matches=="function"&&e.matches(":disabled")}function dc(e,t){let r=(e.tagName||"").toUpperCase();return(!t||t==="innerHTML")&&!ma.has(r)?null:r==="IMG"||t==="srcset"?"camera":r==="A"&&t==="href"?"paperclip":"pencil"}function Ye(e,t,r,i=lc){try{return e.find(t,r,i)}catch{return[]}}function uc(e,t){let r=[],i=new Map,l=null;for(let a of e){if(!a.style)continue;let o=a.path.join(".");if(a.style==="page"){l||(l={scope:"page",el:a.el,list:null,paths:[]},r.push(l)),l.paths.push(o);continue}let n=mc(a.path,t),s=n?n.row:a.el,h=i.get(s);h||(h={scope:n?"row":"section",el:s,list:n?n.list:null,paths:[]},i.set(s,h),r.push(h)),h.paths.push(o)}return r}function mc(e,t){for(let r=e.length-1;r>=0;r--){if(typeof e[r]!="number")continue;let i=e.slice(0,r).join("."),l=t.find(o=>o.path.join(".")===i),a=l&&l.items[e[r]];if(a)return{list:l,row:a}}return null}var Cr=Object.freeze({data:Object.freeze({tokens:["no-data"],bundles:["editor-ui"]}),save:Object.freeze({tokens:["no-save"],bundles:["editor-ui"]}),snapshot:Object.freeze({tokens:["no-snapshot"],bundles:["editor-ui"]}),watch:Object.freeze({tokens:["no-watch"],bundles:["editor-ui"]}),undo:Object.freeze({tokens:["no-undo"],bundles:["editor-ui"]}),history:Object.freeze({tokens:[],bundles:["editor-ui"]})}),pc=Object.freeze({"editor-ui":Object.freeze(["no-data","no-save","no-snapshot","no-watch","no-undo"])}),Th=Object.freeze(["no-save","no-snapshot","no-trigger-autosave","no-dirty","no-watch","no-undo","no-data","freeze","editor-ui","live"]);function st(e,t){if(!e||e.nodeType!==1)return!1;let r=e.getAttribute?.("clay");return!!(r&&r.split(/\s+/).includes(t)||e.hasAttribute?.(t))}function fa(e,t){if(st(e,t))return!0;for(let[r,i]of Object.entries(pc))if(i.includes(t)&&st(e,r))return!0;return!1}function Zt(e){let t=Cr[e];if(!t)throw new Error(`Unknown region capability: ${e}`);return[...t.tokens,...t.bundles].flatMap(r=>[`[clay~="${r}"]`,`[${r}]`]).join(", ")}function fc(e,t){let r=e&&e.nodeType===1?e:e?.parentElement;for(;r&&r.nodeType===1;){let i=Cr[t];if(!i)throw new Error(`Unknown region capability: ${t}`);if(i.tokens.some(l=>fa(r,l))||i.bundles.some(l=>st(r,l)))return r;r=r.parentElement}return null}function gc(e,t){return!!fc(e,t)}var bc=/:(?:focus(?:-within|-visible)?|hover|active|visited|defined)\b/i;function kc(e,t){if(!/^(INPUT|TEXTAREA|SELECT|OPTION)$/.test(e.tagName||""))return;let r=(e.getAttribute?.("type")||"").toLowerCase();"value"in e&&"value"in t&&e.tagName!=="OPTION"&&r!=="checkbox"&&r!=="radio"&&r!=="file"&&(t.value=e.value),e.tagName==="INPUT"&&(r==="checkbox"||r==="radio")&&(t.checked=e.checked),e.tagName==="OPTION"&&(t.selected=e.selected),"indeterminate"in e&&"indeterminate"in t&&(t.indeterminate=e.indeterminate)}function Ri(e,t,r,i){if(i)return!!e.closest?.(t);let l=e;for(;l?.nodeType===1;){if(l.matches(t))return!0;if(l===r)break;l=l.parentElement}return!1}function qi(e,t,r,i,l,a){return(a?gc(e,t):Ri(e,r,l,!1))||!!(i&&(a&&e!==l?e.matches(i):Ri(e,i,l,a)))}function vc(e,t){let r=Cr[t];return r.tokens.some(i=>fa(e,i))||r.bundles.some(i=>st(e,i))}var yc=new Set(["INPUT","TEXTAREA","SELECT","OPTION"]);function ga(e,t,r,i){if(e.nodeType===1&&i(e)){r.dropped.push(t);return}r.cloneToLive.set(t,e),r.liveToClone.set(e,t);let l=e,a=t;if(e.nodeType===1){if(yc.has(e.tagName)&&r.controls.push(e,t),e.tagName==="TEMPLATE"){for(;t.firstChild;)t.removeChild(t.firstChild);l=e.content,a=t.content,r.cloneToLive.set(a,l),r.liveToClone.set(l,a)}}else if(e.nodeType!==11)return;let o=a.firstChild;for(let n=l.firstChild;n&&o;n=n.nextSibling)ga(n,o,r,i),o=o.nextSibling}function ba(e,{capability:t="data",exclude:r=null,inherit:i=!0,provenance:l=null}={}){if(!e)throw new TypeError("createContentView requires a DOM context");let a=e.nodeType===9?e:e.ownerDocument;if(!a?.implementation?.createHTMLDocument)throw new TypeError("createContentView requires an HTML DOM implementation");let o=a.implementation.createHTMLDocument(""),n=l||new WeakMap,s=new WeakMap,h=e.nodeType===9?e.documentElement:e;r&&o.documentElement.matches(r);let d=Zt(t),f=i?c=>vc(c,t)||!!(r&&c.matches(r)):c=>qi(c,t,d,r,h,!1),m=null;if(h.nodeType!==1||!qi(h,t,d,r,h,i)){m=o.importNode(h,!0);let c={cloneToLive:n,liveToClone:s,dropped:[],controls:[]};ga(h,m,c,f);for(let p of c.dropped)p.remove();for(let p=0;p<c.controls.length;p+=2)kc(c.controls[p],c.controls[p+1])}e.nodeType===9&&m&&(o.replaceChild(m,o.documentElement),s.set(e,o),n.set(o,e));let u=c=>{if(bc.test(c))throw new Error(`Filtered content queries do not support stateful selector: ${c}`)};return{root:m,document:o,capability:t,selector:Zt(t),cloneToLive:n,liveToClone:s,original(c){return n.get(c)||null},cloneOf(c){return s.get(c)||null},query(c,p=m){return u(c),Array.from(p.querySelectorAll(c),b=>n.get(b)||b)},text(c=m){return(c===m?m:s.get(c))?.textContent||""},html(c=m){return(c===m?m:s.get(c))?.innerHTML??""},clone(c=m){let p=c===m?m:s.get(c);return p?o.importNode(p,!0):null}}}var xc=[16,8,0],D=8,wc=4;function Ac({anchor:e,bar:t,rail:r=t,viewport:i,current:l=null}){let a=m=>l===m?wc:0;if(e.bottom<=0||e.top>=i.height||e.right<=0||e.left>=i.width)return{mode:"hidden",x:0,y:0};let o=m=>Math.max(D,Math.min(e.left,i.width-m-D)),n=e.top-16-t.height;if(n>=D-a("above"))return{mode:"above",x:o(t.width),y:n};let s=e.bottom+16;if(s+t.height<=i.height-D+a("below"))return{mode:"below",x:o(t.width),y:s};let h=i.width-e.right-D,d=e.left-D,f=h>=d?[["rail-right",h],["rail-left",d]]:[["rail-left",d],["rail-right",h]];for(let[m,u]of f)for(let c of xc){if(r.width+c>u+a(m))continue;let p=m==="rail-right"?Math.min(e.right+c,i.width-r.width-D):Math.max(e.left-c-r.width,D),b=Math.min(e.bottom,i.height-D)-r.height,g=Math.max(D,Math.min(Math.max(e.top,D),b));return{mode:m,x:p,y:g,gap:c}}return{mode:"pinned",x:o(t.width),y:D}}function Oi({anchor:e,handle:t,viewport:r,inset:i=6,prefer:l="auto"}){let a=e.height>=t.height*1.5&&e.width>=t.width*2;if(l==="corner"||a){let m=Math.max(D,Math.min(e.right-t.width+i,r.width-t.width-D)),u=Math.max(D,Math.min(e.top-i,r.height-t.height-D));return{x:m,y:u,mode:"over"}}let o=4,n=e.right+o+t.width<=r.width-D,s=n?e.right+o:e.left-o-t.width,h=Math.max(D,s),d=e.top+e.height/2-t.height/2,f=Math.max(D,Math.min(d,r.height-t.height-D));return{x:h,y:f,mode:n?"beside-right":"beside-left"}}var ct=!1;function ka(){if(ct)return;let e=V("onPrepareForSave");typeof e=="function"&&(e(t=>{ya(t),va(t)}),ct=!0)}function va(e){let t=e&&e.querySelector&&e.querySelector("body");t&&t.classList.remove("hcms-open","hcms-overlay","hcms-side-left",Er)}function ya(e){if(!(!e||typeof e.querySelectorAll!="function"))for(let t of e.querySelectorAll(`[${ke}]`)){let r=os(t);r!==null&&(t.innerHTML=r),t.removeAttribute(ke)}}var ht=!1;function Tr(){if(ht)return;let e=V("onSnapshot");typeof e=="function"&&(e(t=>{ya(t),ss(t,typeof window<"u"?window:null),va(t)}),ht=!0)}function _c(){ka(),Tr(),(!ct||!ht)&&Ec()}var Je=null;function Ec(){Je||typeof document>"u"||(Je=vr(document,is,()=>{ka(),Tr(),ct&&ht&&(Je?.(),Je=null)}))}var Sc={edit:"M8 10h2v6H8zm2 4h4v2h-4zm0-6h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2-2h2v2h-2zm2 2h2v2h-2zm2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-2 2h2v2h-2zm-4 0h2v2h-2z","move-up":"M11 4h2v2h2v2h2v2h2v2h-4v-2h-2v10h-2V10H9v2H5v-2h2V8h2V6h2z","move-down":"M11 4h2v10h2v-2h4v2h-2v2h-2v2h-2v2h-2v-2H9v-2H7v-2H5v-2h4v2h2z",remove:"M5 5h3v3h3v3h2V8h3V5h3v3h-3v3h-3v2h3v3h3v3h-3v-3h-3v-3h-2v3H8v3H5v-3h3v-3h3v-2H8V8H5z",add:"M10 4h4v6h6v4h-6v6h-4v-6H4v-4h6z"};function dt(e){let t=e==="edit"?"6 0 18 18":"0 0 24 24",r=e==="settings"?'<circle cx="6" cy="12" r="1.5"/><circle cx="12" cy="12" r="1.5"/><circle cx="18" cy="12" r="1.5"/>':`<path d="${Sc[e]}"/>`;return`<svg class="hcms-inline-icon" xmlns="http://www.w3.org/2000/svg" viewBox="${t}" width="24" height="24" fill="currentColor" aria-hidden="true" focusable="false">${r}</svg>`}var Li="data-hcms-ghost",Cc=Zt("history");function Tc(e){let t=e.container,r=null;for(;t&&(t.namespaceURI!=="http://www.w3.org/1999/xhtml"||["SELECT","OPTGROUP","DATALIST"].includes(t.tagName));)r=t,t=t.parentElement;return{parent:t,anchor:r}}function Rc({doc:e,themeRoot:t,onAdd:r,onResize:i}){let l=e.defaultView,a=[],o=!1,n=null,s=new Map;function h(u,c,p){u.style[c]!==p&&(u.style[c]=p)}function d(){let u=new Set(a.map(c=>c.node.parentElement));for(let[c,p]of s)u.has(c)&&l?.Sortable?.get(c)===p.instance||(p.instance.option("draggable")===p.selector&&p.instance.option("draggable",p.original),s.delete(c));for(let c of u){let p=l?.Sortable?.get(c);if(!p)continue;let b=p.option("draggable");if(s.get(c)?.selector===b)continue;let g=b,k=`${g.trim().startsWith(">")?"> ":""}:is(${g.trim().replace(/^>\s*/,"")}):not(${Cc})`;p.option("draggable",k),s.set(c,{instance:p,original:g,selector:k})}}function f(){for(let u of a){let{node:c,slot:p,list:b}=u,g=b.items.filter(k=>k.isConnected).map(k=>k.getBoundingClientRect()).filter(k=>k.width>0&&k.height>0);g.length&&(u.width=g.reduce((k,y)=>k+y.width,0)/g.length,u.height=g.reduce((k,y)=>k+y.height,0)/g.length),h(c,"width",u.width?`${Math.round(u.width)}px`:"100%"),h(p,"height",`${Math.max(48,Math.round(u.height||64))}px`),p!==c&&(p.colSpan=Math.max(1,...b.items.map(k=>[...k.children].reduce((y,_)=>y+(_.colSpan||1),0)))),c.hidden!==o&&(c.hidden=o)}d()}function m(u,c){let p=c.tagName,b=["TBODY","THEAD","TFOOT","TABLE"].includes(p),g=e.createElement(b?"tr":["UL","OL","MENU"].includes(p)?"li":"div");for(let A of[Li,"data-hcms-shell","editor-ui","no-watch","no-save","save-remove","snapshot-remove"])g.setAttribute(A,"");g.setAttribute("draggable","false"),g.setAttribute("contenteditable","false"),g.className="hcms-shell pixel-quiet hcms-inline-ghost";for(let A of["light","dark"])g.classList.toggle(A,!!t?.classList.contains(A));let k=b?e.createElement("td"):g;k!==g&&(k.className="hcms-inline-ghost-cell",g.appendChild(k));let y=e.createElement("button");y.type="button",y.className="hcms-inline-list-button hcms-inline-list-add mirk-button mirk-button--small",y.setAttribute("data-hcms-list-action","add"),y.innerHTML=`<span class="mirk-button__label">${dt("add")}<span>Add</span></span>`,k.appendChild(y);let _={node:g,slot:k,button:y,list:u,width:0,height:0};y.addEventListener("click",A=>{A.preventDefault(),A.stopPropagation(),r(_.list)});for(let A of["pointerdown","mousedown","touchstart","click"])g.addEventListener(A,E=>E.stopPropagation());return g.addEventListener("dragstart",A=>{A.preventDefault(),A.stopPropagation()}),_}return{setLists(u){let c=new Set(a),p=[],b=new Set(a.map(k=>k.node)),g=new Set;for(let k of u||[]){if(!k.container||!k.container.isConnected)continue;let{parent:y,anchor:_}=Tc(k);if(!y)continue;if(!g.has(y)){for(let O of y.querySelectorAll(`:scope > [${Li}]`))b.has(O)||O.remove();g.add(y)}let A=a.find(O=>c.has(O)&&O.list.container===k.container&&O.list.path.join(".")===k.path.join("."))||m(k,y);c.delete(A),A.list=k,A.button.setAttribute("data-hcms-list",k.path.join(".")),A.button.setAttribute("aria-label",`Add to ${k.path.join(".")||"the list"}`);let E=_||k.items.filter(O=>O.parentElement===y).at(-1);E?E.nextSibling!==A.node&&E.after(A.node):A.node.parentElement!==y&&y.appendChild(A.node),p.push(A)}for(let k of c)k.node.remove();a=p,n?.disconnect(),!n&&typeof l?.ResizeObserver=="function"&&(n=new l.ResizeObserver(()=>{f(),i?.()}));for(let k of a)for(let y of k.list.items)n?.observe(y);f()},update:f,setHidden(u){o=!!u,f()},destroy(){n?.disconnect();for(let u of a)u.node.remove();a=[],d()}}}var $i=[["move-up","Move up"],["move-down","Move down"]],qc={prefer:"corner",inset:0};function Oc(e,t){return t.width<=e.width&&t.height<=e.height}function Lc({doc:e,layerEl:t,onActivate:r,onListAction:i,onStyle:l}){let a=e.defaultView,o=[],n=new Map,s=0,h=new Map,d=null,f=new Set,m=0,u=!1,c=null,p=null,b=null,g=null,k=new Map,y=!1,_=null,A=Rc({doc:e,themeRoot:t.closest("[data-hcms-shell]"),onResize:O,onAdd:v=>i?.({action:"add",list:v,index:v.items.length})}),E=e.createElement("div");E.className="hcms-inline-highlight",E.hidden=!0,E.setAttribute("aria-hidden","true"),t.appendChild(E);function O(){if(!(m||!a)){if(typeof a.requestAnimationFrame!="function")return ce();m=a.requestAnimationFrame(()=>{m=0,ce()})}}let H=()=>b||g;function ce(){if(!a)return;A.update();let v={width:a.innerWidth,height:a.innerHeight},x=H();for(let w of o){if(!w.visible){w.node.hidden=!0;continue}for(let T of w.members)T.node.hidden=y&&T.kind!=="handle";w.node.hidden=!1;let C=w.el.getBoundingClientRect(),S=w.node.getBoundingClientRect(),R=S.width,L=w.kind==="row"&&!Oc(C,S);if(L&&w.el!==x){for(let T of w.members)T.kind==="row"&&(T.node.hidden=!0);S=w.node.getBoundingClientRect()}if(w.members.every(T=>T.node.hidden)){w.node.hidden=!0;continue}if(w.kind==="style"){let T=Math.max(8,Math.min(C.left,v.width-S.width-8)),M=Math.max(8,Math.min(C.top,v.height-S.height-8));w.node.style.transform=`translate(${Math.round(T)}px, ${Math.round(M)}px)`;continue}let I=w.kind==="handle"?null:qc,{x:$,y:K}=Oi({anchor:C,handle:S,viewport:v,...I}),he=w.members.find(T=>T.kind==="handle");if(L&&he){let T=he.node.getBoundingClientRect(),M=Oi({anchor:C,handle:T,viewport:v}),j=w.members.slice(w.members.indexOf(he)+1).filter(St=>!St.node.hidden).reduce((St,Ua)=>St+Ua.node.getBoundingClientRect().width+2,0);$=Math.max(8+R,Math.min(v.width-8,M.x+T.width+j))-S.width,K=M.y}w.node.style.transform=`translate(${Math.round($)}px, ${Math.round(K)}px)`}if(_)if(!_.node.isConnected||_.node.closest("[hidden]"))W();else{let w=_.button.getBoundingClientRect(),C=_.menu.getBoundingClientRect();_.menu.style.left=`${Math.max(8,w.right-C.width)-w.left}px`,_.menu.style.right="auto",_.menu.style.top=w.bottom+6+C.height>v.height-8?"auto":"calc(100% + 6px)",_.menu.style.bottom=w.bottom+6+C.height>v.height-8?"calc(100% + 6px)":"auto"}Ce(),c?.()}function U(v){if(v?.closest?.("[data-hcms-ghost]"))return null;for(let x=v;x&&x.nodeType===1;x=x.parentElement){let w=k.get(x);if(w)return w}return null}function le(v){_&&!_.node.contains(v.target)&&W();let x=H();g=U(v.target),g&&t.contains(v.target)&&(b=null),H()!==x&&O()}function Se(v){if(v.relatedTarget||!g)return;let x=H();g=null,H()!==x&&O()}function Ce(){if(!p||E.hidden)return;let v=p.getBoundingClientRect();E.style.width=`${Math.round(v.width)}px`,E.style.height=`${Math.round(v.height)}px`,E.style.transform=`translate(${Math.round(v.left)}px, ${Math.round(v.top)}px)`}function Oa(){if(!a||typeof a.IntersectionObserver!="function"){for(let x of o)x.visible=!0;return}d||(d=new a.IntersectionObserver(x=>{let w=!1;for(let C of x)for(let S of n.get(C.target)||[])S.visible!==C.isIntersecting&&(S.visible=C.isIntersecting,w=!0);w&&O()},{threshold:0}));let v=new Set(n.keys());for(let x of f)v.has(x)||d.unobserve(x);for(let x of v)f.has(x)||d.observe(x);f=v}function La(){u||!a||(a.addEventListener("scroll",O,{passive:!0,capture:!0}),a.addEventListener("resize",O,{passive:!0}),e.addEventListener("focusin",le),e.addEventListener("focusout",Se),e.addEventListener("pointerdown",Br,!0),e.addEventListener("keydown",Ir,!0),u=!0)}function $a(){!u||!a||(a.removeEventListener("scroll",O,{capture:!0}),a.removeEventListener("resize",O),e.removeEventListener("focusin",le),e.removeEventListener("focusout",Se),e.removeEventListener("pointerdown",Br,!0),e.removeEventListener("keydown",Ir,!0),u=!1)}function Mr(v){return`${v.kind}\0${v.attr||""}`}function Nr(v,x){return v.container===x.container&&v.scalar===x.scalar}function ja(v,x){return v.kind!==x.kind?!1:v.kind==="style"?!0:v.kind==="handle"?Mr(v.target)===Mr(x.target):v.kind==="row"?v.row===x.row&&Nr(v.list,x.list):Nr(v.list,x.list)}function zr(v,x){v.target=x;let w=x.path.join(".");v.node.setAttribute("data-hcms-target",w),x.icon?v.node.setAttribute("data-hcms-icon",x.icon):v.node.removeAttribute("data-hcms-icon"),v.node.setAttribute("aria-label",`Edit ${w}`)}function Ma(v){let x=e.createElement("button");x.type="button",x.className="hcms-inline-handle mirk-button mirk-button--small",x.innerHTML=`<span class="mirk-button__label">${dt("edit")}</span>`;let w={node:x,kind:"handle",target:v};return zr(w,v),x.addEventListener("click",C=>{C.preventDefault(),C.stopPropagation(),r?.(w.target,x)}),w}function Na(v){let x=e.createElement("button");x.type="button",x.className="hcms-inline-style-chip mirk-button mirk-button--small",x.setAttribute("aria-label","Edit style"),x.innerHTML='<span class="mirk-button__label">Style</span>';let w={node:x,kind:"style",group:v.group};return x.addEventListener("click",C=>{C.preventDefault(),C.stopPropagation(),l?.(w.group,x)}),w}function Fr(v,x){let w=e.createElement("button");return w.type="button",w.className="hcms-inline-list-button mirk-button mirk-button--small",w.setAttribute("data-hcms-list-action",v),w.setAttribute("aria-label",x),w.innerHTML=`<span class="mirk-button__label">${dt(v)}${v==="add"?"<span>Add</span>":""}</span>`,w}function Dr(v,{list:x,row:w,rowIndex:C,count:S}){let R=x.path.join(".");v.list=x,v.row=w,v.index=C,v.count=S,v.node.setAttribute("data-hcms-list",R),v.node.setAttribute("data-hcms-row",String(C));for(let L of v.node.querySelectorAll("[data-hcms-list-action]")){let I=L.getAttribute("data-hcms-list-action"),$=$i.find(([K])=>K===I)?.[1]||I;L.setAttribute("aria-label",`${$} ${R}.${C}`),L.disabled=I==="move-up"&&C===0||I==="move-down"&&C===S-1}}function za(v,x,w,C){let S=e.createElement("div");S.className="hcms-inline-row-controls";let R={node:S,kind:"row",list:v,row:x,index:w,count:C};for(let[L,I]of $i){let $=Fr(L,I);$.addEventListener("click",K=>{K.preventDefault(),K.stopPropagation(),!$.disabled&&i?.({action:L,list:R.list,index:R.index,row:R.row})}),S.appendChild($)}return Dr(R,{list:v,row:x,rowIndex:w,count:C}),R}function W(v=!1){if(!_)return;let x=_;_=null,x.menu.hidden=!0,x.button.setAttribute("aria-expanded","false"),x.node.parentElement?.classList.remove("has-open-settings"),v&&x.button.isConnected&&x.button.focus({preventScroll:!0})}function Br(v){_&&!_.node.contains(v.target)&&W()}function Ir(v){if(_){if(v.key==="Escape")v.preventDefault(),v.stopPropagation(),W(!0);else if(v.key==="Tab")W(!0);else if(["ArrowDown","ArrowUp","Home","End"].includes(v.key)&&_.menu.contains(v.target)){v.preventDefault();let x=[..._.menu.querySelectorAll('[role="menuitem"]')],w=x.indexOf(v.target),C=v.key==="Home"?0:v.key==="End"?x.length-1:w===-1?0:(w+(v.key==="ArrowDown"?1:-1)+x.length)%x.length;x[C]?.focus({preventScroll:!0})}}}function Pr(v,{list:x,row:w,rowIndex:C,style:S=null}){Object.assign(v,{list:x,row:w,index:C,style:S}),v.node.setAttribute("data-hcms-list",x.path.join(".")),v.node.setAttribute("data-hcms-row",String(C)),v.button.setAttribute("aria-label",`Settings ${x.path.join(".")}.${C}`),S&&!v.styleItem.isConnected?v.menu.insertBefore(v.styleItem,v.menu.firstChild):S||v.styleItem.remove()}function Fa(v){let x=e.createElement("div");x.className="hcms-inline-settings";let w=Fr("settings","Settings");w.setAttribute("aria-haspopup","menu"),w.setAttribute("aria-expanded","false");let C=e.createElement("div");C.className="hcms-inline-settings-menu",C.setAttribute("role","menu"),C.setAttribute("aria-label","Item settings"),C.hidden=!0;let S=e.createElement("button");S.type="button",S.setAttribute("role","menuitem"),S.setAttribute("data-hcms-style-action",""),S.textContent="Style";let R=e.createElement("button");R.type="button",R.setAttribute("role","menuitem"),R.setAttribute("data-hcms-list-action","remove"),R.textContent="Delete",C.appendChild(R),x.append(w,C);let L={node:x,button:w,menu:C,styleItem:S,kind:"settings"};Pr(L,v);let I=()=>{W(),_=L,C.hidden=!1,w.setAttribute("aria-expanded","true"),x.parentElement.classList.add("has-open-settings"),C.querySelector('[role="menuitem"]').focus({preventScroll:!0}),O()};return w.addEventListener("click",$=>{$.preventDefault(),$.stopPropagation(),_===L?W(!0):I()}),w.addEventListener("keydown",$=>{($.key==="ArrowDown"||$.key==="ArrowUp")&&($.preventDefault(),I())}),R.addEventListener("click",$=>{$.preventDefault(),$.stopPropagation(),W(!0),i?.({action:"remove",list:L.list,index:L.index,row:L.row})}),S.addEventListener("click",$=>{$.preventDefault(),$.stopPropagation(),W(),l?.(L.style,L.button)}),L}function Da(v,x){v.kind==="handle"?zr(v,x.target):v.kind==="row"?Dr(v,x):v.kind==="settings"?Pr(v,x):v.kind==="style"&&(v.group=x.group)}function He(v,x,w,C,S){let R=x.get(w)?.find(L=>L.category===S);if(!R){R={el:w,category:S,members:[]},v.push(R);let L=x.get(w);L?L.push(R):x.set(w,[R])}R.members.push(C)}function Ba(v,x,w,C){let S=w.items||[];S.forEach((R,L)=>{Qe(R)&&(He(v,x,R,{kind:"row",list:w,row:R,rowIndex:L,count:S.length},"item"),He(v,x,R,{kind:"settings",list:w,row:R,rowIndex:L,style:C.get(R)||null},"item"))})}function Ia(v,x){let w=new Set(v.members),C=[];for(let S of x){let R=v.members.find(L=>w.has(L)&&ja(L,S))||(S.kind==="handle"?Ma(S.target):S.kind==="row"?za(S.list,S.row,S.rowIndex,S.count):S.kind==="style"?Na(S):Fa(S));w.delete(R),Da(R,S),y&&R.kind!=="handle"&&(R.node.hidden=!0),C.push(R)}for(let S of w)S===_&&W(),S.node.remove();C.sort((S,R)=>["row","handle","settings"].indexOf(S.kind)-["row","handle","settings"].indexOf(R.kind)),C.forEach((S,R)=>{v.node.children[R]!==S.node&&v.node.insertBefore(S.node,v.node.children[R]||null)}),v.members=C}function Pa(v,x,w){let C=[],S=new Map,R=new Map,L=0;for(let T of v||[])T.style||(R.has(T.el)||R.set(T.el,T),!(T.kind!=="handle"||!Qe(T.el))&&(He(C,S,T.el,{kind:"handle",target:T},"item"),L++));let I=new Map;for(let T of w||[])T.scope==="row"?I.set(T.el,T):T.scope==="section"&&Qe(T.el)&&He(C,S,T.el,{kind:"style",group:T},"style");for(let T of x||[])Ba(C,S,T,I);let $=new Set(o),K=new Map;for(let T of o)K.has(T.el)||K.set(T.el,T.visible);let he=[];for(let T of C){let M=o.find(j=>$.has(j)&&j.el===T.el&&j.category===T.category);if(!M){let j=e.createElement("div");j.className="hcms-inline-item-controls",j.setAttribute("role","group"),M={el:T.el,node:j,category:T.category,kind:T.category==="add"?"add":"handle",members:[],visible:K.get(T.el)??!1},t.appendChild(j)}$.delete(M),M.el=T.el,M.category=T.category,Ia(M,T.members),M.kind=M.members.some(j=>j.kind==="row")?"row":M.members.some(j=>j.kind==="handle")?"handle":M.members.some(j=>j.kind==="style")?"style":"add",M.node.setAttribute("aria-label",M.category==="add"?"List controls":M.category==="style"?"Style controls":"Item controls"),he.push(M)}for(let T of $)T.node.remove();o=he,n=new Map,k=new Map;for(let T of o){let M=n.get(T.el);M?M.push(T):n.set(T.el,[T]);for(let j of T.members)j.kind!=="row"&&j.kind!=="settings"||(k.set(j.row,j.row),k.set(j.node,j.row),k.set(T.node,j.row))}b&&!k.has(b)&&(b=null),g&&!k.has(g)&&(g=null),h=R,s=L}function Ha(){W(),d?.disconnect(),d=null,f=new Set;for(let v of o)v.node.remove();o=[],n=new Map,h=new Map,k=new Map,s=0}return{setTargets(v,x,w=[]){Pa(v,x,w),A.setLists(x),Oa(),La(),O()},refresh:O,get count(){return s},get controlsHidden(){return y},setControlsHidden(v){if(y=!!v,A.setHidden(y),y){W();for(let x of o){for(let w of x.members)w.kind!=="handle"&&(w.node.hidden=!0);x.members.every(w=>w.node.hidden)&&(x.node.hidden=!0)}}O()},elementToTarget(v){if(v?.closest?.("[data-hcms-ghost]"))return null;for(let x=v;x&&x.nodeType===1;x=x.parentElement){let w=h.get(x);if(w)return w}return null},setHoveredRow(v){let x=H();b=v?U(v):null,H()!==x&&O()},showHighlight(v){v&&(p=v,E.hidden=!1,Ce())},hideHighlight(){p=null,E.hidden=!0},setFollower(v){c=typeof v=="function"?v:null},destroy(){A.destroy(),m&&a&&a.cancelAnimationFrame(m),m=0,c=null,p=null,b=null,g=null,E.remove(),$a(),Ha()}}}var $c="hypercms-inline",ge="is-hcms-inline-active",Qt="is-hcms-inline-onpath",ji='input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), select:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex="-1"])',jc=["bold","italic","link","undo","redo"],Mc=/^H[1-6]$/,Nc=0;function zc({doc:e,pageRoot:t,opts:r={}}){let i=r.richText!==!1,l=null,a=null,o=null,n=new Map,s=null,h=null,d=[],f=null;function m(u,c,p,b,g){let k=wt(e.defaultView);if(typeof k!="function")return null;let y=g||{},_=y.originalHTML??ba(c,{capability:"history"}).html(),A=y.richClayIsOurs??!c.hasAttribute("data-richclay"),E=y.adopted??c.getAttribute("data-richclay-active")==="true",O=Ne(c,b,"history"),H=Fc(u,k,c,b,A);if(!H)return null;ns(c,b==="innerHTML",A);let ce=String(++Nc);c.setAttribute(ke,ce),Tr();let U={el:c,editor:H,path:p,prop:b,boundId:ce,originalHTML:_,oldValue:O,richClayIsOurs:A,adopted:E,dirty:!1,written:!1,restorable(){return!this.adopted&&!this.dirty&&!this.written},lastEdited:void 0};n.set(c,U),ls(ce,U);let le=H.squire;if(le&&typeof le.addEventListener=="function"){let Ce=()=>{U.dirty=!0,U.lastEdited=Ne(c,U.prop,"history"),Dc(u,U)};le.addEventListener("input",Ce),U.detachInput=()=>le.removeEventListener?.("input",Ce)}let Se=()=>xa(U);return c.addEventListener("blur",Se),U.detachBlur=()=>c.removeEventListener("blur",Se),U}return{name:"inline",richText:i,ctx:null,root:null,formRoot:null,errorEl:null,noticeEl:null,handoffEl:null,handoffCountEl:null,popEl:null,enhanceFormRichText:!1,prepareRules(u){return i?ds(u,t):u},bindText(u,c,p,b){return m(this.ctx,u,c,p,b)},mount(u){let c=this.ctx;l=Hc(e,r.theme),this.root=l.root,this.formRoot=l.formRoot,this.errorEl=l.errorEl,this.noticeEl=l.noticeEl,this.handoffEl=l.handoffEl,this.handoffCountEl=l.handoffCountEl,this.popEl=l.popEl,Ae(()=>nt(e));let p=br({pageRules:c.pageRules,formRules:c.formRules,data:u,doc:e});l.formRoot.appendChild(p),c.seeder.seed(l.formRoot),At(l.formRoot,e,this.enhanceFormRichText),Sr(c),Yl(c),a=Lc({doc:e,layerEl:l.layerEl,onActivate:(b,g)=>this.activate(b,g),onListAction:b=>this.listAction(b),onStyle:(b,g)=>this.openStyle(b,g)}),a.setFollower(()=>this.placePopover()),l.closeEl.addEventListener("click",()=>this.deactivate()),l.toggleEl.addEventListener("click",b=>{b.preventDefault(),b.stopPropagation(),this.toggleControls()}),l.pageStyleEl.addEventListener("click",b=>{b.preventDefault(),b.stopPropagation();let g=d.find(k=>k.scope==="page");g&&this.openStyle(g,l.pageStyleEl)}),l.handoffEl.querySelector("[data-hcms-open-view]").addEventListener("click",b=>{b.preventDefault(),b.stopPropagation(),c.onViewRequested?.("sidebar")}),this.bindPage(),this.syncTargets()},listAction({action:u,list:c,index:p,row:b}){let g=this.ctx,k=c.path.join("."),y=g.formRoot.querySelector(`[data-hcms-path="${_e(k)}"]`);if(!y)return;if(u==="add"){wr(k,g);return}let _=b?Vc(g,k,b):p;if(_===-1)return;let A=Uc(y,_);if(A){if(u==="remove"){ia(A,g),this.syncTargets();return}ra(A,u==="move-up"?-1:1,g),this.syncTargets()}},toggleControls(){if(!a||!l)return;let u=!a.controlsHidden;a.setControlsHidden(u),l.toggleEl.setAttribute("aria-pressed",String(u));let c=l.toggleEl.querySelector(".mirk-button__label");c&&(c.textContent=u?"Show controls":"Hide controls")},bindPage(){let u=oe(this.ctx.pageRoot),c=l.root,p=A=>{let E=a&&a.elementToTarget(A.target);E?a.showHighlight(E.el):a?.hideHighlight(),a?.setHoveredRow(A.target)},b=()=>{a?.hideHighlight(),a?.setHoveredRow(null)},g=A=>{if(c.contains(A.target))return;let E=a&&a.elementToTarget(A.target);!E||E.kind!=="text"||n.has(E.el)||m(this.ctx,E.el,E.path.join("."),ut(E))},k=A=>{if(c.contains(A.target))return;let E=a&&a.elementToTarget(A.target);if(!E){this.deactivate();return}(typeof A.target.closest=="function"&&A.target.closest("a[href]")||E.kind!=="text")&&A.preventDefault(),this.activate(E)},y=A=>{A.key==="Escape"&&this.deactivate()},_=A=>{let E=A.detail;if(!(!E||E.pageRoot!==oe(this.ctx.pageRoot)||!E.path))for(let O of n.values())O.path===E.path&&(O.written=!0)};u.addEventListener("pointerover",p),u.addEventListener("pointerleave",b),u.addEventListener("pointerdown",g),u.addEventListener("click",k),c.addEventListener("keydown",y),e.addEventListener("hcms:change",_),o=()=>{u.removeEventListener("pointerover",p),u.removeEventListener("pointerleave",b),u.removeEventListener("pointerdown",g),u.removeEventListener("click",k),c.removeEventListener("keydown",y),e.removeEventListener("hcms:change",_)}},activate(u,c){if(!u||!l||u.kind==="text"&&this.activateText(u))return;let p=Mi(this,l,u.path.join("."));if(!p){this.deactivate();return}s=u,h=c||null,f=null,l.popTitleEl.textContent="Edit content",l.popEl.hidden=!1,l.formRoot.querySelectorAll(`.${ge}`).forEach(Mt),this.placePopover(),zi(p)},openStyle(u,c){if(!u||!l)return;let p=Ni(this,l,u.paths);if(!p){this.deactivate();return}s={kind:"style",scope:u.scope,el:u.scope==="page"?l.pageStyleEl:u.el,path:u.paths[0].split("."),paths:u.paths},h=c||null,f=null,l.popTitleEl.textContent=u.scope==="page"?"Page style":"Style",l.popEl.hidden=!1,l.formRoot.querySelectorAll(`.${ge}`).forEach(Mt),this.placePopover(),zi(p)},activateText(u){let c=u.el,p=n.get(c);if(p)return et(p),!0;let b=m(this.ctx,c,u.path.join("."),ut(u));return b?(et(b),!0):!1},placePopover(){if(!l||!s||l.popEl.hidden)return;let u=e.defaultView;if(!u)return;let c={width:u.innerWidth,height:u.innerHeight},p=s.el.getBoundingClientRect(),b=l.popEl.getBoundingClientRect(),{mode:g,x:k,y}=Ac({anchor:p,bar:b,viewport:c,current:f});f=g,l.popEl.style.transform=`translate(${Math.round(k)}px, ${Math.round(y)}px)`},deactivate(){if(!l||!s&&l.popEl.hidden)return;l.popEl.hidden=!0,Rr(l.root);let u=h;if(s=null,h=null,f=null,u&&e.contains(u)&&typeof u.focus=="function")try{u.focus({preventScroll:!0})}catch{u.focus()}},syncTargets(){if(!a)return;let u=this.ctx,c=pa(u.pageRoot,u.pageRules,e),p=c.lists,b=c.targets.filter(y=>!y.style);d=uc(c.targets,p),l.pageStyleEl.hidden=!d.some(y=>y.scope==="page"),a.setTargets(c.targets,p,d);let g=Bc(this,n,b,e);if(s?.kind==="style"){let y=s.scope==="page"?d.find(_=>_.scope==="page"):d.find(_=>_.el===s.el);y?s={...s,paths:y.paths,path:y.paths[0].split(".")}:this.deactivate()}else if(s){let y=g.get(s.el)||[],_=y.find(A=>Ic(A,s))||y.find(A=>A.path.join(".")===s.path.join("."))||(y.length===1?y[0]:null);_?s=_:this.deactivate()}Pc(this.ctx,n,e);let k=b.reduce((y,_)=>y+(Qe(_.el)?0:1),0);this.handoffEl&&(this.handoffCountEl.textContent=k===0?"":`${k} ${k===1?"field isn't":"fields aren't"} visible right now.`,this.handoffEl.hidden=k===0)},refresh(u,c){u==="livesync"?(_t(e),nt(e),fe(this.ctx,{ignoreActiveValue:!0})):u==="undo"?fe(this.ctx,{ignoreActiveValue:!1}):fe(this.ctx),this.syncTargets(),(u==="livesync"||u==="undo")&&this.rebindText(u),this.restoreActive()},rebindText(u){let c=u!=="undo";for(let[p,b]of[...n]){if(!e.contains(p)){ze(this.ctx,b,{restore:!1,record:c}),n.delete(p);continue}if(p.hasAttribute(re)){let y=Ne(p,b.prop);y!==b.lastEdited&&(b.oldValue=y,b.lastEdited=void 0);continue}let g=e.activeElement===p;ze(this.ctx,b,{restore:!1,record:c}),n.delete(p);let k=m(this.ctx,p,b.path,b.prop,{richClayIsOurs:b.richClayIsOurs,adopted:b.adopted});k&&g&&et(k)}},restoreActive(){if(!(!l||!s||l.popEl.hidden)){if(!e.contains(s.el)){this.deactivate();return}if(!(s.kind==="style"?Ni(this,l,s.paths):Mi(this,l,s.path.join(".")))){this.deactivate();return}l.formRoot.querySelectorAll(`.${ge}`).forEach(Mt),this.placePopover()}},focusOnOpen(){if(this.root&&typeof this.root.focus=="function")try{this.root.focus({preventScroll:!0})}catch{this.root.focus()}},destroy(){h=null,this.deactivate();for(let u of n.values())ze(this.ctx,u);n.clear(),o?.(),o=null,a?.destroy(),a=null,l?.destroy(),l=null,sa(e),this.popEl=null,this.handoffEl=null,this.handoffCountEl=null}}}function Fc(e,t,r,i,l){return Ae(()=>{let a=null;try{a=new t(r,{inline:!0,hyperclay:!1,toolbar:i==="innerHTML"?jc:!1,...Mc.test(r.tagName)?{singleLine:!0}:null})}catch(o){return console.warn("[hypercms] richclay activation failed; the field falls back to the popover",o),null}if(a.unsupported||!a.active){if(l)try{a.destroy()}catch{}return null}return typeof a.reattach=="function"&&a.reattach(),a})}function Dc(e,{path:t,el:r,prop:i}){let l=la(e.formRoot,t);l&&(aa(l,Ne(r,i),e.formRoot,t),Y(J(e),{path:t,structural:!1},e))}function Ne(e,t,r="data"){let i=ba(e,{capability:r});return t==="innerHTML"?i.html():i.text().trim()}function xa(e){let{el:t,prop:r,oldValue:i,lastEdited:l}=e,a=l;if(a===void 0||a===i)return;e.oldValue=a;let o=V("undo");if(!o||typeof o.recordValue!="function")return;let n={prop:r,oldValue:i,newValue:a,read:s=>Ne(s,r,"history"),write:(s,h)=>wa(s,r,h)};o.isPaused?queueMicrotask(()=>{t.isConnected&&o.recordValue(t,n)}):o.recordValue(t,n)}function wa(e,t,r){let i=e.cloneNode(!1);t==="innerHTML"?i.innerHTML=r:i.textContent=r,Te(e,Array.from(i.childNodes),{morphStyle:"innerHTML",policy:"history",restoreFocus:!1,scripts:{handle:!1,merge:!1}})}function ze(e,t,{restore:r=!0,record:i=!0}={}){i&&xa(t),t.detachInput?.(),t.detachBlur?.(),Ae(()=>{if(!t.adopted){try{t.editor.destroy()}catch(l){console.warn("[hypercms] richclay teardown failed; editor state may reach the save",l)}t.richClayIsOurs&&t.el.removeAttribute("data-richclay")}t.el.removeAttribute(re),t.el.removeAttribute(ve),t.el.removeAttribute(ke),as(t.boundId),r&&t.restorable()&&wa(t.el,"innerHTML",t.originalHTML)})}function et(e){let{editor:t,el:r}=e;if(r.ownerDocument.activeElement!==r)try{typeof t.focus=="function"?t.focus():r.focus()}catch{}}function Bc(e,t,r,i){let l=new Map;for(let a of r){let o=l.get(a.el);o?o.push(a):l.set(a.el,[a])}for(let[a,o]of[...t]){let n=l.get(a)||[],s=n.find(m=>ut(m)===o.prop)||n[0];if(!s){ze(e.ctx,o,{restore:!0}),t.delete(a);continue}o.path=s.path.join(".");let h=ut(s);if(h===o.prop)continue;let d=i.activeElement===a;ze(e.ctx,o,{restore:!1}),t.delete(a);let f=e.bindText(a,o.path,h,{richClayIsOurs:o.richClayIsOurs,adopted:o.adopted,originalHTML:o.originalHTML});f&&d&&et(f)}return l}function Ic(e,t){return e.el===t.el&&e.kind===t.kind&&e.attr===t.attr}function ut(e){return e.attr==="innerHTML"?"innerHTML":"textContent"}function Pc(e,t,r){for(let i of e.pageRoot.querySelectorAll(`[${re}]`))t.has(i)||Ae(()=>cs(i,r.defaultView))}function Mi(e,t,r){let i=e.formRoot&&e.formRoot.querySelector(`[data-hcms-path="${_e(r)}"]`);if(Rr(t.root),!i)return null;let l=i.closest("[data-hcms-card]"),a=l?[...l.querySelectorAll('[data-hcms-shape="scalar"][data-hcms-path]')].filter(o=>o.closest("[data-hcms-card]")===l&&o.closest('[data-hcms-shape="object-array"], [data-hcms-shape="scalar-array"]')===l.parentElement.closest('[data-hcms-shape="object-array"]')):[i];a.includes(i)||a.push(i);for(let o of a)Aa(e,o);return i}function Ni(e,t,r){Rr(t.root);let i=null;for(let l of r){let a=e.formRoot&&e.formRoot.querySelector(`[data-hcms-path="${_e(l)}"]`);a&&(i=i||a,Aa(e,a))}return i}function Aa(e,t){t.classList.add(ge),t.removeAttribute("draggable");for(let r=t.parentElement;r&&(r.classList.add(Qt),r.removeAttribute("draggable"),r!==e.formRoot);r=r.parentElement);}function Rr(e){if(e)for(let t of e.querySelectorAll(`.${ge}, .${Qt}`))t.classList.remove(ge,Qt)}function Mt(e){e.tagName==="TEXTAREA"&&lt(e),e.querySelectorAll?.("textarea").forEach(lt)}function zi(e){let t=e.matches?.(ji)?e:e.querySelector?.(ji);if(!(!t||typeof t.focus!="function"))try{t.focus({preventScroll:!0})}catch{t.focus()}}function Hc(e,t){_t(e);let r=e.createElement($c),i=t==="dark"?" dark":t==="light"?" light":"";return r.className="hcms-shell pixel-quiet hcms-inline"+i,r.setAttribute("data-hcms-shell",""),r.setAttribute("editor-ui",""),r.setAttribute("no-save",""),r.setAttribute("save-remove",""),r.setAttribute("snapshot-remove",""),r.setAttribute("no-watch",""),r.setAttribute("tabindex","-1"),r.innerHTML=`
228
+ <div class="hcms-inline-bar">
229
+ <div class="hcms-inline-handoff" hidden>
230
+ <span class="hcms-inline-handoff-count"></span>
231
+ <button type="button" class="hcms-inline-handoff-open mirk-button mirk-button--small" data-hcms-open-view="sidebar">
232
+ <span class="mirk-button__label">Edit in the sidebar</span>
233
+ </button>
234
+ </div>
235
+ <button type="button" class="hcms-inline-page-style mirk-button mirk-button--small" data-hcms-page-style-open hidden>
236
+ <span class="mirk-button__label">Page style</span>
237
+ </button>
238
+ <button type="button" class="hcms-inline-toggle mirk-button mirk-button--small" data-hcms-controls-toggle aria-pressed="false" hidden>
239
+ <span class="mirk-button__label">Hide controls</span>
240
+ </button>
241
+ <div class="hcms-inline-notice" role="status" hidden></div>
242
+ <div class="hcms-inline-error" role="alert" hidden></div>
243
+ </div>
244
+ <div class="hcms-inline-layer"></div>
245
+ <div class="hcms-inline-pop" role="dialog" aria-label="Edit content" hidden>
246
+ <div class="hcms-inline-pop-header">
247
+ <span class="hcms-inline-pop-title">Edit content</span>
248
+ <button type="button" class="hcms-inline-pop-close mirk-button mirk-button--small" aria-label="Close field editor">
249
+ <span class="mirk-button__label">${dt("remove")}</span>
250
+ </button>
251
+ </div>
252
+ <div data-hcms-form-root class="hcms-form"></div>
253
+ </div>
254
+ `,e.body.appendChild(r),{root:r,formRoot:r.querySelector("[data-hcms-form-root]"),noticeEl:r.querySelector(".hcms-inline-notice"),errorEl:r.querySelector(".hcms-inline-error"),handoffEl:r.querySelector(".hcms-inline-handoff"),handoffCountEl:r.querySelector(".hcms-inline-handoff-count"),layerEl:r.querySelector(".hcms-inline-layer"),popEl:r.querySelector(".hcms-inline-pop"),closeEl:r.querySelector(".hcms-inline-pop-close"),toggleEl:r.querySelector("[data-hcms-controls-toggle]"),pageStyleEl:r.querySelector("[data-hcms-page-style-open]"),popTitleEl:r.querySelector(".hcms-inline-pop-title"),destroy(){r.remove()}}}function Uc(e,t){let r=e.querySelector(".hcms-array-items");return r&&r.querySelectorAll(":scope > [data-hcms-card], :scope > [data-hcms-array-item]")[t]||null}function Vc(e,t,r){let{lists:i}=pa(e.pageRoot,e.pageRules),l=i.find(a=>a.path.join(".")===t);return l?l.items.indexOf(r):-1}var Wc="[hypercms]";function Gc(e,t){if(!e||!e.querySelectorAll||!t)return;let r=Jc(t);e.querySelectorAll("template[data-hcms-tpl]").forEach(i=>{let l=i.getAttribute("data-hcms-tpl");l&&(l.startsWith("@")||r.has(l)||console.warn(`${Wc} template "${l}" doesn't match any rule path; ignored`))})}function Jc(e){let t=new Set;return r([],e),t;function r(i,l){let a=i.join("."),o=i.map(s=>typeof s=="number"?"*":s).join(".");a&&t.add(a),o&&t.add(o);let n=Be(l);if(n==="object")for(let[s,h]of Object.entries(l))r([...i,s],h);else if(n==="object-array"||n==="scalar-array"){let s=[...i,"*"],h=s.map(d=>typeof d=="number"?"*":d).join(".");if(t.add(h),n==="object-array"){let d=l[1];if(d&&typeof d=="object"&&!Array.isArray(d))for(let[f,m]of Object.entries(d))r([...s,f],m)}}}}var Yt={skip:"[data-hcms-shell]",templateAttr:"cms-template"},q={isOpen:!1,ctx:null,opts:null};function Xc({view:e,doc:t,pageRoot:r,opts:i={},onCloseRequested:l,onViewRequested:a}){let o=i.rules!==void 0?i.rules:"cms",n=X.findRules(t,o);if(!n){let b=typeof o=="string"?`data-rules-name~="${o}"`:"the provided rules object";throw new Error(`hypercms: no rules found for ${b}`)}let s=e.prepareRules(pl(n.rules,r)),h=n.tagNode;kl(t),wl(t,s),Gc(t,s);let d=El(s,t),f=da(s),m=ha(r,s),u=ml(),c=ne(X.extract(r,s,{...Yt,...u.hooks}),s),p={doc:t,pageRoot:r,pageRules:s,writeRules:f,formRules:d,rulesTagNode:h,rulesSource:o,richText:e.richText,view:e,seeder:u,initialData:c,get formRoot(){return e.formRoot},get shellRoot(){return e.root},get errorEl(){return e.errorEl},get noticeEl(){return e.noticeEl},unresolved:m,lastTwinSignature:null,lastFingerprint:null,lastData:null,observerHandle:null,undoUnsub:null,livesyncUnsub:null,onChange:i.onChange,onError:i.onError,confirmRemove:i.confirmRemove,previouslyFocused:t.activeElement,quiesced:!1,dispatch(b,g){let k=t.defaultView&&t.defaultView.CustomEvent||(typeof CustomEvent<"u"?CustomEvent:null);if(!k)return;let y={...g||{},pageRoot:oe(r),view:e.name},_=new k(b,{bubbles:!0,cancelable:b==="hcms:change",detail:y});(e.root&&e.root.isConnected!==!1?e.root:oe(r)).dispatchEvent(_)},onCloseRequested:l,onViewRequested:a};return p.updateFingerprint=()=>{p.lastFingerprint=ot(J(p))},e.ctx=p,p}function Kc(e){e.updateFingerprint(),xr(e,ne(X.extract(e.pageRoot,e.pageRules,Yt),e.pageRules)),e.observerHandle=ec({onRefresh:i=>e.view.refresh("observer",i)});let t=V("undo");if(t&&typeof t.on=="function"){let i=()=>{if(q.ctx!==e)return;Fi(e,"undo");let l=ne(X.extract(e.pageRoot,e.pageRules,Yt),e.pageRules);ot(l)!==ot(e.lastData)&&(e.lastData=l,e.onChange?.(l,{path:"",structural:!1}))};t.on("undo",i),t.on("redo",i),e.undoUnsub=()=>{t.off("undo",i),t.off("redo",i)}}let r=()=>Fi(e,"livesync");e.livesyncUnsub=vr(e.doc,rs,r),Lr.ctx=e,th(e.doc)}function Fi(e,t){q.ctx===e&&e.view.refresh(t)}function mt(e,{dispatch:t=!0,restoreFocus:r=!0,updateUrl:i=!0,reason:l="close"}={}){if(!e||e.closed)return;e.closed=!0;for(let o of e.uploads||[])try{o.abort()}catch{}e.uploads?.clear();let a=e.previouslyFocused;if(t&&e.dispatch("hcms:close",{reason:l}),i&&lh(),e.observerHandle?.unsubscribe?.(),e.undoUnsub?.(),e.livesyncUnsub?.(),e.detachEvents?.(),Ae(()=>e.view.destroy()),Zc(),r&&typeof a?.focus=="function")try{a.focus()}catch{}}function Zc(){q.isOpen=!1,q.ctx=null,q.opts=null,Lr.ctx=null}function qr(e){let t=e||(typeof window<"u"?window:null),r=t&&t.clay?t.clay.modeLifecycle:null;return r&&typeof r.canWrite=="function"?r:null}function Or(e){let t=qr(e);if(!t)return!0;try{return t.canWrite()!==!1}catch{return!1}}var Qc="[data-hcms-uploading]";function _a(e){if(!e)return[];let t=[];return e.uploads&&e.uploads.size>0&&t.push("upload"),e.pageRoot&&typeof e.pageRoot.querySelector=="function"&&e.pageRoot.querySelector(Qc)&&t.push("preview"),t}function Yc(e){if(!e||e.closed)return{ok:!0};let t=_a(e);return t.length?{ok:!1,code:"pending-input",pending:t}:(e.quiesced=!0,{ok:!0})}function eh(e){!e||e.closed||(e.quiesced=!1)}var Lr={ctx:null};function th(e){let t=e.defaultView||(typeof globalThis<"u"?globalThis:null);if(!t)return;let r=function(){let i=Lr.ctx;if(i)return na(i.formRoot),Pe("Reorder",()=>Y(J(i),{path:"",structural:!0},i))};typeof t.hypercmsCommit!="function"&&(t.hypercmsCommit=r),typeof globalThis<"u"&&typeof globalThis.hypercmsCommit!="function"&&(globalThis.hypercmsCommit=r)}var er="cms";function rh(e){let t=typeof e=="string"?e:"",r=t.indexOf("?"),i=r===-1?t:t.slice(r+1);if(!i)return t;let l=new URLSearchParams(i);return l.get(er)!=="true"?t:(l.set(er,"false"),"?"+l.toString())}function ih(e){let t=typeof e=="string"?e:"",r=t.indexOf("?"),i=r===-1?t:t.slice(r+1);return i?new URLSearchParams(i).get(er)==="true":!1}function lh(){if(typeof window>"u"||!window.location||!window.history||typeof window.history.replaceState!="function")return;let e=window.location.search,t=rh(e);t!==e&&window.history.replaceState(window.history.state,"",t+window.location.hash)}function ah(e){if(Bs(e),typeof document<"u"){let t=document.getElementById("hcms-shell-styles");t?.tagName==="LINK"&&t.remove(),_t(document)}}var tr={sidebar:rc,inline:zc};function oh(e,t){let r=t!==void 0?t:"cms";if(typeof r!="string")return"sidebar";let i=X.findRules(e,r)?.tagNode?.getAttribute?.("data-cms-view");return!i||i==="sidebar"?"sidebar":tr[i]?i:(console.warn(`hypercms: unknown data-cms-view "${i}" on the rules tag, opening the sidebar`),"sidebar")}function Ea(e={}){return $r(e)}function nh(e){let t=e&&e.defaultView;if(!qr(t))return null;let r=t.clay&&t.clay.setMode;return typeof r!="function"?null:r.call(t.clay,"view")}function $r(e={},t=!1){let r=q.isOpen?{...q.opts,...e}:e,i=r.pageRoot||(typeof document<"u"?document:null);if(!i)throw new Error("hypercms: no pageRoot available");let l=(i.nodeType===9?i:i.ownerDocument)||(typeof document<"u"?document:null);if(!l)throw new Error("hypercms: no document available");if(!t&&!Or(l.defaultView))return{ok:!1,code:"not-allowed"};let a=e.view||(q.isOpen?q.ctx.view.name:oh(l,r.rules)),o=tr[a];if(!o)throw new Error(`hypercms: unknown view "${a}" (expected ${Object.keys(tr).join(" or ")})`);let n=q.isOpen?{...r,view:a}:e,s=null,h=null;if(q.isOpen){if(q.ctx.view.name===a)return{ok:!0,view:a};s=q.ctx.previouslyFocused,h=q.ctx.view.name,mt(q.ctx,{restoreFocus:!1,updateUrl:!1,reason:"switch"})}_c();let d=o({doc:l,pageRoot:i,opts:n}),f=Xc({view:d,doc:l,pageRoot:i,opts:n,onCloseRequested:()=>nh(l)||Sa(),onViewRequested:m=>$r({view:m},!0)});s&&(f.previouslyFocused=s);try{d.mount(f.initialData),Kc(f),d.focusOnOpen(),q.isOpen=!0,q.ctx=f,q.opts=n,f.dispatch("hcms:open",{pageRoot:i,previous:h})}catch(m){throw mt(f,{dispatch:!1,restoreFocus:!!s,updateUrl:!1}),m}return{ok:!0,view:a}}function Sa(){if(!q.isOpen)return{ok:!1,code:"no-session"};let e=q.ctx.doc;if(qr(e&&e.defaultView)){let t=_a(q.ctx);if(t.length)return{ok:!1,code:"pending-input",pending:t};if(!Or(e&&e.defaultView))return{ok:!1,code:"busy"}}return mt(q.ctx),{ok:!0}}function Ca(){q.isOpen&&q.ctx.view.refresh("api")}function sh(){return q.isOpen&&q.ctx?q.ctx.view.name:null}function Ta({doc:e,pageRoot:t,opts:r={}}={}){let i=null,l=!1;return{ready:Promise.resolve(),enable(){if(l)return;let a={...r};t&&(a.pageRoot=t),a.pageRoot||(a.pageRoot=e&&e.body||e||null),$r(a,!0),i=q.ctx},quiesce(){return l||!i||q.ctx!==i?{ok:!0}:Yc(i)},resume(){l||!i||q.ctx!==i||eh(i)},dispose(){l||(l=!0,i&&q.ctx===i&&mt(i),i=null)}}}function ch(e={}){return{id:"hypercms",order:1e3,prepare(){return Ta(e)}}}function Nt(){if(!q.isOpen)throw new Error("hypercms: cms is not open");if(q.ctx.quiesced)throw new Error("hypercms: the CMS is not admitting new changes")}var hh={getData(){return q.isOpen?J(q.ctx):null},setValue(e,t){Nt();let r=q.ctx,i=be(e),l=Fe(r.pageRules,i);if(l===void 0)throw new Error(`hypercms: no rule at path "${e}"`);if(typeof l!="string"||l.endsWith("[]"))throw new Error(`hypercms: setValue requires a leaf scalar path; "${e}" is not a leaf`);let a=la(r.formRoot,e);if(!a)throw new Error(`hypercms: no field element at path "${e}"`);aa(a,t,r.formRoot,e),Y(J(r),{path:e,structural:!1},r)},addItem(e){Nt(),wr(e,q.ctx)},removeItem(e){Nt();let t=q.ctx,r=be(e);if(typeof r[r.length-1]!="number")throw new Error(`hypercms: removeItem requires an item path; "${e}" is not an array index`);let i=Fe(t.pageRules,r.slice(0,-1));if(!(Array.isArray(i)||typeof i=="string"&&i.endsWith("[]")))throw new Error(`hypercms: removeItem requires an item path; parent of "${e}" is not an array`);let l=t.formRoot.querySelector(`[data-hcms-path="${fh(e)}"]`);if(!l)throw new Error(`hypercms: no element at path "${e}"`);Le(l,t)},refresh:Ca,_commit(){if(!q.isOpen||q.ctx.quiesced)return;let e=q.ctx;return na(e.formRoot),Pe("Update",()=>Y(J(e),{path:"",structural:!0},e))}},dh=250,uh=1e4;function mh(){typeof window>"u"||typeof document>"u"||ih(window.location?window.location.search:"")&&(q.isOpen||ph(()=>{if(!q.isOpen&&Or())try{Ea()}catch(e){console.warn("hypercms: auto-open failed",e)}}))}function zt(){return!!document.body&&!!V("Mutation")}function ph(e){if(zt()){queueMicrotask(e);return}let t=Date.now()+uh,r=!1,i=null,l=null,a=()=>{r||(r=!0,i!==null&&clearInterval(i),l&&l())};function o(){if(q.isOpen){a();return}zt()&&(a(),e())}l=vr(document,ts,o),i=setInterval(()=>{if(q.isOpen){a();return}if(zt()){a(),e();return}Date.now()>=t&&(a(),console.warn("hypercms: ?cms=true auto-open gave up \u2014 no mutation hub appeared. Load clayjs or hyperclayjs (or just the mutation utility) so the CMS can initialize."))},dh)}mh();var Ra={open:Ea,close:Sa,refresh:Ca,api:hh,hasRules:(e=document)=>!!X.findRules(e,"cms"),prepareModeLease:Ta,modeParticipant:ch,get isOpen(){return q.isOpen},currentView:sh,path:sl,scaffold:or,morphForm:cl};function fh(e){return typeof CSS<"u"&&CSS.escape?CSS.escape(e):String(e).replace(/[^a-zA-Z0-9_\-.*]/g,t=>"\\"+t)}var gh=`/* GENERATED by scripts/build-theme.js from mirk-interface/mirk.css \u2014 DO NOT EDIT.
255
+ Source of truth: mirk-interface/mirk.css + src/theme/pixel-quiet.overrides.css.
256
+ Regenerate with: npm run build:theme */
257
+
258
+ /* ===== mirk-interface@2.2.0, scoped to .hcms-shell ===== */
259
+ /*
260
+ * mirk.css \u2014 the mirk UI kit, v2.
261
+ * Hand-written, no build. Fourteen form components as semantic BEM classes in
262
+ * @layer components, so utilities (Tailwind or your own) always override them
263
+ * with zero !important. Renders fully standalone; Tailwind is optional.
264
+ *
265
+ * Two hinges (see mirk-ui-guide.md):
266
+ * 1. Components live in @layer components \u2192 utilities win.
267
+ * 2. State serializes into the DOM (native attrs, :has(), inline --mirk-value)
268
+ * so document.documentElement.outerHTML round-trips every visible state.
269
+ *
270
+ * This @layer statement makes the file self-sufficient without Tailwind, and
271
+ * merges into Tailwind's own order (@layer theme, base, components, utilities)
272
+ * when present.
273
+ */
274
+ @layer base, components;
275
+
276
+ @layer base {
277
+ /* Components are authored border-box (a 2px bevel must not grow the box). */
278
+ .hcms-shell *, .hcms-shell *::before, .hcms-shell *::after { box-sizing: border-box; }
279
+ .hcms-shell button, .hcms-shell input, .hcms-shell optgroup, .hcms-shell select, .hcms-shell textarea { margin: 0; }
280
+
281
+ @font-face {
282
+ font-family: 'Departure Mono';
283
+ src: url('https://cdn.jsdelivr.net/npm/mirk-interface@2.2.0/fonts/DepartureMono-1.500/DepartureMono-Regular.woff2') format('woff2');
284
+ font-weight: 400; font-style: normal; font-display: swap;
285
+ }
286
+
287
+ .hcms-shell { font-family: 'Departure Mono', ui-monospace, "Menlo", monospace; }
288
+ /* Preflight sets these to ui-monospace; keep them in Departure Mono. */
289
+ .hcms-shell pre, .hcms-shell code, .hcms-shell kbd, .hcms-shell samp { font-family: inherit; }
290
+
291
+ /* 28 tokens, one value each. light-dark() picks the side from color-scheme.
292
+ :root paints the DEFAULT theme \u2014 "Pixel Quiet" (see 0030): mirk's warm soul
293
+ with the volume down. The louder original palette is the opt-in
294
+ [data-theme="full-volume"] block below. */
295
+ .hcms-shell {
296
+ color-scheme: light dark; /* default: follow the OS */
297
+
298
+ --mirk-canvas: light-dark(#FDF8F0, #0B0C13);
299
+ --mirk-bg: light-dark(#FDF8F0, #11131E);
300
+ --mirk-fg: light-dark(#2B241B, #ECEAF2);
301
+ --mirk-accent: light-dark(#efefe5, #1D1F2F);
302
+ --mirk-destructive: light-dark(#C24A3A, #ff5566);
303
+ --mirk-focus-color: light-dark(#C7AE93, #4A506B);
304
+ --mirk-bevel-bg: light-dark(#FCF8F1, #1A1D2C);
305
+ --mirk-bevel-fg: light-dark(#2B241B, #ECEAF2);
306
+ --mirk-bevel-tl: light-dark(#F0E7D8, #2A2E42);
307
+ --mirk-bevel-br: light-dark(#E2D4BF, #14182A);
308
+ --mirk-bevel-hover-bg: light-dark(#F4ECDF, #202436);
309
+ --mirk-pill-inner-top: light-dark(#FBF6EE, #202436);
310
+ --mirk-input-border: light-dark(#D8C8AF, #353B52);
311
+ --mirk-placeholder-color: light-dark(#A8987F, #6A7090);
312
+ --mirk-ctrl-bg: light-dark(#8C7660, #5F6582);
313
+ --mirk-toggle-bg: light-dark(#EFDBBD, #3E4660);
314
+ --mirk-toggle-hi: light-dark(#F4EADA, #4E567A);
315
+ --mirk-toggle-lo: light-dark(#C2A87E, #262B42);
316
+ --mirk-mark-fg: light-dark(#6B5942, #C9CDE0);
317
+ --mirk-sortable-dot: light-dark(#DDCBB0, #353B52);
318
+ --mirk-sortable-shadow: light-dark(#C9B493, #0E1120);
319
+ --mirk-sortable-label: light-dark(#8C7B62, #8A90AB);
320
+ --mirk-sortable-placeholder: light-dark(#A8987F, #6A7090);
321
+ --mirk-slider-fill: light-dark(#F2E0BD, #2A2E42);
322
+ --mirk-slider-nub-bg: light-dark(#EFDBBD, #3E4660);
323
+ --mirk-slider-nub-hi: light-dark(#F4EADA, #4E567A);
324
+ --mirk-slider-nub-lo: light-dark(#C2A87E, #262B42);
325
+
326
+ /* Chip \u2014 the recovery/notification component reads from the kit's own tokens
327
+ via 5 slim hooks, so it matches the kit by default and reskins by overriding
328
+ a hook (not a rule). Each follows the theme (incl. the Full Volume variant)
329
+ and OS light/dark with no per-theme repaint; the one exception is the primary
330
+ fill, which the default (Pixel Quiet) leaves as the theme's fg ink while the
331
+ Full Volume variant tints it a warm brown in light (see below). */
332
+ --mirk-chip-surface: var(--mirk-bg); /* raised panel face */
333
+ --mirk-chip-edge: var(--mirk-input-border); /* panel + recess outline */
334
+ --mirk-chip-primary-bg: var(--mirk-fg); /* primary action fill \u2014 the theme's fg ink (Full Volume tints it warm brown in light) */
335
+ --mirk-chip-primary-fg: var(--mirk-bg);
336
+ --mirk-chip-alert: var(--mirk-destructive); /* icon + struck "now" value */
337
+
338
+ --mirk-radius: 5px; /* the "rounded" corner */
339
+ --mirk-focus-offset: 2px; /* non-color \u2192 can't ride light-dark() */
340
+
341
+ background: var(--mirk-canvas);
342
+ color: var(--mirk-fg);
343
+ }
344
+
345
+ /* The one non-color token with a real light/dark split (was 2px / 3px). */
346
+ @media (prefers-color-scheme: dark) { .hcms-shell { --mirk-focus-offset: 3px; } }
347
+
348
+ /* Force a mode on any subtree with one attribute (class aliases for hosts that
349
+ prefer class-based theming and Tailwind's dark-variant convention). Each also
350
+ paints its own canvas so a wrapper visibly flips. */
351
+ .hcms-shell[data-theme="light"], .hcms-shell.light {
352
+ color-scheme: light; --mirk-focus-offset: 2px;
353
+ background: var(--mirk-canvas); color: var(--mirk-fg);
354
+ }
355
+ .hcms-shell[data-theme="dark"], .hcms-shell.dark {
356
+ color-scheme: dark; --mirk-focus-offset: 3px;
357
+ background: var(--mirk-canvas); color: var(--mirk-fg);
358
+ }
359
+
360
+ /* Built-in brand variant \u2014 "Full Volume": mirk's original full-strength palette,
361
+ the loud pole of the volume axis (Pixel Quiet, now the default, is the quiet
362
+ end). Full-contrast bevel, warm cream / deep navy, crimson destructive.
363
+ Authored with light-dark() like :root, so it follows the OS and still flips
364
+ with .dark / .light. Opt in: data-theme="full-volume". Sits after :root
365
+ (equal specificity, source order wins). --mirk-radius / --mirk-focus-offset /
366
+ --mirk-ctrl-bg and the four shared --mirk-chip-* hooks inherit from :root
367
+ unchanged; only the tokens that differ from the default are re-declared here. */
368
+ .hcms-shell[data-theme="full-volume"] {
369
+ --mirk-canvas: light-dark(#F7F2EA, #0B0C13);
370
+ --mirk-bg: light-dark(#F7F2EA, #1D1F2F);
371
+ --mirk-fg: light-dark(#15120e, #F6F7F9);
372
+ --mirk-accent: light-dark(#efefe5, #232639);
373
+ --mirk-destructive: light-dark(#d4183d, #ff5566);
374
+ --mirk-focus-color: light-dark(#BBA288, #5A607F);
375
+ --mirk-bevel-bg: light-dark(#e9d3bd, #1D1F2F);
376
+ --mirk-bevel-fg: light-dark(#15120e, #F6F7F9);
377
+ --mirk-bevel-tl: light-dark(#f3ddc7, #474C65);
378
+ --mirk-bevel-br: light-dark(#c2ad95, #131725);
379
+ --mirk-bevel-hover-bg: light-dark(#dfc9b3, #232639);
380
+ --mirk-pill-inner-top: light-dark(#efdac7, #232639);
381
+ --mirk-input-border: light-dark(#957E65, #6E738E);
382
+ --mirk-placeholder-color: light-dark(#7F7366, #545973);
383
+ --mirk-toggle-bg: light-dark(#DFC9AF, #656D95);
384
+ --mirk-toggle-hi: light-dark(#E9D6C3, #7F87AD);
385
+ --mirk-toggle-lo: light-dark(#C7A88A, #505677);
386
+ --mirk-mark-fg: light-dark(#3F3225, #E1E3EA);
387
+ --mirk-sortable-dot: light-dark(#e2c5a6, #393f5b);
388
+ --mirk-sortable-shadow: light-dark(#c7a47f, #111527);
389
+ --mirk-sortable-label: light-dark(#231e18, #edeef2);
390
+ --mirk-sortable-placeholder: light-dark(#99826c, #6f7695);
391
+ --mirk-slider-fill: light-dark(#e9d3bd, #232639);
392
+ --mirk-slider-nub-bg: light-dark(#DFC9AF, #656D95);
393
+ --mirk-slider-nub-hi: light-dark(#E9D6C3, #7F87AD);
394
+ --mirk-slider-nub-lo: light-dark(#C7A88A, #505677);
395
+ /* :root (Pixel Quiet) leaves the chip primary as its own fg ink; the original
396
+ default tinted it a warm brown in light \u2014 restore that here. */
397
+ --mirk-chip-primary-bg: light-dark(#1C170E, var(--mirk-fg));
398
+ }
399
+
400
+ /* Roll your own the same way \u2014 an explicit [data-theme] block is the escape hatch:
401
+ [data-theme="sunset"] { color-scheme: light; --mirk-accent: #f0a868; \u2026 } */
402
+ }
403
+
404
+ @layer components {
405
+ /* Visually hidden, still focusable/announced. The hidden native input behind
406
+ every custom control relies on it; Tailwind is optional now. */
407
+ .hcms-shell .mirk-sr-only {
408
+ position: absolute; width: 1px; height: 1px;
409
+ padding: 0; margin: -1px; overflow: hidden;
410
+ clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;
411
+ }
412
+
413
+ /* ============================ BUTTON ============================ */
414
+ .hcms-shell .mirk-button {
415
+ display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
416
+ font: inherit; line-height: 1.5; cursor: pointer; user-select: none;
417
+ text-align: center;
418
+ color: var(--mirk-bevel-fg);
419
+ background: var(--mirk-bevel-bg);
420
+ border: 2px solid;
421
+ /* Raised bevel: light top+left, dark right+bottom. Shorthand is T R B L. */
422
+ border-color: var(--mirk-bevel-tl) var(--mirk-bevel-br) var(--mirk-bevel-br) var(--mirk-bevel-tl);
423
+ padding: 4px 14px 5px; /* medium */
424
+ outline: none;
425
+ }
426
+ .hcms-shell .mirk-button__label { white-space: nowrap; user-select: none; display: inline-block; }
427
+
428
+ /* States, written once, shared by every size and shape. */
429
+ .hcms-shell .mirk-button:hover { background-color: var(--mirk-bevel-hover-bg); }
430
+ .hcms-shell .mirk-button:active {
431
+ border-color: var(--mirk-bevel-br) var(--mirk-bevel-tl) var(--mirk-bevel-tl) var(--mirk-bevel-br);
432
+ }
433
+ .hcms-shell .mirk-button:not(.mirk-button--round):active .mirk-button__label { translate: 1.5px 1.5px; }
434
+ /* Direct focus (a real <button>) or a focus-visible descendant (a <label>
435
+ wrapping a hidden input, as the file/image upload triggers do). */
436
+ .hcms-shell .mirk-button:focus-visible, .hcms-shell .mirk-button:has(:focus-visible) {
437
+ outline: 1px solid var(--mirk-focus-color); outline-offset: var(--mirk-focus-offset);
438
+ }
439
+ .hcms-shell .mirk-button:disabled { opacity: 0.5; cursor: not-allowed; }
440
+
441
+ /* Sizes set padding + font (rect); round re-homes padding to the label below. */
442
+ .hcms-shell .mirk-button--small { padding: 3px 12px; font-size: 14px; }
443
+ .hcms-shell .mirk-button--large { padding: 4px 17px 7px; font-size: 18px; border-width: 3px; }
444
+
445
+ /* Round register: a gradient pill frame with the label as the inner fill. */
446
+ .hcms-shell .mirk-button--round {
447
+ border: none; padding: 2px; border-radius: 14px;
448
+ background-color: var(--mirk-canvas);
449
+ background-image: linear-gradient(to top in oklab, var(--mirk-bevel-br), var(--mirk-bevel-tl));
450
+ opacity: 0.9; transition: opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1);
451
+ }
452
+ .hcms-shell .mirk-button--round:hover { opacity: 1; }
453
+ .hcms-shell .mirk-button--round:active {
454
+ background-image: linear-gradient(to bottom in oklab, var(--mirk-bevel-br), var(--mirk-bevel-tl));
455
+ }
456
+ .hcms-shell .mirk-button--round .mirk-button__label {
457
+ display: flex; align-items: center; gap: 0.5rem;
458
+ padding: 4px 17px 6px; border-radius: 12px;
459
+ color: var(--mirk-bevel-fg);
460
+ background-color: var(--mirk-bevel-bg);
461
+ background-image: linear-gradient(to top in oklab, var(--mirk-bevel-bg), var(--mirk-pill-inner-top));
462
+ }
463
+ .hcms-shell .mirk-button--round.mirk-button--small { border-radius: 12px; }
464
+ .hcms-shell .mirk-button--round.mirk-button--small .mirk-button__label { padding: 2px 14px; border-radius: 10px; }
465
+ .hcms-shell .mirk-button--round.mirk-button--large { border-radius: 16px; }
466
+ .hcms-shell .mirk-button--round.mirk-button--large .mirk-button__label { padding: 7px 24px 9px; border-radius: 14px; }
467
+
468
+ /* Quiet: a borderless text button (transparent border keeps the hit area + the
469
+ baseline aligned with neighbouring bevel buttons). For tertiary actions. */
470
+ .hcms-shell .mirk-button--quiet {
471
+ background: none; background-image: none;
472
+ border-color: transparent; color: var(--mirk-placeholder-color);
473
+ }
474
+ .hcms-shell .mirk-button--quiet:hover { background: none; color: var(--mirk-fg); }
475
+ .hcms-shell .mirk-button--quiet:active { border-color: transparent; }
476
+
477
+ /* ============================ TEXT INPUT ============================ */
478
+ .hcms-shell .mirk-input {
479
+ width: 100%;
480
+ background: var(--mirk-bevel-bg); color: var(--mirk-bevel-fg);
481
+ border: 1px solid var(--mirk-input-border);
482
+ padding: 5px 14px 6px; /* medium */
483
+ font: inherit; line-height: 1.5; border-radius: 0; outline: none;
484
+ }
485
+ .hcms-shell .mirk-input::placeholder { color: var(--mirk-placeholder-color); }
486
+ .hcms-shell .mirk-input:focus-visible {
487
+ outline: 1px solid var(--mirk-focus-color); outline-offset: var(--mirk-focus-offset);
488
+ }
489
+ .hcms-shell .mirk-input--small { padding: 4px 12px; font-size: 14px; }
490
+ .hcms-shell .mirk-input--large { padding: 6px 17px 9px; font-size: 18px; }
491
+ .hcms-shell .mirk-input--rounded { border-radius: var(--mirk-radius); }
492
+
493
+ /* ============================ TEXTAREA ============================ */
494
+ .hcms-shell .mirk-textarea {
495
+ width: 100%;
496
+ background: var(--mirk-bevel-bg); color: var(--mirk-bevel-fg);
497
+ border: 1px solid var(--mirk-input-border);
498
+ padding: 6px 17px 9px; font: inherit; font-size: 18px; line-height: 1.5;
499
+ border-radius: 0; outline: none; resize: vertical;
500
+ }
501
+ .hcms-shell .mirk-textarea::placeholder { color: var(--mirk-placeholder-color); }
502
+ .hcms-shell .mirk-textarea:focus-visible {
503
+ outline: 1px solid var(--mirk-focus-color); outline-offset: var(--mirk-focus-offset);
504
+ }
505
+ .hcms-shell .mirk-textarea--rounded { border-radius: var(--mirk-radius); }
506
+
507
+ /* ============================ NUMBER ============================ */
508
+ .hcms-shell .mirk-number {
509
+ display: flex; align-items: stretch; width: 100%;
510
+ background: var(--mirk-bevel-bg);
511
+ border: 1px solid var(--mirk-input-border); border-radius: 0;
512
+ }
513
+ .hcms-shell .mirk-number:has(:focus-visible) {
514
+ outline: 1px solid var(--mirk-focus-color); outline-offset: var(--mirk-focus-offset);
515
+ }
516
+ .hcms-shell .mirk-number__input {
517
+ flex: 1; min-width: 0; background: transparent; color: var(--mirk-bevel-fg);
518
+ padding: 5px 10px 6px 14px; /* medium */
519
+ font: inherit; line-height: 1.5; outline: none;
520
+ appearance: textfield; -webkit-appearance: textfield;
521
+ }
522
+ .hcms-shell .mirk-number__input::-webkit-outer-spin-button, .hcms-shell .mirk-number__input::-webkit-inner-spin-button { -webkit-appearance: none; appearance: none; }
523
+ .hcms-shell .mirk-number__steps { display: flex; flex-direction: column; padding: 2px; gap: 2px; }
524
+ .hcms-shell .mirk-number__step {
525
+ flex: 1; cursor: pointer; line-height: 1; padding: 0 10px; font-size: 9px; /* medium */
526
+ display: flex; align-items: center; justify-content: center;
527
+ background: var(--mirk-bevel-bg); outline: none;
528
+ border: 2px solid;
529
+ border-color: var(--mirk-bevel-tl) var(--mirk-bevel-br) var(--mirk-bevel-br) var(--mirk-bevel-tl);
530
+ }
531
+ .hcms-shell .mirk-number__step:hover { background: var(--mirk-bevel-hover-bg); }
532
+ .hcms-shell .mirk-number__step:active {
533
+ border-color: var(--mirk-bevel-br) var(--mirk-bevel-tl) var(--mirk-bevel-tl) var(--mirk-bevel-br);
534
+ }
535
+ .hcms-shell .mirk-number__step:focus-visible { outline: 1px solid var(--mirk-focus-color); outline-offset: 1px; }
536
+
537
+ .hcms-shell .mirk-number--small .mirk-number__input { padding: 4px 8px 4px 12px; font-size: 14px; }
538
+ .hcms-shell .mirk-number--small .mirk-number__step { padding: 0 8px; font-size: 8px; }
539
+ .hcms-shell .mirk-number--large .mirk-number__input { padding: 6px 12px 9px 17px; font-size: 18px; }
540
+ .hcms-shell .mirk-number--large .mirk-number__step { padding: 0 12px; font-size: 10px; }
541
+
542
+ .hcms-shell .mirk-number--rounded { border-radius: var(--mirk-radius); }
543
+ .hcms-shell .mirk-number--rounded .mirk-number__step { border-radius: 3px; }
544
+
545
+ /* ============================ SELECT / DROPDOWN ============================ */
546
+ /* Keeps appearance:none + a real chevron (renders identically everywhere today);
547
+ base-select/::picker is a future enhancement. */
548
+ .hcms-shell .mirk-select { position: relative; }
549
+ .hcms-shell .mirk-select__field {
550
+ width: 100%; appearance: none; -webkit-appearance: none;
551
+ background: var(--mirk-bevel-bg); color: var(--mirk-bevel-fg);
552
+ border: 2px solid;
553
+ border-color: var(--mirk-bevel-tl) var(--mirk-bevel-br) var(--mirk-bevel-br) var(--mirk-bevel-tl);
554
+ padding: 4px 40px 5px 14px; /* medium */
555
+ font: inherit; line-height: 1.5; border-radius: 0; outline: none;
556
+ }
557
+ .hcms-shell .mirk-select__field:focus-visible {
558
+ outline: 1px solid var(--mirk-focus-color); outline-offset: var(--mirk-focus-offset);
559
+ }
560
+ .hcms-shell .mirk-select__chevron {
561
+ pointer-events: none; position: absolute; top: 50%; right: 14px; /* medium */
562
+ translate: 0 -50%; rotate: 90deg; display: inline-block; line-height: 1; font-size: 20px;
563
+ }
564
+ .hcms-shell .mirk-select--small .mirk-select__field { padding: 3px 36px 3px 12px; font-size: 14px; }
565
+ .hcms-shell .mirk-select--small .mirk-select__chevron { right: 12px; font-size: 18px; }
566
+ .hcms-shell .mirk-select--large .mirk-select__field { padding: 4px 48px 7px 17px; font-size: 18px; border-width: 3px; }
567
+ .hcms-shell .mirk-select--large .mirk-select__chevron { right: 16px; font-size: 24px; }
568
+
569
+ /* Round: gradient pill frame around a borderless, pill-filled select. */
570
+ .hcms-shell .mirk-select--round .mirk-select__frame {
571
+ padding: 2px; border-radius: 14px; /* medium */
572
+ background-color: var(--mirk-canvas);
573
+ background-image: linear-gradient(to top in oklab, var(--mirk-bevel-br), var(--mirk-bevel-tl));
574
+ }
575
+ .hcms-shell .mirk-select--round .mirk-select__frame:has(:focus-visible) {
576
+ outline: 1px solid var(--mirk-focus-color); outline-offset: var(--mirk-focus-offset);
577
+ }
578
+ .hcms-shell .mirk-select--round .mirk-select__field {
579
+ border: none; background-color: transparent;
580
+ background-image: linear-gradient(to top in oklab, var(--mirk-bevel-bg), var(--mirk-pill-inner-top));
581
+ border-radius: 12px; padding: 4px 40px 6px 17px; /* medium */
582
+ }
583
+ .hcms-shell .mirk-select--round.mirk-select--small .mirk-select__frame { border-radius: 12px; }
584
+ .hcms-shell .mirk-select--round.mirk-select--small .mirk-select__field { border-radius: 10px; padding: 2px 36px 2px 14px; }
585
+ .hcms-shell .mirk-select--round.mirk-select--large .mirk-select__frame { border-radius: 16px; }
586
+ .hcms-shell .mirk-select--round.mirk-select--large .mirk-select__field { border-radius: 14px; padding: 7px 48px 9px 24px; }
587
+ .hcms-shell .mirk-select--round.mirk-select--large .mirk-select__chevron { right: 16px; font-size: 24px; }
588
+
589
+ /* ============================ CHECKBOX ============================ */
590
+ .hcms-shell .mirk-checkbox { display: inline-flex; align-items: center; gap: 0.75rem; cursor: pointer; width: fit-content; }
591
+ .hcms-shell .mirk-checkbox__box {
592
+ position: relative; flex-shrink: 0; width: 22px; height: 22px;
593
+ display: flex; align-items: center; justify-content: center; border-radius: 0;
594
+ background: var(--mirk-bevel-bg);
595
+ border: 2px solid;
596
+ border-color: var(--mirk-bevel-tl) var(--mirk-bevel-br) var(--mirk-bevel-br) var(--mirk-bevel-tl);
597
+ }
598
+ .hcms-shell .mirk-checkbox__mark {
599
+ opacity: 0; display: block; width: 6px; height: 12px;
600
+ border-right: 2.5px solid var(--mirk-mark-fg); border-bottom: 2.5px solid var(--mirk-mark-fg);
601
+ rotate: 45deg; translate: 0.5px -1.5px;
602
+ }
603
+ .hcms-shell .mirk-checkbox__label { font-size: 18px; line-height: 1.5; }
604
+
605
+ .hcms-shell .mirk-checkbox:has(:checked) .mirk-checkbox__box { border-color: var(--mirk-input-border); }
606
+ .hcms-shell .mirk-checkbox:has(:checked) .mirk-checkbox__mark { opacity: 1; }
607
+ .hcms-shell .mirk-checkbox:has(:focus-visible) .mirk-checkbox__box {
608
+ outline: 1px solid var(--mirk-focus-color); outline-offset: var(--mirk-focus-offset);
609
+ }
610
+
611
+ .hcms-shell .mirk-checkbox--small { gap: 0.5rem; }
612
+ .hcms-shell .mirk-checkbox--small .mirk-checkbox__box { width: 18px; height: 18px; }
613
+ .hcms-shell .mirk-checkbox--small .mirk-checkbox__mark {
614
+ width: 5px; height: 10px;
615
+ border-right-width: 2px; border-bottom-width: 2px; translate: 0.5px -1px;
616
+ }
617
+ .hcms-shell .mirk-checkbox--small .mirk-checkbox__label { font-size: 14px; }
618
+
619
+ /* ============================ RADIO ============================ */
620
+ .hcms-shell .mirk-radio { display: inline-flex; align-items: center; gap: 0.75rem; cursor: pointer; width: fit-content; }
621
+ .hcms-shell .mirk-radio__ring {
622
+ position: relative; flex-shrink: 0; width: 25px; height: 25px; border-radius: 9999px;
623
+ background-image: linear-gradient(to top in oklab, var(--mirk-bevel-br), var(--mirk-bevel-tl));
624
+ }
625
+ .hcms-shell .mirk-radio__fill {
626
+ display: block; position: absolute; inset: 2px; border-radius: 9999px;
627
+ background-image: linear-gradient(to top in oklab, var(--mirk-bevel-bg), var(--mirk-pill-inner-top));
628
+ }
629
+ .hcms-shell .mirk-radio__dot {
630
+ display: none; position: absolute; top: 50%; left: 50%; translate: -50% -50%;
631
+ width: 9px; height: 9px; border-radius: 9999px; background: var(--mirk-mark-fg);
632
+ }
633
+ .hcms-shell .mirk-radio__label { font-size: 18px; line-height: 1.5; }
634
+
635
+ .hcms-shell .mirk-radio:has(:checked) .mirk-radio__ring {
636
+ background-image: none; background-color: var(--mirk-bevel-bg);
637
+ border: 2px solid var(--mirk-input-border);
638
+ }
639
+ .hcms-shell .mirk-radio:has(:checked) .mirk-radio__fill { display: none; }
640
+ .hcms-shell .mirk-radio:has(:checked) .mirk-radio__dot { display: block; }
641
+ .hcms-shell .mirk-radio:has(:focus-visible) .mirk-radio__ring {
642
+ outline: 1px solid var(--mirk-focus-color); outline-offset: var(--mirk-focus-offset);
643
+ }
644
+
645
+ .hcms-shell .mirk-radio--small { gap: 0.5rem; }
646
+ .hcms-shell .mirk-radio--small .mirk-radio__ring { width: 20px; height: 20px; }
647
+ .hcms-shell .mirk-radio--small .mirk-radio__dot { width: 7px; height: 7px; }
648
+ .hcms-shell .mirk-radio--small .mirk-radio__label { font-size: 14px; }
649
+
650
+ /* ============================ TOGGLE ============================ */
651
+ .hcms-shell .mirk-toggle { display: inline-flex; align-items: center; gap: 0.75rem; cursor: pointer; width: fit-content; }
652
+ .hcms-shell .mirk-toggle__track {
653
+ position: relative; flex-shrink: 0; width: 49px; height: 27px; border-radius: 0;
654
+ background: var(--mirk-canvas); /* own recessed channel, like the slider track \u2014 never the host page (0033) */
655
+ border: 1px solid var(--mirk-input-border);
656
+ }
657
+ .hcms-shell .mirk-toggle__thumb {
658
+ position: absolute; top: 3px; left: 3px; width: 19px; height: 19px;
659
+ background-color: var(--mirk-toggle-bg);
660
+ border: 2px solid;
661
+ border-color: var(--mirk-toggle-hi) var(--mirk-toggle-lo) var(--mirk-toggle-lo) var(--mirk-toggle-hi);
662
+ transition-property: transform, translate, scale, rotate;
663
+ transition-duration: 0.15s; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
664
+ }
665
+ .hcms-shell .mirk-toggle__label { font-size: 18px; line-height: 1.5; }
666
+
667
+ .hcms-shell .mirk-toggle:has(:checked) .mirk-toggle__thumb { translate: 22px; }
668
+ .hcms-shell .mirk-toggle:has(:focus-visible) .mirk-toggle__track {
669
+ outline: 1px solid var(--mirk-focus-color); outline-offset: var(--mirk-focus-offset);
670
+ }
671
+
672
+ .hcms-shell .mirk-toggle--round .mirk-toggle__track { width: 50px; height: 29px; border-radius: 9999px; }
673
+ .hcms-shell .mirk-toggle--round .mirk-toggle__thumb {
674
+ width: 21px; height: 21px; border: none; border-radius: 9999px;
675
+ background-color: transparent;
676
+ background-image: linear-gradient(to top in oklab, var(--mirk-toggle-lo), var(--mirk-toggle-hi));
677
+ }
678
+ .hcms-shell .mirk-toggle--round .mirk-toggle__thumb::after {
679
+ content: ""; position: absolute; inset: 2px; border-radius: 9999px; background: var(--mirk-toggle-bg);
680
+ }
681
+ .hcms-shell .mirk-toggle--round:has(:checked) .mirk-toggle__thumb { translate: 21px; }
682
+
683
+ .hcms-shell .mirk-toggle--small { gap: 0.5rem; }
684
+ .hcms-shell .mirk-toggle--small .mirk-toggle__track { width: 42px; height: 23px; }
685
+ .hcms-shell .mirk-toggle--small .mirk-toggle__thumb { top: 2px; left: 2px; width: 17px; height: 17px; }
686
+ .hcms-shell .mirk-toggle--small:has(:checked) .mirk-toggle__thumb { translate: 19px; }
687
+ .hcms-shell .mirk-toggle--small .mirk-toggle__label { font-size: 14px; }
688
+ .hcms-shell .mirk-toggle--round.mirk-toggle--small .mirk-toggle__track { width: 43px; height: 25px; }
689
+ .hcms-shell .mirk-toggle--round.mirk-toggle--small .mirk-toggle__thumb { width: 19px; height: 19px; }
690
+ .hcms-shell .mirk-toggle--round.mirk-toggle--small:has(:checked) .mirk-toggle__thumb { translate: 18px; }
691
+
692
+ /* ============================ SLIDER ============================ */
693
+ .hcms-shell .mirk-slider { position: relative; height: 32px; width: 100%; --mirk-value: 0%; }
694
+ .hcms-shell .mirk-slider__input {
695
+ position: absolute; inset: 0; width: 100%; height: 100%;
696
+ opacity: 0; cursor: pointer; z-index: 10;
697
+ }
698
+ .hcms-shell .mirk-slider__track {
699
+ position: absolute; left: 0; right: 0; top: 50%; translate: 0 -50%; height: 12px;
700
+ background: var(--mirk-canvas); border: 1px solid var(--mirk-input-border); overflow: hidden;
701
+ }
702
+ .hcms-shell .mirk-slider__fill { height: 100%; width: var(--mirk-value); background: var(--mirk-slider-fill); }
703
+ .hcms-shell .mirk-slider__nub {
704
+ position: absolute; top: 50%; left: var(--mirk-value); translate: -50% -50%;
705
+ width: 21px; height: 21px; pointer-events: none;
706
+ background-color: var(--mirk-slider-nub-bg);
707
+ border: 2px solid;
708
+ border-color: var(--mirk-slider-nub-hi) var(--mirk-slider-nub-lo) var(--mirk-slider-nub-lo) var(--mirk-slider-nub-hi);
709
+ }
710
+ .hcms-shell .mirk-slider__input:focus-visible ~ .mirk-slider__nub {
711
+ outline: 1px solid var(--mirk-focus-color); outline-offset: var(--mirk-focus-offset);
712
+ }
713
+
714
+ .hcms-shell .mirk-slider--round .mirk-slider__track { height: 10px; border-radius: 9999px; }
715
+ .hcms-shell .mirk-slider--round .mirk-slider__nub {
716
+ width: 24px; height: 24px; border: none; border-radius: 9999px;
717
+ background-color: transparent;
718
+ background-image: linear-gradient(to top in oklab, var(--mirk-slider-nub-lo), var(--mirk-slider-nub-hi));
719
+ }
720
+ .hcms-shell .mirk-slider--round .mirk-slider__nub::after {
721
+ content: ""; position: absolute; inset: 2px; border-radius: 9999px; background: var(--mirk-slider-nub-bg);
722
+ }
723
+
724
+ .hcms-shell .mirk-slider--small { height: 24px; }
725
+ .hcms-shell .mirk-slider--small .mirk-slider__track { height: 8px; }
726
+ .hcms-shell .mirk-slider--small .mirk-slider__nub { width: 16px; height: 16px; }
727
+ .hcms-shell .mirk-slider--round.mirk-slider--small .mirk-slider__track { height: 7px; }
728
+ .hcms-shell .mirk-slider--round.mirk-slider--small .mirk-slider__nub { width: 18px; height: 18px; }
729
+
730
+ /* ============================ DATE ============================ */
731
+ .hcms-shell .mirk-date { position: relative; }
732
+ .hcms-shell .mirk-date__field {
733
+ width: 100%; background: var(--mirk-bevel-bg); color: var(--mirk-bevel-fg);
734
+ border: 1px solid var(--mirk-input-border);
735
+ padding: 6px 44px 9px 17px; font: inherit; font-size: 18px; line-height: 1.5;
736
+ border-radius: 0; outline: none;
737
+ }
738
+ .hcms-shell .mirk-date__field:focus-visible {
739
+ outline: 1px solid var(--mirk-focus-color); outline-offset: var(--mirk-focus-offset);
740
+ }
741
+ .hcms-shell .mirk-date__field::-webkit-calendar-picker-indicator {
742
+ opacity: 0; position: absolute; right: 0; top: 0; bottom: 0; width: 44px; margin: 0; cursor: pointer;
743
+ }
744
+ .hcms-shell .mirk-date__field::-webkit-inner-spin-button { -webkit-appearance: none; appearance: none; }
745
+ .hcms-shell .mirk-date__field::-webkit-clear-button { -webkit-appearance: none; appearance: none; }
746
+ .hcms-shell .mirk-date__icon {
747
+ pointer-events: none; position: absolute; right: 16px; top: 50%; translate: 0 -50%;
748
+ }
749
+ .hcms-shell .mirk-date--rounded .mirk-date__field { border-radius: var(--mirk-radius); }
750
+
751
+ .hcms-shell .mirk-date--small .mirk-date__field { padding: 4px 36px 4px 12px; font-size: 14px; }
752
+ .hcms-shell .mirk-date--small .mirk-date__field::-webkit-calendar-picker-indicator { width: 36px; }
753
+ .hcms-shell .mirk-date--small .mirk-date__icon { right: 12px; }
754
+
755
+ /* The native file/image inputs are visually hidden; their styled label drives
756
+ them, and the focus ring rides :has(:focus-visible) on button or container. */
757
+ .hcms-shell .mirk-file__input, .hcms-shell .mirk-image__input {
758
+ position: absolute; width: 1px; height: 1px;
759
+ padding: 0; margin: -1px; overflow: hidden;
760
+ clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;
761
+ }
762
+
763
+ /* ============================ FILE ============================ */
764
+ .hcms-shell .mirk-file { display: flex; align-items: center; gap: 0.75rem; width: 100%; }
765
+ .hcms-shell .mirk-file__name {
766
+ color: var(--mirk-placeholder-color); font-size: 18px; line-height: 1.5;
767
+ min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
768
+ }
769
+ .hcms-shell .mirk-file__name[data-filled] { color: var(--mirk-bevel-fg); }
770
+
771
+ /* Compact: a shared bordered container holds a smaller button + the name. */
772
+ .hcms-shell .mirk-file--compact {
773
+ padding: 4px 8px; background: var(--mirk-bevel-bg);
774
+ border: 1px solid var(--mirk-input-border); border-radius: 0;
775
+ }
776
+ .hcms-shell .mirk-file--compact:has(:focus-visible) {
777
+ outline: 1px solid var(--mirk-focus-color); outline-offset: var(--mirk-focus-offset);
778
+ }
779
+ /* The upload trigger is a .mirk-button; nudge it onto the container's left
780
+ border so the bevel sits flush (covers compact and round-compact). */
781
+ .hcms-shell .mirk-file--compact .mirk-button { margin-left: -1px; }
782
+ .hcms-shell .mirk-file--compact .mirk-file__name { font-size: 16px; }
783
+ .hcms-shell .mirk-file--compact.mirk-file--round { border-radius: 15px; }
784
+
785
+ /* Filled: the name slot becomes a link to the chosen file, beside a circular \xD7
786
+ to clear it: a 1px ring over a bevel fill that turns destructive on hover.
787
+ Empty keeps the placeholder span. */
788
+ .hcms-shell a.mirk-file__name { text-decoration: underline; text-underline-offset: 2px; }
789
+ .hcms-shell .mirk-file__remove {
790
+ appearance: none; -webkit-appearance: none; flex-shrink: 0;
791
+ width: 18px; height: 18px; border-radius: 50%;
792
+ display: inline-flex; align-items: center; justify-content: center;
793
+ margin: 0; padding: 0; cursor: pointer; line-height: 0;
794
+ color: var(--mirk-bevel-fg); background: var(--mirk-bevel-bg);
795
+ border: 1px solid var(--mirk-input-border);
796
+ }
797
+ .hcms-shell .mirk-file__remove svg { display: block; width: 66%; height: 66%; }
798
+ .hcms-shell .mirk-file__remove:hover { border-color: var(--mirk-destructive); color: var(--mirk-destructive); }
799
+
800
+ /* Small: tighter name + gap + remove \xD7; pair the trigger with mirk-button--small.
801
+ Composes with --compact (densest) and --round. */
802
+ .hcms-shell .mirk-file--small { gap: 0.5rem; }
803
+ .hcms-shell .mirk-file--small .mirk-file__name { font-size: 14px; }
804
+ .hcms-shell .mirk-file--small .mirk-file__remove { width: 16px; height: 16px; }
805
+ .hcms-shell .mirk-file--small.mirk-file--compact { padding: 3px 8px; }
806
+ .hcms-shell .mirk-file--small.mirk-file--compact .mirk-file__name { font-size: 13px; }
807
+
808
+ /* ============================ IMAGE ============================ */
809
+ .hcms-shell .mirk-image { display: flex; flex-direction: column; gap: 0.5rem; }
810
+ .hcms-shell .mirk-image__frame {
811
+ position: relative; width: 120px; height: 120px; overflow: hidden; border-radius: 0;
812
+ display: flex; align-items: center; justify-content: center;
813
+ background: var(--mirk-bevel-bg); border: 1px solid var(--mirk-input-border);
814
+ color: var(--mirk-placeholder-color); font-size: 14px; line-height: 1.5;
815
+ }
816
+ .hcms-shell .mirk-image__preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
817
+ .hcms-shell .mirk-image--rounded .mirk-image__frame { border-radius: var(--mirk-radius); }
818
+ /* The upload trigger is a .mirk-button; keep it hugging its label instead of
819
+ stretching to fill this column-flex container. */
820
+ .hcms-shell .mirk-image .mirk-button { width: fit-content; }
821
+
822
+ /* Compact: a focused 56px thumbnail upload. Empty shows a small upload button;
823
+ once an image is chosen the button hides and a thumbnail + corner \xD7 takes its
824
+ place. The frame clips the image (overflow hidden) while the thumb wrapper
825
+ stays visible, so the \xD7 can sit just outside the corner without being cut. */
826
+ .hcms-shell .mirk-image--compact { flex-direction: row; align-items: center; gap: 0; }
827
+ .hcms-shell .mirk-image__thumb { position: relative; display: inline-block; width: fit-content; margin: 0; line-height: 0; }
828
+ .hcms-shell .mirk-image--compact .mirk-image__frame {
829
+ width: 56px; height: 56px; overflow: hidden; border-radius: 0;
830
+ border: 1px solid var(--mirk-input-border);
831
+ }
832
+ .hcms-shell .mirk-image--compact.mirk-image--rounded .mirk-image__frame { border-radius: var(--mirk-radius); }
833
+ .hcms-shell .mirk-image--compact .mirk-image__preview {
834
+ position: static; inset: auto; width: 100%; height: 100%; display: block; object-fit: cover;
835
+ }
836
+ .hcms-shell .mirk-image__remove {
837
+ position: absolute; top: -7px; right: -7px;
838
+ width: 18px; height: 18px; border-radius: 50%; padding: 0;
839
+ display: inline-flex; align-items: center; justify-content: center;
840
+ appearance: none; -webkit-appearance: none; cursor: pointer; line-height: 0;
841
+ color: var(--mirk-bevel-fg); background: var(--mirk-bevel-bg);
842
+ border: 1px solid var(--mirk-input-border);
843
+ }
844
+ .hcms-shell .mirk-image__remove svg { display: block; width: 10px; height: 10px; }
845
+ .hcms-shell .mirk-image__remove:hover { color: var(--mirk-destructive); border-color: var(--mirk-destructive); }
846
+
847
+ /* ============================ TAGS ============================ */
848
+ .hcms-shell .mirk-tags {
849
+ display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.5rem;
850
+ background: var(--mirk-bevel-bg); border: 1px solid var(--mirk-input-border);
851
+ border-radius: 0; cursor: text;
852
+ }
853
+ .hcms-shell .mirk-tags:has(:focus-visible) {
854
+ outline: 1px solid var(--mirk-focus-color); outline-offset: var(--mirk-focus-offset);
855
+ }
856
+ .hcms-shell .mirk-tags__chip {
857
+ display: inline-flex; align-items: center; gap: 0.5rem;
858
+ padding: 2px 8px 2px 12px; font-size: 14px; line-height: 1.5;
859
+ color: var(--mirk-bevel-fg); background: var(--mirk-bevel-bg);
860
+ border: 2px solid;
861
+ border-color: var(--mirk-bevel-tl) var(--mirk-bevel-br) var(--mirk-bevel-br) var(--mirk-bevel-tl);
862
+ }
863
+ .hcms-shell .mirk-tags__remove {
864
+ appearance: none; -webkit-appearance: none;
865
+ margin: 0; padding: 0; border: 0; background: none; color: inherit;
866
+ cursor: pointer; font-size: 14px; line-height: 1;
867
+ }
868
+ .hcms-shell .mirk-tags__remove:hover { color: var(--mirk-destructive); }
869
+ .hcms-shell .mirk-tags__input {
870
+ appearance: none; -webkit-appearance: none;
871
+ border: 0; padding: 0;
872
+ flex: 1; min-width: 120px; background: transparent; color: var(--mirk-bevel-fg);
873
+ outline: none; font-size: 18px; line-height: 1.5;
874
+ }
875
+ .hcms-shell .mirk-tags__input::placeholder { color: var(--mirk-placeholder-color); }
876
+
877
+ .hcms-shell .mirk-tags--round { border-radius: 15px; }
878
+ .hcms-shell .mirk-tags--round .mirk-tags__chip {
879
+ padding: 2px; border: none; border-radius: 12px;
880
+ background-color: transparent;
881
+ background-image: linear-gradient(to top in oklab, var(--mirk-bevel-br), var(--mirk-bevel-tl));
882
+ }
883
+ .hcms-shell .mirk-tags__chip-inner {
884
+ display: inline-flex; align-items: center; gap: 0.5rem;
885
+ padding: 1px 8px 1px 12px; border-radius: 10px;
886
+ color: var(--mirk-bevel-fg); background-color: var(--mirk-bevel-bg);
887
+ background-image: linear-gradient(to top in oklab, var(--mirk-bevel-bg), var(--mirk-pill-inner-top));
888
+ }
889
+
890
+ .hcms-shell .mirk-tags--small { gap: 0.375rem; padding: 0.375rem; }
891
+ .hcms-shell .mirk-tags--small .mirk-tags__chip { padding: 1px 6px 1px 10px; font-size: 12px; }
892
+ .hcms-shell .mirk-tags--small .mirk-tags__remove { font-size: 12px; }
893
+ .hcms-shell .mirk-tags--small .mirk-tags__input { font-size: 14px; min-width: 90px; }
894
+ .hcms-shell .mirk-tags--small.mirk-tags--round { border-radius: 12px; }
895
+ .hcms-shell .mirk-tags--small.mirk-tags--round .mirk-tags__chip-inner { padding: 1px 6px 1px 10px; }
896
+
897
+ /* ============================ SORTABLE ============================ */
898
+ .hcms-shell .mirk-sortable { display: flex; flex-direction: column; gap: 0.5rem; }
899
+ .hcms-shell .mirk-sortable__item {
900
+ display: flex; flex-direction: row; width: 100%;
901
+ background: var(--mirk-bevel-bg); border: 1px solid var(--mirk-input-border);
902
+ }
903
+ .hcms-shell .mirk-sortable__grip {
904
+ width: 28px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
905
+ cursor: grab; border-right: 1px solid var(--mirk-input-border);
906
+ }
907
+ .hcms-shell .mirk-sortable__grip:active { cursor: grabbing; }
908
+ .hcms-shell .mirk-sortable__dots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; }
909
+ .hcms-shell .mirk-sortable__dot {
910
+ display: block; width: 4px; height: 4px; background: var(--mirk-sortable-dot);
911
+ box-shadow: 1px 0 0 0 var(--mirk-sortable-shadow), 0 1px 0 0 var(--mirk-sortable-shadow), 1px 1px 0 0 var(--mirk-sortable-shadow);
912
+ }
913
+ .hcms-shell .mirk-sortable__body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
914
+ .hcms-shell .mirk-sortable__row { padding: 8px 17px 9px; }
915
+ .hcms-shell .mirk-sortable__row:not(:last-child) { border-bottom: 1px solid var(--mirk-input-border); }
916
+ .hcms-shell .mirk-sortable__label {
917
+ display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.2em;
918
+ margin-bottom: 2px; color: var(--mirk-sortable-label);
919
+ }
920
+ .hcms-shell .mirk-sortable__field {
921
+ width: 100%; background: transparent; color: var(--mirk-bevel-fg);
922
+ font-size: 18px; line-height: 1.5; outline: none;
923
+ }
924
+ .hcms-shell .mirk-sortable__field::placeholder { color: var(--mirk-sortable-placeholder); }
925
+ .hcms-shell .mirk-sortable__field:focus-visible {
926
+ outline: 1px solid var(--mirk-focus-color); outline-offset: var(--mirk-focus-offset);
927
+ }
928
+ .hcms-shell .mirk-sortable--small { gap: 0.375rem; }
929
+ .hcms-shell .mirk-sortable--small .mirk-sortable__grip { width: 24px; }
930
+ .hcms-shell .mirk-sortable--small .mirk-sortable__row { padding: 5px 13px 6px; }
931
+ .hcms-shell .mirk-sortable--small .mirk-sortable__label { font-size: 10px; margin-bottom: 1px; }
932
+ .hcms-shell .mirk-sortable--small .mirk-sortable__field { font-size: 14px; }
933
+
934
+ /* ============================ CHIP ============================ */
935
+ /* A collapsible recovery/notification: a round pill that expands into a RAISED
936
+ panel \u2014 the kit's one elevated surface (a distinct --mirk-bg face, a hairline
937
+ outline, and a soft drop shadow, the only shadow in the kit, reserved for this
938
+ raised tier). State lives in classes (--open, is-changes) so it round-trips via
939
+ outerHTML; mirk.js only flips them on click. Color reads from generic kit
940
+ tokens through 5 slim --mirk-chip-* hooks, so it matches the kit and reskins by
941
+ overriding a hook, not a rule. In a Hyperclay app, add \`save-remove\` to the
942
+ block so a transient prompt never persists into the saved file. */
943
+ .hcms-shell .mirk-chip { display: inline-flex; flex-direction: column; align-items: flex-start; }
944
+ .hcms-shell .mirk-chip__panel { display: none; }
945
+ .hcms-shell .mirk-chip--open .mirk-chip__trigger { display: none; }
946
+ .hcms-shell .mirk-chip--open .mirk-chip__panel { display: flex; }
947
+
948
+ /* Collapsed chip \u2014 a round mirk-button pill (mirk-button--round in the markup),
949
+ the alert glyph seated in the label, so it reads as a distinct affordance, not
950
+ a flat button. A soft, tight lift sets it above the page; deeper on a dark
951
+ canvas (same media + forced-mode pattern as the panel shadow below). */
952
+ .hcms-shell .mirk-chip__trigger .mirk-button__label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
953
+ .hcms-shell .mirk-chip__trigger { box-shadow: 0 6px 14px -8px rgba(43, 36, 27, 0.5), 0 2px 5px -3px rgba(43, 36, 27, 0.32); }
954
+ @media (prefers-color-scheme: dark) { .hcms-shell .mirk-chip__trigger { box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.6), 0 2px 6px -3px rgba(0, 0, 0, 0.5); } }
955
+ .hcms-shell.light .mirk-chip__trigger, .hcms-shell[data-theme="light"] .mirk-chip__trigger { box-shadow: 0 6px 14px -8px rgba(43, 36, 27, 0.5), 0 2px 5px -3px rgba(43, 36, 27, 0.32); }
956
+ .hcms-shell.dark .mirk-chip__trigger, .hcms-shell[data-theme="dark"] .mirk-chip__trigger { box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.6), 0 2px 6px -3px rgba(0, 0, 0, 0.5); }
957
+ /* Drive the warning fill from CSS, not an SVG fill="var(...)" presentation
958
+ attribute (var() is not reliably honored there). */
959
+ .hcms-shell .mirk-chip__warn { fill: var(--mirk-chip-alert); }
960
+ .hcms-shell .mirk-chip__trigger .mirk-chip__warn { vertical-align: -2px; }
961
+
962
+ /* The panel \u2014 the raised surface: a --mirk-bg face over the page, a hairline
963
+ outline, a soft drop shadow. */
964
+ .hcms-shell .mirk-chip__panel {
965
+ width: 300px; max-width: calc(100vw - 44px);
966
+ background: var(--mirk-chip-surface); color: var(--mirk-fg);
967
+ border: 1px solid var(--mirk-chip-edge); border-radius: var(--mirk-radius);
968
+ box-shadow: 0 20px 50px -30px rgba(43, 36, 27, 0.6);
969
+ padding: 14px 15px 13px; flex-direction: column; gap: 12px;
970
+ }
971
+ /* The panel's larger drop (the collapsed pill above carries a tighter one); deepen
972
+ both on a dark canvas. Mirrors the --focus-offset pattern: a media default for
973
+ the OS, plus explicit forced-mode overrides. */
974
+ @media (prefers-color-scheme: dark) { .hcms-shell .mirk-chip__panel { box-shadow: 0 20px 52px -26px rgba(0, 0, 0, 0.78); } }
975
+ .hcms-shell.light .mirk-chip__panel, .hcms-shell[data-theme="light"] .mirk-chip__panel { box-shadow: 0 20px 50px -30px rgba(43, 36, 27, 0.6); }
976
+ .hcms-shell.dark .mirk-chip__panel, .hcms-shell[data-theme="dark"] .mirk-chip__panel { box-shadow: 0 20px 52px -26px rgba(0, 0, 0, 0.78); }
977
+
978
+ /* Head \u2014 icon, text, collapse glyph. */
979
+ .hcms-shell .mirk-chip__head { display: flex; gap: 10px; align-items: flex-start; }
980
+ .hcms-shell .mirk-chip__icon { flex-shrink: 0; line-height: 0; margin-top: 1px; }
981
+ .hcms-shell .mirk-chip__headtext { min-width: 0; }
982
+ .hcms-shell .mirk-chip__eyebrow {
983
+ font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.2em;
984
+ color: var(--mirk-placeholder-color); margin-bottom: 3px;
985
+ }
986
+ .hcms-shell .mirk-chip__title { margin: 0; font-size: 13px; font-weight: 400; line-height: 1.3; color: var(--mirk-fg); }
987
+ .hcms-shell .mirk-chip__collapse {
988
+ margin-left: auto; flex-shrink: 0; width: 24px; height: 24px;
989
+ display: inline-flex; align-items: center; justify-content: center;
990
+ background: none; border: 0; cursor: pointer; padding: 0;
991
+ color: var(--mirk-placeholder-color);
992
+ }
993
+ .hcms-shell .mirk-chip__collapse:hover { color: var(--mirk-fg); }
994
+ .hcms-shell .mirk-chip__collapse svg { display: block; }
995
+
996
+ /* Meta line. */
997
+ .hcms-shell .mirk-chip__meta { font-size: 11px; letter-spacing: 0.04em; color: var(--mirk-placeholder-color); }
998
+ .hcms-shell .mirk-chip__changes-toggle {
999
+ background: none; border: 0; cursor: pointer; font: inherit; font-size: 11px; padding: 0 0 0 4px;
1000
+ color: var(--mirk-placeholder-color); text-decoration: underline; text-underline-offset: 2px;
1001
+ }
1002
+ .hcms-shell .mirk-chip__changes-toggle:hover { color: var(--mirk-fg); }
1003
+
1004
+ /* Before/after field table \u2014 a recessed stack, revealed by the changes toggle. */
1005
+ .hcms-shell .mirk-chip__preview {
1006
+ display: none; flex-direction: column; gap: 11px;
1007
+ background: var(--mirk-bevel-bg); border: 1px solid var(--mirk-chip-edge);
1008
+ padding: 10px 11px;
1009
+ }
1010
+ .hcms-shell .mirk-chip__panel.is-changes .mirk-chip__preview { display: flex; }
1011
+ .hcms-shell .mirk-chip__row { display: flex; flex-direction: column; gap: 2px; }
1012
+ .hcms-shell .mirk-chip__key {
1013
+ font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.1em;
1014
+ color: var(--mirk-placeholder-color);
1015
+ }
1016
+ .hcms-shell .mirk-chip__old, .hcms-shell .mirk-chip__new { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
1017
+ .hcms-shell .mirk-chip__old { font-size: 11px; color: var(--mirk-chip-alert); text-decoration: line-through; opacity: 0.85; }
1018
+ .hcms-shell .mirk-chip__new { font-size: 12px; color: var(--mirk-fg); }
1019
+
1020
+ /* Action stack \u2014 full-width buttons by weight: an embossed primary, a plain bevel
1021
+ revert, a quiet (--quiet) dismiss. */
1022
+ .hcms-shell .mirk-chip__actions { display: flex; flex-direction: column; gap: 8px; margin-top: 1px; }
1023
+ .hcms-shell .mirk-chip__actions .mirk-button { width: 100%; }
1024
+ /* Primary action \u2014 a genuine kit bevel button whose bevel palette is derived from
1025
+ the chip's primary fill (lighter top-left, darker bottom-right), so it embosses
1026
+ on any color. The base .mirk-button rules then drive its border, hover, and the
1027
+ :active flip, identical to the kit's other buttons. */
1028
+ .hcms-shell .mirk-chip__actions .mirk-chip__action--primary {
1029
+ --mirk-bevel-bg: var(--mirk-chip-primary-bg);
1030
+ --mirk-bevel-fg: var(--mirk-chip-primary-fg);
1031
+ --mirk-bevel-tl: color-mix(in srgb, var(--mirk-chip-primary-bg), white 24%);
1032
+ --mirk-bevel-br: color-mix(in srgb, var(--mirk-chip-primary-bg), black 32%);
1033
+ --mirk-bevel-hover-bg: color-mix(in srgb, var(--mirk-chip-primary-bg), white 10%);
1034
+ }
1035
+
1036
+ /* ============================ FIELD ============================ */
1037
+ /* Label + control + hint as one unit, so a form composes without utilities
1038
+ (and without needing the mirk-page rhythm). Any control drops in; the gap
1039
+ matches the page scaffold's label/hint hug. Consecutive fields space
1040
+ themselves. */
1041
+ .hcms-shell .mirk-field { display: flex; flex-direction: column; gap: 6px; }
1042
+ .hcms-shell .mirk-field__label { font-size: 16px; line-height: 1.5; }
1043
+ .hcms-shell .mirk-field + .mirk-field { margin-block-start: 18px; }
1044
+ .hcms-shell .mirk-field--small .mirk-field__label { font-size: 14px; }
1045
+
1046
+ /* An alert hint inside a field stays hidden until a control in the field
1047
+ goes :user-invalid \u2014 a zero-JS native-validation message. Show one
1048
+ unconditionally (a server-side error) by placing it outside the field or
1049
+ overriding display. */
1050
+ .hcms-shell .mirk-field .mirk-hint--alert { display: none; }
1051
+ .hcms-shell .mirk-field:has(:user-invalid) .mirk-hint--alert { display: block; }
1052
+
1053
+ /* ============================ INVALID ============================ */
1054
+ /* Native constraint validation, styled. :user-invalid fires only after the
1055
+ user interacts (unlike :invalid, which would paint required fields red on
1056
+ load). A flat destructive border is the 0012 stateful read; the focus ring
1057
+ stays the focus signal. Pair the message with mirk-hint--alert. */
1058
+ .hcms-shell .mirk-input:user-invalid, .hcms-shell .mirk-textarea:user-invalid, .hcms-shell .mirk-date__field:user-invalid, .hcms-shell .mirk-select__field:user-invalid, .hcms-shell .mirk-number:has(.mirk-number__input:user-invalid) {
1059
+ border-color: var(--mirk-destructive);
1060
+ }
1061
+ .hcms-shell .mirk-checkbox:has(:user-invalid) .mirk-checkbox__box, .hcms-shell .mirk-toggle:has(:user-invalid) .mirk-toggle__track {
1062
+ border-color: var(--mirk-destructive);
1063
+ }
1064
+ /* The unchecked ring is a borderless gradient pill; invalid swaps it for a
1065
+ flat destructive ring (the fill pill still seats inside). */
1066
+ .hcms-shell .mirk-radio:has(:user-invalid) .mirk-radio__ring {
1067
+ background-image: none;
1068
+ border: 2px solid var(--mirk-destructive);
1069
+ }
1070
+
1071
+ /* ============================ PROGRESS ============================ */
1072
+ /* A native <progress> in the slider's clothes: the canvas channel, the
1073
+ slider-fill value bar. --blocks segments the fill into pixel blocks.
1074
+ Keep the -webkit and -moz rules separate \u2014 an unrecognized pseudo-element
1075
+ invalidates the whole selector list. */
1076
+ .hcms-shell .mirk-progress {
1077
+ appearance: none; -webkit-appearance: none;
1078
+ display: block; width: 100%; height: 12px;
1079
+ border: 1px solid var(--mirk-input-border);
1080
+ background: var(--mirk-canvas);
1081
+ }
1082
+ .hcms-shell .mirk-progress::-webkit-progress-bar { background: transparent; }
1083
+ .hcms-shell .mirk-progress::-webkit-progress-value { background: var(--mirk-slider-fill); }
1084
+ .hcms-shell .mirk-progress::-moz-progress-bar { background: var(--mirk-slider-fill); }
1085
+ .hcms-shell .mirk-progress--small { height: 8px; }
1086
+ .hcms-shell .mirk-progress--round { border-radius: 9999px; overflow: hidden; }
1087
+ .hcms-shell .mirk-progress--blocks::-webkit-progress-value {
1088
+ background: repeating-linear-gradient(to right,
1089
+ var(--mirk-slider-fill) 0 8px, transparent 8px 11px);
1090
+ }
1091
+ .hcms-shell .mirk-progress--blocks::-moz-progress-bar {
1092
+ background: repeating-linear-gradient(to right,
1093
+ var(--mirk-slider-fill) 0 8px, transparent 8px 11px);
1094
+ }
1095
+
1096
+ /* ============================ NOTE ============================ */
1097
+ /* An informational callout. Flat on purpose: bevel means pressable in this
1098
+ kit (0012) and a note is content, so it gets the 1px content border over
1099
+ the recessed face, never the raised edge. The 4px left edge carries the
1100
+ status: neutral ink by default, destructive on --alert. */
1101
+ .hcms-shell .mirk-note {
1102
+ display: flex; flex-direction: column; gap: 4px;
1103
+ background: var(--mirk-bevel-bg);
1104
+ border: 1px solid var(--mirk-input-border);
1105
+ border-left: 4px solid var(--mirk-mark-fg);
1106
+ padding: 10px 14px 11px;
1107
+ font-size: 14px; line-height: 1.5;
1108
+ }
1109
+ .hcms-shell .mirk-note__title {
1110
+ font-size: 11px; text-transform: uppercase; letter-spacing: 0.2em;
1111
+ color: var(--mirk-mark-fg);
1112
+ }
1113
+ .hcms-shell .mirk-note__body { color: var(--mirk-fg); }
1114
+ .hcms-shell .mirk-note--alert { border-left-color: var(--mirk-destructive); }
1115
+ .hcms-shell .mirk-note--alert .mirk-note__title { color: var(--mirk-destructive); }
1116
+ .hcms-shell .mirk-note--rounded { border-radius: var(--mirk-radius); }
1117
+
1118
+ /* ============================ HINT ============================ */
1119
+ /* Small print under a field: neutral help text, or --alert validation text. */
1120
+ .hcms-shell .mirk-hint { margin: 0; font-size: 13px; line-height: 1.5; color: var(--mirk-placeholder-color); }
1121
+ .hcms-shell .mirk-hint--alert { color: var(--mirk-destructive); }
1122
+
1123
+ /* ============================ LIST ============================ */
1124
+ /* Content bullets. <ul> gets a square pixel dot (the sortable dot's idiom,
1125
+ one step larger); a nested <ul> hollows it. <ol> gets zero-padded counters
1126
+ in the muted label ink. Styles the bare <li> by descent, like the platform. */
1127
+ .hcms-shell .mirk-list {
1128
+ list-style: none; margin: 0; padding: 0;
1129
+ display: flex; flex-direction: column; gap: 6px;
1130
+ font-size: 16px; line-height: 1.5;
1131
+ }
1132
+ .hcms-shell .mirk-list li { position: relative; padding-left: 22px; }
1133
+ .hcms-shell ul.mirk-list > li::before {
1134
+ content: ""; position: absolute; left: 2px; top: 0.55em;
1135
+ width: 6px; height: 6px; background: var(--mirk-mark-fg);
1136
+ box-shadow: 1px 1px 0 0 var(--mirk-sortable-shadow);
1137
+ }
1138
+ .hcms-shell ol.mirk-list { counter-reset: mirk-li; }
1139
+ .hcms-shell ol.mirk-list > li { counter-increment: mirk-li; padding-left: 38px; }
1140
+ .hcms-shell ol.mirk-list > li::before {
1141
+ content: counter(mirk-li, decimal-leading-zero) ".";
1142
+ position: absolute; left: 0; top: 0;
1143
+ color: var(--mirk-sortable-label);
1144
+ }
1145
+
1146
+ /* One nested level: hollow square, same stack. */
1147
+ .hcms-shell .mirk-list ul {
1148
+ list-style: none; margin: 6px 0 0; padding: 0;
1149
+ display: flex; flex-direction: column; gap: 6px;
1150
+ }
1151
+ .hcms-shell .mirk-list ul > li::before {
1152
+ content: ""; position: absolute; left: 2px; top: 0.55em;
1153
+ width: 6px; height: 6px; background: transparent;
1154
+ border: 1.5px solid var(--mirk-mark-fg); box-shadow: none;
1155
+ }
1156
+
1157
+ .hcms-shell .mirk-list--small { font-size: 14px; gap: 4px; }
1158
+ .hcms-shell .mirk-list--small li { padding-left: 18px; }
1159
+ .hcms-shell ul.mirk-list--small > li::before, .hcms-shell .mirk-list--small ul > li::before { width: 5px; height: 5px; }
1160
+ .hcms-shell ol.mirk-list--small > li { padding-left: 32px; }
1161
+
1162
+ /* ============================ BADGE ============================ */
1163
+ /* A static tag label \u2014 the display counterpart to the mirk-tags input. Flat
1164
+ on purpose: bevel means pressable (0012), a badge is content. */
1165
+ .hcms-shell .mirk-badge {
1166
+ display: inline-flex; align-items: center; gap: 0.375rem;
1167
+ padding: 1px 8px 2px; font-size: 12px; line-height: 1.5;
1168
+ color: var(--mirk-fg); background: var(--mirk-bevel-bg);
1169
+ border: 1px solid var(--mirk-input-border);
1170
+ white-space: nowrap; vertical-align: middle;
1171
+ }
1172
+ .hcms-shell .mirk-badge--accent { background: var(--mirk-accent); }
1173
+ .hcms-shell .mirk-badge--round { border-radius: 9999px; padding: 1px 10px 2px; }
1174
+ .hcms-shell .mirk-badge--alert { color: var(--mirk-destructive); border-color: var(--mirk-destructive); }
1175
+
1176
+ /* ============================ TABLE ============================ */
1177
+ /* A flat data surface: the content face in a 1px frame, header cells in the
1178
+ eyebrow register, hairline row dividers. Semantic <table> styled by
1179
+ descent \u2014 no per-cell classes. The header/stripe tints ride color-mix
1180
+ toward the ink so they stay visible in every palette (Pixel Quiet's
1181
+ canvas and face are nearly the same value). Wrap in an overflow-x:auto
1182
+ div when the table can outgrow its column. */
1183
+ .hcms-shell .mirk-table {
1184
+ width: 100%; border-collapse: collapse;
1185
+ background: var(--mirk-bevel-bg);
1186
+ border: 1px solid var(--mirk-input-border);
1187
+ font-size: 14px; line-height: 1.5;
1188
+ }
1189
+ .hcms-shell .mirk-table th {
1190
+ text-align: left; font-weight: 400;
1191
+ font-size: 11px; text-transform: uppercase; letter-spacing: 0.15em;
1192
+ color: var(--mirk-placeholder-color);
1193
+ background: color-mix(in srgb, var(--mirk-bevel-bg), var(--mirk-fg) 4%);
1194
+ padding: 7px 14px;
1195
+ border-bottom: 1px solid var(--mirk-input-border);
1196
+ }
1197
+ .hcms-shell .mirk-table td {
1198
+ padding: 8px 14px;
1199
+ border-bottom: 1px solid var(--mirk-input-border);
1200
+ vertical-align: top;
1201
+ }
1202
+ .hcms-shell .mirk-table tbody tr:last-child td { border-bottom: 0; }
1203
+ .hcms-shell .mirk-table--striped tbody tr:nth-child(even) td {
1204
+ background: color-mix(in srgb, var(--mirk-bevel-bg), var(--mirk-fg) 3%);
1205
+ }
1206
+ .hcms-shell .mirk-table--small { font-size: 13px; }
1207
+ .hcms-shell .mirk-table--small th { padding: 5px 12px; font-size: 10px; }
1208
+ .hcms-shell .mirk-table--small td { padding: 5px 12px; }
1209
+
1210
+ /* ============================ PAGE ============================ */
1211
+ /* The quickstart shell: mirk-page on <body> (or any wrapper) gives a centered
1212
+ column + typographic defaults, so two CDN tags and one class boot a full
1213
+ page. Every rule rides :where() (zero specificity): any utility, component
1214
+ class, or consumer rule beats it. Flow rhythm targets direct children only,
1215
+ so margins never leak inside component internals. */
1216
+ .hcms-shell .mirk-page { max-width: 640px; margin-inline: auto; padding: 48px 24px 96px; }
1217
+ .hcms-shell .mirk-page--wide { max-width: 960px; }
1218
+
1219
+ /* Departure Mono ships one weight \u2014 hierarchy comes from size, never bold. */
1220
+ .hcms-shell .mirk-page :where(h1, h2, h3, h4) { margin: 0; font-weight: 400; line-height: 1.15; }
1221
+ .hcms-shell .mirk-page :where(h1) { font-size: 40px; }
1222
+ .hcms-shell .mirk-page :where(h2) { font-size: 26px; }
1223
+ .hcms-shell .mirk-page :where(h3) { font-size: 20px; }
1224
+ .hcms-shell .mirk-page :where(h4) { font-size: 16px; }
1225
+ .hcms-shell .mirk-page :where(p) { margin: 0; font-size: 16px; line-height: 1.6; }
1226
+
1227
+ .hcms-shell .mirk-page :where(a) { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
1228
+ .hcms-shell .mirk-page :where(code, kbd) {
1229
+ font-size: 0.875em; padding: 1px 4px;
1230
+ background: var(--mirk-bevel-bg); border: 1px solid var(--mirk-input-border);
1231
+ }
1232
+ .hcms-shell .mirk-page :where(pre) {
1233
+ margin: 0; padding: 12px 14px; font-size: 13px; line-height: 1.5; overflow-x: auto;
1234
+ background: var(--mirk-bevel-bg); border: 1px solid var(--mirk-input-border);
1235
+ }
1236
+ .hcms-shell .mirk-page :where(pre code) { padding: 0; border: 0; background: none; font-size: inherit; }
1237
+ .hcms-shell .mirk-page :where(hr) { border: 0; border-top: 1px solid var(--mirk-input-border); }
1238
+
1239
+ /* Flow rhythm \u2014 direct children only; headings open sections, eyebrows and
1240
+ hints hug their neighbors. Equal specificity, so source order settles ties. */
1241
+ .hcms-shell .mirk-page > :where(* + *) { margin-block-start: 14px; }
1242
+ .hcms-shell .mirk-page > :where(h1, h2, h3, h4):where(* + *) { margin-block-start: 40px; }
1243
+ .hcms-shell .mirk-page > :where(.mirk-eyebrow + *), .hcms-shell .mirk-page > :where(* + .mirk-hint) { margin-block-start: 6px; }
1244
+
1245
+ /* ============================ EYEBROW ============================ */
1246
+ /* The kit's signature section label, as a shippable class. Block so it works
1247
+ the same on <p>, <label>, or <div>, and flow margins always apply. */
1248
+ .hcms-shell .mirk-eyebrow {
1249
+ display: block; margin: 0;
1250
+ font-size: 11px; text-transform: uppercase; letter-spacing: 0.2em;
1251
+ color: var(--mirk-placeholder-color);
1252
+ }
1253
+ }
1254
+
1255
+ /* Respect the machine \u2014 outside @layer components so it always wins. */
1256
+ @media (prefers-reduced-motion: reduce) {
1257
+ .hcms-shell .mirk-button--round, .hcms-shell .mirk-toggle__thumb { transition: none; }
1258
+ .hcms-shell .mirk-button:active .mirk-button__label { translate: none; }
1259
+ }
1260
+ @media (forced-colors: active) {
1261
+ .hcms-shell .mirk-button, .hcms-shell .mirk-select__field, .hcms-shell .mirk-checkbox__box, .hcms-shell .mirk-toggle__track { border: 1px solid ButtonText; }
1262
+ }
1263
+
1264
+ /* ===== pixel-quiet overrides (hypercms-owned) ===== */
1265
+ /* =====================================================================
1266
+ Pixel Quiet \u2014 hypercms theme overrides (hypercms-owned).
1267
+
1268
+ Adapted from ARCHIVE_PROJECTS/cms-sidebar/pixel-quiet/overrides.css. Two jobs:
1269
+ 1. Retune --mirk-* tokens, scoped to .hcms-shell.pixel-quiet (never :root).
1270
+ 2. Author the panel geometry + the functional chrome the static mockup
1271
+ doesn't have (error banner, add/remove/move controls, the engine's
1272
+ sortable cards, push / overlay / left-dock modes) on top of the
1273
+ .hcms-* structural hooks.
1274
+
1275
+ This file is concatenated AFTER the scoped mirk base+components by
1276
+ scripts/build-theme.js, so plain rules here win over mirk's @layer
1277
+ components with zero !important. Loaded only inside .hcms-shell, so nothing
1278
+ here leaks onto the host page.
1279
+ ===================================================================== */
1280
+
1281
+ /* ============================================================
1282
+ TOKEN RETUNE \u2014 LIGHT (warm cream, gentle near-equal bevel)
1283
+ ============================================================ */
1284
+ .hcms-shell.pixel-quiet {
1285
+ color-scheme: light;
1286
+ --mirk-canvas: #F7F2EA;
1287
+ --mirk-bg: #F7F2EA;
1288
+ --mirk-fg: #2B241B;
1289
+ --mirk-accent: #efefe5;
1290
+ --mirk-destructive: #C24A3A;
1291
+ --mirk-focus-color: #C7AE93;
1292
+
1293
+ --mirk-bevel-bg: #FCF8F1;
1294
+ --mirk-bevel-fg: #2B241B;
1295
+ --mirk-bevel-tl: #F0E7D8;
1296
+ --mirk-bevel-br: #E2D4BF;
1297
+ --mirk-bevel-hover-bg: #F4ECDF;
1298
+ --mirk-pill-inner-top: #FBF6EE;
1299
+ --mirk-input-border: #D8C8AF;
1300
+ --mirk-placeholder-color: #A8987F;
1301
+
1302
+ --mirk-mark-fg: #6B5942;
1303
+ --mirk-toggle-bg: #EFDBBD;
1304
+ --mirk-toggle-hi: #F4EADA;
1305
+ --mirk-toggle-lo: #C2A87E;
1306
+ --mirk-sortable-dot: #DDCBB0;
1307
+ --mirk-sortable-shadow: #C9B493;
1308
+ --mirk-sortable-label: #8C7B62;
1309
+ --mirk-sortable-placeholder: #A8987F;
1310
+
1311
+ --mirk-radius: 5px;
1312
+ --mirk-focus-offset: 2px;
1313
+ }
1314
+
1315
+ /* dark token deltas, shared by the explicit .dark opt-in and OS preference */
1316
+ .hcms-shell.pixel-quiet.dark,
1317
+ .hcms-shell.pixel-quiet[data-theme="dark"] {
1318
+ color-scheme: dark;
1319
+ --mirk-canvas: #0B0C13;
1320
+ --mirk-bg: #11131E;
1321
+ --mirk-fg: #ECEAF2;
1322
+ --mirk-accent: #1D1F2F;
1323
+ --mirk-focus-color: #4A506B;
1324
+
1325
+ --mirk-bevel-bg: #1A1D2C;
1326
+ --mirk-bevel-fg: #ECEAF2;
1327
+ --mirk-bevel-tl: #2A2E42;
1328
+ --mirk-bevel-br: #14182A;
1329
+ --mirk-bevel-hover-bg: #202436;
1330
+ --mirk-pill-inner-top: #202436;
1331
+ --mirk-input-border: #353B52;
1332
+ --mirk-placeholder-color: #6A7090;
1333
+
1334
+ --mirk-mark-fg: #C9CDE0;
1335
+ --mirk-toggle-bg: #3E4660;
1336
+ --mirk-toggle-hi: #4E567A;
1337
+ --mirk-toggle-lo: #262B42;
1338
+ --mirk-sortable-dot: #353B52;
1339
+ --mirk-sortable-shadow: #0E1120;
1340
+ --mirk-sortable-label: #8A90AB;
1341
+ --mirk-sortable-placeholder: #6A7090;
1342
+ }
1343
+
1344
+ /* Auto-dark on OS preference, unless the shell pins light with .light */
1345
+ @media (prefers-color-scheme: dark) {
1346
+ .hcms-shell.pixel-quiet:not(.light):not([data-theme="light"]) {
1347
+ color-scheme: dark;
1348
+ --mirk-canvas: #0B0C13;
1349
+ --mirk-bg: #11131E;
1350
+ --mirk-fg: #ECEAF2;
1351
+ --mirk-accent: #1D1F2F;
1352
+ --mirk-focus-color: #4A506B;
1353
+
1354
+ --mirk-bevel-bg: #1A1D2C;
1355
+ --mirk-bevel-fg: #ECEAF2;
1356
+ --mirk-bevel-tl: #2A2E42;
1357
+ --mirk-bevel-br: #14182A;
1358
+ --mirk-bevel-hover-bg: #202436;
1359
+ --mirk-pill-inner-top: #202436;
1360
+ --mirk-input-border: #353B52;
1361
+ --mirk-placeholder-color: #6A7090;
1362
+
1363
+ --mirk-mark-fg: #C9CDE0;
1364
+ --mirk-toggle-bg: #3E4660;
1365
+ --mirk-toggle-hi: #4E567A;
1366
+ --mirk-toggle-lo: #262B42;
1367
+ --mirk-sortable-dot: #353B52;
1368
+ --mirk-sortable-shadow: #0E1120;
1369
+ --mirk-sortable-label: #8A90AB;
1370
+ --mirk-sortable-placeholder: #6A7090;
1371
+ }
1372
+ }
1373
+
1374
+ /* ============================================================
1375
+ SHELL GEOMETRY \u2014 fixed, docked panel, single column.
1376
+ position: fixed makes the shell a containing block so the absolute
1377
+ minibar anchors to it; flex column so the body owns the scroll.
1378
+ ============================================================ */
1379
+ .hcms-shell.pixel-quiet.hcms-panel {
1380
+ box-sizing: border-box;
1381
+ position: fixed;
1382
+ top: 0;
1383
+ right: 0;
1384
+ bottom: 0;
1385
+ width: var(--hcms-shell-width, 380px);
1386
+ max-width: 100vw;
1387
+ z-index: 2147483000;
1388
+ display: flex;
1389
+ flex-direction: column;
1390
+ color: var(--mirk-fg);
1391
+ background: var(--mirk-bg);
1392
+ border-left: 1px solid var(--mirk-input-border);
1393
+ box-shadow: -16px 0 48px -28px rgba(43, 36, 27, 0.45);
1394
+ }
1395
+ .hcms-shell.pixel-quiet.hcms-panel.dark {
1396
+ box-shadow: -16px 0 48px -28px rgba(0, 0, 0, 0.6);
1397
+ }
1398
+
1399
+ .hcms-shell.pixel-quiet.hcms-side-left {
1400
+ right: auto;
1401
+ left: 0;
1402
+ border-left: 0;
1403
+ border-right: 1px solid var(--mirk-input-border);
1404
+ box-shadow: 16px 0 48px -28px rgba(43, 36, 27, 0.45);
1405
+ }
1406
+
1407
+ /* Push the page over so docked content is never hidden underneath. */
1408
+ body.hcms-open { --hcms-shell-width: 380px; }
1409
+ body.hcms-open:not(.hcms-overlay) { padding-right: var(--hcms-shell-width); }
1410
+ body.hcms-open.hcms-side-left:not(.hcms-overlay) { padding-right: 0; padding-left: var(--hcms-shell-width); }
1411
+ body.hcms-open.hcms-overlay { overflow: hidden; }
1412
+
1413
+ @media (max-width: 799px) {
1414
+ body.hcms-open { --hcms-shell-width: 100vw; }
1415
+ body.hcms-open:not(.hcms-overlay),
1416
+ body.hcms-open.hcms-side-left:not(.hcms-overlay) { padding-right: 0; padding-left: 0; }
1417
+ body.hcms-open { overflow: hidden; }
1418
+ }
1419
+
1420
+ /* ---------- SCROLL REGION \u2014 holds the (scrollable) header + form + save ---------- */
1421
+ .hcms-shell-body {
1422
+ flex: 1;
1423
+ min-height: 0;
1424
+ overflow-y: auto;
1425
+ }
1426
+
1427
+ /* ---------- CONDENSED MINIBAR \u2014 appears once the full header scrolls away ---------- */
1428
+ .hcms-shell-minibar {
1429
+ position: absolute;
1430
+ top: 0;
1431
+ left: 0;
1432
+ right: 0;
1433
+ z-index: 2;
1434
+ display: flex;
1435
+ align-items: center;
1436
+ justify-content: space-between;
1437
+ gap: 12px;
1438
+ padding: 9px 24px 10px;
1439
+ background: var(--mirk-bg);
1440
+ border-bottom: 1px solid var(--mirk-input-border);
1441
+ opacity: 0;
1442
+ transform: translateY(-100%);
1443
+ pointer-events: none;
1444
+ transition: opacity 140ms ease, transform 160ms ease;
1445
+ }
1446
+ .hcms-shell.is-condensed .hcms-shell-minibar {
1447
+ opacity: 1;
1448
+ transform: none;
1449
+ pointer-events: auto;
1450
+ }
1451
+ .hcms-shell-minibar-title {
1452
+ font-size: 14px;
1453
+ line-height: 1;
1454
+ color: var(--mirk-fg);
1455
+ white-space: nowrap;
1456
+ overflow: hidden;
1457
+ text-overflow: ellipsis;
1458
+ }
1459
+
1460
+ /* ---------- HEADER (no underline rule \u2014 whitespace separates the bands) ---------- */
1461
+ .hcms-shell-header {
1462
+ flex-shrink: 0;
1463
+ display: flex;
1464
+ align-items: flex-start;
1465
+ justify-content: space-between;
1466
+ gap: 12px;
1467
+ padding: 24px 24px 4px;
1468
+ }
1469
+ .hcms-shell-heading { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
1470
+ .hcms-shell-eyebrow {
1471
+ font-size: 11px;
1472
+ text-transform: uppercase;
1473
+ letter-spacing: 0.18em;
1474
+ color: var(--mirk-placeholder-color);
1475
+ }
1476
+ .hcms-shell-title {
1477
+ margin: 0;
1478
+ font-size: 18px;
1479
+ font-weight: 400;
1480
+ line-height: 1.2;
1481
+ color: var(--mirk-fg);
1482
+ }
1483
+ .hcms-shell-close.mirk-button {
1484
+ flex-shrink: 0;
1485
+ padding: 2px 9px 3px;
1486
+ line-height: 1;
1487
+ }
1488
+ .hcms-shell-close .mirk-button__label { font-size: 16px; }
1489
+
1490
+ /* ---------- FORM \u2014 generous, even vertical rhythm ---------- */
1491
+ .hcms-form {
1492
+ display: flex;
1493
+ flex-direction: column;
1494
+ gap: 26px;
1495
+ padding: 12px 24px 28px;
1496
+ }
1497
+
1498
+ /* one labeled scalar field */
1499
+ .hcms-field { display: flex; flex-direction: column; gap: 9px; }
1500
+ .hcms-field--row {
1501
+ flex-direction: row;
1502
+ align-items: center;
1503
+ justify-content: space-between;
1504
+ }
1505
+
1506
+ /* themed field label */
1507
+ .hcms-label {
1508
+ font-size: 11px;
1509
+ text-transform: uppercase;
1510
+ letter-spacing: 0.14em;
1511
+ color: var(--mirk-sortable-label);
1512
+ }
1513
+
1514
+ /* comfortable control padding + readable size, in mirk's own mono */
1515
+ .hcms-shell.pixel-quiet .mirk-input,
1516
+ .hcms-shell.pixel-quiet .mirk-textarea {
1517
+ font-size: 15px;
1518
+ padding: 9px 14px 10px;
1519
+ }
1520
+ .hcms-shell.pixel-quiet textarea.mirk-input { min-height: 76px; resize: vertical; }
1521
+
1522
+ /* default scalar fields: one-row textareas that grow with their content.
1523
+ Browsers without field-sizing get a scrollHeight fallback (enhance.js). */
1524
+ .hcms-shell.pixel-quiet .hcms-form textarea.mirk-textarea {
1525
+ field-sizing: content;
1526
+ resize: none;
1527
+ overflow: hidden;
1528
+ min-height: 0;
1529
+ }
1530
+
1531
+ /* rich-text surface (@richtext): a contenteditable styled like a textarea */
1532
+ .hcms-shell.pixel-quiet .hcms-richtext {
1533
+ min-height: 2.5em;
1534
+ cursor: text;
1535
+ overflow-wrap: break-word;
1536
+ }
1537
+ .hcms-shell.pixel-quiet .hcms-richtext a {
1538
+ color: inherit;
1539
+ text-decoration: underline;
1540
+ text-underline-offset: 2px;
1541
+ }
1542
+ .hcms-shell.pixel-quiet .hcms-richtext:empty::before {
1543
+ content: attr(data-hcms-placeholder);
1544
+ color: var(--mirk-placeholder-color);
1545
+ }
1546
+ .hcms-shell.pixel-quiet .mirk-select__field {
1547
+ font-size: 15px;
1548
+ padding: 8px 40px 9px 14px;
1549
+ }
1550
+ .hcms-shell.pixel-quiet .mirk-radio__label,
1551
+ .hcms-shell.pixel-quiet .mirk-toggle__label,
1552
+ .hcms-shell.pixel-quiet .mirk-tags__input { font-size: 15px; }
1553
+
1554
+ /* inline radio row */
1555
+ .hcms-radio-row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
1556
+
1557
+ /* chip-field (the @chips built-in): a borderless inline input that sizes to its
1558
+ text, so chips read like static chips but stay inline-editable. */
1559
+ .hcms-shell .mirk-tags__chip { padding-right: 6px; }
1560
+ .hcms-shell .hcms-chip-field {
1561
+ border: 0; background: transparent; color: inherit; font: inherit;
1562
+ outline: none; min-width: 2ch; field-sizing: content; padding: 0;
1563
+ }
1564
+ .hcms-shell .hcms-chips .hcms-add { margin-top: 4px; align-self: flex-start; }
1565
+
1566
+ /* ---------- OBJECT GROUP \u2014 a quiet framed band, not a heavy card ---------- */
1567
+ .hcms-object {
1568
+ display: flex;
1569
+ flex-direction: column;
1570
+ gap: 16px;
1571
+ }
1572
+ .hcms-object-title {
1573
+ margin: 0;
1574
+ font-size: 11px;
1575
+ font-weight: 400;
1576
+ text-transform: uppercase;
1577
+ letter-spacing: 0.14em;
1578
+ color: var(--mirk-sortable-label);
1579
+ }
1580
+ .hcms-object-fields { display: flex; flex-direction: column; gap: 16px; }
1581
+
1582
+ /* ---------- SCALAR ARRAY \u2014 a calm list of mirk-input rows ---------- */
1583
+ .hcms-array { display: flex; flex-direction: column; gap: 14px; }
1584
+ .hcms-array-header { display: flex; align-items: baseline; justify-content: space-between; }
1585
+ .hcms-array-title {
1586
+ margin: 0;
1587
+ font-size: 11px;
1588
+ font-weight: 400;
1589
+ text-transform: uppercase;
1590
+ letter-spacing: 0.14em;
1591
+ color: var(--mirk-sortable-label);
1592
+ }
1593
+ /* The generic stacked-list layout is unlayered, so it would beat mirk's
1594
+ @layer-components rules on any slot that is also a mirk component. Exempt a
1595
+ mirk tags box so it keeps mirk's own row-wrap layout and inner padding. */
1596
+ .hcms-array-items:not(.mirk-tags) {
1597
+ list-style: none;
1598
+ margin: 0;
1599
+ padding: 0;
1600
+ display: flex;
1601
+ flex-direction: column;
1602
+ gap: 10px;
1603
+ }
1604
+ .hcms-array-item {
1605
+ display: flex;
1606
+ align-items: center;
1607
+ gap: 8px;
1608
+ }
1609
+ .hcms-array-item .mirk-input { flex: 1; min-width: 0; }
1610
+
1611
+ /* ---------- OBJECT ARRAY \u2014 mirk-sortable cards from the engine markup ---------- */
1612
+ .hcms-array--cards .hcms-array-items { gap: 14px; }
1613
+ .hcms-card.mirk-sortable__item { background: var(--mirk-bevel-bg); position: relative; }
1614
+ .hcms-card .hcms-card-fields { display: flex; flex-direction: column; flex: 1; min-width: 0; }
1615
+ .hcms-card .hcms-field {
1616
+ gap: 2px;
1617
+ padding: 8px 14px 9px;
1618
+ }
1619
+ .hcms-card .hcms-field:not(:last-child) { border-bottom: 1px solid var(--mirk-input-border); }
1620
+ .hcms-card .hcms-label { letter-spacing: 0.16em; }
1621
+ /* fields inside a card read as quiet rows, not chunky boxed inputs */
1622
+ .hcms-card .mirk-input,
1623
+ .hcms-card .mirk-textarea {
1624
+ border: none;
1625
+ background: transparent;
1626
+ padding: 0;
1627
+ font-size: 15px;
1628
+ }
1629
+ .hcms-card .mirk-input:focus-visible,
1630
+ .hcms-card .mirk-textarea:focus-visible { outline: none; }
1631
+ /* the remove \xD7 is pulled out to the card corner (below), so the controls row
1632
+ now only holds the sr-only move buttons \u2014 collapse it until one is focused. */
1633
+ .hcms-card-controls {
1634
+ display: flex;
1635
+ align-items: center;
1636
+ justify-content: flex-end;
1637
+ gap: 6px;
1638
+ padding: 0;
1639
+ }
1640
+
1641
+ /* quiet \xD7 remove control, shared by scalar-array rows and object-array cards */
1642
+ .hcms-remove {
1643
+ flex-shrink: 0;
1644
+ appearance: none;
1645
+ border: 0;
1646
+ background: none;
1647
+ color: var(--mirk-placeholder-color);
1648
+ cursor: pointer;
1649
+ font-size: 16px;
1650
+ line-height: 1;
1651
+ padding: 2px 6px;
1652
+ }
1653
+ .hcms-remove:hover { color: var(--mirk-destructive); }
1654
+ .hcms-remove[hidden] { display: none; }
1655
+
1656
+ /* object-array card: the delete control is a square corner button pinned
1657
+ top-right, carrying the card's own 1px border + a crisp-line \xD7 icon. */
1658
+ .hcms-remove--card {
1659
+ position: absolute;
1660
+ top: -1px;
1661
+ right: -1px;
1662
+ width: 18px;
1663
+ height: 18px;
1664
+ padding: 0;
1665
+ display: flex;
1666
+ align-items: center;
1667
+ justify-content: center;
1668
+ border: 1px solid var(--mirk-input-border);
1669
+ background: var(--mirk-bevel-bg);
1670
+ color: var(--mirk-placeholder-color);
1671
+ }
1672
+ .hcms-remove--card:hover { border-color: var(--mirk-destructive); }
1673
+ .hcms-remove--card .hcms-x { width: 64%; height: 64%; display: block; }
1674
+
1675
+ /* "+ Add" \u2014 quiet, pinned left */
1676
+ .hcms-add.mirk-button { align-self: flex-start; }
1677
+
1678
+ /* ---------- UPLOAD COMPONENTS (@file / @image) ----------
1679
+ Built on the kit's mirk-file / mirk-image--compact chrome. The native picker
1680
+ is visually hidden but focusable (the mirk-button label is the visible
1681
+ trigger and rings via :has(:focus-visible)); it is NOT .mirk-*__input, so the
1682
+ vendored mirk runtime never handles it. The empty/filled chrome is driven by
1683
+ the bound leaf's value attribute (src/href) in CSS \u2014 no JS state to desync. */
1684
+ .hcms-upload input[type="file"] {
1685
+ position: absolute;
1686
+ width: 1px;
1687
+ height: 1px;
1688
+ padding: 0;
1689
+ margin: -1px;
1690
+ overflow: hidden;
1691
+ clip: rect(0, 0, 0, 0);
1692
+ white-space: nowrap;
1693
+ border: 0;
1694
+ }
1695
+
1696
+ /* @image: show the upload button until the bound <img> carries a real src. */
1697
+ .hcms-upload--image .mirk-image__thumb { display: none; }
1698
+ .hcms-upload--image:has(.mirk-image__preview[src]:not([src=""])) .mirk-image__upload { display: none; }
1699
+ .hcms-upload--image:has(.mirk-image__preview[src]:not([src=""])) .mirk-image__thumb { display: inline-block; }
1700
+
1701
+ /* @file: reveal the clear \xD7 and the filename only once the bound <a> has href. */
1702
+ .hcms-upload--file .hcms-upload-clear { display: none; }
1703
+ .hcms-upload--file:has(a.mirk-file__name[href]:not([href=""])) .hcms-upload-clear { display: inline-flex; }
1704
+ /* A filled filename uses the bright foreground (the kit's [data-filled] look),
1705
+ driven by the bound href so there's no JS attribute to keep in sync \u2014 the
1706
+ vendored runtime that would otherwise stamp data-filled is inert here. */
1707
+ .hcms-upload--file:has(a.mirk-file__name[href]:not([href=""])) a.mirk-file__name {
1708
+ color: var(--mirk-bevel-fg);
1709
+ }
1710
+ .hcms-upload--file a.mirk-file__name:empty {
1711
+ text-decoration: none;
1712
+ cursor: default;
1713
+ }
1714
+ .hcms-upload--file a.mirk-file__name:empty::after {
1715
+ content: "No file chosen";
1716
+ color: var(--mirk-placeholder-color);
1717
+ }
1718
+
1719
+ /* ---------- COLOR (@color) ----------
1720
+ Swatch colors arrive as --hcms-swatch on each element's style, so a value
1721
+ never becomes a selector or a class. The full palette is an 11-column grid
1722
+ (one row per hue); a narrowed set wraps. */
1723
+ .hcms-color-row { display: flex; align-items: center; gap: 8px; }
1724
+ .hcms-color-current {
1725
+ display: inline-flex; align-items: center; gap: 8px;
1726
+ padding: 4px 12px 4px 4px; border: 1px solid var(--mirk-input-border); border-radius: 999px;
1727
+ background: var(--mirk-input-bg); color: var(--mirk-fg); font: inherit; cursor: pointer;
1728
+ }
1729
+ .hcms-color--inline .hcms-color-current { cursor: default; }
1730
+ .hcms-color-chip, .hcms-color-swatch { background: var(--hcms-swatch, transparent); }
1731
+ .hcms-color-chip {
1732
+ width: 20px; height: 20px; border-radius: 50%;
1733
+ box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--mirk-fg) 20%, transparent);
1734
+ }
1735
+ .hcms-color[data-hcms-color-empty] .hcms-color-chip {
1736
+ background: repeating-conic-gradient(var(--mirk-input-border) 0 25%, transparent 0 50%) 50% / 8px 8px;
1737
+ }
1738
+ .hcms-color-clear {
1739
+ display: inline-flex; padding: 2px; border: 0; background: transparent;
1740
+ color: var(--mirk-placeholder-color); cursor: pointer;
1741
+ }
1742
+ .hcms-color-clear:hover { color: var(--mirk-fg); }
1743
+ .hcms-color[data-hcms-color-empty] .hcms-color-clear { display: none; }
1744
+ .hcms-color-panel { margin-top: 8px; }
1745
+ .hcms-color-panel[hidden] { display: none; }
1746
+ .hcms-color-grid { display: flex; flex-wrap: wrap; gap: 4px; }
1747
+ .hcms-color-grid--full { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 3px; }
1748
+ .hcms-color-swatch {
1749
+ width: 22px; height: 22px; padding: 0; border: 0; border-radius: 4px; cursor: pointer;
1750
+ box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--mirk-fg) 15%, transparent);
1751
+ }
1752
+ .hcms-color-grid--full .hcms-color-swatch { width: auto; height: auto; aspect-ratio: 1; }
1753
+ .hcms-color-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--mirk-bg), 0 0 0 4px var(--mirk-fg); }
1754
+ .hcms-color-swatch:focus-visible { outline: 2px solid var(--mirk-focus-color); outline-offset: 2px; }
1755
+ .hcms-color-custom { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
1756
+ .hcms-color-native {
1757
+ width: 32px; height: 28px; padding: 0; border: 1px solid var(--mirk-input-border);
1758
+ border-radius: 4px; background: none; cursor: pointer;
1759
+ }
1760
+ .hcms-color-text { flex: 1; min-width: 0; }
1761
+
1762
+ /* ---------- FONT (@font) ----------
1763
+ Each option sets its own font-family inline, so the list previews every
1764
+ family in its face once the editor-only preview stylesheet arrives. */
1765
+ .hcms-font-current {
1766
+ display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
1767
+ padding: 6px 10px; border: 1px solid var(--mirk-input-border); border-radius: 4px;
1768
+ background: var(--mirk-input-bg); color: var(--mirk-fg); font: inherit; cursor: pointer; text-align: left;
1769
+ }
1770
+ .hcms-font-name { font-size: 15px; }
1771
+ .hcms-font-chevron { transform: rotate(90deg); color: var(--mirk-placeholder-color); }
1772
+ .hcms-font-panel { margin-top: 6px; }
1773
+ .hcms-font-panel[hidden] { display: none; }
1774
+ .hcms-font-list {
1775
+ display: flex; flex-direction: column; max-height: 320px; overflow-y: auto;
1776
+ border: 1px solid var(--mirk-input-border); border-radius: 4px; background: var(--mirk-input-bg);
1777
+ }
1778
+ .hcms-font-group {
1779
+ padding: 8px 10px 4px; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase;
1780
+ color: var(--mirk-placeholder-color);
1781
+ }
1782
+ .hcms-font-option {
1783
+ padding: 6px 10px; border: 0; background: transparent; color: var(--mirk-fg);
1784
+ font-size: 16px; text-align: left; cursor: pointer;
1785
+ }
1786
+ .hcms-font-option:hover { background: color-mix(in oklab, var(--mirk-fg) 8%, transparent); }
1787
+ .hcms-font-option[aria-selected="true"] { background: color-mix(in oklab, var(--mirk-fg) 14%, transparent); }
1788
+ .hcms-font-option:focus-visible { outline: 2px solid var(--mirk-focus-color); outline-offset: -2px; }
1789
+
1790
+ /* ---------- VARIANT (@variant) ----------
1791
+ Native radios behind icon tiles: arrow keys move the choice, the tile with
1792
+ the checked radio is the selected one. */
1793
+ .hcms-variant-row { display: flex; flex-wrap: wrap; gap: 8px; }
1794
+ .hcms-variant-option {
1795
+ position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: 4px;
1796
+ min-width: 64px; padding: 8px 10px; border: 1px solid var(--mirk-input-border); border-radius: 6px;
1797
+ background: var(--mirk-input-bg); color: var(--mirk-placeholder-color); font-size: 12px; cursor: pointer;
1798
+ }
1799
+ .hcms-variant-option:hover { color: var(--mirk-fg); }
1800
+ .hcms-variant-option:has(input:checked) {
1801
+ color: var(--mirk-fg); border-color: var(--mirk-fg);
1802
+ box-shadow: inset 0 0 0 1px var(--mirk-fg);
1803
+ }
1804
+ .hcms-variant-option:has(input:focus-visible) { outline: 2px solid var(--mirk-focus-color); outline-offset: 2px; }
1805
+ .hcms-variant-icon { display: inline-flex; }
1806
+
1807
+ /* ---------- UPLOADING (spec \xA79) ----------
1808
+ One attribute, [data-hcms-uploading], set on the field for as long as the host
1809
+ has the bytes, plus --hcms-upload-progress carrying the percent. No markup of
1810
+ its own: the templates keep their exact shape, so a half-finished upload cannot
1811
+ leave an orphan node behind in the form. The at-upload-time picture is painted
1812
+ on the frame as a background, never assigned to the bound <img>, because that
1813
+ img IS the field's value and a commit landing mid-upload would write a
1814
+ two-megabyte data URL straight into the live page. */
1815
+ .hcms-upload[data-hcms-uploading] .mirk-image__frame {
1816
+ background-size: cover;
1817
+ background-position: center;
1818
+ }
1819
+ /* The empty state hides the thumb, so an upload into an empty field would have
1820
+ nowhere to show. Uploading reveals it, preview or not. */
1821
+ .hcms-upload--image[data-hcms-uploading] .mirk-image__thumb { display: inline-block; }
1822
+ .hcms-upload--image[data-hcms-uploading] .mirk-image__upload { display: none; }
1823
+ /* No \xD7 mid-flight: clearing writes the leaf empty, which says nothing about the
1824
+ request still running and reads as a cancel that is not one. */
1825
+ .hcms-upload[data-hcms-uploading] .hcms-upload-clear { display: none; }
1826
+
1827
+ .hcms-upload[data-hcms-uploading] .mirk-image__frame::after,
1828
+ .hcms-upload--file[data-hcms-uploading] .mirk-file::after {
1829
+ content: "";
1830
+ position: absolute;
1831
+ left: 0;
1832
+ bottom: 0;
1833
+ height: 3px;
1834
+ width: var(--hcms-upload-progress, 0%);
1835
+ background: var(--mirk-bevel-fg);
1836
+ transition: width 120ms linear;
1837
+ }
1838
+ /* The @file row has no frame to hang the bar on, so it becomes the positioning
1839
+ context itself. */
1840
+ .hcms-upload--file[data-hcms-uploading] .mirk-file { position: relative; }
1841
+
1842
+ /* clear-\xD7 (vendored-inert; data-hcms-action, never .mirk-*__remove). Bare \xD7 for
1843
+ @file, a pinned corner badge for @image \u2014 mirroring .hcms-remove / --card. */
1844
+ .hcms-upload-clear {
1845
+ flex-shrink: 0;
1846
+ appearance: none;
1847
+ border: 0;
1848
+ background: none;
1849
+ color: var(--mirk-placeholder-color);
1850
+ cursor: pointer;
1851
+ line-height: 0;
1852
+ padding: 2px 4px;
1853
+ display: inline-flex;
1854
+ align-items: center;
1855
+ justify-content: center;
1856
+ }
1857
+ .hcms-upload-clear:hover { color: var(--mirk-destructive); }
1858
+ .hcms-upload-clear .hcms-x { display: block; width: 14px; height: 14px; }
1859
+
1860
+ .hcms-upload-clear--badge {
1861
+ position: absolute;
1862
+ top: -7px;
1863
+ right: -7px;
1864
+ width: 18px;
1865
+ height: 18px;
1866
+ padding: 0;
1867
+ border-radius: 50%;
1868
+ border: 1px solid var(--mirk-input-border);
1869
+ background: var(--mirk-bevel-bg);
1870
+ color: var(--mirk-bevel-fg);
1871
+ }
1872
+ .hcms-upload-clear--badge:hover { color: var(--mirk-destructive); border-color: var(--mirk-destructive); }
1873
+ .hcms-upload-clear--badge .hcms-x { width: 10px; height: 10px; }
1874
+
1875
+ /* ---------- UNRESOLVED-FIELDS NOTICE ---------- */
1876
+ .hcms-shell-notice {
1877
+ font-size: 12px;
1878
+ line-height: 1.45;
1879
+ white-space: pre-line;
1880
+ color: var(--mirk-mark-fg);
1881
+ background: var(--mirk-bevel-bg);
1882
+ border: 1px solid var(--mirk-input-border);
1883
+ padding: 8px 12px;
1884
+ margin: 0 24px 8px;
1885
+ }
1886
+ .hcms-shell-notice[hidden] { display: none; }
1887
+
1888
+ /* ---------- ERROR BANNER + inline errors ---------- */
1889
+ .hcms-shell-error,
1890
+ .hcms-error {
1891
+ font-size: 12px;
1892
+ line-height: 1.45;
1893
+ color: var(--mirk-destructive);
1894
+ background: var(--mirk-bevel-bg);
1895
+ border: 1px solid var(--mirk-destructive);
1896
+ padding: 8px 12px;
1897
+ }
1898
+ .hcms-shell-error { margin: 0 24px; }
1899
+ .hcms-error { margin-top: 6px; }
1900
+ .hcms-shell-error[hidden],
1901
+ .hcms-error[hidden] { display: none; }
1902
+
1903
+ /* A note, not a refusal: the file WAS stored, in the page, and this says why it
1904
+ is not on the host. Same slot, so there is one place a field ever speaks. */
1905
+ .hcms-error--info {
1906
+ color: var(--mirk-mark-fg);
1907
+ border-color: var(--mirk-input-border);
1908
+ }
1909
+
1910
+ /* ---------- SAVE (sits at the end of the scrolling form, not pinned) ---------- */
1911
+ .hcms-shell-footer {
1912
+ display: flex;
1913
+ justify-content: flex-end;
1914
+ padding: 4px 24px 28px;
1915
+ }
1916
+ .hcms-shell-footer[hidden] { display: none; }
1917
+
1918
+ /* ---------- sr-only move buttons: hidden, visible on keyboard focus ---------- */
1919
+ .hcms-sr-only {
1920
+ position: absolute;
1921
+ width: 1px;
1922
+ height: 1px;
1923
+ padding: 0;
1924
+ margin: -1px;
1925
+ overflow: hidden;
1926
+ clip: rect(0, 0, 0, 0);
1927
+ white-space: nowrap;
1928
+ border: 0;
1929
+ }
1930
+ .hcms-sr-only:focus {
1931
+ position: static;
1932
+ width: auto;
1933
+ height: auto;
1934
+ padding: 2px 6px;
1935
+ margin: 0 2px;
1936
+ overflow: visible;
1937
+ clip: auto;
1938
+ white-space: normal;
1939
+ background: var(--mirk-bevel-bg);
1940
+ border: 1px solid var(--mirk-input-border);
1941
+ color: var(--mirk-fg);
1942
+ font-size: 12px;
1943
+ cursor: pointer;
1944
+ }
1945
+ .hcms-sr-only[hidden] { display: none; }
1946
+
1947
+ /* ============================================================
1948
+ INLINE VIEW GEOMETRY \u2014 not a panel. A transparent full-viewport
1949
+ host whose children are the only interactive surfaces, so the page
1950
+ underneath stays fully usable while the editor is open.
1951
+ ============================================================ */
1952
+ .hcms-shell.pixel-quiet.hcms-inline {
1953
+ position: fixed;
1954
+ inset: 0;
1955
+ z-index: 2147483000;
1956
+ /* The host must never intercept a click meant for the page. Each child
1957
+ re-enables pointer events for itself. */
1958
+ pointer-events: none;
1959
+ background: none;
1960
+ border: 0;
1961
+ box-shadow: none;
1962
+ color: var(--mirk-fg);
1963
+ }
1964
+ .hcms-inline > *,
1965
+ .hcms-inline-layer > * { pointer-events: auto; }
1966
+ .hcms-inline-layer { position: absolute; inset: 0; pointer-events: none; }
1967
+
1968
+ .hcms-inline-bar {
1969
+ position: absolute;
1970
+ left: 50%;
1971
+ bottom: 16px;
1972
+ transform: translateX(-50%);
1973
+ max-width: min(560px, calc(100vw - 32px));
1974
+ display: flex;
1975
+ flex-direction: column;
1976
+ gap: 6px;
1977
+ }
1978
+
1979
+ .hcms-inline-notice,
1980
+ .hcms-inline-error {
1981
+ padding: 8px 12px;
1982
+ border-radius: 8px;
1983
+ font-size: 14px;
1984
+ line-height: 1.4;
1985
+ border: 1px solid var(--mirk-input-border);
1986
+ background: var(--mirk-bg);
1987
+ color: var(--mirk-fg);
1988
+ box-shadow: 0 12px 32px -20px rgba(43, 36, 27, 0.5);
1989
+ }
1990
+ .hcms-inline-notice { white-space: pre-line; }
1991
+ .hcms-inline-error { border-color: var(--mirk-destructive); color: var(--mirk-destructive); }
1992
+ .hcms-inline-notice[hidden],
1993
+ .hcms-inline-error[hidden] { display: none; }
1994
+
1995
+ .hcms-inline-pop {
1996
+ position: absolute;
1997
+ top: 0;
1998
+ left: 0;
1999
+ box-sizing: border-box;
2000
+ width: min(340px, calc(100vw - 24px));
2001
+ max-height: calc(100dvh - 24px);
2002
+ overflow: auto;
2003
+ padding: 16px;
2004
+ border-radius: 8px;
2005
+ border: 1px solid var(--mirk-input-border);
2006
+ background: var(--mirk-bg);
2007
+ color: var(--mirk-fg);
2008
+ box-shadow: 0 16px 40px -22px rgba(43, 36, 27, 0.55);
2009
+ /* Above the handles. They are positioned with z-index: 1 while the popover
2010
+ sat at auto, so a handle painted over the very field it had just opened
2011
+ and covered the text in it. The popover is what someone is using; a handle
2012
+ is only an offer to open one. */
2013
+ z-index: 2;
2014
+ }
2015
+ .hcms-inline-pop[hidden] { display: none; }
2016
+ .hcms-inline-pop-header {
2017
+ display: flex;
2018
+ align-items: center;
2019
+ justify-content: space-between;
2020
+ gap: 16px;
2021
+ margin-bottom: 16px;
2022
+ font-size: 14px;
2023
+ }
2024
+ .hcms-shell .hcms-inline-pop-close {
2025
+ display: inline-flex;
2026
+ align-items: center;
2027
+ justify-content: center;
2028
+ min-width: 36px;
2029
+ min-height: 36px;
2030
+ padding: 4px;
2031
+ }
2032
+
2033
+ .hcms-inline-item-controls {
2034
+ position: absolute;
2035
+ top: 0;
2036
+ left: 0;
2037
+ z-index: 1;
2038
+ will-change: transform;
2039
+ display: flex;
2040
+ align-items: center;
2041
+ gap: 2px;
2042
+ }
2043
+ .hcms-inline-item-controls[hidden],
2044
+ .hcms-inline-handle[hidden] { display: none; }
2045
+ .hcms-inline-item-controls.has-open-settings { z-index: 3; }
2046
+ .hcms-inline-settings { position: relative; display: flex; flex: none; }
2047
+ .hcms-inline-settings[hidden],
2048
+ .hcms-inline-settings-menu[hidden] { display: none; }
2049
+ .hcms-inline-settings-menu {
2050
+ position: absolute;
2051
+ top: calc(100% + 6px);
2052
+ right: 0;
2053
+ min-width: 120px;
2054
+ padding: 4px;
2055
+ border: 1px solid var(--mirk-input-border);
2056
+ border-radius: 5px;
2057
+ background: var(--mirk-bg);
2058
+ box-shadow: 0 8px 24px #0003;
2059
+ }
2060
+ .hcms-inline-settings-menu button {
2061
+ display: block;
2062
+ box-sizing: border-box;
2063
+ width: 100%;
2064
+ padding: 10px 12px;
2065
+ border: 0;
2066
+ background: transparent;
2067
+ color: var(--mirk-destructive);
2068
+ font: inherit;
2069
+ text-align: left;
2070
+ cursor: pointer;
2071
+ }
2072
+ .hcms-inline-settings-menu button:hover,
2073
+ .hcms-inline-settings-menu button:focus-visible {
2074
+ background: var(--mirk-bevel-bg);
2075
+ outline: 1px solid var(--mirk-focus-color);
2076
+ }
2077
+
2078
+ /* Buttons flow within the positioned item container. */
2079
+ .hcms-inline-row-controls {
2080
+ display: flex;
2081
+ gap: 2px;
2082
+ }
2083
+ .hcms-inline-row-controls[hidden] { display: none; }
2084
+
2085
+ .hcms-inline-list-add[hidden] { display: none; }
2086
+
2087
+ .hcms-shell.hcms-inline-ghost {
2088
+ box-sizing: border-box;
2089
+ position: relative;
2090
+ display: flex;
2091
+ align-items: center;
2092
+ justify-content: center;
2093
+ flex: none;
2094
+ max-width: 100%;
2095
+ min-width: 0;
2096
+ margin: 8px 0 0;
2097
+ padding: 0;
2098
+ border: 1px dashed color-mix(in srgb, currentColor 25%, transparent);
2099
+ border-radius: 3px;
2100
+ background: color-mix(in srgb, currentColor 3%, transparent);
2101
+ color: inherit;
2102
+ list-style: none;
2103
+ }
2104
+ .hcms-shell.hcms-inline-ghost[hidden] { display: none; }
2105
+ tr.hcms-shell.hcms-inline-ghost { display: table-row; }
2106
+ .hcms-inline-ghost-cell { padding: 0; text-align: center; vertical-align: middle; }
2107
+
2108
+ .hcms-shell .hcms-inline-handle,
2109
+ .hcms-shell .hcms-inline-list-button {
2110
+ display: inline-flex;
2111
+ align-items: center;
2112
+ justify-content: center;
2113
+ min-width: 36px;
2114
+ min-height: 36px;
2115
+ padding: 4px;
2116
+ line-height: 1;
2117
+ }
2118
+ .hcms-inline-handle .mirk-button__label,
2119
+ .hcms-inline-list-button .mirk-button__label {
2120
+ display: inline-flex;
2121
+ align-items: center;
2122
+ gap: 6px;
2123
+ line-height: 1;
2124
+ }
2125
+ .hcms-inline-icon { display: block; width: 24px; height: 24px; flex: none; }
2126
+ .hcms-inline-handle .hcms-inline-icon { width: 20.4px; height: 20.4px; transform: translateY(-1px); }
2127
+ .hcms-inline-list-add .hcms-inline-icon { width: 16.8px; height: 16.8px; }
2128
+ .hcms-shell .hcms-inline-list-add { padding-inline: 10px; }
2129
+
2130
+ .hcms-inline-list-button {
2131
+ flex: none;
2132
+ }
2133
+ .hcms-inline-list-button[hidden] { display: none; }
2134
+ .hcms-shell .hcms-inline-list-button:disabled {
2135
+ opacity: 1;
2136
+ color: #626B96;
2137
+ background: var(--mirk-bevel-bg);
2138
+ border-color: var(--mirk-bevel-tl) var(--mirk-bevel-br) var(--mirk-bevel-br) var(--mirk-bevel-tl);
2139
+ }
2140
+ .hcms-shell .hcms-inline-list-button:disabled .mirk-button__label { translate: none; }
2141
+
2142
+ /* A finger is not a mouse pointer: on touch the same three controls get the
2143
+ 44px target the platform guidelines ask for. */
2144
+ @media (pointer: coarse) {
2145
+ .hcms-shell .hcms-inline-handle,
2146
+ .hcms-shell .hcms-inline-list-button {
2147
+ min-width: 44px;
2148
+ min-height: 44px;
2149
+ }
2150
+ }
2151
+
2152
+ .hcms-inline-toggle { align-self: center; }
2153
+ .hcms-inline-toggle[hidden] { display: none; }
2154
+
2155
+ /* Fields with no visible anchor can still be edited through the sidebar. */
2156
+ .hcms-inline-handoff {
2157
+ display: flex;
2158
+ align-items: center;
2159
+ gap: 10px;
2160
+ padding: 6px 6px 6px 12px;
2161
+ border-radius: 999px;
2162
+ font-size: 13px;
2163
+ border: 1px solid var(--mirk-input-border);
2164
+ background: var(--mirk-bg);
2165
+ color: var(--mirk-fg);
2166
+ align-self: center;
2167
+ }
2168
+ .hcms-inline-handoff[hidden] { display: none; }
2169
+
2170
+ /* Selected fields only. Scoped to the inline host: [data-hcms-shell] is on BOTH
2171
+ hosts, so an unscoped rule hides the sidebar's whole form too. */
2172
+ .hcms-inline .hcms-form [data-hcms-path] { display: none; }
2173
+ .hcms-inline .hcms-form [data-hcms-path].is-hcms-inline-onpath,
2174
+ .hcms-inline .hcms-form [data-hcms-path].is-hcms-inline-active { display: block; }
2175
+ /* The Page style group has no data path of its own: hide it like a path until
2176
+ a reveal marks it on-path. */
2177
+ .hcms-inline .hcms-form [data-hcms-page-style]:not(.is-hcms-inline-onpath) { display: none; }
2178
+
2179
+ .hcms-inline .hcms-form .is-hcms-inline-onpath,
2180
+ .hcms-inline .hcms-form {
2181
+ margin: 0;
2182
+ padding: 0;
2183
+ border: 0;
2184
+ border-radius: 0;
2185
+ box-shadow: none;
2186
+ background: transparent;
2187
+ min-width: 0;
2188
+ min-height: 0;
2189
+ width: 100%;
2190
+ }
2191
+ .hcms-inline-pop .hcms-object-title,
2192
+ .hcms-inline-pop .hcms-array-header,
2193
+ .hcms-inline-pop .hcms-drag-handle,
2194
+ .hcms-inline-pop [data-hcms-action="add"],
2195
+ .hcms-inline-pop [data-hcms-action="remove"],
2196
+ .hcms-inline-pop [data-hcms-action="move-up"],
2197
+ .hcms-inline-pop [data-hcms-action="move-down"],
2198
+ .hcms-inline-pop .hcms-card-controls { display: none; }
2199
+ .hcms-inline .hcms-form .hcms-field.is-hcms-inline-active {
2200
+ display: flex;
2201
+ gap: 8px;
2202
+ padding: 0;
2203
+ margin: 0 0 16px;
2204
+ border: 0;
2205
+ min-width: min(260px, 100%);
2206
+ }
2207
+ .hcms-inline .hcms-form .hcms-field.is-hcms-inline-active:last-child { margin-bottom: 0; }
2208
+ .hcms-shell.pixel-quiet .hcms-inline-pop .mirk-input,
2209
+ .hcms-shell.pixel-quiet .hcms-inline-pop .mirk-textarea {
2210
+ box-sizing: border-box;
2211
+ width: 100%;
2212
+ min-width: min(260px, 100%);
2213
+ min-height: 42px;
2214
+ padding: 10px 12px;
2215
+ border: 1px solid var(--mirk-input-border);
2216
+ background: var(--mirk-input-bg);
2217
+ }
2218
+ .hcms-inline-pop .mirk-input:focus-visible,
2219
+ .hcms-inline-pop .mirk-textarea:focus-visible {
2220
+ outline: 2px solid var(--mirk-focus-color);
2221
+ outline-offset: 2px;
2222
+ }
2223
+
2224
+ .hcms-inline-highlight {
2225
+ position: absolute;
2226
+ top: 0;
2227
+ left: 0;
2228
+ pointer-events: none;
2229
+ border: 2px solid var(--mirk-focus-color);
2230
+ border-radius: 4px;
2231
+ box-sizing: border-box;
2232
+ will-change: transform;
2233
+ }
2234
+ .hcms-inline-highlight[hidden] { display: none; }
2235
+ `;typeof window<"u"&&typeof document<"u"&&(function(){if(window.__mirk)return;window.__mirk=!0;let e='<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4 4 12 12M12 4 4 12" stroke="currentColor" stroke-width="2" stroke-linecap="square" fill="none"/></svg>';document.addEventListener("click",r=>{let i=r.target.closest(".mirk-number__step");if(!i)return;let l=i.closest(".mirk-number").querySelector("input[type=number]");l&&(i.dataset.step==="up"?l.stepUp():l.stepDown(),l.dispatchEvent(new Event("change",{bubbles:!0})))}),document.addEventListener("input",r=>{let i=r.target.closest(".mirk-slider__input");i&&i.closest(".mirk-slider").style.setProperty("--mirk-value",`${i.value}%`)}),document.addEventListener("change",r=>{let i=r.target.closest(".mirk-file__input");if(!i||!i.files.length)return;let l=i.closest(".mirk-file"),a=l.querySelector(".mirk-file__name");if(!a)return;let o=i.files[0],n=document.createElement("a");if(n.className="mirk-file__name",n.dataset.filled="",n.href=URL.createObjectURL(o),n.target="_blank",n.rel="noopener",n.textContent=o.name,a.replaceWith(n),!l.querySelector(".mirk-file__remove")){let s=document.createElement("button");s.type="button",s.className="mirk-file__remove",s.setAttribute("aria-label","Remove file"),s.innerHTML=e,n.after(s)}}),document.addEventListener("change",r=>{let i=r.target.closest(".mirk-image__input");if(!i||!i.files.length)return;let l=i.closest(".mirk-image"),a=l.querySelector(".mirk-image__preview");if(!a)return;let o=l.querySelector(".mirk-image__placeholder"),n=new FileReader;n.onload=s=>{a.src=s.target.result,a.removeAttribute("hidden"),o&&o.setAttribute("hidden",""),l.querySelector(".mirk-image__thumb")?.removeAttribute("hidden"),l.querySelector(".mirk-image__upload")?.setAttribute("hidden","")},n.readAsDataURL(i.files[0])}),document.addEventListener("click",r=>{let i=r.target.closest(".mirk-file__remove");if(i){let a=i.closest(".mirk-file"),o=a?.querySelector(".mirk-file__input"),n=a?.querySelector(".mirk-file__name");if(o&&(o.value=""),n){let s=document.createElement("span");s.className="mirk-file__name",s.textContent="No file chosen",n.replaceWith(s)}i.remove();return}let l=r.target.closest(".mirk-image__remove");if(l){let a=l.closest(".mirk-image"),o=a?.querySelector(".mirk-image__input"),n=a?.querySelector(".mirk-image__preview");o&&(o.value=""),n&&(n.removeAttribute("src"),n.setAttribute("hidden","")),a?.querySelector(".mirk-image__thumb")?.setAttribute("hidden",""),a?.querySelector(".mirk-image__upload")?.removeAttribute("hidden")}});function t(r,i){let l=document.createElement("span");l.textContent=r;let a=document.createElement("input");a.type="hidden",a.name="tags[]",a.value=r;let o=document.createElement("button");o.type="button",o.className="mirk-tags__remove",o.textContent="\xD7";let n=document.createElement("span");if(n.className="mirk-tags__chip",i){let s=document.createElement("span");s.className="mirk-tags__chip-inner",s.append(l,a,o),n.append(s)}else n.append(l,a,o);return n}document.addEventListener("keydown",r=>{let i=r.target.closest(".mirk-tags__input");if(!i)return;let l=i.closest(".mirk-tags");if(r.key==="Enter"||r.key===","){let a=i.value.trim();if(!a)return;r.preventDefault(),i.before(t(a,l.classList.contains("mirk-tags--round"))),i.value=""}else if(r.key==="Backspace"&&!i.value){let a=l.querySelectorAll(".mirk-tags__chip");a[a.length-1]?.remove()}}),document.addEventListener("click",r=>{let i=r.target.closest(".mirk-tags__remove");if(i){i.closest(".mirk-tags__chip").remove();return}let l=r.target.closest(".mirk-tags");l&&r.target===l&&l.querySelector(".mirk-tags__input")?.focus()}),document.addEventListener("click",r=>{let i=r.target.closest("[data-mirk-chip]");if(!i)return;let l=i.getAttribute("data-mirk-chip");if(l==="open")i.closest(".mirk-chip")?.classList.add("mirk-chip--open");else if(l==="collapse")i.closest(".mirk-chip")?.classList.remove("mirk-chip--open");else if(l==="changes"){let a=i.closest(".mirk-chip__panel")?.classList.toggle("is-changes");i.textContent=a?"(hide changes)":"(view changes)"}}),document.addEventListener("click",r=>{let i=r.target.closest("[data-copy-btn]");if(!i)return;let l=i.closest("[data-copy]");if(!l)return;let a=l.cloneNode(!0);a.querySelectorAll("[data-copy-btn]").forEach(n=>n.remove());let o=l.getAttribute("data-copy")==="text"?a.textContent.replace(/^\s+|\s+$/g,""):a.innerHTML.replace(/\s+data-copy(="[^"]*")?/g,"").replace(/^\s*\n/gm,"").trim();navigator.clipboard.writeText(o).then(()=>{let n=i.textContent;i.textContent="copied",i.dataset.copied="",setTimeout(()=>{i.textContent=n,delete i.dataset.copied},1200)}).catch(()=>{i.textContent="error",setTimeout(()=>{i.textContent="copy"},1200)})})})();ah(gh);var jr=Ra,bh={cms:Ra};typeof window<"u"&&!window.__hyperclayNoAutoExport&&(window.hyperclay=window.hyperclay||{},window.hyperclay.hypercms=jr,window.h=window.hyperclay);var Ee=jr,kh=Di;Ur("cms",Vr);var Et=(e,t)=>Object.assign(new Error(`clay:cms: ${e}`),{code:t}),vh=e=>e?e.signal?.aborted?!0:typeof e.isCurrent=="function"&&!e.isCurrent():!1;function qa(e){let t=!1;return{ready:e.ready,enable(){t||e.enable()},quiesce(){if(t)return;let r=e.quiesce();if(r&&r.ok===!1)throw Object.assign(Et("the CMS still has work to finish",r.code||"pending-input"),{pending:r.pending});return r},resume(){t||e.resume()},dispose(){t||(t=!0,e.dispose())}}}function yh(){if(Ee.isOpen)throw Et("the CMS this boot opened cannot be taken back","unsupported-plugin");let e=qa(Ee.prepareModeLease({}));return{enable(){},quiesce:()=>e.quiesce(),resume:()=>e.resume(),dispose:()=>e.dispose()}}function Vh(e={}){return{id:"clay:cms",order:1e3,async prepare(t={}){if(typeof Ee.prepareModeLease!="function")throw Et("this vendor build has no quiescable session","unsupported-plugin");if(vh(t))throw Et("prepared for a stale generation","stale-document");return t.initial===!0?yh():qa(Ee.prepareModeLease(e))}}}export{Ee as cms,Vh as cmsParticipant,kh as default,Vh as modeParticipant};