@shapio/cms 0.5.0 → 0.5.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 (270) hide show
  1. package/dist/admin/assets/{AssetTile-zOf0K0nN.js → AssetTile-B8ftUG4s.js} +2 -2
  2. package/dist/admin/assets/{AssetTile-zOf0K0nN.js.map → AssetTile-B8ftUG4s.js.map} +1 -1
  3. package/dist/admin/assets/{AssistError-D_vY2CO0.js → AssistError-BidlzaBY.js} +2 -2
  4. package/dist/admin/assets/{AssistError-D_vY2CO0.js.map → AssistError-BidlzaBY.js.map} +1 -1
  5. package/dist/admin/assets/{BlockMenuItems-BEnSpClj.js → BlockMenuItems-DfNBHqVM.js} +2 -2
  6. package/dist/admin/assets/{BlockMenuItems-BEnSpClj.js.map → BlockMenuItems-DfNBHqVM.js.map} +1 -1
  7. package/dist/admin/assets/{Body-B_IVN5wp.js → Body-C0oQSX6L.js} +2 -2
  8. package/dist/admin/assets/{Body-B_IVN5wp.js.map → Body-C0oQSX6L.js.map} +1 -1
  9. package/dist/admin/assets/{Builder-CnEtRudv.js → Builder-Z_hcyzNW.js} +2 -2
  10. package/dist/admin/assets/{Builder-CnEtRudv.js.map → Builder-Z_hcyzNW.js.map} +1 -1
  11. package/dist/admin/assets/{ConfirmDialog-BW-l3Whg.js → ConfirmDialog-DVN-n-tE.js} +2 -2
  12. package/dist/admin/assets/{ConfirmDialog-BW-l3Whg.js.map → ConfirmDialog-DVN-n-tE.js.map} +1 -1
  13. package/dist/admin/assets/{CopyButton-CyoUMStc.js → CopyButton--tHegXQr.js} +2 -2
  14. package/dist/admin/assets/{CopyButton-CyoUMStc.js.map → CopyButton--tHegXQr.js.map} +1 -1
  15. package/dist/admin/assets/{CursorPager-BW2Dl_hn.js → CursorPager-Cb94mITn.js} +2 -2
  16. package/dist/admin/assets/{CursorPager-BW2Dl_hn.js.map → CursorPager-Cb94mITn.js.map} +1 -1
  17. package/dist/admin/assets/{ExternalLink-BCI0q9ib.js → ExternalLink-M1cb1n2n.js} +2 -2
  18. package/dist/admin/assets/{ExternalLink-BCI0q9ib.js.map → ExternalLink-M1cb1n2n.js.map} +1 -1
  19. package/dist/admin/assets/{FocalPoint-CxicvlJO.js → FocalPoint-pTq17ngi.js} +2 -2
  20. package/dist/admin/assets/{FocalPoint-CxicvlJO.js.map → FocalPoint-pTq17ngi.js.map} +1 -1
  21. package/dist/admin/assets/{Form-DB03drS9.js → Form-4zah109J.js} +2 -2
  22. package/dist/admin/assets/{Form-DB03drS9.js.map → Form-4zah109J.js.map} +1 -1
  23. package/dist/admin/assets/FormCheckboxGroup-DAeuGKAU.js +2 -0
  24. package/dist/admin/assets/FormCheckboxGroup-DAeuGKAU.js.map +1 -0
  25. package/dist/admin/assets/{FormRadioGroup-BvSC8SRm.js → FormRadioGroup--xx08rw6.js} +2 -2
  26. package/dist/admin/assets/{FormRadioGroup-BvSC8SRm.js.map → FormRadioGroup--xx08rw6.js.map} +1 -1
  27. package/dist/admin/assets/{FormSelectField-BDIVhZh6.js → FormSelectField-DNOCQKqc.js} +2 -2
  28. package/dist/admin/assets/{FormSelectField-BDIVhZh6.js.map → FormSelectField-DNOCQKqc.js.map} +1 -1
  29. package/dist/admin/assets/{FormSwitchField-OM4F8ln4.js → FormSwitchField-BECl-pzH.js} +2 -2
  30. package/dist/admin/assets/{FormSwitchField-OM4F8ln4.js.map → FormSwitchField-BECl-pzH.js.map} +1 -1
  31. package/dist/admin/assets/{FormTextareaField-Bw7EkC4H.js → FormTextareaField-DmRuKDJ_.js} +2 -2
  32. package/dist/admin/assets/{FormTextareaField-Bw7EkC4H.js.map → FormTextareaField-DmRuKDJ_.js.map} +1 -1
  33. package/dist/admin/assets/{HintedLabel-BGidukgy.js → HintedLabel-DIEBvftx.js} +2 -2
  34. package/dist/admin/assets/{HintedLabel-BGidukgy.js.map → HintedLabel-DIEBvftx.js.map} +1 -1
  35. package/dist/admin/assets/{InfoHint-D3uwei-E.js → InfoHint-BdAadb9U.js} +2 -2
  36. package/dist/admin/assets/{InfoHint-D3uwei-E.js.map → InfoHint-BdAadb9U.js.map} +1 -1
  37. package/dist/admin/assets/{InsertMenuItem-DAihGvbw.js → InsertMenuItem-oh0NJrhB.js} +2 -2
  38. package/dist/admin/assets/{InsertMenuItem-DAihGvbw.js.map → InsertMenuItem-oh0NJrhB.js.map} +1 -1
  39. package/dist/admin/assets/{LinkTabs-DBXbfzME.js → LinkTabs-EBgHX4Uh.js} +2 -2
  40. package/dist/admin/assets/{LinkTabs-DBXbfzME.js.map → LinkTabs-EBgHX4Uh.js.map} +1 -1
  41. package/dist/admin/assets/{Match-CgfZTzqs.js → Match-CvpSNEfi.js} +2 -2
  42. package/dist/admin/assets/{Match-CgfZTzqs.js.map → Match-CvpSNEfi.js.map} +1 -1
  43. package/dist/admin/assets/{Panel-DDky5_x9.js → Panel-BV1BpNCn.js} +2 -2
  44. package/dist/admin/assets/{Panel-DDky5_x9.js.map → Panel-BV1BpNCn.js.map} +1 -1
  45. package/dist/admin/assets/{QueryView-C2d392ly.js → QueryView-Bbw1eiV2.js} +2 -2
  46. package/dist/admin/assets/{QueryView-C2d392ly.js.map → QueryView-Bbw1eiV2.js.map} +1 -1
  47. package/dist/admin/assets/{RadioTile-CcP78eb_.js → RadioTile-CSYW-8gL.js} +2 -2
  48. package/dist/admin/assets/{RadioTile-CcP78eb_.js.map → RadioTile-CSYW-8gL.js.map} +1 -1
  49. package/dist/admin/assets/{RichTextField-CeztaFET.js → RichTextField-BDb67rCi.js} +2 -2
  50. package/dist/admin/assets/{RichTextField-CeztaFET.js.map → RichTextField-BDb67rCi.js.map} +1 -1
  51. package/dist/admin/assets/{RowTitle-mkKp4yfl.js → RowTitle-Cted2GP8.js} +2 -2
  52. package/dist/admin/assets/{RowTitle-mkKp4yfl.js.map → RowTitle-Cted2GP8.js.map} +1 -1
  53. package/dist/admin/assets/SecretReveal-Ccaul96d.js +2 -0
  54. package/dist/admin/assets/SecretReveal-Ccaul96d.js.map +1 -0
  55. package/dist/admin/assets/{SharedGlyph-CuDT7OUU.js → SharedGlyph-BrLi3Hug.js} +2 -2
  56. package/dist/admin/assets/{SharedGlyph-CuDT7OUU.js.map → SharedGlyph-BrLi3Hug.js.map} +1 -1
  57. package/dist/admin/assets/{StepList-BDO0Q3Wc.js → StepList-BLvElvPV.js} +2 -2
  58. package/dist/admin/assets/{StepList-BDO0Q3Wc.js.map → StepList-BLvElvPV.js.map} +1 -1
  59. package/dist/admin/assets/Structure-CRNAuVY7.js +2 -0
  60. package/dist/admin/assets/{Structure-CL_0hVci.js.map → Structure-CRNAuVY7.js.map} +1 -1
  61. package/dist/admin/assets/{SubNavLink-C4eSybWd.js → SubNavLink-biGV5ozd.js} +2 -2
  62. package/dist/admin/assets/{SubNavLink-C4eSybWd.js.map → SubNavLink-biGV5ozd.js.map} +1 -1
  63. package/dist/admin/assets/{SuggestAltButton-CxYlhwyd.js → SuggestAltButton-CrFiRWGr.js} +2 -2
  64. package/dist/admin/assets/{SuggestAltButton-CxYlhwyd.js.map → SuggestAltButton-CrFiRWGr.js.map} +1 -1
  65. package/dist/admin/assets/{TextLink-DzNaAft6.js → TextLink-BPLbXw2n.js} +2 -2
  66. package/dist/admin/assets/{TextLink-DzNaAft6.js.map → TextLink-BPLbXw2n.js.map} +1 -1
  67. package/dist/admin/assets/{Thumbnail-DSPArZ9h.js → Thumbnail-B_TWlgEz.js} +2 -2
  68. package/dist/admin/assets/{Thumbnail-DSPArZ9h.js.map → Thumbnail-B_TWlgEz.js.map} +1 -1
  69. package/dist/admin/assets/{UnsavedChangesGuard-BPOCBD5T.js → UnsavedChangesGuard-CrzR2boF.js} +2 -2
  70. package/dist/admin/assets/{UnsavedChangesGuard-BPOCBD5T.js.map → UnsavedChangesGuard-CrzR2boF.js.map} +1 -1
  71. package/dist/admin/assets/{UserAvatar-BHNWHDVb.js → UserAvatar-W-S3st7E.js} +2 -2
  72. package/dist/admin/assets/{UserAvatar-BHNWHDVb.js.map → UserAvatar-W-S3st7E.js.map} +1 -1
  73. package/dist/admin/assets/{auth-BzCgJtgr.js → auth-cXFFyABE.js} +2 -2
  74. package/dist/admin/assets/{auth-BzCgJtgr.js.map → auth-cXFFyABE.js.map} +1 -1
  75. package/dist/admin/assets/{badge-DBoaS0nQ.js → badge-DrPwivGk.js} +2 -2
  76. package/dist/admin/assets/{badge-DBoaS0nQ.js.map → badge-DrPwivGk.js.map} +1 -1
  77. package/dist/admin/assets/{boxes-DhN0ctLo.js → boxes-CKJ6P9VA.js} +2 -2
  78. package/dist/admin/assets/{boxes-DhN0ctLo.js.map → boxes-CKJ6P9VA.js.map} +1 -1
  79. package/dist/admin/assets/{calendar-clock-BEA3tG17.js → calendar-clock-DPyjti63.js} +2 -2
  80. package/dist/admin/assets/{calendar-clock-BEA3tG17.js.map → calendar-clock-DPyjti63.js.map} +1 -1
  81. package/dist/admin/assets/{changeSets-C54Ku-X9.js → changeSets-DYGm5j1A.js} +2 -2
  82. package/dist/admin/assets/{changeSets-C54Ku-X9.js.map → changeSets-DYGm5j1A.js.map} +1 -1
  83. package/dist/admin/assets/chevron-left-DIp5sJuv.js +2 -0
  84. package/dist/admin/assets/{chevron-left-BeJdUVAX.js.map → chevron-left-DIp5sJuv.js.map} +1 -1
  85. package/dist/admin/assets/{circle-check-ktACw37r.js → circle-check-VXPKg4cE.js} +2 -2
  86. package/dist/admin/assets/{circle-check-ktACw37r.js.map → circle-check-VXPKg4cE.js.map} +1 -1
  87. package/dist/admin/assets/{clock-BKNNASKp.js → clock-DNhupIko.js} +2 -2
  88. package/dist/admin/assets/{clock-BKNNASKp.js.map → clock-DNhupIko.js.map} +1 -1
  89. package/dist/admin/assets/cn-CEPUgFbZ.js +2 -0
  90. package/dist/admin/assets/cn-CEPUgFbZ.js.map +1 -0
  91. package/dist/admin/assets/coerce-BxuBjZdf.js +2 -0
  92. package/dist/admin/assets/{coerce-DDQ1vGLx.js.map → coerce-BxuBjZdf.js.map} +1 -1
  93. package/dist/admin/assets/{constants-DH7oqfO_.js → constants-B9cNrCXV.js} +2 -2
  94. package/dist/admin/assets/{constants-DH7oqfO_.js.map → constants-B9cNrCXV.js.map} +1 -1
  95. package/dist/admin/assets/{content-BptqQO8c.js → content-DjyCdi4c.js} +3 -3
  96. package/dist/admin/assets/{content-BptqQO8c.js.map → content-DjyCdi4c.js.map} +1 -1
  97. package/dist/admin/assets/{contentCounts-BpGlmyeZ.js → contentCounts-CX15iYcR.js} +2 -2
  98. package/dist/admin/assets/{contentCounts-BpGlmyeZ.js.map → contentCounts-CX15iYcR.js.map} +1 -1
  99. package/dist/admin/assets/{contentTypes-B_mAlIcH.js → contentTypes-FgyxLhlk.js} +2 -2
  100. package/dist/admin/assets/{contentTypes-B_mAlIcH.js.map → contentTypes-FgyxLhlk.js.map} +1 -1
  101. package/dist/admin/assets/{context-DyyMW7Md.js → context-FqJXjS5k.js} +2 -2
  102. package/dist/admin/assets/{context-DyyMW7Md.js.map → context-FqJXjS5k.js.map} +1 -1
  103. package/dist/admin/assets/{copy-DjzlFY9u.js → copy-CoHbtS-Y.js} +2 -2
  104. package/dist/admin/assets/{copy-DjzlFY9u.js.map → copy-CoHbtS-Y.js.map} +1 -1
  105. package/dist/admin/assets/{dateTimeLocal-DFXY779D.js → dateTimeLocal-BxmDLO_H.js} +2 -2
  106. package/dist/admin/assets/{dateTimeLocal-DFXY779D.js.map → dateTimeLocal-BxmDLO_H.js.map} +1 -1
  107. package/dist/admin/assets/{develop-DJap_z-1.js → develop-gx8WeWv4.js} +2 -2
  108. package/dist/admin/assets/{develop-DJap_z-1.js.map → develop-gx8WeWv4.js.map} +1 -1
  109. package/dist/admin/assets/{dropdown-menu-DGSMTf23.js → dropdown-menu-BG1rctRQ.js} +2 -2
  110. package/dist/admin/assets/{dropdown-menu-DGSMTf23.js.map → dropdown-menu-BG1rctRQ.js.map} +1 -1
  111. package/dist/admin/assets/{ellipsis-BMP-j3yO.js → ellipsis-DHfP1Ah2.js} +2 -2
  112. package/dist/admin/assets/{ellipsis-BMP-j3yO.js.map → ellipsis-DHfP1Ah2.js.map} +1 -1
  113. package/dist/admin/assets/{external-link-DzOkt97S.js → external-link-itxcNtaX.js} +2 -2
  114. package/dist/admin/assets/{external-link-DzOkt97S.js.map → external-link-itxcNtaX.js.map} +1 -1
  115. package/dist/admin/assets/{fileRoute-CG0Dufvt.js → fileRoute-BZ0pGGsh.js} +2 -2
  116. package/dist/admin/assets/{fileRoute-CG0Dufvt.js.map → fileRoute-BZ0pGGsh.js.map} +1 -1
  117. package/dist/admin/assets/{folder-plus-C-LhI4a2.js → folder-plus-BgsfY_6i.js} +2 -2
  118. package/dist/admin/assets/{folder-plus-C-LhI4a2.js.map → folder-plus-BgsfY_6i.js.map} +1 -1
  119. package/dist/admin/assets/{followPlural-D-8kzFOe.js → followPlural-BqjqhHmz.js} +2 -2
  120. package/dist/admin/assets/{followPlural-D-8kzFOe.js.map → followPlural-BqjqhHmz.js.map} +1 -1
  121. package/dist/admin/assets/{globe-DOoGBy23.js → globe-RjXj4P-A.js} +2 -2
  122. package/dist/admin/assets/{globe-DOoGBy23.js.map → globe-RjXj4P-A.js.map} +1 -1
  123. package/dist/admin/assets/{image-D9p_gGE2.js → image-4itB4TLl.js} +2 -2
  124. package/dist/admin/assets/{image-D9p_gGE2.js.map → image-4itB4TLl.js.map} +1 -1
  125. package/dist/admin/assets/{image-off-G0M2Nh1I.js → image-off-CokIymyg.js} +2 -2
  126. package/dist/admin/assets/{image-off-G0M2Nh1I.js.map → image-off-CokIymyg.js.map} +1 -1
  127. package/dist/admin/assets/{inbox-XaM-nvsM.js → inbox-8AAyyM0T.js} +2 -2
  128. package/dist/admin/assets/{inbox-XaM-nvsM.js.map → inbox-8AAyyM0T.js.map} +1 -1
  129. package/dist/admin/assets/{inbox-CMzYVMZo.js → inbox-97pzmuus.js} +2 -2
  130. package/dist/admin/assets/{inbox-CMzYVMZo.js.map → inbox-97pzmuus.js.map} +1 -1
  131. package/dist/admin/assets/{index-DHmfMpqz.js → index-cpiZvLck.js} +4 -4
  132. package/dist/admin/assets/{index-DHmfMpqz.js.map → index-cpiZvLck.js.map} +1 -1
  133. package/dist/admin/assets/{key-round-HBvMrmMo.js → key-round-Dc4_SOi-.js} +2 -2
  134. package/dist/admin/assets/{key-round-HBvMrmMo.js.map → key-round-Dc4_SOi-.js.map} +1 -1
  135. package/dist/admin/assets/{languages-BOv0jYhe.js → languages-DR2K97A5.js} +2 -2
  136. package/dist/admin/assets/{languages-BOv0jYhe.js.map → languages-DR2K97A5.js.map} +1 -1
  137. package/dist/admin/assets/{layers-CkZyCaeb.js → layers-ZPmcbieN.js} +2 -2
  138. package/dist/admin/assets/{layers-CkZyCaeb.js.map → layers-ZPmcbieN.js.map} +1 -1
  139. package/dist/admin/assets/{link-2-off-UUkSmPIL.js → link-2-off-D_5_hkT7.js} +2 -2
  140. package/dist/admin/assets/{link-2-off-UUkSmPIL.js.map → link-2-off-D_5_hkT7.js.map} +1 -1
  141. package/dist/admin/assets/{link-Bvqcg7db.js → link-BnDFFyvi.js} +2 -2
  142. package/dist/admin/assets/{link-Bvqcg7db.js.map → link-BnDFFyvi.js.map} +1 -1
  143. package/dist/admin/assets/{locales-DbrcdhZi.js → locales-D-21t-l-.js} +2 -2
  144. package/dist/admin/assets/{locales-DbrcdhZi.js.map → locales-D-21t-l-.js.map} +1 -1
  145. package/dist/admin/assets/{media-ugEyLgwN.js → media-D7aimjyy.js} +2 -2
  146. package/dist/admin/assets/{media-ugEyLgwN.js.map → media-D7aimjyy.js.map} +1 -1
  147. package/dist/admin/assets/{media-CO0HSS3b.js → media-Db0cHYNY.js} +2 -2
  148. package/dist/admin/assets/{media-CO0HSS3b.js.map → media-Db0cHYNY.js.map} +1 -1
  149. package/dist/admin/assets/network-l_oLT5fa.js +2 -0
  150. package/dist/admin/assets/network-l_oLT5fa.js.map +1 -0
  151. package/dist/admin/assets/{pencil-BLNGNJmL.js → pencil-Cn8c_gtv.js} +2 -2
  152. package/dist/admin/assets/{pencil-BLNGNJmL.js.map → pencil-Cn8c_gtv.js.map} +1 -1
  153. package/dist/admin/assets/{plus-BXMBYPoB.js → plus-yxvf4aAT.js} +2 -2
  154. package/dist/admin/assets/{plus-BXMBYPoB.js.map → plus-yxvf4aAT.js.map} +1 -1
  155. package/dist/admin/assets/{preload-helper-DEbJbZwX.js → preload-helper-pwSesV5P.js} +2 -2
  156. package/dist/admin/assets/{preload-helper-DEbJbZwX.js.map → preload-helper-pwSesV5P.js.map} +1 -1
  157. package/dist/admin/assets/{publishing-DKrATBaj.js → publishing-PQLCOnvu.js} +2 -2
  158. package/dist/admin/assets/{publishing-DKrATBaj.js.map → publishing-PQLCOnvu.js.map} +1 -1
  159. package/dist/admin/assets/{radio-group-BIhT_uEK.js → radio-group-Fc2ENIMO.js} +2 -2
  160. package/dist/admin/assets/{radio-group-BIhT_uEK.js.map → radio-group-Fc2ENIMO.js.map} +1 -1
  161. package/dist/admin/assets/{rotate-ccw-DqbffhiC.js → rotate-ccw-BHa0BHug.js} +2 -2
  162. package/dist/admin/assets/{rotate-ccw-DqbffhiC.js.map → rotate-ccw-BHa0BHug.js.map} +1 -1
  163. package/dist/admin/assets/{schedules-CETl2eLe.js → schedules-B8y_GnqX.js} +2 -2
  164. package/dist/admin/assets/{schedules-CETl2eLe.js.map → schedules-B8y_GnqX.js.map} +1 -1
  165. package/dist/admin/assets/{schema-CWHuez0q.js → schema-BJHcYshf.js} +2 -2
  166. package/dist/admin/assets/{schema-CWHuez0q.js.map → schema-BJHcYshf.js.map} +1 -1
  167. package/dist/admin/assets/{scroll-text-DlcDEi2k.js → scroll-text-BHLmZpBB.js} +2 -2
  168. package/dist/admin/assets/{scroll-text-DlcDEi2k.js.map → scroll-text-BHLmZpBB.js.map} +1 -1
  169. package/dist/admin/assets/{search-Dy2dtwyR.js → search-D3GGSaSL.js} +2 -2
  170. package/dist/admin/assets/{search-Dy2dtwyR.js.map → search-D3GGSaSL.js.map} +1 -1
  171. package/dist/admin/assets/{searchSchemas-Cz4P1iku.js → searchSchemas-C4dnYI9a.js} +2 -2
  172. package/dist/admin/assets/{searchSchemas-Cz4P1iku.js.map → searchSchemas-C4dnYI9a.js.map} +1 -1
  173. package/dist/admin/assets/{sections-BfG6DTFr.js → sections-BWoTaw2B.js} +2 -2
  174. package/dist/admin/assets/{sections-BfG6DTFr.js.map → sections-BWoTaw2B.js.map} +1 -1
  175. package/dist/admin/assets/{sections-EgXyXN3-.js → sections-eeTU636D.js} +2 -2
  176. package/dist/admin/assets/{sections-EgXyXN3-.js.map → sections-eeTU636D.js.map} +1 -1
  177. package/dist/admin/assets/{select--mePTdz8.js → select-BMi4G1Ib.js} +2 -2
  178. package/dist/admin/assets/{select--mePTdz8.js.map → select-BMi4G1Ib.js.map} +1 -1
  179. package/dist/admin/assets/{send-DVgq5Iwg.js → send-Bqhmg9HP.js} +2 -2
  180. package/dist/admin/assets/{send-DVgq5Iwg.js.map → send-Bqhmg9HP.js.map} +1 -1
  181. package/dist/admin/assets/{seo-Zhb62Ojz.js → seo-BL9C7Yt3.js} +2 -2
  182. package/dist/admin/assets/{seo-Zhb62Ojz.js.map → seo-BL9C7Yt3.js.map} +1 -1
  183. package/dist/admin/assets/settings-D-nW3wQb.js +2 -0
  184. package/dist/admin/assets/settings-D-nW3wQb.js.map +1 -0
  185. package/dist/admin/assets/skeleton-BPLAzyDo.js +42 -0
  186. package/dist/admin/assets/skeleton-BPLAzyDo.js.map +1 -0
  187. package/dist/admin/assets/{snapshots-BpLhILlt.js → snapshots-COSUeZBP.js} +2 -2
  188. package/dist/admin/assets/{snapshots-BpLhILlt.js.map → snapshots-COSUeZBP.js.map} +1 -1
  189. package/dist/admin/assets/{sparkles-Dd6S_roX.js → sparkles-CykwtKTd.js} +2 -2
  190. package/dist/admin/assets/{sparkles-Dd6S_roX.js.map → sparkles-CykwtKTd.js.map} +1 -1
  191. package/dist/admin/assets/{stableId-DFVM13gJ.js → stableId-DfJkQUV3.js} +2 -2
  192. package/dist/admin/assets/{stableId-DFVM13gJ.js.map → stableId-DfJkQUV3.js.map} +1 -1
  193. package/dist/admin/assets/{store-BP-xStwU.js → store-GOGeP63I.js} +2 -2
  194. package/dist/admin/assets/{store-BP-xStwU.js.map → store-GOGeP63I.js.map} +1 -1
  195. package/dist/admin/assets/{switch-skVypg5O.js → switch-XRU_EOoM.js} +2 -2
  196. package/dist/admin/assets/{switch-skVypg5O.js.map → switch-XRU_EOoM.js.map} +1 -1
  197. package/dist/admin/assets/{table-BMbbRUK9.js → table-CLVW6uJB.js} +2 -2
  198. package/dist/admin/assets/{table-BMbbRUK9.js.map → table-CLVW6uJB.js.map} +1 -1
  199. package/dist/admin/assets/{tabs-C1lgOg1B.js → tabs-DB42Xljn.js} +3 -3
  200. package/dist/admin/assets/{tabs-C1lgOg1B.js.map → tabs-DB42Xljn.js.map} +1 -1
  201. package/dist/admin/assets/{textarea-CffBBxoQ.js → textarea-DcsLGCkq.js} +2 -2
  202. package/dist/admin/assets/{textarea-CffBBxoQ.js.map → textarea-DcsLGCkq.js.map} +1 -1
  203. package/dist/admin/assets/{theme-RHTVnR9j.js → theme-CnSar6tt.js} +2 -2
  204. package/dist/admin/assets/{theme-RHTVnR9j.js.map → theme-CnSar6tt.js.map} +1 -1
  205. package/dist/admin/assets/{titles-DWiPmNvn.js → titles-DluirfBO.js} +2 -2
  206. package/dist/admin/assets/{titles-DWiPmNvn.js.map → titles-DluirfBO.js.map} +1 -1
  207. package/dist/admin/assets/{tokens-BqyeN1D-.js → tokens-CQooB8Sf.js} +2 -2
  208. package/dist/admin/assets/{tokens-BqyeN1D-.js.map → tokens-CQooB8Sf.js.map} +1 -1
  209. package/dist/admin/assets/{tooltip-BfSF6EyR.js → tooltip-xfZn0Fla.js} +2 -2
  210. package/dist/admin/assets/{tooltip-BfSF6EyR.js.map → tooltip-xfZn0Fla.js.map} +1 -1
  211. package/dist/admin/assets/{undo-2-p4YlNhBp.js → undo-2-B_QjuGmR.js} +2 -2
  212. package/dist/admin/assets/{undo-2-p4YlNhBp.js.map → undo-2-B_QjuGmR.js.map} +1 -1
  213. package/dist/admin/assets/{useAuditLabels-DV5gcaaG.js → useAuditLabels-BZPAj3wG.js} +2 -2
  214. package/dist/admin/assets/{useAuditLabels-DV5gcaaG.js.map → useAuditLabels-BZPAj3wG.js.map} +1 -1
  215. package/dist/admin/assets/{useConfirmTarget-DCvnxNVg.js → useConfirmTarget-B7iLg66j.js} +2 -2
  216. package/dist/admin/assets/{useConfirmTarget-DCvnxNVg.js.map → useConfirmTarget-B7iLg66j.js.map} +1 -1
  217. package/dist/admin/assets/{useContentSchema-z6tNif86.js → useContentSchema-BTyBYURX.js} +2 -2
  218. package/dist/admin/assets/{useContentSchema-z6tNif86.js.map → useContentSchema-BTyBYURX.js.map} +1 -1
  219. package/dist/admin/assets/{useCursorPager-CQGX41_L.js → useCursorPager-CTGOzl69.js} +2 -2
  220. package/dist/admin/assets/{useCursorPager-CQGX41_L.js.map → useCursorPager-CTGOzl69.js.map} +1 -1
  221. package/dist/admin/assets/{useDiscardGuard-Dhbif7VL.js → useDiscardGuard-CSkPw8iq.js} +2 -2
  222. package/dist/admin/assets/{useDiscardGuard-Dhbif7VL.js.map → useDiscardGuard-CSkPw8iq.js.map} +1 -1
  223. package/dist/admin/assets/{useMediaPickerDialog-D-5uKsMG.js → useMediaPickerDialog-W0jhN-hi.js} +2 -2
  224. package/dist/admin/assets/{useMediaPickerDialog-D-5uKsMG.js.map → useMediaPickerDialog-W0jhN-hi.js.map} +1 -1
  225. package/dist/admin/assets/{useMediaUploader-BtLoimmQ.js → useMediaUploader-BC5zCkQt.js} +2 -2
  226. package/dist/admin/assets/{useMediaUploader-BtLoimmQ.js.map → useMediaUploader-BC5zCkQt.js.map} +1 -1
  227. package/dist/admin/assets/{usePaletteItems-D3PZsW0Q.js → usePaletteItems-CqcKndUT.js} +2 -2
  228. package/dist/admin/assets/{usePaletteItems-D3PZsW0Q.js.map → usePaletteItems-CqcKndUT.js.map} +1 -1
  229. package/dist/admin/assets/{usePlaces-Cj5PljTy.js → usePlaces-o4Os5Nbv.js} +2 -2
  230. package/dist/admin/assets/{usePlaces-Cj5PljTy.js.map → usePlaces-o4Os5Nbv.js.map} +1 -1
  231. package/dist/admin/assets/{useQueries-CeDzli4Z.js → useQueries-BTnSD0k5.js} +2 -2
  232. package/dist/admin/assets/{useQueries-CeDzli4Z.js.map → useQueries-BTnSD0k5.js.map} +1 -1
  233. package/dist/admin/assets/{useResolvedScheme-DHD-zisP.js → useResolvedScheme-SoI-2Faf.js} +2 -2
  234. package/dist/admin/assets/{useResolvedScheme-DHD-zisP.js.map → useResolvedScheme-SoI-2Faf.js.map} +1 -1
  235. package/dist/admin/assets/{useSchemaScopeAccess-BNeVslcv.js → useSchemaScopeAccess-B4-31q7m.js} +2 -2
  236. package/dist/admin/assets/{useSchemaScopeAccess-BNeVslcv.js.map → useSchemaScopeAccess-B4-31q7m.js.map} +1 -1
  237. package/dist/admin/assets/{users-BRefbzuS.js → users-BVuapb3u.js} +2 -2
  238. package/dist/admin/assets/{users-BRefbzuS.js.map → users-BVuapb3u.js.map} +1 -1
  239. package/dist/admin/assets/{users-CppI8ctO.js → users-Oj5V5za_.js} +2 -2
  240. package/dist/admin/assets/{users-CppI8ctO.js.map → users-Oj5V5za_.js.map} +1 -1
  241. package/dist/admin/assets/{zod-Dcwk-m8X.js → zod-cTJwCa4E.js} +2 -2
  242. package/dist/admin/assets/{zod-Dcwk-m8X.js.map → zod-cTJwCa4E.js.map} +1 -1
  243. package/dist/admin/index.html +55 -55
  244. package/dist/cli.js +33 -18
  245. package/dist/cli.js.map +1 -1
  246. package/dist/config.d.ts +1 -1
  247. package/dist/index.d.ts +1 -1
  248. package/dist/index.js +1 -1
  249. package/dist/{public-DYR4mtVQ.d.ts → public-C027OJX6.d.ts} +12 -2
  250. package/dist/{s3Adapter-C8AgFVYw.js → s3Adapter-BipoQiwQ.js} +2 -2
  251. package/dist/{s3Adapter-C8AgFVYw.js.map → s3Adapter-BipoQiwQ.js.map} +1 -1
  252. package/dist/{worker-jz_0yAmS.js → worker-BU-V4qbH.js} +174 -60
  253. package/dist/worker-BU-V4qbH.js.map +1 -0
  254. package/package.json +5 -5
  255. package/dist/admin/assets/FormCheckboxGroup-JP1xzReQ.js +0 -2
  256. package/dist/admin/assets/FormCheckboxGroup-JP1xzReQ.js.map +0 -1
  257. package/dist/admin/assets/SecretReveal-mYCzxF96.js +0 -2
  258. package/dist/admin/assets/SecretReveal-mYCzxF96.js.map +0 -1
  259. package/dist/admin/assets/Structure-CL_0hVci.js +0 -2
  260. package/dist/admin/assets/chevron-left-BeJdUVAX.js +0 -2
  261. package/dist/admin/assets/cn-h5ORT3LK.js +0 -2
  262. package/dist/admin/assets/cn-h5ORT3LK.js.map +0 -1
  263. package/dist/admin/assets/coerce-DDQ1vGLx.js +0 -2
  264. package/dist/admin/assets/network-BfDaUb7D.js +0 -2
  265. package/dist/admin/assets/network-BfDaUb7D.js.map +0 -1
  266. package/dist/admin/assets/settings-Mscp6tN5.js +0 -2
  267. package/dist/admin/assets/settings-Mscp6tN5.js.map +0 -1
  268. package/dist/admin/assets/skeleton-DJVukcn6.js +0 -42
  269. package/dist/admin/assets/skeleton-DJVukcn6.js.map +0 -1
  270. package/dist/worker-jz_0yAmS.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-CQOZoUwg.js";import{t as n}from"./jsx-runtime-DREnUpxT.js";import{i as r,j as i}from"./cn-h5ORT3LK.js";import{i as a,l as o}from"./media-ugEyLgwN.js";import{v as s}from"./auth-BzCgJtgr.js";import{R as c,a as l,i as u,n as d}from"./InfoHint-D3uwei-E.js";import{i as f,k as p,n as m,r as h,t as g}from"./skeleton-DJVukcn6.js";import{a as _,t as v}from"./Thumbnail-DSPArZ9h.js";import{t as y}from"./layers-CkZyCaeb.js";import{n as b}from"./context-DyyMW7Md.js";import{t as x}from"./SuggestAltButton-CxYlhwyd.js";var S={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};S.node;var C=r(S),w={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};w.node;var T=r(w),E={name:`image-plus`,size:24,node:[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]};E.node;var D=r(E),O=e(t(),1),k=e(n(),1),A=({assetId:e,inputId:t,index:n,count:r,editable:S,canEditAlt:w,onMove:E,onRemove:D})=>{let{t:A}=i(),j=a(e),M=o(),[N,P]=(0,O.useState)(),F=(0,O.useContext)(b)?.locale,I=j.data?.filename??e,L=`${t}-alt-${n}`;return(0,k.jsxs)(`li`,{className:`flex items-center gap-3 rounded-lg border bg-card p-2`,children:[j.data?(0,k.jsx)(v,{asset:j.data,className:`size-14 shrink-0 rounded-lg`}):j.isPending?(0,k.jsx)(g,{className:`size-14 shrink-0 rounded-lg`}):(0,k.jsx)(`div`,{className:`size-14 shrink-0 rounded-lg bg-muted`}),(0,k.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,k.jsx)(`p`,{className:`truncate text-sm font-semibold`,children:I}),j.isError?(0,k.jsx)(`p`,{className:`text-meta text-destructive`,children:s(j.error)?A(`content.media.missing`):p(j.error)}):j.data?(0,k.jsx)(`p`,{className:`truncate text-meta text-muted-foreground`,children:j.data.alt?A(`content.media.altValue`,{alt:j.data.alt}):A(`content.media.noAlt`)}):null]}),j.data?(0,k.jsxs)(d,{onOpenChange:e=>P(e?j.data?.alt:void 0),children:[(0,k.jsx)(l,{asChild:!0,children:(0,k.jsxs)(f,{type:`button`,variant:`ghost`,size:`sm`,"aria-label":A(`content.media.details`,{name:I}),children:[(0,k.jsx)(y,{"aria-hidden":`true`}),(0,k.jsx)(`span`,{className:`hidden sm:inline`,children:A(`content.media.detailsShort`)})]})}),(0,k.jsxs)(u,{align:`end`,className:`w-80 space-y-3`,children:[(0,k.jsxs)(`form`,{className:`space-y-2`,onSubmit:e=>{e.preventDefault(),j.data&&N!==void 0&&M.mutate({id:j.data.id,input:{expectedVersion:j.data.version,alt:N}})},children:[(0,k.jsx)(h,{htmlFor:L,children:A(`content.media.altLabel`)}),(0,k.jsx)(m,{id:L,value:N??``,readOnly:!w,onChange:e=>P(e.target.value),"aria-describedby":`${L}-hint`}),(0,k.jsx)(`p`,{id:`${L}-hint`,className:`text-meta text-muted-foreground`,children:A(`content.media.altHint`)}),M.isError?(0,k.jsx)(`p`,{className:`text-meta text-destructive`,children:p(M.error)}):null,w?(0,k.jsx)(x,{assetId:j.data.id,mimeType:j.data.mimeType,locale:F,onSuggest:P}):null,w?(0,k.jsx)(f,{type:`submit`,size:`sm`,disabled:M.isPending||N===j.data.alt,children:M.isPending?A(`common.saving`):A(`content.media.saveAlt`)}):null]}),(0,k.jsxs)(`div`,{className:`space-y-1`,children:[(0,k.jsx)(`p`,{className:`text-sm font-semibold`,children:A(`content.media.variants`)}),(0,k.jsx)(_,{asset:j.data})]})]})]}):null,S&&E?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(f,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":A(`content.items.moveUp`,{item:I,position:n+1}),disabled:n===0,onClick:()=>E(n-1),children:(0,k.jsx)(T,{"aria-hidden":`true`})}),(0,k.jsx)(f,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":A(`content.items.moveDown`,{item:I,position:n+1}),disabled:n===r-1,onClick:()=>E(n+1),children:(0,k.jsx)(C,{"aria-hidden":`true`})})]}):null,S?(0,k.jsx)(f,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":A(`content.media.remove`,{name:I}),onClick:D,children:(0,k.jsx)(c,{"aria-hidden":`true`})}):null]})};export{C as i,D as n,T as r,A as t};
2
- //# sourceMappingURL=AssetTile-zOf0K0nN.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-CQOZoUwg.js";import{t as n}from"./jsx-runtime-DREnUpxT.js";import{i as r,j as i}from"./cn-CEPUgFbZ.js";import{i as a,l as o}from"./media-D7aimjyy.js";import{v as s}from"./auth-cXFFyABE.js";import{R as c,a as l,i as u,n as d}from"./InfoHint-BdAadb9U.js";import{i as f,k as p,n as m,r as h,t as g}from"./skeleton-BPLAzyDo.js";import{a as _,t as v}from"./Thumbnail-B_TWlgEz.js";import{t as y}from"./layers-ZPmcbieN.js";import{n as b}from"./context-FqJXjS5k.js";import{t as x}from"./SuggestAltButton-CrFiRWGr.js";var S={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};S.node;var C=r(S),w={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};w.node;var T=r(w),E={name:`image-plus`,size:24,node:[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]};E.node;var D=r(E),O=e(t(),1),k=e(n(),1),A=({assetId:e,inputId:t,index:n,count:r,editable:S,canEditAlt:w,onMove:E,onRemove:D})=>{let{t:A}=i(),j=a(e),M=o(),[N,P]=(0,O.useState)(),F=(0,O.useContext)(b)?.locale,I=j.data?.filename??e,L=`${t}-alt-${n}`;return(0,k.jsxs)(`li`,{className:`flex items-center gap-3 rounded-lg border bg-card p-2`,children:[j.data?(0,k.jsx)(v,{asset:j.data,className:`size-14 shrink-0 rounded-lg`}):j.isPending?(0,k.jsx)(g,{className:`size-14 shrink-0 rounded-lg`}):(0,k.jsx)(`div`,{className:`size-14 shrink-0 rounded-lg bg-muted`}),(0,k.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,k.jsx)(`p`,{className:`truncate text-sm font-semibold`,children:I}),j.isError?(0,k.jsx)(`p`,{className:`text-meta text-destructive`,children:s(j.error)?A(`content.media.missing`):p(j.error)}):j.data?(0,k.jsx)(`p`,{className:`truncate text-meta text-muted-foreground`,children:j.data.alt?A(`content.media.altValue`,{alt:j.data.alt}):A(`content.media.noAlt`)}):null]}),j.data?(0,k.jsxs)(d,{onOpenChange:e=>P(e?j.data?.alt:void 0),children:[(0,k.jsx)(l,{asChild:!0,children:(0,k.jsxs)(f,{type:`button`,variant:`ghost`,size:`sm`,"aria-label":A(`content.media.details`,{name:I}),children:[(0,k.jsx)(y,{"aria-hidden":`true`}),(0,k.jsx)(`span`,{className:`hidden sm:inline`,children:A(`content.media.detailsShort`)})]})}),(0,k.jsxs)(u,{align:`end`,className:`w-80 space-y-3`,children:[(0,k.jsxs)(`form`,{className:`space-y-2`,onSubmit:e=>{e.preventDefault(),j.data&&N!==void 0&&M.mutate({id:j.data.id,input:{expectedVersion:j.data.version,alt:N}})},children:[(0,k.jsx)(h,{htmlFor:L,children:A(`content.media.altLabel`)}),(0,k.jsx)(m,{id:L,value:N??``,readOnly:!w,onChange:e=>P(e.target.value),"aria-describedby":`${L}-hint`}),(0,k.jsx)(`p`,{id:`${L}-hint`,className:`text-meta text-muted-foreground`,children:A(`content.media.altHint`)}),M.isError?(0,k.jsx)(`p`,{className:`text-meta text-destructive`,children:p(M.error)}):null,w?(0,k.jsx)(x,{assetId:j.data.id,mimeType:j.data.mimeType,locale:F,onSuggest:P}):null,w?(0,k.jsx)(f,{type:`submit`,size:`sm`,disabled:M.isPending||N===j.data.alt,children:M.isPending?A(`common.saving`):A(`content.media.saveAlt`)}):null]}),(0,k.jsxs)(`div`,{className:`space-y-1`,children:[(0,k.jsx)(`p`,{className:`text-sm font-semibold`,children:A(`content.media.variants`)}),(0,k.jsx)(_,{asset:j.data})]})]})]}):null,S&&E?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(f,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":A(`content.items.moveUp`,{item:I,position:n+1}),disabled:n===0,onClick:()=>E(n-1),children:(0,k.jsx)(T,{"aria-hidden":`true`})}),(0,k.jsx)(f,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":A(`content.items.moveDown`,{item:I,position:n+1}),disabled:n===r-1,onClick:()=>E(n+1),children:(0,k.jsx)(C,{"aria-hidden":`true`})})]}):null,S?(0,k.jsx)(f,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":A(`content.media.remove`,{name:I}),onClick:D,children:(0,k.jsx)(c,{"aria-hidden":`true`})}):null]})};export{C as i,D as n,T as r,A as t};
2
+ //# sourceMappingURL=AssetTile-B8ftUG4s.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AssetTile-zOf0K0nN.js","names":["__iconData","__iconData","useState","useContext","_Fragment","Trash2","__toESM","require_jsx_runtime","createLucideIcon","useTranslation","useMediaAsset","useUpdateMediaAsset","isNotFound","Trash","PopoverTrigger","PopoverContent","Popover","Button","describeError","Input","Label","Skeleton","Variants","Thumbnail","Layers","FieldsEnvironmentContext","SuggestAltButton","__iconData$2","ArrowDown","__iconData$1","ArrowUp","__iconData","ImagePlus","import_react","require_react","import_jsx_runtime","AssetTile","asset","assetId","update","alt","setAlt","locale","name","altId","inputId","index","t","open","event","canEditAlt","editable","onMove","count","onRemove"],"sources":["../../../../node_modules/.pnpm/lucide-react@1.49.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/arrow-down.mjs","../../../../node_modules/.pnpm/lucide-react@1.49.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/arrow-up.mjs","../../../../node_modules/.pnpm/lucide-react@1.49.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/image-plus.mjs","../../src/fields/MediaField/AssetTile/index.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.49.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"arrow-down\",\n size: 24,\n node: [\n [\"path\", { d: \"M12 5v14\", key: \"s699le\" }],\n [\"path\", { d: \"m19 12-7 7-7-7\", key: \"1idqje\" }]\n ]\n};\n__iconData.node;\nconst ArrowDown = createLucideIcon(__iconData);\n\nexport { __iconData, ArrowDown as default };\n//# sourceMappingURL=arrow-down.mjs.map\n","/**\n * @license lucide-react v1.49.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"arrow-up\",\n size: 24,\n node: [\n [\"path\", { d: \"m5 12 7-7 7 7\", key: \"hav0vg\" }],\n [\"path\", { d: \"M12 19V5\", key: \"x0mq9r\" }]\n ]\n};\n__iconData.node;\nconst ArrowUp = createLucideIcon(__iconData);\n\nexport { __iconData, ArrowUp as default };\n//# sourceMappingURL=arrow-up.mjs.map\n","/**\n * @license lucide-react v1.49.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"image-plus\",\n size: 24,\n node: [\n [\"path\", { d: \"M16 5h6\", key: \"1vod17\" }],\n [\"path\", { d: \"M19 2v6\", key: \"4bpg5p\" }],\n [\"path\", { d: \"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5\", key: \"1ue2ih\" }],\n [\"path\", { d: \"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21\", key: \"1xmnt7\" }],\n [\"circle\", { cx: \"9\", cy: \"9\", r: \"2\", key: \"af1f0g\" }]\n ]\n};\n__iconData.node;\nconst ImagePlus = createLucideIcon(__iconData);\n\nexport { __iconData, ImagePlus as default };\n//# sourceMappingURL=image-plus.mjs.map\n","import { ArrowDown, ArrowUp, Layers, Trash2 } from 'lucide-react';\nimport { useContext, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { isNotFound } from '@/api/errors';\nimport { useMediaAsset, useUpdateMediaAsset } from '@/api/media';\nimport { SuggestAltButton } from '@/components/SuggestAltButton';\nimport { Button } from '@/components/ui/button';\nimport { Input } from '@/components/ui/input';\nimport { Label } from '@/components/ui/label';\nimport { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';\nimport { Skeleton } from '@/components/ui/skeleton';\nimport { Variants } from '@/features/Media/Details/Variants';\nimport { Thumbnail } from '@/features/Media/Thumbnail';\nimport { describeError } from '@/helpers/describeError';\nimport { FieldsEnvironmentContext } from '../../form/context';\n\ntype AssetTileProps = {\n assetId: string;\n inputId: string;\n index: number;\n count: number;\n editable: boolean;\n canEditAlt: boolean;\n onMove?: (to: number) => void;\n onRemove: () => void;\n};\n\n/** One chosen file: preview, name, alt text (library metadata, editable here), its variants, and actions. */\nexport const AssetTile = ({\n assetId,\n inputId,\n index,\n count,\n editable,\n canEditAlt,\n onMove,\n onRemove,\n}: AssetTileProps) => {\n const { t } = useTranslation();\n const asset = useMediaAsset(assetId);\n const update = useUpdateMediaAsset();\n const [alt, setAlt] = useState<string | undefined>();\n const locale = useContext(FieldsEnvironmentContext)?.locale;\n const name = asset.data?.filename ?? assetId;\n const altId = `${inputId}-alt-${index}`;\n return (\n <li className=\"flex items-center gap-3 rounded-lg border bg-card p-2\">\n {asset.data ? (\n <Thumbnail asset={asset.data} className=\"size-14 shrink-0 rounded-lg\" />\n ) : asset.isPending ? (\n <Skeleton className=\"size-14 shrink-0 rounded-lg\" />\n ) : (\n <div className=\"size-14 shrink-0 rounded-lg bg-muted\" />\n )}\n <div className=\"min-w-0 flex-1 space-y-0.5\">\n <p className=\"truncate text-sm font-semibold\">{name}</p>\n {asset.isError ? (\n <p className=\"text-meta text-destructive\">\n {isNotFound(asset.error) ? t('content.media.missing') : describeError(asset.error)}\n </p>\n ) : asset.data ? (\n <p className=\"truncate text-meta text-muted-foreground\">\n {asset.data.alt ? t('content.media.altValue', { alt: asset.data.alt }) : t('content.media.noAlt')}\n </p>\n ) : null}\n </div>\n {asset.data ? (\n <Popover onOpenChange={(open) => setAlt(open ? asset.data?.alt : undefined)}>\n <PopoverTrigger asChild>\n <Button type=\"button\" variant=\"ghost\" size=\"sm\" aria-label={t('content.media.details', { name })}>\n <Layers aria-hidden=\"true\" />\n <span className=\"hidden sm:inline\">{t('content.media.detailsShort')}</span>\n </Button>\n </PopoverTrigger>\n <PopoverContent align=\"end\" className=\"w-80 space-y-3\">\n <form\n className=\"space-y-2\"\n onSubmit={(event) => {\n event.preventDefault();\n if (asset.data && alt !== undefined) {\n update.mutate({ id: asset.data.id, input: { expectedVersion: asset.data.version, alt } });\n }\n }}\n >\n <Label htmlFor={altId}>{t('content.media.altLabel')}</Label>\n <Input\n id={altId}\n value={alt ?? ''}\n readOnly={!canEditAlt}\n onChange={(event) => setAlt(event.target.value)}\n aria-describedby={`${altId}-hint`}\n />\n <p id={`${altId}-hint`} className=\"text-meta text-muted-foreground\">\n {t('content.media.altHint')}\n </p>\n {update.isError ? (\n <p className=\"text-meta text-destructive\">{describeError(update.error)}</p>\n ) : null}\n {canEditAlt ? (\n <SuggestAltButton\n assetId={asset.data.id}\n mimeType={asset.data.mimeType}\n locale={locale}\n onSuggest={setAlt}\n />\n ) : null}\n {canEditAlt ? (\n <Button type=\"submit\" size=\"sm\" disabled={update.isPending || alt === asset.data.alt}>\n {update.isPending ? t('common.saving') : t('content.media.saveAlt')}\n </Button>\n ) : null}\n </form>\n <div className=\"space-y-1\">\n <p className=\"text-sm font-semibold\">{t('content.media.variants')}</p>\n <Variants asset={asset.data} />\n </div>\n </PopoverContent>\n </Popover>\n ) : null}\n {editable && onMove ? (\n <>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={t('content.items.moveUp', { item: name, position: index + 1 })}\n disabled={index === 0}\n onClick={() => onMove(index - 1)}\n >\n <ArrowUp aria-hidden=\"true\" />\n </Button>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={t('content.items.moveDown', { item: name, position: index + 1 })}\n disabled={index === count - 1}\n onClick={() => onMove(index + 1)}\n >\n <ArrowDown aria-hidden=\"true\" />\n </Button>\n </>\n ) : null}\n {editable ? (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={t('content.media.remove', { name })}\n onClick={onRemove}\n >\n <Trash2 aria-hidden=\"true\" />\n </Button>\n ) : null}\n </li>\n );\n};\n"],"ignoreList":[0,1,2],"mappings":"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"}
1
+ {"version":3,"file":"AssetTile-B8ftUG4s.js","names":["__iconData","__iconData","useState","useContext","_Fragment","Trash2","__toESM","require_jsx_runtime","createLucideIcon","useTranslation","useMediaAsset","useUpdateMediaAsset","isNotFound","Trash","PopoverTrigger","PopoverContent","Popover","Button","describeError","Input","Label","Skeleton","Variants","Thumbnail","Layers","FieldsEnvironmentContext","SuggestAltButton","__iconData$2","ArrowDown","__iconData$1","ArrowUp","__iconData","ImagePlus","import_react","require_react","import_jsx_runtime","AssetTile","asset","assetId","update","alt","setAlt","locale","name","altId","inputId","index","t","open","event","canEditAlt","editable","onMove","count","onRemove"],"sources":["../../../../node_modules/.pnpm/lucide-react@1.49.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/arrow-down.mjs","../../../../node_modules/.pnpm/lucide-react@1.49.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/arrow-up.mjs","../../../../node_modules/.pnpm/lucide-react@1.49.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/image-plus.mjs","../../src/fields/MediaField/AssetTile/index.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.49.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"arrow-down\",\n size: 24,\n node: [\n [\"path\", { d: \"M12 5v14\", key: \"s699le\" }],\n [\"path\", { d: \"m19 12-7 7-7-7\", key: \"1idqje\" }]\n ]\n};\n__iconData.node;\nconst ArrowDown = createLucideIcon(__iconData);\n\nexport { __iconData, ArrowDown as default };\n//# sourceMappingURL=arrow-down.mjs.map\n","/**\n * @license lucide-react v1.49.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"arrow-up\",\n size: 24,\n node: [\n [\"path\", { d: \"m5 12 7-7 7 7\", key: \"hav0vg\" }],\n [\"path\", { d: \"M12 19V5\", key: \"x0mq9r\" }]\n ]\n};\n__iconData.node;\nconst ArrowUp = createLucideIcon(__iconData);\n\nexport { __iconData, ArrowUp as default };\n//# sourceMappingURL=arrow-up.mjs.map\n","/**\n * @license lucide-react v1.49.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"image-plus\",\n size: 24,\n node: [\n [\"path\", { d: \"M16 5h6\", key: \"1vod17\" }],\n [\"path\", { d: \"M19 2v6\", key: \"4bpg5p\" }],\n [\"path\", { d: \"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5\", key: \"1ue2ih\" }],\n [\"path\", { d: \"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21\", key: \"1xmnt7\" }],\n [\"circle\", { cx: \"9\", cy: \"9\", r: \"2\", key: \"af1f0g\" }]\n ]\n};\n__iconData.node;\nconst ImagePlus = createLucideIcon(__iconData);\n\nexport { __iconData, ImagePlus as default };\n//# sourceMappingURL=image-plus.mjs.map\n","import { ArrowDown, ArrowUp, Layers, Trash2 } from 'lucide-react';\nimport { useContext, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { isNotFound } from '@/api/errors';\nimport { useMediaAsset, useUpdateMediaAsset } from '@/api/media';\nimport { SuggestAltButton } from '@/components/SuggestAltButton';\nimport { Button } from '@/components/ui/button';\nimport { Input } from '@/components/ui/input';\nimport { Label } from '@/components/ui/label';\nimport { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';\nimport { Skeleton } from '@/components/ui/skeleton';\nimport { Variants } from '@/features/Media/Details/Variants';\nimport { Thumbnail } from '@/features/Media/Thumbnail';\nimport { describeError } from '@/helpers/describeError';\nimport { FieldsEnvironmentContext } from '../../form/context';\n\ntype AssetTileProps = {\n assetId: string;\n inputId: string;\n index: number;\n count: number;\n editable: boolean;\n canEditAlt: boolean;\n onMove?: (to: number) => void;\n onRemove: () => void;\n};\n\n/** One chosen file: preview, name, alt text (library metadata, editable here), its variants, and actions. */\nexport const AssetTile = ({\n assetId,\n inputId,\n index,\n count,\n editable,\n canEditAlt,\n onMove,\n onRemove,\n}: AssetTileProps) => {\n const { t } = useTranslation();\n const asset = useMediaAsset(assetId);\n const update = useUpdateMediaAsset();\n const [alt, setAlt] = useState<string | undefined>();\n const locale = useContext(FieldsEnvironmentContext)?.locale;\n const name = asset.data?.filename ?? assetId;\n const altId = `${inputId}-alt-${index}`;\n return (\n <li className=\"flex items-center gap-3 rounded-lg border bg-card p-2\">\n {asset.data ? (\n <Thumbnail asset={asset.data} className=\"size-14 shrink-0 rounded-lg\" />\n ) : asset.isPending ? (\n <Skeleton className=\"size-14 shrink-0 rounded-lg\" />\n ) : (\n <div className=\"size-14 shrink-0 rounded-lg bg-muted\" />\n )}\n <div className=\"min-w-0 flex-1 space-y-0.5\">\n <p className=\"truncate text-sm font-semibold\">{name}</p>\n {asset.isError ? (\n <p className=\"text-meta text-destructive\">\n {isNotFound(asset.error) ? t('content.media.missing') : describeError(asset.error)}\n </p>\n ) : asset.data ? (\n <p className=\"truncate text-meta text-muted-foreground\">\n {asset.data.alt ? t('content.media.altValue', { alt: asset.data.alt }) : t('content.media.noAlt')}\n </p>\n ) : null}\n </div>\n {asset.data ? (\n <Popover onOpenChange={(open) => setAlt(open ? asset.data?.alt : undefined)}>\n <PopoverTrigger asChild>\n <Button type=\"button\" variant=\"ghost\" size=\"sm\" aria-label={t('content.media.details', { name })}>\n <Layers aria-hidden=\"true\" />\n <span className=\"hidden sm:inline\">{t('content.media.detailsShort')}</span>\n </Button>\n </PopoverTrigger>\n <PopoverContent align=\"end\" className=\"w-80 space-y-3\">\n <form\n className=\"space-y-2\"\n onSubmit={(event) => {\n event.preventDefault();\n if (asset.data && alt !== undefined) {\n update.mutate({ id: asset.data.id, input: { expectedVersion: asset.data.version, alt } });\n }\n }}\n >\n <Label htmlFor={altId}>{t('content.media.altLabel')}</Label>\n <Input\n id={altId}\n value={alt ?? ''}\n readOnly={!canEditAlt}\n onChange={(event) => setAlt(event.target.value)}\n aria-describedby={`${altId}-hint`}\n />\n <p id={`${altId}-hint`} className=\"text-meta text-muted-foreground\">\n {t('content.media.altHint')}\n </p>\n {update.isError ? (\n <p className=\"text-meta text-destructive\">{describeError(update.error)}</p>\n ) : null}\n {canEditAlt ? (\n <SuggestAltButton\n assetId={asset.data.id}\n mimeType={asset.data.mimeType}\n locale={locale}\n onSuggest={setAlt}\n />\n ) : null}\n {canEditAlt ? (\n <Button type=\"submit\" size=\"sm\" disabled={update.isPending || alt === asset.data.alt}>\n {update.isPending ? t('common.saving') : t('content.media.saveAlt')}\n </Button>\n ) : null}\n </form>\n <div className=\"space-y-1\">\n <p className=\"text-sm font-semibold\">{t('content.media.variants')}</p>\n <Variants asset={asset.data} />\n </div>\n </PopoverContent>\n </Popover>\n ) : null}\n {editable && onMove ? (\n <>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={t('content.items.moveUp', { item: name, position: index + 1 })}\n disabled={index === 0}\n onClick={() => onMove(index - 1)}\n >\n <ArrowUp aria-hidden=\"true\" />\n </Button>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={t('content.items.moveDown', { item: name, position: index + 1 })}\n disabled={index === count - 1}\n onClick={() => onMove(index + 1)}\n >\n <ArrowDown aria-hidden=\"true\" />\n </Button>\n </>\n ) : null}\n {editable ? (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={t('content.media.remove', { name })}\n onClick={onRemove}\n >\n <Trash2 aria-hidden=\"true\" />\n </Button>\n ) : null}\n </li>\n );\n};\n"],"ignoreList":[0,1,2],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./jsx-runtime-DREnUpxT.js";import{F as n,H as r,P as i,V as a,l as o,r as s,s as c,t as l}from"./cn-h5ORT3LK.js";import{A as u,N as d,i as f,k as p}from"./skeleton-DJVukcn6.js";import{t as m}from"./sparkles-Dd6S_roX.js";var h=`https://github.com/mybrokengnome/shapio/blob/main/documentation/assist.md`,g=3e5,_=1500,v=[`succeeded`,`failed`],y=2e4,b=4e3,x={shorten:`Make it shorter and tighter, keeping the meaning and the tone.`,expand:`Expand it with a little more detail, keeping the meaning and the tone.`},S={silent:!0},C=()=>r({queryKey:i.assist.status,queryFn:()=>o.assist.status(),staleTime:g,meta:S}),w=()=>C().data?.enabled===!0,T=()=>a({mutationKey:[`assist`,`altText`],meta:S,mutationFn:e=>c(()=>o.assist.altText(e))}),E=()=>a({mutationKey:[`assist`,`summarize`],meta:S,mutationFn:e=>c(()=>o.assist.summarize(e))}),D=()=>a({mutationKey:[`assist`,`translate`],meta:S,mutationFn:e=>c(()=>o.assist.translate(e))}),O=()=>a({mutationKey:[`assist`,`rewrite`],meta:S,mutationFn:e=>c(()=>o.assist.rewrite(e))}),k=()=>a({mutationKey:[`assist`,`schemaDraft`],meta:S,mutationFn:e=>c(()=>o.assist.schemaDraft(e))}),A=()=>a({mutationKey:[`assist`,`contentOps`],meta:S,mutationFn:e=>c(()=>o.assist.proposeContentOps(e))}),j=e=>r({queryKey:i.assist.run(e??``),queryFn:()=>o.assist.contentOpsRun(e??``),enabled:e!==void 0,meta:S,refetchInterval:e=>e.state.data&&v.includes(e.state.data.status)?!1:_}),M=e(t(),1),N=({type:e=`button`,pending:t,pendingLabel:n,children:r,disabled:i,variant:a=`ghost`,size:o=`sm`,...c})=>(0,M.jsxs)(f,{type:e,variant:a,size:o,disabled:t||i,"aria-busy":t||void 0,...c,children:[t?(0,M.jsx)(s,{className:`animate-spin`,"aria-hidden":`true`}):(0,M.jsx)(m,{"aria-hidden":`true`}),t?n:r]}),P=e=>e instanceof n&&e.status===429?d.t(`assist.errors.rateLimited`):p(e),F=e=>u(e)??d.t(`assist.errors.runFailed`),I=({error:e,id:t,className:n})=>e?(0,M.jsx)(`p`,{id:t,role:`alert`,className:l(`text-meta text-destructive`,n),children:P(e)}):null;export{C as a,k as c,E as d,D as f,b as g,x as h,w as i,O as l,y as m,F as n,j as o,h as p,N as r,A as s,I as t,T as u};
2
- //# sourceMappingURL=AssistError-D_vY2CO0.js.map
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./jsx-runtime-DREnUpxT.js";import{F as n,H as r,P as i,V as a,l as o,r as s,s as c,t as l}from"./cn-CEPUgFbZ.js";import{A as u,N as d,i as f,k as p}from"./skeleton-BPLAzyDo.js";import{t as m}from"./sparkles-CykwtKTd.js";var h=`https://github.com/mybrokengnome/shapio/blob/main/documentation/assist.md`,g=3e5,_=1500,v=[`succeeded`,`failed`],y=2e4,b=4e3,x={shorten:`Make it shorter and tighter, keeping the meaning and the tone.`,expand:`Expand it with a little more detail, keeping the meaning and the tone.`},S={silent:!0},C=()=>r({queryKey:i.assist.status,queryFn:()=>o.assist.status(),staleTime:g,meta:S}),w=()=>C().data?.enabled===!0,T=()=>a({mutationKey:[`assist`,`altText`],meta:S,mutationFn:e=>c(()=>o.assist.altText(e))}),E=()=>a({mutationKey:[`assist`,`summarize`],meta:S,mutationFn:e=>c(()=>o.assist.summarize(e))}),D=()=>a({mutationKey:[`assist`,`translate`],meta:S,mutationFn:e=>c(()=>o.assist.translate(e))}),O=()=>a({mutationKey:[`assist`,`rewrite`],meta:S,mutationFn:e=>c(()=>o.assist.rewrite(e))}),k=()=>a({mutationKey:[`assist`,`schemaDraft`],meta:S,mutationFn:e=>c(()=>o.assist.schemaDraft(e))}),A=()=>a({mutationKey:[`assist`,`contentOps`],meta:S,mutationFn:e=>c(()=>o.assist.proposeContentOps(e))}),j=e=>r({queryKey:i.assist.run(e??``),queryFn:()=>o.assist.contentOpsRun(e??``),enabled:e!==void 0,meta:S,refetchInterval:e=>e.state.data&&v.includes(e.state.data.status)?!1:_}),M=e(t(),1),N=({type:e=`button`,pending:t,pendingLabel:n,children:r,disabled:i,variant:a=`ghost`,size:o=`sm`,...c})=>(0,M.jsxs)(f,{type:e,variant:a,size:o,disabled:t||i,"aria-busy":t||void 0,...c,children:[t?(0,M.jsx)(s,{className:`animate-spin`,"aria-hidden":`true`}):(0,M.jsx)(m,{"aria-hidden":`true`}),t?n:r]}),P=e=>e instanceof n&&e.status===429?d.t(`assist.errors.rateLimited`):p(e),F=e=>u(e)??d.t(`assist.errors.runFailed`),I=({error:e,id:t,className:n})=>e?(0,M.jsx)(`p`,{id:t,role:`alert`,className:l(`text-meta text-destructive`,n),children:P(e)}):null;export{C as a,k as c,E as d,D as f,b as g,x as h,w as i,O as l,y as m,F as n,j as o,h as p,N as r,A as s,I as t,T as u};
2
+ //# sourceMappingURL=AssistError-BidlzaBY.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AssistError-D_vY2CO0.js","names":["Loader2","i18next","__toESM","ShapioApiError","useQuery","queryKeys","useMutation","adminApi","LoaderCircle","withCsrf","cn","knownErrorMessage","instance","Button","describeError","Sparkles","ASSIST_DOCS_URL","ASSIST_STATUS_STALE_MS","CONTENT_OPS_POLL_MS","CONTENT_OPS_FINISHED","REWRITE_MAX_TEXT","SCHEMA_DESCRIPTION_MAX","REWRITE_PRESETS","silent","useAssistStatus","useAssistEnabled","useSuggestAltText","input","useSummarizeField","useTranslateEntry","useRewriteText","useProposeSchema","useProposeContentOps","useContentOpsRun","runId","query","import_jsx_runtime","require_jsx_runtime","AssistButton","props","pending","disabled","pendingLabel","children","describeAssistError","error","describeAssistErrorCode","code","AssistError","className"],"sources":["../../src/constants/assist.ts","../../src/api/assist.ts","../../src/components/AssistButton/index.tsx","../../src/helpers/describeAssistError.ts","../../src/components/AssistError/index.tsx"],"sourcesContent":["import type { ContentOpsStatus } from '@shapio/client';\n\n/** Turning assist on and choosing a provider (env only, by design: no key entry in the admin). */\nexport const ASSIST_DOCS_URL = 'https://github.com/mybrokengnome/shapio/blob/main/documentation/assist.md';\n\n/** The status changes only with a restart, so it is read once in a while, not on every screen. */\nexport const ASSIST_STATUS_STALE_MS = 5 * 60_000;\n\n/** How often a content-ops run is re-read while it is queued or running. */\nexport const CONTENT_OPS_POLL_MS = 1500;\n\nexport const CONTENT_OPS_FINISHED: readonly ContentOpsStatus[] = ['succeeded', 'failed'];\n\n/** The server's limits on a rewrite (routes/admin/assist/schemas.ts). */\nexport const REWRITE_MAX_TEXT = 20_000;\nexport const REWRITE_MAX_INSTRUCTION = 500;\n\n/** A schema description's limit (routes/admin/assist/schemas.ts). */\nexport const SCHEMA_DESCRIPTION_MAX = 4000;\n\n/**\n * One-click rewrite instructions (sent to the model as written; the buttons' labels are translated). The\n * model answers in the language of the text, whatever the instruction's language.\n */\nexport const REWRITE_PRESETS = {\n shorten: 'Make it shorter and tighter, keeping the meaning and the tone.',\n expand: 'Expand it with a little more detail, keeping the meaning and the tone.',\n} as const;\n","import type {\n AltTextInput,\n ContentOpsInput,\n RewriteInput,\n SchemaDraftInput,\n SummarizeInput,\n TranslateInput,\n} from '@shapio/client';\nimport { useMutation, useQuery } from '@tanstack/react-query';\nimport { ASSIST_STATUS_STALE_MS, CONTENT_OPS_FINISHED, CONTENT_OPS_POLL_MS } from '@/constants/assist';\nimport { adminApi } from './client';\nimport { withCsrf } from './csrf';\nimport { queryKeys } from './queryKeys';\n\n/** Assist errors are shown inline where the person asked (describeAssistError), so no toast. */\nconst silent = { silent: true } as const;\n\n/** Whether assist is on, the provider and model, and (with `changes.manage`) this month's usage. */\nexport const useAssistStatus = () =>\n useQuery({\n queryKey: queryKeys.assist.status,\n queryFn: () => adminApi.assist.status(),\n staleTime: ASSIST_STATUS_STALE_MS,\n meta: silent,\n });\n\n/** True only once the server said assist is on; every assist control renders nothing otherwise. */\nexport const useAssistEnabled = () => useAssistStatus().data?.enabled === true;\n\nexport const useSuggestAltText = () =>\n useMutation({\n mutationKey: ['assist', 'altText'],\n meta: silent,\n mutationFn: (input: AltTextInput) => withCsrf(() => adminApi.assist.altText(input)),\n });\n\nexport const useSummarizeField = () =>\n useMutation({\n mutationKey: ['assist', 'summarize'],\n meta: silent,\n mutationFn: (input: SummarizeInput) => withCsrf(() => adminApi.assist.summarize(input)),\n });\n\nexport const useTranslateEntry = () =>\n useMutation({\n mutationKey: ['assist', 'translate'],\n meta: silent,\n mutationFn: (input: TranslateInput) => withCsrf(() => adminApi.assist.translate(input)),\n });\n\nexport const useRewriteText = () =>\n useMutation({\n mutationKey: ['assist', 'rewrite'],\n meta: silent,\n mutationFn: (input: RewriteInput) => withCsrf(() => adminApi.assist.rewrite(input)),\n });\n\n/** Proposed definitions for a description; writes nothing. */\nexport const useProposeSchema = () =>\n useMutation({\n mutationKey: ['assist', 'schemaDraft'],\n meta: silent,\n mutationFn: (input: SchemaDraftInput) => withCsrf(() => adminApi.assist.schemaDraft(input)),\n });\n\nexport const useProposeContentOps = () =>\n useMutation({\n mutationKey: ['assist', 'contentOps'],\n meta: silent,\n mutationFn: (input: ContentOpsInput) => withCsrf(() => adminApi.assist.proposeContentOps(input)),\n });\n\n/** A content-ops run, re-read until it has finished. */\nexport const useContentOpsRun = (runId: string | undefined) =>\n useQuery({\n queryKey: queryKeys.assist.run(runId ?? ''),\n queryFn: () => adminApi.assist.contentOpsRun(runId ?? ''),\n enabled: runId !== undefined,\n meta: silent,\n refetchInterval: (query) =>\n query.state.data && CONTENT_OPS_FINISHED.includes(query.state.data.status)\n ? false\n : CONTENT_OPS_POLL_MS,\n });\n","import { Loader2, Sparkles } from 'lucide-react';\nimport type { ComponentProps } from 'react';\nimport { Button } from '@/components/ui/button';\n\ntype AssistButtonProps = Omit<ComponentProps<typeof Button>, 'type'> & {\n type?: 'button' | 'submit';\n pending: boolean;\n pendingLabel: string;\n};\n\n/**\n * Runs an editor assist: the sparkle marks a model-written proposal (the person reviews it before anything\n * is saved), a spinner and `pendingLabel` while the model works, and no double runs.\n */\nexport const AssistButton = ({\n type = 'button',\n pending,\n pendingLabel,\n children,\n disabled,\n variant = 'ghost',\n size = 'sm',\n ...props\n}: AssistButtonProps) => (\n <Button\n type={type}\n variant={variant}\n size={size}\n disabled={pending || disabled}\n aria-busy={pending || undefined}\n {...props}\n >\n {pending ? <Loader2 className=\"animate-spin\" aria-hidden=\"true\" /> : <Sparkles aria-hidden=\"true\" />}\n {pending ? pendingLabel : children}\n </Button>\n);\n","import { ShapioApiError } from '@shapio/client';\nimport { i18next } from '@/app/i18n';\nimport { describeError, knownErrorMessage } from './describeError';\n\n/**\n * The inline message for a failed assist request: the per-actor limit gets its own sentence (the shared\n * RATE_LIMITED one is about sign-in attempts); every ASSIST_* code has a translation under\n * `errors.codes`; anything else falls back to the server's message (describeError).\n */\nexport const describeAssistError = (error: unknown): string =>\n error instanceof ShapioApiError && error.status === 429\n ? i18next.t('assist.errors.rateLimited')\n : describeError(error);\n\n/** A failed background run reports only its error code: its translated sentence, or a generic one. */\nexport const describeAssistErrorCode = (code: string): string =>\n knownErrorMessage(code) ?? i18next.t('assist.errors.runFailed');\n","import { cn } from '@/helpers/cn';\nimport { describeAssistError } from '@/helpers/describeAssistError';\n\ntype AssistErrorProps = { error: unknown; id?: string; className?: string };\n\n/** Why an assist failed, inline where it was asked for and announced (the server's message or a translation). */\nexport const AssistError = ({ error, id, className }: AssistErrorProps) => {\n if (!error) {\n return null;\n }\n return (\n <p id={id} role=\"alert\" className={cn('text-meta text-destructive', className)}>\n {describeAssistError(error)}\n </p>\n );\n};\n"],"mappings":"6RAGA,IAAagB,EAAkB,4EAGlBC,EAAyB,IAGzBC,EAAsB,KAEtBC,EAAoD,CAAC,YAAa,QAAQ,EAG1EC,EAAmB,IAInBC,EAAyB,IAMzBC,EAAkB,CAC7B,QAAS,iEACT,OAAQ,wEACV,ECZMC,EAAS,CAAE,OAAQ,EAAK,EAGjBC,MACXpB,EAAS,CACP,SAAUC,EAAU,OAAO,OAC3B,YAAeE,EAAS,OAAO,OAAO,EACtC,UAAWU,EACX,KAAMM,CACR,CAAC,EAGUE,MAAyBD,EAAgB,CAAC,CAAC,MAAM,UAAY,GAE7DE,MACXpB,EAAY,CACV,YAAa,CAAC,SAAU,SAAS,EACjC,KAAMiB,EACN,WAAa,GAAwBd,MAAeF,EAAS,OAAO,QAAQoB,CAAK,CAAC,CACpF,CAAC,EAEUC,MACXtB,EAAY,CACV,YAAa,CAAC,SAAU,WAAW,EACnC,KAAMiB,EACN,WAAa,GAA0Bd,MAAeF,EAAS,OAAO,UAAUoB,CAAK,CAAC,CACxF,CAAC,EAEUE,MACXvB,EAAY,CACV,YAAa,CAAC,SAAU,WAAW,EACnC,KAAMiB,EACN,WAAa,GAA0Bd,MAAeF,EAAS,OAAO,UAAUoB,CAAK,CAAC,CACxF,CAAC,EAEUG,MACXxB,EAAY,CACV,YAAa,CAAC,SAAU,SAAS,EACjC,KAAMiB,EACN,WAAa,GAAwBd,MAAeF,EAAS,OAAO,QAAQoB,CAAK,CAAC,CACpF,CAAC,EAGUI,MACXzB,EAAY,CACV,YAAa,CAAC,SAAU,aAAa,EACrC,KAAMiB,EACN,WAAa,GAA4Bd,MAAeF,EAAS,OAAO,YAAYoB,CAAK,CAAC,CAC5F,CAAC,EAEUK,MACX1B,EAAY,CACV,YAAa,CAAC,SAAU,YAAY,EACpC,KAAMiB,EACN,WAAa,GAA2Bd,MAAeF,EAAS,OAAO,kBAAkBoB,CAAK,CAAC,CACjG,CAAC,EAGUM,EAAoB,GAC/B7B,EAAS,CACP,SAAUC,EAAU,OAAO,IAAI6B,GAAS,EAAE,EAC1C,YAAe3B,EAAS,OAAO,cAAc2B,GAAS,EAAE,EACxD,QAASA,IAAU,IAAA,GACnB,KAAMX,EACN,gBAAkB,GAChBY,EAAM,MAAM,MAAQhB,EAAqB,SAASgB,EAAM,MAAM,KAAK,MAAM,EACrE,GACAjB,CACR,CAAC,aCrEUoB,GAAgB,CAC3B,OAAO,SACP,UACA,eACA,WACA,WACA,UAAU,QACV,OAAO,KACP,GAAGC,MAEH,EAAAH,EAAA,KAAA,CAACvB,EAAD,CACQ,OACG,UACH,OACN,SAAU2B,GAAWC,EACrB,YAAWD,GAAW,IAAA,GACtB,GAAID,EANN,SAAA,CAQGC,GAAU,EAAAJ,EAAA,IAAA,CAACpC,EAAD,CAAS,UAAU,eAAe,cAAY,MAAQ,CAAA,GAAI,EAAAoC,EAAA,IAAA,CAACrB,EAAD,CAAU,cAAY,MAAQ,CAAA,EAClGyB,EAAUE,EAAeC,CACpB,ICzBGC,EAAuB,GAClCC,aAAiB1C,GAAkB0C,EAAM,SAAW,IAChD5C,EAAQ,EAAE,2BAA2B,EACrCa,EAAc+B,CAAK,EAGZC,EAA2B,GACtCnC,EAAkBoC,CAAI,GAAK9C,EAAQ,EAAE,yBAAyB,ECVnD+C,GAAe,CAAE,QAAO,KAAI,eAClCH,GAIH,EAAAT,EAAA,IAAA,CAAC,IAAD,CAAO,KAAI,KAAK,QAAQ,UAAW1B,EAAG,6BAA8BuC,CAAS,EAC1E,SAAAL,EAAoBC,CAAK,CACzB,CAAA,EALI"}
1
+ {"version":3,"file":"AssistError-BidlzaBY.js","names":["Loader2","i18next","__toESM","ShapioApiError","useQuery","queryKeys","useMutation","adminApi","LoaderCircle","withCsrf","cn","knownErrorMessage","instance","Button","describeError","Sparkles","ASSIST_DOCS_URL","ASSIST_STATUS_STALE_MS","CONTENT_OPS_POLL_MS","CONTENT_OPS_FINISHED","REWRITE_MAX_TEXT","SCHEMA_DESCRIPTION_MAX","REWRITE_PRESETS","silent","useAssistStatus","useAssistEnabled","useSuggestAltText","input","useSummarizeField","useTranslateEntry","useRewriteText","useProposeSchema","useProposeContentOps","useContentOpsRun","runId","query","import_jsx_runtime","require_jsx_runtime","AssistButton","props","pending","disabled","pendingLabel","children","describeAssistError","error","describeAssistErrorCode","code","AssistError","className"],"sources":["../../src/constants/assist.ts","../../src/api/assist.ts","../../src/components/AssistButton/index.tsx","../../src/helpers/describeAssistError.ts","../../src/components/AssistError/index.tsx"],"sourcesContent":["import type { ContentOpsStatus } from '@shapio/client';\n\n/** Turning assist on and choosing a provider (env only, by design: no key entry in the admin). */\nexport const ASSIST_DOCS_URL = 'https://github.com/mybrokengnome/shapio/blob/main/documentation/assist.md';\n\n/** The status changes only with a restart, so it is read once in a while, not on every screen. */\nexport const ASSIST_STATUS_STALE_MS = 5 * 60_000;\n\n/** How often a content-ops run is re-read while it is queued or running. */\nexport const CONTENT_OPS_POLL_MS = 1500;\n\nexport const CONTENT_OPS_FINISHED: readonly ContentOpsStatus[] = ['succeeded', 'failed'];\n\n/** The server's limits on a rewrite (routes/admin/assist/schemas.ts). */\nexport const REWRITE_MAX_TEXT = 20_000;\nexport const REWRITE_MAX_INSTRUCTION = 500;\n\n/** A schema description's limit (routes/admin/assist/schemas.ts). */\nexport const SCHEMA_DESCRIPTION_MAX = 4000;\n\n/**\n * One-click rewrite instructions (sent to the model as written; the buttons' labels are translated). The\n * model answers in the language of the text, whatever the instruction's language.\n */\nexport const REWRITE_PRESETS = {\n shorten: 'Make it shorter and tighter, keeping the meaning and the tone.',\n expand: 'Expand it with a little more detail, keeping the meaning and the tone.',\n} as const;\n","import type {\n AltTextInput,\n ContentOpsInput,\n RewriteInput,\n SchemaDraftInput,\n SummarizeInput,\n TranslateInput,\n} from '@shapio/client';\nimport { useMutation, useQuery } from '@tanstack/react-query';\nimport { ASSIST_STATUS_STALE_MS, CONTENT_OPS_FINISHED, CONTENT_OPS_POLL_MS } from '@/constants/assist';\nimport { adminApi } from './client';\nimport { withCsrf } from './csrf';\nimport { queryKeys } from './queryKeys';\n\n/** Assist errors are shown inline where the person asked (describeAssistError), so no toast. */\nconst silent = { silent: true } as const;\n\n/** Whether assist is on, the provider and model, and (with `changes.manage`) this month's usage. */\nexport const useAssistStatus = () =>\n useQuery({\n queryKey: queryKeys.assist.status,\n queryFn: () => adminApi.assist.status(),\n staleTime: ASSIST_STATUS_STALE_MS,\n meta: silent,\n });\n\n/** True only once the server said assist is on; every assist control renders nothing otherwise. */\nexport const useAssistEnabled = () => useAssistStatus().data?.enabled === true;\n\nexport const useSuggestAltText = () =>\n useMutation({\n mutationKey: ['assist', 'altText'],\n meta: silent,\n mutationFn: (input: AltTextInput) => withCsrf(() => adminApi.assist.altText(input)),\n });\n\nexport const useSummarizeField = () =>\n useMutation({\n mutationKey: ['assist', 'summarize'],\n meta: silent,\n mutationFn: (input: SummarizeInput) => withCsrf(() => adminApi.assist.summarize(input)),\n });\n\nexport const useTranslateEntry = () =>\n useMutation({\n mutationKey: ['assist', 'translate'],\n meta: silent,\n mutationFn: (input: TranslateInput) => withCsrf(() => adminApi.assist.translate(input)),\n });\n\nexport const useRewriteText = () =>\n useMutation({\n mutationKey: ['assist', 'rewrite'],\n meta: silent,\n mutationFn: (input: RewriteInput) => withCsrf(() => adminApi.assist.rewrite(input)),\n });\n\n/** Proposed definitions for a description; writes nothing. */\nexport const useProposeSchema = () =>\n useMutation({\n mutationKey: ['assist', 'schemaDraft'],\n meta: silent,\n mutationFn: (input: SchemaDraftInput) => withCsrf(() => adminApi.assist.schemaDraft(input)),\n });\n\nexport const useProposeContentOps = () =>\n useMutation({\n mutationKey: ['assist', 'contentOps'],\n meta: silent,\n mutationFn: (input: ContentOpsInput) => withCsrf(() => adminApi.assist.proposeContentOps(input)),\n });\n\n/** A content-ops run, re-read until it has finished. */\nexport const useContentOpsRun = (runId: string | undefined) =>\n useQuery({\n queryKey: queryKeys.assist.run(runId ?? ''),\n queryFn: () => adminApi.assist.contentOpsRun(runId ?? ''),\n enabled: runId !== undefined,\n meta: silent,\n refetchInterval: (query) =>\n query.state.data && CONTENT_OPS_FINISHED.includes(query.state.data.status)\n ? false\n : CONTENT_OPS_POLL_MS,\n });\n","import { Loader2, Sparkles } from 'lucide-react';\nimport type { ComponentProps } from 'react';\nimport { Button } from '@/components/ui/button';\n\ntype AssistButtonProps = Omit<ComponentProps<typeof Button>, 'type'> & {\n type?: 'button' | 'submit';\n pending: boolean;\n pendingLabel: string;\n};\n\n/**\n * Runs an editor assist: the sparkle marks a model-written proposal (the person reviews it before anything\n * is saved), a spinner and `pendingLabel` while the model works, and no double runs.\n */\nexport const AssistButton = ({\n type = 'button',\n pending,\n pendingLabel,\n children,\n disabled,\n variant = 'ghost',\n size = 'sm',\n ...props\n}: AssistButtonProps) => (\n <Button\n type={type}\n variant={variant}\n size={size}\n disabled={pending || disabled}\n aria-busy={pending || undefined}\n {...props}\n >\n {pending ? <Loader2 className=\"animate-spin\" aria-hidden=\"true\" /> : <Sparkles aria-hidden=\"true\" />}\n {pending ? pendingLabel : children}\n </Button>\n);\n","import { ShapioApiError } from '@shapio/client';\nimport { i18next } from '@/app/i18n';\nimport { describeError, knownErrorMessage } from './describeError';\n\n/**\n * The inline message for a failed assist request: the per-actor limit gets its own sentence (the shared\n * RATE_LIMITED one is about sign-in attempts); every ASSIST_* code has a translation under\n * `errors.codes`; anything else falls back to the server's message (describeError).\n */\nexport const describeAssistError = (error: unknown): string =>\n error instanceof ShapioApiError && error.status === 429\n ? i18next.t('assist.errors.rateLimited')\n : describeError(error);\n\n/** A failed background run reports only its error code: its translated sentence, or a generic one. */\nexport const describeAssistErrorCode = (code: string): string =>\n knownErrorMessage(code) ?? i18next.t('assist.errors.runFailed');\n","import { cn } from '@/helpers/cn';\nimport { describeAssistError } from '@/helpers/describeAssistError';\n\ntype AssistErrorProps = { error: unknown; id?: string; className?: string };\n\n/** Why an assist failed, inline where it was asked for and announced (the server's message or a translation). */\nexport const AssistError = ({ error, id, className }: AssistErrorProps) => {\n if (!error) {\n return null;\n }\n return (\n <p id={id} role=\"alert\" className={cn('text-meta text-destructive', className)}>\n {describeAssistError(error)}\n </p>\n );\n};\n"],"mappings":"6RAGA,IAAagB,EAAkB,4EAGlBC,EAAyB,IAGzBC,EAAsB,KAEtBC,EAAoD,CAAC,YAAa,QAAQ,EAG1EC,EAAmB,IAInBC,EAAyB,IAMzBC,EAAkB,CAC7B,QAAS,iEACT,OAAQ,wEACV,ECZMC,EAAS,CAAE,OAAQ,EAAK,EAGjBC,MACXpB,EAAS,CACP,SAAUC,EAAU,OAAO,OAC3B,YAAeE,EAAS,OAAO,OAAO,EACtC,UAAWU,EACX,KAAMM,CACR,CAAC,EAGUE,MAAyBD,EAAgB,CAAC,CAAC,MAAM,UAAY,GAE7DE,MACXpB,EAAY,CACV,YAAa,CAAC,SAAU,SAAS,EACjC,KAAMiB,EACN,WAAa,GAAwBd,MAAeF,EAAS,OAAO,QAAQoB,CAAK,CAAC,CACpF,CAAC,EAEUC,MACXtB,EAAY,CACV,YAAa,CAAC,SAAU,WAAW,EACnC,KAAMiB,EACN,WAAa,GAA0Bd,MAAeF,EAAS,OAAO,UAAUoB,CAAK,CAAC,CACxF,CAAC,EAEUE,MACXvB,EAAY,CACV,YAAa,CAAC,SAAU,WAAW,EACnC,KAAMiB,EACN,WAAa,GAA0Bd,MAAeF,EAAS,OAAO,UAAUoB,CAAK,CAAC,CACxF,CAAC,EAEUG,MACXxB,EAAY,CACV,YAAa,CAAC,SAAU,SAAS,EACjC,KAAMiB,EACN,WAAa,GAAwBd,MAAeF,EAAS,OAAO,QAAQoB,CAAK,CAAC,CACpF,CAAC,EAGUI,MACXzB,EAAY,CACV,YAAa,CAAC,SAAU,aAAa,EACrC,KAAMiB,EACN,WAAa,GAA4Bd,MAAeF,EAAS,OAAO,YAAYoB,CAAK,CAAC,CAC5F,CAAC,EAEUK,MACX1B,EAAY,CACV,YAAa,CAAC,SAAU,YAAY,EACpC,KAAMiB,EACN,WAAa,GAA2Bd,MAAeF,EAAS,OAAO,kBAAkBoB,CAAK,CAAC,CACjG,CAAC,EAGUM,EAAoB,GAC/B7B,EAAS,CACP,SAAUC,EAAU,OAAO,IAAI6B,GAAS,EAAE,EAC1C,YAAe3B,EAAS,OAAO,cAAc2B,GAAS,EAAE,EACxD,QAASA,IAAU,IAAA,GACnB,KAAMX,EACN,gBAAkB,GAChBY,EAAM,MAAM,MAAQhB,EAAqB,SAASgB,EAAM,MAAM,KAAK,MAAM,EACrE,GACAjB,CACR,CAAC,aCrEUoB,GAAgB,CAC3B,OAAO,SACP,UACA,eACA,WACA,WACA,UAAU,QACV,OAAO,KACP,GAAGC,MAEH,EAAAH,EAAA,KAAA,CAACvB,EAAD,CACQ,OACG,UACH,OACN,SAAU2B,GAAWC,EACrB,YAAWD,GAAW,IAAA,GACtB,GAAID,EANN,SAAA,CAQGC,GAAU,EAAAJ,EAAA,IAAA,CAACpC,EAAD,CAAS,UAAU,eAAe,cAAY,MAAQ,CAAA,GAAI,EAAAoC,EAAA,IAAA,CAACrB,EAAD,CAAU,cAAY,MAAQ,CAAA,EAClGyB,EAAUE,EAAeC,CACpB,ICzBGC,EAAuB,GAClCC,aAAiB1C,GAAkB0C,EAAM,SAAW,IAChD5C,EAAQ,EAAE,2BAA2B,EACrCa,EAAc+B,CAAK,EAGZC,EAA2B,GACtCnC,EAAkBoC,CAAI,GAAK9C,EAAQ,EAAE,yBAAyB,ECVnD+C,GAAe,CAAE,QAAO,KAAI,eAClCH,GAIH,EAAAT,EAAA,IAAA,CAAC,IAAD,CAAO,KAAI,KAAK,QAAQ,UAAW1B,EAAG,6BAA8BuC,CAAS,EAC1E,SAAAL,EAAoBC,CAAK,CACzB,CAAA,EALI"}
@@ -1,6 +1,6 @@
1
- import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-CQOZoUwg.js";import{t as n}from"./jsx-runtime-DREnUpxT.js";import{i as r,j as i}from"./cn-h5ORT3LK.js";import{z as a}from"./InfoHint-D3uwei-E.js";import{t as o}from"./image-D9p_gGE2.js";import{i as s,m as c,o as l}from"./dropdown-menu-DGSMTf23.js";import{t as u}from"./InsertMenuItem-DAihGvbw.js";var d={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]};d.node;var f=r(d),p={name:`heading-2`,size:24,node:[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]};p.node;var ee=r(p),te={name:`heading-3`,size:24,node:[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2`,key:`68ncm8`}],[`path`,{d:`M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2`,key:`1ejuhz`}]]};te.node;var ne=r(te),re={name:`list-ordered`,size:24,node:[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]};re.node;var ie=r(re),ae={name:`pilcrow`,size:24,node:[[`path`,{d:`M13 4v16`,key:`8vvj80`}],[`path`,{d:`M17 4v16`,key:`7dpous`}],[`path`,{d:`M19 4H9.5a4.5 4.5 0 0 0 0 9H13`,key:`sh4n9v`}]]};ae.node;var oe=r(ae),se={name:`quote`,size:24,node:[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]};se.node;var ce=r(se),le={name:`table`,size:24,node:[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]};le.node;var ue=r(le),m=e(t(),1),de=(0,m.createContext)(null),fe=()=>(0,m.useContext)(de),pe=(e,t)=>{let n=fe();(0,m.useEffect)(()=>{if(n&&t)return n.set(e,t),()=>{n.get(e)===t&&n.delete(e)}},[n,e,t])};function h(e){this.content=e}h.prototype={constructor:h,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new h(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new h(n)},addToStart:function(e,t){return new h([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new h(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new h(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=h.from(e),e.size?new h(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=h.from(e),e.size?new h(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=h.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},h.from=function(e){if(e instanceof h)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new h(t)};function me(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){let e=i.text,t=a.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r<e.length&&r<t.length&&_e(e.charCodeAt(r-1))&&ge(e.charCodeAt(r))&&n--,n}if(i.content.size||a.content.size){let e=me(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function he(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=o.text,t=s.text,i=e.length,a=t.length;for(;i>0&&a>0&&e[i-1]==t[a-1];)i--,a--,n--,r--;return i&&a&&i<e.length&&_e(e.charCodeAt(i-1))&&ge(e.charCodeAt(i))&&(n++,r++),{a:n,b:r}}if(o.content.size||s.content.size){let e=he(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}function ge(e){return e>=56320&&e<57344}function _e(e){return e>=55296&&e<56320}var g=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return me(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return he(this,e,t,n)}findIndex(e){if(e==0)return _(0,e);if(e==this.size)return _(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?_(t+1,i):_(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};g.empty=new g([],0);var ve={index:0,offset:0};function _(e,t){return ve.index=e,ve.offset=t,ve}function v(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!v(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!v(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var y=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else!n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&v(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);return n.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};y.none=[];var b=class extends Error{},x=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=be(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(ye(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(g.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};x.empty=new x(g.empty,0,0);function ye(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(ye(a.content,t-i-1,n-i-1)))}function be(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=be(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function xe(e,t,n){if(n.openStart>e.depth)throw new b(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new b(`Inconsistent open depths`);return Se(e,t,n,0)}function Se(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=Se(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}if(!n.content.size)return w(a,T(e,t,r));if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return w(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}{let{start:i,end:o}=Ee(n,e);return w(a,Te(e,i,o,t,r))}}function Ce(e,t){if(!t.type.compatibleContent(e.type))throw new b(`Cannot join `+t.type.name+` onto `+e.type.name)}function we(e,t,n){let r=e.node(n);return Ce(r,t.node(n)),r}function S(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function C(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(S(e.nodeAfter,r),a++));for(let e=a;e<o;e++)S(i.child(e),r);t&&t.depth==n&&t.textOffset&&S(t.nodeBefore,r)}function w(e,t){if(!e.type.validContent(t))throw new b(`Invalid content for node `+e.type.name);return e.copy(t)}function Te(e,t,n,r,i){let a=e.depth>i&&we(e,t,i+1),o=r.depth>i&&we(n,r,i+1),s=[];return C(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(Ce(a,o),S(w(a,Te(e,t,n,r,i+1)),s)):(a&&S(w(a,T(e,t,i+1)),s),C(t,n,i,s),o&&S(w(o,T(n,r,i+1)),s)),C(r,null,i,s),new g(s)}function T(e,t,n){let r=[];return C(null,e,n,r),e.depth>n&&S(w(we(e,t,n+1),T(e,t,n+1)),r),C(t,null,n,r),new g(r)}function Ee(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(g.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var De=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return y.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new je(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=Ae.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else Ae.set(t,r=new Oe);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%ke,i}},Oe=class{constructor(){this.elts=[],this.i=0}},ke=12,Ae=new WeakMap,je=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},Me=Object.create(null),E=class e{constructor(e,t,n,r=y.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||g.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&v(this.attrs,t||e.defaultAttrs||Me)&&y.sameSet(this.marks,n||y.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return x.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new x(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return xe(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return De.resolveCached(this,e)}resolveNoCache(e){return De.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),Pe(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=g.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),Fe(this.type.attrs,this.attrs,`node`,this.type.name);let e=y.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];Fe(n.type.attrs,n.attrs,`mark`,n.type.name),e=n.addToSet(e)}if(!y.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=g.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}};E.prototype.text=void 0;var Ne=class e extends E{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Pe(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Pe(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}function Fe(e,t,n,r){for(let i in t)if(!(i in e))throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let n in e)e[n].validate&&e[n].validate(t[n])}var D=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Ie(t,n);if(r.next==null)return e.empty;let i=Le(r);r.next&&r.err(`Unexpected trailing text`);let a=qe(We(i));return Je(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return g.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
1
+ import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{t}from"./react-CQOZoUwg.js";import{t as n}from"./jsx-runtime-DREnUpxT.js";import{i as r,j as i}from"./cn-CEPUgFbZ.js";import{z as a}from"./InfoHint-BdAadb9U.js";import{t as o}from"./image-4itB4TLl.js";import{i as s,m as c,o as l}from"./dropdown-menu-BG1rctRQ.js";import{t as u}from"./InsertMenuItem-oh0NJrhB.js";var d={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]};d.node;var f=r(d),p={name:`heading-2`,size:24,node:[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]};p.node;var ee=r(p),te={name:`heading-3`,size:24,node:[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2`,key:`68ncm8`}],[`path`,{d:`M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2`,key:`1ejuhz`}]]};te.node;var ne=r(te),re={name:`list-ordered`,size:24,node:[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]};re.node;var ie=r(re),ae={name:`pilcrow`,size:24,node:[[`path`,{d:`M13 4v16`,key:`8vvj80`}],[`path`,{d:`M17 4v16`,key:`7dpous`}],[`path`,{d:`M19 4H9.5a4.5 4.5 0 0 0 0 9H13`,key:`sh4n9v`}]]};ae.node;var oe=r(ae),se={name:`quote`,size:24,node:[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]};se.node;var ce=r(se),le={name:`table`,size:24,node:[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]};le.node;var ue=r(le),m=e(t(),1),de=(0,m.createContext)(null),fe=()=>(0,m.useContext)(de),pe=(e,t)=>{let n=fe();(0,m.useEffect)(()=>{if(n&&t)return n.set(e,t),()=>{n.get(e)===t&&n.delete(e)}},[n,e,t])};function h(e){this.content=e}h.prototype={constructor:h,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new h(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new h(n)},addToStart:function(e,t){return new h([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new h(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new h(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=h.from(e),e.size?new h(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=h.from(e),e.size?new h(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=h.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},h.from=function(e){if(e instanceof h)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new h(t)};function me(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){let e=i.text,t=a.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r<e.length&&r<t.length&&_e(e.charCodeAt(r-1))&&ge(e.charCodeAt(r))&&n--,n}if(i.content.size||a.content.size){let e=me(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function he(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=o.text,t=s.text,i=e.length,a=t.length;for(;i>0&&a>0&&e[i-1]==t[a-1];)i--,a--,n--,r--;return i&&a&&i<e.length&&_e(e.charCodeAt(i-1))&&ge(e.charCodeAt(i))&&(n++,r++),{a:n,b:r}}if(o.content.size||s.content.size){let e=he(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}function ge(e){return e>=56320&&e<57344}function _e(e){return e>=55296&&e<56320}var g=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return me(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return he(this,e,t,n)}findIndex(e){if(e==0)return _(0,e);if(e==this.size)return _(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?_(t+1,i):_(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};g.empty=new g([],0);var ve={index:0,offset:0};function _(e,t){return ve.index=e,ve.offset=t,ve}function v(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!v(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!v(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var y=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else!n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&v(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);return n.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};y.none=[];var b=class extends Error{},x=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=be(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(ye(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(g.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};x.empty=new x(g.empty,0,0);function ye(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(ye(a.content,t-i-1,n-i-1)))}function be(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=be(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function xe(e,t,n){if(n.openStart>e.depth)throw new b(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new b(`Inconsistent open depths`);return Se(e,t,n,0)}function Se(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=Se(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}if(!n.content.size)return w(a,T(e,t,r));if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return w(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}{let{start:i,end:o}=Ee(n,e);return w(a,Te(e,i,o,t,r))}}function Ce(e,t){if(!t.type.compatibleContent(e.type))throw new b(`Cannot join `+t.type.name+` onto `+e.type.name)}function we(e,t,n){let r=e.node(n);return Ce(r,t.node(n)),r}function S(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function C(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(S(e.nodeAfter,r),a++));for(let e=a;e<o;e++)S(i.child(e),r);t&&t.depth==n&&t.textOffset&&S(t.nodeBefore,r)}function w(e,t){if(!e.type.validContent(t))throw new b(`Invalid content for node `+e.type.name);return e.copy(t)}function Te(e,t,n,r,i){let a=e.depth>i&&we(e,t,i+1),o=r.depth>i&&we(n,r,i+1),s=[];return C(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(Ce(a,o),S(w(a,Te(e,t,n,r,i+1)),s)):(a&&S(w(a,T(e,t,i+1)),s),C(t,n,i,s),o&&S(w(o,T(n,r,i+1)),s)),C(r,null,i,s),new g(s)}function T(e,t,n){let r=[];return C(null,e,n,r),e.depth>n&&S(w(we(e,t,n+1),T(e,t,n+1)),r),C(t,null,n,r),new g(r)}function Ee(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(g.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var De=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return y.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new je(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=Ae.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else Ae.set(t,r=new Oe);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%ke,i}},Oe=class{constructor(){this.elts=[],this.i=0}},ke=12,Ae=new WeakMap,je=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},Me=Object.create(null),E=class e{constructor(e,t,n,r=y.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||g.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&v(this.attrs,t||e.defaultAttrs||Me)&&y.sameSet(this.marks,n||y.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return x.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new x(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return xe(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return De.resolveCached(this,e)}resolveNoCache(e){return De.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),Pe(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=g.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),Fe(this.type.attrs,this.attrs,`node`,this.type.name);let e=y.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];Fe(n.type.attrs,n.attrs,`mark`,n.type.name),e=n.addToSet(e)}if(!y.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=g.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}};E.prototype.text=void 0;var Ne=class e extends E{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Pe(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Pe(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}function Fe(e,t,n,r){for(let i in t)if(!(i in e))throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let n in e)e[n].validate&&e[n].validate(t[n])}var D=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Ie(t,n);if(r.next==null)return e.empty;let i=Le(r);r.next&&r.err(`Unexpected trailing text`);let a=qe(We(i));return Je(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return g.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
2
2
  `)}};D.empty=new D(!0);var Ie=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function Le(e){let t=[];do t.push(Re(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function Re(e){let t=[];do t.push(ze(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function ze(e){let t=Ue(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=Ve(e,t);else break;return t}function Be(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function Ve(e,t){let n=Be(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:Be(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function He(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function Ue(e){if(e.eat(`(`)){let t=Le(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=He(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function We(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function Ge(e,t){return t-e}function Ke(e,t){let n=[];return r(t),n.sort(Ge);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function qe(e){let t=Object.create(null);return n(Ke(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);Ke(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new D(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(Ge);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function Je(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function Ye(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function Xe(e,t){let n=Object.create(null);for(let r in e){let i=e[r],a=t&&t[r];if(a===void 0){if(i.hasDefault)a=i.default;else throw RangeError(`No value supplied for attribute `+r)}else i.validate&&i.validate(a);n[r]=a}return n}function Ze(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new et(e,r,t[r]);return n}var Qe=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=Ze(e,n.attrs),this.defaultAttrs=Ye(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==D.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Xe(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new E(this,this.computeAttrs(e),g.from(t),y.setFrom(n))}createChecked(e=null,t,n){return t=g.from(t),this.checkContent(t),new E(this,this.computeAttrs(e),t,y.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=g.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(g.empty,!0);return i?new E(this,e,t.append(i),y.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:y.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function $e(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var et=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?$e(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},tt=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=Ze(e,r.attrs),this.excluded=null;let i=Ye(this.attrs);this.instance=i?new y(this,i):null}create(e=null){return!e&&this.instance?this.instance:new y(this,Xe(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}},nt=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=h.from(e.nodes),t.marks=h.from(e.marks||{}),this.nodes=Qe.compile(this.spec.nodes,this),this.marks=tt.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=D.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?rt(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:rt(this,n.split(` `))}this.nodeFromJSON=e=>E.fromJSON(this,e),this.markFromJSON=e=>y.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof Qe))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new Ne(n,n.defaultAttrs,e,y.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function rt(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function it(e){return e.tag!=null}function at(e){return e.style!=null}var ot=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(it(e))this.tags.push(e);else if(at(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new ft(this,t,!1);return n.addAll(e,y.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new ft(this,t,!0);return n.addAll(e,y.none,t.from,t.to),x.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(mt(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=ht(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=ht(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},st={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},ct={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},lt={ol:!0,ul:!0},O=1,ut=2,k=4;function dt(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:(t?O:0)|(t===`full`?ut:0)}var A=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=y.none,this.match=i||(a&k?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(g.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&O)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=g.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(g.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!st.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},ft=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=dt(null,t.preserveWhitespace,0)|(n?k:0);i=r?new A(r.type,r.attrs,y.none,!0,t.topMatch||r.type.contentMatch,a):n?new A(null,null,y.none,!0,null,a):new A(e.schema.topNodeType,null,y.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&ut?`full`:this.localPreserveWS||(r.options&O)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
3
3
  `);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;lt.hasOwnProperty(a)&&this.parser.normalizeLists&&pt(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:ct.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(st.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
4
4
  `),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node){if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=y.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):gt(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=dt(e,i,a.options);a.options&k&&a.content.length==0&&(o|=k);let s=y.none;return n=n.filter(t=>!(a.type?a.type.allowsMarkType(t.type):gt(t.type,e))||(s=t.addToSet(s),!1)),this.nodes.push(new A(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=O);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function pt(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&lt.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function mt(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function ht(e){let t={};for(let n in e)t[n]=e[n];return t}function gt(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var _t=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=j(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){if(e.isText)return j(t).createTextNode(e.text);let{dom:n,contentDOM:r}=M(j(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&M(j(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return typeof t==`string`?{dom:e.createTextNode(t)}:M(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=vt(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return vt(e.marks)}};function vt(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function j(e){return e.document||window.document}var yt=new WeakMap;function bt(e){let t=yt.get(e);return t===void 0&&yt.set(e,t=xt(e)),t}function xt(e){let t=null;function n(e){if(e&&typeof e==`object`){if(Array.isArray(e)){if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t])}else for(let t in e)n(e[t])}}return n(e),t}function M(e,t,n,r){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=bt(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}if(typeof a==`string`)c.appendChild(e.createTextNode(a));else{let{dom:t,contentDOM:i}=M(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var St=65535,Ct=2**16;function wt(e,t){return e+t*Ct}function Tt(e){return e&St}function Et(e){return(e-(e&St))/Ct}var Dt=1,Ot=2,kt=4,At=8,N=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&At)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&kt)>0}},P=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=Tt(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+Et(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:wt(o/3,e-s),f=0;return c&&(f|=e==s?Ot:e==u?Dt:kt,(t<0?e!=s:e!=u)&&(f|=At)),new N(a,f,d)}r+=l-c}return n?e+r:new N(e+r,0,null)}touches(e,t){let n=0,r=Tt(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};P.empty=new P([]);var jt=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new N(e,r,null)}},F=Object.create(null),I=class{getMap(){return P.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=F[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in F)throw RangeError(`Duplicate use of step JSON ID `+e);return F[e]=t,t.prototype.jsonID=e,t}},L=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof b)return e.fail(t.message);throw t}}};function R(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(R(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return g.fromArray(r)}var z=class e extends I{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new x(R(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return L.fromReplace(e,this.from,this.to,i)}invert(){return new B(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};I.jsonID(`addMark`,z);var B=class e extends I{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new x(R(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return L.fromReplace(e,this.from,this.to,n)}invert(){return new z(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};I.jsonID(`removeMark`,B);var Mt=class e extends I{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return L.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return L.fromReplace(e,this.pos,this.pos+1,new x(g.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new V(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};I.jsonID(`addNodeMark`,Mt);var V=class e extends I{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return L.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return L.fromReplace(e,this.pos,this.pos+1,new x(g.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Mt(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};I.jsonID(`removeNodeMark`,V);var H=class e extends I{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Nt(e,this.from,this.to)?L.fail(`Structure replace would overwrite content`):L.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new P([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?x.empty:new x(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?x.empty:new x(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,x.fromJSON(t,n.slice),!!n.structure)}};H.MAP_BIAS=1,I.jsonID(`replace`,H);var U=class e extends I{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(Nt(e,this.from,this.gapFrom)||Nt(e,this.gapTo,this.to)))return L.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return L.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?L.fromReplace(e,this.from,this.to,n):L.fail(`Content does not fit in gap`)}getMap(){return new P([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,x.fromJSON(t,n.slice),n.insert,!!n.structure)}};I.jsonID(`replaceAround`,U);function Nt(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function Pt(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new B(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new z(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function Ft(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof tt){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new B(t.from,t.to,t.style)))}function It(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new H(s,l,x.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new B(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new x(g.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new H(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(g.empty,!0);e.replace(s,s,new x(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function Lt(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Rt(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!Lt(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function zt(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=g.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=g.from(r.node(e).copy(u)),d++):c--;let f=g.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=g.from(i.node(e).copy(f)),p++):l++;e.step(new U(c,l,o,s,new x(u.append(f),d,p),u.size-d,!0))}function Bt(e,t,n=null,r=e){let i=Ht(e,t),a=i&&Ut(r,t);return a?i.map(Vt).concat({type:t,attrs:n}).concat(a.map(Vt)):null}function Vt(e){return{type:e,attrs:null}}function Ht(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function Ut(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function Wt(e,t,n){let r=g.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=g.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new U(i,a,i,a,new x(r,0,0),n.length,!0))}function Gt(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&Jt(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&qt(e,t,n,a),It(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new U(c,l,c+1,l-1,new x(g.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&Kt(e,t,n,a),!1}})}function Kt(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function qt(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
5
5
  `))}})}function Jt(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function Yt(e,t,n,r,i){let a=e.doc.nodeAt(t);if(!a)throw RangeError(`No node at given position`);n||=a.type;let o=n.create(r,null,i||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw RangeError(`Invalid content for node type `+n.name);e.step(new U(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new x(g.from(o),0,0),1,!0))}function Xt(e,t,n=1,r){let i=e.resolve(t),a=i.depth-n,o=r&&r[r.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>a;e--,t--){let n=i.node(e),a=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(a,n.childCount),s=r&&r[t+1];s&&(o=o.replaceChild(0,s.type.create(s.attrs)));let c=r&&r[t]||n;if(!n.canReplace(a+1,n.childCount)||!c.type.validContent(o))return!1}let s=i.indexAfter(a),c=r&&r[0];return i.node(a).canReplaceWith(s,s,c?c.type:i.node(a+1).type)}function Zt(e,t,n=1,r){let i=e.doc.resolve(t),a=g.empty,o=g.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=g.from(i.node(e).copy(a));let t=r&&r[s];o=g.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new H(t,t,new x(a.append(o),n,n),!0))}function Qt(e,t){let n=e.resolve(t),r=n.index();return en(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function $t(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let a=t.child(i),o=a.type==r?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function en(e,t){return!!(e&&t&&!e.isLeaf&&$t(e,t))}function tn(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,a,o=r.index(e);if(e==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(e+1),o++,a=r.node(e).maybeChild(o)):(i=r.node(e).maybeChild(o-1),a=r.node(e+1)),i&&!i.isTextblock&&en(i,a)&&r.node(e).canReplace(o,o+1))return t;if(e==0)break;t=n<0?r.before(e):r.after(e)}}function nn(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(i&&o.inlineContent){let e=o.whitespace==`pre`,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s=e.steps.length;if(r===!1){let r=e.doc.resolve(t+n);qt(e,r.node(),r.before(),s)}o.inlineContent&&It(e,t+n-1,o,a.node().contentMatchAt(a.index()),r==null);let c=e.mapping.slice(s),l=c.map(t-n);if(e.step(new H(l,c.map(t+n,-1),x.empty,!0)),r===!0){let t=e.doc.resolve(l);Kt(e,t.node(),t.before(),e.steps.length)}return e}function rn(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}function an(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(n.openStart==0&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+ +(n>0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e&&o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function on(e,t,n=t,r=x.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return sn(i,a,r)?new H(t,n,r):new cn(i,a,r).fit()}function sn(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var cn=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=g.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=g.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,a=n.depth,o=r.depth;for(;a&&o&&i.childCount==1;)i=i.firstChild.content,a--,o--;let s=new x(i,a,o);return e>-1?new U(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new H(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=ln(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let{type:a,match:o}=this.frontier[e],s,c=null;if(t==1&&(i?o.matchType(i.type)||(c=o.fillBefore(g.from(i),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:c};if(t==2&&i&&(s=o.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:s};if(r&&o.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced;return mn(e,-1)<=t?!1:(this.unplaced.size>1&&mn(e,1)>n&&n++,this.unplaced=new x(e,t+1,n),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=ln(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new x(W(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new x(W(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let a=this.unplaced,o=n?n.content:a.content,s=a.openStart-e,c=0,l=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));u=u.matchFragment(r)}let f=o.size+e-(a.content.size-a.openEnd);for(;c<o.childCount;){let e=o.child(c),t=u.matchType(e.type);if(!t)break;c++,(c>1||s==0||e.content.size)&&(u=t,l.push(un(e.mark(d.allowedMarks(e.marks)),c==1?s:0,c==o.childCount?f:-1)))}let p=c==o.childCount;p||(f=-1),this.placed=G(this.placed,t,g.from(l)),this.frontier[t].match=u,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?e==0?x.empty:new x(W(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new x(W(a.content,e,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!dn(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){scan:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=dn(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=dn(e,n,r,t,!0);if(!i||i.childCount)continue scan}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=G(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=G(this.placed,this.depth,g.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(g.empty,!0);e.childCount&&(this.placed=G(this.placed,this.frontier.length,e))}};function W(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(W(e.firstChild.content,t-1,n)))}function G(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(G(e.lastChild.content,t-1,n)))}function ln(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function un(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,un(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(g.empty,!0)))),e.copy(r)}function dn(e,t,n,r,i){let a=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let s=r.fillBefore(a.content,!0,o);return s&&!fn(n,a.content,o)?s:null}function fn(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function pn(e){return e.spec.defining||e.spec.definingForContent}function mn(e,t){for(let n=0;;n++){let r=t<0?e.firstChild:e.lastChild;if(!r||r.isAtom)return n;e=r.content}}function hn(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(sn(i,a,r))return e.step(new H(t,n,r));let o=yn(i,a);o[o.length-1]==0&&o.pop();let s=-(i.depth+1);o.unshift(s);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;o.indexOf(e)>-1?s=e:i.before(e)==t&&o.splice(1,0,-e)}let c=o.indexOf(s),l=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(l.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=l[e],n=pn(t.type);if(n&&!t.sameMarkup(i.node(Math.abs(s)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let s=(t+u+1)%(r.openStart+1),d=l[s];if(d)for(let t=0;t<o.length;t++){let l=o[(t+c)%o.length],u=!0;l<0&&(u=!1,l=-l);let f=i.node(l-1),p=i.index(l-1);if(f.canReplaceWith(p,p,d.type,d.marks))return e.replace(i.before(l),u?a.after(l):n,new x(gn(r.content,0,r.openStart,s),s,r.openEnd))}}let d=e.steps.length;for(let s=o.length-1;s>=0&&(e.replace(t,n,r),!(e.steps.length>d));s--){let e=o[s];e<0||(t=i.before(e),n=a.after(e))}}function gn(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(gn(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(g.empty,!0))}return e}function _n(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=rn(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new x(g.from(r),0,0))}function vn(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let a=r.sharedDepth(n),o=!1;for(let e=r.depth;e>a;e--)r.node(e).type.spec.isolating&&(o=!0);for(let e=i.depth;e>a;e--)i.node(e).type.spec.isolating&&(o=!0);if(!o){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=i.depth;e>0&&n==i.start(e);e--)n=i.before(e);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let a=yn(r,i);for(let t=0;t<a.length;t++){let n=a[t],o=t==a.length-1;if(o&&n==0||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function yn(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}var bn=class e extends I{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return L.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return L.fromReplace(e,this.pos,this.pos+1,new x(g.from(r),0,+!t.isLeaf))}getMap(){return P.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:`attr`,pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}};I.jsonID(`attr`,bn);var xn=class e extends I{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return L.ok(n)}getMap(){return P.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}};I.jsonID(`docAttr`,xn);var K=class extends Error{};K=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},K.prototype=Object.create(Error.prototype),K.prototype.constructor=K,K.prototype.name=`TransformError`;var Sn=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new jt}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new K(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,a)=>{e=Math.min(e,i),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=x.empty){let r=on(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new x(g.from(n),0,0))}delete(e,t){return this.replace(e,t,x.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return hn(this,e,t,n),this}replaceRangeWith(e,t,n){return _n(this,e,t,n),this}deleteRange(e,t){return vn(this,e,t),this}lift(e,t){return zt(this,e,t),this}join(e,t=1){return nn(this,e,t),this}wrap(e,t){return Wt(this,e,t),this}setBlockType(e,t=e,n,r=null){return Gt(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return Yt(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new bn(e,t,n)),this}setDocAttribute(e,t){return this.step(new xn(e,t)),this}addNodeMark(e,t){return this.step(new Mt(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof y)t.isInSet(n.marks)&&this.step(new V(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new V(e,i)),r=i.removeFromSet(r);for(let e=a.length-1;e>=0;e--)this.step(a[e])}return this}split(e,t=1,n){return Zt(this,e,t,n),this}addMark(e,t,n){return Pt(this,e,t,n),this}removeMark(e,t,n){return Ft(this,e,t,n),this}clearIncompatible(e,t,n){return It(this,e,t,n),this}},Cn=Object.create(null),q=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new wn(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=x.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?x.empty:t),o==0&&An(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),An(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new J(e):Z(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?Z(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):Z(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new X(e.node(0))}static atStart(e){return Z(e,e,0,0,1)||new X(e)}static atEnd(e){return Z(e,e,e.content.size,e.childCount,-1)||new X(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=Cn[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Cn)throw RangeError(`Duplicate use of selection JSON ID `+e);return Cn[e]=t,t.prototype.jsonID=e,t}getBookmark(){return J.between(this.$anchor,this.$head).getBookmark()}};q.prototype.visible=!0;var wn=class{constructor(e,t){this.$from=e,this.$to=t}},Tn=!1;function En(e){!Tn&&!e.parent.inlineContent&&(Tn=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var J=class e extends q{constructor(e,t=e){En(e),En(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return q.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=x.empty){if(super.replace(e,t),t==x.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Dn(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=q.findFrom(n,r,!0)||q.findFrom(n,-r,!0);if(e)n=e.$head;else return q.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(q.findFrom(t,-r,!0)||q.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};q.jsonID(`text`,J);var Dn=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return J.between(e.resolve(this.anchor),e.resolve(this.head))}},Y=class e extends q{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?q.near(a):new e(a)}content(){return new x(g.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new On(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};Y.prototype.visible=!1,q.jsonID(`node`,Y);var On=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Dn(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&Y.isSelectable(n)?new Y(t):q.near(t)}},X=class e extends q{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=x.empty){if(t==x.empty){e.delete(0,e.doc.content.size);let t=q.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:`all`}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return kn}};q.jsonID(`all`,X);var kn={map(){return this},resolve(e){return new X(e)}};function Z(e,t,n,r,i,a=!1){if(t.inlineContent)return J.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=Z(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&Y.isSelectable(r))return Y.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function An(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof H||i instanceof U))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(q.near(e.doc.resolve(o),n))}var jn=1,Mn=2,Nn=4,Pn=class extends Sn{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError(`Selection passed to setSelection must point at the current document`);return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|jn)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&jn)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Mn,this}ensureMarks(e){return y.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Mn)>0}addStep(e,t){super.addStep(e,t),this.updated&=-3,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||y.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(n??=t,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(q.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e==`string`?e:e.key]=t,this}getMeta(e){return this.meta[typeof e==`string`?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Nn,this}get scrolledIntoView(){return(this.updated&Nn)>0}};function Fn(e,t){return!t||!e?e:e.bind(t)}var Q=class{constructor(e,t,n){this.name=e,this.init=Fn(t.init,n),this.apply=Fn(t.apply,n)}},In=[new Q(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Q(`selection`,{init(e,t){return e.selection||q.atStart(t.doc)},apply(e){return e.selection}}),new Q(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Q(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],Ln=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=In.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError(`Adding different instances of a keyed plugin (`+e.key+`)`);this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new Q(e.key,e.spec.state,e))})}},Rn=class e{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let a=0;a<this.config.plugins.length;a++){let o=this.config.plugins[a];if(o.spec.appendTransaction){let s=r?r[a].n:0,c=r?r[a].state:this,l=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,c,n);if(l&&n.filterTransaction(l,a)){if(l.setMeta(`appendedTransaction`,e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<a?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),i=!0}r&&(r[a]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError(`Applying a mismatched transaction`);let n=new e(this.config),r=this.config.fields;for(let e=0;e<r.length;e++){let i=r[e];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new Pn(this)}static create(t){let n=new Ln(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n);for(let e=0;e<n.fields.length;e++)r[n.fields[e].name]=n.fields[e].init(t,r);return r}reconfigure(t){let n=new Ln(this.schema,t.plugins),r=n.fields,i=new e(n);for(let e=0;e<r.length;e++){let n=r[e].name;i[n]=this.hasOwnProperty(n)?this[n]:r[e].init(t,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&typeof e==`object`)for(let n in e){if(n==`doc`||n==`selection`)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(t,n,r){if(!n)throw RangeError(`Invalid input for EditorState.fromJSON`);if(!t.schema)throw RangeError(`Required config field 'schema' missing`);let i=new Ln(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=E.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=q.fromJSON(a.doc,n.selection);else if(e.name==`storedMarks`)n.storedMarks&&(a.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let i in r){let o=r[i],s=o.spec.state;if(o.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){a[e.name]=s.fromJSON.call(o,t,n[i],a);return}}a[e.name]=e.init(t,a)}}),a}};function zn(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=zn(i,t,{})),n[r]=i}return n}var Bn=class{constructor(e){this.spec=e,this.props={},e.props&&zn(e.props,this,this.props),this.key=e.key?e.key.key:Hn(`plugin`)}getState(e){return e[this.key]}},Vn=Object.create(null);function Hn(e){return e in Vn?e+`$`+ ++Vn[e]:(Vn[e]=0,e+`$`)}var Un=class{constructor(e=`key`){this.key=Hn(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},Wn=[{type:`paragraph`,icon:oe,labelKey:`entry.blocks.paragraph`,group:`write`,keywords:[`text`,`p`]},{type:`heading2`,icon:ee,labelKey:`entry.blocks.heading`,group:`write`,keywords:[`h2`,`title`]},{type:`heading3`,icon:ne,labelKey:`entry.blocks.subheading`,group:`write`,keywords:[`h3`]},{type:`blockquote`,icon:ce,labelKey:`entry.blocks.quote`,group:`write`,keywords:[`blockquote`,`cite`]},{type:`bulletList`,icon:c,labelKey:`entry.blocks.bulletList`,group:`write`,keywords:[`ul`,`list`,`bullet`]},{type:`orderedList`,icon:ie,labelKey:`entry.blocks.orderedList`,group:`write`,keywords:[`ol`,`list`,`number`]},{type:`codeBlock`,icon:f,labelKey:`entry.blocks.code`,group:`write`,keywords:[`pre`,`code`]},{type:`horizontalRule`,icon:a,labelKey:`entry.blocks.divider`,group:`write`,keywords:[`hr`,`rule`,`line`]},{type:`image`,icon:o,labelKey:`entry.blocks.image`,group:`media`,keywords:[`picture`,`photo`,`img`]},{type:`table`,icon:ue,labelKey:`entry.blocks.table`,group:`media`,keywords:[`grid`]}],Gn=(e,t)=>{let n=e.trim().toLowerCase();return n===``?[...Wn]:Wn.filter(e=>[t(e),...e.keywords].some(e=>e.toLowerCase().split(/\s+/).some(e=>e.startsWith(n))))},Kn={type:`table`,content:[{type:`tableRow`,content:[0,1,2].map(()=>({type:`tableHeader`,content:[{type:`paragraph`}]}))},...[0,1].map(()=>({type:`tableRow`,content:[0,1,2].map(()=>({type:`tableCell`,content:[{type:`paragraph`}]}))}))]},qn=e=>{switch(e){case`paragraph`:return[{type:`paragraph`}];case`heading2`:return[{type:`heading`,attrs:{level:2}}];case`heading3`:return[{type:`heading`,attrs:{level:3}}];case`blockquote`:return[{type:`blockquote`,content:[{type:`paragraph`}]}];case`bulletList`:case`orderedList`:return[{type:e,content:[{type:`listItem`,content:[{type:`paragraph`}]}]}];case`codeBlock`:return[{type:`codeBlock`}];case`horizontalRule`:return[{type:`horizontalRule`},{type:`paragraph`}];case`table`:return[Kn]}},Jn=e=>e.map(e=>({type:`image`,attrs:{mediaId:e.mediaId,alt:e.alt||null,title:null}})),Yn=async(e,t,n,r)=>{let i=t===`image`?Jn(await r()):qn(t);if(i.length===0||e.isDestroyed)return;let a=e.state.doc.content.size,o=e=>Math.min(Math.max(e,0),a),s=typeof n==`number`?{from:o(n),to:o(n)}:n;e.chain().insertContentAt(s,i,{updateSelection:!0}).focus().run(),t!==`image`&&e.commands.command(({tr:e})=>(e.setSelection(J.near(e.doc.resolve(Math.min(s.from+1,e.doc.content.size)),1)),!0))},Xn=(e,t)=>{let{doc:n}=e.state,r=t===`start`?n.firstChild:n.lastChild;return r?.type.name===`paragraph`&&r.content.size===0?t===`start`?{from:0,to:r.nodeSize}:{from:n.content.size-r.nodeSize,to:n.content.size}:t===`start`?0:n.content.size},Zn=async(e,t,n,r)=>{e.chain().focus().deleteRange(n).run();let i=()=>e.chain().focus();switch(t){case`paragraph`:i().setParagraph().run();return;case`heading2`:i().setHeading({level:2}).run();return;case`heading3`:i().setHeading({level:3}).run();return;case`blockquote`:i().toggleBlockquote().run();return;case`bulletList`:i().toggleBulletList().run();return;case`orderedList`:i().toggleOrderedList().run();return;case`codeBlock`:i().toggleCodeBlock().run();return;case`horizontalRule`:i().setHorizontalRule().run();return;case`image`:{let e=await r();e.length>0&&i().insertContent(Jn(e)).run();return}case`table`:i().insertTable({rows:3,cols:3,withHeaderRow:!0}).run();return}},$=e(n(),1),Qn={write:`entry.blocks.groupWrite`,media:`entry.blocks.groupMedia`},$n=({onSelect:e,canInsertImages:t=!0,heading:n})=>{let{t:r}=i();return[`write`,`media`].map(i=>(0,$.jsxs)(s,{children:[(0,$.jsx)(l,{className:`text-xs font-semibold tracking-wide text-muted-foreground uppercase`,children:n?r(`entry.blocks.groupIn`,{group:r(Qn[i]),field:n}):r(Qn[i])}),Wn.filter(e=>e.group===i).filter(e=>t||e.type!==`image`).map(t=>(0,$.jsx)(u,{icon:t.icon,label:r(t.labelKey),hint:t.type===`image`?r(`entry.blocks.imageHint`):void 0,onSelect:()=>e(t.type)},t.type))]},i))};export{je as A,ee as B,tn as C,_t as D,ot as E,pe as F,ue as I,ce as L,x as M,de as N,g as O,fe as P,ie as R,Bt as S,on as T,H as _,Zn as a,Xt as b,Y as c,q as d,wn as f,U as g,B as h,Yn as i,nt as j,y as k,Bn as l,jt as m,Xn as n,X as o,J as p,Gn as r,Rn as s,$n as t,Un as u,Sn as v,Rt as w,an as x,Qt as y,ne as z};
6
- //# sourceMappingURL=BlockMenuItems-BEnSpClj.js.map
6
+ //# sourceMappingURL=BlockMenuItems-DfNBHqVM.js.map