adminizer 4.1.0-commit.d8a06d3 → 4.2.0-build.44
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.
- package/Readme.md +46 -0
- package/assets/{VanillaJSONEditor-D-Lx670g.js → VanillaJSONEditor-DfRefswH.js} +104 -104
- package/assets/add-DujD3Z0j.js +1 -0
- package/assets/add-form-Ch5HOaI3.js +1 -0
- package/assets/add-group-form-CzjFRYQe.js +1 -0
- package/assets/add-group-xKUhiREd.js +1 -0
- package/assets/add-user-DpTQyN0Z.js +1 -0
- package/assets/add-user-form-DmgL9A2G.js +1 -0
- package/assets/{app-WTooYWC3.css → app-B6cCPfWk.css} +1 -1
- package/assets/app-layout-Dn8y3paC.js +1 -0
- package/assets/app-shell-C1wDrRCe.js +1 -0
- package/assets/app-sidebar-BisOEG_p.js +1 -0
- package/assets/app-sidebar-header-CL1OSuV8.js +11 -0
- package/assets/app.js +169 -39
- package/assets/breadcrumbs-BVZtAG3J.js +1 -0
- package/assets/catalog-Cc6Mk9sX.css +1 -0
- package/assets/catalog-CvJMAtEd.js +16 -0
- package/assets/{chevrons-up-down-kALltqHV.js → chevrons-up-down-D3t3UGV7.js} +2 -2
- package/assets/dashboard-Zsh-5yN2.js +3 -0
- package/assets/date-picker-DKdT6XTZ.js +6 -0
- package/assets/debounce-qdyXyOeG.js +1 -0
- package/assets/del-modal-DZ5wZWad.js +11 -0
- package/assets/{field-renderer-DVHZF6HS.js → field-renderer-Dgj1S2Vi.js} +137 -137
- package/assets/form-Bgv171J2.js +1 -0
- package/assets/form-DcfEHbPb.js +1 -0
- package/assets/{geo-json-BjiyTtMu.js → geo-json-vodY1YtH.js} +5 -5
- package/assets/{handsontable-4mjU_b0n.js → handsontable-C-ThjbaJ.js} +5 -5
- package/assets/home-DOm3EaLO.js +2 -0
- package/assets/icon-B-D8X0jg.js +1 -0
- package/assets/init-user-iMMcIQIW.js +1 -0
- package/assets/input-error-F1DL-Fx6.js +1 -0
- package/assets/list-B-vY1rhM.js +1 -0
- package/assets/list-table-8sDi0ZKa.js +52 -0
- package/assets/{check-LAUWAnlX.js → loader-circle-Btx4NYNU.js} +2 -2
- package/assets/login-C2J62v4_.js +6 -0
- package/assets/manifest.json +197 -965
- package/assets/material-icon-DeSoGIhT.js +1 -0
- package/assets/module-I4hW5UqT.js +1 -0
- package/assets/{monaco-editor-CJs0_GlD.js → monaco-editor-9fDiyfuW.js} +2 -2
- package/assets/{move-left-BhKZRPb4.js → move-left-DWHsVHUF.js} +1 -1
- package/assets/multi-select-Bu3n-kcV.js +11 -0
- package/assets/nav-footer-DQwIyd7c.js +1 -0
- package/assets/nav-main-DDQ-_Oed.js +1 -0
- package/assets/nav-user-BwBu-VwZ.js +1 -0
- package/assets/pagination-render-BoDDo2E1.js +1 -0
- package/assets/register-aPC0gjjS.js +1 -0
- package/assets/{toast-editor-CMK7QtF1.js → toast-editor-1Pul3oMs.js} +2 -2
- package/assets/{trash-2-BoK5Xp2F.js → trash-2-CsxWwHNc.js} +2 -2
- package/assets/use-appearance-J8J2w43p.js +1 -0
- package/assets/use-window-size-DLSEoR6e.js +1 -0
- package/assets/user-info-CnB2lvpg.js +1 -0
- package/assets/user-menu-content-BFbaJw6v.js +6 -0
- package/assets/welcome-DB_D6KJV.js +1 -0
- package/controllers/add.js +8 -8
- package/controllers/catalog/Catalog.d.ts +1 -1
- package/controllers/catalog/Catalog.js +40 -35
- package/controllers/catalog/FrontentCatalogAdapter.d.ts +36 -26
- package/controllers/catalog/FrontentCatalogAdapter.js +71 -72
- package/controllers/edit.js +8 -11
- package/controllers/list.js +2 -2
- package/controllers/login.js +16 -7
- package/controllers/navigation/edit.js +1 -1
- package/controllers/remove.js +1 -1
- package/controllers/view.js +1 -1
- package/helpers/JsUtils.d.ts +1 -0
- package/helpers/JsUtils.js +3 -0
- package/helpers/accessRightsHelper.d.ts +3 -0
- package/helpers/accessRightsHelper.js +27 -4
- package/helpers/controllerHelper.js +39 -18
- package/helpers/fieldsHelper.d.ts +3 -2
- package/helpers/fieldsHelper.js +5 -1
- package/helpers/inertiaAddHelper.d.ts +4 -5
- package/helpers/inertiaAddHelper.js +25 -7
- package/helpers/inertiaFromHelper.js +1 -1
- package/helpers/inertiaMenuHelper.d.ts +1 -1
- package/helpers/inertiaMenuHelper.js +1 -1
- package/helpers/menuHelper.d.ts +8 -3
- package/helpers/menuHelper.js +26 -17
- package/index.d.ts +2 -6
- package/index.js +5 -6
- package/interfaces/adminpanelConfig.d.ts +35 -30
- package/interfaces/global.d.ts +5 -2
- package/interfaces/types.d.ts +1 -1
- package/lib/Adminizer.d.ts +9 -3
- package/lib/Adminizer.js +32 -16
- package/lib/media-manager/Items.js +0 -3
- package/lib/requestProcessor.js +10 -3
- package/lib/v4/DataAccessor.d.ts +3 -1
- package/lib/v4/DataAccessor.js +43 -18
- package/lib/v4/I18n.js +2 -0
- package/lib/{catalog → v4/catalog}/AbstractCatalog.d.ts +89 -60
- package/lib/{catalog → v4/catalog}/AbstractCatalog.js +59 -54
- package/lib/v4/catalog/Navigation.d.ts +43 -0
- package/lib/v4/catalog/Navigation.js +457 -0
- package/lib/{controls → v4/controls}/AbstractControls.d.ts +1 -1
- package/lib/{controls → v4/controls}/codeEditor/MonacoEditor.d.ts +1 -1
- package/lib/{controls → v4/controls}/geojsoneditor/GeoEditor.d.ts +1 -1
- package/lib/{controls → v4/controls}/jsoneditor/JsonEditor.d.ts +1 -1
- package/lib/{controls → v4/controls}/markdown/ToastUiEditor.d.ts +1 -1
- package/lib/{controls → v4/controls}/table/Handsontable.d.ts +1 -1
- package/lib/{controls → v4/controls}/wysiwyg/CKeditor.d.ts +1 -1
- package/lib/{datatable → v4/datatable}/NodeTable.d.ts +3 -3
- package/lib/{datatable → v4/datatable}/NodeTable.js +8 -5
- package/lib/v4/model/AbstractModel.d.ts +5 -1
- package/lib/v4/model/AbstractModel.js +2 -1
- package/lib/v4/model/ModelHandler.js +1 -3
- package/lib/v4/model/adapter/sequelize.d.ts +8 -0
- package/lib/v4/model/adapter/sequelize.js +274 -133
- package/lib/v4/model/adapter/waterline.js +5 -2
- package/lib/{widgets → v4/widgets}/abstractLink.d.ts +1 -1
- package/lib/{widgets → v4/widgets}/abstractWidgetBase.d.ts +1 -1
- package/lib/{widgets → v4/widgets}/widgetHandler.d.ts +11 -4
- package/lib/{widgets → v4/widgets}/widgetHandler.js +1 -1
- package/models/NavigationAP.d.ts +2 -3
- package/models/NavigationAP.js +5 -6
- package/models/UserAP.d.ts +2 -3
- package/package.json +24 -7
- package/system/Router.js +8 -11
- package/system/bindAccessRights.js +0 -4
- package/system/bindControls.js +6 -6
- package/system/bindDev.js +1 -0
- package/system/bindInertia.js +9 -4
- package/system/bindMediaManager.js +0 -1
- package/system/bindModels.js +9 -6
- package/system/bindNavigation.d.ts +2 -0
- package/system/bindNavigation.js +42 -42
- package/system/bindReqFunctions.js +0 -1
- package/system/defaults.js +13 -6
- package/translations/ar.json +70 -1
- package/translations/cn.json +70 -1
- package/translations/de.json +71 -3
- package/translations/en.json +70 -102
- package/translations/es.json +70 -1
- package/translations/fr.json +70 -1
- package/translations/hi.json +70 -1
- package/translations/jp.json +70 -1
- package/translations/ko.json +70 -1
- package/translations/pt.json +70 -1
- package/translations/ru.json +71 -103
- package/translations/ua.json +70 -1
- package/translations/uz.json +72 -0
- package/translations/vi.json +70 -1
- package/ui/components/ui/avatar.d.ts +6 -0
- package/ui/components/ui/avatar.js +13 -0
- package/ui/components/ui/badge.d.ts +9 -0
- package/ui/components/ui/badge.js +22 -0
- package/ui/components/ui/breadcrumb.d.ts +11 -0
- package/ui/components/ui/breadcrumb.js +27 -0
- package/ui/components/ui/button.d.ts +10 -0
- package/ui/components/ui/button.js +33 -0
- package/ui/components/ui/calendar.d.ts +4 -0
- package/ui/components/ui/calendar.js +38 -0
- package/ui/components/ui/card.d.ts +9 -0
- package/ui/components/ui/card.js +24 -0
- package/ui/components/ui/checkbox.d.ts +4 -0
- package/ui/components/ui/checkbox.js +8 -0
- package/ui/components/ui/collapsible.d.ts +5 -0
- package/ui/components/ui/collapsible.js +12 -0
- package/ui/components/ui/command.d.ts +16 -0
- package/ui/components/ui/command.js +33 -0
- package/ui/components/ui/context-menu.d.ts +25 -0
- package/ui/components/ui/context-menu.js +50 -0
- package/ui/components/ui/dialog-stack.d.ts +43 -0
- package/ui/components/ui/dialog-stack.js +238 -0
- package/ui/components/ui/dialog.d.ts +13 -0
- package/ui/components/ui/dialog.js +35 -0
- package/ui/components/ui/dropdown-menu.d.ts +25 -0
- package/ui/components/ui/dropdown-menu.js +50 -0
- package/ui/components/ui/input.d.ts +3 -0
- package/ui/components/ui/input.js +6 -0
- package/ui/components/ui/label.d.ts +4 -0
- package/ui/components/ui/label.js +7 -0
- package/ui/components/ui/menubar.d.ts +26 -0
- package/ui/components/ui/menubar.js +53 -0
- package/ui/components/ui/pagination.d.ts +13 -0
- package/ui/components/ui/pagination.js +29 -0
- package/ui/components/ui/popover.d.ts +7 -0
- package/ui/components/ui/popover.js +16 -0
- package/ui/components/ui/select.d.ts +15 -0
- package/ui/components/ui/select.js +37 -0
- package/ui/components/ui/separator.d.ts +4 -0
- package/ui/components/ui/separator.js +8 -0
- package/ui/components/ui/sheet.d.ts +13 -0
- package/ui/components/ui/sheet.js +39 -0
- package/ui/components/ui/sidebar.d.ts +69 -0
- package/ui/components/ui/sidebar.js +211 -0
- package/ui/components/ui/skeleton.d.ts +2 -0
- package/ui/components/ui/skeleton.js +6 -0
- package/ui/components/ui/slider.d.ts +4 -0
- package/ui/components/ui/slider.js +13 -0
- package/ui/components/ui/sonner.d.ts +3 -0
- package/ui/components/ui/sonner.js +12 -0
- package/ui/components/ui/switch.d.ts +4 -0
- package/ui/components/ui/switch.js +7 -0
- package/ui/components/ui/table.d.ts +10 -0
- package/ui/components/ui/table.js +27 -0
- package/ui/components/ui/textarea.d.ts +3 -0
- package/ui/components/ui/textarea.js +6 -0
- package/ui/components/ui/tooltip.d.ts +7 -0
- package/ui/components/ui/tooltip.js +17 -0
- package/ui/hooks/use-mobile.d.ts +1 -0
- package/ui/hooks/use-mobile.js +15 -0
- package/ui/lib/utils.d.ts +2 -0
- package/ui/lib/utils.js +5 -0
- package/assets/add-BP_u3Tjl.js +0 -1
- package/assets/add-form-nffmiYTh.js +0 -1
- package/assets/add-group-D4vcHlm-.js +0 -1
- package/assets/add-group-form-gNJW11-q.js +0 -1
- package/assets/add-user-DWh3Nas0.js +0 -1
- package/assets/add-user-form-BJ0FsZYJ.js +0 -1
- package/assets/app-layout-DYsRFUuP.js +0 -1
- package/assets/app-shell-Dd9Eknik.js +0 -1
- package/assets/app-sidebar-BOmu6-Sl.js +0 -1
- package/assets/app-sidebar-header-CoXSzWxk.js +0 -11
- package/assets/breadcrumbs-BmAq4fHT.js +0 -1
- package/assets/button-C9B_5Jf_.js +0 -1
- package/assets/checkbox-Fg27sL_1.js +0 -1
- package/assets/chevron-down-B5XuAFRu.js +0 -6
- package/assets/chevron-left-CoMhTMUD.js +0 -6
- package/assets/chevron-right-D5q8rF7h.js +0 -6
- package/assets/compiler-runtime-hB6dAw2d.js +0 -9
- package/assets/createLucideIcon-BFG25zNo.js +0 -21
- package/assets/dashboard-BACj996r.js +0 -3
- package/assets/date-picker-DI1cCO7K.js +0 -6
- package/assets/dropdown-menu-Bhj17ENm.js +0 -1
- package/assets/form-BgWdwvz1.js +0 -1
- package/assets/form-DgtErfln.js +0 -1
- package/assets/home-CHntBHJa.js +0 -2
- package/assets/icon-Dt0vBgDO.js +0 -1
- package/assets/index-B8BS9wMC.js +0 -1
- package/assets/index-BC0yfOHo.js +0 -1
- package/assets/index-BKCgnGj_.js +0 -1
- package/assets/index-BbXEMx9n.js +0 -1
- package/assets/index-BykbU6Ee.js +0 -41
- package/assets/index-CaJgc5EZ.js +0 -1
- package/assets/index-Cgp8OfuI.js +0 -1
- package/assets/index-Cw5o84pO.js +0 -10
- package/assets/index-D5ir9iUV.js +0 -1
- package/assets/index-DrWfGwtf.js +0 -1
- package/assets/index-DwctwfU0.js +0 -1
- package/assets/init-user-JfCKJ5Ce.js +0 -1
- package/assets/input-CvRbIbk4.js +0 -1
- package/assets/input-error-DMK7cAt7.js +0 -1
- package/assets/label-CSLFe9Bz.js +0 -1
- package/assets/list-B2Oa5O_Q.js +0 -1
- package/assets/list-table-DA9MhywL.js +0 -62
- package/assets/loader-circle-Utah5tGx.js +0 -6
- package/assets/login-DQwGtdis.js +0 -6
- package/assets/material-icon-BJg8o_fs.js +0 -1
- package/assets/module-DWXp59Vg.js +0 -1
- package/assets/multi-select-BvRpAW8r.js +0 -11
- package/assets/nav-footer-Bs4dmN1d.js +0 -1
- package/assets/nav-main-Bq3IMk4C.js +0 -1
- package/assets/nav-user-CbB22J5O.js +0 -1
- package/assets/pagination-render-DuXDDbC_.js +0 -1
- package/assets/popover-DtoGI2b1.js +0 -1
- package/assets/register-BSogVF0h.js +0 -1
- package/assets/search-BspystAk.js +0 -6
- package/assets/select-BWepUw-9.js +0 -6
- package/assets/sidebar-CAHsHdjM.js +0 -6
- package/assets/skeleton-COOcAA8f.js +0 -1
- package/assets/sonner-BI0IFOQN.js +0 -1
- package/assets/tooltip-DHwpLKOI.js +0 -1
- package/assets/use-appearance-DRfIqTgw.js +0 -1
- package/assets/use-window-size-h0Sh_NvX.js +0 -1
- package/assets/user-info-DFrmpJ4y.js +0 -9
- package/assets/user-menu-content-DPXQdERj.js +0 -6
- package/assets/utils-DjqsqOe8.js +0 -1
- package/assets/welcome-B4WCIXKf.js +0 -1
- package/controllers/processInstallFinalize.d.ts +0 -1
- package/controllers/processInstallFinalize.js +0 -16
- package/controllers/processInstallStep.d.ts +0 -0
- package/controllers/processInstallStep.js +0 -122
- package/lib/catalog/Navigation.d.ts +0 -0
- package/lib/catalog/Navigation.js +0 -532
- package/lib/installStepper/InstallStepAbstract.d.ts +0 -52
- package/lib/installStepper/InstallStepAbstract.js +0 -69
- package/lib/installStepper/finalizeStep.d.ts +0 -21
- package/lib/installStepper/finalizeStep.js +0 -48
- package/lib/installStepper/installStepper.d.ts +0 -40
- package/lib/installStepper/installStepper.js +0 -195
- package/models/MediaManagerAP.d.ts +0 -62
- package/models/MediaManagerAP.js +0 -45
- package/models/MediaManagerAssociationsAP.d.ts +0 -38
- package/models/MediaManagerAssociationsAP.js +0 -27
- package/models/MediaManagerMetaAP.d.ts +0 -30
- package/models/MediaManagerMetaAP.js +0 -21
- package/system/bindInstallStepper.d.ts +0 -2
- package/system/bindInstallStepper.js +0 -23
- /package/lib/{catalog → v4/catalog}/CatalogHandler.d.ts +0 -0
- /package/lib/{catalog → v4/catalog}/CatalogHandler.js +0 -0
- /package/lib/{controls → v4/controls}/AbstractControls.js +0 -0
- /package/lib/{controls → v4/controls}/ControlsHandler.d.ts +0 -0
- /package/lib/{controls → v4/controls}/ControlsHandler.js +0 -0
- /package/lib/{controls → v4/controls}/codeEditor/MonacoEditor.js +0 -0
- /package/lib/{controls → v4/controls}/geojsoneditor/GeoEditor.js +0 -0
- /package/lib/{controls → v4/controls}/jsoneditor/JsonEditor.js +0 -0
- /package/lib/{controls → v4/controls}/markdown/ToastUiEditor.js +0 -0
- /package/lib/{controls → v4/controls}/table/Handsontable.js +0 -0
- /package/lib/{controls → v4/controls}/wysiwyg/CKeditor.js +0 -0
- /package/lib/{inertia → v4/inertia}/flash.d.ts +0 -0
- /package/lib/{inertia → v4/inertia}/flash.js +0 -0
- /package/lib/{inertia → v4/inertia}/inertiaAdapter.d.ts +0 -0
- /package/lib/{inertia → v4/inertia}/inertiaAdapter.js +0 -0
- /package/lib/{widgets → v4/widgets}/abstractAction.d.ts +0 -0
- /package/lib/{widgets → v4/widgets}/abstractAction.js +0 -0
- /package/lib/{widgets → v4/widgets}/abstractCustom.d.ts +0 -0
- /package/lib/{widgets → v4/widgets}/abstractCustom.js +0 -0
- /package/lib/{widgets → v4/widgets}/abstractInfo.d.ts +0 -0
- /package/lib/{widgets → v4/widgets}/abstractInfo.js +0 -0
- /package/lib/{widgets → v4/widgets}/abstractLink.js +0 -0
- /package/lib/{widgets → v4/widgets}/abstractSwitch.d.ts +0 -0
- /package/lib/{widgets → v4/widgets}/abstractSwitch.js +0 -0
- /package/lib/{widgets → v4/widgets}/abstractWidgetBase.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as i,aw as l,j as o}from"./app.js";function m(c){const e=i.c(5),{name:a,className:n}=c;let s;e[0]!==n?(s=l("material-icons-outlined",n),e[0]=n,e[1]=s):s=e[1];let t;return e[2]!==a||e[3]!==s?(t=o.jsx("span",{className:s,children:a}),e[2]=a,e[3]=s,e[4]=t):t=e[4],t}export{m as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{q as a,r,j as t}from"./app.js";import{A as p}from"./app-layout-Dn8y3paC.js";import{L as c}from"./loader-circle-Btx4NYNU.js";import"./app-shell-C1wDrRCe.js";import"./app-sidebar-BisOEG_p.js";import"./nav-main-DDQ-_Oed.js";import"./material-icon-DeSoGIhT.js";import"./chevrons-up-down-D3t3UGV7.js";import"./app-sidebar-header-CL1OSuV8.js";import"./breadcrumbs-BVZtAG3J.js";import"./nav-user-BwBu-VwZ.js";import"./user-info-CnB2lvpg.js";import"./user-menu-content-BFbaJw6v.js";import"./icon-B-D8X0jg.js";import"./use-appearance-J8J2w43p.js";const d=[];function q(){const s=a(),[n,m]=r.useState(null);return r.useEffect(()=>{const l=async()=>{const e=(await import(s.props.moduleComponent)).default;m(t.jsx(e,{message:s.props.message}))};(()=>{const o=s.props.moduleComponentCSS;if(!o||[...document.head.querySelectorAll("link[rel='stylesheet']")].some(i=>i.href.includes(o)))return;const e=document.createElement("link");e.rel="stylesheet",e.href=o,e.type="text/css",e.onload=()=>console.log(`CSS loaded: ${o}`),e.onerror=()=>console.error(`Failed to load CSS: ${o}`),document.head.appendChild(e)})(),l()},[]),t.jsx(p,{breadcrumbs:d,children:t.jsxs("div",{className:"m-5",children:[t.jsx("div",{className:"mb-5",children:t.jsx("h1",{children:s.props.title})}),n||t.jsx(c,{className:"size-10 animate-spin text-neutral-500 mx-auto mt-[15%]"})]})})}export{q as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as u,W as H,j as ne}from"./app.js";import{
|
|
1
|
+
import{r as u,W as H,c as we,j as ne}from"./app.js";import{u as ye}from"./use-appearance-J8J2w43p.js";import{u as Oe}from"./use-window-size-DLSEoR6e.js";function je(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function oe(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function ie(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?oe(Object(r),!0).forEach(function(n){je(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):oe(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Me(t,e){if(t==null)return{};var r={},n=Object.keys(t),o,i;for(i=0;i<n.length;i++)o=n[i],!(e.indexOf(o)>=0)&&(r[o]=t[o]);return r}function Ee(t,e){if(t==null)return{};var r=Me(t,e),n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(o=0;o<i.length;o++)n=i[o],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Se(t,e){return Pe(t)||Re(t,e)||Ce(t,e)||Ie()}function Pe(t){if(Array.isArray(t))return t}function Re(t,e){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(t)))){var r=[],n=!0,o=!1,i=void 0;try{for(var l=t[Symbol.iterator](),d;!(n=(d=l.next()).done)&&(r.push(d.value),!(e&&r.length===e));n=!0);}catch(b){o=!0,i=b}finally{try{!n&&l.return!=null&&l.return()}finally{if(o)throw i}}return r}}function Ce(t,e){if(t){if(typeof t=="string")return ae(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ae(t,e)}}function ae(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ie(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Le(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ue(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function ce(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ue(Object(r),!0).forEach(function(n){Le(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ue(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Te(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(n){return e.reduceRight(function(o,i){return i(o)},n)}}function G(t){return function e(){for(var r=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=t.length?t.apply(this,o):function(){for(var l=arguments.length,d=new Array(l),b=0;b<l;b++)d[b]=arguments[b];return e.apply(r,[].concat(o,d))}}}function Z(t){return{}.toString.call(t).includes("Object")}function Ae(t){return!Object.keys(t).length}function Y(t){return typeof t=="function"}function $e(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function xe(t,e){return Z(e)||z("changeType"),Object.keys(e).some(function(r){return!$e(t,r)})&&z("changeField"),e}function De(t){Y(t)||z("selectorType")}function Ve(t){Y(t)||Z(t)||z("handlerType"),Z(t)&&Object.values(t).some(function(e){return!Y(e)})&&z("handlersType")}function We(t){t||z("initialIsRequired"),Z(t)||z("initialType"),Ae(t)&&z("initialContent")}function Ne(t,e){throw new Error(t[e]||t.default)}var ze={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},z=G(Ne)(ze),Q={changes:xe,selector:De,handler:Ve,initial:We};function qe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Q.initial(t),Q.handler(e);var r={current:t},n=G(He)(r,e),o=G(Fe)(r),i=G(Q.changes)(t),l=G(Ue)(r);function d(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(T){return T};return Q.selector(w),w(r.current)}function b(w){Te(n,o,i,l)(w)}return[d,b]}function Ue(t,e){return Y(e)?e(t.current):e}function Fe(t,e){return t.current=ce(ce({},t.current),e),e}function He(t,e,r){return Y(e)?e(t.current):Object.keys(r).forEach(function(n){var o;return(o=e[n])===null||o===void 0?void 0:o.call(e,t.current[n])}),r}var Be={create:qe},ke={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs"}};function Ge(t){return function e(){for(var r=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=t.length?t.apply(this,o):function(){for(var l=arguments.length,d=new Array(l),b=0;b<l;b++)d[b]=arguments[b];return e.apply(r,[].concat(o,d))}}}function Ke(t){return{}.toString.call(t).includes("Object")}function Ye(t){return t||le("configIsRequired"),Ke(t)||le("configType"),t.urls?(Je(),{paths:{vs:t.urls.monacoBase}}):t}function Je(){console.warn(se.deprecation)}function Qe(t,e){throw new Error(t[e]||t.default)}var se={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
3
3
|
You are using deprecated way of configuration.
|
|
4
4
|
|
|
@@ -8,4 +8,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
8
8
|
monaco.config({ paths: { vs: '...' } })
|
|
9
9
|
|
|
10
10
|
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
11
|
-
`},le=Ge(Qe)(se),Xe={config:Ye},Ze=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return function(o){return r.reduceRight(function(i,l){return l(i)},o)}};function fe(t,e){return Object.keys(e).forEach(function(r){e[r]instanceof Object&&t[r]&&Object.assign(e[r],fe(t[r],e[r]))}),ie(ie({},t),e)}var _e={type:"cancelation",msg:"operation is manually canceled"};function ee(t){var e=!1,r=new Promise(function(n,o){t.then(function(i){return e?o(_e):n(i)}),t.catch(o)});return r.cancel=function(){return e=!0},r}var et=Be.create({config:ke,isInitialized:!1,resolve:null,reject:null,monaco:null}),de=Se(et,2),J=de[0],_=de[1];function tt(t){var e=Xe.config(t),r=e.monaco,n=Ee(e,["monaco"]);_(function(o){return{config:fe(o.config,n),monaco:r}})}function rt(){var t=J(function(e){var r=e.monaco,n=e.isInitialized,o=e.resolve;return{monaco:r,isInitialized:n,resolve:o}});if(!t.isInitialized){if(_({isInitialized:!0}),t.monaco)return t.resolve(t.monaco),ee(te);if(window.monaco&&window.monaco.editor)return pe(window.monaco),t.resolve(window.monaco),ee(te);Ze(nt,it)(at)}return ee(te)}function nt(t){return document.body.appendChild(t)}function ot(t){var e=document.createElement("script");return t&&(e.src=t),e}function it(t){var e=J(function(n){var o=n.config,i=n.reject;return{config:o,reject:i}}),r=ot("".concat(e.config.paths.vs,"/loader.js"));return r.onload=function(){return t()},r.onerror=e.reject,r}function at(){var t=J(function(r){var n=r.config,o=r.resolve,i=r.reject;return{config:n,resolve:o,reject:i}}),e=window.require;e.config(t.config),e(["vs/editor/editor.main"],function(r){pe(r),t.resolve(r)},function(r){t.reject(r)})}function pe(t){J().monaco||_({monaco:t})}function ut(){return J(function(t){var e=t.monaco;return e})}var te=new Promise(function(t,e){return _({resolve:t,reject:e})}),ge={config:tt,init:rt,__getMonacoInstance:ut},ct={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},re=ct,lt={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},st=lt;function ft({children:t}){return H.createElement("div",{style:st.container},t)}var dt=ft,pt=dt;function gt({width:t,height:e,isEditorReady:r,loading:n,_ref:o,className:i,wrapperProps:l}){return H.createElement("section",{style:{...re.wrapper,width:t,height:e},...l},!r&&H.createElement(pt,null,n),H.createElement("div",{ref:o,style:{...re.fullWidth,...!r&&re.hide},className:i}))}var ht=gt,he=u.memo(ht);function mt(t){u.useEffect(t,[])}var me=mt;function vt(t,e,r=!0){let n=u.useRef(!0);u.useEffect(n.current||!r?()=>{n.current=!1}:t,e)}var S=vt;function K(){}function F(t,e,r,n){return bt(t,n)||wt(t,e,r,n)}function bt(t,e){return t.editor.getModel(ve(t,e))}function wt(t,e,r,n){return t.editor.createModel(e,r,n?ve(t,n):void 0)}function ve(t,e){return t.Uri.parse(e)}function yt({original:t,modified:e,language:r,originalLanguage:n,modifiedLanguage:o,originalModelPath:i,modifiedModelPath:l,keepCurrentOriginalModel:d=!1,keepCurrentModifiedModel:b=!1,theme:w="light",loading:T="Loading...",options:j={},height:m="100%",width:V="100%",className:W,wrapperProps:q={},beforeMount:A=K,onMount:C=K}){let[y,$]=u.useState(!1),[P,h]=u.useState(!0),v=u.useRef(null),p=u.useRef(null),R=u.useRef(null),O=u.useRef(C),c=u.useRef(A),M=u.useRef(!1);me(()=>{let a=ge.init();return a.then(f=>(p.current=f)&&h(!1)).catch(f=>(f==null?void 0:f.type)!=="cancelation"&&console.error("Monaco initialization: error:",f)),()=>v.current?x():a.cancel()}),S(()=>{if(v.current&&p.current){let a=v.current.getOriginalEditor(),f=F(p.current,t||"",n||r||"text",i||"");f!==a.getModel()&&a.setModel(f)}},[i],y),S(()=>{if(v.current&&p.current){let a=v.current.getModifiedEditor(),f=F(p.current,e||"",o||r||"text",l||"");f!==a.getModel()&&a.setModel(f)}},[l],y),S(()=>{let a=v.current.getModifiedEditor();a.getOption(p.current.editor.EditorOption.readOnly)?a.setValue(e||""):e!==a.getValue()&&(a.executeEdits("",[{range:a.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),a.pushUndoStop())},[e],y),S(()=>{var a,f;(f=(a=v.current)==null?void 0:a.getModel())==null||f.original.setValue(t||"")},[t],y),S(()=>{let{original:a,modified:f}=v.current.getModel();p.current.editor.setModelLanguage(a,n||r||"text"),p.current.editor.setModelLanguage(f,o||r||"text")},[r,n,o],y),S(()=>{var a;(a=p.current)==null||a.editor.setTheme(w)},[w],y),S(()=>{var a;(a=v.current)==null||a.updateOptions(j)},[j],y);let N=u.useCallback(()=>{var L;if(!p.current)return;c.current(p.current);let a=F(p.current,t||"",n||r||"text",i||""),f=F(p.current,e||"",o||r||"text",l||"");(L=v.current)==null||L.setModel({original:a,modified:f})},[r,e,o,t,n,i,l]),I=u.useCallback(()=>{var a;!M.current&&R.current&&(v.current=p.current.editor.createDiffEditor(R.current,{automaticLayout:!0,...j}),N(),(a=p.current)==null||a.editor.setTheme(w),$(!0),M.current=!0)},[j,w,N]);u.useEffect(()=>{y&&O.current(v.current,p.current)},[y]),u.useEffect(()=>{!P&&!y&&I()},[P,y,I]);function x(){var f,L,D,B;let a=(f=v.current)==null?void 0:f.getModel();d||((L=a==null?void 0:a.original)==null||L.dispose()),b||((D=a==null?void 0:a.modified)==null||D.dispose()),(B=v.current)==null||B.dispose()}return H.createElement(he,{width:V,height:m,isEditorReady:y,loading:T,_ref:R,className:W,wrapperProps:q})}var Ot=yt;u.memo(Ot);function jt(t){let e=u.useRef();return u.useEffect(()=>{e.current=t},[t]),e.current}var Mt=jt,X=new Map;function Et({defaultValue:t,defaultLanguage:e,defaultPath:r,value:n,language:o,path:i,theme:l="light",line:d,loading:b="Loading...",options:w={},overrideServices:T={},saveViewState:j=!0,keepCurrentModel:m=!1,width:V="100%",height:W="100%",className:q,wrapperProps:A={},beforeMount:C=K,onMount:y=K,onChange:$,onValidate:P=K}){let[h,v]=u.useState(!1),[p,R]=u.useState(!0),O=u.useRef(null),c=u.useRef(null),M=u.useRef(null),N=u.useRef(y),I=u.useRef(C),x=u.useRef(),a=u.useRef(n),f=Mt(i),L=u.useRef(!1),D=u.useRef(!1);me(()=>{let s=ge.init();return s.then(g=>(O.current=g)&&R(!1)).catch(g=>(g==null?void 0:g.type)!=="cancelation"&&console.error("Monaco initialization: error:",g)),()=>c.current?be():s.cancel()}),S(()=>{var g,E,k,U;let s=F(O.current,t||n||"",e||o||"",i||r||"");s!==((g=c.current)==null?void 0:g.getModel())&&(j&&X.set(f,(E=c.current)==null?void 0:E.saveViewState()),(k=c.current)==null||k.setModel(s),j&&((U=c.current)==null||U.restoreViewState(X.get(i))))},[i],h),S(()=>{var s;(s=c.current)==null||s.updateOptions(w)},[w],h),S(()=>{!c.current||n===void 0||(c.current.getOption(O.current.editor.EditorOption.readOnly)?c.current.setValue(n):n!==c.current.getValue()&&(D.current=!0,c.current.executeEdits("",[{range:c.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),c.current.pushUndoStop(),D.current=!1))},[n],h),S(()=>{var g,E;let s=(g=c.current)==null?void 0:g.getModel();s&&o&&((E=O.current)==null||E.editor.setModelLanguage(s,o))},[o],h),S(()=>{var s;d!==void 0&&((s=c.current)==null||s.revealLine(d))},[d],h),S(()=>{var s;(s=O.current)==null||s.editor.setTheme(l)},[l],h);let B=u.useCallback(()=>{var s;if(!(!M.current||!O.current)&&!L.current){I.current(O.current);let g=i||r,E=F(O.current,n||t||"",e||o||"",g||"");c.current=(s=O.current)==null?void 0:s.editor.create(M.current,{model:E,automaticLayout:!0,...w},T),j&&c.current.restoreViewState(X.get(g)),O.current.editor.setTheme(l),d!==void 0&&c.current.revealLine(d),v(!0),L.current=!0}},[t,e,r,n,o,i,w,T,j,l,d]);u.useEffect(()=>{h&&N.current(c.current,O.current)},[h]),u.useEffect(()=>{!p&&!h&&B()},[p,h,B]),a.current=n,u.useEffect(()=>{var s,g;h&&$&&((s=x.current)==null||s.dispose(),x.current=(g=c.current)==null?void 0:g.onDidChangeModelContent(E=>{D.current||$(c.current.getValue(),E)}))},[h,$]),u.useEffect(()=>{if(h){let s=O.current.editor.onDidChangeMarkers(g=>{var k;let E=(k=c.current.getModel())==null?void 0:k.uri;if(E&&g.find(U=>U.path===E.path)){let U=O.current.editor.getModelMarkers({resource:E});P==null||P(U)}});return()=>{s==null||s.dispose()}}return()=>{}},[h,P]);function be(){var s,g;(s=x.current)==null||s.dispose(),m?j&&X.set(i,c.current.saveViewState()):(g=c.current.getModel())==null||g.dispose(),c.current.dispose()}return H.createElement(he,{width:V,height:W,isEditorReady:h,loading:b,_ref:M,className:q,wrapperProps:A})}var St=Et,Pt=u.memo(St),Rt=Pt;const At=t=>{const e=we.c(32),{onChange:r,value:n,options:o,disabled:i}=t,{appearance:l}=ye(),[d,b]=u.useState("light"),w=u.useRef(null),T=u.useRef(null),{width:j}=Oe(),m=j<768,V=j>=768&&j<1024;let W;e[0]!==r?(W=a=>{r(a)},e[0]=r,e[1]=W):W=e[1];const q=W;let A,C;e[2]!==m||e[3]!==V?(A=a=>{w.current=a,C()},C=()=>{var f;if(!w.current)return;const a={minimap:{enabled:!m},fontSize:m?12:V?13:14,lineNumbers:m?"off":"on",lineDecorationsWidth:m?5:10,scrollBeyondLastLine:!m,wordWrap:m?"on":"bounded",renderWhitespace:m?"none":"selection",padding:{top:m?8:16,bottom:m?8:16}};w.current.updateOptions(a),(f=T.current)==null||f.classList.add("overflow-hidden"),setTimeout(()=>{var L,D;(L=w.current)==null||L.layout(),(D=T.current)==null||D.classList.remove("overflow-hidden")},100)},e[2]=m,e[3]=V,e[4]=A,e[5]=C):(A=e[4],C=e[5]);let y,$;e[6]!==l?(y=()=>{b(l==="dark"?"vs-dark":"light")},$=[l],e[6]=l,e[7]=y,e[8]=$):(y=e[7],$=e[8]),u.useEffect(y,$);let P;e[9]!==C?(P=()=>{C()},e[9]=C,e[10]=P):P=e[10];let h;e[11]!==j?(h=[j],e[11]=j,e[12]=h):h=e[12],u.useEffect(P,h);const v=m?"300px":V?"400px":"500px",p=`border rounded-lg ${m?"p-1":"p-2"}`;let R;e[13]!==m?(R=m&&{wordWrap:"on"},e[13]=m,e[14]=R):R=e[14];const O=!m;let c;e[15]!==O?(c={enabled:O},e[15]=O,e[16]=c):c=e[16];let M;e[17]!==R||e[18]!==c?(M={automaticLayout:!0,...R,minimap:c},e[17]=R,e[18]=c,e[19]=M):M=e[19];const N=`transition-all duration-200 ease-in-out ${i?"pointer-events-none opacity-50 cursor-not-allowed":""}`;let I;e[20]!==v||e[21]!==q||e[22]!==A||e[23]!==o.language||e[24]!==M||e[25]!==N||e[26]!==d||e[27]!==n?(I=ne.jsx(Rt,{height:v,language:o.language,value:n,theme:d,options:M,onChange:q,onMount:A,className:N}),e[20]=v,e[21]=q,e[22]=A,e[23]=o.language,e[24]=M,e[25]=N,e[26]=d,e[27]=n,e[28]=I):I=e[28];let x;return e[29]!==I||e[30]!==p?(x=ne.jsx("div",{className:p,ref:T,children:I}),e[29]=I,e[30]=p,e[31]=x):x=e[31],x};export{At as default};
|
|
11
|
+
`},le=Ge(Qe)(se),Xe={config:Ye},Ze=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return function(o){return r.reduceRight(function(i,l){return l(i)},o)}};function fe(t,e){return Object.keys(e).forEach(function(r){e[r]instanceof Object&&t[r]&&Object.assign(e[r],fe(t[r],e[r]))}),ie(ie({},t),e)}var _e={type:"cancelation",msg:"operation is manually canceled"};function ee(t){var e=!1,r=new Promise(function(n,o){t.then(function(i){return e?o(_e):n(i)}),t.catch(o)});return r.cancel=function(){return e=!0},r}var et=Be.create({config:ke,isInitialized:!1,resolve:null,reject:null,monaco:null}),de=Se(et,2),J=de[0],_=de[1];function tt(t){var e=Xe.config(t),r=e.monaco,n=Ee(e,["monaco"]);_(function(o){return{config:fe(o.config,n),monaco:r}})}function rt(){var t=J(function(e){var r=e.monaco,n=e.isInitialized,o=e.resolve;return{monaco:r,isInitialized:n,resolve:o}});if(!t.isInitialized){if(_({isInitialized:!0}),t.monaco)return t.resolve(t.monaco),ee(te);if(window.monaco&&window.monaco.editor)return pe(window.monaco),t.resolve(window.monaco),ee(te);Ze(nt,it)(at)}return ee(te)}function nt(t){return document.body.appendChild(t)}function ot(t){var e=document.createElement("script");return t&&(e.src=t),e}function it(t){var e=J(function(n){var o=n.config,i=n.reject;return{config:o,reject:i}}),r=ot("".concat(e.config.paths.vs,"/loader.js"));return r.onload=function(){return t()},r.onerror=e.reject,r}function at(){var t=J(function(r){var n=r.config,o=r.resolve,i=r.reject;return{config:n,resolve:o,reject:i}}),e=window.require;e.config(t.config),e(["vs/editor/editor.main"],function(r){pe(r),t.resolve(r)},function(r){t.reject(r)})}function pe(t){J().monaco||_({monaco:t})}function ut(){return J(function(t){var e=t.monaco;return e})}var te=new Promise(function(t,e){return _({resolve:t,reject:e})}),ge={config:tt,init:rt,__getMonacoInstance:ut},ct={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},re=ct,lt={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},st=lt;function ft({children:t}){return H.createElement("div",{style:st.container},t)}var dt=ft,pt=dt;function gt({width:t,height:e,isEditorReady:r,loading:n,_ref:o,className:i,wrapperProps:l}){return H.createElement("section",{style:{...re.wrapper,width:t,height:e},...l},!r&&H.createElement(pt,null,n),H.createElement("div",{ref:o,style:{...re.fullWidth,...!r&&re.hide},className:i}))}var ht=gt,he=u.memo(ht);function vt(t){u.useEffect(t,[])}var ve=vt;function mt(t,e,r=!0){let n=u.useRef(!0);u.useEffect(n.current||!r?()=>{n.current=!1}:t,e)}var S=mt;function K(){}function F(t,e,r,n){return bt(t,n)||wt(t,e,r,n)}function bt(t,e){return t.editor.getModel(me(t,e))}function wt(t,e,r,n){return t.editor.createModel(e,r,n?me(t,n):void 0)}function me(t,e){return t.Uri.parse(e)}function yt({original:t,modified:e,language:r,originalLanguage:n,modifiedLanguage:o,originalModelPath:i,modifiedModelPath:l,keepCurrentOriginalModel:d=!1,keepCurrentModifiedModel:b=!1,theme:w="light",loading:T="Loading...",options:j={},height:v="100%",width:V="100%",className:W,wrapperProps:q={},beforeMount:A=K,onMount:C=K}){let[y,$]=u.useState(!1),[P,h]=u.useState(!0),m=u.useRef(null),p=u.useRef(null),R=u.useRef(null),O=u.useRef(C),c=u.useRef(A),M=u.useRef(!1);ve(()=>{let a=ge.init();return a.then(f=>(p.current=f)&&h(!1)).catch(f=>(f==null?void 0:f.type)!=="cancelation"&&console.error("Monaco initialization: error:",f)),()=>m.current?x():a.cancel()}),S(()=>{if(m.current&&p.current){let a=m.current.getOriginalEditor(),f=F(p.current,t||"",n||r||"text",i||"");f!==a.getModel()&&a.setModel(f)}},[i],y),S(()=>{if(m.current&&p.current){let a=m.current.getModifiedEditor(),f=F(p.current,e||"",o||r||"text",l||"");f!==a.getModel()&&a.setModel(f)}},[l],y),S(()=>{let a=m.current.getModifiedEditor();a.getOption(p.current.editor.EditorOption.readOnly)?a.setValue(e||""):e!==a.getValue()&&(a.executeEdits("",[{range:a.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),a.pushUndoStop())},[e],y),S(()=>{var a,f;(f=(a=m.current)==null?void 0:a.getModel())==null||f.original.setValue(t||"")},[t],y),S(()=>{let{original:a,modified:f}=m.current.getModel();p.current.editor.setModelLanguage(a,n||r||"text"),p.current.editor.setModelLanguage(f,o||r||"text")},[r,n,o],y),S(()=>{var a;(a=p.current)==null||a.editor.setTheme(w)},[w],y),S(()=>{var a;(a=m.current)==null||a.updateOptions(j)},[j],y);let N=u.useCallback(()=>{var L;if(!p.current)return;c.current(p.current);let a=F(p.current,t||"",n||r||"text",i||""),f=F(p.current,e||"",o||r||"text",l||"");(L=m.current)==null||L.setModel({original:a,modified:f})},[r,e,o,t,n,i,l]),I=u.useCallback(()=>{var a;!M.current&&R.current&&(m.current=p.current.editor.createDiffEditor(R.current,{automaticLayout:!0,...j}),N(),(a=p.current)==null||a.editor.setTheme(w),$(!0),M.current=!0)},[j,w,N]);u.useEffect(()=>{y&&O.current(m.current,p.current)},[y]),u.useEffect(()=>{!P&&!y&&I()},[P,y,I]);function x(){var f,L,D,B;let a=(f=m.current)==null?void 0:f.getModel();d||((L=a==null?void 0:a.original)==null||L.dispose()),b||((D=a==null?void 0:a.modified)==null||D.dispose()),(B=m.current)==null||B.dispose()}return H.createElement(he,{width:V,height:v,isEditorReady:y,loading:T,_ref:R,className:W,wrapperProps:q})}var Ot=yt;u.memo(Ot);function jt(t){let e=u.useRef();return u.useEffect(()=>{e.current=t},[t]),e.current}var Mt=jt,X=new Map;function Et({defaultValue:t,defaultLanguage:e,defaultPath:r,value:n,language:o,path:i,theme:l="light",line:d,loading:b="Loading...",options:w={},overrideServices:T={},saveViewState:j=!0,keepCurrentModel:v=!1,width:V="100%",height:W="100%",className:q,wrapperProps:A={},beforeMount:C=K,onMount:y=K,onChange:$,onValidate:P=K}){let[h,m]=u.useState(!1),[p,R]=u.useState(!0),O=u.useRef(null),c=u.useRef(null),M=u.useRef(null),N=u.useRef(y),I=u.useRef(C),x=u.useRef(),a=u.useRef(n),f=Mt(i),L=u.useRef(!1),D=u.useRef(!1);ve(()=>{let s=ge.init();return s.then(g=>(O.current=g)&&R(!1)).catch(g=>(g==null?void 0:g.type)!=="cancelation"&&console.error("Monaco initialization: error:",g)),()=>c.current?be():s.cancel()}),S(()=>{var g,E,k,U;let s=F(O.current,t||n||"",e||o||"",i||r||"");s!==((g=c.current)==null?void 0:g.getModel())&&(j&&X.set(f,(E=c.current)==null?void 0:E.saveViewState()),(k=c.current)==null||k.setModel(s),j&&((U=c.current)==null||U.restoreViewState(X.get(i))))},[i],h),S(()=>{var s;(s=c.current)==null||s.updateOptions(w)},[w],h),S(()=>{!c.current||n===void 0||(c.current.getOption(O.current.editor.EditorOption.readOnly)?c.current.setValue(n):n!==c.current.getValue()&&(D.current=!0,c.current.executeEdits("",[{range:c.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),c.current.pushUndoStop(),D.current=!1))},[n],h),S(()=>{var g,E;let s=(g=c.current)==null?void 0:g.getModel();s&&o&&((E=O.current)==null||E.editor.setModelLanguage(s,o))},[o],h),S(()=>{var s;d!==void 0&&((s=c.current)==null||s.revealLine(d))},[d],h),S(()=>{var s;(s=O.current)==null||s.editor.setTheme(l)},[l],h);let B=u.useCallback(()=>{var s;if(!(!M.current||!O.current)&&!L.current){I.current(O.current);let g=i||r,E=F(O.current,n||t||"",e||o||"",g||"");c.current=(s=O.current)==null?void 0:s.editor.create(M.current,{model:E,automaticLayout:!0,...w},T),j&&c.current.restoreViewState(X.get(g)),O.current.editor.setTheme(l),d!==void 0&&c.current.revealLine(d),m(!0),L.current=!0}},[t,e,r,n,o,i,w,T,j,l,d]);u.useEffect(()=>{h&&N.current(c.current,O.current)},[h]),u.useEffect(()=>{!p&&!h&&B()},[p,h,B]),a.current=n,u.useEffect(()=>{var s,g;h&&$&&((s=x.current)==null||s.dispose(),x.current=(g=c.current)==null?void 0:g.onDidChangeModelContent(E=>{D.current||$(c.current.getValue(),E)}))},[h,$]),u.useEffect(()=>{if(h){let s=O.current.editor.onDidChangeMarkers(g=>{var k;let E=(k=c.current.getModel())==null?void 0:k.uri;if(E&&g.find(U=>U.path===E.path)){let U=O.current.editor.getModelMarkers({resource:E});P==null||P(U)}});return()=>{s==null||s.dispose()}}return()=>{}},[h,P]);function be(){var s,g;(s=x.current)==null||s.dispose(),v?j&&X.set(i,c.current.saveViewState()):(g=c.current.getModel())==null||g.dispose(),c.current.dispose()}return H.createElement(he,{width:V,height:W,isEditorReady:h,loading:b,_ref:M,className:q,wrapperProps:A})}var St=Et,Pt=u.memo(St),Rt=Pt;const Tt=t=>{const e=we.c(32),{onChange:r,value:n,options:o,disabled:i}=t,{appearance:l}=ye(),[d,b]=u.useState("light"),w=u.useRef(null),T=u.useRef(null),{width:j}=Oe(),v=j<768,V=j>=768&&j<1024;let W;e[0]!==r?(W=a=>{r(a)},e[0]=r,e[1]=W):W=e[1];const q=W;let A,C;e[2]!==v||e[3]!==V?(A=a=>{w.current=a,C()},C=()=>{var f;if(!w.current)return;const a={minimap:{enabled:!v},fontSize:v?12:V?13:14,lineNumbers:v?"off":"on",lineDecorationsWidth:v?5:10,scrollBeyondLastLine:!v,wordWrap:v?"on":"bounded",renderWhitespace:v?"none":"selection",padding:{top:v?8:16,bottom:v?8:16}};w.current.updateOptions(a),(f=T.current)==null||f.classList.add("overflow-hidden"),setTimeout(()=>{var L,D;(L=w.current)==null||L.layout(),(D=T.current)==null||D.classList.remove("overflow-hidden")},100)},e[2]=v,e[3]=V,e[4]=A,e[5]=C):(A=e[4],C=e[5]);let y,$;e[6]!==l?(y=()=>{b(l==="dark"?"vs-dark":"light")},$=[l],e[6]=l,e[7]=y,e[8]=$):(y=e[7],$=e[8]),u.useEffect(y,$);let P;e[9]!==C?(P=()=>{C()},e[9]=C,e[10]=P):P=e[10];let h;e[11]!==j?(h=[j],e[11]=j,e[12]=h):h=e[12],u.useEffect(P,h);const m=v?"300px":V?"400px":"500px",p=`border rounded-lg ${v?"p-1":"p-2"}`;let R;e[13]!==v?(R=v&&{wordWrap:"on"},e[13]=v,e[14]=R):R=e[14];const O=!v;let c;e[15]!==O?(c={enabled:O},e[15]=O,e[16]=c):c=e[16];let M;e[17]!==R||e[18]!==c?(M={automaticLayout:!0,...R,minimap:c},e[17]=R,e[18]=c,e[19]=M):M=e[19];const N=`transition-all duration-200 ease-in-out ${i?"pointer-events-none opacity-50 cursor-not-allowed":""}`;let I;e[20]!==m||e[21]!==q||e[22]!==A||e[23]!==o.language||e[24]!==M||e[25]!==N||e[26]!==d||e[27]!==n?(I=ne.jsx(Rt,{height:m,language:o.language,value:n,theme:d,options:M,onChange:q,onMount:A,className:N}),e[20]=m,e[21]=q,e[22]=A,e[23]=o.language,e[24]=M,e[25]=N,e[26]=d,e[27]=n,e[28]=I):I=e[28];let x;return e[29]!==I||e[30]!==p?(x=ne.jsx("div",{className:p,ref:T,children:I}),e[29]=I,e[30]=p,e[31]=x):x=e[31],x};export{Tt as default};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{a as de,r as U,c as he,aw as L,j as t,aR as pe,aS as xe,aT as ge,aU as oe,ay as ve,B as ye,aV as be,aW as je,aX as we,a1 as Ne,aY as Ce,aZ as ke,a_ as Se,aA as Pe,a$ as Ve,aB as Me}from"./app.js";/**
|
|
2
|
+
* @license lucide-react v0.485.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const Ee=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],ie=de("circle-x",Ee);/**
|
|
7
|
+
* @license lucide-react v0.485.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const Ie=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],De=de("wand-sparkles",Ie),ce=pe("m-1 flex items-center border rounded-sm px-1",{variants:{variant:{default:"border-foreground/10 text-foreground bg-card hover:bg-card/80",secondary:"border-foreground/10 bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",inverted:"inverted"}},defaultVariants:{variant:"default"}}),_e=U.forwardRef((M,Y)=>{const e=he.c(87);let h,p,r,o,x,g,m,E,I,D,_,$,O,Z,z,u;e[0]!==M?({options:o,onValueChange:r,variant:u,processing:x,disabled:p,defaultValue:m,placeholder:E,notFound:I,search:D,animation:_,maxCount:$,modalPopover:O,asChild:Z,className:h,mode:z,...g}=M,e[0]=M,e[1]=h,e[2]=p,e[3]=r,e[4]=o,e[5]=x,e[6]=g,e[7]=m,e[8]=E,e[9]=I,e[10]=D,e[11]=_,e[12]=$,e[13]=O,e[14]=Z,e[15]=z,e[16]=u):(h=e[1],p=e[2],r=e[3],o=e[4],x=e[5],g=e[6],m=e[7],E=e[8],I=e[9],D=e[10],_=e[11],$=e[12],O=e[13],Z=e[14],z=e[15],u=e[16]);let R;e[17]!==m?(R=m===void 0?[]:m,e[17]=m,e[18]=R):R=e[18];const me=R,J=E===void 0?"":E,Q=I===void 0?"":I,ee=D===void 0?"":D,f=_===void 0?0:_,i=$===void 0?3:$,te=O===void 0?!1:O,n=z===void 0?"multiple":z,[s,T]=U.useState(me),[se,B]=U.useState(!1),[c,ue]=U.useState(!1);let A;e[19]!==r||e[20]!==s?(A=a=>{if(a.key==="Enter")B(!0);else if(a.key==="Backspace"&&!a.currentTarget.value){const l=[...s];l.pop(),T(l),r(l)}},e[19]=r,e[20]=s,e[21]=A):A=e[21];const ae=A;let F;e[22]!==n||e[23]!==r||e[24]!==s?(F=a=>{let l;n==="single"?l=s.includes(a)?[]:[a]:l=s.includes(a)?s.filter(V=>V!==a):[...s,a],T(l),r(l),n==="single"&&B(!1)},e[22]=n,e[23]=r,e[24]=s,e[25]=F):F=e[25];const d=F;let K;e[26]!==r?(K=()=>{T([]),r([])},e[26]=r,e[27]=K):K=e[27];const le=K;let X;e[28]===Symbol.for("react.memo_cache_sentinel")?(X=()=>{B($e)},e[28]=X):X=e[28];const fe=X;let q;e[29]!==i||e[30]!==r||e[31]!==s?(q=()=>{const a=s.slice(0,i);T(a),r(a)},e[29]=i,e[30]=r,e[31]=s,e[32]=q):q=e[32];const re=q;let v;e[33]!==h?(v=L("flex w-full p-1 rounded-md border-input border-1 min-h-10 h-auto items-center justify-between bg-inherit hover:bg-inherit [&_svg]:pointer-events-auto",h),e[33]=h,e[34]=v):v=e[34];let y;e[35]!==f||e[36]!==re||e[37]!==le||e[38]!==c||e[39]!==i||e[40]!==n||e[41]!==o||e[42]!==J||e[43]!==x||e[44]!==s||e[45]!==d||e[46]!==u?(y=s.length>0?t.jsxs("div",{className:"flex justify-between items-center w-full",children:[t.jsxs("div",{className:"flex flex-wrap items-center",children:[s.slice(0,i).map(a=>{const l=o.find(ne=>ne.value===a),V=l==null?void 0:l.icon;return t.jsxs("div",{className:L(c?"animate-bounce":"",ce({variant:u})),style:{animationDuration:`${f}s`},children:[V&&t.jsx(V,{className:"h-4 w-4 mr-2"}),l==null?void 0:l.label,t.jsx(ie,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:ne=>{ne.stopPropagation(),x||d(a)}})]},a)}),n==="multiple"&&s.length>i&&t.jsxs("div",{className:L("bg-transparent text-foreground border-foreground/1 hover:bg-transparent",c?"animate-bounce":"",ce({variant:u})),style:{animationDuration:`${f}s`},children:[`+ ${s.length-i} more`,t.jsx(ie,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:a=>{a.stopPropagation(),re()}})]})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[s.length>0&&t.jsxs(t.Fragment,{children:[t.jsx(xe,{className:"h-4 mx-2 cursor-pointer text-muted-foreground",onClick:a=>{a.stopPropagation(),le()}}),t.jsx(ge,{orientation:"vertical",className:"flex min-h-6 h-full"})]}),t.jsx(oe,{className:"h-4 mx-2 cursor-pointer text-muted-foreground"})]})]}):t.jsxs("div",{className:"flex items-center justify-between w-full mx-auto",children:[t.jsx("span",{className:"text-sm text-muted-foreground mx-3",children:J}),t.jsx(oe,{className:"h-4 cursor-pointer text-muted-foreground mx-2"})]}),e[35]=f,e[36]=re,e[37]=le,e[38]=c,e[39]=i,e[40]=n,e[41]=o,e[42]=J,e[43]=x,e[44]=s,e[45]=d,e[46]=u,e[47]=y):y=e[47];let b;e[48]!==p||e[49]!==g||e[50]!==Y||e[51]!==v||e[52]!==y?(b=t.jsx(ve,{asChild:!0,children:t.jsx(ye,{ref:Y,...g,onClick:fe,disabled:p,className:v,children:y})}),e[48]=p,e[49]=g,e[50]=Y,e[51]=v,e[52]=y,e[53]=b):b=e[53];let H;e[54]===Symbol.for("react.memo_cache_sentinel")?(H=()=>B(!1),e[54]=H):H=e[54];let j;e[55]!==ae||e[56]!==ee?(j=t.jsx(be,{placeholder:ee,onKeyDown:ae}),e[55]=ae,e[56]=ee,e[57]=j):j=e[57];let w;e[58]!==Q?(w=t.jsx(je,{children:Q}),e[58]=Q,e[59]=w):w=e[59];let N;if(e[60]!==o||e[61]!==s||e[62]!==d){let a;e[64]!==s||e[65]!==d?(a=l=>{const V=s.includes(l.value);return t.jsxs(we,{onSelect:()=>d(l.value),className:"cursor-pointer",children:[t.jsx("div",{className:L("mr-2 flex h-5 w-5 items-center justify-center rounded border border-primary",V?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:t.jsx(Ne,{className:"h-4 w-4 text-primary-foreground"})}),l.icon&&t.jsx(l.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),t.jsx("span",{children:l.label})]},l.value)},e[64]=s,e[65]=d,e[66]=a):a=e[66],N=o.map(a),e[60]=o,e[61]=s,e[62]=d,e[63]=N}else N=e[63];let C;e[67]!==N?(C=t.jsx(Ce,{children:N}),e[67]=N,e[68]=C):C=e[68];let W;e[69]===Symbol.for("react.memo_cache_sentinel")?(W=t.jsx(ke,{}),e[69]=W):W=e[69];let k;e[70]!==w||e[71]!==C?(k=t.jsxs(Se,{children:[w,C,W]}),e[70]=w,e[71]=C,e[72]=k):k=e[72];let S;e[73]!==j||e[74]!==k?(S=t.jsx(Pe,{className:"w-auto p-0 z-[410]",align:"start",onEscapeKeyDown:H,children:t.jsxs(Ve,{children:[j,k]})}),e[73]=j,e[74]=k,e[75]=S):S=e[75];let P;e[76]!==f||e[77]!==c||e[78]!==n||e[79]!==s.length?(P=f>0&&s.length>0&&n==="multiple"&&t.jsx(De,{className:L("cursor-pointer my-2 text-foreground bg-background w-3 h-3",c?"":"text-muted-foreground"),onClick:()=>ue(!c)}),e[76]=f,e[77]=c,e[78]=n,e[79]=s.length,e[80]=P):P=e[80];let G;return e[81]!==se||e[82]!==te||e[83]!==b||e[84]!==S||e[85]!==P?(G=t.jsxs(Me,{open:se,onOpenChange:B,modal:te,children:[b,S,P]}),e[81]=se,e[82]=te,e[83]=b,e[84]=S,e[85]=P,e[86]=G):G=e[86],G});_e.displayName="MultiSelect";function $e(M){return!M}export{_e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as u,j as t,an as d,a9 as p,ah as x,aH as h,a8 as f}from"./app.js";import{Icon as m}from"./icon-B-D8X0jg.js";function S(r){const e=u.c(12);let o,a,n;e[0]!==r?({items:a,className:o,...n}=r,e[0]=r,e[1]=o,e[2]=a,e[3]=n):(o=e[1],a=e[2],n=e[3]);const c=`group-data-[collapsible=icon]:p-0 ${o||""}`;let s;e[4]!==a?(s=a.map(j),e[4]=a,e[5]=s):s=e[5];let l;e[6]!==s?(l=t.jsx(h,{children:t.jsx(f,{children:s})}),e[6]=s,e[7]=l):l=e[7];let i;return e[8]!==n||e[9]!==c||e[10]!==l?(i=t.jsx(d,{...n,className:c,children:l}),e[8]=n,e[9]=c,e[10]=l,e[11]=i):i=e[11],i}function j(r){return t.jsx(p,{children:t.jsx(x,{asChild:!0,className:"text-neutral-600 hover:text-neutral-800 dark:text-neutral-300 dark:hover:text-neutral-100",children:t.jsxs("a",{href:r.href,target:"_blank",rel:"noopener noreferrer",children:[r.icon&&t.jsx(m,{iconNode:r.icon,className:"h-5 w-5"}),t.jsx("span",{children:r.title})]})})},r.title)}export{S as NavFooter};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as E,q as G,r as w,j as e,aE as _,a9 as C,ag as $,ah as N,C as M,aF as A,a6 as O,ai as R,aj as z,X as v,an as B,aG as F,aH as L,a8 as P}from"./app.js";import m from"./material-icon-DeSoGIhT.js";function J(a){const t=E.c(15),{items:l}=a;let f;t[0]!==l?(f=l===void 0?[]:l,t[0]=l,t[1]=f):f=t[1];const p=f,h=G();let S;t[2]!==p?(S=()=>{const u={};return p.forEach(o=>{const c=o.section||"Platform";c in u||(u[c]=!0)}),u},t[2]=p,t[3]=S):S=t[3];const[d,y]=w.useState(S),g=U;let x;if(t[4]!==p||t[5]!==d||t[6]!==h){const u=p.reduce(Q,{});let o;if(t[8]!==h){o=r=>{var s,k;const{item:n}=r;return((s=n.actions)==null?void 0:s.length)>0?e.jsx(_,{asChild:!0,defaultOpen:j(n.link),className:"group/collapsible",children:e.jsxs(C,{children:[e.jsx($,{asChild:!0,children:e.jsxs(N,{tooltip:n.title,children:[e.jsx(m,{name:n.icon,className:"!text-[18px]"}),e.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:n.title}),e.jsx(M,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"})]})}),e.jsx(A,{children:e.jsx(O,{children:(k=n.actions)==null?void 0:k.map(i=>e.jsx(R,{children:e.jsx(z,{asChild:!0,isActive:j(i.link),children:i.type==="blank"?e.jsxs("a",{href:i.link,target:"_blank",rel:"noopener noreferrer",children:[i.icon&&e.jsx(m,{name:i.icon,className:"!text-[18px]"}),e.jsx("span",{children:i.title})]}):e.jsxs(v,{href:i.link,children:[i.icon&&e.jsx(m,{name:i.icon,className:"!text-[18px]"}),e.jsx("span",{children:i.title})]})})},i.id))})})]})},n.title):e.jsx(C,{children:e.jsx(N,{asChild:!0,isActive:j(n.link),tooltip:{children:n.title},children:n.type==="blank"?e.jsxs("a",{href:n.link,target:"_blank",rel:"noopener noreferrer",children:[n.icon&&e.jsx(m,{name:n.icon,className:"!text-[18px]"}),e.jsx("span",{children:n.title})]}):e.jsxs(v,{href:n.link,children:[n.icon&&e.jsx(m,{name:n.icon,className:"!text-[18px]"}),e.jsx("span",{children:n.title})]})})},n.title)};const j=r=>{const n=g(h.url),s=g(r);return n===s||n.startsWith(`${s}/`)};t[8]=h,t[9]=o}else o=t[9];let c;t[10]!==o||t[11]!==d?(c=j=>{const[r,n]=j;return e.jsxs(B,{className:"px-2 py-0",children:[e.jsx(F,{asChild:!0,className:"cursor-pointer",onClick:()=>y(s=>({...s,[r]:!s[r]})),children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(M,{className:`transform transition-transform duration-200 ${d[r]?"rotate-90":""}`}),e.jsx("span",{children:r})]})}),d[r]&&e.jsx(L,{children:e.jsx(P,{children:n.map(s=>e.jsx(o,{item:s},s.id||s.title))})})]},r)},t[10]=o,t[11]=d,t[12]=c):c=t[12],x=Object.entries(u).map(c),t[4]=p,t[5]=d,t[6]=h,t[7]=x}else x=t[7];let b;return t[13]!==x?(b=e.jsx(e.Fragment,{children:x}),t[13]=x,t[14]=b):b=t[14],b}function Q(a,t){const l=t.section||"Platform";return a[l]||(a[l]=[]),a[l].push(t),a}function U(a){return a.split("?")[0].replace(/\/$/,"")}export{J as NavMain};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as f,q as x,aI as b,aJ as g,j as s,s as h,ah as j,u as M,a8 as w,a9 as C,aK as S}from"./app.js";import{UserInfo as D}from"./user-info-CnB2lvpg.js";import{UserMenuContent as I}from"./user-menu-content-BFbaJw6v.js";import{C as N}from"./chevrons-up-down-D3t3UGV7.js";function E(){const e=f.c(15),{auth:t,logout:u,logoutBtn:c}=x().props,{state:m}=b(),p=g();let r;e[0]!==t.user?(r=s.jsx(D,{user:t.user}),e[0]=t.user,e[1]=r):r=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx(N,{className:"ml-auto size-4"}),e[2]=i):i=e[2];let o;e[3]!==r?(o=s.jsx(h,{asChild:!0,children:s.jsxs(j,{size:"lg",className:"text-sidebar-accent-foreground data-[state=open]:bg-sidebar-accent group focus-visible:ring-0 cursor-pointer",children:[r,i]})}),e[3]=r,e[4]=o):o=e[4];const d=p?"bottom":m==="collapsed"?"left":"bottom";let n;e[5]!==t.user||e[6]!==u||e[7]!==c?(n=s.jsx(I,{user:t.user,logout:u,logoutBtn:c}),e[5]=t.user,e[6]=u,e[7]=c,e[8]=n):n=e[8];let a;e[9]!==d||e[10]!==n?(a=s.jsx(M,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg z-[1002]",align:"end",side:d,children:n}),e[9]=d,e[10]=n,e[11]=a):a=e[11];let l;return e[12]!==o||e[13]!==a?(l=s.jsx(w,{children:s.jsx(C,{children:s.jsxs(S,{children:[o,a]})})}),e[12]=o,e[13]=a,e[14]=l):l=e[14],l}export{E as NavUser};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as V,j as a,be as k,bf as _,bg as w,bh as A,bi as q,bj as z}from"./app.js";const J=i=>{const e=V.c(44),{pagination:t,pageChange:n,currentPage:s}=i,D=t.links.filter(B).map(G),I=D.includes(1),L=D.includes(t.last_page),j=`${I?"opacity-50 pointer-events-none":"opacity-100"}`,y=`px-6 cursor-pointer bg-secondary hover:bg-muted-foreground/15 ${s===1?"opacity-50 pointer-events-none":""}`;let o;e[0]!==s||e[1]!==n?(o=r=>{r.preventDefault(),s!==1&&n(1)},e[0]=s,e[1]=n,e[2]=o):o=e[2];let l;e[3]!==y||e[4]!==o?(l=a.jsx(k,{className:y,onClick:o,children:"First"}),e[3]=y,e[4]=o,e[5]=l):l=e[5];let c;e[6]!==j||e[7]!==l?(c=a.jsx(_,{className:j,children:l}),e[6]=j,e[7]=l,e[8]=c):c=e[8];const P=`cursor-pointer bg-secondary hover:bg-muted-foreground/15 ${t.prev_page_url?"":"opacity-50 pointer-events-none"}`;let p;e[9]!==s||e[10]!==n||e[11]!==t.prev_page_url?(p=r=>{r.preventDefault(),t.prev_page_url&&n(s-1)},e[9]=s,e[10]=n,e[11]=t.prev_page_url,e[12]=p):p=e[12];let g;e[13]!==P||e[14]!==p?(g=a.jsx(_,{children:a.jsx(w,{className:P,onClick:p})}),e[13]=P,e[14]=p,e[15]=g):g=e[15];let u;if(e[16]!==n||e[17]!==t.links){let r;e[19]!==n?(r=(v,R)=>v.label==="Previous"||v.label==="Next"?null:a.jsx(_,{children:a.jsx(k,{className:`cursor-pointer bg-secondary hover:bg-muted-foreground/15 ${v.active?"!bg-primary dark:!bg-muted-foreground !text-primary-foreground dark:!text-ring":""}`,onClick:E=>{E.preventDefault();const F=parseInt(v.label);n(F)},isActive:v.active,children:v.label})},R),e[19]=n,e[20]=r):r=e[20],u=t.links.map(r),e[16]=n,e[17]=t.links,e[18]=u}else u=e[18];const N=`cursor-pointer bg-secondary hover:bg-muted-foreground/15 ${t.next_page_url?"":"opacity-50 pointer-events-none"}`;let f;e[21]!==s||e[22]!==n||e[23]!==t.next_page_url?(f=r=>{r.preventDefault(),t.next_page_url&&n(s+1)},e[21]=s,e[22]=n,e[23]=t.next_page_url,e[24]=f):f=e[24];let d;e[25]!==N||e[26]!==f?(d=a.jsx(_,{children:a.jsx(A,{className:N,onClick:f})}),e[25]=N,e[26]=f,e[27]=d):d=e[27];const $=`${L?"opacity-50 pointer-events-none":"opacity-100"}`,C=`px-6 cursor-pointer bg-secondary hover:bg-muted-foreground/15 ${s===t.last_page?"opacity-50 pointer-events-none":""}`;let b;e[28]!==s||e[29]!==n||e[30]!==t.last_page?(b=r=>{r.preventDefault(),s!==t.last_page&&n(t.last_page)},e[28]=s,e[29]=n,e[30]=t.last_page,e[31]=b):b=e[31];let m;e[32]!==C||e[33]!==b?(m=a.jsx(k,{className:C,onClick:b,children:"Last"}),e[32]=C,e[33]=b,e[34]=m):m=e[34];let x;e[35]!==$||e[36]!==m?(x=a.jsx(_,{className:$,children:m}),e[35]=$,e[36]=m,e[37]=x):x=e[37];let h;return e[38]!==d||e[39]!==x||e[40]!==c||e[41]!==g||e[42]!==u?(h=a.jsx(q,{children:a.jsxs(z,{className:"flex-wrap",children:[c,g,u,d,x]})}),e[38]=d,e[39]=x,e[40]=c,e[41]=g,e[42]=u,e[43]=h):h=e[43],h};function B(i){return i.label!=="Previous"&&i.label!=="Next"}function G(i){return parseInt(i.label)}export{J as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as Pe,q as _e,r as ye,Y as Se,j as l,L as Q,I as U,S as Ce,b as ke,B as Le,X as Ee,T as Te,h as Ie,e as $e,i as qe,t as Be}from"./app.js";import W from"./input-error-F1DL-Fx6.js";import{i as Fe}from"./use-appearance-J8J2w43p.js";function Xe(){const e=Pe.c(151),s=_e();let Z;e[0]===Symbol.for("react.memo_cache_sentinel")?(Z=[],e[0]=Z):Z=e[0],ye.useEffect(Ve,Z);let ee;e[1]===Symbol.for("react.memo_cache_sentinel")?(ee={locale:"en",email:"",confirmPassword:"",password:"",fullName:"",login:""},e[1]=ee):ee=e[1];const{post:de,data:r,setData:me,processing:a,setError:fe,errors:t,clearErrors:ue}=Se(ee);let se;e[2]!==r.confirmPassword||e[3]!==r.password||e[4]!==s.props.confirmError||e[5]!==s.props.submitLink||e[6]!==de||e[7]!==fe?(se=i=>{if(i.preventDefault(),r.password!==r.confirmPassword){fe("confirmPassword",s.props.confirmError);return}de(s.props.submitLink,{onSuccess:Re,onError:De})},e[2]=r.confirmPassword,e[3]=r.password,e[4]=s.props.confirmError,e[5]=s.props.submitLink,e[6]=de,e[7]=fe,e[8]=se):se=e[8];const be=se;let le;e[9]!==ue||e[10]!==me?(le=(i,ve)=>{ue(),me(i,ve)},e[9]=ue,e[10]=me,e[11]=le):le=e[11];const o=le;let ae;e[12]===Symbol.for("react.memo_cache_sentinel")?(ae=l.jsx(Te,{position:"top-center",richColors:!0,closeButton:!0}),e[12]=ae):ae=e[12];let n;e[13]!==s.props.header.title?(n=l.jsx("h1",{className:"font-medium mb-2 text-xl",children:s.props.header.title}),e[13]=s.props.header.title,e[14]=n):n=e[14];let p;e[15]!==s.props.header.desc?(p=l.jsx("p",{className:"text-muted-foreground text-sm",children:s.props.header.desc}),e[15]=s.props.header.desc,e[16]=p):p=e[16];let re;e[17]===Symbol.for("react.memo_cache_sentinel")?(re=l.jsx("span",{className:"text-red-500",children:"*"}),e[17]=re):re=e[17];let c;e[18]!==s.props.loginLabel?(c=l.jsxs(Q,{htmlFor:"login",children:[s.props.loginLabel,re]}),e[18]=s.props.loginLabel,e[19]=c):c=e[19];const he=`${t.login?"border-red-500":""}`;let d;e[20]!==o?(d=i=>{o("login",i.target.value)},e[20]=o,e[21]=d):d=e[21];let m;e[22]!==r.login||e[23]!==s.props.loginLabel||e[24]!==a||e[25]!==d||e[26]!==he?(m=l.jsx(U,{id:"login",className:he,type:"text",required:!0,tabIndex:1,autoComplete:"username",value:r.login,disabled:a,onChange:d,placeholder:s.props.loginLabel}),e[22]=r.login,e[23]=s.props.loginLabel,e[24]=a,e[25]=d,e[26]=he,e[27]=m):m=e[27];let f;e[28]!==t.login?(f=l.jsx(W,{message:t.login}),e[28]=t.login,e[29]=f):f=e[29];let u;e[30]!==m||e[31]!==f?(u=l.jsxs("div",{className:"relative",children:[m,f]}),e[30]=m,e[31]=f,e[32]=u):u=e[32];let b;e[33]!==u||e[34]!==c?(b=l.jsxs("div",{className:"grid gap-4",children:[c,u]}),e[33]=u,e[34]=c,e[35]=b):b=e[35];let te;e[36]===Symbol.for("react.memo_cache_sentinel")?(te=l.jsx("span",{className:"text-red-500",children:"*"}),e[36]=te):te=e[36];let h;e[37]!==s.props.fullNameLabel?(h=l.jsxs(Q,{htmlFor:"fullName",children:[s.props.fullNameLabel,te]}),e[37]=s.props.fullNameLabel,e[38]=h):h=e[38];const xe=`${t.fullName?"border-red-500":""}`;let x;e[39]!==o?(x=i=>{o("fullName",i.target.value)},e[39]=o,e[40]=x):x=e[40];let g;e[41]!==r.fullName||e[42]!==s.props.fullNameLabel||e[43]!==a||e[44]!==xe||e[45]!==x?(g=l.jsx(U,{id:"fullName",className:xe,type:"text",required:!0,tabIndex:1,autoComplete:"fullName",value:r.fullName,disabled:a,onChange:x,placeholder:s.props.fullNameLabel}),e[41]=r.fullName,e[42]=s.props.fullNameLabel,e[43]=a,e[44]=xe,e[45]=x,e[46]=g):g=e[46];let w;e[47]!==t.fullName?(w=l.jsx(W,{message:t.fullName}),e[47]=t.fullName,e[48]=w):w=e[48];let j;e[49]!==g||e[50]!==w?(j=l.jsxs("div",{className:"relative",children:[g,w]}),e[49]=g,e[50]=w,e[51]=j):j=e[51];let N;e[52]!==h||e[53]!==j?(N=l.jsxs("div",{className:"grid gap-4",children:[h,j]}),e[52]=h,e[53]=j,e[54]=N):N=e[54];let oe;e[55]===Symbol.for("react.memo_cache_sentinel")?(oe=l.jsx("span",{className:"text-red-500",children:"*"}),e[55]=oe):oe=e[55];let L;e[56]!==s.props.passwordLabel?(L=l.jsxs(Q,{htmlFor:"password",children:[s.props.passwordLabel,oe]}),e[56]=s.props.passwordLabel,e[57]=L):L=e[57];const ge=`${t.password?"border-red-500":""}`;let v;e[58]!==o?(v=i=>{o("password",i.target.value)},e[58]=o,e[59]=v):v=e[59];let P;e[60]!==r.password||e[61]!==s.props.passwordLabel||e[62]!==a||e[63]!==ge||e[64]!==v?(P=l.jsx(U,{id:"password",className:ge,type:"password",required:!0,tabIndex:1,autoComplete:"new-password",value:r.password,disabled:a,onChange:v,placeholder:s.props.passwordLabel}),e[60]=r.password,e[61]=s.props.passwordLabel,e[62]=a,e[63]=ge,e[64]=v,e[65]=P):P=e[65];let _;e[66]!==t.password?(_=l.jsx(W,{message:t.password}),e[66]=t.password,e[67]=_):_=e[67];let y;e[68]!==P||e[69]!==_?(y=l.jsxs("div",{className:"relative",children:[P,_]}),e[68]=P,e[69]=_,e[70]=y):y=e[70];let S;e[71]!==L||e[72]!==y?(S=l.jsxs("div",{className:"grid gap-4",children:[L,y]}),e[71]=L,e[72]=y,e[73]=S):S=e[73];let ie;e[74]===Symbol.for("react.memo_cache_sentinel")?(ie=l.jsx("span",{className:"text-red-500",children:"*"}),e[74]=ie):ie=e[74];let C;e[75]!==s.props.confirmPasswordLabel?(C=l.jsxs(Q,{htmlFor:"confirmPassword",children:[s.props.confirmPasswordLabel,ie]}),e[75]=s.props.confirmPasswordLabel,e[76]=C):C=e[76];const we=`${t.confirmPassword?"border-red-500":""}`;let k;e[77]!==o?(k=i=>{o("confirmPassword",i.target.value)},e[77]=o,e[78]=k):k=e[78];let E;e[79]!==r.confirmPassword||e[80]!==s.props.confirmPasswordLabel||e[81]!==a||e[82]!==we||e[83]!==k?(E=l.jsx(U,{id:"confirmPassword",className:we,type:"password",required:!0,tabIndex:1,autoComplete:"new-password",value:r.confirmPassword,disabled:a,onChange:k,placeholder:s.props.confirmPasswordLabel}),e[79]=r.confirmPassword,e[80]=s.props.confirmPasswordLabel,e[81]=a,e[82]=we,e[83]=k,e[84]=E):E=e[84];let T;e[85]!==t.confirmPassword?(T=l.jsx(W,{message:t.confirmPassword}),e[85]=t.confirmPassword,e[86]=T):T=e[86];let I;e[87]!==E||e[88]!==T?(I=l.jsxs("div",{className:"relative",children:[E,T]}),e[87]=E,e[88]=T,e[89]=I):I=e[89];let $;e[90]!==C||e[91]!==I?($=l.jsxs("div",{className:"grid gap-4",children:[C,I]}),e[90]=C,e[91]=I,e[92]=$):$=e[92];let ne;e[93]===Symbol.for("react.memo_cache_sentinel")?(ne=l.jsx("span",{className:"text-red-500",children:"*"}),e[93]=ne):ne=e[93];let q;e[94]!==s.props.emailLabel?(q=l.jsxs(Q,{htmlFor:"email",children:[s.props.emailLabel,ne]}),e[94]=s.props.emailLabel,e[95]=q):q=e[95];const je=`${t.email?"border-red-500":""}`;let B;e[96]!==o?(B=i=>{o("email",i.target.value)},e[96]=o,e[97]=B):B=e[97];let F;e[98]!==r.email||e[99]!==s.props.emailLabel||e[100]!==a||e[101]!==je||e[102]!==B?(F=l.jsx(U,{id:"email",className:je,type:"email",required:!0,tabIndex:1,autoComplete:"email",value:r.email,disabled:a,onChange:B,placeholder:s.props.emailLabel}),e[98]=r.email,e[99]=s.props.emailLabel,e[100]=a,e[101]=je,e[102]=B,e[103]=F):F=e[103];let D;e[104]!==t.email?(D=l.jsx(W,{message:t.email}),e[104]=t.email,e[105]=D):D=e[105];let R;e[106]!==F||e[107]!==D?(R=l.jsxs("div",{className:"relative",children:[F,D]}),e[106]=F,e[107]=D,e[108]=R):R=e[108];let V;e[109]!==q||e[110]!==R?(V=l.jsxs("div",{className:"grid gap-4",children:[q,R]}),e[109]=q,e[110]=R,e[111]=V):V=e[111];let z;e[112]!==s.props.localeLabel?(z=l.jsx(Q,{htmlFor:"locale",children:s.props.localeLabel}),e[112]=s.props.localeLabel,e[113]=z):z=e[113];let J;e[114]!==o?(J=i=>o("locale",i),e[114]=o,e[115]=J):J=e[115];let O;e[116]!==s.props.localeLabel?(O=l.jsx(Ce,{className:"w-full cursor-pointer",children:l.jsx(ke,{placeholder:s.props.localeLabel})}),e[116]=s.props.localeLabel,e[117]=O):O=e[117];let pe;e[118]===Symbol.for("react.memo_cache_sentinel")?(pe=l.jsx(Ie,{children:l.jsx($e,{value:"en",children:"EN"})}),e[118]=pe):pe=e[118];let X;e[119]!==a||e[120]!==J||e[121]!==O?(X=l.jsxs(qe,{onValueChange:J,defaultValue:"en",disabled:a,children:[O,pe]}),e[119]=a,e[120]=J,e[121]=O,e[122]=X):X=e[122];let Y;e[123]!==z||e[124]!==X?(Y=l.jsxs("div",{className:"grid gap-4",children:[z,X]}),e[123]=z,e[124]=X,e[125]=Y):Y=e[125];let A;e[126]!==s.props.submitButton||e[127]!==a?(A=l.jsx(Le,{type:"submit",className:"w-fit",disabled:a,children:s.props.submitButton}),e[126]=s.props.submitButton,e[127]=a,e[128]=A):A=e[128];const Ne=`${a} ? 'pointer-events-none opacity-50' : ''`;let G;e[129]!==s.props.backToLogin.link||e[130]!==s.props.backToLogin.text||e[131]!==Ne?(G=l.jsx(Le,{asChild:!0,variant:"outline",children:l.jsx(Ee,{href:s.props.backToLogin.link,className:Ne,children:s.props.backToLogin.text})}),e[129]=s.props.backToLogin.link,e[130]=s.props.backToLogin.text,e[131]=Ne,e[132]=G):G=e[132];let H;e[133]!==A||e[134]!==G?(H=l.jsxs("div",{className:"flex gap-4",children:[A,G]}),e[133]=A,e[134]=G,e[135]=H):H=e[135];let K;e[136]!==b||e[137]!==N||e[138]!==S||e[139]!==$||e[140]!==V||e[141]!==Y||e[142]!==H?(K=l.jsxs("div",{className:"grid gap-5",children:[b,N,S,$,V,Y,H]}),e[136]=b,e[137]=N,e[138]=S,e[139]=$,e[140]=V,e[141]=Y,e[142]=H,e[143]=K):K=e[143];let M;e[144]!==be||e[145]!==K?(M=l.jsx("form",{onSubmit:be,className:"mt-6",children:K}),e[144]=be,e[145]=K,e[146]=M):M=e[146];let ce;return e[147]!==n||e[148]!==M||e[149]!==p?(ce=l.jsxs("div",{className:"bg-sidebar flex min-h-svh w-full justify-center items-center",children:[ae,l.jsxs("div",{className:"rounded-xl border bg-card text-card-foreground shadow p-6 max-w-sm w-full h-fit",children:[n,p,M]})]}),e[147]=n,e[148]=M,e[149]=p,e[150]=ce):ce=e[150],ce}function De(e){for(const s of Object.keys(e))Be.error(e[s])}function Re(){}function Ve(){Fe()}export{Xe as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as KZ,W as No,r as Cf,j as bv}from"./app.js";import{c as JZ}from"./compiler-runtime-hB6dAw2d.js";import{k as YZ,b as XZ}from"./index-Vcq4gwWv.js";import{u as ZZ}from"./use-window-size-h0Sh_NvX.js";import{u as QZ}from"./use-appearance-DRfIqTgw.js";function Or(r){this.content=r}Or.prototype={constructor:Or,find:function(r){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===r)return e;return-1},get:function(r){var e=this.find(r);return e==-1?void 0:this.content[e+1]},update:function(r,e,t){var n=t&&t!=r?this.remove(t):this,i=n.find(r),a=n.content.slice();return i==-1?a.push(t||r,e):(a[i+1]=e,t&&(a[i]=t)),new Or(a)},remove:function(r){var e=this.find(r);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Or(t)},addToStart:function(r,e){return new Or([r,e].concat(this.remove(r).content))},addToEnd:function(r,e){var t=this.remove(r).content.slice();return t.push(r,e),new Or(t)},addBefore:function(r,e,t){var n=this.remove(e),i=n.content.slice(),a=n.find(r);return i.splice(a==-1?i.length:a,0,e,t),new Or(i)},forEach:function(r){for(var e=0;e<this.content.length;e+=2)r(this.content[e],this.content[e+1])},prepend:function(r){return r=Or.from(r),r.size?new Or(r.content.concat(this.subtract(r).content)):this},append:function(r){return r=Or.from(r),r.size?new Or(this.subtract(r).content.concat(r.content)):this},subtract:function(r){var e=this;r=Or.from(r);for(var t=0;t<r.content.length;t+=2)e=e.remove(r.content[t]);return e},toObject:function(){var r={};return this.forEach(function(e,t){r[e]=t}),r},get size(){return this.content.length>>1}};Or.from=function(r){if(r instanceof Or)return r;var e=[];if(r)for(var t in r)e.push(t,r[t]);return new Or(e)};function Ky(r,e,t){for(let n=0;;n++){if(n==r.childCount||n==e.childCount)return r.childCount==e.childCount?null:t;let i=r.child(n),a=e.child(n);if(i==a){t+=i.nodeSize;continue}if(!i.sameMarkup(a))return t;if(i.isText&&i.text!=a.text){for(let o=0;i.text[o]==a.text[o];o++)t++;return t}if(i.content.size||a.content.size){let o=Ky(i.content,a.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function Jy(r,e,t,n){for(let i=r.childCount,a=e.childCount;;){if(i==0||a==0)return i==a?null:{a:t,b:n};let o=r.child(--i),s=e.child(--a),l=o.nodeSize;if(o==s){t-=l,n-=l;continue}if(!o.sameMarkup(s))return{a:t,b:n};if(o.isText&&o.text!=s.text){let f=0,p=Math.min(o.text.length,s.text.length);for(;f<p&&o.text[o.text.length-f-1]==s.text[s.text.length-f-1];)f++,t--,n--;return{a:t,b:n}}if(o.content.size||s.content.size){let f=Jy(o.content,s.content,t-1,n-1);if(f)return f}t-=l,n-=l}}class Oe{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,t,n,i=0,a){for(let o=0,s=0;s<t;o++){let l=this.content[o],f=s+l.nodeSize;if(f>e&&n(l,i+s,a||null,o)!==!1&&l.content.size){let p=s+1;l.nodesBetween(Math.max(0,e-p),Math.min(l.content.size,t-p),n,i+p)}s=f}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,i){let a="",o=!0;return this.nodesBetween(e,t,(s,l)=>{let f=s.isText?s.text.slice(Math.max(e,l)-l,t-l):s.isLeaf?i?typeof i=="function"?i(s):i:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&f||s.isTextblock)&&n&&(o?o=!1:a+=n),a+=f},0),a}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,i=this.content.slice(),a=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),a=1);a<e.content.length;a++)i.push(e.content[a]);return new Oe(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let n=[],i=0;if(t>e)for(let a=0,o=0;o<t;a++){let s=this.content[a],l=o+s.nodeSize;l>e&&((o<e||l>t)&&(s.isText?s=s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s=s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),i+=s.nodeSize),o=l}return new Oe(n,i)}cutByIndex(e,t){return e==t?Oe.empty:e==0&&t==this.content.length?this:new Oe(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let i=this.content.slice(),a=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new Oe(i,a)}addToStart(e){return new Oe([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Oe(this.content.concat(e),this.size+e.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 new 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 i=this.content[t];e(i,n,t),n+=i.nodeSize}}findDiffStart(e,t=0){return Ky(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Jy(this,e,t,n)}findIndex(e,t=-1){if(e==0)return Al(0,e);if(e==this.size)return Al(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,i=0;;n++){let a=this.child(n),o=i+a.nodeSize;if(o>=e)return o==e||t>0?Al(n+1,o):Al(n,i);i=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return Oe.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new Oe(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Oe.empty;let t,n=0;for(let i=0;i<e.length;i++){let a=e[i];n+=a.nodeSize,i&&a.isText&&e[i-1].sameMarkup(a)?(t||(t=e.slice(0,i)),t[t.length-1]=a.withText(t[t.length-1].text+a.text)):t&&t.push(a)}return new Oe(t||e,n)}static from(e){if(!e)return Oe.empty;if(e instanceof Oe)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Oe([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Oe.empty=new Oe([],0);const Tf={index:0,offset:0};function Al(r,e){return Tf.index=r,Tf.offset=e,Tf}function Zl(r,e){if(r===e)return!0;if(!(r&&typeof r=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(r);if(Array.isArray(e)!=t)return!1;if(t){if(r.length!=e.length)return!1;for(let n=0;n<r.length;n++)if(!Zl(r[n],e[n]))return!1}else{for(let n in r)if(!(n in e)||!Zl(r[n],e[n]))return!1;for(let n in e)if(!(n in r))return!1}return!0}let Pt=class fd{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let i=0;i<e.length;i++){let a=e[i];if(this.eq(a))return e;if(this.type.excludes(a.type))t||(t=e.slice(0,i));else{if(a.type.excludes(this.type))return e;!n&&a.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(a)}}return t||(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&&Zl(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 new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);let i=n.create(t.attrs);return n.checkAttrs(i.attrs),i}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(e){if(!e||Array.isArray(e)&&e.length==0)return fd.none;if(e instanceof fd)return[e];let t=e.slice();return t.sort((n,i)=>n.type.rank-i.type.rank),t}};Pt.none=[];class Ql extends Error{}class Ue{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=Xy(this.content,e+this.openStart,t);return n&&new Ue(n,this.openStart,this.openEnd)}removeBetween(e,t){return new Ue(Yy(this.content,e+this.openStart,t+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(e,t){if(!t)return Ue.empty;let n=t.openStart||0,i=t.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Ue(Oe.fromJSON(e,t.content),n,i)}static maxOpen(e,t=!0){let n=0,i=0;for(let a=e.firstChild;a&&!a.isLeaf&&(t||!a.type.spec.isolating);a=a.firstChild)n++;for(let a=e.lastChild;a&&!a.isLeaf&&(t||!a.type.spec.isolating);a=a.lastChild)i++;return new Ue(e,n,i)}}Ue.empty=new Ue(Oe.empty,0,0);function Yy(r,e,t){let{index:n,offset:i}=r.findIndex(e),a=r.maybeChild(n),{index:o,offset:s}=r.findIndex(t);if(i==e||a.isText){if(s!=t&&!r.child(o).isText)throw new RangeError("Removing non-flat range");return r.cut(0,e).append(r.cut(t))}if(n!=o)throw new RangeError("Removing non-flat range");return r.replaceChild(n,a.copy(Yy(a.content,e-i-1,t-i-1)))}function Xy(r,e,t,n){let{index:i,offset:a}=r.findIndex(e),o=r.maybeChild(i);if(a==e||o.isText)return r.cut(0,e).append(t).append(r.cut(e));let s=Xy(o.content,e-a-1,t);return s&&r.replaceChild(i,o.copy(s))}function eQ(r,e,t){if(t.openStart>r.depth)throw new Ql("Inserted content deeper than insertion position");if(r.depth-t.openStart!=e.depth-t.openEnd)throw new Ql("Inconsistent open depths");return Zy(r,e,t,0)}function Zy(r,e,t,n){let i=r.index(n),a=r.node(n);if(i==e.index(n)&&n<r.depth-t.openStart){let o=Zy(r,e,t,n+1);return a.copy(a.content.replaceChild(i,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&r.depth==n&&e.depth==n){let o=r.parent,s=o.content;return Ha(o,s.cut(0,r.parentOffset).append(t.content).append(s.cut(e.parentOffset)))}else{let{start:o,end:s}=tQ(t,r);return Ha(a,eb(r,o,s,e,n))}else return Ha(a,eu(r,e,n))}function Qy(r,e){if(!e.type.compatibleContent(r.type))throw new Ql("Cannot join "+e.type.name+" onto "+r.type.name)}function dd(r,e,t){let n=r.node(t);return Qy(n,e.node(t)),n}function qa(r,e){let t=e.length-1;t>=0&&r.isText&&r.sameMarkup(e[t])?e[t]=r.withText(e[t].text+r.text):e.push(r)}function ws(r,e,t,n){let i=(e||r).node(t),a=0,o=e?e.index(t):i.childCount;r&&(a=r.index(t),r.depth>t?a++:r.textOffset&&(qa(r.nodeAfter,n),a++));for(let s=a;s<o;s++)qa(i.child(s),n);e&&e.depth==t&&e.textOffset&&qa(e.nodeBefore,n)}function Ha(r,e){return r.type.checkContent(e),r.copy(e)}function eb(r,e,t,n,i){let a=r.depth>i&&dd(r,e,i+1),o=n.depth>i&&dd(t,n,i+1),s=[];return ws(null,r,i,s),a&&o&&e.index(i)==t.index(i)?(Qy(a,o),qa(Ha(a,eb(r,e,t,n,i+1)),s)):(a&&qa(Ha(a,eu(r,e,i+1)),s),ws(e,t,i,s),o&&qa(Ha(o,eu(t,n,i+1)),s)),ws(n,null,i,s),new Oe(s)}function eu(r,e,t){let n=[];if(ws(null,r,t,n),r.depth>t){let i=dd(r,e,t+1);qa(Ha(i,eu(r,e,t+1)),n)}return ws(e,null,t,n),new Oe(n)}function tQ(r,e){let t=e.depth-r.openStart,i=e.node(t).copy(r.content);for(let a=t-1;a>=0;a--)i=e.node(a).copy(Oe.from(i));return{start:i.resolveNoCache(r.openStart+t),end:i.resolveNoCache(i.content.size-r.openEnd-t)}}class Es{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 new 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 new 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],i=e.child(t);return n?e.child(t).cut(n):i}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],i=t==0?0:this.path[t*3-1]+1;for(let a=0;a<e;a++)i+=n.child(a).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Pt.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),i=e.maybeChild(t);if(!n){let s=n;n=i,i=s}let a=n.marks;for(var o=0;o<a.length;o++)a[o].type.spec.inclusive===!1&&(!i||!a[o].isInSet(i.marks))&&(a=a[o--].removeFromSet(a));return a}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,i=e.parent.maybeChild(e.index());for(var a=0;a<n.length;a++)n[a].type.spec.inclusive===!1&&(!i||!n[a].isInSet(i.marks))&&(n=n[a--].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 tu(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(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],i=0,a=t;for(let o=e;;){let{index:s,offset:l}=o.content.findIndex(a),f=a-l;if(n.push(o,s,i+l),!f||(o=o.child(s),o.isText))break;a=f-1,i+=l+1}return new Es(t,n,a)}static resolveCached(e,t){let n=kv.get(e);if(n)for(let a=0;a<n.elts.length;a++){let o=n.elts[a];if(o.pos==t)return o}else kv.set(e,n=new rQ);let i=n.elts[n.i]=Es.resolve(e,t);return n.i=(n.i+1)%nQ,i}}class rQ{constructor(){this.elts=[],this.i=0}}const nQ=12,kv=new WeakMap;class tu{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)}}const iQ=Object.create(null);let ra=class hd{constructor(e,t,n,i=Pt.none){this.type=e,this.attrs=t,this.marks=i,this.content=n||Oe.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,i=0){this.content.nodesBetween(e,t,n,i,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,i){return this.content.textBetween(e,t,n,i)}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&&Zl(this.attrs,t||e.defaultAttrs||iQ)&&Pt.sameSet(this.marks,n||Pt.none)}copy(e=null){return e==this.content?this:new hd(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new hd(this.type,this.attrs,this.content,e)}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 Ue.empty;let i=this.resolve(e),a=this.resolve(t),o=n?0:i.sharedDepth(t),s=i.start(o),f=i.node(o).content.cut(i.pos-s,a.pos-s);return new Ue(f,i.depth-o,a.depth-o)}replace(e,t,n){return eQ(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(i==e||t.isText)return t;e-=i+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 i=this.content.child(t-1);return{node:i,index:t-1,offset:n-i.nodeSize}}resolve(e){return Es.resolveCached(this,e)}resolveNoCache(e){return Es.resolve(this,e)}rangeHasMark(e,t,n){let i=!1;return t>e&&this.nodesBetween(e,t,a=>(n.isInSet(a.marks)&&(i=!0),!i)),i}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()+")"),tb(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=Oe.empty,i=0,a=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,i,a),s=o&&o.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let l=i;l<a;l++)if(!this.type.allowsMarks(n.child(l).marks))return!1;return!0}canReplaceWith(e,t,n,i){if(i&&!this.type.allowsMarks(i))return!1;let a=this.contentMatchAt(e).matchType(n),o=a&&a.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Pt.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!Pt.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.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(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let i=Oe.fromJSON(e,t.content),a=e.nodeType(t.type).create(t.attrs,i,n);return a.type.checkAttrs(a.attrs),a}};ra.prototype.text=void 0;class ru extends ra{constructor(e,t,n,i){if(super(e,t,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):tb(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(e){return e==this.marks?this:new ru(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ru(this.type,this.attrs,e,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 tb(r,e){for(let t=r.length-1;t>=0;t--)e=r[t].type.name+"("+e+")";return e}class Ua{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new aQ(e,t);if(n.next==null)return Ua.empty;let i=rb(n);n.next&&n.err("Unexpected trailing text");let a=dQ(fQ(i));return hQ(a,n),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 i=this;for(let a=t;i&&a<n;a++)i=i.matchType(e.child(a).type);return i}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 i=[this];function a(o,s){let l=o.matchFragment(e,n);if(l&&(!t||l.validEnd))return Oe.from(s.map(f=>f.createAndFill()));for(let f=0;f<o.next.length;f++){let{type:p,next:k}=o.next[f];if(!(p.isText||p.hasRequiredAttrs())&&i.indexOf(k)==-1){i.push(k);let T=a(k,s.concat(p));if(T)return T}}return null}return a(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+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 i=n.shift(),a=i.match;if(a.matchType(e)){let o=[];for(let s=i;s.type;s=s.via)o.push(s.type);return o.reverse()}for(let o=0;o<a.next.length;o++){let{type:s,next:l}=a.next[o];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in t)&&(!i.type||l.validEnd)&&(n.push({match:s.contentMatch,type:s,via:i}),t[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new 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 i=0;i<n.next.length;i++)e.indexOf(n.next[i].next)==-1&&t(n.next[i].next)}return t(this),e.map((n,i)=>{let a=i+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)a+=(o?", ":"")+n.next[o].type.name+"->"+e.indexOf(n.next[o].next);return a}).join(`
|
|
1
|
+
import{g as KZ,W as No,c as JZ,r as Cf,j as bv}from"./app.js";import{k as YZ,b as XZ}from"./index-Vcq4gwWv.js";import{u as ZZ}from"./use-window-size-DLSEoR6e.js";import{u as QZ}from"./use-appearance-J8J2w43p.js";function Or(r){this.content=r}Or.prototype={constructor:Or,find:function(r){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===r)return e;return-1},get:function(r){var e=this.find(r);return e==-1?void 0:this.content[e+1]},update:function(r,e,t){var n=t&&t!=r?this.remove(t):this,i=n.find(r),a=n.content.slice();return i==-1?a.push(t||r,e):(a[i+1]=e,t&&(a[i]=t)),new Or(a)},remove:function(r){var e=this.find(r);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Or(t)},addToStart:function(r,e){return new Or([r,e].concat(this.remove(r).content))},addToEnd:function(r,e){var t=this.remove(r).content.slice();return t.push(r,e),new Or(t)},addBefore:function(r,e,t){var n=this.remove(e),i=n.content.slice(),a=n.find(r);return i.splice(a==-1?i.length:a,0,e,t),new Or(i)},forEach:function(r){for(var e=0;e<this.content.length;e+=2)r(this.content[e],this.content[e+1])},prepend:function(r){return r=Or.from(r),r.size?new Or(r.content.concat(this.subtract(r).content)):this},append:function(r){return r=Or.from(r),r.size?new Or(this.subtract(r).content.concat(r.content)):this},subtract:function(r){var e=this;r=Or.from(r);for(var t=0;t<r.content.length;t+=2)e=e.remove(r.content[t]);return e},toObject:function(){var r={};return this.forEach(function(e,t){r[e]=t}),r},get size(){return this.content.length>>1}};Or.from=function(r){if(r instanceof Or)return r;var e=[];if(r)for(var t in r)e.push(t,r[t]);return new Or(e)};function Ky(r,e,t){for(let n=0;;n++){if(n==r.childCount||n==e.childCount)return r.childCount==e.childCount?null:t;let i=r.child(n),a=e.child(n);if(i==a){t+=i.nodeSize;continue}if(!i.sameMarkup(a))return t;if(i.isText&&i.text!=a.text){for(let o=0;i.text[o]==a.text[o];o++)t++;return t}if(i.content.size||a.content.size){let o=Ky(i.content,a.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function Jy(r,e,t,n){for(let i=r.childCount,a=e.childCount;;){if(i==0||a==0)return i==a?null:{a:t,b:n};let o=r.child(--i),s=e.child(--a),l=o.nodeSize;if(o==s){t-=l,n-=l;continue}if(!o.sameMarkup(s))return{a:t,b:n};if(o.isText&&o.text!=s.text){let f=0,p=Math.min(o.text.length,s.text.length);for(;f<p&&o.text[o.text.length-f-1]==s.text[s.text.length-f-1];)f++,t--,n--;return{a:t,b:n}}if(o.content.size||s.content.size){let f=Jy(o.content,s.content,t-1,n-1);if(f)return f}t-=l,n-=l}}class Oe{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,t,n,i=0,a){for(let o=0,s=0;s<t;o++){let l=this.content[o],f=s+l.nodeSize;if(f>e&&n(l,i+s,a||null,o)!==!1&&l.content.size){let p=s+1;l.nodesBetween(Math.max(0,e-p),Math.min(l.content.size,t-p),n,i+p)}s=f}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,i){let a="",o=!0;return this.nodesBetween(e,t,(s,l)=>{let f=s.isText?s.text.slice(Math.max(e,l)-l,t-l):s.isLeaf?i?typeof i=="function"?i(s):i:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&f||s.isTextblock)&&n&&(o?o=!1:a+=n),a+=f},0),a}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,i=this.content.slice(),a=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),a=1);a<e.content.length;a++)i.push(e.content[a]);return new Oe(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let n=[],i=0;if(t>e)for(let a=0,o=0;o<t;a++){let s=this.content[a],l=o+s.nodeSize;l>e&&((o<e||l>t)&&(s.isText?s=s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s=s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),i+=s.nodeSize),o=l}return new Oe(n,i)}cutByIndex(e,t){return e==t?Oe.empty:e==0&&t==this.content.length?this:new Oe(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let i=this.content.slice(),a=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new Oe(i,a)}addToStart(e){return new Oe([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Oe(this.content.concat(e),this.size+e.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 new 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 i=this.content[t];e(i,n,t),n+=i.nodeSize}}findDiffStart(e,t=0){return Ky(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Jy(this,e,t,n)}findIndex(e,t=-1){if(e==0)return Al(0,e);if(e==this.size)return Al(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,i=0;;n++){let a=this.child(n),o=i+a.nodeSize;if(o>=e)return o==e||t>0?Al(n+1,o):Al(n,i);i=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return Oe.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new Oe(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Oe.empty;let t,n=0;for(let i=0;i<e.length;i++){let a=e[i];n+=a.nodeSize,i&&a.isText&&e[i-1].sameMarkup(a)?(t||(t=e.slice(0,i)),t[t.length-1]=a.withText(t[t.length-1].text+a.text)):t&&t.push(a)}return new Oe(t||e,n)}static from(e){if(!e)return Oe.empty;if(e instanceof Oe)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Oe([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Oe.empty=new Oe([],0);const Tf={index:0,offset:0};function Al(r,e){return Tf.index=r,Tf.offset=e,Tf}function Zl(r,e){if(r===e)return!0;if(!(r&&typeof r=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(r);if(Array.isArray(e)!=t)return!1;if(t){if(r.length!=e.length)return!1;for(let n=0;n<r.length;n++)if(!Zl(r[n],e[n]))return!1}else{for(let n in r)if(!(n in e)||!Zl(r[n],e[n]))return!1;for(let n in e)if(!(n in r))return!1}return!0}let Pt=class fd{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let i=0;i<e.length;i++){let a=e[i];if(this.eq(a))return e;if(this.type.excludes(a.type))t||(t=e.slice(0,i));else{if(a.type.excludes(this.type))return e;!n&&a.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(a)}}return t||(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&&Zl(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 new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);let i=n.create(t.attrs);return n.checkAttrs(i.attrs),i}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(e){if(!e||Array.isArray(e)&&e.length==0)return fd.none;if(e instanceof fd)return[e];let t=e.slice();return t.sort((n,i)=>n.type.rank-i.type.rank),t}};Pt.none=[];class Ql extends Error{}class Ue{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=Xy(this.content,e+this.openStart,t);return n&&new Ue(n,this.openStart,this.openEnd)}removeBetween(e,t){return new Ue(Yy(this.content,e+this.openStart,t+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(e,t){if(!t)return Ue.empty;let n=t.openStart||0,i=t.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Ue(Oe.fromJSON(e,t.content),n,i)}static maxOpen(e,t=!0){let n=0,i=0;for(let a=e.firstChild;a&&!a.isLeaf&&(t||!a.type.spec.isolating);a=a.firstChild)n++;for(let a=e.lastChild;a&&!a.isLeaf&&(t||!a.type.spec.isolating);a=a.lastChild)i++;return new Ue(e,n,i)}}Ue.empty=new Ue(Oe.empty,0,0);function Yy(r,e,t){let{index:n,offset:i}=r.findIndex(e),a=r.maybeChild(n),{index:o,offset:s}=r.findIndex(t);if(i==e||a.isText){if(s!=t&&!r.child(o).isText)throw new RangeError("Removing non-flat range");return r.cut(0,e).append(r.cut(t))}if(n!=o)throw new RangeError("Removing non-flat range");return r.replaceChild(n,a.copy(Yy(a.content,e-i-1,t-i-1)))}function Xy(r,e,t,n){let{index:i,offset:a}=r.findIndex(e),o=r.maybeChild(i);if(a==e||o.isText)return r.cut(0,e).append(t).append(r.cut(e));let s=Xy(o.content,e-a-1,t);return s&&r.replaceChild(i,o.copy(s))}function eQ(r,e,t){if(t.openStart>r.depth)throw new Ql("Inserted content deeper than insertion position");if(r.depth-t.openStart!=e.depth-t.openEnd)throw new Ql("Inconsistent open depths");return Zy(r,e,t,0)}function Zy(r,e,t,n){let i=r.index(n),a=r.node(n);if(i==e.index(n)&&n<r.depth-t.openStart){let o=Zy(r,e,t,n+1);return a.copy(a.content.replaceChild(i,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&r.depth==n&&e.depth==n){let o=r.parent,s=o.content;return Ha(o,s.cut(0,r.parentOffset).append(t.content).append(s.cut(e.parentOffset)))}else{let{start:o,end:s}=tQ(t,r);return Ha(a,eb(r,o,s,e,n))}else return Ha(a,eu(r,e,n))}function Qy(r,e){if(!e.type.compatibleContent(r.type))throw new Ql("Cannot join "+e.type.name+" onto "+r.type.name)}function dd(r,e,t){let n=r.node(t);return Qy(n,e.node(t)),n}function qa(r,e){let t=e.length-1;t>=0&&r.isText&&r.sameMarkup(e[t])?e[t]=r.withText(e[t].text+r.text):e.push(r)}function ws(r,e,t,n){let i=(e||r).node(t),a=0,o=e?e.index(t):i.childCount;r&&(a=r.index(t),r.depth>t?a++:r.textOffset&&(qa(r.nodeAfter,n),a++));for(let s=a;s<o;s++)qa(i.child(s),n);e&&e.depth==t&&e.textOffset&&qa(e.nodeBefore,n)}function Ha(r,e){return r.type.checkContent(e),r.copy(e)}function eb(r,e,t,n,i){let a=r.depth>i&&dd(r,e,i+1),o=n.depth>i&&dd(t,n,i+1),s=[];return ws(null,r,i,s),a&&o&&e.index(i)==t.index(i)?(Qy(a,o),qa(Ha(a,eb(r,e,t,n,i+1)),s)):(a&&qa(Ha(a,eu(r,e,i+1)),s),ws(e,t,i,s),o&&qa(Ha(o,eu(t,n,i+1)),s)),ws(n,null,i,s),new Oe(s)}function eu(r,e,t){let n=[];if(ws(null,r,t,n),r.depth>t){let i=dd(r,e,t+1);qa(Ha(i,eu(r,e,t+1)),n)}return ws(e,null,t,n),new Oe(n)}function tQ(r,e){let t=e.depth-r.openStart,i=e.node(t).copy(r.content);for(let a=t-1;a>=0;a--)i=e.node(a).copy(Oe.from(i));return{start:i.resolveNoCache(r.openStart+t),end:i.resolveNoCache(i.content.size-r.openEnd-t)}}class Es{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 new 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 new 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],i=e.child(t);return n?e.child(t).cut(n):i}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],i=t==0?0:this.path[t*3-1]+1;for(let a=0;a<e;a++)i+=n.child(a).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Pt.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),i=e.maybeChild(t);if(!n){let s=n;n=i,i=s}let a=n.marks;for(var o=0;o<a.length;o++)a[o].type.spec.inclusive===!1&&(!i||!a[o].isInSet(i.marks))&&(a=a[o--].removeFromSet(a));return a}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,i=e.parent.maybeChild(e.index());for(var a=0;a<n.length;a++)n[a].type.spec.inclusive===!1&&(!i||!n[a].isInSet(i.marks))&&(n=n[a--].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 tu(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(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],i=0,a=t;for(let o=e;;){let{index:s,offset:l}=o.content.findIndex(a),f=a-l;if(n.push(o,s,i+l),!f||(o=o.child(s),o.isText))break;a=f-1,i+=l+1}return new Es(t,n,a)}static resolveCached(e,t){let n=kv.get(e);if(n)for(let a=0;a<n.elts.length;a++){let o=n.elts[a];if(o.pos==t)return o}else kv.set(e,n=new rQ);let i=n.elts[n.i]=Es.resolve(e,t);return n.i=(n.i+1)%nQ,i}}class rQ{constructor(){this.elts=[],this.i=0}}const nQ=12,kv=new WeakMap;class tu{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)}}const iQ=Object.create(null);let ra=class hd{constructor(e,t,n,i=Pt.none){this.type=e,this.attrs=t,this.marks=i,this.content=n||Oe.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,i=0){this.content.nodesBetween(e,t,n,i,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,i){return this.content.textBetween(e,t,n,i)}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&&Zl(this.attrs,t||e.defaultAttrs||iQ)&&Pt.sameSet(this.marks,n||Pt.none)}copy(e=null){return e==this.content?this:new hd(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new hd(this.type,this.attrs,this.content,e)}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 Ue.empty;let i=this.resolve(e),a=this.resolve(t),o=n?0:i.sharedDepth(t),s=i.start(o),f=i.node(o).content.cut(i.pos-s,a.pos-s);return new Ue(f,i.depth-o,a.depth-o)}replace(e,t,n){return eQ(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(i==e||t.isText)return t;e-=i+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 i=this.content.child(t-1);return{node:i,index:t-1,offset:n-i.nodeSize}}resolve(e){return Es.resolveCached(this,e)}resolveNoCache(e){return Es.resolve(this,e)}rangeHasMark(e,t,n){let i=!1;return t>e&&this.nodesBetween(e,t,a=>(n.isInSet(a.marks)&&(i=!0),!i)),i}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()+")"),tb(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=Oe.empty,i=0,a=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,i,a),s=o&&o.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let l=i;l<a;l++)if(!this.type.allowsMarks(n.child(l).marks))return!1;return!0}canReplaceWith(e,t,n,i){if(i&&!this.type.allowsMarks(i))return!1;let a=this.contentMatchAt(e).matchType(n),o=a&&a.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Pt.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!Pt.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.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(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let i=Oe.fromJSON(e,t.content),a=e.nodeType(t.type).create(t.attrs,i,n);return a.type.checkAttrs(a.attrs),a}};ra.prototype.text=void 0;class ru extends ra{constructor(e,t,n,i){if(super(e,t,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):tb(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(e){return e==this.marks?this:new ru(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ru(this.type,this.attrs,e,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 tb(r,e){for(let t=r.length-1;t>=0;t--)e=r[t].type.name+"("+e+")";return e}class Ua{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new aQ(e,t);if(n.next==null)return Ua.empty;let i=rb(n);n.next&&n.err("Unexpected trailing text");let a=dQ(fQ(i));return hQ(a,n),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 i=this;for(let a=t;i&&a<n;a++)i=i.matchType(e.child(a).type);return i}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 i=[this];function a(o,s){let l=o.matchFragment(e,n);if(l&&(!t||l.validEnd))return Oe.from(s.map(f=>f.createAndFill()));for(let f=0;f<o.next.length;f++){let{type:p,next:k}=o.next[f];if(!(p.isText||p.hasRequiredAttrs())&&i.indexOf(k)==-1){i.push(k);let T=a(k,s.concat(p));if(T)return T}}return null}return a(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+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 i=n.shift(),a=i.match;if(a.matchType(e)){let o=[];for(let s=i;s.type;s=s.via)o.push(s.type);return o.reverse()}for(let o=0;o<a.next.length;o++){let{type:s,next:l}=a.next[o];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in t)&&(!i.type||l.validEnd)&&(n.push({match:s.contentMatch,type:s,via:i}),t[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new 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 i=0;i<n.next.length;i++)e.indexOf(n.next[i].next)==-1&&t(n.next[i].next)}return t(this),e.map((n,i)=>{let a=i+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)a+=(o?", ":"")+n.next[o].type.name+"->"+e.indexOf(n.next[o].next);return a}).join(`
|
|
2
2
|
`)}}Ua.empty=new Ua(!0);class aQ{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 new SyntaxError(e+" (in content expression '"+this.string+"')")}}function rb(r){let e=[];do e.push(oQ(r));while(r.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function oQ(r){let e=[];do e.push(sQ(r));while(r.next&&r.next!=")"&&r.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function sQ(r){let e=cQ(r);for(;;)if(r.eat("+"))e={type:"plus",expr:e};else if(r.eat("*"))e={type:"star",expr:e};else if(r.eat("?"))e={type:"opt",expr:e};else if(r.eat("{"))e=lQ(r,e);else break;return e}function wv(r){/\D/.test(r.next)&&r.err("Expected number, got '"+r.next+"'");let e=Number(r.next);return r.pos++,e}function lQ(r,e){let t=wv(r),n=t;return r.eat(",")&&(r.next!="}"?n=wv(r):n=-1),r.eat("}")||r.err("Unclosed braced range"),{type:"range",min:t,max:n,expr:e}}function uQ(r,e){let t=r.nodeTypes,n=t[e];if(n)return[n];let i=[];for(let a in t){let o=t[a];o.isInGroup(e)&&i.push(o)}return i.length==0&&r.err("No node type or group '"+e+"' found"),i}function cQ(r){if(r.eat("(")){let e=rb(r);return r.eat(")")||r.err("Missing closing paren"),e}else if(/\W/.test(r.next))r.err("Unexpected token '"+r.next+"'");else{let e=uQ(r,r.next).map(t=>(r.inline==null?r.inline=t.isInline:r.inline!=t.isInline&&r.err("Mixing inline and block content"),{type:"name",value:t}));return r.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function fQ(r){let e=[[]];return i(a(r,0),t()),e;function t(){return e.push([])-1}function n(o,s,l){let f={term:l,to:s};return e[o].push(f),f}function i(o,s){o.forEach(l=>l.to=s)}function a(o,s){if(o.type=="choice")return o.exprs.reduce((l,f)=>l.concat(a(f,s)),[]);if(o.type=="seq")for(let l=0;;l++){let f=a(o.exprs[l],s);if(l==o.exprs.length-1)return f;i(f,s=t())}else if(o.type=="star"){let l=t();return n(s,l),i(a(o.expr,l),l),[n(l)]}else if(o.type=="plus"){let l=t();return i(a(o.expr,s),l),i(a(o.expr,l),l),[n(l)]}else{if(o.type=="opt")return[n(s)].concat(a(o.expr,s));if(o.type=="range"){let l=s;for(let f=0;f<o.min;f++){let p=t();i(a(o.expr,l),p),l=p}if(o.max==-1)i(a(o.expr,l),l);else for(let f=o.min;f<o.max;f++){let p=t();n(l,p),i(a(o.expr,l),p),l=p}return[n(l)]}else{if(o.type=="name")return[n(s,void 0,o.value)];throw new Error("Unknown expr type")}}}}function nb(r,e){return e-r}function Cv(r,e){let t=[];return n(e),t.sort(nb);function n(i){let a=r[i];if(a.length==1&&!a[0].term)return n(a[0].to);t.push(i);for(let o=0;o<a.length;o++){let{term:s,to:l}=a[o];!s&&t.indexOf(l)==-1&&n(l)}}}function dQ(r){let e=Object.create(null);return t(Cv(r,0));function t(n){let i=[];n.forEach(o=>{r[o].forEach(({term:s,to:l})=>{if(!s)return;let f;for(let p=0;p<i.length;p++)i[p][0]==s&&(f=i[p][1]);Cv(r,l).forEach(p=>{f||i.push([s,f=[]]),f.indexOf(p)==-1&&f.push(p)})})});let a=e[n.join(",")]=new Ua(n.indexOf(r.length-1)>-1);for(let o=0;o<i.length;o++){let s=i[o][1].sort(nb);a.next.push({type:i[o][0],next:e[s.join(",")]||t(s)})}return a}}function hQ(r,e){for(let t=0,n=[r];t<n.length;t++){let i=n[t],a=!i.validEnd,o=[];for(let s=0;s<i.next.length;s++){let{type:l,next:f}=i.next[s];o.push(l.name),a&&!(l.isText||l.hasRequiredAttrs())&&(a=!1),n.indexOf(f)==-1&&n.push(f)}a&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function ib(r){let e=Object.create(null);for(let t in r){let n=r[t];if(!n.hasDefault)return null;e[t]=n.default}return e}function ab(r,e){let t=Object.create(null);for(let n in r){let i=e&&e[n];if(i===void 0){let a=r[n];if(a.hasDefault)i=a.default;else throw new RangeError("No value supplied for attribute "+n)}t[n]=i}return t}function ob(r,e,t,n){for(let i in e)if(!(i in r))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${i}`);for(let i in r){let a=r[i];a.validate&&a.validate(e[i])}}function sb(r,e){let t=Object.create(null);if(e)for(let n in e)t[n]=new vQ(r,n,e[n]);return t}let Tv=class lb{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=sb(e,n.attrs),this.defaultAttrs=ib(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==Ua.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:ab(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new ra(this,this.computeAttrs(e),Oe.from(t),Pt.setFrom(n))}createChecked(e=null,t,n){return t=Oe.from(t),this.checkContent(t),new ra(this,this.computeAttrs(e),t,Pt.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=Oe.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let i=this.contentMatch.matchFragment(t),a=i&&i.fillBefore(Oe.empty,!0);return a?new ra(this,e,t.append(a),Pt.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){ob(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:Pt.none:e}static compile(e,t){let n=Object.create(null);e.forEach((a,o)=>n[a]=new lb(a,t,o));let i=t.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let a in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};function pQ(r,e,t){let n=t.split("|");return i=>{let a=i===null?"null":typeof i;if(n.indexOf(a)<0)throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${r}, got ${a}`)}}class vQ{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?pQ(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class Mu{constructor(e,t,n,i){this.name=e,this.rank=t,this.schema=n,this.spec=i,this.attrs=sb(e,i.attrs),this.excluded=null;let a=ib(this.attrs);this.instance=a?new Pt(this,a):null}create(e=null){return!e&&this.instance?this.instance:new Pt(this,ab(this.attrs,e))}static compile(e,t){let n=Object.create(null),i=0;return e.forEach((a,o)=>n[a]=new Mu(a,i++,t,o)),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){ob(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class ub{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=Or.from(e.nodes),t.marks=Or.from(e.marks||{}),this.nodes=Tv.compile(this.spec.nodes,this),this.marks=Mu.compile(this.spec.marks,this);let n=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let a=this.nodes[i],o=a.spec.content||"",s=a.spec.marks;if(a.contentMatch=n[o]||(n[o]=Ua.parse(o,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!a.isInline||!a.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=a}a.markSet=s=="_"?null:s?Sv(this,s.split(" ")):s==""||!a.inlineContent?[]:null}for(let i in this.marks){let a=this.marks[i],o=a.spec.excludes;a.excluded=o==null?[a]:o==""?[]:Sv(this,o.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Tv){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,n,i)}text(e,t){let n=this.nodes.text;return new ru(n,n.defaultAttrs,e,Pt.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return ra.fromJSON(this,e)}markFromJSON(e){return Pt.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Sv(r,e){let t=[];for(let n=0;n<e.length;n++){let i=e[n],a=r.marks[i],o=a;if(a)t.push(a);else for(let s in r.marks){let l=r.marks[s];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&t.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return t}function mQ(r){return r.tag!=null}function gQ(r){return r.style!=null}class $a{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(i=>{if(mQ(i))this.tags.push(i);else if(gQ(i)){let a=/[^=]*/.exec(i.style)[0];n.indexOf(a)<0&&n.push(a),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let a=e.nodes[i.node];return a.contentMatch.matchType(a)})}parse(e,t={}){let n=new Ev(this,t,!1);return n.addAll(e,Pt.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Ev(this,t,!0);return n.addAll(e,Pt.none,t.from,t.to),Ue.maxOpen(n.finish())}matchTag(e,t,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){let a=this.tags[i];if(kQ(e,a.tag)&&(a.namespace===void 0||e.namespaceURI==a.namespace)&&(!a.context||t.matchesContext(a.context))){if(a.getAttrs){let o=a.getAttrs(e);if(o===!1)continue;a.attrs=o||void 0}return a}}}matchStyle(e,t,n,i){for(let a=i?this.styles.indexOf(i)+1:0;a<this.styles.length;a++){let o=this.styles[a],s=o.style;if(!(s.indexOf(e)!=0||o.context&&!n.matchesContext(o.context)||s.length>e.length&&(s.charCodeAt(e.length)!=61||s.slice(e.length+1)!=t))){if(o.getAttrs){let l=o.getAttrs(t);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let t=[];function n(i){let a=i.priority==null?50:i.priority,o=0;for(;o<t.length;o++){let s=t[o];if((s.priority==null?50:s.priority)<a)break}t.splice(o,0,i)}for(let i in e.marks){let a=e.marks[i].spec.parseDOM;a&&a.forEach(o=>{n(o=Mv(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let a=e.nodes[i].spec.parseDOM;a&&a.forEach(o=>{n(o=Mv(o)),o.node||o.ignore||o.mark||(o.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new $a(e,$a.schemaRules(e)))}}const cb={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},yQ={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},fb={ol:!0,ul:!0},Ms=1,pd=2,zl=4;function xv(r,e,t){return e!=null?(e?Ms:0)|(e==="full"?pd:0):r&&r.whitespace=="pre"?Ms|pd:t&-5}class Ol{constructor(e,t,n,i,a,o){this.type=e,this.attrs=t,this.marks=n,this.solid=i,this.options=o,this.content=[],this.activeMarks=Pt.none,this.match=a||(o&zl?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(Oe.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(e.type))?(this.match=n,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Ms)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let a=n;n.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=a.withText(a.text.slice(0,a.text.length-i[0].length))}}let t=Oe.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(Oe.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&&!cb.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Ev{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let i=t.topNode,a,o=xv(null,t.preserveWhitespace,0)|(n?zl:0);i?a=new Ol(i.type,i.attrs,Pt.none,!0,t.topMatch||i.type.contentMatch,o):n?a=new Ol(null,null,Pt.none,!0,null,o):a=new Ol(e.schema.topNodeType,null,Pt.none,!0,null,o),this.nodes=[a],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,i=this.top,a=i.options&pd?"full":this.localPreserveWS||(i.options&Ms)>0;if(a==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(a)a!=="full"?n=n.replace(/\r?\n|\r/g," "):n=n.replace(/\r\n?/g,`
|
|
3
3
|
`);else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let o=i.content[i.content.length-1],s=e.previousSibling;(!o||s&&s.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let i=this.localPreserveWS,a=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),s;fb.hasOwnProperty(o)&&this.parser.normalizeLists&&bQ(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(s=this.parser.matchTag(e,this,n));e:if(l?l.ignore:yQ.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let f,p=this.needsBlock;if(cb.hasOwnProperty(o))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),f=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let k=l&&l.skip?t:this.readStyles(e,t);k&&this.addAll(e,k),f&&this.sync(a),this.needsBlock=p}else{let f=this.readStyles(e,t);f&&this.addElementByRule(e,l,f,l.consuming===!1?s:void 0)}this.localPreserveWS=i}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 i=0;i<this.parser.matchedStyles.length;i++){let a=this.parser.matchedStyles[i],o=n.getPropertyValue(a);if(o)for(let s=void 0;;){let l=this.parser.matchStyle(a,o,this,s);if(!l)break;if(l.ignore)return null;if(l.clearMark?t=t.filter(f=>!l.clearMark(f)):t=t.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)s=l;else break}}return t}addElementByRule(e,t,n,i){let a,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),n,e.nodeName=="BR")||this.leafFallback(e,n);else{let l=this.enter(o,t.attrs||null,n,t.preserveWhitespace);l&&(a=!0,n=l)}else{let l=this.parser.schema.marks[t.mark];n=n.concat(l.create(t.attrs))}let s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,n,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,n,!1));else{let l=e;typeof t.contentElement=="string"?l=e.querySelector(t.contentElement):typeof t.contentElement=="function"?l=t.contentElement(e):t.contentElement&&(l=t.contentElement),this.findAround(e,l,!0),this.addAll(l,n),this.findAround(e,l,!1)}a&&this.sync(s)&&this.open--}addAll(e,t,n,i){let a=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=i==null?null:e.childNodes[i];o!=s;o=o.nextSibling,++a)this.findAtPoint(e,a),this.addDOM(o,t);this.findAtPoint(e,a)}findPlace(e,t,n){let i,a;for(let o=this.open,s=0;o>=0;o--){let l=this.nodes[o],f=l.findWrapping(e);if(f&&(!i||i.length>f.length+s)&&(i=f,a=l,!f.length))break;if(l.solid){if(n)break;s+=2}}if(!i)return null;this.sync(a);for(let o=0;o<i.length;o++)t=this.enterInner(i[o],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let a=this.textblockFromContext();a&&(t=this.enterInner(a,null,t))}let i=this.findPlace(e,t,n);if(i){this.closeExtra();let a=this.top;a.match&&(a.match=a.match.matchType(e.type));let o=Pt.none;for(let s of i.concat(e.marks))(a.type?a.type.allowsMarkType(s.type):Av(s.type,e.type))&&(o=s.addToSet(o));return a.content.push(e.mark(o)),!0}return!1}enter(e,t,n,i){let a=this.findPlace(e.create(t),n,!1);return a&&(a=this.enterInner(e,t,n,!0,i)),a}enterInner(e,t,n,i=!1,a){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let s=xv(e,a,o.options);o.options&zl&&o.content.length==0&&(s|=zl);let l=Pt.none;return n=n.filter(f=>(o.type?o.type.allowsMarkType(f.type):Av(f.type,e))?(l=f.addToSet(l),!1):!0),this.nodes.push(new Ol(e,t,l,i,null,s)),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;this.localPreserveWS&&(this.nodes[t].options|=Ms)}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 i=n.length-1;i>=0;i--)e+=n[i].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 i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].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,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),a=-(n?n.depth+1:0)+(i?0:1),o=(s,l)=>{for(;s>=0;s--){let f=t[s];if(f==""){if(s==t.length-1||s==0)continue;for(;l>=a;l--)if(o(s-1,l))return!0;return!1}else{let p=l>0||l==0&&i?this.nodes[l].type:n&&l>=a?n.node(l-a).type:null;if(!p||p.name!=f&&!p.isInGroup(f))return!1;l--}}return!0};return o(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 t in this.parser.schema.nodes){let n=this.parser.schema.nodes[t];if(n.isTextblock&&n.defaultAttrs)return n}}}function bQ(r){for(let e=r.firstChild,t=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&fb.hasOwnProperty(n)&&t?(t.appendChild(e),e=t):n=="li"?t=e:n&&(t=null)}}function kQ(r,e){return(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,e)}function Mv(r){let e={};for(let t in r)e[t]=r[t];return e}function Av(r,e){let t=e.schema.nodes;for(let n in t){let i=t[n];if(!i.allowsMarkType(r))continue;let a=[],o=s=>{a.push(s);for(let l=0;l<s.edgeCount;l++){let{type:f,next:p}=s.edge(l);if(f==e||a.indexOf(p)<0&&o(p))return!0}};if(o(i.contentMatch))return!0}}class Jo{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=Sf(t).createDocumentFragment());let i=n,a=[];return e.forEach(o=>{if(a.length||o.marks.length){let s=0,l=0;for(;s<a.length&&l<o.marks.length;){let f=o.marks[l];if(!this.marks[f.type.name]){l++;continue}if(!f.eq(a[s][0])||f.type.spec.spanning===!1)break;s++,l++}for(;s<a.length;)i=a.pop()[1];for(;l<o.marks.length;){let f=o.marks[l++],p=this.serializeMark(f,o.isInline,t);p&&(a.push([f,i]),i.appendChild(p.dom),i=p.contentDOM||p.dom)}}i.appendChild(this.serializeNodeInner(o,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:i}=Vl(Sf(t),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let a=this.serializeMark(e.marks[i],e.isInline,t);a&&((a.contentDOM||a.dom).appendChild(n),n=a.dom)}return n}serializeMark(e,t,n={}){let i=this.marks[e.type.name];return i&&Vl(Sf(n),i(e,t),null,e.attrs)}static renderSpec(e,t,n=null,i){return Vl(e,t,n,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Jo(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Ov(e.nodes);return t.text||(t.text=n=>n.text),t}static marksFromSchema(e){return Ov(e.marks)}}function Ov(r){let e={};for(let t in r){let n=r[t].spec.toDOM;n&&(e[t]=n)}return e}function Sf(r){return r.document||window.document}const Nv=new WeakMap;function wQ(r){let e=Nv.get(r);return e===void 0&&Nv.set(r,e=CQ(r)),e}function CQ(r){let e=null;function t(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")e||(e=[]),e.push(n);else for(let i=0;i<n.length;i++)t(n[i]);else for(let i in n)t(n[i])}return t(r),e}function Vl(r,e,t,n){if(typeof e=="string")return{dom:r.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],a;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(n&&(a=wQ(n))&&a.indexOf(e)>-1)throw new 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&&(t=i.slice(0,o),i=i.slice(o+1));let s,l=t?r.createElementNS(t,i):r.createElement(i),f=e[1],p=1;if(f&&typeof f=="object"&&f.nodeType==null&&!Array.isArray(f)){p=2;for(let k in f)if(f[k]!=null){let T=k.indexOf(" ");T>0?l.setAttributeNS(k.slice(0,T),k.slice(T+1),f[k]):l.setAttribute(k,f[k])}}for(let k=p;k<e.length;k++){let T=e[k];if(T===0){if(k<e.length-1||k>p)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:x,contentDOM:E}=Vl(r,T,t,n);if(l.appendChild(x),E){if(s)throw new RangeError("Multiple content holes");s=E}}}return{dom:l,contentDOM:s}}const db=65535,hb=Math.pow(2,16);function TQ(r,e){return r+e*hb}function Dv(r){return r&db}function SQ(r){return(r-(r&db))/hb}const pb=1,vb=2,Ul=4,mb=8;class vd{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&mb)>0}get deletedBefore(){return(this.delInfo&(pb|Ul))>0}get deletedAfter(){return(this.delInfo&(vb|Ul))>0}get deletedAcross(){return(this.delInfo&Ul)>0}}class un{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&un.empty)return un.empty}recover(e){let t=0,n=Dv(e);if(!this.inverted)for(let i=0;i<n;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[n*3]+t+SQ(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 i=0,a=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?i:0);if(l>e)break;let f=this.ranges[s+a],p=this.ranges[s+o],k=l+f;if(e<=k){let T=f?e==l?-1:e==k?1:t:t,x=l+i+(T<0?0:p);if(n)return x;let E=e==(t<0?l:k)?null:TQ(s/3,e-l),P=e==l?vb:e==k?pb:Ul;return(t<0?e!=l:e!=k)&&(P|=mb),new vd(x,P,E)}i+=p-f}return n?e+i:new vd(e+i,0,null)}touches(e,t){let n=0,i=Dv(t),a=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?n:0);if(l>e)break;let f=this.ranges[s+a],p=l+f;if(e<=p&&s==i*3)return!0;n+=this.ranges[s+o]-f}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,a=0;i<this.ranges.length;i+=3){let o=this.ranges[i],s=o-(this.inverted?a:0),l=o+(this.inverted?0:a),f=this.ranges[i+t],p=this.ranges[i+n];e(s,s+f,l,l+p),a+=p-f}}invert(){return new un(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?un.empty:new un(e<0?[0,-e,0]:[0,0,e])}}un.empty=new un([]);class As{constructor(e,t,n=0,i=e?e.length:0){this.mirror=t,this.from=n,this.to=i,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new As(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!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 i=e.getMirror(t);this.appendMap(e._maps[t],i!=null&&i<t?n+i: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=[]),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 i=e.getMirror(t);this.appendMap(e._maps[t].invert(),i!=null&&i>t?n-i-1:void 0)}}invert(){let e=new As;return e.appendMappingInverted(this),e}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 i=0;for(let a=this.from;a<this.to;a++){let o=this._maps[a],s=o.mapResult(e,t);if(s.recover!=null){let l=this.getMirror(a);if(l!=null&&l>a&&l<this.to){a=l,e=this._maps[l].recover(s.recover);continue}}i|=s.delInfo,e=s.pos}return n?e:new vd(e,i,null)}}const xf=Object.create(null);class Ur{getMap(){return un.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=xf[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in xf)throw new RangeError("Duplicate use of step JSON ID "+e);return xf[e]=t,t.prototype.jsonID=e,t}}class hr{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new hr(e,null)}static fail(e){return new hr(null,e)}static fromReplace(e,t,n,i){try{return hr.ok(e.replace(t,n,i))}catch(a){if(a instanceof Ql)return hr.fail(a.message);throw a}}}function eh(r,e,t){let n=[];for(let i=0;i<r.childCount;i++){let a=r.child(i);a.content.size&&(a=a.copy(eh(a.content,e,a))),a.isInline&&(a=e(a,t,i)),n.push(a)}return Oe.fromArray(n)}class Qi extends Ur{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),i=n.node(n.sharedDepth(this.to)),a=new Ue(eh(t.content,(o,s)=>!o.isAtom||!s.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),t.openStart,t.openEnd);return hr.fromReplace(e,this.from,this.to,a)}invert(){return new oi(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Qi(t.pos,n.pos,this.mark)}merge(e){return e instanceof Qi&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Qi(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Qi(t.from,t.to,e.markFromJSON(t.mark))}}Ur.jsonID("addMark",Qi);class oi extends Ur{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 Ue(eh(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return hr.fromReplace(e,this.from,this.to,n)}invert(){return new Qi(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new oi(t.pos,n.pos,this.mark)}merge(e){return e instanceof oi&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new oi(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new oi(t.from,t.to,e.markFromJSON(t.mark))}}Ur.jsonID("removeMark",oi);class ea extends Ur{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return hr.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return hr.fromReplace(e,this.pos,this.pos+1,new Ue(Oe.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let n=this.mark.addToSet(t.marks);if(n.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(n))return new ea(this.pos,t.marks[i]);return new ea(this.pos,this.mark)}}return new Wa(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ea(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new ea(t.pos,e.markFromJSON(t.mark))}}Ur.jsonID("addNodeMark",ea);class Wa extends Ur{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return hr.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return hr.fromReplace(e,this.pos,this.pos+1,new Ue(Oe.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new ea(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Wa(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Wa(t.pos,e.markFromJSON(t.mark))}}Ur.jsonID("removeNodeMark",Wa);class _r extends Ur{constructor(e,t,n,i=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=i}apply(e){return this.structure&&md(e,this.from,this.to)?hr.fail("Structure replace would overwrite content"):hr.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new un([this.from,this.to-this.from,this.slice.size])}invert(e){return new _r(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new _r(t.pos,Math.max(t.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof _r)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?Ue.empty:new Ue(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new _r(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?Ue.empty:new Ue(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new _r(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new _r(t.from,t.to,Ue.fromJSON(e,t.slice),!!t.structure)}}Ur.jsonID("replace",_r);class Sr extends Ur{constructor(e,t,n,i,a,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=i,this.slice=a,this.insert=o,this.structure=s}apply(e){if(this.structure&&(md(e,this.from,this.gapFrom)||md(e,this.gapTo,this.to)))return hr.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return hr.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?hr.fromReplace(e,this.from,this.to,n):hr.fail("Content does not fit in gap")}getMap(){return new un([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new Sr(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),a=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||i<t.pos||a>n.pos?null:new Sr(t.pos,n.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(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Sr(t.from,t.to,t.gapFrom,t.gapTo,Ue.fromJSON(e,t.slice),t.insert,!!t.structure)}}Ur.jsonID("replaceAround",Sr);function md(r,e,t){let n=r.resolve(e),i=t-e,a=n.depth;for(;i>0&&a>0&&n.indexAfter(a)==n.node(a).childCount;)a--,i--;if(i>0){let o=n.node(a).maybeChild(n.indexAfter(a));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function xQ(r,e,t,n){let i=[],a=[],o,s;r.doc.nodesBetween(e,t,(l,f,p)=>{if(!l.isInline)return;let k=l.marks;if(!n.isInSet(k)&&p.type.allowsMarkType(n.type)){let T=Math.max(f,e),x=Math.min(f+l.nodeSize,t),E=n.addToSet(k);for(let P=0;P<k.length;P++)k[P].isInSet(E)||(o&&o.to==T&&o.mark.eq(k[P])?o.to=x:i.push(o=new oi(T,x,k[P])));s&&s.to==T?s.to=x:a.push(s=new Qi(T,x,n))}}),i.forEach(l=>r.step(l)),a.forEach(l=>r.step(l))}function EQ(r,e,t,n){let i=[],a=0;r.doc.nodesBetween(e,t,(o,s)=>{if(!o.isInline)return;a++;let l=null;if(n instanceof Mu){let f=o.marks,p;for(;p=n.isInSet(f);)(l||(l=[])).push(p),f=p.removeFromSet(f)}else n?n.isInSet(o.marks)&&(l=[n]):l=o.marks;if(l&&l.length){let f=Math.min(s+o.nodeSize,t);for(let p=0;p<l.length;p++){let k=l[p],T;for(let x=0;x<i.length;x++){let E=i[x];E.step==a-1&&k.eq(i[x].style)&&(T=E)}T?(T.to=f,T.step=a):i.push({style:k,from:Math.max(s,e),to:f,step:a})}}}),i.forEach(o=>r.step(new oi(o.from,o.to,o.style)))}function th(r,e,t,n=t.contentMatch,i=!0){let a=r.doc.nodeAt(e),o=[],s=e+1;for(let l=0;l<a.childCount;l++){let f=a.child(l),p=s+f.nodeSize,k=n.matchType(f.type);if(!k)o.push(new _r(s,p,Ue.empty));else{n=k;for(let T=0;T<f.marks.length;T++)t.allowsMarkType(f.marks[T].type)||r.step(new oi(s,p,f.marks[T]));if(i&&f.isText&&t.whitespace!="pre"){let T,x=/\r?\n|\r/g,E;for(;T=x.exec(f.text);)E||(E=new Ue(Oe.from(t.schema.text(" ",t.allowedMarks(f.marks))),0,0)),o.push(new _r(s+T.index,s+T.index+T[0].length,E))}}s=p}if(!n.validEnd){let l=n.fillBefore(Oe.empty,!0);r.replace(s,s,new Ue(l,0,0))}for(let l=o.length-1;l>=0;l--)r.step(o[l])}function MQ(r,e,t){return(e==0||r.canReplace(e,r.childCount))&&(t==r.childCount||r.canReplace(0,t))}function Au(r){let t=r.parent.content.cutByIndex(r.startIndex,r.endIndex);for(let n=r.depth;;--n){let i=r.$from.node(n),a=r.$from.index(n),o=r.$to.indexAfter(n);if(n<r.depth&&i.canReplace(a,o,t))return n;if(n==0||i.type.spec.isolating||!MQ(i,a,o))break}return null}function AQ(r,e,t){let{$from:n,$to:i,depth:a}=e,o=n.before(a+1),s=i.after(a+1),l=o,f=s,p=Oe.empty,k=0;for(let E=a,P=!1;E>t;E--)P||n.index(E)>0?(P=!0,p=Oe.from(n.node(E).copy(p)),k++):l--;let T=Oe.empty,x=0;for(let E=a,P=!1;E>t;E--)P||i.after(E+1)<i.end(E)?(P=!0,T=Oe.from(i.node(E).copy(T)),x++):f++;r.step(new Sr(l,f,o,s,new Ue(p.append(T),k,x),p.size-k,!0))}function OQ(r,e,t=null,n=r){let i=NQ(r,e),a=i&&DQ(n,e);return a?i.map(Lv).concat({type:e,attrs:t}).concat(a.map(Lv)):null}function Lv(r){return{type:r,attrs:null}}function NQ(r,e){let{parent:t,startIndex:n,endIndex:i}=r,a=t.contentMatchAt(n).findWrapping(e);if(!a)return null;let o=a.length?a[0]:e;return t.canReplaceWith(n,i,o)?a:null}function DQ(r,e){let{parent:t,startIndex:n,endIndex:i}=r,a=t.child(n),o=e.contentMatch.findWrapping(a.type);if(!o)return null;let l=(o.length?o[o.length-1]:e).contentMatch;for(let f=n;l&&f<i;f++)l=l.matchType(t.child(f).type);return!l||!l.validEnd?null:o}function LQ(r,e,t){let n=Oe.empty;for(let o=t.length-1;o>=0;o--){if(n.size){let s=t[o].type.contentMatch.matchFragment(n);if(!s||!s.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=Oe.from(t[o].type.create(t[o].attrs,n))}let i=e.start,a=e.end;r.step(new Sr(i,a,i,a,new Ue(n,0,0),t.length,!0))}function RQ(r,e,t,n,i){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let a=r.steps.length;r.doc.nodesBetween(e,t,(o,s)=>{let l=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(n,l)&&IQ(r.doc,r.mapping.slice(a).map(s),n)){let f=null;if(n.schema.linebreakReplacement){let x=n.whitespace=="pre",E=!!n.contentMatch.matchType(n.schema.linebreakReplacement);x&&!E?f=!1:!x&&E&&(f=!0)}f===!1&&yb(r,o,s,a),th(r,r.mapping.slice(a).map(s,1),n,void 0,f===null);let p=r.mapping.slice(a),k=p.map(s,1),T=p.map(s+o.nodeSize,1);return r.step(new Sr(k,T,k+1,T-1,new Ue(Oe.from(n.create(l,null,o.marks)),0,0),1,!0)),f===!0&&gb(r,o,s,a),!1}})}function gb(r,e,t,n){e.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let l=r.mapping.slice(n).map(t+1+a+o.index);r.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function yb(r,e,t,n){e.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let o=r.mapping.slice(n).map(t+1+a);r.replaceWith(o,o+1,e.type.schema.text(`
|
|
@@ -842,4 +842,4 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
842
842
|
* @version 3.2.2 | Fri Feb 17 2023
|
|
843
843
|
* @author NHN Cloud FE Development Lab <dl_javascript@nhn.com>
|
|
844
844
|
* @license MIT
|
|
845
|
-
*/Kt.setLanguage(["uk","uk-UA"],{Markdown:"Markdown",WYSIWYG:"WYSIWYG",Write:"Написати",Preview:"Попередній перегляд",Headings:"Заголовки",Paragraph:"Абзац",Bold:"Жирний",Italic:"Курсив",Strike:"Закреслений",Code:"Вбудований код",Line:"Лінія",Blockquote:"Блок цитування","Unordered list":"Невпорядкований список","Ordered list":"Упорядкований список",Task:"Завдання",Indent:"відступ",Outdent:"застарілий","Insert link":"Вставити посилання","Insert CodeBlock":"Вставити код","Insert table":"Вставити таблицю","Insert image":"Вставити зображення",Heading:"Заголовок","Image URL":"URL зображення","Select image file":"Вибрати файл зображення","Choose a file":"Виберіть файл","No file":"Немає файлу",Description:"Опис",OK:"OK",More:"ще",Cancel:"Скасувати",File:"Файл",URL:"URL","Link text":"Текст посилання","Add row to up":"Додати рядок вгору","Add row to down":"Додати рядок вниз","Add column to left":"Додайте стовпець зліва","Add column to right":"Додайте стовпець праворуч","Remove row":"Видалити ряд","Remove column":"Видалити стовпчик","Align column to left":"Вирівняти по лівому краю","Align column to center":"Вирівняти по центру","Align column to right":"Вирівняти по правому краю","Remove table":"Видалити таблицю","Would you like to paste as table?":"Ви хочете вставити у вигляді таблиці?","Text color":"Колір тексту","Auto scroll enabled":"Автоматична прокрутка включена","Auto scroll disabled":"Автоматична прокрутка відключена","Choose language":"Вибрати мову"});const JJe=["ar","zh","hr","cs","nl","en","fi","fr","gl","de","it","ja","ko","nb","pl","pt","ru","es","sv","tr","uk"],jy=document.documentElement.lang,Gy=JJe.includes(jy)?jy:"en",
|
|
845
|
+
*/Kt.setLanguage(["uk","uk-UA"],{Markdown:"Markdown",WYSIWYG:"WYSIWYG",Write:"Написати",Preview:"Попередній перегляд",Headings:"Заголовки",Paragraph:"Абзац",Bold:"Жирний",Italic:"Курсив",Strike:"Закреслений",Code:"Вбудований код",Line:"Лінія",Blockquote:"Блок цитування","Unordered list":"Невпорядкований список","Ordered list":"Упорядкований список",Task:"Завдання",Indent:"відступ",Outdent:"застарілий","Insert link":"Вставити посилання","Insert CodeBlock":"Вставити код","Insert table":"Вставити таблицю","Insert image":"Вставити зображення",Heading:"Заголовок","Image URL":"URL зображення","Select image file":"Вибрати файл зображення","Choose a file":"Виберіть файл","No file":"Немає файлу",Description:"Опис",OK:"OK",More:"ще",Cancel:"Скасувати",File:"Файл",URL:"URL","Link text":"Текст посилання","Add row to up":"Додати рядок вгору","Add row to down":"Додати рядок вниз","Add column to left":"Додайте стовпець зліва","Add column to right":"Додайте стовпець праворуч","Remove row":"Видалити ряд","Remove column":"Видалити стовпчик","Align column to left":"Вирівняти по лівому краю","Align column to center":"Вирівняти по центру","Align column to right":"Вирівняти по правому краю","Remove table":"Видалити таблицю","Would you like to paste as table?":"Ви хочете вставити у вигляді таблиці?","Text color":"Колір тексту","Auto scroll enabled":"Автоматична прокрутка включена","Auto scroll disabled":"Автоматична прокрутка відключена","Choose language":"Вибрати мову"});const JJe=["ar","zh","hr","cs","nl","en","fi","fr","gl","de","it","ja","ko","nb","pl","pt","ru","es","sv","tr","uk"],jy=document.documentElement.lang,Gy=JJe.includes(jy)?jy:"en",e8e=r=>{const e=JZ.c(19),{initialValue:t,onChange:n,options:i,disabled:a}=r,o=t===void 0?"":t,s=Cf.useRef(null),{width:l}=ZZ(),{appearance:f}=QZ(),p=f==="dark"?"dark":"light";let k;e[0]===Symbol.for("react.memo_cache_sentinel")?(k={height:"600px",initialEditType:"markdown",useCommandShortcut:!0,language:Gy},e[0]=k):k=e[0];const[T,x]=Cf.useState(k);let E;e[1]!==n?(E=()=>{var ge;const re=(ge=s.current)==null?void 0:ge.getInstance(),he=re==null?void 0:re.getMarkdown();n&&he&&n(he)},e[1]=n,e[2]=E):E=e[2];const P=E;let F;e[3]!==i||e[4]!==l?(F=()=>{const re=l<1200;x(he=>({...he,...i,previewStyle:re?"tab":(i==null?void 0:i.previewStyle)||"vertical",height:(i==null?void 0:i.height)||"600px",initialEditType:(i==null?void 0:i.initialEditType)||"markdown",useCommandShortcut:(i==null?void 0:i.useCommandShortcut)!==void 0?i.useCommandShortcut:!0})),s.current&&s.current.getInstance().changePreviewStyle(re?"tab":(i==null?void 0:i.previewStyle)||"vertical")},e[3]=i,e[4]=l,e[5]=F):F=e[5];let z;e[6]!==i||e[7]!==p||e[8]!==l?(z=[l,i,p],e[6]=i,e[7]=p,e[8]=l,e[9]=z):z=e[9],Cf.useEffect(F,z);const Y=`${a?"pointer-events-none opacity-50":""}`,Z=`editor-${p}-${Gy}`;let oe;e[10]!==T||e[11]!==P||e[12]!==o||e[13]!==Z||e[14]!==p?(oe=bv.jsx(KJe,{ref:s,initialValue:o,onChange:P,autofocus:!1,theme:p,...T},Z),e[10]=T,e[11]=P,e[12]=o,e[13]=Z,e[14]=p,e[15]=oe):oe=e[15];let le;return e[16]!==Y||e[17]!==oe?(le=bv.jsx("div",{className:Y,children:oe}),e[16]=Y,e[17]=oe,e[18]=le):le=e[18],le};export{e8e as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a as e}from"./app.js";/**
|
|
2
2
|
* @license lucide-react v0.485.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const
|
|
6
|
+
*/const t=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],c=e("trash-2",t);export{c as T};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as S,r as m}from"./app.js";const y=()=>typeof window>"u"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches,E=(e,a,r=365)=>{if(typeof document>"u")return;const c=r*24*60*60;document.cookie=`${e}=${a};path=/;max-age=${c};SameSite=Lax`},s=e=>{const a=e==="dark"||e==="system"&&y();document.documentElement.classList.toggle("dark",a)},w=()=>typeof window>"u"?null:window.matchMedia("(prefers-color-scheme: dark)"),v=()=>{const e=localStorage.getItem("appearance");s(e||"light")};function k(){var a;const e=localStorage.getItem("appearance")||"system";s(e),(a=w())==null||a.addEventListener("change",v)}function C(){const e=S.c(6),[a,r]=m.useState("system"),[c,g]=m.useState(!1);let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=n=>{g(!0),r(n),localStorage.setItem("appearance",n),E("appearance",n),s(n),setTimeout(()=>{g(!1),window.dispatchEvent(new Event("appearanceChanged"))},0)},e[0]=o):o=e[0];const l=o;let p,i;e[1]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{const n=localStorage.getItem("appearance");l(n||"light");const h=t=>{if(t.key==="appearance"){const f=t.newValue;r(f),s(f)}},u=()=>{const t=localStorage.getItem("appearance");r(t),s(t)};return window.addEventListener("storage",h),window.addEventListener("appearanceChanged",u),()=>{var t;window.removeEventListener("storage",h),window.removeEventListener("appearanceChanged",u),(t=w())==null||t.removeEventListener("change",v)}},i=[l],e[1]=p,e[2]=i):(p=e[1],i=e[2]),m.useEffect(p,i);let d;return e[3]!==a||e[4]!==c?(d={appearance:a,updateAppearance:l,isThemeChanging:c},e[3]=a,e[4]=c,e[5]=d):d=e[5],d}export{k as i,C as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as s,r}from"./app.js";const f=()=>{const e=s.c(3);let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={width:typeof window<"u"?window.innerWidth:1024,height:typeof window<"u"?window.innerHeight:768},e[0]=i):i=e[0];const[d,w]=r.useState(i);let n,t;return e[1]===Symbol.for("react.memo_cache_sentinel")?(n=()=>{if(typeof window>"u")return;const o=()=>{w({width:window.innerWidth,height:window.innerHeight})};return window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},t=[],e[1]=n,e[2]=t):(n=e[1],t=e[2]),r.useEffect(n,t),d};export{f as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as x,j as a,aL as h,aM as p,aN as j}from"./app.js";function v(){return I}function I(g){const t=g.trim().split(" ");if(t.length===0)return"";if(t.length===1)return t[0].charAt(0).toUpperCase();const e=t[0].charAt(0),m=t[t.length-1].charAt(0);return`${e}${m}`.toUpperCase()}function N(g){const t=x.c(22),{user:e,showEmail:m}=g,u=m===void 0?!1:m,d=v();let l;t[0]!==e.avatar||t[1]!==e.login?(l=a.jsx(h,{src:e.avatar,alt:e.login}),t[0]=e.avatar,t[1]=e.login,t[2]=l):l=t[2];let s;t[3]!==d||t[4]!==e.login?(s=d(e.login),t[3]=d,t[4]=e.login,t[5]=s):s=t[5];let i;t[6]!==s?(i=a.jsx(p,{className:"rounded-lg bg-neutral-200 text-black dark:bg-neutral-700 dark:text-white",children:s}),t[6]=s,t[7]=i):i=t[7];let n;t[8]!==l||t[9]!==i?(n=a.jsxs(j,{className:"h-8 w-8 overflow-hidden rounded-full",children:[l,i]}),t[8]=l,t[9]=i,t[10]=n):n=t[10];let r;t[11]!==e.login?(r=a.jsx("span",{className:"truncate font-medium",children:e.login}),t[11]=e.login,t[12]=r):r=t[12];let o;t[13]!==u||t[14]!==e.email?(o=u&&a.jsx("span",{className:"text-muted-foreground truncate text-xs",children:e.email}),t[13]=u,t[14]=e.email,t[15]=o):o=t[15];let c;t[16]!==r||t[17]!==o?(c=a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[r,o]}),t[16]=r,t[17]=o,t[18]=c):c=t[18];let f;return t[19]!==n||t[20]!==c?(f=a.jsxs(a.Fragment,{children:[n,c]}),t[19]=n,t[20]=c,t[21]=f):f=t[21],f}export{N as UserInfo};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{a as p,c as f,j as t,aO as x,aP as d,aQ as h,X as y}from"./app.js";import{UserInfo as j}from"./user-info-CnB2lvpg.js";/**
|
|
2
|
+
* @license lucide-react v0.485.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const g=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],b=p("log-out",g);function _(){return M}function M(){document.body.style.removeProperty("pointer-events")}function w(m){const e=f.c(11),{user:a,logout:c,logoutBtn:i}=m,u=_();let o;e[0]!==a?(o=t.jsx(x,{className:"p-0 font-normal",children:t.jsx("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:t.jsx(j,{user:a,showEmail:!0})})}),e[0]=a,e[1]=o):o=e[1];let n;e[2]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(d,{}),e[2]=n):n=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(b,{className:"mr-2"}),e[3]=l):l=e[3];let s;e[4]!==u||e[5]!==c||e[6]!==i?(s=t.jsx(h,{asChild:!0,children:t.jsxs(y,{className:"block w-full cursor-pointer",method:"get",href:c,as:"button",onClick:u,children:[l,i]})}),e[4]=u,e[5]=c,e[6]=i,e[7]=s):s=e[7];let r;return e[8]!==o||e[9]!==s?(r=t.jsxs(t.Fragment,{children:[o,n,s]}),e[8]=o,e[9]=s,e[10]=r):r=e[10],r}export{w as UserMenuContent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as l,q as m,j as p}from"./app.js";import{A as x}from"./app-layout-Dn8y3paC.js";import"./app-shell-C1wDrRCe.js";import"./app-sidebar-BisOEG_p.js";import"./nav-main-DDQ-_Oed.js";import"./material-icon-DeSoGIhT.js";import"./chevrons-up-down-D3t3UGV7.js";import"./app-sidebar-header-CL1OSuV8.js";import"./breadcrumbs-BVZtAG3J.js";import"./nav-user-BwBu-VwZ.js";import"./user-info-CnB2lvpg.js";import"./user-menu-content-BFbaJw6v.js";import"./icon-B-D8X0jg.js";import"./use-appearance-J8J2w43p.js";const a=[];function E(){const t=l.c(8),e=m();let r;t[0]!==e.props.title?(r=e.props.title&&p.jsx("div",{className:"text-3xl mb-8",children:e.props.title}),t[0]=e.props.title,t[1]=r):r=t[1];let s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s=p.jsx("div",{className:"text-3xl mb-8",children:"Adminizer"}),t[2]=s):s=t[2];let o;t[3]!==e.props.text?(o=e.props.text&&p.jsx("div",{dangerouslySetInnerHTML:{__html:e.props.text}}),t[3]=e.props.text,t[4]=o):o=t[4];let i;return t[5]!==r||t[6]!==o?(i=p.jsx(x,{breadcrumbs:a,children:p.jsxs("div",{className:"flex h-full flex-1 flex-col gap-4 rounded-xl p-4",children:[r,s,o]})}),t[5]=r,t[6]=o,t[7]=i):i=t[7],i}export{E as default};
|
package/controllers/add.js
CHANGED
|
@@ -21,7 +21,7 @@ export default async function add(req, res) {
|
|
|
21
21
|
return res.sendStatus(403);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
let dataAccessor = new DataAccessor(req, entity, "add");
|
|
24
|
+
let dataAccessor = new DataAccessor(req.adminizer, req.user, entity, "add");
|
|
25
25
|
let fields = dataAccessor.getFieldsConfig();
|
|
26
26
|
// add deprecated 'records' to config
|
|
27
27
|
fields = await FieldsHelper.loadAssociations(req, fields, "add");
|
|
@@ -91,6 +91,9 @@ export default async function add(req, res) {
|
|
|
91
91
|
await saveRelationsMediaManager(fields, rawReqData, entity.model.identity, record.id);
|
|
92
92
|
Adminizer.log.debug(`A new record was created: `, record);
|
|
93
93
|
if (req.body.jsonPopupCatalog) {
|
|
94
|
+
dataAccessor = new DataAccessor(req.adminizer, req.user, entity, "edit");
|
|
95
|
+
record = await entity.model.findOne({ id: record.id }, dataAccessor);
|
|
96
|
+
// await new Promise(resolve => setTimeout(resolve, 2000));
|
|
94
97
|
return res.json({ record: record });
|
|
95
98
|
}
|
|
96
99
|
else {
|
|
@@ -104,16 +107,13 @@ export default async function add(req, res) {
|
|
|
104
107
|
data = reqData;
|
|
105
108
|
}
|
|
106
109
|
}
|
|
110
|
+
const props = inertiaAddHelper(req, entity, fields);
|
|
107
111
|
if (req.query?.without_layout) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
// data: data
|
|
112
|
-
// });
|
|
113
|
-
return null;
|
|
112
|
+
return res.json({
|
|
113
|
+
props: props
|
|
114
|
+
});
|
|
114
115
|
}
|
|
115
116
|
else {
|
|
116
|
-
const props = inertiaAddHelper(req, entity, fields);
|
|
117
117
|
return req.Inertia.render({
|
|
118
118
|
component: 'add',
|
|
119
119
|
props: props
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function catalogController(req: ReqType, res: ResType): Promise<void |
|
|
1
|
+
export declare function catalogController(req: ReqType, res: ResType): Promise<void | import("express").Response<any, Record<string, any>>>;
|