@panphora/clayjs 1.24.1 → 1.25.1

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 (275) 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 +6060 -4662
  11. package/dist/m/attrs/{refetch-on-save-DPGJJMGN.js → refetch-on-save-5CBFUJUF.js} +1 -1
  12. package/dist/m/attrs/save-freeze-PUYX32AK.js +1 -0
  13. package/dist/m/{c-HIX5H5L7.js → c-2A2ATCIH.js} +1 -1
  14. package/dist/m/{c-BOMQIQ3V.js → c-2EFMJYGJ.js} +1 -1
  15. package/dist/m/{c-MP6S4AZU.js → c-2GB34XL4.js} +2 -2
  16. package/dist/m/c-2TJCFPX4.js +4 -0
  17. package/dist/m/c-33SS5A4Y.js +1 -0
  18. package/dist/m/{c-PCNJETUA.js → c-34J5HC7N.js} +1 -1
  19. package/dist/m/{c-AT7GLQGV.js → c-3AAQJAKJ.js} +1 -1
  20. package/dist/m/c-3F3AADKG.js +1 -0
  21. package/dist/m/{c-HL6BLJNA.js → c-3WX5FABT.js} +1 -1
  22. package/dist/m/c-3XNTQQEJ.js +1 -0
  23. package/dist/m/{c-ZRGEN6QQ.js → c-3Y234AUB.js} +2 -2
  24. package/dist/m/{c-SUXHUL7U.js → c-42RLKGEY.js} +1 -1
  25. package/dist/m/{c-2BLVA6IN.js → c-44WITKWQ.js} +1 -1
  26. package/dist/m/c-47M4QHCK.js +1 -0
  27. package/dist/m/{c-UOUUI265.js → c-4M2T676V.js} +1 -1
  28. package/dist/m/{c-SXGEWPFC.js → c-4NAYDOWH.js} +1 -1
  29. package/dist/m/{c-OCYG4NBQ.js → c-4OZZ7ENT.js} +2 -2
  30. package/dist/m/{c-UOOIF2AL.js → c-5IIEOPIV.js} +1 -1
  31. package/dist/m/{c-YDW4VCHP.js → c-755ZOHOM.js} +1 -1
  32. package/dist/m/c-7Q4XYDF4.js +1 -0
  33. package/dist/m/c-7RHOMAMR.js +1 -0
  34. package/dist/m/{c-7V6MGMX2.js → c-7Z2625LX.js} +1 -1
  35. package/dist/m/{c-CTGRDT6E.js → c-A3OKSYRI.js} +1 -1
  36. package/dist/m/{c-GNI7WHKF.js → c-A5IYL7JI.js} +1 -1
  37. package/dist/m/c-A5LASUEZ.js +1 -0
  38. package/dist/m/c-AQVQKFKB.js +1 -0
  39. package/dist/m/{c-FLEIU6CG.js → c-ASGHHLFX.js} +1 -1
  40. package/dist/m/c-ASMLERFA.js +7 -0
  41. package/dist/m/{c-LUXAB2XI.js → c-AZM34SPO.js} +1 -1
  42. package/dist/m/{c-ZFO5RW6G.js → c-BHLYQGTA.js} +1 -1
  43. package/dist/m/{c-C5AKJVRH.js → c-BJ2RRQBQ.js} +1 -1
  44. package/dist/m/{c-FVPNX2GO.js → c-C27EVUQ6.js} +1 -1
  45. package/dist/m/{c-DFKBGSN2.js → c-C5UGNOC2.js} +1 -1
  46. package/dist/m/c-C6DXZIXD.js +1 -0
  47. package/dist/m/{c-EDE45NM7.js → c-C7SUMNMI.js} +1 -1
  48. package/dist/m/{c-STRI73GQ.js → c-CL5LSATX.js} +1 -1
  49. package/dist/m/c-CPRGR2II.js +1 -0
  50. package/dist/m/{c-NFQFV7OP.js → c-D2OPWOWO.js} +1 -1
  51. package/dist/m/{c-ZKKAF4UT.js → c-D4N4UJCQ.js} +2 -2
  52. package/dist/m/{c-6LEYVQJK.js → c-DAUQ6JZ3.js} +1 -1
  53. package/dist/m/{c-ZGCO4J3H.js → c-DDCYVLGG.js} +1 -1
  54. package/dist/m/{c-KQKKIVLW.js → c-DVMDYRAE.js} +1 -1
  55. package/dist/m/{c-OG6GFSUX.js → c-DYTBSJBI.js} +1 -1
  56. package/dist/m/{c-P2HKMJAW.js → c-EAV7A6BT.js} +1 -1
  57. package/dist/m/{c-X75G43SZ.js → c-EEWPNUM2.js} +1 -1
  58. package/dist/m/c-EHAR4RJJ.js +3 -0
  59. package/dist/m/c-EIDZHQHZ.js +1 -0
  60. package/dist/m/c-ELXMSEN5.js +1 -0
  61. package/dist/m/{c-QQFHEODI.js → c-EQ5NBOGA.js} +1 -1
  62. package/dist/m/c-FC5RUFPR.js +1 -0
  63. package/dist/m/{c-ND3Q2G2I.js → c-GFASNR55.js} +1 -1
  64. package/dist/m/{c-A4L7APIU.js → c-GNFDX6SU.js} +1 -1
  65. package/dist/m/{c-LATNQ6Q5.js → c-H3M6UDNV.js} +1 -1
  66. package/dist/m/{c-YLHTD3KX.js → c-H4M2T4A6.js} +1 -1
  67. package/dist/m/{c-DDS23EY6.js → c-HXGNH6GY.js} +1 -1
  68. package/dist/m/{c-PDBNCJCT.js → c-HYNM5U6B.js} +1 -1
  69. package/dist/m/c-J2YYLEVM.js +1 -0
  70. package/dist/m/c-J2ZW4HMR.js +1 -0
  71. package/dist/m/{c-WCG6AKA7.js → c-JC4RZW4E.js} +1 -1
  72. package/dist/m/c-K2ZHQMPF.js +1 -0
  73. package/dist/m/{c-6IJEVE6B.js → c-KU3PX7LL.js} +1 -1
  74. package/dist/m/{c-YYMZWQLR.js → c-L6KVXPBO.js} +1 -1
  75. package/dist/m/{c-CV4T65JE.js → c-LUBZU4AZ.js} +4 -4
  76. package/dist/m/{c-5FXEKU4Y.js → c-LYNLY3MR.js} +1 -1
  77. package/dist/m/{c-NQAPWM7O.js → c-MHTO3QAD.js} +1 -1
  78. package/dist/m/{c-HDVH3MVC.js → c-MKAUC6DB.js} +1 -1
  79. package/dist/m/c-MLMJUNRV.js +1 -0
  80. package/dist/m/c-MMEVDN6D.js +1 -0
  81. package/dist/m/c-MOP5KBWZ.js +1 -0
  82. package/dist/m/{c-LA2BW7UY.js → c-MZCOGNZL.js} +1 -1
  83. package/dist/m/{c-XW5TIYYB.js → c-N4GEJMXW.js} +1 -1
  84. package/dist/m/{c-RS77ODLY.js → c-NL4I4KNG.js} +1 -1
  85. package/dist/m/{c-2PVGJFI5.js → c-NW4ZFKCY.js} +1 -1
  86. package/dist/m/{c-PYG2NGWU.js → c-O3DPFZCE.js} +1 -1
  87. package/dist/m/c-O4YIDULY.js +1 -0
  88. package/dist/m/{c-LTSPHVAK.js → c-OBMZASYQ.js} +1 -1
  89. package/dist/m/c-OZOACVUD.js +1 -0
  90. package/dist/m/{c-YK2L436K.js → c-OZVK3TFI.js} +1 -1
  91. package/dist/m/c-P73XPAOA.js +1 -0
  92. package/dist/m/c-PP3CUF3U.js +1 -0
  93. package/dist/m/{c-B7GOFGQR.js → c-Q2CB57UG.js} +1 -1
  94. package/dist/m/{c-TWCXBWS3.js → c-QCDVDZIR.js} +1 -1
  95. package/dist/m/{c-LSVN3OLG.js → c-QL4NYM2L.js} +1 -1
  96. package/dist/m/c-RES2S5Q3.js +1 -0
  97. package/dist/m/c-RFGELYEU.js +2 -0
  98. package/dist/m/c-RGFPLQGV.js +1 -0
  99. package/dist/m/c-SMLAJASY.js +1 -0
  100. package/dist/m/{c-MQKSKQHG.js → c-STAPQ2X6.js} +1 -1
  101. package/dist/m/c-SYVF6ZMF.js +1 -0
  102. package/dist/m/{c-SE3SIY7Y.js → c-T5IWJOMW.js} +1 -1
  103. package/dist/m/{c-DD26VXAP.js → c-T7LOTEWO.js} +1 -1
  104. package/dist/m/{c-47IBJGPQ.js → c-TWB5ZQU4.js} +1 -1
  105. package/dist/m/c-U35T5NAY.js +1 -0
  106. package/dist/m/c-U4TWEIKZ.js +1 -0
  107. package/dist/m/c-UW6MMZ4V.js +1 -0
  108. package/dist/m/{c-JWDCQL6J.js → c-V5L6HWVL.js} +1 -1
  109. package/dist/m/c-VGG3UR7I.js +1 -0
  110. package/dist/m/{c-CZHTXGJS.js → c-VO6RSFCO.js} +1 -1
  111. package/dist/m/c-VU4WEWPH.js +4 -0
  112. package/dist/m/c-W7LWCJHD.js +1 -0
  113. package/dist/m/c-WOJ2RTV4.js +1 -0
  114. package/dist/m/{c-T3P3AXEW.js → c-WOWGGNCJ.js} +1 -1
  115. package/dist/m/{c-6RGEQNVV.js → c-XCOQNISP.js} +1 -1
  116. package/dist/m/{c-SGGGCIVD.js → c-XS7G6U3Z.js} +1 -1
  117. package/dist/m/{c-4PO3YGDC.js → c-Y3J5LDKB.js} +1 -1
  118. package/dist/m/c-Y3MPVURA.js +1 -0
  119. package/dist/m/c-Y6HH7LTM.js +1 -0
  120. package/dist/m/{c-RO73MKKR.js → c-YRDKVEGR.js} +1 -1
  121. package/dist/m/{c-FEC6LGFF.js → c-YZGWSCMT.js} +1 -1
  122. package/dist/m/{c-7CM4GMTS.js → c-ZJ7726FO.js} +1 -1
  123. package/dist/m/{c-SKMIR5HQ.js → c-ZPI7M5U5.js} +1 -1
  124. package/dist/m/core/{admin-attrs-ONRWVXPK.js → admin-attrs-43JBA6JB.js} +1 -1
  125. package/dist/m/core/{autosave-TBKAAAFB.js → autosave-HD7Y7UNV.js} +1 -1
  126. package/dist/m/core/{conflict-notice-FOEE6I7E.js → conflict-notice-Y2NTMDGJ.js} +1 -1
  127. package/dist/m/core/draft-mode-M5XNYBMY.js +1 -0
  128. package/dist/m/core/{host-permission-X4BENZEU.js → host-permission-5BYP24GC.js} +1 -1
  129. package/dist/m/core/{is-edit-mode-FFHCQ5DR.js → is-edit-mode-73OXKK5H.js} +1 -1
  130. package/dist/m/core/{persist-6ILUR34S.js → persist-MX3VYVBN.js} +1 -1
  131. package/dist/m/core/{recovery-APWADU4K.js → recovery-VZF7RJZF.js} +1 -1
  132. package/dist/m/core/{save-6HT2LABE.js → save-JZ7R4ET2.js} +1 -1
  133. package/dist/m/core/{save-core-EVMNZQ4V.js → save-core-I4N6S4ED.js} +1 -1
  134. package/dist/m/core/{site-edits-G4BOZMV4.js → site-edits-TIJDPG6H.js} +1 -1
  135. package/dist/m/core/{snapshot-FJP5IJL3.js → snapshot-N5MKDGNI.js} +1 -1
  136. package/dist/m/core/unsaved-warning-BP6ZY3PG.js +1 -0
  137. package/dist/m/events/{index-B6TGDYMG.js → index-YKQIBZE5.js} +1 -1
  138. package/dist/m/internals/index-3LAVREAU.js +1 -0
  139. package/dist/m/lib/{cache-bust-NH7VBWHO.js → cache-bust-BL4KUQAJ.js} +1 -1
  140. package/dist/m/{loader-GLLVDUZA.js → loader-7ORQVRCK.js} +1 -1
  141. package/dist/m/manifest-A27A4278.js +1 -0
  142. package/dist/m/manifest-edit-E8A61EB4.js +1 -0
  143. package/dist/m/manifest.json +1608 -1498
  144. package/dist/m/options/{options-55LQHSJ4.js → options-LKIZ7YTG.js} +1 -1
  145. package/dist/m/page/{editor-KAZDJNND.js → editor-HS2CAV3W.js} +5 -5
  146. package/dist/m/plugins/{ai-edit-LABECCSN.js → ai-edit-WDV2GLDU.js} +2 -2
  147. package/dist/m/plugins/{cms-T2HLI7JG.js → cms-4KET6RZT.js} +9 -9
  148. package/dist/m/plugins/{demo-T7B4RIKL.js → demo-LMCMBILC.js} +1 -1
  149. package/dist/m/plugins/{derive-6LPJOCAV.js → derive-R4USHZ7P.js} +1 -1
  150. package/dist/m/plugins/{indicator-J4ABFARX.js → indicator-OLPZ4WFI.js} +1 -1
  151. package/dist/m/plugins/{live-PGBIEMGB.js → live-CO4VJS46.js} +1 -1
  152. package/dist/m/plugins/{menu-YZL3X2AJ.js → menu-ESEFQARM.js} +1 -1
  153. package/dist/m/plugins/{page-WOCNX2IN.js → page-L3VKIQU2.js} +2 -2
  154. package/dist/m/plugins/{page-view-SJODOOGE.js → page-view-6KNTXABH.js} +1 -1
  155. package/dist/m/plugins/{people-C4TCWFOQ.js → people-EBWE337I.js} +1 -1
  156. package/dist/m/plugins/quickcrop-VNRXGRPC.js +26 -0
  157. package/dist/m/plugins/{richclay-Y2NV44NA.js → richclay-V6WKJTUF.js} +17 -17
  158. package/dist/m/plugins/sortable-BAG3MSWS.js +1 -0
  159. package/dist/m/plugins/{source-YK7MO23W.js → source-OYHDXKTB.js} +1 -1
  160. package/dist/m/plugins/undo-WUK2NLBA.js +1 -0
  161. package/dist/m/plugins/{upgrade-NNTJBSK2.js → upgrade-SZQJYEQQ.js} +1 -1
  162. package/dist/m/plugins/{upload-ZKKJV76X.js → upload-NZET3DNQ.js} +1 -1
  163. package/dist/m/plugins/visitor-drafts-ZE6PCAFP.js +20 -0
  164. package/dist/m/plugins/{visitor-drafts-owner-LHUHFU3L.js → visitor-drafts-owner-TLECTYWS.js} +1 -1
  165. package/dist/m/plugins/{visitor-menu-FY4KM2SW.js → visitor-menu-5XY57JQA.js} +1 -1
  166. package/dist/m/plugins/wire-S5ATC4QI.js +1 -0
  167. package/dist/m/reader-core-AHOAP5DH.js +77 -0
  168. package/dist/m/sync/live-sync-DX4K5GDB.js +1 -0
  169. package/dist/m/ui/index-G7ZJXNMG.js +1 -0
  170. package/dist/m/vendor/sap-core.vendor-5TWOJYVM.js +7 -0
  171. package/dist/offline-manifest.json +844 -784
  172. package/dist/server/core.cjs +4245 -2614
  173. package/dist/server/markdown.cjs +1 -0
  174. package/dist/server/markdown.mjs +7 -0
  175. package/docs/guide.md +27 -37
  176. package/entries/clay-data.js +1 -1
  177. package/entries/sap.js +6 -5
  178. package/package.json +6 -2
  179. package/packed-contract.json +3 -0
  180. package/src/attrs/save-freeze.js +1 -1
  181. package/src/core/admin-contenteditable.js +1 -1
  182. package/src/core/admin-inputs.js +1 -1
  183. package/src/core/admin-onclick.js +1 -1
  184. package/src/core/admin-resources.js +5 -2
  185. package/src/core/conflict-notice-ui.js +59 -34
  186. package/src/core/draft-mode.js +5 -0
  187. package/src/core/save-core.js +10 -10
  188. package/src/core/save.js +10 -10
  189. package/src/core/snapshot.js +56 -43
  190. package/src/core/stale-host-notice.js +20 -7
  191. package/src/lib/dirty-gate.js +19 -0
  192. package/src/page/editor.js +10 -4
  193. package/src/page/import-markdown.js +22 -8
  194. package/src/page/save-projection.js +1 -1
  195. package/src/plugins/menu/visitor.js +33 -1
  196. package/src/plugins/quickcrop.js +128 -69
  197. package/src/plugins/sortable.js +25 -9
  198. package/src/plugins/visitor-drafts/commit.js +50 -3
  199. package/src/plugins/visitor-drafts/idb.js +8 -2
  200. package/src/plugins/visitor-drafts/recovery-menu.js +118 -0
  201. package/src/plugins/visitor-drafts/recovery.js +64 -0
  202. package/src/plugins/visitor-drafts/session.js +61 -13
  203. package/src/plugins/visitor-drafts/store.js +44 -8
  204. package/src/plugins/visitor-drafts.js +34 -5
  205. package/src/server/markdown/index.js +23 -0
  206. package/src/sync/conflicts.js +3 -1
  207. package/src/sync/data-guard-notice.js +137 -18
  208. package/src/sync/live-sync.js +1 -1
  209. package/src/sync/wire-profile.js +9 -4
  210. package/src/ui/bevel-controls.js +4 -1
  211. package/src/ui/dialogs.js +11 -7
  212. package/src/ui/modal.js +9 -7
  213. package/src/ui/toast.js +67 -32
  214. package/src/vendor/hyper-html-api-data.vendor.js +1 -1
  215. package/src/vendor/hyper-html-api-upgrade.vendor.js +2 -2
  216. package/src/vendor/hyper-undo.vendor.js +1 -1
  217. package/src/vendor/hypercms.vendor.js +7 -7
  218. package/src/vendor/richclay.vendor.js +16 -16
  219. package/src/vendor/sap-core.vendor.js +6 -5
  220. package/src/vendor/sap-ownership.vendor.js +181 -11
  221. package/tool-generation/context.md +69 -0
  222. package/tool-generation/system.md +2 -2
  223. package/dist/m/attrs/save-freeze-JZHKRQLR.js +0 -1
  224. package/dist/m/c-277QP5ET.js +0 -1
  225. package/dist/m/c-3UW5EJ77.js +0 -1
  226. package/dist/m/c-42ZNV7LI.js +0 -7
  227. package/dist/m/c-6Q6RGFBF.js +0 -1
  228. package/dist/m/c-APGHGDZM.js +0 -1
  229. package/dist/m/c-BGN7RCTJ.js +0 -1
  230. package/dist/m/c-CJ7QYEWI.js +0 -1
  231. package/dist/m/c-CVSWLX3X.js +0 -1
  232. package/dist/m/c-DXPOFLEJ.js +0 -1
  233. package/dist/m/c-EILLN2H2.js +0 -1
  234. package/dist/m/c-EODTTNVA.js +0 -1
  235. package/dist/m/c-ESK4S67I.js +0 -1
  236. package/dist/m/c-FDWR3FL7.js +0 -1
  237. package/dist/m/c-FYDKYW6E.js +0 -1
  238. package/dist/m/c-HKSLOVU4.js +0 -1
  239. package/dist/m/c-HTLYXCUH.js +0 -1
  240. package/dist/m/c-IUL7PU4P.js +0 -1
  241. package/dist/m/c-JQF2EUCG.js +0 -1
  242. package/dist/m/c-MFOSMAVM.js +0 -3
  243. package/dist/m/c-MQYEDF3Q.js +0 -1
  244. package/dist/m/c-MR75YPRT.js +0 -1
  245. package/dist/m/c-NHXOBD6A.js +0 -1
  246. package/dist/m/c-NVU3DORS.js +0 -1
  247. package/dist/m/c-OYHI67B6.js +0 -1
  248. package/dist/m/c-PWJSJEJU.js +0 -1
  249. package/dist/m/c-QENKN7QI.js +0 -1
  250. package/dist/m/c-R23UHMXG.js +0 -1
  251. package/dist/m/c-SGH3UTF3.js +0 -1
  252. package/dist/m/c-SXNSSHPP.js +0 -1
  253. package/dist/m/c-TFLRT5JX.js +0 -1
  254. package/dist/m/c-U4NTUVDZ.js +0 -1
  255. package/dist/m/c-V2U3F4QX.js +0 -1
  256. package/dist/m/c-VG5XIN4T.js +0 -1
  257. package/dist/m/c-VHSMPITY.js +0 -1
  258. package/dist/m/c-Z4G2UK6T.js +0 -4
  259. package/dist/m/core/draft-mode-4MCL3LYI.js +0 -1
  260. package/dist/m/core/unsaved-warning-ITZDIZ2I.js +0 -1
  261. package/dist/m/internals/index-HS3CQDFW.js +0 -1
  262. package/dist/m/manifest-50FF1C45.js +0 -1
  263. package/dist/m/manifest-edit-BE1A621D.js +0 -1
  264. package/dist/m/plugins/quickcrop-X5MRIBAP.js +0 -26
  265. package/dist/m/plugins/sortable-XCHQG65Z.js +0 -1
  266. package/dist/m/plugins/undo-VLRBQNPN.js +0 -1
  267. package/dist/m/plugins/visitor-drafts-RTZNONHT.js +0 -20
  268. package/dist/m/plugins/wire-M2NR354P.js +0 -1
  269. package/dist/m/reader-core-T2S3JC4E.js +0 -77
  270. package/dist/m/sync/live-sync-Z64YREWQ.js +0 -1
  271. package/dist/m/ui/index-MGTWOW2C.js +0 -1
  272. package/dist/m/vendor/sap-core.vendor-QAEPMETX.js +0 -6
  273. /package/dist/m/{c-QTTJYJMA.js → c-FILLTJA7.js} +0 -0
  274. /package/dist/m/plugins/{quickcrop-X5MRIBAP.js.LEGAL.txt → quickcrop-VNRXGRPC.js.LEGAL.txt} +0 -0
  275. /package/dist/m/plugins/{richclay-Y2NV44NA.js.LEGAL.txt → richclay-V6WKJTUF.js.LEGAL.txt} +0 -0
@@ -0,0 +1,26 @@
1
+ import{a as st,b as dt,c as lt}from"../c-OZOACVUD.js";import{d as ct}from"../c-QHWJ5ZIJ.js";import{a as pt}from"../c-D2OPWOWO.js";import{c as at}from"../c-J2ZW4HMR.js";import{a as K,e as rt,f as it}from"../c-A5LASUEZ.js";import"../c-4JZDZFF6.js";import"../c-5RZNFTWD.js";import"../c-PKCCHJ5X.js";import"../c-46XYM55L.js";import{a as Y}from"../c-NUHP2XDB.js";import"../c-VHNSBD2M.js";var Mt=":root{--qc-surface:#f7f2ea;--qc-surface-hover:#efe7d8;--qc-border:#cdbfa6;--qc-text:#2b241b;--qc-text-hover:#463c2e;--qc-on-dark:#efe7d8;--qc-overlay:rgba(43,36,27,.6);--qc-dim:rgba(0,0,0,.55);--qc-radius:8px;--qc-crop-line:#fff;--qc-font:ui-sans-serif,system-ui,sans-serif;}.qc-css-probe{position:absolute;}.qc-backdrop{position:fixed;inset:0;background:var(--qc-overlay);display:grid;place-items:center;z-index:1000;animation:qc-fade .15s ease;}@keyframes qc-fade{from{opacity:0}}.qc-modal{background:var(--qc-surface);border:1px solid var(--qc-border);border-radius:var(--qc-radius);padding:16px;max-width:92vw;font-family:var(--qc-font);}.qc-bar{display:flex;justify-content:flex-end;gap:10px;margin-top:12px;}.qc-btn{font:inherit;font-family:var(--qc-font);font-size:.85rem;padding:.3rem .75rem;border:1px solid var(--qc-border);border-radius:6px;background:var(--qc-surface);color:var(--qc-text);cursor:pointer;}.qc-btn:hover{background:var(--qc-surface-hover);}.qc-btn-primary{background:var(--qc-text);border-color:var(--qc-text);color:var(--qc-on-dark);font-weight:600;}.qc-btn-primary:hover{background:var(--qc-text-hover);border-color:var(--qc-text-hover);}.qc-stage{position:relative;line-height:0;user-select:none;-webkit-user-select:none;touch-action:none;}.qc-stage img{display:block;max-width:100%;pointer-events:none;}.qc-dim{position:absolute;inset:0;background:var(--qc-dim);pointer-events:none;}.qc-box{position:absolute;cursor:move;outline:1px solid var(--qc-crop-line);background:linear-gradient(var(--qc-crop-line),var(--qc-crop-line)) 0 33.33%/100% 1px no-repeat,linear-gradient(var(--qc-crop-line),var(--qc-crop-line)) 0 66.66%/100% 1px no-repeat,linear-gradient(var(--qc-crop-line),var(--qc-crop-line)) 33.33% 0/1px 100% no-repeat,linear-gradient(var(--qc-crop-line),var(--qc-crop-line)) 66.66% 0/1px 100% no-repeat;background-blend-mode:overlay;}.qc-handle{position:absolute;box-sizing:border-box;width:28px;height:28px;border:7px solid transparent;background:var(--qc-crop-line);background-clip:padding-box;border-radius:9px;}.qc-nw{left:-14px;top:-14px;cursor:nwse-resize;}.qc-ne{right:-14px;top:-14px;cursor:nesw-resize;}.qc-sw{left:-14px;bottom:-14px;cursor:nesw-resize;}.qc-se{right:-14px;bottom:-14px;cursor:nwse-resize;}.qc-mount{line-height:0;}",Lt=["image/jpeg","image/png","image/webp"];var $=!1;function C(t,n="",e=""){let o=document.createElement(t);return n&&(o.className=n),e&&(o.textContent=e),o}function T(t,n,e){t.style.setProperty(n,e,"important")}function Ct(t){return String(t).replace(/[&<>"']/g,n=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[n])}function Q(){if(document.querySelector("style[data-quickcrop]"))return;let t=C("div","qc-css-probe");t.style.display="none",document.body.append(t);let n=getComputedStyle(t).position==="absolute";if(t.remove(),n)return;let e=document.createElement("style");e.setAttribute("data-quickcrop",""),e.setAttribute("save-remove",""),e.setAttribute("snapshot-remove",""),e.textContent=Mt,document.head.append(e)}var N={open({content:t,confirmLabel:n,onConfirm:e,onCancel:o}){Q();let r=C("div","qc-backdrop");r.setAttribute("save-remove",""),r.setAttribute("snapshot-remove","");let p=C("div","qc-modal"),a=C("div","qc-bar"),c=C("button","qc-btn qc-btn-primary",n);c.type="button",a.append(c),p.append(t,a),r.append(p),document.body.append(r);let h=b=>{b.key==="Escape"&&o()};return document.addEventListener("keydown",h),c.onclick=()=>e(),r.onclick=b=>{b.target===r&&o()},c.focus(),{close(){document.removeEventListener("keydown",h),r.remove()}}}};function mt(t){return!!t&&typeof t=="object"&&typeof t.open=="function"&&typeof t.close=="function"&&typeof t.onYes=="function"&&"html"in t}var St='<svg viewBox="0 0 134 134" xmlns="http://www.w3.org/2000/svg"><path class="micromodal__close-bg" d="M132 132.5 1 1.5h131v131Z"/><path d="M83 27l24 24M107 27L83 51" stroke="#fff" stroke-width="6"/></svg>';function ut(t){let n=()=>t.isShowing&&!!document.querySelector(".micromodal-parent");return{fit(){if(n())return null;let e=window.innerWidth>=640?128:80;return{width:Math.max(120,Math.min(550,window.innerWidth-32)-4-e),height:Math.max(120,window.innerHeight-220)}},open(e){if(n())return N.open(e);let{content:o,confirmLabel:r,onConfirm:p,onCancel:a}=e;Q();let c=!1,h=w=>{c||(c=!0,document.removeEventListener("keydown",b,!0),w())},b=w=>{w.key==="Escape"&&(w.stopPropagation(),a())};return t.html='<div class="qc-mount"></div>',t.yes=Ct(r),t.no="",t.closeHtml=St,t.disableFocus=!0,t.onOpen(()=>{document.querySelector(".micromodal__content .qc-mount")?.append(o),document.querySelector(".micromodal-parent .micromodal__yes")?.focus(),document.addEventListener("keydown",b,!0)}),t.onYes(()=>(h(p),!0)),t.onNo(()=>{h(a)}),t.open(),{close(){c||(c=!0,document.removeEventListener("keydown",b,!0),t.close())}}}}}function At(t){if(t==="builtin")return N;if(t&&typeof t=="object"){if(mt(t))return ut(t);if(typeof t.open=="function")return t;throw new TypeError('quickcrop: modal must be "auto", "builtin", a themodal instance, or an adapter with open()')}if(t==="auto")return mt(window.themodal)?ut(window.themodal):N;throw new TypeError('quickcrop: modal must be "auto", "builtin", a themodal instance, or an adapter with open()')}function Ft(t,n={}){let{aspect:e=null,type:o,quality:r=.92,maxWidth:p=null,maxHeight:a=null,minSize:c=40,labels:h={},modal:b="auto"}=n,{confirm:w="Crop"}=h;if(!(t instanceof Blob))return Promise.reject(new TypeError("quickcrop: expected a File or Blob"));if($)return Promise.reject(new Error("quickcrop: already open"));let S;try{S=At(b)}catch(R){return Promise.reject(R)}$=!0;let A=o||(Lt.includes(t.type)?t.type:"image/png"),F=URL.createObjectURL(t),s=new Image;return new Promise((R,B)=>{s.onerror=()=>{URL.revokeObjectURL(F),$=!1,B(new Error("quickcrop: could not decode image"))};function g(){let _=S.fit?S.fit():null,xt=Math.max(1,Math.min(_?.width??window.innerWidth*.86,s.naturalWidth)),yt=Math.max(1,_?.height??window.innerHeight*.72),G=Math.min(xt/s.naturalWidth,yt/s.naturalHeight,1),L=Math.max(1,Math.round(s.naturalWidth*G)),v=Math.max(1,Math.round(s.naturalHeight*G)),U=Math.min(c,L,v);Q();let x=C("div","qc-stage");T(s,"width",L+"px"),T(s,"height",v+"px");let J=C("div","qc-dim"),z=C("div","qc-box");for(let i of["nw","ne","sw","se"])z.appendChild(C("div","qc-handle qc-"+i));x.append(s,J,z);let d,l;e?(d=Math.min(L,v*e),l=d/e,l>v&&(l=v,d=l*e)):(d=L,l=v);let k=(L-d)/2,E=(v-l)/2;V();function V(){T(z,"left",k+"px"),T(z,"top",E+"px"),T(z,"width",d+"px"),T(z,"height",l+"px"),T(J,"clip-path",`polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 0, ${k}px ${E}px, ${k}px ${E+l}px, ${k+d}px ${E+l}px, ${k+d}px ${E}px, ${k}px ${E}px)`)}let D=(i,q,u)=>Math.max(q,Math.min(u,i));x.addEventListener("pointerdown",i=>{let q=i.target.closest(".qc-handle"),u=i.target===z;if(!q&&!u)return;i.preventDefault(),x.setPointerCapture(i.pointerId);let m={px:i.clientX,py:i.clientY,x:k,y:E,w:d,h:l},f=q&&[...q.classList].find(W=>/^qc-(nw|ne|sw|se)$/.test(W))?.slice(3),y=W=>{if(!f)k=D(m.x+(W.clientX-m.px),0,L-d),E=D(m.y+(W.clientY-m.py),0,v-l);else{let H=f.includes("w")?m.x+m.w:m.x,O=f.includes("n")?m.y+m.h:m.y,I=f.includes("e"),X=f.includes("s"),tt=x.getBoundingClientRect(),et=Math.abs(W.clientX-(tt.left+H)),nt=Math.abs(W.clientY-(tt.top+O));if(e){let ot=Math.min(I?L-H:H,(X?v-O:O)*e),Et=Math.min(Math.max(U,U*e),ot);d=D(Math.max(et,nt*e),Et,ot),l=d/e}else d=D(et,U,I?L-H:H),l=D(nt,U,X?v-O:O);k=I?H:H-d,E=X?O:O-l}V()},M=()=>{x.removeEventListener("pointermove",y),x.removeEventListener("pointerup",M),x.removeEventListener("pointercancel",M)};x.addEventListener("pointermove",y),x.addEventListener("pointerup",M),x.addEventListener("pointercancel",M)});function wt(){let i=s.naturalWidth/L,q=s.naturalHeight/v,u=Math.round(d*i),m=Math.round(l*q),f=1;p&&u>p&&(f=p/u),a&&m*f>a&&(f=a/m),u*f*m*f>16777216&&(f=Math.sqrt(16777216/(u*m)));let y=document.createElement("canvas");y.width=Math.max(1,Math.round(u*f)),y.height=Math.max(1,Math.round(m*f));let M=y.getContext("2d");if(!M)throw new Error("quickcrop: crop too large for a canvas");return A==="image/jpeg"&&(M.fillStyle="#fff",M.fillRect(0,0,y.width,y.height)),M.imageSmoothingQuality="high",M.drawImage(s,k*i,E*q,d*i,l*q,0,0,y.width,y.height),y}let j=!1,P=()=>j?!1:(j=!0,kt.close(),URL.revokeObjectURL(F),$=!1,!0),kt=S.open({content:x,confirmLabel:w,onConfirm(){if(j)return;let i,q;try{i=wt(),q=i.toDataURL(A,r)}catch(u){P()&&B(u);return}P()&&i.toBlob(u=>{if(!u){B(new Error("quickcrop: image encoding failed"));return}R({blob:u,dataURL:q,width:i.width,height:i.height})},A,r)},onCancel(){P()&&R(null)}})}s.onload=()=>{try{g()}catch(_){URL.revokeObjectURL(F),$=!1,B(_)}},s.src=F})}var Z=Ft;var ft=[".qc-stage",".qc-backdrop"],ht=`@layer clay-skin{
2
+ :is(.qc-stage, .qc-backdrop),:is(.qc-stage, .qc-backdrop) *{--qc-surface:light-dark(#FFFCF6, #11131E) !important;--qc-text:light-dark(#2B241B, #ECEAF2) !important;--qc-border:light-dark(#D8C8AF, #353B52) !important;--qc-radius:0px !important;--qc-font:system-ui,-apple-system,"Segoe UI",sans-serif !important;--qc-surface-hover:light-dark(#F4ECDF, #1A1D2C) !important;--qc-text-hover:color-mix(in srgb, light-dark(#2B241B, #ECEAF2), light-dark(#FDF8F0, #0B0C13) 12%) !important;--qc-on-dark:light-dark(#FDF8F0, #0B0C13) !important;--qc-overlay:color-mix(in srgb, light-dark(#FDF8F0, #0B0C13) 70%, transparent) !important;--qc-dim:rgba(0,0,0,.55) !important;--qc-crop-line:#fff !important}
3
+ .qc-stage{margin-inline:auto !important;inline-size:fit-content !important;background:light-dark(#F4ECDF, #1A1D2C) !important}
4
+ .qc-stage img{display:block !important;max-inline-size:100% !important}
5
+ .qc-backdrop{position:fixed !important;inset:0 !important;background:var(--qc-overlay) !important;display:grid !important;place-items:center !important;z-index:1000 !important;animation:qc-fade .15s ease !important}
6
+ .qc-modal{background:var(--qc-surface) !important;border:1px solid var(--qc-border) !important;border-radius:var(--qc-radius) !important;padding:16px !important;max-width:92vw !important;font-family:var(--qc-font) !important}
7
+ .qc-bar{display:flex !important;justify-content:flex-end !important;gap:10px !important;margin-top:12px !important}
8
+ .qc-btn{font:inherit !important;font-family:var(--qc-font) !important;font-size:.85rem !important;padding:.3rem .75rem !important;border:1px solid var(--qc-border) !important;border-radius:6px !important;background:var(--qc-surface) !important;color:var(--qc-text) !important;cursor:pointer !important}
9
+ .qc-btn:hover{background:var(--qc-surface-hover) !important}
10
+ .qc-btn-primary{background:var(--qc-text) !important;border-color:var(--qc-text) !important;color:var(--qc-on-dark) !important;font-weight:600 !important}
11
+ .qc-btn-primary:hover{background:var(--qc-text-hover) !important;border-color:var(--qc-text-hover) !important}
12
+ .qc-stage{position:relative !important;line-height:0 !important;user-select:none !important;-webkit-user-select:none !important;touch-action:none !important}
13
+ .qc-stage img{display:block !important;max-width:100% !important;pointer-events:none !important}
14
+ .qc-dim{position:absolute !important;inset:0 !important;background:var(--qc-dim) !important;pointer-events:none !important}
15
+ .qc-box{position:absolute !important;cursor:move !important;outline:1px solid var(--qc-crop-line) !important;background:linear-gradient(var(--qc-crop-line),var(--qc-crop-line)) 0 33.33%/100% 1px no-repeat,linear-gradient(var(--qc-crop-line),var(--qc-crop-line)) 0 66.66%/100% 1px no-repeat,linear-gradient(var(--qc-crop-line),var(--qc-crop-line)) 33.33% 0/1px 100% no-repeat,linear-gradient(var(--qc-crop-line),var(--qc-crop-line)) 66.66% 0/1px 100% no-repeat !important;background-blend-mode:overlay !important}
16
+ .qc-handle{position:absolute !important;box-sizing:border-box !important;width:28px !important;height:28px !important;border:7px solid transparent !important;background:var(--qc-crop-line) !important;background-clip:padding-box !important;border-radius:9px !important}
17
+ .qc-nw{left:-14px !important;top:-14px !important;cursor:nwse-resize !important}
18
+ .qc-ne{right:-14px !important;top:-14px !important;cursor:nesw-resize !important}
19
+ .qc-sw{left:-14px !important;bottom:-14px !important;cursor:nesw-resize !important}
20
+ .qc-se{right:-14px !important;bottom:-14px !important;cursor:nwse-resize !important}
21
+ .qc-mount{line-height:0 !important}
22
+ .qc-stage img[hidden]{display:none !important}
23
+ .qc-backdrop[hidden]{display:none !important}
24
+ .qc-bar[hidden]{display:none !important}
25
+ }`;var gt=844;pt("quickcrop",ht,{roots:ft});function Rt(t){return!!t&&typeof t=="object"&&typeof t.open=="function"&&typeof t.close=="function"&&typeof t.onYes=="function"&&"html"in t}var bt="Crop image";function qt(t,n,e=null){let o=lt({zIndex:"2147483001",width:`${gt}px`,closable:!0,titled:!0,theme:t,surface:"crop"});o.heading.textContent=bt,o.panel.setAttribute("aria-label",bt);let r=at(n,{variant:"primary",onClick:e,theme:t,parts:["dialog.button","crop.button"],labelParts:["dialog.buttonLabel","crop.buttonLabel"]});return o.footer.append(r),{...o,confirm:r}}function Bt(t,n){if(!K(n))return;let e=(o,r)=>{o&&(it(o,n,r),Y(o,rt(n,r,{})))};e(t,["crop.stage"]),e(t.querySelector(":scope > img"),["crop.image"]),e(t.querySelector(".qc-dim"),["crop.dim"]),e(t.querySelector(".qc-box"),["crop.selection"]);for(let o of["nw","ne","sw","se"])e(t.querySelector(`.qc-handle.qc-${o}`),["crop.handle",`crop.handle.${o}`])}function zt(t,n){let{root:e,overlay:o,panel:r,body:p}=qt(t,n);e.setAttribute("aria-hidden","true"),Y(e,["visibility:hidden","pointer-events:none"]),document.body.append(e);try{let a=S=>parseFloat(S)||0,c=getComputedStyle(o),h=getComputedStyle(p),b=p.clientWidth-a(h.paddingLeft)-a(h.paddingRight),w=o.clientHeight-a(c.paddingTop)-a(c.paddingBottom)-r.offsetHeight;return{width:Math.max(1,Math.floor(b)),height:Math.max(1,Math.floor(w))}}finally{e.remove()}}function vt({theme:t=null,confirmLabel:n="Crop"}={}){return{fit(){if(K(t))return zt(t,n);let e=document.documentElement.clientWidth;return{width:Math.max(120,Math.min(gt,e-32)-2-44),height:Math.max(120,window.innerHeight-Math.min(96,window.innerHeight*.1)-200)}},open({content:e,confirmLabel:o,onConfirm:r,onCancel:p}){let{root:a,overlay:c,panel:h,body:b,close:w,confirm:S}=qt(t,o,()=>r());Bt(e,t),b.append(e),w.addEventListener("click",()=>p()),h.addEventListener("submit",g=>g.preventDefault());let A=!1;c.addEventListener("mousedown",g=>{A=g.target===c}),c.addEventListener("click",g=>{A&&g.target===c&&p(),A=!1});let F=g=>{if(g.key==="Tab"){g.stopPropagation(),dt(h,g);return}g.key==="Escape"&&(g.stopPropagation(),p())};document.addEventListener("keydown",F,!0);let s=document.body.style.overflow;document.body.style.overflow="hidden";let R=!1,B=()=>{R||(R=!0,document.removeEventListener("keydown",F,!0),document.body.style.overflow=s,a.remove())};return st.set(a,()=>{B(),p()}),a.setAttribute("aria-hidden","false"),document.body.append(a),S.focus(),{close:B}}}}var Xt=vt();function Ht(t,n={}){let e=n.modal??"auto";if(!(e==="auto"||Rt(e)))return Z(t,n);let r=vt({theme:ct(),confirmLabel:n.labels?.confirm??"Crop"});return Z(t,{...n,modal:r})}var Yt=Ht;export{Xt as bevelCropAdapter,vt as createCropAdapter,Yt as default,Ht as quickcrop};
26
+ /*! For license information please see quickcrop-VNRXGRPC.js.LEGAL.txt */