@grapesjs/studio-sdk-plugins 1.0.12 → 1.0.13-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/iconifyComponent/index.d.ts +3 -0
- package/dist/iconifyComponent/types.d.ts +42 -0
- package/dist/iconifyComponent/typesSchema.d.ts +19 -0
- package/dist/iconifyComponent/utils.d.ts +18 -0
- package/dist/index.cjs.d.ts +2 -0
- package/dist/index.cjs.js +182 -170
- package/dist/index.d.ts +2 -0
- package/dist/index.es.d.ts +2 -0
- package/dist/index.es.js +21738 -16239
- package/dist/index.umd.js +182 -170
- package/dist/lightGalleryComponent/index.cjs.js +1 -1
- package/dist/lightGalleryComponent/index.es.js +29 -30
- package/dist/lightGalleryComponent/index.umd.js +1 -1
- package/dist/prosemirror/index.cjs.js +6 -6
- package/dist/prosemirror/index.es.js +97 -96
- package/dist/prosemirror/index.umd.js +6 -6
- package/dist/prosemirror/types.d.ts +3 -3
- package/dist/rteTinyMce/index.cjs.js +81 -71
- package/dist/rteTinyMce/index.es.js +9747 -4641
- package/dist/rteTinyMce/index.umd.js +81 -71
- package/dist/swiperComponent/index.cjs.js +3 -3
- package/dist/swiperComponent/index.es.js +50 -53
- package/dist/swiperComponent/index.umd.js +3 -3
- package/dist/tableComponent/index.cjs.js +1 -1
- package/dist/tableComponent/index.es.js +121 -121
- package/dist/tableComponent/index.umd.js +1 -1
- package/dist/youtubeAssetProvider/assetProviders/youtube.d.ts +3 -0
- package/dist/youtubeAssetProvider/index.cjs.d.ts +3 -0
- package/dist/youtubeAssetProvider/index.cjs.js +1 -0
- package/dist/youtubeAssetProvider/index.d.ts +3 -0
- package/dist/youtubeAssetProvider/index.es.d.ts +3 -0
- package/dist/youtubeAssetProvider/index.es.js +242 -0
- package/dist/youtubeAssetProvider/index.umd.js +1 -0
- package/dist/youtubeAssetProvider/types.d.ts +202 -0
- package/package.json +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("grapesjs");const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("grapesjs");const m=require("react"),ir=require("react-dom");function b0(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const kn=b0(m),b2=b0(ir),v0="app.grapesjs.com",y0="app-stage.grapesjs.com",Mh=[v0,y0,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],v2="license:check:start",y2="license:check:end",Zf=()=>typeof window<"u",Dd=t=>t&&t.stopPropagation(),x2=(t="",e)=>{const r=new DOMParser().parseFromString(t,"text/html");if(e){const i=r.querySelectorAll("svg")[0].style||{},s=O2(e)?`${e}px`:e;i.width=s,i.height=s,i.fill="currentColor"}return new XMLSerializer().serializeToString(r)},w2=({isDev:t,isStage:e})=>`${t?"":`https://${e?y0:v0}`}/api`,x0=(t={})=>{const{width:e=300,height:n,text:r="IMAGE",bg:o="777",fg:i="white"}=t,s=n?`x${n}`:"";return`https://placehold.co/${e}${s}/${o}/${i}.png?text=${r}`},S2=x0(),C2=()=>{const t=Zf()&&window.location.hostname;return!!t&&(Mh.includes(t)||Mh.some(e=>t.endsWith(e)))},Ld=t=>t&&t.charAt(0).toUpperCase()+t.substring(1),E2=t=>t.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,n)=>(n?"-":"")+e.toLowerCase()),Wa=t=>typeof t<"u",w0=t=>typeof t=="string",O2=t=>typeof t=="number";function xo(t){return typeof t=="function"}const _2=t=>(t||"").toLowerCase().trim().replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-._]+/g,"").replace(/--+/g,"-").trim();var Ht=(t=>(t.free="free",t.startup="startup",t.business="business",t.enterprise="enterprise",t))(Ht||{});async function k2({path:t,baseApiUrl:e,method:n="GET",headers:r={},params:o,body:i}){const l=`${e||w2({isDev:!1,isStage:!1})}${t}`,a={method:n,headers:{"Content-Type":"application/json",...r}};i&&(a.body=JSON.stringify(i));const c=o?new URLSearchParams(o).toString():"",u=c?`?${c}`:"",d=await fetch(`${l}${u}`,a);if(!d.ok)throw new Error(`HTTP error! status: ${d.status}`);return d.json()}const jh={[Ht.free]:0,[Ht.startup]:10,[Ht.business]:20,[Ht.enterprise]:30};function T2(t){const e=t;return e.init=n=>r=>t(r,n),e}const xr=t=>T2(t);async function wr({editor:t,plan:e,pluginName:n,licenseKey:r,cleanup:o}){let i="",s=!1;const l=C2(),a=u=>{console.warn("Cleanup plugin:",n,"Reason:",u),o()},c=(u={})=>{var b;const{error:d,sdkLicense:f}=u,p=(b=u.plan)==null?void 0:b.category;if(!(f||u.license)||d)a(d||"Invalid license");else if(p){const v=jh[e],y=jh[p];v>y&&a({pluginRequiredPlan:e,licensePlan:p})}};t.on(v2,u=>{i=u==null?void 0:u.baseApiUrl,s=!0}),t.on(y2,u=>{c(u)}),setTimeout(async()=>{if(!s){if(l)return;if(r){const u=await A2({licenseKey:r,pluginName:n,baseApiUrl:i});u&&c(u)}else a("The `licenseKey` option not provided")}},2e3)}async function A2(t){const{licenseKey:e,pluginName:n,baseApiUrl:r}=t;try{return(await k2({baseApiUrl:r,path:`/sdk/${e||"na"}`,method:"POST",params:{d:window.location.hostname,pn:n}})).result||{}}catch(o){return console.error("Error during SDK license check:",o),!1}}const Ma=(t,e)=>{var n;return!!((n=t==null?void 0:t.hasAttribute)!=null&&n.call(t,e))},ri=(t,e)=>{var n;return!!((n=t==null?void 0:t.classList)!=null&&n.contains(e))},M2=(t,e={})=>{var i;const n={},r=[],o=[];for(const s in t){const{value:l,...a}=t[s];r.push({id:s,name:s,changeProp:!0,category:e.category,...a}),n[s]=l,!Wa(l)&&o.push(s);const{subTraits:c={}}=a;for(const u in a.subTraits)(i=c[u])==null||i.forEach(d=>{const f=d.id||d.name;n[f]=d.value})}return{propKeys:Object.keys(n),propsNoValues:o,props:n,traits:r}},j2=(t,e)=>{e.forEach(n=>{if(n.subTraits){const r=`${n.id||n.name}`,o=n.changeProp?`change:${r}`:`change:attributes:${r}`;t.on(o,()=>Rh(t,r)),Rh(t,r)}})},Rh=(t,e)=>{const n=t.getTrait(e),r=n.get("category"),o=n.get("subTraits")||{},s=(Object.values(o).flat()||[]).map(c=>c.id||c.name);t.removeTrait(s);const l=o[n.getValue()],a=t.getTraitIndex(e)+1;l&&t.addTrait(l.map(c=>({category:r,...c})),{at:a})},R2=(t,e)=>{e.forEach(n=>{const r=E2(n);r!==n&&t.has(r)&&t.set({[n]:t.get(r),[r]:void 0})})},Vd="gjs-plg-",Nh=(...t)=>t.map(e=>`[data-gjs-type="${e}"]`).join(","),N2="dialogComponent",P2=function(t,e={}){const{Blocks:n,Components:r}=t,{licenseKey:o}=e,i="gjs-plg-dialog",s="gjs-plg-dialog-overlay",l="gjs-plg-dialog-content",a="gjs-plg-dialog-close",c="gjs-plg-dialog-title",u="gjs-plg-dialog-body",d="gjs-plg-dialog-description",f="gjs-plg-dialog-placeholder";n.add(i,{label:"Dialog",media:`
|
|
2
2
|
<svg viewBox="0 0 24 24">
|
|
3
3
|
<path d="M4 4h16v10H8l-4 4V4z"></path>
|
|
4
4
|
</svg>
|
|
5
|
-
`,category:"Extra",content:{type:
|
|
6
|
-
.${
|
|
5
|
+
`,category:"Extra",content:{type:i},activate:!0,...e.block}),r.addType(i,{model:{defaults:{tagName:"div",attributes:{class:i,"data-type-role":i},components:[{type:s},{type:f}],draggable:Nh("wrapper"),droppable:Nh(i),styles:`
|
|
6
|
+
.${i} {
|
|
7
7
|
position: relative;
|
|
8
8
|
z-index: 1;
|
|
9
9
|
}
|
|
10
|
-
`,traits:[{type:"button",label:"Open dialog",name:"onActive",changeProp:!0,command(
|
|
10
|
+
`,traits:[{type:"button",label:"Open dialog",name:"onActive",changeProp:!0,command(g){var b;(b=g.getSelected())==null||b.trigger("active")}},{type:"checkbox",label:"Close when pressing X",name:"closeWhenPressingX",default:!0,changeProp:!0},{type:"checkbox",label:"Close when pressing ESC",name:"closeWhenPressingEsc",default:!0,changeProp:!0},{type:"checkbox",label:"Open when leaving the window",name:"openWhenLeavingWindow",default:!1,changeProp:!0},{type:"number",label:"Open when scrolling to level",name:"openWhenScrollingToLevel",default:0,changeProp:!0}],"script-props":["closeWhenPressingX","closeWhenPressingEsc","openWhenLeavingWindow","openWhenScrollingToLevel"],script:function(g){const b=this;function v(C){const x=b.querySelector('[data-type-role="gjs-plg-dialog-overlay"]'),E=b.querySelector('[data-type-role="gjs-plg-dialog-close"]');function _(){x.style.display="none"}C?(b._onCloseWhenPressingX=_,E.addEventListener("click",b._onCloseWhenPressingX)):(E.removeEventListener("click",b._onCloseWhenPressingX),b._onCloseWhenPressingX=null)}function y(C){const x=b.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');function E(_){_.key==="Escape"&&(x.style.display="none")}C?(b._onCloseWhenPressingEsc=E,b.addEventListener("keydown",b._onCloseWhenPressingEsc)):(b.removeEventListener("keydown",b._onCloseWhenPressingEsc),b._onCloseWhenPressingEsc=null)}function w(C){const x=b.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');function E(){x.style.display="flex"}C?(b._onOpenWhenLeavingWindow=E,document.addEventListener("mouseleave",b._onOpenWhenLeavingWindow)):(document.removeEventListener("mouseleave",b._onOpenWhenLeavingWindow),b._onOpenWhenLeavingWindow=null)}function S(C){const x=b.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');function E(){const _=document.documentElement.scrollTop;C&&_>=Number(C)&&(x.style.display="flex")}C?(b._onOpenWhenScrollingToLevel=E,document.addEventListener("scroll",b._onOpenWhenScrollingToLevel)):(document.removeEventListener("scroll",b._onOpenWhenScrollingToLevel),b._onOpenWhenScrollingToLevel=null)}v(g.closeWhenPressingX),y(g.closeWhenPressingEsc),w(g.openWhenLeavingWindow),S(g.openWhenScrollingToLevel)}},init(){this.on("active",this.handleOpenWhenClickPlaceholder)},handleOpenWhenClickPlaceholder(){this.view.el.querySelector('[data-type-role="gjs-plg-dialog-placeholder"]').addEventListener("click",()=>{const b=this.view.el.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');b.style.display="flex"})}},view:{onActive(){const g=this.el.querySelector('[data-type-role="gjs-plg-dialog-overlay"]');g.style.display="flex"}}}),r.addType(s,{model:{defaults:{tagName:"div",attributes:{class:s,"data-type-role":s},components:{type:l},droppable:!1,draggable:!1,styles:`
|
|
11
11
|
.${s} {
|
|
12
12
|
position: fixed;
|
|
13
13
|
top: 0;
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
justify-content: center;
|
|
20
20
|
background-color: rgba(0, 0, 0, 0.5);
|
|
21
21
|
}
|
|
22
|
-
`}}}),r.addType(
|
|
23
|
-
.${
|
|
22
|
+
`}}}),r.addType(l,{model:{defaults:{tagName:"div",attributes:{class:l,"data-type-role":l},components:[{type:a},{type:c},{type:u}],droppable:!1,draggable:!1,styles:`
|
|
23
|
+
.${l} {
|
|
24
24
|
position: relative;
|
|
25
25
|
background-color: #fff;
|
|
26
26
|
border-radius: 10px;
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
height: 600px;
|
|
31
31
|
box-sizing: border-box;
|
|
32
32
|
}
|
|
33
|
-
`}}}),r.addType(
|
|
34
|
-
.${
|
|
33
|
+
`}}}),r.addType(a,{model:{defaults:{tagName:"button",attributes:{class:a,"data-type-role":a},components:"×",droppable:!1,draggable:!1,styles:`
|
|
34
|
+
.${a} {
|
|
35
35
|
position: absolute;
|
|
36
36
|
top: 10px;
|
|
37
37
|
right: 10px;
|
|
@@ -47,75 +47,16 @@
|
|
|
47
47
|
margin: 0;
|
|
48
48
|
padding: 0 40px 20px 0;
|
|
49
49
|
}
|
|
50
|
-
`}}}),r.addType(u,{model:{defaults:{tagName:"div",attributes:{class:u,"data-type-role":u},components:[{type:
|
|
50
|
+
`}}}),r.addType(u,{model:{defaults:{tagName:"div",attributes:{class:u,"data-type-role":u},components:[{type:d}],styles:`
|
|
51
51
|
.${u} {
|
|
52
52
|
height: 90%;
|
|
53
53
|
overflow: auto;
|
|
54
54
|
}
|
|
55
|
-
`}}}),r.addType(
|
|
56
|
-
.${
|
|
55
|
+
`}}}),r.addType(d,{model:{defaults:{tagName:"p",attributes:{class:d,"data-type-role":d},components:"This is a customizable dialog!",editable:!0,styles:`
|
|
56
|
+
.${d} {
|
|
57
57
|
margin: 0;
|
|
58
58
|
}
|
|
59
|
-
`}}}),r.addType(d,{model:{toHTML(){return""},defaults:{tagName:"button",attributes:{class:d,"data-type-role":d},components:"Dialog (click me to open)",droppable:!1,draggable:!1}},view:{init(){const{em:h,el:m}=this,g="core:preview",y=h.Commands.events;this.listenTo(h,`${y.runCommand}${g}`,()=>{m.style.display="none"}),this.listenTo(h,`${y.stopCommand}${g}`,()=>{m.style.display=""})}}}),wr({editor:t,licenseKey:i,plan:St.startup,pluginName:Rb,cleanup:()=>{n.remove(o),r.removeType(o)}})},Vb=yr(Pb);function b1(t,e,n){let r,i,o,s,a;const l=e;function c(){const f=Date.now()-s;f<l&&f>=0?r=setTimeout(c,l-f):(r=null,a=t.apply(o,i),o=i=null)}const u=function(){return o=this,i=arguments,s=Date.now(),r||(r=setTimeout(c,l)),a};return u.clear=function(){r&&(clearTimeout(r),r=null)},u.flush=function(){r&&(a=t.apply(o,i),o=i=null,clearTimeout(r),r=null)},u}var rn=(t=>(t.toastAdd="studio:toastAdd",t.dialogOpen="studio:dialogOpen",t.dialogClose="studio:dialogClose",t.sidebarLeftSet="studio:sidebarLeft:set",t.sidebarLeftGet="studio:sidebarLeft:get",t.sidebarLeftToggle="studio:sidebarLeft:toggle",t.sidebarRightSet="studio:sidebarRight:set",t.sidebarRightGet="studio:sidebarRight:get",t.sidebarRightToggle="studio:sidebarRight:toggle",t.sidebarTopSet="studio:sidebarTop:set",t.sidebarTopGet="studio:sidebarTop:get",t.sidebarTopToggle="studio:sidebarTop:toggle",t.sidebarBottomSet="studio:sidebarBottom:set",t.sidebarBottomGet="studio:sidebarBottom:get",t.sidebarBottomToggle="studio:sidebarBottom:toggle",t.symbolAdd="studio:symbolAdd",t.symbolDetach="studio:symbolDetach",t.symbolOverride="studio:symbolOverride",t.symbolPropagateStyles="studio:propagateStyles",t.getPagesConfig="studio:getPagesConfig",t.setPagesConfig="studio:setPagesConfig",t.getPageSettings="studio:getPageSettings",t.setPageSettings="studio:setPageSettings",t.projectFiles="studio:projectFiles",t.canvasReload="studio:canvasReload",t.getBlocksPanel="studio:getBlocksPanel",t.setBlocksPanel="studio:setBlocksPanel",t.getStateContextMenu="studio:getStateContextMenu",t.setStateContextMenu="studio:setStateContextMenu",t.contextMenuComponent="studio:contextMenuComponent",t.layoutAdd="studio:layoutAdd",t.layoutRemove="studio:layoutRemove",t.layoutToggle="studio:layoutToggle",t.getStateTheme="studio:getStateTheme",t.setStateTheme="studio:setStateTheme",t))(rn||{}),v1=(t=>(t.layoutToggleId="studio:layoutToggle:",t.toggleBlocksPanel="studio:toggleBlocksPanel",t.pageSettingsUpdate="studio:pageSettingsUpdate",t))(v1||{}),ce=(t=>(t.table="table",t.tableSettings="tableSettings",t.tableDelete="tableDelete",t.tableHead="tableHead",t.tableFoot="tableFoot",t.tableCellItems="tableCellItems",t.tableCellProperties="tableCellProperties",t.tableCellMerge="tableCellMerge",t.tableCellSplit="tableCellSplit",t.tableRowItems="tableRowItems",t.tableRowInsertBefore="tableRowInsertBefore",t.tableRowInsertAfter="tableRowInsertAfter",t.tableRowDelete="tableRowDelete",t.tableRowProperties="tableRowProperties",t.tableRowCut="tableRowCut",t.tableRowCopy="tableRowCopy",t.tableRowPasteBefore="tableRowPasteBefore",t.tableRowPasteAfter="tableRowPasteAfter",t.tableColumn="tableColumn",t.tableColumnItems="tableColumnItems",t.tableColumnInsertBefore="tableColumnInsertBefore",t.tableColumnInsertAfter="tableColumnInsertAfter",t.tableColumnDelete="tableColumnDelete",t.tableColumnCut="tableColumnCut",t.tableColumnCopy="tableColumnCopy",t.tableColumnPasteBefore="tableColumnPasteBefore",t.tableColumnPasteAfter="tableColumnPasteAfter",t))(ce||{});const Se={table:'<svg viewBox="0 0 24 24"><path d="M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2m0 4v4h6V8H5m8 0v4h6V8h-6m-8 6v4h6v-4H5m8 0v4h6v-4h-6Z"/></svg>',tableSettings:'<svg viewBox="0 0 24 24"><path d="M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2m0 4v4h6V8H5m8 0v4h6V8h-6m-8 6v4h6v-4H5m8 0v4h6v-4h-6Z"/></svg>',tableDelete:'<svg viewBox="0 0 24 24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14zM5 6v12h14V6H5z"/><path d="m14.4 8.6 1 1-2.3 2.4 2.3 2.4-1 1-2.4-2.3-2.4 2.3-1-1 2.3-2.4-2.3-2.4 1-1 2.4 2.3z"/></svg>',tableHead:'<svg viewBox="0 0 24 24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm-8 11H5v3h6v-3Zm8 0h-6v3h6v-3Zm0-5h-6v3h6v-3ZM5 13h6v-3H5v3Z"/></svg>',tableFoot:'<svg viewBox="0 0 24 24" data-test="1" style="transform: rotate(180deg);"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm-8 11H5v3h6v-3Zm8 0h-6v3h6v-3Zm0-5h-6v3h6v-3ZM5 13h6v-3H5v3Z"/></svg>',tableColumn:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm0 9h-4v5h4v-5Zm-6 0H9v5h4v-5Zm0-7H9v5h4V6Zm6 0h-4v5h4V6Z"/></svg>',tableCellItems:"",tableCellProperties:'<svg viewBox="0 0 24 24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6l2-2h14zm-8 9H5v5h6v-5zm8 0h-6v5h6v-5zm-8-7H5v5h6V6z"/></svg>',tableCellMerge:'<svg viewBox="0 0 24 24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6l2-2h14zM5 16v2h3v-2H5zm14-5h-9v7h9v-7zm0-5h-4v3h4V6zM8 6H5v3h3V6zm5 0h-3v3h3V6zm-8 8h3v-3H5v3z"/></svg>',tableCellSplit:'<svg viewBox="0 0 24 24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14zM8 15.5H5V18h3v-2.5zm11-5h-9V18h9v-7.5zm-2.5 1 1 1-2 2 2 2-1 1-2-2-2 2-1-1 2-2-2-2 1-1 2 2 2-2zm-8.5-1H5v3h3v-3zM19 6h-4v2.5h4V6zM8 6H5v2.5h3V6zm5 0h-3v2.5h3V6z"/></svg>',tableRowItems:"",tableRowInsertBefore:'<svg viewBox="0 0 24 24"><path d="M6 4a1 1 0 1 1 0 2H5v6h14V6h-1a1 1 0 0 1 0-2h2c.6 0 1 .4 1 1v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5c0-.6.4-1 1-1h2zm5 10H5v4h6v-4zm8 0h-6v4h6v-4zM12 3c.5 0 1 .4 1 .9V6h2a1 1 0 0 1 0 2h-2v2a1 1 0 0 1-2 .1V8H9a1 1 0 0 1 0-2h2V4c0-.6.4-1 1-1z"/></svg>',tableRowInsertAfter:'<svg viewBox="0 0 24 24"><path d="M12 13c.5 0 1 .4 1 .9V16h2a1 1 0 0 1 .1 2H13v2a1 1 0 0 1-2 .1V18H9a1 1 0 0 1-.1-2H11v-2c0-.6.4-1 1-1zm6 7a1 1 0 0 1 0-2h1v-6H5v6h1a1 1 0 0 1 0 2H4a1 1 0 0 1-1-1V6c0-1.1.9-2 2-2h14a2 2 0 0 1 2 2v13c0 .5-.4 1-.9 1H18zM11 6H5v4h6V6zm8 0h-6v4h6V6z"/></svg>',tableRowDelete:'<svg viewBox="0 0 24 24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v3h2.5v2H5v2h2.5v2H5v3h14v-3h-2.5v-2H19v-2h-2.5V9H19V6zm-4.7 1.8 1.2 1L13 12l2.6 3.3-1.2 1-2.3-3-2.3 3-1.2-1L11 12 8.5 8.7l1.2-1 2.3 3 2.3-3z"/></svg>',tableRowProperties:'<svg viewBox="0 0 24 24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14zM5 15v3h6v-3H5zm14 0h-6v3h6v-3zm0-9h-6v3h6V6zM5 9h6V6H5v3z"/></svg>',tableRowCut:'<svg viewBox="0 0 24 24"><path fill-rule="evenodd" d="M22 3v5H9l3 3 2-2h4l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8.7.6 1 1.3 1 2.2.2.8 0 1.5-.6 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 0 1-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2a3 3 0 0 1 1-2.2A3.7 3.7 0 0 1 8.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 0 1 0-2c0-.4.3-.7.5-1l2 2V3h14zM8.5 15.3h-.3a2.6 2.6 0 0 0-.8.4 2.5 2.5 0 0 0-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 0 0 .8-.3L9 18l.4-.4.2-.4.1-.4v-.7a1 1 0 0 0-.2-.5 1 1 0 0 0-.4-.2h-.5zm7 0H15a1 1 0 0 0-.4.3 1 1 0 0 0-.2.5 1.5 1.5 0 0 0 0 .7v.4a2.8 2.8 0 0 0 .5.7h.1a2.8 2.8 0 0 0 .8.6l.4.1h.7l.5-.2.2-.5v-.7a2.6 2.6 0 0 0-.3-.8 2.4 2.4 0 0 0-.7-.7 2.5 2.5 0 0 0-.8-.3h-.3zM12 11.6c-.4 0-.7.1-1 .4-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4s.7-.1 1-.4c.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4zm8.5-7.1h-11v2h11v-2z"/></svg>',tableRowCopy:'<svg viewBox="0 0 24 24"><path d="M22 11v7H6v-7h16zm-2 2H8v3h12v-3zm-1-6v2H4v5H2V7h17z"/></svg>',tableRowPasteBefore:'<svg viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 1a3 3 0 0 1 2.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h12v-4h2v4c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2h3.3A3 3 0 0 1 12 1zm10 7v5H8V8h14zm-1.5 1.5h-11v2h11v-2zM12 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>',tableRowPasteAfter:'<svg viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 1a3 3 0 0 1 2.8 2H18c1 0 2 .8 2 1.9V11h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h14c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2h3.3A3 3 0 0 1 12 1zm10 11v5H8v-5h14zm-1.5 1.5h-11v2h11v-2zM12 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>',tableColumnItems:"",tableColumnInsertBefore:'<svg viewBox="0 0 24 24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a1 1 0 0 1-1-1v-2a1 1 0 0 1 2 0v1h8V6H5v1a1 1 0 1 1-2 0V5c0-.6.4-1 1-1h15zm0 9h-4v5h4v-5zM8 8c.5 0 1 .4 1 .9V11h2a1 1 0 0 1 .1 2H9v2a1 1 0 0 1-2 .1V13H5a1 1 0 0 1-.1-2H7V9c0-.6.4-1 1-1zm11-2h-4v5h4V6z"/></svg>',tableColumnInsertAfter:'<svg viewBox="0 0 24 24"><path d="M20 4c.6 0 1 .4 1 1v2a1 1 0 0 1-2 0V6h-8v12h8v-1a1 1 0 0 1 2 0v2c0 .5-.4 1-.9 1H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h15zM9 13H5v5h4v-5zm7-5c.5 0 1 .4 1 .9V11h2a1 1 0 0 1 .1 2H17v2a1 1 0 0 1-2 .1V13h-2a1 1 0 0 1-.1-2H15V9c0-.6.4-1 1-1zM9 6H5v5h4V6z"/></svg>',tableColumnDelete:'<svg viewBox="0 0 24 24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14zm-4 4h-2V6h-2v2H9V6H5v12h4v-2h2v2h2v-2h2v2h4V6h-4v2zm.3.5 1 1.2-3 2.3 3 2.3-1 1.2L12 13l-3.3 2.6-1-1.2 3-2.3-3-2.3 1-1.2L12 11l3.3-2.5z"/></svg>',tableColumnCut:'<svg viewBox="0 0 24 24"><path fill-rule="evenodd" d="M7.2 4.5a3 3 0 0 1 2.2 1A3.7 3.7 0 0 1 10.5 8v.5l1 1 4-4 1-.5a3.3 3.3 0 0 1 2 0c.4 0 .7.3 1 .5L17 8h4v13h-6V10l-1.5 1.5.5.5v4l-2.5-2.5-1 1v.5c0 .4 0 .8-.3 1.2-.2.5-.4.9-.8 1.2-.6.7-1.3 1-2.2 1-.8.2-1.5 0-2-.6l-.5-.8-.2-1c0-.4 0-.8.3-1.2A3.9 3.9 0 0 1 7 12.7c.5-.2 1-.3 1.5-.2l1-1-1-1c-.5 0-1 0-1.5-.2-.5-.1-1-.4-1.4-.9-.4-.3-.6-.7-.8-1.2L4.5 7c0-.4 0-.7.2-1 0-.3.3-.6.5-.8.5-.5 1.2-.8 2-.7zm12.3 5h-3v10h3v-10zM8 13.8h-.3l-.4.2a2.8 2.8 0 0 0-.7.4v.1a2.8 2.8 0 0 0-.6.8l-.1.4v.7l.2.5.5.2h.7a2.6 2.6 0 0 0 .8-.3 2.4 2.4 0 0 0 .7-.7 2.5 2.5 0 0 0 .3-.8 1.5 1.5 0 0 0 0-.8 1 1 0 0 0-.2-.4 1 1 0 0 0-.5-.2H8zm3.5-3.7c-.4 0-.7.1-1 .4-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4s.7-.1 1-.4c.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4zM7 5.8h-.4a1 1 0 0 0-.5.3 1 1 0 0 0-.2.5v.7a2.5 2.5 0 0 0 .3.8l.2.3h.1l.4.4.4.2.4.1h.7L9 9l.2-.4a1.6 1.6 0 0 0 0-.8 2.6 2.6 0 0 0-.3-.8 2.5 2.5 0 0 0-1.2-1l-.4-.1H7z"/></svg>',tableColumnCopy:'<svg viewBox="0 0 24 24"><path d="M17 6v16h-7V6h7zm-2 2h-3v12h3V8zm-2-6v2H8v15H6V2h7z"/></svg>',tableColumnPasteBefore:'<svg viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 1a3 3 0 0 1 2.8 2H18c1 0 2 .8 2 1.9V18c0 1-.8 2-1.9 2H11v-2h7V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v2H4V5c0-1 .8-2 1.9-2h3.3A3 3 0 0 1 12 1zm-2 7v12H4V8h6zM8.5 9.5h-3v9h3v-9zM12 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>',tableColumnPasteAfter:'<svg viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 1a3 3 0 0 1 2.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h7v2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2h3.3A3 3 0 0 1 12 1zm8 7v12h-6V8h6zm-1.5 1.5h-3v9h3v-9zM12 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>'},vn="table",y1="thead",w1="tfoot",Fc="tbody",gt="row",Ve="cell",Wu="clipboardTable",Db=[vn,y1,w1,Fc,gt,Ve],nl=t=>t.em.get(Wu)||[],Lb=t=>t.every(e=>e.is(Ve)),Uu=(t,e)=>{const{editor:n,event:r,opts:i}=t,o=r.currentTarget||r.target,{x:s,y:a,width:l,height:c}=o.getBoundingClientRect(),u={style:{width:240,height:300},placer:{type:"popover",closeOnClickAway:!0,x:s,y:a,w:l,h:c},layout:{type:"tabs",value:"props",tabs:[{id:"styles",label:"Styles",children:{type:"panelStyles"}},{id:"props",label:"Properties",children:{type:"panelProperties",style:{padding:"14px 7px"}}}]},...e};zi(i.openSettings)?i.openSettings({...t,layoutProps:u}):n.runCommand(rn.layoutToggle,u)},jb=(t,{rows:e=1,cells:n=5,text:r}={})=>({type:t,components:Array.from(Array(e).keys()).map(i=>({type:gt,components:Array.from(Array(n).keys()).map(o=>({type:Ve,components:r?{type:"text",content:zi(r)?r({y:i,x:o}):r}:void 0}))}))}),x1="Table settings",S1=t=>{const{component:e}=t;return e.is(vn)?e:e.closestType(vn)},Hb=t=>{var e;(e=S1(t))==null||e.remove(t.opts)},Ib=t=>{const e=S1(t);e&&(t.editor.select(e),Uu(t,{id:"tableSettings",header:{label:x1}}))},C1=t=>[{id:ce.table,icon:Se[ce.table],label:"Table",items:[{id:ce.tableSettings,label:x1,icon:Se[ce.tableSettings],onClick:({event:n})=>Ib({...t,event:n})},{id:ce.tableDelete,label:"Delete table",icon:Se[ce.tableDelete],onClick:()=>Hb(t)}]}],O1=({editor:t})=>{const e=nl(t);return e.length&&Lb(e)},qf=({component:t,editor:e,after:n})=>{if(!t.is(Ve))return;const r=t.closestType(vn),i=t.closestType(gt),o=t.index()+(n?1:0);r==null||r.findType(gt).forEach(a=>a.append({type:Ve},{at:o}));const s=i==null?void 0:i.components().at(o);s&&e.select(s)},E1=({component:t,opts:e})=>{if(!t.is(Ve))return;const n=t.closestType(vn),r=t.index();n==null||n.findType(gt).forEach(i=>{var o;return(o=i.components().at(r))==null?void 0:o.remove(e)})},_1=({component:t,editor:e})=>{if(!t.is(Ve))return;const n=t.closestType(vn),r=t.index(),i=(n==null?void 0:n.findType(gt).map(o=>o.components().at(r)))||[];i.length&&e.em.set(Wu,i)},Gf=t=>{const{component:e,editor:n,after:r}=t;if(!e.is(Ve)||!O1(t))return;const i=nl(n),o=e.closestType(vn),s=e.index()+(r?1:0);o==null||o.findType(gt).forEach((a,l)=>{const c=i[l],u=(c==null?void 0:c.clone())||{type:Ve};a.append(u,{at:s})})},Bb=t=>{const{component:e}=t;e.is(Ve)&&(_1(t),E1({...t,opts:{temporary:!0}}))},$b=t=>{const e=O1(t);return[{id:ce.tableColumnItems,icon:Se[ce.tableColumn],label:"Column",items:[{id:ce.tableColumnInsertBefore,label:"Insert column before",icon:Se[ce.tableColumnInsertBefore],onClick:()=>qf(t)},{id:ce.tableColumnInsertAfter,label:"Insert column after",icon:Se[ce.tableColumnInsertAfter],onClick:()=>qf({...t,after:!0})},{id:ce.tableColumnDelete,label:"Delete column",icon:Se[ce.tableColumnDelete],onClick:()=>E1(t)},{id:ce.tableColumnCut,label:"Cut column",icon:Se[ce.tableColumnCut],onClick:()=>Bb(t)},{id:ce.tableColumnCopy,label:"Copy column",icon:Se[ce.tableColumnCopy],onClick:()=>_1(t)},{id:ce.tableColumnPasteBefore,label:"Paste column before",icon:Se[ce.tableColumnPasteBefore],disabled:!e,onClick:()=>Gf(t)},{id:ce.tableColumnPasteAfter,label:"Paste column after",icon:Se[ce.tableColumnPasteAfter],disabled:!e,onClick:()=>Gf({...t,after:!0})}]}]},k1="Row settings",zb=t=>t.every(e=>e.is(gt)),io=t=>{const{component:e}=t,n=e.is(Ve),r=e.is(gt);if(!(!n&&!r))return r?e:e.closestType(gt)},Kf=t=>{const{component:e,editor:n,after:r}=t,i=io(t);if(!i)return;const o=i.index()+(r?1:0),s=i.components().length,a=Array.from(Array(s).keys()).map(()=>({type:Ve})),l=i.parent();if(l){const c=l.append({type:gt,components:a},{at:o})[0];if(e.is(Ve)&&c){const u=e.index(),f=c.components().at(u);f&&n.select(f)}}},A1=t=>{var e;(e=io(t))==null||e.remove(t.opts)},T1=t=>{const e=io(t);e&&t.editor.em.set(Wu,[e])},Zf=t=>{var a;const{editor:e,after:n}=t,r=io(t);if(!r||!M1(t))return;const o=nl(e)[0],s=r.index()+(n?1:0);o&&((a=r.parent())==null||a.append(o.clone(),{at:s}))},Fb=t=>{io(t)&&(T1(t),A1({...t,opts:{temporary:!0}}))},M1=({editor:t})=>{const e=nl(t);return e.length&&zb(e)},Wb=t=>{const e=io(t);e&&(t.editor.select(e),Uu(t,{id:"tableRowSettings",header:{label:k1}}))},N1=t=>{const e=M1(t);return[{id:ce.tableRowItems,icon:Se[ce.tableRowProperties],label:"Row",items:[{id:ce.tableRowInsertBefore,label:"Insert row before",icon:Se[ce.tableRowInsertBefore],onClick:()=>Kf(t)},{id:ce.tableRowInsertAfter,label:"Insert row after",icon:Se[ce.tableRowInsertAfter],onClick:()=>Kf({...t,after:!0})},{id:ce.tableRowDelete,label:"Delete row",icon:Se[ce.tableRowDelete],onClick:()=>A1(t)},{id:ce.tableRowProperties,label:k1,icon:Se[ce.tableRowProperties],onClick:({event:r})=>Wb({...t,event:r})},{id:ce.tableRowCut,label:"Cut row",icon:Se[ce.tableRowCut],onClick:()=>Fb(t)},{id:ce.tableRowCopy,label:"Copy row",icon:Se[ce.tableRowCopy],onClick:()=>T1(t)},{id:ce.tableRowPasteBefore,label:"Paste row before",icon:Se[ce.tableRowPasteBefore],disabled:!e,onClick:()=>Zf(t)},{id:ce.tableRowPasteAfter,label:"Paste row after",icon:Se[ce.tableRowPasteAfter],disabled:!e,onClick:()=>Zf({...t,after:!0})}]},...C1(t)]},qu=t=>{const e=t.attributes.attributes||{},n=parseInt(`${e.rowspan||1}`,10),r=parseInt(`${e.colspan||1}`,10);return{rowspan:n,colspan:r}};function R1(t){const e=[];return t.components().forEach((n,r)=>{n.components().each((i,o)=>{const{rowspan:s,colspan:a}=qu(i);if(e[r])for(;e[r][o];)o++;for(let l=r;l<r+s;l++){e[l]||(e[l]=[]);for(let c=o;c<o+a;c++)e[l][c]={real:l===r&&c===o,cell:i,rowspan:s,colspan:a}}})}),e}function Ei(t,e,n){var r;return(r=t[n])==null?void 0:r[e]}const Wc=t=>t.closestType(gt);function Ub(t,{x:e,y:n,rows:r,cols:i}){var a;let o=Wc(t[n][e].cell),s;for(let l=1;l<=r;l++)if(o=(a=o==null?void 0:o.parent())==null?void 0:a.components().at(o.index()+1),o){for(s=e;s>=0;s--){const{cell:c}=t[n+l][s],u=Wc(c);if(u===o){for(let f=1;f<=i;f++){const d=c.index();u.append({type:Ve},{at:d+1})}break}}if(s===-1){const u=o.components().at(0).index();for(let f=1;f<=i;f++)o.append({type:Ve},{at:u})}}}function P1(t){for(let e=0;e<t.length;e++)for(let n=0;n<t[e].length;n++){const i=t[e][n].cell;if(i.em.selected.hasComponent(i)){const{rowspan:o,colspan:s}=qu(i);if(s>1||o>1){i.addAttributes({colspan:1,rowspan:1});for(let a=0;a<s-1;a++){const l=i.index();Wc(i).append({type:Ve},{at:l+1})}Ub(t,{x:n,y:e,rows:o-1,cols:s})}}}}function qb(t){const e=[];t.components().forEach(n=>{n.components().length||e.push(n)}),e.forEach(n=>n.remove())}const rl=(t,e={})=>{var s;const n=R1(t),{em:r}=t;let i,o;for(let a=0;a<n.length;a++)for(let l=0;l<n[a].length;l++){const c=n[a][l];if((s=e.selected)!=null&&s.includes(c.cell)||r.selected.hasComponent(c.cell)){const u={x:l,y:a};i||(i=u),o=u}}return{grid:n,startPos:i,endPos:o}};function Gb(t,e={}){const n=rl(t),{startPos:r,endPos:i}=n;let{grid:o}=n;const{em:s}=t;if(!r||!i)return;const a=r.x,l=r.y,c=i.x,u=i.y,f=Ei(o,a,l),d=Ei(o,c,u);if(f&&d){P1(o),o=R1(t);const p=[],h=Ei(o,a,l).cell;h.addAttributes({colspan:c-a+1,rowspan:u-l+1});for(let m=l;m<=u;m++)for(let g=a;g<=c;g++){const y=Ei(o,g,m);if(!y)continue;const{cell:w}=y;w!==h&&p.push(w)}p.forEach(m=>{e.mergeContent&&h.append(m.components().models),m.remove()}),s.setSelected(h),qb(t)}}const V1="Cell settings",Kb="Merge cells",Zb="Split cell",Jb=t=>t.closestType(gt),Fi=t=>{var e;return(e=Jb(t))==null?void 0:e.parent()},Yb=t=>{const e=t.editor.getSelectedAll(),n=Fi(e[0]),r=e[0];if(!n||!(r!=null&&r.is(Ve))||e.length>1)return!1;const{rowspan:i,colspan:o}=qu(r);return!(o<2&&i<2)},Xb=t=>{const n=t.editor.getSelectedAll()[0],r=Fi(n),{grid:i}=rl(r);P1(i)},D1=t=>{const e=t.editor.getSelectedAll(),n=Fi(e[0]);if(!n||e.length<2||e.some(a=>!a.is(Ve)||Fi(a)!==n))return!1;const{grid:r,startPos:i,endPos:o}=rl(n),{em:s}=n;if(!i||!o)return!1;for(let a=i.y;a<=o.y;a++)for(let l=i.x;l<=o.x;l++){const c=Ei(r,l,a);if(!c||!s.selected.hasComponent(c.cell))return!1}return!0},Qb=t=>{const{editor:e}=t;if(!D1(t))return;const n=e.getSelectedAll(),r=Fi(n[0]);Gb(r,{mergeContent:!0})},ev=t=>{Uu(t,{id:"tableCellSettings",header:{label:V1}})},tv=t=>[{id:ce.tableCellItems,icon:Se[ce.tableCellProperties],label:"Cell",items:[{id:ce.tableCellProperties,label:V1,icon:Se[ce.tableCellProperties],onClick:({event:n})=>ev({...t,event:n})},{id:ce.tableCellMerge,label:Kb,icon:Se[ce.tableCellMerge],onClick:()=>Qb(t),disabled:!D1(t)},{id:ce.tableCellSplit,label:Zb,icon:Se[ce.tableCellSplit],onClick:()=>Xb(t),disabled:!Yb(t)}]},...$b(t),...N1(t)],nv=t=>{const e=t[0]&&Fi(t[0]);if(!e)return;const{grid:n,startPos:r,endPos:i}=rl(e,{selected:t});if(!r||!i)return;const o=[];for(let s=r.y;s<=i.y;s++)for(let a=r.x;a<=i.x;a++){const l=Ei(n,a,s);l&&o.push(l.cell)}o.length&&e.em.setSelected(o,{fromCell:!0})},rv="tableComponent",iv=function(t,e={}){const n={block:{},...e},{Components:r}=t,i={copyable:!1,emptyState:!0,highlightable:!1,stylable:["color","font-family","font-size","font-weight","line-height","text-align","vertical-align","background-color","border-width","border-style","border-color"]};r.addType(vn,{block:n.block&&{label:"Table",media:Se.table,category:"Extra",content:{type:vn,style:{width:"100%"}},select:!0,...n.block},model:{defaults:{emptyState:!0,highlightable:!1,icon:Se.table,stylable:["width","height","margin","font-family","font-size","font-weight","line-height","text-align","background","background-color","border-width","border-style","border-color"],traits:[{type:"number",min:0,name:"cellspacing",label:"Cell spacing"},{type:"number",min:0,name:"cellpadding",label:"Cell padding"},{id:"tableCaption",type:"checkbox",label:"Caption",setValue({component:s,value:a,emitUpdate:l}){const c=s.find("caption")[0];a?!c&&s.append({type:"text",tagName:"caption",components:{type:"textnode",content:"Caption"}}):c==null||c.remove(),l(),t.refresh({tools:!0})},getValue(s){return!!s.component.find("caption")[0]}}],components:jb(Fc,{rows:5}),contextMenu:({items:s,editor:a,component:l})=>[...C1({editor:a,component:l,opts:n}),...s]}}}),r.addType(y1,{model:{defaults:{icon:Se.tableHead,...i}}}),r.addType(w1,{model:{defaults:{icon:Se.tableFoot,...i}}}),r.addType(Fc,{model:{defaults:{icon:Se.tableRowProperties,...i}}}),r.addType(gt,{model:{defaults:{icon:Se.tableRowProperties,emptyState:!0,highlightable:!1,stylable:["height","text-align","border-width","border-style","border-color"],traits:[],contextMenu:({items:s,editor:a,component:l})=>[...N1({editor:a,component:l,opts:n}),...s]}}}),r.addType(Ve,{model:{defaults:{icon:Se.tableCellProperties,emptyState:{styleOut:"height: 1px"},stylable:["width","height","padding","background-color","text-align","vertical-align","border-width","border-style","border-color"],traits:[{id:"tableCellType",type:"select",options:[{value:"td",name:"Cell"},{value:"th",name:"Header Cell"}],label:"Cell type",name:"tagName",changeProp:!0},{id:"tableCellScope",type:"select",options:[{value:!1,name:"None"},{value:"row",name:"Row"},{value:"col",name:"Column"},{value:"rowgroup",name:"Row group"},{value:"colgroup",name:"Column group"}],label:"Scope",name:"scope"}],contextMenu:({items:s,editor:a,component:l})=>[...tv({editor:a,component:l,opts:n}),...s]}}});const o=b1((s,a)=>{var f;const l=t.getSelectedAll(),c=!!((f=a==null?void 0:a.event)!=null&&f.shiftKey);if(l.length<2||!c||a.fromCell)return;const u=l.map(d=>d.is(Ve)?d:d.closestType(Ve)).filter(Boolean);u.length===l.length&&nv(u)},0);t.on("component:select",o),wr({editor:t,plan:St.startup,licenseKey:n.licenseKey,pluginName:rv,cleanup:()=>{t.off("component:select",o),t.Blocks.remove(vn),Db.forEach(s=>r.removeType(s))}})},ov=yr(iv),Jf="page://",Nr="list-pages",gi="list-pages-item",Vr="list-pages-link",sv=t=>t.components().reduce((e,n)=>{var s;const r=n.findFirstType(Vr),i=(s=r==null?void 0:r.attributes.attributes)==null?void 0:s.href,o=i!=null&&i.startsWith(Jf)?i.replace(Jf,""):"";if(o&&r){const a=e[o];a?a.push(r):e[o]=[r]}return e},{}),av="listPagesComponent",sa="data-type-role",lv="page_root",cv=t=>e=>e.is(t),uv=t=>(e,n)=>n.is(t),$l=t=>e=>{var n;return((n=e.getAttribute)==null?void 0:n.call(e,sa))===t},fv=function(t,e={}){const{Blocks:n,Components:r,Pages:i}=t,{licenseKey:o,block:s={}}=e,a="List Pages",l="List Pages Item",c="Link",u=`${zc}${Nr}`,f=`${zc}${Vr}`,d='<svg viewBox="0 0 24 24"><path d="M11 15H17V17H11V15M9 7H7V9H9V7M11 13H17V11H11V13M11 9H17V7H11V9M9 11H7V13H9V11M21 5V19C21 20.1 20.1 21 19 21H5C3.9 21 3 20.1 3 19V5C3 3.9 3.9 3 5 3H19C20.1 3 21 3.9 21 5M19 5H5V19H19V5M9 15H7V17H9V15Z"/></svg>',p='<svg viewBox="0 0 24 24"><path d="M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z" /></svg>';r.addType(Nr,{block:s&&{label:a,media:d,category:"Extra",select:!0,...e.block},isComponent:$l(Nr),model:{defaults:{tagName:"ul",name:a,[lv]:"",classes:u,attributes:{[sa]:Nr},droppable:cv(gi),styles:`
|
|
60
|
-
.${u} {
|
|
61
|
-
list-style: none;
|
|
62
|
-
margin: 0;
|
|
63
|
-
padding: 0;
|
|
64
|
-
}
|
|
65
|
-
`},init(){this.syncPageItems=b1(this.syncPageItems.bind(this),0),this.listenTo(this.em,i.events.all,this.syncPageItems),this.syncPageItems()},syncPageItems(){if(t.Components.getSymbolInfo(this).isInstance)return;const h=this.em.Pages.getAll(),m=this.components(),g=sv(this);h.forEach((y,w)=>{const x=y.id,C=y.getName(),v=g[x];v?v==null||v.forEach(E=>{E.getInnerHTML()!==C&&E.components(C)}):m.add({type:gi,components:[{type:Vr,attributes:{href:`page://${x}`},components:{type:"textnode",content:C}}]},{at:w})})}}}),r.addType(gi,{isComponent:$l(gi),model:{defaults:{name:l,tagName:"li",icon:p,attributes:{[sa]:gi},components:{type:Vr},draggable:uv(Nr)}}}),r.addType(Vr,{extend:"link",isComponent:$l(Vr),model:{defaults:{removable:!1,copyable:!1,delegate:{move:h=>h.closestType(gi)},name:c,classes:f,attributes:{[sa]:Vr},components:{type:"textnode",content:"Item"},styles:`
|
|
66
|
-
.${f} {
|
|
67
|
-
text-decoration: none;
|
|
68
|
-
}
|
|
69
|
-
`}}}),wr({editor:t,licenseKey:o,plan:St.startup,pluginName:av,cleanup:()=>{n.remove(Nr),r.removeType(Nr)}})},dv=yr(fv),pv="fsLightboxComponent",Rs="data-fslightbox",Ps="data-type",hv="fslightbox-open",bi="fslightbox",vi={image:'<svg viewBox="0 0 24 24"><path d="m8.5 13.5 2.5 3 3.5-4.5 4.5 6H5m16 1V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2Z"/></svg>',video:'<svg viewBox="0 0 24 24"><path d="M17 10.5V7a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-3.5l4 4v-11l-4 4Z"/></svg>',imageLightbox:'<svg viewBox="0 0 24 24"><path d="M4,2H20A2,2 0 0,1 22,4V16A2,2 0 0,1 20,18H16L12,22L8,18H4A2,2 0 0,1 2,16V4A2,2 0 0,1 4,2M19,15V7L15,11L13,9L7,15H19M7,5A2,2 0 0,0 5,7A2,2 0 0,0 7,9A2,2 0 0,0 9,7A2,2 0 0,0 7,5Z" /></svg>',external:'<svg viewBox="0 0 24 24"><path d="M14 3v2h3.6l-9.8 9.8 1.4 1.4L19 6.4V10h2V3m-2 16H5V5h7V3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h14a2 2 0 0 0 2-2v-7h-2v7z"/></svg>',eye:'<svg viewBox="0 0 24 24"><path d="M12 9a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3m0 8a5 5 0 0 1-5-5 5 5 0 0 1 5-5 5 5 0 0 1 5 5 5 5 0 0 1-5 5m0-12.5C7 4.5 2.7 7.6 1 12a11.8 11.8 0 0 0 22 0c-1.7-4.4-6-7.5-11-7.5Z"/></svg>'},mv=function(t,e={}){const{Blocks:n,Components:r}=t,i="Lightbox",o=`${zc}${bi}`,s={toolbarIconOpen:vi.eye,block:{},defaultSrc:"https://placehold.co/300/777/white.png?text=Image",cdnScript:"https://cdn.jsdelivr.net/npm/fslightbox@3.4.2/index.js",...e},{block:a,toolbarIconOpen:l,defaultSrc:c}=s,u=function(w){const x=this,C="data-fslightbox",v=window,E=()=>{var P;const A=v.refreshFsLightbox;A==null||A();const B=x.getAttribute(C);if((P=v.fsLightboxInstances)==null||P[B],!v._isEditor)return;Array.from(document.querySelectorAll(`[${C}]`)).forEach(I=>{const z=I.onclick;I.onclick=function(K){K.preventDefault();const te=I;!te.__skipLb&&(z==null||z(K)),te.__skipLb=!0}})};if(v.refreshFsLightbox)E();else{const A=document.createElement("script");A.src=w.cdnScript,A.onload=E,document.head.appendChild(A)}},f=w=>({id:`${bi}-open-lb`,label:l,command:()=>{const x=w.getView();x==null||x.toggleLightbox()}}),d="source-type",p={type:"radio",name:d,label:"Source type",changeProp:!0,options:[{id:"image",label:"Image",icon:vi.image},{id:"video",label:"Video",icon:vi.video},{id:"el",label:"Custom Element",icon:vi.external}],labelToTitle:!0},h={id:"href-image",name:"href",type:"file",label:"Source Image"},m={id:"href-video",name:"href",label:"Source Video",placeholder:"https://www.youtube.com/watch?v=..."},g={id:"href-el",name:"href",label:"Source Element",placeholder:"#custom-element-id"},y={image:[h],video:[m],el:[g]};r.addType(bi,{block:a&&{label:i,media:vi.imageLightbox,category:"Extra",select:!0,...s.block},isComponent:w=>{var x;return(x=w.hasAttribute)==null?void 0:x.call(w,Rs)},extendFn:["initToolbar"],model:{defaults:{tagName:"a",name:i,icon:vi.imageLightbox,classes:o,draggable:(w,x)=>!x.is(bi),attributes:{[Rs]:"lightbox",[Ps]:"image",href:c},components:{type:"image",src:c},script:u,cdnScript:s.cdnScript,"script-props":["attributes","cdnScript"],[d]:"image",traits:[p,{name:Rs,label:"Group name"},{type:"button",label:"Toggle Lightbox",command(w,x){var v;const C=(v=x.target)==null?void 0:v.getView();C==null||C.toggleLightbox()}}],styles:`
|
|
70
|
-
.${o} {
|
|
71
|
-
display: inline-block;
|
|
72
|
-
padding: 10px;
|
|
73
|
-
}
|
|
74
|
-
`},init(){const w=[d].map(x=>`change:${x}`).join(" ");this.on(w,this.updateTraits),this.on(`change:${d}`,this.onSourceTypeChange),this.on("change:attributes:href",this.adjustSourceType),this.updateTraits({init:!0}),this.adjustSourceType()},onSourceTypeChange(w,x,C){if(C.adjust)return;const E=this.get(d)==="video"?"video":"image";this.addAttributes({[Ps]:E,href:""})},adjustSourceType(){const w=this.get(d),x=this.getAttributes().href||"",C={adjust:!0};if(w==="video"){const v=x.includes("youtube.com")?"youtube":"video";this.addAttributes({[Ps]:v},C)}else w!=="el"&&x.startsWith("#")?this.set(d,"el",C):w==="image"&&this.addAttributes({[Ps]:"image"},C)},updateTraits(w={}){const{changed:x}=this,{init:C}=w;if(x[p.name]||C){this.removeTrait([h.name,m.name,g.name]);const v=this.get(d)||"image",E=this.getTraitIndex(d)+1;this.addTrait(y[v],{at:E})}},initToolbar(){if(!l)return;const{toolbar:w}=this,x=f(this);!w.find(v=>v.id===x.id)&&(w==null||w.unshift(x))}},view:{onRender(){this.el.__skipLb=!0},toggleLightbox(){var I;const{em:w,el:x,model:C}=this,{Canvas:v}=w,E=C.getAttributes()[Rs],{defaultView:A,documentElement:B}=x.ownerDocument,T=(I=A.fsLightboxInstances)==null?void 0:I[E];if(B.classList.contains(hv))T.close();else{x.__skipLb=!1;let z;T.props.onOpen=()=>{z=v.getSpots(),setTimeout(()=>v.removeSpots())},T.props.onClose=()=>{z.forEach(K=>v.addSpot(K.attributes))},x.click()}}}}),wr({editor:t,plan:St.startup,licenseKey:s.licenseKey,pluginName:pv,cleanup:()=>{n.remove(bi),r.removeType(bi)}})},gv=yr(mv);var Si=(t=>(t.image="image",t.video="video",t.external="external",t))(Si||{});const Dr="lightGallery",Yf=`${Dr}-item`,aa="data-lightgallery",Xf=`${aa}-item`,wa="toggle",Hr={image:'<svg viewBox="0 0 24 24"><path d="m8.5 13.5 2.5 3 3.5-4.5 4.5 6H5m16 1V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2Z"/></svg>',video:'<svg viewBox="0 0 24 24"><path d="M17 10.5V7a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-3.5l4 4v-11l-4 4Z"/></svg>',gallery:'<svg viewBox="0 0 24 24"><path d="M4,2H20A2,2 0 0,1 22,4V16A2,2 0 0,1 20,18H16L12,22L8,18H4A2,2 0 0,1 2,16V4A2,2 0 0,1 4,2M19,15V7L15,11L13,9L7,15H19M7,5A2,2 0 0,0 5,7A2,2 0 0,0 7,9A2,2 0 0,0 9,7A2,2 0 0,0 7,5Z" /></svg>',galleryItem:'<svg viewBox="0 0 24 24"><path d="M20 2H4a2 2 0 0 0-2 2v18l4-4h14a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2M8 14H6v-2h2v2m0-3H6V9h2v2m0-3H6V6h2v2m7 6h-5v-2h5v2m3-3h-8V9h8v2m0-3h-8V6h8v2Z"/></svg>',external:'<svg viewBox="0 0 24 24"><path d="M14 3v2h3.6l-9.8 9.8 1.4 1.4L19 6.4V10h2V3m-2 16H5V5h7V3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h14a2 2 0 0 0 2-2v-7h-2v7z"/></svg>',eye:'<svg viewBox="0 0 24 24"><path d="M12 9a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3m0 8a5 5 0 0 1-5-5 5 5 0 0 1 5-5 5 5 0 0 1 5 5 5 5 0 0 1-5 5m0-12.5C7 4.5 2.7 7.6 1 12a11.8 11.8 0 0 0 22 0c-1.7-4.4-6-7.5-11-7.5Z"/></svg>'},zl={propKeys:[],props:{},traits:[]},mo=(t,e={})=>{var i;const n={},r=[];for(const o in t){const{value:s,...a}=t[o];r.push({id:o,name:o,changeProp:!0,category:e.category,...a}),n[o]=s;const{subTraits:l={}}=a;for(const c in a.subTraits)(i=l[c])==null||i.forEach(u=>{const f=u.id||u.name;n[f]=u.value})}return{propKeys:Object.keys(n),props:n,traits:r}},Uc=(t,e)=>{const n=t.getTrait(e),r=n.get("category"),i=n.get("subTraits")||{},s=(Object.values(i).flat()||[]).map(c=>c.id||c.name);t.removeTrait(s);const a=i[n.getValue()],l=t.getTraitIndex(e)+1;a&&t.addTrait(a.map(c=>({category:r,...c})),{at:l})},Fl=(t,e)=>{e.forEach(n=>{const r=t.getTrait(n);if(!r||!r.get("subTraits"))return;const i=r.changeProp?`change:${n}`:`change:attributes:${n}`;t.on(i,()=>Uc(t,n)),Uc(t,n)})},bv=(t,e,n)=>{const i=t.getTrait(e).get("subTraits")||{},s=(Object.values(i).flat()||[]).map(l=>{const c=l.name||l.id;return l.changeProp?`change:${c}`:`change:attributes:${c}`}),a=Array.from(new Set(s));a.length&&t.on(a.join(" "),n)},vv={[wa]:{type:"button",label:"Toggle Gallery",command:(t,e)=>{var n,r;return(r=(n=e.target)==null?void 0:n.getView())==null?void 0:r.toggleGallery()}},speed:{type:"number",label:"Speed",tip:"Transition duration between slides (in ms)",value:400,step:50,min:0},inline:{type:"checkbox",label:"Inline Gallery",value:!1},allowMediaOverlap:{type:"checkbox",label:"Allow media overlap",tip:"If enabled, toolbar, captions and thumbnails will overlap with the media element",value:!1},controls:{type:"checkbox",label:"Show controls",tip:"If disabled, prev/next buttons will not be displayed",value:!0},counter:{type:"checkbox",label:"Show counter",tip:"Display the total number of images and index number of the currently displayed slide",value:!0},download:{type:"checkbox",label:"Download icon",tip:"Enable download button",value:!0},enableDrag:{type:"checkbox",label:"Enable drag",tip:"Enables desktop mouse drag support",value:!0},enableSwipe:{type:"checkbox",label:"Enable swipe",tip:"Enables swipe support for mobile devices",value:!0},escKey:{type:"checkbox",label:"Enable Esc key",tip:'Whether the gallery could be closed by pressing the "Esc" key',value:!0},keyPress:{type:"checkbox",label:"Enable keyboard navigation",value:!1},loop:{type:"checkbox",label:"Loop",tip:"If false, will disable the ability to loop back to the beginning of the gallery from the last slide",value:!0},getCaptionFromTitleOrAlt:{type:"checkbox",label:"Caption from title or alt",tip:"Get captions from alt or title tags",value:!0},showMaximizeIcon:{type:"checkbox",label:"Show maximize icon",value:!1},closable:{type:"checkbox",label:"Closable",tip:"If false, it won't be possible to close the gallery",value:!0},showCloseIcon:{type:"checkbox",label:"Show close icon",tip:"If false, close button won't be displayed.",visible:({component:t})=>!!t.getTrait("closable").getValue(),value:!0},closeOnTap:{type:"checkbox",label:"Close on tap",tip:"Allows clicks on black area to close gallery",visible:({component:t})=>!!t.getTrait("closable").getValue(),value:!0}},yv={thumbnail:{category:{id:"thumbnail-options",label:"Thumbnail Options"},type:"checkbox",label:"Thumbnails",value:!0,subTraits:{false:[],true:[{type:"checkbox",name:"enableThumbDrag",label:"Thumbnail drag",tip:"Enable thumbnail drag on desktop",changeProp:!0,value:!0},{type:"checkbox",name:"enableThumbSwipe",label:"Thumbnail swipe",tip:"Enable thumbnail swipe on mobile devices",changeProp:!0,value:!0},{type:"select",name:"alignThumbnails",tip:"Position of thumbnails when the width of all thumbnails combined is less than the gallery's width",label:"Align Thumbnails",value:"middle",changeProp:!0,options:[{id:"left",label:"Left"},{id:"middle",label:"Middle"},{id:"right",label:"Right"}]},{type:"select",name:"currentPagerPosition",label:"Select thumbnail position",value:"middle",changeProp:!0,options:[{id:"left",label:"Left"},{id:"middle",label:"Middle"},{id:"right",label:"Right"}]},{type:"number",name:"thumbMargin",label:"Thumb margin",tip:"Spacing between each thumbnails",changeProp:!0,min:0,value:"5"},{type:"number",name:"thumbWidth",label:"Thumb width",tip:"Width of each thumbnails",changeProp:!0,min:0,value:"100"}]}}},wv={autoplay:{category:{id:"autoplay-options",label:"Autoplay options"},type:"checkbox",label:"Autoplay",value:!0,subTraits:{false:[],true:[{type:"checkbox",name:"autoplayControls",label:"Autoplay controls",tip:"Show/hide autoplay controls",changeProp:!0,value:!0},{type:"checkbox",name:"progressBar",label:"Progress bar",tip:"Show autoplay progress bar",changeProp:!0,value:!0},{type:"checkbox",name:"forceSlideShowAutoplay",label:"Force autoplay",tip:"If false, autoplay will be stopped after first user action",changeProp:!0,value:!1},{type:"checkbox",name:"slideShowAutoplay",label:"Start autoplay",tip:"Enable autoplay on start",changeProp:!0,value:!1},{type:"number",name:"slideShowInterval",label:"Interval",tip:"The time (in ms) between each auto transition",changeProp:!0,min:0,step:50,value:5e3}]}}},xv={zoom:{category:{id:"zoom-options",label:"Zoom options"},type:"checkbox",label:"Zoom",value:!0,subTraits:{false:[],true:[{type:"checkbox",name:"actualSize",label:"Show actual size icon",changeProp:!0,value:!0},{type:"checkbox",name:"infiniteZoom",label:"Infinte zoom",changeProp:!0,value:!0},{type:"checkbox",name:"showZoomInOutIcons",label:"Show zoom in/out icons",changeProp:!0,value:!1},{type:"number",name:"scale",label:"Scale",tip:"Value of zoom should be incremented/decremented",changeProp:!0,min:0,value:1}]}}},Qn="sourceType",Vs="data-iframe",qc={name:"href",type:"file",label:"Image Source"},xa={name:"data-src",label:"Video Source",placeholder:"https://www.youtube.com/watch?v=..."},Gc={name:"data-poster",label:"Video Poster",type:"file"},Qf={name:"data-src",label:"External Source",placeholder:"https://some-external-source.com/...."},L1={label:"Caption",name:"data-sub-html",placeholder:"My caption",changeProp:!1},Sv={[wa]:{type:"button",label:"Toggle Gallery",command:(t,e)=>{var i,o;const n=e.target,r=(i=n==null?void 0:n.closestType(Dr))==null?void 0:i.getView();if(r&&n){const s=((o=r.getLightGallery())==null?void 0:o.items)||[],a=Array.from(s).indexOf(n.getEl());a>=0&&r.toggleGallery(a)}}},[Qn]:{type:"radio",label:"Source type",labelToTitle:!0,value:"image",subTraits:{image:[qc],video:[xa,Gc],external:[Qf]},options:[{id:"image",label:qc.label||"",icon:Hr.image},{id:"video",label:xa.label||"",icon:Hr.video},{id:"external",label:Qf.label||"",icon:Hr.external}]},subHtml:L1},Cv="lightGalleryComponent",ed="lgThumbnail",Ov="lgVideo",td="lgAutoplay",nd="lgZoom",yi="https://cdn.jsdelivr.net/npm/lightgallery@2.8.2",Ev=function(t,e={}){const{Blocks:n,Components:r}=t,i="LightGallery",o="LightGallery Item",s={toolbarIconOpen:Hr.eye,block:{},lgLicenseKey:"92DE1DB8-7986-4F02-B908-514F97678D28",defaultSrc:"https://placehold.co/200/777/white.png?text=Image",plugins:[ed,Ov,td,nd],cdnScript:[`${yi}/lightgallery.min.js`,`${yi}/plugins/thumbnail/lg-thumbnail.min.js`,`${yi}/plugins/video/lg-video.min.js`,`${yi}/plugins/autoplay/lg-autoplay.min.js`,`${yi}/plugins/zoom/lg-zoom.min.js`],cdnStyle:`${yi}/css/lightgallery-bundle.min.css`,...e},{block:a,toolbarIconOpen:l,defaultSrc:c}=s,u=function(x){const C=this,v=window,{plugins:E,cdnScript:A,cdnStyle:B,inline:T,lgLicenseKey:P,...I}=x||{},z=te=>isNaN(te)?void 0:parseInt(te,10),K=()=>{var Y;const te={...I,licenseKey:P,speed:z(I.speed),startAnimationDuration:z(I.startAnimationDuration),thumbMargin:z(I.thumbMargin),thumbWidth:z(I.thumbWidth),slideShowInterval:z(I.slideShowInterval),scale:z(I.scale),enableZoomAfter:z(I.enableZoomAfter),plugins:(E||[]).map(re=>v[re])};T&&(te.container=C,te.closable=!1);const H=(Y=v.lightGallery)==null?void 0:Y.call(v,C,te);T&&H.openGallery()};if(v.lightGallery)K();else{const{head:te}=document,H=Array.isArray(A)?[...A]:[A],Y=Array.isArray(B)?[...B]:[B],re=he=>{if(he.length){const pe=document.createElement("link");pe.href=he.shift(),pe.rel="stylesheet",te.appendChild(pe),re(he)}},oe=he=>{if(he.length){const pe=document.createElement("script");pe.src=he.shift(),pe.onerror=pe.onload=oe.bind(null,he),te.appendChild(pe)}else K()};re(Y),oe(H)}},f=x=>{const C=x.getTrait(wa);if(!l||!C)return;const{toolbar:v}=x,E={id:wa,label:l,command:()=>setTimeout(()=>C.runCommand(),100)};!v.find(B=>B.id===E.id)&&(v==null||v.unshift(E))};let d=[];const p=s.plugins||[],h=mo(vv),m=p.includes(ed)?mo(yv):zl,g=p.includes(td)?mo(wv):zl,y=p.includes(nd)?mo(xv):zl;r.addType(Dr,{block:a&&{label:i,media:Hr.gallery,category:"Extra",select:!0,...s.block},isComponent:x=>Bl(x,aa),extendFn:["init","initToolbar"],model:{defaults:{name:i,icon:Hr.gallery,draggable:(x,C)=>!C.is(Dr),attributes:{[aa]:!0},components:{type:Yf},script:u,selector:"",exThumbImage:"",cdnScript:s.cdnScript,cdnStyle:s.cdnStyle,plugins:s.plugins,lgLicenseKey:s.lgLicenseKey,"script-props":["lgLicenseKey","cdnScript","cdnStyle","plugins","selector","exThumbImage",...h.propKeys,...m.propKeys,...g.propKeys,...y.propKeys],...h.props,...m.props,...g.props,...y.props,traits:[...h.traits,...m.traits,...g.traits,...y.traits]},init(){Fl(this,["thumbnail"]),Fl(this,["autoplay"]),Fl(this,["zoom"])},initToolbar(){f(this)}},extendFnView:["init"],view:{events:()=>({lgInit:"onLgInit",lgBeforeOpen:"onLgOpen",lgAfterClose:"onLgClose"}),init(){const x=r.events.scriptUnmount;x&&this.listenTo(this.model,x,this.destroyLightGallery)},getLightGallery(){return this.el.__lg},destroyLightGallery(){const x=this.getLightGallery();x==null||x.destroy()},disableLgInCanvas(){const x=this.getLightGallery();x.lgOpened=!0},isInlineGallery(){var C;const x=this.getLightGallery();return((C=x==null?void 0:x.settings)==null?void 0:C.container)===this.el},onLgInit(x){this.el.__lg=x.detail.instance,!this.isInlineGallery()&&this.disableLgInCanvas()},onLgOpen(){const{em:x}=this,{Canvas:C}=x,v=this.getLightGallery();d=C.getSpots(),setTimeout(()=>C.removeSpots()),v.__lgOpened=!0},onLgClose(){const x=this.getLightGallery();d.forEach(C=>this.em.Canvas.addSpot(C.attributes)),d=[],x.__lgOpened=!1,setTimeout(()=>this.disableLgInCanvas())},toggleGallery(x){const C=this.getLightGallery();if(C.__lgOpened)return C.closeGallery(!0);C.lgOpened=!1,C.openGallery(x)}}});const w=mo(Sv);r.addType(Yf,{isComponent:x=>Bl(x,Xf)||x.tagName==="A"&&Bl(x.parentElement,aa),extendFn:["init","initToolbar"],model:{defaults:{tagName:"a",name:o,icon:Hr.galleryItem,attributes:{[Xf]:!0,href:c},components:{type:"image",attributes:{alt:"Image",src:c}},...w.props,traits:[...w.traits]},init(){const x=[Qn].map(C=>`change:${C}`).join(" ");this.initSourceType(),this.on(x,this.updateTraits),this.updateTraits({init:!0}),this.initScriptUpdate(),bv(this,Qn,this.triggerGalleryUpdate)},initToolbar(){f(this)},initScriptUpdate(){const x=[L1.name].map(C=>`change:attributes:${C}`).join(" ");this.on(x,this.triggerGalleryUpdate)},triggerGalleryUpdate(...x){var C;(C=this.closestType(Dr))==null||C.__scriptPropsChange(...x)},updateTraits(x={}){const{changed:C}=this,{init:v}=x;if(C[Qn]||v){Uc(this,Qn);const E=this.getTrait(Qn).getValue();if(E===Si.image){this.removeAttributes([xa.name,Gc.name,Vs]);const A=this.getTrait(qc.name);A.setValue(A.getValue()||c)}else E===Si.video?this.removeAttributes([Vs]):E===Si.external&&this.addAttributes({[Vs]:!0})}},initSourceType(){const x=this.getAttributes({noClass:!0,noStyle:!0});x[Vs]?this.set(Qn,Si.external):(x[xa.name]||x[Gc.name])&&this.set(Qn,Si.video)}}}),wr({editor:t,plan:St.startup,licenseKey:s.licenseKey,pluginName:Cv,cleanup:()=>{n.remove(Dr),r.removeType(Dr)}})},_v=yr(Ev),Xt="swiper",zo=`${Xt}-slide`,Pi=`${Xt}-wrapper`,Vi=`${Xt}-nav-prev`,Sa=`${Xt}-nav-next`,Di=`${Xt}-pagination`,Mo=`${Xt}-scrollbar`,ot={slider:`<svg viewBox="0 0 24 24">
|
|
75
|
-
<path d="M22 7.6c0-1-.5-1.6-1.3-1.6H3.4C2.5 6 2 6.7 2 7.6v9.8c0 1 .5 1.6 1.3 1.6h17.4c.8 0 1.3-.6 1.3-1.6V7.6zM21 18H3V7h18v11z" fill-rule="nonzero"/>
|
|
76
|
-
<path d="M4 12.5L6 14v-3zM20 12.5L18 14v-3z"/>
|
|
77
|
-
</svg>`,effect:`<svg viewBox="0 0 24 24">
|
|
78
|
-
<path d="M7.5 5.6 5 7l1.4-2.5L5 2l2.5 1.4L10 2 8.6 4.5 10 7 7.5 5.6m12 9.8L22 14l-1.4 2.5L22 19l-2.5-1.4L17 19l1.4-2.5L17 14l2.5 1.4M22 2l-1.4 2.5L22 7l-2.5-1.4L17 7l1.4-2.5L17 2l2.5 1.4L22 2m-8.7 10.8 2.5-2.5-2.1-2-2.5 2.4 2.1 2m1-5.4 2.4 2.3c.4.4.4 1 0 1.4L5 22.7a1 1 0 0 1-1.4 0l-2.3-2.3a1 1 0 0 1 0-1.4L13 7.3a1 1 0 0 1 1.4 0Z"/>
|
|
79
|
-
</svg>`,autoplay:`<svg viewBox="0 0 24 24">
|
|
80
|
-
<path d="M5 6.3A1 1 0 0 1 5 5a1 1 0 0 1 1.3 0l6.8 5.4.3.3a2 2 0 0 1-2.8 2.8l-.3-.3L5 6.3M12 20a8 8 0 0 0 8-8 8 8 0 0 0-2.3-5.7L19 5a10 10 0 0 1 3 7 10 10 0 0 1-10 10A10 10 0 0 1 2 12h2a8 8 0 0 0 8 8m0-19a2 2 0 0 1 2 2 2 2 0 0 1-2 2 2 2 0 0 1-2-2 2 2 0 0 1 2-2Z"/>
|
|
81
|
-
</svg>`,pagination:`<svg viewBox="0 0 24 24">
|
|
82
|
-
<path d="M16 12a2 2 0 0 1 2-2 2 2 0 0 1 2 2 2 2 0 0 1-2 2 2 2 0 0 1-2-2m-6 0a2 2 0 0 1 2-2 2 2 0 0 1 2 2 2 2 0 0 1-2 2 2 2 0 0 1-2-2m-6 0a2 2 0 0 1 2-2 2 2 0 0 1 2 2 2 2 0 0 1-2 2 2 2 0 0 1-2-2Z"/>
|
|
83
|
-
</svg>`,scrollbar:`<svg viewBox="0 0 24 24">
|
|
84
|
-
<path d="M7.2 9.2 5.8 7.8 1.5 12l4.3 4.2 1.4-1.4L4.4 12zm9.6 5.6 1.4 1.4 4.3-4.2-4.3-4.2-1.4 1.4 2.8 2.8z"/>
|
|
85
|
-
<path fill-rule="evenodd" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0m-2 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0" clip-rule="evenodd"/>
|
|
86
|
-
</svg>`,parallax:`<svg viewBox="0 0 24 24">
|
|
87
|
-
<path d="M12.6 23.3h-.2v.5h.2v-.5m.3-.2-.2.1v.5l.2.1v-.6m-.8 0v.6h.2v-.5z"/>
|
|
88
|
-
<path fill="currentColor" d="M18 9.4a2.5 2.5 0 0 1 3 2.3v5.7a3 3 0 0 1-2.2 2.9h-.2L13 21.4a2.5 2.5 0 0 1-3-2.3v-5.7a3 3 0 0 1 2.2-2.9h.2zM14.5 6a2.5 2.5 0 0 1 3 2.3v.4l-5.3 1A4 4 0 0 0 9 13.4v4.8a2.5 2.5 0 0 1-2.5-2.4v-5.7a3 3 0 0 1 2.2-2.9H9zM11 2.6a2.5 2.5 0 0 1 3 2.3v.3l-5.3 1A4 4 0 0 0 5.5 10v4.8A2.5 2.5 0 0 1 3 12.3V6.6a3 3 0 0 1 2.2-2.9h.2z"/>
|
|
89
|
-
</svg>`,responsive:`<svg viewBox="0 0 24 24">
|
|
90
|
-
<path d="M17 21q-.4 0-.7-.3T16 20V10q0-.8-.6-1.4T14 8h-3.5q-.4 0-.7-.3T9.5 7V4q0-.4.3-.7t.7-.3H20q.4 0 .7.3t.3.7v16q0 .4-.3.7t-.7.3zm-6.5 0q-.4 0-.7-.3t-.3-.7v-9q0-.4.3-.7t.7-.3H13q.4 0 .7.3t.3.7v9q0 .4-.3.7t-.7.3zM4 21q-.4 0-.7-.3T3 20v-9q0-.4.3-.7T4 10h2.5q.4 0 .7.3t.3.7v9q0 .4-.3.7t-.7.3z"/>
|
|
91
|
-
</svg>`,extra:`<svg viewBox="0 0 24 24">
|
|
92
|
-
<path fill-rule="evenodd" d="M5.4 3h13.2A2.4 2.4 0 0 1 21 5.4v13.2a2.4 2.4 0 0 1-2.4 2.4H5.4A2.4 2.4 0 0 1 3 18.6V5.4A2.4 2.4 0 0 1 5.4 3M5 12a2 2 0 1 1 4 0 2 2 0 0 1-4 0m5 0a2 2 0 1 1 4 0 2 2 0 0 1-4 0m7-2a2 2 0 1 0 0 4 2 2 0 0 0 0-4" clip-rule="evenodd"/>
|
|
93
|
-
</svg>`,reload:`<svg viewBox="0 0 24 24">
|
|
94
|
-
<path d="M2 12c0 5 4 9 9 9 2.4 0 4.7-1 6.4-2.6l-1.5-1.5A6.7 6.7 0 0 1 11 19a7 7 0 1 1 7-7h-3l4 4h.1l3.9-4h-3a9 9 0 0 0-18 0Z"/>
|
|
95
|
-
</svg>`,prev:'<svg viewBox="0 0 24 24"><path d="M15.4 16.6 10.8 12l4.6-4.6L14 6l-6 6 6 6 1.4-1.4Z"/></svg>',next:'<svg viewBox="0 0 24 24"><path d="m8.6 16.6 4.6-4.6-4.6-4.6L10 6l6 6-6 6-1.4-1.4Z"/></svg>',add:`<svg viewBox="0 0 24 24">
|
|
96
|
-
<path d="M12 20a8 8 0 1 1 0-16 8 8 0 0 1 0 16m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2m1 5h-2v4H7v2h4v4h2v-4h4v-2h-4V7Z"/>
|
|
97
|
-
</svg>`},rd={id:"swiper-responsive",label:"Responsive",icon:ot.responsive},id={id:"swiper-extra",label:"Extra",icon:ot.extra},kv={actions:{type:"radio",label:!1,labelToTitle:!0,options:[{id:"r",label:"Reload slider",icon:ot.reload},{id:"p",label:"Previous slide",icon:ot.prev},{id:"n",label:"Next slide",icon:ot.next},{id:"a",label:"Add new slide",icon:ot.add}],setValue:({component:t,value:e})=>{var r;const n=(r=t.getView())==null?void 0:r.getSwiper();switch(e){case"r":t.reloadSlider();break;case"p":n==null||n.slidePrev();break;case"n":n==null||n.slideNext();break;case"a":t.addSlide();break}}},vertical:{type:"checkbox",label:"Vertical",value:!1},loop:{type:"checkbox",label:"Loop",value:!1},freeMode:{type:"checkbox",label:"Free mode",value:!1},autoHeight:{type:"checkbox",label:"Auto height",value:!1},navigation:{type:"checkbox",label:"Navigation",getValue:({component:t})=>!!t.findFirstType(Vi),setValue:({component:t,value:e})=>{var n,r;e?t.append([{type:Vi},{type:Sa}]):((n=t.findFirstType(Vi))==null||n.remove(),(r=t.findFirstType(Sa))==null||r.remove()),t.set({navigation:e})}},initialSlide:{type:"number",label:"Initial slide",min:0,value:"0"},speed:{type:"number",label:"Speed",tip:"Transition duration (in ms)",step:500,min:0,value:300},effect:{category:{id:"swiper-effect",label:"Effects",icon:ot.effect},type:"select",label:"Effect Type",value:"slide",options:[{id:"slide",label:"Slide"},{id:"fade",label:"Fade"},{id:"cube",label:"Cube"},{id:"coverflow",label:"Coverflow"},{id:"flip",label:"Flip"},{id:"cards",label:"Cards"}],subTraits:{slide:[{type:"number",name:"slidesPerView",label:"Slides per view",changeProp:!0,min:1,value:1},{type:"number",name:"slidesPerGroup",label:"Slides per group",tip:"Numbers of slides for group sliding",changeProp:!0,min:1,value:1},{type:"number",name:"spaceBetween",label:"Space between",tip:"Distance between slides in px",changeProp:!0,min:0,value:0},{type:"number",name:"slidesOffsetBefore",label:"Slides offset before",tip:"Add additional slide offset in the beginning of the container (in px, before all slides)",changeProp:!0,min:0,value:0},{type:"number",name:"slidesOffsetAfter",label:"Slides offset after",tip:"Add additional slide offset in the end of the container (in px, after all slides)",changeProp:!0,min:0,value:0},{type:"checkbox",name:"centeredSlides",label:"Centered slides",tip:"If enabled, the active slide will be centered",changeProp:!0,value:!1}],fade:[{type:"checkbox",name:"crossFade",tip:"Enables slides cross fade",label:"Cross fade",changeProp:!0,value:!1}],cube:[{type:"checkbox",name:"cubeEffectShadow",label:"Shadow",changeProp:!0,value:!0},{type:"checkbox",name:"cubeEffectSlideShadows",label:"Slide shadows",changeProp:!0,value:!0},{type:"number",name:"cubeEffectShadowOffset",label:"Shadow offset",changeProp:!0,value:20},{type:"number",name:"cubeEffectShadowScale",label:"Shadow scale",changeProp:!0,value:.94}],coverflow:[{type:"number",name:"coverflowEffectDepth",tip:"Depth offset in px (slides translate in Z axis)",label:"Depth",changeProp:!0,min:0,value:100},{type:"number",name:"coverflowEffectModifier",tip:"Effect multiplier",label:"Modifier",changeProp:!0,step:.1,min:0,value:1},{type:"number",name:"coverflowEffectRotate",tip:"Slide rotate in degrees",label:"Rotate",changeProp:!0,min:0,value:50},{type:"number",name:"coverflowEffectScale",tip:"Slide scale effect",label:"Scale",changeProp:!0,min:0,step:.1,value:1},{type:"number",name:"coverflowEffectStretch",tip:"Stretch space between slides (in px)",label:"Stretch",changeProp:!0,min:0,value:0},{type:"checkbox",name:"coverflowEffectSlideShadows",tip:"Enables slides shadows",label:"Slide shadow",changeProp:!0,value:!0}],flip:[{type:"checkbox",name:"flipEffectLimitRotation",tip:"Limit edge slides rotation",label:"Limit rotation",changeProp:!0,value:!0},{type:"checkbox",name:"flipEffectSlideShadows",tip:"Enables slides shadows",label:"Slide shadows",changeProp:!0,value:!0}],cards:[{type:"number",name:"cardsEffectPerSlideOffset",tip:"Offset distance per slide (in px)",label:"Slide offset",changeProp:!0,min:0,value:8},{type:"number",name:"cardsEffectPerSlideRotate",tip:"Rotate angle per slide (in degrees)",label:"Slide rotate",changeProp:!0,min:0,value:2},{type:"checkbox",name:"cardsEffectRotate",tip:"Enables cards rotation",label:"Rotate",changeProp:!0,value:!0},{type:"checkbox",name:"cardsEffectSlideShadows",tip:"Enables slides shadows",label:"Slide shadows",changeProp:!0,value:!0}]}},autoplay:{category:{id:"swiper-autoplay",label:"Autoplay",icon:ot.autoplay},type:"checkbox",label:"Enable Autoplay",value:!1,subTraits:{true:[{type:"number",name:"autoplayDelay",label:"Delay",changeProp:!0,value:3e3},{type:"checkbox",name:"autoplayDisableOnInteraction",label:"Disable on interaction",changeProp:!0,value:!0},{type:"checkbox",name:"autoplayWaitForTransition",label:"Wait for transition",changeProp:!0,value:!0},{type:"checkbox",name:"autoplayPauseOnMouseEnter",label:"Pause on mouse enter",changeProp:!0,value:!1},{type:"checkbox",name:"autoplayReverseDirection",label:"Reverse direction",changeProp:!0,value:!1},{type:"checkbox",name:"autoplayStopOnLastSlide",label:"Stop on last slide",changeProp:!0,value:!1}]}},pagination:{category:{id:"swiper-pagination",label:"Pagination",icon:ot.pagination},type:"select",label:"Pagination Type",options:[{id:"none",label:"None"},{id:"bullets",label:"Bullets"},{id:"progressbar",label:"Progressbar"},{id:"fraction",label:"Fraction"}],getValue:({component:t})=>t.findFirstType(Di)?t.get("pagination")||"bullets":"none",setValue:({component:t,value:e})=>{const n=t.findFirstType(Di);n==null||n.remove(),e!=="none"&&t.append({type:Di}),t.set({pagination:e})},subTraits:{bullets:[{type:"checkbox",name:"dynamicBullets",label:"Dynamic bullets",changeProp:!0,value:!1},{type:"checkbox",name:"clickableBullets",label:"Clickable bullets",changeProp:!0,value:!0}],progressbar:[{type:"checkbox",name:"progressbarOpposite",label:"Progress opposite",changeProp:!0,value:!1}]}},scrollbar:{category:{id:"swiper-scrollbar",label:"Scrollbar",icon:ot.scrollbar},type:"checkbox",label:"Enable Scrollbar",getValue:({component:t})=>!!t.findFirstType(Mo),setValue:({component:t,value:e})=>{const n=t.findFirstType(Mo);n==null||n.remove(),e&&t.append({type:Mo}),t.set({scrollbar:e})},subTraits:{false:[],true:[{type:"checkbox",name:"scrollbarDraggable",label:"Draggable",changeProp:!0,value:!1},{type:"checkbox",name:"scrollbarHide",label:"Hide",tip:"Hide scrollbar automatically after user interaction",changeProp:!0,value:!0}]}},parallax:{category:{id:"swiper-parallax",label:"Parallax",icon:ot.parallax},type:"checkbox",label:"Enable Parallax",value:!1},mobile:{category:rd,type:"checkbox",label:"Enable mobile breakpoint",value:!1,subTraits:{true:[{type:"number",name:"mobileBreakpoint",label:"Mobile breakpoint",tip:"Slide values below will be applied when the screen width is greater than this value",changeProp:!0,min:1,value:460},{type:"number",name:"mobileSlidesPerView",label:"Slides per view",changeProp:!0,min:1,value:1},{type:"number",name:"mobileSlidesPerGroup",label:"Slides per group",changeProp:!0,min:1,value:1},{type:"number",name:"mobileSpaceBetween",label:"Space between",changeProp:!0,min:0,value:0}]}},tablet:{category:rd,type:"checkbox",label:"Enable tablet breakpoint",value:!1,subTraits:{true:[{type:"number",name:"tabletBreakpoint",label:"Tablet breakpoint",tip:"Slide values below will be applied when the screen width is greater than this value",changeProp:!0,min:1,value:991},{type:"number",name:"tabletSlidesPerView",label:"Slides per view",changeProp:!0,min:1,value:1},{type:"number",name:"tabletSlidesPerGroup",label:"Slides per group",changeProp:!0,min:1,value:1},{type:"number",name:"tabletSpaceBetween",label:"Space between",changeProp:!0,min:0,value:0}]}},allowTouchMove:{category:id,type:"checkbox",label:"Allow touch move",tip:"Allow touch interactions",value:!0},grabCursor:{category:id,type:"checkbox",label:"Grab cursor",tip:'If enabled, the user will see the "grab" cursor when hover the slider',value:!1}},od="Slider",Kc="swiper",oo=`${Kc}-`,Av=(t,e)=>{const{Components:n,Blocks:r,Commands:i}=t,{block:o}=e,s=Tb(kv),a="core:preview",l=i.events,c=function(d){const p=this,h=window,m=p.__onLoad,g=p.__activeSlide,y=p.__inPreview,{cdnScript:w,cdnStyle:x,slidesPerView:C}=d||{},v=A=>isNaN(A)?void 0:parseFloat(A),E=()=>{const A={loop:d.loop,speed:d.speed,initialSlide:d.initialSlide,direction:d.vertical?"vertical":"horizontal",effect:d.effect,freeMode:d.freeMode,parallax:d.parallax,autoHeight:d.autoHeight,allowTouchMove:d.allowTouchMove,grabCursor:d.grabCursor,simulateTouch:!0,breakpoints:{},slidesPerView:isNaN(C)?C:v(C),slidesPerGroup:v(d.slidesPerGroup),spaceBetween:v(d.spaceBetween),slidesOffsetBefore:v(d.slidesOffsetBefore),slidesOffsetAfter:v(d.slidesOffsetAfter),centeredSlides:d.centeredSlides,fadeEffect:{crossFade:d.crossFade},cubeEffect:{shadow:d.cubeEffectShadow,slideShadows:d.cubeEffectSlideShadows,shadowOffset:v(d.cubeEffectShadowOffset),shadowScale:v(d.cubeEffectShadowScale)},coverflowEffect:{depth:v(d.coverflowEffectDepth),modifier:v(d.coverflowEffectModifier),rotate:v(d.coverflowEffectRotate),scale:v(d.coverflowEffectScale),stretch:v(d.coverflowEffectStretch),slideShadows:d.coverflowEffectSlideShadows},flipEffect:{limitRotation:d.flipEffectLimitRotation,slideShadows:d.flipEffectSlideShadows},cardsEffect:{perSlideOffset:v(d.cardsEffectPerSlideOffset),perSlideRotate:v(d.cardsEffectPerSlideRotate),rotate:d.cardsEffectRotate,slideShadows:d.cardsEffectSlideShadows},navigation:{nextEl:p.querySelector(".swiper-button-next"),prevEl:p.querySelector(".swiper-button-prev")},pagination:{type:d.pagination||"bullets",dynamicBullets:d.dynamicBullets,clickable:d.clickableBullets,progressbarOpposite:d.progressbarOpposite,el:p.querySelector(".swiper-pagination")},scrollbar:{el:p.querySelector(".swiper-scrollbar"),draggable:d.scrollbarDraggable,hide:d.scrollbarHide},autoplay:d.autoplay&&{delay:d.autoplayDelay,disableOnInteraction:d.autoplayDisableOnInteraction,pauseOnMouseEnter:d.autoplayPauseOnMouseEnter,reverseDirection:d.autoplayReverseDirection,stopOnLastSlide:d.autoplayStopOnLastSlide,waitForTransition:d.autoplayWaitForTransition}};if(d.tablet){const{tabletBreakpoint:T,tabletSlidesPerView:P}=d,I=v(T);A.breakpoints[I]={slidesPerView:isNaN(P)?P:v(P),slidesPerGroup:v(d.tabletSlidesPerGroup),spaceBetween:v(d.tabletSpaceBetween)}}if(d.mobile){const{mobileBreakpoint:T,mobileSlidesPerView:P}=d,I=v(T);A.breakpoints[I]={slidesPerView:isNaN(P)?P:v(P),slidesPerGroup:v(d.mobileSlidesPerGroup),spaceBetween:v(d.mobileSpaceBetween)}}m&&!y&&(A.simulateTouch=!1),g&&(A.initialSlide=g);const B=new h.Swiper(p,A);m==null||m(B)};if(h.Swiper)E();else{const{head:A}=document,B=Array.isArray(w)?[...w]:[w],T=Array.isArray(x)?[...x]:[x],P=z=>{if(z.length){const K=document.createElement("link");K.href=z.shift(),K.rel="stylesheet",A.appendChild(K),P(z)}},I=z=>{if(z.length){const K=document.createElement("script");K.src=z.shift(),K.onerror=K.onload=I.bind(null,z),A.appendChild(K)}else E()};P(T),I(B)}},u=(d=0)=>({type:zo,style:{padding:"50px"},components:{type:"text",components:{type:"textnode",content:`Slide ${d}`}}}),f=n.getType("default").model;return n.addType(Xt,{block:o&&{label:od,media:ot.slider,category:"Extra",select:!0,...e.block},isComponent:d=>Yr(d,Kc),model:{defaults:()=>({name:od,icon:ot.slider,classes:Kc,draggable:(d,p)=>!p.is(Xt),components:[{type:Pi,components:[u(1),u(2),u(3)]},{type:Di}],script:c,cdnScript:e.cdnScript,cdnStyle:e.cdnStyle,"script-props":["cdnScript","cdnStyle",...s.propKeys],...s.props,traits:[...s.traits]}),init(){const{em:d}=this;Mb(this,s.traits),Nb(this,s.propKeys),this.listenTo(d,`${l.runCommand}${a}`,this.onPreviewOn),this.listenTo(d,`${l.stopCommand}${a}`,this.onPreviewOff)},onPreviewOn(){this.__inPreview=!0,this.reloadSlider()},onPreviewOff(){this.__inPreview=!1,this.reloadSlider()},reloadSlider(){this.trigger("rerender")},addSlide(){const d=this.findFirstType(Pi);d==null||d.append(this.getNewSlideComponentDef())},getNewSlideComponentDef(){var p;const d=((p=this.findFirstType(Pi))==null?void 0:p.components().length)||0;return{type:zo,components:{type:"text",components:{type:"textnode",content:`Slide ${d+1}`}}}},toJSON(...d){const p=f.prototype.toJSON.apply(this,d);return s.propsNoValues.forEach(h=>delete p[h]),delete p["script-props"],p}},view:{init(){const d=n.events.scriptUnmount;d&&this.listenTo(this.model,d,this.destroySwiper)},getSwiper(){return this.el.swiper},destroySwiper(){var d;(d=this.getSwiper())==null||d.destroy()},onRender(){const d=this.el;d.__onLoad=p=>p.on("slideChange",()=>this.__activeSlide=p.activeIndex),d.__activeSlide=this.__activeSlide,d.__inPreview=this.model.__inPreview}}}),()=>{n.removeType(Xt),r.remove(Xt)}},Tv="Nav Prev",Mv="Nav Next",Ds=`${oo}button-prev`,Ls=`${oo}button-next`,Nv=t=>{const{Components:e}=t,n=r=>({type:"svg",selectable:!1,hoverable:!1,attributes:{viewBox:"0 0 27 44"},components:{type:"svg-in",tagName:"path",attributes:{d:r,fill:"currentColor"}}});return e.addType(Vi,{isComponent:r=>Yr(r,Ds),model:{defaults:{name:Tv,classes:Ds,copyable:!1,highlightable:!1,droppable:!1,draggable:!1,selectable:!1,hoverable:!1,layerable:!1,components:n("M0,22L22,0l2.1,2.1L4.2,22l19.9,19.9L22,44L0,22L0,22L0,22z"),styles:`
|
|
98
|
-
.${Ds} {
|
|
99
|
-
color: inherit;
|
|
100
|
-
}
|
|
101
|
-
.${Ds}:after {
|
|
102
|
-
content: none;
|
|
103
|
-
}
|
|
104
|
-
`}}}),e.addType(Sa,{extend:Vi,isComponent:r=>Yr(r,Ls),model:{defaults:{name:Mv,classes:Ls,components:n("M27,22L27,22L5,44l-2.1-2.1L22.8,22L2.9,2.1L5,0L27,22L27,22z"),styles:`
|
|
105
|
-
.${Ls} {
|
|
106
|
-
color: inherit;
|
|
107
|
-
}
|
|
108
|
-
.${Ls}:after {
|
|
109
|
-
content: none;
|
|
110
|
-
}
|
|
111
|
-
`}}}),()=>{e.removeType(Vi),e.removeType(Sa)}},Rv=t=>{const{Components:e}=t,n=`${oo}pagination`;return e.addType(Di,{isComponent:r=>Yr(r,n),model:{defaults:{name:"Pagination",classes:n,copyable:!1,highlightable:!1,droppable:!1,draggable:!1,selectable:!1,hoverable:!1,layerable:!1,styles:`
|
|
112
|
-
.${n}-bullet-active {
|
|
113
|
-
background-color: currentColor;
|
|
114
|
-
}
|
|
115
|
-
.${n}-progressbar-fill {
|
|
116
|
-
--swiper-pagination-color: currentColor;
|
|
117
|
-
}
|
|
118
|
-
`}}}),()=>{e.removeType(Di)}},Pv="Scrollbar",sd=`${oo}scrollbar`,Vv=t=>{const{Components:e}=t;return e.addType(Mo,{isComponent:n=>Yr(n,sd),model:{defaults:{name:Pv,classes:sd,copyable:!1,highlightable:!1,removable:!1,selectable:!1,hoverable:!1,layerable:!1,droppable:!1,draggable:!1}}}),()=>{e.removeType(Mo)}},Dv="Slide",ad=`${oo}slide`,Lv=t=>{const{Components:e}=t;return e.addType(zo,{isComponent:n=>Yr(n,ad),model:{defaults:{name:Dv,classes:ad,icon:ot.slider,draggable:(n,r)=>r.is(Pi)}}}),()=>{e.removeType(zo)}},jv="Wrapper",ld=`${oo}wrapper`,Hv=t=>{const{Components:e}=t,{events:n}=e;return e.addType(Pi,{isComponent:r=>Yr(r,ld),model:{defaults:{name:jv,icon:ot.slider,classes:ld,copyable:!1,removable:!1,draggable:!1,highlightable:!1,droppable:r=>r.is(zo)},init(){const r=this.components();this.listenTo(r,"add remove",this.updateSlider)},updateSlider(r){const i=this.closestType(Xt);if(i){const o=i.getView();i.reloadSlider();const s=n.scriptMount;s&&this.em.once(s,()=>{setTimeout(()=>{var a;return(a=o.getSwiper())==null?void 0:a.slideTo(r.index())},100)})}}}}),()=>{e.removeType(Pi)}},Iv="swiperComponent",Bv=function(t,e={}){const n={block:{},cdnScript:"https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js",cdnStyle:"https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css",...e},r=[Av(t,n),Nv(t),Hv(t),Lv(t),Rv(t),Vv(t)];wr({editor:t,plan:St.startup,licenseKey:n.licenseKey,pluginName:Iv,cleanup:()=>{r.forEach(i=>i())}})},$v=yr(Bv),zv=t=>t.dispatchEvent(new CustomEvent("input"));function Fv(t,e){if(!e)return()=>{};const n=t.Components.events,r=u=>t.getSelectedAll().includes(u),i=u=>u.isInstanceOf("text")&&!u.isChildOf("text"),o=u=>u.isChildOf("text"),s=u=>t.getEditing()===u,a=(u,f={})=>{u.trigger("focus",f.event)},l=(u,f)=>{r(u)&&i(u)&&!s(u)&&a(u,f)},c=(u,f)=>{if(r(u)&&!i(u)&&o(u)){const d=u.parents().find(p=>p.isInstanceOf("text"));d&&(a(d,f),setTimeout(()=>t.select(d),0))}};return t.on(n.select,l),t.on(n.selectBefore,c),()=>{t.off(n.select,l),t.off(n.selectBefore,c)}}function Gu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Zc={exports:{}},go={};/**
|
|
59
|
+
`}}}),r.addType(f,{model:{toHTML(){return""},defaults:{tagName:"button",attributes:{class:f,"data-type-role":f},components:"Dialog (click me to open)",droppable:!1,draggable:!1}},view:{init(){const{em:g,el:b}=this,v="core:preview",y=g.Commands.events;this.listenTo(g,`${y.runCommand}${v}`,()=>{b.style.display="none"}),this.listenTo(g,`${y.stopCommand}${v}`,()=>{b.style.display=""})}}}),wr({editor:t,licenseKey:o,plan:Ht.startup,pluginName:N2,cleanup:()=>{n.remove(i),r.removeType(i)}})},D2=xr(P2);var vt=(t=>(t.toastAdd="studio:toastAdd",t.dialogOpen="studio:dialogOpen",t.dialogClose="studio:dialogClose",t.sidebarLeftSet="studio:sidebarLeft:set",t.sidebarLeftGet="studio:sidebarLeft:get",t.sidebarLeftToggle="studio:sidebarLeft:toggle",t.sidebarRightSet="studio:sidebarRight:set",t.sidebarRightGet="studio:sidebarRight:get",t.sidebarRightToggle="studio:sidebarRight:toggle",t.sidebarTopSet="studio:sidebarTop:set",t.sidebarTopGet="studio:sidebarTop:get",t.sidebarTopToggle="studio:sidebarTop:toggle",t.sidebarBottomSet="studio:sidebarBottom:set",t.sidebarBottomGet="studio:sidebarBottom:get",t.sidebarBottomToggle="studio:sidebarBottom:toggle",t.symbolAdd="studio:symbolAdd",t.symbolDetach="studio:symbolDetach",t.symbolOverride="studio:symbolOverride",t.symbolPropagateStyles="studio:propagateStyles",t.getPagesConfig="studio:getPagesConfig",t.setPagesConfig="studio:setPagesConfig",t.getPageSettings="studio:getPageSettings",t.setPageSettings="studio:setPageSettings",t.projectFiles="studio:projectFiles",t.canvasReload="studio:canvasReload",t.getBlocksPanel="studio:getBlocksPanel",t.setBlocksPanel="studio:setBlocksPanel",t.getStateContextMenu="studio:getStateContextMenu",t.setStateContextMenu="studio:setStateContextMenu",t.contextMenuComponent="studio:contextMenuComponent",t.layoutAdd="studio:layoutAdd",t.layoutRemove="studio:layoutRemove",t.layoutToggle="studio:layoutToggle",t.getStateTheme="studio:getStateTheme",t.setStateTheme="studio:setStateTheme",t.assetProviderGet="studio:assetProviderGet",t.assetProviderAdd="studio:assetProviderAdd",t.assetProviderRemove="studio:assetProviderRemove",t))(vt||{}),S0=(t=>(t.layoutToggleId="studio:layoutToggle:",t.toggleBlocksPanel="studio:toggleBlocksPanel",t.pageSettingsUpdate="studio:pageSettingsUpdate",t))(S0||{});function Xf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Id={exports:{}},ks={};/**
|
|
119
60
|
* @license React
|
|
120
61
|
* react-jsx-runtime.production.min.js
|
|
121
62
|
*
|
|
@@ -123,7 +64,7 @@
|
|
|
123
64
|
*
|
|
124
65
|
* This source code is licensed under the MIT license found in the
|
|
125
66
|
* LICENSE file in the root directory of this source tree.
|
|
126
|
-
*/var
|
|
67
|
+
*/var Ph;function L2(){if(Ph)return ks;Ph=1;var t=m,e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function s(l,a,c){var u,d={},f=null,p=null;c!==void 0&&(f=""+c),a.key!==void 0&&(f=""+a.key),a.ref!==void 0&&(p=a.ref);for(u in a)r.call(a,u)&&!i.hasOwnProperty(u)&&(d[u]=a[u]);if(l&&l.defaultProps)for(u in a=l.defaultProps,a)d[u]===void 0&&(d[u]=a[u]);return{$$typeof:e,type:l,key:f,ref:p,props:d,_owner:o.current}}return ks.Fragment=n,ks.jsx=s,ks.jsxs=s,ks}var Ts={},Dh;function V2(){if(Dh)return Ts;Dh=1;var t={};/**
|
|
127
68
|
* @license React
|
|
128
69
|
* react-jsx-runtime.development.js
|
|
129
70
|
*
|
|
@@ -131,52 +72,29 @@
|
|
|
131
72
|
*
|
|
132
73
|
* This source code is licensed under the MIT license found in the
|
|
133
74
|
* LICENSE file in the root directory of this source tree.
|
|
134
|
-
*/return t.NODE_ENV!=="production"&&function(){var e=
|
|
135
|
-
`+Q+
|
|
136
|
-
`),
|
|
137
|
-
`),
|
|
138
|
-
`+
|
|
75
|
+
*/return t.NODE_ENV!=="production"&&function(){var e=m,n=Symbol.for("react.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),b=Symbol.iterator,v="@@iterator";function y(O){if(O===null||typeof O!="object")return null;var Z=b&&O[b]||O[v];return typeof Z=="function"?Z:null}var w=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(O){{for(var Z=arguments.length,le=new Array(Z>1?Z-1:0),ye=1;ye<Z;ye++)le[ye-1]=arguments[ye];C("error",O,le)}}function C(O,Z,le){{var ye=w.ReactDebugCurrentFrame,$e=ye.getStackAddendum();$e!==""&&(Z+="%s",le=le.concat([$e]));var Ge=le.map(function(je){return String(je)});Ge.unshift("Warning: "+Z),Function.prototype.apply.call(console[O],console,Ge)}}var x=!1,E=!1,_=!1,M=!1,k=!1,j;j=Symbol.for("react.module.reference");function N(O){return!!(typeof O=="string"||typeof O=="function"||O===o||O===s||k||O===i||O===u||O===d||M||O===g||x||E||_||typeof O=="object"&&O!==null&&(O.$$typeof===p||O.$$typeof===f||O.$$typeof===l||O.$$typeof===a||O.$$typeof===c||O.$$typeof===j||O.getModuleId!==void 0))}function P(O,Z,le){var ye=O.displayName;if(ye)return ye;var $e=Z.displayName||Z.name||"";return $e!==""?le+"("+$e+")":le}function z(O){return O.displayName||"Context"}function W(O){if(O==null)return null;if(typeof O.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof O=="function")return O.displayName||O.name||null;if(typeof O=="string")return O;switch(O){case o:return"Fragment";case r:return"Portal";case s:return"Profiler";case i:return"StrictMode";case u:return"Suspense";case d:return"SuspenseList"}if(typeof O=="object")switch(O.$$typeof){case a:var Z=O;return z(Z)+".Consumer";case l:var le=O;return z(le._context)+".Provider";case c:return P(O,O.render,"ForwardRef");case f:var ye=O.displayName||null;return ye!==null?ye:W(O.type)||"Memo";case p:{var $e=O,Ge=$e._payload,je=$e._init;try{return W(je(Ge))}catch{return null}}}return null}var F=Object.assign,$=0,J,ee,L,I,A,R,q;function D(){}D.__reactDisabledLog=!0;function V(){{if($===0){J=console.log,ee=console.info,L=console.warn,I=console.error,A=console.group,R=console.groupCollapsed,q=console.groupEnd;var O={configurable:!0,enumerable:!0,value:D,writable:!0};Object.defineProperties(console,{info:O,log:O,warn:O,error:O,group:O,groupCollapsed:O,groupEnd:O})}$++}}function te(){{if($--,$===0){var O={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:F({},O,{value:J}),info:F({},O,{value:ee}),warn:F({},O,{value:L}),error:F({},O,{value:I}),group:F({},O,{value:A}),groupCollapsed:F({},O,{value:R}),groupEnd:F({},O,{value:q})})}$<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var G=w.ReactCurrentDispatcher,Q;function se(O,Z,le){{if(Q===void 0)try{throw Error()}catch($e){var ye=$e.stack.trim().match(/\n( *(at )?)/);Q=ye&&ye[1]||""}return`
|
|
76
|
+
`+Q+O}}var be=!1,de;{var Pe=typeof WeakMap=="function"?WeakMap:Map;de=new Pe}function X(O,Z){if(!O||be)return"";{var le=de.get(O);if(le!==void 0)return le}var ye;be=!0;var $e=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Ge;Ge=G.current,G.current=null,V();try{if(Z){var je=function(){throw Error()};if(Object.defineProperty(je.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(je,[])}catch(Gt){ye=Gt}Reflect.construct(O,[],je)}else{try{je.call()}catch(Gt){ye=Gt}O.call(je.prototype)}}else{try{throw Error()}catch(Gt){ye=Gt}O()}}catch(Gt){if(Gt&&ye&&typeof Gt.stack=="string"){for(var Ae=Gt.stack.split(`
|
|
77
|
+
`),It=ye.stack.split(`
|
|
78
|
+
`),ct=Ae.length-1,pt=It.length-1;ct>=1&&pt>=0&&Ae[ct]!==It[pt];)pt--;for(;ct>=1&&pt>=0;ct--,pt--)if(Ae[ct]!==It[pt]){if(ct!==1||pt!==1)do if(ct--,pt--,pt<0||Ae[ct]!==It[pt]){var Cn=`
|
|
79
|
+
`+Ae[ct].replace(" at new "," at ");return O.displayName&&Cn.includes("<anonymous>")&&(Cn=Cn.replace("<anonymous>",O.displayName)),typeof O=="function"&&de.set(O,Cn),Cn}while(ct>=1&&pt>=0);break}}}finally{be=!1,G.current=Ge,te(),Error.prepareStackTrace=$e}var Si=O?O.displayName||O.name:"",Do=Si?se(Si):"";return typeof O=="function"&&de.set(O,Do),Do}function qe(O,Z,le){return X(O,!1)}function Qe(O){var Z=O.prototype;return!!(Z&&Z.isReactComponent)}function at(O,Z,le){if(O==null)return"";if(typeof O=="function")return X(O,Qe(O));if(typeof O=="string")return se(O);switch(O){case u:return se("Suspense");case d:return se("SuspenseList")}if(typeof O=="object")switch(O.$$typeof){case c:return qe(O.render);case f:return at(O.type,Z,le);case p:{var ye=O,$e=ye._payload,Ge=ye._init;try{return at(Ge($e),Z,le)}catch{}}}return""}var xt=Object.prototype.hasOwnProperty,wt={},rn=w.ReactDebugCurrentFrame;function Le(O){if(O){var Z=O._owner,le=at(O.type,O._source,Z?Z.type:null);rn.setExtraStackFrame(le)}else rn.setExtraStackFrame(null)}function ot(O,Z,le,ye,$e){{var Ge=Function.call.bind(xt);for(var je in O)if(Ge(O,je)){var Ae=void 0;try{if(typeof O[je]!="function"){var It=Error((ye||"React class")+": "+le+" type `"+je+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof O[je]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw It.name="Invariant Violation",It}Ae=O[je](Z,je,ye,le,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ct){Ae=ct}Ae&&!(Ae instanceof Error)&&(Le($e),S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",ye||"React class",le,je,typeof Ae),Le(null)),Ae instanceof Error&&!(Ae.message in wt)&&(wt[Ae.message]=!0,Le($e),S("Failed %s type: %s",le,Ae.message),Le(null))}}}var T=Array.isArray;function re(O){return T(O)}function ie(O){{var Z=typeof Symbol=="function"&&Symbol.toStringTag,le=Z&&O[Symbol.toStringTag]||O.constructor.name||"Object";return le}}function Ce(O){try{return Xe(O),!1}catch{return!0}}function Xe(O){return""+O}function Te(O){if(Ce(O))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ie(O)),Xe(O)}var me=w.ReactCurrentOwner,on={key:!0,ref:!0,__self:!0,__source:!0},yn,ft,Ut;Ut={};function Sr(O){if(xt.call(O,"ref")){var Z=Object.getOwnPropertyDescriptor(O,"ref").get;if(Z&&Z.isReactWarning)return!1}return O.ref!==void 0}function xn(O){if(xt.call(O,"key")){var Z=Object.getOwnPropertyDescriptor(O,"key").get;if(Z&&Z.isReactWarning)return!1}return O.key!==void 0}function it(O,Z){if(typeof O.ref=="string"&&me.current&&Z&&me.current.stateNode!==Z){var le=W(me.current.type);Ut[le]||(S('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',W(me.current.type),O.ref),Ut[le]=!0)}}function et(O,Z){{var le=function(){yn||(yn=!0,S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Z))};le.isReactWarning=!0,Object.defineProperty(O,"key",{get:le,configurable:!0})}}function Rt(O,Z){{var le=function(){ft||(ft=!0,S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Z))};le.isReactWarning=!0,Object.defineProperty(O,"ref",{get:le,configurable:!0})}}var wn=function(O,Z,le,ye,$e,Ge,je){var Ae={$$typeof:n,type:O,key:Z,ref:le,props:je,_owner:Ge};return Ae._store={},Object.defineProperty(Ae._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Ae,"_self",{configurable:!1,enumerable:!1,writable:!1,value:ye}),Object.defineProperty(Ae,"_source",{configurable:!1,enumerable:!1,writable:!1,value:$e}),Object.freeze&&(Object.freeze(Ae.props),Object.freeze(Ae)),Ae};function qt(O,Z,le,ye,$e){{var Ge,je={},Ae=null,It=null;le!==void 0&&(Te(le),Ae=""+le),xn(Z)&&(Te(Z.key),Ae=""+Z.key),Sr(Z)&&(It=Z.ref,it(Z,$e));for(Ge in Z)xt.call(Z,Ge)&&!on.hasOwnProperty(Ge)&&(je[Ge]=Z[Ge]);if(O&&O.defaultProps){var ct=O.defaultProps;for(Ge in ct)je[Ge]===void 0&&(je[Ge]=ct[Ge])}if(Ae||It){var pt=typeof O=="function"?O.displayName||O.name||"Unknown":O;Ae&&et(je,pt),It&&Rt(je,pt)}return wn(O,Ae,It,$e,ye,me.current,je)}}var Cr=w.ReactCurrentOwner,Vt=w.ReactDebugCurrentFrame;function Sn(O){if(O){var Z=O._owner,le=at(O.type,O._source,Z?Z.type:null);Vt.setExtraStackFrame(le)}else Vt.setExtraStackFrame(null)}var Er;Er=!1;function Kr(O){return typeof O=="object"&&O!==null&&O.$$typeof===n}function Yr(){{if(Cr.current){var O=W(Cr.current.type);if(O)return`
|
|
139
80
|
|
|
140
|
-
Check the render method of \``+
|
|
81
|
+
Check the render method of \``+O+"`."}return""}}function Jr(O){return""}var Po={};function Gl(O){{var Z=Yr();if(!Z){var le=typeof O=="string"?O:O.displayName||O.name;le&&(Z=`
|
|
141
82
|
|
|
142
|
-
Check the top-level render call using <`+
|
|
83
|
+
Check the top-level render call using <`+le+">.")}return Z}}function _s(O,Z){{if(!O._store||O._store.validated||O.key!=null)return;O._store.validated=!0;var le=Gl(Z);if(Po[le])return;Po[le]=!0;var ye="";O&&O._owner&&O._owner!==Cr.current&&(ye=" It was passed a child from "+W(O._owner.type)+"."),Sn(O),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',le,ye),Sn(null)}}function kh(O,Z){{if(typeof O!="object")return;if(re(O))for(var le=0;le<O.length;le++){var ye=O[le];Kr(ye)&&_s(ye,Z)}else if(Kr(O))O._store&&(O._store.validated=!0);else if(O){var $e=y(O);if(typeof $e=="function"&&$e!==O.entries)for(var Ge=$e.call(O),je;!(je=Ge.next()).done;)Kr(je.value)&&_s(je.value,Z)}}}function c2(O){{var Z=O.type;if(Z==null||typeof Z=="string")return;var le;if(typeof Z=="function")le=Z.propTypes;else if(typeof Z=="object"&&(Z.$$typeof===c||Z.$$typeof===f))le=Z.propTypes;else return;if(le){var ye=W(Z);ot(le,O.props,"prop",ye,O)}else if(Z.PropTypes!==void 0&&!Er){Er=!0;var $e=W(Z);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",$e||"Unknown")}typeof Z.getDefaultProps=="function"&&!Z.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function u2(O){{for(var Z=Object.keys(O.props),le=0;le<Z.length;le++){var ye=Z[le];if(ye!=="children"&&ye!=="key"){Sn(O),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",ye),Sn(null);break}}O.ref!==null&&(Sn(O),S("Invalid attribute `ref` supplied to `React.Fragment`."),Sn(null))}}var Th={};function Ah(O,Z,le,ye,$e,Ge){{var je=N(O);if(!je){var Ae="";(O===void 0||typeof O=="object"&&O!==null&&Object.keys(O).length===0)&&(Ae+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var It=Jr();It?Ae+=It:Ae+=Yr();var ct;O===null?ct="null":re(O)?ct="array":O!==void 0&&O.$$typeof===n?(ct="<"+(W(O.type)||"Unknown")+" />",Ae=" Did you accidentally export a JSX literal instead of a component?"):ct=typeof O,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ct,Ae)}var pt=qt(O,Z,le,$e,Ge);if(pt==null)return pt;if(je){var Cn=Z.children;if(Cn!==void 0)if(ye)if(re(Cn)){for(var Si=0;Si<Cn.length;Si++)kh(Cn[Si],O);Object.freeze&&Object.freeze(Cn)}else S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else kh(Cn,O)}if(xt.call(Z,"key")){var Do=W(O),Gt=Object.keys(Z).filter(function(m2){return m2!=="key"}),yu=Gt.length>0?"{key: someKey, "+Gt.join(": ..., ")+": ...}":"{key: someKey}";if(!Th[Do+yu]){var g2=Gt.length>0?"{"+Gt.join(": ..., ")+": ...}":"{}";S(`A props object containing a "key" prop is being spread into JSX:
|
|
143
84
|
let props = %s;
|
|
144
85
|
<%s {...props} />
|
|
145
86
|
React keys must be passed directly to JSX without using spread:
|
|
146
87
|
let props = %s;
|
|
147
|
-
<%s key={someKey} {...props} />`,Il,Mr,hb,Mr),Ms[Mr+Il]=!0}}return b===i?Ts(Me):Ll(Me),Me}}function jl(b,k,V){return Ns(b,k,V,!0)}function Hl(b,k,V){return Ns(b,k,V,!1)}var S=Hl,j=jl;bo.Fragment=i,bo.jsx=S,bo.jsxs=j}(),bo}var qv={};qv.NODE_ENV==="production"?Zc.exports=Wv():Zc.exports=Uv();var R=Zc.exports,Gv="M12 2C11.5 2 11 2.19 10.59 2.59L2.59 10.59C1.8 11.37 1.8 12.63 2.59 13.41L10.59 21.41C11.37 22.2 12.63 22.2 13.41 21.41L21.41 13.41C22.2 12.63 22.2 11.37 21.41 10.59L13.41 2.59C13 2.19 12.5 2 12 2M11 7H13V13H11V7M11 15H13V17H11V15Z",Kv="M11 2H13V7H21V10H13V14H18V17H13V22H11V17H6V14H11V10H3V7H11V2Z",Zv="M4 22H2V2H4V22M22 7H6V10H22V7M16 14H6V17H16V14Z",Jv="M20 2H22V22H20V2M2 10H18V7H2V10M8 17H18V14H8V17Z",Yv="M9.5,8.5L11,10L8,13L11,16L9.5,17.5L5,13L9.5,8.5M14.5,17.5L13,16L16,13L13,10L14.5,8.5L19,13L14.5,17.5M21,2H3A2,2 0 0,0 1,4V20A2,2 0 0,0 3,22H21A2,2 0 0,0 23,20V4A2,2 0 0,0 21,2M21,20H3V6H21V20Z",Xv="M11,4H13V16L18.5,10.5L19.92,11.92L12,19.84L4.08,11.92L5.5,10.5L11,16V4Z",Qv="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z",ey="M20 13.5C20 17.09 17.09 20 13.5 20H6V18H13.5C16 18 18 16 18 13.5S16 9 13.5 9H7.83L10.91 12.09L9.5 13.5L4 8L9.5 2.5L10.92 3.91L7.83 7H13.5C17.09 7 20 9.91 20 13.5Z",ty="M10.5 18H18V20H10.5C6.91 20 4 17.09 4 13.5S6.91 7 10.5 7H16.17L13.08 3.91L14.5 2.5L20 8L14.5 13.5L13.09 12.09L16.17 9H10.5C8 9 6 11 6 13.5S8 18 10.5 18Z",ny="M3,21V3H21V21H3M5,5V19H19V5H5Z",ry="M3 16C3 18.8 5.2 21 8 21H10V19H8C6.3 19 5 17.7 5 16V14H3V16M21 8C21 5.2 18.8 3 16 3H14V5H16C17.7 5 19 6.3 19 8V10H21V8M16 21C18.8 21 21 18.8 21 16V14H19V16C19 17.7 17.7 19 16 19H14V21H16M8 3C5.2 3 3 5.2 3 8V10H5V8C5 6.3 6.3 5 8 5H10V3H8Z",iy="M15,21H17V19H15M19,21H21V19H19M7,21H9V19H7M11,21H13V19H11M19,17H21V15H19M19,13H21V11H19M3,3V21H5V5H21V3M19,9H21V7H19",oy="M22,17H18V10H22M23,8H17A1,1 0 0,0 16,9V19A1,1 0 0,0 17,20H23A1,1 0 0,0 24,19V9A1,1 0 0,0 23,8M4,6H22V4H4A2,2 0 0,0 2,6V17H0V20H14V17H4V6Z",sy="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z",ay="M9,20.42L2.79,14.21L5.62,11.38L9,14.77L18.88,4.88L21.71,7.71L9,20.42Z",ly="M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z",cy="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z",uy="M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z",fy="M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z",dy="M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z",py="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",hy="M8,3A2,2 0 0,0 6,5V9A2,2 0 0,1 4,11H3V13H4A2,2 0 0,1 6,15V19A2,2 0 0,0 8,21H10V19H8V14A2,2 0 0,0 6,12A2,2 0 0,0 8,10V5H10V3M16,3A2,2 0 0,1 18,5V9A2,2 0 0,0 20,11H21V13H20A2,2 0 0,0 18,15V19A2,2 0 0,1 16,21H14V19H16V14A2,2 0 0,1 18,12A2,2 0 0,1 16,10V5H14V3H16Z",my="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z",gy="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z",by="M15,9H5V5H15M12,19A3,3 0 0,1 9,16A3,3 0 0,1 12,13A3,3 0 0,1 15,16A3,3 0 0,1 12,19M17,3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V7L17,3Z",vy="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",yy="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",wy="M20,8L12,13L4,8V6L12,11L20,6M20,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V6C22,4.89 21.1,4 20,4Z",xy="M22 6C22 4.9 21.1 4 20 4H4C2.9 4 2 4.9 2 6V18C2 19.1 2.9 20 4 20H20C21.1 20 22 19.1 22 18V6M20 6L12 11L4 6H20M20 18H4V8L12 13L20 8V18Z",Sy="M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z",Cy="M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z",Oy="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z",Ey="M12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9M12,4.5C17,4.5 21.27,7.61 23,12C21.27,16.39 17,19.5 12,19.5C7,19.5 2.73,16.39 1,12C2.73,7.61 7,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C15.76,17.5 19.17,15.36 20.82,12C19.17,8.64 15.76,6.5 12,6.5C8.24,6.5 4.83,8.64 3.18,12Z",_y="M6.92,19L5,17.08L13.06,9L15,10.94M20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L13.84,6.41L11.91,4.5L10.5,5.91L11.92,7.33L3,16.25V21H7.75L16.67,12.08L18.09,13.5L19.5,12.09L17.58,10.17L20.7,7.05C21.1,6.65 21.1,6 20.71,5.63Z",ky="M17.66 11.2C17.43 10.9 17.15 10.64 16.89 10.38C16.22 9.78 15.46 9.35 14.82 8.72C13.33 7.26 13 4.85 13.95 3C13 3.23 12.17 3.75 11.46 4.32C8.87 6.4 7.85 10.07 9.07 13.22C9.11 13.32 9.15 13.42 9.15 13.55C9.15 13.77 9 13.97 8.8 14.05C8.57 14.15 8.33 14.09 8.14 13.93C8.08 13.88 8.04 13.83 8 13.76C6.87 12.33 6.69 10.28 7.45 8.64C5.78 10 4.87 12.3 5 14.47C5.06 14.97 5.12 15.47 5.29 15.97C5.43 16.57 5.7 17.17 6 17.7C7.08 19.43 8.95 20.67 10.96 20.92C13.1 21.19 15.39 20.8 17.03 19.32C18.86 17.66 19.5 15 18.56 12.72L18.43 12.46C18.22 12 17.66 11.2 17.66 11.2M14.5 17.5C14.22 17.74 13.76 18 13.4 18.1C12.28 18.5 11.16 17.94 10.5 17.28C11.69 17 12.4 16.12 12.61 15.23C12.78 14.43 12.46 13.77 12.33 13C12.21 12.26 12.23 11.63 12.5 10.94C12.69 11.32 12.89 11.7 13.13 12C13.9 13 15.11 13.44 15.37 14.8C15.41 14.94 15.43 15.08 15.43 15.23C15.46 16.05 15.1 16.95 14.5 17.5H14.5Z",Ay="M7,11H1V13H7V11M9.17,7.76L7.05,5.64L5.64,7.05L7.76,9.17L9.17,7.76M13,1H11V7H13V1M18.36,7.05L16.95,5.64L14.83,7.76L16.24,9.17L18.36,7.05M17,11V13H23V11H17M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M14.83,16.24L16.95,18.36L18.36,16.95L16.24,14.83L14.83,16.24M5.64,16.95L7.05,18.36L9.17,16.24L7.76,14.83L5.64,16.95M11,23H13V17H11V23Z",Ty="M5,3A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5.5L18.5,3H17V9A1,1 0 0,1 16,10H8A1,1 0 0,1 7,9V3H5M12,4V9H15V4H12M7,12H17A1,1 0 0,1 18,13V19H6V13A1,1 0 0,1 7,12Z",My="M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z",Ny="M5,5H10V7H7V10H5V5M14,5H19V10H17V7H14V5M17,14H19V19H14V17H17V14M10,17V19H5V14H7V17H10Z",Ry="M11,9H13V11H11V9M9,11H11V13H9V11M13,11H15V13H13V11M15,9H17V11H15V9M7,9H9V11H7V9M19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3M9,18H7V16H9V18M13,18H11V16H13V18M17,18H15V16H17V18M19,11H17V13H19V15H17V13H15V15H13V13H11V15H9V13H7V15H5V13H7V11H5V5H19V11Z",Py="M15.07,11.25L14.17,12.17C13.45,12.89 13,13.5 13,15H11V14.5C11,13.39 11.45,12.39 12.17,11.67L13.41,10.41C13.78,10.05 14,9.55 14,9C14,7.89 13.1,7 12,7A2,2 0 0,0 10,9H8A4,4 0 0,1 12,5A4,4 0 0,1 16,9C16,9.88 15.64,10.67 15.07,11.25M13,19H11V17H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z",Vy="M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z",Dy="M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",Ly="M13.5,4A1.5,1.5 0 0,0 12,5.5A1.5,1.5 0 0,0 13.5,7A1.5,1.5 0 0,0 15,5.5A1.5,1.5 0 0,0 13.5,4M13.14,8.77C11.95,8.87 8.7,11.46 8.7,11.46C8.5,11.61 8.56,11.6 8.72,11.88C8.88,12.15 8.86,12.17 9.05,12.04C9.25,11.91 9.58,11.7 10.13,11.36C12.25,10 10.47,13.14 9.56,18.43C9.2,21.05 11.56,19.7 12.17,19.3C12.77,18.91 14.38,17.8 14.54,17.69C14.76,17.54 14.6,17.42 14.43,17.17C14.31,17 14.19,17.12 14.19,17.12C13.54,17.55 12.35,18.45 12.19,17.88C12,17.31 13.22,13.4 13.89,10.71C14,10.07 14.3,8.67 13.14,8.77Z",jy="M12,16L19.36,10.27L21,9L12,2L3,9L4.63,10.27M12,18.54L4.62,12.81L3,14.07L12,21.07L21,14.07L19.37,12.8L12,18.54Z",Hy="M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z",Iy="M12,4V2A10,10 0 0,0 2,12H4A8,8 0 0,1 12,4Z",By="M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V10C4,8.89 4.9,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z",$y="M18 1C15.24 1 13 3.24 13 6V8H4C2.9 8 2 8.89 2 10V20C2 21.11 2.9 22 4 22H16C17.11 22 18 21.11 18 20V10C18 8.9 17.11 8 16 8H15V6C15 4.34 16.34 3 18 3C19.66 3 21 4.34 21 6V8H23V6C23 3.24 20.76 1 18 1M10 13C11.1 13 12 13.89 12 15C12 16.11 11.11 17 10 17C8.9 17 8 16.11 8 15C8 13.9 8.9 13 10 13Z",zy="M7,10L12,15L17,10H7Z",Fy="M20 5L20 19L4 19L4 5H20M20 3H4C2.89 3 2 3.89 2 5V19C2 20.11 2.89 21 4 21H20C21.11 21 22 20.11 22 19V5C22 3.89 21.11 3 20 3M18 15H6V17H18V15M10 7H6V13H10V7M12 9H18V7H12V9M18 11H12V13H18V11Z",Wy="M2.53,19.65L3.87,20.21V11.18L1.44,17.04C1.03,18.06 1.5,19.23 2.53,19.65M22.03,15.95L17.07,4C16.76,3.23 16.03,2.77 15.26,2.75C15,2.75 14.73,2.79 14.47,2.9L7.1,5.95C6.35,6.26 5.89,7 5.87,7.75C5.86,8 5.91,8.29 6,8.55L11,20.5C11.29,21.28 12.03,21.74 12.81,21.75C13.07,21.75 13.33,21.7 13.58,21.6L20.94,18.55C21.96,18.13 22.45,16.96 22.03,15.95M7.88,8.75A1,1 0 0,1 6.88,7.75A1,1 0 0,1 7.88,6.75C8.43,6.75 8.88,7.2 8.88,7.75C8.88,8.3 8.43,8.75 7.88,8.75M5.88,19.75A2,2 0 0,0 7.88,21.75H9.33L5.88,13.41V19.75Z",Uy="M12,2.5L8,7H16L12,2.5M12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12A2,2 0 0,0 12,10M8,17L12,21.5L16,17H8Z",qy="M6.62,10.79C8.06,13.62 10.38,15.94 13.21,17.38L15.41,15.18C15.69,14.9 16.08,14.82 16.43,14.93C17.55,15.3 18.75,15.5 20,15.5A1,1 0 0,1 21,16.5V20A1,1 0 0,1 20,21A17,17 0 0,1 3,4A1,1 0 0,1 4,3H7.5A1,1 0 0,1 8.5,4C8.5,5.25 8.7,6.45 9.07,7.57C9.18,7.92 9.1,8.31 8.82,8.59L6.62,10.79Z",Gy="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",Ky="M17,13H13V17H11V13H7V11H11V7H13V11H17M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z",Zy="M16,7V3H14V7H10V3H8V7H8C7,7 6,8 6,9V14.5L9.5,18V21H14.5V18L18,14.5V9C18,8 17,7 16,7Z",Jy="M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z",Yy="M12 2C11.5 2 11 2.19 10.59 2.59L2.59 10.59C1.8 11.37 1.8 12.63 2.59 13.41L10.59 21.41C11.37 22.2 12.63 22.2 13.41 21.41L21.41 13.41C22.2 12.63 22.2 11.37 21.41 10.59L13.41 2.59C13 2.19 12.5 2 12 2M12 4L20 12L12 20L4 12Z",Xy="M5.5,7A1.5,1.5 0 0,1 4,5.5A1.5,1.5 0 0,1 5.5,4A1.5,1.5 0 0,1 7,5.5A1.5,1.5 0 0,1 5.5,7M21.41,11.58L12.41,2.58C12.05,2.22 11.55,2 11,2H4C2.89,2 2,2.89 2,4V11C2,11.55 2.22,12.05 2.59,12.41L11.58,21.41C11.95,21.77 12.45,22 13,22C13.55,22 14.05,21.77 14.41,21.41L21.41,14.41C21.78,14.05 22,13.55 22,13C22,12.44 21.77,11.94 21.41,11.58Z",Qy="M11,2V4.07C7.38,4.53 4.53,7.38 4.07,11H2V13H4.07C4.53,16.62 7.38,19.47 11,19.93V22H13V19.93C16.62,19.47 19.47,16.62 19.93,13H22V11H19.93C19.47,7.38 16.62,4.53 13,4.07V2M11,6.08V8H13V6.09C15.5,6.5 17.5,8.5 17.92,11H16V13H17.91C17.5,15.5 15.5,17.5 13,17.92V16H11V17.91C8.5,17.5 6.5,15.5 6.08,13H8V11H6.09C6.5,8.5 8.5,6.5 11,6.08M12,11A1,1 0 0,0 11,12A1,1 0 0,0 12,13A1,1 0 0,0 13,12A1,1 0 0,0 12,11Z",e2="M22.08,11.04H20.08V4H13.05V2H11.04V4H4V11.04H2V13.05H4V20.08H11.04V22.08H13.05V20.08H20.08V13.05H22.08V11.04M18.07,18.07H13.05V16.06H11.04V18.07H6V13.05H8.03V11.04H6V6H11.04V8.03H13.05V6H18.07V11.04H16.06V13.05H18.07V18.07M13.05,12.05A1,1 0 0,1 12.05,13.05C11.5,13.05 11.04,12.6 11.04,12.05C11.04,11.5 11.5,11.04 12.05,11.04C12.6,11.04 13.05,11.5 13.05,12.05Z",t2="M16,15H9V13H16M19,11H9V9H19M19,7H9V5H19M21,1H7C5.89,1 5,1.89 5,3V17C5,18.11 5.9,19 7,19H21C22.11,19 23,18.11 23,17V3C23,1.89 22.1,1 21,1M3,5V21H19V23H3A2,2 0 0,1 1,21V5H3Z",n2="M2 12H4V17H20V12H22V17C22 18.11 21.11 19 20 19H4C2.9 19 2 18.11 2 17V12M12 15L17.55 9.54L16.13 8.13L13 11.25V2H11V11.25L7.88 8.13L6.46 9.55L12 15Z",r2="M16.59,5.41L15.17,4L12,7.17L8.83,4L7.41,5.41L12,10M7.41,18.59L8.83,20L12,16.83L15.17,20L16.58,18.59L12,14L7.41,18.59Z",i2="M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z",o2="M21 18H2V20H21V18M19 10V14H4V10H19M20 8H3C2.45 8 2 8.45 2 9V15C2 15.55 2.45 16 3 16H20C20.55 16 21 15.55 21 15V9C21 8.45 20.55 8 20 8M21 4H2V6H21V4Z",s2="M13 3V11H21V3H13M3 21H11V13H3V21M3 3V11H11V3H3M13 16H16V13H18V16H21V18H18V21H16V18H13V16Z",a2="M16.36,14C16.44,13.34 16.5,12.68 16.5,12C16.5,11.32 16.44,10.66 16.36,10H19.74C19.9,10.64 20,11.31 20,12C20,12.69 19.9,13.36 19.74,14M14.59,19.56C15.19,18.45 15.65,17.25 15.97,16H18.92C17.96,17.65 16.43,18.93 14.59,19.56M14.34,14H9.66C9.56,13.34 9.5,12.68 9.5,12C9.5,11.32 9.56,10.65 9.66,10H14.34C14.43,10.65 14.5,11.32 14.5,12C14.5,12.68 14.43,13.34 14.34,14M12,19.96C11.17,18.76 10.5,17.43 10.09,16H13.91C13.5,17.43 12.83,18.76 12,19.96M8,8H5.08C6.03,6.34 7.57,5.06 9.4,4.44C8.8,5.55 8.35,6.75 8,8M5.08,16H8C8.35,17.25 8.8,18.45 9.4,19.56C7.57,18.93 6.03,17.65 5.08,16M4.26,14C4.1,13.36 4,12.69 4,12C4,11.31 4.1,10.64 4.26,10H7.64C7.56,10.66 7.5,11.32 7.5,12C7.5,12.68 7.56,13.34 7.64,14M12,4.03C12.83,5.23 13.5,6.57 13.91,8H10.09C10.5,6.57 11.17,5.23 12,4.03M18.92,8H15.97C15.65,6.75 15.19,5.55 14.59,4.44C16.43,5.07 17.96,6.34 18.92,8M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",l2="M12.89,3L14.85,3.4L11.11,21L9.15,20.6L12.89,3M19.59,12L16,8.41V5.58L22.42,12L16,18.41V15.58L19.59,12M1.58,12L8,5.58V8.41L4.41,12L8,15.58V18.41L1.58,12Z",js={exports:{}},Hs={exports:{}},Ce={};/** @license React v16.13.1
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
151
|
-
*
|
|
152
|
-
* This source code is licensed under the MIT license found in the
|
|
153
|
-
* LICENSE file in the root directory of this source tree.
|
|
154
|
-
*/var fd;function c2(){if(fd)return Ce;fd=1;var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,i=t?Symbol.for("react.strict_mode"):60108,o=t?Symbol.for("react.profiler"):60114,s=t?Symbol.for("react.provider"):60109,a=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,c=t?Symbol.for("react.concurrent_mode"):60111,u=t?Symbol.for("react.forward_ref"):60112,f=t?Symbol.for("react.suspense"):60113,d=t?Symbol.for("react.suspense_list"):60120,p=t?Symbol.for("react.memo"):60115,h=t?Symbol.for("react.lazy"):60116,m=t?Symbol.for("react.block"):60121,g=t?Symbol.for("react.fundamental"):60117,y=t?Symbol.for("react.responder"):60118,w=t?Symbol.for("react.scope"):60119;function x(v){if(typeof v=="object"&&v!==null){var E=v.$$typeof;switch(E){case e:switch(v=v.type,v){case l:case c:case r:case o:case i:case f:return v;default:switch(v=v&&v.$$typeof,v){case a:case u:case h:case p:case s:return v;default:return E}}case n:return E}}}function C(v){return x(v)===c}return Ce.AsyncMode=l,Ce.ConcurrentMode=c,Ce.ContextConsumer=a,Ce.ContextProvider=s,Ce.Element=e,Ce.ForwardRef=u,Ce.Fragment=r,Ce.Lazy=h,Ce.Memo=p,Ce.Portal=n,Ce.Profiler=o,Ce.StrictMode=i,Ce.Suspense=f,Ce.isAsyncMode=function(v){return C(v)||x(v)===l},Ce.isConcurrentMode=C,Ce.isContextConsumer=function(v){return x(v)===a},Ce.isContextProvider=function(v){return x(v)===s},Ce.isElement=function(v){return typeof v=="object"&&v!==null&&v.$$typeof===e},Ce.isForwardRef=function(v){return x(v)===u},Ce.isFragment=function(v){return x(v)===r},Ce.isLazy=function(v){return x(v)===h},Ce.isMemo=function(v){return x(v)===p},Ce.isPortal=function(v){return x(v)===n},Ce.isProfiler=function(v){return x(v)===o},Ce.isStrictMode=function(v){return x(v)===i},Ce.isSuspense=function(v){return x(v)===f},Ce.isValidElementType=function(v){return typeof v=="string"||typeof v=="function"||v===r||v===c||v===o||v===i||v===f||v===d||typeof v=="object"&&v!==null&&(v.$$typeof===h||v.$$typeof===p||v.$$typeof===s||v.$$typeof===a||v.$$typeof===u||v.$$typeof===g||v.$$typeof===y||v.$$typeof===w||v.$$typeof===m)},Ce.typeOf=x,Ce}var Oe={},dd;function u2(){if(dd)return Oe;dd=1;var t={};/** @license React v16.13.1
|
|
155
|
-
* react-is.development.js
|
|
156
|
-
*
|
|
157
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
158
|
-
*
|
|
159
|
-
* This source code is licensed under the MIT license found in the
|
|
160
|
-
* LICENSE file in the root directory of this source tree.
|
|
161
|
-
*/return t.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,n=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,i=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,w=e?Symbol.for("react.responder"):60118,x=e?Symbol.for("react.scope"):60119;function C($){return typeof $=="string"||typeof $=="function"||$===i||$===u||$===s||$===o||$===d||$===p||typeof $=="object"&&$!==null&&($.$$typeof===m||$.$$typeof===h||$.$$typeof===a||$.$$typeof===l||$.$$typeof===f||$.$$typeof===y||$.$$typeof===w||$.$$typeof===x||$.$$typeof===g)}function v($){if(typeof $=="object"&&$!==null){var Re=$.$$typeof;switch(Re){case n:var Xe=$.type;switch(Xe){case c:case u:case i:case s:case o:case d:return Xe;default:var We=Xe&&Xe.$$typeof;switch(We){case l:case f:case m:case h:case a:return We;default:return Re}}case r:return Re}}}var E=c,A=u,B=l,T=a,P=n,I=f,z=i,K=m,te=h,H=r,Y=s,re=o,oe=d,he=!1;function pe($){return he||(he=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),_($)||v($)===c}function _($){return v($)===u}function N($){return v($)===l}function G($){return v($)===a}function W($){return typeof $=="object"&&$!==null&&$.$$typeof===n}function U($){return v($)===f}function se($){return v($)===i}function Z($){return v($)===m}function Q($){return v($)===h}function ie($){return v($)===r}function ue($){return v($)===s}function ae($){return v($)===o}function ke($){return v($)===d}Oe.AsyncMode=E,Oe.ConcurrentMode=A,Oe.ContextConsumer=B,Oe.ContextProvider=T,Oe.Element=P,Oe.ForwardRef=I,Oe.Fragment=z,Oe.Lazy=K,Oe.Memo=te,Oe.Portal=H,Oe.Profiler=Y,Oe.StrictMode=re,Oe.Suspense=oe,Oe.isAsyncMode=pe,Oe.isConcurrentMode=_,Oe.isContextConsumer=N,Oe.isContextProvider=G,Oe.isElement=W,Oe.isForwardRef=U,Oe.isFragment=se,Oe.isLazy=Z,Oe.isMemo=Q,Oe.isPortal=ie,Oe.isProfiler=ue,Oe.isStrictMode=ae,Oe.isSuspense=ke,Oe.isValidElementType=C,Oe.typeOf=v}(),Oe}var pd;function j1(){if(pd)return Hs.exports;pd=1;var t={};return t.NODE_ENV==="production"?Hs.exports=c2():Hs.exports=u2(),Hs.exports}/*
|
|
162
|
-
object-assign
|
|
163
|
-
(c) Sindre Sorhus
|
|
164
|
-
@license MIT
|
|
165
|
-
*/var Wl,hd;function f2(){if(hd)return Wl;hd=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(u){return s[u]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Wl=i()?Object.assign:function(o,s){for(var a,l=r(o),c,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var f in a)e.call(a,f)&&(l[f]=a[f]);if(t){c=t(a);for(var d=0;d<c.length;d++)n.call(a,c[d])&&(l[c[d]]=a[c[d]])}}return l},Wl}var Ul,md;function Ku(){if(md)return Ul;md=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ul=t,Ul}var ql,gd;function H1(){return gd||(gd=1,ql=Function.call.bind(Object.prototype.hasOwnProperty)),ql}var Gl,bd;function d2(){if(bd)return Gl;bd=1;var t={},e=function(){};if(t.NODE_ENV!=="production"){var n=Ku(),r={},i=H1();e=function(s){var a="Warning: "+s;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function o(s,a,l,c,u){if(t.NODE_ENV!=="production"){for(var f in s)if(i(s,f)){var d;try{if(typeof s[f]!="function"){var p=Error((c||"React class")+": "+l+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}d=s[f](a,f,c,l,null,n)}catch(m){d=m}if(d&&!(d instanceof Error)&&e((c||"React class")+": type specification of "+l+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in r)){r[d.message]=!0;var h=u?u():"";e("Failed "+l+" type: "+d.message+(h??""))}}}}return o.resetWarningCache=function(){t.NODE_ENV!=="production"&&(r={})},Gl=o,Gl}var Kl,vd;function p2(){if(vd)return Kl;vd=1;var t={},e=j1(),n=f2(),r=Ku(),i=H1(),o=d2(),s=function(){};t.NODE_ENV!=="production"&&(s=function(l){var c="Warning: "+l;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function a(){return null}return Kl=function(l,c){var u=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function d(_){var N=_&&(u&&_[u]||_[f]);if(typeof N=="function")return N}var p="<<anonymous>>",h={array:w("array"),bigint:w("bigint"),bool:w("boolean"),func:w("function"),number:w("number"),object:w("object"),string:w("string"),symbol:w("symbol"),any:x(),arrayOf:C,element:v(),elementType:E(),instanceOf:A,node:I(),objectOf:T,oneOf:B,oneOfType:P,shape:K,exact:te};function m(_,N){return _===N?_!==0||1/_===1/N:_!==_&&N!==N}function g(_,N){this.message=_,this.data=N&&typeof N=="object"?N:{},this.stack=""}g.prototype=Error.prototype;function y(_){if(t.NODE_ENV!=="production")var N={},G=0;function W(se,Z,Q,ie,ue,ae,ke){if(ie=ie||p,ae=ae||Q,ke!==r){if(c){var $=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw $.name="Invariant Violation",$}else if(t.NODE_ENV!=="production"&&typeof console<"u"){var Re=ie+":"+Q;!N[Re]&&G<3&&(s("You are manually calling a React.PropTypes validation function for the `"+ae+"` prop on `"+ie+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),N[Re]=!0,G++)}}return Z[Q]==null?se?Z[Q]===null?new g("The "+ue+" `"+ae+"` is marked as required "+("in `"+ie+"`, but its value is `null`.")):new g("The "+ue+" `"+ae+"` is marked as required in "+("`"+ie+"`, but its value is `undefined`.")):null:_(Z,Q,ie,ue,ae)}var U=W.bind(null,!1);return U.isRequired=W.bind(null,!0),U}function w(_){function N(G,W,U,se,Z,Q){var ie=G[W],ue=re(ie);if(ue!==_){var ae=oe(ie);return new g("Invalid "+se+" `"+Z+"` of type "+("`"+ae+"` supplied to `"+U+"`, expected ")+("`"+_+"`."),{expectedType:_})}return null}return y(N)}function x(){return y(a)}function C(_){function N(G,W,U,se,Z){if(typeof _!="function")return new g("Property `"+Z+"` of component `"+U+"` has invalid PropType notation inside arrayOf.");var Q=G[W];if(!Array.isArray(Q)){var ie=re(Q);return new g("Invalid "+se+" `"+Z+"` of type "+("`"+ie+"` supplied to `"+U+"`, expected an array."))}for(var ue=0;ue<Q.length;ue++){var ae=_(Q,ue,U,se,Z+"["+ue+"]",r);if(ae instanceof Error)return ae}return null}return y(N)}function v(){function _(N,G,W,U,se){var Z=N[G];if(!l(Z)){var Q=re(Z);return new g("Invalid "+U+" `"+se+"` of type "+("`"+Q+"` supplied to `"+W+"`, expected a single ReactElement."))}return null}return y(_)}function E(){function _(N,G,W,U,se){var Z=N[G];if(!e.isValidElementType(Z)){var Q=re(Z);return new g("Invalid "+U+" `"+se+"` of type "+("`"+Q+"` supplied to `"+W+"`, expected a single ReactElement type."))}return null}return y(_)}function A(_){function N(G,W,U,se,Z){if(!(G[W]instanceof _)){var Q=_.name||p,ie=pe(G[W]);return new g("Invalid "+se+" `"+Z+"` of type "+("`"+ie+"` supplied to `"+U+"`, expected ")+("instance of `"+Q+"`."))}return null}return y(N)}function B(_){if(!Array.isArray(_))return t.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),a;function N(G,W,U,se,Z){for(var Q=G[W],ie=0;ie<_.length;ie++)if(m(Q,_[ie]))return null;var ue=JSON.stringify(_,function(ke,$){var Re=oe($);return Re==="symbol"?String($):$});return new g("Invalid "+se+" `"+Z+"` of value `"+String(Q)+"` "+("supplied to `"+U+"`, expected one of "+ue+"."))}return y(N)}function T(_){function N(G,W,U,se,Z){if(typeof _!="function")return new g("Property `"+Z+"` of component `"+U+"` has invalid PropType notation inside objectOf.");var Q=G[W],ie=re(Q);if(ie!=="object")return new g("Invalid "+se+" `"+Z+"` of type "+("`"+ie+"` supplied to `"+U+"`, expected an object."));for(var ue in Q)if(i(Q,ue)){var ae=_(Q,ue,U,se,Z+"."+ue,r);if(ae instanceof Error)return ae}return null}return y(N)}function P(_){if(!Array.isArray(_))return t.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var N=0;N<_.length;N++){var G=_[N];if(typeof G!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+he(G)+" at index "+N+"."),a}function W(U,se,Z,Q,ie){for(var ue=[],ae=0;ae<_.length;ae++){var ke=_[ae],$=ke(U,se,Z,Q,ie,r);if($==null)return null;$.data&&i($.data,"expectedType")&&ue.push($.data.expectedType)}var Re=ue.length>0?", expected one of type ["+ue.join(", ")+"]":"";return new g("Invalid "+Q+" `"+ie+"` supplied to "+("`"+Z+"`"+Re+"."))}return y(W)}function I(){function _(N,G,W,U,se){return H(N[G])?null:new g("Invalid "+U+" `"+se+"` supplied to "+("`"+W+"`, expected a ReactNode."))}return y(_)}function z(_,N,G,W,U){return new g((_||"React class")+": "+N+" type `"+G+"."+W+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+U+"`.")}function K(_){function N(G,W,U,se,Z){var Q=G[W],ie=re(Q);if(ie!=="object")return new g("Invalid "+se+" `"+Z+"` of type `"+ie+"` "+("supplied to `"+U+"`, expected `object`."));for(var ue in _){var ae=_[ue];if(typeof ae!="function")return z(U,se,Z,ue,oe(ae));var ke=ae(Q,ue,U,se,Z+"."+ue,r);if(ke)return ke}return null}return y(N)}function te(_){function N(G,W,U,se,Z){var Q=G[W],ie=re(Q);if(ie!=="object")return new g("Invalid "+se+" `"+Z+"` of type `"+ie+"` "+("supplied to `"+U+"`, expected `object`."));var ue=n({},G[W],_);for(var ae in ue){var ke=_[ae];if(i(_,ae)&&typeof ke!="function")return z(U,se,Z,ae,oe(ke));if(!ke)return new g("Invalid "+se+" `"+Z+"` key `"+ae+"` supplied to `"+U+"`.\nBad object: "+JSON.stringify(G[W],null," ")+`
|
|
166
|
-
Valid keys: `+JSON.stringify(Object.keys(_),null," "));var $=ke(Q,ae,U,se,Z+"."+ae,r);if($)return $}return null}return y(N)}function H(_){switch(typeof _){case"number":case"string":case"undefined":return!0;case"boolean":return!_;case"object":if(Array.isArray(_))return _.every(H);if(_===null||l(_))return!0;var N=d(_);if(N){var G=N.call(_),W;if(N!==_.entries){for(;!(W=G.next()).done;)if(!H(W.value))return!1}else for(;!(W=G.next()).done;){var U=W.value;if(U&&!H(U[1]))return!1}}else return!1;return!0;default:return!1}}function Y(_,N){return _==="symbol"?!0:N?N["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&N instanceof Symbol:!1}function re(_){var N=typeof _;return Array.isArray(_)?"array":_ instanceof RegExp?"object":Y(N,_)?"symbol":N}function oe(_){if(typeof _>"u"||_===null)return""+_;var N=re(_);if(N==="object"){if(_ instanceof Date)return"date";if(_ instanceof RegExp)return"regexp"}return N}function he(_){var N=oe(_);switch(N){case"array":case"object":return"an "+N;case"boolean":case"date":case"regexp":return"a "+N;default:return N}}function pe(_){return!_.constructor||!_.constructor.name?p:_.constructor.name}return h.checkPropTypes=o,h.resetWarningCache=o.resetWarningCache,h.PropTypes=h,h},Kl}var Zl,yd;function h2(){if(yd)return Zl;yd=1;var t=Ku();function e(){}function n(){}return n.resetWarningCache=e,Zl=function(){function r(s,a,l,c,u,f){if(f!==t){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:e};return o.PropTypes=o,o},Zl}var wd;function m2(){if(wd)return js.exports;wd=1;var t={};if(t.NODE_ENV!=="production"){var e=j1(),n=!0;js.exports=p2()(e.isElement,n)}else js.exports=h2()();return js.exports}var g2=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(r,i,o){n.o(r,i)||Object.defineProperty(r,i,{enumerable:!0,get:o})},n.r=function(r){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},n.t=function(r,i){if(1&i&&(r=n(r)),8&i||4&i&&typeof r=="object"&&r&&r.__esModule)return r;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:r}),2&i&&typeof r!="string")for(var s in r)n.d(o,s,(function(a){return r[a]}).bind(null,s));return o},n.n=function(r){var i=r&&r.__esModule?function(){return r.default}:function(){return r};return n.d(i,"a",i),i},n.o=function(r,i){return Object.prototype.hasOwnProperty.call(r,i)},n.p="",n(n.s=2)}([function(t,e){t.exports=m2()},function(t,e){t.exports=O},function(t,e,n){n.r(e);var r=n(1),i=n(0),o=function(){return(o=Object.assign||function(h){for(var m,g=1,y=arguments.length;g<y;g++)for(var w in m=arguments[g])Object.prototype.hasOwnProperty.call(m,w)&&(h[w]=m[w]);return h}).apply(this,arguments)},s=function(h,m){var g={};for(var y in h)Object.prototype.hasOwnProperty.call(h,y)&&m.indexOf(y)<0&&(g[y]=h[y]);if(h!=null&&typeof Object.getOwnPropertySymbols=="function"){var w=0;for(y=Object.getOwnPropertySymbols(h);w<y.length;w++)m.indexOf(y[w])<0&&Object.prototype.propertyIsEnumerable.call(h,y[w])&&(g[y[w]]=h[y[w]])}return g},a=0,l=r.forwardRef(function(h,m){var g=h.title,y=g===void 0?null:g,w=h.description,x=w===void 0?null:w,C=h.size,v=C===void 0?null:C,E=h.color,A=E===void 0?"currentColor":E,B=h.horizontal,T=B===void 0?null:B,P=h.vertical,I=P===void 0?null:P,z=h.rotate,K=z===void 0?null:z,te=h.spin,H=te===void 0?null:te,Y=h.style,re=Y===void 0?{}:Y,oe=h.children,he=s(h,["title","description","size","color","horizontal","vertical","rotate","spin","style","children"]);a++;var pe,_=H!==null&&H,N=r.Children.map(oe,function(se){var Z=se;_!==!0&&(_=(H===null?Z.props.spin:H)===!0);var Q=Z.props.size;typeof v=="number"&&typeof Z.props.size=="number"&&(Q=Z.props.size/v);var ie={size:Q,color:A===null?Z.props.color:A,horizontal:T===null?Z.props.horizontal:T,vertical:I===null?Z.props.vertical:I,rotate:K===null?Z.props.rotate:K,spin:H===null?Z.props.spin:H,inStack:!0};return r.cloneElement(Z,ie)});v!==null&&(re.width=typeof v=="string"?v:1.5*v+"rem");var G,W="stack_labelledby_"+a,U="stack_describedby_"+a;if(y)pe=x?W+" "+U:W;else if(G="presentation",x)throw new Error("title attribute required when description is set");return r.createElement("svg",o({ref:m,viewBox:"0 0 24 24",style:re,role:G,"aria-labelledby":pe},he),y&&r.createElement("title",{id:W},y),x&&r.createElement("desc",{id:U},x),_&&r.createElement("style",null,"@keyframes spin { from { transform: rotate(0deg) } to { transform: rotate(360deg) } }","@keyframes spin-inverse { from { transform: rotate(0deg) } to { transform: rotate(-360deg) } }"),N)});l.displayName="Stack",l.propTypes={size:i.oneOfType([i.number,i.string]),color:i.string,horizontal:i.bool,vertical:i.bool,rotate:i.number,spin:i.oneOfType([i.bool,i.number]),children:i.oneOfType([i.arrayOf(i.node),i.node]).isRequired,className:i.string,style:i.object},l.defaultProps={size:null,color:null,horizontal:null,vertical:null,rotate:null,spin:null};var c=l;n.d(e,"Icon",function(){return p}),n.d(e,"Stack",function(){return c});var u=function(){return(u=Object.assign||function(h){for(var m,g=1,y=arguments.length;g<y;g++)for(var w in m=arguments[g])Object.prototype.hasOwnProperty.call(m,w)&&(h[w]=m[w]);return h}).apply(this,arguments)},f=function(h,m){var g={};for(var y in h)Object.prototype.hasOwnProperty.call(h,y)&&m.indexOf(y)<0&&(g[y]=h[y]);if(h!=null&&typeof Object.getOwnPropertySymbols=="function"){var w=0;for(y=Object.getOwnPropertySymbols(h);w<y.length;w++)m.indexOf(y[w])<0&&Object.prototype.propertyIsEnumerable.call(h,y[w])&&(g[y[w]]=h[y[w]])}return g},d=0,p=r.forwardRef(function(h,m){var g=h.path,y=h.id,w=y===void 0?++d:y,x=h.title,C=x===void 0?null:x,v=h.description,E=v===void 0?null:v,A=h.size,B=A===void 0?null:A,T=h.color,P=T===void 0?"currentColor":T,I=h.horizontal,z=I!==void 0&&I,K=h.vertical,te=K!==void 0&&K,H=h.rotate,Y=H===void 0?0:H,re=h.spin,oe=re!==void 0&&re,he=h.style,pe=he===void 0?{}:he,_=h.inStack,N=_!==void 0&&_,G=f(h,["path","id","title","description","size","color","horizontal","vertical","rotate","spin","style","inStack"]),W={},U=[];B!==null&&(N?U.push("scale("+B+")"):(pe.width=typeof B=="string"?B:1.5*B+"rem",pe.height=pe.width)),z&&U.push("scaleX(-1)"),te&&U.push("scaleY(-1)"),Y!==0&&U.push("rotate("+Y+"deg)"),P!==null&&(W.fill=P);var se=r.createElement("path",u({d:g,style:W},N?G:{})),Z=se;U.length>0&&(pe.transform=U.join(" "),pe.transformOrigin="center",N&&(Z=r.createElement("g",{style:pe},se,r.createElement("rect",{width:"24",height:"24",fill:"transparent"}))));var Q,ie=Z,ue=oe===!0||typeof oe!="number"?2:oe,ae=!N&&(z||te);if(ue<0&&(ae=!ae),oe&&(ie=r.createElement("g",{style:{animation:"spin"+(ae?"-inverse":"")+" linear "+Math.abs(ue)+"s infinite",transformOrigin:"center"}},Z,!(z||te||Y!==0)&&r.createElement("rect",{width:"24",height:"24",fill:"transparent"}))),N)return ie;var ke,$="icon_labelledby_"+w,Re="icon_describedby_"+w;if(C)Q=E?$+" "+Re:$;else if(ke="presentation",E)throw new Error("title attribute required when description is set");return r.createElement("svg",u({ref:m,viewBox:"0 0 24 24",style:pe,role:ke,"aria-labelledby":Q},G),C&&r.createElement("title",{id:$},C),E&&r.createElement("desc",{id:Re},E),!N&&oe&&(ae?r.createElement("style",null,"@keyframes spin-inverse { from { transform: rotate(0deg) } to { transform: rotate(-360deg) } }"):r.createElement("style",null,"@keyframes spin { from { transform: rotate(0deg) } to { transform: rotate(360deg) } }")),ie)});p.displayName="Icon",p.propTypes={path:i.string.isRequired,size:i.oneOfType([i.number,i.string]),color:i.string,horizontal:i.bool,vertical:i.bool,rotate:i.number,spin:i.oneOfType([i.bool,i.number]),style:i.object,inStack:i.bool,className:i.string},p.defaultProps={size:null,color:"currentColor",horizontal:!1,vertical:!1,rotate:0,spin:!1},e.default=p}]);const b2=Gu(g2);var I1={exports:{}};/*!
|
|
167
|
-
Copyright (c) 2018 Jed Watson.
|
|
168
|
-
Licensed under the MIT License (MIT), see
|
|
169
|
-
http://jedwatson.github.io/classnames
|
|
170
|
-
*/(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var o="",s=0;s<arguments.length;s++){var a=arguments[s];a&&(o=i(o,r(a)))}return o}function r(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return n.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var s="";for(var a in o)e.call(o,a)&&o[a]&&(s=i(s,a));return s}function i(o,s){return s?o?o+" "+s:o+s:o}t.exports?(n.default=n,t.exports=n):window.classNames=n})()})(I1);var v2=I1.exports;const _i=Gu(v2);var M={},y2={0:"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'",1:function(e,n){return"Cannot apply '"+e+"' to '"+n.toString()+"': Field not found."},5:"'keys()' can only be used on observable objects, arrays, sets and maps",6:"'values()' can only be used on observable objects, arrays, sets and maps",7:"'entries()' can only be used on observable objects, arrays and maps",8:"'set()' can only be used on observable objects, arrays and maps",9:"'remove()' can only be used on observable objects, arrays and maps",10:"'has()' can only be used on observable objects, arrays and maps",11:"'get()' can only be used on observable objects, arrays and maps",12:"Invalid annotation",13:"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)",14:"Intercept handlers should return nothing or a change object",15:"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)",16:"Modification exception: the internal structure of an observable array was changed.",17:function(e,n){return"[mobx.array] Index out of bounds, "+e+" is larger than "+n},18:"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js",19:function(e){return"Cannot initialize from classes that inherit from Map: "+e.constructor.name},20:function(e){return"Cannot initialize map from "+e},21:function(e){return"Cannot convert to map from '"+e+"'"},22:"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js",23:"It is not possible to get index atoms from arrays",24:function(e){return"Cannot obtain administration from "+e},25:function(e,n){return"the entry '"+e+"' does not exist in the observable map '"+n+"'"},26:"please specify a property",27:function(e,n){return"no observable property '"+e.toString()+"' found on the observable object '"+n+"'"},28:function(e){return"Cannot obtain atom from "+e},29:"Expecting some object",30:"invalid action stack. did you forget to finish an action?",31:"missing option for computed: get",32:function(e,n){return"Cycle detected in computation "+e+": "+n},33:function(e){return"The setter of computed value '"+e+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"},34:function(e){return"[ComputedValue '"+e+"'] It is not possible to assign a new value to a computed value."},35:"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`",36:"isolateGlobalState should be called before MobX is running any reactions",37:function(e){return"[mobx] `observableArray."+e+"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice()."+e+"()` instead"},38:"'ownKeys()' can only be used on observable objects",39:"'defineProperty()' can only be used on observable objects"},w2=M.NODE_ENV!=="production"?y2:{};function J(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];if(M.NODE_ENV!=="production"){var i=typeof t=="string"?t:w2[t];throw typeof i=="function"&&(i=i.apply(null,n)),new Error("[MobX] "+i)}throw new Error(typeof t=="number"?"[MobX] minified error nr: "+t+(n.length?" "+n.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+t)}var x2={};function il(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:x2}var B1=Object.assign,Ca=Object.getOwnPropertyDescriptor,yn=Object.defineProperty,ol=Object.prototype,Oa=[];Object.freeze(Oa);var $1={};Object.freeze($1);var S2=typeof Proxy<"u",C2=Object.toString();function z1(){S2||J(M.NODE_ENV!=="production"?"`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`":"Proxy not available")}function vo(t){M.NODE_ENV!=="production"&&L.verifyProxies&&J("MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to "+t)}function sn(){return++L.mobxGuid}function Zu(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}var ki=function(){};function Be(t){return typeof t=="function"}function Xr(t){var e=typeof t;switch(e){case"string":case"symbol":case"number":return!0}return!1}function sl(t){return t!==null&&typeof t=="object"}function Sn(t){if(!sl(t))return!1;var e=Object.getPrototypeOf(t);if(e==null)return!0;var n=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n.toString()===C2}function F1(t){var e=t==null?void 0:t.constructor;return e?e.name==="GeneratorFunction"||e.displayName==="GeneratorFunction":!1}function al(t,e,n){yn(t,e,{enumerable:!1,writable:!0,configurable:!0,value:n})}function W1(t,e,n){yn(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}function li(t,e){var n="isMobX"+t;return e.prototype[n]=!0,function(r){return sl(r)&&r[n]===!0}}function so(t){return t!=null&&Object.prototype.toString.call(t)==="[object Map]"}function O2(t){var e=Object.getPrototypeOf(t),n=Object.getPrototypeOf(e),r=Object.getPrototypeOf(n);return r===null}function Hn(t){return t!=null&&Object.prototype.toString.call(t)==="[object Set]"}var U1=typeof Object.getOwnPropertySymbols<"u";function E2(t){var e=Object.keys(t);if(!U1)return e;var n=Object.getOwnPropertySymbols(t);return n.length?[].concat(e,n.filter(function(r){return ol.propertyIsEnumerable.call(t,r)})):e}var ll=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:U1?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames;function Jc(t){return typeof t=="string"?t:typeof t=="symbol"?t.toString():new String(t).toString()}function q1(t){return t===null?null:typeof t=="object"?""+t:t}function It(t,e){return ol.hasOwnProperty.call(t,e)}var _2=Object.getOwnPropertyDescriptors||function(e){var n={};return ll(e).forEach(function(r){n[r]=Ca(e,r)}),n};function vt(t,e){return!!(t&e)}function yt(t,e,n){return n?t|=e:t&=~e,t}function xd(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function k2(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,T2(r.key),r)}}function ao(t,e,n){return e&&k2(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ai(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=M2(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
171
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wn(){return Wn=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Wn.apply(null,arguments)}function G1(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Yc(t,e)}function Yc(t,e){return Yc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Yc(t,e)}function A2(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function T2(t){var e=A2(t,"string");return typeof e=="symbol"?e:e+""}function M2(t,e){if(t){if(typeof t=="string")return xd(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xd(t,e):void 0}}var ft=Symbol("mobx-stored-annotations");function wn(t){function e(n,r){if(ss(r))return t.decorate_20223_(n,r);is(n,r,t)}return Object.assign(e,t)}function is(t,e,n){if(It(t,ft)||al(t,ft,Wn({},t[ft])),M.NODE_ENV!=="production"&&_a(n)&&!It(t[ft],e)){var r=t.constructor.name+".prototype."+e.toString();J("'"+r+"' is decorated with 'override', but no such decorated member was found on prototype.")}N2(t,n,e),_a(n)||(t[ft][e]=n)}function N2(t,e,n){if(M.NODE_ENV!=="production"&&!_a(e)&&It(t[ft],n)){var r=t.constructor.name+".prototype."+n.toString(),i=t[ft][n].annotationType_,o=e.annotationType_;J("Cannot apply '@"+o+"' to '"+r+"':"+(`
|
|
172
|
-
The field is already decorated with '@`+i+"'.")+`
|
|
88
|
+
<%s key={someKey} {...props} />`,yu,Do,g2,Do),Th[Do+yu]=!0}}return O===o?u2(pt):c2(pt),pt}}function d2(O,Z,le){return Ah(O,Z,le,!0)}function f2(O,Z,le){return Ah(O,Z,le,!1)}var p2=f2,h2=d2;Ts.Fragment=o,Ts.jsx=p2,Ts.jsxs=h2}(),Ts}var I2={};I2.NODE_ENV==="production"?Id.exports=L2():Id.exports=V2();var h=Id.exports;const C0=new Set,fn=new WeakMap,Hi=new WeakMap,oi=new WeakMap,$d=new WeakMap,$2=new WeakMap,Ki=new WeakMap,Ua=new WeakMap;let wo;const Wo="__aa_tgt",Hd="__aa_del",H2=t=>{const e=U2(t);e&&e.forEach(n=>q2(n))},B2=t=>{t.forEach(e=>{e.target===wo&&F2(),fn.has(e.target)&&mi(e.target)})};function z2(t){const e=$d.get(t);e==null||e.disconnect();let n=fn.get(t),r=0;const o=5;n||(n=Yi(t),fn.set(t,n));const{offsetWidth:i,offsetHeight:s}=wo,a=[n.top-o,i-(n.left+o+n.width),s-(n.top+o+n.height),n.left-o].map(u=>`${-1*Math.floor(u)}px`).join(" "),c=new IntersectionObserver(()=>{++r>1&&mi(t)},{root:wo,threshold:1,rootMargin:a});c.observe(t),$d.set(t,c)}function mi(t){clearTimeout(Ua.get(t));const e=Ac(t),n=typeof e=="function"?500:e.duration;Ua.set(t,setTimeout(()=>{const r=oi.get(t);(!r||r.finished)&&(fn.set(t,Yi(t)),z2(t))},n))}function F2(){clearTimeout(Ua.get(wo)),Ua.set(wo,setTimeout(()=>{C0.forEach(t=>_0(t,e=>E0(()=>mi(e))))},100))}function W2(t){setTimeout(()=>{$2.set(t,setInterval(()=>E0(mi.bind(null,t)),2e3))},Math.round(2e3*Math.random()))}function E0(t){typeof requestIdleCallback=="function"?requestIdleCallback(()=>t()):requestAnimationFrame(()=>t())}let Bd,Ri;typeof window<"u"&&(wo=document.documentElement,Bd=new MutationObserver(H2),Ri=new ResizeObserver(B2),Ri.observe(wo));function U2(t){return t.reduce((e,n)=>{if(e===!1)return!1;if(n.target instanceof Element){if(xu(n.target),!e.has(n.target)){e.add(n.target);for(let r=0;r<n.target.children.length;r++){const o=n.target.children.item(r);if(o){if(Hd in o)return!1;xu(n.target,o),e.add(o)}}}if(n.removedNodes.length)for(let r=0;r<n.removedNodes.length;r++){const o=n.removedNodes[r];if(Hd in o)return!1;o instanceof Element&&(e.add(o),xu(n.target,o),Hi.set(o,[n.previousSibling,n.nextSibling]))}}return e},new Set)}function xu(t,e){!e&&!(Wo in t)?Object.defineProperty(t,Wo,{value:t}):e&&!(Wo in e)&&Object.defineProperty(e,Wo,{value:t})}function q2(t){var e;const n=wo.contains(t),r=fn.has(t);n&&Hi.has(t)&&Hi.delete(t),oi.has(t)&&((e=oi.get(t))===null||e===void 0||e.cancel()),r&&n?G2(t):r&&!n?Y2(t):K2(t)}function tr(t){return Number(t.replace(/[^0-9.\-]/g,""))}function Yi(t){const e=t.getBoundingClientRect();return{top:e.top+window.scrollY,left:e.left+window.scrollX,width:e.width,height:e.height}}function O0(t,e,n){let r=e.width,o=e.height,i=n.width,s=n.height;const l=getComputedStyle(t);if(l.getPropertyValue("box-sizing")==="content-box"){const c=tr(l.paddingTop)+tr(l.paddingBottom)+tr(l.borderTopWidth)+tr(l.borderBottomWidth),u=tr(l.paddingLeft)+tr(l.paddingRight)+tr(l.borderRightWidth)+tr(l.borderLeftWidth);r-=u,i-=u,o-=c,s-=c}return[r,i,o,s].map(Math.round)}function Ac(t){return Wo in t&&Ki.has(t[Wo])?Ki.get(t[Wo]):{duration:250,easing:"ease-in-out"}}function _0(t,...e){e.forEach(n=>n(t,Ki.has(t)));for(let n=0;n<t.children.length;n++){const r=t.children.item(n);r&&e.forEach(o=>o(r,Ki.has(r)))}}function G2(t){const e=fn.get(t),n=Yi(t);let r;if(!e)return;const o=Ac(t);if(typeof o!="function"){const i=e.left-n.left,s=e.top-n.top,[l,a,c,u]=O0(t,e,n),d={transform:`translate(${i}px, ${s}px)`},f={transform:"translate(0, 0)"};l!==a&&(d.width=`${l}px`,f.width=`${a}px`),c!==u&&(d.height=`${c}px`,f.height=`${u}px`),r=t.animate([d,f],o)}else r=new Animation(o(t,"remain",e,n)),r.play();oi.set(t,r),fn.set(t,n),r.addEventListener("finish",mi.bind(null,t))}function K2(t){const e=Yi(t);fn.set(t,e);const n=Ac(t);let r;typeof n!="function"?r=t.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:n.duration*1.5,easing:"ease-in"}):(r=new Animation(n(t,"add",e)),r.play()),oi.set(t,r),r.addEventListener("finish",mi.bind(null,t))}function Y2(t){if(!Hi.has(t)||!fn.has(t))return;const[e,n]=Hi.get(t);Object.defineProperty(t,Hd,{value:!0}),n&&n.parentNode&&n.parentNode instanceof Element?n.parentNode.insertBefore(t,n):e&&e.parentNode&&e.parentNode.appendChild(t);const[r,o,i,s]=J2(t),l=Ac(t),a=fn.get(t);let c;Object.assign(t.style,{position:"absolute",top:`${r}px`,left:`${o}px`,width:`${i}px`,height:`${s}px`,margin:0,pointerEvents:"none",transformOrigin:"center",zIndex:100}),typeof l!="function"?c=t.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:l.duration,easing:"ease-out"}):(c=new Animation(l(t,"remove",a)),c.play()),oi.set(t,c),c.addEventListener("finish",()=>{var u;t.remove(),fn.delete(t),Hi.delete(t),oi.delete(t),(u=$d.get(t))===null||u===void 0||u.disconnect()})}function J2(t){const e=fn.get(t),[n,,r]=O0(t,e,Yi(t));let o=t.parentElement;for(;o&&(getComputedStyle(o).position==="static"||o instanceof HTMLBodyElement);)o=o.parentElement;o||(o=document.body);const i=getComputedStyle(o),s=fn.get(o)||Yi(o),l=Math.round(e.top-s.top)-tr(i.borderTopWidth),a=Math.round(e.left-s.left)-tr(i.borderLeftWidth);return[l,a,n,r]}function Z2(t,e={}){Bd&&Ri&&(getComputedStyle(t).position==="static"&&Object.assign(t.style,{position:"relative"}),_0(t,mi,W2,n=>Ri==null?void 0:Ri.observe(n)),typeof e=="function"?Ki.set(t,e):Ki.set(t,{duration:250,easing:"ease-in-out",...e}),Bd.observe(t,{childList:!0}),C0.add(t))}function X2(t){const e=m.useRef(null);return m.useEffect(()=>{e.current instanceof HTMLElement&&Z2(e.current,t)},[e]),e}var H={},Q2={0:"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'",1:function(e,n){return"Cannot apply '"+e+"' to '"+n.toString()+"': Field not found."},5:"'keys()' can only be used on observable objects, arrays, sets and maps",6:"'values()' can only be used on observable objects, arrays, sets and maps",7:"'entries()' can only be used on observable objects, arrays and maps",8:"'set()' can only be used on observable objects, arrays and maps",9:"'remove()' can only be used on observable objects, arrays and maps",10:"'has()' can only be used on observable objects, arrays and maps",11:"'get()' can only be used on observable objects, arrays and maps",12:"Invalid annotation",13:"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)",14:"Intercept handlers should return nothing or a change object",15:"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)",16:"Modification exception: the internal structure of an observable array was changed.",17:function(e,n){return"[mobx.array] Index out of bounds, "+e+" is larger than "+n},18:"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js",19:function(e){return"Cannot initialize from classes that inherit from Map: "+e.constructor.name},20:function(e){return"Cannot initialize map from "+e},21:function(e){return"Cannot convert to map from '"+e+"'"},22:"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js",23:"It is not possible to get index atoms from arrays",24:function(e){return"Cannot obtain administration from "+e},25:function(e,n){return"the entry '"+e+"' does not exist in the observable map '"+n+"'"},26:"please specify a property",27:function(e,n){return"no observable property '"+e.toString()+"' found on the observable object '"+n+"'"},28:function(e){return"Cannot obtain atom from "+e},29:"Expecting some object",30:"invalid action stack. did you forget to finish an action?",31:"missing option for computed: get",32:function(e,n){return"Cycle detected in computation "+e+": "+n},33:function(e){return"The setter of computed value '"+e+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"},34:function(e){return"[ComputedValue '"+e+"'] It is not possible to assign a new value to a computed value."},35:"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`",36:"isolateGlobalState should be called before MobX is running any reactions",37:function(e){return"[mobx] `observableArray."+e+"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice()."+e+"()` instead"},38:"'ownKeys()' can only be used on observable objects",39:"'defineProperty()' can only be used on observable objects"},ew=H.NODE_ENV!=="production"?Q2:{};function ce(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];if(H.NODE_ENV!=="production"){var o=typeof t=="string"?t:ew[t];throw typeof o=="function"&&(o=o.apply(null,n)),new Error("[MobX] "+o)}throw new Error(typeof t=="number"?"[MobX] minified error nr: "+t+(n.length?" "+n.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+t)}var tw={};function Mc(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:tw}var k0=Object.assign,qa=Object.getOwnPropertyDescriptor,cr=Object.defineProperty,jc=Object.prototype,Ga=[];Object.freeze(Ga);var T0={};Object.freeze(T0);var nw=typeof Proxy<"u",rw=Object.toString();function A0(){nw||ce(H.NODE_ENV!=="production"?"`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`":"Proxy not available")}function As(t){H.NODE_ENV!=="production"&&Y.verifyProxies&&ce("MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to "+t)}function Zn(){return++Y.mobxGuid}function Qf(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}var Ni=function(){};function yt(t){return typeof t=="function"}function ii(t){var e=typeof t;switch(e){case"string":case"symbol":case"number":return!0}return!1}function Rc(t){return t!==null&&typeof t=="object"}function hr(t){if(!Rc(t))return!1;var e=Object.getPrototypeOf(t);if(e==null)return!0;var n=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n.toString()===rw}function M0(t){var e=t==null?void 0:t.constructor;return e?e.name==="GeneratorFunction"||e.displayName==="GeneratorFunction":!1}function Nc(t,e,n){cr(t,e,{enumerable:!1,writable:!0,configurable:!0,value:n})}function j0(t,e,n){cr(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}function bi(t,e){var n="isMobX"+t;return e.prototype[n]=!0,function(r){return Rc(r)&&r[n]===!0}}function ps(t){return t!=null&&Object.prototype.toString.call(t)==="[object Map]"}function ow(t){var e=Object.getPrototypeOf(t),n=Object.getPrototypeOf(e),r=Object.getPrototypeOf(n);return r===null}function Nr(t){return t!=null&&Object.prototype.toString.call(t)==="[object Set]"}var R0=typeof Object.getOwnPropertySymbols<"u";function iw(t){var e=Object.keys(t);if(!R0)return e;var n=Object.getOwnPropertySymbols(t);return n.length?[].concat(e,n.filter(function(r){return jc.propertyIsEnumerable.call(t,r)})):e}var Pc=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:R0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames;function zd(t){return typeof t=="string"?t:typeof t=="symbol"?t.toString():new String(t).toString()}function N0(t){return t===null?null:typeof t=="object"?""+t:t}function Dn(t,e){return jc.hasOwnProperty.call(t,e)}var sw=Object.getOwnPropertyDescriptors||function(e){var n={};return Pc(e).forEach(function(r){n[r]=qa(e,r)}),n};function ln(t,e){return!!(t&e)}function an(t,e,n){return n?t|=e:t&=~e,t}function Lh(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function lw(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,cw(r.key),r)}}function hs(t,e,n){return e&&lw(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Pi(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=uw(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
89
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hr(){return Hr=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Hr.apply(null,arguments)}function P0(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Fd(t,e)}function Fd(t,e){return Fd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Fd(t,e)}function aw(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function cw(t){var e=aw(t,"string");return typeof e=="symbol"?e:e+""}function uw(t,e){if(t){if(typeof t=="string")return Lh(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lh(t,e):void 0}}var Kt=Symbol("mobx-stored-annotations");function ur(t){function e(n,r){if(_l(r))return t.decorate_20223_(n,r);Ol(n,r,t)}return Object.assign(e,t)}function Ol(t,e,n){if(Dn(t,Kt)||Nc(t,Kt,Hr({},t[Kt])),H.NODE_ENV!=="production"&&Ya(n)&&!Dn(t[Kt],e)){var r=t.constructor.name+".prototype."+e.toString();ce("'"+r+"' is decorated with 'override', but no such decorated member was found on prototype.")}dw(t,n,e),Ya(n)||(t[Kt][e]=n)}function dw(t,e,n){if(H.NODE_ENV!=="production"&&!Ya(e)&&Dn(t[Kt],n)){var r=t.constructor.name+".prototype."+n.toString(),o=t[Kt][n].annotationType_,i=e.annotationType_;ce("Cannot apply '@"+i+"' to '"+r+"':"+(`
|
|
90
|
+
The field is already decorated with '@`+o+"'.")+`
|
|
173
91
|
Re-decorating fields is not allowed.
|
|
174
|
-
Use '@override' decorator for methods overridden by subclass.`)}}function
|
|
175
|
-
'`+
|
|
176
|
-
'`+
|
|
177
|
-
'`+
|
|
178
|
-
'`+
|
|
179
|
-
'`+i+"' cannot be used on getter/setter properties"))}var nw="true",rw=X1();function X1(t){return{annotationType_:nw,options_:t,make_:iw,extend_:ow,decorate_20223_:sw}}function iw(t,e,n,r){var i,o;if(n.get)return dl.make_(t,e,n,r);if(n.set){var s=ei(e.toString(),n.set);return r===t.target_?t.defineProperty_(e,{configurable:L.safeDescriptors?t.isPlainObject_:!0,set:s})===null?0:2:(yn(r,e,{configurable:!0,set:s}),2)}if(r!==t.target_&&typeof n.value=="function"){var a;if(F1(n.value)){var l,c=(l=this.options_)!=null&&l.autoBind?Ui.bound:Ui;return c.make_(t,e,n,r)}var u=(a=this.options_)!=null&&a.autoBind?Fo.bound:Fo;return u.make_(t,e,n,r)}var f=((i=this.options_)==null?void 0:i.deep)===!1?Ke.ref:Ke;if(typeof n.value=="function"&&(o=this.options_)!=null&&o.autoBind){var d;n.value=n.value.bind((d=t.proxy_)!=null?d:t.target_)}return f.make_(t,e,n,r)}function ow(t,e,n,r){var i,o;if(n.get)return dl.extend_(t,e,n,r);if(n.set)return t.defineProperty_(e,{configurable:L.safeDescriptors?t.isPlainObject_:!0,set:ei(e.toString(),n.set)},r);if(typeof n.value=="function"&&(i=this.options_)!=null&&i.autoBind){var s;n.value=n.value.bind((s=t.proxy_)!=null?s:t.target_)}var a=((o=this.options_)==null?void 0:o.deep)===!1?Ke.ref:Ke;return a.extend_(t,e,n,r)}function sw(t,e){J("'"+this.annotationType_+"' cannot be used as a decorator")}var aw="observable",lw="observable.ref",cw="observable.shallow",uw="observable.struct",Q1={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(Q1);function Is(t){return t||Q1}var Xc=fl(aw),fw=fl(lw,{enhancer:ul}),dw=fl(cw,{enhancer:j2}),pw=fl(uw,{enhancer:H2}),em=wn(Xc);function Bs(t){return t.deep===!0?Qr:t.deep===!1?ul:mw(t.defaultDecorator)}function hw(t){var e;return t?(e=t.defaultDecorator)!=null?e:X1(t):void 0}function mw(t){var e,n;return t&&(e=(n=t.options_)==null?void 0:n.enhancer)!=null?e:Qr}function tm(t,e,n){if(ss(e))return Xc.decorate_20223_(t,e);if(Xr(e)){is(t,e,Xc);return}return Uo(t)?t:Sn(t)?Ke.object(t,e,n):Array.isArray(t)?Ke.array(t,e):so(t)?Ke.map(t,e):Hn(t)?Ke.set(t,e):typeof t=="object"&&t!==null?t:Ke.box(t,e)}B1(tm,em);var gw={box:function(e,n){var r=Is(n);return new Fr(e,Bs(r),r.name,!0,r.equals)},array:function(e,n){var r=Is(n);return(L.useProxies===!1||r.proxy===!1?vx:lx)(e,Bs(r),r.name)},map:function(e,n){var r=Is(n);return new Sm(e,Bs(r),r.name)},set:function(e,n){var r=Is(n);return new Cm(e,Bs(r),r.name)},object:function(e,n,r){return ui(function(){return Jw(L.useProxies===!1||(r==null?void 0:r.proxy)===!1?lo({},r):ix({},r),e,n)})},ref:wn(fw),shallow:wn(dw),deep:em,struct:wn(pw)},Ke=B1(tm,gw),nm="computed",bw="computed.struct",Qc=Yu(nm),vw=Yu(bw,{equals:Ea.structural}),dl=function(e,n){if(ss(n))return Qc.decorate_20223_(e,n);if(Xr(n))return is(e,n,Qc);if(Sn(e))return wn(Yu(nm,e));M.NODE_ENV!=="production"&&(Be(e)||J("First argument to `computed` should be an expression."),Be(n)&&J("A setter as second argument is no longer supported, use `{ set: fn }` option instead"));var r=Sn(n)?n:{};return r.get=e,r.name||(r.name=e.name||""),new Wt(r)};Object.assign(dl,Qc);dl.struct=wn(vw);var Sd,Cd,ka=0,yw=1,ww=(Sd=(Cd=Ca(function(){},"name"))==null?void 0:Cd.configurable)!=null?Sd:!1,Od={value:"action",configurable:!0,writable:!1,enumerable:!1};function ei(t,e,n,r){n===void 0&&(n=!1),M.NODE_ENV!=="production"&&(Be(e)||J("`action` can only be invoked on functions"),(typeof t!="string"||!t)&&J("actions should have valid names, got: '"+t+"'"));function i(){return xw(t,n,e,r||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return e.toString()},ww&&(Od.value=t,yn(i,"name",Od)),i}function xw(t,e,n,r,i){var o=Sw(t,e,r,i);try{return n.apply(r,i)}catch(s){throw o.error_=s,s}finally{Cw(o)}}function Sw(t,e,n,r){var i=M.NODE_ENV!=="production"&&Je()&&!!t,o=0;if(M.NODE_ENV!=="production"&&i){o=Date.now();var s=r?Array.from(r):Oa;Ct({type:tf,name:t,object:n,arguments:s})}var a=L.trackingDerivation,l=!e||!a;Lt();var c=L.allowStateChanges;l&&(ci(),c=Xu(!0));var u=ef(!0),f={runAsAction_:l,prevDerivation_:a,prevAllowStateChanges_:c,prevAllowStateReads_:u,notifySpy_:i,startTime_:o,actionId_:yw++,parentActionId_:ka};return ka=f.actionId_,f}function Cw(t){ka!==t.actionId_&&J(30),ka=t.parentActionId_,t.error_!==void 0&&(L.suppressReactionErrors=!0),Qu(t.prevAllowStateChanges_),No(t.prevAllowStateReads_),jt(),t.runAsAction_&&zn(t.prevDerivation_),M.NODE_ENV!=="production"&&t.notifySpy_&&Ot({time:Date.now()-t.startTime_}),L.suppressReactionErrors=!1}function Xu(t){var e=L.allowStateChanges;return L.allowStateChanges=t,e}function Qu(t){L.allowStateChanges=t}var Ow="create",Fr=function(t){function e(r,i,o,s,a){var l;return o===void 0&&(o=M.NODE_ENV!=="production"?"ObservableValue@"+sn():"ObservableValue"),s===void 0&&(s=!0),a===void 0&&(a=Ea.default),l=t.call(this,o)||this,l.enhancer=void 0,l.name_=void 0,l.equals=void 0,l.hasUnreportedChange_=!1,l.interceptors_=void 0,l.changeListeners_=void 0,l.value_=void 0,l.dehancer=void 0,l.enhancer=i,l.name_=o,l.equals=a,l.value_=i(r,void 0,o),M.NODE_ENV!=="production"&&s&&Je()&&ti({type:Ow,object:l,observableKind:"value",debugObjectName:l.name_,newValue:""+l.value_}),l}G1(e,t);var n=e.prototype;return n.dehanceValue=function(i){return this.dehancer!==void 0?this.dehancer(i):i},n.set=function(i){var o=this.value_;if(i=this.prepareNewValue_(i),i!==L.UNCHANGED){var s=Je();M.NODE_ENV!=="production"&&s&&Ct({type:Qt,object:this,observableKind:"value",debugObjectName:this.name_,newValue:i,oldValue:o}),this.setNewValue_(i),M.NODE_ENV!=="production"&&s&&Ot()}},n.prepareNewValue_=function(i){if(mn(this),Pt(this)){var o=Vt(this,{object:this,type:Qt,newValue:i});if(!o)return L.UNCHANGED;i=o.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?L.UNCHANGED:i},n.setNewValue_=function(i){var o=this.value_;this.value_=i,this.reportChanged(),en(this)&&tn(this,{type:Qt,object:this,newValue:i,oldValue:o})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(i){return ls(this,i)},n.observe_=function(i,o){return o&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:Qt,newValue:this.value_,oldValue:void 0}),cs(this,i)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+"["+this.value_+"]"},n.valueOf=function(){return q1(this.get())},n[Symbol.toPrimitive]=function(){return this.valueOf()},e}(xr),Wt=function(){function t(n){this.dependenciesState_=we.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=we.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new Aa(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=Bt.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,n.get||J(31),this.derivation=n.get,this.name_=n.name||(M.NODE_ENV!=="production"?"ComputedValue@"+sn():"ComputedValue"),n.set&&(this.setter_=ei(M.NODE_ENV!=="production"?this.name_+"-setter":"ComputedValue-setter",n.set)),this.equals_=n.equals||(n.compareStructural||n.struct?Ea.structural:Ea.default),this.scope_=n.context,this.requiresReaction_=n.requiresReaction,this.keepAlive_=!!n.keepAlive}var e=t.prototype;return e.onBecomeStale_=function(){Nw(this)},e.onBO=function(){this.onBOL&&this.onBOL.forEach(function(r){return r()})},e.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},e.get=function(){if(this.isComputing&&J(32,this.name_,this.derivation),L.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)eu(this)&&(this.warnAboutUntrackedRead_(),Lt(),this.value_=this.computeValue_(!1),jt());else if(cm(this),eu(this)){var r=L.trackingContext;this.keepAlive_&&!r&&(L.trackingContext=this),this.trackAndCompute()&&Mw(this),L.trackingContext=r}var i=this.value_;if(la(i))throw i.cause;return i},e.set=function(r){if(this.setter_){this.isRunningSetter&&J(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,r)}finally{this.isRunningSetter=!1}}else J(34,this.name_)},e.trackAndCompute=function(){var r=this.value_,i=this.dependenciesState_===we.NOT_TRACKING_,o=this.computeValue_(!0),s=i||la(r)||la(o)||!this.equals_(r,o);return s&&(this.value_=o,M.NODE_ENV!=="production"&&Je()&&ti({observableKind:"computed",debugObjectName:this.name_,object:this.scope_,type:"update",oldValue:r,newValue:o})),s},e.computeValue_=function(r){this.isComputing=!0;var i=Xu(!1),o;if(r)o=rm(this,this.derivation,this.scope_);else if(L.disableErrorBoundaries===!0)o=this.derivation.call(this.scope_);else try{o=this.derivation.call(this.scope_)}catch(s){o=new Aa(s)}return Qu(i),this.isComputing=!1,o},e.suspend_=function(){this.keepAlive_||(tu(this),this.value_=void 0,M.NODE_ENV!=="production"&&this.isTracing_!==Bt.NONE&&console.log("[mobx.trace] Computed value '"+this.name_+"' was suspended and it will recompute on the next access."))},e.observe_=function(r,i){var o=this,s=!0,a=void 0;return $w(function(){var l=o.get();if(!s||i){var c=ci();r({observableKind:"computed",debugObjectName:o.name_,type:Qt,object:o,newValue:l,oldValue:a}),zn(c)}s=!1,a=l})},e.warnAboutUntrackedRead_=function(){M.NODE_ENV!=="production"&&(this.isTracing_!==Bt.NONE&&console.log("[mobx.trace] Computed value '"+this.name_+"' is being read outside a reactive context. Doing a full recompute."),(typeof this.requiresReaction_=="boolean"?this.requiresReaction_:L.computedRequiresReaction)&&console.warn("[mobx] Computed value '"+this.name_+"' is being read outside a reactive context. Doing a full recompute."))},e.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},e.valueOf=function(){return q1(this.get())},e[Symbol.toPrimitive]=function(){return this.valueOf()},ao(t,[{key:"isComputing",get:function(){return vt(this.flags_,t.isComputingMask_)},set:function(r){this.flags_=yt(this.flags_,t.isComputingMask_,r)}},{key:"isRunningSetter",get:function(){return vt(this.flags_,t.isRunningSetterMask_)},set:function(r){this.flags_=yt(this.flags_,t.isRunningSetterMask_,r)}},{key:"isBeingObserved",get:function(){return vt(this.flags_,t.isBeingObservedMask_)},set:function(r){this.flags_=yt(this.flags_,t.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return vt(this.flags_,t.isPendingUnobservationMask_)},set:function(r){this.flags_=yt(this.flags_,t.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return vt(this.flags_,t.diffValueMask_)?1:0},set:function(r){this.flags_=yt(this.flags_,t.diffValueMask_,r===1)}}])}();Wt.isComputingMask_=1;Wt.isRunningSetterMask_=2;Wt.isBeingObservedMask_=4;Wt.isPendingUnobservationMask_=8;Wt.diffValueMask_=16;var pl=li("ComputedValue",Wt),we;(function(t){t[t.NOT_TRACKING_=-1]="NOT_TRACKING_",t[t.UP_TO_DATE_=0]="UP_TO_DATE_",t[t.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",t[t.STALE_=2]="STALE_"})(we||(we={}));var Bt;(function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"})(Bt||(Bt={}));var Aa=function(e){this.cause=void 0,this.cause=e};function la(t){return t instanceof Aa}function eu(t){switch(t.dependenciesState_){case we.UP_TO_DATE_:return!1;case we.NOT_TRACKING_:case we.STALE_:return!0;case we.POSSIBLY_STALE_:{for(var e=ef(!0),n=ci(),r=t.observing_,i=r.length,o=0;o<i;o++){var s=r[o];if(pl(s)){if(L.disableErrorBoundaries)s.get();else try{s.get()}catch{return zn(n),No(e),!0}if(t.dependenciesState_===we.STALE_)return zn(n),No(e),!0}}return om(t),zn(n),No(e),!1}}}function mn(t){if(M.NODE_ENV!=="production"){var e=t.observers_.size>0;!L.allowStateChanges&&(e||L.enforceActions==="always")&&console.warn("[MobX] "+(L.enforceActions?"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: ":"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: ")+t.name_)}}function Ew(t){M.NODE_ENV!=="production"&&!L.allowStateReads&&L.observableRequiresReaction&&console.warn("[mobx] Observable '"+t.name_+"' being read outside a reactive context.")}function rm(t,e,n){var r=ef(!0);om(t),t.newObserving_=new Array(t.runId_===0?100:t.observing_.length),t.unboundDepsCount_=0,t.runId_=++L.runId;var i=L.trackingDerivation;L.trackingDerivation=t,L.inBatch++;var o;if(L.disableErrorBoundaries===!0)o=e.call(n);else try{o=e.call(n)}catch(s){o=new Aa(s)}return L.inBatch--,L.trackingDerivation=i,kw(t),_w(t),No(r),o}function _w(t){M.NODE_ENV!=="production"&&t.observing_.length===0&&(typeof t.requiresObservable_=="boolean"?t.requiresObservable_:L.reactionRequiresObservable)&&console.warn("[mobx] Derivation '"+t.name_+"' is created/updated without reading any observable value.")}function kw(t){for(var e=t.observing_,n=t.observing_=t.newObserving_,r=we.UP_TO_DATE_,i=0,o=t.unboundDepsCount_,s=0;s<o;s++){var a=n[s];a.diffValue===0&&(a.diffValue=1,i!==s&&(n[i]=a),i++),a.dependenciesState_>r&&(r=a.dependenciesState_)}for(n.length=i,t.newObserving_=null,o=e.length;o--;){var l=e[o];l.diffValue===0&&am(l,t),l.diffValue=0}for(;i--;){var c=n[i];c.diffValue===1&&(c.diffValue=0,Tw(c,t))}r!==we.UP_TO_DATE_&&(t.dependenciesState_=r,t.onBecomeStale_())}function tu(t){var e=t.observing_;t.observing_=[];for(var n=e.length;n--;)am(e[n],t);t.dependenciesState_=we.NOT_TRACKING_}function im(t){var e=ci();try{return t()}finally{zn(e)}}function ci(){var t=L.trackingDerivation;return L.trackingDerivation=null,t}function zn(t){L.trackingDerivation=t}function ef(t){var e=L.allowStateReads;return L.allowStateReads=t,e}function No(t){L.allowStateReads=t}function om(t){if(t.dependenciesState_!==we.UP_TO_DATE_){t.dependenciesState_=we.UP_TO_DATE_;for(var e=t.observing_,n=e.length;n--;)e[n].lowestObserverState_=we.UP_TO_DATE_}}var ca=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},ua=!0,sm=!1,L=function(){var t=il();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(ua=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==new ca().version&&(ua=!1),ua?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new ca):(setTimeout(function(){sm||J(35)},1),new ca)}();function Aw(){if((L.pendingReactions.length||L.inBatch||L.isRunningReactions)&&J(36),sm=!0,ua){var t=il();--t.__mobxInstanceCount===0&&(t.__mobxGlobals=void 0),L=new ca}}function Tw(t,e){t.observers_.add(e),t.lowestObserverState_>e.dependenciesState_&&(t.lowestObserverState_=e.dependenciesState_)}function am(t,e){t.observers_.delete(e),t.observers_.size===0&&lm(t)}function lm(t){t.isPendingUnobservation===!1&&(t.isPendingUnobservation=!0,L.pendingUnobservations.push(t))}function Lt(){L.inBatch++}function jt(){if(--L.inBatch===0){pm();for(var t=L.pendingUnobservations,e=0;e<t.length;e++){var n=t[e];n.isPendingUnobservation=!1,n.observers_.size===0&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBUO()),n instanceof Wt&&n.suspend_())}L.pendingUnobservations=[]}}function cm(t){Ew(t);var e=L.trackingDerivation;return e!==null?(e.runId_!==t.lastAccessedBy_&&(t.lastAccessedBy_=e.runId_,e.newObserving_[e.unboundDepsCount_++]=t,!t.isBeingObserved&&L.trackingContext&&(t.isBeingObserved=!0,t.onBO())),t.isBeingObserved):(t.observers_.size===0&&L.inBatch>0&&lm(t),!1)}function um(t){t.lowestObserverState_!==we.STALE_&&(t.lowestObserverState_=we.STALE_,t.observers_.forEach(function(e){e.dependenciesState_===we.UP_TO_DATE_&&(M.NODE_ENV!=="production"&&e.isTracing_!==Bt.NONE&&fm(e,t),e.onBecomeStale_()),e.dependenciesState_=we.STALE_}))}function Mw(t){t.lowestObserverState_!==we.STALE_&&(t.lowestObserverState_=we.STALE_,t.observers_.forEach(function(e){e.dependenciesState_===we.POSSIBLY_STALE_?(e.dependenciesState_=we.STALE_,M.NODE_ENV!=="production"&&e.isTracing_!==Bt.NONE&&fm(e,t)):e.dependenciesState_===we.UP_TO_DATE_&&(t.lowestObserverState_=we.UP_TO_DATE_)}))}function Nw(t){t.lowestObserverState_===we.UP_TO_DATE_&&(t.lowestObserverState_=we.POSSIBLY_STALE_,t.observers_.forEach(function(e){e.dependenciesState_===we.UP_TO_DATE_&&(e.dependenciesState_=we.POSSIBLY_STALE_,e.onBecomeStale_())}))}function fm(t,e){if(console.log("[mobx.trace] '"+t.name_+"' is invalidated due to a change in: '"+e.name_+"'"),t.isTracing_===Bt.BREAK){var n=[];dm(vm(t),n,1),new Function(`debugger;
|
|
92
|
+
Use '@override' decorator for methods overridden by subclass.`)}}function fw(t){return Dn(t,Kt)||Nc(t,Kt,Hr({},t[Kt])),t[Kt]}function _l(t){return typeof t=="object"&&typeof t.kind=="string"}function Dc(t,e){H.NODE_ENV!=="production"&&!e.includes(t.kind)&&ce("The decorator applied to '"+String(t.name)+"' cannot be used on a "+t.kind+" element")}var xe=Symbol("mobx administration"),ko=function(){function t(n){n===void 0&&(n=H.NODE_ENV!=="production"?"Atom@"+Zn():"Atom"),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=Ve.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=n}var e=t.prototype;return e.onBO=function(){this.onBOL&&this.onBOL.forEach(function(r){return r()})},e.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},e.reportObserved=function(){return J0(this)},e.reportChanged=function(){Rn(),Z0(this),Nn()},e.toString=function(){return this.name_},hs(t,[{key:"isBeingObserved",get:function(){return ln(this.flags_,t.isBeingObservedMask_)},set:function(r){this.flags_=an(this.flags_,t.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return ln(this.flags_,t.isPendingUnobservationMask_)},set:function(r){this.flags_=an(this.flags_,t.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return ln(this.flags_,t.diffValueMask_)?1:0},set:function(r){this.flags_=an(this.flags_,t.diffValueMask_,r===1)}}])}();ko.isBeingObservedMask_=1;ko.isPendingUnobservationMask_=2;ko.diffValueMask_=4;var ep=bi("Atom",ko);function D0(t,e,n){e===void 0&&(e=Ni),n===void 0&&(n=Ni);var r=new ko(t);return e!==Ni&&_S(r,e),n!==Ni&&rb(r,n),r}function pw(t,e){return t===e}function hw(t,e){return ap(t,e)}function gw(t,e){return ap(t,e,1)}function mw(t,e){return Object.is?Object.is(t,e):t===e?t!==0||1/t===1/e:t!==t&&e!==e}var Ka={identity:pw,structural:hw,default:mw,shallow:gw};function si(t,e,n){return cl(t)?t:Array.isArray(t)?Tt.array(t,{name:n}):hr(t)?Tt.object(t,void 0,{name:n}):ps(t)?Tt.map(t,{name:n}):Nr(t)?Tt.set(t,{name:n}):typeof t=="function"&&!Ji(t)&&!al(t)?M0(t)?Zi(t):ll(n,t):t}function bw(t,e,n){if(t==null||Ml(t)||Hc(t)||To(t)||or(t))return t;if(Array.isArray(t))return Tt.array(t,{name:n,deep:!1});if(hr(t))return Tt.object(t,void 0,{name:n,deep:!1});if(ps(t))return Tt.map(t,{name:n,deep:!1});if(Nr(t))return Tt.set(t,{name:n,deep:!1});H.NODE_ENV!=="production"&&ce("The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets")}function Lc(t){return t}function vw(t,e){return H.NODE_ENV!=="production"&&cl(t)&&ce("observable.struct should not be used with observable values"),ap(t,e)?e:t}var yw="override";function Ya(t){return t.annotationType_===yw}function kl(t,e){return{annotationType_:t,options_:e,make_:xw,extend_:ww,decorate_20223_:Sw}}function xw(t,e,n,r){var o;if((o=this.options_)!=null&&o.bound)return this.extend_(t,e,n,!1)===null?0:1;if(r===t.target_)return this.extend_(t,e,n,!1)===null?0:2;if(Ji(n.value))return 1;var i=L0(t,this,e,n,!1);return cr(r,e,i),2}function ww(t,e,n,r){var o=L0(t,this,e,n);return t.defineProperty_(e,o,r)}function Sw(t,e){H.NODE_ENV!=="production"&&Dc(e,["method","field"]);var n=e.kind,r=e.name,o=e.addInitializer,i=this,s=function(c){var u,d,f,p;return li((u=(d=i.options_)==null?void 0:d.name)!=null?u:r.toString(),c,(f=(p=i.options_)==null?void 0:p.autoAction)!=null?f:!1)};if(n=="field")return function(a){var c,u=a;return Ji(u)||(u=s(u)),(c=i.options_)!=null&&c.bound&&(u=u.bind(this),u.isMobxAction=!0),u};if(n=="method"){var l;return Ji(t)||(t=s(t)),(l=this.options_)!=null&&l.bound&&o(function(){var a=this,c=a[r].bind(a);c.isMobxAction=!0,a[r]=c}),t}ce("Cannot apply '"+i.annotationType_+"' to '"+String(r)+"' (kind: "+n+"):"+(`
|
|
93
|
+
'`+i.annotationType_+"' can only be used on properties with a function value."))}function Cw(t,e,n,r){var o=e.annotationType_,i=r.value;H.NODE_ENV!=="production"&&!yt(i)&&ce("Cannot apply '"+o+"' to '"+t.name_+"."+n.toString()+"':"+(`
|
|
94
|
+
'`+o+"' can only be used on properties with a function value."))}function L0(t,e,n,r,o){var i,s,l,a,c,u,d;o===void 0&&(o=Y.safeDescriptors),Cw(t,e,n,r);var f=r.value;if((i=e.options_)!=null&&i.bound){var p;f=f.bind((p=t.proxy_)!=null?p:t.target_)}return{value:li((s=(l=e.options_)==null?void 0:l.name)!=null?s:n.toString(),f,(a=(c=e.options_)==null?void 0:c.autoAction)!=null?a:!1,(u=e.options_)!=null&&u.bound?(d=t.proxy_)!=null?d:t.target_:void 0),configurable:o?t.isPlainObject_:!0,enumerable:!1,writable:!o}}function V0(t,e){return{annotationType_:t,options_:e,make_:Ew,extend_:Ow,decorate_20223_:_w}}function Ew(t,e,n,r){var o;if(r===t.target_)return this.extend_(t,e,n,!1)===null?0:2;if((o=this.options_)!=null&&o.bound&&(!Dn(t.target_,e)||!al(t.target_[e]))&&this.extend_(t,e,n,!1)===null)return 0;if(al(n.value))return 1;var i=I0(t,this,e,n,!1,!1);return cr(r,e,i),2}function Ow(t,e,n,r){var o,i=I0(t,this,e,n,(o=this.options_)==null?void 0:o.bound);return t.defineProperty_(e,i,r)}function _w(t,e){var n;H.NODE_ENV!=="production"&&Dc(e,["method"]);var r=e.name,o=e.addInitializer;return al(t)||(t=Zi(t)),(n=this.options_)!=null&&n.bound&&o(function(){var i=this,s=i[r].bind(i);s.isMobXFlow=!0,i[r]=s}),t}function kw(t,e,n,r){var o=e.annotationType_,i=r.value;H.NODE_ENV!=="production"&&!yt(i)&&ce("Cannot apply '"+o+"' to '"+t.name_+"."+n.toString()+"':"+(`
|
|
95
|
+
'`+o+"' can only be used on properties with a generator function value."))}function I0(t,e,n,r,o,i){i===void 0&&(i=Y.safeDescriptors),kw(t,e,n,r);var s=r.value;if(al(s)||(s=Zi(s)),o){var l;s=s.bind((l=t.proxy_)!=null?l:t.target_),s.isMobXFlow=!0}return{value:s,configurable:i?t.isPlainObject_:!0,enumerable:!1,writable:!i}}function tp(t,e){return{annotationType_:t,options_:e,make_:Tw,extend_:Aw,decorate_20223_:Mw}}function Tw(t,e,n){return this.extend_(t,e,n,!1)===null?0:1}function Aw(t,e,n,r){return jw(t,this,e,n),t.defineComputedProperty_(e,Hr({},this.options_,{get:n.get,set:n.set}),r)}function Mw(t,e){H.NODE_ENV!=="production"&&Dc(e,["getter"]);var n=this,r=e.name,o=e.addInitializer;return o(function(){var i=gs(this)[xe],s=Hr({},n.options_,{get:t,context:this});s.name||(s.name=H.NODE_ENV!=="production"?i.name_+"."+r.toString():"ObservableObject."+r.toString()),i.values_.set(r,new $n(s))}),function(){return this[xe].getObservablePropValue_(r)}}function jw(t,e,n,r){var o=e.annotationType_,i=r.get;H.NODE_ENV!=="production"&&!i&&ce("Cannot apply '"+o+"' to '"+t.name_+"."+n.toString()+"':"+(`
|
|
96
|
+
'`+o+"' can only be used on getter(+setter) properties."))}function Vc(t,e){return{annotationType_:t,options_:e,make_:Rw,extend_:Nw,decorate_20223_:Pw}}function Rw(t,e,n){return this.extend_(t,e,n,!1)===null?0:1}function Nw(t,e,n,r){var o,i;return Dw(t,this,e,n),t.defineObservableProperty_(e,n.value,(o=(i=this.options_)==null?void 0:i.enhancer)!=null?o:si,r)}function Pw(t,e){if(H.NODE_ENV!=="production"){if(e.kind==="field")throw ce("Please use `@observable accessor "+String(e.name)+"` instead of `@observable "+String(e.name)+"`");Dc(e,["accessor"])}var n=this,r=e.kind,o=e.name,i=new WeakSet;function s(l,a){var c,u,d=gs(l)[xe],f=new Yo(a,(c=(u=n.options_)==null?void 0:u.enhancer)!=null?c:si,H.NODE_ENV!=="production"?d.name_+"."+o.toString():"ObservableObject."+o.toString(),!1);d.values_.set(o,f),i.add(l)}if(r=="accessor")return{get:function(){return i.has(this)||s(this,t.get.call(this)),this[xe].getObservablePropValue_(o)},set:function(a){return i.has(this)||s(this,a),this[xe].setObservablePropValue_(o,a)},init:function(a){return i.has(this)||s(this,a),a}}}function Dw(t,e,n,r){var o=e.annotationType_;H.NODE_ENV!=="production"&&!("value"in r)&&ce("Cannot apply '"+o+"' to '"+t.name_+"."+n.toString()+"':"+(`
|
|
97
|
+
'`+o+"' cannot be used on getter/setter properties"))}var Lw="true",Vw=$0();function $0(t){return{annotationType_:Lw,options_:t,make_:Iw,extend_:$w,decorate_20223_:Hw}}function Iw(t,e,n,r){var o,i;if(n.get)return Ic.make_(t,e,n,r);if(n.set){var s=li(e.toString(),n.set);return r===t.target_?t.defineProperty_(e,{configurable:Y.safeDescriptors?t.isPlainObject_:!0,set:s})===null?0:2:(cr(r,e,{configurable:!0,set:s}),2)}if(r!==t.target_&&typeof n.value=="function"){var l;if(M0(n.value)){var a,c=(a=this.options_)!=null&&a.autoBind?Zi.bound:Zi;return c.make_(t,e,n,r)}var u=(l=this.options_)!=null&&l.autoBind?ll.bound:ll;return u.make_(t,e,n,r)}var d=((o=this.options_)==null?void 0:o.deep)===!1?Tt.ref:Tt;if(typeof n.value=="function"&&(i=this.options_)!=null&&i.autoBind){var f;n.value=n.value.bind((f=t.proxy_)!=null?f:t.target_)}return d.make_(t,e,n,r)}function $w(t,e,n,r){var o,i;if(n.get)return Ic.extend_(t,e,n,r);if(n.set)return t.defineProperty_(e,{configurable:Y.safeDescriptors?t.isPlainObject_:!0,set:li(e.toString(),n.set)},r);if(typeof n.value=="function"&&(o=this.options_)!=null&&o.autoBind){var s;n.value=n.value.bind((s=t.proxy_)!=null?s:t.target_)}var l=((i=this.options_)==null?void 0:i.deep)===!1?Tt.ref:Tt;return l.extend_(t,e,n,r)}function Hw(t,e){ce("'"+this.annotationType_+"' cannot be used as a decorator")}var Bw="observable",zw="observable.ref",Fw="observable.shallow",Ww="observable.struct",H0={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(H0);function Kl(t){return t||H0}var Wd=Vc(Bw),Uw=Vc(zw,{enhancer:Lc}),qw=Vc(Fw,{enhancer:bw}),Gw=Vc(Ww,{enhancer:vw}),B0=ur(Wd);function Yl(t){return t.deep===!0?si:t.deep===!1?Lc:Yw(t.defaultDecorator)}function Kw(t){var e;return t?(e=t.defaultDecorator)!=null?e:$0(t):void 0}function Yw(t){var e,n;return t&&(e=(n=t.options_)==null?void 0:n.enhancer)!=null?e:si}function z0(t,e,n){if(_l(e))return Wd.decorate_20223_(t,e);if(ii(e)){Ol(t,e,Wd);return}return cl(t)?t:hr(t)?Tt.object(t,e,n):Array.isArray(t)?Tt.array(t,e):ps(t)?Tt.map(t,e):Nr(t)?Tt.set(t,e):typeof t=="object"&&t!==null?t:Tt.box(t,e)}k0(z0,B0);var Jw={box:function(e,n){var r=Kl(n);return new Yo(e,Yl(r),r.name,!0,r.equals)},array:function(e,n){var r=Kl(n);return(Y.useProxies===!1||r.proxy===!1?XS:zS)(e,Yl(r),r.name)},map:function(e,n){var r=Kl(n);return new cb(e,Yl(r),r.name)},set:function(e,n){var r=Kl(n);return new ub(e,Yl(r),r.name)},object:function(e,n,r){return yi(function(){return MS(Y.useProxies===!1||(r==null?void 0:r.proxy)===!1?gs({},r):IS({},r),e,n)})},ref:ur(Uw),shallow:ur(qw),deep:B0,struct:ur(Gw)},Tt=k0(z0,Jw),F0="computed",Zw="computed.struct",Ud=tp(F0),Xw=tp(Zw,{equals:Ka.structural}),Ic=function(e,n){if(_l(n))return Ud.decorate_20223_(e,n);if(ii(n))return Ol(e,n,Ud);if(hr(e))return ur(tp(F0,e));H.NODE_ENV!=="production"&&(yt(e)||ce("First argument to `computed` should be an expression."),yt(n)&&ce("A setter as second argument is no longer supported, use `{ set: fn }` option instead"));var r=hr(n)?n:{};return r.get=e,r.name||(r.name=e.name||""),new $n(r)};Object.assign(Ic,Ud);Ic.struct=ur(Xw);var Vh,Ih,Ja=0,Qw=1,eS=(Vh=(Ih=qa(function(){},"name"))==null?void 0:Ih.configurable)!=null?Vh:!1,$h={value:"action",configurable:!0,writable:!1,enumerable:!1};function li(t,e,n,r){n===void 0&&(n=!1),H.NODE_ENV!=="production"&&(yt(e)||ce("`action` can only be invoked on functions"),(typeof t!="string"||!t)&&ce("actions should have valid names, got: '"+t+"'"));function o(){return tS(t,n,e,r||this,arguments)}return o.isMobxAction=!0,o.toString=function(){return e.toString()},eS&&($h.value=t,cr(o,"name",$h)),o}function tS(t,e,n,r,o){var i=nS(t,e,r,o);try{return n.apply(r,o)}catch(s){throw i.error_=s,s}finally{rS(i)}}function nS(t,e,n,r){var o=H.NODE_ENV!=="production"&&At()&&!!t,i=0;if(H.NODE_ENV!=="production"&&o){i=Date.now();var s=r?Array.from(r):Ga;pn({type:ip,name:t,object:n,arguments:s})}var l=Y.trackingDerivation,a=!e||!l;Rn();var c=Y.allowStateChanges;a&&(vi(),c=np(!0));var u=op(!0),d={runAsAction_:a,prevDerivation_:l,prevAllowStateChanges_:c,prevAllowStateReads_:u,notifySpy_:o,startTime_:i,actionId_:Qw++,parentActionId_:Ja};return Ja=d.actionId_,d}function rS(t){Ja!==t.actionId_&&ce(30),Ja=t.parentActionId_,t.error_!==void 0&&(Y.suppressReactionErrors=!0),rp(t.prevAllowStateChanges_),Us(t.prevAllowStateReads_),Nn(),t.runAsAction_&&Vr(t.prevDerivation_),H.NODE_ENV!=="production"&&t.notifySpy_&&hn({time:Date.now()-t.startTime_}),Y.suppressReactionErrors=!1}function np(t){var e=Y.allowStateChanges;return Y.allowStateChanges=t,e}function rp(t){Y.allowStateChanges=t}var oS="create",Yo=function(t){function e(r,o,i,s,l){var a;return i===void 0&&(i=H.NODE_ENV!=="production"?"ObservableValue@"+Zn():"ObservableValue"),s===void 0&&(s=!0),l===void 0&&(l=Ka.default),a=t.call(this,i)||this,a.enhancer=void 0,a.name_=void 0,a.equals=void 0,a.hasUnreportedChange_=!1,a.interceptors_=void 0,a.changeListeners_=void 0,a.value_=void 0,a.dehancer=void 0,a.enhancer=o,a.name_=i,a.equals=l,a.value_=o(r,void 0,i),H.NODE_ENV!=="production"&&s&&At()&&ai({type:oS,object:a,observableKind:"value",debugObjectName:a.name_,newValue:""+a.value_}),a}P0(e,t);var n=e.prototype;return n.dehanceValue=function(o){return this.dehancer!==void 0?this.dehancer(o):o},n.set=function(o){var i=this.value_;if(o=this.prepareNewValue_(o),o!==Y.UNCHANGED){var s=At();H.NODE_ENV!=="production"&&s&&pn({type:Un,object:this,observableKind:"value",debugObjectName:this.name_,newValue:o,oldValue:i}),this.setNewValue_(o),H.NODE_ENV!=="production"&&s&&hn()}},n.prepareNewValue_=function(o){if(sr(this),Tn(this)){var i=An(this,{object:this,type:Un,newValue:o});if(!i)return Y.UNCHANGED;o=i.newValue}return o=this.enhancer(o,this.value_,this.name_),this.equals(this.value_,o)?Y.UNCHANGED:o},n.setNewValue_=function(o){var i=this.value_;this.value_=o,this.reportChanged(),Gn(this)&&Kn(this,{type:Un,object:this,newValue:o,oldValue:i})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(o){return Tl(this,o)},n.observe_=function(o,i){return i&&o({observableKind:"value",debugObjectName:this.name_,object:this,type:Un,newValue:this.value_,oldValue:void 0}),Al(this,o)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+"["+this.value_+"]"},n.valueOf=function(){return N0(this.get())},n[Symbol.toPrimitive]=function(){return this.valueOf()},e}(ko),$n=function(){function t(n){this.dependenciesState_=Ve.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Ve.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new Za(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=Ln.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,n.get||ce(31),this.derivation=n.get,this.name_=n.name||(H.NODE_ENV!=="production"?"ComputedValue@"+Zn():"ComputedValue"),n.set&&(this.setter_=li(H.NODE_ENV!=="production"?this.name_+"-setter":"ComputedValue-setter",n.set)),this.equals_=n.equals||(n.compareStructural||n.struct?Ka.structural:Ka.default),this.scope_=n.context,this.requiresReaction_=n.requiresReaction,this.keepAlive_=!!n.keepAlive}var e=t.prototype;return e.onBecomeStale_=function(){dS(this)},e.onBO=function(){this.onBOL&&this.onBOL.forEach(function(r){return r()})},e.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},e.get=function(){if(this.isComputing&&ce(32,this.name_,this.derivation),Y.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)qd(this)&&(this.warnAboutUntrackedRead_(),Rn(),this.value_=this.computeValue_(!1),Nn());else if(J0(this),qd(this)){var r=Y.trackingContext;this.keepAlive_&&!r&&(Y.trackingContext=this),this.trackAndCompute()&&uS(this),Y.trackingContext=r}var o=this.value_;if(ja(o))throw o.cause;return o},e.set=function(r){if(this.setter_){this.isRunningSetter&&ce(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,r)}finally{this.isRunningSetter=!1}}else ce(34,this.name_)},e.trackAndCompute=function(){var r=this.value_,o=this.dependenciesState_===Ve.NOT_TRACKING_,i=this.computeValue_(!0),s=o||ja(r)||ja(i)||!this.equals_(r,i);return s&&(this.value_=i,H.NODE_ENV!=="production"&&At()&&ai({observableKind:"computed",debugObjectName:this.name_,object:this.scope_,type:"update",oldValue:r,newValue:i})),s},e.computeValue_=function(r){this.isComputing=!0;var o=np(!1),i;if(r)i=W0(this,this.derivation,this.scope_);else if(Y.disableErrorBoundaries===!0)i=this.derivation.call(this.scope_);else try{i=this.derivation.call(this.scope_)}catch(s){i=new Za(s)}return rp(o),this.isComputing=!1,i},e.suspend_=function(){this.keepAlive_||(Gd(this),this.value_=void 0,H.NODE_ENV!=="production"&&this.isTracing_!==Ln.NONE&&console.log("[mobx.trace] Computed value '"+this.name_+"' was suspended and it will recompute on the next access."))},e.observe_=function(r,o){var i=this,s=!0,l=void 0;return wS(function(){var a=i.get();if(!s||o){var c=vi();r({observableKind:"computed",debugObjectName:i.name_,type:Un,object:i,newValue:a,oldValue:l}),Vr(c)}s=!1,l=a})},e.warnAboutUntrackedRead_=function(){H.NODE_ENV!=="production"&&(this.isTracing_!==Ln.NONE&&console.log("[mobx.trace] Computed value '"+this.name_+"' is being read outside a reactive context. Doing a full recompute."),(typeof this.requiresReaction_=="boolean"?this.requiresReaction_:Y.computedRequiresReaction)&&console.warn("[mobx] Computed value '"+this.name_+"' is being read outside a reactive context. Doing a full recompute."))},e.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},e.valueOf=function(){return N0(this.get())},e[Symbol.toPrimitive]=function(){return this.valueOf()},hs(t,[{key:"isComputing",get:function(){return ln(this.flags_,t.isComputingMask_)},set:function(r){this.flags_=an(this.flags_,t.isComputingMask_,r)}},{key:"isRunningSetter",get:function(){return ln(this.flags_,t.isRunningSetterMask_)},set:function(r){this.flags_=an(this.flags_,t.isRunningSetterMask_,r)}},{key:"isBeingObserved",get:function(){return ln(this.flags_,t.isBeingObservedMask_)},set:function(r){this.flags_=an(this.flags_,t.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return ln(this.flags_,t.isPendingUnobservationMask_)},set:function(r){this.flags_=an(this.flags_,t.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return ln(this.flags_,t.diffValueMask_)?1:0},set:function(r){this.flags_=an(this.flags_,t.diffValueMask_,r===1)}}])}();$n.isComputingMask_=1;$n.isRunningSetterMask_=2;$n.isBeingObservedMask_=4;$n.isPendingUnobservationMask_=8;$n.diffValueMask_=16;var $c=bi("ComputedValue",$n),Ve;(function(t){t[t.NOT_TRACKING_=-1]="NOT_TRACKING_",t[t.UP_TO_DATE_=0]="UP_TO_DATE_",t[t.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",t[t.STALE_=2]="STALE_"})(Ve||(Ve={}));var Ln;(function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"})(Ln||(Ln={}));var Za=function(e){this.cause=void 0,this.cause=e};function ja(t){return t instanceof Za}function qd(t){switch(t.dependenciesState_){case Ve.UP_TO_DATE_:return!1;case Ve.NOT_TRACKING_:case Ve.STALE_:return!0;case Ve.POSSIBLY_STALE_:{for(var e=op(!0),n=vi(),r=t.observing_,o=r.length,i=0;i<o;i++){var s=r[i];if($c(s)){if(Y.disableErrorBoundaries)s.get();else try{s.get()}catch{return Vr(n),Us(e),!0}if(t.dependenciesState_===Ve.STALE_)return Vr(n),Us(e),!0}}return q0(t),Vr(n),Us(e),!1}}}function sr(t){if(H.NODE_ENV!=="production"){var e=t.observers_.size>0;!Y.allowStateChanges&&(e||Y.enforceActions==="always")&&console.warn("[MobX] "+(Y.enforceActions?"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: ":"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: ")+t.name_)}}function iS(t){H.NODE_ENV!=="production"&&!Y.allowStateReads&&Y.observableRequiresReaction&&console.warn("[mobx] Observable '"+t.name_+"' being read outside a reactive context.")}function W0(t,e,n){var r=op(!0);q0(t),t.newObserving_=new Array(t.runId_===0?100:t.observing_.length),t.unboundDepsCount_=0,t.runId_=++Y.runId;var o=Y.trackingDerivation;Y.trackingDerivation=t,Y.inBatch++;var i;if(Y.disableErrorBoundaries===!0)i=e.call(n);else try{i=e.call(n)}catch(s){i=new Za(s)}return Y.inBatch--,Y.trackingDerivation=o,lS(t),sS(t),Us(r),i}function sS(t){H.NODE_ENV!=="production"&&t.observing_.length===0&&(typeof t.requiresObservable_=="boolean"?t.requiresObservable_:Y.reactionRequiresObservable)&&console.warn("[mobx] Derivation '"+t.name_+"' is created/updated without reading any observable value.")}function lS(t){for(var e=t.observing_,n=t.observing_=t.newObserving_,r=Ve.UP_TO_DATE_,o=0,i=t.unboundDepsCount_,s=0;s<i;s++){var l=n[s];l.diffValue===0&&(l.diffValue=1,o!==s&&(n[o]=l),o++),l.dependenciesState_>r&&(r=l.dependenciesState_)}for(n.length=o,t.newObserving_=null,i=e.length;i--;){var a=e[i];a.diffValue===0&&K0(a,t),a.diffValue=0}for(;o--;){var c=n[o];c.diffValue===1&&(c.diffValue=0,cS(c,t))}r!==Ve.UP_TO_DATE_&&(t.dependenciesState_=r,t.onBecomeStale_())}function Gd(t){var e=t.observing_;t.observing_=[];for(var n=e.length;n--;)K0(e[n],t);t.dependenciesState_=Ve.NOT_TRACKING_}function U0(t){var e=vi();try{return t()}finally{Vr(e)}}function vi(){var t=Y.trackingDerivation;return Y.trackingDerivation=null,t}function Vr(t){Y.trackingDerivation=t}function op(t){var e=Y.allowStateReads;return Y.allowStateReads=t,e}function Us(t){Y.allowStateReads=t}function q0(t){if(t.dependenciesState_!==Ve.UP_TO_DATE_){t.dependenciesState_=Ve.UP_TO_DATE_;for(var e=t.observing_,n=e.length;n--;)e[n].lowestObserverState_=Ve.UP_TO_DATE_}}var Ra=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},Na=!0,G0=!1,Y=function(){var t=Mc();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(Na=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==new Ra().version&&(Na=!1),Na?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new Ra):(setTimeout(function(){G0||ce(35)},1),new Ra)}();function aS(){if((Y.pendingReactions.length||Y.inBatch||Y.isRunningReactions)&&ce(36),G0=!0,Na){var t=Mc();--t.__mobxInstanceCount===0&&(t.__mobxGlobals=void 0),Y=new Ra}}function cS(t,e){t.observers_.add(e),t.lowestObserverState_>e.dependenciesState_&&(t.lowestObserverState_=e.dependenciesState_)}function K0(t,e){t.observers_.delete(e),t.observers_.size===0&&Y0(t)}function Y0(t){t.isPendingUnobservation===!1&&(t.isPendingUnobservation=!0,Y.pendingUnobservations.push(t))}function Rn(){Y.inBatch++}function Nn(){if(--Y.inBatch===0){eb();for(var t=Y.pendingUnobservations,e=0;e<t.length;e++){var n=t[e];n.isPendingUnobservation=!1,n.observers_.size===0&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBUO()),n instanceof $n&&n.suspend_())}Y.pendingUnobservations=[]}}function J0(t){iS(t);var e=Y.trackingDerivation;return e!==null?(e.runId_!==t.lastAccessedBy_&&(t.lastAccessedBy_=e.runId_,e.newObserving_[e.unboundDepsCount_++]=t,!t.isBeingObserved&&Y.trackingContext&&(t.isBeingObserved=!0,t.onBO())),t.isBeingObserved):(t.observers_.size===0&&Y.inBatch>0&&Y0(t),!1)}function Z0(t){t.lowestObserverState_!==Ve.STALE_&&(t.lowestObserverState_=Ve.STALE_,t.observers_.forEach(function(e){e.dependenciesState_===Ve.UP_TO_DATE_&&(H.NODE_ENV!=="production"&&e.isTracing_!==Ln.NONE&&X0(e,t),e.onBecomeStale_()),e.dependenciesState_=Ve.STALE_}))}function uS(t){t.lowestObserverState_!==Ve.STALE_&&(t.lowestObserverState_=Ve.STALE_,t.observers_.forEach(function(e){e.dependenciesState_===Ve.POSSIBLY_STALE_?(e.dependenciesState_=Ve.STALE_,H.NODE_ENV!=="production"&&e.isTracing_!==Ln.NONE&&X0(e,t)):e.dependenciesState_===Ve.UP_TO_DATE_&&(t.lowestObserverState_=Ve.UP_TO_DATE_)}))}function dS(t){t.lowestObserverState_===Ve.UP_TO_DATE_&&(t.lowestObserverState_=Ve.POSSIBLY_STALE_,t.observers_.forEach(function(e){e.dependenciesState_===Ve.UP_TO_DATE_&&(e.dependenciesState_=Ve.POSSIBLY_STALE_,e.onBecomeStale_())}))}function X0(t,e){if(console.log("[mobx.trace] '"+t.name_+"' is invalidated due to a change in: '"+e.name_+"'"),t.isTracing_===Ln.BREAK){var n=[];Q0(ib(t),n,1),new Function(`debugger;
|
|
180
98
|
/*
|
|
181
99
|
Tracing '`+t.name_+`'
|
|
182
100
|
|
|
@@ -184,19 +102,19 @@ You are entering this break point because derivation '`+t.name_+"' is being trac
|
|
|
184
102
|
Just follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update
|
|
185
103
|
The stackframe you are looking for is at least ~6-8 stack-frames up.
|
|
186
104
|
|
|
187
|
-
`+(t instanceof
|
|
105
|
+
`+(t instanceof $n?t.derivation.toString().replace(/[*]\//g,"/"):"")+`
|
|
188
106
|
|
|
189
107
|
The dependencies for this derivation are:
|
|
190
108
|
|
|
191
109
|
`+n.join(`
|
|
192
110
|
`)+`
|
|
193
111
|
*/
|
|
194
|
-
`)()}}function dm(t,e,n){if(e.length>=1e3){e.push("(and many more)");return}e.push(""+" ".repeat(n-1)+t.name),t.dependencies&&t.dependencies.forEach(function(r){return dm(r,e,n+1)})}var Un=function(){function t(n,r,i,o){n===void 0&&(n=M.NODE_ENV!=="production"?"Reaction@"+sn():"Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=we.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=Bt.NONE,this.name_=n,this.onInvalidate_=r,this.errorHandler_=i,this.requiresObservable_=o}var e=t.prototype;return e.onBecomeStale_=function(){this.schedule_()},e.schedule_=function(){this.isScheduled||(this.isScheduled=!0,L.pendingReactions.push(this),pm())},e.runReaction_=function(){if(!this.isDisposed){Lt(),this.isScheduled=!1;var r=L.trackingContext;if(L.trackingContext=this,eu(this)){this.isTrackPending=!0;try{this.onInvalidate_(),M.NODE_ENV!=="production"&&this.isTrackPending&&Je()&&ti({name:this.name_,type:"scheduled-reaction"})}catch(i){this.reportExceptionInDerivation_(i)}}L.trackingContext=r,jt()}},e.track=function(r){if(!this.isDisposed){Lt();var i=Je(),o;M.NODE_ENV!=="production"&&i&&(o=Date.now(),Ct({name:this.name_,type:"reaction"})),this.isRunning=!0;var s=L.trackingContext;L.trackingContext=this;var a=rm(this,r,void 0);L.trackingContext=s,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&tu(this),la(a)&&this.reportExceptionInDerivation_(a.cause),M.NODE_ENV!=="production"&&i&&Ot({time:Date.now()-o}),jt()}},e.reportExceptionInDerivation_=function(r){var i=this;if(this.errorHandler_){this.errorHandler_(r,this);return}if(L.disableErrorBoundaries)throw r;var o=M.NODE_ENV!=="production"?"[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'":"[mobx] uncaught error in '"+this+"'";L.suppressReactionErrors?M.NODE_ENV!=="production"&&console.warn("[mobx] (error in reaction '"+this.name_+"' suppressed, fix error of causing action below)"):console.error(o,r),M.NODE_ENV!=="production"&&Je()&&ti({type:"error",name:this.name_,message:o,error:""+r}),L.globalReactionErrorHandlers.forEach(function(s){return s(r,i)})},e.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(Lt(),tu(this),jt()))},e.getDisposer_=function(r){var i=this,o=function s(){i.dispose(),r==null||r.removeEventListener==null||r.removeEventListener("abort",s)};return r==null||r.addEventListener==null||r.addEventListener("abort",o),o[fe]=this,o},e.toString=function(){return"Reaction["+this.name_+"]"},e.trace=function(r){r===void 0&&(r=!1),tx(this,r)},ao(t,[{key:"isDisposed",get:function(){return vt(this.flags_,t.isDisposedMask_)},set:function(r){this.flags_=yt(this.flags_,t.isDisposedMask_,r)}},{key:"isScheduled",get:function(){return vt(this.flags_,t.isScheduledMask_)},set:function(r){this.flags_=yt(this.flags_,t.isScheduledMask_,r)}},{key:"isTrackPending",get:function(){return vt(this.flags_,t.isTrackPendingMask_)},set:function(r){this.flags_=yt(this.flags_,t.isTrackPendingMask_,r)}},{key:"isRunning",get:function(){return vt(this.flags_,t.isRunningMask_)},set:function(r){this.flags_=yt(this.flags_,t.isRunningMask_,r)}},{key:"diffValue",get:function(){return vt(this.flags_,t.diffValueMask_)?1:0},set:function(r){this.flags_=yt(this.flags_,t.diffValueMask_,r===1)}}])}();Un.isDisposedMask_=1;Un.isScheduledMask_=2;Un.isTrackPendingMask_=4;Un.isRunningMask_=8;Un.diffValueMask_=16;var Ed=100,nu=function(e){return e()};function pm(){L.inBatch>0||L.isRunningReactions||nu(Rw)}function Rw(){L.isRunningReactions=!0;for(var t=L.pendingReactions,e=0;t.length>0;){++e===Ed&&(console.error(M.NODE_ENV!=="production"?"Reaction doesn't converge to a stable state after "+Ed+" iterations."+(" Probably there is a cycle in the reactive function: "+t[0]):"[mobx] cycle in reaction: "+t[0]),t.splice(0));for(var n=t.splice(0),r=0,i=n.length;r<i;r++)n[r].runReaction_()}L.isRunningReactions=!1}var Ta=li("Reaction",Un);function Pw(t){var e=nu;nu=function(r){return t(function(){return e(r)})}}function Je(){return M.NODE_ENV!=="production"&&!!L.spyListeners.length}function ti(t){if(M.NODE_ENV!=="production"&&L.spyListeners.length)for(var e=L.spyListeners,n=0,r=e.length;n<r;n++)e[n](t)}function Ct(t){if(M.NODE_ENV!=="production"){var e=Wn({},t,{spyReportStart:!0});ti(e)}}var Vw={type:"report-end",spyReportEnd:!0};function Ot(t){M.NODE_ENV!=="production"&&ti(t?Wn({},t,{type:"report-end",spyReportEnd:!0}):Vw)}function Dw(t){return M.NODE_ENV==="production"?(console.warn("[mobx.spy] Is a no-op in production builds"),function(){}):(L.spyListeners.push(t),Zu(function(){L.spyListeners=L.spyListeners.filter(function(e){return e!==t})}))}var tf="action",Lw="action.bound",hm="autoAction",jw="autoAction.bound",Hw="<unnamed action>",ru=as(tf),Iw=as(Lw,{bound:!0}),iu=as(hm,{autoAction:!0}),Bw=as(jw,{autoAction:!0,bound:!0});function mm(t){var e=function(r,i){if(Be(r))return ei(r.name||Hw,r,t);if(Be(i))return ei(r,i,t);if(ss(i))return(t?iu:ru).decorate_20223_(r,i);if(Xr(i))return is(r,i,t?iu:ru);if(Xr(r))return wn(as(t?hm:tf,{name:r,autoAction:t}));M.NODE_ENV!=="production"&&J("Invalid arguments for `action`")};return e}var Ti=mm(!1);Object.assign(Ti,ru);var Fo=mm(!0);Object.assign(Fo,iu);Ti.bound=wn(Iw);Fo.bound=wn(Bw);function Wi(t){return Be(t)&&t.isMobxAction===!0}function $w(t,e){var n,r,i,o;e===void 0&&(e=$1),M.NODE_ENV!=="production"&&(Be(t)||J("Autorun expects a function as first argument"),Wi(t)&&J("Autorun does not accept actions since actions are untrackable"));var s=(n=(r=e)==null?void 0:r.name)!=null?n:M.NODE_ENV!=="production"?t.name||"Autorun@"+sn():"Autorun",a=!e.scheduler&&!e.delay,l;if(a)l=new Un(s,function(){this.track(f)},e.onError,e.requiresObservable);else{var c=Fw(e),u=!1;l=new Un(s,function(){u||(u=!0,c(function(){u=!1,l.isDisposed||l.track(f)}))},e.onError,e.requiresObservable)}function f(){t(l)}return(i=e)!=null&&(i=i.signal)!=null&&i.aborted||l.schedule_(),l.getDisposer_((o=e)==null?void 0:o.signal)}var zw=function(e){return e()};function Fw(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:zw}var Ww="onBO",Uw="onBUO";function qw(t,e,n){return bm(Ww,t,e,n)}function gm(t,e,n){return bm(Uw,t,e,n)}function bm(t,e,n,r){var i=qi(e),o=Be(r)?r:n,s=t+"L";return i[s]?i[s].add(o):i[s]=new Set([o]),function(){var a=i[s];a&&(a.delete(o),a.size===0&&delete i[s])}}var Gw="never",$s="always",Kw="observed";function Zw(t){t.isolateGlobalState===!0&&Aw();var e=t.useProxies,n=t.enforceActions;if(e!==void 0&&(L.useProxies=e===$s?!0:e===Gw?!1:typeof Proxy<"u"),e==="ifavailable"&&(L.verifyProxies=!0),n!==void 0){var r=n===$s?$s:n===Kw;L.enforceActions=r,L.allowStateChanges=!(r===!0||r===$s)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in t&&(L[i]=!!t[i])}),L.allowStateReads=!L.observableRequiresReaction,M.NODE_ENV!=="production"&&L.disableErrorBoundaries===!0&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),t.reactionScheduler&&Pw(t.reactionScheduler)}function Jw(t,e,n,r){M.NODE_ENV!=="production"&&(arguments.length>4&&J("'extendObservable' expected 2-4 arguments"),typeof t!="object"&&J("'extendObservable' expects an object as first argument"),Sr(t)&&J("'extendObservable' should not be used on maps, use map.merge instead"),Sn(e)||J("'extendObservable' only accepts plain objects as second argument"),(Uo(e)||Uo(n))&&J("Extending an object with another observable (object) is not supported"));var i=_2(e);return ui(function(){var o=lo(t,r)[fe];ll(i).forEach(function(s){o.extend_(s,i[s],n&&s in n?n[s]:!0)})}),t}function vm(t,e){return ym(qi(t,e))}function ym(t){var e={name:t.name_};return t.observing_&&t.observing_.length>0&&(e.dependencies=Yw(t.observing_).map(ym)),e}function Yw(t){return Array.from(new Set(t))}var Xw=0;function wm(){this.message="FLOW_CANCELLED"}wm.prototype=Object.create(Error.prototype);var Jl=J1("flow"),Qw=J1("flow.bound",{bound:!0}),Ui=Object.assign(function(e,n){if(ss(n))return Jl.decorate_20223_(e,n);if(Xr(n))return is(e,n,Jl);M.NODE_ENV!=="production"&&arguments.length!==1&&J("Flow expects single argument with generator function");var r=e,i=r.name||"<unnamed flow>",o=function(){var a=this,l=arguments,c=++Xw,u=Ti(i+" - runid: "+c+" - init",r).apply(a,l),f,d=void 0,p=new Promise(function(h,m){var g=0;f=m;function y(C){d=void 0;var v;try{v=Ti(i+" - runid: "+c+" - yield "+g++,u.next).call(u,C)}catch(E){return m(E)}x(v)}function w(C){d=void 0;var v;try{v=Ti(i+" - runid: "+c+" - yield "+g++,u.throw).call(u,C)}catch(E){return m(E)}x(v)}function x(C){if(Be(C==null?void 0:C.then)){C.then(x,m);return}return C.done?h(C.value):(d=Promise.resolve(C.value),d.then(y,w))}y(void 0)});return p.cancel=Ti(i+" - runid: "+c+" - cancel",function(){try{d&&_d(d);var h=u.return(void 0),m=Promise.resolve(h.value);m.then(ki,ki),_d(m),f(new wm)}catch(g){f(g)}}),p};return o.isMobXFlow=!0,o},Jl);Ui.bound=wn(Qw);function _d(t){Be(t.cancel)&&t.cancel()}function Wo(t){return(t==null?void 0:t.isMobXFlow)===!0}function ex(t,e){return t?us(t)||!!t[fe]||Ju(t)||Ta(t)||pl(t):!1}function Uo(t){return M.NODE_ENV!=="production"&&arguments.length!==1&&J("isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property"),ex(t)}function tx(){if(M.NODE_ENV!=="production"){for(var t=!1,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];typeof n[n.length-1]=="boolean"&&(t=n.pop());var i=nx(n);if(!i)return J("'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly");i.isTracing_===Bt.NONE&&console.log("[mobx.trace] '"+i.name_+"' tracing enabled"),i.isTracing_=t?Bt.BREAK:Bt.LOG}}function nx(t){switch(t.length){case 0:return L.trackingDerivation;case 1:return qi(t[0]);case 2:return qi(t[0],t[1])}}function In(t,e){e===void 0&&(e=void 0),Lt();try{return t.apply(e)}finally{jt()}}function Rr(t){return t[fe]}var rx={has:function(e,n){return M.NODE_ENV!=="production"&&L.trackingDerivation&&vo("detect new properties using the 'in' operator. Use 'has' from 'mobx' instead."),Rr(e).has_(n)},get:function(e,n){return Rr(e).get_(n)},set:function(e,n,r){var i;return Xr(n)?(M.NODE_ENV!=="production"&&!Rr(e).values_.has(n)&&vo("add a new observable property through direct assignment. Use 'set' from 'mobx' instead."),(i=Rr(e).set_(n,r,!0))!=null?i:!0):!1},deleteProperty:function(e,n){var r;return M.NODE_ENV!=="production"&&vo("delete properties from an observable object. Use 'remove' from 'mobx' instead."),Xr(n)?(r=Rr(e).delete_(n,!0))!=null?r:!0:!1},defineProperty:function(e,n,r){var i;return M.NODE_ENV!=="production"&&vo("define property on an observable object. Use 'defineProperty' from 'mobx' instead."),(i=Rr(e).defineProperty_(n,r))!=null?i:!0},ownKeys:function(e){return M.NODE_ENV!=="production"&&L.trackingDerivation&&vo("iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead."),Rr(e).ownKeys_()},preventExtensions:function(e){J(13)}};function ix(t,e){var n,r;return z1(),t=lo(t,e),(r=(n=t[fe]).proxy_)!=null?r:n.proxy_=new Proxy(t,rx)}function Pt(t){return t.interceptors_!==void 0&&t.interceptors_.length>0}function ls(t,e){var n=t.interceptors_||(t.interceptors_=[]);return n.push(e),Zu(function(){var r=n.indexOf(e);r!==-1&&n.splice(r,1)})}function Vt(t,e){var n=ci();try{for(var r=[].concat(t.interceptors_||[]),i=0,o=r.length;i<o&&(e=r[i](e),e&&!e.type&&J(14),!!e);i++);return e}finally{zn(n)}}function en(t){return t.changeListeners_!==void 0&&t.changeListeners_.length>0}function cs(t,e){var n=t.changeListeners_||(t.changeListeners_=[]);return n.push(e),Zu(function(){var r=n.indexOf(e);r!==-1&&n.splice(r,1)})}function tn(t,e){var n=ci(),r=t.changeListeners_;if(r){r=r.slice();for(var i=0,o=r.length;i<o;i++)r[i](e);zn(n)}}function ox(t,e,n){return ui(function(){var r,i=lo(t,n)[fe];M.NODE_ENV!=="production"&&e&&t[ft]&&J("makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported."),(r=e)!=null||(e=R2(t)),ll(e).forEach(function(o){return i.make_(o,e[o])})}),t}var kd="splice",Qt="update",sx=1e4,ax={get:function(e,n){var r=e[fe];return n===fe?r:n==="length"?r.getArrayLength_():typeof n=="string"&&!isNaN(n)?r.get_(parseInt(n)):It(Ma,n)?Ma[n]:e[n]},set:function(e,n,r){var i=e[fe];return n==="length"&&i.setArrayLength_(r),typeof n=="symbol"||isNaN(n)?e[n]=r:i.set_(parseInt(n),r),!0},preventExtensions:function(){J(15)}},nf=function(){function t(n,r,i,o){n===void 0&&(n=M.NODE_ENV!=="production"?"ObservableArray@"+sn():"ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=i,this.legacyMode_=o,this.atom_=new xr(n),this.enhancer_=function(s,a){return r(s,a,M.NODE_ENV!=="production"?n+"[..]":"ObservableArray[..]")}}var e=t.prototype;return e.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},e.dehanceValues_=function(r){return this.dehancer!==void 0&&r.length>0?r.map(this.dehancer):r},e.intercept_=function(r){return ls(this,r)},e.observe_=function(r,i){return i===void 0&&(i=!1),i&&r({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),cs(this,r)},e.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},e.setArrayLength_=function(r){(typeof r!="number"||isNaN(r)||r<0)&&J("Out of range: "+r);var i=this.values_.length;if(r!==i)if(r>i){for(var o=new Array(r-i),s=0;s<r-i;s++)o[s]=void 0;this.spliceWithArray_(i,0,o)}else this.spliceWithArray_(r,i-r)},e.updateArrayLength_=function(r,i){r!==this.lastKnownLength_&&J(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&_m(r+i+1)},e.spliceWithArray_=function(r,i,o){var s=this;mn(this.atom_);var a=this.values_.length;if(r===void 0?r=0:r>a?r=a:r<0&&(r=Math.max(0,a+r)),arguments.length===1?i=a-r:i==null?i=0:i=Math.max(0,Math.min(i,a-r)),o===void 0&&(o=Oa),Pt(this)){var l=Vt(this,{object:this.proxy_,type:kd,index:r,removedCount:i,added:o});if(!l)return Oa;i=l.removedCount,o=l.added}if(o=o.length===0?o:o.map(function(f){return s.enhancer_(f,void 0)}),this.legacyMode_||M.NODE_ENV!=="production"){var c=o.length-i;this.updateArrayLength_(a,c)}var u=this.spliceItemsIntoValues_(r,i,o);return(i!==0||o.length!==0)&&this.notifyArraySplice_(r,o,u),this.dehanceValues_(u)},e.spliceItemsIntoValues_=function(r,i,o){if(o.length<sx){var s;return(s=this.values_).splice.apply(s,[r,i].concat(o))}else{var a=this.values_.slice(r,r+i),l=this.values_.slice(r+i);this.values_.length+=o.length-i;for(var c=0;c<o.length;c++)this.values_[r+c]=o[c];for(var u=0;u<l.length;u++)this.values_[r+o.length+u]=l[u];return a}},e.notifyArrayChildUpdate_=function(r,i,o){var s=!this.owned_&&Je(),a=en(this),l=a||s?{observableKind:"array",object:this.proxy_,type:Qt,debugObjectName:this.atom_.name_,index:r,newValue:i,oldValue:o}:null;M.NODE_ENV!=="production"&&s&&Ct(l),this.atom_.reportChanged(),a&&tn(this,l),M.NODE_ENV!=="production"&&s&&Ot()},e.notifyArraySplice_=function(r,i,o){var s=!this.owned_&&Je(),a=en(this),l=a||s?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:kd,index:r,removed:o,added:i,removedCount:o.length,addedCount:i.length}:null;M.NODE_ENV!=="production"&&s&&Ct(l),this.atom_.reportChanged(),a&&tn(this,l),M.NODE_ENV!=="production"&&s&&Ot()},e.get_=function(r){if(this.legacyMode_&&r>=this.values_.length){console.warn(M.NODE_ENV!=="production"?"[mobx.array] Attempt to read an array index ("+r+") that is out of bounds ("+this.values_.length+"). Please check length first. Out of bound indices will not be tracked by MobX":"[mobx] Out of bounds read: "+r);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[r])},e.set_=function(r,i){var o=this.values_;if(this.legacyMode_&&r>o.length&&J(17,r,o.length),r<o.length){mn(this.atom_);var s=o[r];if(Pt(this)){var a=Vt(this,{type:Qt,object:this.proxy_,index:r,newValue:i});if(!a)return;i=a.newValue}i=this.enhancer_(i,s);var l=i!==s;l&&(o[r]=i,this.notifyArrayChildUpdate_(r,i,s))}else{for(var c=new Array(r+1-o.length),u=0;u<c.length-1;u++)c[u]=void 0;c[c.length-1]=i,this.spliceWithArray_(o.length,0,c)}},t}();function lx(t,e,n,r){return n===void 0&&(n=M.NODE_ENV!=="production"?"ObservableArray@"+sn():"ObservableArray"),r===void 0&&(r=!1),z1(),ui(function(){var i=new nf(n,e,r,!1);W1(i.values_,fe,i);var o=new Proxy(i.values_,ax);return i.proxy_=o,t&&t.length&&i.spliceWithArray_(0,0,t),o})}var Ma={clear:function(){return this.splice(0)},replace:function(e){var n=this[fe];return n.spliceWithArray_(0,n.values_.length,e)},toJSON:function(){return this.slice()},splice:function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];var s=this[fe];switch(arguments.length){case 0:return[];case 1:return s.spliceWithArray_(e);case 2:return s.spliceWithArray_(e,n)}return s.spliceWithArray_(e,n,i)},spliceWithArray:function(e,n,r){return this[fe].spliceWithArray_(e,n,r)},push:function(){for(var e=this[fe],n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.spliceWithArray_(e.values_.length,0,r),e.values_.length},pop:function(){return this.splice(Math.max(this[fe].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var e=this[fe],n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.spliceWithArray_(0,0,r),e.values_.length},reverse:function(){return L.trackingDerivation&&J(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){L.trackingDerivation&&J(37,"sort");var e=this.slice();return e.sort.apply(e,arguments),this.replace(e),this},remove:function(e){var n=this[fe],r=n.dehanceValues_(n.values_).indexOf(e);return r>-1?(this.splice(r,1),!0):!1}};Ne("at",At);Ne("concat",At);Ne("flat",At);Ne("includes",At);Ne("indexOf",At);Ne("join",At);Ne("lastIndexOf",At);Ne("slice",At);Ne("toString",At);Ne("toLocaleString",At);Ne("toSorted",At);Ne("toSpliced",At);Ne("with",At);Ne("every",an);Ne("filter",an);Ne("find",an);Ne("findIndex",an);Ne("findLast",an);Ne("findLastIndex",an);Ne("flatMap",an);Ne("forEach",an);Ne("map",an);Ne("some",an);Ne("toReversed",an);Ne("reduce",xm);Ne("reduceRight",xm);function Ne(t,e){typeof Array.prototype[t]=="function"&&(Ma[t]=e(t))}function At(t){return function(){var e=this[fe];e.atom_.reportObserved();var n=e.dehanceValues_(e.values_);return n[t].apply(n,arguments)}}function an(t){return function(e,n){var r=this,i=this[fe];i.atom_.reportObserved();var o=i.dehanceValues_(i.values_);return o[t](function(s,a){return e.call(n,s,a,r)})}}function xm(t){return function(){var e=this,n=this[fe];n.atom_.reportObserved();var r=n.dehanceValues_(n.values_),i=arguments[0];return arguments[0]=function(o,s,a){return i(o,s,a,e)},r[t].apply(r,arguments)}}var cx=li("ObservableArrayAdministration",nf);function hl(t){return sl(t)&&cx(t[fe])}var ux={},sr="add",Na="delete",Sm=function(){function t(n,r,i){var o=this;r===void 0&&(r=Qr),i===void 0&&(i=M.NODE_ENV!=="production"?"ObservableMap@"+sn():"ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[fe]=ux,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=r,this.name_=i,Be(Map)||J(18),ui(function(){o.keysAtom_=K1(M.NODE_ENV!=="production"?o.name_+".keys()":"ObservableMap.keys()"),o.data_=new Map,o.hasMap_=new Map,n&&o.merge(n)})}var e=t.prototype;return e.has_=function(r){return this.data_.has(r)},e.has=function(r){var i=this;if(!L.trackingDerivation)return this.has_(r);var o=this.hasMap_.get(r);if(!o){var s=o=new Fr(this.has_(r),ul,M.NODE_ENV!=="production"?this.name_+"."+Jc(r)+"?":"ObservableMap.key?",!1);this.hasMap_.set(r,s),gm(s,function(){return i.hasMap_.delete(r)})}return o.get()},e.set=function(r,i){var o=this.has_(r);if(Pt(this)){var s=Vt(this,{type:o?Qt:sr,object:this,newValue:i,name:r});if(!s)return this;i=s.newValue}return o?this.updateValue_(r,i):this.addValue_(r,i),this},e.delete=function(r){var i=this;if(mn(this.keysAtom_),Pt(this)){var o=Vt(this,{type:Na,object:this,name:r});if(!o)return!1}if(this.has_(r)){var s=Je(),a=en(this),l=a||s?{observableKind:"map",debugObjectName:this.name_,type:Na,object:this,oldValue:this.data_.get(r).value_,name:r}:null;return M.NODE_ENV!=="production"&&s&&Ct(l),In(function(){var c;i.keysAtom_.reportChanged(),(c=i.hasMap_.get(r))==null||c.setNewValue_(!1);var u=i.data_.get(r);u.setNewValue_(void 0),i.data_.delete(r)}),a&&tn(this,l),M.NODE_ENV!=="production"&&s&&Ot(),!0}return!1},e.updateValue_=function(r,i){var o=this.data_.get(r);if(i=o.prepareNewValue_(i),i!==L.UNCHANGED){var s=Je(),a=en(this),l=a||s?{observableKind:"map",debugObjectName:this.name_,type:Qt,object:this,oldValue:o.value_,name:r,newValue:i}:null;M.NODE_ENV!=="production"&&s&&Ct(l),o.setNewValue_(i),a&&tn(this,l),M.NODE_ENV!=="production"&&s&&Ot()}},e.addValue_=function(r,i){var o=this;mn(this.keysAtom_),In(function(){var c,u=new Fr(i,o.enhancer_,M.NODE_ENV!=="production"?o.name_+"."+Jc(r):"ObservableMap.key",!1);o.data_.set(r,u),i=u.value_,(c=o.hasMap_.get(r))==null||c.setNewValue_(!0),o.keysAtom_.reportChanged()});var s=Je(),a=en(this),l=a||s?{observableKind:"map",debugObjectName:this.name_,type:sr,object:this,name:r,newValue:i}:null;M.NODE_ENV!=="production"&&s&&Ct(l),a&&tn(this,l),M.NODE_ENV!=="production"&&s&&Ot()},e.get=function(r){return this.has(r)?this.dehanceValue_(this.data_.get(r).get()):this.dehanceValue_(void 0)},e.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},e.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},e.values=function(){var r=this,i=this.keys();return Ad({next:function(){var s=i.next(),a=s.done,l=s.value;return{done:a,value:a?void 0:r.get(l)}}})},e.entries=function(){var r=this,i=this.keys();return Ad({next:function(){var s=i.next(),a=s.done,l=s.value;return{done:a,value:a?void 0:[l,r.get(l)]}}})},e[Symbol.iterator]=function(){return this.entries()},e.forEach=function(r,i){for(var o=Ai(this),s;!(s=o()).done;){var a=s.value,l=a[0],c=a[1];r.call(i,c,l,this)}},e.merge=function(r){var i=this;return Sr(r)&&(r=new Map(r)),In(function(){Sn(r)?E2(r).forEach(function(o){return i.set(o,r[o])}):Array.isArray(r)?r.forEach(function(o){var s=o[0],a=o[1];return i.set(s,a)}):so(r)?(O2(r)||J(19,r),r.forEach(function(o,s){return i.set(s,o)})):r!=null&&J(20,r)}),this},e.clear=function(){var r=this;In(function(){im(function(){for(var i=Ai(r.keys()),o;!(o=i()).done;){var s=o.value;r.delete(s)}})})},e.replace=function(r){var i=this;return In(function(){for(var o=fx(r),s=new Map,a=!1,l=Ai(i.data_.keys()),c;!(c=l()).done;){var u=c.value;if(!o.has(u)){var f=i.delete(u);if(f)a=!0;else{var d=i.data_.get(u);s.set(u,d)}}}for(var p=Ai(o.entries()),h;!(h=p()).done;){var m=h.value,g=m[0],y=m[1],w=i.data_.has(g);if(i.set(g,y),i.data_.has(g)){var x=i.data_.get(g);s.set(g,x),w||(a=!0)}}if(!a)if(i.data_.size!==s.size)i.keysAtom_.reportChanged();else for(var C=i.data_.keys(),v=s.keys(),E=C.next(),A=v.next();!E.done;){if(E.value!==A.value){i.keysAtom_.reportChanged();break}E=C.next(),A=v.next()}i.data_=s}),this},e.toString=function(){return"[object ObservableMap]"},e.toJSON=function(){return Array.from(this)},e.observe_=function(r,i){return M.NODE_ENV!=="production"&&i===!0&&J("`observe` doesn't support fireImmediately=true in combination with maps."),cs(this,r)},e.intercept_=function(r){return ls(this,r)},ao(t,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),Sr=li("ObservableMap",Sm);function Ad(t){return t[Symbol.toStringTag]="MapIterator",sf(t)}function fx(t){if(so(t)||Sr(t))return t;if(Array.isArray(t))return new Map(t);if(Sn(t)){var e=new Map;for(var n in t)e.set(n,t[n]);return e}else return J(21,t)}var dx={},Cm=function(){function t(n,r,i){var o=this;r===void 0&&(r=Qr),i===void 0&&(i=M.NODE_ENV!=="production"?"ObservableSet@"+sn():"ObservableSet"),this.name_=void 0,this[fe]=dx,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=i,Be(Set)||J(22),this.enhancer_=function(s,a){return r(s,a,i)},ui(function(){o.atom_=K1(o.name_),n&&o.replace(n)})}var e=t.prototype;return e.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},e.clear=function(){var r=this;In(function(){im(function(){for(var i=Ai(r.data_.values()),o;!(o=i()).done;){var s=o.value;r.delete(s)}})})},e.forEach=function(r,i){for(var o=Ai(this),s;!(s=o()).done;){var a=s.value;r.call(i,a,a,this)}},e.add=function(r){var i=this;if(mn(this.atom_),Pt(this)){var o=Vt(this,{type:sr,object:this,newValue:r});if(!o)return this}if(!this.has(r)){In(function(){i.data_.add(i.enhancer_(r,void 0)),i.atom_.reportChanged()});var s=M.NODE_ENV!=="production"&&Je(),a=en(this),l=a||s?{observableKind:"set",debugObjectName:this.name_,type:sr,object:this,newValue:r}:null;s&&M.NODE_ENV!=="production"&&Ct(l),a&&tn(this,l),s&&M.NODE_ENV!=="production"&&Ot()}return this},e.delete=function(r){var i=this;if(Pt(this)){var o=Vt(this,{type:Na,object:this,oldValue:r});if(!o)return!1}if(this.has(r)){var s=M.NODE_ENV!=="production"&&Je(),a=en(this),l=a||s?{observableKind:"set",debugObjectName:this.name_,type:Na,object:this,oldValue:r}:null;return s&&M.NODE_ENV!=="production"&&Ct(l),In(function(){i.atom_.reportChanged(),i.data_.delete(r)}),a&&tn(this,l),s&&M.NODE_ENV!=="production"&&Ot(),!0}return!1},e.has=function(r){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(r))},e.entries=function(){var r=0,i=Array.from(this.keys()),o=Array.from(this.values());return Td({next:function(){var a=r;return r+=1,a<o.length?{value:[i[a],o[a]],done:!1}:{value:void 0,done:!0}}})},e.keys=function(){return this.values()},e.values=function(){this.atom_.reportObserved();var r=this,i=0,o=Array.from(this.data_.values());return Td({next:function(){return i<o.length?{value:r.dehanceValue_(o[i++]),done:!1}:{value:void 0,done:!0}}})},e.intersection=function(r){if(Hn(r)&&!hn(r))return r.intersection(this);var i=new Set(this);return i.intersection(r)},e.union=function(r){if(Hn(r)&&!hn(r))return r.union(this);var i=new Set(this);return i.union(r)},e.difference=function(r){return new Set(this).difference(r)},e.symmetricDifference=function(r){if(Hn(r)&&!hn(r))return r.symmetricDifference(this);var i=new Set(this);return i.symmetricDifference(r)},e.isSubsetOf=function(r){return new Set(this).isSubsetOf(r)},e.isSupersetOf=function(r){return new Set(this).isSupersetOf(r)},e.isDisjointFrom=function(r){if(Hn(r)&&!hn(r))return r.isDisjointFrom(this);var i=new Set(this);return i.isDisjointFrom(r)},e.replace=function(r){var i=this;return hn(r)&&(r=new Set(r)),In(function(){Array.isArray(r)?(i.clear(),r.forEach(function(o){return i.add(o)})):Hn(r)?(i.clear(),r.forEach(function(o){return i.add(o)})):r!=null&&J("Cannot initialize set from "+r)}),this},e.observe_=function(r,i){return M.NODE_ENV!=="production"&&i===!0&&J("`observe` doesn't support fireImmediately=true in combination with sets."),cs(this,r)},e.intercept_=function(r){return ls(this,r)},e.toJSON=function(){return Array.from(this)},e.toString=function(){return"[object ObservableSet]"},e[Symbol.iterator]=function(){return this.values()},ao(t,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),hn=li("ObservableSet",Cm);function Td(t){return t[Symbol.toStringTag]="SetIterator",sf(t)}var Md=Object.create(null),Nd="remove",ou=function(){function t(n,r,i,o){r===void 0&&(r=new Map),o===void 0&&(o=rw),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=n,this.values_=r,this.name_=i,this.defaultAnnotation_=o,this.keysAtom_=new xr(M.NODE_ENV!=="production"?this.name_+".keys":"ObservableObject.keys"),this.isPlainObject_=Sn(this.target_),M.NODE_ENV!=="production"&&!Am(this.defaultAnnotation_)&&J("defaultAnnotation must be valid annotation"),M.NODE_ENV!=="production"&&(this.appliedAnnotations_={})}var e=t.prototype;return e.getObservablePropValue_=function(r){return this.values_.get(r).get()},e.setObservablePropValue_=function(r,i){var o=this.values_.get(r);if(o instanceof Wt)return o.set(i),!0;if(Pt(this)){var s=Vt(this,{type:Qt,object:this.proxy_||this.target_,name:r,newValue:i});if(!s)return null;i=s.newValue}if(i=o.prepareNewValue_(i),i!==L.UNCHANGED){var a=en(this),l=M.NODE_ENV!=="production"&&Je(),c=a||l?{type:Qt,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:o.value_,name:r,newValue:i}:null;M.NODE_ENV!=="production"&&l&&Ct(c),o.setNewValue_(i),a&&tn(this,c),M.NODE_ENV!=="production"&&l&&Ot()}return!0},e.get_=function(r){return L.trackingDerivation&&!It(this.target_,r)&&this.has_(r),this.target_[r]},e.set_=function(r,i,o){return o===void 0&&(o=!1),It(this.target_,r)?this.values_.has(r)?this.setObservablePropValue_(r,i):o?Reflect.set(this.target_,r,i):(this.target_[r]=i,!0):this.extend_(r,{value:i,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,o)},e.has_=function(r){if(!L.trackingDerivation)return r in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(r);return i||(i=new Fr(r in this.target_,ul,M.NODE_ENV!=="production"?this.name_+"."+Jc(r)+"?":"ObservableObject.key?",!1),this.pendingKeys_.set(r,i)),i.get()},e.make_=function(r,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(Vd(this,i,r),!(r in this.target_)){var o;if((o=this.target_[ft])!=null&&o[r])return;J(1,i.annotationType_,this.name_+"."+r.toString())}for(var s=this.target_;s&&s!==ol;){var a=Ca(s,r);if(a){var l=i.make_(this,r,a,s);if(l===0)return;if(l===1)break}s=Object.getPrototypeOf(s)}Pd(this,i,r)}},e.extend_=function(r,i,o,s){if(s===void 0&&(s=!1),o===!0&&(o=this.defaultAnnotation_),o===!1)return this.defineProperty_(r,i,s);Vd(this,o,r);var a=o.extend_(this,r,i,s);return a&&Pd(this,o,r),a},e.defineProperty_=function(r,i,o){o===void 0&&(o=!1),mn(this.keysAtom_);try{Lt();var s=this.delete_(r);if(!s)return s;if(Pt(this)){var a=Vt(this,{object:this.proxy_||this.target_,name:r,type:sr,newValue:i.value});if(!a)return null;var l=a.newValue;i.value!==l&&(i=Wn({},i,{value:l}))}if(o){if(!Reflect.defineProperty(this.target_,r,i))return!1}else yn(this.target_,r,i);this.notifyPropertyAddition_(r,i.value)}finally{jt()}return!0},e.defineObservableProperty_=function(r,i,o,s){s===void 0&&(s=!1),mn(this.keysAtom_);try{Lt();var a=this.delete_(r);if(!a)return a;if(Pt(this)){var l=Vt(this,{object:this.proxy_||this.target_,name:r,type:sr,newValue:i});if(!l)return null;i=l.newValue}var c=Rd(r),u={configurable:L.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:c.get,set:c.set};if(s){if(!Reflect.defineProperty(this.target_,r,u))return!1}else yn(this.target_,r,u);var f=new Fr(i,o,M.NODE_ENV!=="production"?this.name_+"."+r.toString():"ObservableObject.key",!1);this.values_.set(r,f),this.notifyPropertyAddition_(r,f.value_)}finally{jt()}return!0},e.defineComputedProperty_=function(r,i,o){o===void 0&&(o=!1),mn(this.keysAtom_);try{Lt();var s=this.delete_(r);if(!s)return s;if(Pt(this)){var a=Vt(this,{object:this.proxy_||this.target_,name:r,type:sr,newValue:void 0});if(!a)return null}i.name||(i.name=M.NODE_ENV!=="production"?this.name_+"."+r.toString():"ObservableObject.key"),i.context=this.proxy_||this.target_;var l=Rd(r),c={configurable:L.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:l.get,set:l.set};if(o){if(!Reflect.defineProperty(this.target_,r,c))return!1}else yn(this.target_,r,c);this.values_.set(r,new Wt(i)),this.notifyPropertyAddition_(r,void 0)}finally{jt()}return!0},e.delete_=function(r,i){if(i===void 0&&(i=!1),mn(this.keysAtom_),!It(this.target_,r))return!0;if(Pt(this)){var o=Vt(this,{object:this.proxy_||this.target_,name:r,type:Nd});if(!o)return null}try{var s;Lt();var a=en(this),l=M.NODE_ENV!=="production"&&Je(),c=this.values_.get(r),u=void 0;if(!c&&(a||l)){var f;u=(f=Ca(this.target_,r))==null?void 0:f.value}if(i){if(!Reflect.deleteProperty(this.target_,r))return!1}else delete this.target_[r];if(M.NODE_ENV!=="production"&&delete this.appliedAnnotations_[r],c&&(this.values_.delete(r),c instanceof Fr&&(u=c.value_),um(c)),this.keysAtom_.reportChanged(),(s=this.pendingKeys_)==null||(s=s.get(r))==null||s.set(r in this.target_),a||l){var d={type:Nd,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:u,name:r};M.NODE_ENV!=="production"&&l&&Ct(d),a&&tn(this,d),M.NODE_ENV!=="production"&&l&&Ot()}}finally{jt()}return!0},e.observe_=function(r,i){return M.NODE_ENV!=="production"&&i===!0&&J("`observe` doesn't support the fire immediately property for observable objects."),cs(this,r)},e.intercept_=function(r){return ls(this,r)},e.notifyPropertyAddition_=function(r,i){var o,s=en(this),a=M.NODE_ENV!=="production"&&Je();if(s||a){var l=s||a?{type:sr,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:r,newValue:i}:null;M.NODE_ENV!=="production"&&a&&Ct(l),s&&tn(this,l),M.NODE_ENV!=="production"&&a&&Ot()}(o=this.pendingKeys_)==null||(o=o.get(r))==null||o.set(!0),this.keysAtom_.reportChanged()},e.ownKeys_=function(){return this.keysAtom_.reportObserved(),ll(this.target_)},e.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},t}();function lo(t,e){var n;if(M.NODE_ENV!=="production"&&e&&us(t)&&J("Options can't be provided for already observable objects."),It(t,fe))return M.NODE_ENV!=="production"&&!(km(t)instanceof ou)&&J("Cannot convert '"+Ra(t)+`' into observable object:
|
|
112
|
+
`)()}}function Q0(t,e,n){if(e.length>=1e3){e.push("(and many more)");return}e.push(""+" ".repeat(n-1)+t.name),t.dependencies&&t.dependencies.forEach(function(r){return Q0(r,e,n+1)})}var Br=function(){function t(n,r,o,i){n===void 0&&(n=H.NODE_ENV!=="production"?"Reaction@"+Zn():"Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=Ve.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=Ln.NONE,this.name_=n,this.onInvalidate_=r,this.errorHandler_=o,this.requiresObservable_=i}var e=t.prototype;return e.onBecomeStale_=function(){this.schedule_()},e.schedule_=function(){this.isScheduled||(this.isScheduled=!0,Y.pendingReactions.push(this),eb())},e.runReaction_=function(){if(!this.isDisposed){Rn(),this.isScheduled=!1;var r=Y.trackingContext;if(Y.trackingContext=this,qd(this)){this.isTrackPending=!0;try{this.onInvalidate_(),H.NODE_ENV!=="production"&&this.isTrackPending&&At()&&ai({name:this.name_,type:"scheduled-reaction"})}catch(o){this.reportExceptionInDerivation_(o)}}Y.trackingContext=r,Nn()}},e.track=function(r){if(!this.isDisposed){Rn();var o=At(),i;H.NODE_ENV!=="production"&&o&&(i=Date.now(),pn({name:this.name_,type:"reaction"})),this.isRunning=!0;var s=Y.trackingContext;Y.trackingContext=this;var l=W0(this,r,void 0);Y.trackingContext=s,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&Gd(this),ja(l)&&this.reportExceptionInDerivation_(l.cause),H.NODE_ENV!=="production"&&o&&hn({time:Date.now()-i}),Nn()}},e.reportExceptionInDerivation_=function(r){var o=this;if(this.errorHandler_){this.errorHandler_(r,this);return}if(Y.disableErrorBoundaries)throw r;var i=H.NODE_ENV!=="production"?"[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'":"[mobx] uncaught error in '"+this+"'";Y.suppressReactionErrors?H.NODE_ENV!=="production"&&console.warn("[mobx] (error in reaction '"+this.name_+"' suppressed, fix error of causing action below)"):console.error(i,r),H.NODE_ENV!=="production"&&At()&&ai({type:"error",name:this.name_,message:i,error:""+r}),Y.globalReactionErrorHandlers.forEach(function(s){return s(r,o)})},e.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(Rn(),Gd(this),Nn()))},e.getDisposer_=function(r){var o=this,i=function s(){o.dispose(),r==null||r.removeEventListener==null||r.removeEventListener("abort",s)};return r==null||r.addEventListener==null||r.addEventListener("abort",i),i[xe]=this,i},e.toString=function(){return"Reaction["+this.name_+"]"},e.trace=function(r){r===void 0&&(r=!1),DS(this,r)},hs(t,[{key:"isDisposed",get:function(){return ln(this.flags_,t.isDisposedMask_)},set:function(r){this.flags_=an(this.flags_,t.isDisposedMask_,r)}},{key:"isScheduled",get:function(){return ln(this.flags_,t.isScheduledMask_)},set:function(r){this.flags_=an(this.flags_,t.isScheduledMask_,r)}},{key:"isTrackPending",get:function(){return ln(this.flags_,t.isTrackPendingMask_)},set:function(r){this.flags_=an(this.flags_,t.isTrackPendingMask_,r)}},{key:"isRunning",get:function(){return ln(this.flags_,t.isRunningMask_)},set:function(r){this.flags_=an(this.flags_,t.isRunningMask_,r)}},{key:"diffValue",get:function(){return ln(this.flags_,t.diffValueMask_)?1:0},set:function(r){this.flags_=an(this.flags_,t.diffValueMask_,r===1)}}])}();Br.isDisposedMask_=1;Br.isScheduledMask_=2;Br.isTrackPendingMask_=4;Br.isRunningMask_=8;Br.diffValueMask_=16;var Hh=100,Kd=function(e){return e()};function eb(){Y.inBatch>0||Y.isRunningReactions||Kd(fS)}function fS(){Y.isRunningReactions=!0;for(var t=Y.pendingReactions,e=0;t.length>0;){++e===Hh&&(console.error(H.NODE_ENV!=="production"?"Reaction doesn't converge to a stable state after "+Hh+" iterations."+(" Probably there is a cycle in the reactive function: "+t[0]):"[mobx] cycle in reaction: "+t[0]),t.splice(0));for(var n=t.splice(0),r=0,o=n.length;r<o;r++)n[r].runReaction_()}Y.isRunningReactions=!1}var Xa=bi("Reaction",Br);function pS(t){var e=Kd;Kd=function(r){return t(function(){return e(r)})}}function At(){return H.NODE_ENV!=="production"&&!!Y.spyListeners.length}function ai(t){if(H.NODE_ENV!=="production"&&Y.spyListeners.length)for(var e=Y.spyListeners,n=0,r=e.length;n<r;n++)e[n](t)}function pn(t){if(H.NODE_ENV!=="production"){var e=Hr({},t,{spyReportStart:!0});ai(e)}}var hS={type:"report-end",spyReportEnd:!0};function hn(t){H.NODE_ENV!=="production"&&ai(t?Hr({},t,{type:"report-end",spyReportEnd:!0}):hS)}function gS(t){return H.NODE_ENV==="production"?(console.warn("[mobx.spy] Is a no-op in production builds"),function(){}):(Y.spyListeners.push(t),Qf(function(){Y.spyListeners=Y.spyListeners.filter(function(e){return e!==t})}))}var ip="action",mS="action.bound",tb="autoAction",bS="autoAction.bound",vS="<unnamed action>",Yd=kl(ip),yS=kl(mS,{bound:!0}),Jd=kl(tb,{autoAction:!0}),xS=kl(bS,{autoAction:!0,bound:!0});function nb(t){var e=function(r,o){if(yt(r))return li(r.name||vS,r,t);if(yt(o))return li(r,o,t);if(_l(o))return(t?Jd:Yd).decorate_20223_(r,o);if(ii(o))return Ol(r,o,t?Jd:Yd);if(ii(r))return ur(kl(t?tb:ip,{name:r,autoAction:t}));H.NODE_ENV!=="production"&&ce("Invalid arguments for `action`")};return e}var Di=nb(!1);Object.assign(Di,Yd);var ll=nb(!0);Object.assign(ll,Jd);Di.bound=ur(yS);ll.bound=ur(xS);function Ji(t){return yt(t)&&t.isMobxAction===!0}function wS(t,e){var n,r,o,i;e===void 0&&(e=T0),H.NODE_ENV!=="production"&&(yt(t)||ce("Autorun expects a function as first argument"),Ji(t)&&ce("Autorun does not accept actions since actions are untrackable"));var s=(n=(r=e)==null?void 0:r.name)!=null?n:H.NODE_ENV!=="production"?t.name||"Autorun@"+Zn():"Autorun",l=!e.scheduler&&!e.delay,a;if(l)a=new Br(s,function(){this.track(d)},e.onError,e.requiresObservable);else{var c=CS(e),u=!1;a=new Br(s,function(){u||(u=!0,c(function(){u=!1,a.isDisposed||a.track(d)}))},e.onError,e.requiresObservable)}function d(){t(a)}return(o=e)!=null&&(o=o.signal)!=null&&o.aborted||a.schedule_(),a.getDisposer_((i=e)==null?void 0:i.signal)}var SS=function(e){return e()};function CS(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:SS}var ES="onBO",OS="onBUO";function _S(t,e,n){return ob(ES,t,e,n)}function rb(t,e,n){return ob(OS,t,e,n)}function ob(t,e,n,r){var o=Xi(e),i=yt(r)?r:n,s=t+"L";return o[s]?o[s].add(i):o[s]=new Set([i]),function(){var l=o[s];l&&(l.delete(i),l.size===0&&delete o[s])}}var kS="never",Jl="always",TS="observed";function AS(t){t.isolateGlobalState===!0&&aS();var e=t.useProxies,n=t.enforceActions;if(e!==void 0&&(Y.useProxies=e===Jl?!0:e===kS?!1:typeof Proxy<"u"),e==="ifavailable"&&(Y.verifyProxies=!0),n!==void 0){var r=n===Jl?Jl:n===TS;Y.enforceActions=r,Y.allowStateChanges=!(r===!0||r===Jl)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(o){o in t&&(Y[o]=!!t[o])}),Y.allowStateReads=!Y.observableRequiresReaction,H.NODE_ENV!=="production"&&Y.disableErrorBoundaries===!0&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),t.reactionScheduler&&pS(t.reactionScheduler)}function MS(t,e,n,r){H.NODE_ENV!=="production"&&(arguments.length>4&&ce("'extendObservable' expected 2-4 arguments"),typeof t!="object"&&ce("'extendObservable' expects an object as first argument"),To(t)&&ce("'extendObservable' should not be used on maps, use map.merge instead"),hr(e)||ce("'extendObservable' only accepts plain objects as second argument"),(cl(e)||cl(n))&&ce("Extending an object with another observable (object) is not supported"));var o=sw(e);return yi(function(){var i=gs(t,r)[xe];Pc(o).forEach(function(s){i.extend_(s,o[s],n&&s in n?n[s]:!0)})}),t}function ib(t,e){return sb(Xi(t,e))}function sb(t){var e={name:t.name_};return t.observing_&&t.observing_.length>0&&(e.dependencies=jS(t.observing_).map(sb)),e}function jS(t){return Array.from(new Set(t))}var RS=0;function lb(){this.message="FLOW_CANCELLED"}lb.prototype=Object.create(Error.prototype);var wu=V0("flow"),NS=V0("flow.bound",{bound:!0}),Zi=Object.assign(function(e,n){if(_l(n))return wu.decorate_20223_(e,n);if(ii(n))return Ol(e,n,wu);H.NODE_ENV!=="production"&&arguments.length!==1&&ce("Flow expects single argument with generator function");var r=e,o=r.name||"<unnamed flow>",i=function(){var l=this,a=arguments,c=++RS,u=Di(o+" - runid: "+c+" - init",r).apply(l,a),d,f=void 0,p=new Promise(function(g,b){var v=0;d=b;function y(C){f=void 0;var x;try{x=Di(o+" - runid: "+c+" - yield "+v++,u.next).call(u,C)}catch(E){return b(E)}S(x)}function w(C){f=void 0;var x;try{x=Di(o+" - runid: "+c+" - yield "+v++,u.throw).call(u,C)}catch(E){return b(E)}S(x)}function S(C){if(yt(C==null?void 0:C.then)){C.then(S,b);return}return C.done?g(C.value):(f=Promise.resolve(C.value),f.then(y,w))}y(void 0)});return p.cancel=Di(o+" - runid: "+c+" - cancel",function(){try{f&&Bh(f);var g=u.return(void 0),b=Promise.resolve(g.value);b.then(Ni,Ni),Bh(b),d(new lb)}catch(v){d(v)}}),p};return i.isMobXFlow=!0,i},wu);Zi.bound=ur(NS);function Bh(t){yt(t.cancel)&&t.cancel()}function al(t){return(t==null?void 0:t.isMobXFlow)===!0}function PS(t,e){return t?Ml(t)||!!t[xe]||ep(t)||Xa(t)||$c(t):!1}function cl(t){return H.NODE_ENV!=="production"&&arguments.length!==1&&ce("isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property"),PS(t)}function DS(){if(H.NODE_ENV!=="production"){for(var t=!1,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];typeof n[n.length-1]=="boolean"&&(t=n.pop());var o=LS(n);if(!o)return ce("'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly");o.isTracing_===Ln.NONE&&console.log("[mobx.trace] '"+o.name_+"' tracing enabled"),o.isTracing_=t?Ln.BREAK:Ln.LOG}}function LS(t){switch(t.length){case 0:return Y.trackingDerivation;case 1:return Xi(t[0]);case 2:return Xi(t[0],t[1])}}function Pr(t,e){e===void 0&&(e=void 0),Rn();try{return t.apply(e)}finally{Nn()}}function Lo(t){return t[xe]}var VS={has:function(e,n){return H.NODE_ENV!=="production"&&Y.trackingDerivation&&As("detect new properties using the 'in' operator. Use 'has' from 'mobx' instead."),Lo(e).has_(n)},get:function(e,n){return Lo(e).get_(n)},set:function(e,n,r){var o;return ii(n)?(H.NODE_ENV!=="production"&&!Lo(e).values_.has(n)&&As("add a new observable property through direct assignment. Use 'set' from 'mobx' instead."),(o=Lo(e).set_(n,r,!0))!=null?o:!0):!1},deleteProperty:function(e,n){var r;return H.NODE_ENV!=="production"&&As("delete properties from an observable object. Use 'remove' from 'mobx' instead."),ii(n)?(r=Lo(e).delete_(n,!0))!=null?r:!0:!1},defineProperty:function(e,n,r){var o;return H.NODE_ENV!=="production"&&As("define property on an observable object. Use 'defineProperty' from 'mobx' instead."),(o=Lo(e).defineProperty_(n,r))!=null?o:!0},ownKeys:function(e){return H.NODE_ENV!=="production"&&Y.trackingDerivation&&As("iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead."),Lo(e).ownKeys_()},preventExtensions:function(e){ce(13)}};function IS(t,e){var n,r;return A0(),t=gs(t,e),(r=(n=t[xe]).proxy_)!=null?r:n.proxy_=new Proxy(t,VS)}function Tn(t){return t.interceptors_!==void 0&&t.interceptors_.length>0}function Tl(t,e){var n=t.interceptors_||(t.interceptors_=[]);return n.push(e),Qf(function(){var r=n.indexOf(e);r!==-1&&n.splice(r,1)})}function An(t,e){var n=vi();try{for(var r=[].concat(t.interceptors_||[]),o=0,i=r.length;o<i&&(e=r[o](e),e&&!e.type&&ce(14),!!e);o++);return e}finally{Vr(n)}}function Gn(t){return t.changeListeners_!==void 0&&t.changeListeners_.length>0}function Al(t,e){var n=t.changeListeners_||(t.changeListeners_=[]);return n.push(e),Qf(function(){var r=n.indexOf(e);r!==-1&&n.splice(r,1)})}function Kn(t,e){var n=vi(),r=t.changeListeners_;if(r){r=r.slice();for(var o=0,i=r.length;o<i;o++)r[o](e);Vr(n)}}function $S(t,e,n){return yi(function(){var r,o=gs(t,n)[xe];H.NODE_ENV!=="production"&&e&&t[Kt]&&ce("makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported."),(r=e)!=null||(e=fw(t)),Pc(e).forEach(function(i){return o.make_(i,e[i])})}),t}var zh="splice",Un="update",HS=1e4,BS={get:function(e,n){var r=e[xe];return n===xe?r:n==="length"?r.getArrayLength_():typeof n=="string"&&!isNaN(n)?r.get_(parseInt(n)):Dn(Qa,n)?Qa[n]:e[n]},set:function(e,n,r){var o=e[xe];return n==="length"&&o.setArrayLength_(r),typeof n=="symbol"||isNaN(n)?e[n]=r:o.set_(parseInt(n),r),!0},preventExtensions:function(){ce(15)}},sp=function(){function t(n,r,o,i){n===void 0&&(n=H.NODE_ENV!=="production"?"ObservableArray@"+Zn():"ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=o,this.legacyMode_=i,this.atom_=new ko(n),this.enhancer_=function(s,l){return r(s,l,H.NODE_ENV!=="production"?n+"[..]":"ObservableArray[..]")}}var e=t.prototype;return e.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},e.dehanceValues_=function(r){return this.dehancer!==void 0&&r.length>0?r.map(this.dehancer):r},e.intercept_=function(r){return Tl(this,r)},e.observe_=function(r,o){return o===void 0&&(o=!1),o&&r({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),Al(this,r)},e.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},e.setArrayLength_=function(r){(typeof r!="number"||isNaN(r)||r<0)&&ce("Out of range: "+r);var o=this.values_.length;if(r!==o)if(r>o){for(var i=new Array(r-o),s=0;s<r-o;s++)i[s]=void 0;this.spliceWithArray_(o,0,i)}else this.spliceWithArray_(r,o-r)},e.updateArrayLength_=function(r,o){r!==this.lastKnownLength_&&ce(16),this.lastKnownLength_+=o,this.legacyMode_&&o>0&&pb(r+o+1)},e.spliceWithArray_=function(r,o,i){var s=this;sr(this.atom_);var l=this.values_.length;if(r===void 0?r=0:r>l?r=l:r<0&&(r=Math.max(0,l+r)),arguments.length===1?o=l-r:o==null?o=0:o=Math.max(0,Math.min(o,l-r)),i===void 0&&(i=Ga),Tn(this)){var a=An(this,{object:this.proxy_,type:zh,index:r,removedCount:o,added:i});if(!a)return Ga;o=a.removedCount,i=a.added}if(i=i.length===0?i:i.map(function(d){return s.enhancer_(d,void 0)}),this.legacyMode_||H.NODE_ENV!=="production"){var c=i.length-o;this.updateArrayLength_(l,c)}var u=this.spliceItemsIntoValues_(r,o,i);return(o!==0||i.length!==0)&&this.notifyArraySplice_(r,i,u),this.dehanceValues_(u)},e.spliceItemsIntoValues_=function(r,o,i){if(i.length<HS){var s;return(s=this.values_).splice.apply(s,[r,o].concat(i))}else{var l=this.values_.slice(r,r+o),a=this.values_.slice(r+o);this.values_.length+=i.length-o;for(var c=0;c<i.length;c++)this.values_[r+c]=i[c];for(var u=0;u<a.length;u++)this.values_[r+i.length+u]=a[u];return l}},e.notifyArrayChildUpdate_=function(r,o,i){var s=!this.owned_&&At(),l=Gn(this),a=l||s?{observableKind:"array",object:this.proxy_,type:Un,debugObjectName:this.atom_.name_,index:r,newValue:o,oldValue:i}:null;H.NODE_ENV!=="production"&&s&&pn(a),this.atom_.reportChanged(),l&&Kn(this,a),H.NODE_ENV!=="production"&&s&&hn()},e.notifyArraySplice_=function(r,o,i){var s=!this.owned_&&At(),l=Gn(this),a=l||s?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:zh,index:r,removed:i,added:o,removedCount:i.length,addedCount:o.length}:null;H.NODE_ENV!=="production"&&s&&pn(a),this.atom_.reportChanged(),l&&Kn(this,a),H.NODE_ENV!=="production"&&s&&hn()},e.get_=function(r){if(this.legacyMode_&&r>=this.values_.length){console.warn(H.NODE_ENV!=="production"?"[mobx.array] Attempt to read an array index ("+r+") that is out of bounds ("+this.values_.length+"). Please check length first. Out of bound indices will not be tracked by MobX":"[mobx] Out of bounds read: "+r);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[r])},e.set_=function(r,o){var i=this.values_;if(this.legacyMode_&&r>i.length&&ce(17,r,i.length),r<i.length){sr(this.atom_);var s=i[r];if(Tn(this)){var l=An(this,{type:Un,object:this.proxy_,index:r,newValue:o});if(!l)return;o=l.newValue}o=this.enhancer_(o,s);var a=o!==s;a&&(i[r]=o,this.notifyArrayChildUpdate_(r,o,s))}else{for(var c=new Array(r+1-i.length),u=0;u<c.length-1;u++)c[u]=void 0;c[c.length-1]=o,this.spliceWithArray_(i.length,0,c)}},t}();function zS(t,e,n,r){return n===void 0&&(n=H.NODE_ENV!=="production"?"ObservableArray@"+Zn():"ObservableArray"),r===void 0&&(r=!1),A0(),yi(function(){var o=new sp(n,e,r,!1);j0(o.values_,xe,o);var i=new Proxy(o.values_,BS);return o.proxy_=i,t&&t.length&&o.spliceWithArray_(0,0,t),i})}var Qa={clear:function(){return this.splice(0)},replace:function(e){var n=this[xe];return n.spliceWithArray_(0,n.values_.length,e)},toJSON:function(){return this.slice()},splice:function(e,n){for(var r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];var s=this[xe];switch(arguments.length){case 0:return[];case 1:return s.spliceWithArray_(e);case 2:return s.spliceWithArray_(e,n)}return s.spliceWithArray_(e,n,o)},spliceWithArray:function(e,n,r){return this[xe].spliceWithArray_(e,n,r)},push:function(){for(var e=this[xe],n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return e.spliceWithArray_(e.values_.length,0,r),e.values_.length},pop:function(){return this.splice(Math.max(this[xe].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var e=this[xe],n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return e.spliceWithArray_(0,0,r),e.values_.length},reverse:function(){return Y.trackingDerivation&&ce(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){Y.trackingDerivation&&ce(37,"sort");var e=this.slice();return e.sort.apply(e,arguments),this.replace(e),this},remove:function(e){var n=this[xe],r=n.dehanceValues_(n.values_).indexOf(e);return r>-1?(this.splice(r,1),!0):!1}};Ze("at",vn);Ze("concat",vn);Ze("flat",vn);Ze("includes",vn);Ze("indexOf",vn);Ze("join",vn);Ze("lastIndexOf",vn);Ze("slice",vn);Ze("toString",vn);Ze("toLocaleString",vn);Ze("toSorted",vn);Ze("toSpliced",vn);Ze("with",vn);Ze("every",Xn);Ze("filter",Xn);Ze("find",Xn);Ze("findIndex",Xn);Ze("findLast",Xn);Ze("findLastIndex",Xn);Ze("flatMap",Xn);Ze("forEach",Xn);Ze("map",Xn);Ze("some",Xn);Ze("toReversed",Xn);Ze("reduce",ab);Ze("reduceRight",ab);function Ze(t,e){typeof Array.prototype[t]=="function"&&(Qa[t]=e(t))}function vn(t){return function(){var e=this[xe];e.atom_.reportObserved();var n=e.dehanceValues_(e.values_);return n[t].apply(n,arguments)}}function Xn(t){return function(e,n){var r=this,o=this[xe];o.atom_.reportObserved();var i=o.dehanceValues_(o.values_);return i[t](function(s,l){return e.call(n,s,l,r)})}}function ab(t){return function(){var e=this,n=this[xe];n.atom_.reportObserved();var r=n.dehanceValues_(n.values_),o=arguments[0];return arguments[0]=function(i,s,l){return o(i,s,l,e)},r[t].apply(r,arguments)}}var FS=bi("ObservableArrayAdministration",sp);function Hc(t){return Rc(t)&&FS(t[xe])}var WS={},ao="add",ec="delete",cb=function(){function t(n,r,o){var i=this;r===void 0&&(r=si),o===void 0&&(o=H.NODE_ENV!=="production"?"ObservableMap@"+Zn():"ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[xe]=WS,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=r,this.name_=o,yt(Map)||ce(18),yi(function(){i.keysAtom_=D0(H.NODE_ENV!=="production"?i.name_+".keys()":"ObservableMap.keys()"),i.data_=new Map,i.hasMap_=new Map,n&&i.merge(n)})}var e=t.prototype;return e.has_=function(r){return this.data_.has(r)},e.has=function(r){var o=this;if(!Y.trackingDerivation)return this.has_(r);var i=this.hasMap_.get(r);if(!i){var s=i=new Yo(this.has_(r),Lc,H.NODE_ENV!=="production"?this.name_+"."+zd(r)+"?":"ObservableMap.key?",!1);this.hasMap_.set(r,s),rb(s,function(){return o.hasMap_.delete(r)})}return i.get()},e.set=function(r,o){var i=this.has_(r);if(Tn(this)){var s=An(this,{type:i?Un:ao,object:this,newValue:o,name:r});if(!s)return this;o=s.newValue}return i?this.updateValue_(r,o):this.addValue_(r,o),this},e.delete=function(r){var o=this;if(sr(this.keysAtom_),Tn(this)){var i=An(this,{type:ec,object:this,name:r});if(!i)return!1}if(this.has_(r)){var s=At(),l=Gn(this),a=l||s?{observableKind:"map",debugObjectName:this.name_,type:ec,object:this,oldValue:this.data_.get(r).value_,name:r}:null;return H.NODE_ENV!=="production"&&s&&pn(a),Pr(function(){var c;o.keysAtom_.reportChanged(),(c=o.hasMap_.get(r))==null||c.setNewValue_(!1);var u=o.data_.get(r);u.setNewValue_(void 0),o.data_.delete(r)}),l&&Kn(this,a),H.NODE_ENV!=="production"&&s&&hn(),!0}return!1},e.updateValue_=function(r,o){var i=this.data_.get(r);if(o=i.prepareNewValue_(o),o!==Y.UNCHANGED){var s=At(),l=Gn(this),a=l||s?{observableKind:"map",debugObjectName:this.name_,type:Un,object:this,oldValue:i.value_,name:r,newValue:o}:null;H.NODE_ENV!=="production"&&s&&pn(a),i.setNewValue_(o),l&&Kn(this,a),H.NODE_ENV!=="production"&&s&&hn()}},e.addValue_=function(r,o){var i=this;sr(this.keysAtom_),Pr(function(){var c,u=new Yo(o,i.enhancer_,H.NODE_ENV!=="production"?i.name_+"."+zd(r):"ObservableMap.key",!1);i.data_.set(r,u),o=u.value_,(c=i.hasMap_.get(r))==null||c.setNewValue_(!0),i.keysAtom_.reportChanged()});var s=At(),l=Gn(this),a=l||s?{observableKind:"map",debugObjectName:this.name_,type:ao,object:this,name:r,newValue:o}:null;H.NODE_ENV!=="production"&&s&&pn(a),l&&Kn(this,a),H.NODE_ENV!=="production"&&s&&hn()},e.get=function(r){return this.has(r)?this.dehanceValue_(this.data_.get(r).get()):this.dehanceValue_(void 0)},e.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},e.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},e.values=function(){var r=this,o=this.keys();return Fh({next:function(){var s=o.next(),l=s.done,a=s.value;return{done:l,value:l?void 0:r.get(a)}}})},e.entries=function(){var r=this,o=this.keys();return Fh({next:function(){var s=o.next(),l=s.done,a=s.value;return{done:l,value:l?void 0:[a,r.get(a)]}}})},e[Symbol.iterator]=function(){return this.entries()},e.forEach=function(r,o){for(var i=Pi(this),s;!(s=i()).done;){var l=s.value,a=l[0],c=l[1];r.call(o,c,a,this)}},e.merge=function(r){var o=this;return To(r)&&(r=new Map(r)),Pr(function(){hr(r)?iw(r).forEach(function(i){return o.set(i,r[i])}):Array.isArray(r)?r.forEach(function(i){var s=i[0],l=i[1];return o.set(s,l)}):ps(r)?(ow(r)||ce(19,r),r.forEach(function(i,s){return o.set(s,i)})):r!=null&&ce(20,r)}),this},e.clear=function(){var r=this;Pr(function(){U0(function(){for(var o=Pi(r.keys()),i;!(i=o()).done;){var s=i.value;r.delete(s)}})})},e.replace=function(r){var o=this;return Pr(function(){for(var i=US(r),s=new Map,l=!1,a=Pi(o.data_.keys()),c;!(c=a()).done;){var u=c.value;if(!i.has(u)){var d=o.delete(u);if(d)l=!0;else{var f=o.data_.get(u);s.set(u,f)}}}for(var p=Pi(i.entries()),g;!(g=p()).done;){var b=g.value,v=b[0],y=b[1],w=o.data_.has(v);if(o.set(v,y),o.data_.has(v)){var S=o.data_.get(v);s.set(v,S),w||(l=!0)}}if(!l)if(o.data_.size!==s.size)o.keysAtom_.reportChanged();else for(var C=o.data_.keys(),x=s.keys(),E=C.next(),_=x.next();!E.done;){if(E.value!==_.value){o.keysAtom_.reportChanged();break}E=C.next(),_=x.next()}o.data_=s}),this},e.toString=function(){return"[object ObservableMap]"},e.toJSON=function(){return Array.from(this)},e.observe_=function(r,o){return H.NODE_ENV!=="production"&&o===!0&&ce("`observe` doesn't support fireImmediately=true in combination with maps."),Al(this,r)},e.intercept_=function(r){return Tl(this,r)},hs(t,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),To=bi("ObservableMap",cb);function Fh(t){return t[Symbol.toStringTag]="MapIterator",cp(t)}function US(t){if(ps(t)||To(t))return t;if(Array.isArray(t))return new Map(t);if(hr(t)){var e=new Map;for(var n in t)e.set(n,t[n]);return e}else return ce(21,t)}var qS={},ub=function(){function t(n,r,o){var i=this;r===void 0&&(r=si),o===void 0&&(o=H.NODE_ENV!=="production"?"ObservableSet@"+Zn():"ObservableSet"),this.name_=void 0,this[xe]=qS,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=o,yt(Set)||ce(22),this.enhancer_=function(s,l){return r(s,l,o)},yi(function(){i.atom_=D0(i.name_),n&&i.replace(n)})}var e=t.prototype;return e.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},e.clear=function(){var r=this;Pr(function(){U0(function(){for(var o=Pi(r.data_.values()),i;!(i=o()).done;){var s=i.value;r.delete(s)}})})},e.forEach=function(r,o){for(var i=Pi(this),s;!(s=i()).done;){var l=s.value;r.call(o,l,l,this)}},e.add=function(r){var o=this;if(sr(this.atom_),Tn(this)){var i=An(this,{type:ao,object:this,newValue:r});if(!i)return this}if(!this.has(r)){Pr(function(){o.data_.add(o.enhancer_(r,void 0)),o.atom_.reportChanged()});var s=H.NODE_ENV!=="production"&&At(),l=Gn(this),a=l||s?{observableKind:"set",debugObjectName:this.name_,type:ao,object:this,newValue:r}:null;s&&H.NODE_ENV!=="production"&&pn(a),l&&Kn(this,a),s&&H.NODE_ENV!=="production"&&hn()}return this},e.delete=function(r){var o=this;if(Tn(this)){var i=An(this,{type:ec,object:this,oldValue:r});if(!i)return!1}if(this.has(r)){var s=H.NODE_ENV!=="production"&&At(),l=Gn(this),a=l||s?{observableKind:"set",debugObjectName:this.name_,type:ec,object:this,oldValue:r}:null;return s&&H.NODE_ENV!=="production"&&pn(a),Pr(function(){o.atom_.reportChanged(),o.data_.delete(r)}),l&&Kn(this,a),s&&H.NODE_ENV!=="production"&&hn(),!0}return!1},e.has=function(r){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(r))},e.entries=function(){var r=0,o=Array.from(this.keys()),i=Array.from(this.values());return Wh({next:function(){var l=r;return r+=1,l<i.length?{value:[o[l],i[l]],done:!1}:{value:void 0,done:!0}}})},e.keys=function(){return this.values()},e.values=function(){this.atom_.reportObserved();var r=this,o=0,i=Array.from(this.data_.values());return Wh({next:function(){return o<i.length?{value:r.dehanceValue_(i[o++]),done:!1}:{value:void 0,done:!0}}})},e.intersection=function(r){if(Nr(r)&&!or(r))return r.intersection(this);var o=new Set(this);return o.intersection(r)},e.union=function(r){if(Nr(r)&&!or(r))return r.union(this);var o=new Set(this);return o.union(r)},e.difference=function(r){return new Set(this).difference(r)},e.symmetricDifference=function(r){if(Nr(r)&&!or(r))return r.symmetricDifference(this);var o=new Set(this);return o.symmetricDifference(r)},e.isSubsetOf=function(r){return new Set(this).isSubsetOf(r)},e.isSupersetOf=function(r){return new Set(this).isSupersetOf(r)},e.isDisjointFrom=function(r){if(Nr(r)&&!or(r))return r.isDisjointFrom(this);var o=new Set(this);return o.isDisjointFrom(r)},e.replace=function(r){var o=this;return or(r)&&(r=new Set(r)),Pr(function(){Array.isArray(r)?(o.clear(),r.forEach(function(i){return o.add(i)})):Nr(r)?(o.clear(),r.forEach(function(i){return o.add(i)})):r!=null&&ce("Cannot initialize set from "+r)}),this},e.observe_=function(r,o){return H.NODE_ENV!=="production"&&o===!0&&ce("`observe` doesn't support fireImmediately=true in combination with sets."),Al(this,r)},e.intercept_=function(r){return Tl(this,r)},e.toJSON=function(){return Array.from(this)},e.toString=function(){return"[object ObservableSet]"},e[Symbol.iterator]=function(){return this.values()},hs(t,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),or=bi("ObservableSet",ub);function Wh(t){return t[Symbol.toStringTag]="SetIterator",cp(t)}var Uh=Object.create(null),qh="remove",Zd=function(){function t(n,r,o,i){r===void 0&&(r=new Map),i===void 0&&(i=Vw),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=n,this.values_=r,this.name_=o,this.defaultAnnotation_=i,this.keysAtom_=new ko(H.NODE_ENV!=="production"?this.name_+".keys":"ObservableObject.keys"),this.isPlainObject_=hr(this.target_),H.NODE_ENV!=="production"&&!gb(this.defaultAnnotation_)&&ce("defaultAnnotation must be valid annotation"),H.NODE_ENV!=="production"&&(this.appliedAnnotations_={})}var e=t.prototype;return e.getObservablePropValue_=function(r){return this.values_.get(r).get()},e.setObservablePropValue_=function(r,o){var i=this.values_.get(r);if(i instanceof $n)return i.set(o),!0;if(Tn(this)){var s=An(this,{type:Un,object:this.proxy_||this.target_,name:r,newValue:o});if(!s)return null;o=s.newValue}if(o=i.prepareNewValue_(o),o!==Y.UNCHANGED){var l=Gn(this),a=H.NODE_ENV!=="production"&&At(),c=l||a?{type:Un,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:i.value_,name:r,newValue:o}:null;H.NODE_ENV!=="production"&&a&&pn(c),i.setNewValue_(o),l&&Kn(this,c),H.NODE_ENV!=="production"&&a&&hn()}return!0},e.get_=function(r){return Y.trackingDerivation&&!Dn(this.target_,r)&&this.has_(r),this.target_[r]},e.set_=function(r,o,i){return i===void 0&&(i=!1),Dn(this.target_,r)?this.values_.has(r)?this.setObservablePropValue_(r,o):i?Reflect.set(this.target_,r,o):(this.target_[r]=o,!0):this.extend_(r,{value:o,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,i)},e.has_=function(r){if(!Y.trackingDerivation)return r in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var o=this.pendingKeys_.get(r);return o||(o=new Yo(r in this.target_,Lc,H.NODE_ENV!=="production"?this.name_+"."+zd(r)+"?":"ObservableObject.key?",!1),this.pendingKeys_.set(r,o)),o.get()},e.make_=function(r,o){if(o===!0&&(o=this.defaultAnnotation_),o!==!1){if(Yh(this,o,r),!(r in this.target_)){var i;if((i=this.target_[Kt])!=null&&i[r])return;ce(1,o.annotationType_,this.name_+"."+r.toString())}for(var s=this.target_;s&&s!==jc;){var l=qa(s,r);if(l){var a=o.make_(this,r,l,s);if(a===0)return;if(a===1)break}s=Object.getPrototypeOf(s)}Kh(this,o,r)}},e.extend_=function(r,o,i,s){if(s===void 0&&(s=!1),i===!0&&(i=this.defaultAnnotation_),i===!1)return this.defineProperty_(r,o,s);Yh(this,i,r);var l=i.extend_(this,r,o,s);return l&&Kh(this,i,r),l},e.defineProperty_=function(r,o,i){i===void 0&&(i=!1),sr(this.keysAtom_);try{Rn();var s=this.delete_(r);if(!s)return s;if(Tn(this)){var l=An(this,{object:this.proxy_||this.target_,name:r,type:ao,newValue:o.value});if(!l)return null;var a=l.newValue;o.value!==a&&(o=Hr({},o,{value:a}))}if(i){if(!Reflect.defineProperty(this.target_,r,o))return!1}else cr(this.target_,r,o);this.notifyPropertyAddition_(r,o.value)}finally{Nn()}return!0},e.defineObservableProperty_=function(r,o,i,s){s===void 0&&(s=!1),sr(this.keysAtom_);try{Rn();var l=this.delete_(r);if(!l)return l;if(Tn(this)){var a=An(this,{object:this.proxy_||this.target_,name:r,type:ao,newValue:o});if(!a)return null;o=a.newValue}var c=Gh(r),u={configurable:Y.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:c.get,set:c.set};if(s){if(!Reflect.defineProperty(this.target_,r,u))return!1}else cr(this.target_,r,u);var d=new Yo(o,i,H.NODE_ENV!=="production"?this.name_+"."+r.toString():"ObservableObject.key",!1);this.values_.set(r,d),this.notifyPropertyAddition_(r,d.value_)}finally{Nn()}return!0},e.defineComputedProperty_=function(r,o,i){i===void 0&&(i=!1),sr(this.keysAtom_);try{Rn();var s=this.delete_(r);if(!s)return s;if(Tn(this)){var l=An(this,{object:this.proxy_||this.target_,name:r,type:ao,newValue:void 0});if(!l)return null}o.name||(o.name=H.NODE_ENV!=="production"?this.name_+"."+r.toString():"ObservableObject.key"),o.context=this.proxy_||this.target_;var a=Gh(r),c={configurable:Y.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:a.get,set:a.set};if(i){if(!Reflect.defineProperty(this.target_,r,c))return!1}else cr(this.target_,r,c);this.values_.set(r,new $n(o)),this.notifyPropertyAddition_(r,void 0)}finally{Nn()}return!0},e.delete_=function(r,o){if(o===void 0&&(o=!1),sr(this.keysAtom_),!Dn(this.target_,r))return!0;if(Tn(this)){var i=An(this,{object:this.proxy_||this.target_,name:r,type:qh});if(!i)return null}try{var s;Rn();var l=Gn(this),a=H.NODE_ENV!=="production"&&At(),c=this.values_.get(r),u=void 0;if(!c&&(l||a)){var d;u=(d=qa(this.target_,r))==null?void 0:d.value}if(o){if(!Reflect.deleteProperty(this.target_,r))return!1}else delete this.target_[r];if(H.NODE_ENV!=="production"&&delete this.appliedAnnotations_[r],c&&(this.values_.delete(r),c instanceof Yo&&(u=c.value_),Z0(c)),this.keysAtom_.reportChanged(),(s=this.pendingKeys_)==null||(s=s.get(r))==null||s.set(r in this.target_),l||a){var f={type:qh,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:u,name:r};H.NODE_ENV!=="production"&&a&&pn(f),l&&Kn(this,f),H.NODE_ENV!=="production"&&a&&hn()}}finally{Nn()}return!0},e.observe_=function(r,o){return H.NODE_ENV!=="production"&&o===!0&&ce("`observe` doesn't support the fire immediately property for observable objects."),Al(this,r)},e.intercept_=function(r){return Tl(this,r)},e.notifyPropertyAddition_=function(r,o){var i,s=Gn(this),l=H.NODE_ENV!=="production"&&At();if(s||l){var a=s||l?{type:ao,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:r,newValue:o}:null;H.NODE_ENV!=="production"&&l&&pn(a),s&&Kn(this,a),H.NODE_ENV!=="production"&&l&&hn()}(i=this.pendingKeys_)==null||(i=i.get(r))==null||i.set(!0),this.keysAtom_.reportChanged()},e.ownKeys_=function(){return this.keysAtom_.reportObserved(),Pc(this.target_)},e.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},t}();function gs(t,e){var n;if(H.NODE_ENV!=="production"&&e&&Ml(t)&&ce("Options can't be provided for already observable objects."),Dn(t,xe))return H.NODE_ENV!=="production"&&!(hb(t)instanceof Zd)&&ce("Cannot convert '"+tc(t)+`' into observable object:
|
|
195
113
|
The target is already observable of different type.
|
|
196
|
-
Extending builtins is not supported.`),t;
|
|
197
|
-
The field is already annotated with '`+
|
|
114
|
+
Extending builtins is not supported.`),t;H.NODE_ENV!=="production"&&!Object.isExtensible(t)&&ce("Cannot make the designated object observable; it is not extensible");var r=(n=e==null?void 0:e.name)!=null?n:H.NODE_ENV!=="production"?(hr(t)?"ObservableObject":t.constructor.name)+"@"+Zn():"ObservableObject",o=new Zd(t,new Map,String(r),Kw(e));return Nc(t,xe,o),t}var GS=bi("ObservableObjectAdministration",Zd);function Gh(t){return Uh[t]||(Uh[t]={get:function(){return this[xe].getObservablePropValue_(t)},set:function(n){return this[xe].setObservablePropValue_(t,n)}})}function Ml(t){return Rc(t)?GS(t[xe]):!1}function Kh(t,e,n){var r;H.NODE_ENV!=="production"&&(t.appliedAnnotations_[n]=e),(r=t.target_[Kt])==null||delete r[n]}function Yh(t,e,n){if(H.NODE_ENV!=="production"&&!gb(e)&&ce("Cannot annotate '"+t.name_+"."+n.toString()+"': Invalid annotation."),H.NODE_ENV!=="production"&&!Ya(e)&&Dn(t.appliedAnnotations_,n)){var r=t.name_+"."+n.toString(),o=t.appliedAnnotations_[n].annotationType_,i=e.annotationType_;ce("Cannot apply '"+i+"' to '"+r+"':"+(`
|
|
115
|
+
The field is already annotated with '`+o+"'.")+`
|
|
198
116
|
Re-annotating fields is not allowed.
|
|
199
|
-
Use 'override' annotation for methods overridden by subclass.`)}}var
|
|
117
|
+
Use 'override' annotation for methods overridden by subclass.`)}}var KS=fb(0),YS=function(){var t=!1,e={};return Object.defineProperty(e,"0",{set:function(){t=!0}}),Object.create(e)[0]=1,t===!1}(),Su=0,db=function(){};function JS(t,e){Object.setPrototypeOf?Object.setPrototypeOf(t.prototype,e):t.prototype.__proto__!==void 0?t.prototype.__proto__=e:t.prototype=e}JS(db,Array.prototype);var lp=function(t){function e(r,o,i,s){var l;return i===void 0&&(i=H.NODE_ENV!=="production"?"ObservableArray@"+Zn():"ObservableArray"),s===void 0&&(s=!1),l=t.call(this)||this,yi(function(){var a=new sp(i,o,s,!0);a.proxy_=l,j0(l,xe,a),r&&r.length&&l.spliceWithArray(0,0,r),YS&&Object.defineProperty(l,"0",KS)}),l}P0(e,t);var n=e.prototype;return n.concat=function(){this[xe].atom_.reportObserved();for(var o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return Array.prototype.concat.apply(this.slice(),i.map(function(l){return Hc(l)?l.slice():l}))},n[Symbol.iterator]=function(){var r=this,o=0;return cp({next:function(){return o<r.length?{value:r[o++],done:!1}:{done:!0,value:void 0}}})},hs(e,[{key:"length",get:function(){return this[xe].getArrayLength_()},set:function(o){this[xe].setArrayLength_(o)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(db);Object.entries(Qa).forEach(function(t){var e=t[0],n=t[1];e!=="concat"&&Nc(lp.prototype,e,n)});function fb(t){return{enumerable:!1,configurable:!0,get:function(){return this[xe].get_(t)},set:function(n){this[xe].set_(t,n)}}}function ZS(t){cr(lp.prototype,""+t,fb(t))}function pb(t){if(t>Su){for(var e=Su;e<t+100;e++)ZS(e);Su=t}}pb(1e3);function XS(t,e,n){return new lp(t,e,n)}function Xi(t,e){if(typeof t=="object"&&t!==null){if(Hc(t))return e!==void 0&&ce(23),t[xe].atom_;if(or(t))return t.atom_;if(To(t)){if(e===void 0)return t.keysAtom_;var n=t.data_.get(e)||t.hasMap_.get(e);return n||ce(25,e,tc(t)),n}if(Ml(t)){if(!e)return ce(26);var r=t[xe].values_.get(e);return r||ce(27,e,tc(t)),r}if(ep(t)||$c(t)||Xa(t))return t}else if(yt(t)&&Xa(t[xe]))return t[xe];ce(28)}function hb(t,e){if(t||ce(29),ep(t)||$c(t)||Xa(t)||To(t)||or(t))return t;if(t[xe])return t[xe];ce(24,t)}function tc(t,e){var n;if(e!==void 0)n=Xi(t,e);else{if(Ji(t))return t.name;Ml(t)||To(t)||or(t)?n=hb(t):n=Xi(t)}return n.name_}function yi(t){var e=vi(),n=np(!0);Rn();try{return t()}finally{Nn(),rp(n),Vr(e)}}var Jh=jc.toString;function ap(t,e,n){return n===void 0&&(n=-1),Xd(t,e,n)}function Xd(t,e,n,r,o){if(t===e)return t!==0||1/t===1/e;if(t==null||e==null)return!1;if(t!==t)return e!==e;var i=typeof t;if(i!=="function"&&i!=="object"&&typeof e!="object")return!1;var s=Jh.call(t);if(s!==Jh.call(e))return!1;switch(s){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:+t==0?1/+t===1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(t)===Symbol.valueOf.call(e);case"[object Map]":case"[object Set]":n>=0&&n++;break}t=Zh(t),e=Zh(e);var l=s==="[object Array]";if(!l){if(typeof t!="object"||typeof e!="object")return!1;var a=t.constructor,c=e.constructor;if(a!==c&&!(yt(a)&&a instanceof a&&yt(c)&&c instanceof c)&&"constructor"in t&&"constructor"in e)return!1}if(n===0)return!1;n<0&&(n=-1),r=r||[],o=o||[];for(var u=r.length;u--;)if(r[u]===t)return o[u]===e;if(r.push(t),o.push(e),l){if(u=t.length,u!==e.length)return!1;for(;u--;)if(!Xd(t[u],e[u],n-1,r,o))return!1}else{var d=Object.keys(t),f;if(u=d.length,Object.keys(e).length!==u)return!1;for(;u--;)if(f=d[u],!(Dn(e,f)&&Xd(t[f],e[f],n-1,r,o)))return!1}return r.pop(),o.pop(),!0}function Zh(t){return Hc(t)?t.slice():ps(t)||To(t)||Nr(t)||or(t)?Array.from(t.entries()):t}var Xh,QS=((Xh=Mc().Iterator)==null?void 0:Xh.prototype)||{};function cp(t){return t[Symbol.iterator]=eC,Object.assign(Object.create(QS),t)}function eC(){return this}function gb(t){return t instanceof Object&&typeof t.annotationType_=="string"&&yt(t.make_)&&yt(t.extend_)}["Symbol","Map","Set"].forEach(function(t){var e=Mc();typeof e[t]>"u"&&ce("MobX requires global '"+t+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:gS,extras:{getDebugName:tc},$mobx:xe});if(!m.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!$S)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");var tC={};function nC(t){t()}function rC(t){t||(t=nC,tC.NODE_ENV!=="production"&&console.warn("[MobX] Failed to get unstable_batched updates from react-dom / react-native")),AS({reactionScheduler:t})}function oC(t){return ib(t)}var iC=1e4,sC=1e4,lC=function(){function t(e){var n=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(r){r===void 0&&(r=iC),clearTimeout(n.sweepTimeout),n.sweepTimeout=void 0;var o=Date.now();n.registrations.forEach(function(i,s){o-i.registeredAt>=r&&(n.finalize(i.value),n.registrations.delete(s))}),n.registrations.size>0&&n.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){n.sweep(0)}})}return Object.defineProperty(t.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n,r){this.registrations.set(r,{value:n,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(t.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.registrations.delete(e)}}),Object.defineProperty(t.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sweepTimeout===void 0&&(this.sweepTimeout=setTimeout(this.sweep,sC))}}),t}(),aC=typeof FinalizationRegistry<"u"?FinalizationRegistry:lC,Qd=new aC(function(t){var e;(e=t.reaction)===null||e===void 0||e.dispose(),t.reaction=null}),ef={exports:{}},Cu={};/**
|
|
200
118
|
* @license React
|
|
201
119
|
* use-sync-external-store-shim.production.min.js
|
|
202
120
|
*
|
|
@@ -204,7 +122,7 @@ Use 'override' annotation for methods overridden by subclass.`)}}var hx=Em(0),mx
|
|
|
204
122
|
*
|
|
205
123
|
* This source code is licensed under the MIT license found in the
|
|
206
124
|
* LICENSE file in the root directory of this source tree.
|
|
207
|
-
*/var
|
|
125
|
+
*/var Qh;function cC(){if(Qh)return Cu;Qh=1;var t=m;function e(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,o=t.useEffect,i=t.useLayoutEffect,s=t.useDebugValue;function l(d,f){var p=f(),g=r({inst:{value:p,getSnapshot:f}}),b=g[0].inst,v=g[1];return i(function(){b.value=p,b.getSnapshot=f,a(b)&&v({inst:b})},[d,p,f]),o(function(){return a(b)&&v({inst:b}),d(function(){a(b)&&v({inst:b})})},[d]),s(p),p}function a(d){var f=d.getSnapshot;d=d.value;try{var p=f();return!n(d,p)}catch{return!0}}function c(d,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:l;return Cu.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:u,Cu}var Eu={},eg;function uC(){if(eg)return Eu;eg=1;var t={};/**
|
|
208
126
|
* @license React
|
|
209
127
|
* use-sync-external-store-shim.development.js
|
|
210
128
|
*
|
|
@@ -212,12 +130,32 @@ Use 'override' annotation for methods overridden by subclass.`)}}var hx=Em(0),mx
|
|
|
212
130
|
*
|
|
213
131
|
* This source code is licensed under the MIT license found in the
|
|
214
132
|
* LICENSE file in the root directory of this source tree.
|
|
215
|
-
*/return t.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=O,n=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function r(C){{for(var v=arguments.length,E=new Array(v>1?v-1:0),A=1;A<v;A++)E[A-1]=arguments[A];i("error",C,E)}}function i(C,v,E){{var A=n.ReactDebugCurrentFrame,B=A.getStackAddendum();B!==""&&(v+="%s",E=E.concat([B]));var T=E.map(function(P){return String(P)});T.unshift("Warning: "+v),Function.prototype.apply.call(console[C],console,T)}}function o(C,v){return C===v&&(C!==0||1/C===1/v)||C!==C&&v!==v}var s=typeof Object.is=="function"?Object.is:o,a=e.useState,l=e.useEffect,c=e.useLayoutEffect,u=e.useDebugValue,f=!1,d=!1;function p(C,v,E){f||e.startTransition!==void 0&&(f=!0,r("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var A=v();if(!d){var B=v();s(A,B)||(r("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}var T=a({inst:{value:A,getSnapshot:v}}),P=T[0].inst,I=T[1];return c(function(){P.value=A,P.getSnapshot=v,h(P)&&I({inst:P})},[C,A,v]),l(function(){h(P)&&I({inst:P});var z=function(){h(P)&&I({inst:P})};return C(z)},[C]),u(A),A}function h(C){var v=C.getSnapshot,E=C.value;try{var A=v();return!s(E,A)}catch{return!0}}function m(C,v,E){return v()}var g=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",y=!g,w=y?m:p,x=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:w;Ql.useSyncExternalStore=x,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}(),Ql}var Nx={};Nx.NODE_ENV==="production"?lu.exports=Tx():lu.exports=Mx();var Rx=lu.exports;function Bd(t){t.reaction=new Un("observer".concat(t.name),function(){var e;t.stateVersion=Symbol(),(e=t.onStoreChange)===null||e===void 0||e.call(t)})}function Px(t,e){e===void 0&&(e="observed");var n=O.useRef(null);if(!n.current){var r={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:e,subscribe:function(a){return au.unregister(r),r.onStoreChange=a,r.reaction||(Bd(r),r.stateVersion=Symbol()),function(){var l;r.onStoreChange=null,(l=r.reaction)===null||l===void 0||l.dispose(),r.reaction=null}},getSnapshot:function(){return r.stateVersion}};n.current=r}var i=n.current;i.reaction||(Bd(i),au.register(n,i,i)),O.useDebugValue(i.reaction,Ox),Rx.useSyncExternalStore(i.subscribe,i.getSnapshot,i.getSnapshot);var o,s;if(i.reaction.track(function(){try{o=t()}catch(a){s=a}}),s)throw s;return o}var $d={},ec,tc,zd=!0,Tm=typeof Symbol=="function"&&Symbol.for,Vx=(tc=(ec=Object.getOwnPropertyDescriptor(function(){},"name"))===null||ec===void 0?void 0:ec.configurable)!==null&&tc!==void 0?tc:!1,Fd=Tm?Symbol.for("react.forward_ref"):typeof O.forwardRef=="function"&&O.forwardRef(function(t){return null}).$$typeof,Wd=Tm?Symbol.for("react.memo"):typeof O.memo=="function"&&O.memo(function(t){return null}).$$typeof;function fs(t,e){var n;if($d.NODE_ENV!=="production"&&zd&&e&&(zd=!1,console.warn("[mobx-react-lite] `observer(fn, { forwardRef: true })` is deprecated, use `observer(React.forwardRef(fn))`")),Wd&&t.$$typeof===Wd)throw new Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");var r=(n=void 0)!==null&&n!==void 0?n:!1,i=t,o=t.displayName||t.name;if(Fd&&t.$$typeof===Fd&&(r=!0,i=t.render,typeof i!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var s=function(a,l){return Px(function(){return i(a,l)},o)};return s.displayName=t.displayName,Vx&&Object.defineProperty(s,"name",{value:t.name,writable:!0,configurable:!0}),t.contextTypes&&(s.contextTypes=t.contextTypes),r&&(s=O.forwardRef(s)),s=O.memo(s),Lx(t,s),$d.NODE_ENV!=="production"&&Object.defineProperty(s,"contextTypes",{set:function(){var a,l;throw new Error("[mobx-react-lite] `".concat(this.displayName||((a=this.type)===null||a===void 0?void 0:a.displayName)||((l=this.type)===null||l===void 0?void 0:l.name)||"Component",".contextTypes` must be set before applying `observer`."))}}),s}var Dx={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function Lx(t,e){Object.keys(t).forEach(function(n){Dx[n]||Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}var nc;Cx(tl.unstable_batchedUpdates);nc=au.finalizeAllImmediately;const Mm=new Set,Et=new WeakMap,Li=new WeakMap,ni=new WeakMap,cu=new WeakMap,jx=new WeakMap,Gi=new WeakMap,Pa=new WeakMap;let br;const Ir="__aa_tgt",uu="__aa_del",Hx=t=>{const e=Fx(t);e&&e.forEach(n=>Wx(n))},Ix=t=>{t.forEach(e=>{e.target===br&&$x(),Et.has(e.target)&&fi(e.target)})};function Bx(t){const e=cu.get(t);e==null||e.disconnect();let n=Et.get(t),r=0;const i=5;n||(n=Ki(t),Et.set(t,n));const{offsetWidth:o,offsetHeight:s}=br,l=[n.top-i,o-(n.left+i+n.width),s-(n.top+i+n.height),n.left-i].map(u=>`${-1*Math.floor(u)}px`).join(" "),c=new IntersectionObserver(()=>{++r>1&&fi(t)},{root:br,threshold:1,rootMargin:l});c.observe(t),cu.set(t,c)}function fi(t){clearTimeout(Pa.get(t));const e=ml(t),n=typeof e=="function"?500:e.duration;Pa.set(t,setTimeout(()=>{const r=ni.get(t);(!r||r.finished)&&(Et.set(t,Ki(t)),Bx(t))},n))}function $x(){clearTimeout(Pa.get(br)),Pa.set(br,setTimeout(()=>{Mm.forEach(t=>Pm(t,e=>Nm(()=>fi(e))))},100))}function zx(t){setTimeout(()=>{jx.set(t,setInterval(()=>Nm(fi.bind(null,t)),2e3))},Math.round(2e3*Math.random()))}function Nm(t){typeof requestIdleCallback=="function"?requestIdleCallback(()=>t()):requestAnimationFrame(()=>t())}let fu,Mi;typeof window<"u"&&(br=document.documentElement,fu=new MutationObserver(Hx),Mi=new ResizeObserver(Ix),Mi.observe(br));function Fx(t){return t.reduce((e,n)=>{if(e===!1)return!1;if(n.target instanceof Element){if(rc(n.target),!e.has(n.target)){e.add(n.target);for(let r=0;r<n.target.children.length;r++){const i=n.target.children.item(r);if(i){if(uu in i)return!1;rc(n.target,i),e.add(i)}}}if(n.removedNodes.length)for(let r=0;r<n.removedNodes.length;r++){const i=n.removedNodes[r];if(uu in i)return!1;i instanceof Element&&(e.add(i),rc(n.target,i),Li.set(i,[n.previousSibling,n.nextSibling]))}}return e},new Set)}function rc(t,e){!e&&!(Ir in t)?Object.defineProperty(t,Ir,{value:t}):e&&!(Ir in e)&&Object.defineProperty(e,Ir,{value:t})}function Wx(t){var e;const n=br.contains(t),r=Et.has(t);n&&Li.has(t)&&Li.delete(t),ni.has(t)&&((e=ni.get(t))===null||e===void 0||e.cancel()),r&&n?Ux(t):r&&!n?Gx(t):qx(t)}function fn(t){return Number(t.replace(/[^0-9.\-]/g,""))}function Ki(t){const e=t.getBoundingClientRect();return{top:e.top+window.scrollY,left:e.left+window.scrollX,width:e.width,height:e.height}}function Rm(t,e,n){let r=e.width,i=e.height,o=n.width,s=n.height;const a=getComputedStyle(t);if(a.getPropertyValue("box-sizing")==="content-box"){const c=fn(a.paddingTop)+fn(a.paddingBottom)+fn(a.borderTopWidth)+fn(a.borderBottomWidth),u=fn(a.paddingLeft)+fn(a.paddingRight)+fn(a.borderRightWidth)+fn(a.borderLeftWidth);r-=u,o-=u,i-=c,s-=c}return[r,o,i,s].map(Math.round)}function ml(t){return Ir in t&&Gi.has(t[Ir])?Gi.get(t[Ir]):{duration:250,easing:"ease-in-out"}}function Pm(t,...e){e.forEach(n=>n(t,Gi.has(t)));for(let n=0;n<t.children.length;n++){const r=t.children.item(n);r&&e.forEach(i=>i(r,Gi.has(r)))}}function Ux(t){const e=Et.get(t),n=Ki(t);let r;if(!e)return;const i=ml(t);if(typeof i!="function"){const o=e.left-n.left,s=e.top-n.top,[a,l,c,u]=Rm(t,e,n),f={transform:`translate(${o}px, ${s}px)`},d={transform:"translate(0, 0)"};a!==l&&(f.width=`${a}px`,d.width=`${l}px`),c!==u&&(f.height=`${c}px`,d.height=`${u}px`),r=t.animate([f,d],i)}else r=new Animation(i(t,"remain",e,n)),r.play();ni.set(t,r),Et.set(t,n),r.addEventListener("finish",fi.bind(null,t))}function qx(t){const e=Ki(t);Et.set(t,e);const n=ml(t);let r;typeof n!="function"?r=t.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:n.duration*1.5,easing:"ease-in"}):(r=new Animation(n(t,"add",e)),r.play()),ni.set(t,r),r.addEventListener("finish",fi.bind(null,t))}function Gx(t){if(!Li.has(t)||!Et.has(t))return;const[e,n]=Li.get(t);Object.defineProperty(t,uu,{value:!0}),n&&n.parentNode&&n.parentNode instanceof Element?n.parentNode.insertBefore(t,n):e&&e.parentNode&&e.parentNode.appendChild(t);const[r,i,o,s]=Kx(t),a=ml(t),l=Et.get(t);let c;Object.assign(t.style,{position:"absolute",top:`${r}px`,left:`${i}px`,width:`${o}px`,height:`${s}px`,margin:0,pointerEvents:"none",transformOrigin:"center",zIndex:100}),typeof a!="function"?c=t.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:a.duration,easing:"ease-out"}):(c=new Animation(a(t,"remove",l)),c.play()),ni.set(t,c),c.addEventListener("finish",()=>{var u;t.remove(),Et.delete(t),Li.delete(t),ni.delete(t),(u=cu.get(t))===null||u===void 0||u.disconnect()})}function Kx(t){const e=Et.get(t),[n,,r]=Rm(t,e,Ki(t));let i=t.parentElement;for(;i&&(getComputedStyle(i).position==="static"||i instanceof HTMLBodyElement);)i=i.parentElement;i||(i=document.body);const o=getComputedStyle(i),s=Et.get(i)||Ki(i),a=Math.round(e.top-s.top)-fn(o.borderTopWidth),l=Math.round(e.left-s.left)-fn(o.borderLeftWidth);return[a,l,n,r]}function Zx(t,e={}){fu&&Mi&&(getComputedStyle(t).position==="static"&&Object.assign(t.style,{position:"relative"}),Pm(t,fi,zx,n=>Mi==null?void 0:Mi.observe(n)),typeof e=="function"?Gi.set(t,e):Gi.set(t,{duration:250,easing:"ease-in-out",...e}),fu.observe(t,{childList:!0}),Mm.add(t))}function Jx(t){const e=O.useRef(null);return O.useEffect(()=>{e.current instanceof HTMLElement&&Zx(e.current,t)},[e]),e}const Ee=xe;function xe(...t){return(Array.isArray(t[0])?t[0]:[...t]).filter(Boolean).flatMap(i=>typeof i=="string"?i.split(" ").map(o=>{if(o=o.replace(/gjs-/g,"gs-utl-"),!o.includes("gs-utl-")&&!o.startsWith("gs-")){const s=o.split(":"),a=s.pop(),l=s.join(":"),c=a==null?void 0:a.startsWith("!"),f=`gs-utl-${c?a==null?void 0:a.slice(1):a}`,d=c?`!${f}`:f;return l?`${l}:${d}`:d}return o}):i).join(" ")}const Le=O.forwardRef(function({as:e,children:n,className:r,col:i,revert:o,full:s,nowrap:a,space:l,justify:c,items:u,...f},d){const p=e||"div";return R.jsx(p,{ref:d,className:xe(["gs-utl-flex",r,i&&!o&&"gs-utl-flex-col",i&&o&&"gs-utl-flex-col-reverse",!i&&o&&"gs-utl-flex-row-reverse",s&&!i&&"gs-utl-w-full",s&&i&&"gs-utl-h-full",a?"gs-utl-flex-nowrap":"gs-utl-flex-wrap",l==="x2s"&&(i?"gs-utl-space-y-0.5":"gs-utl-space-x-0.5"),l==="xs"&&(i?"gs-utl-space-y-1":"gs-utl-space-x-1"),l==="s"&&(i?"gs-utl-space-y-2":"gs-utl-space-x-2"),l==="m"&&(i?"gs-utl-space-y-4":"gs-utl-space-x-4"),l==="l"&&(i?"gs-utl-space-y-6":"gs-utl-space-x-6"),l==="xl"&&(i?"gs-utl-space-y-8":"gs-utl-space-x-8"),u==="start"&&"gs-utl-items-start",u==="end"&&"gs-utl-items-end",u==="center"&&"gs-utl-items-center",c==="start"&&"gs-utl-justify-start",c==="end"&&"gs-utl-justify-end",c==="center"&&"gs-utl-justify-center",c==="between"&&"gs-utl-justify-between"]),...f,children:n})}),me=O.forwardRef(function({children:e,className:n,grow:r,...i},o){return R.jsx("div",{ref:o,className:xe([n,r&&"flex-1"]),...i,children:e})}),Yx=150,Ae={bgTr:"gs-utl-bg-transparent",txt:"gs-theme-cl-txt gs-utl-text-gray-900 dark:gs-utl-text-gray-400",txtLowEmphasis:"gs-utl-text-neutral-500 dark:gs-utl-text-neutral-500",txtHighEmphasis:"gs-utl-text-black dark:gs-utl-text-gray-200",txtHighEmphasisH:"hover:gs-utl-text-black hover:dark:gs-utl-text-gray-200",tA:"gs-theme-cl-tA gs-utl-text-violet-400",tAo:"gs-theme-cl-tAo gs-utl-text-violet-800 dark:gs-utl-text-violet-400",hTAo:"gs-theme-cl-hTAo hover:gs-utl-text-violet-800 hover:dark:gs-utl-text-violet-400",grouphTAo:"gs-theme-cl-grouphTAo group-hover:gs-utl-text-violet-800 group-hover:dark:gs-utl-text-violet-400",bA:"gs-theme-cl-bA gs-utl-border-violet-400",bgA:"gs-theme-cl-bgA gs-utl-bg-violet-400 gs-utl-text-white dark:gs-utl-bg-violet-500",bgA2:"gs-theme-cl-bgA2 gs-utl-bg-violet-500 gs-utl-text-white",bgO:"gs-theme-cl-bg0 gs-utl-bg-violet-50 gs-utl-text-violet-900 dark:gs-utl-bg-zinc-800 dark:gs-utl-text-violet-400",bg:"gs-theme-cl-bg gs-utl-bg-white dark:gs-utl-bg-zinc-900",bgBlur:"gs-utl-bg-white/50 dark:gs-utl-bg-zinc-900/50 gs-utl-backdrop-blur-sm",bgH:"gs-theme-cl-bgH gs-utl-bg-gray-100 dark:gs-utl-bg-zinc-700",bgH75:"gs-utl-bg-gray-100/75 dark:gs-utl-bg-zinc-700/75",hBgH:"gs-theme-cl-hBgH hover:gs-utl-bg-gray-50 hover:dark:gs-utl-bg-zinc-800",bgH2:"gs-theme-cl-bgH2 gs-utl-bg-gray-25 dark:gs-utl-bg-zinc-800",hBgH2:"gs-theme-cl-hBgH2 hover:gs-utl-bg-gray-25 hover:dark:gs-utl-bg-zinc-800",hBgAct:"gs-theme-cl-hBgAct hover:gs-utl-bg-violet-800 hover:dark:gs-utl-bg-violet-400",hBgA2:"gs-theme-cl-hBgA2 hover:gs-utl-bg-violet-500 hover:dark:gs-utl-bg-violet-600",hBgDark:"hover:gs-utl-bg-black/10",sel:"gs-theme-cl-sel gs-utl-bg-pink-200 gs-utl-text-pink-900",selBr:"gs-theme-cl-selBr gs-utl-border-pink-900",cmp:"gs-theme-cl-cmp gs-utl-bg-blue-450 gs-utl-text-white",cmpSymbol:"gs-theme-cl-cmpSymbol gs-utl-bg-[#7b61ff] gs-utl-text-white",cmpBgSoft:"gs-theme-cl-cmpBgSoft gs-utl-bg-blue-100 dark:gs-utl-bg-sky-800",cmpBgSymbolSoft:"gs-theme-cl-cmpBgSymbolSoft gs-utl-bg-violet-200 dark:gs-utl-bg-violet-800",cmpBgSoftX:"gs-theme-cl-cmpBgSoftX gs-utl-bg-blue-50 dark:gs-utl-bg-gray-800",cmpBgSymbolSoftX:"gs-theme-cl-cmpBgSymbolSoftX gs-utl-bg-[#edebff] dark:gs-utl-bg-[#2d1b4b]",cmpTxtActive:"gs-theme-cl-cmpTxtActive dark:gs-utl-text-gray-300",cmpBr:"gs-theme-cl-cmpBr gs-utl-border-blue-450",cmpSymbolBr:"gs-theme-cl-cmpSymbolBr gs-utl-border-[#7b61ff]",cmpTargetBg:"gs-utl-bg-amber-500 gs-utl-text-white",cmpTargetBgOpac:"gs-utl-bg-amber-500/5",cmpTargetBr:"gs-utl-border-amber-500",tW:"gs-utl-text-amber-500",bgW:"gs-utl-bg-amber-500",bgRed:"gs-utl-bg-red-500",hBgRed:"hover:gs-utl-bg-red-600",hBgW:"hover:gs-utl-bg-amber-600",br:"gs-theme-cl-br gs-utl-border-gray-300 dark:gs-utl-border-zinc-700",brRed:"gs-utl-border-red-500",brLight:"gs-utl-border-white/25"},Xx={enter:"gs-utl-transition gs-utl-duration-100 gs-utl-ease-out",enterFrom:"gs-utl-scale-95 gs-utl-opacity-0",enterTo:"gs-utl-opacity-100",leave:"gs-utl-transition gs-utl-ease-in gs-utl-duration-100",leaveFrom:"gs-utl-scale-100 gs-utl-opacity-100",leaveTo:"gs-utl-scale-95 gs-utl-opacity-0"},Qx={enter:"gs-utl-transition gs-utl-duration-100 gs-utl-ease-out",enterFrom:"gs-utl-opacity-0",enterTo:"gs-utl-opacity-100"},eS={leave:"gs-utl-transition gs-utl-ease-in gs-utl-duration-100",leaveFrom:"gs-utl-opacity-100",leaveTo:"gs-utl-opacity-0"},tS={...Qx,...eS},af={xy:"gs-utl-px-4 gs-utl-py-2",xyS:"gs-utl-px-2 gs-utl-py-1",xyS2:"gs-utl-px-2 gs-utl-py-0.5",x:"gs-utl-px-4",xS:"gs-utl-px-2",y:"gs-utl-py-2",s:"gs-utl-p-2"},nS={bg:Ae.bg,bgH:Ae.bgH},Ud={bg:"gs-utl-bg-zinc-700",txt:"gs-utl-text-white",block:"gs-utl-text-xs gs-utl-mt-1 gs-utl-bg-white/10 gs-utl-rounded gs-utl-px-2 gs-utl-py-1"},$t={rnd:"gs-utl-rounded",pill:"gs-utl-rounded-full",b:"gs-utl-border",bT:"gs-utl-border-transparent",bS:"gs-utl-border-2",bt:"gs-utl-border-t",bb:"gs-utl-border-b",br:"gs-utl-border-r",bl:"gs-utl-border-l",bA:"gs-theme-cl-bA gs-utl-border-violet-400 dark:gs-utl-border-violet-500"},rS={focus:"gs-theme-ring-focus focus:gs-utl-outline-none focus-visible:gs-utl-ring-2 gs-utl-ring-violet-300 gs-utl-ring-opacity-80",deepFocus:"focus:gs-utl-outline-none [&:has(:focus-visible)]:gs-utl-ring-2 gs-utl-ring-violet-300 gs-utl-ring-opacity-80"},qo={s3x:"13px",s2x:"14px",sx:"16px",s:"18px"},qd={click:"gs-utl-cursor-pointer gs-utl-transition-opacity gs-utl-opacity-75 hover:gs-utl-opacity-100",hover:"gs-utl-transition-opacity gs-utl-opacity-50 hover:gs-utl-opacity-100",hoverGroup:"group-hover:gs-utl-opacity-100 gs-utl-opacity-0 gs-utl-transition-opacity",dot:"gs-utl-w-[6px] gs-utl-h-[6px] gs-utl-rounded-full",scrollY:"gs-utl-overflow-y-auto gs-utl-overflow-x-hidden",txtEllips:"gs-utl-text-ellipsis gs-utl-overflow-hidden gs-utl-whitespace-nowrap",coverAbs:"gs-utl-absolute gs-utl-top-0 gs-utl-left-0 gs-utl-w-full gs-utl-h-full",disabled:"gs-utl-opacity-50 gs-utl-pointer-events-none",noFocusOut:"focus:gs-utl-outline-none",spin:"gs-utl-animate-spin-fast"},iS={link:xe(Ae.tAo),inputText:"gs-theme-elStyles-inputText focus:gs-utl-outline-none gs-utl-placeholder:text-neutral-400 placeholder:dark:gs-utl-text-neutral-500"},oS=({variant:t,size:e="m",className:n,active:r,border:i=!0,rounded:o=!0,disabled:s=!1,withBg:a,block:l,full:c})=>{const u=t==="pr",f=t==="out",d=t==="out-clear",p=t==="warn",h=t==="danger",m=i&&(f||d||!t);return["gs-utl-transition-colors gs-utl-cursor-pointer",l&&"block",e==="s"&&"gjs-p-1 text-sm",e==="m"&&"gjs-p-1 gjs-px-2",e==="m2"&&"gjs-p-1 gjs-px-3",e==="lg"&&"gjs-p-2 gjs-px-4 text-lg",n,o&&$t.rnd,m&&`${$t.b} ${Ae.br}`,a&&Ae.bg,m&&xe($t.b,f&&Ae.bA,f&&Ae.tAo,!s&&Ae.hBgH),p&&xe(Ae.bgW,Ae.hBgW,!s&&Ae.hBgW,"text-white"),h&&xe(Ae.bgRed,!s&&Ae.hBgRed,"text-white"),u&&xe(Ae.bgA2,!s&&Ae.hBgAct),r&&Ae.bgA,s&&"disabled:gs-utl-opacity-80 cursor-not-allowed",c&&"w-full",rS.focus]};function lf({children:t,...e}){const{variant:n,size:r,active:i,border:o,rounded:s,block:a,full:l,className:c,icon:u,loading:f,withBg:d,...p}=e,h=f?{icon:Iy,size:"18px",className:xe("animate-spin-fast")}:g1(u)?{icon:u,size:"18px"}:u;return R.jsx("button",{className:xe(oS(e)),disabled:e.disabled,...p,children:h?R.jsxs(Le,{className:xe("gap-2"),items:"center",nowrap:!0,children:[R.jsx(me,{children:R.jsx(ii,{...h})}),t&&R.jsx(me,{children:t})]}):t})}var sS=Object.defineProperty,aS=(t,e,n)=>e in t?sS(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ic=(t,e,n)=>(aS(t,typeof e!="symbol"?e+"":e,n),n);let lS=class{constructor(){ic(this,"current",this.detect()),ic(this,"handoffState","pending"),ic(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},fa=new lS,Go=(t,e)=>{fa.isServer?O.useEffect(t,e):O.useLayoutEffect(t,e)};function ji(t){let e=O.useRef(t);return Go(()=>{e.current=t},[t]),e}let $n=function(t){let e=ji(t);return O.useCallback((...n)=>e.current(...n),[e])};function cS(t){typeof queueMicrotask=="function"?queueMicrotask(t):Promise.resolve().then(t).catch(e=>setTimeout(()=>{throw e}))}function ds(){let t=[],e={addEventListener(n,r,i,o){return n.addEventListener(r,i,o),e.add(()=>n.removeEventListener(r,i,o))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return e.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return e.requestAnimationFrame(()=>e.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return e.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return cS(()=>{r.current&&n[0]()}),e.add(()=>{r.current=!1})},style(n,r,i){let o=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:i}),this.add(()=>{Object.assign(n.style,{[r]:o})})},group(n){let r=ds();return n(r),this.add(()=>r.dispose())},add(n){return t.push(n),()=>{let r=t.indexOf(n);if(r>=0)for(let i of t.splice(r,1))i()}},dispose(){for(let n of t.splice(0))n()}};return e}function Vm(){let[t]=O.useState(ds);return O.useEffect(()=>()=>t.dispose(),[t]),t}function uS(){let t=typeof document>"u";return"useSyncExternalStore"in Rt?(e=>e.useSyncExternalStore)(Rt)(()=>()=>{},()=>!1,()=>!t):!1}function Dm(){let t=uS(),[e,n]=Rt.useState(fa.isHandoffComplete);return e&&fa.isHandoffComplete===!1&&n(!1),Rt.useEffect(()=>{e!==!0&&n(!0)},[e]),Rt.useEffect(()=>fa.handoff(),[]),t?!1:e}function gn(t,e,...n){if(t in e){let i=e[t];return typeof i=="function"?i(...n):i}let r=new Error(`Tried to handle "${t}" but there is no handler defined. Only defined handlers are: ${Object.keys(e).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,gn),r}let fS=Symbol();function Lm(...t){let e=O.useRef(t);O.useEffect(()=>{e.current=t},[t]);let n=$n(r=>{for(let i of e.current)i!=null&&(typeof i=="function"?i(r):i.current=r)});return t.every(r=>r==null||(r==null?void 0:r[fS]))?void 0:n}function Va(...t){return Array.from(new Set(t.flatMap(e=>typeof e=="string"?e.split(" "):[]))).filter(Boolean).join(" ")}var jm=(t=>(t[t.None=0]="None",t[t.RenderStrategy=1]="RenderStrategy",t[t.Static=2]="Static",t))(jm||{}),ar=(t=>(t[t.Unmount=0]="Unmount",t[t.Hidden=1]="Hidden",t))(ar||{});function Hm({ourProps:t,theirProps:e,slot:n,defaultTag:r,features:i,visible:o=!0,name:s,mergeRefs:a}){a=a??dS;let l=Im(e,t);if(o)return zs(l,n,r,s,a);let c=i??0;if(c&2){let{static:u=!1,...f}=l;if(u)return zs(f,n,r,s,a)}if(c&1){let{unmount:u=!0,...f}=l;return gn(u?0:1,{0(){return null},1(){return zs({...f,hidden:!0,style:{display:"none"}},n,r,s,a)}})}return zs(l,n,r,s,a)}function zs(t,e={},n,r,i){let{as:o=n,children:s,refName:a="ref",...l}=oc(t,["unmount","static"]),c=t.ref!==void 0?{[a]:t.ref}:{},u=typeof s=="function"?s(e):s;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(e));let f={};if(e){let d=!1,p=[];for(let[h,m]of Object.entries(e))typeof m=="boolean"&&(d=!0),m===!0&&p.push(h);d&&(f["data-headlessui-state"]=p.join(" "))}if(o===O.Fragment&&Object.keys(Gd(l)).length>0){if(!O.isValidElement(u)||Array.isArray(u)&&u.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map(m=>` - ${m}`).join(`
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
`));let d=u.props,p=typeof(d==null?void 0:d.className)=="function"?(...m)=>Va(d==null?void 0:d.className(...m),l.className):Va(d==null?void 0:d.className,l.className),h=p?{className:p}:{};return O.cloneElement(u,Object.assign({},Im(u.props,Gd(oc(l,["ref"]))),f,c,{ref:i(u.ref,c.ref)},h))}return O.createElement(o,Object.assign({},oc(l,["ref"]),o!==O.Fragment&&c,o!==O.Fragment&&f),u)}function dS(...t){return t.every(e=>e==null)?void 0:e=>{for(let n of t)n!=null&&(typeof n=="function"?n(e):n.current=e)}}function Im(...t){if(t.length===0)return{};if(t.length===1)return t[0];let e={},n={};for(let r of t)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):e[i]=r[i];if(e.disabled||e["aria-disabled"])return Object.assign(e,Object.fromEntries(Object.keys(n).map(r=>[r,void 0])));for(let r in n)Object.assign(e,{[r](i,...o){let s=n[r];for(let a of s){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;a(i,...o)}}});return e}function cf(t){var e;return Object.assign(O.forwardRef(t),{displayName:(e=t.displayName)!=null?e:t.name})}function Gd(t){let e=Object.assign({},t);for(let n in e)e[n]===void 0&&delete e[n];return e}function oc(t,e=[]){let n=Object.assign({},t);for(let r of e)r in n&&delete n[r];return n}let uf=O.createContext(null);uf.displayName="OpenClosedContext";var Ln=(t=>(t[t.Open=1]="Open",t[t.Closed=2]="Closed",t[t.Closing=4]="Closing",t[t.Opening=8]="Opening",t))(Ln||{});function Bm(){return O.useContext(uf)}function pS({value:t,children:e}){return O.createElement(uf.Provider,{value:t},e)}function ff(){let t=O.useRef(!1);return Go(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function hS(t=0){let[e,n]=O.useState(t),r=ff(),i=O.useCallback(l=>{r.current&&n(c=>c|l)},[e,r]),o=O.useCallback(l=>!!(e&l),[e]),s=O.useCallback(l=>{r.current&&n(c=>c&~l)},[n,r]),a=O.useCallback(l=>{r.current&&n(c=>c^l)},[n]);return{flags:e,addFlag:i,hasFlag:o,removeFlag:s,toggleFlag:a}}function mS(t){let e={called:!1};return(...n)=>{if(!e.called)return e.called=!0,t(...n)}}function sc(t,...e){t&&e.length>0&&t.classList.add(...e)}function ac(t,...e){t&&e.length>0&&t.classList.remove(...e)}function gS(t,e){let n=ds();if(!t)return n.dispose;let{transitionDuration:r,transitionDelay:i}=getComputedStyle(t),[o,s]=[r,i].map(l=>{let[c=0]=l.split(",").filter(Boolean).map(u=>u.includes("ms")?parseFloat(u):parseFloat(u)*1e3).sort((u,f)=>f-u);return c}),a=o+s;if(a!==0){n.group(c=>{c.setTimeout(()=>{e(),c.dispose()},a),c.addEventListener(t,"transitionrun",u=>{u.target===u.currentTarget&&c.dispose()})});let l=n.addEventListener(t,"transitionend",c=>{c.target===c.currentTarget&&(e(),l())})}else e();return n.add(()=>e()),n.dispose}function bS(t,e,n,r){let i=n?"enter":"leave",o=ds(),s=r!==void 0?mS(r):()=>{};i==="enter"&&(t.removeAttribute("hidden"),t.style.display="");let a=gn(i,{enter:()=>e.enter,leave:()=>e.leave}),l=gn(i,{enter:()=>e.enterTo,leave:()=>e.leaveTo}),c=gn(i,{enter:()=>e.enterFrom,leave:()=>e.leaveFrom});return ac(t,...e.base,...e.enter,...e.enterTo,...e.enterFrom,...e.leave,...e.leaveFrom,...e.leaveTo,...e.entered),sc(t,...e.base,...a,...c),o.nextFrame(()=>{ac(t,...e.base,...a,...c),sc(t,...e.base,...a,...l),gS(t,()=>(ac(t,...e.base,...a),sc(t,...e.base,...e.entered),s()))}),o.dispose}function vS({immediate:t,container:e,direction:n,classes:r,onStart:i,onStop:o}){let s=ff(),a=Vm(),l=ji(n);Go(()=>{t&&(l.current="enter")},[t]),Go(()=>{let c=ds();a.add(c.dispose);let u=e.current;if(u&&l.current!=="idle"&&s.current)return c.dispose(),i.current(l.current),c.add(bS(u,r.current,l.current==="enter",()=>{c.dispose(),o.current(l.current)})),c.dispose},[n])}function Xn(t=""){return t.split(/\s+/).filter(e=>e.length>1)}let gl=O.createContext(null);gl.displayName="TransitionContext";var yS=(t=>(t.Visible="visible",t.Hidden="hidden",t))(yS||{});function wS(){let t=O.useContext(gl);if(t===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return t}function xS(){let t=O.useContext(bl);if(t===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return t}let bl=O.createContext(null);bl.displayName="NestingContext";function vl(t){return"children"in t?vl(t.children):t.current.filter(({el:e})=>e.current!==null).filter(({state:e})=>e==="visible").length>0}function $m(t,e){let n=ji(t),r=O.useRef([]),i=ff(),o=Vm(),s=$n((p,h=ar.Hidden)=>{let m=r.current.findIndex(({el:g})=>g===p);m!==-1&&(gn(h,{[ar.Unmount](){r.current.splice(m,1)},[ar.Hidden](){r.current[m].state="hidden"}}),o.microTask(()=>{var g;!vl(r)&&i.current&&((g=n.current)==null||g.call(n))}))}),a=$n(p=>{let h=r.current.find(({el:m})=>m===p);return h?h.state!=="visible"&&(h.state="visible"):r.current.push({el:p,state:"visible"}),()=>s(p,ar.Unmount)}),l=O.useRef([]),c=O.useRef(Promise.resolve()),u=O.useRef({enter:[],leave:[],idle:[]}),f=$n((p,h,m)=>{l.current.splice(0),e&&(e.chains.current[h]=e.chains.current[h].filter(([g])=>g!==p)),e==null||e.chains.current[h].push([p,new Promise(g=>{l.current.push(g)})]),e==null||e.chains.current[h].push([p,new Promise(g=>{Promise.all(u.current[h].map(([y,w])=>w)).then(()=>g())})]),h==="enter"?c.current=c.current.then(()=>e==null?void 0:e.wait.current).then(()=>m(h)):m(h)}),d=$n((p,h,m)=>{Promise.all(u.current[h].splice(0).map(([g,y])=>y)).then(()=>{var g;(g=l.current.shift())==null||g()}).then(()=>m(h))});return O.useMemo(()=>({children:r,register:a,unregister:s,onStart:f,onStop:d,wait:c,chains:u}),[a,s,r,f,d,u,c])}function SS(){}let CS=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Kd(t){var e;let n={};for(let r of CS)n[r]=(e=t[r])!=null?e:SS;return n}function OS(t){let e=O.useRef(Kd(t));return O.useEffect(()=>{e.current=Kd(t)},[t]),e}let ES="div",zm=jm.RenderStrategy;function _S(t,e){var n,r;let{beforeEnter:i,afterEnter:o,beforeLeave:s,afterLeave:a,enter:l,enterFrom:c,enterTo:u,entered:f,leave:d,leaveFrom:p,leaveTo:h,...m}=t,g=O.useRef(null),y=Lm(g,e),w=(n=m.unmount)==null||n?ar.Unmount:ar.Hidden,{show:x,appear:C,initial:v}=wS(),[E,A]=O.useState(x?"visible":"hidden"),B=xS(),{register:T,unregister:P}=B;O.useEffect(()=>T(g),[T,g]),O.useEffect(()=>{if(w===ar.Hidden&&g.current){if(x&&E!=="visible"){A("visible");return}return gn(E,{hidden:()=>P(g),visible:()=>T(g)})}},[E,g,T,P,x,w]);let I=ji({base:Xn(m.className),enter:Xn(l),enterFrom:Xn(c),enterTo:Xn(u),entered:Xn(f),leave:Xn(d),leaveFrom:Xn(p),leaveTo:Xn(h)}),z=OS({beforeEnter:i,afterEnter:o,beforeLeave:s,afterLeave:a}),K=Dm();O.useEffect(()=>{if(K&&E==="visible"&&g.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[g,E,K]);let te=v&&!C,H=C&&x&&v,Y=!K||te?"idle":x?"enter":"leave",re=hS(0),oe=$n(W=>gn(W,{enter:()=>{re.addFlag(Ln.Opening),z.current.beforeEnter()},leave:()=>{re.addFlag(Ln.Closing),z.current.beforeLeave()},idle:()=>{}})),he=$n(W=>gn(W,{enter:()=>{re.removeFlag(Ln.Opening),z.current.afterEnter()},leave:()=>{re.removeFlag(Ln.Closing),z.current.afterLeave()},idle:()=>{}})),pe=$m(()=>{A("hidden"),P(g)},B),_=O.useRef(!1);vS({immediate:H,container:g,classes:I,direction:Y,onStart:ji(W=>{_.current=!0,pe.onStart(g,W,oe)}),onStop:ji(W=>{_.current=!1,pe.onStop(g,W,he),W==="leave"&&!vl(pe)&&(A("hidden"),P(g))})});let N=m,G={ref:y};return H?N={...N,className:Va(m.className,...I.current.enter,...I.current.enterFrom)}:_.current&&(N.className=Va(m.className,(r=g.current)==null?void 0:r.className),N.className===""&&delete N.className),O.createElement(bl.Provider,{value:pe},O.createElement(pS,{value:gn(E,{visible:Ln.Open,hidden:Ln.Closed})|re.flags},Hm({ourProps:G,theirProps:N,defaultTag:ES,features:zm,visible:E==="visible",name:"Transition.Child"})))}function kS(t,e){let{show:n,appear:r=!1,unmount:i=!0,...o}=t,s=O.useRef(null),a=Lm(s,e);Dm();let l=Bm();if(n===void 0&&l!==null&&(n=(l&Ln.Open)===Ln.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,u]=O.useState(n?"visible":"hidden"),f=$m(()=>{u("hidden")}),[d,p]=O.useState(!0),h=O.useRef([n]);Go(()=>{d!==!1&&h.current[h.current.length-1]!==n&&(h.current.push(n),p(!1))},[h,n]);let m=O.useMemo(()=>({show:n,appear:r,initial:d}),[n,r,d]);O.useEffect(()=>{if(n)u("visible");else if(!vl(f))u("hidden");else{let x=s.current;if(!x)return;let C=x.getBoundingClientRect();C.x===0&&C.y===0&&C.width===0&&C.height===0&&u("hidden")}},[n,f]);let g={unmount:i},y=$n(()=>{var x;d&&p(!1),(x=t.beforeEnter)==null||x.call(t)}),w=$n(()=>{var x;d&&p(!1),(x=t.beforeLeave)==null||x.call(t)});return O.createElement(bl.Provider,{value:f},O.createElement(gl.Provider,{value:m},Hm({ourProps:{...g,as:O.Fragment,children:O.createElement(Fm,{ref:a,...g,...o,beforeEnter:y,beforeLeave:w})},theirProps:{},defaultTag:O.Fragment,features:zm,visible:c==="visible",name:"Transition"})))}function AS(t,e){let n=O.useContext(gl)!==null,r=Bm()!==null;return O.createElement(O.Fragment,null,!n&&r?O.createElement(du,{ref:e,...t}):O.createElement(Fm,{ref:e,...t}))}let du=cf(kS),Fm=cf(_S),TS=cf(AS),Wm=Object.assign(du,{Child:TS,Root:du});var Zd=function(e){return e.reduce(function(n,r){var i=r[0],o=r[1];return n[i]=o,n},{})},Jd=typeof window<"u"&&window.document&&window.document.createElement?Rt.useLayoutEffect:Rt.useEffect,pt="top",Ut="bottom",qt="right",ht="left",df="auto",ps=[pt,Ut,qt,ht],Zi="start",Ko="end",MS="clippingParents",Um="viewport",yo="popper",NS="reference",Yd=ps.reduce(function(t,e){return t.concat([e+"-"+Zi,e+"-"+Ko])},[]),qm=[].concat(ps,[df]).reduce(function(t,e){return t.concat([e,e+"-"+Zi,e+"-"+Ko])},[]),RS="beforeRead",PS="read",VS="afterRead",DS="beforeMain",LS="main",jS="afterMain",HS="beforeWrite",IS="write",BS="afterWrite",$S=[RS,PS,VS,DS,LS,jS,HS,IS,BS];function Cn(t){return t?(t.nodeName||"").toLowerCase():null}function kt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function ri(t){var e=kt(t).Element;return t instanceof e||t instanceof Element}function zt(t){var e=kt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function pf(t){if(typeof ShadowRoot>"u")return!1;var e=kt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function zS(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!zt(o)||!Cn(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function FS(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=s.reduce(function(l,c){return l[c]="",l},{});!zt(i)||!Cn(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const WS={name:"applyStyles",enabled:!0,phase:"write",fn:zS,effect:FS,requires:["computeStyles"]};function xn(t){return t.split("-")[0]}var Wr=Math.max,Da=Math.min,Ji=Math.round;function pu(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Gm(){return!/^((?!chrome|android).)*safari/i.test(pu())}function Yi(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&zt(t)&&(i=t.offsetWidth>0&&Ji(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Ji(r.height)/t.offsetHeight||1);var s=ri(t)?kt(t):window,a=s.visualViewport,l=!Gm()&&n,c=(r.left+(l&&a?a.offsetLeft:0))/i,u=(r.top+(l&&a?a.offsetTop:0))/o,f=r.width/i,d=r.height/o;return{width:f,height:d,top:u,right:c+f,bottom:u+d,left:c,x:c,y:u}}function hf(t){var e=Yi(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function Km(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&pf(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function qn(t){return kt(t).getComputedStyle(t)}function US(t){return["table","td","th"].indexOf(Cn(t))>=0}function Cr(t){return((ri(t)?t.ownerDocument:t.document)||window.document).documentElement}function yl(t){return Cn(t)==="html"?t:t.assignedSlot||t.parentNode||(pf(t)?t.host:null)||Cr(t)}function Xd(t){return!zt(t)||qn(t).position==="fixed"?null:t.offsetParent}function qS(t){var e=/firefox/i.test(pu()),n=/Trident/i.test(pu());if(n&&zt(t)){var r=qn(t);if(r.position==="fixed")return null}var i=yl(t);for(pf(i)&&(i=i.host);zt(i)&&["html","body"].indexOf(Cn(i))<0;){var o=qn(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function hs(t){for(var e=kt(t),n=Xd(t);n&&US(n)&&qn(n).position==="static";)n=Xd(n);return n&&(Cn(n)==="html"||Cn(n)==="body"&&qn(n).position==="static")?e:n||qS(t)||e}function mf(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Ro(t,e,n){return Wr(t,Da(e,n))}function GS(t,e,n){var r=Ro(t,e,n);return r>n?n:r}function Zm(){return{top:0,right:0,bottom:0,left:0}}function Jm(t){return Object.assign({},Zm(),t)}function Ym(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var KS=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,Jm(typeof e!="number"?e:Ym(e,ps))};function ZS(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=xn(n.placement),l=mf(a),c=[ht,qt].indexOf(a)>=0,u=c?"height":"width";if(!(!o||!s)){var f=KS(i.padding,n),d=hf(o),p=l==="y"?pt:ht,h=l==="y"?Ut:qt,m=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],g=s[l]-n.rects.reference[l],y=hs(o),w=y?l==="y"?y.clientHeight||0:y.clientWidth||0:0,x=m/2-g/2,C=f[p],v=w-d[u]-f[h],E=w/2-d[u]/2+x,A=Ro(C,E,v),B=l;n.modifiersData[r]=(e={},e[B]=A,e.centerOffset=A-E,e)}}function JS(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||Km(e.elements.popper,i)&&(e.elements.arrow=i))}const YS={name:"arrow",enabled:!0,phase:"main",fn:ZS,effect:JS,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Xi(t){return t.split("-")[1]}var XS={top:"auto",right:"auto",bottom:"auto",left:"auto"};function QS(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:Ji(n*i)/i||0,y:Ji(r*i)/i||0}}function Qd(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,f=t.isFixed,d=s.x,p=d===void 0?0:d,h=s.y,m=h===void 0?0:h,g=typeof u=="function"?u({x:p,y:m}):{x:p,y:m};p=g.x,m=g.y;var y=s.hasOwnProperty("x"),w=s.hasOwnProperty("y"),x=ht,C=pt,v=window;if(c){var E=hs(n),A="clientHeight",B="clientWidth";if(E===kt(n)&&(E=Cr(n),qn(E).position!=="static"&&a==="absolute"&&(A="scrollHeight",B="scrollWidth")),E=E,i===pt||(i===ht||i===qt)&&o===Ko){C=Ut;var T=f&&E===v&&v.visualViewport?v.visualViewport.height:E[A];m-=T-r.height,m*=l?1:-1}if(i===ht||(i===pt||i===Ut)&&o===Ko){x=qt;var P=f&&E===v&&v.visualViewport?v.visualViewport.width:E[B];p-=P-r.width,p*=l?1:-1}}var I=Object.assign({position:a},c&&XS),z=u===!0?QS({x:p,y:m},kt(n)):{x:p,y:m};if(p=z.x,m=z.y,l){var K;return Object.assign({},I,(K={},K[C]=w?"0":"",K[x]=y?"0":"",K.transform=(v.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",K))}return Object.assign({},I,(e={},e[C]=w?m+"px":"",e[x]=y?p+"px":"",e.transform="",e))}function eC(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:xn(e.placement),variation:Xi(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Qd(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Qd(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const tC={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:eC,data:{}};var Fs={passive:!0};function nC(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,a=s===void 0?!0:s,l=kt(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(u){u.addEventListener("scroll",n.update,Fs)}),a&&l.addEventListener("resize",n.update,Fs),function(){o&&c.forEach(function(u){u.removeEventListener("scroll",n.update,Fs)}),a&&l.removeEventListener("resize",n.update,Fs)}}const rC={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:nC,data:{}};var iC={left:"right",right:"left",bottom:"top",top:"bottom"};function da(t){return t.replace(/left|right|bottom|top/g,function(e){return iC[e]})}var oC={start:"end",end:"start"};function ep(t){return t.replace(/start|end/g,function(e){return oC[e]})}function gf(t){var e=kt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function bf(t){return Yi(Cr(t)).left+gf(t).scrollLeft}function sC(t,e){var n=kt(t),r=Cr(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;var c=Gm();(c||!c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a+bf(t),y:l}}function aC(t){var e,n=Cr(t),r=gf(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=Wr(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Wr(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+bf(t),l=-r.scrollTop;return qn(i||n).direction==="rtl"&&(a+=Wr(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function vf(t){var e=qn(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Xm(t){return["html","body","#document"].indexOf(Cn(t))>=0?t.ownerDocument.body:zt(t)&&vf(t)?t:Xm(yl(t))}function Po(t,e){var n;e===void 0&&(e=[]);var r=Xm(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=kt(r),s=i?[o].concat(o.visualViewport||[],vf(r)?r:[]):r,a=e.concat(s);return i?a:a.concat(Po(yl(s)))}function hu(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function lC(t,e){var n=Yi(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function tp(t,e,n){return e===Um?hu(sC(t,n)):ri(e)?lC(e,n):hu(aC(Cr(t)))}function cC(t){var e=Po(yl(t)),n=["absolute","fixed"].indexOf(qn(t).position)>=0,r=n&&zt(t)?hs(t):t;return ri(r)?e.filter(function(i){return ri(i)&&Km(i,r)&&Cn(i)!=="body"}):[]}function uC(t,e,n,r){var i=e==="clippingParents"?cC(t):[].concat(e),o=[].concat(i,[n]),s=o[0],a=o.reduce(function(l,c){var u=tp(t,c,r);return l.top=Wr(u.top,l.top),l.right=Da(u.right,l.right),l.bottom=Da(u.bottom,l.bottom),l.left=Wr(u.left,l.left),l},tp(t,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Qm(t){var e=t.reference,n=t.element,r=t.placement,i=r?xn(r):null,o=r?Xi(r):null,s=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(i){case pt:l={x:s,y:e.y-n.height};break;case Ut:l={x:s,y:e.y+e.height};break;case qt:l={x:e.x+e.width,y:a};break;case ht:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var c=i?mf(i):null;if(c!=null){var u=c==="y"?"height":"width";switch(o){case Zi:l[c]=l[c]-(e[u]/2-n[u]/2);break;case Ko:l[c]=l[c]+(e[u]/2-n[u]/2);break}}return l}function Zo(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,a=n.boundary,l=a===void 0?MS:a,c=n.rootBoundary,u=c===void 0?Um:c,f=n.elementContext,d=f===void 0?yo:f,p=n.altBoundary,h=p===void 0?!1:p,m=n.padding,g=m===void 0?0:m,y=Jm(typeof g!="number"?g:Ym(g,ps)),w=d===yo?NS:yo,x=t.rects.popper,C=t.elements[h?w:d],v=uC(ri(C)?C:C.contextElement||Cr(t.elements.popper),l,u,s),E=Yi(t.elements.reference),A=Qm({reference:E,element:x,strategy:"absolute",placement:i}),B=hu(Object.assign({},x,A)),T=d===yo?B:E,P={top:v.top-T.top+y.top,bottom:T.bottom-v.bottom+y.bottom,left:v.left-T.left+y.left,right:T.right-v.right+y.right},I=t.modifiersData.offset;if(d===yo&&I){var z=I[i];Object.keys(P).forEach(function(K){var te=[qt,Ut].indexOf(K)>=0?1:-1,H=[pt,Ut].indexOf(K)>=0?"y":"x";P[K]+=z[H]*te})}return P}function fC(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?qm:l,u=Xi(r),f=u?a?Yd:Yd.filter(function(h){return Xi(h)===u}):ps,d=f.filter(function(h){return c.indexOf(h)>=0});d.length===0&&(d=f);var p=d.reduce(function(h,m){return h[m]=Zo(t,{placement:m,boundary:i,rootBoundary:o,padding:s})[xn(m)],h},{});return Object.keys(p).sort(function(h,m){return p[h]-p[m]})}function dC(t){if(xn(t)===df)return[];var e=da(t);return[ep(t),e,ep(e)]}function pC(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,f=n.rootBoundary,d=n.altBoundary,p=n.flipVariations,h=p===void 0?!0:p,m=n.allowedAutoPlacements,g=e.options.placement,y=xn(g),w=y===g,x=l||(w||!h?[da(g)]:dC(g)),C=[g].concat(x).reduce(function(W,U){return W.concat(xn(U)===df?fC(e,{placement:U,boundary:u,rootBoundary:f,padding:c,flipVariations:h,allowedAutoPlacements:m}):U)},[]),v=e.rects.reference,E=e.rects.popper,A=new Map,B=!0,T=C[0],P=0;P<C.length;P++){var I=C[P],z=xn(I),K=Xi(I)===Zi,te=[pt,Ut].indexOf(z)>=0,H=te?"width":"height",Y=Zo(e,{placement:I,boundary:u,rootBoundary:f,altBoundary:d,padding:c}),re=te?K?qt:ht:K?Ut:pt;v[H]>E[H]&&(re=da(re));var oe=da(re),he=[];if(o&&he.push(Y[z]<=0),a&&he.push(Y[re]<=0,Y[oe]<=0),he.every(function(W){return W})){T=I,B=!1;break}A.set(I,he)}if(B)for(var pe=h?3:1,_=function(U){var se=C.find(function(Z){var Q=A.get(Z);if(Q)return Q.slice(0,U).every(function(ie){return ie})});if(se)return T=se,"break"},N=pe;N>0;N--){var G=_(N);if(G==="break")break}e.placement!==T&&(e.modifiersData[r]._skip=!0,e.placement=T,e.reset=!0)}}const hC={name:"flip",enabled:!0,phase:"main",fn:pC,requiresIfExists:["offset"],data:{_skip:!1}};function np(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function rp(t){return[pt,qt,Ut,ht].some(function(e){return t[e]>=0})}function mC(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=Zo(e,{elementContext:"reference"}),a=Zo(e,{altBoundary:!0}),l=np(s,r),c=np(a,i,o),u=rp(l),f=rp(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const gC={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:mC};function bC(t,e,n){var r=xn(t),i=[ht,pt].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[ht,qt].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function vC(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=qm.reduce(function(u,f){return u[f]=bC(f,e.rects,o),u},{}),a=s[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}const yC={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:vC};function wC(t){var e=t.state,n=t.name;e.modifiersData[n]=Qm({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const xC={name:"popperOffsets",enabled:!0,phase:"read",fn:wC,data:{}};function SC(t){return t==="x"?"y":"x"}function CC(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,f=n.padding,d=n.tether,p=d===void 0?!0:d,h=n.tetherOffset,m=h===void 0?0:h,g=Zo(e,{boundary:l,rootBoundary:c,padding:f,altBoundary:u}),y=xn(e.placement),w=Xi(e.placement),x=!w,C=mf(y),v=SC(C),E=e.modifiersData.popperOffsets,A=e.rects.reference,B=e.rects.popper,T=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,P=typeof T=="number"?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),I=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,z={x:0,y:0};if(E){if(o){var K,te=C==="y"?pt:ht,H=C==="y"?Ut:qt,Y=C==="y"?"height":"width",re=E[C],oe=re+g[te],he=re-g[H],pe=p?-B[Y]/2:0,_=w===Zi?A[Y]:B[Y],N=w===Zi?-B[Y]:-A[Y],G=e.elements.arrow,W=p&&G?hf(G):{width:0,height:0},U=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Zm(),se=U[te],Z=U[H],Q=Ro(0,A[Y],W[Y]),ie=x?A[Y]/2-pe-Q-se-P.mainAxis:_-Q-se-P.mainAxis,ue=x?-A[Y]/2+pe+Q+Z+P.mainAxis:N+Q+Z+P.mainAxis,ae=e.elements.arrow&&hs(e.elements.arrow),ke=ae?C==="y"?ae.clientTop||0:ae.clientLeft||0:0,$=(K=I==null?void 0:I[C])!=null?K:0,Re=re+ie-$-ke,Xe=re+ue-$,We=Ro(p?Da(oe,Re):oe,re,p?Wr(he,Xe):he);E[C]=We,z[C]=We-re}if(a){var ct,ln=C==="x"?pt:ht,Tt=C==="x"?Ut:qt,Te=E[v],De=v==="y"?"height":"width",Zn=Te+g[ln],Jn=Te-g[Tt],kr=[pt,ht].indexOf(y)!==-1,Ar=(ct=I==null?void 0:I[v])!=null?ct:0,Yn=kr?Zn:Te-A[De]-B[De]-Ar+P.altAxis,Gt=kr?Te+A[De]+B[De]-Ar-P.altAxis:Jn,cn=p&&kr?GS(Yn,Te,Gt):Ro(p?Yn:Zn,Te,p?Gt:Jn);E[v]=cn,z[v]=cn-Te}e.modifiersData[r]=z}}const OC={name:"preventOverflow",enabled:!0,phase:"main",fn:CC,requiresIfExists:["offset"]};function EC(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function _C(t){return t===kt(t)||!zt(t)?gf(t):EC(t)}function kC(t){var e=t.getBoundingClientRect(),n=Ji(e.width)/t.offsetWidth||1,r=Ji(e.height)/t.offsetHeight||1;return n!==1||r!==1}function AC(t,e,n){n===void 0&&(n=!1);var r=zt(e),i=zt(e)&&kC(e),o=Cr(e),s=Yi(t,i,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Cn(e)!=="body"||vf(o))&&(a=_C(e)),zt(e)?(l=Yi(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=bf(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function TC(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&i(l)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function MC(t){var e=TC(t);return $S.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function NC(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function RC(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var ip={placement:"bottom",modifiers:[],strategy:"absolute"};function op(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function PC(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,o=i===void 0?ip:i;return function(a,l,c){c===void 0&&(c=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},ip,o),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},f=[],d=!1,p={state:u,setOptions:function(y){var w=typeof y=="function"?y(u.options):y;m(),u.options=Object.assign({},o,u.options,w),u.scrollParents={reference:ri(a)?Po(a):a.contextElement?Po(a.contextElement):[],popper:Po(l)};var x=MC(RC([].concat(r,u.options.modifiers)));return u.orderedModifiers=x.filter(function(C){return C.enabled}),h(),p.update()},forceUpdate:function(){if(!d){var y=u.elements,w=y.reference,x=y.popper;if(op(w,x)){u.rects={reference:AC(w,hs(x),u.options.strategy==="fixed"),popper:hf(x)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(P){return u.modifiersData[P.name]=Object.assign({},P.data)});for(var C=0;C<u.orderedModifiers.length;C++){if(u.reset===!0){u.reset=!1,C=-1;continue}var v=u.orderedModifiers[C],E=v.fn,A=v.options,B=A===void 0?{}:A,T=v.name;typeof E=="function"&&(u=E({state:u,options:B,name:T,instance:p})||u)}}}},update:NC(function(){return new Promise(function(g){p.forceUpdate(),g(u)})}),destroy:function(){m(),d=!0}};if(!op(a,l))return p;p.setOptions(c).then(function(g){!d&&c.onFirstUpdate&&c.onFirstUpdate(g)});function h(){u.orderedModifiers.forEach(function(g){var y=g.name,w=g.options,x=w===void 0?{}:w,C=g.effect;if(typeof C=="function"){var v=C({state:u,name:y,instance:p,options:x}),E=function(){};f.push(v||E)}})}function m(){f.forEach(function(g){return g()}),f=[]}return p}}var VC=[rC,xC,tC,WS,yC,hC,OC,YS,gC],DC=PC({defaultModifiers:VC}),LC=typeof Element<"u",jC=typeof Map=="function",HC=typeof Set=="function",IC=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function pa(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var n,r,i;if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(!pa(t[r],e[r]))return!1;return!0}var o;if(jC&&t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(o=t.entries();!(r=o.next()).done;)if(!e.has(r.value[0]))return!1;for(o=t.entries();!(r=o.next()).done;)if(!pa(r.value[1],e.get(r.value[0])))return!1;return!0}if(HC&&t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(o=t.entries();!(r=o.next()).done;)if(!e.has(r.value[0]))return!1;return!0}if(IC&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(t[r]!==e[r])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf&&typeof t.valueOf=="function"&&typeof e.valueOf=="function")return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString&&typeof t.toString=="function"&&typeof e.toString=="function")return t.toString()===e.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[r]))return!1;if(LC&&t instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&t.$$typeof)&&!pa(t[i[r]],e[i[r]]))return!1;return!0}return t!==t&&e!==e}var BC=function(e,n){try{return pa(e,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const $C=Gu(BC);var zC=[],eg=function(e,n,r){r===void 0&&(r={});var i=Rt.useRef(null),o={onFirstUpdate:r.onFirstUpdate,placement:r.placement||"bottom",strategy:r.strategy||"absolute",modifiers:r.modifiers||zC},s=Rt.useState({styles:{popper:{position:o.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),a=s[0],l=s[1],c=Rt.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(p){var h=p.state,m=Object.keys(h.elements);gb.flushSync(function(){l({styles:Zd(m.map(function(g){return[g,h.styles[g]||{}]})),attributes:Zd(m.map(function(g){return[g,h.attributes[g]]}))})})},requires:["computeStyles"]}},[]),u=Rt.useMemo(function(){var d={onFirstUpdate:o.onFirstUpdate,placement:o.placement,strategy:o.strategy,modifiers:[].concat(o.modifiers,[c,{name:"applyStyles",enabled:!1}])};return $C(i.current,d)?i.current||d:(i.current=d,d)},[o.onFirstUpdate,o.placement,o.strategy,o.modifiers,c]),f=Rt.useRef();return Jd(function(){f.current&&f.current.setOptions(u)},[u]),Jd(function(){if(!(e==null||n==null)){var d=r.createPopper||DC,p=d(e,n,u);return f.current=p,function(){p.destroy(),f.current=null}}},[e,n,r.createPopper]),{state:f.current?f.current.state:null,styles:a.styles,attributes:a.attributes,update:f.current?f.current.update:null,forceUpdate:f.current?f.current.forceUpdate:null}};const tg=t=>typeof t<"u";var mu=(t=>(t.web="web",t.email="email",t))(mu||{});const yf=O.forwardRef(function({children:e,title:n,onClose:r,icon:i,shadow:o=!0,padding:s=!0,border:a=!0,round:l=!0,className:c,classNameBody:u,size:f="m",titleClass:d=xe("gs-utl-mb-2 gs-utl-mt-0.5"),style:p,bg:h,...m},g){return R.jsxs("div",{...m,ref:g,style:p,className:xe([c,h||nS.bg,$t.b,l&&$t.rnd,a?Ae.br:$t.bT,"gs-utl-card gs-utl-overflow-auto",o&&"gs-utl-shadow-md",s&&f==="l"&&"gs-utl-p-5",s&&f==="m"&&"gs-utl-px-4 gs-utl-py-2",s&&f==="s"&&"gs-utl-px-2 gs-utl-py-1",s&&f==="xs"&&"gs-utl-px-2 gs-utl-py-0.5",s&&f==="x2s"&&"gs-utl-px-0.5"]),children:[(n||r)&&n!==!1&&R.jsxs(Le,{className:xe("gs-utl-card-title",d),items:"center",children:[R.jsx(me,{className:xe("truncate"),grow:!0,children:n}),(r||i)&&R.jsx(me,{onClick:r,className:xe("cursor-pointer transition-opacity opacity-50 hover:gs-utl-opacity-100"),children:R.jsx(ii,{icon:i||Bn.close,size:"18px"})})]}),R.jsx("div",{className:xe("gs-utl-card-body",u),children:e})]})}),FC=()=>gs().contextMenu;var WC={},lc=tl;WC.NODE_ENV==="production"?(lc.createRoot,lc.hydrateRoot):lc.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function UC({action:t,icon:e,label:n,className:r,items:i,...o}){const s=O.useRef(null),[a,l]=O.useState(),c=s.current,u=xe([r,"gs-utl-last:border-b-0 gs-utl-gap-2 gs-utl-select-none",Ae.br,af.xy,$t.bb,o.disabled&&qd.disabled,...t?[Ae.hBgH,"gs-utl-cursor-pointer"]:["gs-utl-cursor-default"]]),f=p=>zi(t)&&t({event:p});O.useEffect(()=>{if(!c)return;const p=setTimeout(()=>l(c.getBoundingClientRect()),o.active?0:Yx);return()=>clearTimeout(p)},[c,o.active]);const d=()=>{var p;return(p=o.onActive)==null?void 0:p.call(o)};return R.jsxs(Le,{ref:s,items:"center",nowrap:!0,className:u,onClick:f,onPointerEnter:d,children:[e&&R.jsx(me,{children:R.jsx(ii,{icon:e,size:qo.s})}),R.jsx(me,{className:xe(o.classNameLabel,qd.txtEllips),grow:!0,children:n}),!!(i!=null&&i.length)&&R.jsxs(R.Fragment,{children:[R.jsx(me,{children:R.jsx(ii,{icon:Bn.chevronRight,size:qo.s,className:xe("-gs-utl-mr-2")})}),a&&o.active&&R.jsx(KC,{items:i,x:a.left,y:a.top,w:a.width,h:a.height,open:!0})]})]})}function La({className:t,as:e="label",bold:n,m:r="gjs-mb-1",size:i="m",capitalize:o=!0,children:s,tip:a,...l}){const c=e;return R.jsxs(c,{className:xe(t,r,a?"gs-utl-flex gs-utl-gap-2 gs-utl-items-center":"block",o&&"capitalize",n&&"font-semibold",i==="s"&&"text-sm"),...l,children:[!!a&&R.jsx(rg,{classNameWrp:"gs-utl-normal-case",classNameContent:"gs-utl-max-w-60",title:a,children:R.jsx(ii,{icon:Bn.information,size:qo.s2x})}),s]})}xe("cursor-default select-none focus:gs-utl-outline-none","z-20 max-h-full");const qC={strategy:"fixed",placement:"bottom",modifiers:[{name:"offset",options:{offset:[0,5]}},{name:"flip",options:{fallbackPlacements:["top"]}}]},sp=p1()&&document.body,ng=(t={})=>({...qC,placement:"right-start",modifiers:[{name:"offset",options:{offset:t.offset||[0,5]}},{name:"flip",options:{boundary:t.boundary??sp}},{name:"preventOverflow",options:{boundary:t.boundary??sp}}]}),GC=ng(),Ws="gs-ctx-menu-list",KC=fs(function({open:e,items:n,x:r,y:i,w:o,h:s}){const a=FC(),[l,c]=O.useState(),[u,f]=O.useState(null),d=O.useMemo(()=>({getBoundingClientRect:()=>new DOMRect(r,i,o,s)}),[r,i,o,s,e]),{styles:p,attributes:h}=eg(d,u,GC),m=_i(`${Ws}-wrp gs-utl-z-20`),g=_i(`${Ws} gs-utl-z-20`),y=_i(`${Ws}-body gs-utl-max-w-56`),w=_i(`${Ws}-item`),x="gs-utl-max-w-40",C=v=>{const{action:E,onClick:A}=v;if(E||A)return B=>{const T={editor:a.store.appEditorStore.editor,...B};zi(E)?(E(T),a.hide()):zi(A)&&(A(T),a.hide())}};return R.jsx("div",{className:m,ref:f,style:p.popper,...h.popper,children:R.jsx(Wm,{show:!!e,...tS,unmount:!1,children:R.jsx(yf,{padding:!1,className:g,classNameBody:y,children:n.map((v,E)=>O.createElement(UC,{...v,key:v.id??E,className:w,classNameLabel:x,action:C(v),onActive:()=>c(v),active:l===v}))})})})}),cc="gs-cmp-tooltip";function rg({className:t,classNameWrp:e,classNameContent:n,children:r,title:i,onClick:o,inline:s,size:a}){const[l,c]=O.useState(!1),[u,f]=O.useState(!1),d=tg(a),[p,h]=O.useState(null),[m,g]=O.useState(null),y=eg(p,m,{...ng(),placement:"bottom"}),w=xe(`${cc}-target`,!s&&"block",t,!o&&"cursor-auto"),x=xe(`${cc}-content`,n,"fixed z-30 text-sm",!d&&!n&&"whitespace-nowrap",a==="s"&&"w-60");return O.useEffect(()=>{var C;l&&((C=y.update)==null||C.call(y))},[l,y.update]),O.useEffect(()=>{const C=setTimeout(()=>c(u),10);return()=>clearTimeout(C)},[u]),R.jsxs("div",{className:xe(cc,"relative",e),children:[R.jsx("span",{ref:h,className:w,onMouseEnter:()=>i&&f(!0),onMouseLeave:()=>f(!1),children:R.jsx("div",{className:xe(s&&"inline-block"),onClick:()=>{f(!1),o==null||o()},children:r})}),!!u&&R.jsx("div",{className:x,ref:g,style:y.styles.popper,...y.attributes.popper,children:R.jsx(Wm,{show:!!l,unmount:!1,...Xx,children:R.jsx(yf,{className:xe(Ud.txt),bg:Ud.bg,size:"s",border:!1,children:i})})})]})}function ZC({children:t,title:e,classNameWrp:n,...r}){return R.jsx(rg,{title:e,classNameWrp:n,children:R.jsx(lf,{...r,children:t})})}const JC={info:Ae.bgA,error:"bg-red-500",success:"bg-green-500",warning:"bg-orange-400"},YC=O.forwardRef(function(e,n){const r={info:Bn.informationVariant,error:Bn.fire,success:Bn.checkBold,warning:Bn.alertRhombus},{children:i,className:o,content:s,id:a,buttons:l=[],variant:c="info",autoHideTimeout:u=3e3}=e,f=O.useRef(null),d=O.useRef(),p=r[c],h=JC[c];O.useImperativeHandle(n,()=>f.current,[]);const m=()=>{var x;return(x=e.onDismiss)==null?void 0:x.call(e,a)},g=()=>{u&&(d.current=setTimeout(m,u))},y=()=>d.current&&clearTimeout(d.current);O.useEffect(()=>(g(),y),[]);const w=s||i;return R.jsx(yf,{className:Ee(o,"overflow-hidden relative"),ref:f,onPointerEnter:y,onPointerLeave:g,children:R.jsxs(Le,{space:"m",items:"center",className:Ee(af.y),children:[R.jsx(me,{className:Ee(h,$t.pill,"text-white gjs-p-1"),children:R.jsx(ii,{icon:p,size:qo.s})}),R.jsx(me,{grow:!0,className:Ee("gjs-pr-3"),children:R.jsxs(Le,{col:!0,space:"xs",children:[R.jsx(me,{className:Ee("text-lg font-medium leading-6"),children:e.header}),w&&R.jsx(me,{className:Ee(Ae.txtLowEmphasis),children:w}),!!l.length&&R.jsx(Le,{space:"m",justify:"end",children:l.map(({id:x,...C})=>R.jsx(lf,{...C},x))})]})}),R.jsx(me,{className:Ee("absolute top-1 right-1"),children:R.jsx(ZC,{onClick:m,border:!1,children:R.jsx(ii,{icon:Bn.close,size:qo.s})})})]})})});fs(O.forwardRef(function({className:e,toasts:n,onDismiss:r,...i},o){const s=Jx({});return R.jsx("div",{className:Ee(e,"w-80 gs-utl-z-30"),...i,ref:s,children:n.map(a=>R.jsx(YC,{...a,className:Ee("gjs-mb-2"),onDismiss:r},a.uuid||a.id))})}));const ap=new Map,XC=O.forwardRef(function({svg:e,iconSize:n,...r},i){let o=ap.get(e);return o||(o=yb(e,n),ap.set(e,o)),R.jsx("div",{...r,ref:i,dangerouslySetInnerHTML:{__html:o}})}),QC=t=>t.replace(/[^a-z0-9.]/gi,"_").toLowerCase(),lp=(t,e,n="html")=>{const{Pages:r}=t,i=ja({page:e,key:"slug"});return`${r.getMain()===e?"index":Eb(i||e.getName())}.${n}`},e5="custom-html-body",cp="data-custom-html-body",je={title:({cmp:t})=>t.tagName==="title",favicon:({cmp:t})=>{var e;return t.tagName==="link"&&((e=t.attributes.attributes)==null?void 0:e.rel)==="icon"},description:({cmp:t})=>{var e;return t.tagName==="meta"&&((e=t.attributes.attributes)==null?void 0:e.name)==="description"},keywords:({cmp:t})=>{var e;return t.tagName==="meta"&&((e=t.attributes.attributes)==null?void 0:e.name)==="keywords"},socialTitle:({cmp:t})=>{var e;return t.tagName==="meta"&&((e=t.attributes.attributes)==null?void 0:e.property)==="og:title"},socialImage:({cmp:t})=>{var e;return t.tagName==="meta"&&((e=t.attributes.attributes)==null?void 0:e.property)==="og:image"},socialDescription:({cmp:t})=>{var e;return t.tagName==="meta"&&((e=t.attributes.attributes)==null?void 0:e.property)==="og:description"},charset:({cmp:t})=>{var e;return t.tagName==="meta"&&((e=t.attributes.attributes)==null?void 0:e.charset)},viewport:({cmp:t})=>{var e;return t.tagName==="meta"&&((e=t.attributes.attributes)==null?void 0:e.name)==="viewport"},robots:({cmp:t})=>{var e;return t.tagName==="meta"&&((e=t.attributes.attributes)==null?void 0:e.name)==="robots"},generator:({cmp:t})=>{var e;return t.tagName==="meta"&&((e=t.attributes.attributes)==null?void 0:e.name)==="generator"}},t5=t=>{for(const e in je){const n=e;if(je[n]({cmp:t}))return n}},n5=(t,e,n)=>{const r=[];let i=n;return t.getMainComponent().findType(e5).forEach(o=>{r.push(o),i=(i||"")+o.getInnerHTML()}),{components:r,html:i,changed:i!==e}},r5=t=>{const e={...t.get("settings")??{}},n=t.getMainComponent(),{head:r}=n;if(r){const i=[];r.components().forEach(o=>{const{content:s,href:a}=o.getAttributes({noClass:!0,noStyle:!0});je.title({cmp:o})?e.title=o.getInnerHTML():je.favicon({cmp:o})?e.favicon=a:je.description({cmp:o})?e.description=s:je.keywords({cmp:o})?e.keywords=s:je.socialTitle({cmp:o})?e.socialTitle=s:je.socialDescription({cmp:o})?e.socialDescription=s:je.socialImage({cmp:o})?e.socialImage=s:t5(o)||i.push(o.toHTML())}),i.length&&(e.customCodeHead=i.join(`
|
|
219
|
-
|
|
220
|
-
|
|
133
|
+
*/return t.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=m,n=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function r(C){{for(var x=arguments.length,E=new Array(x>1?x-1:0),_=1;_<x;_++)E[_-1]=arguments[_];o("error",C,E)}}function o(C,x,E){{var _=n.ReactDebugCurrentFrame,M=_.getStackAddendum();M!==""&&(x+="%s",E=E.concat([M]));var k=E.map(function(j){return String(j)});k.unshift("Warning: "+x),Function.prototype.apply.call(console[C],console,k)}}function i(C,x){return C===x&&(C!==0||1/C===1/x)||C!==C&&x!==x}var s=typeof Object.is=="function"?Object.is:i,l=e.useState,a=e.useEffect,c=e.useLayoutEffect,u=e.useDebugValue,d=!1,f=!1;function p(C,x,E){d||e.startTransition!==void 0&&(d=!0,r("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var _=x();if(!f){var M=x();s(_,M)||(r("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var k=l({inst:{value:_,getSnapshot:x}}),j=k[0].inst,N=k[1];return c(function(){j.value=_,j.getSnapshot=x,g(j)&&N({inst:j})},[C,_,x]),a(function(){g(j)&&N({inst:j});var P=function(){g(j)&&N({inst:j})};return C(P)},[C]),u(_),_}function g(C){var x=C.getSnapshot,E=C.value;try{var _=x();return!s(E,_)}catch{return!0}}function b(C,x,E){return x()}var v=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",y=!v,w=y?b:p,S=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:w;Eu.useSyncExternalStore=S,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}(),Eu}var dC={};dC.NODE_ENV==="production"?ef.exports=cC():ef.exports=uC();var fC=ef.exports;function tg(t){t.reaction=new Br("observer".concat(t.name),function(){var e;t.stateVersion=Symbol(),(e=t.onStoreChange)===null||e===void 0||e.call(t)})}function pC(t,e){e===void 0&&(e="observed");var n=m.useRef(null);if(!n.current){var r={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:e,subscribe:function(l){return Qd.unregister(r),r.onStoreChange=l,r.reaction||(tg(r),r.stateVersion=Symbol()),function(){var a;r.onStoreChange=null,(a=r.reaction)===null||a===void 0||a.dispose(),r.reaction=null}},getSnapshot:function(){return r.stateVersion}};n.current=r}var o=n.current;o.reaction||(tg(o),Qd.register(n,o,o)),m.useDebugValue(o.reaction,oC),fC.useSyncExternalStore(o.subscribe,o.getSnapshot,o.getSnapshot);var i,s;if(o.reaction.track(function(){try{i=t()}catch(l){s=l}}),s)throw s;return i}var ng={},Ou,_u,rg=!0,mb=typeof Symbol=="function"&&Symbol.for,hC=(_u=(Ou=Object.getOwnPropertyDescriptor(function(){},"name"))===null||Ou===void 0?void 0:Ou.configurable)!==null&&_u!==void 0?_u:!1,og=mb?Symbol.for("react.forward_ref"):typeof m.forwardRef=="function"&&m.forwardRef(function(t){return null}).$$typeof,ig=mb?Symbol.for("react.memo"):typeof m.memo=="function"&&m.memo(function(t){return null}).$$typeof;function ms(t,e){var n;if(ng.NODE_ENV!=="production"&&rg&&e&&(rg=!1,console.warn("[mobx-react-lite] `observer(fn, { forwardRef: true })` is deprecated, use `observer(React.forwardRef(fn))`")),ig&&t.$$typeof===ig)throw new Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");var r=(n=void 0)!==null&&n!==void 0?n:!1,o=t,i=t.displayName||t.name;if(og&&t.$$typeof===og&&(r=!0,o=t.render,typeof o!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var s=function(l,a){return pC(function(){return o(l,a)},i)};return s.displayName=t.displayName,hC&&Object.defineProperty(s,"name",{value:t.name,writable:!0,configurable:!0}),t.contextTypes&&(s.contextTypes=t.contextTypes),r&&(s=m.forwardRef(s)),s=m.memo(s),mC(t,s),ng.NODE_ENV!=="production"&&Object.defineProperty(s,"contextTypes",{set:function(){var l,a;throw new Error("[mobx-react-lite] `".concat(this.displayName||((l=this.type)===null||l===void 0?void 0:l.displayName)||((a=this.type)===null||a===void 0?void 0:a.name)||"Component",".contextTypes` must be set before applying `observer`."))}}),s}var gC={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function mC(t,e){Object.keys(t).forEach(function(n){gC[n]||Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}var ku;rC(ir.unstable_batchedUpdates);ku=Qd.finalizeAllImmediately;const Re=B;function B(...t){return(Array.isArray(t[0])?t[0]:[...t]).filter(Boolean).flatMap(o=>typeof o=="string"?o.split(" ").map(i=>{if(i=i.replace(/gjs-/g,"gs-utl-"),!i.includes("gs-utl-")&&!i.startsWith("gs-")){const s=i.split(":"),l=s.pop(),a=s.join(":"),c=l==null?void 0:l.startsWith("!"),d=`gs-utl-${c?l==null?void 0:l.slice(1):l}`,f=c?`!${d}`:d;return a?`${a}:${f}`:f}return i}):o).join(" ")}var bC="M12 2C11.5 2 11 2.19 10.59 2.59L2.59 10.59C1.8 11.37 1.8 12.63 2.59 13.41L10.59 21.41C11.37 22.2 12.63 22.2 13.41 21.41L21.41 13.41C22.2 12.63 22.2 11.37 21.41 10.59L13.41 2.59C13 2.19 12.5 2 12 2M11 7H13V13H11V7M11 15H13V17H11V15Z",vC="M11 2H13V7H21V10H13V14H18V17H13V22H11V17H6V14H11V10H3V7H11V2Z",yC="M4 22H2V2H4V22M22 7H6V10H22V7M16 14H6V17H16V14Z",xC="M20 2H22V22H20V2M2 10H18V7H2V10M8 17H18V14H8V17Z",wC="M9.5,8.5L11,10L8,13L11,16L9.5,17.5L5,13L9.5,8.5M14.5,17.5L13,16L16,13L13,10L14.5,8.5L19,13L14.5,17.5M21,2H3A2,2 0 0,0 1,4V20A2,2 0 0,0 3,22H21A2,2 0 0,0 23,20V4A2,2 0 0,0 21,2M21,20H3V6H21V20Z",SC="M11,4H13V16L18.5,10.5L19.92,11.92L12,19.84L4.08,11.92L5.5,10.5L11,16V4Z",CC="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z",EC="M20 13.5C20 17.09 17.09 20 13.5 20H6V18H13.5C16 18 18 16 18 13.5S16 9 13.5 9H7.83L10.91 12.09L9.5 13.5L4 8L9.5 2.5L10.92 3.91L7.83 7H13.5C17.09 7 20 9.91 20 13.5Z",OC="M10.5 18H18V20H10.5C6.91 20 4 17.09 4 13.5S6.91 7 10.5 7H16.17L13.08 3.91L14.5 2.5L20 8L14.5 13.5L13.09 12.09L16.17 9H10.5C8 9 6 11 6 13.5S8 18 10.5 18Z",_C="M3,21V3H21V21H3M5,5V19H19V5H5Z",kC="M3 16C3 18.8 5.2 21 8 21H10V19H8C6.3 19 5 17.7 5 16V14H3V16M21 8C21 5.2 18.8 3 16 3H14V5H16C17.7 5 19 6.3 19 8V10H21V8M16 21C18.8 21 21 18.8 21 16V14H19V16C19 17.7 17.7 19 16 19H14V21H16M8 3C5.2 3 3 5.2 3 8V10H5V8C5 6.3 6.3 5 8 5H10V3H8Z",TC="M15,21H17V19H15M19,21H21V19H19M7,21H9V19H7M11,21H13V19H11M19,17H21V15H19M19,13H21V11H19M3,3V21H5V5H21V3M19,9H21V7H19",AC="M22,17H18V10H22M23,8H17A1,1 0 0,0 16,9V19A1,1 0 0,0 17,20H23A1,1 0 0,0 24,19V9A1,1 0 0,0 23,8M4,6H22V4H4A2,2 0 0,0 2,6V17H0V20H14V17H4V6Z",MC="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z",jC="M9,20.42L2.79,14.21L5.62,11.38L9,14.77L18.88,4.88L21.71,7.71L9,20.42Z",RC="M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z",NC="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z",PC="M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z",DC="M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z",LC="M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z",VC="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",IC="M8,3A2,2 0 0,0 6,5V9A2,2 0 0,1 4,11H3V13H4A2,2 0 0,1 6,15V19A2,2 0 0,0 8,21H10V19H8V14A2,2 0 0,0 6,12A2,2 0 0,0 8,10V5H10V3M16,3A2,2 0 0,1 18,5V9A2,2 0 0,0 20,11H21V13H20A2,2 0 0,0 18,15V19A2,2 0 0,1 16,21H14V19H16V14A2,2 0 0,1 18,12A2,2 0 0,1 16,10V5H14V3H16Z",$C="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z",HC="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z",BC="M15,9H5V5H15M12,19A3,3 0 0,1 9,16A3,3 0 0,1 12,13A3,3 0 0,1 15,16A3,3 0 0,1 12,19M17,3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V7L17,3Z",zC="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",FC="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",WC="M20,8L12,13L4,8V6L12,11L20,6M20,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V6C22,4.89 21.1,4 20,4Z",UC="M22 6C22 4.9 21.1 4 20 4H4C2.9 4 2 4.9 2 6V18C2 19.1 2.9 20 4 20H20C21.1 20 22 19.1 22 18V6M20 6L12 11L4 6H20M20 18H4V8L12 13L20 8V18Z",qC="M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z",GC="M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z",KC="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z",YC="M12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9M12,4.5C17,4.5 21.27,7.61 23,12C21.27,16.39 17,19.5 12,19.5C7,19.5 2.73,16.39 1,12C2.73,7.61 7,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C15.76,17.5 19.17,15.36 20.82,12C19.17,8.64 15.76,6.5 12,6.5C8.24,6.5 4.83,8.64 3.18,12Z",JC="M6.92,19L5,17.08L13.06,9L15,10.94M20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L13.84,6.41L11.91,4.5L10.5,5.91L11.92,7.33L3,16.25V21H7.75L16.67,12.08L18.09,13.5L19.5,12.09L17.58,10.17L20.7,7.05C21.1,6.65 21.1,6 20.71,5.63Z",ZC="M17.66 11.2C17.43 10.9 17.15 10.64 16.89 10.38C16.22 9.78 15.46 9.35 14.82 8.72C13.33 7.26 13 4.85 13.95 3C13 3.23 12.17 3.75 11.46 4.32C8.87 6.4 7.85 10.07 9.07 13.22C9.11 13.32 9.15 13.42 9.15 13.55C9.15 13.77 9 13.97 8.8 14.05C8.57 14.15 8.33 14.09 8.14 13.93C8.08 13.88 8.04 13.83 8 13.76C6.87 12.33 6.69 10.28 7.45 8.64C5.78 10 4.87 12.3 5 14.47C5.06 14.97 5.12 15.47 5.29 15.97C5.43 16.57 5.7 17.17 6 17.7C7.08 19.43 8.95 20.67 10.96 20.92C13.1 21.19 15.39 20.8 17.03 19.32C18.86 17.66 19.5 15 18.56 12.72L18.43 12.46C18.22 12 17.66 11.2 17.66 11.2M14.5 17.5C14.22 17.74 13.76 18 13.4 18.1C12.28 18.5 11.16 17.94 10.5 17.28C11.69 17 12.4 16.12 12.61 15.23C12.78 14.43 12.46 13.77 12.33 13C12.21 12.26 12.23 11.63 12.5 10.94C12.69 11.32 12.89 11.7 13.13 12C13.9 13 15.11 13.44 15.37 14.8C15.41 14.94 15.43 15.08 15.43 15.23C15.46 16.05 15.1 16.95 14.5 17.5H14.5Z",XC="M7,11H1V13H7V11M9.17,7.76L7.05,5.64L5.64,7.05L7.76,9.17L9.17,7.76M13,1H11V7H13V1M18.36,7.05L16.95,5.64L14.83,7.76L16.24,9.17L18.36,7.05M17,11V13H23V11H17M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M14.83,16.24L16.95,18.36L18.36,16.95L16.24,14.83L14.83,16.24M5.64,16.95L7.05,18.36L9.17,16.24L7.76,14.83L5.64,16.95M11,23H13V17H11V23Z",QC="M5,3A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5.5L18.5,3H17V9A1,1 0 0,1 16,10H8A1,1 0 0,1 7,9V3H5M12,4V9H15V4H12M7,12H17A1,1 0 0,1 18,13V19H6V13A1,1 0 0,1 7,12Z",eE="M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z",tE="M5,5H10V7H7V10H5V5M14,5H19V10H17V7H14V5M17,14H19V19H14V17H17V14M10,17V19H5V14H7V17H10Z",nE="M11,9H13V11H11V9M9,11H11V13H9V11M13,11H15V13H13V11M15,9H17V11H15V9M7,9H9V11H7V9M19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3M9,18H7V16H9V18M13,18H11V16H13V18M17,18H15V16H17V18M19,11H17V13H19V15H17V13H15V15H13V13H11V15H9V13H7V15H5V13H7V11H5V5H19V11Z",rE="M15.07,11.25L14.17,12.17C13.45,12.89 13,13.5 13,15H11V14.5C11,13.39 11.45,12.39 12.17,11.67L13.41,10.41C13.78,10.05 14,9.55 14,9C14,7.89 13.1,7 12,7A2,2 0 0,0 10,9H8A4,4 0 0,1 12,5A4,4 0 0,1 16,9C16,9.88 15.64,10.67 15.07,11.25M13,19H11V17H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z",oE="M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z",iE="M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",sE="M13.5,4A1.5,1.5 0 0,0 12,5.5A1.5,1.5 0 0,0 13.5,7A1.5,1.5 0 0,0 15,5.5A1.5,1.5 0 0,0 13.5,4M13.14,8.77C11.95,8.87 8.7,11.46 8.7,11.46C8.5,11.61 8.56,11.6 8.72,11.88C8.88,12.15 8.86,12.17 9.05,12.04C9.25,11.91 9.58,11.7 10.13,11.36C12.25,10 10.47,13.14 9.56,18.43C9.2,21.05 11.56,19.7 12.17,19.3C12.77,18.91 14.38,17.8 14.54,17.69C14.76,17.54 14.6,17.42 14.43,17.17C14.31,17 14.19,17.12 14.19,17.12C13.54,17.55 12.35,18.45 12.19,17.88C12,17.31 13.22,13.4 13.89,10.71C14,10.07 14.3,8.67 13.14,8.77Z",lE="M12,16L19.36,10.27L21,9L12,2L3,9L4.63,10.27M12,18.54L4.62,12.81L3,14.07L12,21.07L21,14.07L19.37,12.8L12,18.54Z",aE="M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z",cE="M12,4V2A10,10 0 0,0 2,12H4A8,8 0 0,1 12,4Z",uE="M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V10C4,8.89 4.9,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z",dE="M18 1C15.24 1 13 3.24 13 6V8H4C2.9 8 2 8.89 2 10V20C2 21.11 2.9 22 4 22H16C17.11 22 18 21.11 18 20V10C18 8.9 17.11 8 16 8H15V6C15 4.34 16.34 3 18 3C19.66 3 21 4.34 21 6V8H23V6C23 3.24 20.76 1 18 1M10 13C11.1 13 12 13.89 12 15C12 16.11 11.11 17 10 17C8.9 17 8 16.11 8 15C8 13.9 8.9 13 10 13Z",fE="M7,10L12,15L17,10H7Z",pE="M20 5L20 19L4 19L4 5H20M20 3H4C2.89 3 2 3.89 2 5V19C2 20.11 2.89 21 4 21H20C21.11 21 22 20.11 22 19V5C22 3.89 21.11 3 20 3M18 15H6V17H18V15M10 7H6V13H10V7M12 9H18V7H12V9M18 11H12V13H18V11Z",hE="M2.53,19.65L3.87,20.21V11.18L1.44,17.04C1.03,18.06 1.5,19.23 2.53,19.65M22.03,15.95L17.07,4C16.76,3.23 16.03,2.77 15.26,2.75C15,2.75 14.73,2.79 14.47,2.9L7.1,5.95C6.35,6.26 5.89,7 5.87,7.75C5.86,8 5.91,8.29 6,8.55L11,20.5C11.29,21.28 12.03,21.74 12.81,21.75C13.07,21.75 13.33,21.7 13.58,21.6L20.94,18.55C21.96,18.13 22.45,16.96 22.03,15.95M7.88,8.75A1,1 0 0,1 6.88,7.75A1,1 0 0,1 7.88,6.75C8.43,6.75 8.88,7.2 8.88,7.75C8.88,8.3 8.43,8.75 7.88,8.75M5.88,19.75A2,2 0 0,0 7.88,21.75H9.33L5.88,13.41V19.75Z",gE="M12,2.5L8,7H16L12,2.5M12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12A2,2 0 0,0 12,10M8,17L12,21.5L16,17H8Z",mE="M6.62,10.79C8.06,13.62 10.38,15.94 13.21,17.38L15.41,15.18C15.69,14.9 16.08,14.82 16.43,14.93C17.55,15.3 18.75,15.5 20,15.5A1,1 0 0,1 21,16.5V20A1,1 0 0,1 20,21A17,17 0 0,1 3,4A1,1 0 0,1 4,3H7.5A1,1 0 0,1 8.5,4C8.5,5.25 8.7,6.45 9.07,7.57C9.18,7.92 9.1,8.31 8.82,8.59L6.62,10.79Z",bE="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",vE="M17,13H13V17H11V13H7V11H11V7H13V11H17M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z",yE="M16,7V3H14V7H10V3H8V7H8C7,7 6,8 6,9V14.5L9.5,18V21H14.5V18L18,14.5V9C18,8 17,7 16,7Z",xE="M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z",wE="M12 2C11.5 2 11 2.19 10.59 2.59L2.59 10.59C1.8 11.37 1.8 12.63 2.59 13.41L10.59 21.41C11.37 22.2 12.63 22.2 13.41 21.41L21.41 13.41C22.2 12.63 22.2 11.37 21.41 10.59L13.41 2.59C13 2.19 12.5 2 12 2M12 4L20 12L12 20L4 12Z",SE="M5.5,7A1.5,1.5 0 0,1 4,5.5A1.5,1.5 0 0,1 5.5,4A1.5,1.5 0 0,1 7,5.5A1.5,1.5 0 0,1 5.5,7M21.41,11.58L12.41,2.58C12.05,2.22 11.55,2 11,2H4C2.89,2 2,2.89 2,4V11C2,11.55 2.22,12.05 2.59,12.41L11.58,21.41C11.95,21.77 12.45,22 13,22C13.55,22 14.05,21.77 14.41,21.41L21.41,14.41C21.78,14.05 22,13.55 22,13C22,12.44 21.77,11.94 21.41,11.58Z",CE="M11,2V4.07C7.38,4.53 4.53,7.38 4.07,11H2V13H4.07C4.53,16.62 7.38,19.47 11,19.93V22H13V19.93C16.62,19.47 19.47,16.62 19.93,13H22V11H19.93C19.47,7.38 16.62,4.53 13,4.07V2M11,6.08V8H13V6.09C15.5,6.5 17.5,8.5 17.92,11H16V13H17.91C17.5,15.5 15.5,17.5 13,17.92V16H11V17.91C8.5,17.5 6.5,15.5 6.08,13H8V11H6.09C6.5,8.5 8.5,6.5 11,6.08M12,11A1,1 0 0,0 11,12A1,1 0 0,0 12,13A1,1 0 0,0 13,12A1,1 0 0,0 12,11Z",EE="M22.08,11.04H20.08V4H13.05V2H11.04V4H4V11.04H2V13.05H4V20.08H11.04V22.08H13.05V20.08H20.08V13.05H22.08V11.04M18.07,18.07H13.05V16.06H11.04V18.07H6V13.05H8.03V11.04H6V6H11.04V8.03H13.05V6H18.07V11.04H16.06V13.05H18.07V18.07M13.05,12.05A1,1 0 0,1 12.05,13.05C11.5,13.05 11.04,12.6 11.04,12.05C11.04,11.5 11.5,11.04 12.05,11.04C12.6,11.04 13.05,11.5 13.05,12.05Z",OE="M16,15H9V13H16M19,11H9V9H19M19,7H9V5H19M21,1H7C5.89,1 5,1.89 5,3V17C5,18.11 5.9,19 7,19H21C22.11,19 23,18.11 23,17V3C23,1.89 22.1,1 21,1M3,5V21H19V23H3A2,2 0 0,1 1,21V5H3Z",_E="M2 12H4V17H20V12H22V17C22 18.11 21.11 19 20 19H4C2.9 19 2 18.11 2 17V12M12 15L17.55 9.54L16.13 8.13L13 11.25V2H11V11.25L7.88 8.13L6.46 9.55L12 15Z",kE="M16.59,5.41L15.17,4L12,7.17L8.83,4L7.41,5.41L12,10M7.41,18.59L8.83,20L12,16.83L15.17,20L16.58,18.59L12,14L7.41,18.59Z",TE="M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z",AE="M21 18H2V20H21V18M19 10V14H4V10H19M20 8H3C2.45 8 2 8.45 2 9V15C2 15.55 2.45 16 3 16H20C20.55 16 21 15.55 21 15V9C21 8.45 20.55 8 20 8M21 4H2V6H21V4Z",ME="M13 3V11H21V3H13M3 21H11V13H3V21M3 3V11H11V3H3M13 16H16V13H18V16H21V18H18V21H16V18H13V16Z",jE="M16.36,14C16.44,13.34 16.5,12.68 16.5,12C16.5,11.32 16.44,10.66 16.36,10H19.74C19.9,10.64 20,11.31 20,12C20,12.69 19.9,13.36 19.74,14M14.59,19.56C15.19,18.45 15.65,17.25 15.97,16H18.92C17.96,17.65 16.43,18.93 14.59,19.56M14.34,14H9.66C9.56,13.34 9.5,12.68 9.5,12C9.5,11.32 9.56,10.65 9.66,10H14.34C14.43,10.65 14.5,11.32 14.5,12C14.5,12.68 14.43,13.34 14.34,14M12,19.96C11.17,18.76 10.5,17.43 10.09,16H13.91C13.5,17.43 12.83,18.76 12,19.96M8,8H5.08C6.03,6.34 7.57,5.06 9.4,4.44C8.8,5.55 8.35,6.75 8,8M5.08,16H8C8.35,17.25 8.8,18.45 9.4,19.56C7.57,18.93 6.03,17.65 5.08,16M4.26,14C4.1,13.36 4,12.69 4,12C4,11.31 4.1,10.64 4.26,10H7.64C7.56,10.66 7.5,11.32 7.5,12C7.5,12.68 7.56,13.34 7.64,14M12,4.03C12.83,5.23 13.5,6.57 13.91,8H10.09C10.5,6.57 11.17,5.23 12,4.03M18.92,8H15.97C15.65,6.75 15.19,5.55 14.59,4.44C16.43,5.07 17.96,6.34 18.92,8M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",RE="M12.89,3L14.85,3.4L11.11,21L9.15,20.6L12.89,3M19.59,12L16,8.41V5.58L22.42,12L16,18.41V15.58L19.59,12M1.58,12L8,5.58V8.41L4.41,12L8,15.58V18.41L1.58,12Z";const fe=m.forwardRef(function({as:e,children:n,className:r,col:o,revert:i,full:s,nowrap:l,space:a,justify:c,items:u,...d},f){const p=e||"div";return h.jsx(p,{ref:f,className:B(["gs-utl-flex",r,o&&!i&&"gs-utl-flex-col",o&&i&&"gs-utl-flex-col-reverse",!o&&i&&"gs-utl-flex-row-reverse",s&&!o&&"gs-utl-w-full",s&&o&&"gs-utl-h-full",l?"gs-utl-flex-nowrap":"gs-utl-flex-wrap",a==="x2s"&&(o?"gs-utl-space-y-0.5":"gs-utl-space-x-0.5"),a==="xs"&&(o?"gs-utl-space-y-1":"gs-utl-space-x-1"),a==="s"&&(o?"gs-utl-space-y-2":"gs-utl-space-x-2"),a==="m"&&(o?"gs-utl-space-y-4":"gs-utl-space-x-4"),a==="l"&&(o?"gs-utl-space-y-6":"gs-utl-space-x-6"),a==="xl"&&(o?"gs-utl-space-y-8":"gs-utl-space-x-8"),u==="start"&&"gs-utl-items-start",u==="end"&&"gs-utl-items-end",u==="center"&&"gs-utl-items-center",c==="start"&&"gs-utl-justify-start",c==="end"&&"gs-utl-justify-end",c==="center"&&"gs-utl-justify-center",c==="between"&&"gs-utl-justify-between"]),...d,children:n})}),U=m.forwardRef(function({children:e,className:n,grow:r,...o},i){return h.jsx("div",{ref:i,className:B([n,r&&"flex-1"]),...o,children:e})});var Zl={exports:{}},Xl={exports:{}},He={};/** @license React v16.13.1
|
|
134
|
+
* react-is.production.min.js
|
|
135
|
+
*
|
|
136
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
137
|
+
*
|
|
138
|
+
* This source code is licensed under the MIT license found in the
|
|
139
|
+
* LICENSE file in the root directory of this source tree.
|
|
140
|
+
*/var sg;function NE(){if(sg)return He;sg=1;var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,o=t?Symbol.for("react.strict_mode"):60108,i=t?Symbol.for("react.profiler"):60114,s=t?Symbol.for("react.provider"):60109,l=t?Symbol.for("react.context"):60110,a=t?Symbol.for("react.async_mode"):60111,c=t?Symbol.for("react.concurrent_mode"):60111,u=t?Symbol.for("react.forward_ref"):60112,d=t?Symbol.for("react.suspense"):60113,f=t?Symbol.for("react.suspense_list"):60120,p=t?Symbol.for("react.memo"):60115,g=t?Symbol.for("react.lazy"):60116,b=t?Symbol.for("react.block"):60121,v=t?Symbol.for("react.fundamental"):60117,y=t?Symbol.for("react.responder"):60118,w=t?Symbol.for("react.scope"):60119;function S(x){if(typeof x=="object"&&x!==null){var E=x.$$typeof;switch(E){case e:switch(x=x.type,x){case a:case c:case r:case i:case o:case d:return x;default:switch(x=x&&x.$$typeof,x){case l:case u:case g:case p:case s:return x;default:return E}}case n:return E}}}function C(x){return S(x)===c}return He.AsyncMode=a,He.ConcurrentMode=c,He.ContextConsumer=l,He.ContextProvider=s,He.Element=e,He.ForwardRef=u,He.Fragment=r,He.Lazy=g,He.Memo=p,He.Portal=n,He.Profiler=i,He.StrictMode=o,He.Suspense=d,He.isAsyncMode=function(x){return C(x)||S(x)===a},He.isConcurrentMode=C,He.isContextConsumer=function(x){return S(x)===l},He.isContextProvider=function(x){return S(x)===s},He.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===e},He.isForwardRef=function(x){return S(x)===u},He.isFragment=function(x){return S(x)===r},He.isLazy=function(x){return S(x)===g},He.isMemo=function(x){return S(x)===p},He.isPortal=function(x){return S(x)===n},He.isProfiler=function(x){return S(x)===i},He.isStrictMode=function(x){return S(x)===o},He.isSuspense=function(x){return S(x)===d},He.isValidElementType=function(x){return typeof x=="string"||typeof x=="function"||x===r||x===c||x===i||x===o||x===d||x===f||typeof x=="object"&&x!==null&&(x.$$typeof===g||x.$$typeof===p||x.$$typeof===s||x.$$typeof===l||x.$$typeof===u||x.$$typeof===v||x.$$typeof===y||x.$$typeof===w||x.$$typeof===b)},He.typeOf=S,He}var Be={},lg;function PE(){if(lg)return Be;lg=1;var t={};/** @license React v16.13.1
|
|
141
|
+
* react-is.development.js
|
|
142
|
+
*
|
|
143
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
144
|
+
*
|
|
145
|
+
* This source code is licensed under the MIT license found in the
|
|
146
|
+
* LICENSE file in the root directory of this source tree.
|
|
147
|
+
*/return t.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,n=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,b=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,w=e?Symbol.for("react.responder"):60118,S=e?Symbol.for("react.scope"):60119;function C(X){return typeof X=="string"||typeof X=="function"||X===o||X===u||X===s||X===i||X===f||X===p||typeof X=="object"&&X!==null&&(X.$$typeof===b||X.$$typeof===g||X.$$typeof===l||X.$$typeof===a||X.$$typeof===d||X.$$typeof===y||X.$$typeof===w||X.$$typeof===S||X.$$typeof===v)}function x(X){if(typeof X=="object"&&X!==null){var qe=X.$$typeof;switch(qe){case n:var Qe=X.type;switch(Qe){case c:case u:case o:case s:case i:case f:return Qe;default:var at=Qe&&Qe.$$typeof;switch(at){case a:case d:case b:case g:case l:return at;default:return qe}}case r:return qe}}}var E=c,_=u,M=a,k=l,j=n,N=d,P=o,z=b,W=g,F=r,$=s,J=i,ee=f,L=!1;function I(X){return L||(L=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),A(X)||x(X)===c}function A(X){return x(X)===u}function R(X){return x(X)===a}function q(X){return x(X)===l}function D(X){return typeof X=="object"&&X!==null&&X.$$typeof===n}function V(X){return x(X)===d}function te(X){return x(X)===o}function G(X){return x(X)===b}function Q(X){return x(X)===g}function se(X){return x(X)===r}function be(X){return x(X)===s}function de(X){return x(X)===i}function Pe(X){return x(X)===f}Be.AsyncMode=E,Be.ConcurrentMode=_,Be.ContextConsumer=M,Be.ContextProvider=k,Be.Element=j,Be.ForwardRef=N,Be.Fragment=P,Be.Lazy=z,Be.Memo=W,Be.Portal=F,Be.Profiler=$,Be.StrictMode=J,Be.Suspense=ee,Be.isAsyncMode=I,Be.isConcurrentMode=A,Be.isContextConsumer=R,Be.isContextProvider=q,Be.isElement=D,Be.isForwardRef=V,Be.isFragment=te,Be.isLazy=G,Be.isMemo=Q,Be.isPortal=se,Be.isProfiler=be,Be.isStrictMode=de,Be.isSuspense=Pe,Be.isValidElementType=C,Be.typeOf=x}(),Be}var ag;function bb(){if(ag)return Xl.exports;ag=1;var t={};return t.NODE_ENV==="production"?Xl.exports=NE():Xl.exports=PE(),Xl.exports}/*
|
|
148
|
+
object-assign
|
|
149
|
+
(c) Sindre Sorhus
|
|
150
|
+
@license MIT
|
|
151
|
+
*/var Tu,cg;function DE(){if(cg)return Tu;cg=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function o(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var s={},l=0;l<10;l++)s["_"+String.fromCharCode(l)]=l;var a=Object.getOwnPropertyNames(s).map(function(u){return s[u]});if(a.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Tu=o()?Object.assign:function(i,s){for(var l,a=r(i),c,u=1;u<arguments.length;u++){l=Object(arguments[u]);for(var d in l)e.call(l,d)&&(a[d]=l[d]);if(t){c=t(l);for(var f=0;f<c.length;f++)n.call(l,c[f])&&(a[c[f]]=l[c[f]])}}return a},Tu}var Au,ug;function up(){if(ug)return Au;ug=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Au=t,Au}var Mu,dg;function vb(){return dg||(dg=1,Mu=Function.call.bind(Object.prototype.hasOwnProperty)),Mu}var ju,fg;function LE(){if(fg)return ju;fg=1;var t={},e=function(){};if(t.NODE_ENV!=="production"){var n=up(),r={},o=vb();e=function(s){var l="Warning: "+s;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}}}function i(s,l,a,c,u){if(t.NODE_ENV!=="production"){for(var d in s)if(o(s,d)){var f;try{if(typeof s[d]!="function"){var p=Error((c||"React class")+": "+a+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}f=s[d](l,d,c,a,null,n)}catch(b){f=b}if(f&&!(f instanceof Error)&&e((c||"React class")+": type specification of "+a+" `"+d+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in r)){r[f.message]=!0;var g=u?u():"";e("Failed "+a+" type: "+f.message+(g??""))}}}}return i.resetWarningCache=function(){t.NODE_ENV!=="production"&&(r={})},ju=i,ju}var Ru,pg;function VE(){if(pg)return Ru;pg=1;var t={},e=bb(),n=DE(),r=up(),o=vb(),i=LE(),s=function(){};t.NODE_ENV!=="production"&&(s=function(a){var c="Warning: "+a;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function l(){return null}return Ru=function(a,c){var u=typeof Symbol=="function"&&Symbol.iterator,d="@@iterator";function f(A){var R=A&&(u&&A[u]||A[d]);if(typeof R=="function")return R}var p="<<anonymous>>",g={array:w("array"),bigint:w("bigint"),bool:w("boolean"),func:w("function"),number:w("number"),object:w("object"),string:w("string"),symbol:w("symbol"),any:S(),arrayOf:C,element:x(),elementType:E(),instanceOf:_,node:N(),objectOf:k,oneOf:M,oneOfType:j,shape:z,exact:W};function b(A,R){return A===R?A!==0||1/A===1/R:A!==A&&R!==R}function v(A,R){this.message=A,this.data=R&&typeof R=="object"?R:{},this.stack=""}v.prototype=Error.prototype;function y(A){if(t.NODE_ENV!=="production")var R={},q=0;function D(te,G,Q,se,be,de,Pe){if(se=se||p,de=de||Q,Pe!==r){if(c){var X=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw X.name="Invariant Violation",X}else if(t.NODE_ENV!=="production"&&typeof console<"u"){var qe=se+":"+Q;!R[qe]&&q<3&&(s("You are manually calling a React.PropTypes validation function for the `"+de+"` prop on `"+se+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),R[qe]=!0,q++)}}return G[Q]==null?te?G[Q]===null?new v("The "+be+" `"+de+"` is marked as required "+("in `"+se+"`, but its value is `null`.")):new v("The "+be+" `"+de+"` is marked as required in "+("`"+se+"`, but its value is `undefined`.")):null:A(G,Q,se,be,de)}var V=D.bind(null,!1);return V.isRequired=D.bind(null,!0),V}function w(A){function R(q,D,V,te,G,Q){var se=q[D],be=J(se);if(be!==A){var de=ee(se);return new v("Invalid "+te+" `"+G+"` of type "+("`"+de+"` supplied to `"+V+"`, expected ")+("`"+A+"`."),{expectedType:A})}return null}return y(R)}function S(){return y(l)}function C(A){function R(q,D,V,te,G){if(typeof A!="function")return new v("Property `"+G+"` of component `"+V+"` has invalid PropType notation inside arrayOf.");var Q=q[D];if(!Array.isArray(Q)){var se=J(Q);return new v("Invalid "+te+" `"+G+"` of type "+("`"+se+"` supplied to `"+V+"`, expected an array."))}for(var be=0;be<Q.length;be++){var de=A(Q,be,V,te,G+"["+be+"]",r);if(de instanceof Error)return de}return null}return y(R)}function x(){function A(R,q,D,V,te){var G=R[q];if(!a(G)){var Q=J(G);return new v("Invalid "+V+" `"+te+"` of type "+("`"+Q+"` supplied to `"+D+"`, expected a single ReactElement."))}return null}return y(A)}function E(){function A(R,q,D,V,te){var G=R[q];if(!e.isValidElementType(G)){var Q=J(G);return new v("Invalid "+V+" `"+te+"` of type "+("`"+Q+"` supplied to `"+D+"`, expected a single ReactElement type."))}return null}return y(A)}function _(A){function R(q,D,V,te,G){if(!(q[D]instanceof A)){var Q=A.name||p,se=I(q[D]);return new v("Invalid "+te+" `"+G+"` of type "+("`"+se+"` supplied to `"+V+"`, expected ")+("instance of `"+Q+"`."))}return null}return y(R)}function M(A){if(!Array.isArray(A))return t.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),l;function R(q,D,V,te,G){for(var Q=q[D],se=0;se<A.length;se++)if(b(Q,A[se]))return null;var be=JSON.stringify(A,function(Pe,X){var qe=ee(X);return qe==="symbol"?String(X):X});return new v("Invalid "+te+" `"+G+"` of value `"+String(Q)+"` "+("supplied to `"+V+"`, expected one of "+be+"."))}return y(R)}function k(A){function R(q,D,V,te,G){if(typeof A!="function")return new v("Property `"+G+"` of component `"+V+"` has invalid PropType notation inside objectOf.");var Q=q[D],se=J(Q);if(se!=="object")return new v("Invalid "+te+" `"+G+"` of type "+("`"+se+"` supplied to `"+V+"`, expected an object."));for(var be in Q)if(o(Q,be)){var de=A(Q,be,V,te,G+"."+be,r);if(de instanceof Error)return de}return null}return y(R)}function j(A){if(!Array.isArray(A))return t.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),l;for(var R=0;R<A.length;R++){var q=A[R];if(typeof q!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+L(q)+" at index "+R+"."),l}function D(V,te,G,Q,se){for(var be=[],de=0;de<A.length;de++){var Pe=A[de],X=Pe(V,te,G,Q,se,r);if(X==null)return null;X.data&&o(X.data,"expectedType")&&be.push(X.data.expectedType)}var qe=be.length>0?", expected one of type ["+be.join(", ")+"]":"";return new v("Invalid "+Q+" `"+se+"` supplied to "+("`"+G+"`"+qe+"."))}return y(D)}function N(){function A(R,q,D,V,te){return F(R[q])?null:new v("Invalid "+V+" `"+te+"` supplied to "+("`"+D+"`, expected a ReactNode."))}return y(A)}function P(A,R,q,D,V){return new v((A||"React class")+": "+R+" type `"+q+"."+D+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+V+"`.")}function z(A){function R(q,D,V,te,G){var Q=q[D],se=J(Q);if(se!=="object")return new v("Invalid "+te+" `"+G+"` of type `"+se+"` "+("supplied to `"+V+"`, expected `object`."));for(var be in A){var de=A[be];if(typeof de!="function")return P(V,te,G,be,ee(de));var Pe=de(Q,be,V,te,G+"."+be,r);if(Pe)return Pe}return null}return y(R)}function W(A){function R(q,D,V,te,G){var Q=q[D],se=J(Q);if(se!=="object")return new v("Invalid "+te+" `"+G+"` of type `"+se+"` "+("supplied to `"+V+"`, expected `object`."));var be=n({},q[D],A);for(var de in be){var Pe=A[de];if(o(A,de)&&typeof Pe!="function")return P(V,te,G,de,ee(Pe));if(!Pe)return new v("Invalid "+te+" `"+G+"` key `"+de+"` supplied to `"+V+"`.\nBad object: "+JSON.stringify(q[D],null," ")+`
|
|
152
|
+
Valid keys: `+JSON.stringify(Object.keys(A),null," "));var X=Pe(Q,de,V,te,G+"."+de,r);if(X)return X}return null}return y(R)}function F(A){switch(typeof A){case"number":case"string":case"undefined":return!0;case"boolean":return!A;case"object":if(Array.isArray(A))return A.every(F);if(A===null||a(A))return!0;var R=f(A);if(R){var q=R.call(A),D;if(R!==A.entries){for(;!(D=q.next()).done;)if(!F(D.value))return!1}else for(;!(D=q.next()).done;){var V=D.value;if(V&&!F(V[1]))return!1}}else return!1;return!0;default:return!1}}function $(A,R){return A==="symbol"?!0:R?R["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&R instanceof Symbol:!1}function J(A){var R=typeof A;return Array.isArray(A)?"array":A instanceof RegExp?"object":$(R,A)?"symbol":R}function ee(A){if(typeof A>"u"||A===null)return""+A;var R=J(A);if(R==="object"){if(A instanceof Date)return"date";if(A instanceof RegExp)return"regexp"}return R}function L(A){var R=ee(A);switch(R){case"array":case"object":return"an "+R;case"boolean":case"date":case"regexp":return"a "+R;default:return R}}function I(A){return!A.constructor||!A.constructor.name?p:A.constructor.name}return g.checkPropTypes=i,g.resetWarningCache=i.resetWarningCache,g.PropTypes=g,g},Ru}var Nu,hg;function IE(){if(hg)return Nu;hg=1;var t=up();function e(){}function n(){}return n.resetWarningCache=e,Nu=function(){function r(s,l,a,c,u,d){if(d!==t){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:e};return i.PropTypes=i,i},Nu}var gg;function $E(){if(gg)return Zl.exports;gg=1;var t={};if(t.NODE_ENV!=="production"){var e=bb(),n=!0;Zl.exports=VE()(e.isElement,n)}else Zl.exports=IE()();return Zl.exports}var HE=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(r,o,i){n.o(r,o)||Object.defineProperty(r,o,{enumerable:!0,get:i})},n.r=function(r){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},n.t=function(r,o){if(1&o&&(r=n(r)),8&o||4&o&&typeof r=="object"&&r&&r.__esModule)return r;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:r}),2&o&&typeof r!="string")for(var s in r)n.d(i,s,(function(l){return r[l]}).bind(null,s));return i},n.n=function(r){var o=r&&r.__esModule?function(){return r.default}:function(){return r};return n.d(o,"a",o),o},n.o=function(r,o){return Object.prototype.hasOwnProperty.call(r,o)},n.p="",n(n.s=2)}([function(t,e){t.exports=$E()},function(t,e){t.exports=m},function(t,e,n){n.r(e);var r=n(1),o=n(0),i=function(){return(i=Object.assign||function(g){for(var b,v=1,y=arguments.length;v<y;v++)for(var w in b=arguments[v])Object.prototype.hasOwnProperty.call(b,w)&&(g[w]=b[w]);return g}).apply(this,arguments)},s=function(g,b){var v={};for(var y in g)Object.prototype.hasOwnProperty.call(g,y)&&b.indexOf(y)<0&&(v[y]=g[y]);if(g!=null&&typeof Object.getOwnPropertySymbols=="function"){var w=0;for(y=Object.getOwnPropertySymbols(g);w<y.length;w++)b.indexOf(y[w])<0&&Object.prototype.propertyIsEnumerable.call(g,y[w])&&(v[y[w]]=g[y[w]])}return v},l=0,a=r.forwardRef(function(g,b){var v=g.title,y=v===void 0?null:v,w=g.description,S=w===void 0?null:w,C=g.size,x=C===void 0?null:C,E=g.color,_=E===void 0?"currentColor":E,M=g.horizontal,k=M===void 0?null:M,j=g.vertical,N=j===void 0?null:j,P=g.rotate,z=P===void 0?null:P,W=g.spin,F=W===void 0?null:W,$=g.style,J=$===void 0?{}:$,ee=g.children,L=s(g,["title","description","size","color","horizontal","vertical","rotate","spin","style","children"]);l++;var I,A=F!==null&&F,R=r.Children.map(ee,function(te){var G=te;A!==!0&&(A=(F===null?G.props.spin:F)===!0);var Q=G.props.size;typeof x=="number"&&typeof G.props.size=="number"&&(Q=G.props.size/x);var se={size:Q,color:_===null?G.props.color:_,horizontal:k===null?G.props.horizontal:k,vertical:N===null?G.props.vertical:N,rotate:z===null?G.props.rotate:z,spin:F===null?G.props.spin:F,inStack:!0};return r.cloneElement(G,se)});x!==null&&(J.width=typeof x=="string"?x:1.5*x+"rem");var q,D="stack_labelledby_"+l,V="stack_describedby_"+l;if(y)I=S?D+" "+V:D;else if(q="presentation",S)throw new Error("title attribute required when description is set");return r.createElement("svg",i({ref:b,viewBox:"0 0 24 24",style:J,role:q,"aria-labelledby":I},L),y&&r.createElement("title",{id:D},y),S&&r.createElement("desc",{id:V},S),A&&r.createElement("style",null,"@keyframes spin { from { transform: rotate(0deg) } to { transform: rotate(360deg) } }","@keyframes spin-inverse { from { transform: rotate(0deg) } to { transform: rotate(-360deg) } }"),R)});a.displayName="Stack",a.propTypes={size:o.oneOfType([o.number,o.string]),color:o.string,horizontal:o.bool,vertical:o.bool,rotate:o.number,spin:o.oneOfType([o.bool,o.number]),children:o.oneOfType([o.arrayOf(o.node),o.node]).isRequired,className:o.string,style:o.object},a.defaultProps={size:null,color:null,horizontal:null,vertical:null,rotate:null,spin:null};var c=a;n.d(e,"Icon",function(){return p}),n.d(e,"Stack",function(){return c});var u=function(){return(u=Object.assign||function(g){for(var b,v=1,y=arguments.length;v<y;v++)for(var w in b=arguments[v])Object.prototype.hasOwnProperty.call(b,w)&&(g[w]=b[w]);return g}).apply(this,arguments)},d=function(g,b){var v={};for(var y in g)Object.prototype.hasOwnProperty.call(g,y)&&b.indexOf(y)<0&&(v[y]=g[y]);if(g!=null&&typeof Object.getOwnPropertySymbols=="function"){var w=0;for(y=Object.getOwnPropertySymbols(g);w<y.length;w++)b.indexOf(y[w])<0&&Object.prototype.propertyIsEnumerable.call(g,y[w])&&(v[y[w]]=g[y[w]])}return v},f=0,p=r.forwardRef(function(g,b){var v=g.path,y=g.id,w=y===void 0?++f:y,S=g.title,C=S===void 0?null:S,x=g.description,E=x===void 0?null:x,_=g.size,M=_===void 0?null:_,k=g.color,j=k===void 0?"currentColor":k,N=g.horizontal,P=N!==void 0&&N,z=g.vertical,W=z!==void 0&&z,F=g.rotate,$=F===void 0?0:F,J=g.spin,ee=J!==void 0&&J,L=g.style,I=L===void 0?{}:L,A=g.inStack,R=A!==void 0&&A,q=d(g,["path","id","title","description","size","color","horizontal","vertical","rotate","spin","style","inStack"]),D={},V=[];M!==null&&(R?V.push("scale("+M+")"):(I.width=typeof M=="string"?M:1.5*M+"rem",I.height=I.width)),P&&V.push("scaleX(-1)"),W&&V.push("scaleY(-1)"),$!==0&&V.push("rotate("+$+"deg)"),j!==null&&(D.fill=j);var te=r.createElement("path",u({d:v,style:D},R?q:{})),G=te;V.length>0&&(I.transform=V.join(" "),I.transformOrigin="center",R&&(G=r.createElement("g",{style:I},te,r.createElement("rect",{width:"24",height:"24",fill:"transparent"}))));var Q,se=G,be=ee===!0||typeof ee!="number"?2:ee,de=!R&&(P||W);if(be<0&&(de=!de),ee&&(se=r.createElement("g",{style:{animation:"spin"+(de?"-inverse":"")+" linear "+Math.abs(be)+"s infinite",transformOrigin:"center"}},G,!(P||W||$!==0)&&r.createElement("rect",{width:"24",height:"24",fill:"transparent"}))),R)return se;var Pe,X="icon_labelledby_"+w,qe="icon_describedby_"+w;if(C)Q=E?X+" "+qe:X;else if(Pe="presentation",E)throw new Error("title attribute required when description is set");return r.createElement("svg",u({ref:b,viewBox:"0 0 24 24",style:I,role:Pe,"aria-labelledby":Q},q),C&&r.createElement("title",{id:X},C),E&&r.createElement("desc",{id:qe},E),!R&&ee&&(de?r.createElement("style",null,"@keyframes spin-inverse { from { transform: rotate(0deg) } to { transform: rotate(-360deg) } }"):r.createElement("style",null,"@keyframes spin { from { transform: rotate(0deg) } to { transform: rotate(360deg) } }")),se)});p.displayName="Icon",p.propTypes={path:o.string.isRequired,size:o.oneOfType([o.number,o.string]),color:o.string,horizontal:o.bool,vertical:o.bool,rotate:o.number,spin:o.oneOfType([o.bool,o.number]),style:o.object,inStack:o.bool,className:o.string},p.defaultProps={size:null,color:"currentColor",horizontal:!1,vertical:!1,rotate:0,spin:!1},e.default=p}]);const BE=Xf(HE);var yb={exports:{}};/*!
|
|
153
|
+
Copyright (c) 2018 Jed Watson.
|
|
154
|
+
Licensed under the MIT License (MIT), see
|
|
155
|
+
http://jedwatson.github.io/classnames
|
|
156
|
+
*/(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var i="",s=0;s<arguments.length;s++){var l=arguments[s];l&&(i=o(i,r(l)))}return i}function r(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return n.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var s="";for(var l in i)e.call(i,l)&&i[l]&&(s=o(s,l));return s}function o(i,s){return s?i?i+" "+s:i+s:i}t.exports?(n.default=n,t.exports=n):window.classNames=n})()})(yb);var zE=yb.exports;const tt=Xf(zE);function xb(t,e,n){let r,o,i,s,l;const a=e;function c(){const d=Date.now()-s;d<a&&d>=0?r=setTimeout(c,a-d):(r=null,l=t.apply(i,o),i=o=null)}const u=function(){return i=this,o=arguments,s=Date.now(),r||(r=setTimeout(c,a)),l};return u.clear=function(){r&&(clearTimeout(r),r=null)},u.flush=function(){r&&(l=t.apply(i,o),i=o=null,clearTimeout(r),r=null)},u}const mg=new Map,FE=m.forwardRef(function({svg:e,iconSize:n,...r},o){let i=mg.get(e);return i||(i=x2(e,n),mg.set(e,i)),h.jsx("div",{...r,ref:o,dangerouslySetInnerHTML:{__html:i}})}),WE=150,he={bgTr:"gs-utl-bg-transparent",txt:"gs-theme-cl-txt gs-utl-text-gray-900 dark:gs-utl-text-gray-400",txtLowEmphasis:"gs-utl-text-neutral-500 dark:gs-utl-text-neutral-500",txtHighEmphasis:"gs-utl-text-black dark:gs-utl-text-gray-200",txtHighEmphasisH:"hover:gs-utl-text-black hover:dark:gs-utl-text-gray-200",tA:"gs-theme-cl-tA gs-utl-text-violet-400",tAo:"gs-theme-cl-tAo gs-utl-text-violet-800 dark:gs-utl-text-violet-400",hTAo:"gs-theme-cl-hTAo hover:gs-utl-text-violet-800 hover:dark:gs-utl-text-violet-400",grouphTAo:"gs-theme-cl-grouphTAo group-hover:gs-utl-text-violet-800 group-hover:dark:gs-utl-text-violet-400",bA:"gs-theme-cl-bA gs-utl-border-violet-400",bgA:"gs-theme-cl-bgA gs-utl-bg-violet-400 gs-utl-text-white dark:gs-utl-bg-violet-500",bgA2:"gs-theme-cl-bgA2 gs-utl-bg-violet-500 gs-utl-text-white",bgO:"gs-theme-cl-bg0 gs-utl-bg-violet-50 gs-utl-text-violet-900 dark:gs-utl-bg-zinc-800 dark:gs-utl-text-violet-400",bg:"gs-theme-cl-bg gs-utl-bg-white dark:gs-utl-bg-zinc-900",bgBlur:"gs-utl-bg-white/50 dark:gs-utl-bg-zinc-900/50 gs-utl-backdrop-blur-sm",bgH:"gs-theme-cl-bgH gs-utl-bg-gray-100 dark:gs-utl-bg-zinc-700",bgH75:"gs-utl-bg-gray-100/75 dark:gs-utl-bg-zinc-700/75",hBgH:"gs-theme-cl-hBgH hover:gs-utl-bg-gray-50 hover:dark:gs-utl-bg-zinc-800",bgH2:"gs-theme-cl-bgH2 gs-utl-bg-gray-25 dark:gs-utl-bg-zinc-800",hBgH2:"gs-theme-cl-hBgH2 hover:gs-utl-bg-gray-25 hover:dark:gs-utl-bg-zinc-800",hBgAct:"gs-theme-cl-hBgAct hover:gs-utl-bg-violet-800 hover:dark:gs-utl-bg-violet-400",hBgA2:"gs-theme-cl-hBgA2 hover:gs-utl-bg-violet-500 hover:dark:gs-utl-bg-violet-600",hBgDark:"hover:gs-utl-bg-black/10",sel:"gs-theme-cl-sel gs-utl-bg-pink-200 gs-utl-text-pink-900",selBr:"gs-theme-cl-selBr gs-utl-border-pink-900",cmp:"gs-theme-cl-cmp gs-utl-bg-blue-450 gs-utl-text-white",cmpSymbol:"gs-theme-cl-cmpSymbol gs-utl-bg-[#7b61ff] gs-utl-text-white",cmpBgSoft:"gs-theme-cl-cmpBgSoft gs-utl-bg-blue-100 dark:gs-utl-bg-sky-800",cmpBgSymbolSoft:"gs-theme-cl-cmpBgSymbolSoft gs-utl-bg-violet-200 dark:gs-utl-bg-violet-800",cmpBgSoftX:"gs-theme-cl-cmpBgSoftX gs-utl-bg-blue-50 dark:gs-utl-bg-gray-800",cmpBgSymbolSoftX:"gs-theme-cl-cmpBgSymbolSoftX gs-utl-bg-[#edebff] dark:gs-utl-bg-[#2d1b4b]",cmpTxtActive:"gs-theme-cl-cmpTxtActive dark:gs-utl-text-gray-300",cmpBr:"gs-theme-cl-cmpBr gs-utl-border-blue-450",cmpSymbolBr:"gs-theme-cl-cmpSymbolBr gs-utl-border-[#7b61ff]",cmpTargetBg:"gs-utl-bg-amber-500 gs-utl-text-white",cmpTargetBgOpac:"gs-utl-bg-amber-500/5",cmpTargetBr:"gs-utl-border-amber-500",tW:"gs-utl-text-amber-500",bgW:"gs-utl-bg-amber-500",bgRed:"gs-utl-bg-red-500",hBgRed:"hover:gs-utl-bg-red-600",hBgW:"hover:gs-utl-bg-amber-600",br:"gs-theme-cl-br gs-utl-border-gray-300 dark:gs-utl-border-zinc-700",brRed:"gs-utl-border-red-500",brLight:"gs-utl-border-white/25"},wb={enter:"gs-utl-transition gs-utl-duration-100 gs-utl-ease-out",enterFrom:"gs-utl-scale-95 gs-utl-opacity-0",enterTo:"gs-utl-opacity-100",leave:"gs-utl-transition gs-utl-ease-in gs-utl-duration-100",leaveFrom:"gs-utl-scale-100 gs-utl-opacity-100",leaveTo:"gs-utl-scale-95 gs-utl-opacity-0"},UE={enter:"gs-utl-transition gs-utl-duration-100 gs-utl-ease-out",enterFrom:"gs-utl-opacity-0",enterTo:"gs-utl-opacity-100"},qE={leave:"gs-utl-transition gs-utl-ease-in gs-utl-duration-100",leaveFrom:"gs-utl-opacity-100",leaveTo:"gs-utl-opacity-0"},GE={...UE,...qE},dr={xy:"gs-utl-px-4 gs-utl-py-2",xyS:"gs-utl-px-2 gs-utl-py-1",xyS2:"gs-utl-px-2 gs-utl-py-0.5",x:"gs-utl-px-4",xS:"gs-utl-px-2",y:"gs-utl-py-2",s:"gs-utl-p-2"},Sb={bg:he.bg,bgH:he.bgH},bg={bg:"gs-utl-bg-zinc-700",txt:"gs-utl-text-white",block:"gs-utl-text-xs gs-utl-mt-1 gs-utl-bg-white/10 gs-utl-rounded gs-utl-px-2 gs-utl-py-1"},we={rnd:"gs-utl-rounded",pill:"gs-utl-rounded-full",b:"gs-utl-border",bT:"gs-utl-border-transparent",bS:"gs-utl-border-2",bt:"gs-utl-border-t",bb:"gs-utl-border-b",br:"gs-utl-border-r",bl:"gs-utl-border-l",bA:"gs-theme-cl-bA gs-utl-border-violet-400 dark:gs-utl-border-violet-500"},nc={focus:"gs-theme-ring-focus focus:gs-utl-outline-none focus-visible:gs-utl-ring-2 gs-utl-ring-violet-300 gs-utl-ring-opacity-80",deepFocus:"focus:gs-utl-outline-none [&:has(:focus-visible)]:gs-utl-ring-2 gs-utl-ring-violet-300 gs-utl-ring-opacity-80"},We={s3x:"13px",s2x:"14px",sx:"16px",s:"18px"},So={click:"gs-utl-cursor-pointer gs-utl-transition-opacity gs-utl-opacity-75 hover:gs-utl-opacity-100",hover:"gs-utl-transition-opacity gs-utl-opacity-50 hover:gs-utl-opacity-100",hoverGroup:"group-hover:gs-utl-opacity-100 gs-utl-opacity-0 gs-utl-transition-opacity",dot:"gs-utl-w-[6px] gs-utl-h-[6px] gs-utl-rounded-full",scrollY:"gs-utl-overflow-y-auto gs-utl-overflow-x-hidden",txtEllips:"gs-utl-text-ellipsis gs-utl-overflow-hidden gs-utl-whitespace-nowrap",coverAbs:"gs-utl-absolute gs-utl-top-0 gs-utl-left-0 gs-utl-w-full gs-utl-h-full",disabled:"gs-utl-opacity-50 gs-utl-pointer-events-none",noFocusOut:"focus:gs-utl-outline-none",spin:"gs-utl-animate-spin-fast"},Cb={link:B(he.tAo),inputText:"gs-theme-elStyles-inputText focus:gs-utl-outline-none gs-utl-placeholder:text-neutral-400 placeholder:dark:gs-utl-text-neutral-500"},KE=t=>t.replace(/[^a-z0-9.]/gi,"_").toLowerCase(),vg=(t,e,n="html")=>{const{Pages:r}=t,o=rc({page:e,key:"slug"});return`${r.getMain()===e?"index":_2(o||e.getName())}.${n}`},YE="custom-html-body",yg="data-custom-html-body",ht={title:({cmp:t})=>t.tagName==="title",favicon:({cmp:t})=>{var e;return t.tagName==="link"&&((e=t.attributes.attributes)==null?void 0:e.rel)==="icon"},description:({cmp:t})=>{var e;return t.tagName==="meta"&&((e=t.attributes.attributes)==null?void 0:e.name)==="description"},keywords:({cmp:t})=>{var e;return t.tagName==="meta"&&((e=t.attributes.attributes)==null?void 0:e.name)==="keywords"},socialTitle:({cmp:t})=>{var e;return t.tagName==="meta"&&((e=t.attributes.attributes)==null?void 0:e.property)==="og:title"},socialImage:({cmp:t})=>{var e;return t.tagName==="meta"&&((e=t.attributes.attributes)==null?void 0:e.property)==="og:image"},socialDescription:({cmp:t})=>{var e;return t.tagName==="meta"&&((e=t.attributes.attributes)==null?void 0:e.property)==="og:description"},charset:({cmp:t})=>{var e;return t.tagName==="meta"&&((e=t.attributes.attributes)==null?void 0:e.charset)},viewport:({cmp:t})=>{var e;return t.tagName==="meta"&&((e=t.attributes.attributes)==null?void 0:e.name)==="viewport"},robots:({cmp:t})=>{var e;return t.tagName==="meta"&&((e=t.attributes.attributes)==null?void 0:e.name)==="robots"},generator:({cmp:t})=>{var e;return t.tagName==="meta"&&((e=t.attributes.attributes)==null?void 0:e.name)==="generator"}},JE=t=>{for(const e in ht){const n=e;if(ht[n]({cmp:t}))return n}},ZE=(t,e,n)=>{const r=[];let o=n;return t.getMainComponent().findType(YE).forEach(i=>{r.push(i),o=(o||"")+i.getInnerHTML()}),{components:r,html:o,changed:o!==e}},XE=t=>{const e={...t.get("settings")??{}},n=t.getMainComponent(),{head:r}=n;if(r){const o=[];r.components().forEach(i=>{const{content:s,href:l}=i.getAttributes({noClass:!0,noStyle:!0});ht.title({cmp:i})?e.title=i.getInnerHTML():ht.favicon({cmp:i})?e.favicon=l:ht.description({cmp:i})?e.description=s:ht.keywords({cmp:i})?e.keywords=s:ht.socialTitle({cmp:i})?e.socialTitle=s:ht.socialDescription({cmp:i})?e.socialDescription=s:ht.socialImage({cmp:i})?e.socialImage=s:JE(i)||o.push(i.toHTML())}),o.length&&(e.customCodeHead=o.join(`
|
|
157
|
+
`))}return e.customCodeBody=ZE(t,e.customCodeBody).html,e},Eb=t=>t.getModel().get("customData")??{},QE=t=>(t==null?void 0:t.projectDataCustom.globalPageSettings)??{},rc=t=>{const{page:e,key:n,appEditorStore:r,def:o="",defPage:i=""}=t;return(e?XE(e)[n]??i:QE(r)[n])??o},Vo=(t,e)=>{const n=t.em.getEditor(),o=Eb(n).globalPageSettings||{};return rc({page:t,key:e})||o[e]},eO=()=>$l().contextMenu,dp=()=>$l().i18nStore,xg="gs-custom-layout",tO=m.forwardRef(function({className:e,component:n,noWrapper:r,id:o,render:i,...s},l){const{editor:a}=Hl(),c=m.useRef(null),u=n,d=u&&a?h.jsx(u,{editor:a}):null,f=tt(xg,o&&`${xg}__${o}`,e),p=c.current,g=r&&!i;return m.useImperativeHandle(l,()=>c.current,[]),m.useEffect(()=>{if(!i||!p)return;const b=w=>p.appendChild(w),v=w=>p.removeChild(w),y=i({editor:a,addEl:b,removeEl:v});if(w0(y))p.innerHTML=y;else{if(y instanceof HTMLElement)return b(y),()=>{v(y)};if(xo(y))return()=>{y()}}},[i,a,p]),g?d:h.jsx("div",{className:f,ref:c,...s,children:d})});ms(tO);var Ob=(t=>(t.gjs="gjs",t.gjsStudio="gjs-studio",t))(Ob||{});const jl=t=>typeof t<"u";var tf=(t=>(t.web="web",t.email="email",t))(tf||{});const nO=()=>$l().localSettingsStore,rO=()=>$l().modalStore;function oO(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function wg(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function Sg(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?wg(Object(n),!0).forEach(function(r){oO(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):wg(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function iO(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i<r.length;i++)o=r[i],!(e.indexOf(o)>=0)&&(n[o]=t[o]);return n}function sO(t,e){if(t==null)return{};var n=iO(t,e),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function lO(t,e){return aO(t)||cO(t,e)||uO(t,e)||dO()}function aO(t){if(Array.isArray(t))return t}function cO(t,e){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(t)))){var n=[],r=!0,o=!1,i=void 0;try{for(var s=t[Symbol.iterator](),l;!(r=(l=s.next()).done)&&(n.push(l.value),!(e&&n.length===e));r=!0);}catch(a){o=!0,i=a}finally{try{!r&&s.return!=null&&s.return()}finally{if(o)throw i}}return n}}function uO(t,e){if(t){if(typeof t=="string")return Cg(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cg(t,e)}}function Cg(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function dO(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
158
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fO(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Eg(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function Og(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Eg(Object(n),!0).forEach(function(r){fO(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Eg(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function pO(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(r){return e.reduceRight(function(o,i){return i(o)},r)}}function Bs(t){return function e(){for(var n=this,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return o.length>=t.length?t.apply(this,o):function(){for(var s=arguments.length,l=new Array(s),a=0;a<s;a++)l[a]=arguments[a];return e.apply(n,[].concat(o,l))}}}function oc(t){return{}.toString.call(t).includes("Object")}function hO(t){return!Object.keys(t).length}function ul(t){return typeof t=="function"}function gO(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function mO(t,e){return oc(e)||go("changeType"),Object.keys(e).some(function(n){return!gO(t,n)})&&go("changeField"),e}function bO(t){ul(t)||go("selectorType")}function vO(t){ul(t)||oc(t)||go("handlerType"),oc(t)&&Object.values(t).some(function(e){return!ul(e)})&&go("handlersType")}function yO(t){t||go("initialIsRequired"),oc(t)||go("initialType"),hO(t)&&go("initialContent")}function xO(t,e){throw new Error(t[e]||t.default)}var wO={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"},go=Bs(xO)(wO),Ql={changes:mO,selector:bO,handler:vO,initial:yO};function SO(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ql.initial(t),Ql.handler(e);var n={current:t},r=Bs(OO)(n,e),o=Bs(EO)(n),i=Bs(Ql.changes)(t),s=Bs(CO)(n);function l(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(u){return u};return Ql.selector(c),c(n.current)}function a(c){pO(r,o,i,s)(c)}return[l,a]}function CO(t,e){return ul(e)?e(t.current):e}function EO(t,e){return t.current=Og(Og({},t.current),e),e}function OO(t,e,n){return ul(e)?e(t.current):Object.keys(n).forEach(function(r){var o;return(o=e[r])===null||o===void 0?void 0:o.call(e,t.current[r])}),n}var _O={create:SO},kO={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function TO(t){return function e(){for(var n=this,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return o.length>=t.length?t.apply(this,o):function(){for(var s=arguments.length,l=new Array(s),a=0;a<s;a++)l[a]=arguments[a];return e.apply(n,[].concat(o,l))}}}function AO(t){return{}.toString.call(t).includes("Object")}function MO(t){return t||_g("configIsRequired"),AO(t)||_g("configType"),t.urls?(jO(),{paths:{vs:t.urls.monacoBase}}):t}function jO(){console.warn(_b.deprecation)}function RO(t,e){throw new Error(t[e]||t.default)}var _b={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!
|
|
221
159
|
You are using deprecated way of configuration.
|
|
222
160
|
|
|
223
161
|
Instead of using
|
|
@@ -226,42 +164,45 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
226
164
|
monaco.config({ paths: { vs: '...' } })
|
|
227
165
|
|
|
228
166
|
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
229
|
-
`},gp=P5(j5)(sg),H5={config:D5},I5=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return function(i){return n.reduceRight(function(o,s){return s(o)},i)}};function ag(t,e){return Object.keys(e).forEach(function(n){e[n]instanceof Object&&t[n]&&Object.assign(e[n],ag(t[n],e[n]))}),dp(dp({},t),e)}var B5={type:"cancelation",msg:"operation is manually canceled"};function uc(t){var e=!1,n=new Promise(function(r,i){t.then(function(o){return e?i(B5):r(o)}),t.catch(i)});return n.cancel=function(){return e=!0},n}var $5=N5.create({config:R5,isInitialized:!1,resolve:null,reject:null,monaco:null}),lg=d5($5,2),ms=lg[0],wl=lg[1];function z5(t){var e=H5.config(t),n=e.monaco,r=f5(e,["monaco"]);wl(function(i){return{config:ag(i.config,r),monaco:n}})}function F5(){var t=ms(function(e){var n=e.monaco,r=e.isInitialized,i=e.resolve;return{monaco:n,isInitialized:r,resolve:i}});if(!t.isInitialized){if(wl({isInitialized:!0}),t.monaco)return t.resolve(t.monaco),uc(fc);if(window.monaco&&window.monaco.editor)return cg(window.monaco),t.resolve(window.monaco),uc(fc);I5(W5,q5)(G5)}return uc(fc)}function W5(t){return document.body.appendChild(t)}function U5(t){var e=document.createElement("script");return t&&(e.src=t),e}function q5(t){var e=ms(function(r){var i=r.config,o=r.reject;return{config:i,reject:o}}),n=U5("".concat(e.config.paths.vs,"/loader.js"));return n.onload=function(){return t()},n.onerror=e.reject,n}function G5(){var t=ms(function(n){var r=n.config,i=n.resolve,o=n.reject;return{config:r,resolve:i,reject:o}}),e=window.require;e.config(t.config),e(["vs/editor/editor.main"],function(n){cg(n),t.resolve(n)},function(n){t.reject(n)})}function cg(t){ms().monaco||wl({monaco:t})}function K5(){return ms(function(t){var e=t.monaco;return e})}var fc=new Promise(function(t,e){return wl({resolve:t,reject:e})}),ug={config:z5,init:F5,__getMonacoInstance:K5},Z5={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},dc=Z5,J5={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Y5=J5;function X5({children:t}){return O.createElement("div",{style:Y5.container},t)}var Q5=X5,eO=Q5;function tO({width:t,height:e,isEditorReady:n,loading:r,_ref:i,className:o,wrapperProps:s}){return O.createElement("section",{style:{...dc.wrapper,width:t,height:e},...s},!n&&O.createElement(eO,null,r),O.createElement("div",{ref:i,style:{...dc.fullWidth,...!n&&dc.hide},className:o}))}var nO=tO,fg=O.memo(nO);function rO(t){O.useEffect(t,[])}var dg=rO;function iO(t,e,n=!0){let r=O.useRef(!0);O.useEffect(r.current||!n?()=>{r.current=!1}:t,e)}var bt=iO;function Vo(){}function Ni(t,e,n,r){return oO(t,r)||sO(t,e,n,r)}function oO(t,e){return t.editor.getModel(pg(t,e))}function sO(t,e,n,r){return t.editor.createModel(e,n,r?pg(t,r):void 0)}function pg(t,e){return t.Uri.parse(e)}function aO({original:t,modified:e,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:o,modifiedModelPath:s,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:u="Loading...",options:f={},height:d="100%",width:p="100%",className:h,wrapperProps:m={},beforeMount:g=Vo,onMount:y=Vo}){let[w,x]=O.useState(!1),[C,v]=O.useState(!0),E=O.useRef(null),A=O.useRef(null),B=O.useRef(null),T=O.useRef(y),P=O.useRef(g),I=O.useRef(!1);dg(()=>{let H=ug.init();return H.then(Y=>(A.current=Y)&&v(!1)).catch(Y=>(Y==null?void 0:Y.type)!=="cancelation"&&console.error("Monaco initialization: error:",Y)),()=>E.current?te():H.cancel()}),bt(()=>{if(E.current&&A.current){let H=E.current.getOriginalEditor(),Y=Ni(A.current,t||"",r||n||"text",o||"");Y!==H.getModel()&&H.setModel(Y)}},[o],w),bt(()=>{if(E.current&&A.current){let H=E.current.getModifiedEditor(),Y=Ni(A.current,e||"",i||n||"text",s||"");Y!==H.getModel()&&H.setModel(Y)}},[s],w),bt(()=>{let H=E.current.getModifiedEditor();H.getOption(A.current.editor.EditorOption.readOnly)?H.setValue(e||""):e!==H.getValue()&&(H.executeEdits("",[{range:H.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),H.pushUndoStop())},[e],w),bt(()=>{var H,Y;(Y=(H=E.current)==null?void 0:H.getModel())==null||Y.original.setValue(t||"")},[t],w),bt(()=>{let{original:H,modified:Y}=E.current.getModel();A.current.editor.setModelLanguage(H,r||n||"text"),A.current.editor.setModelLanguage(Y,i||n||"text")},[n,r,i],w),bt(()=>{var H;(H=A.current)==null||H.editor.setTheme(c)},[c],w),bt(()=>{var H;(H=E.current)==null||H.updateOptions(f)},[f],w);let z=O.useCallback(()=>{var re;if(!A.current)return;P.current(A.current);let H=Ni(A.current,t||"",r||n||"text",o||""),Y=Ni(A.current,e||"",i||n||"text",s||"");(re=E.current)==null||re.setModel({original:H,modified:Y})},[n,e,i,t,r,o,s]),K=O.useCallback(()=>{var H;!I.current&&B.current&&(E.current=A.current.editor.createDiffEditor(B.current,{automaticLayout:!0,...f}),z(),(H=A.current)==null||H.editor.setTheme(c),x(!0),I.current=!0)},[f,c,z]);O.useEffect(()=>{w&&T.current(E.current,A.current)},[w]),O.useEffect(()=>{!C&&!w&&K()},[C,w,K]);function te(){var Y,re,oe,he;let H=(Y=E.current)==null?void 0:Y.getModel();a||((re=H==null?void 0:H.original)==null||re.dispose()),l||((oe=H==null?void 0:H.modified)==null||oe.dispose()),(he=E.current)==null||he.dispose()}return O.createElement(fg,{width:p,height:d,isEditorReady:w,loading:u,_ref:B,className:h,wrapperProps:m})}var lO=aO;O.memo(lO);function cO(t){let e=O.useRef();return O.useEffect(()=>{e.current=t},[t]),e.current}var uO=cO,qs=new Map;function fO({defaultValue:t,defaultLanguage:e,defaultPath:n,value:r,language:i,path:o,theme:s="light",line:a,loading:l="Loading...",options:c={},overrideServices:u={},saveViewState:f=!0,keepCurrentModel:d=!1,width:p="100%",height:h="100%",className:m,wrapperProps:g={},beforeMount:y=Vo,onMount:w=Vo,onChange:x,onValidate:C=Vo}){let[v,E]=O.useState(!1),[A,B]=O.useState(!0),T=O.useRef(null),P=O.useRef(null),I=O.useRef(null),z=O.useRef(w),K=O.useRef(y),te=O.useRef(),H=O.useRef(r),Y=uO(o),re=O.useRef(!1),oe=O.useRef(!1);dg(()=>{let _=ug.init();return _.then(N=>(T.current=N)&&B(!1)).catch(N=>(N==null?void 0:N.type)!=="cancelation"&&console.error("Monaco initialization: error:",N)),()=>P.current?pe():_.cancel()}),bt(()=>{var N,G,W,U;let _=Ni(T.current,t||r||"",e||i||"",o||n||"");_!==((N=P.current)==null?void 0:N.getModel())&&(f&&qs.set(Y,(G=P.current)==null?void 0:G.saveViewState()),(W=P.current)==null||W.setModel(_),f&&((U=P.current)==null||U.restoreViewState(qs.get(o))))},[o],v),bt(()=>{var _;(_=P.current)==null||_.updateOptions(c)},[c],v),bt(()=>{!P.current||r===void 0||(P.current.getOption(T.current.editor.EditorOption.readOnly)?P.current.setValue(r):r!==P.current.getValue()&&(oe.current=!0,P.current.executeEdits("",[{range:P.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),P.current.pushUndoStop(),oe.current=!1))},[r],v),bt(()=>{var N,G;let _=(N=P.current)==null?void 0:N.getModel();_&&i&&((G=T.current)==null||G.editor.setModelLanguage(_,i))},[i],v),bt(()=>{var _;a!==void 0&&((_=P.current)==null||_.revealLine(a))},[a],v),bt(()=>{var _;(_=T.current)==null||_.editor.setTheme(s)},[s],v);let he=O.useCallback(()=>{var _;if(!(!I.current||!T.current)&&!re.current){K.current(T.current);let N=o||n,G=Ni(T.current,r||t||"",e||i||"",N||"");P.current=(_=T.current)==null?void 0:_.editor.create(I.current,{model:G,automaticLayout:!0,...c},u),f&&P.current.restoreViewState(qs.get(N)),T.current.editor.setTheme(s),a!==void 0&&P.current.revealLine(a),E(!0),re.current=!0}},[t,e,n,r,i,o,c,u,f,s,a]);O.useEffect(()=>{v&&z.current(P.current,T.current)},[v]),O.useEffect(()=>{!A&&!v&&he()},[A,v,he]),H.current=r,O.useEffect(()=>{var _,N;v&&x&&((_=te.current)==null||_.dispose(),te.current=(N=P.current)==null?void 0:N.onDidChangeModelContent(G=>{oe.current||x(P.current.getValue(),G)}))},[v,x]),O.useEffect(()=>{if(v){let _=T.current.editor.onDidChangeMarkers(N=>{var W;let G=(W=P.current.getModel())==null?void 0:W.uri;if(G&&N.find(U=>U.path===G.path)){let U=T.current.editor.getModelMarkers({resource:G});C==null||C(U)}});return()=>{_==null||_.dispose()}}return()=>{}},[v,C]);function pe(){var _,N;(_=te.current)==null||_.dispose(),d?f&&qs.set(o,P.current.saveViewState()):(N=P.current.getModel())==null||N.dispose(),P.current.dispose()}return O.createElement(fg,{width:p,height:h,isEditorReady:v,loading:l,_ref:I,className:m,wrapperProps:g})}var dO=fO,pO=O.memo(dO),hO=pO;const mO=t=>{var e;(e=t.getAction("editor.action.formatDocument"))==null||e.run()},gO="gs-field-code",bO={minimap:{enabled:!1},lineNumbers:"off",scrollBeyondLastLine:!1,contextmenu:!1,fixedOverflowWidgets:!0,showFoldingControls:"always",suggestOnTriggerCharacters:!1,lineDecorationsWidth:0,renderLineHighlight:"none",wordWrapOverride1:"off",tabSize:2,scrollbar:{verticalScrollbarSize:8,horizontal:"hidden",alwaysConsumeMouseWheel:!1}};function vO({size:t,value:e,label:n,language:r,onChange:i,clean:o,padding:s,isDarkTheme:a,className:l,containerClassName:c,noMinHeight:u,onMount:f,readOnly:d,description:p}){const h=typeof e=="string"?e:JSON.stringify(e,null,2);return R.jsxs("div",{className:Ee(gO,"flex flex-col w-full h-full",c),children:[!!n&&R.jsx(La,{children:n}),!!p&&R.jsx(La,{as:"span",size:t,className:Ee(Ae.txtLowEmphasis),capitalize:!1,children:p}),R.jsx("div",{className:Ee("flex-grow","w-full","h-full",!u&&"gs-utl-min-h-48"),style:{position:"relative",width:"100%",height:"100%"},children:R.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0},children:R.jsx(hO,{defaultLanguage:r,defaultValue:h,theme:a?"vs-dark":"light",className:Ee($t.b,$t.rnd,Ae.br,l),options:{...bO,readOnly:d,...o&&{domReadOnly:!0,overviewRulerLanes:0,selectOnLineNumbers:!1,folding:!1,matchBrackets:"never",guides:{indentation:!1}},...m1(s)&&{lineDecorationsWidth:s*2,padding:{top:s,bottom:s}}},onChange:i,onMount:(m,g)=>{let y=!1;const w=()=>mO(m);m.onDidChangeModelLanguageConfiguration(w),m.onDidScrollChange(()=>{y||(y=!0,w())}),setTimeout(w,10),f==null||f(m,g)}})})})]})}const yO=t=>t.Assets.getAll().reduce((r,i)=>{const o=i.getSrc(),s=o.match(/^data:([^;]+);/);if(s){const a=o.split(",")[1],l=QC(i.get("name"));r[o]={mime:s[1],name:l,base64:a}}return r},{}),wO=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),bp=(t,e,n={})=>{let r=t;const i=n.pathPfx||"";for(const o in e)if(r.includes(o)){const s=e[o];r=r.replace(new RegExp(wO(o),"g"),`${i}${s.name}`),s.found=!0}return r},xO=(t,e)=>`${e||""}${t||""}`,SO=(t,e)=>{const n=t?`<div ${cp}>${t}</div>`:"",r=e?`<div ${cp} data-gjs-global>${e}</div>`:"";return`${n}${r}`},CO=async(t,e={})=>{const{page:n,skipProject:r,assetsFolder:i="assets",filenameCss:o="style.css",styles:s,isMJML:a}=e,l=[],c=n?[n]:t.Pages.getAll(),u=yO(t),f=`${i}/`,d=t.getCss({keepUnusedStyles:!0,component:n==null?void 0:n.getMainComponent()})||"",p=bp(d,u,{pathPfx:f}),h=s==="inline",m=s==="skip",g=ig(t).globalPageSettings||{},y=c.map(w=>{var ct,ln,Tt;const x=w.getName(),C=Pr(w,"title")||x,v=Pr(w,"favicon"),E=Pr(w,"description"),A=Pr(w,"keywords"),B=Pr(w,"socialTitle"),T=Pr(w,"socialDescription"),P=Pr(w,"socialImage"),I=ja({page:w,key:"customCodeHead"}),z=xO(I,g.customCodeHead),K=ja({page:w,key:"customCodeBody"}),te=SO(K,g.customCodeBody),H=w.getMainComponent(),Y=t.getJs({component:H}),re=Y?`<script>${Y}<\/script>`:"",oe=[],he=[],pe=H.toHTML({asDocument:!1}).replace("</body>",`${te}${re}</body>`),_=H.head;let N=C&&`<title>${C}</title>`,G=v&&`<link rel="icon" href="${v}"/>`,W=E&&`<meta name="description" content="${E}"/>`,U=A&&`<meta name="keywords" content="${A}"/>`,se=B&&`<meta property="og:title" content="${B}"/>`,Z=T&&`<meta property="og:description" content="${T}"/>`,Q=P&&`<meta property="og:image" content="${P}"/>`,ie='<meta charset="utf-8">',ue='<meta name="viewport" content="width=device-width,initial-scale=1">',ae='<meta name="robots" content="index,follow">',ke='<meta name="generator" content="GrapesJS Studio">';_.components().forEach(Te=>{const De=Te.toHTML();je.title({cmp:Te})?N=De:je.favicon({cmp:Te})?G=De:je.description({cmp:Te})?W=De:je.keywords({cmp:Te})?U=De:je.socialTitle({cmp:Te})?se=De:je.socialDescription({cmp:Te})?Z=De:je.socialImage({cmp:Te})?Q=De:je.charset({cmp:Te})?ie=De:je.viewport({cmp:Te})?ue=De:je.robots({cmp:Te})?ae=De:je.generator({cmp:Te})&&(ke=De)}),N&&oe.push(N),ie&&oe.push(ie),ue&&oe.push(ue),ae&&oe.push(ae),ke&&oe.push(ke),W&&oe.push(W),U&&oe.push(U),se&&oe.push(se),Z&&oe.push(Z),Q&&oe.push(Q),G&&oe.push(G),he.length&&oe.push(...he),z&&oe.push(z),p&&!m&&oe.push(h?`<style>${p}</style>`:`<link rel="stylesheet" href="./${o}">`);const $=H.doctype||"<!DOCTYPE html>",Re=(ln=(ct=H.docEl).__attrToString)==null?void 0:ln.call(ct),Xe=(Tt=_.__attrToString)==null?void 0:Tt.call(_),We=a?t.runCommand("mjml-code-to-html").html:`${$}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
${oe.join(`
|
|
167
|
+
`},_g=TO(RO)(_b),NO={config:MO},PO=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return function(o){return n.reduceRight(function(i,s){return s(i)},o)}};function kb(t,e){return Object.keys(e).forEach(function(n){e[n]instanceof Object&&t[n]&&Object.assign(e[n],kb(t[n],e[n]))}),Sg(Sg({},t),e)}var DO={type:"cancelation",msg:"operation is manually canceled"};function Pu(t){var e=!1,n=new Promise(function(r,o){t.then(function(i){return e?o(DO):r(i)}),t.catch(o)});return n.cancel=function(){return e=!0},n}var LO=_O.create({config:kO,isInitialized:!1,resolve:null,reject:null,monaco:null}),Tb=lO(LO,2),Rl=Tb[0],Bc=Tb[1];function VO(t){var e=NO.config(t),n=e.monaco,r=sO(e,["monaco"]);Bc(function(o){return{config:kb(o.config,r),monaco:n}})}function IO(){var t=Rl(function(e){var n=e.monaco,r=e.isInitialized,o=e.resolve;return{monaco:n,isInitialized:r,resolve:o}});if(!t.isInitialized){if(Bc({isInitialized:!0}),t.monaco)return t.resolve(t.monaco),Pu(Du);if(window.monaco&&window.monaco.editor)return Ab(window.monaco),t.resolve(window.monaco),Pu(Du);PO($O,BO)(zO)}return Pu(Du)}function $O(t){return document.body.appendChild(t)}function HO(t){var e=document.createElement("script");return t&&(e.src=t),e}function BO(t){var e=Rl(function(r){var o=r.config,i=r.reject;return{config:o,reject:i}}),n=HO("".concat(e.config.paths.vs,"/loader.js"));return n.onload=function(){return t()},n.onerror=e.reject,n}function zO(){var t=Rl(function(n){var r=n.config,o=n.resolve,i=n.reject;return{config:r,resolve:o,reject:i}}),e=window.require;e.config(t.config),e(["vs/editor/editor.main"],function(n){Ab(n),t.resolve(n)},function(n){t.reject(n)})}function Ab(t){Rl().monaco||Bc({monaco:t})}function FO(){return Rl(function(t){var e=t.monaco;return e})}var Du=new Promise(function(t,e){return Bc({resolve:t,reject:e})}),Mb={config:VO,init:IO,__getMonacoInstance:FO},WO={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Lu=WO,UO={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},qO=UO;function GO({children:t}){return m.createElement("div",{style:qO.container},t)}var KO=GO,YO=KO;function JO({width:t,height:e,isEditorReady:n,loading:r,_ref:o,className:i,wrapperProps:s}){return m.createElement("section",{style:{...Lu.wrapper,width:t,height:e},...s},!n&&m.createElement(YO,null,r),m.createElement("div",{ref:o,style:{...Lu.fullWidth,...!n&&Lu.hide},className:i}))}var ZO=JO,jb=m.memo(ZO);function XO(t){m.useEffect(t,[])}var Rb=XO;function QO(t,e,n=!0){let r=m.useRef(!0);m.useEffect(r.current||!n?()=>{r.current=!1}:t,e)}var sn=QO;function qs(){}function Li(t,e,n,r){return e5(t,r)||t5(t,e,n,r)}function e5(t,e){return t.editor.getModel(Nb(t,e))}function t5(t,e,n,r){return t.editor.createModel(e,n,r?Nb(t,r):void 0)}function Nb(t,e){return t.Uri.parse(e)}function n5({original:t,modified:e,language:n,originalLanguage:r,modifiedLanguage:o,originalModelPath:i,modifiedModelPath:s,keepCurrentOriginalModel:l=!1,keepCurrentModifiedModel:a=!1,theme:c="light",loading:u="Loading...",options:d={},height:f="100%",width:p="100%",className:g,wrapperProps:b={},beforeMount:v=qs,onMount:y=qs}){let[w,S]=m.useState(!1),[C,x]=m.useState(!0),E=m.useRef(null),_=m.useRef(null),M=m.useRef(null),k=m.useRef(y),j=m.useRef(v),N=m.useRef(!1);Rb(()=>{let F=Mb.init();return F.then($=>(_.current=$)&&x(!1)).catch($=>($==null?void 0:$.type)!=="cancelation"&&console.error("Monaco initialization: error:",$)),()=>E.current?W():F.cancel()}),sn(()=>{if(E.current&&_.current){let F=E.current.getOriginalEditor(),$=Li(_.current,t||"",r||n||"text",i||"");$!==F.getModel()&&F.setModel($)}},[i],w),sn(()=>{if(E.current&&_.current){let F=E.current.getModifiedEditor(),$=Li(_.current,e||"",o||n||"text",s||"");$!==F.getModel()&&F.setModel($)}},[s],w),sn(()=>{let F=E.current.getModifiedEditor();F.getOption(_.current.editor.EditorOption.readOnly)?F.setValue(e||""):e!==F.getValue()&&(F.executeEdits("",[{range:F.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),F.pushUndoStop())},[e],w),sn(()=>{var F,$;($=(F=E.current)==null?void 0:F.getModel())==null||$.original.setValue(t||"")},[t],w),sn(()=>{let{original:F,modified:$}=E.current.getModel();_.current.editor.setModelLanguage(F,r||n||"text"),_.current.editor.setModelLanguage($,o||n||"text")},[n,r,o],w),sn(()=>{var F;(F=_.current)==null||F.editor.setTheme(c)},[c],w),sn(()=>{var F;(F=E.current)==null||F.updateOptions(d)},[d],w);let P=m.useCallback(()=>{var J;if(!_.current)return;j.current(_.current);let F=Li(_.current,t||"",r||n||"text",i||""),$=Li(_.current,e||"",o||n||"text",s||"");(J=E.current)==null||J.setModel({original:F,modified:$})},[n,e,o,t,r,i,s]),z=m.useCallback(()=>{var F;!N.current&&M.current&&(E.current=_.current.editor.createDiffEditor(M.current,{automaticLayout:!0,...d}),P(),(F=_.current)==null||F.editor.setTheme(c),S(!0),N.current=!0)},[d,c,P]);m.useEffect(()=>{w&&k.current(E.current,_.current)},[w]),m.useEffect(()=>{!C&&!w&&z()},[C,w,z]);function W(){var $,J,ee,L;let F=($=E.current)==null?void 0:$.getModel();l||((J=F==null?void 0:F.original)==null||J.dispose()),a||((ee=F==null?void 0:F.modified)==null||ee.dispose()),(L=E.current)==null||L.dispose()}return m.createElement(jb,{width:p,height:f,isEditorReady:w,loading:u,_ref:M,className:g,wrapperProps:b})}var r5=n5;m.memo(r5);function o5(t){let e=m.useRef();return m.useEffect(()=>{e.current=t},[t]),e.current}var i5=o5,ea=new Map;function s5({defaultValue:t,defaultLanguage:e,defaultPath:n,value:r,language:o,path:i,theme:s="light",line:l,loading:a="Loading...",options:c={},overrideServices:u={},saveViewState:d=!0,keepCurrentModel:f=!1,width:p="100%",height:g="100%",className:b,wrapperProps:v={},beforeMount:y=qs,onMount:w=qs,onChange:S,onValidate:C=qs}){let[x,E]=m.useState(!1),[_,M]=m.useState(!0),k=m.useRef(null),j=m.useRef(null),N=m.useRef(null),P=m.useRef(w),z=m.useRef(y),W=m.useRef(),F=m.useRef(r),$=i5(i),J=m.useRef(!1),ee=m.useRef(!1);Rb(()=>{let A=Mb.init();return A.then(R=>(k.current=R)&&M(!1)).catch(R=>(R==null?void 0:R.type)!=="cancelation"&&console.error("Monaco initialization: error:",R)),()=>j.current?I():A.cancel()}),sn(()=>{var R,q,D,V;let A=Li(k.current,t||r||"",e||o||"",i||n||"");A!==((R=j.current)==null?void 0:R.getModel())&&(d&&ea.set($,(q=j.current)==null?void 0:q.saveViewState()),(D=j.current)==null||D.setModel(A),d&&((V=j.current)==null||V.restoreViewState(ea.get(i))))},[i],x),sn(()=>{var A;(A=j.current)==null||A.updateOptions(c)},[c],x),sn(()=>{!j.current||r===void 0||(j.current.getOption(k.current.editor.EditorOption.readOnly)?j.current.setValue(r):r!==j.current.getValue()&&(ee.current=!0,j.current.executeEdits("",[{range:j.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),j.current.pushUndoStop(),ee.current=!1))},[r],x),sn(()=>{var R,q;let A=(R=j.current)==null?void 0:R.getModel();A&&o&&((q=k.current)==null||q.editor.setModelLanguage(A,o))},[o],x),sn(()=>{var A;l!==void 0&&((A=j.current)==null||A.revealLine(l))},[l],x),sn(()=>{var A;(A=k.current)==null||A.editor.setTheme(s)},[s],x);let L=m.useCallback(()=>{var A;if(!(!N.current||!k.current)&&!J.current){z.current(k.current);let R=i||n,q=Li(k.current,r||t||"",e||o||"",R||"");j.current=(A=k.current)==null?void 0:A.editor.create(N.current,{model:q,automaticLayout:!0,...c},u),d&&j.current.restoreViewState(ea.get(R)),k.current.editor.setTheme(s),l!==void 0&&j.current.revealLine(l),E(!0),J.current=!0}},[t,e,n,r,o,i,c,u,d,s,l]);m.useEffect(()=>{x&&P.current(j.current,k.current)},[x]),m.useEffect(()=>{!_&&!x&&L()},[_,x,L]),F.current=r,m.useEffect(()=>{var A,R;x&&S&&((A=W.current)==null||A.dispose(),W.current=(R=j.current)==null?void 0:R.onDidChangeModelContent(q=>{ee.current||S(j.current.getValue(),q)}))},[x,S]),m.useEffect(()=>{if(x){let A=k.current.editor.onDidChangeMarkers(R=>{var D;let q=(D=j.current.getModel())==null?void 0:D.uri;if(q&&R.find(V=>V.path===q.path)){let V=k.current.editor.getModelMarkers({resource:q});C==null||C(V)}});return()=>{A==null||A.dispose()}}return()=>{}},[x,C]);function I(){var A,R;(A=W.current)==null||A.dispose(),f?d&&ea.set(i,j.current.saveViewState()):(R=j.current.getModel())==null||R.dispose(),j.current.dispose()}return m.createElement(jb,{width:p,height:g,isEditorReady:x,loading:a,_ref:N,className:b,wrapperProps:v})}var l5=s5,a5=m.memo(l5),c5=a5,u5=Object.defineProperty,d5=(t,e,n)=>e in t?u5(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Vu=(t,e,n)=>(d5(t,typeof e!="symbol"?e+"":e,n),n);let f5=class{constructor(){Vu(this,"current",this.detect()),Vu(this,"handoffState","pending"),Vu(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Ir=new f5,bt=(t,e)=>{Ir.isServer?m.useEffect(t,e):m.useLayoutEffect(t,e)};function Xt(t){let e=m.useRef(t);return bt(()=>{e.current=t},[t]),e}function Pb(t,e){let[n,r]=m.useState(t),o=Xt(t);return bt(()=>r(o.current),[o,r,...e]),n}let ae=function(t){let e=Xt(t);return m.useCallback((...n)=>e.current(...n),[e])};function fp(t,e,n){let[r,o]=m.useState(n),i=t!==void 0,s=m.useRef(i),l=m.useRef(!1),a=m.useRef(!1);return i&&!s.current&&!l.current?(l.current=!0,s.current=i,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!i&&s.current&&!a.current&&(a.current=!0,s.current=i,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[i?t:r,ae(c=>(i||o(c),e==null?void 0:e(c)))]}function Db(t){typeof queueMicrotask=="function"?queueMicrotask(t):Promise.resolve().then(t).catch(e=>setTimeout(()=>{throw e}))}function Co(){let t=[],e={addEventListener(n,r,o,i){return n.addEventListener(r,o,i),e.add(()=>n.removeEventListener(r,o,i))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return e.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return e.requestAnimationFrame(()=>e.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return e.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return Db(()=>{r.current&&n[0]()}),e.add(()=>{r.current=!1})},style(n,r,o){let i=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:i})})},group(n){let r=Co();return n(r),this.add(()=>r.dispose())},add(n){return t.push(n),()=>{let r=t.indexOf(n);if(r>=0)for(let o of t.splice(r,1))o()}},dispose(){for(let n of t.splice(0))n()}};return e}function Eo(){let[t]=m.useState(Co);return m.useEffect(()=>()=>t.dispose(),[t]),t}function p5(){let t=typeof document>"u";return"useSyncExternalStore"in kn?(e=>e.useSyncExternalStore)(kn)(()=>()=>{},()=>!1,()=>!t):!1}function zc(){let t=p5(),[e,n]=kn.useState(Ir.isHandoffComplete);return e&&Ir.isHandoffComplete===!1&&n(!1),kn.useEffect(()=>{e!==!0&&n(!0)},[e]),kn.useEffect(()=>Ir.handoff(),[]),t?!1:e}var kg;let Mt=(kg=m.useId)!=null?kg:function(){let t=zc(),[e,n]=m.useState(t?()=>Ir.nextId():null);return bt(()=>{e===null&&n(Ir.nextId())},[e]),e!=null?""+e:void 0};function Ue(t,e,...n){if(t in e){let o=e[t];return typeof o=="function"?o(...n):o}let r=new Error(`Tried to handle "${t}" but there is no handler defined. Only defined handlers are: ${Object.keys(e).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Ue),r}function xi(t){return Ir.isServer?null:t instanceof Node?t.ownerDocument:t!=null&&t.hasOwnProperty("current")&&t.current instanceof Node?t.current.ownerDocument:document}let nf=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(t=>`${t}:not([tabindex='-1'])`).join(",");var dn=(t=>(t[t.First=1]="First",t[t.Previous=2]="Previous",t[t.Next=4]="Next",t[t.Last=8]="Last",t[t.WrapAround=16]="WrapAround",t[t.NoScroll=32]="NoScroll",t))(dn||{}),Qi=(t=>(t[t.Error=0]="Error",t[t.Overflow=1]="Overflow",t[t.Success=2]="Success",t[t.Underflow=3]="Underflow",t))(Qi||{}),h5=(t=>(t[t.Previous=-1]="Previous",t[t.Next=1]="Next",t))(h5||{});function Fc(t=document.body){return t==null?[]:Array.from(t.querySelectorAll(nf)).sort((e,n)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Wc=(t=>(t[t.Strict=0]="Strict",t[t.Loose=1]="Loose",t))(Wc||{});function pp(t,e=0){var n;return t===((n=xi(t))==null?void 0:n.body)?!1:Ue(e,{0(){return t.matches(nf)},1(){let r=t;for(;r!==null;){if(r.matches(nf))return!0;r=r.parentElement}return!1}})}var g5=(t=>(t[t.Keyboard=0]="Keyboard",t[t.Mouse=1]="Mouse",t))(g5||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",t=>{t.metaKey||t.altKey||t.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",t=>{t.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:t.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let m5=["textarea","input"].join(",");function b5(t){var e,n;return(n=(e=t==null?void 0:t.matches)==null?void 0:e.call(t,m5))!=null?n:!1}function hp(t,e=n=>n){return t.slice().sort((n,r)=>{let o=e(n),i=e(r);if(o===null||i===null)return 0;let s=o.compareDocumentPosition(i);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Dr(t,e,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let i=Array.isArray(t)?t.length>0?t[0].ownerDocument:document:t.ownerDocument,s=Array.isArray(t)?n?hp(t):t:Fc(t);o.length>0&&s.length>1&&(s=s.filter(p=>!o.includes(p))),r=r??i.activeElement;let l=(()=>{if(e&5)return 1;if(e&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),a=(()=>{if(e&1)return 0;if(e&2)return Math.max(0,s.indexOf(r))-1;if(e&4)return Math.max(0,s.indexOf(r))+1;if(e&8)return s.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=e&32?{preventScroll:!0}:{},u=0,d=s.length,f;do{if(u>=d||u+d<=0)return 0;let p=a+u;if(e&16)p=(p+d)%d;else{if(p<0)return 3;if(p>=d)return 1}f=s[p],f==null||f.focus(c),u+=l}while(f!==i.activeElement);return e&6&&b5(f)&&f.select(),2}function v5(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function y5(){return/Android/gi.test(window.navigator.userAgent)}function x5(){return v5()||y5()}function ta(t,e,n){let r=Xt(e);m.useEffect(()=>{function o(i){r.current(i)}return document.addEventListener(t,o,n),()=>document.removeEventListener(t,o,n)},[t,n])}function Lb(t,e,n){let r=Xt(e);m.useEffect(()=>{function o(i){r.current(i)}return window.addEventListener(t,o,n),()=>window.removeEventListener(t,o,n)},[t,n])}function Vb(t,e,n=!0){let r=m.useRef(!1);m.useEffect(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);function o(s,l){if(!r.current||s.defaultPrevented)return;let a=l(s);if(a===null||!a.getRootNode().contains(a)||!a.isConnected)return;let c=function u(d){return typeof d=="function"?u(d()):Array.isArray(d)||d instanceof Set?d:[d]}(t);for(let u of c){if(u===null)continue;let d=u instanceof HTMLElement?u:u.current;if(d!=null&&d.contains(a)||s.composed&&s.composedPath().includes(d))return}return!pp(a,Wc.Loose)&&a.tabIndex!==-1&&s.preventDefault(),e(s,a)}let i=m.useRef(null);ta("pointerdown",s=>{var l,a;r.current&&(i.current=((a=(l=s.composedPath)==null?void 0:l.call(s))==null?void 0:a[0])||s.target)},!0),ta("mousedown",s=>{var l,a;r.current&&(i.current=((a=(l=s.composedPath)==null?void 0:l.call(s))==null?void 0:a[0])||s.target)},!0),ta("click",s=>{x5()||i.current&&(o(s,()=>i.current),i.current=null)},!0),ta("touchend",s=>o(s,()=>s.target instanceof HTMLElement?s.target:null),!0),Lb("blur",s=>o(s,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function bs(...t){return m.useMemo(()=>xi(...t),[...t])}function Tg(t){var e;if(t.type)return t.type;let n=(e=t.as)!=null?e:"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function Uc(t,e){let[n,r]=m.useState(()=>Tg(t));return bt(()=>{r(Tg(t))},[t.type,t.as]),bt(()=>{n||e.current&&e.current instanceof HTMLButtonElement&&!e.current.hasAttribute("type")&&r("button")},[n,e]),n}let Ib=Symbol();function gp(t,e=!0){return Object.assign(t,{[Ib]:e})}function lt(...t){let e=m.useRef(t);m.useEffect(()=>{e.current=t},[t]);let n=ae(r=>{for(let o of e.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return t.every(r=>r==null||(r==null?void 0:r[Ib]))?void 0:n}function Ag(t){return[t.screenX,t.screenY]}function w5(){let t=m.useRef([-1,-1]);return{wasMoved(e){let n=Ag(e);return t.current[0]===n[0]&&t.current[1]===n[1]?!1:(t.current=n,!0)},update(e){t.current=Ag(e)}}}function S5({container:t,accept:e,walk:n,enabled:r=!0}){let o=m.useRef(e),i=m.useRef(n);m.useEffect(()=>{o.current=e,i.current=n},[e,n]),bt(()=>{if(!t||!r)return;let s=xi(t);if(!s)return;let l=o.current,a=i.current,c=Object.assign(d=>l(d),{acceptNode:l}),u=s.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,c,!1);for(;u.nextNode();)a(u.currentNode)},[t,r,o,i])}function ic(...t){return Array.from(new Set(t.flatMap(e=>typeof e=="string"?e.split(" "):[]))).filter(Boolean).join(" ")}var gr=(t=>(t[t.None=0]="None",t[t.RenderStrategy=1]="RenderStrategy",t[t.Static=2]="Static",t))(gr||{}),co=(t=>(t[t.Unmount=0]="Unmount",t[t.Hidden=1]="Hidden",t))(co||{});function nt({ourProps:t,theirProps:e,slot:n,defaultTag:r,features:o,visible:i=!0,name:s,mergeRefs:l}){l=l??C5;let a=$b(e,t);if(i)return na(a,n,r,s,l);let c=o??0;if(c&2){let{static:u=!1,...d}=a;if(u)return na(d,n,r,s,l)}if(c&1){let{unmount:u=!0,...d}=a;return Ue(u?0:1,{0(){return null},1(){return na({...d,hidden:!0,style:{display:"none"}},n,r,s,l)}})}return na(a,n,r,s,l)}function na(t,e={},n,r,o){let{as:i=n,children:s,refName:l="ref",...a}=Iu(t,["unmount","static"]),c=t.ref!==void 0?{[l]:t.ref}:{},u=typeof s=="function"?s(e):s;"className"in a&&a.className&&typeof a.className=="function"&&(a.className=a.className(e));let d={};if(e){let f=!1,p=[];for(let[g,b]of Object.entries(e))typeof b=="boolean"&&(f=!0),b===!0&&p.push(g);f&&(d["data-headlessui-state"]=p.join(" "))}if(i===m.Fragment&&Object.keys(dl(a)).length>0){if(!m.isValidElement(u)||Array.isArray(u)&&u.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(a).map(b=>` - ${b}`).join(`
|
|
168
|
+
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(b=>` - ${b}`).join(`
|
|
169
|
+
`)].join(`
|
|
170
|
+
`));let f=u.props,p=typeof(f==null?void 0:f.className)=="function"?(...b)=>ic(f==null?void 0:f.className(...b),a.className):ic(f==null?void 0:f.className,a.className),g=p?{className:p}:{};return m.cloneElement(u,Object.assign({},$b(u.props,dl(Iu(a,["ref"]))),d,c,{ref:o(u.ref,c.ref)},g))}return m.createElement(i,Object.assign({},Iu(a,["ref"]),i!==m.Fragment&&c,i!==m.Fragment&&d),u)}function mp(){let t=m.useRef([]),e=m.useCallback(n=>{for(let r of t.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return t.current=n,e}}function C5(...t){return t.every(e=>e==null)?void 0:e=>{for(let n of t)n!=null&&(typeof n=="function"?n(e):n.current=e)}}function $b(...t){if(t.length===0)return{};if(t.length===1)return t[0];let e={},n={};for(let r of t)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):e[o]=r[o];if(e.disabled||e["aria-disabled"])return Object.assign(e,Object.fromEntries(Object.keys(n).map(r=>[r,void 0])));for(let r in n)Object.assign(e,{[r](o,...i){let s=n[r];for(let l of s){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;l(o,...i)}}});return e}function rt(t){var e;return Object.assign(m.forwardRef(t),{displayName:(e=t.displayName)!=null?e:t.name})}function dl(t){let e=Object.assign({},t);for(let n in e)e[n]===void 0&&delete e[n];return e}function Iu(t,e=[]){let n=Object.assign({},t);for(let r of e)r in n&&delete n[r];return n}let E5="div";var zr=(t=>(t[t.None=1]="None",t[t.Focusable=2]="Focusable",t[t.Hidden=4]="Hidden",t))(zr||{});function O5(t,e){var n;let{features:r=1,...o}=t,i={ref:e,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return nt({ourProps:i,theirProps:o,slot:{},defaultTag:E5,name:"Hidden"})}let Oo=rt(O5),bp=m.createContext(null);bp.displayName="OpenClosedContext";var st=(t=>(t[t.Open=1]="Open",t[t.Closed=2]="Closed",t[t.Closing=4]="Closing",t[t.Opening=8]="Opening",t))(st||{});function vs(){return m.useContext(bp)}function qc({value:t,children:e}){return m.createElement(bp.Provider,{value:t},e)}function ci(t){let e=t.parentElement,n=null;for(;e&&!(e instanceof HTMLFieldSetElement);)e instanceof HTMLLegendElement&&(n=e),e=e.parentElement;let r=(e==null?void 0:e.getAttribute("disabled"))==="";return r&&_5(n)?!1:r}function _5(t){if(!t)return!1;let e=t.previousElementSibling;for(;e!==null;){if(e instanceof HTMLLegendElement)return!1;e=e.previousElementSibling}return!0}function k5(t){throw new Error("Unexpected object: "+t)}var Yt=(t=>(t[t.First=0]="First",t[t.Previous=1]="Previous",t[t.Next=2]="Next",t[t.Last=3]="Last",t[t.Specific=4]="Specific",t[t.Nothing=5]="Nothing",t))(Yt||{});function T5(t,e){let n=e.resolveItems();if(n.length<=0)return null;let r=e.resolveActiveIndex(),o=r??-1;switch(t.focus){case 0:{for(let i=0;i<n.length;++i)if(!e.resolveDisabled(n[i],i,n))return i;return r}case 1:{for(let i=o-1;i>=0;--i)if(!e.resolveDisabled(n[i],i,n))return i;return r}case 2:{for(let i=o+1;i<n.length;++i)if(!e.resolveDisabled(n[i],i,n))return i;return r}case 3:{for(let i=n.length-1;i>=0;--i)if(!e.resolveDisabled(n[i],i,n))return i;return r}case 4:{for(let i=0;i<n.length;++i)if(e.resolveId(n[i],i,n)===t.id)return i;return r}case 5:return null;default:k5(t)}}function vp(t={},e=null,n=[]){for(let[r,o]of Object.entries(t))Bb(n,Hb(e,r),o);return n}function Hb(t,e){return t?t+"["+e+"]":e}function Bb(t,e,n){if(Array.isArray(n))for(let[r,o]of n.entries())Bb(t,Hb(e,r.toString()),o);else n instanceof Date?t.push([e,n.toISOString()]):typeof n=="boolean"?t.push([e,n?"1":"0"]):typeof n=="string"?t.push([e,n]):typeof n=="number"?t.push([e,`${n}`]):n==null?t.push([e,""]):vp(n,e,t)}function zb(t){var e,n;let r=(e=t==null?void 0:t.form)!=null?e:t.closest("form");if(r){for(let o of r.elements)if(o!==t&&(o.tagName==="INPUT"&&o.type==="submit"||o.tagName==="BUTTON"&&o.type==="submit"||o.nodeName==="INPUT"&&o.type==="image")){o.click();return}(n=r.requestSubmit)==null||n.call(r)}}var Oe=(t=>(t.Space=" ",t.Enter="Enter",t.Escape="Escape",t.Backspace="Backspace",t.Delete="Delete",t.ArrowLeft="ArrowLeft",t.ArrowUp="ArrowUp",t.ArrowRight="ArrowRight",t.ArrowDown="ArrowDown",t.Home="Home",t.End="End",t.PageUp="PageUp",t.PageDown="PageDown",t.Tab="Tab",t))(Oe||{});function A5(t,e,n,r){let o=Xt(n);m.useEffect(()=>{t=t??window;function i(s){o.current(s)}return t.addEventListener(e,i,r),()=>t.removeEventListener(e,i,r)},[t,e,r])}function yp(){let t=m.useRef(!1);return bt(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function M5(t){let e=ae(t),n=m.useRef(!1);m.useEffect(()=>(n.current=!1,()=>{n.current=!0,Db(()=>{n.current&&e()})}),[e])}var Lr=(t=>(t[t.Forwards=0]="Forwards",t[t.Backwards=1]="Backwards",t))(Lr||{});function Fb(){let t=m.useRef(0);return Lb("keydown",e=>{e.key==="Tab"&&(t.current=e.shiftKey?1:0)},!0),t}let j5=m.createContext(!1);function R5(){return m.useContext(j5)}function N5(t){let e=R5(),n=m.useContext(Wb),r=bs(t),[o,i]=m.useState(()=>{if(!e&&n!==null||Ir.isServer)return null;let s=r==null?void 0:r.getElementById("headlessui-portal-root");if(s)return s;if(r===null)return null;let l=r.createElement("div");return l.setAttribute("id","headlessui-portal-root"),r.body.appendChild(l)});return m.useEffect(()=>{o!==null&&(r!=null&&r.body.contains(o)||r==null||r.body.appendChild(o))},[o,r]),m.useEffect(()=>{e||n!==null&&i(n.current)},[n,i,e]),o}let P5=m.Fragment;function D5(t,e){let n=t,r=m.useRef(null),o=lt(gp(u=>{r.current=u}),e),i=bs(r),s=N5(r),[l]=m.useState(()=>{var u;return Ir.isServer?null:(u=i==null?void 0:i.createElement("div"))!=null?u:null}),a=m.useContext(rf),c=zc();return bt(()=>{!s||!l||s.contains(l)||(l.setAttribute("data-headlessui-portal",""),s.appendChild(l))},[s,l]),bt(()=>{if(l&&a)return a.register(l)},[a,l]),M5(()=>{var u;!s||!l||(l instanceof Node&&s.contains(l)&&s.removeChild(l),s.childNodes.length<=0&&((u=s.parentElement)==null||u.removeChild(s)))}),c?!s||!l?null:ir.createPortal(nt({ourProps:{ref:o},theirProps:n,defaultTag:P5,name:"Portal"}),l):null}let L5=m.Fragment,Wb=m.createContext(null);function V5(t,e){let{target:n,...r}=t,o={ref:lt(e)};return m.createElement(Wb.Provider,{value:n},nt({ourProps:o,theirProps:r,defaultTag:L5,name:"Popover.Group"}))}let rf=m.createContext(null);function I5(){let t=m.useContext(rf),e=m.useRef([]),n=ae(i=>(e.current.push(i),t&&t.register(i),()=>r(i))),r=ae(i=>{let s=e.current.indexOf(i);s!==-1&&e.current.splice(s,1),t&&t.unregister(i)}),o=m.useMemo(()=>({register:n,unregister:r,portals:e}),[n,r,e]);return[e,m.useMemo(()=>function({children:i}){return m.createElement(rf.Provider,{value:o},i)},[o])]}let $5=rt(D5),H5=rt(V5);Object.assign($5,{Group:H5});function B5({defaultContainers:t=[],portals:e,mainTreeNodeRef:n}={}){var r;let o=m.useRef((r=n==null?void 0:n.current)!=null?r:null),i=bs(o),s=ae(()=>{var l,a,c;let u=[];for(let d of t)d!==null&&(d instanceof HTMLElement?u.push(d):"current"in d&&d.current instanceof HTMLElement&&u.push(d.current));if(e!=null&&e.current)for(let d of e.current)u.push(d);for(let d of(l=i==null?void 0:i.querySelectorAll("html > *, body > *"))!=null?l:[])d!==document.body&&d!==document.head&&d instanceof HTMLElement&&d.id!=="headlessui-portal-root"&&(d.contains(o.current)||d.contains((c=(a=o.current)==null?void 0:a.getRootNode())==null?void 0:c.host)||u.some(f=>d.contains(f))||u.push(d));return u});return{resolveContainers:s,contains:ae(l=>s().some(a=>a.contains(l))),mainTreeNodeRef:o,MainTreeNode:m.useMemo(()=>function(){return n!=null?null:m.createElement(Oo,{features:zr.Hidden,ref:o})},[o,n])}}function z5(){let t=m.useRef(null);return{mainTreeNodeRef:t,MainTreeNode:m.useMemo(()=>function(){return m.createElement(Oo,{features:zr.Hidden,ref:t})},[t])}}let Ub=m.createContext(null);function qb(){let t=m.useContext(Ub);if(t===null){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,qb),e}return t}function xp(){let[t,e]=m.useState([]);return[t.length>0?t.join(" "):void 0,m.useMemo(()=>function(n){let r=ae(i=>(e(s=>[...s,i]),()=>e(s=>{let l=s.slice(),a=l.indexOf(i);return a!==-1&&l.splice(a,1),l}))),o=m.useMemo(()=>({register:r,slot:n.slot,name:n.name,props:n.props}),[r,n.slot,n.name,n.props]);return m.createElement(Ub.Provider,{value:o},n.children)},[e])]}let F5="p";function W5(t,e){let n=Mt(),{id:r=`headlessui-description-${n}`,...o}=t,i=qb(),s=lt(e);bt(()=>i.register(r),[r,i.register]);let l={ref:s,...i.props,id:r};return nt({ourProps:l,theirProps:o,slot:i.slot||{},defaultTag:F5,name:i.name||"Description"})}let U5=rt(W5),Gb=Object.assign(U5,{});var Mg;let q5=(Mg=m.startTransition)!=null?Mg:function(t){t()};var G5=(t=>(t[t.Open=0]="Open",t[t.Closed=1]="Closed",t))(G5||{}),K5=(t=>(t[t.ToggleDisclosure=0]="ToggleDisclosure",t[t.CloseDisclosure=1]="CloseDisclosure",t[t.SetButtonId=2]="SetButtonId",t[t.SetPanelId=3]="SetPanelId",t[t.LinkPanel=4]="LinkPanel",t[t.UnlinkPanel=5]="UnlinkPanel",t))(K5||{});let Y5={0:t=>({...t,disclosureState:Ue(t.disclosureState,{0:1,1:0})}),1:t=>t.disclosureState===1?t:{...t,disclosureState:1},4(t){return t.linkedPanel===!0?t:{...t,linkedPanel:!0}},5(t){return t.linkedPanel===!1?t:{...t,linkedPanel:!1}},2(t,e){return t.buttonId===e.buttonId?t:{...t,buttonId:e.buttonId}},3(t,e){return t.panelId===e.panelId?t:{...t,panelId:e.panelId}}},wp=m.createContext(null);wp.displayName="DisclosureContext";function Sp(t){let e=m.useContext(wp);if(e===null){let n=new Error(`<${t} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Sp),n}return e}let Cp=m.createContext(null);Cp.displayName="DisclosureAPIContext";function Kb(t){let e=m.useContext(Cp);if(e===null){let n=new Error(`<${t} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Kb),n}return e}let Ep=m.createContext(null);Ep.displayName="DisclosurePanelContext";function J5(){return m.useContext(Ep)}function Z5(t,e){return Ue(e.type,Y5,t,e)}let X5=m.Fragment;function Q5(t,e){let{defaultOpen:n=!1,...r}=t,o=m.useRef(null),i=lt(e,gp(v=>{o.current=v},t.as===void 0||t.as===m.Fragment)),s=m.useRef(null),l=m.useRef(null),a=m.useReducer(Z5,{disclosureState:n?0:1,linkedPanel:!1,buttonRef:l,panelRef:s,buttonId:null,panelId:null}),[{disclosureState:c,buttonId:u},d]=a,f=ae(v=>{d({type:1});let y=xi(o);if(!y||!u)return;let w=v?v instanceof HTMLElement?v:v.current instanceof HTMLElement?v.current:y.getElementById(u):y.getElementById(u);w==null||w.focus()}),p=m.useMemo(()=>({close:f}),[f]),g=m.useMemo(()=>({open:c===0,close:f}),[c,f]),b={ref:i};return m.createElement(wp.Provider,{value:a},m.createElement(Cp.Provider,{value:p},m.createElement(qc,{value:Ue(c,{0:st.Open,1:st.Closed})},nt({ourProps:b,theirProps:r,slot:g,defaultTag:X5,name:"Disclosure"}))))}let e_="button";function t_(t,e){let n=Mt(),{id:r=`headlessui-disclosure-button-${n}`,...o}=t,[i,s]=Sp("Disclosure.Button"),l=J5(),a=l===null?!1:l===i.panelId,c=m.useRef(null),u=lt(c,e,a?null:i.buttonRef),d=mp();m.useEffect(()=>{if(!a)return s({type:2,buttonId:r}),()=>{s({type:2,buttonId:null})}},[r,s,a]);let f=ae(w=>{var S;if(a){if(i.disclosureState===1)return;switch(w.key){case Oe.Space:case Oe.Enter:w.preventDefault(),w.stopPropagation(),s({type:0}),(S=i.buttonRef.current)==null||S.focus();break}}else switch(w.key){case Oe.Space:case Oe.Enter:w.preventDefault(),w.stopPropagation(),s({type:0});break}}),p=ae(w=>{switch(w.key){case Oe.Space:w.preventDefault();break}}),g=ae(w=>{var S;ci(w.currentTarget)||t.disabled||(a?(s({type:0}),(S=i.buttonRef.current)==null||S.focus()):s({type:0}))}),b=m.useMemo(()=>({open:i.disclosureState===0}),[i]),v=Uc(t,c),y=a?{ref:u,type:v,onKeyDown:f,onClick:g}:{ref:u,id:r,type:v,"aria-expanded":i.disclosureState===0,"aria-controls":i.linkedPanel?i.panelId:void 0,onKeyDown:f,onKeyUp:p,onClick:g};return nt({mergeRefs:d,ourProps:y,theirProps:o,slot:b,defaultTag:e_,name:"Disclosure.Button"})}let n_="div",r_=gr.RenderStrategy|gr.Static;function o_(t,e){let n=Mt(),{id:r=`headlessui-disclosure-panel-${n}`,...o}=t,[i,s]=Sp("Disclosure.Panel"),{close:l}=Kb("Disclosure.Panel"),a=mp(),c=lt(e,i.panelRef,g=>{q5(()=>s({type:g?4:5}))});m.useEffect(()=>(s({type:3,panelId:r}),()=>{s({type:3,panelId:null})}),[r,s]);let u=vs(),d=u!==null?(u&st.Open)===st.Open:i.disclosureState===0,f=m.useMemo(()=>({open:i.disclosureState===0,close:l}),[i,l]),p={ref:c,id:r};return m.createElement(Ep.Provider,{value:i.panelId},nt({mergeRefs:a,ourProps:p,theirProps:o,slot:f,defaultTag:n_,features:r_,visible:d,name:"Disclosure.Panel"}))}let i_=rt(Q5),s_=rt(t_),l_=rt(o_),$u=Object.assign(i_,{Button:s_,Panel:l_}),jg=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Rg(t){var e,n;let r=(e=t.innerText)!=null?e:"",o=t.cloneNode(!0);if(!(o instanceof HTMLElement))return r;let i=!1;for(let l of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))l.remove(),i=!0;let s=i?(n=o.innerText)!=null?n:"":r;return jg.test(s)&&(s=s.replace(jg,"")),s}function a_(t){let e=t.getAttribute("aria-label");if(typeof e=="string")return e.trim();let n=t.getAttribute("aria-labelledby");if(n){let r=n.split(" ").map(o=>{let i=document.getElementById(o);if(i){let s=i.getAttribute("aria-label");return typeof s=="string"?s.trim():Rg(i).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return Rg(t).trim()}function c_(t){let e=m.useRef(""),n=m.useRef("");return ae(()=>{let r=t.current;if(!r)return"";let o=r.innerText;if(e.current===o)return n.current;let i=a_(r).trim().toLowerCase();return e.current=o,n.current=i,i})}var u_=(t=>(t[t.Open=0]="Open",t[t.Closed=1]="Closed",t))(u_||{}),d_=(t=>(t[t.Single=0]="Single",t[t.Multi=1]="Multi",t))(d_||{}),f_=(t=>(t[t.Pointer=0]="Pointer",t[t.Other=1]="Other",t))(f_||{}),p_=(t=>(t[t.OpenListbox=0]="OpenListbox",t[t.CloseListbox=1]="CloseListbox",t[t.GoToOption=2]="GoToOption",t[t.Search=3]="Search",t[t.ClearSearch=4]="ClearSearch",t[t.RegisterOption=5]="RegisterOption",t[t.UnregisterOption=6]="UnregisterOption",t[t.RegisterLabel=7]="RegisterLabel",t))(p_||{});function Hu(t,e=n=>n){let n=t.activeOptionIndex!==null?t.options[t.activeOptionIndex]:null,r=hp(e(t.options.slice()),i=>i.dataRef.current.domRef.current),o=n?r.indexOf(n):null;return o===-1&&(o=null),{options:r,activeOptionIndex:o}}let h_={1(t){return t.dataRef.current.disabled||t.listboxState===1?t:{...t,activeOptionIndex:null,listboxState:1}},0(t){if(t.dataRef.current.disabled||t.listboxState===0)return t;let e=t.activeOptionIndex,{isSelected:n}=t.dataRef.current,r=t.options.findIndex(o=>n(o.dataRef.current.value));return r!==-1&&(e=r),{...t,listboxState:0,activeOptionIndex:e}},2(t,e){var n;if(t.dataRef.current.disabled||t.listboxState===1)return t;let r=Hu(t),o=T5(e,{resolveItems:()=>r.options,resolveActiveIndex:()=>r.activeOptionIndex,resolveId:i=>i.id,resolveDisabled:i=>i.dataRef.current.disabled});return{...t,...r,searchQuery:"",activeOptionIndex:o,activationTrigger:(n=e.trigger)!=null?n:1}},3:(t,e)=>{if(t.dataRef.current.disabled||t.listboxState===1)return t;let n=t.searchQuery!==""?0:1,r=t.searchQuery+e.value.toLowerCase(),o=(t.activeOptionIndex!==null?t.options.slice(t.activeOptionIndex+n).concat(t.options.slice(0,t.activeOptionIndex+n)):t.options).find(s=>{var l;return!s.dataRef.current.disabled&&((l=s.dataRef.current.textValue)==null?void 0:l.startsWith(r))}),i=o?t.options.indexOf(o):-1;return i===-1||i===t.activeOptionIndex?{...t,searchQuery:r}:{...t,searchQuery:r,activeOptionIndex:i,activationTrigger:1}},4(t){return t.dataRef.current.disabled||t.listboxState===1||t.searchQuery===""?t:{...t,searchQuery:""}},5:(t,e)=>{let n={id:e.id,dataRef:e.dataRef},r=Hu(t,o=>[...o,n]);return t.activeOptionIndex===null&&t.dataRef.current.isSelected(e.dataRef.current.value)&&(r.activeOptionIndex=r.options.indexOf(n)),{...t,...r}},6:(t,e)=>{let n=Hu(t,r=>{let o=r.findIndex(i=>i.id===e.id);return o!==-1&&r.splice(o,1),r});return{...t,...n,activationTrigger:1}},7:(t,e)=>({...t,labelId:e.id})},Op=m.createContext(null);Op.displayName="ListboxActionsContext";function Nl(t){let e=m.useContext(Op);if(e===null){let n=new Error(`<${t} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Nl),n}return e}let _p=m.createContext(null);_p.displayName="ListboxDataContext";function Pl(t){let e=m.useContext(_p);if(e===null){let n=new Error(`<${t} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Pl),n}return e}function g_(t,e){return Ue(e.type,h_,t,e)}let m_=m.Fragment;function b_(t,e){let{value:n,defaultValue:r,form:o,name:i,onChange:s,by:l=(D,V)=>D===V,disabled:a=!1,horizontal:c=!1,multiple:u=!1,...d}=t;const f=c?"horizontal":"vertical";let p=lt(e),[g=u?[]:void 0,b]=fp(n,s,r),[v,y]=m.useReducer(g_,{dataRef:m.createRef(),listboxState:1,options:[],searchQuery:"",labelId:null,activeOptionIndex:null,activationTrigger:1}),w=m.useRef({static:!1,hold:!1}),S=m.useRef(null),C=m.useRef(null),x=m.useRef(null),E=ae(typeof l=="string"?(D,V)=>{let te=l;return(D==null?void 0:D[te])===(V==null?void 0:V[te])}:l),_=m.useCallback(D=>Ue(M.mode,{1:()=>g.some(V=>E(V,D)),0:()=>E(g,D)}),[g]),M=m.useMemo(()=>({...v,value:g,disabled:a,mode:u?1:0,orientation:f,compare:E,isSelected:_,optionsPropsRef:w,labelRef:S,buttonRef:C,optionsRef:x}),[g,a,u,v]);bt(()=>{v.dataRef.current=M},[M]),Vb([M.buttonRef,M.optionsRef],(D,V)=>{var te;y({type:1}),pp(V,Wc.Loose)||(D.preventDefault(),(te=M.buttonRef.current)==null||te.focus())},M.listboxState===0);let k=m.useMemo(()=>({open:M.listboxState===0,disabled:a,value:g}),[M,a,g]),j=ae(D=>{let V=M.options.find(te=>te.id===D);V&&J(V.dataRef.current.value)}),N=ae(()=>{if(M.activeOptionIndex!==null){let{dataRef:D,id:V}=M.options[M.activeOptionIndex];J(D.current.value),y({type:2,focus:Yt.Specific,id:V})}}),P=ae(()=>y({type:0})),z=ae(()=>y({type:1})),W=ae((D,V,te)=>D===Yt.Specific?y({type:2,focus:Yt.Specific,id:V,trigger:te}):y({type:2,focus:D,trigger:te})),F=ae((D,V)=>(y({type:5,id:D,dataRef:V}),()=>y({type:6,id:D}))),$=ae(D=>(y({type:7,id:D}),()=>y({type:7,id:null}))),J=ae(D=>Ue(M.mode,{0(){return b==null?void 0:b(D)},1(){let V=M.value.slice(),te=V.findIndex(G=>E(G,D));return te===-1?V.push(D):V.splice(te,1),b==null?void 0:b(V)}})),ee=ae(D=>y({type:3,value:D})),L=ae(()=>y({type:4})),I=m.useMemo(()=>({onChange:J,registerOption:F,registerLabel:$,goToOption:W,closeListbox:z,openListbox:P,selectActiveOption:N,selectOption:j,search:ee,clearSearch:L}),[]),A={ref:p},R=m.useRef(null),q=Eo();return m.useEffect(()=>{R.current&&r!==void 0&&q.addEventListener(R.current,"reset",()=>{b==null||b(r)})},[R,b]),m.createElement(Op.Provider,{value:I},m.createElement(_p.Provider,{value:M},m.createElement(qc,{value:Ue(M.listboxState,{0:st.Open,1:st.Closed})},i!=null&&g!=null&&vp({[i]:g}).map(([D,V],te)=>m.createElement(Oo,{features:zr.Hidden,ref:te===0?G=>{var Q;R.current=(Q=G==null?void 0:G.closest("form"))!=null?Q:null}:void 0,...dl({key:D,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:o,disabled:a,name:D,value:V})})),nt({ourProps:A,theirProps:d,slot:k,defaultTag:m_,name:"Listbox"}))))}let v_="button";function y_(t,e){var n;let r=Mt(),{id:o=`headlessui-listbox-button-${r}`,...i}=t,s=Pl("Listbox.Button"),l=Nl("Listbox.Button"),a=lt(s.buttonRef,e),c=Eo(),u=ae(v=>{switch(v.key){case Oe.Space:case Oe.Enter:case Oe.ArrowDown:v.preventDefault(),l.openListbox(),c.nextFrame(()=>{s.value||l.goToOption(Yt.First)});break;case Oe.ArrowUp:v.preventDefault(),l.openListbox(),c.nextFrame(()=>{s.value||l.goToOption(Yt.Last)});break}}),d=ae(v=>{switch(v.key){case Oe.Space:v.preventDefault();break}}),f=ae(v=>{if(ci(v.currentTarget))return v.preventDefault();s.listboxState===0?(l.closeListbox(),c.nextFrame(()=>{var y;return(y=s.buttonRef.current)==null?void 0:y.focus({preventScroll:!0})})):(v.preventDefault(),l.openListbox())}),p=Pb(()=>{if(s.labelId)return[s.labelId,o].join(" ")},[s.labelId,o]),g=m.useMemo(()=>({open:s.listboxState===0,disabled:s.disabled,value:s.value}),[s]),b={ref:a,id:o,type:Uc(t,s.buttonRef),"aria-haspopup":"listbox","aria-controls":(n=s.optionsRef.current)==null?void 0:n.id,"aria-expanded":s.listboxState===0,"aria-labelledby":p,disabled:s.disabled,onKeyDown:u,onKeyUp:d,onClick:f};return nt({ourProps:b,theirProps:i,slot:g,defaultTag:v_,name:"Listbox.Button"})}let x_="label";function w_(t,e){let n=Mt(),{id:r=`headlessui-listbox-label-${n}`,...o}=t,i=Pl("Listbox.Label"),s=Nl("Listbox.Label"),l=lt(i.labelRef,e);bt(()=>s.registerLabel(r),[r]);let a=ae(()=>{var u;return(u=i.buttonRef.current)==null?void 0:u.focus({preventScroll:!0})}),c=m.useMemo(()=>({open:i.listboxState===0,disabled:i.disabled}),[i]);return nt({ourProps:{ref:l,id:r,onClick:a},theirProps:o,slot:c,defaultTag:x_,name:"Listbox.Label"})}let S_="ul",C_=gr.RenderStrategy|gr.Static;function E_(t,e){var n;let r=Mt(),{id:o=`headlessui-listbox-options-${r}`,...i}=t,s=Pl("Listbox.Options"),l=Nl("Listbox.Options"),a=lt(s.optionsRef,e),c=Eo(),u=Eo(),d=vs(),f=d!==null?(d&st.Open)===st.Open:s.listboxState===0;m.useEffect(()=>{var y;let w=s.optionsRef.current;w&&s.listboxState===0&&w!==((y=xi(w))==null?void 0:y.activeElement)&&w.focus({preventScroll:!0})},[s.listboxState,s.optionsRef]);let p=ae(y=>{switch(u.dispose(),y.key){case Oe.Space:if(s.searchQuery!=="")return y.preventDefault(),y.stopPropagation(),l.search(y.key);case Oe.Enter:if(y.preventDefault(),y.stopPropagation(),s.activeOptionIndex!==null){let{dataRef:w}=s.options[s.activeOptionIndex];l.onChange(w.current.value)}s.mode===0&&(l.closeListbox(),Co().nextFrame(()=>{var w;return(w=s.buttonRef.current)==null?void 0:w.focus({preventScroll:!0})}));break;case Ue(s.orientation,{vertical:Oe.ArrowDown,horizontal:Oe.ArrowRight}):return y.preventDefault(),y.stopPropagation(),l.goToOption(Yt.Next);case Ue(s.orientation,{vertical:Oe.ArrowUp,horizontal:Oe.ArrowLeft}):return y.preventDefault(),y.stopPropagation(),l.goToOption(Yt.Previous);case Oe.Home:case Oe.PageUp:return y.preventDefault(),y.stopPropagation(),l.goToOption(Yt.First);case Oe.End:case Oe.PageDown:return y.preventDefault(),y.stopPropagation(),l.goToOption(Yt.Last);case Oe.Escape:return y.preventDefault(),y.stopPropagation(),l.closeListbox(),c.nextFrame(()=>{var w;return(w=s.buttonRef.current)==null?void 0:w.focus({preventScroll:!0})});case Oe.Tab:y.preventDefault(),y.stopPropagation();break;default:y.key.length===1&&(l.search(y.key),u.setTimeout(()=>l.clearSearch(),350));break}}),g=Pb(()=>{var y;return(y=s.buttonRef.current)==null?void 0:y.id},[s.buttonRef.current]),b=m.useMemo(()=>({open:s.listboxState===0}),[s]),v={"aria-activedescendant":s.activeOptionIndex===null||(n=s.options[s.activeOptionIndex])==null?void 0:n.id,"aria-multiselectable":s.mode===1?!0:void 0,"aria-labelledby":g,"aria-orientation":s.orientation,id:o,onKeyDown:p,role:"listbox",tabIndex:0,ref:a};return nt({ourProps:v,theirProps:i,slot:b,defaultTag:S_,features:C_,visible:f,name:"Listbox.Options"})}let O_="li";function __(t,e){let n=Mt(),{id:r=`headlessui-listbox-option-${n}`,disabled:o=!1,value:i,...s}=t,l=Pl("Listbox.Option"),a=Nl("Listbox.Option"),c=l.activeOptionIndex!==null?l.options[l.activeOptionIndex].id===r:!1,u=l.isSelected(i),d=m.useRef(null),f=c_(d),p=Xt({disabled:o,value:i,domRef:d,get textValue(){return f()}}),g=lt(e,d);bt(()=>{if(l.listboxState!==0||!c||l.activationTrigger===0)return;let E=Co();return E.requestAnimationFrame(()=>{var _,M;(M=(_=d.current)==null?void 0:_.scrollIntoView)==null||M.call(_,{block:"nearest"})}),E.dispose},[d,c,l.listboxState,l.activationTrigger,l.activeOptionIndex]),bt(()=>a.registerOption(r,p),[p,r]);let b=ae(E=>{if(o)return E.preventDefault();a.onChange(i),l.mode===0&&(a.closeListbox(),Co().nextFrame(()=>{var _;return(_=l.buttonRef.current)==null?void 0:_.focus({preventScroll:!0})}))}),v=ae(()=>{if(o)return a.goToOption(Yt.Nothing);a.goToOption(Yt.Specific,r)}),y=w5(),w=ae(E=>y.update(E)),S=ae(E=>{y.wasMoved(E)&&(o||c||a.goToOption(Yt.Specific,r,0))}),C=ae(E=>{y.wasMoved(E)&&(o||c&&a.goToOption(Yt.Nothing))}),x=m.useMemo(()=>({active:c,selected:u,disabled:o}),[c,u,o]);return nt({ourProps:{id:r,ref:g,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":u,disabled:void 0,onClick:b,onFocus:v,onPointerEnter:w,onMouseEnter:w,onPointerMove:S,onMouseMove:S,onPointerLeave:C,onMouseLeave:C},theirProps:s,slot:x,defaultTag:O_,name:"Listbox.Option"})}let k_=rt(b_),T_=rt(y_),A_=rt(w_),M_=rt(E_),j_=rt(__),Ms=Object.assign(k_,{Button:T_,Label:A_,Options:M_,Option:j_});var R_=(t=>(t[t.Open=0]="Open",t[t.Closed=1]="Closed",t))(R_||{}),N_=(t=>(t[t.TogglePopover=0]="TogglePopover",t[t.ClosePopover=1]="ClosePopover",t[t.SetButton=2]="SetButton",t[t.SetButtonId=3]="SetButtonId",t[t.SetPanel=4]="SetPanel",t[t.SetPanelId=5]="SetPanelId",t))(N_||{});let P_={0:t=>{let e={...t,popoverState:Ue(t.popoverState,{0:1,1:0})};return e.popoverState===0&&(e.__demoMode=!1),e},1(t){return t.popoverState===1?t:{...t,popoverState:1}},2(t,e){return t.button===e.button?t:{...t,button:e.button}},3(t,e){return t.buttonId===e.buttonId?t:{...t,buttonId:e.buttonId}},4(t,e){return t.panel===e.panel?t:{...t,panel:e.panel}},5(t,e){return t.panelId===e.panelId?t:{...t,panelId:e.panelId}}},kp=m.createContext(null);kp.displayName="PopoverContext";function Gc(t){let e=m.useContext(kp);if(e===null){let n=new Error(`<${t} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Gc),n}return e}let Tp=m.createContext(null);Tp.displayName="PopoverAPIContext";function Ap(t){let e=m.useContext(Tp);if(e===null){let n=new Error(`<${t} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Ap),n}return e}let Mp=m.createContext(null);Mp.displayName="PopoverGroupContext";function Yb(){return m.useContext(Mp)}let Kc=m.createContext(null);Kc.displayName="PopoverPanelContext";function D_(){return m.useContext(Kc)}function L_(t,e){return Ue(e.type,P_,t,e)}let V_="div";function I_(t,e){var n;let{__demoMode:r=!1,...o}=t,i=m.useRef(null),s=lt(e,gp($=>{i.current=$})),l=m.useRef([]),a=m.useReducer(L_,{__demoMode:r,popoverState:r?0:1,buttons:l,button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:m.createRef(),afterPanelSentinel:m.createRef()}),[{popoverState:c,button:u,buttonId:d,panel:f,panelId:p,beforePanelSentinel:g,afterPanelSentinel:b},v]=a,y=bs((n=i.current)!=null?n:u),w=m.useMemo(()=>{if(!u||!f)return!1;for(let R of document.querySelectorAll("body > *"))if(Number(R==null?void 0:R.contains(u))^Number(R==null?void 0:R.contains(f)))return!0;let $=Fc(),J=$.indexOf(u),ee=(J+$.length-1)%$.length,L=(J+1)%$.length,I=$[ee],A=$[L];return!f.contains(I)&&!f.contains(A)},[u,f]),S=Xt(d),C=Xt(p),x=m.useMemo(()=>({buttonId:S,panelId:C,close:()=>v({type:1})}),[S,C,v]),E=Yb(),_=E==null?void 0:E.registerPopover,M=ae(()=>{var $;return($=E==null?void 0:E.isFocusWithinPopoverGroup())!=null?$:(y==null?void 0:y.activeElement)&&((u==null?void 0:u.contains(y.activeElement))||(f==null?void 0:f.contains(y.activeElement)))});m.useEffect(()=>_==null?void 0:_(x),[_,x]);let[k,j]=I5(),N=B5({mainTreeNodeRef:E==null?void 0:E.mainTreeNodeRef,portals:k,defaultContainers:[u,f]});A5(y==null?void 0:y.defaultView,"focus",$=>{var J,ee,L,I;$.target!==window&&$.target instanceof HTMLElement&&c===0&&(M()||u&&f&&(N.contains($.target)||(ee=(J=g.current)==null?void 0:J.contains)!=null&&ee.call(J,$.target)||(I=(L=b.current)==null?void 0:L.contains)!=null&&I.call(L,$.target)||v({type:1})))},!0),Vb(N.resolveContainers,($,J)=>{v({type:1}),pp(J,Wc.Loose)||($.preventDefault(),u==null||u.focus())},c===0);let P=ae($=>{v({type:1});let J=$?$ instanceof HTMLElement?$:"current"in $&&$.current instanceof HTMLElement?$.current:u:u;J==null||J.focus()}),z=m.useMemo(()=>({close:P,isPortalled:w}),[P,w]),W=m.useMemo(()=>({open:c===0,close:P}),[c,P]),F={ref:s};return m.createElement(Kc.Provider,{value:null},m.createElement(kp.Provider,{value:a},m.createElement(Tp.Provider,{value:z},m.createElement(qc,{value:Ue(c,{0:st.Open,1:st.Closed})},m.createElement(j,null,nt({ourProps:F,theirProps:o,slot:W,defaultTag:V_,name:"Popover"}),m.createElement(N.MainTreeNode,null))))))}let $_="button";function H_(t,e){let n=Mt(),{id:r=`headlessui-popover-button-${n}`,...o}=t,[i,s]=Gc("Popover.Button"),{isPortalled:l}=Ap("Popover.Button"),a=m.useRef(null),c=`headlessui-focus-sentinel-${Mt()}`,u=Yb(),d=u==null?void 0:u.closeOthers,f=D_()!==null;m.useEffect(()=>{if(!f)return s({type:3,buttonId:r}),()=>{s({type:3,buttonId:null})}},[f,r,s]);let[p]=m.useState(()=>Symbol()),g=lt(a,e,f?null:N=>{if(N)i.buttons.current.push(p);else{let P=i.buttons.current.indexOf(p);P!==-1&&i.buttons.current.splice(P,1)}i.buttons.current.length>1&&console.warn("You are already using a <Popover.Button /> but only 1 <Popover.Button /> is supported."),N&&s({type:2,button:N})}),b=lt(a,e),v=bs(a),y=ae(N=>{var P,z,W;if(f){if(i.popoverState===1)return;switch(N.key){case Oe.Space:case Oe.Enter:N.preventDefault(),(z=(P=N.target).click)==null||z.call(P),s({type:1}),(W=i.button)==null||W.focus();break}}else switch(N.key){case Oe.Space:case Oe.Enter:N.preventDefault(),N.stopPropagation(),i.popoverState===1&&(d==null||d(i.buttonId)),s({type:0});break;case Oe.Escape:if(i.popoverState!==0)return d==null?void 0:d(i.buttonId);if(!a.current||v!=null&&v.activeElement&&!a.current.contains(v.activeElement))return;N.preventDefault(),N.stopPropagation(),s({type:1});break}}),w=ae(N=>{f||N.key===Oe.Space&&N.preventDefault()}),S=ae(N=>{var P,z;ci(N.currentTarget)||t.disabled||(f?(s({type:1}),(P=i.button)==null||P.focus()):(N.preventDefault(),N.stopPropagation(),i.popoverState===1&&(d==null||d(i.buttonId)),s({type:0}),(z=i.button)==null||z.focus()))}),C=ae(N=>{N.preventDefault(),N.stopPropagation()}),x=i.popoverState===0,E=m.useMemo(()=>({open:x}),[x]),_=Uc(t,a),M=f?{ref:b,type:_,onKeyDown:y,onClick:S}:{ref:g,id:i.buttonId,type:_,"aria-expanded":i.popoverState===0,"aria-controls":i.panel?i.panelId:void 0,onKeyDown:y,onKeyUp:w,onClick:S,onMouseDown:C},k=Fb(),j=ae(()=>{let N=i.panel;if(!N)return;function P(){Ue(k.current,{[Lr.Forwards]:()=>Dr(N,dn.First),[Lr.Backwards]:()=>Dr(N,dn.Last)})===Qi.Error&&Dr(Fc().filter(z=>z.dataset.headlessuiFocusGuard!=="true"),Ue(k.current,{[Lr.Forwards]:dn.Next,[Lr.Backwards]:dn.Previous}),{relativeTo:i.button})}P()});return m.createElement(m.Fragment,null,nt({ourProps:M,theirProps:o,slot:E,defaultTag:$_,name:"Popover.Button"}),x&&!f&&l&&m.createElement(Oo,{id:c,features:zr.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:j}))}let B_="div",z_=gr.RenderStrategy|gr.Static;function F_(t,e){let n=Mt(),{id:r=`headlessui-popover-overlay-${n}`,...o}=t,[{popoverState:i},s]=Gc("Popover.Overlay"),l=lt(e),a=vs(),c=a!==null?(a&st.Open)===st.Open:i===0,u=ae(f=>{if(ci(f.currentTarget))return f.preventDefault();s({type:1})}),d=m.useMemo(()=>({open:i===0}),[i]);return nt({ourProps:{ref:l,id:r,"aria-hidden":!0,onClick:u},theirProps:o,slot:d,defaultTag:B_,features:z_,visible:c,name:"Popover.Overlay"})}let W_="div",U_=gr.RenderStrategy|gr.Static;function q_(t,e){let n=Mt(),{id:r=`headlessui-popover-panel-${n}`,focus:o=!1,...i}=t,[s,l]=Gc("Popover.Panel"),{close:a,isPortalled:c}=Ap("Popover.Panel"),u=`headlessui-focus-sentinel-before-${Mt()}`,d=`headlessui-focus-sentinel-after-${Mt()}`,f=m.useRef(null),p=lt(f,e,M=>{l({type:4,panel:M})}),g=bs(f),b=mp();bt(()=>(l({type:5,panelId:r}),()=>{l({type:5,panelId:null})}),[r,l]);let v=vs(),y=v!==null?(v&st.Open)===st.Open:s.popoverState===0,w=ae(M=>{var k;switch(M.key){case Oe.Escape:if(s.popoverState!==0||!f.current||g!=null&&g.activeElement&&!f.current.contains(g.activeElement))return;M.preventDefault(),M.stopPropagation(),l({type:1}),(k=s.button)==null||k.focus();break}});m.useEffect(()=>{var M;t.static||s.popoverState===1&&((M=t.unmount)==null||M)&&l({type:4,panel:null})},[s.popoverState,t.unmount,t.static,l]),m.useEffect(()=>{if(s.__demoMode||!o||s.popoverState!==0||!f.current)return;let M=g==null?void 0:g.activeElement;f.current.contains(M)||Dr(f.current,dn.First)},[s.__demoMode,o,f,s.popoverState]);let S=m.useMemo(()=>({open:s.popoverState===0,close:a}),[s,a]),C={ref:p,id:r,onKeyDown:w,onBlur:o&&s.popoverState===0?M=>{var k,j,N,P,z;let W=M.relatedTarget;W&&f.current&&((k=f.current)!=null&&k.contains(W)||(l({type:1}),((N=(j=s.beforePanelSentinel.current)==null?void 0:j.contains)!=null&&N.call(j,W)||(z=(P=s.afterPanelSentinel.current)==null?void 0:P.contains)!=null&&z.call(P,W))&&W.focus({preventScroll:!0})))}:void 0,tabIndex:-1},x=Fb(),E=ae(()=>{let M=f.current;if(!M)return;function k(){Ue(x.current,{[Lr.Forwards]:()=>{var j;Dr(M,dn.First)===Qi.Error&&((j=s.afterPanelSentinel.current)==null||j.focus())},[Lr.Backwards]:()=>{var j;(j=s.button)==null||j.focus({preventScroll:!0})}})}k()}),_=ae(()=>{let M=f.current;if(!M)return;function k(){Ue(x.current,{[Lr.Forwards]:()=>{var j;if(!s.button)return;let N=Fc(),P=N.indexOf(s.button),z=N.slice(0,P+1),W=[...N.slice(P+1),...z];for(let F of W.slice())if(F.dataset.headlessuiFocusGuard==="true"||(j=s.panel)!=null&&j.contains(F)){let $=W.indexOf(F);$!==-1&&W.splice($,1)}Dr(W,dn.First,{sorted:!1})},[Lr.Backwards]:()=>{var j;Dr(M,dn.Previous)===Qi.Error&&((j=s.button)==null||j.focus())}})}k()});return m.createElement(Kc.Provider,{value:r},y&&c&&m.createElement(Oo,{id:u,ref:s.beforePanelSentinel,features:zr.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:E}),nt({mergeRefs:b,ourProps:C,theirProps:i,slot:S,defaultTag:W_,features:U_,visible:y,name:"Popover.Panel"}),y&&c&&m.createElement(Oo,{id:d,ref:s.afterPanelSentinel,features:zr.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:_}))}let G_="div";function K_(t,e){let n=m.useRef(null),r=lt(n,e),[o,i]=m.useState([]),s=z5(),l=ae(b=>{i(v=>{let y=v.indexOf(b);if(y!==-1){let w=v.slice();return w.splice(y,1),w}return v})}),a=ae(b=>(i(v=>[...v,b]),()=>l(b))),c=ae(()=>{var b;let v=xi(n);if(!v)return!1;let y=v.activeElement;return(b=n.current)!=null&&b.contains(y)?!0:o.some(w=>{var S,C;return((S=v.getElementById(w.buttonId.current))==null?void 0:S.contains(y))||((C=v.getElementById(w.panelId.current))==null?void 0:C.contains(y))})}),u=ae(b=>{for(let v of o)v.buttonId.current!==b&&v.close()}),d=m.useMemo(()=>({registerPopover:a,unregisterPopover:l,isFocusWithinPopoverGroup:c,closeOthers:u,mainTreeNodeRef:s.mainTreeNodeRef}),[a,l,c,u,s.mainTreeNodeRef]),f=m.useMemo(()=>({}),[]),p=t,g={ref:r};return m.createElement(Mp.Provider,{value:d},nt({ourProps:g,theirProps:p,slot:f,defaultTag:G_,name:"Popover.Group"}),m.createElement(s.MainTreeNode,null))}let Y_=rt(I_),J_=rt(H_),Z_=rt(F_),X_=rt(q_),Q_=rt(K_),Bu=Object.assign(Y_,{Button:J_,Overlay:Z_,Panel:X_,Group:Q_}),Jb=m.createContext(null);function Zb(){let t=m.useContext(Jb);if(t===null){let e=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,Zb),e}return t}function jp(){let[t,e]=m.useState([]);return[t.length>0?t.join(" "):void 0,m.useMemo(()=>function(n){let r=ae(i=>(e(s=>[...s,i]),()=>e(s=>{let l=s.slice(),a=l.indexOf(i);return a!==-1&&l.splice(a,1),l}))),o=m.useMemo(()=>({register:r,slot:n.slot,name:n.name,props:n.props}),[r,n.slot,n.name,n.props]);return m.createElement(Jb.Provider,{value:o},n.children)},[e])]}let ek="label";function tk(t,e){let n=Mt(),{id:r=`headlessui-label-${n}`,passive:o=!1,...i}=t,s=Zb(),l=lt(e);bt(()=>s.register(r),[r,s.register]);let a={ref:l,...s.props,id:r};return o&&("onClick"in a&&(delete a.htmlFor,delete a.onClick),"onClick"in i&&delete i.onClick),nt({ourProps:a,theirProps:i,slot:s.slot||{},defaultTag:ek,name:s.name||"Label"})}let nk=rt(tk),Xb=Object.assign(nk,{});function Qb(t=0){let[e,n]=m.useState(t),r=yp(),o=m.useCallback(a=>{r.current&&n(c=>c|a)},[e,r]),i=m.useCallback(a=>!!(e&a),[e]),s=m.useCallback(a=>{r.current&&n(c=>c&~a)},[n,r]),l=m.useCallback(a=>{r.current&&n(c=>c^a)},[n]);return{flags:e,addFlag:o,hasFlag:i,removeFlag:s,toggleFlag:l}}var rk=(t=>(t[t.RegisterOption=0]="RegisterOption",t[t.UnregisterOption=1]="UnregisterOption",t))(rk||{});let ok={0(t,e){let n=[...t.options,{id:e.id,element:e.element,propsRef:e.propsRef}];return{...t,options:hp(n,r=>r.element.current)}},1(t,e){let n=t.options.slice(),r=t.options.findIndex(o=>o.id===e.id);return r===-1?t:(n.splice(r,1),{...t,options:n})}},Rp=m.createContext(null);Rp.displayName="RadioGroupDataContext";function ev(t){let e=m.useContext(Rp);if(e===null){let n=new Error(`<${t} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ev),n}return e}let Np=m.createContext(null);Np.displayName="RadioGroupActionsContext";function tv(t){let e=m.useContext(Np);if(e===null){let n=new Error(`<${t} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,tv),n}return e}function ik(t,e){return Ue(e.type,ok,t,e)}let sk="div";function lk(t,e){let n=Mt(),{id:r=`headlessui-radiogroup-${n}`,value:o,defaultValue:i,form:s,name:l,onChange:a,by:c=(L,I)=>L===I,disabled:u=!1,...d}=t,f=ae(typeof c=="string"?(L,I)=>{let A=c;return(L==null?void 0:L[A])===(I==null?void 0:I[A])}:c),[p,g]=m.useReducer(ik,{options:[]}),b=p.options,[v,y]=jp(),[w,S]=xp(),C=m.useRef(null),x=lt(C,e),[E,_]=fp(o,a,i),M=m.useMemo(()=>b.find(L=>!L.propsRef.current.disabled),[b]),k=m.useMemo(()=>b.some(L=>f(L.propsRef.current.value,E)),[b,E]),j=ae(L=>{var I;if(u||f(L,E))return!1;let A=(I=b.find(R=>f(R.propsRef.current.value,L)))==null?void 0:I.propsRef.current;return A!=null&&A.disabled?!1:(_==null||_(L),!0)});S5({container:C.current,accept(L){return L.getAttribute("role")==="radio"?NodeFilter.FILTER_REJECT:L.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(L){L.setAttribute("role","none")}});let N=ae(L=>{let I=C.current;if(!I)return;let A=xi(I),R=b.filter(q=>q.propsRef.current.disabled===!1).map(q=>q.element.current);switch(L.key){case Oe.Enter:zb(L.currentTarget);break;case Oe.ArrowLeft:case Oe.ArrowUp:if(L.preventDefault(),L.stopPropagation(),Dr(R,dn.Previous|dn.WrapAround)===Qi.Success){let q=b.find(D=>D.element.current===(A==null?void 0:A.activeElement));q&&j(q.propsRef.current.value)}break;case Oe.ArrowRight:case Oe.ArrowDown:if(L.preventDefault(),L.stopPropagation(),Dr(R,dn.Next|dn.WrapAround)===Qi.Success){let q=b.find(D=>D.element.current===(A==null?void 0:A.activeElement));q&&j(q.propsRef.current.value)}break;case Oe.Space:{L.preventDefault(),L.stopPropagation();let q=b.find(D=>D.element.current===(A==null?void 0:A.activeElement));q&&j(q.propsRef.current.value)}break}}),P=ae(L=>(g({type:0,...L}),()=>g({type:1,id:L.id}))),z=m.useMemo(()=>({value:E,firstOption:M,containsCheckedOption:k,disabled:u,compare:f,...p}),[E,M,k,u,f,p]),W=m.useMemo(()=>({registerOption:P,change:j}),[P,j]),F={ref:x,id:r,role:"radiogroup","aria-labelledby":v,"aria-describedby":w,onKeyDown:N},$=m.useMemo(()=>({value:E}),[E]),J=m.useRef(null),ee=Eo();return m.useEffect(()=>{J.current&&i!==void 0&&ee.addEventListener(J.current,"reset",()=>{j(i)})},[J,j]),m.createElement(S,{name:"RadioGroup.Description"},m.createElement(y,{name:"RadioGroup.Label"},m.createElement(Np.Provider,{value:W},m.createElement(Rp.Provider,{value:z},l!=null&&E!=null&&vp({[l]:E}).map(([L,I],A)=>m.createElement(Oo,{features:zr.Hidden,ref:A===0?R=>{var q;J.current=(q=R==null?void 0:R.closest("form"))!=null?q:null}:void 0,...dl({key:L,as:"input",type:"radio",checked:I!=null,hidden:!0,readOnly:!0,form:s,disabled:u,name:L,value:I})})),nt({ourProps:F,theirProps:d,slot:$,defaultTag:sk,name:"RadioGroup"})))))}var ak=(t=>(t[t.Empty=1]="Empty",t[t.Active=2]="Active",t))(ak||{});let ck="div";function uk(t,e){var n;let r=Mt(),{id:o=`headlessui-radiogroup-option-${r}`,value:i,disabled:s=!1,...l}=t,a=m.useRef(null),c=lt(a,e),[u,d]=jp(),[f,p]=xp(),{addFlag:g,removeFlag:b,hasFlag:v}=Qb(1),y=Xt({value:i,disabled:s}),w=ev("RadioGroup.Option"),S=tv("RadioGroup.Option");bt(()=>S.registerOption({id:o,element:a,propsRef:y}),[o,S,a,y]);let C=ae(P=>{var z;if(ci(P.currentTarget))return P.preventDefault();S.change(i)&&(g(2),(z=a.current)==null||z.focus())}),x=ae(P=>{if(ci(P.currentTarget))return P.preventDefault();g(2)}),E=ae(()=>b(2)),_=((n=w.firstOption)==null?void 0:n.id)===o,M=w.disabled||s,k=w.compare(w.value,i),j={ref:c,id:o,role:"radio","aria-checked":k?"true":"false","aria-labelledby":u,"aria-describedby":f,"aria-disabled":M?!0:void 0,tabIndex:M?-1:k||!w.containsCheckedOption&&_?0:-1,onClick:M?void 0:C,onFocus:M?void 0:x,onBlur:M?void 0:E},N=m.useMemo(()=>({checked:k,disabled:M,active:v(2)}),[k,M,v]);return m.createElement(p,{name:"RadioGroup.Description"},m.createElement(d,{name:"RadioGroup.Label"},nt({ourProps:j,theirProps:l,slot:N,defaultTag:ck,name:"RadioGroup.Option"})))}let dk=rt(lk),fk=rt(uk),Ng=Object.assign(dk,{Option:fk,Label:Xb,Description:Gb}),Pp=m.createContext(null);Pp.displayName="GroupContext";let pk=m.Fragment;function hk(t){var e;let[n,r]=m.useState(null),[o,i]=jp(),[s,l]=xp(),a=m.useMemo(()=>({switch:n,setSwitch:r,labelledby:o,describedby:s}),[n,r,o,s]),c={},u=t;return m.createElement(l,{name:"Switch.Description"},m.createElement(i,{name:"Switch.Label",props:{htmlFor:(e=a.switch)==null?void 0:e.id,onClick(d){n&&(d.currentTarget.tagName==="LABEL"&&d.preventDefault(),n.click(),n.focus({preventScroll:!0}))}}},m.createElement(Pp.Provider,{value:a},nt({ourProps:c,theirProps:u,defaultTag:pk,name:"Switch.Group"}))))}let gk="button";function mk(t,e){var n;let r=Mt(),{id:o=`headlessui-switch-${r}`,checked:i,defaultChecked:s=!1,onChange:l,disabled:a=!1,name:c,value:u,form:d,...f}=t,p=m.useContext(Pp),g=m.useRef(null),b=lt(g,e,p===null?null:p.setSwitch),[v,y]=fp(i,l,s),w=ae(()=>y==null?void 0:y(!v)),S=ae(k=>{if(ci(k.currentTarget))return k.preventDefault();k.preventDefault(),w()}),C=ae(k=>{k.key===Oe.Space?(k.preventDefault(),w()):k.key===Oe.Enter&&zb(k.currentTarget)}),x=ae(k=>k.preventDefault()),E=m.useMemo(()=>({checked:v}),[v]),_={id:o,ref:b,role:"switch",type:Uc(t,g),tabIndex:t.tabIndex===-1?0:(n=t.tabIndex)!=null?n:0,"aria-checked":v,"aria-labelledby":p==null?void 0:p.labelledby,"aria-describedby":p==null?void 0:p.describedby,disabled:a,onClick:S,onKeyUp:C,onKeyPress:x},M=Eo();return m.useEffect(()=>{var k;let j=(k=g.current)==null?void 0:k.closest("form");j&&s!==void 0&&M.addEventListener(j,"reset",()=>{y(s)})},[g,y]),m.createElement(m.Fragment,null,c!=null&&v&&m.createElement(Oo,{features:zr.Hidden,...dl({as:"input",type:"checkbox",hidden:!0,readOnly:!0,disabled:a,form:d,checked:v,name:c,value:u})}),nt({ourProps:_,theirProps:f,slot:E,defaultTag:gk,name:"Switch"}))}let bk=rt(mk),vk=hk,zu=Object.assign(bk,{Group:vk,Label:Xb,Description:Gb});function yk(t){let e={called:!1};return(...n)=>{if(!e.called)return e.called=!0,t(...n)}}function Fu(t,...e){t&&e.length>0&&t.classList.add(...e)}function Wu(t,...e){t&&e.length>0&&t.classList.remove(...e)}function xk(t,e){let n=Co();if(!t)return n.dispose;let{transitionDuration:r,transitionDelay:o}=getComputedStyle(t),[i,s]=[r,o].map(a=>{let[c=0]=a.split(",").filter(Boolean).map(u=>u.includes("ms")?parseFloat(u):parseFloat(u)*1e3).sort((u,d)=>d-u);return c}),l=i+s;if(l!==0){n.group(c=>{c.setTimeout(()=>{e(),c.dispose()},l),c.addEventListener(t,"transitionrun",u=>{u.target===u.currentTarget&&c.dispose()})});let a=n.addEventListener(t,"transitionend",c=>{c.target===c.currentTarget&&(e(),a())})}else e();return n.add(()=>e()),n.dispose}function wk(t,e,n,r){let o=n?"enter":"leave",i=Co(),s=r!==void 0?yk(r):()=>{};o==="enter"&&(t.removeAttribute("hidden"),t.style.display="");let l=Ue(o,{enter:()=>e.enter,leave:()=>e.leave}),a=Ue(o,{enter:()=>e.enterTo,leave:()=>e.leaveTo}),c=Ue(o,{enter:()=>e.enterFrom,leave:()=>e.leaveFrom});return Wu(t,...e.base,...e.enter,...e.enterTo,...e.enterFrom,...e.leave,...e.leaveFrom,...e.leaveTo,...e.entered),Fu(t,...e.base,...l,...c),i.nextFrame(()=>{Wu(t,...e.base,...l,...c),Fu(t,...e.base,...l,...a),xk(t,()=>(Wu(t,...e.base,...l),Fu(t,...e.base,...e.entered),s()))}),i.dispose}function Sk({immediate:t,container:e,direction:n,classes:r,onStart:o,onStop:i}){let s=yp(),l=Eo(),a=Xt(n);bt(()=>{t&&(a.current="enter")},[t]),bt(()=>{let c=Co();l.add(c.dispose);let u=e.current;if(u&&a.current!=="idle"&&s.current)return c.dispose(),o.current(a.current),c.add(wk(u,r.current,a.current==="enter",()=>{c.dispose(),i.current(a.current)})),c.dispose},[n])}function Zr(t=""){return t.split(/\s+/).filter(e=>e.length>1)}let Yc=m.createContext(null);Yc.displayName="TransitionContext";var Ck=(t=>(t.Visible="visible",t.Hidden="hidden",t))(Ck||{});function Ek(){let t=m.useContext(Yc);if(t===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return t}function Ok(){let t=m.useContext(Jc);if(t===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return t}let Jc=m.createContext(null);Jc.displayName="NestingContext";function Zc(t){return"children"in t?Zc(t.children):t.current.filter(({el:e})=>e.current!==null).filter(({state:e})=>e==="visible").length>0}function nv(t,e){let n=Xt(t),r=m.useRef([]),o=yp(),i=Eo(),s=ae((p,g=co.Hidden)=>{let b=r.current.findIndex(({el:v})=>v===p);b!==-1&&(Ue(g,{[co.Unmount](){r.current.splice(b,1)},[co.Hidden](){r.current[b].state="hidden"}}),i.microTask(()=>{var v;!Zc(r)&&o.current&&((v=n.current)==null||v.call(n))}))}),l=ae(p=>{let g=r.current.find(({el:b})=>b===p);return g?g.state!=="visible"&&(g.state="visible"):r.current.push({el:p,state:"visible"}),()=>s(p,co.Unmount)}),a=m.useRef([]),c=m.useRef(Promise.resolve()),u=m.useRef({enter:[],leave:[],idle:[]}),d=ae((p,g,b)=>{a.current.splice(0),e&&(e.chains.current[g]=e.chains.current[g].filter(([v])=>v!==p)),e==null||e.chains.current[g].push([p,new Promise(v=>{a.current.push(v)})]),e==null||e.chains.current[g].push([p,new Promise(v=>{Promise.all(u.current[g].map(([y,w])=>w)).then(()=>v())})]),g==="enter"?c.current=c.current.then(()=>e==null?void 0:e.wait.current).then(()=>b(g)):b(g)}),f=ae((p,g,b)=>{Promise.all(u.current[g].splice(0).map(([v,y])=>y)).then(()=>{var v;(v=a.current.shift())==null||v()}).then(()=>b(g))});return m.useMemo(()=>({children:r,register:l,unregister:s,onStart:d,onStop:f,wait:c,chains:u}),[l,s,r,d,f,u,c])}function _k(){}let kk=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Pg(t){var e;let n={};for(let r of kk)n[r]=(e=t[r])!=null?e:_k;return n}function Tk(t){let e=m.useRef(Pg(t));return m.useEffect(()=>{e.current=Pg(t)},[t]),e}let Ak="div",rv=gr.RenderStrategy;function Mk(t,e){var n,r;let{beforeEnter:o,afterEnter:i,beforeLeave:s,afterLeave:l,enter:a,enterFrom:c,enterTo:u,entered:d,leave:f,leaveFrom:p,leaveTo:g,...b}=t,v=m.useRef(null),y=lt(v,e),w=(n=b.unmount)==null||n?co.Unmount:co.Hidden,{show:S,appear:C,initial:x}=Ek(),[E,_]=m.useState(S?"visible":"hidden"),M=Ok(),{register:k,unregister:j}=M;m.useEffect(()=>k(v),[k,v]),m.useEffect(()=>{if(w===co.Hidden&&v.current){if(S&&E!=="visible"){_("visible");return}return Ue(E,{hidden:()=>j(v),visible:()=>k(v)})}},[E,v,k,j,S,w]);let N=Xt({base:Zr(b.className),enter:Zr(a),enterFrom:Zr(c),enterTo:Zr(u),entered:Zr(d),leave:Zr(f),leaveFrom:Zr(p),leaveTo:Zr(g)}),P=Tk({beforeEnter:o,afterEnter:i,beforeLeave:s,afterLeave:l}),z=zc();m.useEffect(()=>{if(z&&E==="visible"&&v.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[v,E,z]);let W=x&&!C,F=C&&S&&x,$=!z||W?"idle":S?"enter":"leave",J=Qb(0),ee=ae(D=>Ue(D,{enter:()=>{J.addFlag(st.Opening),P.current.beforeEnter()},leave:()=>{J.addFlag(st.Closing),P.current.beforeLeave()},idle:()=>{}})),L=ae(D=>Ue(D,{enter:()=>{J.removeFlag(st.Opening),P.current.afterEnter()},leave:()=>{J.removeFlag(st.Closing),P.current.afterLeave()},idle:()=>{}})),I=nv(()=>{_("hidden"),j(v)},M),A=m.useRef(!1);Sk({immediate:F,container:v,classes:N,direction:$,onStart:Xt(D=>{A.current=!0,I.onStart(v,D,ee)}),onStop:Xt(D=>{A.current=!1,I.onStop(v,D,L),D==="leave"&&!Zc(I)&&(_("hidden"),j(v))})});let R=b,q={ref:y};return F?R={...R,className:ic(b.className,...N.current.enter,...N.current.enterFrom)}:A.current&&(R.className=ic(b.className,(r=v.current)==null?void 0:r.className),R.className===""&&delete R.className),m.createElement(Jc.Provider,{value:I},m.createElement(qc,{value:Ue(E,{visible:st.Open,hidden:st.Closed})|J.flags},nt({ourProps:q,theirProps:R,defaultTag:Ak,features:rv,visible:E==="visible",name:"Transition.Child"})))}function jk(t,e){let{show:n,appear:r=!1,unmount:o=!0,...i}=t,s=m.useRef(null),l=lt(s,e);zc();let a=vs();if(n===void 0&&a!==null&&(n=(a&st.Open)===st.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,u]=m.useState(n?"visible":"hidden"),d=nv(()=>{u("hidden")}),[f,p]=m.useState(!0),g=m.useRef([n]);bt(()=>{f!==!1&&g.current[g.current.length-1]!==n&&(g.current.push(n),p(!1))},[g,n]);let b=m.useMemo(()=>({show:n,appear:r,initial:f}),[n,r,f]);m.useEffect(()=>{if(n)u("visible");else if(!Zc(d))u("hidden");else{let S=s.current;if(!S)return;let C=S.getBoundingClientRect();C.x===0&&C.y===0&&C.width===0&&C.height===0&&u("hidden")}},[n,d]);let v={unmount:o},y=ae(()=>{var S;f&&p(!1),(S=t.beforeEnter)==null||S.call(t)}),w=ae(()=>{var S;f&&p(!1),(S=t.beforeLeave)==null||S.call(t)});return m.createElement(Jc.Provider,{value:d},m.createElement(Yc.Provider,{value:b},nt({ourProps:{...v,as:m.Fragment,children:m.createElement(ov,{ref:l,...v,...i,beforeEnter:y,beforeLeave:w})},theirProps:{},defaultTag:m.Fragment,features:rv,visible:c==="visible",name:"Transition"})))}function Rk(t,e){let n=m.useContext(Yc)!==null,r=vs()!==null;return m.createElement(m.Fragment,null,!n&&r?m.createElement(of,{ref:e,...t}):m.createElement(ov,{ref:e,...t}))}let of=rt(jk),ov=rt(Mk),Nk=rt(Rk),Dp=Object.assign(of,{Child:Nk,Root:of});var Dg=function(e){return e.reduce(function(n,r){var o=r[0],i=r[1];return n[o]=i,n},{})},Lg=typeof window<"u"&&window.document&&window.document.createElement?kn.useLayoutEffect:kn.useEffect,Qt="top",Hn="bottom",Bn="right",en="left",Lp="auto",Dl=[Qt,Hn,Bn,en],es="start",fl="end",Pk="clippingParents",iv="viewport",js="popper",Dk="reference",Vg=Dl.reduce(function(t,e){return t.concat([e+"-"+es,e+"-"+fl])},[]),sv=[].concat(Dl,[Lp]).reduce(function(t,e){return t.concat([e,e+"-"+es,e+"-"+fl])},[]),Lk="beforeRead",Vk="read",Ik="afterRead",$k="beforeMain",Hk="main",Bk="afterMain",zk="beforeWrite",Fk="write",Wk="afterWrite",Uk=[Lk,Vk,Ik,$k,Hk,Bk,zk,Fk,Wk];function mr(t){return t?(t.nodeName||"").toLowerCase():null}function bn(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function ui(t){var e=bn(t).Element;return t instanceof e||t instanceof Element}function Vn(t){var e=bn(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Vp(t){if(typeof ShadowRoot>"u")return!1;var e=bn(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function qk(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},o=e.attributes[n]||{},i=e.elements[n];!Vn(i)||!mr(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(s){var l=o[s];l===!1?i.removeAttribute(s):i.setAttribute(s,l===!0?"":l)}))})}function Gk(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var o=e.elements[r],i=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),l=s.reduce(function(a,c){return a[c]="",a},{});!Vn(o)||!mr(o)||(Object.assign(o.style,l),Object.keys(i).forEach(function(a){o.removeAttribute(a)}))})}}const Kk={name:"applyStyles",enabled:!0,phase:"write",fn:qk,effect:Gk,requires:["computeStyles"]};function fr(t){return t.split("-")[0]}var Jo=Math.max,sc=Math.min,ts=Math.round;function sf(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function lv(){return!/^((?!chrome|android).)*safari/i.test(sf())}function ns(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),o=1,i=1;e&&Vn(t)&&(o=t.offsetWidth>0&&ts(r.width)/t.offsetWidth||1,i=t.offsetHeight>0&&ts(r.height)/t.offsetHeight||1);var s=ui(t)?bn(t):window,l=s.visualViewport,a=!lv()&&n,c=(r.left+(a&&l?l.offsetLeft:0))/o,u=(r.top+(a&&l?l.offsetTop:0))/i,d=r.width/o,f=r.height/i;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c,x:c,y:u}}function Ip(t){var e=ns(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function av(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&Vp(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Fr(t){return bn(t).getComputedStyle(t)}function Yk(t){return["table","td","th"].indexOf(mr(t))>=0}function Ao(t){return((ui(t)?t.ownerDocument:t.document)||window.document).documentElement}function Xc(t){return mr(t)==="html"?t:t.assignedSlot||t.parentNode||(Vp(t)?t.host:null)||Ao(t)}function Ig(t){return!Vn(t)||Fr(t).position==="fixed"?null:t.offsetParent}function Jk(t){var e=/firefox/i.test(sf()),n=/Trident/i.test(sf());if(n&&Vn(t)){var r=Fr(t);if(r.position==="fixed")return null}var o=Xc(t);for(Vp(o)&&(o=o.host);Vn(o)&&["html","body"].indexOf(mr(o))<0;){var i=Fr(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function Ll(t){for(var e=bn(t),n=Ig(t);n&&Yk(n)&&Fr(n).position==="static";)n=Ig(n);return n&&(mr(n)==="html"||mr(n)==="body"&&Fr(n).position==="static")?e:n||Jk(t)||e}function $p(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Gs(t,e,n){return Jo(t,sc(e,n))}function Zk(t,e,n){var r=Gs(t,e,n);return r>n?n:r}function cv(){return{top:0,right:0,bottom:0,left:0}}function uv(t){return Object.assign({},cv(),t)}function dv(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var Xk=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,uv(typeof e!="number"?e:dv(e,Dl))};function Qk(t){var e,n=t.state,r=t.name,o=t.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,l=fr(n.placement),a=$p(l),c=[en,Bn].indexOf(l)>=0,u=c?"height":"width";if(!(!i||!s)){var d=Xk(o.padding,n),f=Ip(i),p=a==="y"?Qt:en,g=a==="y"?Hn:Bn,b=n.rects.reference[u]+n.rects.reference[a]-s[a]-n.rects.popper[u],v=s[a]-n.rects.reference[a],y=Ll(i),w=y?a==="y"?y.clientHeight||0:y.clientWidth||0:0,S=b/2-v/2,C=d[p],x=w-f[u]-d[g],E=w/2-f[u]/2+S,_=Gs(C,E,x),M=a;n.modifiersData[r]=(e={},e[M]=_,e.centerOffset=_-E,e)}}function eT(t){var e=t.state,n=t.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=e.elements.popper.querySelector(o),!o)||av(e.elements.popper,o)&&(e.elements.arrow=o))}const tT={name:"arrow",enabled:!0,phase:"main",fn:Qk,effect:eT,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function rs(t){return t.split("-")[1]}var nT={top:"auto",right:"auto",bottom:"auto",left:"auto"};function rT(t,e){var n=t.x,r=t.y,o=e.devicePixelRatio||1;return{x:ts(n*o)/o||0,y:ts(r*o)/o||0}}function $g(t){var e,n=t.popper,r=t.popperRect,o=t.placement,i=t.variation,s=t.offsets,l=t.position,a=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,d=t.isFixed,f=s.x,p=f===void 0?0:f,g=s.y,b=g===void 0?0:g,v=typeof u=="function"?u({x:p,y:b}):{x:p,y:b};p=v.x,b=v.y;var y=s.hasOwnProperty("x"),w=s.hasOwnProperty("y"),S=en,C=Qt,x=window;if(c){var E=Ll(n),_="clientHeight",M="clientWidth";if(E===bn(n)&&(E=Ao(n),Fr(E).position!=="static"&&l==="absolute"&&(_="scrollHeight",M="scrollWidth")),E=E,o===Qt||(o===en||o===Bn)&&i===fl){C=Hn;var k=d&&E===x&&x.visualViewport?x.visualViewport.height:E[_];b-=k-r.height,b*=a?1:-1}if(o===en||(o===Qt||o===Hn)&&i===fl){S=Bn;var j=d&&E===x&&x.visualViewport?x.visualViewport.width:E[M];p-=j-r.width,p*=a?1:-1}}var N=Object.assign({position:l},c&&nT),P=u===!0?rT({x:p,y:b},bn(n)):{x:p,y:b};if(p=P.x,b=P.y,a){var z;return Object.assign({},N,(z={},z[C]=w?"0":"",z[S]=y?"0":"",z.transform=(x.devicePixelRatio||1)<=1?"translate("+p+"px, "+b+"px)":"translate3d("+p+"px, "+b+"px, 0)",z))}return Object.assign({},N,(e={},e[C]=w?b+"px":"",e[S]=y?p+"px":"",e.transform="",e))}function oT(t){var e=t.state,n=t.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,s=i===void 0?!0:i,l=n.roundOffsets,a=l===void 0?!0:l,c={placement:fr(e.placement),variation:rs(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,$g(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:a})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,$g(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const iT={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:oT,data:{}};var ra={passive:!0};function sT(t){var e=t.state,n=t.instance,r=t.options,o=r.scroll,i=o===void 0?!0:o,s=r.resize,l=s===void 0?!0:s,a=bn(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&c.forEach(function(u){u.addEventListener("scroll",n.update,ra)}),l&&a.addEventListener("resize",n.update,ra),function(){i&&c.forEach(function(u){u.removeEventListener("scroll",n.update,ra)}),l&&a.removeEventListener("resize",n.update,ra)}}const lT={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:sT,data:{}};var aT={left:"right",right:"left",bottom:"top",top:"bottom"};function Pa(t){return t.replace(/left|right|bottom|top/g,function(e){return aT[e]})}var cT={start:"end",end:"start"};function Hg(t){return t.replace(/start|end/g,function(e){return cT[e]})}function Hp(t){var e=bn(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Bp(t){return ns(Ao(t)).left+Hp(t).scrollLeft}function uT(t,e){var n=bn(t),r=Ao(t),o=n.visualViewport,i=r.clientWidth,s=r.clientHeight,l=0,a=0;if(o){i=o.width,s=o.height;var c=lv();(c||!c&&e==="fixed")&&(l=o.offsetLeft,a=o.offsetTop)}return{width:i,height:s,x:l+Bp(t),y:a}}function dT(t){var e,n=Ao(t),r=Hp(t),o=(e=t.ownerDocument)==null?void 0:e.body,i=Jo(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=Jo(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),l=-r.scrollLeft+Bp(t),a=-r.scrollTop;return Fr(o||n).direction==="rtl"&&(l+=Jo(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:l,y:a}}function zp(t){var e=Fr(t),n=e.overflow,r=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function fv(t){return["html","body","#document"].indexOf(mr(t))>=0?t.ownerDocument.body:Vn(t)&&zp(t)?t:fv(Xc(t))}function Ks(t,e){var n;e===void 0&&(e=[]);var r=fv(t),o=r===((n=t.ownerDocument)==null?void 0:n.body),i=bn(r),s=o?[i].concat(i.visualViewport||[],zp(r)?r:[]):r,l=e.concat(s);return o?l:l.concat(Ks(Xc(s)))}function lf(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function fT(t,e){var n=ns(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function Bg(t,e,n){return e===iv?lf(uT(t,n)):ui(e)?fT(e,n):lf(dT(Ao(t)))}function pT(t){var e=Ks(Xc(t)),n=["absolute","fixed"].indexOf(Fr(t).position)>=0,r=n&&Vn(t)?Ll(t):t;return ui(r)?e.filter(function(o){return ui(o)&&av(o,r)&&mr(o)!=="body"}):[]}function hT(t,e,n,r){var o=e==="clippingParents"?pT(t):[].concat(e),i=[].concat(o,[n]),s=i[0],l=i.reduce(function(a,c){var u=Bg(t,c,r);return a.top=Jo(u.top,a.top),a.right=sc(u.right,a.right),a.bottom=sc(u.bottom,a.bottom),a.left=Jo(u.left,a.left),a},Bg(t,s,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function pv(t){var e=t.reference,n=t.element,r=t.placement,o=r?fr(r):null,i=r?rs(r):null,s=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,a;switch(o){case Qt:a={x:s,y:e.y-n.height};break;case Hn:a={x:s,y:e.y+e.height};break;case Bn:a={x:e.x+e.width,y:l};break;case en:a={x:e.x-n.width,y:l};break;default:a={x:e.x,y:e.y}}var c=o?$p(o):null;if(c!=null){var u=c==="y"?"height":"width";switch(i){case es:a[c]=a[c]-(e[u]/2-n[u]/2);break;case fl:a[c]=a[c]+(e[u]/2-n[u]/2);break}}return a}function pl(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=r===void 0?t.placement:r,i=n.strategy,s=i===void 0?t.strategy:i,l=n.boundary,a=l===void 0?Pk:l,c=n.rootBoundary,u=c===void 0?iv:c,d=n.elementContext,f=d===void 0?js:d,p=n.altBoundary,g=p===void 0?!1:p,b=n.padding,v=b===void 0?0:b,y=uv(typeof v!="number"?v:dv(v,Dl)),w=f===js?Dk:js,S=t.rects.popper,C=t.elements[g?w:f],x=hT(ui(C)?C:C.contextElement||Ao(t.elements.popper),a,u,s),E=ns(t.elements.reference),_=pv({reference:E,element:S,strategy:"absolute",placement:o}),M=lf(Object.assign({},S,_)),k=f===js?M:E,j={top:x.top-k.top+y.top,bottom:k.bottom-x.bottom+y.bottom,left:x.left-k.left+y.left,right:k.right-x.right+y.right},N=t.modifiersData.offset;if(f===js&&N){var P=N[o];Object.keys(j).forEach(function(z){var W=[Bn,Hn].indexOf(z)>=0?1:-1,F=[Qt,Hn].indexOf(z)>=0?"y":"x";j[z]+=P[F]*W})}return j}function gT(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=n.boundary,i=n.rootBoundary,s=n.padding,l=n.flipVariations,a=n.allowedAutoPlacements,c=a===void 0?sv:a,u=rs(r),d=u?l?Vg:Vg.filter(function(g){return rs(g)===u}):Dl,f=d.filter(function(g){return c.indexOf(g)>=0});f.length===0&&(f=d);var p=f.reduce(function(g,b){return g[b]=pl(t,{placement:b,boundary:o,rootBoundary:i,padding:s})[fr(b)],g},{});return Object.keys(p).sort(function(g,b){return p[g]-p[b]})}function mT(t){if(fr(t)===Lp)return[];var e=Pa(t);return[Hg(t),e,Hg(e)]}function bT(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,l=s===void 0?!0:s,a=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,g=p===void 0?!0:p,b=n.allowedAutoPlacements,v=e.options.placement,y=fr(v),w=y===v,S=a||(w||!g?[Pa(v)]:mT(v)),C=[v].concat(S).reduce(function(D,V){return D.concat(fr(V)===Lp?gT(e,{placement:V,boundary:u,rootBoundary:d,padding:c,flipVariations:g,allowedAutoPlacements:b}):V)},[]),x=e.rects.reference,E=e.rects.popper,_=new Map,M=!0,k=C[0],j=0;j<C.length;j++){var N=C[j],P=fr(N),z=rs(N)===es,W=[Qt,Hn].indexOf(P)>=0,F=W?"width":"height",$=pl(e,{placement:N,boundary:u,rootBoundary:d,altBoundary:f,padding:c}),J=W?z?Bn:en:z?Hn:Qt;x[F]>E[F]&&(J=Pa(J));var ee=Pa(J),L=[];if(i&&L.push($[P]<=0),l&&L.push($[J]<=0,$[ee]<=0),L.every(function(D){return D})){k=N,M=!1;break}_.set(N,L)}if(M)for(var I=g?3:1,A=function(V){var te=C.find(function(G){var Q=_.get(G);if(Q)return Q.slice(0,V).every(function(se){return se})});if(te)return k=te,"break"},R=I;R>0;R--){var q=A(R);if(q==="break")break}e.placement!==k&&(e.modifiersData[r]._skip=!0,e.placement=k,e.reset=!0)}}const vT={name:"flip",enabled:!0,phase:"main",fn:bT,requiresIfExists:["offset"],data:{_skip:!1}};function zg(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Fg(t){return[Qt,Bn,Hn,en].some(function(e){return t[e]>=0})}function yT(t){var e=t.state,n=t.name,r=e.rects.reference,o=e.rects.popper,i=e.modifiersData.preventOverflow,s=pl(e,{elementContext:"reference"}),l=pl(e,{altBoundary:!0}),a=zg(s,r),c=zg(l,o,i),u=Fg(a),d=Fg(c);e.modifiersData[n]={referenceClippingOffsets:a,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const xT={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:yT};function wT(t,e,n){var r=fr(t),o=[en,Qt].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=i[0],l=i[1];return s=s||0,l=(l||0)*o,[en,Bn].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function ST(t){var e=t.state,n=t.options,r=t.name,o=n.offset,i=o===void 0?[0,0]:o,s=sv.reduce(function(u,d){return u[d]=wT(d,e.rects,i),u},{}),l=s[e.placement],a=l.x,c=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=a,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}const CT={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:ST};function ET(t){var e=t.state,n=t.name;e.modifiersData[n]=pv({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const OT={name:"popperOffsets",enabled:!0,phase:"read",fn:ET,data:{}};function _T(t){return t==="x"?"y":"x"}function kT(t){var e=t.state,n=t.options,r=t.name,o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,l=s===void 0?!1:s,a=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,f=n.tether,p=f===void 0?!0:f,g=n.tetherOffset,b=g===void 0?0:g,v=pl(e,{boundary:a,rootBoundary:c,padding:d,altBoundary:u}),y=fr(e.placement),w=rs(e.placement),S=!w,C=$p(y),x=_T(C),E=e.modifiersData.popperOffsets,_=e.rects.reference,M=e.rects.popper,k=typeof b=="function"?b(Object.assign({},e.rects,{placement:e.placement})):b,j=typeof k=="number"?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),N=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,P={x:0,y:0};if(E){if(i){var z,W=C==="y"?Qt:en,F=C==="y"?Hn:Bn,$=C==="y"?"height":"width",J=E[C],ee=J+v[W],L=J-v[F],I=p?-M[$]/2:0,A=w===es?_[$]:M[$],R=w===es?-M[$]:-_[$],q=e.elements.arrow,D=p&&q?Ip(q):{width:0,height:0},V=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:cv(),te=V[W],G=V[F],Q=Gs(0,_[$],D[$]),se=S?_[$]/2-I-Q-te-j.mainAxis:A-Q-te-j.mainAxis,be=S?-_[$]/2+I+Q+G+j.mainAxis:R+Q+G+j.mainAxis,de=e.elements.arrow&&Ll(e.elements.arrow),Pe=de?C==="y"?de.clientTop||0:de.clientLeft||0:0,X=(z=N==null?void 0:N[C])!=null?z:0,qe=J+se-X-Pe,Qe=J+be-X,at=Gs(p?sc(ee,qe):ee,J,p?Jo(L,Qe):L);E[C]=at,P[C]=at-J}if(l){var xt,wt=C==="x"?Qt:en,rn=C==="x"?Hn:Bn,Le=E[x],ot=x==="y"?"height":"width",T=Le+v[wt],re=Le-v[rn],ie=[Qt,en].indexOf(y)!==-1,Ce=(xt=N==null?void 0:N[x])!=null?xt:0,Xe=ie?T:Le-_[ot]-M[ot]-Ce+j.altAxis,Te=ie?Le+_[ot]+M[ot]-Ce-j.altAxis:re,me=p&&ie?Zk(Xe,Le,Te):Gs(p?Xe:T,Le,p?Te:re);E[x]=me,P[x]=me-Le}e.modifiersData[r]=P}}const TT={name:"preventOverflow",enabled:!0,phase:"main",fn:kT,requiresIfExists:["offset"]};function AT(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function MT(t){return t===bn(t)||!Vn(t)?Hp(t):AT(t)}function jT(t){var e=t.getBoundingClientRect(),n=ts(e.width)/t.offsetWidth||1,r=ts(e.height)/t.offsetHeight||1;return n!==1||r!==1}function RT(t,e,n){n===void 0&&(n=!1);var r=Vn(e),o=Vn(e)&&jT(e),i=Ao(e),s=ns(t,o,n),l={scrollLeft:0,scrollTop:0},a={x:0,y:0};return(r||!r&&!n)&&((mr(e)!=="body"||zp(i))&&(l=MT(e)),Vn(e)?(a=ns(e,!0),a.x+=e.clientLeft,a.y+=e.clientTop):i&&(a.x=Bp(i))),{x:s.left+l.scrollLeft-a.x,y:s.top+l.scrollTop-a.y,width:s.width,height:s.height}}function NT(t){var e=new Map,n=new Set,r=[];t.forEach(function(i){e.set(i.name,i)});function o(i){n.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(l){if(!n.has(l)){var a=e.get(l);a&&o(a)}}),r.push(i)}return t.forEach(function(i){n.has(i.name)||o(i)}),r}function PT(t){var e=NT(t);return Uk.reduce(function(n,r){return n.concat(e.filter(function(o){return o.phase===r}))},[])}function DT(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function LT(t){var e=t.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Wg={placement:"bottom",modifiers:[],strategy:"absolute"};function Ug(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function VT(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,o=e.defaultOptions,i=o===void 0?Wg:o;return function(l,a,c){c===void 0&&(c=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Wg,i),modifiersData:{},elements:{reference:l,popper:a},attributes:{},styles:{}},d=[],f=!1,p={state:u,setOptions:function(y){var w=typeof y=="function"?y(u.options):y;b(),u.options=Object.assign({},i,u.options,w),u.scrollParents={reference:ui(l)?Ks(l):l.contextElement?Ks(l.contextElement):[],popper:Ks(a)};var S=PT(LT([].concat(r,u.options.modifiers)));return u.orderedModifiers=S.filter(function(C){return C.enabled}),g(),p.update()},forceUpdate:function(){if(!f){var y=u.elements,w=y.reference,S=y.popper;if(Ug(w,S)){u.rects={reference:RT(w,Ll(S),u.options.strategy==="fixed"),popper:Ip(S)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(j){return u.modifiersData[j.name]=Object.assign({},j.data)});for(var C=0;C<u.orderedModifiers.length;C++){if(u.reset===!0){u.reset=!1,C=-1;continue}var x=u.orderedModifiers[C],E=x.fn,_=x.options,M=_===void 0?{}:_,k=x.name;typeof E=="function"&&(u=E({state:u,options:M,name:k,instance:p})||u)}}}},update:DT(function(){return new Promise(function(v){p.forceUpdate(),v(u)})}),destroy:function(){b(),f=!0}};if(!Ug(l,a))return p;p.setOptions(c).then(function(v){!f&&c.onFirstUpdate&&c.onFirstUpdate(v)});function g(){u.orderedModifiers.forEach(function(v){var y=v.name,w=v.options,S=w===void 0?{}:w,C=v.effect;if(typeof C=="function"){var x=C({state:u,name:y,instance:p,options:S}),E=function(){};d.push(x||E)}})}function b(){d.forEach(function(v){return v()}),d=[]}return p}}var IT=[lT,OT,iT,Kk,CT,vT,TT,tT,xT],$T=VT({defaultModifiers:IT}),HT=typeof Element<"u",BT=typeof Map=="function",zT=typeof Set=="function",FT=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Da(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var n,r,o;if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(!Da(t[r],e[r]))return!1;return!0}var i;if(BT&&t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(i=t.entries();!(r=i.next()).done;)if(!e.has(r.value[0]))return!1;for(i=t.entries();!(r=i.next()).done;)if(!Da(r.value[1],e.get(r.value[0])))return!1;return!0}if(zT&&t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(i=t.entries();!(r=i.next()).done;)if(!e.has(r.value[0]))return!1;return!0}if(FT&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(t[r]!==e[r])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf&&typeof t.valueOf=="function"&&typeof e.valueOf=="function")return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString&&typeof t.toString=="function"&&typeof e.toString=="function")return t.toString()===e.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,o[r]))return!1;if(HT&&t instanceof Element)return!1;for(r=n;r--!==0;)if(!((o[r]==="_owner"||o[r]==="__v"||o[r]==="__o")&&t.$$typeof)&&!Da(t[o[r]],e[o[r]]))return!1;return!0}return t!==t&&e!==e}var WT=function(e,n){try{return Da(e,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const UT=Xf(WT);var qT=[],Qc=function(e,n,r){r===void 0&&(r={});var o=kn.useRef(null),i={onFirstUpdate:r.onFirstUpdate,placement:r.placement||"bottom",strategy:r.strategy||"absolute",modifiers:r.modifiers||qT},s=kn.useState({styles:{popper:{position:i.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),l=s[0],a=s[1],c=kn.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(p){var g=p.state,b=Object.keys(g.elements);b2.flushSync(function(){a({styles:Dg(b.map(function(v){return[v,g.styles[v]||{}]})),attributes:Dg(b.map(function(v){return[v,g.attributes[v]]}))})})},requires:["computeStyles"]}},[]),u=kn.useMemo(function(){var f={onFirstUpdate:i.onFirstUpdate,placement:i.placement,strategy:i.strategy,modifiers:[].concat(i.modifiers,[c,{name:"applyStyles",enabled:!1}])};return UT(o.current,f)?o.current||f:(o.current=f,f)},[i.onFirstUpdate,i.placement,i.strategy,i.modifiers,c]),d=kn.useRef();return Lg(function(){d.current&&d.current.setOptions(u)},[u]),Lg(function(){if(!(e==null||n==null)){var f=r.createPopper||$T,p=f(e,n,u);return d.current=p,function(){p.destroy(),d.current=null}}},[e,n,r.createPopper]),{state:d.current?d.current.state:null,styles:l.styles,attributes:l.attributes,update:d.current?d.current.update:null,forceUpdate:d.current?d.current.forceUpdate:null}};const is=m.forwardRef(function({children:e,title:n,onClose:r,icon:o,shadow:i=!0,padding:s=!0,border:l=!0,round:a=!0,className:c,classNameBody:u,size:d="m",titleClass:f=B("gs-utl-mb-2 gs-utl-mt-0.5"),style:p,bg:g,...b},v){return h.jsxs("div",{...b,ref:v,style:p,className:B([c,g||Sb.bg,we.b,a&&we.rnd,l?he.br:we.bT,"gs-utl-card gs-utl-overflow-auto",i&&"gs-utl-shadow-md",s&&d==="l"&&"gs-utl-p-5",s&&d==="m"&&"gs-utl-px-4 gs-utl-py-2",s&&d==="s"&&"gs-utl-px-2 gs-utl-py-1",s&&d==="xs"&&"gs-utl-px-2 gs-utl-py-0.5",s&&d==="x2s"&&"gs-utl-px-0.5"]),children:[(n||r)&&n!==!1&&h.jsxs(fe,{className:B("gs-utl-card-title",f),items:"center",children:[h.jsx(U,{className:B("truncate"),grow:!0,children:n}),(r||o)&&h.jsx(U,{onClick:r,className:B("cursor-pointer transition-opacity opacity-50 hover:gs-utl-opacity-100"),children:h.jsx(ge,{icon:o||_e.close,size:"18px"})})]}),h.jsx("div",{className:B("gs-utl-card-body",u),children:e})]})});var GT={},Uu=ir;GT.NODE_ENV==="production"?(Uu.createRoot,Uu.hydrateRoot):Uu.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function KT(t,e){m.useEffect(()=>{const n="pointerdown",{current:r}=t;if(!r||!e.enabled)return;function o(i){const s=i.target;r&&s&&!r.contains(s)&&e.onTrigger(s)}return document.addEventListener(n,o),()=>{document.removeEventListener(n,o)}},[t.current,e.enabled])}const YT="gs-cmp-popover";function hv({children:t,handler:e,title:n,size:r,padding:o=!0,overlay:i,clickAway:s,topIcon:l,placement:a="auto",offset:c,open:u,onClose:d,buttonAs:f,className:p,classNameBody:g,buttonProps:b={}}){const[v,y]=m.useState(!!u),[w,S]=m.useState(v),[C,x]=m.useState(null),[E,_]=m.useState(null),M=Qc(C,E,{...Fp({offset:c}),placement:a}),k=()=>{S(!1),d==null||d()};KT({current:E},{onTrigger:k,enabled:s&&v}),m.useEffect(()=>{S(!!u)},[u]),m.useEffect(()=>{var P;v&&((P=M.update)==null||P.call(M))},[v,M.update]),m.useEffect(()=>{const P=setTimeout(()=>y(w),10);return()=>clearTimeout(P)},[w]);const j=B("w-full transition-colors",...Jv({border:!1,size:"",...b})),N=B(["fixed z-20",l&&"gjs-mt-5",r==="s"&&"w-full max-w-64",r==="sm"&&"w-full max-w-sm",r==="md"&&"w-full max-w-md"]);return h.jsxs(Bu,{className:B(YT,"relative flex",p),children:[h.jsx(Bu.Button,{ref:x,as:f,className:j,children:h.jsx("div",{onClick:()=>!jl(u)&&S(!v),children:e})}),v&&i&&h.jsx("div",{onClick:k,className:B("z-10 fixed inset-0")}),w&&h.jsx(Bu.Panel,{static:!0,className:N,ref:_,style:M.styles.popper,...M.attributes.popper,children:h.jsx(Dp,{as:m.Fragment,show:v,unmount:!1,...wb,children:h.jsx(is,{title:n,onClose:k,padding:o,classNameBody:g,children:typeof t=="function"?t({close:k}):t})})})]})}function JT({action:t,icon:e,label:n,className:r,items:o,...i}){const s=m.useRef(null),[l,a]=m.useState(),c=s.current,u=B([r,"gs-utl-last:border-b-0 gs-utl-gap-2 gs-utl-select-none",he.br,dr.xy,we.bb,i.disabled&&So.disabled,...t?[he.hBgH,"gs-utl-cursor-pointer"]:["gs-utl-cursor-default"]]),d=p=>xo(t)&&t({event:p});m.useEffect(()=>{if(!c)return;const p=setTimeout(()=>a(c.getBoundingClientRect()),i.active?0:WE);return()=>clearTimeout(p)},[c,i.active]);const f=()=>{var p;return(p=i.onActive)==null?void 0:p.call(i)};return h.jsxs(fe,{ref:s,items:"center",nowrap:!0,className:u,onClick:d,onPointerEnter:f,children:[e&&h.jsx(U,{children:h.jsx(ge,{icon:e,size:We.s})}),h.jsx(U,{className:B(i.classNameLabel,So.txtEllips),grow:!0,children:n}),!!(o!=null&&o.length)&&h.jsxs(h.Fragment,{children:[h.jsx(U,{children:h.jsx(ge,{icon:_e.chevronRight,size:We.s,className:B("-gs-utl-mr-2")})}),l&&i.active&&h.jsx(rA,{items:o,x:l.left,y:l.top,w:l.width,h:l.height,open:!0})]})]})}const ZT=(t,e)=>t.filter(n=>n.id===e)[0]||null,XT=(t,e)=>(t==null?void 0:t.id)===(e==null?void 0:e.id),QT=(t,e)=>t.label.toLowerCase().indexOf(e.toLowerCase())>=0,eA=B("cursor-default select-none focus:gs-utl-outline-none","z-20 max-h-full"),gv={strategy:"fixed",placement:"bottom",modifiers:[{name:"offset",options:{offset:[0,5]}},{name:"flip",options:{fallbackPlacements:["top"]}}]},tA="gs-select-field";function Je({value:t,onChange:e,onBlur:n,onFocus:r,handlerSelected:o,label:i,options:s,includeEmpty:l,className:a,search:c,fixed:u,open:d,caret:f=_e.chevronDown,size:p="m",width:g="",border:b,style:v,pos:y,emptyState:w="- Select an option -",name:S,required:C,disabled:x,tip:E,classNameContainer:_,autoFocus:M}){const[k,j]=m.useState(null),[N,P]=m.useState(null),[z,W]=m.useState(""),{styles:F,attributes:$}=Qc(k,N,gv),J=typeof c=="object"?c.onChange:void 0,ee=[...s].filter(G=>c?J||QT(G,z):G),L=c&&(typeof c=="object"&&c.value||z),I=L&&ee.length?ee[0]:ZT(ee,t),A=G=>e(G.id),R={id:null,label:w},q=I?o?o(I):I.content||I.label:o?o(R):w;l&&ee.unshift(R);const D=G=>{const{value:Q}=G.target,se=Q.trim();switch(G.key){case"Escape":e(null);break;case"Enter":e((ee.length?ee[0].id:se)||null);break;case" ":Dd(G);break}},V=tt("gs-utl-w-full gs-utl-text-left gs-utl-cursor-pointer gs-utl-block",we.rnd,nc.focus),te=()=>{n==null||n()};return h.jsx(Ms,{value:I,onChange:A,children:({open:G})=>h.jsxs("div",{className:tt(tA,_,"gs-utl-relative gs-utl-w-full gs-utl-text-sm"),style:v,children:[i&&h.jsx(Ms.Label,{children:h.jsx(gn,{as:"span",size:p,tip:E,children:i})}),S&&h.jsx("input",{type:"input",name:S,value:(I==null?void 0:I.id)??"",onChange:()=>{},className:B("gs-utl-w-[1px] gs-utl-h-[1px] gs-utl-opacity-[0.001] gs-utl-absolute"),required:C,disabled:x}),h.jsx(Ms.Button,{ref:j,className:V,tabIndex:c?-1:void 0,children:c?h.jsx("input",{autoFocus:M,value:typeof c=="object"&&c.value||z,className:tt([a,"gs-utl-w-full",we.rnd,nc.focus,dr.xyS]),onChange:Q=>{W(Q.target.value),J==null||J(Q.target.value)},onKeyDown:D,onClick:Dd,onBlur:te,onFocus:r}):h.jsx(is,{border:b,size:p,title:q,icon:f,shadow:!1,className:B(a),titleClass:""})}),h.jsx(Ms.Options,{static:d,className:eA,ref:P,style:F.popper,...$.popper,children:h.jsxs(is,{padding:!1,className:B("h-full"),style:{minWidth:`${k==null?void 0:k.offsetWidth}px`,maxHeight:200},children:[!ee.length&&c&&c!==!0&&h.jsx("div",{className:B(dr.xy),children:c.empty}),ee.map((Q,se)=>h.jsx(Ms.Option,{value:Q,children:({active:be,selected:de})=>h.jsxs(fe,{items:"center",className:B([Q.className,dr.xy,be&&Sb.bgH]),children:[h.jsx(U,{className:B("truncate"),grow:!0,children:Q.content||Q.label}),h.jsx(U,{className:B("gjs-pl-2"),children:XT(Q,I)&&!L&&h.jsx(ge,{className:B(he.tA),icon:_e.check,size:We.s})})]})},se))]})})]})})}const qg=Zf()&&document.body,Fp=(t={})=>({...gv,placement:"right-start",modifiers:[{name:"offset",options:{offset:t.offset||[0,5]}},{name:"flip",options:{boundary:t.boundary??qg}},{name:"preventOverflow",options:{boundary:t.boundary??qg}}]}),nA=Fp(),oa="gs-ctx-menu-list",rA=ms(function({open:e,items:n,x:r,y:o,w:i,h:s}){const l=eO(),[a,c]=m.useState(),[u,d]=m.useState(null),f=m.useMemo(()=>({getBoundingClientRect:()=>new DOMRect(r,o,i,s)}),[r,o,i,s,e]),{styles:p,attributes:g}=Qc(f,u,nA),b=tt(`${oa}-wrp gs-utl-z-20`),v=tt(`${oa} gs-utl-z-20`),y=tt(`${oa}-body gs-utl-max-w-56`),w=tt(`${oa}-item`),S="gs-utl-max-w-40",C=x=>{const{action:E,onClick:_}=x;if(E||_)return M=>{const k={editor:l.store.appEditorStore.editor,...M};xo(E)?(E(k),l.hide()):xo(_)&&(_(k),l.hide())}};return h.jsx("div",{className:b,ref:d,style:p.popper,...g.popper,children:h.jsx(Dp,{show:!!e,...GE,unmount:!1,children:h.jsx(is,{padding:!1,className:v,classNameBody:y,children:n.map((x,E)=>m.createElement(JT,{...x,key:x.id??E,className:w,classNameLabel:S,action:C(x),onActive:()=>c(x),active:a===x}))})})})}),qu="gs-cmp-tooltip";function mo({className:t,classNameWrp:e,classNameContent:n,children:r,title:o,onClick:i,inline:s,size:l}){const[a,c]=m.useState(!1),[u,d]=m.useState(!1),f=jl(l),[p,g]=m.useState(null),[b,v]=m.useState(null),y=Qc(p,b,{...Fp(),placement:"bottom"}),w=B(`${qu}-target`,!s&&"block",t,!i&&"cursor-auto"),S=B(`${qu}-content`,n,"fixed z-30 text-sm",!f&&!n&&"whitespace-nowrap",l==="s"&&"w-60");return m.useEffect(()=>{var C;a&&((C=y.update)==null||C.call(y))},[a,y.update]),m.useEffect(()=>{const C=setTimeout(()=>c(u),10);return()=>clearTimeout(C)},[u]),h.jsxs("div",{className:B(qu,"relative",e),children:[h.jsx("span",{ref:g,className:w,onMouseEnter:()=>o&&d(!0),onMouseLeave:()=>d(!1),children:h.jsx("div",{className:B(s&&"inline-block"),onClick:()=>{d(!1),i==null||i()},children:r})}),!!u&&h.jsx("div",{className:S,ref:v,style:y.styles.popper,...y.attributes.popper,children:h.jsx(Dp,{show:!!a,unmount:!1,...wb,children:h.jsx(is,{className:B(bg.txt),bg:bg.bg,size:"s",border:!1,children:o})})})]})}function gn({className:t,as:e="label",bold:n,m:r="gjs-mb-1",size:o="m",capitalize:i=!0,children:s,tip:l,...a}){const c=e;return h.jsxs(c,{className:B(t,r,l?"gs-utl-flex gs-utl-gap-2 gs-utl-items-center":"block",i&&"capitalize",n&&"font-semibold",o==="s"&&"text-sm"),...a,children:[!!l&&h.jsx(mo,{classNameWrp:"gs-utl-normal-case",classNameContent:"gs-utl-max-w-60",title:l,children:h.jsx(ge,{icon:_e.information,size:We.s2x})}),s]})}const oA=t=>{var e;(e=t.getAction("editor.action.formatDocument"))==null||e.run()},iA="gs-field-code",sA={minimap:{enabled:!1},lineNumbers:"off",scrollBeyondLastLine:!1,contextmenu:!1,fixedOverflowWidgets:!0,showFoldingControls:"always",suggestOnTriggerCharacters:!1,lineDecorationsWidth:0,renderLineHighlight:"none",wordWrapOverride1:"off",tabSize:2,scrollbar:{verticalScrollbarSize:8,horizontal:"hidden",alwaysConsumeMouseWheel:!1}};function lA({size:t,value:e,label:n,language:r,onChange:o,clean:i,padding:s,isDarkTheme:l,className:a,containerClassName:c,noMinHeight:u,onMount:d,readOnly:f,description:p}){const g=typeof e=="string"?e:JSON.stringify(e,null,2);return h.jsxs("div",{className:Re(iA,"flex flex-col w-full h-full",c),children:[!!n&&h.jsx(gn,{children:n}),!!p&&h.jsx(gn,{as:"span",size:t,className:Re(he.txtLowEmphasis),capitalize:!1,children:p}),h.jsx("div",{className:Re("flex-grow","w-full","h-full",!u&&"gs-utl-min-h-48"),style:{position:"relative",width:"100%",height:"100%"},children:h.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0},children:h.jsx(c5,{defaultLanguage:r,defaultValue:g,theme:l?"vs-dark":"light",className:Re(we.b,we.rnd,he.br,a),options:{...sA,readOnly:f,...i&&{domReadOnly:!0,overviewRulerLanes:0,selectOnLineNumbers:!1,folding:!1,matchBrackets:"never",guides:{indentation:!1}},...Wa(s)&&{lineDecorationsWidth:s*2,padding:{top:s,bottom:s}}},onChange:o,onMount:(b,v)=>{let y=!1;const w=()=>oA(b);b.onDidChangeModelLanguageConfiguration(w),b.onDidScrollChange(()=>{y||(y=!0,w())}),setTimeout(w,10),d==null||d(b,v)}})})})]})}const aA=t=>t.Assets.getAll().reduce((r,o)=>{const i=o.getSrc(),s=i.match(/^data:([^;]+);/);if(s){const l=i.split(",")[1],a=KE(o.get("name"));r[i]={mime:s[1],name:a,base64:l}}return r},{}),cA=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Gg=(t,e,n={})=>{let r=t;const o=n.pathPfx||"";for(const i in e)if(r.includes(i)){const s=e[i];r=r.replace(new RegExp(cA(i),"g"),`${o}${s.name}`),s.found=!0}return r},uA=(t,e)=>`${e||""}${t||""}`,dA=(t,e)=>{const n=t?`<div ${yg}>${t}</div>`:"",r=e?`<div ${yg} data-gjs-global>${e}</div>`:"";return`${n}${r}`},fA=async(t,e={})=>{const{page:n,skipProject:r,assetsFolder:o="assets",filenameCss:i="style.css",styles:s,isMJML:l}=e,a=[],c=n?[n]:t.Pages.getAll(),u=aA(t),d=`${o}/`,f=t.getCss({keepUnusedStyles:!0,component:n==null?void 0:n.getMainComponent()})||"",p=Gg(f,u,{pathPfx:d}),g=s==="inline",b=s==="skip",v=Eb(t).globalPageSettings||{},y=c.map(w=>{var xt,wt,rn;const S=w.getName(),C=Vo(w,"title")||S,x=Vo(w,"favicon"),E=Vo(w,"description"),_=Vo(w,"keywords"),M=Vo(w,"socialTitle"),k=Vo(w,"socialDescription"),j=Vo(w,"socialImage"),N=rc({page:w,key:"customCodeHead"}),P=uA(N,v.customCodeHead),z=rc({page:w,key:"customCodeBody"}),W=dA(z,v.customCodeBody),F=w.getMainComponent(),$=t.getJs({component:F}),J=$?`<script>${$}<\/script>`:"",ee=[],L=[],I=F.toHTML({asDocument:!1}).replace("</body>",`${W}${J}</body>`),A=F.head;let R=C&&`<title>${C}</title>`,q=x&&`<link rel="icon" href="${x}"/>`,D=E&&`<meta name="description" content="${E}"/>`,V=_&&`<meta name="keywords" content="${_}"/>`,te=M&&`<meta property="og:title" content="${M}"/>`,G=k&&`<meta property="og:description" content="${k}"/>`,Q=j&&`<meta property="og:image" content="${j}"/>`,se='<meta charset="utf-8">',be='<meta name="viewport" content="width=device-width,initial-scale=1">',de='<meta name="robots" content="index,follow">',Pe='<meta name="generator" content="GrapesJS Studio">';A.components().forEach(Le=>{const ot=Le.toHTML();ht.title({cmp:Le})?R=ot:ht.favicon({cmp:Le})?q=ot:ht.description({cmp:Le})?D=ot:ht.keywords({cmp:Le})?V=ot:ht.socialTitle({cmp:Le})?te=ot:ht.socialDescription({cmp:Le})?G=ot:ht.socialImage({cmp:Le})?Q=ot:ht.charset({cmp:Le})?se=ot:ht.viewport({cmp:Le})?be=ot:ht.robots({cmp:Le})?de=ot:ht.generator({cmp:Le})&&(Pe=ot)}),R&&ee.push(R),se&&ee.push(se),be&&ee.push(be),de&&ee.push(de),Pe&&ee.push(Pe),D&&ee.push(D),V&&ee.push(V),te&&ee.push(te),G&&ee.push(G),Q&&ee.push(Q),q&&ee.push(q),L.length&&ee.push(...L),P&&ee.push(P),p&&!b&&ee.push(g?`<style>${p}</style>`:`<link rel="stylesheet" href="./${i}">`);const X=F.doctype||"<!DOCTYPE html>",qe=(wt=(xt=F.docEl).__attrToString)==null?void 0:wt.call(xt),Qe=(rn=A.__attrToString)==null?void 0:rn.call(A),at=l?t.runCommand("mjml-code-to-html").html:`${X}
|
|
171
|
+
<html${qe?` ${qe}`:""}>
|
|
172
|
+
<head${Qe?` ${Qe}`:""}>
|
|
173
|
+
${ee.join(`
|
|
233
174
|
`)}
|
|
234
175
|
</head>
|
|
235
|
-
${
|
|
176
|
+
${I}
|
|
236
177
|
</html>
|
|
237
|
-
`;return{filename:
|
|
178
|
+
`;return{filename:vg(t,w),content:Gg(at,u,{pathPfx:d}),mimeType:"text/html"}});a.push(...y),l&&c.forEach(w=>{a.push({filename:vg(t,w,"mjml"),content:w.getMainComponent().toHTML(),mimeType:"text/mjml"})});for(const w in u){const S=u[w];S.found&&a.push({path:o,filename:S.name,content:atob(S.base64),mimeType:S.mime})}return p&&!g&&!b&&a.push({filename:i,content:p,mimeType:"text/css"}),r||a.push({filename:"gjs-project.grapesjs",content:JSON.stringify(t.getProjectData()),mimeType:"application/json"}),a};ms(function({buttonProps:e,content:n,code:r,onAction:o}){const i=rO(),s=dp(),l=Hl(),{isProjectTypeEmail:a}=l,c=l.editor,{isDarkTheme:u}=nO(),[d,f]=m.useState(),p=()=>{const b=(d||"").trim();o?o(b):c.setComponents(b),i.close()};m.useEffect(()=>{r?f(r):(async()=>{if(a)f(c.getHtml());else{const y=(await fA(c,{page:c.Pages.getSelected(),skipProject:!0,styles:"inline"})).find(w=>w.mimeType==="text/html");y&&f(y.content)}})()},[]);const g=(e==null?void 0:e.children)||s.t("actions.importCode.button");return h.jsxs(fe,{col:!0,space:"m",children:[h.jsx(U,{children:n??s.t("actions.importCode.content")}),h.jsx(U,{className:B("h-96"),children:d!==void 0&&h.jsx(lA,{value:d,onChange:b=>f(b||""),isDarkTheme:u,language:"html"})}),h.jsx(fe,{justify:"end",children:h.jsx(Cs,{size:"m2",variant:"pr",onClick:p,...e,children:g})})]})});function pA(t){const{Blocks:e}=t,n="Content",r="Layout",o={className:"h-7",full:!0,space:"s",nowrap:!0},i={category:r,full:!0},s="gjs-border-2 gjs-border-current gjs-rounded-sm",l=(a,c)=>{e.add(a,{select:!0,category:n,...c})};l("mj-text",{label:"Text",media:`<svg viewBox="0 0 24 24">
|
|
238
179
|
<path fill="currentColor" d="M18.5,4L19.66,8.35L18.7,8.61C18.25,7.74 17.79,6.87 17.26,6.43C16.73,6 16.11,6 15.5,6H13V16.5C13,17 13,17.5 13.33,17.75C13.67,18 14.33,18 15,18V19H9V18C9.67,18 10.33,18 10.67,17.75C11,17.5 11,17 11,16.5V6H8.5C7.89,6 7.27,6 6.74,6.43C6.21,6.87 5.75,7.74 5.3,8.61L4.34,8.35L5.5,4H18.5Z" />
|
|
239
|
-
</svg>`,content:"<mj-text>Insert text here</mj-text>",activate:!0}),
|
|
180
|
+
</svg>`,content:"<mj-text>Insert text here</mj-text>",activate:!0}),l("mj-button",{label:"Button",media:`<svg viewBox="0 0 24 24">
|
|
240
181
|
<path fill="currentColor" d="M20 20.5C20 21.3 19.3 22 18.5 22H13C12.6 22 12.3 21.9 12 21.6L8 17.4L8.7 16.6C8.9 16.4 9.2 16.3 9.5 16.3H9.7L12 18V9C12 8.4 12.4 8 13 8S14 8.4 14 9V13.5L15.2 13.6L19.1 15.8C19.6 16 20 16.6 20 17.1V20.5M20 2H4C2.9 2 2 2.9 2 4V12C2 13.1 2.9 14 4 14H8V12H4V4H20V12H18V14H20C21.1 14 22 13.1 22 12V4C22 2.9 21.1 2 20 2Z" />
|
|
241
|
-
</svg>`,content:"<mj-button>Button</mj-button>"}),
|
|
182
|
+
</svg>`,content:"<mj-button>Button</mj-button>"}),l("mj-image",{label:"Image",media:`<svg viewBox="0 0 24 24">
|
|
242
183
|
<path fill="currentColor" d="M21,3H3C2,3 1,4 1,5V19A2,2 0 0,0 3,21H21C22,21 23,20 23,19V5C23,4 22,3 21,3M5,17L8.5,12.5L11,15.5L14.5,11L19,17H5Z" />
|
|
243
|
-
</svg>`,content:`<mj-image src="${
|
|
184
|
+
</svg>`,content:`<mj-image src="${S2}"/>`,activate:!0}),l("mj-divider",{label:"Divider",media:`<svg viewBox="0 0 24 24">
|
|
244
185
|
<path fill="currentColor" d="M21 18H2V20H21V18M19 10V14H4V10H19M20 8H3C2.45 8 2 8.45 2 9V15C2 15.55 2.45 16 3 16H20C20.55 16 21 15.55 21 15V9C21 8.45 20.55 8 20 8M21 4H2V6H21V4Z" />
|
|
245
|
-
</svg>`,content:"<mj-divider/>"}),
|
|
186
|
+
</svg>`,content:"<mj-divider/>"}),l("mj-social",{label:"Social",media:`<svg viewBox="0 0 24 24">
|
|
246
187
|
<path fill="currentColor" d="M18,16.08C17.24,16.08 16.56,16.38 16.04,16.85L8.91,12.7C8.96,12.47 9,12.24 9,12C9,11.76 8.96,11.53 8.91,11.3L15.96,7.19C16.5,7.69 17.21,8 18,8A3,3 0 0,0 21,5A3,3 0 0,0 18,2A3,3 0 0,0 15,5C15,5.24 15.04,5.47 15.09,5.7L8.04,9.81C7.5,9.31 6.79,9 6,9A3,3 0 0,0 3,12A3,3 0 0,0 6,15C6.79,15 7.5,14.69 8.04,14.19L15.16,18.34C15.11,18.55 15.08,18.77 15.08,19C15.08,20.61 16.39,21.91 18,21.91C19.61,21.91 20.92,20.61 20.92,19A2.92,2.92 0 0,0 18,16.08Z" />
|
|
247
188
|
</svg>`,content:`<mj-social font-size="12px" icon-size="24px" border-radius="12px" mode="horizontal">
|
|
248
189
|
<mj-social-element name="facebook"></mj-social-element>
|
|
249
190
|
<mj-social-element name="linkedin"></mj-social-element>
|
|
250
191
|
<mj-social-element name="twitter"></mj-social-element>
|
|
251
|
-
</mj-social>`}),
|
|
192
|
+
</mj-social>`}),l("mj-social-element",{label:"Social Element",media:`<svg viewBox="0 0 24 24">
|
|
252
193
|
<path d="M18 16.08C17.24 16.08 16.56 16.38 16.04 16.85L8.91 12.7C8.96 12.47 9 12.24 9 12S8.96 11.53 8.91 11.3L15.96 7.19C16.5 7.69 17.21 8 18 8C19.66 8 21 6.66 21 5S19.66 2 18 2 15 3.34 15 5C15 5.24 15.04 5.47 15.09 5.7L8.04 9.81C7.5 9.31 6.79 9 6 9C4.34 9 3 10.34 3 12S4.34 15 6 15C6.79 15 7.5 14.69 8.04 14.19L15.16 18.34C15.11 18.55 15.08 18.77 15.08 19C15.08 20.61 16.39 21.91 18 21.91S20.92 20.61 20.92 19C20.92 17.39 19.61 16.08 18 16.08M18 4C18.55 4 19 4.45 19 5S18.55 6 18 6 17 5.55 17 5 17.45 4 18 4M6 13C5.45 13 5 12.55 5 12S5.45 11 6 11 7 11.45 7 12 6.55 13 6 13M18 20C17.45 20 17 19.55 17 19S17.45 18 18 18 19 18.45 19 19 18.55 20 18 20Z" />
|
|
253
|
-
</svg>`,content:'<mj-social-element name="facebook">Facebook</mj-social-element>'}),
|
|
194
|
+
</svg>`,content:'<mj-social-element name="facebook">Facebook</mj-social-element>'}),l("mj-spacer",{label:"Spacer",media:`<svg viewBox="0 0 24 24">
|
|
254
195
|
<path fill="currentColor" d="M8,18H11V15H2V13H22V15H13V18H16L12,22L8,18M12,2L8,6H11V9H2V11H22V9H13V6H16L12,2Z" />
|
|
255
|
-
</svg>`,content:"<mj-spacer/>"}),
|
|
196
|
+
</svg>`,content:"<mj-spacer/>"}),l("mj-navbar",{label:"Navbar",media:`<svg viewBox="0 0 24 24">
|
|
256
197
|
<path fill="currentColor" d="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z" />
|
|
257
198
|
</svg>`,content:`<mj-navbar>
|
|
258
199
|
<mj-navbar-link>HOME</mj-navbar-link>
|
|
259
200
|
<mj-navbar-link>ABOUT</mj-navbar-link>
|
|
260
201
|
<mj-navbar-link>CONTACT</mj-navbar-link>
|
|
261
202
|
<mj-navbar-link>BLOG</mj-navbar-link>
|
|
262
|
-
</mj-navbar>`}),
|
|
203
|
+
</mj-navbar>`}),l("mj-hero",{label:"Hero",media:`<svg viewBox="0 0 24 24">
|
|
263
204
|
<path fill="currentColor" d="M20,20H4A2,2 0 0,1 2,18V6A2,2 0 0,1 4,4H20A2,2 0 0,1 22,6V18A2,2 0 0,1 20,20M4,6V18H20V6H4M6,9H18V11H6V9M6,13H16V15H6V13Z" />
|
|
264
|
-
</svg>`,content:`<mj-hero mode="fixed-height" height="469px" background-width="600px" background-height="469px" background-url="${
|
|
205
|
+
</svg>`,content:`<mj-hero mode="fixed-height" height="469px" background-width="600px" background-height="469px" background-url="${x0({width:600,height:300,text:"Hero Image",fg:"555"})}" background-color="#2a3448" padding="100px 0px">
|
|
265
206
|
<mj-text padding="20px" color="#ffffff" font-family="Helvetica" align="center" font-size="45px" line-height="45px" font-weight="900">
|
|
266
207
|
Heading title
|
|
267
208
|
</mj-text>
|
|
@@ -271,79 +212,150 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
271
212
|
<mj-button href="https://mjml.io/" align="center">
|
|
272
213
|
Call to action!
|
|
273
214
|
</mj-button>
|
|
274
|
-
</mj-hero>`}),
|
|
215
|
+
</mj-hero>`}),l("mj-raw",{label:"HTML block",activate:!0,media:`<svg viewBox="0 0 24 24">
|
|
275
216
|
<path d="M5.59 3.41L7 4.82L3.82 8L7 11.18L5.59 12.6L1 8L5.59 3.41M11.41 3.41L16 8L11.41 12.6L10 11.18L13.18 8L10 4.82L11.41 3.41M22 6V18C22 19.11 21.11 20 20 20H4C2.9 20 2 19.11 2 18V14H4V18H20V6H17.03V4H20C21.11 4 22 4.89 22 6Z" />
|
|
276
217
|
</svg>`,content:`<mj-raw>
|
|
277
218
|
<span>Insert here you custom HTML</span>
|
|
278
|
-
</mj-raw>`}),
|
|
219
|
+
</mj-raw>`}),l("mj-1-column",{...i,label:"1 Column",mediaReact:h.jsx(fe,{...o,children:h.jsx(U,{className:s,grow:!0})}),content:`<mj-section>
|
|
279
220
|
<mj-column></mj-column>
|
|
280
|
-
</mj-section>`}),
|
|
221
|
+
</mj-section>`}),l("mj-2-columns-50-50",{...i,label:"2 Columns 50/50",mediaReact:h.jsxs(fe,{...o,children:[h.jsx(U,{className:s,grow:!0}),h.jsx(U,{className:s,grow:!0})]}),content:`<mj-section>
|
|
281
222
|
<mj-column></mj-column>
|
|
282
223
|
<mj-column></mj-column>
|
|
283
|
-
</mj-section>`}),
|
|
224
|
+
</mj-section>`}),l("mj-2-columns-25-75",{...i,label:"2 Columns 25/75",mediaReact:h.jsxs(fe,{...o,children:[h.jsx(U,{className:Re(s,"gs-utl-basis-1/4")}),h.jsx(U,{className:Re(s,"gs-utl-basis-3/4")})]}),content:`<mj-section>
|
|
284
225
|
<mj-column width="25%"></mj-column>
|
|
285
226
|
<mj-column width="75%"></mj-column>
|
|
286
|
-
</mj-section>`}),
|
|
227
|
+
</mj-section>`}),l("mj-2-columns-33-67",{...i,label:"2 Columns 33/67",mediaReact:h.jsxs(fe,{...o,children:[h.jsx(U,{className:Re(s,"gs-utl-basis-1/3")}),h.jsx(U,{className:Re(s,"gs-utl-basis-2/3")})]}),content:`<mj-section>
|
|
287
228
|
<mj-column width="33%"></mj-column>
|
|
288
229
|
<mj-column width="67%"></mj-column>
|
|
289
|
-
</mj-section>`}),
|
|
230
|
+
</mj-section>`}),l("mj-2-columns-67-33",{...i,label:"2 Columns 67/33",mediaReact:h.jsxs(fe,{...o,children:[h.jsx(U,{className:Re(s,"gs-utl-basis-2/3")}),h.jsx(U,{className:Re(s,"gs-utl-basis-1/3")})]}),content:`<mj-section>
|
|
290
231
|
<mj-column width="67%"></mj-column>
|
|
291
232
|
<mj-column width="33%"></mj-column>
|
|
292
|
-
</mj-section>`}),
|
|
233
|
+
</mj-section>`}),l("mj-2-columns-75-25",{...i,label:"2 Columns 75/25",mediaReact:h.jsxs(fe,{...o,children:[h.jsx(U,{className:Re(s,"gs-utl-basis-3/4")}),h.jsx(U,{className:Re(s,"gs-utl-basis-1/4")})]}),content:`<mj-section>
|
|
293
234
|
<mj-column width="75%"></mj-column>
|
|
294
235
|
<mj-column width="25%"></mj-column>
|
|
295
|
-
</mj-section>`}),
|
|
236
|
+
</mj-section>`}),l("mj-3-columns",{...i,label:"3 Columns",mediaReact:h.jsxs(fe,{...o,children:[h.jsx(U,{className:s,grow:!0}),h.jsx(U,{className:s,grow:!0}),h.jsx(U,{className:s,grow:!0})]}),content:`<mj-section>
|
|
296
237
|
<mj-column></mj-column>
|
|
297
238
|
<mj-column></mj-column>
|
|
298
239
|
<mj-column></mj-column>
|
|
299
|
-
</mj-section>`}),
|
|
240
|
+
</mj-section>`}),l("mj-3-columns-25-25-50",{...i,label:"3 Columns 25/25/50",mediaReact:h.jsxs(fe,{...o,children:[h.jsx(U,{className:Re(s,"gs-utl-basis-1/4")}),h.jsx(U,{className:Re(s,"gs-utl-basis-1/4")}),h.jsx(U,{className:Re(s,"gs-utl-basis-2/4")})]}),content:`<mj-section>
|
|
300
241
|
<mj-column width="25%"></mj-column>
|
|
301
242
|
<mj-column width="25%"></mj-column>
|
|
302
243
|
<mj-column width="50%"></mj-column>
|
|
303
|
-
</mj-section>`}),
|
|
244
|
+
</mj-section>`}),l("mj-3-columns-25-50-25",{...i,label:"3 Columns 25/50/25",mediaReact:h.jsxs(fe,{...o,children:[h.jsx(U,{className:Re(s,"gs-utl-basis-1/4")}),h.jsx(U,{className:Re(s,"gs-utl-basis-2/4")}),h.jsx(U,{className:Re(s,"gs-utl-basis-1/4")})]}),content:`<mj-section>
|
|
304
245
|
<mj-column width="25%"></mj-column>
|
|
305
246
|
<mj-column width="50%"></mj-column>
|
|
306
247
|
<mj-column width="25%"></mj-column>
|
|
307
|
-
</mj-section>`}),
|
|
248
|
+
</mj-section>`}),l("mj-3-columns-50-25-25",{...i,label:"3 Columns 50/25/25",mediaReact:h.jsxs(fe,{...o,children:[h.jsx(U,{className:Re(s,"gs-utl-basis-2/4")}),h.jsx(U,{className:Re(s,"gs-utl-basis-1/4")}),h.jsx(U,{className:Re(s,"gs-utl-basis-1/4")})]}),content:`<mj-section>
|
|
308
249
|
<mj-column width="50%"></mj-column>
|
|
309
250
|
<mj-column width="25%"></mj-column>
|
|
310
251
|
<mj-column width="25%"></mj-column>
|
|
311
|
-
</mj-section>`}),
|
|
252
|
+
</mj-section>`}),l("mj-4-columns",{...i,label:"4 Columns",mediaReact:h.jsxs(fe,{...o,children:[h.jsx(U,{className:s,grow:!0}),h.jsx(U,{className:s,grow:!0}),h.jsx(U,{className:s,grow:!0}),h.jsx(U,{className:s,grow:!0})]}),content:`<mj-section>
|
|
312
253
|
<mj-column></mj-column>
|
|
313
254
|
<mj-column></mj-column>
|
|
314
255
|
<mj-column></mj-column>
|
|
315
256
|
<mj-column></mj-column>
|
|
316
|
-
</mj-section>`})}
|
|
257
|
+
</mj-section>`})}tf.email+"",tf.web+"";const hA=/\s(?![^(]*\))/,Kg=/^-?[0-9]+[a-zA-Z%]{0,}$/;function Yg(t){const e=t.split(hA),n=e.indexOf("inset")>=0,r=e.filter(u=>u!=="inset"),o=r.filter(u=>!Kg.test(u))[0]||"currentColor",i=r.filter(u=>Kg.test(u)),[s="0",l="0",a="0",c="0"]=i;return{x:s,y:l,blur:a,spread:c,inset:n,color:o}}function eu(t){const e=t.indexOf("(")+1,n=t.lastIndexOf(")");return{name:t.substring(0,e-1).trim(),value:String.prototype.substring.apply(t,[e,n>=0?n:void 0]).trim()}}var af={exports:{}},Rs={};/**
|
|
317
258
|
* @license React
|
|
318
|
-
* react-jsx-runtime.production.
|
|
259
|
+
* react-jsx-runtime.production.js
|
|
319
260
|
*
|
|
320
|
-
* Copyright (c)
|
|
261
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
321
262
|
*
|
|
322
263
|
* This source code is licensed under the MIT license found in the
|
|
323
264
|
* LICENSE file in the root directory of this source tree.
|
|
324
|
-
*/var
|
|
265
|
+
*/var Jg;function gA(){if(Jg)return Rs;Jg=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,o,i){var s=null;if(i!==void 0&&(s=""+i),o.key!==void 0&&(s=""+o.key),"key"in o){i={};for(var l in o)l!=="key"&&(i[l]=o[l])}else i=o;return o=i.ref,{$$typeof:t,type:r,key:s,ref:o!==void 0?o:null,props:i}}return Rs.Fragment=e,Rs.jsx=n,Rs.jsxs=n,Rs}var Ns={},Zg;function mA(){if(Zg)return Ns;Zg=1;var t={};/**
|
|
325
266
|
* @license React
|
|
326
267
|
* react-jsx-runtime.development.js
|
|
327
268
|
*
|
|
328
|
-
* Copyright (c)
|
|
269
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
329
270
|
*
|
|
330
271
|
* This source code is licensed under the MIT license found in the
|
|
331
272
|
* LICENSE file in the root directory of this source tree.
|
|
332
|
-
*/
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
`),
|
|
336
|
-
|
|
273
|
+
*/return t.NODE_ENV!=="production"&&function(){function e(T){if(T==null)return null;if(typeof T=="function")return T.$$typeof===L?null:T.displayName||T.name||null;if(typeof T=="string")return T;switch(T){case _:return"Fragment";case E:return"Portal";case k:return"Profiler";case M:return"StrictMode";case z:return"Suspense";case W:return"SuspenseList"}if(typeof T=="object")switch(typeof T.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),T.$$typeof){case N:return(T.displayName||"Context")+".Provider";case j:return(T._context.displayName||"Context")+".Consumer";case P:var re=T.render;return T=T.displayName,T||(T=re.displayName||re.name||"",T=T!==""?"ForwardRef("+T+")":"ForwardRef"),T;case F:return re=T.displayName||null,re!==null?re:e(T.type)||"Memo";case $:re=T._payload,T=T._init;try{return e(T(re))}catch{}}return null}function n(T){return""+T}function r(T){try{n(T);var re=!1}catch{re=!0}if(re){re=console;var ie=re.error,Ce=typeof Symbol=="function"&&Symbol.toStringTag&&T[Symbol.toStringTag]||T.constructor.name||"Object";return ie.call(re,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",Ce),n(T)}}function o(){}function i(){if(V===0){te=console.log,G=console.info,Q=console.warn,se=console.error,be=console.group,de=console.groupCollapsed,Pe=console.groupEnd;var T={configurable:!0,enumerable:!0,value:o,writable:!0};Object.defineProperties(console,{info:T,log:T,warn:T,error:T,group:T,groupCollapsed:T,groupEnd:T})}V++}function s(){if(V--,V===0){var T={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:R({},T,{value:te}),info:R({},T,{value:G}),warn:R({},T,{value:Q}),error:R({},T,{value:se}),group:R({},T,{value:be}),groupCollapsed:R({},T,{value:de}),groupEnd:R({},T,{value:Pe})})}0>V&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function l(T){if(X===void 0)try{throw Error()}catch(ie){var re=ie.stack.trim().match(/\n( *(at )?)/);X=re&&re[1]||"",qe=-1<ie.stack.indexOf(`
|
|
274
|
+
at`)?" (<anonymous>)":-1<ie.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
275
|
+
`+X+T+qe}function a(T,re){if(!T||Qe)return"";var ie=at.get(T);if(ie!==void 0)return ie;Qe=!0,ie=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var Ce=null;Ce=I.H,I.H=null,i();try{var Xe={DetermineComponentFrameRoot:function(){try{if(re){var xn=function(){throw Error()};if(Object.defineProperty(xn.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xn,[])}catch(et){var it=et}Reflect.construct(T,[],xn)}else{try{xn.call()}catch(et){it=et}T.call(xn.prototype)}}else{try{throw Error()}catch(et){it=et}(xn=T())&&typeof xn.catch=="function"&&xn.catch(function(){})}}catch(et){if(et&&it&&typeof et.stack=="string")return[et.stack,it.stack]}return[null,null]}};Xe.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var Te=Object.getOwnPropertyDescriptor(Xe.DetermineComponentFrameRoot,"name");Te&&Te.configurable&&Object.defineProperty(Xe.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var me=Xe.DetermineComponentFrameRoot(),on=me[0],yn=me[1];if(on&&yn){var ft=on.split(`
|
|
276
|
+
`),Ut=yn.split(`
|
|
277
|
+
`);for(me=Te=0;Te<ft.length&&!ft[Te].includes("DetermineComponentFrameRoot");)Te++;for(;me<Ut.length&&!Ut[me].includes("DetermineComponentFrameRoot");)me++;if(Te===ft.length||me===Ut.length)for(Te=ft.length-1,me=Ut.length-1;1<=Te&&0<=me&&ft[Te]!==Ut[me];)me--;for(;1<=Te&&0<=me;Te--,me--)if(ft[Te]!==Ut[me]){if(Te!==1||me!==1)do if(Te--,me--,0>me||ft[Te]!==Ut[me]){var Sr=`
|
|
278
|
+
`+ft[Te].replace(" at new "," at ");return T.displayName&&Sr.includes("<anonymous>")&&(Sr=Sr.replace("<anonymous>",T.displayName)),typeof T=="function"&&at.set(T,Sr),Sr}while(1<=Te&&0<=me);break}}}finally{Qe=!1,I.H=Ce,s(),Error.prepareStackTrace=ie}return ft=(ft=T?T.displayName||T.name:"")?l(ft):"",typeof T=="function"&&at.set(T,ft),ft}function c(T){if(T==null)return"";if(typeof T=="function"){var re=T.prototype;return a(T,!(!re||!re.isReactComponent))}if(typeof T=="string")return l(T);switch(T){case z:return l("Suspense");case W:return l("SuspenseList")}if(typeof T=="object")switch(T.$$typeof){case P:return T=a(T.render,!1),T;case F:return c(T.type);case $:re=T._payload,T=T._init;try{return c(T(re))}catch{}}return""}function u(){var T=I.A;return T===null?null:T.getOwner()}function d(T){if(A.call(T,"key")){var re=Object.getOwnPropertyDescriptor(T,"key").get;if(re&&re.isReactWarning)return!1}return T.key!==void 0}function f(T,re){function ie(){wt||(wt=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",re))}ie.isReactWarning=!0,Object.defineProperty(T,"key",{get:ie,configurable:!0})}function p(){var T=e(this.type);return rn[T]||(rn[T]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),T=this.props.ref,T!==void 0?T:null}function g(T,re,ie,Ce,Xe,Te){return ie=Te.ref,T={$$typeof:x,type:T,key:re,props:Te,_owner:Xe},(ie!==void 0?ie:null)!==null?Object.defineProperty(T,"ref",{enumerable:!1,get:p}):Object.defineProperty(T,"ref",{enumerable:!1,value:null}),T._store={},Object.defineProperty(T._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(T,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(T.props),Object.freeze(T)),T}function b(T,re,ie,Ce,Xe,Te){if(typeof T=="string"||typeof T=="function"||T===_||T===k||T===M||T===z||T===W||T===J||typeof T=="object"&&T!==null&&(T.$$typeof===$||T.$$typeof===F||T.$$typeof===N||T.$$typeof===j||T.$$typeof===P||T.$$typeof===q||T.getModuleId!==void 0)){var me=re.children;if(me!==void 0)if(Ce)if(D(me)){for(Ce=0;Ce<me.length;Ce++)v(me[Ce],T);Object.freeze&&Object.freeze(me)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else v(me,T)}else me="",(T===void 0||typeof T=="object"&&T!==null&&Object.keys(T).length===0)&&(me+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),T===null?Ce="null":D(T)?Ce="array":T!==void 0&&T.$$typeof===x?(Ce="<"+(e(T.type)||"Unknown")+" />",me=" Did you accidentally export a JSX literal instead of a component?"):Ce=typeof T,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ce,me);if(A.call(re,"key")){me=e(T);var on=Object.keys(re).filter(function(ft){return ft!=="key"});Ce=0<on.length?"{key: someKey, "+on.join(": ..., ")+": ...}":"{key: someKey}",Le[me+Ce]||(on=0<on.length?"{"+on.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
279
|
+
let props = %s;
|
|
280
|
+
<%s {...props} />
|
|
281
|
+
React keys must be passed directly to JSX without using spread:
|
|
282
|
+
let props = %s;
|
|
283
|
+
<%s key={someKey} {...props} />`,Ce,me,on,me),Le[me+Ce]=!0)}if(me=null,ie!==void 0&&(r(ie),me=""+ie),d(re)&&(r(re.key),me=""+re.key),"key"in re){ie={};for(var yn in re)yn!=="key"&&(ie[yn]=re[yn])}else ie=re;return me&&f(ie,typeof T=="function"?T.displayName||T.name||"Unknown":T),g(T,me,Te,Xe,u(),ie)}function v(T,re){if(typeof T=="object"&&T&&T.$$typeof!==xt){if(D(T))for(var ie=0;ie<T.length;ie++){var Ce=T[ie];y(Ce)&&w(Ce,re)}else if(y(T))T._store&&(T._store.validated=1);else if(T===null||typeof T!="object"?ie=null:(ie=ee&&T[ee]||T["@@iterator"],ie=typeof ie=="function"?ie:null),typeof ie=="function"&&ie!==T.entries&&(ie=ie.call(T),ie!==T))for(;!(T=ie.next()).done;)y(T.value)&&w(T.value,re)}}function y(T){return typeof T=="object"&&T!==null&&T.$$typeof===x}function w(T,re){if(T._store&&!T._store.validated&&T.key==null&&(T._store.validated=1,re=S(re),!ot[re])){ot[re]=!0;var ie="";T&&T._owner!=null&&T._owner!==u()&&(ie=null,typeof T._owner.tag=="number"?ie=e(T._owner.type):typeof T._owner.name=="string"&&(ie=T._owner.name),ie=" It was passed a child from "+ie+".");var Ce=I.getCurrentStack;I.getCurrentStack=function(){var Xe=c(T.type);return Ce&&(Xe+=Ce()||""),Xe},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',re,ie),I.getCurrentStack=Ce}}function S(T){var re="",ie=u();return ie&&(ie=e(ie.type))&&(re=`
|
|
337
284
|
|
|
338
|
-
Check the render method of \``+
|
|
285
|
+
Check the render method of \``+ie+"`."),re||(T=e(T))&&(re=`
|
|
339
286
|
|
|
340
|
-
Check the top-level render call using <`+b+">.")}return j}}function ks(S,j){{if(!S._store||S._store.validated||S.key!=null)return;S._store.validated=!0;var b=_s(j);if(Es[b])return;Es[b]=!0;var k="";S&&S._owner&&S._owner!==po.current&&(k=" It was passed a child from "+K(S._owner.type)+"."),An(S),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',b,k),An(null)}}function ho(S,j){{if(typeof S!="object")return;if(Zn(S))for(var b=0;b<S.length;b++){var k=S[b];Tr(k)&&ks(k,j)}else if(Tr(S))S._store&&(S._store.validated=!0);else if(S){var V=g(S);if(typeof V=="function"&&V!==S.entries)for(var q=V.call(S),X;!(X=q.next()).done;)Tr(X.value)&&ks(X.value,j)}}}function As(S){{var j=S.type;if(j==null||typeof j=="string")return;var b;if(typeof j=="function")b=j.propTypes;else if(typeof j=="object"&&(j.$$typeof===l||j.$$typeof===f))b=j.propTypes;else return;if(b){var k=K(j);Te(b,S.props,"prop",k,S)}else if(j.PropTypes!==void 0&&!un){un=!0;var V=K(j);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",V||"Unknown")}typeof j.getDefaultProps=="function"&&!j.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ll(S){{for(var j=Object.keys(S.props),b=0;b<j.length;b++){var k=j[b];if(k!=="children"&&k!=="key"){An(S),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",k),An(null);break}}S.ref!==null&&(An(S),w("Invalid attribute `ref` supplied to `React.Fragment`."),An(null))}}function Ts(S,j,b,k,V,q){{var X=P(S);if(!X){var ee="";(S===void 0||typeof S=="object"&&S!==null&&Object.keys(S).length===0)&&(ee+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var le=Os();le?ee+=le:ee+=mi();var ne;S===null?ne="null":Zn(S)?ne="array":S!==void 0&&S.$$typeof===e?(ne="<"+(K(S.type)||"Unknown")+" />",ee=" Did you accidentally export a JSX literal instead of a component?"):ne=typeof S,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ne,ee)}var ve=Dl(S,j,b,V,q);if(ve==null)return ve;if(X){var ye=j.children;if(ye!==void 0)if(k)if(Zn(ye)){for(var Me=0;Me<ye.length;Me++)ho(ye[Me],S);Object.freeze&&Object.freeze(ye)}else w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ho(ye,S)}return S===r?Ll(ve):As(ve),ve}}function Ms(S,j,b){return Ts(S,j,b,!0)}function Ns(S,j,b){return Ts(S,j,b,!1)}var jl=Ns,Hl=Ms;Gs.Fragment=r,Gs.jsx=jl,Gs.jsxs=Hl}()),Gs}hg.NODE_ENV==="production"?gu.exports=_O():gu.exports=kO();var Ze=gu.exports;const mg=O.createContext(null),AO=({children:t})=>{const[e,n]=O.useState({setEditor:r=>{n(i=>({...i,editor:r}))}});return Ze.jsx(mg.Provider,{value:e,children:t})},kn=()=>{const t=O.useContext(mg);if(!t)throw new Error("useEditorInstance must be used within EditorInstanceProvider");return t},gg=O.createContext(null),TO=({children:t})=>{const[e,n]=O.useState(()=>({setRefCanvas(r){n(i=>({...i,refCanvas:r}))},setCustomModal(r){n(i=>({...i,customModal:r}))},setCustomAssets(r){n(i=>({...i,customAssets:r}))},setCustomBlocks(r){n(i=>({...i,customBlocks:r}))},setCustomRte(r){n(i=>({...i,customRte:r}))},setCustomStyles(r){n(i=>({...i,customStyles:r}))},setCustomLayers(r){n(i=>({...i,customLayers:r}))},setCustomSelectors(r){n(i=>({...i,customSelectors:r}))},setCustomTraits(r){n(i=>({...i,customTraits:r}))},setReady(r){n(i=>({...i,ready:r}))}}));return Ze.jsx(gg.Provider,{value:e,children:t})},Kn=()=>{const t=O.useContext(gg);if(!t)throw new Error("useEditorOptions must be used within EditorOptionsProvider");return t};function MO(...t){return(Array.isArray(t[0])?t[0]:[...t]).filter(Boolean).join(" ")}function Or(t){return typeof t=="function"}function nn(){}const bg=t=>typeof t=="string",NO=async t=>{const e=document.createElement("link");e.href=t,e.rel="stylesheet",document.head.appendChild(e)},vg=t=>{const e=bg(t)?{id:t,src:t}:t;return new Promise((n,r)=>{const i=document.createElement("script");if(document.querySelector(`script[src="${e.src}"]`))return n(e.id);i.src=e.src,i.onload=()=>n(e.id),i.onerror=()=>r(e.id),document.head.appendChild(i)})},RO=t=>{const e=t.map(n=>vg(n));return Promise.allSettled(e)},Sp=t=>function(){const e=O.useRef(null);return O.useEffect(()=>{const{current:n}=e;n&&(bg(t)?n.innerHTML=t:n.appendChild(t))},[e.current]),Ze.jsx("div",{ref:e})},Cp=new WeakMap;function co(t){if(!t)return()=>null;const e=Cp.get(t);if(e)return e;const n=function({children:r}){return tl.createPortal(r,t)};return Cp.set(t,n),n}O.memo(function({children:t}){const{editor:e}=kn(),n=Kn(),[r,i]=O.useState(!1),[o,s]=O.useState({assets:[],types:[],close:()=>{},select:()=>{},Container:()=>null});return O.useEffect(()=>{if(!e)return;const a=e.Assets.events.custom,l=({open:c,assets:u,types:f,select:d,close:p,container:h})=>{c&&s({assets:u,types:f,select:d,close:p,Container:co(h)}),i(c)};return e.on(a,l),()=>{e.off(a,l)}},[e]),O.useEffect(()=>n.setCustomAssets(!0),[]),e&&Or(t)?t({open:r,...o}):null});O.memo(function({children:t}){const{editor:e}=kn(),n=Kn(),[r,i]=O.useState(()=>({blocks:[],dragStart:nn,dragStop:nn,mapCategoryBlocks:new Map,Container:()=>null}));return O.useEffect(()=>{if(!e)return;const o=e.Blocks.events.custom,s=({blocks:a,container:l,dragStart:c,dragStop:u})=>{const f=a.reduce((d,p)=>{const h=p.getCategoryLabel(),m=d.get(h);return m?m.push(p):d.set(h,[p]),d},new Map);i({blocks:a,dragStart:c,dragStop:u,mapCategoryBlocks:f,Container:co(l)})};return e.on(o,s),e.Blocks.__trgCustom(),()=>{e.off(o,s)}},[e]),O.useEffect(()=>n.setCustomBlocks(!0),[]),e&&Or(t)?t(r):null});O.memo(function({children:t}){const{editor:e}=kn(),[n,r]=O.useState(()=>({devices:[],selected:"",select:nn}));return O.useEffect(()=>{if(!e)return;const{Devices:i}=e,o=i.events.all,s=()=>{var a;r({devices:i.getDevices(),selected:(a=i.getSelected())==null?void 0:a.id,select:l=>i.select(l)})};return e.on(o,s),s(),()=>{e.off(o,s)}},[e]),e&&Or(t)?t(n):null});const PO=t=>!!(t&&!Array.isArray(t)&&typeof t=="object");async function VO(t){const e=t.map(({id:o,src:s})=>({id:o,src:s})),n=t.reduce((o,s)=>(o[s.id]=s,o),{}),r=[],i=[];return(await RO(e)).forEach(o=>{o.status==="fulfilled"?r.push(n[o.value]):i.push(n[o.reason])}),{loaded:r,failed:i}}const DO=async t=>{const e=[...t],n={};if(e.length){const r={},i=[];if(e.forEach((o,s)=>{PO(o)&&(r[o.id]={index:s},i.push(o))}),i.length){const{loaded:o}=await VO(i);o.forEach(({id:s,options:a})=>{r[s].loaded=!0,n[s]=a||{}})}Object.keys(r).forEach(o=>{const s=r[o];s.loaded?e[s.index]=o:e[s.index]=!1})}return{plugins:e.filter(Boolean),pluginOptions:n}},LO=O.memo(function({children:t,className:e,style:n,options:r={},plugins:i=[],grapesjs:o,grapesjsCss:s,onEditor:a=nn,onReady:l,onUpdate:c,waitReady:u,...f}){const{setEditor:d}=kn(),p=Kn(),[h,m]=O.useState(!1),g=O.useRef(null);O.useEffect(()=>{if(!p.ready||!g.current)return;const A=g.current,B=p.refCanvas;let T,P={},I=[];const z=K=>{const te={height:"100%",...r,plugins:[...I,...r.plugins||[]],pluginsOpts:{...r.pluginsOpts,...P},modal:{...r.modal,custom:!!p.customModal},assetManager:{...r.assetManager,custom:!!p.customAssets},styleManager:{...r.styleManager,custom:!!p.customStyles},blockManager:{...r.blockManager,custom:!!p.customBlocks},richTextEditor:{...r.richTextEditor,custom:!!p.customRte},layerManager:{...r.layerManager,custom:!!p.customLayers},traitManager:{...r.traitManager,custom:!!p.customTraits},selectorManager:{...r.selectorManager,custom:!!p.customSelectors},container:B||A,customUI:!!B,...B?{panels:{defaults:[]}}:{}};T=K.init(te),d(T),a(T),c&&T.on("update",()=>{c(T.getProjectData(),T)}),T.onReady(()=>{m(!0),l==null||l(T)})};return(async()=>{s&&await NO(s);const K=await DO(i);I=K.plugins,P=K.pluginOptions,typeof o=="string"?(await vg(o),z(window.grapesjs)):z(o)})(),()=>T==null?void 0:T.destroy()},[p.ready]);const y=r.height??"100%",w=r.width??"100%",x=MO("gjs-editor-wrapper",e),C=u&&!h,v=O.useMemo(()=>({...n,height:y,width:w}),[y,w,n]),E=O.useMemo(()=>({...v,...C?{opacity:0,width:0,height:0}:{}}),[v,C]);return Ze.jsxs(Ze.Fragment,{children:[u&&!h?Ze.jsx("div",{className:x,style:v,children:u}):null,Ze.jsx("div",{...f,ref:g,className:x,style:E,children:t})]})}),jO=O.memo(function(){const t=Kn();return O.useEffect(()=>t.setReady(!0),[]),Ze.jsx(Ze.Fragment,{})});O.memo(function({children:t,...e}){return Ze.jsx(AO,{children:Ze.jsx(TO,{children:Ze.jsxs(LO,{...e,children:[t,Ze.jsx(jO,{})]})})})});O.memo(function({children:t}){const{editor:e}=kn(),n=Kn(),[r,i]=O.useState(()=>({root:void 0,Container:()=>null}));return O.useEffect(()=>{if(!e)return;const{Layers:o}=e,s=o.events.custom,a=({container:l})=>{i({root:o.getRoot(),Container:co(l)})};return e.on(s,a),o.__trgCustom({}),()=>{e.off(s,a)}},[e]),O.useEffect(()=>n.setCustomLayers(!0),[]),e&&Or(t)?t(r):null});O.memo(function({children:t}){const{editor:e}=kn(),n=Kn(),[r,i]=O.useState(!1),[o,s]=O.useState({title:Ze.jsx(Ze.Fragment,{}),content:Ze.jsx(Ze.Fragment,{}),attributes:{},close:nn});return O.useEffect(()=>{if(!e)return;const a="modal",l=({open:c,title:u,content:f,close:d,attributes:p})=>{c&&s({title:O.createElement(Sp(u)),content:O.createElement(Sp(f)),attributes:p,close:d}),i(c)};return e.on(a,l),()=>{e.off(a,l)}},[e]),O.useEffect(()=>n.setCustomModal(!0),[]),e&&typeof t=="function"?t({open:r,...o}):null});O.memo(function({children:t}){const{editor:e}=kn(),[n,r]=O.useState(()=>({pages:[],selected:void 0,select:nn,add:nn,remove:nn}));return O.useEffect(()=>{if(!e)return;const{Pages:i}=e,o=i.events.all,s=()=>{r({pages:i.getAll(),selected:i.getSelected(),select:(...a)=>i.select(...a),add:(...a)=>i.add(...a),remove:(...a)=>i.remove(...a)})};return e.on(o,s),s(),()=>{e.off(o,s)}},[e]),e&&Or(t)?t(n):null});O.memo(function({children:t}){const{editor:e}=kn(),n=Kn(),[r,i]=O.useState(()=>({selectors:[],states:[],selectedState:"",targets:[],addSelector:nn,removeSelector:nn,setState:nn,Container:()=>null}));return O.useEffect(()=>{if(!e)return;const{Selectors:o}=e,s=o.events.custom,a=({container:l})=>{i({selectors:o.getSelected(),states:o.getStates(),selectedState:o.getState(),targets:o.getSelectedTargets().map(c=>c.getSelectorsString()),addSelector:(...c)=>o.addSelected(...c),removeSelector:(...c)=>o.removeSelected(...c),setState:(...c)=>o.setState(...c),Container:co(l)})};return e.on(s,a),()=>{e.off(s,a)}},[e]),O.useEffect(()=>n.setCustomSelectors(!0),[]),e&&Or(t)?t(r):null});O.memo(function({children:t}){const{editor:e}=kn(),n=Kn(),[r,i]=O.useState(()=>({sectors:[],Container:()=>null}));return O.useEffect(()=>{if(!e)return;const{Styles:o}=e,s=o.events.custom,a=({container:l})=>{i({sectors:o.getSectors({visible:!0}),Container:co(l)})};return e.on(s,a),()=>{e.off(s,a)}},[e]),O.useEffect(()=>n.setCustomStyles(!0),[]),e&&Or(t)?t(r):null});O.memo(function({children:t}){const{editor:e}=kn(),n=Kn(),[r,i]=O.useState(()=>({traits:[],Container:()=>null}));return O.useEffect(()=>{if(!e)return;const{Traits:o}=e,s=o.events.custom,a=({container:l})=>{i({traits:o.getCurrent(),Container:co(l)})};return e.on(s,a),o.__trgCustom(),()=>{e.off(s,a)}},[e]),O.useEffect(()=>n.setCustomTraits(!0),[]),e&&Or(t)?t(r):null});var HO={grad:.9,turn:360,rad:360/(2*Math.PI)},Tn=function(t){return typeof t=="string"?t.length>0:typeof t=="number"},$e=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=Math.pow(10,e)),Math.round(n*t)/n+0},Ht=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=1),t>n?n:t>e?t:e},yg=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},Op=function(t){return{r:Ht(t.r,0,255),g:Ht(t.g,0,255),b:Ht(t.b,0,255),a:Ht(t.a)}},pc=function(t){return{r:$e(t.r),g:$e(t.g),b:$e(t.b),a:$e(t.a,3)}},IO=/^#([0-9a-f]{3,8})$/i,Ks=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},wg=function(t){var e=t.r,n=t.g,r=t.b,i=t.a,o=Math.max(e,n,r),s=o-Math.min(e,n,r),a=s?o===e?(n-r)/s:o===n?2+(r-e)/s:4+(e-n)/s:0;return{h:60*(a<0?a+6:a),s:o?s/o*100:0,v:o/255*100,a:i}},xg=function(t){var e=t.h,n=t.s,r=t.v,i=t.a;e=e/360*6,n/=100,r/=100;var o=Math.floor(e),s=r*(1-n),a=r*(1-(e-o)*n),l=r*(1-(1-e+o)*n),c=o%6;return{r:255*[r,a,s,s,l,r][c],g:255*[l,r,r,a,s,s][c],b:255*[s,s,l,r,r,a][c],a:i}},Ep=function(t){return{h:yg(t.h),s:Ht(t.s,0,100),l:Ht(t.l,0,100),a:Ht(t.a)}},_p=function(t){return{h:$e(t.h),s:$e(t.s),l:$e(t.l),a:$e(t.a,3)}},kp=function(t){return xg((n=(e=t).s,{h:e.h,s:(n*=((r=e.l)<50?r:100-r)/100)>0?2*n/(r+n)*100:0,v:r+n,a:e.a}));var e,n,r},Do=function(t){return{h:(e=wg(t)).h,s:(i=(200-(n=e.s))*(r=e.v)/100)>0&&i<200?n*r/100/(i<=100?i:200-i)*100:0,l:i/2,a:e.a};var e,n,r,i},BO=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,$O=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,zO=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,FO=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,bu={string:[[function(t){var e=IO.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?$e(parseInt(t[3]+t[3],16)/255,2):1}:t.length===6||t.length===8?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:t.length===8?$e(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=zO.exec(t)||FO.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:Op({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(t){var e=BO.exec(t)||$O.exec(t);if(!e)return null;var n,r,i=Ep({h:(n=e[1],r=e[2],r===void 0&&(r="deg"),Number(n)*(HO[r]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return kp(i)},"hsl"]],object:[[function(t){var e=t.r,n=t.g,r=t.b,i=t.a,o=i===void 0?1:i;return Tn(e)&&Tn(n)&&Tn(r)?Op({r:Number(e),g:Number(n),b:Number(r),a:Number(o)}):null},"rgb"],[function(t){var e=t.h,n=t.s,r=t.l,i=t.a,o=i===void 0?1:i;if(!Tn(e)||!Tn(n)||!Tn(r))return null;var s=Ep({h:Number(e),s:Number(n),l:Number(r),a:Number(o)});return kp(s)},"hsl"],[function(t){var e=t.h,n=t.s,r=t.v,i=t.a,o=i===void 0?1:i;if(!Tn(e)||!Tn(n)||!Tn(r))return null;var s=function(a){return{h:yg(a.h),s:Ht(a.s,0,100),v:Ht(a.v,0,100),a:Ht(a.a)}}({h:Number(e),s:Number(n),v:Number(r),a:Number(o)});return xg(s)},"hsv"]]},Ap=function(t,e){for(var n=0;n<e.length;n++){var r=e[n][0](t);if(r)return[r,e[n][1]]}return[null,void 0]},WO=function(t){return typeof t=="string"?Ap(t.trim(),bu.string):typeof t=="object"&&t!==null?Ap(t,bu.object):[null,void 0]},hc=function(t,e){var n=Do(t);return{h:n.h,s:Ht(n.s+100*e,0,100),l:n.l,a:n.a}},mc=function(t){return(299*t.r+587*t.g+114*t.b)/1e3/255},Tp=function(t,e){var n=Do(t);return{h:n.h,s:n.s,l:Ht(n.l+100*e,0,100),a:n.a}},vu=function(){function t(e){this.parsed=WO(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return t.prototype.isValid=function(){return this.parsed!==null},t.prototype.brightness=function(){return $e(mc(this.rgba),2)},t.prototype.isDark=function(){return mc(this.rgba)<.5},t.prototype.isLight=function(){return mc(this.rgba)>=.5},t.prototype.toHex=function(){return e=pc(this.rgba),n=e.r,r=e.g,i=e.b,s=(o=e.a)<1?Ks($e(255*o)):"","#"+Ks(n)+Ks(r)+Ks(i)+s;var e,n,r,i,o,s},t.prototype.toRgb=function(){return pc(this.rgba)},t.prototype.toRgbString=function(){return e=pc(this.rgba),n=e.r,r=e.g,i=e.b,(o=e.a)<1?"rgba("+n+", "+r+", "+i+", "+o+")":"rgb("+n+", "+r+", "+i+")";var e,n,r,i,o},t.prototype.toHsl=function(){return _p(Do(this.rgba))},t.prototype.toHslString=function(){return e=_p(Do(this.rgba)),n=e.h,r=e.s,i=e.l,(o=e.a)<1?"hsla("+n+", "+r+"%, "+i+"%, "+o+")":"hsl("+n+", "+r+"%, "+i+"%)";var e,n,r,i,o},t.prototype.toHsv=function(){return e=wg(this.rgba),{h:$e(e.h),s:$e(e.s),v:$e(e.v),a:$e(e.a,3)};var e},t.prototype.invert=function(){return Mn({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},t.prototype.saturate=function(e){return e===void 0&&(e=.1),Mn(hc(this.rgba,e))},t.prototype.desaturate=function(e){return e===void 0&&(e=.1),Mn(hc(this.rgba,-e))},t.prototype.grayscale=function(){return Mn(hc(this.rgba,-1))},t.prototype.lighten=function(e){return e===void 0&&(e=.1),Mn(Tp(this.rgba,e))},t.prototype.darken=function(e){return e===void 0&&(e=.1),Mn(Tp(this.rgba,-e))},t.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},t.prototype.alpha=function(e){return typeof e=="number"?Mn({r:(n=this.rgba).r,g:n.g,b:n.b,a:e}):$e(this.rgba.a,3);var n},t.prototype.hue=function(e){var n=Do(this.rgba);return typeof e=="number"?Mn({h:e,s:n.s,l:n.l,a:n.a}):$e(n.h)},t.prototype.isEqual=function(e){return this.toHex()===Mn(e).toHex()},t}(),Mn=function(t){return t instanceof vu?t:new vu(t)},Mp=[],UO=function(t){t.forEach(function(e){Mp.indexOf(e)<0&&(e(vu,bu),Mp.push(e))})};function qO(t,e){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var i in n)r[n[i]]=i;var o={};t.prototype.toName=function(s){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,l,c=r[this.toHex()];if(c)return c;if(s!=null&&s.closest){var u=this.toRgb(),f=1/0,d="black";if(!o.length)for(var p in n)o[p]=new t(n[p]).toRgb();for(var h in n){var m=(a=u,l=o[h],Math.pow(a.r-l.r,2)+Math.pow(a.g-l.g,2)+Math.pow(a.b-l.b,2));m<f&&(f=m,d=h)}return d}},e.string.push([function(s){var a=s.toLowerCase(),l=a==="transparent"?"#0000":n[a];return l?new t(l).toRgb():null},"name"])}const Np=t=>tg(t)?t:"",GO=(t={})=>xe("w-full placeholder:italic",Ae.bgTr,iS.inputText,t.disabled&&Ae.txtLowEmphasis),KO="gs-input-field";O.forwardRef(function(e,n){const{className:r,value:i,label:o,size:s="m",type:a,placeholder:l,required:c,disabled:u,readOnly:f,description:d,name:p,style:h,tip:m,onInput:g,onChange:y,onBlur:w}=e,[x,C]=O.useState(Np(i)),v=GO(e),E=O.useRef(null);O.useImperativeHandle(n,()=>E.current,[]),O.useEffect(()=>{C(Np(i))},[i]);const A=(I,z)=>{y==null||y(I,z)},B=I=>{const{key:z}=I;switch(z){case"Escape":return C(i);case"Enter":return A(x)}},T=()=>{A(x),w==null||w()},P=I=>{const z=I.target.value;C(z),g==null||g(z)};return R.jsxs("div",{className:xe(KO,r),style:h,ref:E,children:[!!o&&R.jsx(La,{size:s,children:o}),!!d&&R.jsx(La,{size:s,tip:m,as:"span",className:xe(Ae.txtLowEmphasis),capitalize:!1,children:d}),R.jsx(Le,{className:xe(Ae.bg,$t.b,$t.rnd,Ae.br,s==="m"&&af.xy,s==="s"&&"gjs-px-3 gjs-py-1"),items:"center",space:"x2s",children:R.jsx(me,{grow:!0,children:R.jsx("input",{className:v,name:p,value:x,onChange:P,placeholder:l,required:c,onBlur:T,onKeyDown:B,readOnly:f,disabled:u,type:a})})})]})});UO([qO]);function Sg(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function ZO(t){return"nodeType"in t}function JO(t){var e,n;return t?Sg(t)?t:ZO(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function YO(t){return Sg(t)?!1:t instanceof JO(t).HTMLElement}var Rp;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(Rp||(Rp={}));const Cg=Object.freeze({x:0,y:0});var Pp;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Pp||(Pp={}));function Og(t,e,n=Cg){if(!t||!YO(t))return n;const r={x:n.x+t.offsetLeft,y:n.y+t.offsetTop};return t.offsetParent===e?r:Og(t.offsetParent,e,r)}function XO(t){const{offsetWidth:e,offsetHeight:n}=t,{x:r,y:i}=Og(t,null);return{width:e,height:n,offsetTop:i,offsetLeft:r}}var Vp;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(Vp||(Vp={}));var Dp;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(Dp||(Dp={}));var yu;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(yu||(yu={}));var wu;(function(t){t.Optimized="optimized"})(wu||(wu={}));yu.WhileDragging,wu.Optimized;var Lp;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(Lp||(Lp={}));var Jt;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter"})(Jt||(Jt={}));Jt.Space,Jt.Enter,Jt.Esc,Jt.Space,Jt.Enter;var jp;(function(t){t[t.RightClick=2]="RightClick"})(jp||(jp={}));({...Cg});Jt.Down,Jt.Right,Jt.Up,Jt.Left;const QO=/^-?[0-9]+(\.[0-9]+)?[a-zA-Z%]{0,}$/,eE=/,(?![^(]*\))/,gc=/\s(?![^(]*\))/,tE=/^(closest-side|closest-corner|farthest-side|farthest-corner)/i,bc=/^circle|ellipse/i,nE=t=>{var u;const e=[],{name:n,value:r}=wf(t),[i,...o]=r.split(eE).map(f=>f.trim()).filter(Boolean),s=o.length>1,a=s?i:"",l={type:"none"},c=s?o:[i,...o];if(QO.test(a))l.type="angle",l.value=a;else if(/^to\s/.test(a))l.type="side-or-corner",l.value=a;else if(tE.test(a))l.type="size",l.value=a;else if(bc.test(a)||/^at\s/.test(a)||/\sat\s/.test(a)){l.type="at",l.value=a;const f=((u=a.match(bc))==null?void 0:u[0])||"circle";l.shape=f;const d={x:"0%",y:"0%"},p={x:"0%",y:"0%"},[h,m]=a.replace(bc,"").trim().split("at").map(g=>g.trim());if(h){const[g,y]=h.split(gc);d.x=g,d.y=y||g}if(m){const[g,y]=m.split(gc);p.x=g,p.y=y||g}l.size=d,l.position=p}return c.forEach(f=>{const[d,p]=f.split(gc);e.push({color:d,hint:p?parseFloat(p):null})}),e.forEach((f,d)=>{f.hint===null&&(f.hint=d/(e.length-1)*100)}),{name:n,orientation:l,colorStops:e}};var lr=(t=>(t.Image="image",t.Gradient="gradient",t.Color="color",t))(lr||{});const ha="background-image",cr="__background-type",Lo=ha,Zs=["%"],Js=["s","ms"],xo=["deg","rad","grad"],dn=["px","%","em","rem","vw","vh"],Hp={type:"select",options:["visible","hidden","scroll","auto"].map(t=>({id:t})),default:"visible"},rE=t=>`linear-gradient(${t} 1%, ${t} 100%)`,Ia=t=>({id:t,label:t.split("-").map($c).join(" ")}),Eg=t=>({property:e,to:n})=>{if(n.value){const r=e.getOption(),i=e.getParent().getProperty(t),o=i.getUnit(),s={units:r.units||[],min:r.min,max:r.max,unit:""};(!o||(s==null?void 0:s.units.indexOf(o))<0)&&(s.unit=(s==null?void 0:s.units[0])||""),i.up(s)}},iE=t=>{const e=`${t}-name`,n=`${t}-value`;return(r,{separatorLayers:i})=>{const o=r[t]||"";return o?o.split(i).map(s=>{const{name:a,value:l}=wf(s);return{[e]:a,[n]:l}}):[]}},Ip=t=>{const e={[Lo]:t};if(t.indexOf("url(")>-1)e[cr]=lr.Image;else if(t.indexOf("gradient(")>-1){const n=nE(t),r=n.colorStops,i=n.name.indexOf("linear")>=0;r.length===2&&i&&r[0].color===r[1].color?e[cr]=lr.Color:e[cr]=lr.Gradient}else e[cr]=lr.Color,e[Lo]=rE(t);return e},Bp=(t="filter")=>{const e=`${t}-name`,n=`${t}-value`;return{property:t,type:"stack",layerSeparator:" ",fromStyle(r,{separatorLayers:i}){const o=r[t]||"";return o?o.split(i).map(s=>{const{name:a,value:l}=wf(s);return{[e]:a,[n]:l}}):[]},toStyle(r,{name:i}){return{[i]:`${r[e]}(${r[n]||"0"})`}},properties:[{property:e,type:"select",default:"blur",options:[{id:"blur",label:"Blur",min:0,units:["px","em","rem","vw","vh"]},{id:"brightness",label:"Brightness",min:0,units:["%"]},{id:"contrast",label:"Contrast",min:0,units:["%"]},{id:"grayscale",label:"Grayscale",min:0,max:100,units:["%"]},{id:"hue-rotate",label:"Hue rotate",min:0,max:360,units:["deg","rad","grad"]},{id:"invert",label:"Invert",min:0,max:100,units:["%"]},{id:"saturate",label:"Saturate",min:0,units:["%"]},{id:"sepia",label:"Sepia",min:0,max:100,units:["%"]}],onChange:Eg(n)},{property:n,type:"integer"}]}},Ys=(t,{x:e,y:n,mergable:r}={})=>{const i={property:`${t}-x`,type:"integer",units:dn,...e},o={property:`${t}-y`,type:"integer",units:dn,...n};return{property:t,type:"composite",properties:[i,o],...r&&{fromStyle(s,{name:a,separator:l,property:c}){const[u,f]=c.getProperties(),[d,p]=(s[a]||"").split(l);return{[u.getId()]:s[u.getName()]||d||"",[f.getId()]:s[f.getName()]||p||d||""}},toStyle(s,{name:a,property:l}){const[c,u]=l.getProperties(),f=s[c.getId()],d=s[u.getId()];return{[a]:f===d?f:`${f} ${d}`}}}}},oE=(t,e="")=>{const n=`${t}-name`,r=`${t}-value`;return(i,{name:o})=>({[o]:`${i[n]}(${i[r]||e})`})};["top","middle","bottom"].map(Ia),["none","solid","dotted","dashed","double","groove","ridge","inset","outset"].map(Ia);Ys("gap",{x:{property:"row-gap",min:0,default:"0"},y:{property:"column-gap",min:0,default:"0"},mergable:!0}),["baseline","top","middle","bottom"].map(Ia),new RegExp("(?<!\\(.*[^)]),(?![^(]*\\))"),lr.Image,lr.Gradient,lr.Color,["background-position-x","background-position-y"].map(t=>({type:"integer",property:t,units:dn,default:"0px"})),["background-size-x","background-size-y"].map(t=>({type:"integer",property:t,units:dn,default:"auto"})),["border-top-width","border-right-width","border-bottom-width","border-left-width"].map(t=>({type:"integer",property:t,default:"0",units:dn})),["border-top-style","border-right-style","border-bottom-style","border-left-style"].map(t=>({type:"select",property:t,default:"none",options:[{id:"none",label:"None"},{id:"solid",label:"Solid"},{id:"dotted",label:"Dotted"},{id:"dashed",label:"Dashed"},{id:"double",label:"Double"},{id:"groove",label:"Groove"},{id:"ridge",label:"Ridge"},{id:"inset",label:"Inset"},{id:"outset",label:"Outset"}]})),["border-top-color","border-right-color","border-bottom-color","border-left-color"].map(t=>({type:"color",property:t,default:"currentColor"})),Ys("overflow",{x:Hp,y:Hp,mergable:!0}),Bp(),Bp("backdrop-filter"),["width","height","min-width","min-height","max-width","max-height","padding","margin","color","font-size","line-height","letter-height","border","border-radius","background","opacity","box-shadow","text-shadow","filter","backdrop-filter","transform","all"].map(Ia),Js[0],Js[0],iE("transform"),oE("transform","0"),Eg("transform-value"),Ys("transform-origin",{x:{default:"50%"},y:{default:"50%"}}),Ys("perspective-origin",{x:{default:"50%"},y:{default:"50%"}});og.gjsStudio;const sE=O.createContext(void 0),gs=()=>{const t=O.useContext(sE);if(!t)throw new Error("useStore must be used inside of StoreProvider");return t},Xs=({icon:t,layout:e,tooltip:n,className:r,forceRemove:i,removeLayouts:o})=>({type:"button",icon:t,tooltip:n,className:r,size:"s",editorEvents:{[`${v1.layoutToggleId}${e.id}`]:({fromEvent:s,setState:a})=>{a({active:s.isOpen})}},onClick:({editor:s})=>{o==null||o.forEach(a=>s.runCommand(rn.layoutRemove,{id:a,force:i})),s.runCommand(rn.layoutToggle,{...e})}}),$p={type:"static",layoutId:"leftPanelsContainer"},zp={width:240,overflow:"hidden"};Xs({tooltip:"Blocks",removeLayouts:["pagesLayers","ps"],layout:{id:"blocks",layout:"panelBlocks",header:{label:"Blocks"},style:zp,placer:$p}}),Xs({tooltip:"Pages & Layers",removeLayouts:["blocks","ps"],layout:{id:"pagesLayers",layout:"panelPagesLayers",header:!1,style:zp,placer:$p}}),Xs({tooltip:"Page Settings",removeLayouts:["pagesLayers","blocks"],layout:{id:"ps",layout:"panelPageSettings",header:{label:"Page Settings"},style:{marginLeft:40}}}),Xs({icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12,10.11C13.03,10.11 13.87,10.95 13.87,12C13.87,13 13.03,13.85 12,13.85C10.97,13.85 10.13,13 10.13,12C10.13,10.95 10.97,10.11 12,10.11M7.37,20C8,20.38 9.38,19.8 10.97,18.3C10.45,17.71 9.94,17.07 9.46,16.4C8.64,16.32 7.83,16.2 7.06,16.04C6.55,18.18 6.74,19.65 7.37,20M8.08,14.26L7.79,13.75C7.68,14.04 7.57,14.33 7.5,14.61C7.77,14.67 8.07,14.72 8.38,14.77C8.28,14.6 8.18,14.43 8.08,14.26M14.62,13.5L15.43,12L14.62,10.5C14.32,9.97 14,9.5 13.71,9.03C13.17,9 12.6,9 12,9C11.4,9 10.83,9 10.29,9.03C10,9.5 9.68,9.97 9.38,10.5L8.57,12L9.38,13.5C9.68,14.03 10,14.5 10.29,14.97C10.83,15 11.4,15 12,15C12.6,15 13.17,15 13.71,14.97C14,14.5 14.32,14.03 14.62,13.5M12,6.78C11.81,7 11.61,7.23 11.41,7.5C11.61,7.5 11.8,7.5 12,7.5C12.2,7.5 12.39,7.5 12.59,7.5C12.39,7.23 12.19,7 12,6.78M12,17.22C12.19,17 12.39,16.77 12.59,16.5C12.39,16.5 12.2,16.5 12,16.5C11.8,16.5 11.61,16.5 11.41,16.5C11.61,16.77 11.81,17 12,17.22M16.62,4C16,3.62 14.62,4.2 13.03,5.7C13.55,6.29 14.06,6.93 14.54,7.6C15.36,7.68 16.17,7.8 16.94,7.96C17.45,5.82 17.26,4.35 16.62,4M15.92,9.74L16.21,10.25C16.32,9.96 16.43,9.67 16.5,9.39C16.23,9.33 15.93,9.28 15.62,9.23C15.72,9.4 15.82,9.57 15.92,9.74M17.37,2.69C18.84,3.53 19,5.74 18.38,8.32C20.92,9.07 22.75,10.31 22.75,12C22.75,13.69 20.92,14.93 18.38,15.68C19,18.26 18.84,20.47 17.37,21.31C15.91,22.15 13.92,21.19 12,19.36C10.08,21.19 8.09,22.15 6.62,21.31C5.16,20.47 5,18.26 5.62,15.68C3.08,14.93 1.25,13.69 1.25,12C1.25,10.31 3.08,9.07 5.62,8.32C5,5.74 5.16,3.53 6.62,2.69C8.09,1.85 10.08,2.81 12,4.64C13.92,2.81 15.91,1.85 17.37,2.69M17.08,12C17.42,12.75 17.72,13.5 17.97,14.26C20.07,13.63 21.25,12.73 21.25,12C21.25,11.27 20.07,10.37 17.97,9.74C17.72,10.5 17.42,11.25 17.08,12M6.92,12C6.58,11.25 6.28,10.5 6.03,9.74C3.93,10.37 2.75,11.27 2.75,12C2.75,12.73 3.93,13.63 6.03,14.26C6.28,13.5 6.58,12.75 6.92,12M15.92,14.26C15.82,14.43 15.72,14.6 15.62,14.77C15.93,14.72 16.23,14.67 16.5,14.61C16.43,14.33 16.32,14.04 16.21,13.75L15.92,14.26M13.03,18.3C14.62,19.8 16,20.38 16.62,20C17.26,19.65 17.45,18.18 16.94,16.04C16.17,16.2 15.36,16.32 14.54,16.4C14.06,17.07 13.55,17.71 13.03,18.3M8.08,9.74C8.18,9.57 8.28,9.4 8.38,9.23C8.07,9.28 7.77,9.33 7.5,9.39C7.57,9.67 7.68,9.96 7.79,10.25L8.08,9.74M10.97,5.7C9.38,4.2 8,3.62 7.37,4C6.74,4.35 6.55,5.82 7.06,7.96C7.83,7.8 8.64,7.68 9.46,7.6C9.94,6.93 10.45,6.29 10.97,5.7Z" /></svg>',tooltip:"Custom Component",className:"gs-utl-mt-auto",layout:{id:"customLayout",layout:{type:"custom",component:()=>R.jsx("div",{children:"Custom Reat component"})},header:{label:"Custom"},style:{marginLeft:40}}});const xf=()=>gs().appEditorStore,aE=()=>{try{return xf()}catch{}};var Bn=(t=>(t.alertRhombus="alertRhombus",t.alignHorizontalCenter="alignHorizontalCenter",t.alignHorizontalLeft="alignHorizontalLeft",t.alignHorizontalRight="alignHorizontalRight",t.applicationBracketsOutline="applicationBracketsOutline",t.arrowDown="arrowDown",t.arrowRight="arrowRight",t.arrowULeftTop="arrowULeftTop",t.arrowURightTop="arrowURightTop",t.borderAllVariant="borderAllVariant",t.borderRadius="borderRadius",t.borderStyle="borderStyle",t.cellphoneLink="cellphoneLink",t.check="check",t.checkBold="checkBold",t.checkboxBlank="checkboxBlank",t.chevronUp="chevronUp",t.chevronDown="chevronDown",t.chevronLeft="chevronLeft",t.chevronRight="chevronRight",t.close="close",t.codeBraces="codeBraces",t.cog="cog",t.contentCopy="contentCopy",t.contentSave="contentSave",t.delete="delete",t.dotsVertical="dotsVertical",t.email="email",t.emailOutline="emailOutline",t.eye="eye",t.eyedropperVariant="eyedropperVariant",t.eyeOff="eyeOff",t.eyeOffOutline="eyeOffOutline",t.eyeOutline="eyeOutline",t.fire="fire",t.flare="flare",t.floppy="floppy",t.folder="folder",t.fullscreen="fullscreen",t.gradientVertical="gradientVertical",t.helpCircle="helpCircle",t.image="image",t.information="information",t.informationVariant="informationVariant",t.layers="layers",t.link="link",t.lock="lock",t.lockOpenVariant="lockOpenVariant",t.menuDown="menuDown",t.newspaperVariantOutline="newspaperVariantOutline",t.paletteSwatch="paletteSwatch",t.panVertical="panVertical",t.phone="phone",t.plus="plus",t.plusBox="plusBox",t.powerPlug="powerPlug",t.refresh="refresh",t.rhombusOutline="rhombusOutline",t.tag="tag",t.target="target",t.targetVariant="targetVariant",t.textBoxMultiple="textBoxMultiple",t.trayArrowDown="trayArrowDown",t.unfoldLessHorizontal="unfoldLessHorizontal",t.unfoldMoreHorizontal="unfoldMoreHorizontal",t.viewDayOutline="viewDayOutline",t.viewGridPlus="viewGridPlus",t.web="web",t.xml="xml",t))(Bn||{});const vc={alertRhombus:Gv,alignHorizontalCenter:Kv,alignHorizontalLeft:Zv,alignHorizontalRight:Jv,applicationBracketsOutline:Yv,arrowDown:Xv,arrowRight:Qv,arrowULeftTop:ey,arrowURightTop:ty,borderAllVariant:ny,borderRadius:ry,borderStyle:iy,cellphoneLink:oy,check:sy,checkBold:ay,checkboxBlank:ly,chevronUp:dy,chevronDown:cy,chevronLeft:uy,chevronRight:fy,close:py,codeBraces:hy,cog:my,contentCopy:gy,contentSave:by,delete:vy,dotsVertical:yy,email:wy,emailOutline:xy,eye:Sy,eyedropperVariant:_y,eyeOff:Cy,eyeOffOutline:Oy,eyeOutline:Ey,fire:ky,flare:Ay,floppy:Ty,folder:My,fullscreen:Ny,gradientVertical:Ry,helpCircle:Py,image:Vy,information:Dy,informationVariant:Ly,layers:jy,link:Hy,lock:By,lockOpenVariant:$y,menuDown:zy,newspaperVariantOutline:Fy,paletteSwatch:Wy,panVertical:Uy,phone:qy,plus:Gy,plusBox:Ky,powerPlug:Zy,refresh:Jy,rhombusOutline:Yy,tag:Xy,target:Qy,targetVariant:e2,textBoxMultiple:t2,trayArrowDown:n2,unfoldLessHorizontal:r2,unfoldMoreHorizontal:i2,viewDayOutline:o2,viewGridPlus:s2,web:a2,xml:l2},lE="gs-cmp-icon",ii=fs(function({className:e,icon:n,size:r,rotate:i,horizontal:o,vertical:s}){var f;const a=(f=aE())==null?void 0:f.sdkCustomIcons,l=(a==null?void 0:a[n])||(vc==null?void 0:vc[n])||n,c=[o&&"scaleX(-1)",s&&"scaleY(-1)",i&&`rotate(${i}deg)`].filter(d=>!!d).join(" ");if(!l)return null;const u=_i(lE,e);return l.startsWith("<svg")||l.startsWith("<?xml")?R.jsx(XC,{className:u,style:{transform:c||void 0},svg:l,iconSize:r}):R.jsx(b2,{className:u,path:l,size:r,rotate:i,horizontal:o,vertical:s})});var _g=(t=>(t.dark="dark",t.light="light",t.auto="auto",t))(_g||{});const Sf=new WeakMap,cE=(t,e)=>{Sf.set(t,e)},uE=t=>{Sf.delete(t)},yc=t=>Sf.get(t),Qs=t=>{const e=t.target,n=e.closest(".tox"),r=e.matches(".ephox-snooker-resizer-bar");(n||r)&&t.stopPropagation()},Fp=t=>{t.stopPropagation(),t.preventDefault()},fE=(t,e)=>{const n=t.getDoc(),r=t.getWin();if(e!=null&&e.event){const{event:i}=e,{clientX:o,clientY:s}=i;let a;if(n.caretRangeFromPoint)a=n.caretRangeFromPoint(o,s);else if(n.caretPositionFromPoint){const l=n.caretPositionFromPoint(o,s);a=n.createRange(),a==null||a.setStart(l.offsetNode,l.offset)}if(a){const l=r.getSelection();l==null||l.removeAllRanges(),l==null||l.addRange(a),t.selection.setRng(a)}}else t.execCommand("SelectAll")},dE=t=>{var c,u;const{el:e,editor:n,componentView:r}=t,i=n.runCommand(rn.getStateTheme),o=r.model,s={target:e,inline:!0,skin:(i==null?void 0:i.theme)===_g.dark?"oxide-dark":"oxide",menubar:!1,image_advtab:!0,paste_data_images:!0,statusbar:!1,branding:!1,forced_root_block:"div",plugins:"advlist autolink lists link image media table",toolbar_mode:"sliding",toolbar:"bold italic underline strikethrough forecolor backcolor alignleft aligncenter alignright alignjustify link image | fontfamily fontsize bullist numlist outdent indent table"},a=((u=(c=t.pluginOpts)==null?void 0:c.loadConfig)==null?void 0:u.call(c,{config:s,editor:n,componentView:r,component:o}))||{};return{...s,...a}},Wp=(t,e=document)=>new Promise((n,r)=>{const i=Array.isArray(t)?[...t]:[t],{head:o}=e,s=a=>{if(a.length){const l=e.createElement("script");l.src=a.shift(),l.onload=s.bind(null,a),l.onerror=r,o.appendChild(l)}else n()};s(i)}),pE="rteTinyMce",hE=function(t,e={}){const n={cdnScript:"https://cdn.jsdelivr.net/npm/tinymce@6.8.5/tinymce.min.js",...e},{cdnScript:r}=n,i=t.Canvas.events,o=async(l,c)=>{const u=l.ownerDocument,f=u.defaultView,d=c==null?void 0:c.view;if(!f||!d){console.warn("Missing required data",{win:f,componentView:d});return}const p=dE({el:l,editor:t,componentView:d,pluginOpts:n}),m=(await f.tinymce.init(p))[0];if(!m)return;const y=(await window.tinymce.init({...p,target:document.createElement("div")}))[0];return m.ui.show(),u.body.addEventListener("mousedown",Qs),document.body.addEventListener("mousedown",Qs),m.on("Change",()=>zv(l)),m.on("blur",()=>m.ui.show()),m.on("OpenWindow",function(){var C;const w=(C=u.querySelector(".tox-dialog"))==null?void 0:C.closest(".tox");w&&(w==null?void 0:w.ownerDocument)!==document&&(document.body.appendChild(w),m.once("CloseWindow",()=>{w&&w.ownerDocument===document&&u.body.appendChild(w)}))}),l.addEventListener("dragstart",Fp,{capture:!0}),t.runCommand(rn.setStateContextMenu,{enabled:!1}),fE(m,c),{rteEditor:m,rteEditorShallow:y}},s=(l,c)=>{l.ownerDocument.body.removeEventListener("mousedown",Qs),document.body.removeEventListener("mousedown",Qs),l.removeEventListener("dragstart",Fp,{capture:!0}),t.runCommand(rn.setStateContextMenu,{enabled:!0}),c.rteEditor.destroy(),c.rteEditorShallow.destroy()};t.on(i.frameLoad,async({window:l})=>{Wp(r,l.document)}),t.onReady(()=>{Wp(r,document)}),t.setCustomRte({parseContent:!0,async enable(l,c,u){const f=yc(l);if(f)return f.rteEditor;const d=await o(l,u);return d&&cE(l,d),d==null?void 0:d.rteEditor},disable(l){const c=yc(l);c&&(uE(l),s(l,c))},getContent(l){var u,f;const c=yc(l);return c?(f=(u=c.rteEditor).getContent)==null?void 0:f.call(u):l.innerHTML}});const a=Fv(t,n.enableOnClick);wr({editor:t,licenseKey:n.licenseKey,plan:St.startup,pluginName:pE,cleanup:()=>{t.RichTextEditor.customRte=void 0,a()}})},mE=yr(hE);function Ue(t){this.content=t}Ue.prototype={constructor:Ue,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),o=r.content.slice();return i==-1?o.push(n||t,e):(o[i+1]=e,n&&(o[i]=n)),new Ue(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Ue(n)},addToStart:function(t,e){return new Ue([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Ue(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),o=r.find(t);return i.splice(o==-1?i.length:o,0,e,n),new Ue(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Ue.from(t),t.size?new Ue(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Ue.from(t),t.size?new Ue(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Ue.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};Ue.from=function(t){if(t instanceof Ue)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Ue(e)};function kg(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=kg(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function Ag(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),a=e.child(--o),l=s.nodeSize;if(s==a){n-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;c<u&&s.text[s.text.length-c-1]==a.text[a.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let c=Ag(s.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class D{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,o){for(let s=0,a=0;a<n;s++){let l=this.content[s],c=a+l.nodeSize;if(c>e&&r(l,i+a,o||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,i+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new D(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let o=0,s=0;s<n;o++){let a=this.content[o],l=s+a.nodeSize;l>e&&((s<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=l}return new D(r,i)}cutByIndex(e,n){return e==n?D.empty:e==0&&n==this.content.length?this:new D(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new D(i,o)}addToStart(e){return new D([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new D(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))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 n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return kg(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Ag(this,e,n,r)}findIndex(e,n=-1){if(e==0)return ea(0,e);if(e==this.size)return ea(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?ea(r+1,s):ea(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return D.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new D(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return D.empty;let n,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(n||(n=e.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new D(n||e,r)}static from(e){if(!e)return D.empty;if(e instanceof D)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new D([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}D.empty=new D([],0);const wc={index:0,offset:0};function ea(t,e){return wc.index=t,wc.offset=e,wc}function Ba(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Ba(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Ba(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}class _e{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Ba(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return _e.none;if(e instanceof _e)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}}_e.none=[];class $a extends Error{}class F{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=Mg(this.content,e+this.openStart,n);return r&&new F(r,this.openStart,this.openEnd)}removeBetween(e,n){return new F(Tg(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return F.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new F(D.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new F(e,r,i)}}F.empty=new F(D.empty,0,0);function Tg(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(i==e||o.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(Tg(o.content,e-i-1,n-i-1)))}function Mg(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let a=Mg(s.content,e-o-1,n);return a&&t.replaceChild(i,s.copy(a))}function gE(t,e,n){if(n.openStart>t.depth)throw new $a("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new $a("Inconsistent open depths");return Ng(t,e,n,0)}function Ng(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let s=Ng(t,e,n,r+1);return o.copy(o.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,a=s.content;return qr(s,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=bE(n,t);return qr(o,Pg(t,s,a,e,r))}else return qr(o,za(t,e,r))}function Rg(t,e){if(!e.type.compatibleContent(t.type))throw new $a("Cannot join "+e.type.name+" onto "+t.type.name)}function xu(t,e,n){let r=t.node(n);return Rg(r,e.node(n)),r}function Ur(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function jo(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(Ur(t.nodeAfter,r),o++));for(let a=o;a<s;a++)Ur(i.child(a),r);e&&e.depth==n&&e.textOffset&&Ur(e.nodeBefore,r)}function qr(t,e){return t.type.checkContent(e),t.copy(e)}function Pg(t,e,n,r,i){let o=t.depth>i&&xu(t,e,i+1),s=r.depth>i&&xu(n,r,i+1),a=[];return jo(null,t,i,a),o&&s&&e.index(i)==n.index(i)?(Rg(o,s),Ur(qr(o,Pg(t,e,n,r,i+1)),a)):(o&&Ur(qr(o,za(t,e,i+1)),a),jo(e,n,i,a),s&&Ur(qr(s,za(n,r,i+1)),a)),jo(r,null,i,a),new D(a)}function za(t,e,n){let r=[];if(jo(null,t,n,r),t.depth>n){let i=xu(t,e,n+1);Ur(qr(i,za(t,e,n+1)),r)}return jo(e,null,n,r),new D(r)}function bE(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(D.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Yo{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.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,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return _e.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let a=r;r=i,i=a}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Fa(this,e,r);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 n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(o),c=o-l;if(r.push(s,a,i+l),!c||(s=s.child(a),s.isText))break;o=c-1,i+=l+1}return new Yo(n,r,o)}static resolveCached(e,n){let r=Up.get(e);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==n)return s}else Up.set(e,r=new vE);let i=r.elts[r.i]=Yo.resolve(e,n);return r.i=(r.i+1)%yE,i}}class vE{constructor(){this.elts=[],this.i=0}}const yE=12,Up=new WeakMap;class Fa{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}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 wE=Object.create(null);let Gr=class Su{constructor(e,n,r,i=_e.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||D.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,n,r,i=0){this.content.nodesBetween(e,n,r,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,n,r,i){return this.content.textBetween(e,n,r,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,n,r){return this.type==e&&Ba(this.attrs,n||e.defaultAttrs||wE)&&_e.sameSet(this.marks,r||_e.none)}copy(e=null){return e==this.content?this:new Su(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Su(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return F.empty;let i=this.resolve(e),o=this.resolve(n),s=r?0:i.sharedDepth(n),a=i.start(s),c=i.node(s).content.cut(i.pos-a,o.pos-a);return new F(c,i.depth-s,o.depth-s)}replace(e,n,r){return gE(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return Yo.resolveCached(this,e)}resolveNoCache(e){return Yo.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,o=>(r.isInSet(o.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()+")"),Vg(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=D.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,n);return s?s.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=_e.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!_e.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n 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(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=D.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};Gr.prototype.text=void 0;class Wa extends Gr{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Vg(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Wa(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Wa(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Vg(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class oi{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new xE(e,n);if(r.next==null)return oi.empty;let i=Dg(r);r.next&&r.err("Unexpected trailing text");let o=AE(kE(i));return TE(o,r),o}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(e.child(o).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:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function o(s,a){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return D.from(a.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:u,next:f}=s.next[c];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let d=o(f,a.concat(u));if(d)return d}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let a=i;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:a,next:l}=o.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),n[a.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 n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return o}).join(`
|
|
341
|
-
`)}}oi.empty=new oi(!0);class xE{constructor(e,n){this.string=e,this.nodeTypes=n,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 Dg(t){let e=[];do e.push(SE(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function SE(t){let e=[];do e.push(CE(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function CE(t){let e=_E(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=OE(t,e);else break;return e}function qp(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function OE(t,e){let n=qp(t),r=n;return t.eat(",")&&(t.next!="}"?r=qp(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function EE(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.isInGroup(e)&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function _E(t){if(t.eat("(")){let e=Dg(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=EE(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function kE(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,l){let c={term:l,to:a};return e[s].push(c),c}function i(s,a){s.forEach(l=>l.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(o(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=o(s.exprs[l],a);if(l==s.exprs.length-1)return c;i(c,a=n())}else if(s.type=="star"){let l=n();return r(a,l),i(o(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return i(o(s.expr,a),l),i(o(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(o(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c<s.min;c++){let u=n();i(o(s.expr,l),u),l=u}if(s.max==-1)i(o(s.expr,l),l);else for(let c=s.min;c<s.max;c++){let u=n();r(l,u),i(o(s.expr,l),u),l=u}return[r(l)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function Lg(t,e){return e-t}function Gp(t,e){let n=[];return r(e),n.sort(Lg);function r(i){let o=t[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let s=0;s<o.length;s++){let{term:a,to:l}=o[s];!a&&n.indexOf(l)==-1&&r(l)}}}function AE(t){let e=Object.create(null);return n(Gp(t,0));function n(r){let i=[];r.forEach(s=>{t[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u<i.length;u++)i[u][0]==a&&(c=i[u][1]);Gp(t,l).forEach(u=>{c||i.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let o=e[r.join(",")]=new oi(r.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let a=i[s][1].sort(Lg);o.next.push({type:i[s][0],next:e[a.join(",")]||n(a)})}return o}}function TE(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],o=!i.validEnd,s=[];for(let a=0;a<i.next.length;a++){let{type:l,next:c}=i.next[a];s.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c)}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function jg(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function Hg(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let o=t[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function Ig(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let o=t[i];o.validate&&o.validate(e[i])}}function Bg(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new NE(t,r,e[r]);return n}let Kp=class $g{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Bg(e,r.attrs),this.defaultAttrs=jg(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==oi.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:Hg(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Gr(this,this.computeAttrs(e),D.from(n),_e.setFrom(r))}createChecked(e=null,n,r){return n=D.from(n),this.checkContent(n),new Gr(this,this.computeAttrs(e),n,_e.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=D.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(D.empty,!0);return o?new Gr(this,e,n.append(o),_e.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).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){Ig(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 n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:_e.none:e}static compile(e,n){let r=Object.create(null);e.forEach((o,s)=>r[o]=new $g(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function ME(t,e,n){let r=n.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${o}`)}}class NE{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?ME(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class xl{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=Bg(e,i.attrs),this.excluded=null;let o=jg(this.attrs);this.instance=o?new _e(this,o):null}create(e=null){return!e&&this.instance?this.instance:new _e(this,Hg(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new xl(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){Ig(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class RE{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=Ue.from(e.nodes),n.marks=Ue.from(e.marks||{}),this.nodes=Kp.compile(this.spec.nodes,this),this.marks=xl.compile(this.spec.marks,this);let r=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 o=this.nodes[i],s=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=oi.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=a=="_"?null:a?Zp(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:Zp(this,s.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,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Kp){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(n,r,i)}text(e,n){let r=this.nodes.text;return new Wa(r,r.defaultAttrs,e,_e.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return Gr.fromJSON(this,e)}markFromJSON(e){return _e.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function Zp(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t.marks[i],s=o;if(o)n.push(o);else for(let a in t.marks){let l=t.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function PE(t){return t.tag!=null}function VE(t){return t.style!=null}let Cf=class Cu{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(PE(i))this.tags.push(i);else if(VE(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new Yp(this,n,!1);return r.addAll(e,_e.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Yp(this,n,!0);return r.addAll(e,_e.none,n.from,n.to),F.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(jE(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(e,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<n.length;s++){let a=n[s];if((a.priority==null?50:a.priority)<o)break}n.splice(s,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Xp(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Xp(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Cu(e,Cu.schemaRules(e)))}};const zg={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},DE={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Fg={ol:!0,ul:!0},Ua=1,qa=2,Ho=4;function Jp(t,e,n){return e!=null?(e?Ua:0)|(e==="full"?qa:0):t&&t.whitespace=="pre"?Ua|qa:n&~Ho}class ta{constructor(e,n,r,i,o,s){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=_e.none,this.match=o||(s&Ho?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(D.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Ua)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=D.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(D.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!zg.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Yp{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,s=Jp(null,n.preserveWhitespace,0)|(r?Ho:0);i?o=new ta(i.type,i.attrs,_e.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new ta(null,null,_e.none,!0,null,s):o=new ta(e.schema.topNodeType,null,_e.none,!0,null,s),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top;if(i.options&qa||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i.options&Ua)i.options&qa?r=r.replace(/\r\n?/g,`
|
|
342
|
-
|
|
343
|
-
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],s=r.getPropertyValue(o);if(s)for(let a=void 0;;){let l=this.parser.matchStyle(o,s,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(c=>!l.clearMark(c)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,i){let o,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r)||this.leafFallback(e,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(o=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}o&&this.sync(a)&&this.open--}addAll(e,n,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,a=i==null?null:e.childNodes[i];s!=a;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,n);this.findAtPoint(e,o)}findPlace(e,n){let r,i;for(let o=this.open;o>=0;o--){let s=this.nodes[o],a=s.findWrapping(e);if(a&&(!r||r.length>a.length)&&(r=a,i=s,!a.length)||s.solid)break}if(!r)return null;this.sync(i);for(let o=0;o<r.length;o++)n=this.enterInner(r[o],null,n,!1);return n}insertNode(e,n){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let r=this.findPlace(e,n);if(r){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=_e.none;for(let s of r.concat(e.marks))(i.type?i.type.allowsMarkType(s.type):Qp(s.type,e.type))&&(o=s.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,n,r,i){let o=this.findPlace(e.create(n),r);return o&&(o=this.enterInner(e,n,r,!0,i)),o}enterInner(e,n,r,i=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let a=Jp(e,o,s.options);s.options&Ho&&s.content.length==0&&(a|=Ho);let l=_e.none;return r=r.filter(c=>(s.type?s.type.allowsMarkType(c.type):Qp(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new ta(e,n,l,i,null,a)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].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 n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&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)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function LE(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Fg.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function jE(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Xp(t){let e={};for(let n in t)e[n]=t[n];return e}function Qp(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=a=>{o.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:u}=a.edge(l);if(c==e||o.indexOf(u)<0&&s(u))return!0}};if(s(i.contentMatch))return!0}}class di{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=xc(n).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let a=0,l=0;for(;a<o.length&&l<s.marks.length;){let c=s.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(o[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<o.length;)i=o.pop()[1];for(;l<s.marks.length;){let c=s.marks[l++],u=this.serializeMark(c,s.isInline,n);u&&(o.push([c,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=ma(xc(n),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,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&ma(xc(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return ma(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new di(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=eh(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return eh(e.marks)}}function eh(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function xc(t){return t.document||window.document}const th=new WeakMap;function HE(t){let e=th.get(t);return e===void 0&&th.set(t,e=IE(t)),e}function IE(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function ma(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=HE(r))&&o.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 s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let a,l=n?t.createElementNS(n,i):t.createElement(i),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let f in c)if(c[f]!=null){let d=f.indexOf(" ");d>0?l.setAttributeNS(f.slice(0,d),f.slice(d+1),c[f]):l.setAttribute(f,c[f])}}for(let f=u;f<e.length;f++){let d=e[f];if(d===0){if(f<e.length-1||f>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:p,contentDOM:h}=ma(t,d,n,r);if(l.appendChild(p),h){if(a)throw new RangeError("Multiple content holes");a=h}}}return{dom:l,contentDOM:a}}const Wg=65535,Ug=Math.pow(2,16);function BE(t,e){return t+e*Ug}function nh(t){return t&Wg}function $E(t){return(t-(t&Wg))/Ug}const qg=1,Gg=2,ga=4,Kg=8;class Ou{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Kg)>0}get deletedBefore(){return(this.delInfo&(qg|ga))>0}get deletedAfter(){return(this.delInfo&(Gg|ga))>0}get deletedAcross(){return(this.delInfo&ga)>0}}class wt{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&wt.empty)return wt.empty}recover(e){let n=0,r=nh(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+$E(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let c=this.ranges[a+o],u=this.ranges[a+s],f=l+c;if(e<=f){let d=c?e==l?-1:e==f?1:n:n,p=l+i+(d<0?0:u);if(r)return p;let h=e==(n<0?l:f)?null:BE(a/3,e-l),m=e==l?Gg:e==f?qg:ga;return(n<0?e!=l:e!=f)&&(m|=Kg),new Ou(p,m,h)}i+=u-c}return r?e+i:new Ou(e+i,0,null)}touches(e,n){let r=0,i=nh(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let c=this.ranges[a+o],u=l+c;if(e<=u&&a==i*3)return!0;r+=this.ranges[a+s]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),l=s+(this.inverted?0:o),c=this.ranges[i+n],u=this.ranges[i+r];e(a,a+c,l,l+u),o+=u-c}}invert(){return new wt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?wt.empty:new wt(e<0?[0,-e,0]:[0,0,e])}}wt.empty=new wt([]);class Hi{constructor(e=[],n,r=0,i=e.length){this.maps=e,this.mirror=n,this.from=r,this.to=i}slice(e=0,n=this.maps.length){return new Hi(this.maps,this.mirror,e,n)}copy(){return new Hi(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,n){this.to=this.maps.push(e),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(e){for(let n=0,r=this.maps.length;n<e.maps.length;n++){let i=e.getMirror(n);this.appendMap(e.maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this.maps.length+e.maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new Hi;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this.maps[o],a=s.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(o);if(l!=null&&l>o&&l<this.to){o=l,e=this.maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return r?e:new Ou(e,i,null)}}const Sc=Object.create(null);class rt{getMap(){return wt.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Sc[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Sc)throw new RangeError("Duplicate use of step JSON ID "+e);return Sc[e]=n,n.prototype.jsonID=e,n}}class Ie{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Ie(e,null)}static fail(e){return new Ie(null,e)}static fromReplace(e,n,r,i){try{return Ie.ok(e.replace(n,r,i))}catch(o){if(o instanceof $a)return Ie.fail(o.message);throw o}}}function Of(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(Of(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return D.fromArray(r)}class ur extends rt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new F(Of(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Ie.fromReplace(e,this.from,this.to,o)}invert(){return new bn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new ur(n.pos,r.pos,this.mark)}merge(e){return e instanceof ur&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ur(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new ur(n.from,n.to,e.markFromJSON(n.mark))}}rt.jsonID("addMark",ur);class bn extends rt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new F(Of(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Ie.fromReplace(e,this.from,this.to,r)}invert(){return new ur(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new bn(n.pos,r.pos,this.mark)}merge(e){return e instanceof bn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new bn(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new bn(n.from,n.to,e.markFromJSON(n.mark))}}rt.jsonID("removeMark",bn);class fr extends rt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ie.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Ie.fromReplace(e,this.pos,this.pos+1,new F(D.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new fr(this.pos,n.marks[i]);return new fr(this.pos,this.mark)}}return new Qi(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new fr(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new fr(n.pos,e.markFromJSON(n.mark))}}rt.jsonID("addNodeMark",fr);class Qi extends rt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ie.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Ie.fromReplace(e,this.pos,this.pos+1,new F(D.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new fr(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Qi(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Qi(n.pos,e.markFromJSON(n.mark))}}rt.jsonID("removeNodeMark",Qi);class tt extends rt{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&Eu(e,this.from,this.to)?Ie.fail("Structure replace would overwrite content"):Ie.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new wt([this.from,this.to-this.from,this.slice.size])}invert(e){return new tt(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new tt(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof tt)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?F.empty:new F(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new tt(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?F.empty:new F(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new tt(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new tt(n.from,n.to,F.fromJSON(e,n.slice),!!n.structure)}}rt.jsonID("replace",tt);class Ye extends rt{constructor(e,n,r,i,o,s,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(e){if(this.structure&&(Eu(e,this.from,this.gapFrom)||Eu(e,this.gapTo,this.to)))return Ie.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Ie.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Ie.fromReplace(e,this.from,this.to,r):Ie.fail("Content does not fit in gap")}getMap(){return new wt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Ye(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new Ye(n.pos,r.pos,i,o,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,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ye(n.from,n.to,n.gapFrom,n.gapTo,F.fromJSON(e,n.slice),n.insert,!!n.structure)}}rt.jsonID("replaceAround",Ye);function Eu(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function zE(t,e,n,r){let i=[],o=[],s,a;t.doc.nodesBetween(e,n,(l,c,u)=>{if(!l.isInline)return;let f=l.marks;if(!r.isInSet(f)&&u.type.allowsMarkType(r.type)){let d=Math.max(c,e),p=Math.min(c+l.nodeSize,n),h=r.addToSet(f);for(let m=0;m<f.length;m++)f[m].isInSet(h)||(s&&s.to==d&&s.mark.eq(f[m])?s.to=p:i.push(s=new bn(d,p,f[m])));a&&a.to==d?a.to=p:o.push(a=new ur(d,p,r))}}),i.forEach(l=>t.step(l)),o.forEach(l=>t.step(l))}function FE(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;o++;let l=null;if(r instanceof xl){let c=s.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,n);for(let u=0;u<l.length;u++){let f=l[u],d;for(let p=0;p<i.length;p++){let h=i[p];h.step==o-1&&f.eq(i[p].style)&&(d=h)}d?(d.to=c,d.step=o):i.push({style:f,from:Math.max(a,e),to:c,step:o})}}}),i.forEach(s=>t.step(new bn(s.from,s.to,s.style)))}function Ef(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l<o.childCount;l++){let c=o.child(l),u=a+c.nodeSize,f=r.matchType(c.type);if(!f)s.push(new tt(a,u,F.empty));else{r=f;for(let d=0;d<c.marks.length;d++)n.allowsMarkType(c.marks[d].type)||t.step(new bn(a,u,c.marks[d]));if(i&&c.isText&&n.whitespace!="pre"){let d,p=/\r?\n|\r/g,h;for(;d=p.exec(c.text);)h||(h=new F(D.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),s.push(new tt(a+d.index,a+d.index+d[0].length,h))}}a=u}if(!r.validEnd){let l=r.fillBefore(D.empty,!0);t.replace(a,a,new F(l,0,0))}for(let l=s.length-1;l>=0;l--)t.step(s[l])}function WE(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Sl(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(r<t.depth&&i.canReplace(o,s,n))return r;if(r==0||i.type.spec.isolating||!WE(i,o,s))break}return null}function UE(t,e,n){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),a=i.after(o+1),l=s,c=a,u=D.empty,f=0;for(let h=o,m=!1;h>n;h--)m||r.index(h)>0?(m=!0,u=D.from(r.node(h).copy(u)),f++):l--;let d=D.empty,p=0;for(let h=o,m=!1;h>n;h--)m||i.after(h+1)<i.end(h)?(m=!0,d=D.from(i.node(h).copy(d)),p++):c++;t.step(new Ye(l,c,s,a,new F(u.append(d),f,p),u.size-f,!0))}function Zg(t,e,n=null,r=t){let i=qE(t,e),o=i&&GE(r,e);return o?i.map(rh).concat({type:e,attrs:n}).concat(o.map(rh)):null}function rh(t){return{type:t,attrs:null}}function qE(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return n.canReplaceWith(r,i,s)?o:null}function GE(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let c=r;l&&c<i;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:s}function KE(t,e,n){let r=D.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=D.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new Ye(i,o,i,o,new F(r,0,0),n.length,!0))}function ZE(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{let l=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,l)&&JE(t.doc,t.mapping.slice(o).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",h=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!h?c=!1:!p&&h&&(c=!0)}c===!1&&Yg(t,s,a,o),Ef(t,t.mapping.slice(o).map(a,1),r,void 0,c===null);let u=t.mapping.slice(o),f=u.map(a,1),d=u.map(a+s.nodeSize,1);return t.step(new Ye(f,d,f+1,d-1,new F(D.from(r.create(l,null,s.marks)),0,0),1,!0)),c===!0&&Jg(t,s,a,o),!1}})}function Jg(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let l=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function Yg(t,e,n,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text(`
|
|
344
|
-
`))}})}function JE(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function YE(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Ye(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new F(D.from(s),0,0),1,!0))}function Ii(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,u=n-2;c>o;c--,u--){let f=i.node(c),d=i.index(c);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(d,f.childCount),h=r&&r[u+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let m=r&&r[u]||f;if(!f.canReplace(d+1,f.childCount)||!m.type.validContent(p))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function XE(t,e,n=1,r){let i=t.doc.resolve(e),o=D.empty,s=D.empty;for(let a=i.depth,l=i.depth-n,c=n-1;a>l;a--,c--){o=D.from(i.node(a).copy(o));let u=r&&r[c];s=D.from(u?u.type.create(u.attrs,s):i.node(a).copy(s))}t.step(new tt(e,e,new F(o.append(s),n,n),!0))}function Cl(t,e){let n=t.resolve(e),r=n.index();return e_(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function QE(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let i=0;i<e.childCount;i++){let o=e.child(i),s=o.type==r?t.type.schema.nodes.text:o.type;if(n=n.matchType(s),!n||!t.type.allowsMarks(o.marks))return!1}return n.validEnd}function e_(t,e){return!!(t&&e&&!t.isLeaf&&QE(t,e))}function t_(t,e,n){let r=null,{linebreakReplacement:i}=t.doc.type.schema,o=t.doc.resolve(e-n),s=o.node().type;if(i&&s.inlineContent){let u=s.whitespace=="pre",f=!!s.contentMatch.matchType(i);u&&!f?r=!1:!u&&f&&(r=!0)}let a=t.steps.length;if(r===!1){let u=t.doc.resolve(e+n);Yg(t,u.node(),u.before(),a)}s.inlineContent&&Ef(t,e+n-1,s,o.node().contentMatchAt(o.index()),r==null);let l=t.mapping.slice(a),c=l.map(e-n);if(t.step(new tt(c,l.map(e+n,-1),F.empty,!0)),r===!0){let u=t.doc.resolve(c);Jg(t,u.node(),u.before(),t.steps.length)}return t}function n_(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function r_(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let s=r.depth;s>=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),c=r.node(s),u=!1;if(o==1)u=c.canReplace(l,l,i);else{let f=c.contentMatchAt(l).findWrapping(i.firstChild.type);u=f&&c.canReplaceWith(l,l,f[0])}if(u)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function _f(t,e,n=e,r=F.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return Xg(i,o,r)?new tt(e,n,r):new i_(i,o,r).fit()}function Xg(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class i_{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=D.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=D.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let l=new F(o,s,a);return e>-1?new Ye(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new tt(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=Cc(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,f=null;if(n==1&&(s?c.matchType(s.type)||(f=c.fillBefore(D.from(s),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:f};if(n==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:u};if(o&&c.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Cc(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new F(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Cc(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new F(ko(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new F(ko(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let m=0;m<o.length;m++)this.openFrontierNode(o[m]);let s=this.unplaced,a=r?r.content:s.content,l=s.openStart-e,c=0,u=[],{match:f,type:d}=this.frontier[n];if(i){for(let m=0;m<i.childCount;m++)u.push(i.child(m));f=f.matchFragment(i)}let p=a.size+e-(s.content.size-s.openEnd);for(;c<a.childCount;){let m=a.child(c),g=f.matchType(m.type);if(!g)break;c++,(c>1||l==0||m.content.size)&&(f=g,u.push(Qg(m.mark(d.allowedMarks(m.marks)),c==1?l:0,c==a.childCount?p:-1)))}let h=c==a.childCount;h||(p=-1),this.placed=Ao(this.placed,n,D.from(u)),this.frontier[n].match=f,h&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=a;m<p;m++){let y=g.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),g=y.content}this.unplaced=h?e==0?F.empty:new F(ko(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new F(ko(s.content,e,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!Oc(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=Oc(e,n,i,r,o);if(s){for(let a=n-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],u=Oc(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Ao(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Ao(this.placed,this.depth,D.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(D.empty,!0);n.childCount&&(this.placed=Ao(this.placed,this.frontier.length,n))}}function ko(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(ko(t.firstChild.content,e-1,n)))}function Ao(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Ao(t.lastChild.content,e-1,n)))}function Cc(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function Qg(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,Qg(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(D.empty,!0)))),t.copy(r)}function Oc(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!o_(n,o.content,s)?a:null}function o_(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function s_(t){return t.spec.defining||t.spec.definingForContent}function a_(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if(Xg(i,o,r))return t.step(new tt(e,n,r));let s=t0(i,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let d=i.depth,p=i.pos-1;d>0;d--,p--){let h=i.node(d).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;s.indexOf(d)>-1?a=d:i.before(d)==p&&s.splice(1,0,-d)}let l=s.indexOf(a),c=[],u=r.openStart;for(let d=r.content,p=0;;p++){let h=d.firstChild;if(c.push(h),p==r.openStart)break;d=h.content}for(let d=u-1;d>=0;d--){let p=c[d],h=s_(p.type);if(h&&!p.sameMarkup(i.node(Math.abs(a)-1)))u=d;else if(h||!p.type.isTextblock)break}for(let d=r.openStart;d>=0;d--){let p=(d+u+1)%(r.openStart+1),h=c[p];if(h)for(let m=0;m<s.length;m++){let g=s[(m+l)%s.length],y=!0;g<0&&(y=!1,g=-g);let w=i.node(g-1),x=i.index(g-1);if(w.canReplaceWith(x,x,h.type,h.marks))return t.replace(i.before(g),y?o.after(g):n,new F(e0(r.content,0,r.openStart,p),p,r.openEnd))}}let f=t.steps.length;for(let d=s.length-1;d>=0&&(t.replace(e,n,r),!(t.steps.length>f));d--){let p=s[d];p<0||(e=i.before(p),n=o.after(p))}}function e0(t,e,n,r,i){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(e0(o.content,e+1,n,r,o)))}if(e>r){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(D.empty,!0))}return t}function l_(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=n_(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new F(D.from(r),0,0))}function c_(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=t0(r,i);for(let s=0;s<o.length;s++){let a=o[s],l=s==o.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),i.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return t.delete(r.before(s),n);t.delete(e,n)}function t0(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(o<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}class Bi extends rt{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ie.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Ie.fromReplace(e,this.pos,this.pos+1,new F(D.from(i),0,n.isLeaf?0:1))}getMap(){return wt.empty}invert(e){return new Bi(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Bi(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Bi(n.pos,n.attr,n.value)}}rt.jsonID("attr",Bi);class Xo extends rt{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Ie.ok(r)}getMap(){return wt.empty}invert(e){return new Xo(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Xo(n.attr,n.value)}}rt.jsonID("docAttr",Xo);let eo=class extends Error{};eo=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};eo.prototype=Object.create(Error.prototype);eo.prototype.constructor=eo;eo.prototype.name="TransformError";class n0{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Hi}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new eo(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=F.empty){let i=_f(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new F(D.from(r),0,0))}delete(e,n){return this.replace(e,n,F.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return a_(this,e,n,r),this}replaceRangeWith(e,n,r){return l_(this,e,n,r),this}deleteRange(e,n){return c_(this,e,n),this}lift(e,n){return UE(this,e,n),this}join(e,n=1){return t_(this,e,n),this}wrap(e,n){return KE(this,e,n),this}setBlockType(e,n=e,r,i=null){return ZE(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return YE(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new Bi(e,n,r)),this}setDocAttribute(e,n){return this.step(new Xo(e,n)),this}addNodeMark(e,n){return this.step(new fr(e,n)),this}removeNodeMark(e,n){if(!(n instanceof _e)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Qi(e,n)),this}split(e,n=1,r){return XE(this,e,n,r),this}addMark(e,n,r){return zE(this,e,n,r),this}removeMark(e,n,r){return FE(this,e,n,r),this}clearIncompatible(e,n,r){return Ef(this,e,n,r),this}}const Ec=Object.create(null);class ge{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new r0(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=F.empty){let r=n.content.lastChild,i=null;for(let a=0;a<n.openEnd;a++)i=r,r=r.lastChild;let o=e.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:c}=s[a],u=e.mapping.slice(o);e.replaceRange(u.map(l.pos),u.map(c.pos),a?F.empty:n),a==0&&sh(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:a}=i[o],l=e.mapping.slice(r),c=l.map(s.pos),u=l.map(a.pos);o?e.deleteRange(c,u):(e.replaceRangeWith(c,u,n),sh(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new be(e):Ci(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let s=n<0?Ci(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):Ci(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new _t(e.node(0))}static atStart(e){return Ci(e,e,0,0,1)||new _t(e)}static atEnd(e){return Ci(e,e,e.content.size,e.childCount,-1)||new _t(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Ec[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Ec)throw new RangeError("Duplicate use of selection JSON ID "+e);return Ec[e]=n,n.prototype.jsonID=e,n}getBookmark(){return be.between(this.$anchor,this.$head).getBookmark()}}ge.prototype.visible=!0;class r0{constructor(e,n){this.$from=e,this.$to=n}}let ih=!1;function oh(t){!ih&&!t.parent.inlineContent&&(ih=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class be extends ge{constructor(e,n=e){oh(e),oh(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return ge.near(r);let i=e.resolve(n.map(this.anchor));return new be(i.parent.inlineContent?i:r,r)}replace(e,n=F.empty){if(super.replace(e,n),n==F.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof be&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Ol(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new be(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=ge.findFrom(n,r,!0)||ge.findFrom(n,-r,!0);if(o)n=o.$head;else return ge.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(ge.findFrom(e,-r,!0)||ge.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new be(e,n)}}ge.jsonID("text",be);class Ol{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Ol(e.map(this.anchor),e.map(this.head))}resolve(e){return be.between(e.resolve(this.anchor),e.resolve(this.head))}}class de extends ge{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=e.resolve(i);return r?ge.near(o):new de(o)}content(){return new F(D.from(this.node),0,0)}eq(e){return e instanceof de&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new kf(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new de(e.resolve(n.anchor))}static create(e,n){return new de(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}de.prototype.visible=!1;ge.jsonID("node",de);class kf{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Ol(r,r):new kf(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&de.isSelectable(r)?new de(n):ge.near(n)}}class _t extends ge{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=F.empty){if(n==F.empty){e.delete(0,e.doc.content.size);let r=ge.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new _t(e)}map(e){return new _t(e)}eq(e){return e instanceof _t}getBookmark(){return u_}}ge.jsonID("all",_t);const u_={map(){return this},resolve(t){return new _t(t)}};function Ci(t,e,n,r,i,o=!1){if(e.inlineContent)return be.create(t,n);for(let s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let a=e.child(s);if(a.isAtom){if(!o&&de.isSelectable(a))return de.create(t,n-(i<0?a.nodeSize:0))}else{let l=Ci(t,a,n+i,i<0?a.childCount:0,i,o);if(l)return l}n+=a.nodeSize*i}return null}function sh(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof tt||i instanceof Ye))return;let o=t.mapping.maps[r],s;o.forEach((a,l,c,u)=>{s==null&&(s=u)}),t.setSelection(ge.near(t.doc.resolve(s),n))}const ah=1,na=2,lh=4;class f_ extends n0{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|ah)&~na,this.storedMarks=null,this}get selectionSet(){return(this.updated&ah)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=na,this}ensureMarks(e){return _e.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&na)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~na,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||_e.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.setSelection(ge.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=lh,this}get scrolledIntoView(){return(this.updated&lh)>0}}function ch(t,e){return!e||!t?t:t.bind(e)}class To{constructor(e,n,r){this.name=e,this.init=ch(n.init,r),this.apply=ch(n.apply,r)}}const d_=[new To("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new To("selection",{init(t,e){return t.selection||ge.atStart(e.doc)},apply(t){return t.selection}}),new To("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new To("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class _c{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=d_.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new To(r.key,r.spec.state,r))})}}class Ri{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=i?i[s].n:0,c=i?i[s].state:this,u=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,c,r);if(u&&r.filterTransaction(u,s)){if(u.setMeta("appendedTransaction",e),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<s?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),o=!0}i&&(i[s]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Ri(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];n[o.name]=o.apply(e,this[o.name],this,n)}return n}get tr(){return new f_(this)}static create(e){let n=new _c(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Ri(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}reconfigure(e){let n=new _c(this.schema,e.plugins),r=n.fields,i=new Ri(n);for(let o=0;o<r.length;o++){let s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new _c(e.schema,e.plugins),o=new Ri(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=Gr.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=ge.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){o[s.name]=c.fromJSON.call(l,e,n[a],o);return}}o[s.name]=s.init(e,o)}}),o}}function i0(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=i0(i,e,{})),n[r]=i}return n}class bs{constructor(e){this.spec=e,this.props={},e.props&&i0(e.props,this,this.props),this.key=e.key?e.key.key:o0("plugin")}getState(e){return e[this.key]}}const kc=Object.create(null);function o0(t){return t in kc?t+"$"+ ++kc[t]:(kc[t]=0,t+"$")}class vs{constructor(e="key"){this.key=o0(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const s0=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function p_(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const h_=(t,e,n)=>{let r=p_(t,n);if(!r)return!1;let i=a0(r);if(!i){let s=r.blockRange(),a=s&&Sl(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(p0(t,i,e,-1))return!0;if(r.parent.content.size==0&&(to(o,"end")||de.isSelectable(o)))for(let s=r.depth;;s--){let a=_f(t.doc,r.before(s),r.after(s),F.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(to(o,"end")?ge.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):de.create(l.doc,i.pos-o.nodeSize)),e(l.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1};function to(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const m_=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=a0(r)}let s=o&&o.nodeBefore;return!s||!de.isSelectable(s)?!1:(e&&e(t.tr.setSelection(de.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function a0(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function g_(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const b_=(t,e,n)=>{let r=g_(t,n);if(!r)return!1;let i=l0(r);if(!i)return!1;let o=i.nodeAfter;if(p0(t,i,e,1))return!0;if(r.parent.content.size==0&&(to(o,"start")||de.isSelectable(o))){let s=_f(t.doc,r.before(),r.after(),F.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=t.tr.step(s);a.setSelection(to(o,"start")?ge.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):de.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},v_=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;o=l0(r)}let s=o&&o.nodeAfter;return!s||!de.isSelectable(s)?!1:(e&&e(t.tr.setSelection(de.create(t.doc,o.pos)).scrollIntoView()),!0)};function l0(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const y_=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
|
|
345
|
-
`).scrollIntoView()),!0)};function Af(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const c0=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=Af(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(ge.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},w_=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof _t||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Af(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=t.tr.insert(s,o.createAndFill());a.setSelection(be.create(a.doc,s+1)),e(a.scrollIntoView())}return!0},u0=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(Ii(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Sl(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)};function f0(t){return(e,n)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof de&&e.selection.node.isBlock)return!r.parentOffset||!Ii(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let o=[],s,a,l=!1,c=!1;for(let p=r.depth;;p--)if(r.node(p).isBlock){l=r.end(p)==r.pos+(r.depth-p),c=r.start(p)==r.pos-(r.depth-p),a=Af(r.node(p-1).contentMatchAt(r.indexAfter(p-1)));let m=t&&t(i.parent,l,r);o.unshift(m||(l&&a?{type:a}:null)),s=p;break}else{if(p==1)return!1;o.unshift(null)}let u=e.tr;(e.selection instanceof be||e.selection instanceof _t)&&u.deleteSelection();let f=u.mapping.map(r.pos),d=Ii(u.doc,f,o.length,o);if(d||(o[0]=a?{type:a}:null,d=Ii(u.doc,f,o.length,o)),u.split(f,o.length,o),!l&&c&&r.node(s).type!=a){let p=u.mapping.map(r.before(s)),h=u.doc.resolve(p);a&&r.node(s-1).canReplaceWith(h.index(),h.index()+1,a)&&u.setNodeMarkup(u.mapping.map(r.before(s)),a)}return n&&n(u.scrollIntoView()),!0}}const x_=f0(),d0=(t,e)=>(e&&e(t.tr.setSelection(new _t(t.doc))),!0);function S_(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||Cl(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function p0(t,e,n,r){let i=e.nodeBefore,o=e.nodeAfter,s,a,l=i.type.spec.isolating||o.type.spec.isolating;if(!l&&S_(t,e,n))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(s=(a=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&a.matchType(s[0]||o.type).validEnd){if(n){let p=e.pos+o.nodeSize,h=D.empty;for(let y=s.length-1;y>=0;y--)h=D.from(s[y].create(null,h));h=D.from(i.copy(h));let m=t.tr.step(new Ye(e.pos-1,p,e.pos,p,new F(h,1,0),s.length,!0)),g=m.doc.resolve(p+2*s.length);g.nodeAfter&&g.nodeAfter.type==i.type&&Cl(m.doc,g.pos)&&m.join(g.pos),n(m.scrollIntoView())}return!0}let u=o.type.spec.isolating||r>0&&l?null:ge.findFrom(e,1),f=u&&u.$from.blockRange(u.$to),d=f&&Sl(f);if(d!=null&&d>=e.depth)return n&&n(t.tr.lift(f,d).scrollIntoView()),!0;if(c&&to(o,"start",!0)&&to(i,"end")){let p=i,h=[];for(;h.push(p),!p.isTextblock;)p=p.lastChild;let m=o,g=1;for(;!m.isTextblock;m=m.firstChild)g++;if(p.canReplace(p.childCount,p.childCount,m.content)){if(n){let y=D.empty;for(let x=h.length-1;x>=0;x--)y=D.from(h[x].copy(y));let w=t.tr.step(new Ye(e.pos-h.length,e.pos+o.nodeSize,e.pos+g,e.pos+o.nodeSize-g,new F(y,h.length,0),0,!0));n(w.scrollIntoView())}return!0}}return!1}function h0(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(be.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const C_=h0(-1),O_=h0(1);function E_(t,e=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:s},$to:{pos:a}}=n.selection.ranges[o];n.doc.nodesBetween(s,a,(l,c)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let u=n.doc.resolve(c),f=u.index();i=u.parent.canReplaceWith(f,f+1,t)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[s];o.setBlockType(a,l,t,e)}r(o.scrollIntoView())}return!0}}function __(t,e,n,r){for(let i=0;i<e.length;i++){let{$from:o,$to:s}=e[i],a=o.depth==0?t.inlineContent&&t.type.allowsMarkType(n):!1;if(t.nodesBetween(o.pos,s.pos,(l,c)=>{if(a||!r)return!1;a=l.inlineContent&&l.type.allowsMarkType(n)}),a)return!0}return!1}function Lr(t,e=null,n){let r=n!==!1;return function(i,o){let{empty:s,$cursor:a,ranges:l}=i.selection;if(s&&!a||!__(i.doc,l,t,r))return!1;if(o)if(a)t.isInSet(i.storedMarks||a.marks())?o(i.tr.removeStoredMark(t)):o(i.tr.addStoredMark(t.create(e)));else{let c,u=i.tr;c=!l.some(f=>i.doc.rangeHasMark(f.$from.pos,f.$to.pos,t));for(let f=0;f<l.length;f++){let{$from:d,$to:p}=l[f];if(!c)u.removeMark(d.pos,p.pos,t);else{let h=d.pos,m=p.pos,g=d.nodeAfter,y=p.nodeBefore,w=g&&g.isText?/^\s*/.exec(g.text)[0].length:0,x=y&&y.isText?/\s*$/.exec(y.text)[0].length:0;h+w<m&&(h+=w,m-=x),u.addMark(h,m,t.create(e))}}o(u.scrollIntoView())}return!0}}function Qo(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}let Ac=Qo(s0,h_,m_),uh=Qo(s0,b_,v_);const jn={Enter:Qo(y_,w_,u0,x_),"Mod-Enter":c0,Backspace:Ac,"Mod-Backspace":Ac,"Shift-Backspace":Ac,Delete:uh,"Mod-Delete":uh,"Mod-a":d0},m0={"Ctrl-h":jn.Backspace,"Alt-Backspace":jn["Mod-Backspace"],"Ctrl-d":jn.Delete,"Ctrl-Alt-Backspace":jn["Mod-Delete"],"Alt-Delete":jn["Mod-Delete"],"Alt-d":jn["Mod-Delete"],"Ctrl-a":C_,"Ctrl-e":O_};for(let t in jn)m0[t]=jn[t];const k_=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform?os.platform()=="darwin":!1,A_=k_?m0:jn;var Ga=200,ze=function(){};ze.prototype.append=function(e){return e.length?(e=ze.from(e),!this.length&&e||e.length<Ga&&this.leafAppend(e)||this.length<Ga&&e.leafPrepend(this)||this.appendInner(e)):this};ze.prototype.prepend=function(e){return e.length?ze.from(e).append(this):this};ze.prototype.appendInner=function(e){return new T_(this,e)};ze.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?ze.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};ze.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};ze.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};ze.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},n,r),i};ze.from=function(e){return e instanceof ze?e:e&&e.length?new g0(e):ze.empty};var g0=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,a){for(var l=o;l<s;l++)if(i(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,s,a){for(var l=o-1;l>=s;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Ga)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Ga)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(ze);ze.empty=new g0([]);var T_=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,s){var a=this.left.length;if(i<a&&this.left.forEachInner(r,i,Math.min(o,a),s)===!1||o>a&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,o)-a,s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(o,a)-a,s+a)===!1||o<a&&this.left.forEachInvertedInner(r,Math.min(i,a),o,s)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(ze);const M_=500;class Yt{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,a,l,c=[],u=[];return this.items.forEach((f,d)=>{if(!f.step){i||(i=this.remapping(r,d+1),o=i.maps.length),o--,u.push(f);return}if(i){u.push(new pn(f.map));let p=f.step.map(i.slice(o)),h;p&&s.maybeStep(p).doc&&(h=s.mapping.maps[s.mapping.maps.length-1],c.push(new pn(h,void 0,void 0,c.length+u.length))),o--,h&&i.appendMap(h,o)}else s.maybeStep(f.step);if(f.selection)return a=i?f.selection.map(i.slice(o)):f.selection,l=new Yt(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(e,n,r,i){let o=[],s=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let u=0;u<e.steps.length;u++){let f=e.steps[u].invert(e.docs[u]),d=new pn(e.mapping.maps[u],f,n),p;(p=l&&l.merge(d))&&(d=p,u?o.pop():a=a.slice(0,a.length-1)),o.push(d),n&&(s++,n=void 0),i||(l=d)}let c=s-r.depth;return c>R_&&(a=N_(a,c),s-=c),new Yt(a.append(o),s)}remapping(e,n){let r=new Hi;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new Yt(this.items.append(e.map(n=>new pn(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(d=>{d.selection&&a--},i);let l=n;this.items.forEach(d=>{let p=o.getMirror(--l);if(p==null)return;s=Math.min(s,p);let h=o.maps[p];if(d.step){let m=e.steps[p].invert(e.docs[p]),g=d.selection&&d.selection.map(o.slice(l+1,p));g&&a++,r.push(new pn(h,m,g))}else r.push(new pn(h))},i);let c=[];for(let d=n;d<s;d++)c.push(new pn(o.maps[d]));let u=this.items.slice(0,i).append(c).append(r),f=new Yt(u,a);return f.emptyItemCount()>M_&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=e)i.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let u=s.selection&&s.selection.map(n.slice(r));u&&o++;let f=new pn(c.invert(),l,u),d,p=i.length-1;(d=i.length&&i[p].merge(f))?i[p]=d:i.push(f)}}else s.map&&r--},this.items.length,0),new Yt(ze.from(i.reverse()),o)}}Yt.empty=new Yt(ze.empty,0);function N_(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class pn{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new pn(n.getMap().invert(),n,this.selection)}}}class tr{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const R_=20;function P_(t,e,n,r){let i=n.getMeta(Kr),o;if(i)return i.historyState;n.getMeta(L_)&&(t=new tr(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(Kr))return s.getMeta(Kr).redo?new tr(t.done.addTransform(n,void 0,r,ba(e)),t.undone,fh(n.mapping.maps),t.prevTime,t.prevComposition):new tr(t.done,t.undone.addTransform(n,void 0,r,ba(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!V_(n,t.prevRanges)),c=s?Tc(t.prevRanges,n.mapping):fh(n.mapping.maps);return new tr(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,ba(e)),Yt.empty,c,n.time,a??t.prevComposition)}else return(o=n.getMeta("rebased"))?new tr(t.done.rebased(n,o),t.undone.rebased(n,o),Tc(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new tr(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Tc(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function V_(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(n=!0)}),n}function fh(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,i,o,s)=>e.push(o,s));return e}function Tc(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),o=e.map(t[r+1],-1);i<=o&&n.push(i,o)}return n}function D_(t,e,n){let r=ba(e),i=Kr.get(e).spec.config,o=(n?t.undone:t.done).popEvent(e,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),l=new tr(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(Kr,{redo:n,historyState:l})}let Mc=!1,dh=null;function ba(t){let e=t.plugins;if(dh!=e){Mc=!1,dh=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Mc=!0;break}}return Mc}const Kr=new vs("history"),L_=new vs("closeHistory");function j_(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new bs({key:Kr,state:{init(){return new tr(Yt.empty,Yt.empty,null,0,-1)},apply(e,n,r){return P_(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?v0:r=="historyRedo"?_u:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function b0(t,e){return(n,r)=>{let i=Kr.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let o=D_(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}const v0=b0(!1,!0),_u=b0(!0,!0);var vr={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Ka={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},H_=typeof navigator<"u"&&/Mac/.test(navigator.platform),I_=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var qe=0;qe<10;qe++)vr[48+qe]=vr[96+qe]=String(qe);for(var qe=1;qe<=24;qe++)vr[qe+111]="F"+qe;for(var qe=65;qe<=90;qe++)vr[qe]=String.fromCharCode(qe+32),Ka[qe]=String.fromCharCode(qe);for(var Nc in vr)Ka.hasOwnProperty(Nc)||(Ka[Nc]=vr[Nc]);function B_(t){var e=H_&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||I_&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Ka:vr)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const $_=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function z_(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))$_?s=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),s&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function F_(t){let e=Object.create(null);for(let n in t)e[z_(n)]=t[n];return e}function Rc(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function Pc(t){return new bs({props:{handleKeyDown:y0(t)}})}function y0(t){let e=F_(t);return function(n,r){let i=B_(r),o,s=e[Rc(i,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=e[Rc(i,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=vr[r.keyCode])&&o!=i){let a=e[Rc(o,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}function ph(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&i.node(s.depth-1).type.compatibleContent(t)&&s.startIndex==0){if(i.index(s.depth-1)==0)return!1;let u=n.doc.resolve(s.start-2);l=new Fa(u,u,s.depth),s.endIndex<s.parent.childCount&&(s=new Fa(i,n.doc.resolve(o.end(s.depth)),s.depth)),a=!0}let c=Zg(l,t,e,s);return c?(r&&r(W_(n.tr,s,c,a,t).scrollIntoView()),!0):!1}}function W_(t,e,n,r,i){let o=D.empty;for(let u=n.length-1;u>=0;u--)o=D.from(n[u].type.create(n[u].attrs,o));t.step(new Ye(e.start-(r?2:0),e.end,e.start,e.end,new F(o,0,0),n.length,!0));let s=0;for(let u=0;u<n.length;u++)n[u].type==i&&(s=u+1);let a=n.length-s,l=e.start+n.length-(r?2:0),c=e.parent;for(let u=e.startIndex,f=e.endIndex,d=!0;u<f;u++,d=!1)!d&&Ii(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=c.child(u).nodeSize;return t}function U_(t,e){return function(n,r){let{$from:i,$to:o,node:s}=n.selection;if(s&&s.isBlock||i.depth<2||!i.sameParent(o))return!1;let a=i.node(-1);if(a.type!=t)return!1;if(i.parent.content.size==0&&i.node(-1).childCount==i.indexAfter(-1)){if(i.depth==3||i.node(-3).type!=t||i.index(-2)!=i.node(-2).childCount-1)return!1;if(r){let f=D.empty,d=i.index(-1)?1:i.index(-2)?2:3;for(let y=i.depth-d;y>=i.depth-3;y--)f=D.from(i.node(y).copy(f));let p=i.indexAfter(-1)<i.node(-2).childCount?1:i.indexAfter(-2)<i.node(-3).childCount?2:3;f=f.append(D.from(t.createAndFill()));let h=i.before(i.depth-(d-1)),m=n.tr.replace(h,i.after(-p),new F(f,4-d,0)),g=-1;m.doc.nodesBetween(h,m.doc.content.size,(y,w)=>{if(g>-1)return!1;y.isTextblock&&y.content.size==0&&(g=w+1)}),g>-1&&m.setSelection(ge.near(m.doc.resolve(g))),r(m.scrollIntoView())}return!0}let l=o.pos==i.end()?a.contentMatchAt(0).defaultType:null,c=n.tr.delete(i.pos,o.pos),u=l?[null,{type:l}]:void 0;return Ii(c.doc,i.pos,2,u)?(r&&r(c.split(i.pos,2,u).scrollIntoView()),!0):!1}}function ku(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,s=>s.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?q_(e,n,t,o):G_(e,n,o):!0:!1}}function q_(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new Ye(o-1,s,o,s,new F(D.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Fa(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));const a=Sl(r);if(a==null)return!1;i.lift(r,a);let l=i.mapping.map(o,-1)-1;return Cl(i.doc,l)&&i.join(l),e(i.scrollIntoView()),!0}function G_(t,e,n){let r=t.tr,i=n.parent;for(let p=n.end,h=n.endIndex-1,m=n.startIndex;h>m;h--)p-=i.child(h).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,c=o.node(-1),u=o.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?D.empty:D.from(i))))return!1;let f=o.pos,d=f+s.nodeSize;return r.step(new Ye(f-(a?1:0),d+(l?1:0),f+1,d-1,new F((a?D.empty:D.from(i.copy(D.empty))).append(l?D.empty:D.from(i.copy(D.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function K_(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=t)return!1;if(n){let c=l.lastChild&&l.lastChild.type==a.type,u=D.from(c?t.create():null),f=new F(D.from(t.create(null,D.from(a.type.create(null,u)))),c?3:1,0),d=o.start,p=o.end;n(e.tr.step(new Ye(d-(c?3:1),p,d,p,f,1,!0)).scrollIntoView())}return!0}}const Ge=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},es=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Au=null;const Dn=function(t,e,n){let r=Au||(Au=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},Z_=function(){Au=null},si=function(t,e,n,r){return n&&(hh(t,e,n,r,-1)||hh(t,e,n,r,1))},J_=/^(img|br|input|textarea|hr)$/i;function hh(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Dt(t))){let o=t.parentNode;if(!o||o.nodeType!=1||ys(t)||J_.test(t.nodeName)||t.contentEditable=="false")return!1;e=Ge(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?Dt(t):0}else return!1}}function Dt(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Y_(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Dt(t)}else if(t.parentNode&&!ys(t))e=Ge(t),t=t.parentNode;else return null}}function X_(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!ys(t))e=Ge(t)+1,t=t.parentNode;else return null}}function Q_(t,e,n){for(let r=e==0,i=e==Dt(t);r||i;){if(t==n)return!0;let o=Ge(t);if(t=t.parentNode,!t)return!1;r=r&&o==0,i=i&&o==Dt(t)}}function ys(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const El=function(t){return t.focusNode&&si(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function jr(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function e3(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function t3(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Dt(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Dt(r.startContainer),r.startOffset)}}}const On=typeof navigator<"u"?navigator:null,mh=typeof document<"u"?document:null,Er=On&&On.userAgent||"",Tu=/Edge\/(\d+)/.exec(Er),w0=/MSIE \d/.exec(Er),Mu=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Er),mt=!!(w0||Mu||Tu),hr=w0?document.documentMode:Mu?+Mu[1]:Tu?+Tu[1]:0,on=!mt&&/gecko\/(\d+)/i.test(Er);on&&+(/Firefox\/(\d+)/.exec(Er)||[0,0])[1];const Nu=!mt&&/Chrome\/(\d+)/.exec(Er),nt=!!Nu,x0=Nu?+Nu[1]:0,st=!mt&&!!On&&/Apple Computer/.test(On.vendor),no=st&&(/Mobile\/\w+/.test(Er)||!!On&&On.maxTouchPoints>2),Nt=no||(On?/Mac/.test(On.platform):!1),n3=On?/Win/.test(On.platform):!1,Zt=/Android \d/.test(Er),ws=!!mh&&"webkitFontSmoothing"in mh.documentElement.style,r3=ws?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function i3(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Nn(t,e){return typeof t=="number"?t:t[e]}function o3(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function gh(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;s=es(s)){if(s.nodeType!=1)continue;let a=s,l=a==o.body,c=l?i3(o):o3(a),u=0,f=0;if(e.top<c.top+Nn(r,"top")?f=-(c.top-e.top+Nn(i,"top")):e.bottom>c.bottom-Nn(r,"bottom")&&(f=e.bottom-e.top>c.bottom-c.top?e.top+Nn(i,"top")-c.top:e.bottom-c.bottom+Nn(i,"bottom")),e.left<c.left+Nn(r,"left")?u=-(c.left-e.left+Nn(i,"left")):e.right>c.right-Nn(r,"right")&&(u=e.right-c.right+Nn(i,"right")),u||f)if(l)o.defaultView.scrollBy(u,f);else{let d=a.scrollLeft,p=a.scrollTop;f&&(a.scrollTop+=f),u&&(a.scrollLeft+=u);let h=a.scrollLeft-d,m=a.scrollTop-p;e={left:e.left-h,top:e.top-m,right:e.right-h,bottom:e.bottom-m}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function s3(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let a=t.root.elementFromPoint(o,s);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:S0(t.dom)}}function S0(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=es(r));return e}function a3({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;C0(n,r==0?0:r-e)}function C0(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:o}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=o&&(r.scrollLeft=o)}}let wi=null;function l3(t){if(t.setActive)return t.setActive();if(wi)return t.focus(wi);let e=S0(t);t.focus(wi==null?{get preventScroll(){return wi={preventScroll:!0},!0}}:void 0),wi||(wi=!1,C0(e,0))}function O0(t,e){let n,r=2e8,i,o=0,s=e.top,a=e.top,l,c;for(let u=t.firstChild,f=0;u;u=u.nextSibling,f++){let d;if(u.nodeType==1)d=u.getClientRects();else if(u.nodeType==3)d=Dn(u).getClientRects();else continue;for(let p=0;p<d.length;p++){let h=d[p];if(h.top<=s&&h.bottom>=a){s=Math.max(h.bottom,s),a=Math.min(h.top,a);let m=h.left>e.left?h.left-e.left:h.right<e.left?e.left-h.right:0;if(m<r){n=u,r=m,i=m&&n.nodeType==3?{left:h.right<e.left?h.right:h.left,top:e.top}:e,u.nodeType==1&&m&&(o=f+(e.left>=(h.left+h.right)/2?1:0));continue}}else h.top>e.top&&!l&&h.left<=e.left&&h.right>=e.left&&(l=u,c={left:Math.max(h.left,Math.min(h.right,e.left)),top:h.top});!n&&(e.left>=h.right&&e.top>=h.top||e.left>=h.left&&e.top>=h.bottom)&&(o=f+1)}}return!n&&l&&(n=l,i=c,r=0),n&&n.nodeType==3?c3(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:O0(n,i)}function c3(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);let o=er(r,1);if(o.top!=o.bottom&&Tf(e,o))return{node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function Tf(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function u3(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function f3(t,e,n){let{node:r,offset:i}=O0(e,n),o=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();o=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function d3(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let a=t.docView.nearestDesc(o,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)){let l=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&(!s&&l.left>r.left||l.top>r.top?i=a.posBefore:(!s&&l.right<r.left||l.bottom<r.top)&&(i=a.posAfter),s=!0),!a.contentDOM&&i<0&&!a.node.isText)return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter}o=a.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function E0(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let s=t.childNodes[o];if(s.nodeType==1){let a=s.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(Tf(e,c))return E0(s,e,c)}}if((o=(o+1)%r)==i)break}return t}function p3(t,e){let n=t.dom.ownerDocument,r,i=0,o=t3(n,e.left,e.top);o&&({node:r,offset:i}=o);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let c=t.dom.getBoundingClientRect();if(!Tf(e,c)||(s=E0(t.dom,e,c),!s))return null}if(st)for(let c=s;r&&c;c=es(c))c.draggable&&(r=void 0);if(s=u3(s,e),r){if(on&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let u=r.childNodes[i],f;u.nodeName=="IMG"&&(f=u.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&i++}let c;ws&&i&&r.nodeType==1&&(c=r.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=d3(t,r,i,e))}a==null&&(a=f3(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function bh(t){return t.top<t.bottom||t.left<t.right}function er(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(bh(r))return r}return Array.prototype.find.call(n,bh)||t.getBoundingClientRect()}const h3=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function _0(t,e,n){let{node:r,offset:i,atom:o}=t.docView.domFromPos(e,n<0?-1:1),s=ws||on;if(r.nodeType==3)if(s&&(h3.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let l=er(Dn(r,i,i),n);if(on&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let c=er(Dn(r,i-1,i-1),-1);if(c.top==l.top){let u=er(Dn(r,i,i+1),-1);if(u.top!=l.top)return So(u,u.left<c.left)}}return l}else{let l=i,c=i,u=n<0?1:-1;return n<0&&!i?(c++,u=-1):n>=0&&i==r.nodeValue.length?(l--,u=1):n<0?l--:c++,So(er(Dn(r,l,c),u),u<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==Dt(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return Vc(l.getBoundingClientRect(),!1)}if(o==null&&i<Dt(r)){let l=r.childNodes[i];if(l.nodeType==1)return Vc(l.getBoundingClientRect(),!0)}return Vc(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==Dt(r))){let l=r.childNodes[i-1],c=l.nodeType==3?Dn(l,Dt(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return So(er(c,1),!1)}if(o==null&&i<Dt(r)){let l=r.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?Dn(l,0,s?0:1):l.nodeType==1?l:null:null;if(c)return So(er(c,-1),!0)}return So(er(r.nodeType==3?Dn(r):r,-n),n>=0)}function So(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Vc(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function k0(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function m3(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return k0(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}let s=_0(t,i.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Dn(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let u=l[c];if(u.bottom>u.top+1&&(n=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const g3=/[\u0590-\u08ac]/;function b3(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=t.domSelection();return a?!g3.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?o:s:k0(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:f}=t.domSelectionRange(),d=a.caretBidiLevel;a.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:h,focusOffset:m}=t.domSelectionRange(),g=h&&!p.contains(h.nodeType==1?h:h.parentNode)||l==h&&c==m;try{a.collapse(u,f),l&&(l!=u||c!=f)&&a.extend&&a.extend(l,c)}catch{}return d!=null&&(a.caretBidiLevel=d),g}):r.pos==r.start()||r.pos==r.end()}let vh=null,yh=null,wh=!1;function v3(t,e,n){return vh==e&&yh==n?wh:(vh=e,yh=n,wh=n=="up"||n=="down"?m3(t,e,n):b3(t,e,n))}const Ft=0,xh=1,Br=2,En=3;class xs{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Ft,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let o,s;if(e==this.contentDOM)o=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(s)+s.size:this.posAtStart}else{let o,s;if(e==this.contentDOM)o=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(s):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>Ge(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],o=r+i.size;if(r==e&&o!=r){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(e<o)return i.descAt(e-r-i.border);r=o}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let s=this.children[r],a=o+s.size;if(a>e||s instanceof T0){i=e-o;break}o=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof A0&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?Ge(o.dom)+1:0}}else{let o,s=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,s=!1);return o&&s&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?Ge(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let s=r,a=0;;a++){let l=this.children[a],c=s+l.size;if(i==-1&&e<=c){let u=s+l.border;if(e>=u&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,u);e=s;for(let f=a;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=Ge(d.dom)+1;break}e-=d.size}i==-1&&(i=0)}if(i>-1&&(c>n||a==this.children.length-1)){n=c;for(let u=a+1;u<this.children.length;u++){let f=this.children[u];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=Ge(f.dom);break}n+=f.size}o==-1&&(o=this.contentDOM.childNodes.length);break}s=c}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,i=!1){let o=Math.min(e,n),s=Math.max(e,n);for(let p=0,h=0;p<this.children.length;p++){let m=this.children[p],g=h+m.size;if(o>h&&s<g)return m.setSelection(e-h-m.border,n-h-m.border,r,i);h=g}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),u=r.domSelectionRange(),f=!1;if((on||st)&&e==n){let{node:p,offset:h}=a;if(p.nodeType==3){if(f=!!(h&&p.nodeValue[h-1]==`
|
|
346
|
-
`),f&&h==p.nodeValue.length)for(let m=p,g;m;m=m.parentNode){if(g=m.nextSibling){g.nodeName=="BR"&&(a=l={node:g.parentNode,offset:Ge(g)+1});break}let y=m.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let m=p.childNodes[h-1];f=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(on&&u.focusNode&&u.focusNode!=l.node&&u.focusNode.nodeType==1){let p=u.focusNode.childNodes[u.focusOffset];p&&p.contentEditable=="false"&&(i=!0)}if(!(i||f&&st)&&si(a.node,a.offset,u.anchorNode,u.anchorOffset)&&si(l.node,l.offset,u.focusNode,u.focusOffset))return;let d=!1;if((c.extend||e==n)&&!f){c.collapse(a.node,a.offset);try{e!=n&&c.extend(l.node,l.offset),d=!0}catch{}}if(!d){if(e>n){let h=a;a=l,l=h}let p=document.createRange();p.setEnd(l.node,l.offset),p.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],s=r+o.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let a=r+o.border,l=s-o.border;if(e>=a&&n<=l){this.dirty=e==r||n==s?Br:xh,e==a&&n==l&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=En:o.markDirty(e-a,n-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Br:En}r=s}this.dirty=Br}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Br:xh;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class A0 extends xs{constructor(e,n,r,i){let o,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==Ft&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class y3 extends xs{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class ai extends xs{constructor(e,n,r,i,o){super(e,[],r,i),this.mark=n,this.spec=o}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=di.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new ai(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&En||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=En&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Ft){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Ft}}slice(e,n,r){let i=ai.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=Pu(o,n,s,r)),e>0&&(o=Pu(o,0,e,r));for(let a=0;a<o.length;a++)o[a].parent=i;return i.children=o,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class mr extends xs{constructor(e,n,r,i,o,s,a,l,c){super(e,[],o,s),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(e,n,r,i,o,s){let a=o.nodeViews[n.type.name],l,c=a&&a(n,o,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,i),u=c&&c.dom,f=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:f}=di.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!f&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let d=u;return u=R0(u,r,n),c?l=new w3(e,n,r,i,u,f||null,d,c,o,s+1):n.isText?new _l(e,n,r,i,u,d,o):new mr(e,n,r,i,u,f||null,d,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>D.empty)}return e}matchesNode(e,n,r){return this.dirty==Ft&&e.eq(this.node)&&Za(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new S3(this,s&&s.node,e);E3(this.node,this.innerDeco,(c,u,f)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!f&&l.syncToMarks(u==this.node.childCount?_e.none:this.node.child(u).marks,r,e),l.placeWidget(c,e,i)},(c,u,f,d)=>{l.syncToMarks(c.marks,r,e);let p;l.findNodeMatch(c,u,f,d)||a&&e.state.selection.from>i&&e.state.selection.to<i+c.nodeSize&&(p=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(c,u,f,p,e)||l.updateNextNode(c,u,f,e,d,i)||l.addNode(c,u,f,e,i),i+=c.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Br)&&(s&&this.protectLocalComposition(e,s),M0(this.contentDOM,this.children,e),no&&_3(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof be)||r<n||i>n+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,a=k3(this.node.content,s,r-n,i-n);return a<0?null:{node:o,pos:a,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new y3(this,o,n,i);e.input.compositionNodes.push(s),this.children=Pu(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==En||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Ft}updateOuterDeco(e){if(Za(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=N0(this.dom,this.nodeDOM,Ru(this.outerDeco,this.node,n),Ru(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Sh(t,e,n,r,i){R0(r,e,t);let o=new mr(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class _l extends mr{constructor(e,n,r,i,o,s,a){super(e,n,r,i,o,null,s,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==En||this.dirty!=Ft&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Ft||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Ft,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),o=document.createTextNode(i.text);return new _l(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=En)}get domAtom(){return!1}isText(e){return this.node.text==e}}class T0 extends xs{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Ft&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class w3 extends mr{constructor(e,n,r,i,o,s,a,l,c,u){super(e,n,r,i,o,s,a,c,u),this.spec=l}update(e,n,r,i){if(this.dirty==En)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,n,r);return o&&this.updateInner(e,n,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function M0(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=s.dom;if(a.parentNode==t){for(;a!=r;)r=Ch(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(a,r);if(s instanceof ai){let l=r?r.previousSibling:t.lastChild;M0(s.contentDOM,s.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=Ch(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const Io=function(t){t&&(this.nodeName=t)};Io.prototype=Object.create(null);const $r=[new Io];function Ru(t,e,n){if(t.length==0)return $r;let r=n?$r[0]:new Io,i=[r];for(let o=0;o<t.length;o++){let s=t[o].type.attrs;if(s){s.nodeName&&i.push(r=new Io(s.nodeName));for(let a in s){let l=s[a];l!=null&&(n&&i.length==1&&i.push(r=new Io(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return i}function N0(t,e,n,r){if(n==$r&&r==$r)return e;let i=e;for(let o=0;o<r.length;o++){let s=r[o],a=n[o];if(o){let l;a&&a.nodeName==s.nodeName&&i!=t&&(l=i.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=$r[0]),i=l}x3(i,a||$r[0],s)}return i}function x3(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&t.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&t.classList.add(i[o]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)t.style.removeProperty(i[1])}n.style&&(t.style.cssText+=n.style)}}function R0(t,e,n){return N0(t,t,$r,Ru(e,n,t.nodeType!=1))}function Za(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function Ch(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class S3{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=C3(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let i=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=Ft,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let c=this.top.children[l];if(c.matchesMark(e[o])&&!this.isLocked(c.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=ai.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))o=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(e,n,r)&&!this.preMatch.matched.has(c)){o=a;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,n,r,i,o){let s=this.top.children[i];return s.dirty==En&&s.dom==s.contentDOM&&(s.dirty=Br),s.update(e,n,r,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=n}}updateNextNode(e,n,r,i,o,s){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof mr){let c=this.preMatch.matched.get(l);if(c!=null&&c!=o)return!1;let u=l.dom,f,d=this.isLocked(u)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=En&&Za(n,l.outerDeco));if(!d&&l.update(e,n,r,i))return this.destroyBetween(this.index,a),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!d&&(f=this.recreateWrapper(l,e,n,r,i,s)))return this.destroyBetween(this.index,a),this.top.children[this.index]=f,f.contentDOM&&(f.dirty=Br,f.updateChildren(i,s+1),f.dirty=Ft),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,i,o,s){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!Za(r,e.outerDeco)||!i.eq(e.innerDeco))return null;let a=mr.create(this.top,n,r,i,o,s);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,n,r,i,o){let s=mr.create(this.top,e,n,r,i,o);s.contentDOM&&s.updateChildren(i,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new A0(this.top,e,n,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof ai;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof _l)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((st||nt)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new T0(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function C3(t,e){let n=e,r=n.children.length,i=t.childCount,o=new Map,s=[];e:for(;i>0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof ai)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}function O3(t,e){return t.type.side-e.type.side}function E3(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let c=0;c<t.childCount;c++){let u=t.child(c);r(u,i,e.forChild(o,u),c),o+=u.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){let u,f;for(;s<i.length&&i[s].to==o;){let g=i[s++];g.widget&&(u?(f||(f=[u])).push(g):u=g)}if(u)if(f){f.sort(O3);for(let g=0;g<f.length;g++)n(f[g],c,!!l)}else n(u,c,!!l);let d,p;if(l)p=-1,d=l,l=null;else if(c<t.childCount)p=c,d=t.child(c++);else break;for(let g=0;g<a.length;g++)a[g].to<=o&&a.splice(g--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let h=o+d.nodeSize;if(d.isText){let g=h;s<i.length&&i[s].from<g&&(g=i[s].from);for(let y=0;y<a.length;y++)a[y].to<g&&(g=a[y].to);g<h&&(l=d.cut(g-o),d=d.cut(0,g-o),h=g,p=-1)}else for(;s<i.length&&i[s].to<h;)s++;let m=d.isInline&&!d.isLeaf?a.filter(g=>!g.inline):a.slice();r(d,m,e.forChild(o,d),p),o=h}}function _3(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function k3(t,e,n,r){for(let i=0,o=0;i<t.childCount&&o<=r;){let s=t.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let l=s.text;for(;i<t.childCount;){let c=t.child(i++);if(o+=c.nodeSize,!c.isText)break;l+=c.text}if(o>=n){if(o>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let c=a<r?l.lastIndexOf(e,r-a-1):-1;if(c>=0&&c+e.length+a>=n)return a+c;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function Pu(t,e,n,r,i){let o=[];for(let s=0,a=0;s<t.length;s++){let l=t[s],c=a,u=a+=l.size;c>=n||u<=e?o.push(l):(c<e&&o.push(l.slice(0,e-c,r)),i&&(o.push(i),i=void 0),u>n&&o.push(l.slice(n-c,l.size,r)))}return o}function Mf(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,c;if(El(n)){for(l=s;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&de.isSelectable(f)&&i.parent&&!(f.isInline&&Q_(n.focusNode,n.focusOffset,i.dom))){let d=i.posBefore;c=new de(s==d?a:r.resolve(d))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let f=s,d=s;for(let p=0;p<n.rangeCount;p++){let h=n.getRangeAt(p);f=Math.min(f,t.docView.posFromDOM(h.startContainer,h.startOffset,1)),d=Math.max(d,t.docView.posFromDOM(h.endContainer,h.endOffset,-1))}if(f<0)return null;[l,s]=d==t.state.selection.anchor?[d,f]:[f,d],a=r.resolve(s)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let u=r.resolve(l);if(!c){let f=e=="pointer"||t.state.selection.head<a.pos&&!o?1:-1;c=Nf(t,u,a,f)}return c}function P0(t){return t.editable?t.hasFocus():D0(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Fn(t,e=!1){let n=t.state.selection;if(V0(t,n),!!P0(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&nt){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&si(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)T3(t);else{let{anchor:r,head:i}=n,o,s;Oh&&!(n instanceof be)&&(n.$from.parent.inlineContent||(o=Eh(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=Eh(t,n.to))),t.docView.setSelection(r,i,t,e),Oh&&(o&&_h(o),s&&_h(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&A3(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Oh=st||nt&&x0<63;function Eh(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(st&&i&&i.contentEditable=="false")return Dc(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return Dc(i);if(o)return Dc(o)}}function Dc(t){return t.contentEditable="true",st&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function _h(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function A3(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!P0(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function T3(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setStart(r.parentNode,Ge(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&mt&&hr<=11&&(r.disabled=!0,r.disabled=!1)}function V0(t,e){if(e instanceof de){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(kh(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else kh(t)}function kh(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Nf(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||be.between(e,n,r)}function Ah(t){return t.editable&&!t.hasFocus()?!1:D0(t)}function D0(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function M3(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return si(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Vu(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&ge.findFrom(o,e)}function nr(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Th(t,e,n){let r=t.state.selection;if(r instanceof be)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=t.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return nr(t,new be(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Vu(t.state,e);return i&&i instanceof de?nr(t,i):!1}else if(!(Nt&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let a=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?de.isSelectable(o)?nr(t,new de(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):ws?nr(t,new be(t.state.doc.resolve(e<0?a:a+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof de&&r.node.isInline)return nr(t,new be(e>0?r.$to:r.$from));{let i=Vu(t.state,e);return i?nr(t,i):!1}}}function Ja(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Bo(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function xi(t,e){return e<0?N3(t):R3(t)}function N3(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(on&&n.nodeType==1&&r<Ja(n)&&Bo(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(Bo(a,-1))i=n,o=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(L0(n))break;{let a=n.previousSibling;for(;a&&Bo(a,-1);)i=n.parentNode,o=Ge(a),a=a.previousSibling;if(a)n=a,r=Ja(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Du(t,n,r):i&&Du(t,i,o)}function R3(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=Ja(n),o,s;for(;;)if(r<i){if(n.nodeType!=1)break;let a=n.childNodes[r];if(Bo(a,1))o=n,s=++r;else break}else{if(L0(n))break;{let a=n.nextSibling;for(;a&&Bo(a,1);)o=a.parentNode,s=Ge(a)+1,a=a.nextSibling;if(a)n=a,r=0,i=Ja(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}o&&Du(t,o,s)}function L0(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function P3(t,e){for(;t&&e==t.childNodes.length&&!ys(t);)e=Ge(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function V3(t,e){for(;t&&!e&&!ys(t);)e=Ge(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function Du(t,e,n){if(e.nodeType!=3){let o,s;(s=P3(e,n))?(e=s,n=0):(o=V3(e,n))&&(e=o,n=o.nodeValue.length)}let r=t.domSelection();if(!r)return;if(El(r)){let o=document.createRange();o.setEnd(e,n),o.setStart(e,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&Fn(t)},50)}function Mh(t,e){let n=t.state.doc.resolve(e);if(!(nt||n3)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(e<n.end()){let o=t.coordsAtPos(e+1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function Nh(t,e,n){let r=t.state.selection;if(r instanceof be&&!r.empty||n.indexOf("s")>-1||Nt&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Vu(t.state,e);if(s&&s instanceof de)return nr(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,a=r instanceof _t?ge.near(s,e):ge.findFrom(s,e);return a?nr(t,a):!1}return!1}function Rh(t,e){if(!(t.state.selection instanceof be))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),t.dispatch(s),!0}return!1}function Ph(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function D3(t){if(!st||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Ph(t,r,"true"),setTimeout(()=>Ph(t,r,"false"),20)}return!1}function L3(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function j3(t,e){let n=e.keyCode,r=L3(e);if(n==8||Nt&&n==72&&r=="c")return Rh(t,-1)||xi(t,-1);if(n==46&&!e.shiftKey||Nt&&n==68&&r=="c")return Rh(t,1)||xi(t,1);if(n==13||n==27)return!0;if(n==37||Nt&&n==66&&r=="c"){let i=n==37?Mh(t,t.state.selection.from)=="ltr"?-1:1:-1;return Th(t,i,r)||xi(t,i)}else if(n==39||Nt&&n==70&&r=="c"){let i=n==39?Mh(t,t.state.selection.from)=="ltr"?1:-1:1;return Th(t,i,r)||xi(t,i)}else{if(n==38||Nt&&n==80&&r=="c")return Nh(t,-1,r)||xi(t,-1);if(n==40||Nt&&n==78&&r=="c")return D3(t)||Nh(t,1,r)||xi(t,1);if(r==(Nt?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function j0(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=t.someProp("clipboardSerializer")||di.fromSchema(t.state.schema),a=F0(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c=l.firstChild,u,f=0;for(;c&&c.nodeType==1&&(u=z0[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let h=a.createElement(u[p]);for(;l.firstChild;)h.appendChild(l.firstChild);l.appendChild(h),f++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(n)}`);let d=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,`
|
|
287
|
+
Check the top-level render call using <`+T+">."),re}var C=m,x=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),N=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),J=Symbol.for("react.offscreen"),ee=Symbol.iterator,L=Symbol.for("react.client.reference"),I=C.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,A=Object.prototype.hasOwnProperty,R=Object.assign,q=Symbol.for("react.client.reference"),D=Array.isArray,V=0,te,G,Q,se,be,de,Pe;o.__reactDisabledLog=!0;var X,qe,Qe=!1,at=new(typeof WeakMap=="function"?WeakMap:Map),xt=Symbol.for("react.client.reference"),wt,rn={},Le={},ot={};Ns.Fragment=_,Ns.jsx=function(T,re,ie,Ce,Xe){return b(T,re,ie,!1,Ce,Xe)},Ns.jsxs=function(T,re,ie,Ce,Xe){return b(T,re,ie,!0,Ce,Xe)}}(),Ns}var bA={};bA.NODE_ENV==="production"?af.exports=gA():af.exports=mA();var ue=af.exports;const mv=m.createContext(null),vA=({children:t})=>{const[e,n]=m.useState({setEditor:r=>{n(o=>({...o,editor:r}))}});return ue.jsx(mv.Provider,{value:e,children:t})},Qn=()=>{const t=m.useContext(mv);if(!t)throw new Error("useEditorInstance must be used within EditorInstanceProvider");return t},yA=()=>{const{editor:t}=Qn();if(!t)throw new Error("useEditor used before the load of the editor instance. You can wrap your component in `<WithEditor>` or make use of `useEditorMaybe` hook and ensure the `editor` exists.");return t},bv=m.createContext(null),xA=({children:t})=>{const[e,n]=m.useState(()=>({setRefCanvas(r){n(o=>({...o,refCanvas:r}))},setCustomModal(r){n(o=>({...o,customModal:r}))},setCustomAssets(r){n(o=>({...o,customAssets:r}))},setCustomBlocks(r){n(o=>({...o,customBlocks:r}))},setCustomRte(r){n(o=>({...o,customRte:r}))},setCustomStyles(r){n(o=>({...o,customStyles:r}))},setCustomLayers(r){n(o=>({...o,customLayers:r}))},setCustomSelectors(r){n(o=>({...o,customSelectors:r}))},setCustomTraits(r){n(o=>({...o,customTraits:r}))},setReady(r){n(o=>({...o,ready:r}))}}));return ue.jsx(bv.Provider,{value:e,children:t})},Gr=()=>{const t=m.useContext(bv);if(!t)throw new Error("useEditorOptions must be used within EditorOptionsProvider");return t};function wA(...t){return(Array.isArray(t[0])?t[0]:[...t]).filter(Boolean).join(" ")}function Mo(t){return typeof t=="function"}function Yn(){}const vv=t=>typeof t=="string",SA=async t=>{const e=document.createElement("link");e.href=t,e.rel="stylesheet",document.head.appendChild(e)},yv=t=>{const e=vv(t)?{id:t,src:t}:t;return new Promise((n,r)=>{const o=document.createElement("script");if(document.querySelector(`script[src="${e.src}"]`))return n(e.id);o.src=e.src,o.onload=()=>n(e.id),o.onerror=()=>r(e.id),document.head.appendChild(o)})},CA=t=>{const e=t.map(n=>yv(n));return Promise.allSettled(e)},Xg=t=>function(){const e=m.useRef(null);return m.useEffect(()=>{const{current:n}=e;n&&(vv(t)?n.innerHTML=t:n.appendChild(t))},[e.current]),ue.jsx("div",{ref:e})},Qg=new WeakMap;function ys(t){if(!t)return()=>ue.jsx(ue.Fragment,{});const e=Qg.get(t);if(e)return e;const n=function({children:r}){return ir.createPortal(m.createElement("div",null,r),t)};return Qg.set(t,n),n}m.memo(function({children:t}){const{editor:e}=Qn(),n=Gr(),[r,o]=m.useState(!1),[i,s]=m.useState({assets:[],types:[],close:()=>{},select:()=>{},Container:()=>ue.jsx(ue.Fragment,{})});return m.useEffect(()=>{if(!e)return;const l=e.Assets.events.custom,a=({open:c,assets:u,types:d,select:f,close:p,container:g})=>{c&&s({assets:u,types:d,select:f,close:p,Container:ys(g)}),o(c)};return e.on(l,a),()=>{e.off(l,a)}},[e]),m.useEffect(()=>n.setCustomAssets(!0),[]),e?Mo(t)?t({open:r,...i}):ue.jsx(ue.Fragment,{}):ue.jsx(ue.Fragment,{})});m.memo(function({children:t}){const{editor:e}=Qn(),n=Gr(),[r,o]=m.useState(()=>({blocks:[],dragStart:Yn,dragStop:Yn,mapCategoryBlocks:new Map,Container:()=>ue.jsx(ue.Fragment,{})}));return m.useEffect(()=>{if(!e)return;const i=e.Blocks.events.custom,s=({blocks:l,container:a,dragStart:c,dragStop:u})=>{const d=l.reduce((f,p)=>{const g=p.getCategoryLabel(),b=f.get(g);return b?b.push(p):f.set(g,[p]),f},new Map);o({blocks:l,dragStart:c,dragStop:u,mapCategoryBlocks:d,Container:ys(a)})};return e.on(i,s),e.Blocks.__trgCustom(),()=>{e.off(i,s)}},[e]),m.useEffect(()=>n.setCustomBlocks(!0),[]),e?Mo(t)?t(r):ue.jsx(ue.Fragment,{}):ue.jsx(ue.Fragment,{})});m.memo(function({children:t}){const{editor:e}=Qn(),[n,r]=m.useState(()=>({devices:[],selected:"",select:Yn}));return m.useEffect(()=>{if(!e)return;const{Devices:o}=e,i=o.events.all,s=()=>{var l;r({devices:o.getDevices(),selected:(l=o.getSelected())==null?void 0:l.id,select:a=>o.select(a)})};return e.on(i,s),s(),()=>{e.off(i,s)}},[e]),e?Mo(t)?t(n):ue.jsx(ue.Fragment,{}):ue.jsx(ue.Fragment,{})});const EA=t=>!!(t&&!Array.isArray(t)&&typeof t=="object");async function OA(t){const e=t.map(({id:i,src:s})=>({id:i,src:s})),n=t.reduce((i,s)=>(i[s.id]=s,i),{}),r=[],o=[];return(await CA(e)).forEach(i=>{i.status==="fulfilled"?r.push(n[i.value]):o.push(n[i.reason])}),{loaded:r,failed:o}}const _A=async t=>{const e=[...t],n={};if(e.length){const r={},o=[];if(e.forEach((i,s)=>{EA(i)&&(r[i.id]={index:s},o.push(i))}),o.length){const{loaded:i}=await OA(o);i.forEach(({id:s,options:l})=>{r[s].loaded=!0,n[s]=l||{}})}Object.keys(r).forEach(i=>{const s=r[i];s.loaded?e[s.index]=i:e[s.index]=!1})}return{plugins:e.filter(Boolean),pluginOptions:n}},kA=m.memo(function({children:t,className:e,style:n,options:r={},plugins:o=[],grapesjs:i,grapesjsCss:s,onEditor:l=Yn,onReady:a,onUpdate:c,waitReady:u,...d}){const{setEditor:f}=Qn(),p=Gr(),[g,b]=m.useState(!1),v=m.useRef(null);m.useEffect(()=>{if(!p.ready||!v.current)return;const _=v.current,M=p.refCanvas;let k,j={},N=[];const P=z=>{const W={height:"100%",...r,plugins:[...N,...r.plugins||[]],pluginsOpts:{...r.pluginsOpts,...j},modal:{custom:!!p.customModal,...r.modal},assetManager:{custom:!!p.customAssets,...r.assetManager},styleManager:{custom:!!p.customStyles,...r.styleManager},blockManager:{custom:!!p.customBlocks,...r.blockManager},richTextEditor:{custom:!!p.customRte,...r.richTextEditor},layerManager:{custom:!!p.customLayers,...r.layerManager},traitManager:{custom:!!p.customTraits,...r.traitManager},selectorManager:{custom:!!p.customSelectors,...r.selectorManager},container:M||_,customUI:!!M,...M?{panels:{defaults:[]}}:{}};k=z.init(W),f(k),l(k),c&&k.on("update",()=>{c(k.getProjectData(),k)}),k.onReady(()=>{b(!0),a==null||a(k)})};return(async()=>{s&&await SA(s);const z=await _A(o);N=z.plugins,j=z.pluginOptions,typeof i=="string"?(await yv(i),P(window.grapesjs)):P(i)})(),()=>k==null?void 0:k.destroy()},[p.ready]);const y=r.height??"100%",w=r.width??"100%",S=wA("gjs-editor-wrapper",e),C=u&&!g,x=m.useMemo(()=>({...n,height:y,width:w}),[y,w,n]),E=m.useMemo(()=>({...x,...C?{opacity:0,width:0,height:0}:{}}),[x,C]);return ue.jsxs(ue.Fragment,{children:[u&&!g?ue.jsx("div",{className:S,style:x,children:u}):null,ue.jsx("div",{...d,ref:v,className:S,style:E,children:t})]})}),TA=m.memo(function(){const t=Gr();return m.useEffect(()=>t.setReady(!0),[]),ue.jsx(ue.Fragment,{})});m.memo(function({children:t,...e}){return ue.jsx(vA,{children:ue.jsx(xA,{children:ue.jsxs(kA,{...e,children:[t,ue.jsx(TA,{})]})})})});m.memo(function({children:t}){const{editor:e}=Qn(),n=Gr(),[r,o]=m.useState(()=>({root:void 0,Container:()=>ue.jsx(ue.Fragment,{})}));return m.useEffect(()=>{if(!e)return;const{Layers:i}=e,s=i.events.custom,l=({container:a})=>{o({root:i.getRoot(),Container:ys(a)})};return e.on(s,l),i.__trgCustom({}),()=>{e.off(s,l)}},[e]),m.useEffect(()=>n.setCustomLayers(!0),[]),e?Mo(t)?t(r):ue.jsx(ue.Fragment,{}):ue.jsx(ue.Fragment,{})});m.memo(function({children:t}){const{editor:e}=Qn(),n=Gr(),[r,o]=m.useState(!1),[i,s]=m.useState({title:ue.jsx(ue.Fragment,{}),content:ue.jsx(ue.Fragment,{}),attributes:{},close:Yn});return m.useEffect(()=>{if(!e)return;const l="modal",a=({open:c,title:u,content:d,close:f,attributes:p})=>{c&&s({title:m.createElement(Xg(u)),content:m.createElement(Xg(d)),attributes:p,close:f}),o(c)};return e.on(l,a),()=>{e.off(l,a)}},[e]),m.useEffect(()=>n.setCustomModal(!0),[]),e?typeof t=="function"?t({open:r,...i}):ue.jsx(ue.Fragment,{}):ue.jsx(ue.Fragment,{})});m.memo(function({children:t}){const{editor:e}=Qn(),[n,r]=m.useState(()=>({pages:[],selected:void 0,select:Yn,add:Yn,remove:Yn}));return m.useEffect(()=>{if(!e)return;const{Pages:o}=e,i=o.events.all,s=()=>{r({pages:o.getAll(),selected:o.getSelected(),select:(...l)=>o.select(...l),add:(...l)=>o.add(...l),remove:(...l)=>o.remove(...l)})};return e.on(i,s),s(),()=>{e.off(i,s)}},[e]),e?Mo(t)?t(n):ue.jsx(ue.Fragment,{}):ue.jsx(ue.Fragment,{})});m.memo(function({children:t}){const{editor:e}=Qn(),n=Gr(),[r,o]=m.useState(()=>({selectors:[],states:[],selectedState:"",targets:[],addSelector:Yn,removeSelector:Yn,setState:Yn,Container:()=>ue.jsx(ue.Fragment,{})}));return m.useEffect(()=>{if(!e)return;const{Selectors:i}=e,s=i.events.custom,l=({container:a})=>{o({selectors:i.getSelected(),states:i.getStates(),selectedState:i.getState(),targets:i.getSelectedTargets().map(c=>c.getSelectorsString()),addSelector:(...c)=>i.addSelected(...c),removeSelector:(...c)=>i.removeSelected(...c),setState:(...c)=>i.setState(...c),Container:ys(a)})};return e.on(s,l),()=>{e.off(s,l)}},[e]),m.useEffect(()=>n.setCustomSelectors(!0),[]),e?Mo(t)?t(r):ue.jsx(ue.Fragment,{}):ue.jsx(ue.Fragment,{})});m.memo(function({children:t}){const{editor:e}=Qn(),n=Gr(),[r,o]=m.useState(()=>({sectors:[],Container:()=>ue.jsx(ue.Fragment,{})}));return m.useEffect(()=>{if(!e)return;const{Styles:i}=e,s=i.events.custom,l=({container:a})=>{o({sectors:i.getSectors({visible:!0}),Container:ys(a)})};return e.on(s,l),()=>{e.off(s,l)}},[e]),m.useEffect(()=>n.setCustomStyles(!0),[]),e?Mo(t)?t(r):ue.jsx(ue.Fragment,{}):ue.jsx(ue.Fragment,{})});m.memo(function({children:t}){const{editor:e}=Qn(),n=Gr(),[r,o]=m.useState(()=>({traits:[],Container:()=>ue.jsx(ue.Fragment,{})}));return m.useEffect(()=>{if(!e)return;const{Traits:i}=e,s=i.events.custom,l=({container:a})=>{o({traits:i.getCurrent(),Container:ys(a)})};return e.on(s,l),i.__trgCustom(),()=>{e.off(s,l)}},[e]),m.useEffect(()=>n.setCustomTraits(!0),[]),e?Mo(t)?t(r):ue.jsx(ue.Fragment,{}):ue.jsx(ue.Fragment,{})});const Wp="gs-cmp-accordion",cf=`${Wp}-handler`,ia=`${cf}__content`,AA=`${Wp}-content`;function MA({className:t,classNameWrap:e,classNameContent:n,style:r,handler:o,handlerIcon:i,children:s,inverted:l,disabled:a,sticky:c,onChange:u,open:d}){return h.jsx($u,{as:"div",defaultOpen:d,className:B(Wp,e,"relative"),children:({open:f})=>h.jsxs(h.Fragment,{children:[h.jsx($u.Button,{as:a?"div":"button",disabled:a,style:r,onClick:p=>u==null?void 0:u({event:p,open:!f}),className:({open:p})=>tt(cf,xo(t)?t(p):t,c&&"gs-utl-sticky gs-utl-top-0 gs-utl-z-10","gs-utl-w-full"),children:({open:p})=>h.jsxs(fe,{items:"center",className:B("gap-2"),full:!0,children:[h.jsx(U,{className:B(ia,"text-left"),grow:!0,children:xo(o)?o(p):h.jsxs(fe,{items:"center",className:B(`${ia}-wrp`,"gap-3"),nowrap:!0,children:[!!i&&h.jsx(ge,{className:B(`${ia}-icon`),icon:i,size:We.s2x}),h.jsx(U,{className:B(`${ia}-label gs-utl-w-full`),children:o})]})}),h.jsx(U,{className:B(`${cf}-toggle`,l&&"-order-1",a&&"gs-utl-hidden"),children:h.jsx(ge,{icon:_e.chevronDown,className:B("w-5 h-5 transition-transform",p&&"rotate-180")})})]})}),h.jsx($u.Panel,{className:B(AA,n),children:s})]})})}function oe({label:t,property:e,hasValue:n,empty:r,onClear:o,children:i,shallow:s,row:l,tooltip:a,className:c,...u}){const d=t||(e==null?void 0:e.getLabel()),f=e==null?void 0:e.getParentTarget(),p=n||!r&&(e==null?void 0:e.hasValue({noParent:!0})),g=!p&&(e==null?void 0:e.hasValue())&&f,b=f==null?void 0:f.getDevice(),v=f==null?void 0:f.getState(),y=f==null?void 0:f.getComponent(),w=()=>o?o():e==null?void 0:e.clear(),S={className:B(c,"text-sm w-full"),col:!l,items:l?"center":void 0,...u};return e&&!e.isVisible()?null:h.jsx(h.Fragment,{children:h.jsxs(fe,{...S,children:[h.jsx(U,{grow:!0,children:h.jsxs(fe,{as:"label",items:"center",space:"xs",className:B("block",!l&&"gjs-mb-1",p&&!s&&he.tAo),children:[a&&h.jsx(U,{children:h.jsx(mo,{title:a,children:h.jsx(ge,{icon:_e.information,size:We.sx})})}),h.jsx(U,{children:r?h.jsx("span",{children:" "}):d}),!!g&&!s&&h.jsx(mo,{title:h.jsxs(h.Fragment,{children:[h.jsx("div",{className:B("gjs-mb-1"),children:"Value inherited from"}),!!b&&h.jsxs(fe,{space:"s",children:[h.jsx(U,{children:h.jsx(ge,{icon:_e.cellphoneLink,size:We.sx})}),h.jsx(U,{children:h.jsx("b",{children:b.getName()})})]}),h.jsxs(fe,{space:"s",children:[h.jsx(U,{children:h.jsx(ge,{icon:y?_e.targetVariant:_e.tag,size:We.sx})}),h.jsxs(U,{children:[h.jsx("b",{children:y?"Components":"Selectors"}),h.jsxs("span",{className:B("text-xs opacity-75"),children:[" ",f==null?void 0:f.selectorsToString({skipState:1})]})]})]}),!!v&&h.jsxs(fe,{space:"s",children:[h.jsx(U,{children:h.jsx(ge,{icon:_e.flare,size:We.sx})}),h.jsx(U,{children:h.jsx("b",{children:v.getLabel()})})]})]}),children:h.jsx("div",{className:B("gs-utl-w-[6px] gs-utl-h-[6px] gjs-rounded-full",he.bgW)})}),p&&!s&&h.jsx(mo,{title:"Clear value",onClick:w,children:h.jsx(ge,{className:B(So.click),icon:_e.close,size:We.s2x})})]})}),h.jsx(U,{grow:!0,className:B("max-w-full"),children:i})]})})}function Mn({className:t,options:e,label:n,name:r,value:o,size:i="m",required:s,disabled:l,style:a,onChange:c}){const u=f=>{const p=e.filter(g=>g.id===f)[0];return e.indexOf(p)===e.length-1},d=(f,p)=>B("cursor-pointer",i==="m"&&dr.xy,i==="s"&&"gs-utl-px-2 gs-utl-py-1 text-sm",i==="xs"&&"gs-utl-p-1 text-sm",he.br,f&&he.bgO,!u(p)&&we.br);return h.jsxs(Ng,{value:o,onChange:c,className:B("gs-field-buttons w-full"),disabled:l,style:a,children:[!!n&&h.jsx(gn,{size:i,children:n}),r&&h.jsx("input",{type:"hidden",name:r,value:o,required:s}),h.jsx(fe,{className:B(t,we.b,we.rnd,he.br,"cursor-pointer"),items:"center",full:!0,nowrap:!0,children:e.map(({id:f,label:p,title:g,icon:b})=>h.jsx(mo,{title:g,className:B("w-full"),classNameWrp:B("flex-1"),children:h.jsx(Ng.Option,{value:f,className:({checked:v})=>d(v,f),children:h.jsxs(fe,{justify:"center",space:"s",full:!0,children:[!!b&&h.jsx(ge,{icon:b,size:We.s}),p&&h.jsx(U,{children:p})]})})},f))})]})}var jA={grad:.9,turn:360,rad:360/(2*Math.PI)},Or=function(t){return typeof t=="string"?t.length>0:typeof t=="number"},St=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=Math.pow(10,e)),Math.round(n*t)/n+0},Pn=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=1),t>n?n:t>e?t:e},xv=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},em=function(t){return{r:Pn(t.r,0,255),g:Pn(t.g,0,255),b:Pn(t.b,0,255),a:Pn(t.a)}},Gu=function(t){return{r:St(t.r),g:St(t.g),b:St(t.b),a:St(t.a,3)}},RA=/^#([0-9a-f]{3,8})$/i,sa=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},wv=function(t){var e=t.r,n=t.g,r=t.b,o=t.a,i=Math.max(e,n,r),s=i-Math.min(e,n,r),l=s?i===e?(n-r)/s:i===n?2+(r-e)/s:4+(e-n)/s:0;return{h:60*(l<0?l+6:l),s:i?s/i*100:0,v:i/255*100,a:o}},Sv=function(t){var e=t.h,n=t.s,r=t.v,o=t.a;e=e/360*6,n/=100,r/=100;var i=Math.floor(e),s=r*(1-n),l=r*(1-(e-i)*n),a=r*(1-(1-e+i)*n),c=i%6;return{r:255*[r,l,s,s,a,r][c],g:255*[a,r,r,l,s,s][c],b:255*[s,s,a,r,r,l][c],a:o}},tm=function(t){return{h:xv(t.h),s:Pn(t.s,0,100),l:Pn(t.l,0,100),a:Pn(t.a)}},nm=function(t){return{h:St(t.h),s:St(t.s),l:St(t.l),a:St(t.a,3)}},rm=function(t){return Sv((n=(e=t).s,{h:e.h,s:(n*=((r=e.l)<50?r:100-r)/100)>0?2*n/(r+n)*100:0,v:r+n,a:e.a}));var e,n,r},Ys=function(t){return{h:(e=wv(t)).h,s:(o=(200-(n=e.s))*(r=e.v)/100)>0&&o<200?n*r/100/(o<=100?o:200-o)*100:0,l:o/2,a:e.a};var e,n,r,o},NA=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,PA=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,DA=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,LA=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,uf={string:[[function(t){var e=RA.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?St(parseInt(t[3]+t[3],16)/255,2):1}:t.length===6||t.length===8?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:t.length===8?St(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=DA.exec(t)||LA.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:em({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(t){var e=NA.exec(t)||PA.exec(t);if(!e)return null;var n,r,o=tm({h:(n=e[1],r=e[2],r===void 0&&(r="deg"),Number(n)*(jA[r]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return rm(o)},"hsl"]],object:[[function(t){var e=t.r,n=t.g,r=t.b,o=t.a,i=o===void 0?1:o;return Or(e)&&Or(n)&&Or(r)?em({r:Number(e),g:Number(n),b:Number(r),a:Number(i)}):null},"rgb"],[function(t){var e=t.h,n=t.s,r=t.l,o=t.a,i=o===void 0?1:o;if(!Or(e)||!Or(n)||!Or(r))return null;var s=tm({h:Number(e),s:Number(n),l:Number(r),a:Number(i)});return rm(s)},"hsl"],[function(t){var e=t.h,n=t.s,r=t.v,o=t.a,i=o===void 0?1:o;if(!Or(e)||!Or(n)||!Or(r))return null;var s=function(l){return{h:xv(l.h),s:Pn(l.s,0,100),v:Pn(l.v,0,100),a:Pn(l.a)}}({h:Number(e),s:Number(n),v:Number(r),a:Number(i)});return Sv(s)},"hsv"]]},om=function(t,e){for(var n=0;n<e.length;n++){var r=e[n][0](t);if(r)return[r,e[n][1]]}return[null,void 0]},VA=function(t){return typeof t=="string"?om(t.trim(),uf.string):typeof t=="object"&&t!==null?om(t,uf.object):[null,void 0]},Ku=function(t,e){var n=Ys(t);return{h:n.h,s:Pn(n.s+100*e,0,100),l:n.l,a:n.a}},Yu=function(t){return(299*t.r+587*t.g+114*t.b)/1e3/255},im=function(t,e){var n=Ys(t);return{h:n.h,s:n.s,l:Pn(n.l+100*e,0,100),a:n.a}},df=function(){function t(e){this.parsed=VA(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return t.prototype.isValid=function(){return this.parsed!==null},t.prototype.brightness=function(){return St(Yu(this.rgba),2)},t.prototype.isDark=function(){return Yu(this.rgba)<.5},t.prototype.isLight=function(){return Yu(this.rgba)>=.5},t.prototype.toHex=function(){return e=Gu(this.rgba),n=e.r,r=e.g,o=e.b,s=(i=e.a)<1?sa(St(255*i)):"","#"+sa(n)+sa(r)+sa(o)+s;var e,n,r,o,i,s},t.prototype.toRgb=function(){return Gu(this.rgba)},t.prototype.toRgbString=function(){return e=Gu(this.rgba),n=e.r,r=e.g,o=e.b,(i=e.a)<1?"rgba("+n+", "+r+", "+o+", "+i+")":"rgb("+n+", "+r+", "+o+")";var e,n,r,o,i},t.prototype.toHsl=function(){return nm(Ys(this.rgba))},t.prototype.toHslString=function(){return e=nm(Ys(this.rgba)),n=e.h,r=e.s,o=e.l,(i=e.a)<1?"hsla("+n+", "+r+"%, "+o+"%, "+i+")":"hsl("+n+", "+r+"%, "+o+"%)";var e,n,r,o,i},t.prototype.toHsv=function(){return e=wv(this.rgba),{h:St(e.h),s:St(e.s),v:St(e.v),a:St(e.a,3)};var e},t.prototype.invert=function(){return er({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},t.prototype.saturate=function(e){return e===void 0&&(e=.1),er(Ku(this.rgba,e))},t.prototype.desaturate=function(e){return e===void 0&&(e=.1),er(Ku(this.rgba,-e))},t.prototype.grayscale=function(){return er(Ku(this.rgba,-1))},t.prototype.lighten=function(e){return e===void 0&&(e=.1),er(im(this.rgba,e))},t.prototype.darken=function(e){return e===void 0&&(e=.1),er(im(this.rgba,-e))},t.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},t.prototype.alpha=function(e){return typeof e=="number"?er({r:(n=this.rgba).r,g:n.g,b:n.b,a:e}):St(this.rgba.a,3);var n},t.prototype.hue=function(e){var n=Ys(this.rgba);return typeof e=="number"?er({h:e,s:n.s,l:n.l,a:n.a}):St(n.h)},t.prototype.isEqual=function(e){return this.toHex()===er(e).toHex()},t}(),er=function(t){return t instanceof df?t:new df(t)},sm=[],IA=function(t){t.forEach(function(e){sm.indexOf(e)<0&&(e(df,uf),sm.push(e))})};function $A(t,e){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var o in n)r[n[o]]=o;var i={};t.prototype.toName=function(s){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var l,a,c=r[this.toHex()];if(c)return c;if(s!=null&&s.closest){var u=this.toRgb(),d=1/0,f="black";if(!i.length)for(var p in n)i[p]=new t(n[p]).toRgb();for(var g in n){var b=(l=u,a=i[g],Math.pow(l.r-a.r,2)+Math.pow(l.g-a.g,2)+Math.pow(l.b-a.b,2));b<d&&(d=b,f=g)}return f}},e.string.push([function(s){var l=s.toLowerCase(),a=l==="transparent"?"#0000":n[l];return a?new t(a).toRgb():null},"name"])}function tu(){return(tu=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function Cv(t,e){if(t==null)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)e.indexOf(n=i[r])>=0||(o[n]=t[n]);return o}function ff(t){var e=m.useRef(t),n=m.useRef(function(r){e.current&&e.current(r)});return e.current=t,n.current}var ss=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=1),t>n?n:t<e?e:t},Js=function(t){return"touches"in t},pf=function(t){return t&&t.ownerDocument.defaultView||self},lm=function(t,e,n){var r=t.getBoundingClientRect(),o=Js(e)?function(i,s){for(var l=0;l<i.length;l++)if(i[l].identifier===s)return i[l];return i[0]}(e.touches,n):e;return{left:ss((o.pageX-(r.left+pf(t).pageXOffset))/r.width),top:ss((o.pageY-(r.top+pf(t).pageYOffset))/r.height)}},am=function(t){!Js(t)&&t.preventDefault()},Up=m.memo(function(t){var e=t.onMove,n=t.onKey,r=Cv(t,["onMove","onKey"]),o=m.useRef(null),i=ff(e),s=ff(n),l=m.useRef(null),a=m.useRef(!1),c=m.useMemo(function(){var p=function(v){am(v),(Js(v)?v.touches.length>0:v.buttons>0)&&o.current?i(lm(o.current,v,l.current)):b(!1)},g=function(){return b(!1)};function b(v){var y=a.current,w=pf(o.current),S=v?w.addEventListener:w.removeEventListener;S(y?"touchmove":"mousemove",p),S(y?"touchend":"mouseup",g)}return[function(v){var y=v.nativeEvent,w=o.current;if(w&&(am(y),!function(C,x){return x&&!Js(C)}(y,a.current)&&w)){if(Js(y)){a.current=!0;var S=y.changedTouches||[];S.length&&(l.current=S[0].identifier)}w.focus(),i(lm(w,y,l.current)),b(!0)}},function(v){var y=v.which||v.keyCode;y<37||y>40||(v.preventDefault(),s({left:y===39?.05:y===37?-.05:0,top:y===40?.05:y===38?-.05:0}))},b]},[s,i]),u=c[0],d=c[1],f=c[2];return m.useEffect(function(){return f},[f]),m.createElement("div",tu({},r,{onTouchStart:u,onMouseDown:u,className:"react-colorful__interactive",ref:o,onKeyDown:d,tabIndex:0,role:"slider"}))}),nu=function(t){return t.filter(Boolean).join(" ")},qp=function(t){var e=t.color,n=t.left,r=t.top,o=r===void 0?.5:r,i=nu(["react-colorful__pointer",t.className]);return m.createElement("div",{className:i,style:{top:100*o+"%",left:100*n+"%"}},m.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:e}}))},Bt=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=Math.pow(10,e)),Math.round(n*t)/n},Ev=function(t){var e=t.s,n=t.v,r=t.a,o=(200-e)*n/100;return{h:Bt(t.h),s:Bt(o>0&&o<200?e*n/100/(o<=100?o:200-o)*100:0),l:Bt(o/2),a:Bt(r,2)}},hf=function(t){var e=Ev(t);return"hsl("+e.h+", "+e.s+"%, "+e.l+"%)"},Ju=function(t){var e=Ev(t);return"hsla("+e.h+", "+e.s+"%, "+e.l+"%, "+e.a+")"},HA=function(t){var e=t.h,n=t.s,r=t.v,o=t.a;e=e/360*6,n/=100,r/=100;var i=Math.floor(e),s=r*(1-n),l=r*(1-(e-i)*n),a=r*(1-(1-e+i)*n),c=i%6;return{r:Bt(255*[r,l,s,s,a,r][c]),g:Bt(255*[a,r,r,l,s,s][c]),b:Bt(255*[s,s,a,r,r,l][c]),a:Bt(o,2)}},BA=function(t){var e=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(t);return e?zA({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):{h:0,s:0,v:0,a:1}},zA=function(t){var e=t.r,n=t.g,r=t.b,o=t.a,i=Math.max(e,n,r),s=i-Math.min(e,n,r),l=s?i===e?(n-r)/s:i===n?2+(r-e)/s:4+(e-n)/s:0;return{h:Bt(60*(l<0?l+6:l)),s:Bt(i?s/i*100:0),v:Bt(i/255*100),a:o}},FA=m.memo(function(t){var e=t.hue,n=t.onChange,r=nu(["react-colorful__hue",t.className]);return m.createElement("div",{className:r},m.createElement(Up,{onMove:function(o){n({h:360*o.left})},onKey:function(o){n({h:ss(e+360*o.left,0,360)})},"aria-label":"Hue","aria-valuenow":Bt(e),"aria-valuemax":"360","aria-valuemin":"0"},m.createElement(qp,{className:"react-colorful__hue-pointer",left:e/360,color:hf({h:e,s:100,v:100,a:1})})))}),WA=m.memo(function(t){var e=t.hsva,n=t.onChange,r={backgroundColor:hf({h:e.h,s:100,v:100,a:1})};return m.createElement("div",{className:"react-colorful__saturation",style:r},m.createElement(Up,{onMove:function(o){n({s:100*o.left,v:100-100*o.top})},onKey:function(o){n({s:ss(e.s+100*o.left,0,100),v:ss(e.v-100*o.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Bt(e.s)+"%, Brightness "+Bt(e.v)+"%"},m.createElement(qp,{className:"react-colorful__saturation-pointer",top:1-e.v/100,left:e.s/100,color:hf(e)})))}),UA=function(t,e){if(t===e)return!0;for(var n in t)if(t[n]!==e[n])return!1;return!0},qA=function(t,e){return t.replace(/\s/g,"")===e.replace(/\s/g,"")};function GA(t,e,n){var r=ff(n),o=m.useState(function(){return t.toHsva(e)}),i=o[0],s=o[1],l=m.useRef({color:e,hsva:i});m.useEffect(function(){if(!t.equal(e,l.current.color)){var c=t.toHsva(e);l.current={hsva:c,color:e},s(c)}},[e,t]),m.useEffect(function(){var c;UA(i,l.current.hsva)||t.equal(c=t.fromHsva(i),l.current.color)||(l.current={hsva:i,color:c},r(c))},[i,t,r]);var a=m.useCallback(function(c){s(function(u){return Object.assign({},u,c)})},[]);return[i,a]}var KA=typeof window<"u"?m.useLayoutEffect:m.useEffect,YA=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},cm=new Map,JA=function(t){KA(function(){var e=t.current?t.current.ownerDocument:document;if(e!==void 0&&!cm.has(e)){var n=e.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,cm.set(e,n);var r=YA();r&&n.setAttribute("nonce",r),e.head.appendChild(n)}},[])},ZA=function(t){var e=t.className,n=t.hsva,r=t.onChange,o={backgroundImage:"linear-gradient(90deg, "+Ju(Object.assign({},n,{a:0}))+", "+Ju(Object.assign({},n,{a:1}))+")"},i=nu(["react-colorful__alpha",e]),s=Bt(100*n.a);return m.createElement("div",{className:i},m.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),m.createElement(Up,{onMove:function(l){r({a:l.left})},onKey:function(l){r({a:ss(n.a+l.left)})},"aria-label":"Alpha","aria-valuetext":s+"%","aria-valuenow":s,"aria-valuemin":"0","aria-valuemax":"100"},m.createElement(qp,{className:"react-colorful__alpha-pointer",left:n.a,color:Ju(n)})))},XA=function(t){var e=t.className,n=t.colorModel,r=t.color,o=r===void 0?n.defaultColor:r,i=t.onChange,s=Cv(t,["className","colorModel","color","onChange"]),l=m.useRef(null);JA(l);var a=GA(n,o,i),c=a[0],u=a[1],d=nu(["react-colorful",e]);return m.createElement("div",tu({},s,{ref:l,className:d}),m.createElement(WA,{hsva:c,onChange:u}),m.createElement(FA,{hue:c.h,onChange:u}),m.createElement(ZA,{hsva:c,onChange:u,className:"react-colorful__last-control"}))},QA={defaultColor:"rgba(0, 0, 0, 1)",toHsva:BA,fromHsva:function(t){var e=HA(t);return"rgba("+e.r+", "+e.g+", "+e.b+", "+e.a+")"},equal:qA},eM=function(t){return m.createElement(XA,tu({},t,{colorModel:QA}))};const um=t=>jl(t)?t:"",tM=(t={})=>B("w-full placeholder:italic",he.bgTr,Cb.inputText,t.disabled&&he.txtLowEmphasis),nM="gs-input-field",Gp=m.forwardRef(function(e,n){const{className:r,value:o,label:i,size:s="m",type:l,placeholder:a,required:c,disabled:u,readOnly:d,description:f,name:p,style:g,tip:b,onInput:v,onChange:y,onBlur:w}=e,[S,C]=m.useState(um(o)),x=tM(e),E=m.useRef(null);m.useImperativeHandle(n,()=>E.current,[]),m.useEffect(()=>{C(um(o))},[o]);const _=(N,P)=>{y==null||y(N,P)},M=N=>{const{key:P}=N;switch(P){case"Escape":return C(o);case"Enter":return _(S)}},k=()=>{_(S),w==null||w()},j=N=>{const P=N.target.value;C(P),v==null||v(P)};return h.jsxs("div",{className:B(nM,r),style:g,ref:E,children:[!!i&&h.jsx(gn,{size:s,children:i}),!!f&&h.jsx(gn,{size:s,tip:b,as:"span",className:B(he.txtLowEmphasis),capitalize:!1,children:f}),h.jsx(fe,{className:B(he.bg,we.b,we.rnd,he.br,s==="m"&&dr.xy,s==="s"&&"gjs-px-3 gjs-py-1"),items:"center",space:"x2s",children:h.jsx(U,{grow:!0,children:h.jsx("input",{className:x,name:p,value:S,onChange:j,placeholder:a,required:c,onBlur:k,onKeyDown:M,readOnly:d,disabled:u,type:l})})})]})});IA([$A]);const rM="gs-cmp-color-picker",oM={backgroundSize:"10px"},iM=[0,15],sM=t=>t.startsWith("rgba")?t:er(t).toRgbString();function Ov({className:t,value:e,onChange:n}){const r=sM(e||""),[o,i]=m.useState(!1),s=Zf()&&!!window.EyeDropper,l=tt(`${rM}-handler gs-utl-bg-checker gs-utl-overflow-hidden gs-utl-cursor-pointer`,t,we.b,we.rnd,he.br),a=p=>{n==null||n(p,!0)},c=()=>{s&&new window.EyeDropper().open().then(g=>a(g.sRGBHex))},u=()=>{i(!0)},d=()=>{n==null||n(r,!1),i(!1)},f=h.jsxs("div",{style:oM,className:l,children:[o&&h.jsx("div",{onPointerUp:d,className:tt("gs-utl-fixed gs-utl-inset-0 gs-utl-z-50 gs-utl-cursor-grabbing")}),h.jsx("div",{className:tt("gs-utl-w-4 gs-utl-h-4"),style:{backgroundColor:e}})]});return h.jsxs(hv,{handler:f,title:"Color",size:"s",placement:"left-end",offset:iM,clickAway:!0,children:[h.jsx(eM,{className:"color-picker",color:r,onChange:a,onPointerDown:u,onPointerUp:d}),h.jsxs(fe,{className:tt("gs-utl-mt-3"),space:"s",children:[h.jsx(U,{grow:!0,children:h.jsx(Gp,{size:"s",value:r,onChange:a})}),s&&h.jsx(Cs,{type:"button",onClick:c,children:h.jsx(ge,{icon:_e.eyedropperVariant,size:We.s})})]})]})}const dm=t=>jl(t)?t:"",lM="gs-cmp-color-field";function di({className:t,value:e,label:n,size:r="m",placeholder:o,preventSubmitOnEnter:i=!1,onChange:s}){const[l,a]=m.useState(dm(e));m.useEffect(()=>{a(dm(e))},[e]);const c=(f,p)=>{s==null||s(f,p)},u=f=>{switch(f.key){case"Escape":return a(e);case"Enter":c(l),i&&(f.preventDefault(),f.stopPropagation())}},d=()=>{c(l)};return h.jsxs("div",{className:B(lM,t),children:[!!n&&h.jsx(gn,{size:r,children:n}),h.jsxs(fe,{className:B(he.bg,he.br,we.b,we.rnd,r==="m"&&dr.xy,r==="s"&&"gjs-px-3 gjs-py-1"),items:"center",space:"s",children:[h.jsx(U,{children:h.jsx(Ov,{value:e,onChange:s})}),h.jsx(U,{grow:!0,children:h.jsx("input",{className:B("w-full focus:gs-utl-outline-none",he.bgTr),value:l,onChange:f=>a(f.target.value),placeholder:o,onBlur:d,onKeyDown:u})})]})]})}const _v=({value:t,step:e})=>{const n=parseFloat(`${t}`);let r=0;if(Math.floor(n)!==n&&e){const o=`${e}`.split(".")[1];r=(o==null?void 0:o.length)||0}return r?parseFloat(n.toFixed(r)):n},aM=({value:t,key:e,shiftKey:n,min:r,max:o,step:i=1})=>{const s=e==="ArrowUp",l=e==="ArrowDown";let a=null;if(s||l){a=Number(t);const c=parseFloat(`${i}`);s&&(a+=(n?10:1)*c),l&&(a-=(n?10:1)*c),a=`${ru({min:r,max:o,value:a})}`,a=_v({value:a,step:i})}return a},ru=({min:t,max:e,value:n})=>{const r=parseFloat(`${n}`);let o=r||0;return Wa(t)&&(o=Math.max(o,parseFloat(`${t}`)||0)),Wa(e)&&(o=Math.min(o,parseFloat(`${e}`)||0)),`${`${r}`!=`${n}`?n:o}`},cM=(t,e,n,r={})=>{const o=parseInt(`${t}`,10)||0,{min:i,max:s,step:l=1}=r;let a=o;const c=d=>{const f=d.clientY-e,p=o-f*parseFloat(`${l}`);a=_v({value:ru({min:i,max:s,value:p}),step:l}),n(a,!0)},u=()=>{window.removeEventListener("mousemove",c),window.removeEventListener("mouseup",u),n(a)};window.addEventListener("mousemove",c),window.addEventListener("mouseup",u)},uM=(t,e,n={})=>{const{partial:r}=n,o=(i,s)=>i===s||r&&i.startsWith(s);return e.some(i=>o(typeof i=="string"?i:i.id,t))},fm=t=>jl(t)?t:"",dM="gs-cmp-number-field";function Me({className:t,value:e,units:n,valueUnit:r,label:o,size:i="m",pan:s=!0,min:l,max:a,step:c,tip:u,placeholder:d,onChange:f,onChangeUnit:p}){const[g,b]=m.useState(fm(e)),[v,y]=m.useState(!1),w=(n==null?void 0:n.map(M=>({id:M,label:M})))||[],S={min:l,max:a,step:c};m.useEffect(()=>{b(fm(e))},[e,r]);const C=(M,k)=>{f==null||f(ru({min:l,max:a,value:M}),k)},x=M=>{y(!0);const k=(j,N)=>{C(j,!!N),!N&&y(!1)};cM(g,M.clientY,k,S)},E=M=>{const{key:k,shiftKey:j}=M;switch(k){case"Escape":return b(e);case"Enter":return C(g)}const N=aM({step:c,value:e,key:k,shiftKey:j});N!==null&&(M.preventDefault(),C(N))},_=()=>{C(g)};return h.jsxs("div",{className:B(dM,t),children:[v&&h.jsx("div",{className:B("fixed inset-0 z-50 cursor-ns")}),!!o&&h.jsx(gn,{size:i,tip:u,children:o}),h.jsxs(fe,{className:B(he.bg,he.br,we.b,we.rnd,i==="m"&&dr.xy,i==="s"&&"gjs-px-3 gjs-py-1"),items:"center",space:"x2s",children:[!!s&&h.jsx(U,{onMouseDown:x,className:B("opacity-50 cursor-ns",i==="m"&&"-gjs-ml-3",i==="s"&&"-gjs-ml-2",s!==!0&&"gjs-mr-0.5 -gjs-ml-1"),children:s===!0?h.jsx(ge,{icon:_e.panVertical,size:We.s2x}):s}),h.jsx(U,{grow:!0,children:h.jsx("input",{className:B("w-full",he.bgTr,Cb.inputText),value:g,onChange:M=>b(M.target.value),placeholder:d,onBlur:_,onKeyDown:E})}),!!w.length&&h.jsx(U,{className:B(w.length===1&&"opacity-50 pointer-events-none"),children:h.jsx(Je,{caret:"",size:"x2s",pos:"right",width:"75px",emptyState:"-",border:!1,value:r,onChange:M=>p==null?void 0:p(M),options:w})})]})]})}function fM(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return m.useMemo(()=>r=>{e.forEach(o=>o(r))},e)}const ou=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function xs(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function Kp(t){return"nodeType"in t}function jo(t){var e,n;return t?xs(t)?t:Kp(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function Yp(t){const{Document:e}=jo(t);return t instanceof e}function ws(t){return xs(t)?!1:t instanceof jo(t).HTMLElement}function kv(t){return t instanceof jo(t).SVGElement}function Ss(t){return t?xs(t)?t.document:Kp(t)?Yp(t)?t:ws(t)||kv(t)?t.ownerDocument:document:document:document}const fi=ou?m.useLayoutEffect:m.useEffect;function pM(t){const e=m.useRef(t);return fi(()=>{e.current=t}),m.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return e.current==null?void 0:e.current(...r)},[])}function hM(){const t=m.useRef(null),e=m.useCallback((r,o)=>{t.current=setInterval(r,o)},[]),n=m.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function Vl(t,e){const n=m.useRef();return m.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function Jp(t){const e=pM(t),n=m.useRef(null),r=m.useCallback(o=>{o!==n.current&&(e==null||e(o,n.current)),n.current=o},[]);return[n,r]}let Zu={};function Il(t,e){return m.useMemo(()=>{if(e)return e;const n=Zu[t]==null?0:Zu[t]+1;return Zu[t]=n,t+"-"+n},[t,e])}function Tv(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((i,s)=>{const l=Object.entries(s);for(const[a,c]of l){const u=i[a];u!=null&&(i[a]=u+t*c)}return i},{...e})}}const hl=Tv(1),Av=Tv(-1);function gM(t){return"clientX"in t&&"clientY"in t}function mM(t){if(!t)return!1;const{KeyboardEvent:e}=jo(t.target);return e&&t instanceof e}function bM(t){if(!t)return!1;const{TouchEvent:e}=jo(t.target);return e&&t instanceof e}function gf(t){if(bM(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return gM(t)?{x:t.clientX,y:t.clientY}:null}const gl=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:n}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:n}=t;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(t){if(t)return[gl.Translate.toString(t),gl.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),vM={display:"none"};function yM(t){let{id:e,value:n}=t;return m.createElement("div",{id:e,style:vM},n)}function xM(t){let{id:e,announcement:n,ariaLiveType:r="assertive"}=t;const o={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return m.createElement("div",{id:e,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function wM(){const[t,e]=m.useState("");return{announce:m.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const SM={draggable:`
|
|
288
|
+
To pick up a draggable item, press the space bar.
|
|
289
|
+
While dragging, use the arrow keys to move the item.
|
|
290
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
291
|
+
`},CM={onDragStart(t){return`Picked up draggable item ${t}.`},onDragOver(t,e){return e?`Draggable item ${t} was moved over droppable area ${e}.`:`Draggable item ${t} is no longer over a droppable area.`},onDragEnd(t,e){return e?`Draggable item ${t} was dropped over droppable area ${e}`:`Draggable item ${t} was dropped.`},onDragCancel(t){return`Dragging was cancelled. Draggable item ${t} was dropped.`}};var Ke;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(Ke||(Ke={}));function Xu(...t){}class Zs extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(({disabled:e})=>!e)}getNodeFor(e){var n,r;return(n=(r=this.get(e))==null?void 0:r.node.current)!=null?n:void 0}}const iu=m.createContext({activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,activeNodeClientRect:null,activators:[],ariaDescribedById:{draggable:""},containerNodeRect:null,dispatch:Xu,draggableNodes:{},droppableRects:new Map,droppableContainers:new Zs,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Xu},scrollableAncestors:[],scrollableAncestorRects:[],recomputeLayouts:Xu,windowRect:null,willRecomputeLayouts:!1});function EM(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:{},translate:{x:0,y:0}},droppable:{containers:new Zs}}}function OM(t,e){switch(e.type){case Ke.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case Ke.DragMove:return t.draggable.active?{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}}:t;case Ke.DragEnd:case Ke.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Ke.RegisterDroppable:{const{element:n}=e,{id:r}=n,o=new Zs(t.droppable.containers);return o.set(r,n),{...t,droppable:{...t.droppable,containers:o}}}case Ke.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=e,i=t.droppable.containers.get(n);if(!i||r!==i.key)return t;const s=new Zs(t.droppable.containers);return s.set(n,{...i,disabled:o}),{...t,droppable:{...t.droppable,containers:s}}}case Ke.UnregisterDroppable:{const{id:n,key:r}=e,o=t.droppable.containers.get(n);if(!o||r!==o.key)return t;const i=new Zs(t.droppable.containers);return i.delete(n),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}const Mv=m.createContext({type:null,event:null});function _M({onDragStart:t,onDragMove:e,onDragOver:n,onDragEnd:r,onDragCancel:o}){const i=m.useContext(Mv),s=m.useRef(i);m.useEffect(()=>{if(i!==s.current){const{type:l,event:a}=i;switch(l){case Ke.DragStart:t==null||t(a);break;case Ke.DragMove:e==null||e(a);break;case Ke.DragOver:n==null||n(a);break;case Ke.DragCancel:o==null||o(a);break;case Ke.DragEnd:r==null||r(a);break}s.current=i}},[i,t,e,n,r,o])}function kM({announcements:t=CM,hiddenTextDescribedById:e,screenReaderInstructions:n}){const{announce:r,announcement:o}=wM(),i=Il("DndLiveRegion"),[s,l]=m.useState(!1);return m.useEffect(()=>{l(!0)},[]),_M(m.useMemo(()=>({onDragStart({active:a}){r(t.onDragStart(a.id))},onDragMove({active:a,over:c}){t.onDragMove&&r(t.onDragMove(a.id,c==null?void 0:c.id))},onDragOver({active:a,over:c}){r(t.onDragOver(a.id,c==null?void 0:c.id))},onDragEnd({active:a,over:c}){r(t.onDragEnd(a.id,c==null?void 0:c.id))},onDragCancel({active:a}){r(t.onDragCancel(a.id))}}),[r,t])),s?ir.createPortal(m.createElement(m.Fragment,null,m.createElement(yM,{id:e,value:n.draggable}),m.createElement(xM,{id:i,announcement:o})),document.body):null}const Wr=Object.freeze({x:0,y:0});function jv(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function pm(t,e=t.offsetLeft,n=t.offsetTop){return{x:e+t.width*.5,y:n+t.height*.5}}const TM=({collisionRect:t,droppableContainers:e})=>{const n=pm(t,t.left,t.top);let r=1/0,o=null;for(const i of e){const{rect:{current:s}}=i;if(s){const l=jv(pm(s),n);l<r&&(r=l,o=i.id)}}return o};function AM(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function MM(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:Wr}function jM(t){return function(n,...r){return r.reduce((o,i)=>({...o,top:o.top+t*i.y,bottom:o.bottom+t*i.y,left:o.left+t*i.x,right:o.right+t*i.x,offsetLeft:o.offsetLeft+t*i.x,offsetTop:o.offsetTop+t*i.y}),{...n})}}const hm=jM(1);function RM(t,e=window.getComputedStyle(t)){return e.position==="fixed"}function NM(t,e=window.getComputedStyle(t)){const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].find(o=>{const i=e[o];return typeof i=="string"?n.test(i):!1})!=null}function Zp(t){const e=[];function n(r){if(!r)return e;if(Yp(r)&&r.scrollingElement!=null&&!e.includes(r.scrollingElement))return e.push(r.scrollingElement),e;if(!ws(r)||kv(r)||e.includes(r))return e;const o=window.getComputedStyle(r);return NM(r,o)&&e.push(r),RM(r,o)?e:n(r.parentNode)}return t?n(t.parentNode):e}function Qu(t){return!ou||!t?null:xs(t)?t:Kp(t)?Yp(t)||t===Ss(t).scrollingElement?window:ws(t)?t:null:null}function mf(t){return xs(t)?{x:t.scrollX,y:t.scrollY}:{x:t.scrollLeft,y:t.scrollTop}}var Vi;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Vi||(Vi={}));function Rv(t){const e={x:0,y:0},n={x:t.scrollWidth-t.clientWidth,y:t.scrollHeight-t.clientHeight},r=t.scrollTop<=e.y,o=t.scrollLeft<=e.x,i=t.scrollTop>=n.y,s=t.scrollLeft>=n.x;return{isTop:r,isLeft:o,isBottom:i,isRight:s,maxScroll:n,minScroll:e}}function PM(t){return!ou||!t?!1:t===document.scrollingElement}const DM={x:.2,y:.2};function LM(t,e,{top:n,left:r,right:o,bottom:i},s=10,l=DM){const{clientHeight:a,clientWidth:c}=t,u=PM(t)?{top:0,left:0,right:c,bottom:a,width:c,height:a}:e,{isTop:d,isBottom:f,isLeft:p,isRight:g}=Rv(t),b={x:0,y:0},v={x:0,y:0},y={height:u.height*l.y,width:u.width*l.x};return!d&&n<=u.top+y.height?(b.y=Vi.Backward,v.y=s*Math.abs((u.top+y.height-n)/y.height)):!f&&i>=u.bottom-y.height&&(b.y=Vi.Forward,v.y=s*Math.abs((u.bottom-y.height-i)/y.height)),!g&&o>=u.right-y.width?(b.x=Vi.Forward,v.x=s*Math.abs((u.right-y.width-o)/y.width)):!p&&r<=u.left+y.width&&(b.x=Vi.Backward,v.x=s*Math.abs((u.left+y.width-r)/y.width)),{direction:b,speed:v}}function VM(t){if(t===document.scrollingElement){const{innerWidth:i,innerHeight:s}=window;return{top:0,left:0,right:i,bottom:s,width:i,height:s}}const{top:e,left:n,right:r,bottom:o}=t.getBoundingClientRect();return{top:e,left:n,right:r,bottom:o,width:t.clientWidth,height:t.clientHeight}}function Nv(t){return t.reduce((e,n)=>hl(e,mf(n)),Wr)}function Pv(t,e,n=Wr){if(!t||!ws(t))return n;const r={x:n.x+t.offsetLeft,y:n.y+t.offsetTop};return t.offsetParent===e?r:Pv(t.offsetParent,e,r)}function su(t){const{offsetWidth:e,offsetHeight:n}=t,{x:r,y:o}=Pv(t,null);return{width:e,height:n,offsetTop:o,offsetLeft:r}}function lu(t){if(xs(t)){const c=window.innerWidth,u=window.innerHeight;return{top:0,left:0,right:c,bottom:u,width:c,height:u,offsetTop:0,offsetLeft:0}}const{offsetTop:e,offsetLeft:n}=su(t),{width:r,height:o,top:i,bottom:s,left:l,right:a}=t.getBoundingClientRect();return{width:r,height:o,top:i,bottom:s,right:a,left:l,offsetTop:e,offsetLeft:n}}function bf(t){const{width:e,height:n,offsetTop:r,offsetLeft:o}=su(t),i=Zp(t),s=Nv(i),l=r-s.y,a=o-s.x;return{width:e,height:n,top:l,bottom:l+n,right:a+e,left:a,offsetTop:r,offsetLeft:o}}function gm(t){return"top"in t}function mm(t,e=t.offsetLeft,n=t.offsetTop){return[{x:e,y:n},{x:e+t.width,y:n},{x:e,y:n+t.height},{x:e+t.width,y:n+t.height}]}const IM=({collisionRect:t,droppableContainers:e})=>{let n=1/0,r=null;const o=mm(t,t.left,t.top);for(const i of e){const{rect:{current:s}}=i;if(s){const l=mm(s,gm(s)?s.left:void 0,gm(s)?s.top:void 0),a=o.reduce((u,d,f)=>u+jv(l[f],d),0),c=Number((a/4).toFixed(4));c<n&&(n=c,r=i.id)}}return r};function $M(t,e){const n=Math.max(e.top,t.offsetTop),r=Math.max(e.left,t.offsetLeft),o=Math.min(e.left+e.width,t.offsetLeft+t.width),i=Math.min(e.top+e.height,t.offsetTop+t.height),s=o-r,l=i-n;if(r<o&&n<i){const a=e.width*e.height,c=t.width*t.height,u=s*l,d=u/(a+c-u);return Number(d.toFixed(4))}return 0}const HM=({collisionRect:t,droppableContainers:e})=>{let n=0,r=null;for(const o of e){const{rect:{current:i}}=o;if(i){const s=$M(i,t);s>n&&(n=s,r=o.id)}}return r};var Xs;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(Xs||(Xs={}));var lc;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(lc||(lc={}));function BM({acceleration:t,activator:e=Xs.Pointer,canScroll:n,draggingRect:r,enabled:o,interval:i=5,order:s=lc.TreeOrder,pointerCoordinates:l,scrollableAncestors:a,scrollableAncestorRects:c,threshold:u}){const[d,f]=hM(),p=m.useRef({x:1,y:1}),g=m.useMemo(()=>{switch(e){case Xs.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Xs.DraggableRect:return r}return null},[e,r,l]),b=m.useRef(Wr),v=m.useRef(null),y=m.useCallback(()=>{const S=v.current;if(!S)return;const C=p.current.x*b.current.x,x=p.current.y*b.current.y;S.scrollBy(C,x)},[]),w=m.useMemo(()=>s===lc.TreeOrder?[...a].reverse():a,[s,a]);m.useEffect(()=>{if(!o||!a.length||!g){f();return}for(const S of w){if((n==null?void 0:n(S))===!1)continue;const C=a.indexOf(S),x=c[C];if(!x)continue;const{direction:E,speed:_}=LM(S,x,g,t,u);if(_.x>0||_.y>0){f(),v.current=S,d(y,i),p.current=_,b.current=E;return}}p.current={x:0,y:0},b.current={x:0,y:0},f()},[t,y,n,f,o,i,JSON.stringify(g),d,a,w,c,JSON.stringify(u)])}function zM(t,e){const n=e!==null?t[e]:void 0,r=n?n.node.current:null;return Vl(o=>{var i;return e===null?null:(i=r??o)!=null?i:null},[r,e])}function FM(t,e){return m.useMemo(()=>t.reduce((n,r)=>{const{sensor:o}=r,i=o.activators.map(s=>({eventName:s.eventName,handler:e(s.handler,r)}));return[...n,...i]},[]),[t,e])}function Dv(t){const e=m.useRef(t);return fi(()=>{e.current!==t&&(e.current=t)},[t]),e}var ml;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(ml||(ml={}));var vf;(function(t){t.Optimized="optimized"})(vf||(vf={}));const bm=new Map,WM={measure:su,strategy:ml.WhileDragging,frequency:vf.Optimized};function UM(t,{dragging:e,dependencies:n,config:r}){const[o,i]=m.useState(!1),{frequency:s,measure:l,strategy:a}={...WM,...r},c=m.useRef(t),u=m.useCallback(()=>i(!0),[]),d=m.useRef(null),f=g(),p=Vl(b=>{if(f&&!e)return bm;if(!b||b===bm||c.current!==t||o){for(let v of t)v&&(v.rect.current=v.node.current?l(v.node.current):null);return qM(t)}return b},[t,e,f,l,o]);return m.useEffect(()=>{c.current=t},[t]),m.useEffect(()=>{o&&i(!1)},[o]),m.useEffect(function(){f||requestAnimationFrame(u)},[e,f]),m.useEffect(function(){f||typeof s!="number"||d.current!==null||(d.current=setTimeout(()=>{u(),d.current=null},s))},[s,f,u,...n]),{layoutRectMap:p,recomputeLayouts:u,willRecomputeLayouts:o};function g(){switch(a){case ml.Always:return!1;case ml.BeforeDragging:return e;default:return!e}}}function qM(t){const e=new Map;if(t)for(const n of t){if(!n)continue;const{id:r,rect:o}=n;o.current!=null&&e.set(r,o.current)}return e}function GM(t){const[e,n]=m.useState(null),r=m.useRef(t),o=m.useCallback(i=>{const s=Qu(i.target);s&&n(l=>l?(l.set(s,mf(s)),new Map(l)):null)},[]);return m.useEffect(()=>{const i=r.current;if(t!==i){s(i);const l=t.map(a=>{const c=Qu(a);return c?(c.addEventListener("scroll",o,{passive:!0}),[c,mf(c)]):null}).filter(a=>a!=null);n(l.length?new Map(l):null),r.current=t}return()=>{s(t),s(i)};function s(l){l.forEach(a=>{const c=Qu(a);c==null||c.removeEventListener("scroll",o)})}},[o,t]),m.useMemo(()=>t.length?e?Array.from(e.values()).reduce((i,s)=>hl(i,s),Wr):Nv(t):Wr,[t,e])}const KM=[];function YM(t){const e=m.useRef(t),n=Vl(r=>t?r&&t&&e.current&&t.parentNode===e.current.parentNode?r:Zp(t):KM,[t]);return m.useEffect(()=>{e.current=t},[t]),n}function JM(t){m.useEffect(()=>{if(!ou)return;const e=t.map(({sensor:n})=>n.setup==null?void 0:n.setup());return()=>{for(const n of e)n==null||n()}},t.map(({sensor:e})=>e))}function ZM(t,e){return m.useMemo(()=>t.reduce((n,{eventName:r,handler:o})=>(n[r]=i=>{o(i,e)},n),{}),[t,e])}const ed=Vv(lu),XM=QM(lu);function Lv(t,e,n){const r=m.useRef(t);return Vl(o=>t?n||!o&&t||t!==r.current?ws(t)&&t.parentNode==null?null:e(t):o??null:null,[t,n,e])}function Vv(t){return(e,n)=>Lv(e,t,n)}function QM(t){const e=[];return function(r,o){const i=m.useRef(r);return Vl(s=>r.length?o||!s&&r.length||r!==i.current?r.map(l=>t(l)):s??e:e,[r,o])}}function e3(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return ws(e)?e:t}function t3(t){const{width:e,height:n,offsetLeft:r,offsetTop:o}=su(t);return{top:o,bottom:o+n,left:r,right:r+e,width:e,height:n,offsetTop:o,offsetLeft:r}}const n3=Vv(t3);function r3({disabled:t,forceRecompute:e}){const[n,r]=Jp(),o=n3(t?null:e3(n.current),e);return m.useMemo(()=>({nodeRef:n,rect:o,setRef:r}),[o,n,r])}function vm(t,e){return m.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function o3(...t){return m.useMemo(()=>[...t].filter(e=>e!=null),[...t])}class Qs{constructor(e){this.target=e,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})}}add(e,n,r){var o;(o=this.target)==null||o.addEventListener(e,n,r),this.listeners.push([e,n,r])}}function i3(t){const{EventTarget:e}=jo(t);return t instanceof e?t:Ss(t)}function td(t,e){const n=Math.abs(t.x),r=Math.abs(t.y);return typeof e=="number"?Math.sqrt(n**2+r**2)>e:"x"in e&&"y"in e?n>e.x&&r>e.y:"x"in e?n>e.x:"y"in e?r>e.y:!1}var On;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(On||(On={}));function ym(t){t.preventDefault()}function s3(t){t.stopPropagation()}var Ne;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter"})(Ne||(Ne={}));const Iv={start:[Ne.Space,Ne.Enter],cancel:[Ne.Esc],end:[Ne.Space,Ne.Enter]},l3=(t,{currentCoordinates:e})=>{switch(t.code){case Ne.Right:return{...e,x:e.x+25};case Ne.Left:return{...e,x:e.x-25};case Ne.Down:return{...e,y:e.y+25};case Ne.Up:return{...e,y:e.y-25}}};class Xp{constructor(e){this.props=e,this.autoScrollEnabled=!1,this.coordinates=Wr;const{event:{target:n}}=e;this.props=e,this.listeners=new Qs(Ss(n)),this.windowListeners=new Qs(jo(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(On.Resize,this.handleCancel),this.windowListeners.add(On.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(On.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props;if(!e.node.current)throw new Error("Active draggable node is undefined");const r=lu(e.node.current),o={x:r.left,y:r.top};this.coordinates=o,n(o)}handleKeyDown(e){if(mM(e)){const{coordinates:n}=this,{active:r,context:o,options:i}=this.props,{keyboardCodes:s=Iv,coordinateGetter:l=l3,scrollBehavior:a="smooth"}=i,{code:c}=e;if(s.end.includes(c)){this.handleEnd(e);return}if(s.cancel.includes(c)){this.handleCancel(e);return}const u=l(e,{active:r,context:o.current,currentCoordinates:n});if(u){const d={x:0,y:0},{scrollableAncestors:f}=o.current;for(const p of f){const g=e.code,b=Av(u,n),{isTop:v,isRight:y,isLeft:w,isBottom:S,maxScroll:C,minScroll:x}=Rv(p),E=VM(p),_={x:Math.min(g===Ne.Right?E.right-E.width/2:E.right,Math.max(g===Ne.Right?E.left:E.left+E.width/2,u.x)),y:Math.min(g===Ne.Down?E.bottom-E.height/2:E.bottom,Math.max(g===Ne.Down?E.top:E.top+E.height/2,u.y))},M=g===Ne.Right&&!y||g===Ne.Left&&!w,k=g===Ne.Down&&!S||g===Ne.Up&&!v;if(M&&_.x!==u.x){if(g===Ne.Right&&p.scrollLeft+b.x<=C.x||g===Ne.Left&&p.scrollLeft+b.x>=x.x){p.scrollBy({left:b.x,behavior:a});return}d.x=g===Ne.Right?p.scrollLeft-C.x:p.scrollLeft-x.x,p.scrollBy({left:-d.x,behavior:a});break}else if(k&&_.y!==u.y){if(g===Ne.Down&&p.scrollTop+b.y<=C.y||g===Ne.Up&&p.scrollTop+b.y>=x.y){p.scrollBy({top:b.y,behavior:a});return}d.y=g===Ne.Down?p.scrollTop-C.y:p.scrollTop-x.y,p.scrollBy({top:-d.y,behavior:a});break}}this.handleMove(e,hl(u,d))}}}handleMove(e,n){const{onMove:r}=this.props;e.preventDefault(),r(n),this.coordinates=n}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Xp.activators=[{eventName:"onKeyDown",handler:(t,{keyboardCodes:e=Iv,onActivation:n})=>{const{code:r}=t.nativeEvent;return e.start.includes(r)?(t.preventDefault(),n==null||n({event:t.nativeEvent}),!0):!1}}];function xm(t){return!!(t&&"distance"in t)}function wm(t){return!!(t&&"delay"in t)}class Qp{constructor(e,n,r=i3(e.event.target)){this.props=e,this.events=n,this.autoScrollEnabled=!0,this.activated=!1,this.timeoutId=null;const{event:o}=e,{target:i}=o;this.props=e,this.events=n,this.document=Ss(i),this.documentListeners=new Qs(this.document),this.listeners=new Qs(r),this.windowListeners=new Qs(jo(i)),this.initialCoordinates=gf(o),this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(On.Resize,this.handleCancel),this.windowListeners.add(On.DragStart,ym),this.windowListeners.add(On.VisibilityChange,this.handleCancel),this.windowListeners.add(On.ContextMenu,ym),this.documentListeners.add(On.Keydown,this.handleKeydown),n){if(xm(n))return;if(wm(n)){this.timeoutId=setTimeout(this.handleStart,n.delay);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(On.Click,s3,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(On.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){const{activated:n,initialCoordinates:r,props:o}=this,{onMove:i,options:{activationConstraint:s}}=o;if(!r)return;const l=gf(e),a=Av(r,l);if(!n&&s){if(wm(s))return td(a,s.tolerance)?this.handleCancel():void 0;if(xm(s))return s.tolerance!=null&&td(a,s.tolerance)?this.handleCancel():td(a,s.distance)?this.handleStart():void 0}e.cancelable&&e.preventDefault(),i(l)}handleEnd(){const{onEnd:e}=this.props;this.detach(),e()}handleCancel(){const{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===Ne.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const a3={move:{name:"pointermove"},end:{name:"pointerup"}};class eh extends Qp{constructor(e){const{event:n}=e,r=Ss(n.target);super(e,a3,r)}}eh.activators=[{eventName:"onPointerDown",handler:({nativeEvent:t},{onActivation:e})=>!t.isPrimary||t.button!==0?!1:(e==null||e({event:t}),!0)}];const c3={move:{name:"mousemove"},end:{name:"mouseup"}};var yf;(function(t){t[t.RightClick=2]="RightClick"})(yf||(yf={}));class u3 extends Qp{constructor(e){super(e,c3,Ss(e.event.target))}}u3.activators=[{eventName:"onMouseDown",handler:({nativeEvent:t},{onActivation:e})=>t.button===yf.RightClick?!1:(e==null||e({event:t}),!0)}];const nd={move:{name:"touchmove"},end:{name:"touchend"}};class d3 extends Qp{constructor(e){super(e,nd)}static setup(){return window.addEventListener(nd.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(nd.move.name,e)};function e(){}}}d3.activators=[{eventName:"onTouchStart",handler:({nativeEvent:t},{onActivation:e})=>{const{touches:n}=t;return n.length>1?!1:(e==null||e({event:t}),!0)}}];function f3(t,{transform:e,...n}){return t!=null&&t.length?t.reduce((r,o)=>o({transform:r,...n}),e):e}const p3=[{sensor:eh,options:{}},{sensor:Xp,options:{}}],h3={current:{}},$v=m.createContext({...Wr,scaleX:1,scaleY:1}),g3=m.memo(function({id:e,autoScroll:n=!0,announcements:r,children:o,sensors:i=p3,collisionDetection:s=HM,measuring:l,modifiers:a,screenReaderInstructions:c=SM,...u}){var d,f,p,g,b;const v=m.useReducer(OM,void 0,EM),[y,w]=v,[S,C]=m.useState(()=>({type:null,event:null})),[x,E]=m.useState(!1),{draggable:{active:_,nodes:M,translate:k},droppable:{containers:j}}=y,N=_?M[_]:null,P=m.useRef({initial:null,translated:null}),z=m.useMemo(()=>{var it;return _!=null?{id:_,data:(it=N==null?void 0:N.data)!=null?it:h3,rect:P}:null},[_,N]),W=m.useRef(null),[F,$]=m.useState(null),[J,ee]=m.useState(null),L=m.useRef(u),I=Il("DndDescribedBy",e),A=m.useMemo(()=>j.getEnabled(),[j]),{layoutRectMap:R,recomputeLayouts:q,willRecomputeLayouts:D}=UM(A,{dragging:x,dependencies:[k.x,k.y],config:l==null?void 0:l.droppable}),V=zM(M,_),te=J?gf(J):null,G=Lv(V,(d=l==null||(f=l.draggable)==null?void 0:f.measure)!=null?d:bf),Q=ed(V),se=m.useRef(null),be=se.current,de=m.useRef({active:null,activeNode:V,collisionRect:null,droppableRects:R,draggableNodes:M,draggingNodeRect:null,droppableContainers:j,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null,translatedRect:null}),Pe=j.getNodeFor((p=de.current.over)==null?void 0:p.id),X=ed(V?V.ownerDocument.defaultView:null),qe=ed(V?V.parentElement:null),Qe=YM(_?Pe??V:null),at=XM(Qe),xt=r3({disabled:_==null,forceRecompute:D}),wt=(g=xt.rect)!=null?g:G,rn=wt===G?MM(G,be):Wr,Le=f3(a,{transform:{x:k.x-rn.x,y:k.y-rn.y,scaleX:1,scaleY:1},activatorEvent:J,active:z,activeNodeRect:Q,containerNodeRect:qe,draggingNodeRect:wt,over:de.current.over,overlayNodeRect:xt.rect,scrollableAncestors:Qe,scrollableAncestorRects:at,windowRect:X}),ot=te?hl(te,k):null,T=GM(Qe),re=hl(Le,T),ie=wt?hm(wt,Le):null,Ce=ie?hm(ie,T):null,Xe=z&&Ce?s({active:z,collisionRect:Ce,droppableContainers:A}):null,[Te,me]=m.useState(null),on=AM(Le,(b=Te==null?void 0:Te.rect)!=null?b:null,G),yn=m.useCallback((it,{sensor:et,options:Rt})=>{if(!W.current)return;const wn=M[W.current];if(!wn)return;const qt=new et({active:W.current,activeNode:wn,event:it.nativeEvent,options:Rt,context:de,onStart(Vt){const Sn=W.current;if(!Sn)return;const Er=M[Sn];if(!Er)return;const{onDragStart:Kr}=L.current,Yr={active:{id:Sn,data:Er.data,rect:P}};ir.unstable_batchedUpdates(()=>{w({type:Ke.DragStart,initialCoordinates:Vt,active:Sn}),C({type:Ke.DragStart,event:Yr})}),Kr==null||Kr(Yr)},onMove(Vt){w({type:Ke.DragMove,coordinates:Vt})},onEnd:Cr(Ke.DragEnd),onCancel:Cr(Ke.DragCancel)});ir.unstable_batchedUpdates(()=>{$(qt),ee(it.nativeEvent)});function Cr(Vt){return async function(){const{active:Er,over:Kr,scrollAdjustedTranslate:Yr}=de.current;let Jr=null;if(Er&&Yr){const{cancelDrop:Po}=L.current;Jr={active:Er,delta:Yr,over:Kr},Vt===Ke.DragEnd&&typeof Po=="function"&&await Promise.resolve(Po(Jr))&&(Vt=Ke.DragCancel)}if(W.current=null,ir.unstable_batchedUpdates(()=>{w({type:Vt}),me(null),E(!1),$(null),ee(null),Jr&&C({type:Vt,event:Jr})}),Jr){const{onDragCancel:Po,onDragEnd:Gl}=L.current,_s=Vt===Ke.DragEnd?Gl:Po;_s==null||_s(Jr)}}}},[w,M]),ft=m.useCallback((it,et)=>(Rt,wn)=>{const qt=Rt.nativeEvent;W.current!==null||qt.dndKit||qt.defaultPrevented||it(Rt,et.options)===!0&&(qt.dndKit={capturedBy:et.sensor},W.current=wn,yn(Rt,et))},[yn]),Ut=FM(i,ft);JM(i),fi(()=>{L.current=u},Object.values(u)),m.useEffect(()=>{_!=null&&E(!0)},[_]),m.useEffect(()=>{z||(se.current=null),z&&G&&!se.current&&(se.current=G)},[G,z]),m.useEffect(()=>{const{onDragMove:it}=L.current,{active:et,over:Rt}=de.current;if(!et)return;const wn={active:et,delta:{x:re.x,y:re.y},over:Rt};C({type:Ke.DragMove,event:wn}),it==null||it(wn)},[re.x,re.y]),m.useEffect(()=>{const{active:it,droppableContainers:et,scrollAdjustedTranslate:Rt}=de.current;if(!it||!W.current||!Rt)return;const{onDragOver:wn}=L.current,qt=et.get(Xe),Cr=qt&&qt.rect.current?{id:qt.id,rect:qt.rect.current,data:qt.data,disabled:qt.disabled}:null,Vt={active:it,delta:{x:Rt.x,y:Rt.y},over:Cr};ir.unstable_batchedUpdates(()=>{me(Cr),C({type:Ke.DragOver,event:Vt}),wn==null||wn(Vt)})},[Xe]),fi(()=>{de.current={active:z,activeNode:V,collisionRect:Ce,droppableRects:R,draggableNodes:M,draggingNodeRect:wt,droppableContainers:j,over:Te,scrollableAncestors:Qe,scrollAdjustedTranslate:re,translatedRect:ie},P.current={initial:wt,translated:ie}},[z,V,Ce,M,wt,R,j,Te,Qe,re,ie]),BM({...xn(),draggingRect:ie,pointerCoordinates:ot,scrollableAncestors:Qe,scrollableAncestorRects:at});const Sr=m.useMemo(()=>({active:z,activeNode:V,activeNodeRect:G,activeNodeClientRect:Q,activatorEvent:J,activators:Ut,ariaDescribedById:{draggable:I},containerNodeRect:qe,dispatch:w,dragOverlay:xt,draggableNodes:M,droppableContainers:j,droppableRects:R,over:Te,recomputeLayouts:q,scrollableAncestors:Qe,scrollableAncestorRects:at,willRecomputeLayouts:D,windowRect:X}),[z,V,Q,G,J,Ut,qe,xt,w,M,I,j,R,Te,q,Qe,at,D,X]);return m.createElement(Mv.Provider,{value:S},m.createElement(iu.Provider,{value:Sr},m.createElement($v.Provider,{value:on},o)),m.createElement(kM,{announcements:r,hiddenTextDescribedById:I,screenReaderInstructions:c}));function xn(){const it=(F==null?void 0:F.autoScrollEnabled)===!1,et=typeof n=="object"?n.enabled===!1:n===!1,Rt=!it&&!et;return typeof n=="object"?{...n,enabled:Rt}:{enabled:Rt}}}),m3=m.createContext(null),Sm="button",b3="Droppable";function v3({id:t,data:e,disabled:n=!1,attributes:r}){const o=Il(b3),{active:i,activeNodeRect:s,activatorEvent:l,ariaDescribedById:a,draggableNodes:c,droppableRects:u,activators:d,over:f}=m.useContext(iu),{role:p=Sm,roleDescription:g="draggable",tabIndex:b=0}=r??{},v=(i==null?void 0:i.id)===t,y=m.useContext(v?$v:m3),[w,S]=Jp(),C=ZM(d,t),x=Dv(e);m.useEffect(()=>(c[t]={id:t,key:o,node:w,data:x},()=>{const _=c[t];_&&_.key===o&&delete c[t]}),[c,t]);const E=m.useMemo(()=>({role:p,tabIndex:b,"aria-pressed":v&&p===Sm?!0:void 0,"aria-roledescription":g,"aria-describedby":a.draggable}),[p,b,v,g,a.draggable]);return{active:i,activeNodeRect:s,activatorEvent:l,attributes:E,droppableRects:u,isDragging:v,listeners:n?void 0:C,node:w,over:f,setNodeRef:S,transform:y}}function y3(){return m.useContext(iu)}const x3="Droppable";function w3({data:t,disabled:e=!1,id:n}){const r=Il(x3),{active:o,dispatch:i,over:s}=m.useContext(iu),l=m.useRef(null),[a,c]=Jp(),u=Dv(t);return fi(()=>(i({type:Ke.RegisterDroppable,element:{id:n,key:r,disabled:e,node:a,rect:l,data:u}}),()=>i({type:Ke.UnregisterDroppable,key:r,id:n})),[n]),m.useEffect(()=>{i({type:Ke.SetDroppableDisabled,id:n,key:r,disabled:e})},[e]),{active:o,rect:l,isOver:(s==null?void 0:s.id)===n,node:a,over:s,setNodeRef:c}}function S3(t,e,n){const r={...t};return e.top+t.y<=n.top?r.y=n.top-e.top:e.bottom+t.y>=n.top+n.height&&(r.y=n.top+n.height-e.bottom),e.left+t.x<=n.left?r.x=n.left-e.left:e.right+t.x>=n.left+n.width&&(r.x=n.left+n.width-e.right),r}const C3=({draggingNodeRect:t,transform:e,scrollableAncestorRects:n})=>{const r=n[0];return!t||!r?e:S3(e,t,r)},E3=({transform:t})=>({...t,x:0});function Hv(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function O3(t,e){return t.reduce((n,r,o)=>{const i=e.get(r);return i&&(n[o]=i),n},Array(t.length))}function la(t){return t!==null&&t>=0}const Bv=({layoutRects:t,activeIndex:e,overIndex:n,index:r})=>{const o=Hv(t,n,e),i=t[r],s=o[r];return!s||!i?null:{x:s.offsetLeft-i.offsetLeft,y:s.offsetTop-i.offsetTop,scaleX:s.width/i.width,scaleY:s.height/i.height}},aa={scaleX:1,scaleY:1},_3=({activeIndex:t,activeNodeRect:e,index:n,layoutRects:r,overIndex:o})=>{var i;const s=(i=r[t])!=null?i:e;if(!s)return null;if(n===t){const a=r[o];return a?{x:0,y:t<o?a.offsetTop+a.height-(s.offsetTop+s.height):a.offsetTop-s.offsetTop,...aa}:null}const l=k3(r,n,t);return n>t&&n<=o?{x:0,y:-s.height-l,...aa}:n<t&&n>=o?{x:0,y:s.height+l,...aa}:{x:0,y:0,...aa}};function k3(t,e,n){const r=t[e],o=t[e-1],i=t[e+1];return r?n<e?o?r.offsetTop-(o.offsetTop+o.height):i?i.offsetTop-(r.offsetTop+r.height):0:i?i.offsetTop-(r.offsetTop+r.height):o?r.offsetTop-(o.offsetTop+o.height):0:0}const zv="Sortable",Fv=m.createContext({activeIndex:-1,containerId:zv,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Bv,wasDragging:{current:!1}});function T3({children:t,id:e,items:n,strategy:r=Bv}){const{active:o,dragOverlay:i,droppableRects:s,over:l,recomputeLayouts:a,willRecomputeLayouts:c}=y3(),u=Il(zv,e),d=i.rect!==null,f=m.useMemo(()=>n.map(_=>typeof _=="string"?_:_.id),[n]),p=o!=null,g=m.useRef(!1),b=o?f.indexOf(o.id):-1,v=b!==-1,y=l?f.indexOf(l.id):-1,w=m.useRef(f),S=O3(f,s),C=!A3(f,w.current),x=y!==-1&&b===-1||C;fi(()=>{C&&v&&!c&&a()},[C,v,a,c]),m.useEffect(()=>{w.current=f},[f]),m.useEffect(()=>{const _=setTimeout(()=>{g.current=p},100);return()=>clearTimeout(_)},[p]);const E=m.useMemo(()=>({activeIndex:b,containerId:u,disableTransforms:x,items:f,overIndex:y,useDragOverlay:d,sortedRects:S,strategy:r,wasDragging:g}),[b,u,x,f,y,S,d,r,g]);return m.createElement(Fv.Provider,{value:E},t)}function A3(t,e){return t.join()===e.join()}const M3=({id:t,items:e,activeIndex:n,overIndex:r})=>Hv(e,n,r).indexOf(t),j3=({containerId:t,isSorting:e,wasDragging:n,index:r,items:o,newIndex:i,previousItems:s,previousContainerId:l,transition:a})=>!a||!n||s!==o&&r===i?!1:e?!0:i!==r&&t===l,R3={duration:200,easing:"ease"},Wv="transform",N3=gl.Transition.toString({property:Wv,duration:0,easing:"linear"}),P3={roleDescription:"sortable"};function D3({disabled:t,index:e,node:n,rect:r}){const[o,i]=m.useState(null),s=m.useRef(e);return fi(()=>{if(!t&&e!==s.current&&n.current){const l=r.current;if(l){const a=lu(n.current),c={x:l.offsetLeft-a.offsetLeft,y:l.offsetTop-a.offsetTop,scaleX:l.width/a.width,scaleY:l.height/a.height};(c.x||c.y)&&i(c)}}e!==s.current&&(s.current=e)},[t,e,n,r]),m.useEffect(()=>{o&&requestAnimationFrame(()=>{i(null)})},[o]),o}function L3({animateLayoutChanges:t=j3,attributes:e,disabled:n,data:r,getNewIndex:o=M3,id:i,strategy:s,transition:l=R3}){const{items:a,containerId:c,activeIndex:u,disableTransforms:d,sortedRects:f,overIndex:p,useDragOverlay:g,strategy:b,wasDragging:v}=m.useContext(Fv),y=a.indexOf(i),w=m.useMemo(()=>({sortable:{containerId:c,index:y,items:a},...r}),[c,r,y,a]),{rect:S,node:C,setNodeRef:x}=w3({id:i,data:w}),{active:E,activeNodeRect:_,activatorEvent:M,attributes:k,setNodeRef:j,listeners:N,isDragging:P,over:z,transform:W}=v3({id:i,data:w,attributes:{...P3,...e},disabled:n}),F=fM(x,j),$=!!E,J=$&&v.current&&!d&&la(u)&&la(p),ee=!g&&P,L=ee&&J?W:null,A=J?L??(s??b)({layoutRects:f,activeNodeRect:_,activeIndex:u,overIndex:p,index:y}):null,R=la(u)&&la(p)?o({id:i,items:a,activeIndex:u,overIndex:p}):y,q=m.useRef(a),D=a!==q.current,V=m.useRef(R),te=m.useRef(c),G=t({active:E,containerId:c,isDragging:P,isSorting:$,id:i,index:y,items:a,newIndex:V.current,previousItems:q.current,previousContainerId:te.current,transition:l,wasDragging:v.current}),Q=D3({disabled:!G,index:y,node:C,rect:S});return m.useEffect(()=>{$&&V.current!==R&&(V.current=R),c!==te.current&&(te.current=c),a!==q.current&&(q.current=a)},[$,R,c,a]),{active:E,attributes:k,activatorEvent:M,rect:S,index:y,isSorting:$,isDragging:P,listeners:N,node:C,overIndex:p,over:z,setNodeRef:F,setDroppableNodeRef:x,setDraggableNodeRef:j,transform:Q??A,transition:se()};function se(){if(Q||D&&V.current===y)return N3;if(!(ee||!l)&&($||G))return gl.Transition.toString({...l,property:Wv})}}const V3=[Ne.Down,Ne.Right,Ne.Up,Ne.Left],I3=(t,{context:{active:e,droppableContainers:n,translatedRect:r,scrollableAncestors:o}})=>{if(V3.includes(t.code)){if(t.preventDefault(),!e||!r)return;const s=[];n.getEnabled().forEach(a=>{if(!a||a!=null&&a.disabled)return;const c=a==null?void 0:a.node.current;if(!c)return;const u=bf(c),d={...a,rect:{current:u}};switch(t.code){case Ne.Down:r.top+r.height<=u.top&&s.push(d);break;case Ne.Up:r.top>=u.top+u.height&&s.push(d);break;case Ne.Left:r.left>=u.left+u.width&&s.push(d);break;case Ne.Right:r.left+r.width<=u.left&&s.push(d);break}});const l=IM({active:e,collisionRect:r,droppableContainers:s});if(l){var i;const a=(i=n.get(l))==null?void 0:i.node.current;if(a){const u=Zp(a).some((g,b)=>o[b]!==g),d=bf(a),f=u?{x:0,y:0}:{x:r.width-d.width,y:r.height-d.height};return{x:d.left-f.x,y:d.top-f.y}}}}};function $3(t){const{id:e,item:n,className:r,select:o,remove:i,renderItem:s,previewStyle:l}=t,{attributes:a,listeners:c,setNodeRef:u,transform:d,transition:f}=L3({id:e}),p={transform:gl.Transform.toString(d),transition:f},g=()=>o==null?void 0:o(n);return h.jsx("div",{ref:u,style:p,...a,children:h.jsxs(fe,{space:"s",onClick:g,className:r,items:"center",nowrap:!0,children:[h.jsx(U,{className:B(So.hover,"cursor-grab"),...c,children:h.jsx(ge,{icon:_e.dotsVertical,size:We.sx})}),h.jsx(U,{grow:!0,className:B("overflow-hidden"),children:h.jsxs(fe,{children:[h.jsx(U,{grow:!0,className:B("overflow-ellipsis overflow-hidden"),children:s(n)}),!!l&&h.jsx(U,{children:h.jsx("div",{className:B("w-4 h-4 gjs-bg-white",we.b,we.rnd),style:l(n)})})]})}),h.jsx(U,{className:B(So.click),onClick:b=>{Dd(b),i==null||i(n)},children:h.jsx(ge,{icon:_e.close,size:We.sx})})]},n.getIndex?n.getIndex():n.id||n.cid)})}const ca=t=>t.cid??t.id;function to({className:t,items:e,selected:n,children:r,title:o,titleAdd:i,label:s,select:l,add:a,move:c,remove:u,renderItem:d,previewStyle:f}){const p=o3(vm(eh),vm(Xp,{coordinateGetter:I3}));function g(v){const{active:y,over:w}=v;if(y.id!==(w==null?void 0:w.id)){const S=e.find(x=>ca(x)===y.id),C=e.findIndex(x=>ca(x)===(w==null?void 0:w.id));S&&(c==null||c(S,C))}}const b=B(we.rnd,he.br,e.length&&we.b,e.length&&"gjs-mt-1");return h.jsxs("div",{className:B(t,"w-full"),children:[!!(s||a)&&h.jsxs(fe,{items:"center",children:[h.jsx(U,{grow:!0,children:h.jsx(gn,{size:"s",children:s})}),!!a&&h.jsx(U,{children:h.jsx(mo,{title:i,inline:!0,children:h.jsx(Cs,{onClick:a,size:"s",children:h.jsx(ge,{icon:_e.plus,size:We.s})})})})]}),h.jsx(hv,{placement:"left",size:"s",buttonAs:"div",title:o,classNameBody:"gs-utl-gap-2 gs-utl-flex gs-utl-flex-col",open:!!n,onClose:()=>l==null?void 0:l(null),handler:h.jsx(g3,{sensors:p,collisionDetection:TM,onDragEnd:g,modifiers:[E3,C3],children:h.jsx(T3,{items:e.map(ca),strategy:_3,children:h.jsx("div",{className:b,children:e.map((v,y)=>{const w=ca(v),S=v===n,C=B("gjs-px-2 gjs-py-2 text-xs",he.br,y&&we.bt,!S&&he.hBgH2,S&&he.bgH);return h.jsx($3,{id:w,item:v,className:C,select:l,remove:u,renderItem:d,previewStyle:f},w)})})})}),children:r})]})}function Uv({children:t,title:e,classNameWrp:n,...r}){return h.jsx(mo,{title:e,classNameWrp:n,children:h.jsx(Cs,{...r,children:t})})}const _r="gs-cmp-file-field";function qv({className:t,value:e,label:n,btnLabel:r,nameLabel:o,size:i,isContain:s,clear:l,inputField:a,placeholder:c,description:u,preview:d=50,onChange:f,onOpen:p}){var S;const g=(e||"").replace(/^"|"$/gi,""),b=((S=g.split("/").pop())==null?void 0:S.split("?")[0])||"",v={minWidth:d,minHeight:d},y=g?{...v,backgroundImage:`url("${g}")`}:v,w=tt(" gs-utl-w-full gs-utl-bg-checker gs-utl-bg-no-repeat gs-utl-bg-center",s?"gs-utl-bg-contain":"gs-utl-bg-cover",we.b,we.rnd,he.br);return h.jsxs(fe,{className:tt(_r,t,"gs-utl-gap-1"),col:!0,nowrap:!0,children:[!!n&&h.jsx(gn,{className:tt(`${_r}-label`),size:i,m:"",children:n}),!!u&&h.jsx(gn,{className:tt(`${_r}-desc`,he.txtLowEmphasis),size:i,as:"span",m:"",capitalize:!1,children:u}),h.jsxs(fe,{className:tt(`${_r}-content gs-utl-gap-1`,he.bg),items:"center",nowrap:!0,children:[h.jsx(U,{className:tt(`${_r}-preview`),children:h.jsx("div",{className:w,style:y})}),h.jsxs(U,{className:tt(`${_r}-fields gs-utl-overflow-hidden`),grow:!0,children:[b&&o!==!1&&h.jsx(gn,{className:tt(`${_r}-name`,"gs-utl-mb-2",So.txtEllips),as:"div",size:i,capitalize:!1,children:b}),h.jsxs(fe,{className:tt(`${_r}-buttons`),space:"s",nowrap:!0,children:[h.jsx(Cs,{onClick:()=>p==null?void 0:p(e),size:i,type:"button",block:!0,full:!0,children:r||"Select image"}),!!e&&l&&h.jsx(Uv,{onClick:()=>f==null?void 0:f(""),title:l.tooltip,size:i,icon:{icon:_e.close,size:We.s},type:"button",block:!0})]})]})]}),a&&h.jsx(Gp,{className:tt(`${_r}-input`),value:g,onChange:f,size:i,placeholder:c})]})}function ac(t){return t.isFull()||["slider","composite","stack","file"].includes(t.getType())}function H3(t){return["composite","stack"].includes(t.getType())}function cc({property:t}){switch(t.getType()){case"number":case"slider":case"integer":return h.jsx(Me,{...Fe(t)});case"color":return h.jsx(di,{...Ur(t)});case"select":return h.jsx(Je,{...De(t)});case"radio":return h.jsx(Mn,{...De(t)});case"file":return h.jsx(qv,{...i4(t)});case"composite":return h.jsx(Jt,{property:t,corners:t.get("corners"),generic:t.get("generic")});case"stack":return h.jsx(to,{...no(t),children:t.getProperties().map(e=>h.jsx(oe,{property:e,className:Re(ac(e)&&"col-span-full"),children:h.jsx(cc,{property:e})},e.getId()))});default:return h.jsx(Gp,{...Ur(t)})}}function B3({sector:t}){const e=t.getProperties().filter(n=>n.isVisible());return h.jsx("div",{className:Re("grid grid-cols-2 gap-2"),children:e.map(n=>H3(n)?h.jsx("div",{className:Re(ac(n)&&"col-span-full"),children:h.jsx(cc,{property:n})},n.getId()):h.jsx(oe,{property:n,className:Re(ac(n)&&"col-span-full"),children:h.jsx(cc,{property:n})},n.getId()))})}const z3="gs-cmp-sector-row";function pe({className:t,children:e,bottom:n,separator:r,separatorTop:o,property:i,...s}){const l=h.jsx("div",{className:B("gjs-mb-2 -gjs-ml-2 -gjs-mr-2",we.bb,he.br)}),a=B(z3,t,"w-full gs-utl-gap-2",n),c=(Array.isArray(i)?i:[i]).filter(Boolean);return(c.length?c.some(d=>d.isVisible()):!0)?h.jsxs(h.Fragment,{children:[o&&l,h.jsx(fe,{className:a,nowrap:!0,...s,children:e}),r&&l]}):null}function Ps(t,e,n={}){const r=t.getType(),{compact:o=!1}=n,i=t.getParent(),s=t.getDefaultValue();if(r==="select"){const a={property:i.getName()};return h.jsx(Je,{...De(t,a),...e?{value:e.same?t.getValue({noDefault:!0}):"",emptyState:e.same?t.getOptionLabel(s,a)||s:"Custom",onChange:c=>e.all.map(u=>u.upValue(c))}:{}})}else return r==="color"?h.jsx(di,{...Ur(t),...e?{value:e.same?t.getValue({noDefault:!0}):"",placeholder:e.same?s:"Custom",onChange:(l,a)=>e.all.map(c=>c.upValue(l,{partial:a}))}:{}}):h.jsx(Me,{...Fe(t),...o?{pan:t.getLabel()[0]}:{},...e?{value:e.same?t.getValue({noDefault:!0}):"",valueUnit:e.same?t.getUnit():"",placeholder:e.same?s:"Custom",onChange:(l,a)=>e.all.map(c=>c.upValue(l,{partial:a})),onChangeUnit:l=>e.all.map(a=>a.upUnit(l))}:{}})}function Jt({property:t,corners:e,compact:n,generic:r,children:o,options:i}){const s={id:"custom",label:h.jsx(ge,{icon:_e.borderStyle,size:We.s}),title:"Custom"},l=[{id:"all",label:h.jsx(ge,{icon:_e.borderAllVariant,size:We.s}),title:"All"},s],[a,c]=m.useState(null),u=t.isDetached(),d=t.getProperties(),f=d.length,[p,g,b,v]=d,y=p.getFullValue(),S=d.map(W=>W.getFullValue()).every(W=>W===y),C=a!==null?a:S||i?"all":s.id,x=i?[...i,s]:[],E=t.getFullValue(),_=x.some(W=>W.id===E),M=C===s.id||(i?!_:!1)||!!r,k=h.jsx(oe,{property:n?null:p,shallow:!u,children:Ps(p,null,{compact:n})}),j=h.jsx(oe,{property:n?null:g,shallow:!u,children:Ps(g,null,{compact:n})}),N=!!b&&h.jsx(oe,{property:n?null:b,shallow:!u,children:Ps(b,null,{compact:n})}),P=!!v&&h.jsx(oe,{property:n?null:v,shallow:!u,children:Ps(v,null,{compact:n})}),z=n?{label:t.getLabel()}:{property:t};return t!=null&&t.isVisible()?h.jsxs(fe,{className:B("w-full gs-utl-gap-2"),col:!0,nowrap:!0,children:[h.jsx(pe,{children:h.jsx(oe,{...z,children:!r&&h.jsx(pe,{bottom:"0",children:o!==void 0?o:i?h.jsx(h.Fragment,{children:h.jsx(U,{grow:!0,children:h.jsx(Mn,{size:"s",options:x,value:M?s.id:E,onChange:W=>{W===s.id?c(W):(t.upValue(W),c(""))}})})}):h.jsxs(h.Fragment,{children:[h.jsx(U,{grow:!0,children:Ps(p,{same:S,all:d})}),h.jsx(U,{grow:!0,children:h.jsx(Mn,{size:"s",options:l,value:C,onChange:c})})]})})})}),M&&h.jsx(pe,{col:!0,className:B("gjs-px-2 gjs-py-1",he.bgH2,we.rnd,we.b,he.br),children:r?h.jsx("div",{className:B("grid grid-cols-2 gap-2"),children:d.map(W=>h.jsx(oe,{property:W,shallow:!u,className:B(ac(W)&&"col-span-full"),children:h.jsx(cc,{property:W})},W.getId()))}):f===2?h.jsx(h.Fragment,{children:h.jsxs(fe,{space:"s",children:[h.jsx(U,{grow:!0,children:k}),h.jsx(U,{grow:!0,children:j})]})}):f===3?h.jsxs(h.Fragment,{children:[h.jsxs(fe,{space:"s",children:[h.jsx(U,{grow:!0,children:k}),h.jsx(U,{grow:!0,children:j})]}),h.jsx(fe,{space:"s",children:h.jsx(U,{grow:!0,children:N})})]}):e?h.jsxs(h.Fragment,{children:[h.jsxs(fe,{space:"s",children:[h.jsx(U,{grow:!0,children:k}),h.jsx(U,{grow:!0,children:j})]}),h.jsxs(fe,{space:"s",children:[h.jsx(U,{grow:!0,children:P}),h.jsx(U,{grow:!0,children:N})]})]}):h.jsxs(h.Fragment,{children:[h.jsx(fe,{className:B("gs-utl-w-1/2 gjs-m-auto"),children:k}),h.jsxs(fe,{space:"s",children:[h.jsx(U,{grow:!0,children:P}),h.jsx(U,{grow:!0,children:j})]}),h.jsx(fe,{className:B("gs-utl-w-1/2 gjs-m-auto"),children:N})]})})]}):null}function F3({sector:t}){const e=t.getProperty("border-radius");return h.jsxs(h.Fragment,{children:[h.jsx(Jt,{property:e,corners:!0}),h.jsx(Jt,{property:t.getProperty("border-width")}),h.jsx(Jt,{property:t.getProperty("border-style")}),h.jsx(Jt,{property:t.getProperty("border-color")})]})}const Io=t=>ru({value:parseFloat(t),min:-3,max:3}),rd=(t,e="filter")=>{const n=t.getProperty(`${e}-value`),r=t.getProperty(`${e}-name`).getOption()||{},o=r.units||[],i=n.getUnit(),s=uM(i,o)?i:o[0];return{...Fe(n),units:o,valueUnit:s,onChange:(l,a)=>{n.upValue(l,{partial:a,units:o,min:r.min,max:r.max})}}},Cm=(t,e)=>{const n=t.getProperty(`${e}-name`),r=t.getProperty(`${e}-value`);return{...De(n),onChange:o=>{n.upValue(o),r.upValue("")}}},W3={"text-shadow-h":"1px","text-shadow-v":"1px","text-shadow-blur":"5px"};function U3({sector:t}){const e=t.getProperty("box-shadow"),n=t.getProperty("text-shadow"),r=t.getProperty("filter"),o=t.getProperty("backdrop-filter"),i=t.getProperty("transition"),s=t.getProperty("transform"),l=t.getProperty("perspective-origin"),a=t.getProperty("backface-visibility"),c=t.getProperty("perspective"),u=t.getProperty("transform-style"),d=t.getProperty("opacity"),f=t.getProperty("mix-blend-mode"),p=t.getProperty("cursor"),g=v=>{const{boxShadowH:y,boxShadowV:w,boxShadowBlur:S,boxShadowColor:C,boxShadowSpread:x,boxShadowType:E}=v.getValues({camelCase:!0}),_=Io(y),M=Io(w),k=Io(S),j=Io(x),N=`${_}px ${M}px ${k}px ${j}px ${C} ${E}`.trim();return h.jsxs(fe,{space:"s",items:"center",children:[h.jsxs(U,{grow:!0,children:[y," ",w," ",S," ",x]}),h.jsx(U,{children:h.jsx("div",{className:B("w-4 h-4 gjs-bg-white",we.b,we.rnd),style:{boxShadow:N}})})]})},b=v=>{const{textShadowH:y,textShadowV:w,textShadowBlur:S,textShadowColor:C}=v.getValues({camelCase:!0}),x=Io(y),E=Io(w),_=Io(S),M=`${x}px ${E}px ${_}px ${C}`.trim();return h.jsxs(fe,{space:"s",items:"center",children:[h.jsxs(U,{grow:!0,children:[y," ",w," ",S]}),h.jsx(U,{children:h.jsx("div",{className:B("w-4 h-4 gjs-bg-white",we.b,we.rnd),style:{boxShadow:M}})})]})};return h.jsxs(h.Fragment,{children:[h.jsxs(pe,{property:[d,f],children:[h.jsx(oe,{property:d,children:h.jsx(Me,{...Fe(d)})}),h.jsx(oe,{property:f,children:h.jsx(Je,{...De(f)})})]}),h.jsx(pe,{property:p,separator:!0,children:h.jsx(oe,{property:p,children:h.jsx(Je,{...De(p)})})}),h.jsx(pe,{property:e,separator:!0,children:h.jsxs(to,{...no(e),renderItem:g,children:[h.jsx(pe,{children:h.jsx(Mn,{...De(e.getProperty("box-shadow-type"))})}),h.jsxs(pe,{children:[h.jsx(oe,{label:"X offset",children:h.jsx(Me,{...Fe(e.getProperty("box-shadow-h"))})}),h.jsx(oe,{label:"Y offset",children:h.jsx(Me,{...Fe(e.getProperty("box-shadow-v"))})})]}),h.jsxs(pe,{children:[h.jsx(oe,{label:"Blur",children:h.jsx(Me,{...Fe(e.getProperty("box-shadow-blur"))})}),h.jsx(oe,{label:"Spread",children:h.jsx(Me,{...Fe(e.getProperty("box-shadow-spread"))})})]}),h.jsx(pe,{children:h.jsx(oe,{label:"Color",children:h.jsx(di,{...Ur(e.getProperty("box-shadow-color"))})})})]})}),h.jsx(pe,{property:n,separator:!0,children:h.jsxs(to,{...no(n,W3),renderItem:b,children:[h.jsxs(pe,{children:[h.jsx(oe,{label:"X offset",children:h.jsx(Me,{...Fe(n.getProperty("text-shadow-h"))})}),h.jsx(oe,{label:"Y offset",children:h.jsx(Me,{...Fe(n.getProperty("text-shadow-v"))})})]}),h.jsx(pe,{children:h.jsx(oe,{label:"Blur",children:h.jsx(Me,{...Fe(n.getProperty("text-shadow-blur"))})})}),h.jsx(pe,{children:h.jsx(oe,{label:"Color",children:h.jsx(di,{...Ur(n.getProperty("text-shadow-color"))})})})]})}),h.jsx(pe,{property:r,separator:!0,children:h.jsx(to,{...no(r,{"filter-name":"blur","filter-value":"3px"}),children:h.jsxs(pe,{children:[h.jsx(oe,{label:"Type",children:h.jsx(Je,{...Cm(r,"filter")})}),h.jsx(oe,{label:"Value",children:h.jsx(Me,{...rd(r)})})]})})}),h.jsx(pe,{property:o,separator:!0,children:h.jsx(to,{...no(o,{"backdrop-filter-name":"blur","backdrop-filter-value":"3px"}),children:h.jsxs(pe,{children:[h.jsx(oe,{label:"Type",children:h.jsx(Je,{...De(o.getProperty("backdrop-filter-name"))})}),h.jsx(oe,{label:"Value",children:h.jsx(Me,{...rd(o,"backdrop-filter")})})]})})}),h.jsx(pe,{property:i,separator:!0,children:h.jsxs(to,{...no(i),children:[h.jsx(pe,{children:h.jsx(oe,{label:"Type",children:h.jsx(Je,{...De(i.getProperty("transition-property"))})})}),h.jsx(pe,{children:h.jsx(oe,{label:"Easing",children:h.jsx(Je,{...De(i.getProperty("transition-timing-function"))})})}),h.jsxs(pe,{children:[h.jsx(oe,{label:"Duration",children:h.jsx(Me,{...Fe(i.getProperty("transition-duration"))})}),h.jsx(oe,{label:"Delay",children:h.jsx(Me,{...Fe(i.getProperty("transition-delay"))})})]})]})}),h.jsx(pe,{property:s,separator:!0,children:h.jsx(to,{...no(s),children:h.jsxs(pe,{children:[h.jsx(oe,{label:"Type",children:h.jsx(Je,{...Cm(s,"transform")})}),h.jsx(oe,{label:"Value",children:h.jsx(Me,{...rd(s,"transform")})})]})})}),h.jsx(Jt,{property:t.getProperty("transform-origin")}),h.jsx(Jt,{property:t.getProperty("overflow")}),h.jsx(pe,{property:a,children:h.jsx(oe,{property:a,children:h.jsx(Mn,{...De(a)})})}),h.jsx(pe,{property:[c,u,l],separatorTop:!0,children:"Children transform"}),h.jsxs(pe,{property:[c,u],children:[h.jsx(oe,{property:c,children:h.jsx(Me,{...Fe(c)})}),h.jsx(oe,{property:u,children:h.jsx(Mn,{...De(u)})})]}),h.jsx(Jt,{property:l})]})}function q3(t,e){return t.indexOf(e)>=0}const Ye=We.s,ua="M6 6v12h13V6H6zm0 13v5H5V0h1v5h13c.6 0 1 .4 1 1v12c0 .6-.4 1-1 1H6zm6-14h1v14h-1V5z",da="M6 6v12h13V6H6zm0-1h13c.6 0 1 .4 1 1v12c0 .6-.4 1-1 1H6a1 1 0 01-1-1V6c0-.6.4-1 1-1zm6-5h1v24h-1V0z",fa="M6 6v12h13V6H6zm13-1V0h1v24h-1v-5H6a1 1 0 01-1-1V6c0-.6.4-1 1-1h13zm-7 0h1v14h-1V5z",Em="M2 6v12h6V6H2zm0 13v5H1V0h1v5h6c.6 0 1 .4 1 1v12c0 .6-.4 1-1 1H2zM16 6v12h6V6h-6zm6-1V0h1v24h-1v-5h-6a1 1 0 01-1-1V6c0-.6.4-1 1-1h6z",Om="M11 0h1v24h-1V0zM1 6h6v12H1V6zm0-1h6c.6 0 1 .4 1 1v12c0 .6-.4 1-1 1H1a1 1 0 01-1-1V6c0-.6.4-1 1-1zm15 1h6v12h-6V6zm0-1h6c.6 0 1 .4 1 1v12c0 .6-.4 1-1 1h-6a1 1 0 01-1-1V6c0-.6.4-1 1-1z",G3="M3 6v12h6V6H3zm0-1h6c.6 0 1 .4 1 1v12c0 .6-.4 1-1 1H3a1 1 0 01-1-1V6c0-.6.4-1 1-1zM0 0h1v24H0V0zm14 6v12h6V6h-6zm0-1h6c.6 0 1 .4 1 1v12c0 .6-.4 1-1 1h-6a1 1 0 01-1-1V6c0-.6.4-1 1-1zm8-5h1v24h-1V0zM11 0h1v24h-1V0z",od="M15 19H9V6h6v13zM8 6v13H0v1h24v-1h-8V6h8V5H0v1h8z";function K3({sector:t}){const{editor:e}=Hl(),n=dp(),[r,o]=m.useState({}),[i,s]=m.useState({}),l=t.getProperty("display"),a=t.getProperty("flex-direction"),c=t.getProperty("justify-content"),u=t.getProperty("align-items"),d=t.getProperty("flex-wrap"),f=t.getProperty("align-content"),p=t.getProperty("align-self"),g=t.getProperty("order"),b=P=>n.t(`styleManager.layout.${P}`),v=l.getValue(),y=v==="flex",w=(i.display||"").indexOf("flex")>=0,S=a.getValue(),C=S.indexOf("reverse")>=0,x=!q3(["column","column-reverse"],S),E=[{id:"row",label:h.jsx(ge,{icon:_e.arrowRight,size:We.sx}),title:b("direction.title.row")},{id:"row-reverse",label:h.jsx(ge,{icon:_e.arrowRight,size:Ye,horizontal:!0}),title:b("direction.title.row-reverse")},{id:"column",label:h.jsx(ge,{icon:_e.arrowDown,size:We.sx}),title:b("direction.title.column")},{id:"column-reverse",label:h.jsx(ge,{icon:_e.arrowDown,size:Ye,vertical:!0}),title:b("direction.title.column-reverse")}],_=[{id:"flex-start",title:"Start",label:h.jsx(ge,{icon:ua,size:Ye,rotate:x?0:90,horizontal:x&&C,vertical:!x&&C})},{id:"center",title:"Center",label:h.jsx(ge,{icon:da,size:Ye,rotate:x?0:90})},{id:"flex-end",title:"End",label:h.jsx(ge,{icon:fa,size:Ye,rotate:x?0:90,horizontal:x&&C,vertical:!x&&C})},{id:"space-between",title:"Space between",label:h.jsx(ge,{icon:Em,size:Ye,rotate:x?0:90})},{id:"space-around",title:"Space around",label:h.jsx(ge,{icon:Om,size:Ye,rotate:x?0:90})},{id:"space-evenly",title:"Space evenly",label:h.jsx(ge,{icon:G3,size:Ye,rotate:x?0:90})}],M=[{id:"stretch",title:"Stretch",label:h.jsx(ge,{icon:od,size:Ye,rotate:x?0:90})},{id:"flex-start",title:"Start",label:h.jsx(ge,{icon:ua,size:Ye,rotate:x?90:0})},{id:"center",title:"Center",label:h.jsx(ge,{icon:da,size:Ye,rotate:x?90:0})},{id:"flex-end",title:"End",label:h.jsx(ge,{icon:fa,size:Ye,rotate:x?90:0})}],k=[{id:"flex-start",title:"Start",label:h.jsx(ge,{icon:ua,size:Ye,rotate:x?90:0,horizontal:x&&C,vertical:!x&&C})},{id:"center",title:"Center",label:h.jsx(ge,{icon:da,size:Ye,rotate:x?90:0})},{id:"flex-end",title:"End",label:h.jsx(ge,{icon:fa,size:Ye,rotate:x?90:0,horizontal:x&&C,vertical:!x&&C})},{id:"space-between",title:"Space between",label:h.jsx(ge,{icon:Em,size:Ye,rotate:x?90:0})},{id:"space-around",title:"Space around",label:h.jsx(ge,{icon:Om,size:Ye,rotate:x?90:0})},{id:"stretch",title:"Stretch",label:h.jsx(ge,{icon:od,size:Ye,rotate:x?0:90})}],j=[{id:"auto",title:"Auto",label:h.jsx(ge,{icon:_e.close,size:Ye})},{id:"flex-start",title:"Start",label:h.jsx(ge,{icon:ua,size:Ye,rotate:90})},{id:"center",title:"Center",label:h.jsx(ge,{icon:da,size:Ye,rotate:90})},{id:"flex-end",title:"End",label:h.jsx(ge,{icon:fa,size:Ye,rotate:90})},{id:"stretch",title:"Stretch",label:h.jsx(ge,{icon:od,size:Ye,rotate:0})}],N=[{id:"0 0 auto",label:h.jsx(ge,{icon:_e.close,size:Ye}),title:"Auto"},{id:"1 1 0%",label:h.jsx(ge,{icon:_e.unfoldMoreHorizontal,size:Ye,rotate:90}),title:"Fill container"},{id:"0 1 auto",label:h.jsx(ge,{icon:_e.unfoldLessHorizontal,size:Ye,rotate:90}),title:"Hug contents"}];return m.useEffect(()=>{if(!e)return()=>{};const{Styles:P}=e,z=()=>{const F=e.getSelected();let $={},J={};if(F){const ee=F.getEl();if(ee){$=window.getComputedStyle(ee);const L=ee.parentElement;L&&(J=window.getComputedStyle(L))}}o($),s(J)},W=P.events.target;return e.on(W,z),z(),()=>e.off(W,z)},[e]),h.jsxs(h.Fragment,{children:[h.jsx(pe,{children:h.jsx(oe,{property:l,tooltip:b(`display.tips.${v}`),row:!0,children:h.jsx(Je,{...De(l)})})}),y&&h.jsxs(h.Fragment,{children:[h.jsx(pe,{children:h.jsx(oe,{property:a,children:h.jsx(Mn,{...De(a),options:E})})}),h.jsx(pe,{children:h.jsx(oe,{property:c,children:h.jsx(Mn,{...De(c),options:_})})}),h.jsx(pe,{children:h.jsx(oe,{property:u,children:h.jsx(Mn,{...De(u),options:M})})}),h.jsx(pe,{children:h.jsx(Jt,{property:t.getProperty("gap")})}),h.jsx(pe,{children:h.jsx(oe,{property:d,row:!0,children:h.jsx(Je,{...De(d)})})}),d.getValue()!=="nowrap"&&h.jsx(pe,{children:h.jsx(oe,{property:f,children:h.jsx(Mn,{...De(f),options:k})})})]}),w&&h.jsxs(h.Fragment,{children:[h.jsx(pe,{separatorTop:!0,children:b("flexChild")}),h.jsx(pe,{children:h.jsx(Jt,{property:t.getProperty("flex"),options:N})}),h.jsx(pe,{children:h.jsx(oe,{property:p,children:h.jsx(Mn,{...De(p),options:j})})}),h.jsx(pe,{children:h.jsx(oe,{property:g,row:!0,children:h.jsx(Me,{...Fe(g)})})})]})]})}const Y3=["topLeft","topRight","bottomLeft","bottomRight","left","right","bottom","top","full"];function J3({sector:t}){var f;const e=dp(),n=t.getProperty("position"),r=n.getValue(),o=t.getProperty("top"),i=t.getProperty("right"),s=t.getProperty("bottom"),l=t.getProperty("left"),a=p=>e.t(`styleManager.position.${p}`),c=Y3.map(p=>({id:p,label:a(`presets.options.${p}`)})),u=["absolute","fixed"].includes(r),d=p=>{let g="auto",b="auto",v="auto",y="auto";switch(p){case"topLeft":g="0%",y="0%";break;case"topRight":g="0%",b="0%";break;case"bottomLeft":v="0%",y="0%";break;case"bottomRight":v="0%",b="0%";break;case"left":g="0%",v="0%",y="0%";break;case"right":g="0%",v="0%",b="0%";break;case"bottom":y="0%",v="0%",b="0%";break;case"top":y="0%",g="0%",b="0%";break;case"full":y="0%",g="0%",b="0%",v="0%";break}o.upValue(g),i.upValue(b),s.upValue(v),l.upValue(y)};return h.jsxs(h.Fragment,{children:[h.jsxs(pe,{children:[h.jsx(oe,{property:n,tooltip:a(`tips.${(f=n.getOption())==null?void 0:f.id}`),row:!0,children:h.jsx(Je,{...De(n)})}),u&&h.jsx(U,{children:h.jsx(mo,{title:a("presets.title"),children:h.jsx(Je,{options:c,onChange:d,emptyState:"P",size:"s",caret:"",value:!0})})})]}),r!=="static"&&h.jsxs(h.Fragment,{children:[h.jsxs(pe,{col:!0,children:[h.jsx(fe,{className:B("gs-utl-w-1/2 gjs-m-auto"),children:h.jsx(oe,{property:o,children:h.jsx(Me,{...Fe(o)})})}),h.jsxs(fe,{space:"s",children:[h.jsx(U,{grow:!0,children:h.jsx(oe,{property:l,children:h.jsx(Me,{...Fe(l)})})}),h.jsx(U,{grow:!0,children:h.jsx(oe,{property:i,children:h.jsx(Me,{...Fe(i)})})})]}),h.jsx(fe,{className:B("gs-utl-w-1/2 gjs-m-auto"),children:h.jsx(oe,{property:s,children:h.jsx(Me,{...Fe(s)})})})]}),h.jsx(pe,{children:h.jsx(oe,{property:t.getProperty("z-index"),children:h.jsx(Me,{...Fe(t.getProperty("z-index"))})})})]})]})}function Z3({sector:t}){const e=t.getProperty("width"),n=t.getProperty("min-width"),r=t.getProperty("max-width"),o=t.getProperty("height"),i=t.getProperty("min-height"),s=t.getProperty("max-height");return h.jsxs(h.Fragment,{children:[h.jsxs(pe,{property:[e,o],children:[h.jsx(oe,{property:e,children:h.jsx(Me,{...Fe(e)})}),h.jsx(oe,{property:o,children:h.jsx(Me,{...Fe(o)})})]}),h.jsxs(pe,{property:[n,i],children:[h.jsx(oe,{property:n,children:h.jsx(Me,{...Fe(n)})}),h.jsx(oe,{property:i,children:h.jsx(Me,{...Fe(i)})})]}),h.jsxs(pe,{property:[r,s],children:[h.jsx(oe,{property:r,children:h.jsx(Me,{...Fe(r)})}),h.jsx(oe,{property:s,children:h.jsx(Me,{...Fe(s)})})]})]})}function X3({sector:t}){return h.jsxs(h.Fragment,{children:[h.jsx(Jt,{property:t.getProperty("padding")}),h.jsx(Jt,{property:t.getProperty("margin")})]})}function Q3({sector:t}){const e=t.getProperty("font-family"),n=t.getProperty("color"),r=t.getProperty("font-size"),o=t.getProperty("font-weight"),i=t.getProperty("line-height"),s=t.getProperty("letter-spacing"),l=t.getProperty("text-align"),a=t.getProperty("vertical-align"),c=t.getProperty("text-decoration"),u=t.getProperty("text-transform"),d=t.getProperty("direction"),f=t.getProperty("white-space");return h.jsxs(h.Fragment,{children:[!!e&&h.jsx(pe,{property:e,children:h.jsx(oe,{property:e,children:h.jsx(Je,{...De(e)})})}),!!n&&h.jsx(pe,{property:n,children:h.jsx(oe,{property:n,children:h.jsx(di,{...Ur(n)})})}),h.jsxs(pe,{property:[r,o],children:[!!r&&h.jsx(oe,{property:r,children:h.jsx(Me,{...Fe(r)})}),!!o&&h.jsx(oe,{property:o,children:h.jsx(Je,{...De(o)})})]}),h.jsxs(pe,{property:[i,s],children:[!!i&&h.jsx(oe,{property:i,children:h.jsx(Me,{...Fe(i)})}),!!s&&h.jsx(oe,{property:s,children:h.jsx(Me,{...Fe(s)})})]}),h.jsxs(pe,{property:[l,a],children:[!!l&&h.jsx(oe,{property:l,children:h.jsx(Je,{...De(l)})}),!!a&&h.jsx(oe,{property:a,children:h.jsx(Je,{...De(a)})})]}),h.jsxs(pe,{property:[u,d],children:[!!u&&h.jsx(oe,{property:u,children:h.jsx(Je,{...De(u)})}),!!d&&h.jsx(oe,{property:d,children:h.jsx(Je,{...De(d)})})]}),h.jsxs(pe,{property:[f,c],children:[!!f&&h.jsx(oe,{property:f,children:h.jsx(Je,{...De(f)})}),!!c&&h.jsx(oe,{property:c,children:h.jsx(Je,{...De(c)})})]})]})}const Gv="gs-style-manager",th=`${Gv}-sector`,e4=`${th}-header`,t4=`${th}-content`,n4=(t,e=0,n=!0)=>B(e4,he.bgH2,dr.xyS,he.br,e&&we.bt,(t||n)&&we.bb),r4=(t,e={})=>t.getOptions().map(n=>({id:t.getOptionId(n),label:t.getOptionLabel(t.getOptionId(n),e),title:n.title})),o4=(t,e)=>e.map(n=>({...n,title:t.getOptionLabel(t.getOptionId(n))})),De=(t,e={})=>({size:"s",options:r4(t,e),value:t.getValue(),onChange:n=>t.upValue(n)}),no=(t,e={})=>({title:t.getLabel(),titleAdd:`Add new ${t.getLabel()}`,items:t.getLayers(),selected:t.getSelectedLayer(),renderItem:n=>t.getLayerLabel(n),add:()=>t.addLayer(e,{at:0}),select:n=>t.selectLayer(n),remove:n=>t.removeLayer(n),move:(n,r=0)=>t.moveLayer(n,r),label:h.jsx(oe,{property:t})}),Fe=t=>({size:"s",value:t.getValue({noDefault:!0}),valueUnit:t.getUnit(),units:t.getUnits(),placeholder:t.getDefaultValue(),onChangeUnit:e=>t.upUnit(e),onChange:(e,n)=>t.upValue(e,{partial:n})}),Ur=t=>({size:"s",value:t.getValue({noDefault:!0}),placeholder:t.getDefaultValue(),onChange:(e,n)=>t.upValue(e,{partial:n})}),i4=t=>({...Ur(t),onOpen(){const e=t.em.Assets;e.open({select(n){t.upValue(n.getSrc()),e.close()}})}}),s4=t=>{const e=t.getId();let n=B3;switch(e){case"gs-layout":n=K3;break;case"gs-size":n=Z3;break;case"gs-space":n=X3;break;case"gs-position":n=J3;break;case"gs-borders":n=F3;break;case"gs-effects":n=U3;break;case"gs-typography":n=Q3;break;case"gs-background":n=g4;break}return h.jsx(n,{sector:t})};ms(function({className:e,sectors:n}){const{editor:r}=Hl();if(!r)return null;const{Styles:o}=r,i=o.getSelected(),s=n.length?n:o.getSectors({visible:!0});return i?h.jsx("div",{className:B(Gv,e,"select-none"),children:s.map((l,a)=>h.jsx(MA,{classNameWrap:th,sticky:!0,handler:()=>{const c=l.getProperties({withValue:!0}).length>0,u=l.getProperties({withParentValue:!0}).length>0;return h.jsxs(fe,{space:"xs",items:"center",children:[h.jsx(U,{className:B("gjs-mr-2"),children:l.getName()}),c&&h.jsx(U,{children:h.jsx("div",{className:B(So.dot,he.bgA2)})}),u&&h.jsx(U,{children:h.jsx("div",{className:B(So.dot,he.bgW)})})]})},className:c=>n4(c,a,a===s.length-1),children:h.jsx(fe,{className:B(t4,"gs-utl-p-2 gs-utl-gap-2"),col:!0,children:s4(l)})},l.getId()))}):null});function _m({value:t,label:e,border:n,size:r="m",tip:o,disabled:i,onChange:s}){const l=!!t,a=B("relative inline-flex items-center h-6 gjs-rounded-full w-11 transition-colors focus:gs-utl-outline-none",l?he.bgA:he.bgH,nc.focus,n&&`${he.br} ${we.b}`);return h.jsx(zu.Group,{children:h.jsxs(fe,{full:!0,items:"center",children:[!!e&&h.jsx(zu.Label,{className:B("gs-utl-mr-4 gs-utl-flex-1 gs-utl-flex gs-utl-gap-2 gs-utl-items-center"),passive:!0,children:h.jsx(gn,{as:"span",size:r,tip:o,m:"",children:e})}),h.jsx(zu,{checked:l,onChange:s,className:a,disabled:i,children:h.jsx("span",{className:B(he.bg,"inline-block w-4 h-4 transform gjs-rounded-full transition-transform",l?"translate-x-6":"translate-x-1")})})]})})}const l4=/^-?[0-9]+(\.[0-9]+)?[a-zA-Z%]{0,}$/,a4=/,(?![^(]*\))/,id=/\s(?![^(]*\))/,c4=/^(closest-side|closest-corner|farthest-side|farthest-corner)/i,sd=/^circle|ellipse/i,nh=t=>{var u;const e=[],{name:n,value:r}=eu(t),[o,...i]=r.split(a4).map(d=>d.trim()).filter(Boolean),s=i.length>1,l=s?o:"",a={type:"none"},c=s?i:[o,...i];if(l4.test(l))a.type="angle",a.value=l;else if(/^to\s/.test(l))a.type="side-or-corner",a.value=l;else if(c4.test(l))a.type="size",a.value=l;else if(sd.test(l)||/^at\s/.test(l)||/\sat\s/.test(l)){a.type="at",a.value=l;const d=((u=l.match(sd))==null?void 0:u[0])||"circle";a.shape=d;const f={x:"0%",y:"0%"},p={x:"0%",y:"0%"},[g,b]=l.replace(sd,"").trim().split("at").map(v=>v.trim());if(g){const[v,y]=g.split(id);f.x=v,f.y=y||v}if(b){const[v,y]=b.split(id);p.x=v,p.y=y||v}a.size=f,a.position=p}return c.forEach(d=>{const[f,p]=d.split(id);e.push({color:f,hint:p?parseFloat(p):null})}),e.forEach((d,f)=>{d.hint===null&&(d.hint=f/(e.length-1)*100)}),{name:n,orientation:a,colorStops:e}},Xr=({stops:t,orientation:e="to right",name:n="linear-gradient"})=>{const o=(t.length===1?[{color:t[0].color,hint:null},{color:t[0].color,hint:null}]:t).map(i=>`${i.color} ${i.hint?`${i.hint}%`:""}`.trim()).join(", ");return o?`${n}(${e}, ${o})`:"none"},u4=t=>t.slice().sort((e,n)=>(e.hint||0)-(n.hint||0)),d4="gs-cmp-grad-picker";function f4({className:t,value:e,onChange:n}){var $,J,ee;const r=nh(e),[o,i]=m.useState(r.colorStops),[s,l]=m.useState(null),a=m.useRef(null),c=B(d4,"gs-grad-picker gs-utl-select-none gs-utl-gap-1",t,we.rnd),u=r.name||"linear-gradient",d=u.indexOf("radial")>=0,f=u.indexOf("repeating")>=0,p=r.orientation.value,g=`${parseFloat(`${p}`)||180}`,b=`${parseFloat(`${($=r.orientation.size)==null?void 0:$.x}`)||0}`,v=`${parseFloat(`${(J=r.orientation.position)==null?void 0:J.x}`)||0}`,y=`${parseFloat(`${(ee=r.orientation.position)==null?void 0:ee.y}`)||0}`,w=0,S=100,C=(L,I=!1)=>{const A=u4(L);i(A),n==null||n(Xr({name:u,orientation:p,stops:A}),I)},x=(L,I=!1)=>{n==null||n(Xr({stops:o,name:u,orientation:`${L}deg`}),I)},E=(L,I=!1)=>{n==null||n(Xr({stops:o,name:u,orientation:`${L}px at ${v}% ${y}%`}),I)},_=(L,I=!1)=>{n==null||n(Xr({stops:o,name:u,orientation:`${b}px at ${L}% ${y}%`}),I)},M=(L,I=!1)=>{n==null||n(Xr({stops:o,name:u,orientation:`${b}px at ${v}% ${L}%`}),I)},k=L=>{const I=`${L?"repeating-":""}${d?"radial":"linear"}-gradient`;n==null||n(Xr({stops:o,orientation:p,name:I}))},j=L=>{const I=`${f?"repeating-":""}${L?"radial":"linear"}-gradient`;n==null||n(Xr({stops:o,orientation:L?"100px at 50% 50%":"90deg",name:I}))};m.useEffect(()=>{if(!s)return;const L=parseFloat(`${s.stop.hint}`),I=R=>{let D=(R.clientX-s.x)*100;D=D/s.w,D=L+D,D=D<w?w:D,D=D>S?S:D,s.stop.hint=parseInt(`${D}`,10),C(o,!0)},A=()=>{l(null),C(o)};return window.addEventListener("pointermove",I),window.addEventListener("pointerup",A),()=>{window.removeEventListener("pointermove",I),window.removeEventListener("pointerup",A),A()}},[s]);const N=(L,I)=>{const A=a.current;l({stop:I,w:(A==null?void 0:A.clientWidth)||0,h:(A==null?void 0:A.clientHeight)||0,x:L.clientX,y:L.clientY})},P=L=>{const I=a.current,A=(I==null?void 0:I.clientWidth)||0,R=(I==null?void 0:I.clientHeight)||0,q=L.nativeEvent.offsetX-((I==null?void 0:I.clientLeft)||0),D=L.nativeEvent.offsetY-((I==null?void 0:I.clientTop)||0),V=q/A*100,te=document.createElement("canvas"),G=te.getContext("2d");if(!G)return;te.width=A,te.height=R;const Q=G.createLinearGradient(0,0,A,R);o.forEach(X=>Q.addColorStop(parseFloat(`${X.hint}`)/100,X.color)),G.fillStyle=Q,G.fillRect(0,0,te.width,te.height),te.style.background="black";const se=G.getImageData(q,D,1,1).data,be=se[3]?(100/255*se[3]/100).toFixed(2):0,de=`rgba(${se[0]}, ${se[1]}, ${se[2]}, ${be})`,Pe=de==="rgba(0, 0, 0, 0)"?"#000":de;C([...o,{color:Pe,hint:V}])},z=L=>{C(o.filter(I=>I!==L))},W=(L,I,A)=>{I&&(L.color=I),C(o,A)},F=L=>(s==null?void 0:s.stop)===L;return h.jsxs(fe,{className:c,col:!0,children:[!!(s!=null&&s.stop)&&h.jsx("div",{className:B("fixed inset-0 z-50 cursor-colr")}),h.jsxs("div",{className:B("relative gjs-mb-6 gjs-mt-3"),children:[h.jsx("div",{className:B("bg-checker h-8",we.rnd),children:h.jsx("div",{ref:a,className:B("w-full h-full cursor-cross",we.b,we.rnd,he.br),style:{backgroundImage:Xr({stops:o})},onClick:P})}),o.map((L,I)=>h.jsxs("div",{className:B("absolute top-0 h-full"),style:{left:`${L.hint}%`},children:[h.jsx("div",{className:B("cursor-pointer absolute gs-utl-translate-x-[-50%] gs-utl-top-[-14px]"),onClick:()=>z(L),children:h.jsx(ge,{icon:_e.close,size:We.s3x})}),h.jsx("div",{onPointerDown:A=>N(A,L),className:B("h-full w-1 gs-utl-translate-x-[-50%] cursor-colr opacity-50 gjs-border-white",we.br,we.bl,F(L)?"gjs-bg-white":"gjs-bg-black")}),h.jsx("div",{className:B("cursor-pointer gs-utl-bottom-[-17px] gs-utl-left-[-7px] absolute"),children:h.jsx(Ov,{value:L.color,onChange:(A,R)=>W(L,A,R),className:B("h-4 w-4 gjs-rounded-full gjs-border-2")})})]},I))]}),h.jsxs(fe,{space:"s",items:"center",children:[h.jsx(U,{grow:!0,children:h.jsx(_m,{label:"Repeat",value:f,onChange:k})}),h.jsx(U,{grow:!0,children:h.jsx(_m,{label:"Radial",value:d,onChange:j})})]}),d?h.jsxs(fe,{space:"s",col:!0,children:[h.jsx(U,{children:h.jsx(fe,{space:"s",items:"center",children:h.jsx(U,{grow:!0,children:h.jsx(Me,{pan:"S",size:"s",value:b,onChange:E,valueUnit:"px",units:["px"]})})})}),h.jsx(U,{children:h.jsxs(fe,{space:"s",children:[h.jsx(U,{grow:!0,children:h.jsx(Me,{pan:"X",size:"s",value:v,onChange:_,valueUnit:"%",units:["%"]})}),h.jsx(U,{grow:!0,children:h.jsx(Me,{pan:"Y",size:"s",value:y,onChange:M,valueUnit:"%",units:["%"]})})]})})]}):h.jsx(fe,{space:"s",items:"center",nowrap:!0,children:h.jsx(U,{grow:!0,children:h.jsx(Me,{pan:"A",size:"s",value:g,onChange:x,valueUnit:"deg",units:["deg"]})})})]})}var uo=(t=>(t.Image="image",t.Gradient="gradient",t.Color="color",t))(uo||{});const La="background-image",lr="__background-type",el=La,Kv="https://placehold.co/150/777/white.png?text=IMAGE",xf="50px",p4={[lr]:"image","background-image":`url("${Kv}")`,"background-size":`${xf} ${xf}`,"background-repeat":"repeat","background-position":"0px 0px"},h4=t=>(t.includes("gradient(")?nh(t).colorStops[0].color:t)||"";function g4({sector:t}){var v;const e=yA(),n=t.getProperty("background"),r=n.getProperty(lr),o=n.getProperty("background-image"),i=n.getProperty("background-position"),s=n.getProperty("background-size"),l=t.getProperty("background-color"),a=t.getProperty("background-clip"),c=((v=n.getSelectedLayer())==null?void 0:v.getIndex())||-1,u=r==null?void 0:r.getValue(),d=u==="image",f=o.getValue(),p=()=>{const y=e.Assets;y.open({select(w){const S=w.getSrc();o.upValue(`url("${S}")`),y.close()}})},g=y=>{let w="none",S="100%";y==="image"?(w=`url("${Kv}")`,S=xf):y==="gradient"?w="linear-gradient(90deg, black 10%, white 90%)":y==="color"&&(w="rgba(0, 0, 0, 0.5)"),o.upValue(w),r.upValue(y),i.upValue("0 0"),s.upValue(`${S} ${S}`)},b=o4(r,[{id:"image",label:h.jsx(ge,{icon:_e.image,size:We.s})},{id:"gradient",label:h.jsx(ge,{icon:_e.gradientVertical,size:We.s})},{id:"color",label:h.jsx(ge,{icon:_e.checkboxBlank,size:We.s})}]);return h.jsxs(h.Fragment,{children:[h.jsx(pe,{property:n,separator:!0,children:h.jsxs(to,{...no(n,p4),previewStyle:y=>n.getStyleFromLayer(y,{camelCase:!0}),children:[h.jsx(pe,{children:h.jsx(oe,{label:"Type",children:h.jsx(Mn,{...De(r),options:b,onChange:g})})}),h.jsx(pe,{children:h.jsxs(oe,{children:[d&&h.jsx(qv,{value:eu(f).value,onOpen:p}),u==="color"&&h.jsx(di,{...Ur(o),value:h4(f)}),u==="gradient"&&h.jsx(f4,{value:f,onChange:(y,w)=>o.upValue(y,{partial:w})},c)]})}),d&&h.jsxs(h.Fragment,{children:[h.jsx(pe,{col:!0,children:h.jsx(Jt,{property:i})}),h.jsx(pe,{col:!0,children:h.jsx(Jt,{property:s})}),h.jsxs(pe,{children:[h.jsx(oe,{label:n.getProperty("background-repeat").getLabel(),children:h.jsx(Je,{...De(n.getProperty("background-repeat"))})}),h.jsx(oe,{label:n.getProperty("background-attachment").getLabel(),children:h.jsx(Je,{...De(n.getProperty("background-attachment"))})})]}),h.jsx(pe,{children:h.jsx(oe,{label:n.getProperty("background-origin").getLabel(),children:h.jsx(Je,{...De(n.getProperty("background-origin"))})})})]})]})}),h.jsx(pe,{property:l,children:h.jsx(oe,{property:l,children:h.jsx(di,{...Ur(l)})})}),h.jsx(pe,{property:a,children:h.jsx(oe,{property:a,children:h.jsx(Je,{...De(a)})})})]})}const pa=["%"],ha=["s","ms"],Ds=["deg","rad","grad"],nr=["px","%","em","rem","vw","vh"],km={type:"select",options:["visible","hidden","scroll","auto"].map(t=>({id:t})),default:"visible"},m4=t=>`linear-gradient(${t} 1%, ${t} 100%)`,uc=t=>({id:t,label:t.split("-").map(Ld).join(" ")}),Yv=t=>({property:e,to:n})=>{if(n.value){const r=e.getOption(),o=e.getParent().getProperty(t),i=o.getUnit(),s={units:r.units||[],min:r.min,max:r.max,unit:""};(!i||(s==null?void 0:s.units.indexOf(i))<0)&&(s.unit=(s==null?void 0:s.units[0])||""),o.up(s)}},b4=t=>{const e=`${t}-name`,n=`${t}-value`;return(r,{separatorLayers:o})=>{const i=r[t]||"";return i?i.split(o).map(s=>{const{name:l,value:a}=eu(s);return{[e]:l,[n]:a}}):[]}},Tm=t=>{const e={[el]:t};if(t.indexOf("url(")>-1)e[lr]=uo.Image;else if(t.indexOf("gradient(")>-1){const n=nh(t),r=n.colorStops,o=n.name.indexOf("linear")>=0;r.length===2&&o&&r[0].color===r[1].color?e[lr]=uo.Color:e[lr]=uo.Gradient}else e[lr]=uo.Color,e[el]=m4(t);return e},Am=(t="filter")=>{const e=`${t}-name`,n=`${t}-value`;return{property:t,type:"stack",layerSeparator:" ",fromStyle(r,{separatorLayers:o}){const i=r[t]||"";return i?i.split(o).map(s=>{const{name:l,value:a}=eu(s);return{[e]:l,[n]:a}}):[]},toStyle(r,{name:o}){return{[o]:`${r[e]}(${r[n]||"0"})`}},properties:[{property:e,type:"select",default:"blur",options:[{id:"blur",label:"Blur",min:0,units:["px","em","rem","vw","vh"]},{id:"brightness",label:"Brightness",min:0,units:["%"]},{id:"contrast",label:"Contrast",min:0,units:["%"]},{id:"grayscale",label:"Grayscale",min:0,max:100,units:["%"]},{id:"hue-rotate",label:"Hue rotate",min:0,max:360,units:["deg","rad","grad"]},{id:"invert",label:"Invert",min:0,max:100,units:["%"]},{id:"saturate",label:"Saturate",min:0,units:["%"]},{id:"sepia",label:"Sepia",min:0,max:100,units:["%"]}],onChange:Yv(n)},{property:n,type:"integer"}]}},ga=(t,{x:e,y:n,mergable:r}={})=>{const o={property:`${t}-x`,type:"integer",units:nr,...e},i={property:`${t}-y`,type:"integer",units:nr,...n};return{property:t,type:"composite",properties:[o,i],...r&&{fromStyle(s,{name:l,separator:a,property:c}){const[u,d]=c.getProperties(),[f,p]=(s[l]||"").split(a);return{[u.getId()]:s[u.getName()]||f||"",[d.getId()]:s[d.getName()]||p||f||""}},toStyle(s,{name:l,property:a}){const[c,u]=a.getProperties(),d=s[c.getId()],f=s[u.getId()];return{[l]:d===f?d:`${d} ${f}`}}}}},v4=(t,e="")=>{const n=`${t}-name`,r=`${t}-value`;return(o,{name:i})=>({[i]:`${o[n]}(${o[r]||e})`})};["top","middle","bottom"].map(uc),["none","solid","dotted","dashed","double","groove","ridge","inset","outset"].map(uc);ga("gap",{x:{property:"row-gap",min:0,default:"0"},y:{property:"column-gap",min:0,default:"0"},mergable:!0}),["baseline","top","middle","bottom"].map(uc),new RegExp("(?<!\\(.*[^)]),(?![^(]*\\))"),uo.Image,uo.Gradient,uo.Color,["background-position-x","background-position-y"].map(t=>({type:"integer",property:t,units:nr,default:"0px"})),["background-size-x","background-size-y"].map(t=>({type:"integer",property:t,units:nr,default:"auto"})),["border-top-width","border-right-width","border-bottom-width","border-left-width"].map(t=>({type:"integer",property:t,default:"0",units:nr})),["border-top-style","border-right-style","border-bottom-style","border-left-style"].map(t=>({type:"select",property:t,default:"none",options:[{id:"none",label:"None"},{id:"solid",label:"Solid"},{id:"dotted",label:"Dotted"},{id:"dashed",label:"Dashed"},{id:"double",label:"Double"},{id:"groove",label:"Groove"},{id:"ridge",label:"Ridge"},{id:"inset",label:"Inset"},{id:"outset",label:"Outset"}]})),["border-top-color","border-right-color","border-bottom-color","border-left-color"].map(t=>({type:"color",property:t,default:"currentColor"})),ga("overflow",{x:km,y:km,mergable:!0}),Am(),Am("backdrop-filter"),["width","height","min-width","min-height","max-width","max-height","padding","margin","color","font-size","line-height","letter-height","border","border-radius","background","opacity","box-shadow","text-shadow","filter","backdrop-filter","transform","all"].map(uc),ha[0],ha[0],b4("transform"),v4("transform","0"),Yv("transform-value"),ga("transform-origin",{x:{default:"50%"},y:{default:"50%"}}),ga("perspective-origin",{x:{default:"50%"},y:{default:"50%"}});Ob.gjsStudio;const y4=m.createContext(void 0),$l=()=>{const t=m.useContext(y4);if(!t)throw new Error("useStore must be used inside of StoreProvider");return t},ma=({icon:t,layout:e,tooltip:n,className:r,forceRemove:o,removeLayouts:i})=>({type:"button",icon:t,tooltip:n,className:r,size:"s",editorEvents:{[`${S0.layoutToggleId}${e.id}`]:({fromEvent:s,setState:l})=>{l({active:s.isOpen})}},onClick:({editor:s})=>{i==null||i.forEach(l=>s.runCommand(vt.layoutRemove,{id:l,force:o})),s.runCommand(vt.layoutToggle,{...e})}}),Mm={type:"static",layoutId:"leftPanelsContainer"},jm={width:240,overflow:"hidden"};ma({tooltip:"Blocks",removeLayouts:["pagesLayers","ps"],layout:{id:"blocks",layout:"panelBlocks",header:{label:"Blocks"},style:jm,placer:Mm}}),ma({tooltip:"Pages & Layers",removeLayouts:["blocks","ps"],layout:{id:"pagesLayers",layout:"panelPagesLayers",header:!1,style:jm,placer:Mm}}),ma({tooltip:"Page Settings",removeLayouts:["pagesLayers","blocks"],layout:{id:"ps",layout:"panelPageSettings",header:{label:"Page Settings"},style:{marginLeft:40}}}),ma({icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12,10.11C13.03,10.11 13.87,10.95 13.87,12C13.87,13 13.03,13.85 12,13.85C10.97,13.85 10.13,13 10.13,12C10.13,10.95 10.97,10.11 12,10.11M7.37,20C8,20.38 9.38,19.8 10.97,18.3C10.45,17.71 9.94,17.07 9.46,16.4C8.64,16.32 7.83,16.2 7.06,16.04C6.55,18.18 6.74,19.65 7.37,20M8.08,14.26L7.79,13.75C7.68,14.04 7.57,14.33 7.5,14.61C7.77,14.67 8.07,14.72 8.38,14.77C8.28,14.6 8.18,14.43 8.08,14.26M14.62,13.5L15.43,12L14.62,10.5C14.32,9.97 14,9.5 13.71,9.03C13.17,9 12.6,9 12,9C11.4,9 10.83,9 10.29,9.03C10,9.5 9.68,9.97 9.38,10.5L8.57,12L9.38,13.5C9.68,14.03 10,14.5 10.29,14.97C10.83,15 11.4,15 12,15C12.6,15 13.17,15 13.71,14.97C14,14.5 14.32,14.03 14.62,13.5M12,6.78C11.81,7 11.61,7.23 11.41,7.5C11.61,7.5 11.8,7.5 12,7.5C12.2,7.5 12.39,7.5 12.59,7.5C12.39,7.23 12.19,7 12,6.78M12,17.22C12.19,17 12.39,16.77 12.59,16.5C12.39,16.5 12.2,16.5 12,16.5C11.8,16.5 11.61,16.5 11.41,16.5C11.61,16.77 11.81,17 12,17.22M16.62,4C16,3.62 14.62,4.2 13.03,5.7C13.55,6.29 14.06,6.93 14.54,7.6C15.36,7.68 16.17,7.8 16.94,7.96C17.45,5.82 17.26,4.35 16.62,4M15.92,9.74L16.21,10.25C16.32,9.96 16.43,9.67 16.5,9.39C16.23,9.33 15.93,9.28 15.62,9.23C15.72,9.4 15.82,9.57 15.92,9.74M17.37,2.69C18.84,3.53 19,5.74 18.38,8.32C20.92,9.07 22.75,10.31 22.75,12C22.75,13.69 20.92,14.93 18.38,15.68C19,18.26 18.84,20.47 17.37,21.31C15.91,22.15 13.92,21.19 12,19.36C10.08,21.19 8.09,22.15 6.62,21.31C5.16,20.47 5,18.26 5.62,15.68C3.08,14.93 1.25,13.69 1.25,12C1.25,10.31 3.08,9.07 5.62,8.32C5,5.74 5.16,3.53 6.62,2.69C8.09,1.85 10.08,2.81 12,4.64C13.92,2.81 15.91,1.85 17.37,2.69M17.08,12C17.42,12.75 17.72,13.5 17.97,14.26C20.07,13.63 21.25,12.73 21.25,12C21.25,11.27 20.07,10.37 17.97,9.74C17.72,10.5 17.42,11.25 17.08,12M6.92,12C6.58,11.25 6.28,10.5 6.03,9.74C3.93,10.37 2.75,11.27 2.75,12C2.75,12.73 3.93,13.63 6.03,14.26C6.28,13.5 6.58,12.75 6.92,12M15.92,14.26C15.82,14.43 15.72,14.6 15.62,14.77C15.93,14.72 16.23,14.67 16.5,14.61C16.43,14.33 16.32,14.04 16.21,13.75L15.92,14.26M13.03,18.3C14.62,19.8 16,20.38 16.62,20C17.26,19.65 17.45,18.18 16.94,16.04C16.17,16.2 15.36,16.32 14.54,16.4C14.06,17.07 13.55,17.71 13.03,18.3M8.08,9.74C8.18,9.57 8.28,9.4 8.38,9.23C8.07,9.28 7.77,9.33 7.5,9.39C7.57,9.67 7.68,9.96 7.79,10.25L8.08,9.74M10.97,5.7C9.38,4.2 8,3.62 7.37,4C6.74,4.35 6.55,5.82 7.06,7.96C7.83,7.8 8.64,7.68 9.46,7.6C9.94,6.93 10.45,6.29 10.97,5.7Z" /></svg>',tooltip:"Custom Component",className:"gs-utl-mt-auto",layout:{id:"customLayout",layout:{type:"custom",component:()=>h.jsx("div",{children:"Custom Reat component"})},header:{label:"Custom"},style:{marginLeft:40}}});const Hl=()=>$l().appEditorStore,x4=()=>{try{return Hl()}catch{}};var _e=(t=>(t.alertRhombus="alertRhombus",t.alignHorizontalCenter="alignHorizontalCenter",t.alignHorizontalLeft="alignHorizontalLeft",t.alignHorizontalRight="alignHorizontalRight",t.applicationBracketsOutline="applicationBracketsOutline",t.arrowDown="arrowDown",t.arrowRight="arrowRight",t.arrowULeftTop="arrowULeftTop",t.arrowURightTop="arrowURightTop",t.borderAllVariant="borderAllVariant",t.borderRadius="borderRadius",t.borderStyle="borderStyle",t.cellphoneLink="cellphoneLink",t.check="check",t.checkBold="checkBold",t.checkboxBlank="checkboxBlank",t.chevronUp="chevronUp",t.chevronDown="chevronDown",t.chevronLeft="chevronLeft",t.chevronRight="chevronRight",t.close="close",t.codeBraces="codeBraces",t.cog="cog",t.contentCopy="contentCopy",t.contentSave="contentSave",t.delete="delete",t.dotsVertical="dotsVertical",t.email="email",t.emailOutline="emailOutline",t.eye="eye",t.eyedropperVariant="eyedropperVariant",t.eyeOff="eyeOff",t.eyeOffOutline="eyeOffOutline",t.eyeOutline="eyeOutline",t.fire="fire",t.flare="flare",t.floppy="floppy",t.folder="folder",t.fullscreen="fullscreen",t.gradientVertical="gradientVertical",t.helpCircle="helpCircle",t.image="image",t.information="information",t.informationVariant="informationVariant",t.layers="layers",t.link="link",t.lock="lock",t.lockOpenVariant="lockOpenVariant",t.menuDown="menuDown",t.newspaperVariantOutline="newspaperVariantOutline",t.paletteSwatch="paletteSwatch",t.panVertical="panVertical",t.phone="phone",t.plus="plus",t.plusBox="plusBox",t.powerPlug="powerPlug",t.refresh="refresh",t.rhombusOutline="rhombusOutline",t.tag="tag",t.target="target",t.targetVariant="targetVariant",t.textBoxMultiple="textBoxMultiple",t.trayArrowDown="trayArrowDown",t.unfoldLessHorizontal="unfoldLessHorizontal",t.unfoldMoreHorizontal="unfoldMoreHorizontal",t.viewDayOutline="viewDayOutline",t.viewGridPlus="viewGridPlus",t.web="web",t.xml="xml",t))(_e||{});const ld={alertRhombus:bC,alignHorizontalCenter:vC,alignHorizontalLeft:yC,alignHorizontalRight:xC,applicationBracketsOutline:wC,arrowDown:SC,arrowRight:CC,arrowULeftTop:EC,arrowURightTop:OC,borderAllVariant:_C,borderRadius:kC,borderStyle:TC,cellphoneLink:AC,check:MC,checkBold:jC,checkboxBlank:RC,chevronUp:LC,chevronDown:NC,chevronLeft:PC,chevronRight:DC,close:VC,codeBraces:IC,cog:$C,contentCopy:HC,contentSave:BC,delete:zC,dotsVertical:FC,email:WC,emailOutline:UC,eye:qC,eyedropperVariant:JC,eyeOff:GC,eyeOffOutline:KC,eyeOutline:YC,fire:ZC,flare:XC,floppy:QC,folder:eE,fullscreen:tE,gradientVertical:nE,helpCircle:rE,image:oE,information:iE,informationVariant:sE,layers:lE,link:aE,lock:uE,lockOpenVariant:dE,menuDown:fE,newspaperVariantOutline:pE,paletteSwatch:hE,panVertical:gE,phone:mE,plus:bE,plusBox:vE,powerPlug:yE,refresh:xE,rhombusOutline:wE,tag:SE,target:CE,targetVariant:EE,textBoxMultiple:OE,trayArrowDown:_E,unfoldLessHorizontal:kE,unfoldMoreHorizontal:TE,viewDayOutline:AE,viewGridPlus:ME,web:jE,xml:RE},w4="gs-cmp-icon",ge=ms(function({className:e,icon:n,size:r,rotate:o,horizontal:i,vertical:s}){var d;const l=(d=x4())==null?void 0:d.sdkCustomIcons,a=(l==null?void 0:l[n])||(ld==null?void 0:ld[n])||n,c=[i&&"scaleX(-1)",s&&"scaleY(-1)",o&&`rotate(${o}deg)`].filter(f=>!!f).join(" ");if(!a)return null;const u=tt(w4,e);return a.startsWith("<svg")||a.startsWith("<?xml")?h.jsx(FE,{className:u,style:{transform:c||void 0},svg:a,iconSize:r}):h.jsx(BE,{className:u,path:a,size:r,rotate:o,horizontal:i,vertical:s})}),Jv=({variant:t,size:e="m",className:n,active:r,border:o=!0,rounded:i=!0,disabled:s=!1,withBg:l,block:a,full:c})=>{const u=t==="pr",d=t==="out",f=t==="out-clear",p=t==="warn",g=t==="danger",b=o&&(d||f||!t);return["gs-utl-transition-colors gs-utl-cursor-pointer",a&&"block",e==="s"&&"gjs-p-1 text-sm",e==="m"&&"gjs-p-1 gjs-px-2",e==="m2"&&"gjs-p-1 gjs-px-3",e==="lg"&&"gjs-p-2 gjs-px-4 text-lg",n,i&&we.rnd,b&&`${we.b} ${he.br}`,l&&he.bg,b&&B(we.b,d&&he.bA,d&&he.tAo,!s&&he.hBgH),p&&B(he.bgW,he.hBgW,!s&&he.hBgW,"text-white"),g&&B(he.bgRed,!s&&he.hBgRed,"text-white"),u&&B(he.bgA2,!s&&he.hBgAct),r&&he.bgA,s&&"disabled:gs-utl-opacity-80 cursor-not-allowed",c&&"w-full",nc.focus]};function Cs({children:t,...e}){const{variant:n,size:r,active:o,border:i,rounded:s,block:l,full:a,className:c,icon:u,loading:d,withBg:f,type:p="button",...g}=e,b=d?{icon:cE,size:"18px",className:B("animate-spin-fast")}:w0(u)?{icon:u,size:"18px"}:u;return h.jsx("button",{className:B(Jv(e)),disabled:e.disabled,type:p,...g,children:b?h.jsxs(fe,{className:B("gap-2"),items:"center",nowrap:!0,children:[h.jsx(U,{children:h.jsx(ge,{...b})}),t&&h.jsx(U,{children:t})]}):t})}var Zv=(t=>(t.Info="info",t.Error="error",t.Success="success",t.Warning="warning",t))(Zv||{});const S4={info:he.bgA,error:"bg-red-500",success:"bg-green-500",warning:"bg-orange-400"},C4=m.forwardRef(function(e,n){const r={info:_e.informationVariant,error:_e.fire,success:_e.checkBold,warning:_e.alertRhombus},{children:o,className:i,content:s,id:l,buttons:a=[],variant:c="info",autoHideTimeout:u=3e3}=e,d=m.useRef(null),f=m.useRef(),p=r[c],g=S4[c];m.useImperativeHandle(n,()=>d.current,[]);const b=()=>{var S;return(S=e.onDismiss)==null?void 0:S.call(e,l)},v=()=>{u&&(f.current=setTimeout(b,u))},y=()=>f.current&&clearTimeout(f.current);m.useEffect(()=>(v(),y),[]);const w=s||o;return h.jsx(is,{className:Re(i,"overflow-hidden relative"),ref:d,onPointerEnter:y,onPointerLeave:v,children:h.jsxs(fe,{space:"m",items:"center",className:Re(dr.y),children:[h.jsx(U,{className:Re(g,we.pill,"text-white gjs-p-1"),children:h.jsx(ge,{icon:p,size:We.s})}),h.jsx(U,{grow:!0,className:Re("gjs-pr-3"),children:h.jsxs(fe,{col:!0,space:"xs",children:[h.jsx(U,{className:Re("text-lg font-medium leading-6"),children:e.header}),w&&h.jsx(U,{className:Re(he.txtLowEmphasis),children:w}),!!a.length&&h.jsx(fe,{space:"m",justify:"end",children:a.map(({id:S,...C})=>h.jsx(Cs,{...C},S))})]})}),h.jsx(U,{className:Re("absolute top-1 right-1"),children:h.jsx(Uv,{onClick:b,border:!1,children:h.jsx(ge,{icon:_e.close,size:We.s})})})]})})});ms(m.forwardRef(function({className:e,toasts:n,onDismiss:r,...o},i){const s=X2({});return h.jsx("div",{className:Re(e,"w-80 gs-utl-z-30"),...o,ref:s,children:n.map(l=>h.jsx(C4,{...l,className:Re("gjs-mb-2"),onDismiss:r},l.uuid||l.id))})}));var Xv=(t=>(t.dark="dark",t.light="light",t.auto="auto",t))(Xv||{});const E4={ratioDefault:!0,tc:!1,cl:!1,cr:!1,bc:!1},ad=`<svg viewBox="0 0 24 24">
|
|
292
|
+
<path d="M19 0H9C7.9 0 7 .9 7 2V18C7 19.1 7.9 20 9 20H19C20.1 20 21 19.1 21 18V2C21 .9 20.1 0 19 0M19 18H9V2H19V18M3 4V22C3 23.1 3.9 24 5 24H17V22H5V4H3M14 5L11 10L14 15L17 10L14 5Z" />
|
|
293
|
+
</svg>`,Qv="layout-icon-picker",O4="icons-layout-",ey="icons-list-layout",ty="gs-iconify-picker",rh="__iconify_collection",_4="https://api.iconify.design",cd=new Map;let ba;const k4=({collectionId:t})=>`https://cdn.jsdelivr.net/npm/@iconify-json/${t}@latest/icons.json`;async function ny({collectionId:t,editor:e}){try{if(cd.has(t))return cd.get(t);const n=await fetch(k4({collectionId:t}));if(!n.ok)throw new Error(`Failed to fetch collection: ${n.statusText}`);const r=await n.json();return cd.set(t,r),r}catch(n){console.error("Error fetching collection",n),e.runCommand(vt.toastAdd,D4());return}}async function T4({collectionIds:t,editor:e}){try{if(ba)return ba;const n=t?`?prefixes=${t.join(",")}`:"",r=await fetch(`${_4}/collections${n}`);if(!r.ok)throw new Error(`Failed to fetch collections: ${r.statusText}`);return ba=await r.json(),ba}catch(n){console.error("Error fetching collections",n),e.runCommand(vt.toastAdd,ry());return}}function Rm(){return{type:"button",label:"Open Icon Picker",name:"onActive",changeProp:!0,command(t){var e;(e=t.getSelected())==null||e.trigger("active")}}}async function A4({collectionIds:t,editor:e,component:n}){const r=await T4({collectionIds:t,editor:e});if(!r)return;const o=({icon:a,collectionId:c,iconId:u})=>{n.components(a),n.set({collectionId:c,iconId:u})},i=Object.entries(r).map(([a,c])=>({id:a,...c})).sort((a,c)=>a.name.localeCompare(c.name)),s=n.get("collectionId")??i[0].id;e.runCommand(vt.layoutToggle,{id:Qv,placer:{type:"dialog",size:"l",title:"Select Icon"},header:!1,layout:{type:"column",style:{height:500,gap:10},children:[R4({collectionsList:i,collectionId:s,editor:e,handleClick:o}),{id:ey,type:"column",grow:!0}]}});const l=await ny({collectionId:s,editor:e});l&&wf({editor:e,collection:l,handleClick:o,collectionId:s})}function M4({editor:t,collection:e}){t.em.set(rh,e)}function j4(t){return t.em.get(rh)}function wf(t){const{editor:e}=t,n={id:O4,layout:N4(t),header:!1,style:{height:"100%"},placer:{type:"static",layoutId:ey}};e.runCommand(vt.layoutRemove,{id:n.id,force:!0}),setTimeout(()=>e.runCommand(vt.layoutAdd,n),10)}function R4(t){const{collectionsList:e,collectionId:n,editor:r,handleClick:o}=t,i=e.map(({id:s,name:l,total:a})=>({id:s,label:`${l} (${a})`})).sort((s,l)=>s.label.localeCompare(l.label));return{type:"column",style:{gap:10},className:`${ty}__header`,children:[{type:"selectField",value:n,options:i,emptyState:"Select an icon collection",onChange:async({setState:s,value:l})=>{const a=await ny({collectionId:l,editor:r});a&&(s({value:l}),M4({editor:r,collection:a}),wf({editor:r,collection:a,handleClick:o,collectionId:l}))}},{type:"inputField",value:"",placeholder:"Search icons inside collection...",editorEvents:{[`change:${rh}`]:({setState:s})=>s({value:""})},onInput:({setState:s,value:l,editor:a})=>{const c=j4(a);if(!c)return;const u=Object.fromEntries(Object.entries(c.icons).filter(([d])=>d.includes(l)));s({value:l}),wf({editor:a,collection:c,handleClick:o,collectionId:l,collectionFiltered:{...c,icons:u}})}}]}}function N4({collection:t,collectionFiltered:e,handleClick:n}){const{height:r=24,width:o=24,icons:i,prefix:s}=e||t,l=Object.entries(i).map(([a,{body:c}])=>({name:a,body:c}),{});return{type:"column",className:`${ty}__content`,style:{height:"100%"},children:{type:"virtualList",items:l,itemLayout:({item:a})=>[{type:"custom",render:c=>{const{editor:u,addEl:d,removeEl:f}=c,p=document.createElementNS("http://www.w3.org/2000/svg","svg");p.setAttribute("xmlns","http://www.w3.org/2000/svg"),p.innerHTML=a.body,p.setAttribute("viewBox",`0 0 ${o} ${r}`);const{cssWidth:g,cssHeight:b}=P4(o,r);p.style.cssText=`width: ${g}px; height: ${b}px; cursor: pointer;`,p.addEventListener("mouseover",()=>{p.style.border="2px solid currentColor",p.style.borderRadius="4px",p.style.padding="4px"}),p.addEventListener("mouseout",()=>{p.style.border="none"});const v=()=>{const y=p.cloneNode(!0);y.removeAttribute("style");const w=y.outerHTML;n({icon:w,collectionId:s,iconId:a.name}),u==null||u.runCommand(vt.layoutRemove,{id:Qv})};return p.addEventListener("click",v),d(p),()=>{p.removeEventListener("click",v),f(p)}}}]}}}function P4(t,e){const n=t/e;let r=48,o=48;return n>1?o=48/n:n<1&&(r=48*n),{cssWidth:r,cssHeight:o}}function ry(){return{id:"toast-error-getCollections",header:"Error",content:"Error fetching collections",variant:Zv.Error}}function D4(){return{...ry(),id:"toast-error-getCollection",content:"Error fetching collection"}}const L4="iconifyComponent",V4=function(t,e={}){var p;const{Components:n,Blocks:r}=t,{collections:o,extendIconComponent:i=!0,licenseKey:s,block:l={}}=e,a="icon",c="iconify",u="Iconify",d="data-type-iconify",f={events:()=>({dblclick:"onActive"}),onActive(){A4({collectionIds:o,editor:t,component:this.model})}};if(n.addType(c,{block:l&&{label:u,media:ad,content:{type:c},category:"Extra",activate:!0,...l},isComponent:g=>Ma(g,d),model:{defaults:{name:u,icon:ad,droppable:!1,attributes:{[d]:!0},resizable:E4,components:ad,style:{width:"50px",height:"50px"},traits:[Rm()]},init(){this.listenTo(this.components(),"change add",this.disableLayers),this.disableLayers()},disableLayers(){this.components().forEach(g=>g.set({layerable:!1,locked:!0}))}},view:f}),i){const g=(p=n.getType(a))==null?void 0:p.model,[b,v,...y]=g.getDefaults().traits;n.addType(a,{model:{defaults:{traits:[b,v,Rm(),...y]}},view:f})}wr({editor:t,licenseKey:s,plan:Ht.startup,pluginName:L4,cleanup:()=>{r.remove(c),n.removeType(c)}})},I4=xr(V4);var ve=(t=>(t.table="table",t.tableSettings="tableSettings",t.tableDelete="tableDelete",t.tableHead="tableHead",t.tableFoot="tableFoot",t.tableCellItems="tableCellItems",t.tableCellProperties="tableCellProperties",t.tableCellMerge="tableCellMerge",t.tableCellSplit="tableCellSplit",t.tableRowItems="tableRowItems",t.tableRowInsertBefore="tableRowInsertBefore",t.tableRowInsertAfter="tableRowInsertAfter",t.tableRowDelete="tableRowDelete",t.tableRowProperties="tableRowProperties",t.tableRowCut="tableRowCut",t.tableRowCopy="tableRowCopy",t.tableRowPasteBefore="tableRowPasteBefore",t.tableRowPasteAfter="tableRowPasteAfter",t.tableColumn="tableColumn",t.tableColumnItems="tableColumnItems",t.tableColumnInsertBefore="tableColumnInsertBefore",t.tableColumnInsertAfter="tableColumnInsertAfter",t.tableColumnDelete="tableColumnDelete",t.tableColumnCut="tableColumnCut",t.tableColumnCopy="tableColumnCopy",t.tableColumnPasteBefore="tableColumnPasteBefore",t.tableColumnPasteAfter="tableColumnPasteAfter",t))(ve||{});const Ie={table:'<svg viewBox="0 0 24 24"><path d="M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2m0 4v4h6V8H5m8 0v4h6V8h-6m-8 6v4h6v-4H5m8 0v4h6v-4h-6Z"/></svg>',tableSettings:'<svg viewBox="0 0 24 24"><path d="M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2m0 4v4h6V8H5m8 0v4h6V8h-6m-8 6v4h6v-4H5m8 0v4h6v-4h-6Z"/></svg>',tableDelete:'<svg viewBox="0 0 24 24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14zM5 6v12h14V6H5z"/><path d="m14.4 8.6 1 1-2.3 2.4 2.3 2.4-1 1-2.4-2.3-2.4 2.3-1-1 2.3-2.4-2.3-2.4 1-1 2.4 2.3z"/></svg>',tableHead:'<svg viewBox="0 0 24 24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm-8 11H5v3h6v-3Zm8 0h-6v3h6v-3Zm0-5h-6v3h6v-3ZM5 13h6v-3H5v3Z"/></svg>',tableFoot:'<svg viewBox="0 0 24 24" data-test="1" style="transform: rotate(180deg);"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm-8 11H5v3h6v-3Zm8 0h-6v3h6v-3Zm0-5h-6v3h6v-3ZM5 13h6v-3H5v3Z"/></svg>',tableColumn:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14Zm0 9h-4v5h4v-5Zm-6 0H9v5h4v-5Zm0-7H9v5h4V6Zm6 0h-4v5h4V6Z"/></svg>',tableCellItems:"",tableCellProperties:'<svg viewBox="0 0 24 24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6l2-2h14zm-8 9H5v5h6v-5zm8 0h-6v5h6v-5zm-8-7H5v5h6V6z"/></svg>',tableCellMerge:'<svg viewBox="0 0 24 24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6l2-2h14zM5 16v2h3v-2H5zm14-5h-9v7h9v-7zm0-5h-4v3h4V6zM8 6H5v3h3V6zm5 0h-3v3h3V6zm-8 8h3v-3H5v3z"/></svg>',tableCellSplit:'<svg viewBox="0 0 24 24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14zM8 15.5H5V18h3v-2.5zm11-5h-9V18h9v-7.5zm-2.5 1 1 1-2 2 2 2-1 1-2-2-2 2-1-1 2-2-2-2 1-1 2 2 2-2zm-8.5-1H5v3h3v-3zM19 6h-4v2.5h4V6zM8 6H5v2.5h3V6zm5 0h-3v2.5h3V6z"/></svg>',tableRowItems:"",tableRowInsertBefore:'<svg viewBox="0 0 24 24"><path d="M6 4a1 1 0 1 1 0 2H5v6h14V6h-1a1 1 0 0 1 0-2h2c.6 0 1 .4 1 1v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5c0-.6.4-1 1-1h2zm5 10H5v4h6v-4zm8 0h-6v4h6v-4zM12 3c.5 0 1 .4 1 .9V6h2a1 1 0 0 1 0 2h-2v2a1 1 0 0 1-2 .1V8H9a1 1 0 0 1 0-2h2V4c0-.6.4-1 1-1z"/></svg>',tableRowInsertAfter:'<svg viewBox="0 0 24 24"><path d="M12 13c.5 0 1 .4 1 .9V16h2a1 1 0 0 1 .1 2H13v2a1 1 0 0 1-2 .1V18H9a1 1 0 0 1-.1-2H11v-2c0-.6.4-1 1-1zm6 7a1 1 0 0 1 0-2h1v-6H5v6h1a1 1 0 0 1 0 2H4a1 1 0 0 1-1-1V6c0-1.1.9-2 2-2h14a2 2 0 0 1 2 2v13c0 .5-.4 1-.9 1H18zM11 6H5v4h6V6zm8 0h-6v4h6V6z"/></svg>',tableRowDelete:'<svg viewBox="0 0 24 24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14zm0 2H5v3h2.5v2H5v2h2.5v2H5v3h14v-3h-2.5v-2H19v-2h-2.5V9H19V6zm-4.7 1.8 1.2 1L13 12l2.6 3.3-1.2 1-2.3-3-2.3 3-1.2-1L11 12 8.5 8.7l1.2-1 2.3 3 2.3-3z"/></svg>',tableRowProperties:'<svg viewBox="0 0 24 24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14zM5 15v3h6v-3H5zm14 0h-6v3h6v-3zm0-9h-6v3h6V6zM5 9h6V6H5v3z"/></svg>',tableRowCut:'<svg viewBox="0 0 24 24"><path fill-rule="evenodd" d="M22 3v5H9l3 3 2-2h4l-4 4 1 1h.5c.4 0 .8 0 1.2.3.5.2.9.4 1.2.8.7.6 1 1.3 1 2.2.2.8 0 1.5-.6 2l-.8.5-1 .2c-.4 0-.8 0-1.2-.3a3.9 3.9 0 0 1-2.1-2.2c-.2-.5-.3-1-.2-1.5l-1-1-1 1c0 .5 0 1-.2 1.5-.1.5-.4 1-.9 1.4-.3.4-.7.6-1.2.8l-1.2.3c-.4 0-.7 0-1-.2-.3 0-.6-.3-.8-.5-.5-.5-.8-1.2-.7-2a3 3 0 0 1 1-2.2A3.7 3.7 0 0 1 8.6 14H9l1-1-4-4-.5-1a3.3 3.3 0 0 1 0-2c0-.4.3-.7.5-1l2 2V3h14zM8.5 15.3h-.3a2.6 2.6 0 0 0-.8.4 2.5 2.5 0 0 0-.9 1.1l-.1.4v.7l.2.5.5.2h.7a2.5 2.5 0 0 0 .8-.3L9 18l.4-.4.2-.4.1-.4v-.7a1 1 0 0 0-.2-.5 1 1 0 0 0-.4-.2h-.5zm7 0H15a1 1 0 0 0-.4.3 1 1 0 0 0-.2.5 1.5 1.5 0 0 0 0 .7v.4a2.8 2.8 0 0 0 .5.7h.1a2.8 2.8 0 0 0 .8.6l.4.1h.7l.5-.2.2-.5v-.7a2.6 2.6 0 0 0-.3-.8 2.4 2.4 0 0 0-.7-.7 2.5 2.5 0 0 0-.8-.3h-.3zM12 11.6c-.4 0-.7.1-1 .4-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4s.7-.1 1-.4c.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4zm8.5-7.1h-11v2h11v-2z"/></svg>',tableRowCopy:'<svg viewBox="0 0 24 24"><path d="M22 11v7H6v-7h16zm-2 2H8v3h12v-3zm-1-6v2H4v5H2V7h17z"/></svg>',tableRowPasteBefore:'<svg viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 1a3 3 0 0 1 2.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h12v-4h2v4c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2h3.3A3 3 0 0 1 12 1zm10 7v5H8V8h14zm-1.5 1.5h-11v2h11v-2zM12 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>',tableRowPasteAfter:'<svg viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 1a3 3 0 0 1 2.8 2H18c1 0 2 .8 2 1.9V11h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h14c0 1-.8 2-1.9 2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2h3.3A3 3 0 0 1 12 1zm10 11v5H8v-5h14zm-1.5 1.5h-11v2h11v-2zM12 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>',tableColumnItems:"",tableColumnInsertBefore:'<svg viewBox="0 0 24 24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a1 1 0 0 1-1-1v-2a1 1 0 0 1 2 0v1h8V6H5v1a1 1 0 1 1-2 0V5c0-.6.4-1 1-1h15zm0 9h-4v5h4v-5zM8 8c.5 0 1 .4 1 .9V11h2a1 1 0 0 1 .1 2H9v2a1 1 0 0 1-2 .1V13H5a1 1 0 0 1-.1-2H7V9c0-.6.4-1 1-1zm11-2h-4v5h4V6z"/></svg>',tableColumnInsertAfter:'<svg viewBox="0 0 24 24"><path d="M20 4c.6 0 1 .4 1 1v2a1 1 0 0 1-2 0V6h-8v12h8v-1a1 1 0 0 1 2 0v2c0 .5-.4 1-.9 1H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h15zM9 13H5v5h4v-5zm7-5c.5 0 1 .4 1 .9V11h2a1 1 0 0 1 .1 2H17v2a1 1 0 0 1-2 .1V13h-2a1 1 0 0 1-.1-2H15V9c0-.6.4-1 1-1zM9 6H5v5h4V6z"/></svg>',tableColumnDelete:'<svg viewBox="0 0 24 24"><path d="M19 4a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h14zm-4 4h-2V6h-2v2H9V6H5v12h4v-2h2v2h2v-2h2v2h4V6h-4v2zm.3.5 1 1.2-3 2.3 3 2.3-1 1.2L12 13l-3.3 2.6-1-1.2 3-2.3-3-2.3 1-1.2L12 11l3.3-2.5z"/></svg>',tableColumnCut:'<svg viewBox="0 0 24 24"><path fill-rule="evenodd" d="M7.2 4.5a3 3 0 0 1 2.2 1A3.7 3.7 0 0 1 10.5 8v.5l1 1 4-4 1-.5a3.3 3.3 0 0 1 2 0c.4 0 .7.3 1 .5L17 8h4v13h-6V10l-1.5 1.5.5.5v4l-2.5-2.5-1 1v.5c0 .4 0 .8-.3 1.2-.2.5-.4.9-.8 1.2-.6.7-1.3 1-2.2 1-.8.2-1.5 0-2-.6l-.5-.8-.2-1c0-.4 0-.8.3-1.2A3.9 3.9 0 0 1 7 12.7c.5-.2 1-.3 1.5-.2l1-1-1-1c-.5 0-1 0-1.5-.2-.5-.1-1-.4-1.4-.9-.4-.3-.6-.7-.8-1.2L4.5 7c0-.4 0-.7.2-1 0-.3.3-.6.5-.8.5-.5 1.2-.8 2-.7zm12.3 5h-3v10h3v-10zM8 13.8h-.3l-.4.2a2.8 2.8 0 0 0-.7.4v.1a2.8 2.8 0 0 0-.6.8l-.1.4v.7l.2.5.5.2h.7a2.6 2.6 0 0 0 .8-.3 2.4 2.4 0 0 0 .7-.7 2.5 2.5 0 0 0 .3-.8 1.5 1.5 0 0 0 0-.8 1 1 0 0 0-.2-.4 1 1 0 0 0-.5-.2H8zm3.5-3.7c-.4 0-.7.1-1 .4-.3.3-.4.6-.4 1s.1.7.4 1c.3.3.6.4 1 .4s.7-.1 1-.4c.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4zM7 5.8h-.4a1 1 0 0 0-.5.3 1 1 0 0 0-.2.5v.7a2.5 2.5 0 0 0 .3.8l.2.3h.1l.4.4.4.2.4.1h.7L9 9l.2-.4a1.6 1.6 0 0 0 0-.8 2.6 2.6 0 0 0-.3-.8 2.5 2.5 0 0 0-1.2-1l-.4-.1H7z"/></svg>',tableColumnCopy:'<svg viewBox="0 0 24 24"><path d="M17 6v16h-7V6h7zm-2 2h-3v12h3V8zm-2-6v2H8v15H6V2h7z"/></svg>',tableColumnPasteBefore:'<svg viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 1a3 3 0 0 1 2.8 2H18c1 0 2 .8 2 1.9V18c0 1-.8 2-1.9 2H11v-2h7V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v2H4V5c0-1 .8-2 1.9-2h3.3A3 3 0 0 1 12 1zm-2 7v12H4V8h6zM8.5 9.5h-3v9h3v-9zM12 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>',tableColumnPasteAfter:'<svg viewBox="0 0 24 24"><path fill-rule="evenodd" d="M12 1a3 3 0 0 1 2.8 2H18c1 0 2 .8 2 1.9V7h-2V5h-2v1c0 .6-.4 1-1 1H9a1 1 0 0 1-1-1V5H6v13h7v2H6c-1 0-2-.8-2-1.9V5c0-1 .8-2 1.9-2h3.3A3 3 0 0 1 12 1zm8 7v12h-6V8h6zm-1.5 1.5h-3v9h3v-9zM12 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>'},pr="table",oy="thead",iy="tfoot",Sf="tbody",nn="row",dt="cell",oh="clipboardTable",$4=[pr,oy,iy,Sf,nn,dt],au=t=>t.em.get(oh)||[],H4=t=>t.every(e=>e.is(dt)),ih=(t,e)=>{const{editor:n,event:r,opts:o}=t,i=r.currentTarget||r.target,{x:s,y:l,width:a,height:c}=i.getBoundingClientRect(),u={style:{width:240,height:300},placer:{type:"popover",closeOnClickAway:!0,x:s,y:l,w:a,h:c},layout:{type:"tabs",value:"props",tabs:[{id:"styles",label:"Styles",children:{type:"panelStyles"}},{id:"props",label:"Properties",children:{type:"panelProperties",style:{padding:"14px 7px"}}}]},...e};xo(o.openSettings)?o.openSettings({...t,layoutProps:u}):n.runCommand(vt.layoutToggle,u)},B4=(t,{rows:e=1,cells:n=5,text:r}={})=>({type:t,components:Array.from(Array(e).keys()).map(o=>({type:nn,components:Array.from(Array(n).keys()).map(i=>({type:dt,components:r?{type:"text",content:xo(r)?r({y:o,x:i}):r}:void 0}))}))}),sy="Table settings",ly=t=>{const{component:e}=t;return e.is(pr)?e:e.closestType(pr)},z4=t=>{var e;(e=ly(t))==null||e.remove(t.opts)},F4=t=>{const e=ly(t);e&&(t.editor.select(e),ih(t,{id:"tableSettings",header:{label:sy}}))},ay=t=>[{id:ve.table,icon:Ie[ve.table],label:"Table",items:[{id:ve.tableSettings,label:sy,icon:Ie[ve.tableSettings],onClick:({event:n})=>F4({...t,event:n})},{id:ve.tableDelete,label:"Delete table",icon:Ie[ve.tableDelete],onClick:()=>z4(t)}]}],cy=({editor:t})=>{const e=au(t);return e.length&&H4(e)},Nm=({component:t,editor:e,after:n})=>{if(!t.is(dt))return;const r=t.closestType(pr),o=t.closestType(nn),i=t.index()+(n?1:0);r==null||r.findType(nn).forEach(l=>l.append({type:dt},{at:i}));const s=o==null?void 0:o.components().at(i);s&&e.select(s)},uy=({component:t,opts:e})=>{if(!t.is(dt))return;const n=t.closestType(pr),r=t.index();n==null||n.findType(nn).forEach(o=>{var i;return(i=o.components().at(r))==null?void 0:i.remove(e)})},dy=({component:t,editor:e})=>{if(!t.is(dt))return;const n=t.closestType(pr),r=t.index(),o=(n==null?void 0:n.findType(nn).map(i=>i.components().at(r)))||[];o.length&&e.em.set(oh,o)},Pm=t=>{const{component:e,editor:n,after:r}=t;if(!e.is(dt)||!cy(t))return;const o=au(n),i=e.closestType(pr),s=e.index()+(r?1:0);i==null||i.findType(nn).forEach((l,a)=>{const c=o[a],u=(c==null?void 0:c.clone())||{type:dt};l.append(u,{at:s})})},W4=t=>{const{component:e}=t;e.is(dt)&&(dy(t),uy({...t,opts:{temporary:!0}}))},U4=t=>{const e=cy(t);return[{id:ve.tableColumnItems,icon:Ie[ve.tableColumn],label:"Column",items:[{id:ve.tableColumnInsertBefore,label:"Insert column before",icon:Ie[ve.tableColumnInsertBefore],onClick:()=>Nm(t)},{id:ve.tableColumnInsertAfter,label:"Insert column after",icon:Ie[ve.tableColumnInsertAfter],onClick:()=>Nm({...t,after:!0})},{id:ve.tableColumnDelete,label:"Delete column",icon:Ie[ve.tableColumnDelete],onClick:()=>uy(t)},{id:ve.tableColumnCut,label:"Cut column",icon:Ie[ve.tableColumnCut],onClick:()=>W4(t)},{id:ve.tableColumnCopy,label:"Copy column",icon:Ie[ve.tableColumnCopy],onClick:()=>dy(t)},{id:ve.tableColumnPasteBefore,label:"Paste column before",icon:Ie[ve.tableColumnPasteBefore],disabled:!e,onClick:()=>Pm(t)},{id:ve.tableColumnPasteAfter,label:"Paste column after",icon:Ie[ve.tableColumnPasteAfter],disabled:!e,onClick:()=>Pm({...t,after:!0})}]}]},fy="Row settings",q4=t=>t.every(e=>e.is(nn)),Es=t=>{const{component:e}=t,n=e.is(dt),r=e.is(nn);if(!(!n&&!r))return r?e:e.closestType(nn)},Dm=t=>{const{component:e,editor:n,after:r}=t,o=Es(t);if(!o)return;const i=o.index()+(r?1:0),s=o.components().length,l=Array.from(Array(s).keys()).map(()=>({type:dt})),a=o.parent();if(a){const c=a.append({type:nn,components:l},{at:i})[0];if(e.is(dt)&&c){const u=e.index(),d=c.components().at(u);d&&n.select(d)}}},py=t=>{var e;(e=Es(t))==null||e.remove(t.opts)},hy=t=>{const e=Es(t);e&&t.editor.em.set(oh,[e])},Lm=t=>{var l;const{editor:e,after:n}=t,r=Es(t);if(!r||!gy(t))return;const i=au(e)[0],s=r.index()+(n?1:0);i&&((l=r.parent())==null||l.append(i.clone(),{at:s}))},G4=t=>{Es(t)&&(hy(t),py({...t,opts:{temporary:!0}}))},gy=({editor:t})=>{const e=au(t);return e.length&&q4(e)},K4=t=>{const e=Es(t);e&&(t.editor.select(e),ih(t,{id:"tableRowSettings",header:{label:fy}}))},my=t=>{const e=gy(t);return[{id:ve.tableRowItems,icon:Ie[ve.tableRowProperties],label:"Row",items:[{id:ve.tableRowInsertBefore,label:"Insert row before",icon:Ie[ve.tableRowInsertBefore],onClick:()=>Dm(t)},{id:ve.tableRowInsertAfter,label:"Insert row after",icon:Ie[ve.tableRowInsertAfter],onClick:()=>Dm({...t,after:!0})},{id:ve.tableRowDelete,label:"Delete row",icon:Ie[ve.tableRowDelete],onClick:()=>py(t)},{id:ve.tableRowProperties,label:fy,icon:Ie[ve.tableRowProperties],onClick:({event:r})=>K4({...t,event:r})},{id:ve.tableRowCut,label:"Cut row",icon:Ie[ve.tableRowCut],onClick:()=>G4(t)},{id:ve.tableRowCopy,label:"Copy row",icon:Ie[ve.tableRowCopy],onClick:()=>hy(t)},{id:ve.tableRowPasteBefore,label:"Paste row before",icon:Ie[ve.tableRowPasteBefore],disabled:!e,onClick:()=>Lm(t)},{id:ve.tableRowPasteAfter,label:"Paste row after",icon:Ie[ve.tableRowPasteAfter],disabled:!e,onClick:()=>Lm({...t,after:!0})}]},...ay(t)]},sh=t=>{const e=t.attributes.attributes||{},n=parseInt(`${e.rowspan||1}`,10),r=parseInt(`${e.colspan||1}`,10);return{rowspan:n,colspan:r}};function by(t){const e=[];return t.components().forEach((n,r)=>{n.components().each((o,i)=>{const{rowspan:s,colspan:l}=sh(o);if(e[r])for(;e[r][i];)i++;for(let a=r;a<r+s;a++){e[a]||(e[a]=[]);for(let c=i;c<i+l;c++)e[a][c]={real:a===r&&c===i,cell:o,rowspan:s,colspan:l}}})}),e}function Ii(t,e,n){var r;return(r=t[n])==null?void 0:r[e]}const Cf=t=>t.closestType(nn);function Y4(t,{x:e,y:n,rows:r,cols:o}){var l;let i=Cf(t[n][e].cell),s;for(let a=1;a<=r;a++)if(i=(l=i==null?void 0:i.parent())==null?void 0:l.components().at(i.index()+1),i){for(s=e;s>=0;s--){const{cell:c}=t[n+a][s],u=Cf(c);if(u===i){for(let d=1;d<=o;d++){const f=c.index();u.append({type:dt},{at:f+1})}break}}if(s===-1){const u=i.components().at(0).index();for(let d=1;d<=o;d++)i.append({type:dt},{at:u})}}}function vy(t){for(let e=0;e<t.length;e++)for(let n=0;n<t[e].length;n++){const o=t[e][n].cell;if(o.em.selected.hasComponent(o)){const{rowspan:i,colspan:s}=sh(o);if(s>1||i>1){o.addAttributes({colspan:1,rowspan:1});for(let l=0;l<s-1;l++){const a=o.index();Cf(o).append({type:dt},{at:a+1})}Y4(t,{x:n,y:e,rows:i-1,cols:s})}}}}function J4(t){const e=[];t.components().forEach(n=>{n.components().length||e.push(n)}),e.forEach(n=>n.remove())}const cu=(t,e={})=>{var s;const n=by(t),{em:r}=t;let o,i;for(let l=0;l<n.length;l++)for(let a=0;a<n[l].length;a++){const c=n[l][a];if((s=e.selected)!=null&&s.includes(c.cell)||r.selected.hasComponent(c.cell)){const u={x:a,y:l};o||(o=u),i=u}}return{grid:n,startPos:o,endPos:i}};function Z4(t,e={}){const n=cu(t),{startPos:r,endPos:o}=n;let{grid:i}=n;const{em:s}=t;if(!r||!o)return;const l=r.x,a=r.y,c=o.x,u=o.y,d=Ii(i,l,a),f=Ii(i,c,u);if(d&&f){vy(i),i=by(t);const p=[],g=Ii(i,l,a).cell;g.addAttributes({colspan:c-l+1,rowspan:u-a+1});for(let b=a;b<=u;b++)for(let v=l;v<=c;v++){const y=Ii(i,v,b);if(!y)continue;const{cell:w}=y;w!==g&&p.push(w)}p.forEach(b=>{e.mergeContent&&g.append(b.components().models),b.remove()}),s.setSelected(g),J4(t)}}const yy="Cell settings",X4="Merge cells",Q4="Split cell",ej=t=>t.closestType(nn),ls=t=>{var e;return(e=ej(t))==null?void 0:e.parent()},tj=t=>{const e=t.editor.getSelectedAll(),n=ls(e[0]),r=e[0];if(!n||!(r!=null&&r.is(dt))||e.length>1)return!1;const{rowspan:o,colspan:i}=sh(r);return!(i<2&&o<2)},nj=t=>{const n=t.editor.getSelectedAll()[0],r=ls(n),{grid:o}=cu(r);vy(o)},xy=t=>{const e=t.editor.getSelectedAll(),n=ls(e[0]);if(!n||e.length<2||e.some(l=>!l.is(dt)||ls(l)!==n))return!1;const{grid:r,startPos:o,endPos:i}=cu(n),{em:s}=n;if(!o||!i)return!1;for(let l=o.y;l<=i.y;l++)for(let a=o.x;a<=i.x;a++){const c=Ii(r,a,l);if(!c||!s.selected.hasComponent(c.cell))return!1}return!0},rj=t=>{const{editor:e}=t;if(!xy(t))return;const n=e.getSelectedAll(),r=ls(n[0]);Z4(r,{mergeContent:!0})},oj=t=>{ih(t,{id:"tableCellSettings",header:{label:yy}})},ij=t=>[{id:ve.tableCellItems,icon:Ie[ve.tableCellProperties],label:"Cell",items:[{id:ve.tableCellProperties,label:yy,icon:Ie[ve.tableCellProperties],onClick:({event:n})=>oj({...t,event:n})},{id:ve.tableCellMerge,label:X4,icon:Ie[ve.tableCellMerge],onClick:()=>rj(t),disabled:!xy(t)},{id:ve.tableCellSplit,label:Q4,icon:Ie[ve.tableCellSplit],onClick:()=>nj(t),disabled:!tj(t)}]},...U4(t),...my(t)],sj=t=>{const e=t[0]&&ls(t[0]);if(!e)return;const{grid:n,startPos:r,endPos:o}=cu(e,{selected:t});if(!r||!o)return;const i=[];for(let s=r.y;s<=o.y;s++)for(let l=r.x;l<=o.x;l++){const a=Ii(n,l,s);a&&i.push(a.cell)}i.length&&e.em.setSelected(i,{fromCell:!0})},lj="tableComponent",aj=function(t,e={}){const n={block:{},...e},{Components:r}=t,o={copyable:!1,emptyState:!0,highlightable:!1,stylable:["color","font-family","font-size","font-weight","line-height","text-align","vertical-align","background-color","border-width","border-style","border-color"]};r.addType(pr,{block:n.block&&{label:"Table",media:Ie.table,category:"Extra",content:{type:pr,style:{width:"100%"}},select:!0,...n.block},model:{defaults:{emptyState:!0,highlightable:!1,icon:Ie.table,stylable:["width","height","margin","font-family","font-size","font-weight","line-height","text-align","background","background-color","border-width","border-style","border-color"],traits:[{type:"number",min:0,name:"cellspacing",label:"Cell spacing"},{type:"number",min:0,name:"cellpadding",label:"Cell padding"},{id:"tableCaption",type:"checkbox",label:"Caption",setValue({component:s,value:l,emitUpdate:a}){const c=s.find("caption")[0];l?!c&&s.append({type:"text",tagName:"caption",components:{type:"textnode",content:"Caption"}}):c==null||c.remove(),a(),t.refresh({tools:!0})},getValue(s){return!!s.component.find("caption")[0]}}],components:B4(Sf,{rows:5}),contextMenu:({items:s,editor:l,component:a})=>[...ay({editor:l,component:a,opts:n}),...s]}}}),r.addType(oy,{model:{defaults:{icon:Ie.tableHead,...o}}}),r.addType(iy,{model:{defaults:{icon:Ie.tableFoot,...o}}}),r.addType(Sf,{model:{defaults:{icon:Ie.tableRowProperties,...o}}}),r.addType(nn,{model:{defaults:{icon:Ie.tableRowProperties,emptyState:!0,highlightable:!1,stylable:["height","text-align","border-width","border-style","border-color"],traits:[],contextMenu:({items:s,editor:l,component:a})=>[...my({editor:l,component:a,opts:n}),...s]}}}),r.addType(dt,{model:{defaults:{icon:Ie.tableCellProperties,emptyState:{styleOut:"height: 1px"},stylable:["width","height","padding","background-color","text-align","vertical-align","border-width","border-style","border-color"],traits:[{id:"tableCellType",type:"select",options:[{value:"td",name:"Cell"},{value:"th",name:"Header Cell"}],label:"Cell type",name:"tagName",changeProp:!0},{id:"tableCellScope",type:"select",options:[{value:!1,name:"None"},{value:"row",name:"Row"},{value:"col",name:"Column"},{value:"rowgroup",name:"Row group"},{value:"colgroup",name:"Column group"}],label:"Scope",name:"scope"}],contextMenu:({items:s,editor:l,component:a})=>[...ij({editor:l,component:a,opts:n}),...s]}}});const i=xb((s,l)=>{var d;const a=t.getSelectedAll(),c=!!((d=l==null?void 0:l.event)!=null&&d.shiftKey);if(a.length<2||!c||l.fromCell)return;const u=a.map(f=>f.is(dt)?f:f.closestType(dt)).filter(Boolean);u.length===a.length&&sj(u)},0);t.on("component:select",i),wr({editor:t,plan:Ht.startup,licenseKey:n.licenseKey,pluginName:lj,cleanup:()=>{t.off("component:select",i),t.Blocks.remove(pr),$4.forEach(s=>r.removeType(s))}})},cj=xr(aj),Vm="page://",$o="list-pages",Ci="list-pages-item",Ho="list-pages-link",uj=t=>t.components().reduce((e,n)=>{var s;const r=n.findFirstType(Ho),o=(s=r==null?void 0:r.attributes.attributes)==null?void 0:s.href,i=o!=null&&o.startsWith(Vm)?o.replace(Vm,""):"";if(i&&r){const l=e[i];l?l.push(r):e[i]=[r]}return e},{}),dj="listPagesComponent",Va="data-type-role",fj="page_root",pj=t=>e=>e.is(t),hj=t=>(e,n)=>n.is(t),ud=t=>e=>{var n;return((n=e.getAttribute)==null?void 0:n.call(e,Va))===t},gj=function(t,e={}){const{Blocks:n,Components:r,Pages:o}=t,{licenseKey:i,block:s={}}=e,l="List Pages",a="List Pages Item",c="Link",u=`${Vd}${$o}`,d=`${Vd}${Ho}`,f='<svg viewBox="0 0 24 24"><path d="M11 15H17V17H11V15M9 7H7V9H9V7M11 13H17V11H11V13M11 9H17V7H11V9M9 11H7V13H9V11M21 5V19C21 20.1 20.1 21 19 21H5C3.9 21 3 20.1 3 19V5C3 3.9 3.9 3 5 3H19C20.1 3 21 3.9 21 5M19 5H5V19H19V5M9 15H7V17H9V15Z"/></svg>',p='<svg viewBox="0 0 24 24"><path d="M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z" /></svg>';r.addType($o,{block:s&&{label:l,media:f,category:"Extra",select:!0,...e.block},isComponent:ud($o),model:{defaults:{tagName:"ul",name:l,[fj]:"",classes:u,attributes:{[Va]:$o},droppable:pj(Ci),styles:`
|
|
294
|
+
.${u} {
|
|
295
|
+
list-style: none;
|
|
296
|
+
margin: 0;
|
|
297
|
+
padding: 0;
|
|
298
|
+
}
|
|
299
|
+
`},init(){this.syncPageItems=xb(this.syncPageItems.bind(this),0),this.listenTo(this.em,o.events.all,this.syncPageItems),this.syncPageItems()},syncPageItems(){if(t.Components.getSymbolInfo(this).isInstance)return;const g=this.em.Pages.getAll(),b=this.components(),v=uj(this);g.forEach((y,w)=>{const S=y.id,C=y.getName(),x=v[S];x?x==null||x.forEach(E=>{E.getInnerHTML()!==C&&E.components(C)}):b.add({type:Ci,components:[{type:Ho,attributes:{href:`page://${S}`},components:{type:"textnode",content:C}}]},{at:w})})}}}),r.addType(Ci,{isComponent:ud(Ci),model:{defaults:{name:a,tagName:"li",icon:p,attributes:{[Va]:Ci},components:{type:Ho},draggable:hj($o)}}}),r.addType(Ho,{extend:"link",isComponent:ud(Ho),model:{defaults:{removable:!1,copyable:!1,delegate:{move:g=>g.closestType(Ci)},name:c,classes:d,attributes:{[Va]:Ho},components:{type:"textnode",content:"Item"},styles:`
|
|
300
|
+
.${d} {
|
|
301
|
+
text-decoration: none;
|
|
302
|
+
}
|
|
303
|
+
`}}}),wr({editor:t,licenseKey:i,plan:Ht.startup,pluginName:dj,cleanup:()=>{n.remove($o),r.removeType($o)}})},mj=xr(gj),bj="fsLightboxComponent",va="data-fslightbox",ya="data-type",vj="fslightbox-open",Ei="fslightbox",Oi={image:'<svg viewBox="0 0 24 24"><path d="m8.5 13.5 2.5 3 3.5-4.5 4.5 6H5m16 1V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2Z"/></svg>',video:'<svg viewBox="0 0 24 24"><path d="M17 10.5V7a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-3.5l4 4v-11l-4 4Z"/></svg>',imageLightbox:'<svg viewBox="0 0 24 24"><path d="M4,2H20A2,2 0 0,1 22,4V16A2,2 0 0,1 20,18H16L12,22L8,18H4A2,2 0 0,1 2,16V4A2,2 0 0,1 4,2M19,15V7L15,11L13,9L7,15H19M7,5A2,2 0 0,0 5,7A2,2 0 0,0 7,9A2,2 0 0,0 9,7A2,2 0 0,0 7,5Z" /></svg>',external:'<svg viewBox="0 0 24 24"><path d="M14 3v2h3.6l-9.8 9.8 1.4 1.4L19 6.4V10h2V3m-2 16H5V5h7V3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h14a2 2 0 0 0 2-2v-7h-2v7z"/></svg>',eye:'<svg viewBox="0 0 24 24"><path d="M12 9a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3m0 8a5 5 0 0 1-5-5 5 5 0 0 1 5-5 5 5 0 0 1 5 5 5 5 0 0 1-5 5m0-12.5C7 4.5 2.7 7.6 1 12a11.8 11.8 0 0 0 22 0c-1.7-4.4-6-7.5-11-7.5Z"/></svg>'},yj=function(t,e={}){const{Blocks:n,Components:r}=t,o="Lightbox",i=`${Vd}${Ei}`,s={toolbarIconOpen:Oi.eye,block:{},defaultSrc:"https://placehold.co/300/777/white.png?text=Image",cdnScript:"https://cdn.jsdelivr.net/npm/fslightbox@3.4.2/index.js",...e},{block:l,toolbarIconOpen:a,defaultSrc:c}=s,u=function(w){const S=this,C="data-fslightbox",x=window,E=()=>{var j;const _=x.refreshFsLightbox;_==null||_();const M=S.getAttribute(C);if((j=x.fsLightboxInstances)==null||j[M],!x._isEditor)return;Array.from(document.querySelectorAll(`[${C}]`)).forEach(N=>{const P=N.onclick;N.onclick=function(z){z.preventDefault();const W=N;!W.__skipLb&&(P==null||P(z)),W.__skipLb=!0}})};if(x.refreshFsLightbox)E();else{const _=document.createElement("script");_.src=w.cdnScript,_.onload=E,document.head.appendChild(_)}},d=w=>({id:`${Ei}-open-lb`,label:a,command:()=>{const S=w.getView();S==null||S.toggleLightbox()}}),f="source-type",p={type:"radio",name:f,label:"Source type",changeProp:!0,options:[{id:"image",label:"Image",icon:Oi.image},{id:"video",label:"Video",icon:Oi.video},{id:"el",label:"Custom Element",icon:Oi.external}],labelToTitle:!0},g={id:"href-image",name:"href",type:"file",label:"Source Image"},b={id:"href-video",name:"href",label:"Source Video",placeholder:"https://www.youtube.com/watch?v=..."},v={id:"href-el",name:"href",label:"Source Element",placeholder:"#custom-element-id"},y={image:[g],video:[b],el:[v]};r.addType(Ei,{block:l&&{label:o,media:Oi.imageLightbox,category:"Extra",select:!0,...s.block},isComponent:w=>{var S;return(S=w.hasAttribute)==null?void 0:S.call(w,va)},extendFn:["initToolbar"],model:{defaults:{tagName:"a",name:o,icon:Oi.imageLightbox,classes:i,draggable:(w,S)=>!S.is(Ei),attributes:{[va]:"lightbox",[ya]:"image",href:c},components:{type:"image",src:c},script:u,cdnScript:s.cdnScript,"script-props":["attributes","cdnScript"],[f]:"image",traits:[p,{name:va,label:"Group name"},{type:"button",label:"Toggle Lightbox",command(w,S){var x;const C=(x=S.target)==null?void 0:x.getView();C==null||C.toggleLightbox()}}],styles:`
|
|
304
|
+
.${i} {
|
|
305
|
+
display: inline-block;
|
|
306
|
+
padding: 10px;
|
|
307
|
+
}
|
|
308
|
+
`},init(){const w=[f].map(S=>`change:${S}`).join(" ");this.on(w,this.updateTraits),this.on(`change:${f}`,this.onSourceTypeChange),this.on("change:attributes:href",this.adjustSourceType),this.updateTraits({init:!0}),this.adjustSourceType()},onSourceTypeChange(w,S,C){if(C.adjust)return;const E=this.get(f)==="video"?"video":"image";this.addAttributes({[ya]:E,href:""})},adjustSourceType(){const w=this.get(f),S=this.getAttributes().href||"",C={adjust:!0};if(w==="video"){const x=S.includes("youtube.com")?"youtube":"video";this.addAttributes({[ya]:x},C)}else w!=="el"&&S.startsWith("#")?this.set(f,"el",C):w==="image"&&this.addAttributes({[ya]:"image"},C)},updateTraits(w={}){const{changed:S}=this,{init:C}=w;if(S[p.name]||C){this.removeTrait([g.name,b.name,v.name]);const x=this.get(f)||"image",E=this.getTraitIndex(f)+1;this.addTrait(y[x],{at:E})}},initToolbar(){if(!a)return;const{toolbar:w}=this,S=d(this);!w.find(x=>x.id===S.id)&&(w==null||w.unshift(S))}},view:{onRender(){this.el.__skipLb=!0},toggleLightbox(){var N;const{em:w,el:S,model:C}=this,{Canvas:x}=w,E=C.getAttributes()[va],{defaultView:_,documentElement:M}=S.ownerDocument,k=(N=_.fsLightboxInstances)==null?void 0:N[E];if(M.classList.contains(vj))k.close();else{S.__skipLb=!1;let P;k.props.onOpen=()=>{P=x.getSpots(),setTimeout(()=>x.removeSpots())},k.props.onClose=()=>{P.forEach(z=>x.addSpot(z.attributes))},S.click()}}}}),wr({editor:t,plan:Ht.startup,licenseKey:s.licenseKey,pluginName:bj,cleanup:()=>{n.remove(Ei),r.removeType(Ei)}})},xj=xr(yj);var Ai=(t=>(t.image="image",t.video="video",t.external="external",t))(Ai||{});const Bo="lightGallery",Im=`${Bo}-item`,Ia="data-lightgallery",$m=`${Ia}-item`,dc="toggle",Uo={image:'<svg viewBox="0 0 24 24"><path d="m8.5 13.5 2.5 3 3.5-4.5 4.5 6H5m16 1V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2Z"/></svg>',video:'<svg viewBox="0 0 24 24"><path d="M17 10.5V7a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-3.5l4 4v-11l-4 4Z"/></svg>',gallery:'<svg viewBox="0 0 24 24"><path d="M4,2H20A2,2 0 0,1 22,4V16A2,2 0 0,1 20,18H16L12,22L8,18H4A2,2 0 0,1 2,16V4A2,2 0 0,1 4,2M19,15V7L15,11L13,9L7,15H19M7,5A2,2 0 0,0 5,7A2,2 0 0,0 7,9A2,2 0 0,0 9,7A2,2 0 0,0 7,5Z" /></svg>',galleryItem:'<svg viewBox="0 0 24 24"><path d="M20 2H4a2 2 0 0 0-2 2v18l4-4h14a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2M8 14H6v-2h2v2m0-3H6V9h2v2m0-3H6V6h2v2m7 6h-5v-2h5v2m3-3h-8V9h8v2m0-3h-8V6h8v2Z"/></svg>',external:'<svg viewBox="0 0 24 24"><path d="M14 3v2h3.6l-9.8 9.8 1.4 1.4L19 6.4V10h2V3m-2 16H5V5h7V3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h14a2 2 0 0 0 2-2v-7h-2v7z"/></svg>',eye:'<svg viewBox="0 0 24 24"><path d="M12 9a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3m0 8a5 5 0 0 1-5-5 5 5 0 0 1 5-5 5 5 0 0 1 5 5 5 5 0 0 1-5 5m0-12.5C7 4.5 2.7 7.6 1 12a11.8 11.8 0 0 0 22 0c-1.7-4.4-6-7.5-11-7.5Z"/></svg>'},dd={propKeys:[],props:{},traits:[]},Ls=(t,e={})=>{var o;const n={},r=[];for(const i in t){const{value:s,...l}=t[i];r.push({id:i,name:i,changeProp:!0,category:e.category,...l}),n[i]=s;const{subTraits:a={}}=l;for(const c in l.subTraits)(o=a[c])==null||o.forEach(u=>{const d=u.id||u.name;n[d]=u.value})}return{propKeys:Object.keys(n),props:n,traits:r}},Ef=(t,e)=>{const n=t.getTrait(e),r=n.get("category"),o=n.get("subTraits")||{},s=(Object.values(o).flat()||[]).map(c=>c.id||c.name);t.removeTrait(s);const l=o[n.getValue()],a=t.getTraitIndex(e)+1;l&&t.addTrait(l.map(c=>({category:r,...c})),{at:a})},fd=(t,e)=>{e.forEach(n=>{const r=t.getTrait(n);if(!r||!r.get("subTraits"))return;const o=r.changeProp?`change:${n}`:`change:attributes:${n}`;t.on(o,()=>Ef(t,n)),Ef(t,n)})},wj=(t,e,n)=>{const o=t.getTrait(e).get("subTraits")||{},s=(Object.values(o).flat()||[]).map(a=>{const c=a.name||a.id;return a.changeProp?`change:${c}`:`change:attributes:${c}`}),l=Array.from(new Set(s));l.length&&t.on(l.join(" "),n)},Sj={[dc]:{type:"button",label:"Toggle Gallery",command:(t,e)=>{var n,r;return(r=(n=e.target)==null?void 0:n.getView())==null?void 0:r.toggleGallery()}},speed:{type:"number",label:"Speed",tip:"Transition duration between slides (in ms)",value:400,step:50,min:0},inline:{type:"checkbox",label:"Inline Gallery",value:!1},allowMediaOverlap:{type:"checkbox",label:"Allow media overlap",tip:"If enabled, toolbar, captions and thumbnails will overlap with the media element",value:!1},controls:{type:"checkbox",label:"Show controls",tip:"If disabled, prev/next buttons will not be displayed",value:!0},counter:{type:"checkbox",label:"Show counter",tip:"Display the total number of images and index number of the currently displayed slide",value:!0},download:{type:"checkbox",label:"Download icon",tip:"Enable download button",value:!0},enableDrag:{type:"checkbox",label:"Enable drag",tip:"Enables desktop mouse drag support",value:!0},enableSwipe:{type:"checkbox",label:"Enable swipe",tip:"Enables swipe support for mobile devices",value:!0},escKey:{type:"checkbox",label:"Enable Esc key",tip:'Whether the gallery could be closed by pressing the "Esc" key',value:!0},keyPress:{type:"checkbox",label:"Enable keyboard navigation",value:!1},loop:{type:"checkbox",label:"Loop",tip:"If false, will disable the ability to loop back to the beginning of the gallery from the last slide",value:!0},getCaptionFromTitleOrAlt:{type:"checkbox",label:"Caption from title or alt",tip:"Get captions from alt or title tags",value:!0},showMaximizeIcon:{type:"checkbox",label:"Show maximize icon",value:!1},closable:{type:"checkbox",label:"Closable",tip:"If false, it won't be possible to close the gallery",value:!0},showCloseIcon:{type:"checkbox",label:"Show close icon",tip:"If false, close button won't be displayed.",visible:({component:t})=>!!t.getTrait("closable").getValue(),value:!0},closeOnTap:{type:"checkbox",label:"Close on tap",tip:"Allows clicks on black area to close gallery",visible:({component:t})=>!!t.getTrait("closable").getValue(),value:!0}},Cj={thumbnail:{category:{id:"thumbnail-options",label:"Thumbnail Options"},type:"checkbox",label:"Thumbnails",value:!0,subTraits:{false:[],true:[{type:"checkbox",name:"enableThumbDrag",label:"Thumbnail drag",tip:"Enable thumbnail drag on desktop",changeProp:!0,value:!0},{type:"checkbox",name:"enableThumbSwipe",label:"Thumbnail swipe",tip:"Enable thumbnail swipe on mobile devices",changeProp:!0,value:!0},{type:"select",name:"alignThumbnails",tip:"Position of thumbnails when the width of all thumbnails combined is less than the gallery's width",label:"Align Thumbnails",value:"middle",changeProp:!0,options:[{id:"left",label:"Left"},{id:"middle",label:"Middle"},{id:"right",label:"Right"}]},{type:"select",name:"currentPagerPosition",label:"Select thumbnail position",value:"middle",changeProp:!0,options:[{id:"left",label:"Left"},{id:"middle",label:"Middle"},{id:"right",label:"Right"}]},{type:"number",name:"thumbMargin",label:"Thumb margin",tip:"Spacing between each thumbnails",changeProp:!0,min:0,value:"5"},{type:"number",name:"thumbWidth",label:"Thumb width",tip:"Width of each thumbnails",changeProp:!0,min:0,value:"100"}]}}},Ej={autoplay:{category:{id:"autoplay-options",label:"Autoplay options"},type:"checkbox",label:"Autoplay",value:!0,subTraits:{false:[],true:[{type:"checkbox",name:"autoplayControls",label:"Autoplay controls",tip:"Show/hide autoplay controls",changeProp:!0,value:!0},{type:"checkbox",name:"progressBar",label:"Progress bar",tip:"Show autoplay progress bar",changeProp:!0,value:!0},{type:"checkbox",name:"forceSlideShowAutoplay",label:"Force autoplay",tip:"If false, autoplay will be stopped after first user action",changeProp:!0,value:!1},{type:"checkbox",name:"slideShowAutoplay",label:"Start autoplay",tip:"Enable autoplay on start",changeProp:!0,value:!1},{type:"number",name:"slideShowInterval",label:"Interval",tip:"The time (in ms) between each auto transition",changeProp:!0,min:0,step:50,value:5e3}]}}},Oj={zoom:{category:{id:"zoom-options",label:"Zoom options"},type:"checkbox",label:"Zoom",value:!0,subTraits:{false:[],true:[{type:"checkbox",name:"actualSize",label:"Show actual size icon",changeProp:!0,value:!0},{type:"checkbox",name:"infiniteZoom",label:"Infinte zoom",changeProp:!0,value:!0},{type:"checkbox",name:"showZoomInOutIcons",label:"Show zoom in/out icons",changeProp:!0,value:!1},{type:"number",name:"scale",label:"Scale",tip:"Value of zoom should be incremented/decremented",changeProp:!0,min:0,value:1}]}}},Qr="sourceType",xa="data-iframe",Of={name:"href",type:"file",label:"Image Source"},fc={name:"data-src",label:"Video Source",placeholder:"https://www.youtube.com/watch?v=..."},_f={name:"data-poster",label:"Video Poster",type:"file"},Hm={name:"data-src",label:"External Source",placeholder:"https://some-external-source.com/...."},wy={label:"Caption",name:"data-sub-html",placeholder:"My caption",changeProp:!1},_j={[dc]:{type:"button",label:"Toggle Gallery",command:(t,e)=>{var o,i;const n=e.target,r=(o=n==null?void 0:n.closestType(Bo))==null?void 0:o.getView();if(r&&n){const s=((i=r.getLightGallery())==null?void 0:i.items)||[],l=Array.from(s).indexOf(n.getEl());l>=0&&r.toggleGallery(l)}}},[Qr]:{type:"radio",label:"Source type",labelToTitle:!0,value:"image",subTraits:{image:[Of],video:[fc,_f],external:[Hm]},options:[{id:"image",label:Of.label||"",icon:Uo.image},{id:"video",label:fc.label||"",icon:Uo.video},{id:"external",label:Hm.label||"",icon:Uo.external}]},subHtml:wy},kj="lightGalleryComponent",Bm="lgThumbnail",Tj="lgVideo",zm="lgAutoplay",Fm="lgZoom",_i="https://cdn.jsdelivr.net/npm/lightgallery@2.8.2",Aj=function(t,e={}){const{Blocks:n,Components:r}=t,o="LightGallery",i="LightGallery Item",s={toolbarIconOpen:Uo.eye,block:{},lgLicenseKey:"92DE1DB8-7986-4F02-B908-514F97678D28",defaultSrc:"https://placehold.co/200/777/white.png?text=Image",plugins:[Bm,Tj,zm,Fm],cdnScript:[`${_i}/lightgallery.min.js`,`${_i}/plugins/thumbnail/lg-thumbnail.min.js`,`${_i}/plugins/video/lg-video.min.js`,`${_i}/plugins/autoplay/lg-autoplay.min.js`,`${_i}/plugins/zoom/lg-zoom.min.js`],cdnStyle:`${_i}/css/lightgallery-bundle.min.css`,...e},{block:l,toolbarIconOpen:a,defaultSrc:c}=s,u=function(S){const C=this,x=window,{plugins:E,cdnScript:_,cdnStyle:M,inline:k,lgLicenseKey:j,...N}=S||{},P=W=>isNaN(W)?void 0:parseInt(W,10),z=()=>{var $;const W={...N,licenseKey:j,speed:P(N.speed),startAnimationDuration:P(N.startAnimationDuration),thumbMargin:P(N.thumbMargin),thumbWidth:P(N.thumbWidth),slideShowInterval:P(N.slideShowInterval),scale:P(N.scale),enableZoomAfter:P(N.enableZoomAfter),plugins:(E||[]).map(J=>x[J])};k&&(W.container=C,W.closable=!1);const F=($=x.lightGallery)==null?void 0:$.call(x,C,W);k&&F.openGallery()};if(x.lightGallery)z();else{const{head:W}=document,F=Array.isArray(_)?[..._]:[_],$=Array.isArray(M)?[...M]:[M],J=L=>{if(L.length){const I=document.createElement("link");I.href=L.shift(),I.rel="stylesheet",W.appendChild(I),J(L)}},ee=L=>{if(L.length){const I=document.createElement("script");I.src=L.shift(),I.onerror=I.onload=ee.bind(null,L),W.appendChild(I)}else z()};J($),ee(F)}},d=S=>{const C=S.getTrait(dc);if(!a||!C)return;const{toolbar:x}=S,E={id:dc,label:a,command:()=>setTimeout(()=>C.runCommand(),100)};!x.find(M=>M.id===E.id)&&(x==null||x.unshift(E))};let f=[];const p=s.plugins||[],g=Ls(Sj),b=p.includes(Bm)?Ls(Cj):dd,v=p.includes(zm)?Ls(Ej):dd,y=p.includes(Fm)?Ls(Oj):dd;r.addType(Bo,{block:l&&{label:o,media:Uo.gallery,category:"Extra",select:!0,...s.block},isComponent:S=>Ma(S,Ia),extendFn:["init","initToolbar"],model:{defaults:{name:o,icon:Uo.gallery,draggable:(S,C)=>!C.is(Bo),attributes:{[Ia]:!0},components:{type:Im},script:u,selector:"",exThumbImage:"",cdnScript:s.cdnScript,cdnStyle:s.cdnStyle,plugins:s.plugins,lgLicenseKey:s.lgLicenseKey,"script-props":["lgLicenseKey","cdnScript","cdnStyle","plugins","selector","exThumbImage",...g.propKeys,...b.propKeys,...v.propKeys,...y.propKeys],...g.props,...b.props,...v.props,...y.props,traits:[...g.traits,...b.traits,...v.traits,...y.traits]},init(){fd(this,["thumbnail"]),fd(this,["autoplay"]),fd(this,["zoom"])},initToolbar(){d(this)}},extendFnView:["init"],view:{events:()=>({lgInit:"onLgInit",lgBeforeOpen:"onLgOpen",lgAfterClose:"onLgClose"}),init(){this.listenTo(this.model,r.events.scriptUnmount,this.destroyLightGallery)},getLightGallery(){return this.el.__lg},destroyLightGallery(){const S=this.getLightGallery();S==null||S.destroy()},disableLgInCanvas(){const S=this.getLightGallery();S.lgOpened=!0},isInlineGallery(){var C;const S=this.getLightGallery();return((C=S==null?void 0:S.settings)==null?void 0:C.container)===this.el},onLgInit(S){this.el.__lg=S.detail.instance,!this.isInlineGallery()&&this.disableLgInCanvas()},onLgOpen(){const{em:S}=this,{Canvas:C}=S,x=this.getLightGallery();f=C.getSpots(),setTimeout(()=>C.removeSpots()),x.__lgOpened=!0},onLgClose(){const S=this.getLightGallery();f.forEach(C=>this.em.Canvas.addSpot(C.attributes)),f=[],S.__lgOpened=!1,setTimeout(()=>this.disableLgInCanvas())},toggleGallery(S){const C=this.getLightGallery();if(C.__lgOpened)return C.closeGallery(!0);C.lgOpened=!1,C.openGallery(S)}}});const w=Ls(_j);r.addType(Im,{isComponent:S=>Ma(S,$m)||S.tagName==="A"&&Ma(S.parentElement,Ia),extendFn:["init","initToolbar"],model:{defaults:{tagName:"a",name:i,icon:Uo.galleryItem,attributes:{[$m]:!0,href:c},components:{type:"image",attributes:{alt:"Image",src:c}},...w.props,traits:[...w.traits]},init(){const S=[Qr].map(C=>`change:${C}`).join(" ");this.initSourceType(),this.on(S,this.updateTraits),this.updateTraits({init:!0}),this.initScriptUpdate(),wj(this,Qr,this.triggerGalleryUpdate)},initToolbar(){d(this)},initScriptUpdate(){const S=[wy.name].map(C=>`change:attributes:${C}`).join(" ");this.on(S,this.triggerGalleryUpdate)},triggerGalleryUpdate(...S){var C;(C=this.closestType(Bo))==null||C.__scriptPropsChange(...S)},updateTraits(S={}){const{changed:C}=this,{init:x}=S;if(C[Qr]||x){Ef(this,Qr);const E=this.getTrait(Qr).getValue();if(E===Ai.image){this.removeAttributes([fc.name,_f.name,xa]);const _=this.getTrait(Of.name);_.setValue(_.getValue()||c)}else E===Ai.video?this.removeAttributes([xa]):E===Ai.external&&this.addAttributes({[xa]:!0})}},initSourceType(){const S=this.getAttributes({noClass:!0,noStyle:!0});S[xa]?this.set(Qr,Ai.external):(S[fc.name]||S[_f.name])&&this.set(Qr,Ai.video)}}}),wr({editor:t,plan:Ht.startup,licenseKey:s.licenseKey,pluginName:kj,cleanup:()=>{n.remove(Bo),r.removeType(Bo)}})},Mj=xr(Aj),qn="swiper",bl=`${qn}-slide`,Bi=`${qn}-wrapper`,zi=`${qn}-nav-prev`,pc=`${qn}-nav-next`,Fi=`${qn}-pagination`,tl=`${qn}-scrollbar`,$t={slider:`<svg viewBox="0 0 24 24">
|
|
309
|
+
<path d="M22 7.6c0-1-.5-1.6-1.3-1.6H3.4C2.5 6 2 6.7 2 7.6v9.8c0 1 .5 1.6 1.3 1.6h17.4c.8 0 1.3-.6 1.3-1.6V7.6zM21 18H3V7h18v11z" fill-rule="nonzero"/>
|
|
310
|
+
<path d="M4 12.5L6 14v-3zM20 12.5L18 14v-3z"/>
|
|
311
|
+
</svg>`,effect:`<svg viewBox="0 0 24 24">
|
|
312
|
+
<path d="M7.5 5.6 5 7l1.4-2.5L5 2l2.5 1.4L10 2 8.6 4.5 10 7 7.5 5.6m12 9.8L22 14l-1.4 2.5L22 19l-2.5-1.4L17 19l1.4-2.5L17 14l2.5 1.4M22 2l-1.4 2.5L22 7l-2.5-1.4L17 7l1.4-2.5L17 2l2.5 1.4L22 2m-8.7 10.8 2.5-2.5-2.1-2-2.5 2.4 2.1 2m1-5.4 2.4 2.3c.4.4.4 1 0 1.4L5 22.7a1 1 0 0 1-1.4 0l-2.3-2.3a1 1 0 0 1 0-1.4L13 7.3a1 1 0 0 1 1.4 0Z"/>
|
|
313
|
+
</svg>`,autoplay:`<svg viewBox="0 0 24 24">
|
|
314
|
+
<path d="M5 6.3A1 1 0 0 1 5 5a1 1 0 0 1 1.3 0l6.8 5.4.3.3a2 2 0 0 1-2.8 2.8l-.3-.3L5 6.3M12 20a8 8 0 0 0 8-8 8 8 0 0 0-2.3-5.7L19 5a10 10 0 0 1 3 7 10 10 0 0 1-10 10A10 10 0 0 1 2 12h2a8 8 0 0 0 8 8m0-19a2 2 0 0 1 2 2 2 2 0 0 1-2 2 2 2 0 0 1-2-2 2 2 0 0 1 2-2Z"/>
|
|
315
|
+
</svg>`,pagination:`<svg viewBox="0 0 24 24">
|
|
316
|
+
<path d="M16 12a2 2 0 0 1 2-2 2 2 0 0 1 2 2 2 2 0 0 1-2 2 2 2 0 0 1-2-2m-6 0a2 2 0 0 1 2-2 2 2 0 0 1 2 2 2 2 0 0 1-2 2 2 2 0 0 1-2-2m-6 0a2 2 0 0 1 2-2 2 2 0 0 1 2 2 2 2 0 0 1-2 2 2 2 0 0 1-2-2Z"/>
|
|
317
|
+
</svg>`,scrollbar:`<svg viewBox="0 0 24 24">
|
|
318
|
+
<path d="M7.2 9.2 5.8 7.8 1.5 12l4.3 4.2 1.4-1.4L4.4 12zm9.6 5.6 1.4 1.4 4.3-4.2-4.3-4.2-1.4 1.4 2.8 2.8z"/>
|
|
319
|
+
<path fill-rule="evenodd" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0m-2 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0" clip-rule="evenodd"/>
|
|
320
|
+
</svg>`,parallax:`<svg viewBox="0 0 24 24">
|
|
321
|
+
<path d="M12.6 23.3h-.2v.5h.2v-.5m.3-.2-.2.1v.5l.2.1v-.6m-.8 0v.6h.2v-.5z"/>
|
|
322
|
+
<path fill="currentColor" d="M18 9.4a2.5 2.5 0 0 1 3 2.3v5.7a3 3 0 0 1-2.2 2.9h-.2L13 21.4a2.5 2.5 0 0 1-3-2.3v-5.7a3 3 0 0 1 2.2-2.9h.2zM14.5 6a2.5 2.5 0 0 1 3 2.3v.4l-5.3 1A4 4 0 0 0 9 13.4v4.8a2.5 2.5 0 0 1-2.5-2.4v-5.7a3 3 0 0 1 2.2-2.9H9zM11 2.6a2.5 2.5 0 0 1 3 2.3v.3l-5.3 1A4 4 0 0 0 5.5 10v4.8A2.5 2.5 0 0 1 3 12.3V6.6a3 3 0 0 1 2.2-2.9h.2z"/>
|
|
323
|
+
</svg>`,responsive:`<svg viewBox="0 0 24 24">
|
|
324
|
+
<path d="M17 21q-.4 0-.7-.3T16 20V10q0-.8-.6-1.4T14 8h-3.5q-.4 0-.7-.3T9.5 7V4q0-.4.3-.7t.7-.3H20q.4 0 .7.3t.3.7v16q0 .4-.3.7t-.7.3zm-6.5 0q-.4 0-.7-.3t-.3-.7v-9q0-.4.3-.7t.7-.3H13q.4 0 .7.3t.3.7v9q0 .4-.3.7t-.7.3zM4 21q-.4 0-.7-.3T3 20v-9q0-.4.3-.7T4 10h2.5q.4 0 .7.3t.3.7v9q0 .4-.3.7t-.7.3z"/>
|
|
325
|
+
</svg>`,extra:`<svg viewBox="0 0 24 24">
|
|
326
|
+
<path fill-rule="evenodd" d="M5.4 3h13.2A2.4 2.4 0 0 1 21 5.4v13.2a2.4 2.4 0 0 1-2.4 2.4H5.4A2.4 2.4 0 0 1 3 18.6V5.4A2.4 2.4 0 0 1 5.4 3M5 12a2 2 0 1 1 4 0 2 2 0 0 1-4 0m5 0a2 2 0 1 1 4 0 2 2 0 0 1-4 0m7-2a2 2 0 1 0 0 4 2 2 0 0 0 0-4" clip-rule="evenodd"/>
|
|
327
|
+
</svg>`,reload:`<svg viewBox="0 0 24 24">
|
|
328
|
+
<path d="M2 12c0 5 4 9 9 9 2.4 0 4.7-1 6.4-2.6l-1.5-1.5A6.7 6.7 0 0 1 11 19a7 7 0 1 1 7-7h-3l4 4h.1l3.9-4h-3a9 9 0 0 0-18 0Z"/>
|
|
329
|
+
</svg>`,prev:'<svg viewBox="0 0 24 24"><path d="M15.4 16.6 10.8 12l4.6-4.6L14 6l-6 6 6 6 1.4-1.4Z"/></svg>',next:'<svg viewBox="0 0 24 24"><path d="m8.6 16.6 4.6-4.6-4.6-4.6L10 6l6 6-6 6-1.4-1.4Z"/></svg>',add:`<svg viewBox="0 0 24 24">
|
|
330
|
+
<path d="M12 20a8 8 0 1 1 0-16 8 8 0 0 1 0 16m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2m1 5h-2v4H7v2h4v4h2v-4h4v-2h-4V7Z"/>
|
|
331
|
+
</svg>`},Wm={id:"swiper-responsive",label:"Responsive",icon:$t.responsive},Um={id:"swiper-extra",label:"Extra",icon:$t.extra},jj={actions:{type:"radio",label:!1,labelToTitle:!0,options:[{id:"r",label:"Reload slider",icon:$t.reload},{id:"p",label:"Previous slide",icon:$t.prev},{id:"n",label:"Next slide",icon:$t.next},{id:"a",label:"Add new slide",icon:$t.add}],setValue:({component:t,value:e})=>{var r;const n=(r=t.getView())==null?void 0:r.getSwiper();switch(e){case"r":t.reloadSlider();break;case"p":n==null||n.slidePrev();break;case"n":n==null||n.slideNext();break;case"a":t.addSlide();break}}},vertical:{type:"checkbox",label:"Vertical",value:!1},loop:{type:"checkbox",label:"Loop",value:!1},freeMode:{type:"checkbox",label:"Free mode",value:!1},autoHeight:{type:"checkbox",label:"Auto height",value:!1},navigation:{type:"checkbox",label:"Navigation",getValue:({component:t})=>!!t.findFirstType(zi),setValue:({component:t,value:e})=>{var n,r;e?t.append([{type:zi},{type:pc}]):((n=t.findFirstType(zi))==null||n.remove(),(r=t.findFirstType(pc))==null||r.remove()),t.set({navigation:e})}},initialSlide:{type:"number",label:"Initial slide",min:0,value:"0"},speed:{type:"number",label:"Speed",tip:"Transition duration (in ms)",step:500,min:0,value:300},effect:{category:{id:"swiper-effect",label:"Effects",icon:$t.effect},type:"select",label:"Effect Type",value:"slide",options:[{id:"slide",label:"Slide"},{id:"fade",label:"Fade"},{id:"cube",label:"Cube"},{id:"coverflow",label:"Coverflow"},{id:"flip",label:"Flip"},{id:"cards",label:"Cards"}],subTraits:{slide:[{type:"number",name:"slidesPerView",label:"Slides per view",changeProp:!0,min:1,value:1},{type:"number",name:"slidesPerGroup",label:"Slides per group",tip:"Numbers of slides for group sliding",changeProp:!0,min:1,value:1},{type:"number",name:"spaceBetween",label:"Space between",tip:"Distance between slides in px",changeProp:!0,min:0,value:0},{type:"number",name:"slidesOffsetBefore",label:"Slides offset before",tip:"Add additional slide offset in the beginning of the container (in px, before all slides)",changeProp:!0,min:0,value:0},{type:"number",name:"slidesOffsetAfter",label:"Slides offset after",tip:"Add additional slide offset in the end of the container (in px, after all slides)",changeProp:!0,min:0,value:0},{type:"checkbox",name:"centeredSlides",label:"Centered slides",tip:"If enabled, the active slide will be centered",changeProp:!0,value:!1}],fade:[{type:"checkbox",name:"crossFade",tip:"Enables slides cross fade",label:"Cross fade",changeProp:!0,value:!1}],cube:[{type:"checkbox",name:"cubeEffectShadow",label:"Shadow",changeProp:!0,value:!0},{type:"checkbox",name:"cubeEffectSlideShadows",label:"Slide shadows",changeProp:!0,value:!0},{type:"number",name:"cubeEffectShadowOffset",label:"Shadow offset",changeProp:!0,value:20},{type:"number",name:"cubeEffectShadowScale",label:"Shadow scale",changeProp:!0,value:.94}],coverflow:[{type:"number",name:"coverflowEffectDepth",tip:"Depth offset in px (slides translate in Z axis)",label:"Depth",changeProp:!0,min:0,value:100},{type:"number",name:"coverflowEffectModifier",tip:"Effect multiplier",label:"Modifier",changeProp:!0,step:.1,min:0,value:1},{type:"number",name:"coverflowEffectRotate",tip:"Slide rotate in degrees",label:"Rotate",changeProp:!0,min:0,value:50},{type:"number",name:"coverflowEffectScale",tip:"Slide scale effect",label:"Scale",changeProp:!0,min:0,step:.1,value:1},{type:"number",name:"coverflowEffectStretch",tip:"Stretch space between slides (in px)",label:"Stretch",changeProp:!0,min:0,value:0},{type:"checkbox",name:"coverflowEffectSlideShadows",tip:"Enables slides shadows",label:"Slide shadow",changeProp:!0,value:!0}],flip:[{type:"checkbox",name:"flipEffectLimitRotation",tip:"Limit edge slides rotation",label:"Limit rotation",changeProp:!0,value:!0},{type:"checkbox",name:"flipEffectSlideShadows",tip:"Enables slides shadows",label:"Slide shadows",changeProp:!0,value:!0}],cards:[{type:"number",name:"cardsEffectPerSlideOffset",tip:"Offset distance per slide (in px)",label:"Slide offset",changeProp:!0,min:0,value:8},{type:"number",name:"cardsEffectPerSlideRotate",tip:"Rotate angle per slide (in degrees)",label:"Slide rotate",changeProp:!0,min:0,value:2},{type:"checkbox",name:"cardsEffectRotate",tip:"Enables cards rotation",label:"Rotate",changeProp:!0,value:!0},{type:"checkbox",name:"cardsEffectSlideShadows",tip:"Enables slides shadows",label:"Slide shadows",changeProp:!0,value:!0}]}},autoplay:{category:{id:"swiper-autoplay",label:"Autoplay",icon:$t.autoplay},type:"checkbox",label:"Enable Autoplay",value:!1,subTraits:{true:[{type:"number",name:"autoplayDelay",label:"Delay",changeProp:!0,value:3e3},{type:"checkbox",name:"autoplayDisableOnInteraction",label:"Disable on interaction",changeProp:!0,value:!0},{type:"checkbox",name:"autoplayWaitForTransition",label:"Wait for transition",changeProp:!0,value:!0},{type:"checkbox",name:"autoplayPauseOnMouseEnter",label:"Pause on mouse enter",changeProp:!0,value:!1},{type:"checkbox",name:"autoplayReverseDirection",label:"Reverse direction",changeProp:!0,value:!1},{type:"checkbox",name:"autoplayStopOnLastSlide",label:"Stop on last slide",changeProp:!0,value:!1}]}},pagination:{category:{id:"swiper-pagination",label:"Pagination",icon:$t.pagination},type:"select",label:"Pagination Type",options:[{id:"none",label:"None"},{id:"bullets",label:"Bullets"},{id:"progressbar",label:"Progressbar"},{id:"fraction",label:"Fraction"}],getValue:({component:t})=>t.findFirstType(Fi)?t.get("pagination")||"bullets":"none",setValue:({component:t,value:e})=>{const n=t.findFirstType(Fi);n==null||n.remove(),e!=="none"&&t.append({type:Fi}),t.set({pagination:e})},subTraits:{bullets:[{type:"checkbox",name:"dynamicBullets",label:"Dynamic bullets",changeProp:!0,value:!1},{type:"checkbox",name:"clickableBullets",label:"Clickable bullets",changeProp:!0,value:!0}],progressbar:[{type:"checkbox",name:"progressbarOpposite",label:"Progress opposite",changeProp:!0,value:!1}]}},scrollbar:{category:{id:"swiper-scrollbar",label:"Scrollbar",icon:$t.scrollbar},type:"checkbox",label:"Enable Scrollbar",getValue:({component:t})=>!!t.findFirstType(tl),setValue:({component:t,value:e})=>{const n=t.findFirstType(tl);n==null||n.remove(),e&&t.append({type:tl}),t.set({scrollbar:e})},subTraits:{false:[],true:[{type:"checkbox",name:"scrollbarDraggable",label:"Draggable",changeProp:!0,value:!1},{type:"checkbox",name:"scrollbarHide",label:"Hide",tip:"Hide scrollbar automatically after user interaction",changeProp:!0,value:!0}]}},parallax:{category:{id:"swiper-parallax",label:"Parallax",icon:$t.parallax},type:"checkbox",label:"Enable Parallax",value:!1},mobile:{category:Wm,type:"checkbox",label:"Enable mobile breakpoint",value:!1,subTraits:{true:[{type:"number",name:"mobileBreakpoint",label:"Mobile breakpoint",tip:"Slide values below will be applied when the screen width is greater than this value",changeProp:!0,min:1,value:460},{type:"number",name:"mobileSlidesPerView",label:"Slides per view",changeProp:!0,min:1,value:1},{type:"number",name:"mobileSlidesPerGroup",label:"Slides per group",changeProp:!0,min:1,value:1},{type:"number",name:"mobileSpaceBetween",label:"Space between",changeProp:!0,min:0,value:0}]}},tablet:{category:Wm,type:"checkbox",label:"Enable tablet breakpoint",value:!1,subTraits:{true:[{type:"number",name:"tabletBreakpoint",label:"Tablet breakpoint",tip:"Slide values below will be applied when the screen width is greater than this value",changeProp:!0,min:1,value:991},{type:"number",name:"tabletSlidesPerView",label:"Slides per view",changeProp:!0,min:1,value:1},{type:"number",name:"tabletSlidesPerGroup",label:"Slides per group",changeProp:!0,min:1,value:1},{type:"number",name:"tabletSpaceBetween",label:"Space between",changeProp:!0,min:0,value:0}]}},allowTouchMove:{category:Um,type:"checkbox",label:"Allow touch move",tip:"Allow touch interactions",value:!0},grabCursor:{category:Um,type:"checkbox",label:"Grab cursor",tip:'If enabled, the user will see the "grab" cursor when hover the slider',value:!1}},qm="Slider",kf="swiper",Os=`${kf}-`,Rj=(t,e)=>{const{Components:n,Blocks:r,Commands:o}=t,{block:i}=e,s=M2(jj),l="core:preview",a=o.events,c=function(f){const p=this,g=window,b=p.__onLoad,v=p.__activeSlide,y=p.__inPreview,{cdnScript:w,cdnStyle:S,slidesPerView:C}=f||{},x=_=>isNaN(_)?void 0:parseFloat(_),E=()=>{const _={loop:f.loop,speed:f.speed,initialSlide:f.initialSlide,direction:f.vertical?"vertical":"horizontal",effect:f.effect,freeMode:f.freeMode,parallax:f.parallax,autoHeight:f.autoHeight,allowTouchMove:f.allowTouchMove,grabCursor:f.grabCursor,simulateTouch:!0,breakpoints:{},slidesPerView:isNaN(C)?C:x(C),slidesPerGroup:x(f.slidesPerGroup),spaceBetween:x(f.spaceBetween),slidesOffsetBefore:x(f.slidesOffsetBefore),slidesOffsetAfter:x(f.slidesOffsetAfter),centeredSlides:f.centeredSlides,fadeEffect:{crossFade:f.crossFade},cubeEffect:{shadow:f.cubeEffectShadow,slideShadows:f.cubeEffectSlideShadows,shadowOffset:x(f.cubeEffectShadowOffset),shadowScale:x(f.cubeEffectShadowScale)},coverflowEffect:{depth:x(f.coverflowEffectDepth),modifier:x(f.coverflowEffectModifier),rotate:x(f.coverflowEffectRotate),scale:x(f.coverflowEffectScale),stretch:x(f.coverflowEffectStretch),slideShadows:f.coverflowEffectSlideShadows},flipEffect:{limitRotation:f.flipEffectLimitRotation,slideShadows:f.flipEffectSlideShadows},cardsEffect:{perSlideOffset:x(f.cardsEffectPerSlideOffset),perSlideRotate:x(f.cardsEffectPerSlideRotate),rotate:f.cardsEffectRotate,slideShadows:f.cardsEffectSlideShadows},navigation:{nextEl:p.querySelector(".swiper-button-next"),prevEl:p.querySelector(".swiper-button-prev")},pagination:{type:f.pagination||"bullets",dynamicBullets:f.dynamicBullets,clickable:f.clickableBullets,progressbarOpposite:f.progressbarOpposite,el:p.querySelector(".swiper-pagination")},scrollbar:{el:p.querySelector(".swiper-scrollbar"),draggable:f.scrollbarDraggable,hide:f.scrollbarHide},autoplay:f.autoplay&&{delay:f.autoplayDelay,disableOnInteraction:f.autoplayDisableOnInteraction,pauseOnMouseEnter:f.autoplayPauseOnMouseEnter,reverseDirection:f.autoplayReverseDirection,stopOnLastSlide:f.autoplayStopOnLastSlide,waitForTransition:f.autoplayWaitForTransition}};if(f.tablet){const{tabletBreakpoint:k,tabletSlidesPerView:j}=f,N=x(k);_.breakpoints[N]={slidesPerView:isNaN(j)?j:x(j),slidesPerGroup:x(f.tabletSlidesPerGroup),spaceBetween:x(f.tabletSpaceBetween)}}if(f.mobile){const{mobileBreakpoint:k,mobileSlidesPerView:j}=f,N=x(k);_.breakpoints[N]={slidesPerView:isNaN(j)?j:x(j),slidesPerGroup:x(f.mobileSlidesPerGroup),spaceBetween:x(f.mobileSpaceBetween)}}b&&!y&&(_.simulateTouch=!1),v&&(_.initialSlide=v);const M=new g.Swiper(p,_);b==null||b(M)};if(g.Swiper)E();else{const{head:_}=document,M=Array.isArray(w)?[...w]:[w],k=Array.isArray(S)?[...S]:[S],j=P=>{if(P.length){const z=document.createElement("link");z.href=P.shift(),z.rel="stylesheet",_.appendChild(z),j(P)}},N=P=>{if(P.length){const z=document.createElement("script");z.src=P.shift(),z.onerror=z.onload=N.bind(null,P),_.appendChild(z)}else E()};j(k),N(M)}},u=(f=0)=>({type:bl,style:{padding:"50px"},components:{type:"text",components:{type:"textnode",content:`Slide ${f}`}}}),d=n.getType("default").model;return n.addType(qn,{block:i&&{label:qm,media:$t.slider,category:"Extra",select:!0,...e.block},isComponent:f=>ri(f,kf),model:{defaults:()=>({name:qm,icon:$t.slider,classes:kf,draggable:(f,p)=>!p.is(qn),components:[{type:Bi,components:[u(1),u(2),u(3)]},{type:Fi}],script:c,cdnScript:e.cdnScript,cdnStyle:e.cdnStyle,"script-props":["cdnScript","cdnStyle",...s.propKeys],...s.props,traits:[...s.traits]}),init(){const{em:f}=this;j2(this,s.traits),R2(this,s.propKeys),this.listenTo(f,`${a.runCommand}${l}`,this.onPreviewOn),this.listenTo(f,`${a.stopCommand}${l}`,this.onPreviewOff)},onPreviewOn(){this.__inPreview=!0,this.reloadSlider()},onPreviewOff(){this.__inPreview=!1,this.reloadSlider()},reloadSlider(){this.trigger("rerender")},addSlide(){const f=this.findFirstType(Bi);f==null||f.append(this.getNewSlideComponentDef())},getNewSlideComponentDef(){var p;const f=((p=this.findFirstType(Bi))==null?void 0:p.components().length)||0;return{type:bl,components:{type:"text",components:{type:"textnode",content:`Slide ${f+1}`}}}},toJSON(...f){const p=d.prototype.toJSON.apply(this,f);return s.propsNoValues.forEach(g=>delete p[g]),delete p["script-props"],p}},view:{init(){this.listenTo(this.model,n.events.scriptUnmount,this.destroySwiper)},getSwiper(){return this.el.swiper},destroySwiper(){var f;(f=this.getSwiper())==null||f.destroy()},onRender(){const f=this.el;f.__onLoad=p=>p.on("slideChange",()=>this.__activeSlide=p.activeIndex),f.__activeSlide=this.__activeSlide,f.__inPreview=this.model.__inPreview}}}),()=>{n.removeType(qn),r.remove(qn)}},Nj="Nav Prev",Pj="Nav Next",wa=`${Os}button-prev`,Sa=`${Os}button-next`,Dj=t=>{const{Components:e}=t,n=r=>({type:"svg",selectable:!1,hoverable:!1,attributes:{viewBox:"0 0 27 44"},components:{type:"svg-in",tagName:"path",attributes:{d:r,fill:"currentColor"}}});return e.addType(zi,{isComponent:r=>ri(r,wa),model:{defaults:{name:Nj,classes:wa,copyable:!1,highlightable:!1,droppable:!1,draggable:!1,selectable:!1,hoverable:!1,layerable:!1,components:n("M0,22L22,0l2.1,2.1L4.2,22l19.9,19.9L22,44L0,22L0,22L0,22z"),styles:`
|
|
332
|
+
.${wa} {
|
|
333
|
+
color: inherit;
|
|
334
|
+
}
|
|
335
|
+
.${wa}:after {
|
|
336
|
+
content: none;
|
|
337
|
+
}
|
|
338
|
+
`}}}),e.addType(pc,{extend:zi,isComponent:r=>ri(r,Sa),model:{defaults:{name:Pj,classes:Sa,components:n("M27,22L27,22L5,44l-2.1-2.1L22.8,22L2.9,2.1L5,0L27,22L27,22z"),styles:`
|
|
339
|
+
.${Sa} {
|
|
340
|
+
color: inherit;
|
|
341
|
+
}
|
|
342
|
+
.${Sa}:after {
|
|
343
|
+
content: none;
|
|
344
|
+
}
|
|
345
|
+
`}}}),()=>{e.removeType(zi),e.removeType(pc)}},Lj=t=>{const{Components:e}=t,n=`${Os}pagination`;return e.addType(Fi,{isComponent:r=>ri(r,n),model:{defaults:{name:"Pagination",classes:n,copyable:!1,highlightable:!1,droppable:!1,draggable:!1,selectable:!1,hoverable:!1,layerable:!1,styles:`
|
|
346
|
+
.${n}-bullet-active {
|
|
347
|
+
background-color: currentColor;
|
|
348
|
+
}
|
|
349
|
+
.${n}-progressbar-fill {
|
|
350
|
+
--swiper-pagination-color: currentColor;
|
|
351
|
+
}
|
|
352
|
+
`}}}),()=>{e.removeType(Fi)}},Vj="Scrollbar",Gm=`${Os}scrollbar`,Ij=t=>{const{Components:e}=t;return e.addType(tl,{isComponent:n=>ri(n,Gm),model:{defaults:{name:Vj,classes:Gm,copyable:!1,highlightable:!1,removable:!1,selectable:!1,hoverable:!1,layerable:!1,droppable:!1,draggable:!1}}}),()=>{e.removeType(tl)}},$j="Slide",Km=`${Os}slide`,Hj=t=>{const{Components:e}=t;return e.addType(bl,{isComponent:n=>ri(n,Km),model:{defaults:{name:$j,classes:Km,icon:$t.slider,draggable:(n,r)=>r.is(Bi)}}}),()=>{e.removeType(bl)}},Bj="Wrapper",Ym=`${Os}wrapper`,zj=t=>{const{Components:e}=t,{events:n}=e;return e.addType(Bi,{isComponent:r=>ri(r,Ym),model:{defaults:{name:Bj,icon:$t.slider,classes:Ym,copyable:!1,removable:!1,draggable:!1,highlightable:!1,droppable:r=>r.is(bl)},init(){const r=this.components();this.listenTo(r,"add remove",this.updateSlider)},updateSlider(r){const o=this.closestType(qn);if(o){const i=o.getView();o.reloadSlider(),this.em.once(n.scriptMount,()=>{setTimeout(()=>{var s;return(s=i.getSwiper())==null?void 0:s.slideTo(r.index())},100)})}}}}),()=>{e.removeType(Bi)}},Fj="swiperComponent",Wj=function(t,e={}){const n={block:{},cdnScript:"https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js",cdnStyle:"https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css",...e},r=[Rj(t,n),Dj(t),zj(t),Hj(t),Lj(t),Ij(t)];wr({editor:t,plan:Ht.startup,licenseKey:n.licenseKey,pluginName:Fj,cleanup:()=>{r.forEach(o=>o())}})},Uj=xr(Wj),qj=t=>t.dispatchEvent(new CustomEvent("input"));function Gj(t,e){if(!e)return()=>{};const n=t.Components.events,r=u=>t.getSelectedAll().includes(u),o=u=>u.isInstanceOf("text")&&!u.isChildOf("text"),i=u=>u.isChildOf("text"),s=u=>t.getEditing()===u,l=(u,d={})=>{u.trigger("focus",d.event)},a=(u,d)=>{r(u)&&o(u)&&!s(u)&&l(u,d)},c=(u,d)=>{if(r(u)&&!o(u)&&i(u)){const f=u.parents().find(p=>p.isInstanceOf("text"));f&&(l(f,d),setTimeout(()=>t.select(f),0))}};return t.on(n.select,a),t.on(n.selectBefore,c),()=>{t.off(n.select,a),t.off(n.selectBefore,c)}}const lh=new WeakMap,Kj=(t,e)=>{lh.set(t,e)},Yj=t=>{lh.delete(t)},pd=t=>lh.get(t),Ca=t=>{const e=t.target,n=e.closest(".tox"),r=e.matches(".ephox-snooker-resizer-bar");(n||r)&&t.stopPropagation()},Jm=t=>{t.stopPropagation(),t.preventDefault()},Jj=(t,e)=>{const n=t.getDoc(),r=t.getWin();if(e!=null&&e.event){const{event:o}=e,{clientX:i,clientY:s}=o;let l;if(n.caretRangeFromPoint)l=n.caretRangeFromPoint(i,s);else if(n.caretPositionFromPoint){const a=n.caretPositionFromPoint(i,s);l=n.createRange(),l==null||l.setStart(a.offsetNode,a.offset)}if(l){const a=r.getSelection();a==null||a.removeAllRanges(),a==null||a.addRange(l),t.selection.setRng(l)}}else t.execCommand("SelectAll")},Zj=t=>{var c,u;const{el:e,editor:n,componentView:r}=t,o=n.runCommand(vt.getStateTheme),i=r.model,s={target:e,inline:!0,skin:(o==null?void 0:o.theme)===Xv.dark?"oxide-dark":"oxide",menubar:!1,image_advtab:!0,paste_data_images:!0,statusbar:!1,branding:!1,forced_root_block:"div",plugins:"advlist autolink lists link image media table",toolbar_mode:"sliding",toolbar:"bold italic underline strikethrough forecolor backcolor alignleft aligncenter alignright alignjustify link image | fontfamily fontsize bullist numlist outdent indent table"},l=((u=(c=t.pluginOpts)==null?void 0:c.loadConfig)==null?void 0:u.call(c,{config:s,editor:n,componentView:r,component:i}))||{};return{...s,...l}},Zm=(t,e=document)=>new Promise((n,r)=>{const o=Array.isArray(t)?[...t]:[t],{head:i}=e,s=l=>{if(l.length){const a=e.createElement("script");a.src=l.shift(),a.onload=s.bind(null,l),a.onerror=r,i.appendChild(a)}else n()};s(o)}),Xj="rteTinyMce",Qj=function(t,e={}){const n={cdnScript:"https://cdn.jsdelivr.net/npm/tinymce@6.8.5/tinymce.min.js",...e},{cdnScript:r}=n,o=t.Canvas.events,i=async(a,c)=>{const u=a.ownerDocument,d=u.defaultView,f=c==null?void 0:c.view;if(!d||!f){console.warn("Missing required data",{win:d,componentView:f});return}const p=Zj({el:a,editor:t,componentView:f,pluginOpts:n}),b=(await d.tinymce.init(p))[0];if(!b)return;const y=(await window.tinymce.init({...p,target:document.createElement("div")}))[0];return b.ui.show(),u.body.addEventListener("mousedown",Ca),document.body.addEventListener("mousedown",Ca),b.on("Change",()=>qj(a)),b.on("blur",()=>b.ui.show()),b.on("OpenWindow",function(){var C;const w=(C=u.querySelector(".tox-dialog"))==null?void 0:C.closest(".tox");w&&(w==null?void 0:w.ownerDocument)!==document&&(document.body.appendChild(w),b.once("CloseWindow",()=>{w&&w.ownerDocument===document&&u.body.appendChild(w)}))}),a.addEventListener("dragstart",Jm,{capture:!0}),t.runCommand(vt.setStateContextMenu,{enabled:!1}),Jj(b,c),{rteEditor:b,rteEditorShallow:y}},s=(a,c)=>{a.ownerDocument.body.removeEventListener("mousedown",Ca),document.body.removeEventListener("mousedown",Ca),a.removeEventListener("dragstart",Jm,{capture:!0}),t.runCommand(vt.setStateContextMenu,{enabled:!0}),c.rteEditor.destroy(),c.rteEditorShallow.destroy()};t.on(o.frameLoad,async({window:a})=>{Zm(r,a.document)}),t.onReady(()=>{Zm(r,document)}),t.setCustomRte({parseContent:!0,async enable(a,c,u){const d=pd(a);if(d)return d.rteEditor;const f=await i(a,u);return f&&Kj(a,f),f==null?void 0:f.rteEditor},disable(a){const c=pd(a);c&&(Yj(a),s(a,c))},getContent(a){var u,d;const c=pd(a);return c?(d=(u=c.rteEditor).getContent)==null?void 0:d.call(u):a.innerHTML}});const l=Gj(t,n.enableOnClick);wr({editor:t,licenseKey:n.licenseKey,plan:Ht.startup,pluginName:Xj,cleanup:()=>{t.RichTextEditor.customRte=void 0,l()}})},eR=xr(Qj);function Ot(t){this.content=t}Ot.prototype={constructor:Ot,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),i=r.content.slice();return o==-1?i.push(n||t,e):(i[o+1]=e,n&&(i[o]=n)),new Ot(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Ot(n)},addToStart:function(t,e){return new Ot([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Ot(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),i=r.find(t);return o.splice(i==-1?o.length:i,0,e,n),new Ot(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Ot.from(t),t.size?new Ot(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Ot.from(t),t.size?new Ot(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Ot.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};Ot.from=function(t){if(t instanceof Ot)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Ot(e)};function Sy(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),i=e.child(r);if(o==i){n+=o.nodeSize;continue}if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)n++;return n}if(o.content.size||i.content.size){let s=Sy(o.content,i.content,n+1);if(s!=null)return s}n+=o.nodeSize}}function Cy(t,e,n,r){for(let o=t.childCount,i=e.childCount;;){if(o==0||i==0)return o==i?null:{a:n,b:r};let s=t.child(--o),l=e.child(--i),a=s.nodeSize;if(s==l){n-=a,r-=a;continue}if(!s.sameMarkup(l))return{a:n,b:r};if(s.isText&&s.text!=l.text){let c=0,u=Math.min(s.text.length,l.text.length);for(;c<u&&s.text[s.text.length-c-1]==l.text[l.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(s.content.size||l.content.size){let c=Cy(s.content,l.content,n-1,r-1);if(c)return c}n-=a,r-=a}}class K{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,o=0,i){for(let s=0,l=0;l<n;s++){let a=this.content[s],c=l+a.nodeSize;if(c>e&&r(a,o+l,i||null,s)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,n-u),r,o+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let i="",s=!0;return this.nodesBetween(e,n,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,n-a):l.isLeaf?o?typeof o=="function"?o(l):o:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(s?s=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);i<e.content.length;i++)o.push(e.content[i]);return new K(o,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],o=0;if(n>e)for(let i=0,s=0;s<n;i++){let l=this.content[i],a=s+l.nodeSize;a>e&&((s<e||a>n)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,n-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,n-s-1))),r.push(l),o+=l.nodeSize),s=a}return new K(r,o)}cutByIndex(e,n){return e==n?K.empty:e==0&&n==this.content.length?this:new K(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[e]=n,new K(o,i)}addToStart(e){return new K([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new K(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))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 n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let o=this.content[n];e(o,r,n),r+=o.nodeSize}}findDiffStart(e,n=0){return Sy(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Cy(this,e,n,r)}findIndex(e,n=-1){if(e==0)return Ea(0,e);if(e==this.size)return Ea(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,o=0;;r++){let i=this.child(r),s=o+i.nodeSize;if(s>=e)return s==e||n>0?Ea(r+1,s):Ea(r,o);o=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return K.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new K(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return K.empty;let n,r=0;for(let o=0;o<e.length;o++){let i=e[o];r+=i.nodeSize,o&&i.isText&&e[o-1].sameMarkup(i)?(n||(n=e.slice(0,o)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new K(n||e,r)}static from(e){if(!e)return K.empty;if(e instanceof K)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new K([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}K.empty=new K([],0);const hd={index:0,offset:0};function Ea(t,e){return hd.index=t,hd.offset=e,hd}function hc(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!hc(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!hc(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}class ze{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let o=0;o<e.length;o++){let i=e[o];if(this.eq(i))return e;if(this.type.excludes(i.type))n||(n=e.slice(0,o));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(n||(n=e.slice(0,o)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&hc(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let o=r.create(n.attrs);return r.checkAttrs(o.attrs),o}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return ze.none;if(e instanceof ze)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}}ze.none=[];class gc extends Error{}class ne{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=Oy(this.content,e+this.openStart,n);return r&&new ne(r,this.openStart,this.openEnd)}removeBetween(e,n){return new ne(Ey(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return ne.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ne(K.fromJSON(e,n.content),r,o)}static maxOpen(e,n=!0){let r=0,o=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)o++;return new ne(e,r,o)}}ne.empty=new ne(K.empty,0,0);function Ey(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:l}=t.findIndex(n);if(o==e||i.isText){if(l!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(Ey(i.content,e-o-1,n-o-1)))}function Oy(t,e,n,r){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o);if(i==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let l=Oy(s.content,e-i-1,n);return l&&t.replaceChild(o,s.copy(l))}function tR(t,e,n){if(n.openStart>t.depth)throw new gc("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new gc("Inconsistent open depths");return _y(t,e,n,0)}function _y(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let s=_y(t,e,n,r+1);return i.copy(i.content.replaceChild(o,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,l=s.content;return Xo(s,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:s,end:l}=nR(n,t);return Xo(i,Ty(t,s,l,e,r))}else return Xo(i,mc(t,e,r))}function ky(t,e){if(!e.type.compatibleContent(t.type))throw new gc("Cannot join "+e.type.name+" onto "+t.type.name)}function Tf(t,e,n){let r=t.node(n);return ky(r,e.node(n)),r}function Zo(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function nl(t,e,n,r){let o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(Zo(t.nodeAfter,r),i++));for(let l=i;l<s;l++)Zo(o.child(l),r);e&&e.depth==n&&e.textOffset&&Zo(e.nodeBefore,r)}function Xo(t,e){return t.type.checkContent(e),t.copy(e)}function Ty(t,e,n,r,o){let i=t.depth>o&&Tf(t,e,o+1),s=r.depth>o&&Tf(n,r,o+1),l=[];return nl(null,t,o,l),i&&s&&e.index(o)==n.index(o)?(ky(i,s),Zo(Xo(i,Ty(t,e,n,r,o+1)),l)):(i&&Zo(Xo(i,mc(t,e,o+1)),l),nl(e,n,o,l),s&&Zo(Xo(s,mc(n,r,o+1)),l)),nl(r,null,o,l),new K(l)}function mc(t,e,n){let r=[];if(nl(null,t,n,r),t.depth>n){let o=Tf(t,e,n+1);Zo(Xo(o,mc(t,e,n+1)),r)}return nl(e,null,n,r),new K(r)}function nR(t,e){let n=e.depth-t.openStart,o=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)o=e.node(i).copy(K.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}class vl{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.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,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(n);return r?e.child(n).cut(r):o}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let i=0;i<e;i++)o+=r.child(i).nodeSize;return o}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return ze.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),o=e.maybeChild(n);if(!r){let l=r;r=o,o=l}let i=r.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!o||!i[s].isInSet(o.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,o=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!o||!r[i].isInSet(o.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new bc(this,e,r);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 n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,i=n;for(let s=e;;){let{index:l,offset:a}=s.content.findIndex(i),c=i-a;if(r.push(s,l,o+a),!c||(s=s.child(l),s.isText))break;i=c-1,o+=a+1}return new vl(n,r,i)}static resolveCached(e,n){let r=Xm.get(e);if(r)for(let i=0;i<r.elts.length;i++){let s=r.elts[i];if(s.pos==n)return s}else Xm.set(e,r=new rR);let o=r.elts[r.i]=vl.resolve(e,n);return r.i=(r.i+1)%oR,o}}class rR{constructor(){this.elts=[],this.i=0}}const oR=12,Xm=new WeakMap;class bc{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}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 iR=Object.create(null);let Qo=class Af{constructor(e,n,r,o=ze.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||K.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,n,r,o=0){this.content.nodesBetween(e,n,r,o,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,n,r,o){return this.content.textBetween(e,n,r,o)}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,n,r){return this.type==e&&hc(this.attrs,n||e.defaultAttrs||iR)&&ze.sameSet(this.marks,r||ze.none)}copy(e=null){return e==this.content?this:new Af(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Af(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return ne.empty;let o=this.resolve(e),i=this.resolve(n),s=r?0:o.sharedDepth(n),l=o.start(s),c=o.node(s).content.cut(o.pos-l,i.pos-l);return new ne(c,o.depth-s,i.depth-s)}replace(e,n,r){return tR(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:o}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(o==e||n.isText)return n;e-=o+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}resolve(e){return vl.resolveCached(this,e)}resolveNoCache(e){return vl.resolve(this,e)}rangeHasMark(e,n,r){let o=!1;return n>e&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(o=!0),!o)),o}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()+")"),Ay(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=K.empty,o=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,o,i),l=s&&s.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=o;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let i=this.contentMatchAt(e).matchType(r),s=i&&i.matchFragment(this.content,n);return s?s.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=ze.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!ze.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n 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(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let o=K.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,o,r);return i.type.checkAttrs(i.attrs),i}};Qo.prototype.text=void 0;class vc extends Qo{constructor(e,n,r,o){if(super(e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ay(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new vc(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new vc(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Ay(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class pi{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new sR(e,n);if(r.next==null)return pi.empty;let o=My(r);r.next&&r.err("Unexpected trailing text");let i=pR(fR(o));return hR(i,r),i}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let o=this;for(let i=n;o&&i<r;i++)o=o.matchType(e.child(i).type);return o}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:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let o=[this];function i(s,l){let a=s.matchFragment(e,r);if(a&&(!n||a.validEnd))return K.from(l.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:u,next:d}=s.next[c];if(!(u.isText||u.hasRequiredAttrs())&&o.indexOf(d)==-1){o.push(d);let f=i(d,l.concat(u));if(f)return f}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),i=o.match;if(i.matchType(e)){let s=[];for(let l=o;l.type;l=l.via)s.push(l.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:l,next:a}=i.next[s];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!o.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:o}),n[l.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 n(r){e.push(r);for(let o=0;o<r.next.length;o++)e.indexOf(r.next[o].next)==-1&&n(r.next[o].next)}return n(this),e.map((r,o)=>{let i=o+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)i+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return i}).join(`
|
|
353
|
+
`)}}pi.empty=new pi(!0);class sR{constructor(e,n){this.string=e,this.nodeTypes=n,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 My(t){let e=[];do e.push(lR(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function lR(t){let e=[];do e.push(aR(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function aR(t){let e=dR(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=cR(t,e);else break;return e}function Qm(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function cR(t,e){let n=Qm(t),r=n;return t.eat(",")&&(t.next!="}"?r=Qm(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function uR(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let i in n){let s=n[i];s.isInGroup(e)&&o.push(s)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function dR(t){if(t.eat("(")){let e=My(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=uR(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function fR(t){let e=[[]];return o(i(t,0),n()),e;function n(){return e.push([])-1}function r(s,l,a){let c={term:a,to:l};return e[s].push(c),c}function o(s,l){s.forEach(a=>a.to=l)}function i(s,l){if(s.type=="choice")return s.exprs.reduce((a,c)=>a.concat(i(c,l)),[]);if(s.type=="seq")for(let a=0;;a++){let c=i(s.exprs[a],l);if(a==s.exprs.length-1)return c;o(c,l=n())}else if(s.type=="star"){let a=n();return r(l,a),o(i(s.expr,a),a),[r(a)]}else if(s.type=="plus"){let a=n();return o(i(s.expr,l),a),o(i(s.expr,a),a),[r(a)]}else{if(s.type=="opt")return[r(l)].concat(i(s.expr,l));if(s.type=="range"){let a=l;for(let c=0;c<s.min;c++){let u=n();o(i(s.expr,a),u),a=u}if(s.max==-1)o(i(s.expr,a),a);else for(let c=s.min;c<s.max;c++){let u=n();r(a,u),o(i(s.expr,a),u),a=u}return[r(a)]}else{if(s.type=="name")return[r(l,void 0,s.value)];throw new Error("Unknown expr type")}}}}function jy(t,e){return e-t}function e1(t,e){let n=[];return r(e),n.sort(jy);function r(o){let i=t[o];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(o);for(let s=0;s<i.length;s++){let{term:l,to:a}=i[s];!l&&n.indexOf(a)==-1&&r(a)}}}function pR(t){let e=Object.create(null);return n(e1(t,0));function n(r){let o=[];r.forEach(s=>{t[s].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u<o.length;u++)o[u][0]==l&&(c=o[u][1]);e1(t,a).forEach(u=>{c||o.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new pi(r.indexOf(t.length-1)>-1);for(let s=0;s<o.length;s++){let l=o[s][1].sort(jy);i.next.push({type:o[s][0],next:e[l.join(",")]||n(l)})}return i}}function hR(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],i=!o.validEnd,s=[];for(let l=0;l<o.next.length;l++){let{type:a,next:c}=o.next[l];s.push(a.name),i&&!(a.isText||a.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Ry(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function Ny(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(o===void 0){let i=t[r];if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function Py(t,e,n,r){for(let o in e)if(!(o in t))throw new RangeError(`Unsupported attribute ${o} for ${n} of type ${o}`);for(let o in t){let i=t[o];i.validate&&i.validate(e[o])}}function Dy(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new mR(t,r,e[r]);return n}let t1=class Ly{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Dy(e,r.attrs),this.defaultAttrs=Ry(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==pi.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:Ny(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Qo(this,this.computeAttrs(e),K.from(n),ze.setFrom(r))}createChecked(e=null,n,r){return n=K.from(n),this.checkContent(n),new Qo(this,this.computeAttrs(e),n,ze.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=K.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let o=this.contentMatch.matchFragment(n),i=o&&o.fillBefore(K.empty,!0);return i?new Qo(this,e,n.append(i),ze.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).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){Py(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 n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:ze.none:e}static compile(e,n){let r=Object.create(null);e.forEach((i,s)=>r[i]=new Ly(i,n,s));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function gR(t,e,n){let r=n.split("|");return o=>{let i=o===null?"null":typeof o;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}class mR{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?gR(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class uu{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=Dy(e,o.attrs),this.excluded=null;let i=Ry(this.attrs);this.instance=i?new ze(this,i):null}create(e=null){return!e&&this.instance?this.instance:new ze(this,Ny(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((i,s)=>r[i]=new uu(i,o++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){Py(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class bR{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in e)n[o]=e[o];n.nodes=Ot.from(e.nodes),n.marks=Ot.from(e.marks||{}),this.nodes=t1.compile(this.spec.nodes,this),this.marks=uu.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",l=i.spec.marks;if(i.contentMatch=r[s]||(r[s]=pi.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=l=="_"?null:l?n1(this,l.split(" ")):l==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:n1(this,s.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,n=null,r,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof t1){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(n,r,o)}text(e,n){let r=this.nodes.text;return new vc(r,r.defaultAttrs,e,ze.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return Qo.fromJSON(this,e)}markFromJSON(e){return ze.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function n1(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],i=t.marks[o],s=i;if(i)n.push(i);else for(let l in t.marks){let a=t.marks[l];(o=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=a)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function vR(t){return t.tag!=null}function yR(t){return t.style!=null}let ah=class Mf{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(o=>{if(vR(o))this.tags.push(o);else if(yR(o)){let i=/[^=]*/.exec(o.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let i=e.nodes[o.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new o1(this,n,!1);return r.addAll(e,ze.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new o1(this,n,!0);return r.addAll(e,ze.none,n.from,n.to),ne.maxOpen(r.finish())}matchTag(e,n,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let i=this.tags[o];if(SR(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let s=i.getAttrs(e);if(s===!1)continue;i.attrs=s||void 0}return i}}}matchStyle(e,n,r,o){for(let i=o?this.styles.indexOf(o)+1:0;i<this.styles.length;i++){let s=this.styles[i],l=s.style;if(!(l.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(s.getAttrs){let a=s.getAttrs(n);if(a===!1)continue;s.attrs=a||void 0}return s}}}static schemaRules(e){let n=[];function r(o){let i=o.priority==null?50:o.priority,s=0;for(;s<n.length;s++){let l=n[s];if((l.priority==null?50:l.priority)<i)break}n.splice(s,0,o)}for(let o in e.marks){let i=e.marks[o].spec.parseDOM;i&&i.forEach(s=>{r(s=i1(s)),s.mark||s.ignore||s.clearMark||(s.mark=o)})}for(let o in e.nodes){let i=e.nodes[o].spec.parseDOM;i&&i.forEach(s=>{r(s=i1(s)),s.node||s.ignore||s.mark||(s.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Mf(e,Mf.schemaRules(e)))}};const Vy={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},xR={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Iy={ol:!0,ul:!0},yc=1,xc=2,rl=4;function r1(t,e,n){return e!=null?(e?yc:0)|(e==="full"?xc:0):t&&t.whitespace=="pre"?yc|xc:n&~rl}class Oa{constructor(e,n,r,o,i,s){this.type=e,this.attrs=n,this.marks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=ze.none,this.match=i||(s&rl?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(K.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(e.type))?(this.match=r,o):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&yc)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let n=K.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(K.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Vy.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class o1{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0;let o=n.topNode,i,s=r1(null,n.preserveWhitespace,0)|(r?rl:0);o?i=new Oa(o.type,o.attrs,ze.none,!0,n.topMatch||o.type.contentMatch,s):r?i=new Oa(null,null,ze.none,!0,null,s):i=new Oa(e.schema.topNodeType,null,ze.none,!0,null,s),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,o=this.top;if(o.options&xc||o.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o.options&yc)o.options&xc?r=r.replace(/\r\n?/g,`
|
|
354
|
+
`):r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let i=o.content[o.content.length-1],s=e.previousSibling;(!i||s&&s.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let o=e.nodeName.toLowerCase(),i;Iy.hasOwnProperty(o)&&this.parser.normalizeLists&&wR(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,r));if(s?s.ignore:xR.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,n);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let l,a=this.top,c=this.needsBlock;if(Vy.hasOwnProperty(o))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),l=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);return}let u=s&&s.skip?n:this.readStyles(e,n);u&&this.addAll(e,u),l&&this.sync(a),this.needsBlock=c}else{let l=this.readStyles(e,n);l&&this.addElementByRule(e,s,l,s.consuming===!1?i:void 0)}}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
355
|
+
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let i=this.parser.matchedStyles[o],s=r.getPropertyValue(i);if(s)for(let l=void 0;;){let a=this.parser.matchStyle(i,s,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?n=n.filter(c=>!a.clearMark(c)):n=n.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return n}addElementByRule(e,n,r,o){let i,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r)||this.leafFallback(e,r);else{let a=this.enter(s,n.attrs||null,r,n.preserveWhitespace);a&&(i=!0,r=a)}else{let a=this.parser.schema.marks[n.mark];r=r.concat(a.create(n.attrs))}let l=this.top;if(s&&s.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r));else{let a=e;typeof n.contentElement=="string"?a=e.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(e):n.contentElement&&(a=n.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}i&&this.sync(l)&&this.open--}addAll(e,n,r,o){let i=r||0;for(let s=r?e.childNodes[r]:e.firstChild,l=o==null?null:e.childNodes[o];s!=l;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s,n);this.findAtPoint(e,i)}findPlace(e,n){let r,o;for(let i=this.open;i>=0;i--){let s=this.nodes[i],l=s.findWrapping(e);if(l&&(!r||r.length>l.length)&&(r=l,o=s,!l.length)||s.solid)break}if(!r)return null;this.sync(o);for(let i=0;i<r.length;i++)n=this.enterInner(r[i],null,n,!1);return n}insertNode(e,n){if(e.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(n=this.enterInner(o,null,n))}let r=this.findPlace(e,n);if(r){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(e.type));let i=ze.none;for(let s of r.concat(e.marks))(o.type?o.type.allowsMarkType(s.type):s1(s.type,e.type))&&(i=s.addToSet(i));return o.content.push(e.mark(i)),!0}return!1}enter(e,n,r,o){let i=this.findPlace(e.create(n),r);return i&&(i=this.enterInner(e,n,r,!0,o)),i}enterInner(e,n,r,o=!1,i){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let l=r1(e,i,s.options);s.options&rl&&s.content.length==0&&(l|=rl);let a=ze.none;return r=r.filter(c=>(s.type?s.type.allowsMarkType(c.type):s1(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new Oa(e,n,a,o,null,l)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].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 n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=(l,a)=>{for(;l>=0;l--){let c=n[l];if(c==""){if(l==n.length-1||l==0)continue;for(;a>=i;a--)if(s(l-1,a))return!0;return!1}else{let u=a>0||a==0&&o?this.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function wR(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Iy.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function SR(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function i1(t){let e={};for(let n in t)e[n]=t[n];return e}function s1(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let i=[],s=l=>{i.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:u}=l.edge(a);if(c==e||i.indexOf(u)<0&&s(u))return!0}};if(s(o.contentMatch))return!0}}class wi{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=gd(n).createDocumentFragment());let o=r,i=[];return e.forEach(s=>{if(i.length||s.marks.length){let l=0,a=0;for(;l<i.length&&a<s.marks.length;){let c=s.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(i[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<i.length;)o=i.pop()[1];for(;a<s.marks.length;){let c=s.marks[a++],u=this.serializeMark(c,s.isInline,n);u&&(i.push([c,o]),o.appendChild(u.dom),o=u.contentDOM||u.dom)}}o.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:o}=$a(gd(n),this.nodes[e.type.name](e),null,e.attrs);if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,o)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let o=e.marks.length-1;o>=0;o--){let i=this.serializeMark(e.marks[o],e.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,n,r={}){let o=this.marks[e.type.name];return o&&$a(gd(r),o(e,n),null,e.attrs)}static renderSpec(e,n,r=null,o){return $a(e,n,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new wi(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=l1(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return l1(e.marks)}}function l1(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function gd(t){return t.document||window.document}const a1=new WeakMap;function CR(t){let e=a1.get(t);return e===void 0&&a1.set(t,e=ER(t)),e}function ER(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let o=0;o<r.length;o++)n(r[o]);else for(let o in r)n(r[o])}return n(t),e}function $a(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let o=e[0],i;if(typeof o!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=CR(r))&&i.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 s=o.indexOf(" ");s>0&&(n=o.slice(0,s),o=o.slice(s+1));let l,a=n?t.createElementNS(n,o):t.createElement(o),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):a.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:p,contentDOM:g}=$a(t,f,n,r);if(a.appendChild(p),g){if(l)throw new RangeError("Multiple content holes");l=g}}}return{dom:a,contentDOM:l}}const $y=65535,Hy=Math.pow(2,16);function OR(t,e){return t+e*Hy}function c1(t){return t&$y}function _R(t){return(t-(t&$y))/Hy}const By=1,zy=2,Ha=4,Fy=8;class jf{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Fy)>0}get deletedBefore(){return(this.delInfo&(By|Ha))>0}get deletedAfter(){return(this.delInfo&(zy|Ha))>0}get deletedAcross(){return(this.delInfo&Ha)>0}}class cn{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&cn.empty)return cn.empty}recover(e){let n=0,r=c1(e);if(!this.inverted)for(let o=0;o<r;o++)n+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+n+_R(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let o=0,i=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?o:0);if(a>e)break;let c=this.ranges[l+i],u=this.ranges[l+s],d=a+c;if(e<=d){let f=c?e==a?-1:e==d?1:n:n,p=a+o+(f<0?0:u);if(r)return p;let g=e==(n<0?a:d)?null:OR(l/3,e-a),b=e==a?zy:e==d?By:Ha;return(n<0?e!=a:e!=d)&&(b|=Fy),new jf(p,b,g)}o+=u-c}return r?e+o:new jf(e+o,0,null)}touches(e,n){let r=0,o=c1(n),i=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let c=this.ranges[l+i],u=a+c;if(e<=u&&l==o*3)return!0;r+=this.ranges[l+s]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o<this.ranges.length;o+=3){let s=this.ranges[o],l=s-(this.inverted?i:0),a=s+(this.inverted?0:i),c=this.ranges[o+n],u=this.ranges[o+r];e(l,l+c,a,a+u),i+=u-c}}invert(){return new cn(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?cn.empty:new cn(e<0?[0,-e,0]:[0,0,e])}}cn.empty=new cn([]);class Wi{constructor(e=[],n,r=0,o=e.length){this.maps=e,this.mirror=n,this.from=r,this.to=o}slice(e=0,n=this.maps.length){return new Wi(this.maps,this.mirror,e,n)}copy(){return new Wi(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,n){this.to=this.maps.push(e),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(e){for(let n=0,r=this.maps.length;n<e.maps.length;n++){let o=e.getMirror(n);this.appendMap(e.maps[n],o!=null&&o<n?r+o:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this.maps.length+e.maps.length;n>=0;n--){let o=e.getMirror(n);this.appendMap(e.maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let e=new Wi;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let o=0;for(let i=this.from;i<this.to;i++){let s=this.maps[i],l=s.mapResult(e,n);if(l.recover!=null){let a=this.getMirror(i);if(a!=null&&a>i&&a<this.to){i=a,e=this.maps[a].recover(l.recover);continue}}o|=l.delInfo,e=l.pos}return r?e:new jf(e,o,null)}}const md=Object.create(null);class Lt{getMap(){return cn.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=md[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in md)throw new RangeError("Duplicate use of step JSON ID "+e);return md[e]=n,n.prototype.jsonID=e,n}}class mt{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new mt(e,null)}static fail(e){return new mt(null,e)}static fromReplace(e,n,r,o){try{return mt.ok(e.replace(n,r,o))}catch(i){if(i instanceof gc)return mt.fail(i.message);throw i}}}function ch(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let i=t.child(o);i.content.size&&(i=i.copy(ch(i.content,e,i))),i.isInline&&(i=e(i,n,o)),r.push(i)}return K.fromArray(r)}class fo extends Lt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new ne(ch(n.content,(s,l)=>!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),n.openStart,n.openEnd);return mt.fromReplace(e,this.from,this.to,i)}invert(){return new ar(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new fo(n.pos,r.pos,this.mark)}merge(e){return e instanceof fo&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new fo(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new fo(n.from,n.to,e.markFromJSON(n.mark))}}Lt.jsonID("addMark",fo);class ar extends Lt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new ne(ch(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return mt.fromReplace(e,this.from,this.to,r)}invert(){return new fo(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new ar(n.pos,r.pos,this.mark)}merge(e){return e instanceof ar&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ar(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new ar(n.from,n.to,e.markFromJSON(n.mark))}}Lt.jsonID("removeMark",ar);class po extends Lt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return mt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return mt.fromReplace(e,this.pos,this.pos+1,new ne(K.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;o<n.marks.length;o++)if(!n.marks[o].isInSet(r))return new po(this.pos,n.marks[o]);return new po(this.pos,this.mark)}}return new as(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new po(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new po(n.pos,e.markFromJSON(n.mark))}}Lt.jsonID("addNodeMark",po);class as extends Lt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return mt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return mt.fromReplace(e,this.pos,this.pos+1,new ne(K.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new po(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new as(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new as(n.pos,e.markFromJSON(n.mark))}}Lt.jsonID("removeNodeMark",as);class Pt extends Lt{constructor(e,n,r,o=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=o}apply(e){return this.structure&&Rf(e,this.from,this.to)?mt.fail("Structure replace would overwrite content"):mt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new cn([this.from,this.to-this.from,this.slice.size])}invert(e){return new Pt(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Pt(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof Pt)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?ne.empty:new ne(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Pt(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?ne.empty:new ne(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Pt(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Pt(n.from,n.to,ne.fromJSON(e,n.slice),!!n.structure)}}Lt.jsonID("replace",Pt);class jt extends Lt{constructor(e,n,r,o,i,s,l=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=l}apply(e){if(this.structure&&(Rf(e,this.from,this.gapFrom)||Rf(e,this.gapTo,this.to)))return mt.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return mt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?mt.fromReplace(e,this.from,this.to,r):mt.fail("Content does not fit in gap")}getMap(){return new cn([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new jt(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||i>r.pos?null:new jt(n.pos,r.pos,o,i,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,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new jt(n.from,n.to,n.gapFrom,n.gapTo,ne.fromJSON(e,n.slice),n.insert,!!n.structure)}}Lt.jsonID("replaceAround",jt);function Rf(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function kR(t,e,n,r){let o=[],i=[],s,l;t.doc.nodesBetween(e,n,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),p=Math.min(c+a.nodeSize,n),g=r.addToSet(d);for(let b=0;b<d.length;b++)d[b].isInSet(g)||(s&&s.to==f&&s.mark.eq(d[b])?s.to=p:o.push(s=new ar(f,p,d[b])));l&&l.to==f?l.to=p:i.push(l=new fo(f,p,r))}}),o.forEach(a=>t.step(a)),i.forEach(a=>t.step(a))}function TR(t,e,n,r){let o=[],i=0;t.doc.nodesBetween(e,n,(s,l)=>{if(!s.isInline)return;i++;let a=null;if(r instanceof uu){let c=s.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(a=[r]):a=s.marks;if(a&&a.length){let c=Math.min(l+s.nodeSize,n);for(let u=0;u<a.length;u++){let d=a[u],f;for(let p=0;p<o.length;p++){let g=o[p];g.step==i-1&&d.eq(o[p].style)&&(f=g)}f?(f.to=c,f.step=i):o.push({style:d,from:Math.max(l,e),to:c,step:i})}}}),o.forEach(s=>t.step(new ar(s.from,s.to,s.style)))}function uh(t,e,n,r=n.contentMatch,o=!0){let i=t.doc.nodeAt(e),s=[],l=e+1;for(let a=0;a<i.childCount;a++){let c=i.child(a),u=l+c.nodeSize,d=r.matchType(c.type);if(!d)s.push(new Pt(l,u,ne.empty));else{r=d;for(let f=0;f<c.marks.length;f++)n.allowsMarkType(c.marks[f].type)||t.step(new ar(l,u,c.marks[f]));if(o&&c.isText&&n.whitespace!="pre"){let f,p=/\r?\n|\r/g,g;for(;f=p.exec(c.text);)g||(g=new ne(K.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),s.push(new Pt(l+f.index,l+f.index+f[0].length,g))}}l=u}if(!r.validEnd){let a=r.fillBefore(K.empty,!0);t.replace(l,l,new ne(a,0,0))}for(let a=s.length-1;a>=0;a--)t.step(s[a])}function AR(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function du(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let o=t.$from.node(r),i=t.$from.index(r),s=t.$to.indexAfter(r);if(r<t.depth&&o.canReplace(i,s,n))return r;if(r==0||o.type.spec.isolating||!AR(o,i,s))break}return null}function MR(t,e,n){let{$from:r,$to:o,depth:i}=e,s=r.before(i+1),l=o.after(i+1),a=s,c=l,u=K.empty,d=0;for(let g=i,b=!1;g>n;g--)b||r.index(g)>0?(b=!0,u=K.from(r.node(g).copy(u)),d++):a--;let f=K.empty,p=0;for(let g=i,b=!1;g>n;g--)b||o.after(g+1)<o.end(g)?(b=!0,f=K.from(o.node(g).copy(f)),p++):c++;t.step(new jt(a,c,s,l,new ne(u.append(f),d,p),u.size-d,!0))}function Wy(t,e,n=null,r=t){let o=jR(t,e),i=o&&RR(r,e);return i?o.map(u1).concat({type:e,attrs:n}).concat(i.map(u1)):null}function u1(t){return{type:t,attrs:null}}function jR(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return n.canReplaceWith(r,o,s)?i:null}function RR(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let a=(s.length?s[s.length-1]:e).contentMatch;for(let c=r;a&&c<o;c++)a=a.matchType(n.child(c).type);return!a||!a.validEnd?null:s}function NR(t,e,n){let r=K.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let l=n[s].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=K.from(n[s].type.create(n[s].attrs,r))}let o=e.start,i=e.end;t.step(new jt(o,i,o,i,new ne(r,0,0),n.length,!0))}function PR(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(s,l)=>{let a=typeof o=="function"?o(s):o;if(s.isTextblock&&!s.hasMarkup(r,a)&&DR(t.doc,t.mapping.slice(i).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",g=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!g?c=!1:!p&&g&&(c=!0)}c===!1&&qy(t,s,l,i),uh(t,t.mapping.slice(i).map(l,1),r,void 0,c===null);let u=t.mapping.slice(i),d=u.map(l,1),f=u.map(l+s.nodeSize,1);return t.step(new jt(d,f,d+1,f-1,new ne(K.from(r.create(a,null,s.marks)),0,0),1,!0)),c===!0&&Uy(t,s,l,i),!1}})}function Uy(t,e,n,r){e.forEach((o,i)=>{if(o.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(o.text);){let a=t.mapping.slice(r).map(n+1+i+s.index);t.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function qy(t,e,n,r){e.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+i);t.replaceWith(s,s+1,e.type.schema.text(`
|
|
356
|
+
`))}})}function DR(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function LR(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new jt(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new ne(K.from(s),0,0),1,!0))}function Ui(t,e,n=1,r){let o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,u=n-2;c>i;c--,u--){let d=o.node(c),f=o.index(c);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),g=r&&r[u+1];g&&(p=p.replaceChild(0,g.type.create(g.attrs)));let b=r&&r[u]||d;if(!d.canReplace(f+1,d.childCount)||!b.type.validContent(p))return!1}let l=o.indexAfter(i),a=r&&r[0];return o.node(i).canReplaceWith(l,l,a?a.type:o.node(i+1).type)}function VR(t,e,n=1,r){let o=t.doc.resolve(e),i=K.empty,s=K.empty;for(let l=o.depth,a=o.depth-n,c=n-1;l>a;l--,c--){i=K.from(o.node(l).copy(i));let u=r&&r[c];s=K.from(u?u.type.create(u.attrs,s):o.node(l).copy(s))}t.step(new Pt(e,e,new ne(i.append(s),n,n),!0))}function fu(t,e){let n=t.resolve(e),r=n.index();return $R(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function IR(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o<e.childCount;o++){let i=e.child(o),s=i.type==r?t.type.schema.nodes.text:i.type;if(n=n.matchType(s),!n||!t.type.allowsMarks(i.marks))return!1}return n.validEnd}function $R(t,e){return!!(t&&e&&!t.isLeaf&&IR(t,e))}function HR(t,e,n){let r=null,{linebreakReplacement:o}=t.doc.type.schema,i=t.doc.resolve(e-n),s=i.node().type;if(o&&s.inlineContent){let u=s.whitespace=="pre",d=!!s.contentMatch.matchType(o);u&&!d?r=!1:!u&&d&&(r=!0)}let l=t.steps.length;if(r===!1){let u=t.doc.resolve(e+n);qy(t,u.node(),u.before(),l)}s.inlineContent&&uh(t,e+n-1,s,i.node().contentMatchAt(i.index()),r==null);let a=t.mapping.slice(l),c=a.map(e-n);if(t.step(new Pt(c,a.map(e+n,-1),ne.empty,!0)),r===!0){let u=t.doc.resolve(c);Uy(t,u.node(),u.before(),t.steps.length)}return t}function BR(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,n))return r.after(o+1);if(i<r.node(o).childCount)return null}return null}function zR(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let i=0;i<n.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let s=r.depth;s>=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,a=r.index(s)+(l>0?1:0),c=r.node(s),u=!1;if(i==1)u=c.canReplace(a,a,o);else{let d=c.contentMatchAt(a).findWrapping(o.firstChild.type);u=d&&c.canReplaceWith(a,a,d[0])}if(u)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function dh(t,e,n=e,r=ne.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return Gy(o,i,r)?new Pt(e,n,r):new FR(o,i,r).fit()}function Gy(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class FR{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=K.empty;for(let o=0;o<=e.depth;o++){let i=e.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=K.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let i=this.placed,s=r.depth,l=o.depth;for(;s&&l&&i.childCount==1;)i=i.firstChild.content,s--,l--;let a=new ne(i,s,l);return e>-1?new jt(r.pos,e,this.$to.pos,this.$to.end(),a,n):a.size||r.pos!=this.$to.pos?new Pt(r.pos,o.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let i=n.firstChild;if(n.childCount>1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=bd(this.unplaced.content,r-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:c}=this.frontier[l],u,d=null;if(n==1&&(s?c.matchType(s.type)||(d=c.fillBefore(K.from(s),!1)):i&&a.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:l,parent:i,inject:d};if(n==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:l,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=bd(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new ne(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=bd(e,n);if(o.childCount<=1&&n>0){let i=e.size-n<=n+o.size;this.unplaced=new ne(zs(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new ne(zs(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let b=0;b<i.length;b++)this.openFrontierNode(i[b]);let s=this.unplaced,l=r?r.content:s.content,a=s.openStart-e,c=0,u=[],{match:d,type:f}=this.frontier[n];if(o){for(let b=0;b<o.childCount;b++)u.push(o.child(b));d=d.matchFragment(o)}let p=l.size+e-(s.content.size-s.openEnd);for(;c<l.childCount;){let b=l.child(c),v=d.matchType(b.type);if(!v)break;c++,(c>1||a==0||b.content.size)&&(d=v,u.push(Ky(b.mark(f.allowedMarks(b.marks)),c==1?a:0,c==l.childCount?p:-1)))}let g=c==l.childCount;g||(p=-1),this.placed=Fs(this.placed,n,K.from(u)),this.frontier[n].match=d,g&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let b=0,v=l;b<p;b++){let y=v.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),v=y.content}this.unplaced=g?e==0?ne.empty:new ne(zs(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new ne(zs(s.content,e,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!vd(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,o=this.$to.after(r);for(;r>1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],i=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=vd(e,n,o,r,i);if(s){for(let l=n-1;l>=0;l--){let{match:a,type:c}=this.frontier[l],u=vd(e,l,c,a,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:i?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Fs(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,i)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=Fs(this.placed,this.depth,K.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(K.empty,!0);n.childCount&&(this.placed=Fs(this.placed,this.frontier.length,n))}}function zs(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(zs(t.firstChild.content,e-1,n)))}function Fs(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Fs(t.lastChild.content,e-1,n)))}function bd(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function Ky(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,Ky(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(K.empty,!0)))),t.copy(r)}function vd(t,e,n,r,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let l=r.fillBefore(i.content,!0,s);return l&&!WR(n,i.content,s)?l:null}function WR(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function UR(t){return t.spec.defining||t.spec.definingForContent}function qR(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),i=t.doc.resolve(n);if(Gy(o,i,r))return t.step(new Pt(e,n,r));let s=Jy(o,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let l=-(o.depth+1);s.unshift(l);for(let f=o.depth,p=o.pos-1;f>0;f--,p--){let g=o.node(f).type.spec;if(g.defining||g.definingAsContext||g.isolating)break;s.indexOf(f)>-1?l=f:o.before(f)==p&&s.splice(1,0,-f)}let a=s.indexOf(l),c=[],u=r.openStart;for(let f=r.content,p=0;;p++){let g=f.firstChild;if(c.push(g),p==r.openStart)break;f=g.content}for(let f=u-1;f>=0;f--){let p=c[f],g=UR(p.type);if(g&&!p.sameMarkup(o.node(Math.abs(l)-1)))u=f;else if(g||!p.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let p=(f+u+1)%(r.openStart+1),g=c[p];if(g)for(let b=0;b<s.length;b++){let v=s[(b+a)%s.length],y=!0;v<0&&(y=!1,v=-v);let w=o.node(v-1),S=o.index(v-1);if(w.canReplaceWith(S,S,g.type,g.marks))return t.replace(o.before(v),y?i.after(v):n,new ne(Yy(r.content,0,r.openStart,p),p,r.openEnd))}}let d=t.steps.length;for(let f=s.length-1;f>=0&&(t.replace(e,n,r),!(t.steps.length>d));f--){let p=s[f];p<0||(e=o.before(p),n=i.after(p))}}function Yy(t,e,n,r,o){if(e<n){let i=t.firstChild;t=t.replaceChild(0,i.copy(Yy(i.content,e+1,n,r,i)))}if(e>r){let i=o.contentMatchAt(0),s=i.fillBefore(t).append(t);t=s.append(i.matchFragment(s).fillBefore(K.empty,!0))}return t}function GR(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=BR(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new ne(K.from(r),0,0))}function KR(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),i=Jy(r,o);for(let s=0;s<i.length;s++){let l=i[s],a=s==i.length-1;if(a&&l==0||r.node(l).type.contentMatch.validEnd)return t.delete(r.start(l),o.end(l));if(l>0&&(a||r.node(l-1).canReplace(r.index(l-1),o.indexAfter(l-1))))return t.delete(r.before(l),o.after(l))}for(let s=1;s<=r.depth&&s<=o.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&o.end(s)-n!=o.depth-s&&r.start(s-1)==o.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),o.index(s-1)))return t.delete(r.before(s),n);t.delete(e,n)}function Jy(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let o=r;o>=0;o--){let i=t.start(o);if(i<t.pos-(t.depth-o)||e.end(o)>e.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&n.push(o)}return n}class qi extends Lt{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return mt.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return mt.fromReplace(e,this.pos,this.pos+1,new ne(K.from(o),0,n.isLeaf?0:1))}getMap(){return cn.empty}invert(e){return new qi(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new qi(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new qi(n.pos,n.attr,n.value)}}Lt.jsonID("attr",qi);class yl extends Lt{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let o in e.attrs)n[o]=e.attrs[o];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return mt.ok(r)}getMap(){return cn.empty}invert(e){return new yl(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new yl(n.attr,n.value)}}Lt.jsonID("docAttr",yl);let cs=class extends Error{};cs=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};cs.prototype=Object.create(Error.prototype);cs.prototype.constructor=cs;cs.prototype.name="TransformError";class Zy{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Wi}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new cs(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=ne.empty){let o=dh(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new ne(K.from(r),0,0))}delete(e,n){return this.replace(e,n,ne.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return qR(this,e,n,r),this}replaceRangeWith(e,n,r){return GR(this,e,n,r),this}deleteRange(e,n){return KR(this,e,n),this}lift(e,n){return MR(this,e,n),this}join(e,n=1){return HR(this,e,n),this}wrap(e,n){return NR(this,e,n),this}setBlockType(e,n=e,r,o=null){return PR(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return LR(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new qi(e,n,r)),this}setDocAttribute(e,n){return this.step(new yl(e,n)),this}addNodeMark(e,n){return this.step(new po(e,n)),this}removeNodeMark(e,n){if(!(n instanceof ze)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new as(e,n)),this}split(e,n=1,r){return VR(this,e,n,r),this}addMark(e,n,r){return kR(this,e,n,r),this}removeMark(e,n,r){return TR(this,e,n,r),this}clearIncompatible(e,n,r){return uh(this,e,n,r),this}}const yd=Object.create(null);class Ee{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new Xy(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=ne.empty){let r=n.content.lastChild,o=null;for(let l=0;l<n.openEnd;l++)o=r,r=r.lastChild;let i=e.steps.length,s=this.ranges;for(let l=0;l<s.length;l++){let{$from:a,$to:c}=s[l],u=e.mapping.slice(i);e.replaceRange(u.map(a.pos),u.map(c.pos),l?ne.empty:n),l==0&&p1(e,i,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,o=this.ranges;for(let i=0;i<o.length;i++){let{$from:s,$to:l}=o[i],a=e.mapping.slice(r),c=a.map(s.pos),u=a.map(l.pos);i?e.deleteRange(c,u):(e.replaceRangeWith(c,u,n),p1(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let o=e.parent.inlineContent?new ke(e):Mi(e.node(0),e.parent,e.pos,e.index(),n,r);if(o)return o;for(let i=e.depth-1;i>=0;i--){let s=n<0?Mi(e.node(0),e.node(i),e.before(i+1),e.index(i),n,r):Mi(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new mn(e.node(0))}static atStart(e){return Mi(e,e,0,0,1)||new mn(e)}static atEnd(e){return Mi(e,e,e.content.size,e.childCount,-1)||new mn(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=yd[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in yd)throw new RangeError("Duplicate use of selection JSON ID "+e);return yd[e]=n,n.prototype.jsonID=e,n}getBookmark(){return ke.between(this.$anchor,this.$head).getBookmark()}}Ee.prototype.visible=!0;class Xy{constructor(e,n){this.$from=e,this.$to=n}}let d1=!1;function f1(t){!d1&&!t.parent.inlineContent&&(d1=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class ke extends Ee{constructor(e,n=e){f1(e),f1(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return Ee.near(r);let o=e.resolve(n.map(this.anchor));return new ke(o.parent.inlineContent?o:r,r)}replace(e,n=ne.empty){if(super.replace(e,n),n==ne.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof ke&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new pu(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new ke(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let o=e.resolve(n);return new this(o,r==n?o:e.resolve(r))}static between(e,n,r){let o=e.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let i=Ee.findFrom(n,r,!0)||Ee.findFrom(n,-r,!0);if(i)n=i.$head;else return Ee.near(n,r)}return e.parent.inlineContent||(o==0?e=n:(e=(Ee.findFrom(e,-r,!0)||Ee.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=o<0&&(e=n))),new ke(e,n)}}Ee.jsonID("text",ke);class pu{constructor(e,n){this.anchor=e,this.head=n}map(e){return new pu(e.map(this.anchor),e.map(this.head))}resolve(e){return ke.between(e.resolve(this.anchor),e.resolve(this.head))}}class Se extends Ee{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:o}=n.mapResult(this.anchor),i=e.resolve(o);return r?Ee.near(i):new Se(i)}content(){return new ne(K.from(this.node),0,0)}eq(e){return e instanceof Se&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new fh(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Se(e.resolve(n.anchor))}static create(e,n){return new Se(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Se.prototype.visible=!1;Ee.jsonID("node",Se);class fh{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new pu(r,r):new fh(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&Se.isSelectable(r)?new Se(n):Ee.near(n)}}class mn extends Ee{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=ne.empty){if(n==ne.empty){e.delete(0,e.doc.content.size);let r=Ee.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new mn(e)}map(e){return new mn(e)}eq(e){return e instanceof mn}getBookmark(){return YR}}Ee.jsonID("all",mn);const YR={map(){return this},resolve(t){return new mn(t)}};function Mi(t,e,n,r,o,i=!1){if(e.inlineContent)return ke.create(t,n);for(let s=r-(o>0?0:1);o>0?s<e.childCount:s>=0;s+=o){let l=e.child(s);if(l.isAtom){if(!i&&Se.isSelectable(l))return Se.create(t,n-(o<0?l.nodeSize:0))}else{let a=Mi(t,l,n+o,o<0?l.childCount:0,o,i);if(a)return a}n+=l.nodeSize*o}return null}function p1(t,e,n){let r=t.steps.length-1;if(r<e)return;let o=t.steps[r];if(!(o instanceof Pt||o instanceof jt))return;let i=t.mapping.maps[r],s;i.forEach((l,a,c,u)=>{s==null&&(s=u)}),t.setSelection(Ee.near(t.doc.resolve(s),n))}const h1=1,_a=2,g1=4;class JR extends Zy{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|h1)&~_a,this.storedMarks=null,this}get selectionSet(){return(this.updated&h1)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=_a,this}ensureMarks(e){return ze.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&_a)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~_a,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||ze.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let o=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let s=this.doc.resolve(n);i=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(e,i)),this.selection.empty||this.setSelection(Ee.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=g1,this}get scrolledIntoView(){return(this.updated&g1)>0}}function m1(t,e){return!e||!t?t:t.bind(e)}class Ws{constructor(e,n,r){this.name=e,this.init=m1(n.init,r),this.apply=m1(n.apply,r)}}const ZR=[new Ws("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Ws("selection",{init(t,e){return t.selection||Ee.atStart(e.doc)},apply(t){return t.selection}}),new Ws("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Ws("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class xd{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=ZR.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Ws(r.key,r.spec.state,r))})}}class $i{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let o=this.config.plugins[r];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),o=null;for(;;){let i=!1;for(let s=0;s<this.config.plugins.length;s++){let l=this.config.plugins[s];if(l.spec.appendTransaction){let a=o?o[s].n:0,c=o?o[s].state:this,u=a<n.length&&l.spec.appendTransaction.call(l,a?n.slice(a):n,c,r);if(u&&r.filterTransaction(u,s)){if(u.setMeta("appendedTransaction",e),!o){o=[];for(let d=0;d<this.config.plugins.length;d++)o.push(d<s?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),i=!0}o&&(o[s]={state:r,n:n.length})}}if(!i)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new $i(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let i=r[o];n[i.name]=i.apply(e,this[i.name],this,n)}return n}get tr(){return new JR(this)}static create(e){let n=new xd(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new $i(n);for(let o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(e,r);return r}reconfigure(e){let n=new xd(this.schema,e.plugins),r=n.fields,o=new $i(n);for(let i=0;i<r.length;i++){let s=r[i].name;o[s]=this.hasOwnProperty(s)?this[s]:r[i].init(e,o)}return o}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=e[r],i=o.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(o,this[o.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new xd(e.schema,e.plugins),i=new $i(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=Qo.fromJSON(e.schema,n.doc);else if(s.name=="selection")i.selection=Ee.fromJSON(i.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let a=r[l],c=a.spec.state;if(a.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){i[s.name]=c.fromJSON.call(a,e,n[l],i);return}}i[s.name]=s.init(e,i)}}),i}}function Qy(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=Qy(o,e,{})),n[r]=o}return n}class Bl{constructor(e){this.spec=e,this.props={},e.props&&Qy(e.props,this,this.props),this.key=e.key?e.key.key:ex("plugin")}getState(e){return e[this.key]}}const wd=Object.create(null);function ex(t){return t in wd?t+"$"+ ++wd[t]:(wd[t]=0,t+"$")}class zl{constructor(e="key"){this.key=ex(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const tx=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function XR(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const QR=(t,e,n)=>{let r=XR(t,n);if(!r)return!1;let o=nx(r);if(!o){let s=r.blockRange(),l=s&&du(s);return l==null?!1:(e&&e(t.tr.lift(s,l).scrollIntoView()),!0)}let i=o.nodeBefore;if(ax(t,o,e,-1))return!0;if(r.parent.content.size==0&&(us(i,"end")||Se.isSelectable(i)))for(let s=r.depth;;s--){let l=dh(t.doc,r.before(s),r.after(s),ne.empty);if(l&&l.slice.size<l.to-l.from){if(e){let a=t.tr.step(l);a.setSelection(us(i,"end")?Ee.findFrom(a.doc.resolve(a.mapping.map(o.pos,-1)),-1):Se.create(a.doc,o.pos-i.nodeSize)),e(a.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return i.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0):!1};function us(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const eN=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=nx(r)}let s=i&&i.nodeBefore;return!s||!Se.isSelectable(s)?!1:(e&&e(t.tr.setSelection(Se.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function nx(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function tN(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const nN=(t,e,n)=>{let r=tN(t,n);if(!r)return!1;let o=rx(r);if(!o)return!1;let i=o.nodeAfter;if(ax(t,o,e,1))return!0;if(r.parent.content.size==0&&(us(i,"start")||Se.isSelectable(i))){let s=dh(t.doc,r.before(),r.after(),ne.empty);if(s&&s.slice.size<s.to-s.from){if(e){let l=t.tr.step(s);l.setSelection(us(i,"start")?Ee.findFrom(l.doc.resolve(l.mapping.map(o.pos)),1):Se.create(l.doc,l.mapping.map(o.pos))),e(l.scrollIntoView())}return!0}}return i.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0):!1},rN=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;i=rx(r)}let s=i&&i.nodeAfter;return!s||!Se.isSelectable(s)?!1:(e&&e(t.tr.setSelection(Se.create(t.doc,i.pos)).scrollIntoView()),!0)};function rx(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const oN=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
|
|
357
|
+
`).scrollIntoView()),!0)};function ph(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const ox=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=ph(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let l=n.after(),a=t.tr.replaceWith(l,l,s.createAndFill());a.setSelection(Ee.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},iN=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof mn||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=ph(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let s=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,l=t.tr.insert(s,i.createAndFill());l.setSelection(ke.create(l.doc,s+1)),e(l.scrollIntoView())}return!0},ix=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(Ui(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),o=r&&du(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)};function sx(t){return(e,n)=>{let{$from:r,$to:o}=e.selection;if(e.selection instanceof Se&&e.selection.node.isBlock)return!r.parentOffset||!Ui(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let i=[],s,l,a=!1,c=!1;for(let p=r.depth;;p--)if(r.node(p).isBlock){a=r.end(p)==r.pos+(r.depth-p),c=r.start(p)==r.pos-(r.depth-p),l=ph(r.node(p-1).contentMatchAt(r.indexAfter(p-1)));let b=t&&t(o.parent,a,r);i.unshift(b||(a&&l?{type:l}:null)),s=p;break}else{if(p==1)return!1;i.unshift(null)}let u=e.tr;(e.selection instanceof ke||e.selection instanceof mn)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=Ui(u.doc,d,i.length,i);if(f||(i[0]=l?{type:l}:null,f=Ui(u.doc,d,i.length,i)),u.split(d,i.length,i),!a&&c&&r.node(s).type!=l){let p=u.mapping.map(r.before(s)),g=u.doc.resolve(p);l&&r.node(s-1).canReplaceWith(g.index(),g.index()+1,l)&&u.setNodeMarkup(u.mapping.map(r.before(s)),l)}return n&&n(u.scrollIntoView()),!0}}const sN=sx(),lx=(t,e)=>(e&&e(t.tr.setSelection(new mn(t.doc))),!0);function lN(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(o.isTextblock||fu(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function ax(t,e,n,r){let o=e.nodeBefore,i=e.nodeAfter,s,l,a=o.type.spec.isolating||i.type.spec.isolating;if(!a&&lN(t,e,n))return!0;let c=!a&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(s=(l=o.contentMatchAt(o.childCount)).findWrapping(i.type))&&l.matchType(s[0]||i.type).validEnd){if(n){let p=e.pos+i.nodeSize,g=K.empty;for(let y=s.length-1;y>=0;y--)g=K.from(s[y].create(null,g));g=K.from(o.copy(g));let b=t.tr.step(new jt(e.pos-1,p,e.pos,p,new ne(g,1,0),s.length,!0)),v=b.doc.resolve(p+2*s.length);v.nodeAfter&&v.nodeAfter.type==o.type&&fu(b.doc,v.pos)&&b.join(v.pos),n(b.scrollIntoView())}return!0}let u=i.type.spec.isolating||r>0&&a?null:Ee.findFrom(e,1),d=u&&u.$from.blockRange(u.$to),f=d&&du(d);if(f!=null&&f>=e.depth)return n&&n(t.tr.lift(d,f).scrollIntoView()),!0;if(c&&us(i,"start",!0)&&us(o,"end")){let p=o,g=[];for(;g.push(p),!p.isTextblock;)p=p.lastChild;let b=i,v=1;for(;!b.isTextblock;b=b.firstChild)v++;if(p.canReplace(p.childCount,p.childCount,b.content)){if(n){let y=K.empty;for(let S=g.length-1;S>=0;S--)y=K.from(g[S].copy(y));let w=t.tr.step(new jt(e.pos-g.length,e.pos+i.nodeSize,e.pos+v,e.pos+i.nodeSize-v,new ne(y,g.length,0),0,!0));n(w.scrollIntoView())}return!0}}return!1}function cx(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(n&&n(e.tr.setSelection(ke.create(e.doc,t<0?o.start(i):o.end(i)))),!0):!1}}const aN=cx(-1),cN=cx(1);function uN(t,e=null){return function(n,r){let o=!1;for(let i=0;i<n.selection.ranges.length&&!o;i++){let{$from:{pos:s},$to:{pos:l}}=n.selection.ranges[i];n.doc.nodesBetween(s,l,(a,c)=>{if(o)return!1;if(!(!a.isTextblock||a.hasMarkup(t,e)))if(a.type==t)o=!0;else{let u=n.doc.resolve(c),d=u.index();o=u.parent.canReplaceWith(d,d+1,t)}})}if(!o)return!1;if(r){let i=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:l},$to:{pos:a}}=n.selection.ranges[s];i.setBlockType(l,a,t,e)}r(i.scrollIntoView())}return!0}}function dN(t,e,n,r){for(let o=0;o<e.length;o++){let{$from:i,$to:s}=e[o],l=i.depth==0?t.inlineContent&&t.type.allowsMarkType(n):!1;if(t.nodesBetween(i.pos,s.pos,(a,c)=>{if(l||!r)return!1;l=a.inlineContent&&a.type.allowsMarkType(n)}),l)return!0}return!1}function zo(t,e=null,n){let r=n!==!1;return function(o,i){let{empty:s,$cursor:l,ranges:a}=o.selection;if(s&&!l||!dN(o.doc,a,t,r))return!1;if(i)if(l)t.isInSet(o.storedMarks||l.marks())?i(o.tr.removeStoredMark(t)):i(o.tr.addStoredMark(t.create(e)));else{let c,u=o.tr;c=!a.some(d=>o.doc.rangeHasMark(d.$from.pos,d.$to.pos,t));for(let d=0;d<a.length;d++){let{$from:f,$to:p}=a[d];if(!c)u.removeMark(f.pos,p.pos,t);else{let g=f.pos,b=p.pos,v=f.nodeAfter,y=p.nodeBefore,w=v&&v.isText?/^\s*/.exec(v.text)[0].length:0,S=y&&y.isText?/\s*$/.exec(y.text)[0].length:0;g+w<b&&(g+=w,b-=S),u.addMark(g,b,t.create(e))}}i(u.scrollIntoView())}return!0}}function xl(...t){return function(e,n,r){for(let o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}let Sd=xl(tx,QR,eN),b1=xl(tx,nN,rN);const Rr={Enter:xl(oN,iN,ix,sN),"Mod-Enter":ox,Backspace:Sd,"Mod-Backspace":Sd,"Shift-Backspace":Sd,Delete:b1,"Mod-Delete":b1,"Mod-a":lx},ux={"Ctrl-h":Rr.Backspace,"Alt-Backspace":Rr["Mod-Backspace"],"Ctrl-d":Rr.Delete,"Ctrl-Alt-Backspace":Rr["Mod-Delete"],"Alt-Delete":Rr["Mod-Delete"],"Alt-d":Rr["Mod-Delete"],"Ctrl-a":aN,"Ctrl-e":cN};for(let t in Rr)ux[t]=Rr[t];const fN=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform?os.platform()=="darwin":!1,pN=fN?ux:Rr;var wc=200,Ct=function(){};Ct.prototype.append=function(e){return e.length?(e=Ct.from(e),!this.length&&e||e.length<wc&&this.leafAppend(e)||this.length<wc&&e.leafPrepend(this)||this.appendInner(e)):this};Ct.prototype.prepend=function(e){return e.length?Ct.from(e).append(this):this};Ct.prototype.appendInner=function(e){return new hN(this,e)};Ct.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?Ct.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};Ct.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};Ct.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};Ct.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(i,s){return o.push(e(i,s))},n,r),o};Ct.from=function(e){return e instanceof Ct?e:e&&e.length?new dx(e):Ct.empty};var dx=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(o,i){return o==0&&i==this.length?this:new e(this.values.slice(o,i))},e.prototype.getInner=function(o){return this.values[o]},e.prototype.forEachInner=function(o,i,s,l){for(var a=i;a<s;a++)if(o(this.values[a],l+a)===!1)return!1},e.prototype.forEachInvertedInner=function(o,i,s,l){for(var a=i-1;a>=s;a--)if(o(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(o){if(this.length+o.length<=wc)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=wc)return new e(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Ct);Ct.empty=new dx([]);var hN=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,o,i,s){var l=this.left.length;if(o<l&&this.left.forEachInner(r,o,Math.min(i,l),s)===!1||i>l&&this.right.forEachInner(r,Math.max(o-l,0),Math.min(this.length,i)-l,s+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,i,s){var l=this.left.length;if(o>l&&this.right.forEachInvertedInner(r,o-l,Math.max(i,l)-l,s+l)===!1||i<l&&this.left.forEachInvertedInner(r,Math.min(o,l),i,s)===!1)return!1},e.prototype.sliceInner=function(r,o){if(r==0&&o==this.length)return this;var i=this.left.length;return o<=i?this.left.slice(r,o):r>=i?this.right.slice(r-i,o-i):this.left.slice(r,i).append(this.right.slice(0,o-i))},e.prototype.leafAppend=function(r){var o=this.right.leafAppend(r);if(o)return new e(this.left,o)},e.prototype.leafPrepend=function(r){var o=this.left.leafPrepend(r);if(o)return new e(o,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Ct);const gN=500;class Wn{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,i;n&&(o=this.remapping(r,this.items.length),i=o.maps.length);let s=e.tr,l,a,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){o||(o=this.remapping(r,f+1),i=o.maps.length),i--,u.push(d);return}if(o){u.push(new rr(d.map));let p=d.step.map(o.slice(i)),g;p&&s.maybeStep(p).doc&&(g=s.mapping.maps[s.mapping.maps.length-1],c.push(new rr(g,void 0,void 0,c.length+u.length))),i--,g&&o.appendMap(g,i)}else s.maybeStep(d.step);if(d.selection)return l=o?d.selection.map(o.slice(i)):d.selection,a=new Wn(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:s,selection:l}}addTransform(e,n,r,o){let i=[],s=this.eventCount,l=this.items,a=!o&&l.length?l.get(l.length-1):null;for(let u=0;u<e.steps.length;u++){let d=e.steps[u].invert(e.docs[u]),f=new rr(e.mapping.maps[u],d,n),p;(p=a&&a.merge(f))&&(f=p,u?i.pop():l=l.slice(0,l.length-1)),i.push(f),n&&(s++,n=void 0),o||(a=f)}let c=s-r.depth;return c>bN&&(l=mN(l,c),s-=c),new Wn(l.append(i),s)}remapping(e,n){let r=new Wi;return this.items.forEach((o,i)=>{let s=o.mirrorOffset!=null&&i-o.mirrorOffset>=e?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new Wn(this.items.append(e.map(n=>new rr(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),i=e.mapping,s=e.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},o);let a=n;this.items.forEach(f=>{let p=i.getMirror(--a);if(p==null)return;s=Math.min(s,p);let g=i.maps[p];if(f.step){let b=e.steps[p].invert(e.docs[p]),v=f.selection&&f.selection.map(i.slice(a+1,p));v&&l++,r.push(new rr(g,b,v))}else r.push(new rr(g))},o);let c=[];for(let f=n;f<s;f++)c.push(new rr(i.maps[f]));let u=this.items.slice(0,o).append(c).append(r),d=new Wn(u,l);return d.emptyItemCount()>gN&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,o=[],i=0;return this.items.forEach((s,l)=>{if(l>=e)o.push(s),s.selection&&i++;else if(s.step){let a=s.step.map(n.slice(r)),c=a&&a.getMap();if(r--,c&&n.appendMap(c,r),a){let u=s.selection&&s.selection.map(n.slice(r));u&&i++;let d=new rr(c.invert(),a,u),f,p=o.length-1;(f=o.length&&o[p].merge(d))?o[p]=f:o.push(d)}}else s.map&&r--},this.items.length,0),new Wn(Ct.from(o.reverse()),i)}}Wn.empty=new Wn(Ct.empty,0);function mN(t,e){let n;return t.forEach((r,o)=>{if(r.selection&&e--==0)return n=o,!1}),t.slice(n)}class rr{constructor(e,n,r,o){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=o}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new rr(n.getMap().invert(),n,this.selection)}}}class ro{constructor(e,n,r,o,i){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=i}}const bN=20;function vN(t,e,n,r){let o=n.getMeta(ei),i;if(o)return o.historyState;n.getMeta(wN)&&(t=new ro(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(ei))return s.getMeta(ei).redo?new ro(t.done.addTransform(n,void 0,r,Ba(e)),t.undone,v1(n.mapping.maps),t.prevTime,t.prevComposition):new ro(t.done,t.undone.addTransform(n,void 0,r,Ba(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),a=t.prevTime==0||!s&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!yN(n,t.prevRanges)),c=s?Cd(t.prevRanges,n.mapping):v1(n.mapping.maps);return new ro(t.done.addTransform(n,a?e.selection.getBookmark():void 0,r,Ba(e)),Wn.empty,c,n.time,l??t.prevComposition)}else return(i=n.getMeta("rebased"))?new ro(t.done.rebased(n,i),t.undone.rebased(n,i),Cd(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new ro(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Cd(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function yN(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,o)=>{for(let i=0;i<e.length;i+=2)r<=e[i+1]&&o>=e[i]&&(n=!0)}),n}function v1(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,o,i,s)=>e.push(i,s));return e}function Cd(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),i=e.map(t[r+1],-1);o<=i&&n.push(o,i)}return n}function xN(t,e,n){let r=Ba(e),o=ei.get(e).spec.config,i=(n?t.undone:t.done).popEvent(e,r);if(!i)return null;let s=i.selection.resolve(i.transform.doc),l=(n?t.done:t.undone).addTransform(i.transform,e.selection.getBookmark(),o,r),a=new ro(n?l:i.remaining,n?i.remaining:l,null,0,-1);return i.transform.setSelection(s).setMeta(ei,{redo:n,historyState:a})}let Ed=!1,y1=null;function Ba(t){let e=t.plugins;if(y1!=e){Ed=!1,y1=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Ed=!0;break}}return Ed}const ei=new zl("history"),wN=new zl("closeHistory");function SN(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Bl({key:ei,state:{init(){return new ro(Wn.empty,Wn.empty,null,0,-1)},apply(e,n,r){return vN(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,o=r=="historyUndo"?px:r=="historyRedo"?Nf:null;return o?(n.preventDefault(),o(e.state,e.dispatch)):!1}}}})}function fx(t,e){return(n,r)=>{let o=ei.getState(n);if(!o||(t?o.undone:o.done).eventCount==0)return!1;if(r){let i=xN(o,n,t);i&&r(e?i.scrollIntoView():i)}return!0}}const px=fx(!1,!0),Nf=fx(!0,!0);var _o={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Sc={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},CN=typeof navigator<"u"&&/Mac/.test(navigator.platform),EN=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var _t=0;_t<10;_t++)_o[48+_t]=_o[96+_t]=String(_t);for(var _t=1;_t<=24;_t++)_o[_t+111]="F"+_t;for(var _t=65;_t<=90;_t++)_o[_t]=String.fromCharCode(_t+32),Sc[_t]=String.fromCharCode(_t);for(var Od in _o)Sc.hasOwnProperty(Od)||(Sc[Od]=_o[Od]);function ON(t){var e=CN&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||EN&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Sc:_o)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const _N=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function kN(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,o,i,s;for(let l=0;l<e.length-1;l++){let a=e[l];if(/^(cmd|meta|m)$/i.test(a))s=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))o=!0;else if(/^s(hift)?$/i.test(a))i=!0;else if(/^mod$/i.test(a))_N?s=!0:o=!0;else throw new Error("Unrecognized modifier name: "+a)}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),s&&(n="Meta-"+n),i&&(n="Shift-"+n),n}function TN(t){let e=Object.create(null);for(let n in t)e[kN(n)]=t[n];return e}function _d(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function kd(t){return new Bl({props:{handleKeyDown:hx(t)}})}function hx(t){let e=TN(t);return function(n,r){let o=ON(r),i,s=e[_d(o,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let l=e[_d(o,r,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||o.charCodeAt(0)>127)&&(i=_o[r.keyCode])&&i!=o){let l=e[_d(i,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}function x1(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),l=!1,a=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(t)&&s.startIndex==0){if(o.index(s.depth-1)==0)return!1;let u=n.doc.resolve(s.start-2);a=new bc(u,u,s.depth),s.endIndex<s.parent.childCount&&(s=new bc(o,n.doc.resolve(i.end(s.depth)),s.depth)),l=!0}let c=Wy(a,t,e,s);return c?(r&&r(AN(n.tr,s,c,l,t).scrollIntoView()),!0):!1}}function AN(t,e,n,r,o){let i=K.empty;for(let u=n.length-1;u>=0;u--)i=K.from(n[u].type.create(n[u].attrs,i));t.step(new jt(e.start-(r?2:0),e.end,e.start,e.end,new ne(i,0,0),n.length,!0));let s=0;for(let u=0;u<n.length;u++)n[u].type==o&&(s=u+1);let l=n.length-s,a=e.start+n.length-(r?2:0),c=e.parent;for(let u=e.startIndex,d=e.endIndex,f=!0;u<d;u++,f=!1)!f&&Ui(t.doc,a,l)&&(t.split(a,l),a+=2*l),a+=c.child(u).nodeSize;return t}function MN(t,e){return function(n,r){let{$from:o,$to:i,node:s}=n.selection;if(s&&s.isBlock||o.depth<2||!o.sameParent(i))return!1;let l=o.node(-1);if(l.type!=t)return!1;if(o.parent.content.size==0&&o.node(-1).childCount==o.indexAfter(-1)){if(o.depth==3||o.node(-3).type!=t||o.index(-2)!=o.node(-2).childCount-1)return!1;if(r){let d=K.empty,f=o.index(-1)?1:o.index(-2)?2:3;for(let y=o.depth-f;y>=o.depth-3;y--)d=K.from(o.node(y).copy(d));let p=o.indexAfter(-1)<o.node(-2).childCount?1:o.indexAfter(-2)<o.node(-3).childCount?2:3;d=d.append(K.from(t.createAndFill()));let g=o.before(o.depth-(f-1)),b=n.tr.replace(g,o.after(-p),new ne(d,4-f,0)),v=-1;b.doc.nodesBetween(g,b.doc.content.size,(y,w)=>{if(v>-1)return!1;y.isTextblock&&y.content.size==0&&(v=w+1)}),v>-1&&b.setSelection(Ee.near(b.doc.resolve(v))),r(b.scrollIntoView())}return!0}let a=i.pos==o.end()?l.contentMatchAt(0).defaultType:null,c=n.tr.delete(o.pos,i.pos),u=a?[null,{type:a}]:void 0;return Ui(c.doc,o.pos,2,u)?(r&&r(c.split(o.pos,2,u).scrollIntoView()),!0):!1}}function Pf(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,s=>s.childCount>0&&s.firstChild.type==t);return i?n?r.node(i.depth-1).type==t?jN(e,n,t,i):RN(e,n,i):!0:!1}}function jN(t,e,n,r){let o=t.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new jt(i-1,s,i,s,new ne(K.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new bc(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));const l=du(r);if(l==null)return!1;o.lift(r,l);let a=o.mapping.map(i,-1)-1;return fu(o.doc,a)&&o.join(a),e(o.scrollIntoView()),!0}function RN(t,e,n){let r=t.tr,o=n.parent;for(let p=n.end,g=n.endIndex-1,b=n.startIndex;g>b;g--)p-=o.child(g).nodeSize,r.delete(p-1,p+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,a=n.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(l?0:1),u+1,s.content.append(a?K.empty:K.from(o))))return!1;let d=i.pos,f=d+s.nodeSize;return r.step(new jt(d-(l?1:0),f+(a?1:0),d+1,f-1,new ne((l?K.empty:K.from(o.copy(K.empty))).append(a?K.empty:K.from(o.copy(K.empty))),l?0:1,a?0:1),l?0:1)),e(r.scrollIntoView()),!0}function NN(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,c=>c.childCount>0&&c.firstChild.type==t);if(!i)return!1;let s=i.startIndex;if(s==0)return!1;let l=i.parent,a=l.child(s-1);if(a.type!=t)return!1;if(n){let c=a.lastChild&&a.lastChild.type==l.type,u=K.from(c?t.create():null),d=new ne(K.from(t.create(null,K.from(l.type.create(null,u)))),c?3:1,0),f=i.start,p=i.end;n(e.tr.step(new jt(f-(c?3:1),p,f,p,d,1,!0)).scrollIntoView())}return!0}}const kt=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},wl=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Df=null;const jr=function(t,e,n){let r=Df||(Df=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},PN=function(){Df=null},hi=function(t,e,n,r){return n&&(w1(t,e,n,r,-1)||w1(t,e,n,r,1))},DN=/^(img|br|input|textarea|hr)$/i;function w1(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:jn(t))){let i=t.parentNode;if(!i||i.nodeType!=1||Fl(t)||DN.test(t.nodeName)||t.contentEditable=="false")return!1;e=kt(t)+(o<0?0:1),t=i}else if(t.nodeType==1){if(t=t.childNodes[e+(o<0?-1:0)],t.contentEditable=="false")return!1;e=o<0?jn(t):0}else return!1}}function jn(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function LN(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=jn(t)}else if(t.parentNode&&!Fl(t))e=kt(t),t=t.parentNode;else return null}}function VN(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!Fl(t))e=kt(t)+1,t=t.parentNode;else return null}}function IN(t,e,n){for(let r=e==0,o=e==jn(t);r||o;){if(t==n)return!0;let i=kt(t);if(t=t.parentNode,!t)return!1;r=r&&i==0,o=o&&i==jn(t)}}function Fl(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const hu=function(t){return t.focusNode&&hi(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Fo(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function $N(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function HN(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(jn(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(jn(r.startContainer),r.startOffset)}}}const br=typeof navigator<"u"?navigator:null,S1=typeof document<"u"?document:null,Ro=br&&br.userAgent||"",Lf=/Edge\/(\d+)/.exec(Ro),gx=/MSIE \d/.exec(Ro),Vf=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ro),tn=!!(gx||Vf||Lf),bo=gx?document.documentMode:Vf?+Vf[1]:Lf?+Lf[1]:0,Jn=!tn&&/gecko\/(\d+)/i.test(Ro);Jn&&+(/Firefox\/(\d+)/.exec(Ro)||[0,0])[1];const If=!tn&&/Chrome\/(\d+)/.exec(Ro),Dt=!!If,mx=If?+If[1]:0,zt=!tn&&!!br&&/Apple Computer/.test(br.vendor),ds=zt&&(/Mobile\/\w+/.test(Ro)||!!br&&br.maxTouchPoints>2),_n=ds||(br?/Mac/.test(br.platform):!1),BN=br?/Win/.test(br.platform):!1,Fn=/Android \d/.test(Ro),Wl=!!S1&&"webkitFontSmoothing"in S1.documentElement.style,zN=Wl?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function FN(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function kr(t,e){return typeof t=="number"?t:t[e]}function WN(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function C1(t,e,n){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let s=n||t.dom;s;s=wl(s)){if(s.nodeType!=1)continue;let l=s,a=l==i.body,c=a?FN(i):WN(l),u=0,d=0;if(e.top<c.top+kr(r,"top")?d=-(c.top-e.top+kr(o,"top")):e.bottom>c.bottom-kr(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+kr(o,"top")-c.top:e.bottom-c.bottom+kr(o,"bottom")),e.left<c.left+kr(r,"left")?u=-(c.left-e.left+kr(o,"left")):e.right>c.right-kr(r,"right")&&(u=e.right-c.right+kr(o,"right")),u||d)if(a)i.defaultView.scrollBy(u,d);else{let f=l.scrollLeft,p=l.scrollTop;d&&(l.scrollTop+=d),u&&(l.scrollLeft+=u);let g=l.scrollLeft-f,b=l.scrollTop-p;e={left:e.left-g,top:e.top-b,right:e.right-g,bottom:e.bottom-b}}if(a||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function UN(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,o;for(let i=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let l=t.root.elementFromPoint(i,s);if(!l||l==t.dom||!t.dom.contains(l))continue;let a=l.getBoundingClientRect();if(a.top>=n-20){r=l,o=a.top;break}}return{refDOM:r,refTop:o,stack:bx(t.dom)}}function bx(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=wl(r));return e}function qN({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;vx(n,r==0?0:r-e)}function vx(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:o,left:i}=t[n];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=i&&(r.scrollLeft=i)}}let ki=null;function GN(t){if(t.setActive)return t.setActive();if(ki)return t.focus(ki);let e=bx(t);t.focus(ki==null?{get preventScroll(){return ki={preventScroll:!0},!0}}:void 0),ki||(ki=!1,vx(e,0))}function yx(t,e){let n,r=2e8,o,i=0,s=e.top,l=e.top,a,c;for(let u=t.firstChild,d=0;u;u=u.nextSibling,d++){let f;if(u.nodeType==1)f=u.getClientRects();else if(u.nodeType==3)f=jr(u).getClientRects();else continue;for(let p=0;p<f.length;p++){let g=f[p];if(g.top<=s&&g.bottom>=l){s=Math.max(g.bottom,s),l=Math.min(g.top,l);let b=g.left>e.left?g.left-e.left:g.right<e.left?e.left-g.right:0;if(b<r){n=u,r=b,o=b&&n.nodeType==3?{left:g.right<e.left?g.right:g.left,top:e.top}:e,u.nodeType==1&&b&&(i=d+(e.left>=(g.left+g.right)/2?1:0));continue}}else g.top>e.top&&!a&&g.left<=e.left&&g.right>=e.left&&(a=u,c={left:Math.max(g.left,Math.min(g.right,e.left)),top:g.top});!n&&(e.left>=g.right&&e.top>=g.top||e.left>=g.left&&e.top>=g.bottom)&&(i=d+1)}}return!n&&a&&(n=a,o=c,r=0),n&&n.nodeType==3?KN(n,o):!n||r&&n.nodeType==1?{node:t,offset:i}:yx(n,o)}function KN(t,e){let n=t.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(t,o+1),r.setStart(t,o);let i=eo(r,1);if(i.top!=i.bottom&&hh(e,i))return{node:t,offset:o+(e.left>=(i.left+i.right)/2?1:0)}}return{node:t,offset:0}}function hh(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function YN(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function JN(t,e,n){let{node:r,offset:o}=yx(e,n),i=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();i=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,o,i)}function ZN(t,e,n,r){let o=-1;for(let i=e,s=!1;i!=t.dom;){let l=t.docView.nearestDesc(i,!0);if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)){let a=l.dom.getBoundingClientRect();if(l.node.isBlock&&l.parent&&(!s&&a.left>r.left||a.top>r.top?o=l.posBefore:(!s&&a.right<r.left||a.bottom<r.top)&&(o=l.posAfter),s=!0),!l.contentDOM&&o<0&&!l.node.isText)return(l.node.isBlock?r.top<(a.top+a.bottom)/2:r.left<(a.left+a.right)/2)?l.posBefore:l.posAfter}i=l.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}function xx(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),i=o;;){let s=t.childNodes[i];if(s.nodeType==1){let l=s.getClientRects();for(let a=0;a<l.length;a++){let c=l[a];if(hh(e,c))return xx(s,e,c)}}if((i=(i+1)%r)==o)break}return t}function XN(t,e){let n=t.dom.ownerDocument,r,o=0,i=HN(n,e.left,e.top);i&&({node:r,offset:o}=i);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),l;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let c=t.dom.getBoundingClientRect();if(!hh(e,c)||(s=xx(t.dom,e,c),!s))return null}if(zt)for(let c=s;r&&c;c=wl(c))c.draggable&&(r=void 0);if(s=YN(s,e),r){if(Jn&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let u=r.childNodes[o],d;u.nodeName=="IMG"&&(d=u.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&o++}let c;Wl&&o&&r.nodeType==1&&(c=r.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&o--,r==t.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(l=ZN(t,r,o,e))}l==null&&(l=JN(t,s,e));let a=t.docView.nearestDesc(s,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function E1(t){return t.top<t.bottom||t.left<t.right}function eo(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(E1(r))return r}return Array.prototype.find.call(n,E1)||t.getBoundingClientRect()}const QN=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function wx(t,e,n){let{node:r,offset:o,atom:i}=t.docView.domFromPos(e,n<0?-1:1),s=Wl||Jn;if(r.nodeType==3)if(s&&(QN.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let a=eo(jr(r,o,o),n);if(Jn&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let c=eo(jr(r,o-1,o-1),-1);if(c.top==a.top){let u=eo(jr(r,o,o+1),-1);if(u.top!=a.top)return Vs(u,u.left<c.left)}}return a}else{let a=o,c=o,u=n<0?1:-1;return n<0&&!o?(c++,u=-1):n>=0&&o==r.nodeValue.length?(a--,u=1):n<0?a--:c++,Vs(eo(jr(r,a,c),u),u<0)}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&o&&(n<0||o==jn(r))){let a=r.childNodes[o-1];if(a.nodeType==1)return Td(a.getBoundingClientRect(),!1)}if(i==null&&o<jn(r)){let a=r.childNodes[o];if(a.nodeType==1)return Td(a.getBoundingClientRect(),!0)}return Td(r.getBoundingClientRect(),n>=0)}if(i==null&&o&&(n<0||o==jn(r))){let a=r.childNodes[o-1],c=a.nodeType==3?jr(a,jn(a)-(s?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(c)return Vs(eo(c,1),!1)}if(i==null&&o<jn(r)){let a=r.childNodes[o];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let c=a?a.nodeType==3?jr(a,0,s?0:1):a.nodeType==1?a:null:null;if(c)return Vs(eo(c,-1),!0)}return Vs(eo(r.nodeType==3?jr(r):r,-n),n>=0)}function Vs(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Td(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function Sx(t,e,n){let r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}function eP(t,e,n){let r=e.selection,o=n=="up"?r.$from:r.$to;return Sx(t,e,()=>{let{node:i}=t.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(i,!0);if(!l)break;if(l.node.isBlock){i=l.contentDOM||l.dom;break}i=l.dom.parentNode}let s=wx(t,o.pos,1);for(let l=i.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=jr(l,0,l.nodeValue.length).getClientRects();else continue;for(let c=0;c<a.length;c++){let u=a[c];if(u.bottom>u.top+1&&(n=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const tP=/[\u0590-\u08ac]/;function nP(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,l=t.domSelection();return l?!tP.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?i:s:Sx(t,e,()=>{let{focusNode:a,focusOffset:c,anchorNode:u,anchorOffset:d}=t.domSelectionRange(),f=l.caretBidiLevel;l.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:g,focusOffset:b}=t.domSelectionRange(),v=g&&!p.contains(g.nodeType==1?g:g.parentNode)||a==g&&c==b;try{l.collapse(u,d),a&&(a!=u||c!=d)&&l.extend&&l.extend(a,c)}catch{}return f!=null&&(l.caretBidiLevel=f),v}):r.pos==r.start()||r.pos==r.end()}let O1=null,_1=null,k1=!1;function rP(t,e,n){return O1==e&&_1==n?k1:(O1=e,_1=n,k1=n=="up"||n=="down"?eP(t,e,n):nP(t,e,n))}const In=0,T1=1,qo=2,vr=3;class Ul{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=In,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let o=this.children[n];if(o==e)return r;r+=o.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let i,s;if(e==this.contentDOM)i=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.previousSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(s)+s.size:this.posAtStart}else{let i,s;if(e==this.contentDOM)i=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(s):this.posAtEnd}let o;if(e==this.dom&&this.contentDOM)o=n>kt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&n==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,o=e;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!n||i.node))if(r&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return i}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let o=e;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],i=r+o.size;if(r==e&&i!=r){for(;!o.border&&o.children.length;)o=o.children[0];return o}if(e<i)return o.descAt(e-r-o.border);r=i}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,o=0;for(let i=0;r<this.children.length;r++){let s=this.children[r],l=i+s.size;if(l>e||s instanceof Ex){o=e-i;break}i=l}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof Cx&&i.side>=0;r--);if(n<=0){let i,s=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,s=!1);return i&&n&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?kt(i.dom)+1:0}}else{let i,s=!0;for(;i=r<this.children.length?this.children[r]:null,!(!i||i.dom.parentNode==this.contentDOM);r++,s=!1);return i&&s&&!i.border&&!i.domAtom?i.domFromPos(0,n):{node:this.contentDOM,offset:i?kt(i.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,i=-1;for(let s=r,l=0;;l++){let a=this.children[l],c=s+a.size;if(o==-1&&e<=c){let u=s+a.border;if(e>=u&&n<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,n,u);e=s;for(let d=l;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){o=kt(f.dom)+1;break}e-=f.size}o==-1&&(o=0)}if(o>-1&&(c>n||l==this.children.length-1)){n=c;for(let u=l+1;u<this.children.length;u++){let d=this.children[u];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){i=kt(d.dom);break}n+=d.size}i==-1&&(i=this.contentDOM.childNodes.length);break}s=c}return{node:this.contentDOM,from:e,to:n,fromOffset:o,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,o=!1){let i=Math.min(e,n),s=Math.max(e,n);for(let p=0,g=0;p<this.children.length;p++){let b=this.children[p],v=g+b.size;if(i>g&&s<v)return b.setSelection(e-g-b.border,n-g-b.border,r,o);g=v}let l=this.domFromPos(e,e?-1:1),a=n==e?l:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),u=r.domSelectionRange(),d=!1;if((Jn||zt)&&e==n){let{node:p,offset:g}=l;if(p.nodeType==3){if(d=!!(g&&p.nodeValue[g-1]==`
|
|
358
|
+
`),d&&g==p.nodeValue.length)for(let b=p,v;b;b=b.parentNode){if(v=b.nextSibling){v.nodeName=="BR"&&(l=a={node:v.parentNode,offset:kt(v)+1});break}let y=b.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let b=p.childNodes[g-1];d=b&&(b.nodeName=="BR"||b.contentEditable=="false")}}if(Jn&&u.focusNode&&u.focusNode!=a.node&&u.focusNode.nodeType==1){let p=u.focusNode.childNodes[u.focusOffset];p&&p.contentEditable=="false"&&(o=!0)}if(!(o||d&&zt)&&hi(l.node,l.offset,u.anchorNode,u.anchorOffset)&&hi(a.node,a.offset,u.focusNode,u.focusOffset))return;let f=!1;if((c.extend||e==n)&&!d){c.collapse(l.node,l.offset);try{e!=n&&c.extend(a.node,a.offset),f=!0}catch{}}if(!f){if(e>n){let g=l;l=a,a=g}let p=document.createRange();p.setEnd(a.node,a.offset),p.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,o=0;o<this.children.length;o++){let i=this.children[o],s=r+i.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let l=r+i.border,a=s-i.border;if(e>=l&&n<=a){this.dirty=e==r||n==s?qo:T1,e==l&&n==a&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=vr:i.markDirty(e-l,n-l);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?qo:vr}r=s}this.dirty=qo}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?qo:T1;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class Cx extends Ul{constructor(e,n,r,o){let i,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,i=this}matchesWidget(e){return this.dirty==In&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class oP extends Ul{constructor(e,n,r,o){super(e,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class gi extends Ul{constructor(e,n,r,o,i){super(e,[],r,o),this.mark=n,this.spec=i}static create(e,n,r,o){let i=o.nodeViews[n.type.name],s=i&&i(n,o,r);return(!s||!s.dom)&&(s=wi.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new gi(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&vr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=vr&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=In){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=In}}slice(e,n,r){let o=gi.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;n<s&&(i=Hf(i,n,s,r)),e>0&&(i=Hf(i,0,e,r));for(let l=0;l<i.length;l++)i[l].parent=o;return o.children=i,o}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class vo extends Ul{constructor(e,n,r,o,i,s,l,a,c){super(e,[],i,s),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=l}static create(e,n,r,o,i,s){let l=i.nodeViews[n.type.name],a,c=l&&l(n,i,()=>{if(!a)return s;if(a.parent)return a.parent.posBeforeChild(a)},r,o),u=c&&c.dom,d=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=wi.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!d&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=kx(u,r,n),c?a=new iP(e,n,r,o,u,d||null,f,c,i,s+1):n.isText?new gu(e,n,r,o,u,f,i):new vo(e,n,r,o,u,d||null,f,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>K.empty)}return e}matchesNode(e,n,r){return this.dirty==In&&e.eq(this.node)&&Cc(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,o=n,i=e.composing?this.localCompositionInfo(e,n):null,s=i&&i.pos>-1?i:null,l=i&&i.pos<0,a=new lP(this,s&&s.node,e);uP(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?a.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!d&&a.syncToMarks(u==this.node.childCount?ze.none:this.node.child(u).marks,r,e),a.placeWidget(c,e,o)},(c,u,d,f)=>{a.syncToMarks(c.marks,r,e);let p;a.findNodeMatch(c,u,d,f)||l&&e.state.selection.from>o&&e.state.selection.to<o+c.nodeSize&&(p=a.findIndexWithChild(i.node))>-1&&a.updateNodeAt(c,u,d,p,e)||a.updateNextNode(c,u,d,e,f,o)||a.addNode(c,u,d,e,o),o+=c.nodeSize}),a.syncToMarks([],r,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==qo)&&(s&&this.protectLocalComposition(e,s),Ox(this.contentDOM,this.children,e),ds&&dP(this.dom))}localCompositionInfo(e,n){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof ke)||r<n||o>n+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let s=i.nodeValue,l=fP(this.node.content,s,r-n,o-n);return l<0?null:{node:i,pos:l,text:s}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let i=n;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new oP(this,i,n,o);e.input.compositionNodes.push(s),this.children=Hf(this.children,r,r+o.length,e,s)}update(e,n,r,o){return this.dirty==vr||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,o),!0)}updateInner(e,n,r,o){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=In}updateOuterDeco(e){if(Cc(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=_x(this.dom,this.nodeDOM,$f(this.outerDeco,this.node,n),$f(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function A1(t,e,n,r,o){kx(r,e,t);let i=new vo(void 0,t,e,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class gu extends vo{constructor(e,n,r,o,i,s,l){super(e,n,r,o,i,null,s,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,o){return this.dirty==vr||this.dirty!=In&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=In||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=e,this.dirty=In,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let o=this.node.cut(e,n),i=document.createTextNode(o.text);return new gu(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=vr)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Ex extends Ul{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==In&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class iP extends vo{constructor(e,n,r,o,i,s,l,a,c,u){super(e,n,r,o,i,s,l,c,u),this.spec=a}update(e,n,r,o){if(this.dirty==vr)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,o),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Ox(t,e,n){let r=t.firstChild,o=!1;for(let i=0;i<e.length;i++){let s=e[i],l=s.dom;if(l.parentNode==t){for(;l!=r;)r=M1(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(l,r);if(s instanceof gi){let a=r?r.previousSibling:t.lastChild;Ox(s.contentDOM,s.children,n),r=a?a.nextSibling:t.firstChild}}for(;r;)r=M1(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}const ol=function(t){t&&(this.nodeName=t)};ol.prototype=Object.create(null);const Go=[new ol];function $f(t,e,n){if(t.length==0)return Go;let r=n?Go[0]:new ol,o=[r];for(let i=0;i<t.length;i++){let s=t[i].type.attrs;if(s){s.nodeName&&o.push(r=new ol(s.nodeName));for(let l in s){let a=s[l];a!=null&&(n&&o.length==1&&o.push(r=new ol(e.isInline?"span":"div")),l=="class"?r.class=(r.class?r.class+" ":"")+a:l=="style"?r.style=(r.style?r.style+";":"")+a:l!="nodeName"&&(r[l]=a))}}}return o}function _x(t,e,n,r){if(n==Go&&r==Go)return e;let o=e;for(let i=0;i<r.length;i++){let s=r[i],l=n[i];if(i){let a;l&&l.nodeName==s.nodeName&&o!=t&&(a=o.parentNode)&&a.nodeName.toLowerCase()==s.nodeName||(a=document.createElement(s.nodeName),a.pmIsDeco=!0,a.appendChild(o),l=Go[0]),o=a}sP(o,l||Go[0],s)}return o}function sP(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let i=0;i<r.length;i++)o.indexOf(r[i])==-1&&t.classList.remove(r[i]);for(let i=0;i<o.length;i++)r.indexOf(o[i])==-1&&t.classList.add(o[i]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=r.exec(e.style);)t.style.removeProperty(o[1])}n.style&&(t.style.cssText+=n.style)}}function kx(t,e,n){return _x(t,t,Go,$f(e,n,t.nodeType!=1))}function Cc(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function M1(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class lP{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=aP(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let o=0,i=this.stack.length>>1,s=Math.min(i,e.length);for(;o<s&&(o==i-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&e[o].type.spec.spanning!==!1;)o++;for(;o<i;)this.destroyRest(),this.top.dirty=In,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let l=-1;for(let a=this.index;a<Math.min(this.index+3,this.top.children.length);a++){let c=this.top.children[a];if(c.matchesMark(e[i])&&!this.isLocked(c.dom)){l=a;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let a=gi.create(this.top,e[i],n,r);this.top.children.splice(this.index,0,a),this.top=a,this.changed=!0}this.index=0,i++}}findNodeMatch(e,n,r,o){let i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))i=this.top.children.indexOf(s,this.index);else for(let l=this.index,a=Math.min(this.top.children.length,l+5);l<a;l++){let c=this.top.children[l];if(c.matchesNode(e,n,r)&&!this.preMatch.matched.has(c)){i=l;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,n,r,o,i){let s=this.top.children[o];return s.dirty==vr&&s.dom==s.contentDOM&&(s.dirty=qo),s.update(e,n,r,i)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==r)return o}return-1}e=n}}updateNextNode(e,n,r,o,i,s){for(let l=this.index;l<this.top.children.length;l++){let a=this.top.children[l];if(a instanceof vo){let c=this.preMatch.matched.get(a);if(c!=null&&c!=i)return!1;let u=a.dom,d,f=this.isLocked(u)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&a.dirty!=vr&&Cc(n,a.outerDeco));if(!f&&a.update(e,n,r,o))return this.destroyBetween(this.index,l),a.dom!=u&&(this.changed=!0),this.index++,!0;if(!f&&(d=this.recreateWrapper(a,e,n,r,o,s)))return this.destroyBetween(this.index,l),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=qo,d.updateChildren(o,s+1),d.dirty=In),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,o,i,s){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!Cc(r,e.outerDeco)||!o.eq(e.innerDeco))return null;let l=vo.create(this.top,n,r,o,i,s);if(l.contentDOM){l.children=e.children,e.children=[];for(let a of l.children)a.parent=l}return e.destroy(),l}addNode(e,n,r,o,i){let s=vo.create(this.top,e,n,r,o,i);s.contentDOM&&s.updateChildren(o,i+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,r){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(e)&&(e==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{let i=new Cx(this.top,e,n,r);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof gi;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof gu)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((zt||Dt)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let o=new Ex(this.top,[],r,null);n!=this.top?n.children.push(o):n.children.splice(this.index++,0,o),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function aP(t,e){let n=e,r=n.children.length,o=t.childCount,i=new Map,s=[];e:for(;o>0;){let l;for(;;)if(r){let c=n.children[r-1];if(c instanceof gi)n=c,r=c.children.length;else{l=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let a=l.node;if(a){if(a!=t.child(o-1))break;--o,i.set(l,o),s.push(l)}}return{index:o,matched:i,matches:s.reverse()}}function cP(t,e){return t.type.side-e.type.side}function uP(t,e,n,r){let o=e.locals(t),i=0;if(o.length==0){for(let c=0;c<t.childCount;c++){let u=t.child(c);r(u,o,e.forChild(i,u),c),i+=u.nodeSize}return}let s=0,l=[],a=null;for(let c=0;;){let u,d;for(;s<o.length&&o[s].to==i;){let v=o[s++];v.widget&&(u?(d||(d=[u])).push(v):u=v)}if(u)if(d){d.sort(cP);for(let v=0;v<d.length;v++)n(d[v],c,!!a)}else n(u,c,!!a);let f,p;if(a)p=-1,f=a,a=null;else if(c<t.childCount)p=c,f=t.child(c++);else break;for(let v=0;v<l.length;v++)l[v].to<=i&&l.splice(v--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)l.push(o[s++]);let g=i+f.nodeSize;if(f.isText){let v=g;s<o.length&&o[s].from<v&&(v=o[s].from);for(let y=0;y<l.length;y++)l[y].to<v&&(v=l[y].to);v<g&&(a=f.cut(v-i),f=f.cut(0,v-i),g=v,p=-1)}else for(;s<o.length&&o[s].to<g;)s++;let b=f.isInline&&!f.isLeaf?l.filter(v=>!v.inline):l.slice();r(f,b,e.forChild(i,f),p),i=g}}function dP(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function fP(t,e,n,r){for(let o=0,i=0;o<t.childCount&&i<=r;){let s=t.child(o++),l=i;if(i+=s.nodeSize,!s.isText)continue;let a=s.text;for(;o<t.childCount;){let c=t.child(o++);if(i+=c.nodeSize,!c.isText)break;a+=c.text}if(i>=n){if(i>=r&&a.slice(r-e.length-l,r-l)==e)return r-e.length;let c=l<r?a.lastIndexOf(e,r-l-1):-1;if(c>=0&&c+e.length+l>=n)return l+c;if(n==r&&a.length>=r+e.length-l&&a.slice(r-l,r-l+e.length)==e)return r}}return-1}function Hf(t,e,n,r,o){let i=[];for(let s=0,l=0;s<t.length;s++){let a=t[s],c=l,u=l+=a.size;c>=n||u<=e?i.push(a):(c<e&&i.push(a.slice(0,e-c,r)),o&&(i.push(o),o=void 0),u>n&&i.push(a.slice(n-c,a.size,r)))}return i}function gh(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),i=o&&o.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l=r.resolve(s),a,c;if(hu(n)){for(a=s;o&&!o.node;)o=o.parent;let d=o.node;if(o&&d.isAtom&&Se.isSelectable(d)&&o.parent&&!(d.isInline&&IN(n.focusNode,n.focusOffset,o.dom))){let f=o.posBefore;c=new Se(s==f?l:r.resolve(f))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let d=s,f=s;for(let p=0;p<n.rangeCount;p++){let g=n.getRangeAt(p);d=Math.min(d,t.docView.posFromDOM(g.startContainer,g.startOffset,1)),f=Math.max(f,t.docView.posFromDOM(g.endContainer,g.endOffset,-1))}if(d<0)return null;[a,s]=f==t.state.selection.anchor?[f,d]:[d,f],l=r.resolve(s)}else a=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(a<0)return null}let u=r.resolve(a);if(!c){let d=e=="pointer"||t.state.selection.head<l.pos&&!i?1:-1;c=mh(t,u,l,d)}return c}function Tx(t){return t.editable?t.hasFocus():Mx(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function $r(t,e=!1){let n=t.state.selection;if(Ax(t,n),!!Tx(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Dt){let r=t.domSelectionRange(),o=t.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&hi(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)hP(t);else{let{anchor:r,head:o}=n,i,s;j1&&!(n instanceof ke)&&(n.$from.parent.inlineContent||(i=R1(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=R1(t,n.to))),t.docView.setSelection(r,o,t,e),j1&&(i&&N1(i),s&&N1(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&pP(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const j1=zt||Dt&&mx<63;function R1(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(zt&&o&&o.contentEditable=="false")return Ad(o);if((!o||o.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(o)return Ad(o);if(i)return Ad(i)}}function Ad(t){return t.contentEditable="true",zt&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function N1(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function pP(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=o)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!Tx(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function hP(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,o=r.nodeName=="IMG";o?n.setStart(r.parentNode,kt(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!o&&!t.state.selection.visible&&tn&&bo<=11&&(r.disabled=!0,r.disabled=!1)}function Ax(t,e){if(e instanceof Se){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(P1(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else P1(t)}function P1(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function mh(t,e,n,r){return t.someProp("createSelectionBetween",o=>o(t,e,n))||ke.between(e,n,r)}function D1(t){return t.editable&&!t.hasFocus()?!1:Mx(t)}function Mx(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function gP(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return hi(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Bf(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return i&&Ee.findFrom(i,e)}function oo(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function L1(t,e,n){let r=t.state.selection;if(r instanceof ke)if(n.indexOf("s")>-1){let{$head:o}=r,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=t.state.doc.resolve(o.pos+i.nodeSize*(e<0?-1:1));return oo(t,new ke(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let o=Bf(t.state,e);return o&&o instanceof Se?oo(t,o):!1}else if(!(_n&&n.indexOf("m")>-1)){let o=r.$head,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter,s;if(!i||i.isText)return!1;let l=e<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(s=t.docView.descAt(l))&&!s.contentDOM?Se.isSelectable(i)?oo(t,new Se(e<0?t.state.doc.resolve(o.pos-i.nodeSize):o)):Wl?oo(t,new ke(t.state.doc.resolve(e<0?l:l+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Se&&r.node.isInline)return oo(t,new ke(e>0?r.$to:r.$from));{let o=Bf(t.state,e);return o?oo(t,o):!1}}}function Ec(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function il(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Ti(t,e){return e<0?mP(t):bP(t)}function mP(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=!1;for(Jn&&n.nodeType==1&&r<Ec(n)&&il(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(il(l,-1))o=n,i=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(jx(n))break;{let l=n.previousSibling;for(;l&&il(l,-1);)o=n.parentNode,i=kt(l),l=l.previousSibling;if(l)n=l,r=Ec(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?zf(t,n,r):o&&zf(t,o,i)}function bP(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o=Ec(n),i,s;for(;;)if(r<o){if(n.nodeType!=1)break;let l=n.childNodes[r];if(il(l,1))i=n,s=++r;else break}else{if(jx(n))break;{let l=n.nextSibling;for(;l&&il(l,1);)i=l.parentNode,s=kt(l)+1,l=l.nextSibling;if(l)n=l,r=0,o=Ec(n);else{if(n=n.parentNode,n==t.dom)break;r=o=0}}}i&&zf(t,i,s)}function jx(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function vP(t,e){for(;t&&e==t.childNodes.length&&!Fl(t);)e=kt(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function yP(t,e){for(;t&&!e&&!Fl(t);)e=kt(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function zf(t,e,n){if(e.nodeType!=3){let i,s;(s=vP(e,n))?(e=s,n=0):(i=yP(e,n))&&(e=i,n=i.nodeValue.length)}let r=t.domSelection();if(!r)return;if(hu(r)){let i=document.createRange();i.setEnd(e,n),i.setStart(e,n),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:o}=t;setTimeout(()=>{t.state==o&&$r(t)},50)}function V1(t,e){let n=t.state.doc.resolve(e);if(!(Dt||BN)&&n.parent.inlineContent){let o=t.coordsAtPos(e);if(e>n.start()){let i=t.coordsAtPos(e-1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left<o.left?"ltr":"rtl"}if(e<n.end()){let i=t.coordsAtPos(e+1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function I1(t,e,n){let r=t.state.selection;if(r instanceof ke&&!r.empty||n.indexOf("s")>-1||_n&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Bf(t.state,e);if(s&&s instanceof Se)return oo(t,s)}if(!o.parent.inlineContent){let s=e<0?o:i,l=r instanceof mn?Ee.near(s,e):Ee.findFrom(s,e);return l?oo(t,l):!1}return!1}function $1(t,e){if(!(t.state.selection instanceof ke))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let s=t.state.tr;return e<0?s.delete(n.pos-i.nodeSize,n.pos):s.delete(n.pos,n.pos+i.nodeSize),t.dispatch(s),!0}return!1}function H1(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function xP(t){if(!zt||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;H1(t,r,"true"),setTimeout(()=>H1(t,r,"false"),20)}return!1}function wP(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function SP(t,e){let n=e.keyCode,r=wP(e);if(n==8||_n&&n==72&&r=="c")return $1(t,-1)||Ti(t,-1);if(n==46&&!e.shiftKey||_n&&n==68&&r=="c")return $1(t,1)||Ti(t,1);if(n==13||n==27)return!0;if(n==37||_n&&n==66&&r=="c"){let o=n==37?V1(t,t.state.selection.from)=="ltr"?-1:1:-1;return L1(t,o,r)||Ti(t,o)}else if(n==39||_n&&n==70&&r=="c"){let o=n==39?V1(t,t.state.selection.from)=="ltr"?1:-1:1;return L1(t,o,r)||Ti(t,o)}else{if(n==38||_n&&n==80&&r=="c")return I1(t,-1,r)||Ti(t,-1);if(n==40||_n&&n==78&&r=="c")return xP(t)||I1(t,1,r)||Ti(t,1);if(r==(_n?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Rx(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:r,openStart:o,openEnd:i}=e;for(;o>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,i--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=t.someProp("clipboardSerializer")||wi.fromSchema(t.state.schema),l=Ix(),a=l.createElement("div");a.appendChild(s.serializeFragment(r,{document:l}));let c=a.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=Vx[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let g=l.createElement(u[p]);for(;a.firstChild;)g.appendChild(a.firstChild);a.appendChild(g),d++}c=a.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${i}${d?` -${d}`:""} ${JSON.stringify(n)}`);let f=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,`
|
|
347
359
|
|
|
348
|
-
`);return{dom:
|
|
349
|
-
`))),0,0):F.empty;let f=t.someProp("clipboardTextParser",d=>d(e,i,r,t));if(f)a=f;else{let d=i.marks(),{schema:p}=t.state,h=di.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=s.appendChild(document.createElement("p"));m&&g.appendChild(h.serializeNode(p.text(m,d)))})}}else t.someProp("transformPastedHTML",f=>{n=f(n,t)}),s=$3(n),ws&&z3(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let f=+u[3];f>0;f--){let d=s.firstChild;for(;d&&d.nodeType!=1;)d=d.nextSibling;if(!d)break;s=d}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Cf.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!H3.test(d.parentNode.nodeName)?{ignore:!0}:null}})),u)a=F3(Vh(a,+u[1],+u[2]),u[4]);else if(a=F.maxOpen(I3(a.content,i),!0),a.openStart||a.openEnd){let f=0,d=0;for(let p=a.content.firstChild;f<a.openStart&&!p.type.spec.isolating;f++,p=p.firstChild);for(let p=a.content.lastChild;d<a.openEnd&&!p.type.spec.isolating;d++,p=p.lastChild);a=Vh(a,f,d)}return t.someProp("transformPasted",f=>{a=f(a,t)}),a}const H3=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function I3(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(a=>{if(!s)return;let l=i.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&o.length&&B0(l,o,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=$0(s[s.length-1],o.length));let u=I0(a,l);s.push(u),i=i.matchType(u.type),o=l}}),s)return D.from(s)}return t}function I0(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,D.from(t));return t}function B0(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=B0(t,e,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(D.from(I0(n,t,i+1))))}}function $0(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,$0(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(D.empty,!0);return t.copy(n.append(r))}function Lu(t,e,n,r,i,o){let s=e<0?t.firstChild:t.lastChild,a=s.content;return t.childCount>1&&(o=0),i<r-1&&(a=Lu(a,e,n,r,i+1,o)),i>=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(D.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function Vh(t,e,n){return e<t.openStart&&(t=new F(Lu(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new F(Lu(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const z0={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Dh=null;function F0(){return Dh||(Dh=document.implementation.createHTMLDocument("title"))}let Lc=null;function B3(t){let e=window.trustedTypes;return e?(Lc||(Lc=e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Lc.createHTML(t)):t}function $3(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=F0().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&z0[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=B3(t),i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function z3(t){let e=t.querySelectorAll(nt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function F3(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:i,openStart:o,openEnd:s}=t;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=D.from(l.create(r[a+1],i)),o++,s++}return new F(i,o,s)}const at={},lt={},W3={touchstart:!0,touchmove:!0};class U3{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function q3(t){for(let e in at){let n=at[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{K3(t,r)&&!Rf(t,r)&&(t.editable||!(r.type in lt))&&n(t,r)},W3[e]?{passive:!0}:void 0)}st&&t.dom.addEventListener("input",()=>null),ju(t)}function dr(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function G3(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function ju(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Rf(t,r))})}function Rf(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function K3(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function Z3(t,e){!Rf(t,e)&&at[e.type]&&(t.editable||!(e.type in lt))&&at[e.type](t,e)}lt.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!U0(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Zt&&nt&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),no&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,jr(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||j3(t,n)?n.preventDefault():dr(t,"key")};lt.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};lt.keypress=(t,e)=>{let n=e;if(U0(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Nt&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof be)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function kl(t){return{left:t.clientX,top:t.clientY}}function J3(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Pf(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,a=>s>o.depth?a(t,n,o.nodeAfter,o.before(s),i,!0):a(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function $i(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function Y3(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&de.isSelectable(r)?($i(t,new de(n)),!0):!1}function X3(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof de&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let a=s>o.depth?o.nodeAfter:o.node(s);if(de.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?($i(t,de.create(t.state.doc,i)),!0):!1}function Q3(t,e,n,r,i){return Pf(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?X3(t,n):Y3(t,n))}function ek(t,e,n,r){return Pf(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function tk(t,e,n,r){return Pf(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||nk(t,n,r)}function nk(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?($i(t,be.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),a=i.before(o);if(s.inlineContent)$i(t,be.create(r,a+1,a+1+s.content.size));else if(de.isSelectable(s))$i(t,de.create(r,a));else continue;return!0}}function Vf(t){return Ya(t)}const W0=Nt?"metaKey":"ctrlKey";at.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Vf(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&J3(n,t.input.lastClick)&&!n[W0]&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(kl(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new rk(t,s,n,!!r)):(o=="doubleClick"?ek:tk)(t,s.pos,s.inside,n)?n.preventDefault():dr(t,"pointer"))};class rk{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[W0],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let u=e.state.doc.resolve(n.pos);o=u.parent,s=u.depth?u.before():0}const a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:c}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof de&&c.from<=s&&c.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&on&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),dr(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Fn(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(kl(e))),this.updateAllowDefault(e),this.allowDefault||!n?dr(this.view,"pointer"):Q3(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||st&&this.mightDrag&&!this.mightDrag.node.isAtom||nt&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?($i(this.view,ge.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):dr(this.view,"pointer")}move(e){this.updateAllowDefault(e),dr(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}at.touchstart=t=>{t.input.lastTouch=Date.now(),Vf(t),dr(t,"pointer")};at.touchmove=t=>{t.input.lastTouch=Date.now(),dr(t,"pointer")};at.contextmenu=t=>Vf(t);function U0(t,e){return t.composing?!0:st&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const ik=Zt?5e3:-1;lt.compositionstart=lt.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof be&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Ya(t,!0),t.markCursor=null;else if(Ya(t,!e.selection.empty),on&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){let a=t.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}q0(t,ik)};lt.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,q0(t,20))};function q0(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Ya(t),e))}function G0(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=sk());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function ok(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=Y_(e.focusNode,e.focusOffset),r=X_(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function sk(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Ya(t,e=!1){if(!(Zt&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),G0(t),e||t.docView&&t.docView.dirty){let n=Mf(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!t.state.selection.empty?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function ak(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const ts=mt&&hr<15||no&&r3<604;at.copy=lt.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=ts?null:n.clipboardData,s=r.content(),{dom:a,text:l}=j0(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):ak(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function lk(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function ck(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ns(t,r.value,null,i,e):ns(t,r.textContent,r.innerHTML,i,e)},50)}function ns(t,e,n,r,i){let o=H0(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,o||F.empty)))return!0;if(!o)return!1;let s=lk(o),a=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function K0(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}lt.paste=(t,e)=>{let n=e;if(t.composing&&!Zt)return;let r=ts?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&ns(t,K0(r),r.getData("text/html"),i,n)?n.preventDefault():ck(t,n)};class Z0{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const J0=Nt?"altKey":"ctrlKey";at.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(kl(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof de?i.to-1:i.to))){if(r&&r.mightDrag)s=de.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=t.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(s=de.create(t.state.doc,f.posBefore))}}let a=(s||t.state.selection).content(),{dom:l,text:c,slice:u}=j0(t,a);(!n.dataTransfer.files.length||!nt||x0>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(ts?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",ts||n.dataTransfer.setData("text/plain",c),t.dragging=new Z0(u,!n[J0],s)};at.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};lt.dragover=lt.dragenter=(t,e)=>e.preventDefault();lt.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(kl(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",h=>{s=h(s,t)}):s=H0(t,K0(n.dataTransfer),ts?null:n.dataTransfer.getData("text/html"),!1,o);let a=!!(r&&!n[J0]);if(t.someProp("handleDrop",h=>h(t,n,s||F.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?r_(t.state.doc,o.pos,s):o.pos;l==null&&(l=o.pos);let c=t.state.tr;if(a){let{node:h}=r;h?h.replace(c):c.deleteSelection()}let u=c.mapping.map(l),f=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,d=c.doc;if(f?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(d))return;let p=c.doc.resolve(u);if(f&&de.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new de(p));else{let h=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((m,g,y,w)=>h=w),c.setSelection(Nf(t,p,c.doc.resolve(h)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))};at.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Fn(t)},20))};at.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};at.beforeinput=(t,e)=>{if(nt&&Zt&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,jr(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in lt)at[t]=lt[t];function rs(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Xa{constructor(e,n){this.toDOM=e,this.spec=n||Zr,this.side=this.spec.side||0}map(e,n,r,i){let{pos:o,deleted:s}=e.mapResult(n.from+i,this.side<0?-1:1);return s?null:new dt(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Xa&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&rs(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class gr{constructor(e,n){this.attrs=e,this.spec=n||Zr}map(e,n,r,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new dt(o,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof gr&&rs(this.attrs,e.attrs)&&rs(this.spec,e.spec)}static is(e){return e.type instanceof gr}destroy(){}}class Df{constructor(e,n){this.attrs=e,this.spec=n||Zr}map(e,n,r,i){let o=e.mapResult(n.from+i,1);if(o.deleted)return null;let s=e.mapResult(n.to+i,-1);return s.deleted||s.pos<=o.pos?null:new dt(o.pos-r,s.pos-r,this)}valid(e,n){let{index:r,offset:i}=e.content.findIndex(n.from),o;return i==n.from&&!(o=e.child(r)).isText&&i+o.nodeSize==n.to}eq(e){return this==e||e instanceof Df&&rs(this.attrs,e.attrs)&&rs(this.spec,e.spec)}destroy(){}}class dt{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new dt(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new dt(e,e,new Xa(n,r))}static inline(e,n,r,i){return new dt(e,n,new gr(r,i))}static node(e,n,r,i){return new dt(e,n,new Df(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof gr}get widget(){return this.type instanceof Xa}}const Oi=[],Zr={};class Pe{constructor(e,n){this.local=e.length?e:Oi,this.children=n.length?n:Oi}static create(e,n){return n.length?Qa(n,e,0,Zr):et}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,o){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=n&&a.to>=e&&(!o||o(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let a=this.children[s]+1;this.children[s+2].findInner(e-a,n-a,r,i+a,o)}}map(e,n,r){return this==et||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Zr)}mapInner(e,n,r,i,o){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,i);l&&l.type.valid(n,l)?(s||(s=[])).push(l):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?uk(this.children,s||[],e,n,r,i,o):s?new Pe(s.sort(Jr),Oi):et}add(e,n){return n.length?this==et?Pe.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,o=0;e.forEach((a,l)=>{let c=l+r,u;if(u=X0(n,a,c)){for(i||(i=this.children.slice());o<i.length&&i[o]<l;)o+=3;i[o]==l?i[o+2]=i[o+2].addInner(a,u,c+1):i.splice(o,0,l,l+a.nodeSize,Qa(u,a,c+1,Zr)),o+=3}});let s=Y0(o?Q0(n):n,-r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new Pe(s.length?this.local.concat(s).sort(Jr):this.local,i||this.children)}remove(e){return e.length==0||this==et?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let s,a=r[o]+n,l=r[o+1]+n;for(let u=0,f;u<e.length;u++)(f=e[u])&&f.from>a&&f.to<l&&(e[u]=null,(s||(s=[])).push(f));if(!s)continue;r==this.children&&(r=this.children.slice());let c=r[o+2].removeInner(s,a+1);c!=et?r[o+2]=c:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,s;o<e.length;o++)if(s=e[o])for(let a=0;a<i.length;a++)i[a].eq(s,n)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Pe(i,r):et}forChild(e,n){if(this==et)return this;if(n.isLeaf)return Pe.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let o=e+1,s=o+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>o&&l.type instanceof gr){let c=Math.max(o,l.from)-o,u=Math.min(s,l.to)-o;c<u&&(i||(i=[])).push(l.copy(c,u))}}if(i){let a=new Pe(i.sort(Jr),Oi);return r?new ir([a,r]):a}return r||et}eq(e){if(this==e)return!0;if(!(e instanceof Pe)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Lf(this.localsInner(e))}localsInner(e){if(this==et)return Oi;if(e.inlineContent||!this.local.some(gr.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof gr||n.push(this.local[r]);return n}forEachSet(e){e(this)}}Pe.empty=new Pe([],[]);Pe.removeOverlap=Lf;const et=Pe.empty;class ir{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,Zr));return ir.from(r)}forChild(e,n){if(n.isLeaf)return Pe.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,n);o!=et&&(o instanceof ir?r=r.concat(o.members):r.push(o))}return ir.from(r)}eq(e){if(!(e instanceof ir)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!n)n=o;else{r&&(n=n.slice(),r=!1);for(let s=0;s<o.length;s++)n.push(o[s])}}return n?Lf(r?n:n.sort(Jr)):Oi}static from(e){switch(e.length){case 0:return et;case 1:return e[0];default:return new ir(e.every(n=>n instanceof Pe)?e:e.reduce((n,r)=>n.concat(r instanceof Pe?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function uk(t,e,n,r,i,o,s){let a=t.slice();for(let c=0,u=o;c<n.maps.length;c++){let f=0;n.maps[c].forEach((d,p,h,m)=>{let g=m-h-(p-d);for(let y=0;y<a.length;y+=3){let w=a[y+1];if(w<0||d>w+u-f)continue;let x=a[y]+u-f;p>=x?a[y+1]=d<=x?-2:-1:d>=u&&g&&(a[y]+=g,a[y+1]+=g)}f+=g}),u=n.maps[c].map(u,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let u=n.map(t[c]+o),f=u-i;if(f<0||f>=r.content.size){l=!0;continue}let d=n.map(t[c+1]+o,-1),p=d-i,{index:h,offset:m}=r.content.findIndex(f),g=r.maybeChild(h);if(g&&m==f&&m+g.nodeSize==p){let y=a[c+2].mapInner(n,g,u+1,t[c]+o+1,s);y!=et?(a[c]=f,a[c+1]=p,a[c+2]=y):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=fk(a,t,e,n,i,o,s),u=Qa(c,r,0,s);e=u.local;for(let f=0;f<a.length;f+=3)a[f+1]<0&&(a.splice(f,3),f-=3);for(let f=0,d=0;f<u.children.length;f+=3){let p=u.children[f];for(;d<a.length&&a[d]<p;)d+=3;a.splice(d,0,u.children[f],u.children[f+1],u.children[f+2])}}return new Pe(e.sort(Jr),a)}function Y0(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(new dt(i.from+e,i.to+e,i.type))}return n}function fk(t,e,n,r,i,o,s){function a(l,c){for(let u=0;u<l.local.length;u++){let f=l.local[u].map(r,i,c);f?n.push(f):s.onRemove&&s.onRemove(l.local[u].spec)}for(let u=0;u<l.children.length;u+=3)a(l.children[u+2],l.children[u]+c+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+o+1);return n}function X0(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let o=0,s;o<t.length;o++)(s=t[o])&&s.from>n&&s.to<r&&((i||(i=[])).push(s),t[o]=null);return i}function Q0(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Qa(t,e,n,r){let i=[],o=!1;e.forEach((a,l)=>{let c=X0(t,a,l+n);if(c){o=!0;let u=Qa(c,a,n+l+1,r);u!=et&&i.push(l,l+a.nodeSize,u)}});let s=Y0(o?Q0(t):t,-n).sort(Jr);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||i.length?new Pe(s,i):et}function Jr(t,e){return t.from-e.from||t.to-e.to}function Lf(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let o=e[i];if(o.from==r.from){o.to!=r.to&&(e==t&&(e=t.slice()),e[i]=o.copy(o.from,r.to),Lh(e,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,o.from),Lh(e,i,r.copy(o.from,r.to)));break}}}return e}function Lh(t,e,n){for(;e<t.length&&Jr(n,t[e])>0;)e++;t.splice(e,0,n)}function jc(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=et&&e.push(r)}),t.cursorWrapper&&e.push(Pe.create(t.state.doc,[t.cursorWrapper.deco])),ir.from(e)}const dk={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},pk=mt&&hr<=11;class hk{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class mk{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new hk,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);mt&&hr<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),pk&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,dk)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Ah(this.view)){if(this.suppressingSelectionUpdates)return Fn(this.view);if(mt&&hr<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&si(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let o=e.focusNode;o;o=es(o))n.add(o);for(let o=e.anchorNode;o;o=es(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Ah(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,a=!1,l=[];if(e.editable)for(let u=0;u<n.length;u++){let f=this.registerMutation(n[u],l);f&&(o=o<0?f.from:Math.min(f.from,o),s=s<0?f.to:Math.max(f.to,s),f.typeOver&&(a=!0))}if(on&&l.length){let u=l.filter(f=>f.nodeName=="BR");if(u.length==2){let[f,d]=u;f.parentNode&&f.parentNode.parentNode==d.parentNode?d.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let d of u){let p=d.parentNode;p&&p.nodeName=="LI"&&(!f||vk(e,f)!=p)&&d.remove()}}}let c=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&El(r)&&(c=Mf(e))&&c.eq(ge.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Fn(e),this.currentSelection.set(r),e.scrollToSelection()):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),gk(e)),this.handleDOMChange(o,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Fn(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++){let f=e.addedNodes[u];n.push(f),f.nodeType==3&&(this.lastChangedTextNode=f)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,o=e.nextSibling;if(mt&&hr<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:f,nextSibling:d}=e.addedNodes[u];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f),(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(o=d)}let s=i&&i.parentNode==e.target?Ge(i)+1:0,a=r.localPosFromDOM(e.target,s,-1),l=o&&o.parentNode==e.target?Ge(o):e.target.childNodes.length,c=r.localPosFromDOM(e.target,l,1);return{from:a,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let jh=new WeakMap,Hh=!1;function gk(t){if(!jh.has(t)&&(jh.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=on,Hh)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Hh=!0}}function Ih(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return si(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function bk(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return Ih(t,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?Ih(t,n):null}function vk(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function yk(t,e,n){let{node:r,fromOffset:i,toOffset:o,from:s,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),c,u=l.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:l.anchorOffset}],El(l)||c.push({node:l.focusNode,offset:l.focusOffset})),nt&&t.input.lastKeyCode===8)for(let g=o;g>i;g--){let y=r.childNodes[g-1],w=y.pmViewDesc;if(y.nodeName=="BR"&&!w){o=g;break}if(!w||w.size)break}let f=t.state.doc,d=t.someProp("domParser")||Cf.fromSchema(t.state.schema),p=f.resolve(s),h=null,m=d.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:wk,context:p});if(c&&c[0].pos!=null){let g=c[0].pos,y=c[1]&&c[1].pos;y==null&&(y=g),h={anchor:g+s,head:y+s}}return{doc:m,sel:h,from:s,to:a}}function wk(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(st&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||st&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const xk=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Sk(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let T=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,P=Mf(t,T);if(P&&!t.state.selection.eq(P)){if(nt&&Zt&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",z=>z(t,jr(13,"Enter"))))return;let I=t.state.tr.setSelection(P);T=="pointer"?I.setMeta("pointer",!0):T=="key"&&I.scrollIntoView(),o&&I.setMeta("composition",o),t.dispatch(I)}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(n);e=s.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,c=yk(t,e,n),u=t.state.doc,f=u.slice(c.from,c.to),d,p;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(d=t.state.selection.to,p="end"):(d=t.state.selection.from,p="start"),t.input.lastKeyCode=null;let h=Ek(f.content,c.doc.content,c.from,d,p);if(h&&t.input.domChangeCount++,(no&&t.input.lastIOSEnter>Date.now()-225||Zt)&&i.some(T=>T.nodeType==1&&!xk.test(T.nodeName))&&(!h||h.endA>=h.endB)&&t.someProp("handleKeyDown",T=>T(t,jr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!h)if(r&&l instanceof be&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))h={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let T=Bh(t,t.state.doc,c.sel);if(T&&!T.eq(t.state.selection)){let P=t.state.tr.setSelection(T);o&&P.setMeta("composition",o),t.dispatch(P)}}return}t.state.selection.from<t.state.selection.to&&h.start==h.endB&&t.state.selection instanceof be&&(h.start>t.state.selection.from&&h.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?h.start=t.state.selection.from:h.endA<t.state.selection.to&&h.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(h.endB+=t.state.selection.to-h.endA,h.endA=t.state.selection.to)),mt&&hr<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>c.from&&c.doc.textBetween(h.start-c.from-1,h.start-c.from+1)==" "&&(h.start--,h.endA--,h.endB--);let m=c.doc.resolveNoCache(h.start-c.from),g=c.doc.resolveNoCache(h.endB-c.from),y=u.resolve(h.start),w=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=h.endA,x;if((no&&t.input.lastIOSEnter>Date.now()-225&&(!w||i.some(T=>T.nodeName=="DIV"||T.nodeName=="P"))||!w&&m.pos<c.doc.content.size&&!m.sameParent(g)&&(x=ge.findFrom(c.doc.resolve(m.pos+1),1,!0))&&x.head==g.pos)&&t.someProp("handleKeyDown",T=>T(t,jr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>h.start&&Ok(u,h.start,h.endA,m,g)&&t.someProp("handleKeyDown",T=>T(t,jr(8,"Backspace")))){Zt&&nt&&t.domObserver.suppressSelectionUpdates();return}nt&&Zt&&h.endB==h.start&&(t.input.lastAndroidDelete=Date.now()),Zt&&!w&&m.start()!=g.start()&&g.parentOffset==0&&m.depth==g.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==h.endA&&(h.endB-=2,g=c.doc.resolveNoCache(h.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(T){return T(t,jr(13,"Enter"))})},20));let C=h.start,v=h.endA,E,A,B;if(w){if(m.pos==g.pos)mt&&hr<=11&&m.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Fn(t),20)),E=t.state.tr.delete(C,v),A=u.resolve(h.start).marksAcross(u.resolve(h.endA));else if(h.endA==h.endB&&(B=Ck(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,h.endA-y.start()))))E=t.state.tr,B.type=="add"?E.addMark(C,v,B.mark):E.removeMark(C,v,B.mark);else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let T=m.parent.textBetween(m.parentOffset,g.parentOffset);if(t.someProp("handleTextInput",P=>P(t,C,v,T)))return;E=t.state.tr.insertText(T,C,v)}}if(E||(E=t.state.tr.replace(C,v,c.doc.slice(h.start-c.from,h.endB-c.from))),c.sel){let T=Bh(t,E.doc,c.sel);T&&!(nt&&Zt&&t.composing&&T.empty&&(h.start!=h.endB||t.input.lastAndroidDelete<Date.now()-100)&&(T.head==C||T.head==E.mapping.map(v)-1)||mt&&T.empty&&T.head==C)&&E.setSelection(T)}A&&E.ensureMarks(A),o&&E.setMeta("composition",o),t.dispatch(E.scrollIntoView())}function Bh(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Nf(t,e.resolve(n.anchor),e.resolve(n.head))}function Ck(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,a,l;for(let u=0;u<r.length;u++)i=r[u].removeFromSet(i);for(let u=0;u<n.length;u++)o=n[u].removeFromSet(o);if(i.length==1&&o.length==0)a=i[0],s="add",l=u=>u.mark(a.addToSet(u.marks));else if(i.length==0&&o.length==1)a=o[0],s="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<e.childCount;u++)c.push(l(e.child(u)));if(D.from(c).eq(t))return{mark:a,type:s}}function Ok(t,e,n,r,i){if(n-e<=i.pos-r.pos||Hc(r,!0,!1)<i.pos)return!1;let o=t.resolve(e);if(!r.parent.isTextblock){let a=o.nodeAfter;return a!=null&&n==e+a.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=t.resolve(Hc(o,!0,!0));return!s.parent.isTextblock||s.pos>n||Hc(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function Hc(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let o=t.node(r).maybeChild(t.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function Ek(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let l=Math.max(0,o-Math.min(s,a));r-=s+l-o}if(s<o&&t.size<e.size){let l=r<=o&&r>=s?o-r:0;o-=l,o&&o<e.size&&$h(e.textBetween(o-1,o+1))&&(o+=l?1:-1),a=o+(a-s),s=o}else if(a<o){let l=r<=o&&r>=a?o-r:0;o-=l,o&&o<t.size&&$h(t.textBetween(o-1,o+1))&&(o+=l?1:-1),s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}function $h(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class _k{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new U3,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(qh),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Wh(this),Fh(this),this.nodeViews=Uh(this),this.docView=Sh(this.state.doc,zh(this),jc(this),this.dom,this),this.domObserver=new mk(this,(r,i,o,s)=>Sk(this,r,i,o,s)),this.domObserver.start(),q3(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&ju(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(qh),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(G0(this),s=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=Uh(this);Ak(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&ju(this),this.editable=Wh(this),Fh(this);let l=jc(this),c=zh(this),u=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=o||!this.docView.matchesNode(e.doc,c,l);(f||!e.selection.eq(i.selection))&&(s=!0);let d=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&s3(this);if(s){this.domObserver.stop();let p=f&&(mt||nt)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&kk(i.selection,e.selection);if(f){let h=nt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=ok(this)),(o||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=Sh(e.doc,c,l,this.dom,this)),h&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&M3(this))?Fn(this,p):(V0(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():d&&a3(d)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof de){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&gh(this,n.getBoundingClientRect(),e)}else gh(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let o=r.from+(this.state.doc.content.size-n.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new Z0(e.slice,e.move,i<0?void 0:de.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[e];if(a!=null&&(i=n?n(a):a))return i}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let a=o[s].props[e];if(a!=null&&(i=n?n(a):a))return i}}hasFocus(){if(mt){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&l3(this.dom),Fn(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return p3(this,e)}coordsAtPos(e,n=1){return _0(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return v3(this,n||this.state,e)}pasteHTML(e,n){return ns(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return ns(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(G3(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],jc(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Z_())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Z3(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?st&&this.root.nodeType===11&&e3(this.dom.ownerDocument)==this.dom&&bk(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function zh(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[dt.node(0,t.state.doc.content.size,e)]}function Fh(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:dt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Wh(t){return!t.someProp("editable",e=>e(t.state)===!1)}function kk(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function Uh(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function Ak(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function qh(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Hu,Iu;if(typeof WeakMap<"u"){let t=new WeakMap;Hu=e=>t.get(e),Iu=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;Hu=r=>{for(let i=0;i<t.length;i+=2)if(t[i]==r)return t[i+1]},Iu=(r,i)=>(n==10&&(n=0),t[n++]=r,t[n++]=i)}var He=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const r=e%this.width,i=e/this.width|0;let o=r+1,s=i+1;for(let a=1;o<this.width&&this.map[e+a]==n;a++)o++;for(let a=1;s<this.height&&this.map[e+this.width*a]==n;a++)s++;return{left:r,top:i,right:o,bottom:s}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){const{left:r,right:i,top:o,bottom:s}=this.findCell(t);return e=="horiz"?(n<0?r==0:i==this.width)?null:this.map[o*this.width+(n<0?r-1:i)]:(n<0?o==0:s==this.height)?null:this.map[r+this.width*(n<0?o-1:s)]}rectBetween(t,e){const{left:n,right:r,top:i,bottom:o}=this.findCell(t),{left:s,right:a,top:l,bottom:c}=this.findCell(e);return{left:Math.min(n,s),top:Math.min(i,l),right:Math.max(r,a),bottom:Math.max(o,c)}}cellsInRect(t){const e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let i=t.left;i<t.right;i++){const o=r*this.width+i,s=this.map[o];n[s]||(n[s]=!0,!(i==t.left&&i&&this.map[o-1]==s||r==t.top&&r&&this.map[o-this.width]==s)&&e.push(s))}return e}positionAt(t,e,n){for(let r=0,i=0;;r++){const o=i+n.child(r).nodeSize;if(r==t){let s=e+t*this.width;const a=(t+1)*this.width;for(;s<a&&this.map[s]<i;)s++;return s==a?o-1:this.map[s]}i=o}}static get(t){return Hu(t)||Iu(t,Tk(t))}};function Tk(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=Mk(t),n=t.childCount,r=[];let i=0,o=null;const s=[];for(let c=0,u=e*n;c<u;c++)r[c]=0;for(let c=0,u=0;c<n;c++){const f=t.child(c);u++;for(let h=0;;h++){for(;i<r.length&&r[i]!=0;)i++;if(h==f.childCount)break;const m=f.child(h),{colspan:g,rowspan:y,colwidth:w}=m.attrs;for(let x=0;x<y;x++){if(x+c>=n){(o||(o=[])).push({type:"overlong_rowspan",pos:u,n:y-x});break}const C=i+x*e;for(let v=0;v<g;v++){r[C+v]==0?r[C+v]=u:(o||(o=[])).push({type:"collision",row:c,pos:u,n:g-v});const E=w&&w[v];if(E){const A=(C+v)%e*2,B=s[A];B==null||B!=E&&s[A+1]==1?(s[A]=E,s[A+1]=1):B==E&&s[A+1]++}}}i+=g,u+=m.nodeSize}const d=(c+1)*e;let p=0;for(;i<d;)r[i++]==0&&p++;p&&(o||(o=[])).push({type:"missing",row:c,n:p}),u++}const a=new He(e,n,r,o);let l=!1;for(let c=0;!l&&c<s.length;c+=2)s[c]!=null&&s[c+1]<n&&(l=!0);return l&&Nk(a,s,t),a}function Mk(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const i=t.child(r);let o=0;if(n)for(let s=0;s<r;s++){const a=t.child(s);for(let l=0;l<a.childCount;l++){const c=a.child(l);s+c.attrs.rowspan>r&&(o+=c.attrs.colspan)}}for(let s=0;s<i.childCount;s++){const a=i.child(s);o+=a.attrs.colspan,a.attrs.rowspan>1&&(n=!0)}e==-1?e=o:e!=o&&(e=Math.max(e,o))}return e}function Nk(t,e,n){t.problems||(t.problems=[]);const r={};for(let i=0;i<t.map.length;i++){const o=t.map[i];if(r[o])continue;r[o]=!0;const s=n.nodeAt(o);if(!s)throw new RangeError(`No cell with offset ${o} found`);let a=null;const l=s.attrs;for(let c=0;c<l.colspan;c++){const u=(i+c)%t.width,f=e[u*2];f!=null&&(!l.colwidth||l.colwidth[c]!=f)&&((a||(a=Rk(l)))[c]=f)}a&&t.problems.unshift({type:"colwidth mismatch",pos:o,colwidth:a})}}function Rk(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function Gh(t,e){if(typeof t=="string")return{};const n=t.getAttribute("data-colwidth"),r=n&&/^\d+(,\d+)*$/.test(n)?n.split(",").map(s=>Number(s)):null,i=Number(t.getAttribute("colspan")||1),o={colspan:i,rowspan:Number(t.getAttribute("rowspan")||1),colwidth:r&&r.length==i?r:null};for(const s in e){const a=e[s].getFromDOM,l=a&&a(t);l!=null&&(o[s]=l)}return o}function Kh(t,e){const n={};t.attrs.colspan!=1&&(n.colspan=t.attrs.colspan),t.attrs.rowspan!=1&&(n.rowspan=t.attrs.rowspan),t.attrs.colwidth&&(n["data-colwidth"]=t.attrs.colwidth.join(","));for(const r in e){const i=e[r].setDOMAttr;i&&i(t.attrs[r],n)}return n}function Pk(t){const e=t.cellAttributes||{},n={colspan:{default:1},rowspan:{default:1},colwidth:{default:null}};for(const r in e)n[r]={default:e[r].default};return{table:{content:"table_row+",tableRole:"table",isolating:!0,group:t.tableGroup,parseDOM:[{tag:"table"}],toDOM(){return["table",["tbody",0]]}},table_row:{content:"(table_cell | table_header)*",tableRole:"row",parseDOM:[{tag:"tr"}],toDOM(){return["tr",0]}},table_cell:{content:t.cellContent,attrs:n,tableRole:"cell",isolating:!0,parseDOM:[{tag:"td",getAttrs:r=>Gh(r,e)}],toDOM(r){return["td",Kh(r,e),0]}},table_header:{content:t.cellContent,attrs:n,tableRole:"header_cell",isolating:!0,parseDOM:[{tag:"th",getAttrs:r=>Gh(r,e)}],toDOM(r){return["th",Kh(r,e),0]}}}}function _n(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],i=r.spec.tableRole;i&&(e[i]=r)}}return e}var or=new vs("selectingCells");function Ss(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function Al(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function jf(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=Ss(e.$head)||Vk(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function Vk(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function Bu(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function Dk(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function Hf(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function eb(t,e,n){const r=t.node(-1),i=He.get(r),o=t.start(-1),s=i.nextCell(t.pos-o,e,n);return s==null?null:t.node(0).resolve(o+s)}function ro(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}var Fe=class Vn extends ge{constructor(e,n=e){const r=e.node(-1),i=He.get(r),o=e.start(-1),s=i.rectBetween(e.pos-o,n.pos-o),a=e.node(0),l=i.cellsInRect(s).filter(u=>u!=n.pos-o);l.unshift(n.pos-o);const c=l.map(u=>{const f=r.nodeAt(u);if(!f)throw RangeError(`No cell with offset ${u} found`);const d=o+u+1;return new r0(a.resolve(d),a.resolve(d+f.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),i=e.resolve(n.map(this.$headCell.pos));if(Bu(r)&&Bu(i)&&Hf(r,i)){const o=this.$anchorCell.node(-1)!=r.node(-1);return o&&this.isRowSelection()?Vn.rowSelection(r,i):o&&this.isColSelection()?Vn.colSelection(r,i):new Vn(r,i)}return be.between(r,i)}content(){const e=this.$anchorCell.node(-1),n=He.get(e),r=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),o={},s=[];for(let l=i.top;l<i.bottom;l++){const c=[];for(let u=l*n.width+i.left,f=i.left;f<i.right;f++,u++){const d=n.map[u];if(o[d])continue;o[d]=!0;const p=n.findCell(d);let h=e.nodeAt(d);if(!h)throw RangeError(`No cell with offset ${d} found`);const m=i.left-p.left,g=p.right-i.right;if(m>0||g>0){let y=h.attrs;if(m>0&&(y=ro(y,0,m)),g>0&&(y=ro(y,y.colspan-g,g)),p.left<i.left){if(h=h.type.createAndFill(y),!h)throw RangeError(`Could not create cell with attrs ${JSON.stringify(y)}`)}else h=h.type.create(y,h.content)}if(p.top<i.top||p.bottom>i.bottom){const y={...h.attrs,rowspan:Math.min(p.bottom,i.bottom)-Math.max(p.top,i.top)};p.top<i.top?h=h.type.createAndFill(y):h=h.type.create(y,h.content)}c.push(h)}s.push(e.child(l).copy(D.from(c)))}const a=this.isColSelection()&&this.isRowSelection()?e:s;return new F(D.from(a),1,1)}replace(e,n=F.empty){const r=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){const{$from:a,$to:l}=i[s],c=e.mapping.slice(r);e.replace(c.map(a.pos),c.map(l.pos),s?F.empty:n)}const o=ge.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);o&&e.setSelection(o)}replaceWith(e,n){this.replace(e,new F(D.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=He.get(n),i=this.$anchorCell.start(-1),o=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let s=0;s<o.length;s++)e(n.nodeAt(o[s]),i+o[s])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),i=He.get(r),o=e.start(-1),s=i.findCell(e.pos-o),a=i.findCell(n.pos-o),l=e.node(0);return s.top<=a.top?(s.top>0&&(e=l.resolve(o+i.map[s.left])),a.bottom<i.height&&(n=l.resolve(o+i.map[i.width*(i.height-1)+a.right-1]))):(a.top>0&&(n=l.resolve(o+i.map[a.left])),s.bottom<i.height&&(e=l.resolve(o+i.map[i.width*(i.height-1)+s.right-1]))),new Vn(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=He.get(e),r=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-r),o=n.colCount(this.$headCell.pos-r);if(Math.min(i,o)>0)return!1;const s=i+this.$anchorCell.nodeAfter.attrs.colspan,a=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,a)==n.width}eq(e){return e instanceof Vn&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),i=He.get(r),o=e.start(-1),s=i.findCell(e.pos-o),a=i.findCell(n.pos-o),l=e.node(0);return s.left<=a.left?(s.left>0&&(e=l.resolve(o+i.map[s.top*i.width])),a.right<i.width&&(n=l.resolve(o+i.map[i.width*(a.top+1)-1]))):(a.left>0&&(n=l.resolve(o+i.map[a.top*i.width])),s.right<i.width&&(e=l.resolve(o+i.map[i.width*(s.top+1)-1]))),new Vn(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new Vn(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new Vn(e.resolve(n),e.resolve(r))}getBookmark(){return new Lk(this.$anchorCell.pos,this.$headCell.pos)}};Fe.prototype.visible=!1;ge.jsonID("cell",Fe);var Lk=class tb{constructor(e,n){this.anchor=e,this.head=n}map(e){return new tb(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&Hf(n,r)?new Fe(n,r):ge.near(r,1)}};function jk(t){if(!(t.selection instanceof Fe))return null;const e=[];return t.selection.forEachCell((n,r)=>{e.push(dt.node(r,r+n.nodeSize,{class:"selectedCell"}))}),Pe.create(t.doc,e)}function Hk({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return!1;let n=t.pos,r=e.pos,i=t.depth;for(;i>=0&&!(t.after(i+1)<t.end(i));i--,n++);for(let o=e.depth;o>=0&&!(e.before(o+1)>e.start(o));o--,r--);return n==r&&/row|table/.test(t.node(i).type.spec.tableRole)}function Ik({$from:t,$to:e}){let n,r;for(let i=t.depth;i>0;i--){const o=t.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){n=o;break}}for(let i=e.depth;i>0;i--){const o=e.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){r=o;break}}return n!==r&&e.parentOffset===0}function Bk(t,e,n){const r=(e||t).selection,i=(e||t).doc;let o,s;if(r instanceof de&&(s=r.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")o=Fe.create(i,r.from);else if(s=="row"){const a=i.resolve(r.from+1);o=Fe.rowSelection(a,a)}else if(!n){const a=He.get(r.node),l=r.from+1,c=l+a.map[a.width*a.height-1];o=Fe.create(i,l+1,c)}}else r instanceof be&&Hk(r)?o=be.create(i,r.from):r instanceof be&&Ik(r)&&(o=be.create(i,r.$from.start(),r.$from.end()));return o&&(e||(e=t.tr)).setSelection(o),e}var $k=new vs("fix-tables");function nb(t,e,n,r){const i=t.childCount,o=e.childCount;e:for(let s=0,a=0;s<o;s++){const l=e.child(s);for(let c=a,u=Math.min(i,s+3);c<u;c++)if(t.child(c)==l){a=c+1,n+=l.nodeSize;continue e}r(l,n),a<i&&t.child(a).sameMarkup(l)?nb(t.child(a),l,n+1,r):l.nodesBetween(0,l.content.size,r,n+1),n+=l.nodeSize}}function zk(t,e){let n;const r=(i,o)=>{i.type.spec.tableRole=="table"&&(n=Fk(t,i,o,n))};return e?e.doc!=t.doc&&nb(e.doc,t.doc,0,r):t.doc.descendants(r),n}function Fk(t,e,n,r){const i=He.get(e);if(!i.problems)return r;r||(r=t.tr);const o=[];for(let l=0;l<i.height;l++)o.push(0);for(let l=0;l<i.problems.length;l++){const c=i.problems[l];if(c.type=="collision"){const u=e.nodeAt(c.pos);if(!u)continue;const f=u.attrs;for(let d=0;d<f.rowspan;d++)o[c.row+d]+=c.n;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,ro(f,f.colspan-c.n,c.n))}else if(c.type=="missing")o[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=e.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=e.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}}let s,a;for(let l=0;l<o.length;l++)o[l]&&(s==null&&(s=l),a=l);for(let l=0,c=n+1;l<i.height;l++){const u=e.child(l),f=c+u.nodeSize,d=o[l];if(d>0){let p="cell";u.firstChild&&(p=u.firstChild.type.spec.tableRole);const h=[];for(let g=0;g<d;g++){const y=_n(t.schema)[p].createAndFill();y&&h.push(y)}const m=(l==0||s==l-1)&&a==l?c+1:f-1;r.insert(r.mapping.map(m),h)}c=f}return r.setMeta($k,{fixTables:!0})}function rb(t){const e=t.selection,n=jf(t),r=n.node(-1),i=n.start(-1),o=He.get(r);return{...e instanceof Fe?o.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):o.findCell(n.pos-i),tableStart:i,map:o,table:r}}function Wk(t){return function(e,n){if(!Al(e))return!1;if(n){const r=_n(e.schema),i=rb(e),o=e.tr,s=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),a=s.map(l=>i.table.nodeAt(l));for(let l=0;l<s.length;l++)a[l].type==r.header_cell&&o.setNodeMarkup(i.tableStart+s[l],r.cell,a[l].attrs);if(o.steps.length==0)for(let l=0;l<s.length;l++)o.setNodeMarkup(i.tableStart+s[l],r.header_cell,a[l].attrs);n(o)}return!0}}function Zh(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let i=0;i<r.length;i++){const o=e.table.nodeAt(r[i]);if(o&&o.type!==n.header_cell)return!1}return!0}function If(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?Wk(t):function(n,r){if(!Al(n))return!1;if(r){const i=_n(n.schema),o=rb(n),s=n.tr,a=Zh("row",o,i),l=Zh("column",o,i),u=(t==="column"?a:t==="row"?l:!1)?1:0,f=t=="column"?{left:0,top:u,right:1,bottom:o.map.height}:t=="row"?{left:u,top:0,right:o.map.width,bottom:1}:o,d=t=="column"?l?i.cell:i.header_cell:t=="row"?a?i.cell:i.header_cell:i.cell;o.map.cellsInRect(f).forEach(p=>{const h=p+o.tableStart,m=s.doc.nodeAt(h);m&&s.setNodeMarkup(h,d,m.attrs)}),r(s)}return!0}}If("row",{useDeprecatedLogic:!0});If("column",{useDeprecatedLogic:!0});If("cell",{useDeprecatedLogic:!0});function Uk(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,i=t.before();r>=0;r--){const o=t.node(-1).child(r),s=o.lastChild;if(s)return i-1-s.nodeSize;i-=o.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const n=t.node(-1);for(let r=t.indexAfter(-1),i=t.after();r<n.childCount;r++){const o=n.child(r);if(o.childCount)return i+1;i+=o.nodeSize}}return null}function Jh(t){return function(e,n){if(!Al(e))return!1;const r=Uk(jf(e),t);if(r==null)return!1;if(n){const i=e.doc.resolve(r);n(e.tr.setSelection(be.between(i,Dk(i))).scrollIntoView())}return!0}}function ra(t,e){const n=t.selection;if(!(n instanceof Fe))return!1;if(e){const r=t.tr,i=_n(t.schema).cell.createAndFill().content;n.forEachCell((o,s)=>{o.content.eq(i)||r.replace(r.mapping.map(s+1),r.mapping.map(s+o.nodeSize-1),new F(i,0,0))}),r.docChanged&&e(r)}return!0}function qk(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;const i=e.child(0),o=i.type.spec.tableRole,s=i.type.schema,a=[];if(o=="row")for(let l=0;l<e.childCount;l++){let c=e.child(l).content;const u=l?0:Math.max(0,n-1),f=l<e.childCount-1?0:Math.max(0,r-1);(u||f)&&(c=$u(_n(s).row,new F(c,u,f)).content),a.push(c)}else if(o=="cell"||o=="header_cell")a.push(n||r?$u(_n(s).row,new F(e,n,r)).content:e);else return null;return Gk(s,a)}function Gk(t,e){const n=[];for(let i=0;i<e.length;i++){const o=e[i];for(let s=o.childCount-1;s>=0;s--){const{rowspan:a,colspan:l}=o.child(s).attrs;for(let c=i;c<i+a;c++)n[c]=(n[c]||0)+l}}let r=0;for(let i=0;i<n.length;i++)r=Math.max(r,n[i]);for(let i=0;i<n.length;i++)if(i>=e.length&&e.push(D.empty),n[i]<r){const o=_n(t).cell.createAndFill(),s=[];for(let a=n[i];a<r;a++)s.push(o);e[i]=e[i].append(D.from(s))}return{height:e.length,width:r,rows:e}}function $u(t,e){const n=t.createAndFill();return new n0(n).replace(0,n.content.size,e).doc}function Kk({width:t,height:e,rows:n},r,i){if(t!=r){const o=[],s=[];for(let a=0;a<n.length;a++){const l=n[a],c=[];for(let u=o[a]||0,f=0;u<r;f++){let d=l.child(f%l.childCount);u+d.attrs.colspan>r&&(d=d.type.createChecked(ro(d.attrs,d.attrs.colspan,u+d.attrs.colspan-r),d.content)),c.push(d),u+=d.attrs.colspan;for(let p=1;p<d.attrs.rowspan;p++)o[a+p]=(o[a+p]||0)+d.attrs.colspan}s.push(D.from(c))}n=s,t=r}if(e!=i){const o=[];for(let s=0,a=0;s<i;s++,a++){const l=[],c=n[a%e];for(let u=0;u<c.childCount;u++){let f=c.child(u);s+f.attrs.rowspan>i&&(f=f.type.create({...f.attrs,rowspan:Math.max(1,i-f.attrs.rowspan)},f.content)),l.push(f)}o.push(D.from(l))}n=o,e=i}return{width:t,height:e,rows:n}}function Zk(t,e,n,r,i,o,s){const a=t.doc.type.schema,l=_n(a);let c,u;if(i>e.width)for(let f=0,d=0;f<e.height;f++){const p=n.child(f);d+=p.nodeSize;const h=[];let m;p.lastChild==null||p.lastChild.type==l.cell?m=c||(c=l.cell.createAndFill()):m=u||(u=l.header_cell.createAndFill());for(let g=e.width;g<i;g++)h.push(m);t.insert(t.mapping.slice(s).map(d-1+r),h)}if(o>e.height){const f=[];for(let h=0,m=(e.height-1)*e.width;h<Math.max(e.width,i);h++){const g=h>=e.width?!1:n.nodeAt(e.map[m+h]).type==l.header_cell;f.push(g?u||(u=l.header_cell.createAndFill()):c||(c=l.cell.createAndFill()))}const d=l.row.create(null,D.from(f)),p=[];for(let h=e.height;h<o;h++)p.push(d);t.insert(t.mapping.slice(s).map(r+n.nodeSize-2),p)}return!!(c||u)}function Yh(t,e,n,r,i,o,s,a){if(s==0||s==e.height)return!1;let l=!1;for(let c=i;c<o;c++){const u=s*e.width+c,f=e.map[u];if(e.map[u-e.width]==f){l=!0;const d=n.nodeAt(f),{top:p,left:h}=e.findCell(f);t.setNodeMarkup(t.mapping.slice(a).map(f+r),null,{...d.attrs,rowspan:s-p}),t.insert(t.mapping.slice(a).map(e.positionAt(s,h,n)),d.type.createAndFill({...d.attrs,rowspan:p+d.attrs.rowspan-s})),c+=d.attrs.colspan-1}}return l}function Xh(t,e,n,r,i,o,s,a){if(s==0||s==e.width)return!1;let l=!1;for(let c=i;c<o;c++){const u=c*e.width+s,f=e.map[u];if(e.map[u-1]==f){l=!0;const d=n.nodeAt(f),p=e.colCount(f),h=t.mapping.slice(a).map(f+r);t.setNodeMarkup(h,null,ro(d.attrs,s-p,d.attrs.colspan-(s-p))),t.insert(h+d.nodeSize,d.type.createAndFill(ro(d.attrs,0,s-p))),c+=d.attrs.rowspan-1}}return l}function Qh(t,e,n,r,i){let o=n?t.doc.nodeAt(n-1):t.doc;if(!o)throw new Error("No table found");let s=He.get(o);const{top:a,left:l}=r,c=l+i.width,u=a+i.height,f=t.tr;let d=0;function p(){if(o=n?f.doc.nodeAt(n-1):f.doc,!o)throw new Error("No table found");s=He.get(o),d=f.mapping.maps.length}Zk(f,s,o,n,c,u,d)&&p(),Yh(f,s,o,n,l,c,a,d)&&p(),Yh(f,s,o,n,l,c,u,d)&&p(),Xh(f,s,o,n,a,u,l,d)&&p(),Xh(f,s,o,n,a,u,c,d)&&p();for(let h=a;h<u;h++){const m=s.positionAt(h,l,o),g=s.positionAt(h,c,o);f.replace(f.mapping.slice(d).map(m+n),f.mapping.slice(d).map(g+n),new F(i.rows[h-a],0,0))}p(),f.setSelection(new Fe(f.doc.resolve(n+s.positionAt(a,l,o)),f.doc.resolve(n+s.positionAt(u-1,c-1,o)))),e(f)}var Jk=y0({ArrowLeft:ia("horiz",-1),ArrowRight:ia("horiz",1),ArrowUp:ia("vert",-1),ArrowDown:ia("vert",1),"Shift-ArrowLeft":oa("horiz",-1),"Shift-ArrowRight":oa("horiz",1),"Shift-ArrowUp":oa("vert",-1),"Shift-ArrowDown":oa("vert",1),Backspace:ra,"Mod-Backspace":ra,Delete:ra,"Mod-Delete":ra});function va(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function ia(t,e){return(n,r,i)=>{if(!i)return!1;const o=n.selection;if(o instanceof Fe)return va(n,r,ge.near(o.$headCell,e));if(t!="horiz"&&!o.empty)return!1;const s=ib(i,t,e);if(s==null)return!1;if(t=="horiz")return va(n,r,ge.near(n.doc.resolve(o.head+e),e));{const a=n.doc.resolve(s),l=eb(a,t,e);let c;return l?c=ge.near(l,1):e<0?c=ge.near(n.doc.resolve(a.before(-1)),-1):c=ge.near(n.doc.resolve(a.after(-1)),1),va(n,r,c)}}}function oa(t,e){return(n,r,i)=>{if(!i)return!1;const o=n.selection;let s;if(o instanceof Fe)s=o;else{const l=ib(i,t,e);if(l==null)return!1;s=new Fe(n.doc.resolve(l))}const a=eb(s.$headCell,t,e);return a?va(n,r,new Fe(s.$anchorCell,a)):!1}}function Yk(t,e){const n=t.state.doc,r=Ss(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new Fe(r))),!0):!1}function Xk(t,e,n){if(!Al(t.state))return!1;let r=qk(n);const i=t.state.selection;if(i instanceof Fe){r||(r={width:1,height:1,rows:[D.from($u(_n(t.state.schema).cell,n))]});const o=i.$anchorCell.node(-1),s=i.$anchorCell.start(-1),a=He.get(o).rectBetween(i.$anchorCell.pos-s,i.$headCell.pos-s);return r=Kk(r,a.right-a.left,a.bottom-a.top),Qh(t.state,t.dispatch,s,a,r),!0}else if(r){const o=jf(t.state),s=o.start(-1);return Qh(t.state,t.dispatch,s,He.get(o.node(-1)).findCell(o.pos-s),r),!0}else return!1}function Qk(t,e){var n;if(e.ctrlKey||e.metaKey)return;const r=e1(t,e.target);let i;if(e.shiftKey&&t.state.selection instanceof Fe)o(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(i=Ss(t.state.selection.$anchor))!=null&&((n=Ic(t,e))==null?void 0:n.pos)!=i.pos)o(i,e),e.preventDefault();else if(!r)return;function o(l,c){let u=Ic(t,c);const f=or.getState(t.state)==null;if(!u||!Hf(l,u))if(f)u=l;else return;const d=new Fe(l,u);if(f||!t.state.selection.eq(d)){const p=t.state.tr.setSelection(d);f&&p.setMeta(or,l.pos),t.dispatch(p)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",a),or.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(or,-1))}function a(l){const c=l,u=or.getState(t.state);let f;if(u!=null)f=t.state.doc.resolve(u);else if(e1(t,c.target)!=r&&(f=Ic(t,e),!f))return s();f&&o(f,c)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",a)}function ib(t,e,n){if(!(t.state.selection instanceof be))return null;const{$head:r}=t.state.selection;for(let i=r.depth-1;i>=0;i--){const o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))return null;if(o.type.spec.tableRole=="cell"||o.type.spec.tableRole=="header_cell"){const a=r.before(i),l=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(l)?a:null}}return null}function e1(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Ic(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?Ss(t.state.doc.resolve(n.pos)):null}var e4=class{constructor(t,e){this.node=t,this.defaultCellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${e}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),zu(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,zu(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function zu(t,e,n,r,i,o){var s;let a=0,l=!0,c=e.firstChild;const u=t.firstChild;if(u){for(let f=0,d=0;f<u.childCount;f++){const{colspan:p,colwidth:h}=u.child(f).attrs;for(let m=0;m<p;m++,d++){const g=i==d?o:h&&h[m],y=g?g+"px":"";if(a+=g||r,g||(l=!1),c)c.style.width!=y&&(c.style.width=y),c=c.nextSibling;else{const w=document.createElement("col");w.style.width=y,e.appendChild(w)}}}for(;c;){const f=c.nextSibling;(s=c.parentNode)==null||s.removeChild(c),c=f}l?(n.style.width=a+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=a+"px")}}var xt=new vs("tableColumnResizing");function t4({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:n=100,View:r=e4,lastColumnResizable:i=!0}={}){const o=new bs({key:xt,state:{init(s,a){var l,c;const u=(c=(l=o.spec)==null?void 0:l.props)==null?void 0:c.nodeViews,f=_n(a.schema).table.name;return r&&u&&(u[f]=(d,p)=>new r(d,n,p)),new n4(-1,!1)},apply(s,a){return a.apply(s)}},props:{attributes:s=>{const a=xt.getState(s);return a&&a.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,a)=>{r4(s,a,t,i)},mouseleave:s=>{i4(s)},mousedown:(s,a)=>{o4(s,a,e,n)}},decorations:s=>{const a=xt.getState(s);if(a&&a.activeHandle>-1)return u4(s,a.activeHandle)},nodeViews:{}}});return o}var n4=class ya{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,r=e.getMeta(xt);if(r&&r.setHandle!=null)return new ya(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new ya(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let i=e.mapping.map(n.activeHandle,-1);return Bu(e.doc.resolve(i))||(i=-1),new ya(i,n.dragging)}return n}};function r4(t,e,n,r){const i=xt.getState(t.state);if(i&&!i.dragging){const o=a4(e.target);let s=-1;if(o){const{left:a,right:l}=o.getBoundingClientRect();e.clientX-a<=n?s=t1(t,e,"left",n):l-e.clientX<=n&&(s=t1(t,e,"right",n))}if(s!=i.activeHandle){if(!r&&s!==-1){const a=t.state.doc.resolve(s),l=a.node(-1),c=He.get(l),u=a.start(-1);if(c.colCount(a.pos-u)+a.nodeAfter.attrs.colspan-1==c.width-1)return}ob(t,s)}}}function i4(t){const e=xt.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&ob(t,-1)}function o4(t,e,n,r){var i;const o=(i=t.dom.ownerDocument.defaultView)!=null?i:window,s=xt.getState(t.state);if(!s||s.activeHandle==-1||s.dragging)return!1;const a=t.state.doc.nodeAt(s.activeHandle),l=s4(t,s.activeHandle,a.attrs);t.dispatch(t.state.tr.setMeta(xt,{setDragging:{startX:e.clientX,startWidth:l}}));function c(f){o.removeEventListener("mouseup",c),o.removeEventListener("mousemove",u);const d=xt.getState(t.state);d!=null&&d.dragging&&(l4(t,d.activeHandle,n1(d.dragging,f,n)),t.dispatch(t.state.tr.setMeta(xt,{setDragging:null})))}function u(f){if(!f.which)return c(f);const d=xt.getState(t.state);if(d&&d.dragging){const p=n1(d.dragging,f,n);r1(t,d.activeHandle,p,r)}}return r1(t,s.activeHandle,l,r),o.addEventListener("mouseup",c),o.addEventListener("mousemove",u),e.preventDefault(),!0}function s4(t,e,{colspan:n,colwidth:r}){const i=r&&r[r.length-1];if(i)return i;const o=t.domAtPos(e);let a=o.node.childNodes[o.offset].offsetWidth,l=n;if(r)for(let c=0;c<n;c++)r[c]&&(a-=r[c],l--);return a/l}function a4(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function t1(t,e,n,r){const i=n=="right"?-r:r,o=t.posAtCoords({left:e.clientX+i,top:e.clientY});if(!o)return-1;const{pos:s}=o,a=Ss(t.state.doc.resolve(s));if(!a)return-1;if(n=="right")return a.pos;const l=He.get(a.node(-1)),c=a.start(-1),u=l.map.indexOf(a.pos-c);return u%l.width==0?-1:c+l.map[u-1]}function n1(t,e,n){const r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function ob(t,e){t.dispatch(t.state.tr.setMeta(xt,{setHandle:e}))}function l4(t,e,n){const r=t.state.doc.resolve(e),i=r.node(-1),o=He.get(i),s=r.start(-1),a=o.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,l=t.state.tr;for(let c=0;c<o.height;c++){const u=c*o.width+a;if(c&&o.map[u]==o.map[u-o.width])continue;const f=o.map[u],d=i.nodeAt(f).attrs,p=d.colspan==1?0:a-o.colCount(f);if(d.colwidth&&d.colwidth[p]==n)continue;const h=d.colwidth?d.colwidth.slice():c4(d.colspan);h[p]=n,l.setNodeMarkup(s+f,null,{...d,colwidth:h})}l.docChanged&&t.dispatch(l)}function r1(t,e,n,r){const i=t.state.doc.resolve(e),o=i.node(-1),s=i.start(-1),a=He.get(o).colCount(i.pos-s)+i.nodeAfter.attrs.colspan-1;let l=t.domAtPos(i.start(-1)).node;for(;l&&l.nodeName!="TABLE";)l=l.parentNode;l&&zu(o,l.firstChild,l,r,a,n)}function c4(t){return Array(t).fill(0)}function u4(t,e){var n;const r=[],i=t.doc.resolve(e),o=i.node(-1);if(!o)return Pe.empty;const s=He.get(o),a=i.start(-1),l=s.colCount(i.pos-a)+i.nodeAfter.attrs.colspan-1;for(let c=0;c<s.height;c++){const u=l+c*s.width;if((l==s.width-1||s.map[u]!=s.map[u+1])&&(c==0||s.map[u]!=s.map[u-s.width])){const f=s.map[u],d=a+f+o.nodeAt(f).nodeSize-1,p=document.createElement("div");p.className="column-resize-handle",(n=xt.getState(t))!=null&&n.dragging&&r.push(dt.node(a+f,a+f+o.nodeAt(f).nodeSize,{class:"column-resize-dragging"})),r.push(dt.widget(d,p))}}return Pe.create(t.doc,r)}function f4({allowTableNodeSelection:t=!1}={}){return new bs({key:or,state:{init(){return null},apply(e,n){const r=e.getMeta(or);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;const{deleted:i,pos:o}=e.mapping.mapResult(n);return i?null:o}},props:{decorations:jk,handleDOMEvents:{mousedown:Qk},createSelectionBetween(e){return or.getState(e.state)!=null?e.state.selection:null},handleTripleClick:Yk,handleKeyDown:Jk,handlePaste:Xk},appendTransaction(e,n,r){return Bk(r,zk(r,n),t)}})}const $o=t=>{const e=Object.fromEntries(Array.from(t.attributes).map(n=>[n.name,n.value]));return delete e.draggable,e},i1="data-gs-mrk-fs",o1="data-gs-ib",el="data-gs-ifrg",Gn="attrs",sb={[Gn]:{default:"{}"}},Rn={[Gn]:{default:{}}},ab=t=>({[Gn]:JSON.stringify($o(t))}),Pn=t=>({attrs:$o(t)}),Co=t=>e=>[t,e.attrs.attrs,0],rr=t=>t.attrs[Gn]?JSON.parse(t.attrs[Gn]):{},d4={doc:{content:"block+"},text:{group:"inline",inline:!0},inlineFragment:{group:"block",content:"inline*",isTextBlock:!0,parseDOM:[{tag:`span[${el}]`,getAttrs:Pn}],toDOM:()=>["span",{[el]:""},0]},div:{group:"block",content:"inline*",attrs:Rn,parseDOM:[{tag:"div",getAttrs:Pn}],toDOM:Co("div")},paragraph:{group:"block",content:"inline*",attrs:Rn,parseDOM:[{tag:"p",getAttrs:Pn}],toDOM:Co("p")},orderedList:{group:"block",content:"listItem+",attrs:Rn,parseDOM:[{tag:"ol",getAttrs:Pn}],toDOM:Co("ol")},bulletList:{group:"block",content:"listItem+",attrs:Rn,parseDOM:[{tag:"ul",getAttrs:Pn}],toDOM:Co("ul")},listItem:{content:"block*",group:"block",attrs:Rn,parseDOM:[{tag:"li",getAttrs:Pn}],toDOM:Co("li"),defining:!0},codeBlock:{group:"block",content:"text*",marks:"",attrs:Rn,parseDOM:[{tag:"pre",getAttrs:Pn}],toDOM:t=>["pre",t.attrs.attrs,["code",0]]},image:{inline:!0,group:"inline",selectable:!0,attrs:Rn,parseDOM:[{tag:"img[src]",getAttrs:Pn}],toDOM:t=>["img",t.attrs.attrs]},inlineBreak:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:`br[${o1}]`}],toDOM(){return["br",{[o1]:""}]}},hardBreak:{inline:!1,group:"block",selectable:!1,attrs:Rn,parseDOM:[{tag:"br",getAttrs:Pn}],toDOM:t=>["br",{...t.attrs.attrs}]},heading:{group:"block",content:"inline*",attrs:{level:{default:1},attrs:{default:{}}},defining:!0,parseDOM:Array.from({length:6},(t,e)=>({tag:`h${e+1}`,getAttrs:n=>({level:e+1,attrs:$o(n)})})),toDOM({attrs:t}){const{level:e}=t;return[e?`h${e}`:"div",t.attrs,0]}},...Pk({tableGroup:"block",cellContent:"block+",cellAttributes:{[Gn]:{default:Rn[Gn].default,getFromDOM:$o,setDOMAttr:(t,e)=>{t&&Object.assign(e,t)}},background:{default:null,getFromDOM(t){return t.style.backgroundColor||null},setDOMAttr(t,e){t&&(e.style=(e.style||"")+`background-color: ${t};`)}}}}),nonTextNode:{group:"block",content:"block*",attrs:{tagName:{default:"span"},attrs:{default:{}}},parseDOM:[{tag:"*:not(tbody)",getAttrs:t=>({tagName:t.tagName.toLowerCase(),attrs:$o(t)}),priority:0}],toDOM(t){const{tagName:e,attrs:n}=t.attrs;return[e,n,0]}}},Oo=(t,e)=>({attrs:sb,parseDOM:t.map(n=>({tag:n,getAttrs:ab})),toDOM:e}),p4={strong:Oo(["strong","b"],t=>["b",rr(t)]),link:Oo(["a"],t=>["a",rr(t),0]),em:Oo(["em","i"],t=>["em",rr(t)]),underline:Oo(["u"],t=>["u",rr(t),0]),strikethrough:Oo(["s"],t=>["s",rr(t),0]),font_size:{attrs:{...sb,size:{default:null}},parseDOM:[{tag:`span[${i1}]`,getAttrs:t=>({...ab(t),size:t.style.fontSize})}],toDOM(t){const{size:e}=t.attrs,n={...rr(t),[i1]:!0};return e&&(n.style=`font-size: ${e}`),["span",n,0]}}},s1=new RE({nodes:d4,marks:p4}),Tl=new WeakMap,Bf=new WeakMap,h4=(t,e)=>{Tl.set(t,e),Bf.set(e,t)},m4=(t,e)=>{Tl.delete(t),Bf.delete(e)},Bc=t=>Tl.get(t),g4=t=>Bf.get(t),a1=t=>{var n;const e=g4(t);return(n=e==null?void 0:e.__gjsv)==null?void 0:n.model},b4=t=>t.dispatchEvent(new CustomEvent("input"));function v4(t){const e=n=>{if(n.tagName==="SPAN"&&n.hasAttribute(el)){if(n.getAttribute("style")){n.removeAttribute(el);return}const r=n.parentElement;if(r){for(;n.firstChild;)r.insertBefore(n.firstChild,n);r.removeChild(n)}}else Array.from(n.children).forEach(r=>e(r))};e(t)}function y4(t,e={}){if(!e.enableOnClick)return()=>{};const n=t.Components.events,r=u=>t.getSelectedAll().includes(u),i=u=>u.isInstanceOf("text")&&!u.isChildOf("text"),o=u=>u.isChildOf("text"),s=u=>t.getEditing()===u,a=(u,f={})=>{u.trigger("focus",f.event)},l=(u,f)=>{r(u)&&i(u)&&!s(u)&&a(u,f)},c=(u,f)=>{if(r(u)&&!i(u)&&o(u)){const d=u.parents().find(p=>p.isInstanceOf("text"));d&&(a(d,f),setTimeout(()=>t.select(d),0))}};return t.on(n.select,l),t.on(n.selectBefore,c),()=>{t.off(n.select,l),t.off(n.selectBefore,c)}}const w4=(t,e)=>{const n=x4(t);return n&&M4(n)?S4(t,e):n?f0(()=>({type:t.schema.nodes.div}))(t,e):!1};function x4(t){const e=t.selection.$from;if(e.node(e.depth).type===t.schema.nodes.inlineFragment){const n=e.depth-1;return e.node(n)}return e.node(e.depth)}function S4(t,e){const{selection:n,schema:r,tr:i}=t;i.split(n.from,1);const o=n.from+1,s=i.doc.nodeAt(o),a={...s.attrs.attrs,id:void 0},l=s.textContent.length>0,c=s.textContent.length||0,u=s.textContent||" ",f=r.text(u),d=r.nodes.div.create(a,l?f:[],[]);return i.replaceRangeWith(o,o+c+2,d),i.setSelection(be.create(i.doc,o+1)),e==null||e(i.scrollIntoView()),!0}function C4(t,e,n){const{state:r,dispatch:i}=t,{selection:o,tr:s}=r,a=(l,c,u)=>{const f={};return l.split(";").forEach(d=>{const[p,h]=d.split(":").map(m=>m.trim());p&&(f[p]=h)}),f[c]=u,Object.entries(f).map(([d,p])=>`${d}: ${p}`).join("; ")};if(!o.empty||n)s.doc.nodesBetween(o.from,o.to,(l,c)=>{var u,f;if(l.type===r.schema.nodes.image){const d=a(((u=l.attrs.attrs)==null?void 0:u.style)||"","float",e);s.setNodeMarkup(c,void 0,{...l.attrs,attrs:{...l.attrs.attrs,style:d}})}else if(l.type.isBlock){const d=a(((f=l.attrs.attrs)==null?void 0:f.style)||"","text-align",e);lb(l)?s.setBlockType(o.from,void 0,r.schema.nodes.div,{attrs:{style:d}}):s.setNodeMarkup(c,void 0,{...l.attrs,attrs:{...l.attrs.attrs,style:d}})}});else{const l=r.doc.resolve(o.from),c=l.start(l.depth),u=r.doc.nodeAt(c);if(u!=null&&u.type.isBlock){const f=a(u.attrs.style||"","text-align",e);s.setNodeMarkup(c,void 0,{...u.attrs,style:f})}}s.docChanged&&i(s.scrollIntoView())}const Eo=(t,e)=>{const{from:n,to:r}=t.selection;let i=!1;return t.doc.nodesBetween(n,r,o=>{if(i)return!1;o.marks.some(s=>s.type===e)&&(i=!0)}),i};function O4(t,e,n="_blank"){const{state:r,dispatch:i}=t,{schema:o,selection:s,tr:a}=r,l=o.marks.link;try{const c=l.create({[Gn]:JSON.stringify({href:e,target:n})});a.addMark(s.from,s.to,c),i(a.scrollIntoView())}catch(c){console.error("Error applying link mark:",c)}}function E4(t,e){const{state:n,dispatch:r}=t,{selection:i,tr:o}=n;if(i.empty)return;const s=n.schema.marks.font_size;if(!s){console.error("Font size mark is not defined in the schema.");return}o.addMark(i.from,i.to,s.create({size:e})),r(o.scrollIntoView())}const zr=(t,e)=>{const{doc:n,selection:r}=t.state,i=n.resolve(r.from);for(let o=i.depth;o>0;o--){const s=i.node(o);if(e(s))return{pos:o>0?i.before(o):0,start:i.start(o),depth:o,node:s}}},_4=t=>(t||"").split(";").map(e=>e.split(":")).reduce((e,[n,r])=>(n=n.replace(/-./g,i=>i.toUpperCase()[1]).trim(),e[n]=`${r}`.trim(),e),{});function k4(...t){return(e,n)=>{const r=s=>{e=e.apply(s),n==null||n(s)},i=t.pop();return t.reduce((s,a)=>s||a(e,r),!1)&&i!==void 0&&i(e,n)}}const A4=(t,e)=>{const{state:n,dispatch:r}=t;if(e!=null&&e.event){const{event:i}=e,o=t.posAtCoords({left:i.clientX,top:i.clientY});o!=null&&o.pos&&r(n.tr.setSelection(be.create(n.doc,o.pos)))}else d0(n,r);setTimeout(()=>setTimeout(()=>t.focus()))},Fu=t=>t.isBlock,lb=t=>t.type.name==="inlineFragment",T4=t=>Fu(t)&&!lb(t),cb=t=>t.type.name==="bulletList",ub=t=>t.type.name==="orderedList",M4=t=>t.type.name==="heading",N4=t=>cb(t)||ub(t),l1=(t,e)=>{var o,s;const n=(o=zr(t,a=>a.type===e))==null?void 0:o.node,r=t.state.schema.nodes.listItem;let i;return n?i=ku(r):(s=zr(t,N4))!=null&&s.node?i=k4(ku(r),ph(e)):i=ph(e),i(t.state,t.dispatch)},fb=(t,e)=>{const{selection:n}=t.state;return[...n.$from.marks(),...n.$to.marks()].find(r=>r.type.name===e)},R4=t=>{var s;const{view:e,prop:n,editor:r,propCSS:i}=t,o=(s=zr(e,T4))==null?void 0:s.node;if(o){const a=o.attrs.attrs||{},l=_4(a.style);if(n in l)return l[n]||"";if(a.id){const c=r.Components.getById(a.id);return((c==null?void 0:c.getStyle())||{})[i]||""}}return""},P4=t=>{const{view:e,prop:n,markName:r,editor:i,propCSS:o}=t,s=fb(e,r);if(s){const a=s.attrs;if(a[n])return a[n];if(a[Gn]){const l=rr(s).id;if(l){const c=i.Components.getById(l);return((c==null?void 0:c.getStyle())||{})[o]||""}}}return""},db=(t,e)=>{const{dispatch:n}=t,{nodes:r,marks:i}=t.state.schema;return{text:{selected:()=>{const{selection:o,doc:s}=t.state;return s.textBetween(o.from,o.to," ")},replace:(o,s={})=>{const{state:a}=t,{from:l}=a.selection;let c=a.tr.replaceSelectionWith(a.schema.text(o));s.select&&(c=c.setSelection(be.create(c.doc,l,l+o.length))),n==null||n(c)}},bold:{toggle:()=>Lr(i.strong)(t.state,n),isActive:()=>Eo(t.state,i.strong)},italic:{toggle:()=>Lr(i.em)(t.state,n),isActive:()=>Eo(t.state,i.em)},underline:{toggle:()=>Lr(i.underline)(t.state,n),isActive:()=>Eo(t.state,i.underline)},strikethrough:{toggle:()=>Lr(i.strikethrough)(t.state,n),isActive:()=>Eo(t.state,i.strikethrough)},link:{get:()=>{const o=a1(t);if(o!=null&&o.is("link"))return o.getAttributes();{const s=fb(t,"link");return s?rr(s):{}}},toggle:()=>Lr(i.link)(t.state,n),isActive:()=>Eo(t.state,i.link),create:o=>{const s=a1(t);s!=null&&s.is("link")?(s.addAttributes({href:o.url,target:o.target}),t.focus()):O4(t,o.url,o.target)}},alignText:{get:()=>R4({view:t,editor:e,prop:"textAlign",propCSS:"text-align"}),set:o=>C4(t,o.value,!0)},fontSize:{get:()=>P4({view:t,editor:e,markName:"font_size",prop:"size",propCSS:"font-size"}),set:o=>E4(t,o.value)},image:{open(){const o="assetLayout",{state:s,dispatch:a}=t,{selection:l,doc:c}=s,u=c.textBetween(l.from,l.to," "),f={id:o,disablePropagation:!0,placer:{type:"dialog",title:"Select image",size:"l"},header:!1,layout:{type:"panelAssets",onSelect:d=>{const p={alt:u,src:d.asset.getSrc()};a(s.tr.replaceSelectionWith(r.image.createAndFill({attrs:p})))}}};e.runCommand(rn.layoutToggle,f)}},heading:{get:()=>{var s;const o=(s=zr(t,Fu))==null?void 0:s.node;return`${(o==null?void 0:o.attrs.level)||""}`},set:({value:o})=>{var l;const{state:s}=t,a=(l=zr(t,Fu))==null?void 0:l.node;E_(s.schema.nodes.heading,{attrs:a==null?void 0:a.attrs.attrs,level:o?parseInt(o,10):0})(s,n)}},listBullet:{isActive:()=>{var o;return!!((o=zr(t,cb))!=null&&o.node)},toggle:()=>l1(t,r.bulletList)},listOrdered:{isActive:()=>{var o;return!!((o=zr(t,ub))!=null&&o.node)},toggle:()=>l1(t,r.orderedList)}}},Kt="rte:selectionchange",Mt={bold:'<svg viewBox="0 0 24 24"><path d="M13.5,15.5H10V12.5H13.5A1.5,1.5 0 0,1 15,14A1.5,1.5 0 0,1 13.5,15.5M10,6.5H13A1.5,1.5 0 0,1 14.5,8A1.5,1.5 0 0,1 13,9.5H10M15.6,10.79C16.57,10.11 17.25,9 17.25,8C17.25,5.74 15.5,4 13.25,4H7V18H14.04C16.14,18 17.75,16.3 17.75,14.21C17.75,12.69 16.89,11.39 15.6,10.79Z" /></svg>',italic:'<svg viewBox="0 0 24 24"><path d="M10,4V7H12.21L8.79,15H6V18H14V15H11.79L15.21,7H18V4H10Z" /></svg>',underline:'<svg viewBox="0 0 24 24"><path d="M5,21H19V19H5V21M12,17A6,6 0 0,0 18,11V3H15.5V11A3.5,3.5 0 0,1 12,14.5A3.5,3.5 0 0,1 8.5,11V3H6V11A6,6 0 0,0 12,17Z" /></svg>',strikethrough:'<svg viewBox="0 0 24 24"><path d="M7.2 9.8c-1.2-2.3.5-5 2.9-5.5 3.1-1 7.6.4 7.5 4.2h-3l-.1-.8c-.2-.6-.6-.9-1.2-1.1-.8-.3-2.1-.2-2.8.3C9 8.2 10.4 9.5 12 10H7.4l-.2-.2M21 13v-2H3v2h9.6l.6.2c.6.3 1.1.5 1.3 1.1.1.4.2.9 0 1.3-.2.5-.6.7-1.1.9-1.8.5-4-.2-3.9-2.4h-3c-.1 2.6 2.1 4.4 4.5 4.7 3.8.8 8.3-1.6 6.3-5.9l3.7.1Z"/></svg>',link:'<svg viewBox="0 0 24 24"><path d="M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z" /></svg>',image:'<svg viewBox="0 0 24 24"><path d="M19,19H5V5H19M19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3M13.96,12.29L11.21,15.83L9.25,13.47L6.5,17H17.5L13.96,12.29Z"></path></svg>',listBullet:'<svg viewBox="0 0 24 24"><path d="M7 5h14v2H7V5m0 8v-2h14v2H7M4 4.5A1.5 1.5 0 0 1 5.5 6 1.5 1.5 0 0 1 4 7.5 1.5 1.5 0 0 1 2.5 6 1.5 1.5 0 0 1 4 4.5m0 6A1.5 1.5 0 0 1 5.5 12 1.5 1.5 0 0 1 4 13.5 1.5 1.5 0 0 1 2.5 12 1.5 1.5 0 0 1 4 10.5M7 19v-2h14v2H7m-3-2.5A1.5 1.5 0 0 1 5.5 18 1.5 1.5 0 0 1 4 19.5 1.5 1.5 0 0 1 2.5 18 1.5 1.5 0 0 1 4 16.5Z"/></svg>',listOrdered:'<svg viewBox="0 0 24 24"><path d="M7 13v-2h14v2H7m0 6v-2h14v2H7M7 7V5h14v2H7M3 8V5H2V4h2v4H3m-1 9v-1h3v4H2v-1h2v-.5H3v-1h1V17H2m2.3-7a.8.8 0 0 1 .7.8c0 .1 0 .3-.2.5L3 13h2v1H2v-1l2-2H2v-1h2.3Z"/></svg>',alignTextLeft:'<svg viewBox="0 0 24 24"><path d="M3,3H21V5H3V3M3,7H15V9H3V7M3,11H21V13H3V11M3,15H15V17H3V15M3,19H21V21H3V19Z" /></svg>',alignTextCenter:'<svg viewBox="0 0 24 24"><path d="M3,3H21V5H3V3M7,7H17V9H7V7M3,11H21V13H3V11M7,15H17V17H7V15M3,19H21V21H3V19Z" /></svg>',alignTextRight:'<svg viewBox="0 0 24 24"><path d="M3,3H21V5H3V3M9,7H21V9H9V7M3,11H21V13H3V11M9,15H21V17H9V15M3,19H21V21H3V19Z" /></svg>',alignTextJustify:'<svg viewBox="0 0 24 24"><path d="M3,3H21V5H3V3M3,7H21V9H3V7M3,11H21V13H3V11M3,15H21V17H3V15M3,19H21V21H3V19Z" /></svg>'},V4=(t,e)=>{var l;const{editor:n,el:r}=t,i=Tl.get(r),o=db(i,n),s={separator:{type:"column",style:{borderRightWidth:"1px",borderRightStyle:"solid",alignSelf:"stretch",margin:3}},bold:{id:"bold",icon:Mt.bold,size:"s",type:"button",editorEvents:{[Kt]:({setState:c})=>{c({active:o.bold.isActive()})}},onClick:({setState:c})=>{o.bold.toggle(),c({active:o.bold.isActive()})}},italic:{id:"italic",icon:Mt.italic,size:"s",type:"button",editorEvents:{[Kt]:({setState:c})=>{c({active:o.italic.isActive()})}},onClick:({setState:c})=>{o.italic.toggle(),c({active:o.italic.isActive()})}},underline:{id:"underline",icon:Mt.underline,size:"s",type:"button",editorEvents:{[Kt]:({setState:c})=>{c({active:o.underline.isActive()})}},onClick:({setState:c})=>{o.underline.toggle(),c({active:o.underline.isActive()})}},strikethrough:{id:"strikethrough",icon:Mt.strikethrough,size:"s",type:"button",editorEvents:{[Kt]:({setState:c})=>{c({active:o.strikethrough.isActive()})}},onClick:({setState:c})=>{o.strikethrough.toggle(),c({active:o.strikethrough.isActive()})}},image:{id:"image",icon:Mt.image,size:"s",type:"button",onClick:()=>o.image.open()},link:{id:"link",icon:Mt.link,size:"s",type:"button",editorEvents:{[Kt]:({setState:c})=>{c({active:o.link.isActive(),disabled:i.state.selection.empty})}},onClick:({event:c})=>{const u=c.currentTarget||c.target,{x:f,y:d,width:p,height:h}=u.getBoundingClientRect(),m="linkLayout",g=()=>n.runCommand(rn.layoutRemove,{id:m}),y=o.link.get(),w={id:m,style:{width:240},disablePropagation:!0,placer:{type:"popover",closeOnClickAway:!0,x:f,y:d,w:p,h},header:{label:"Link"},layout:{type:"column",as:"form",style:{padding:"0 10px 15px",gap:10},onSubmit:x=>{x.preventDefault();const C=new FormData(x.currentTarget);o.link.create({url:C.get("url"),target:C.get("target")}),g()},children:[{type:"inputField",name:"url",label:"URL",placeholder:"eg. https://google.com",required:!0,value:(y==null?void 0:y.href)||"",onChange:({value:x,setState:C})=>C({value:x})},{type:"selectField",name:"target",label:"Open link in",emptyState:"Current window",value:(y==null?void 0:y.target)||"",options:[{id:"",label:"Current window"},{id:"_blank",label:"New window"}],onChange:({value:x,setState:C})=>C({value:x})},{type:"row",style:{gap:10,justifyContent:"end"},children:[o.link.isActive()&&{type:"button",label:"Clear",buttonType:"button",onClick:()=>{o.link.toggle(),g()}},{type:"button",variant:"primary",label:"Submit",buttonType:"submit"}]}]}};n.runCommand(rn.layoutToggle,w)}},alignText:{id:"alignText",type:"buttonGroupField",size:"s",value:"",options:[{id:"left",icon:Mt.alignTextLeft},{id:"center",icon:Mt.alignTextCenter},{id:"right",icon:Mt.alignTextRight},{id:"justify",icon:Mt.alignTextJustify}],editorEvents:{[Kt]:({setState:c})=>{c({value:o.alignText.get()})}},onChange:({value:c,setState:u})=>{u({value:c}),o.alignText.set({value:c})}},listBullet:{id:"listBullet",icon:Mt.listBullet,size:"s",type:"button",editorEvents:{[Kt]:({setState:c})=>{c({active:o.listBullet.isActive()})}},onClick:({setState:c})=>{o.listBullet.toggle(),c({active:o.listBullet.isActive()})}},listOrdered:{id:"listOrdered",icon:Mt.listOrdered,size:"s",type:"button",editorEvents:{[Kt]:({setState:c})=>{c({active:o.listOrdered.isActive()})}},onClick:({setState:c})=>{o.listOrdered.toggle(),c({active:o.listOrdered.isActive()})}},heading:{id:"heading",type:"selectField",size:"s",value:"",emptyState:"Heading",options:[{id:"",label:"Normal"},{id:"1",label:"Heading 1"},{id:"2",label:"Heading 2"},{id:"3",label:"Heading 3"},{id:"4",label:"Heading 4"},{id:"5",label:"Heading 5"},{id:"6",label:"Heading 6"}],editorEvents:{[Kt]:({setState:c})=>{c({value:o.heading.get()})}},onChange:({value:c,setState:u})=>{u({value:c}),o.heading.set({value:c}),i.focus()}},fontSize:{id:"fontSize",type:"selectField",size:"s",value:"",emptyState:"Font size",options:[{id:"8pt",label:"8pt"},{id:"10pt",label:"10pt"},{id:"12pt",label:"12pt"},{id:"14pt",label:"14pt"},{id:"18pt",label:"18pt"},{id:"24pt",label:"24pt"},{id:"36pt",label:"36pt"}],editorEvents:{[Kt]:({setState:c})=>{c({value:o.fontSize.get()})}},onChange:({value:c,setState:u})=>{u({value:c}),o.fontSize.set({value:c}),i.focus()}}},a=[s.bold,s.italic,s.underline,s.strikethrough,s.image,s.link,s.listBullet,s.listOrdered,s.alignText,s.heading,s.fontSize];return((l=e.toolbar)==null?void 0:l.call(e,{...t,commands:o,layouts:s,proseMirror:{view:i},items:a}))||a};class D4{constructor(e,n,r){this.editor=r,this.node=e,this.dom=document.createElement("img"),this.view=n,Object.keys(e.attrs.attrs).forEach(i=>{this.dom.setAttribute(i,e.attrs.attrs[i])}),this.dom.addEventListener("dblclick",i=>this.handleDoubleClick(i))}handleDoubleClick(e){const{editor:n,view:r}=this;db(r,n).image.open(),e.preventDefault()}update(e){return e.type!==this.node.type?!1:(this.node=e,Object.keys(e.attrs.attrs).forEach(n=>{this.dom.setAttribute(n,e.attrs.attrs[n])}),!0)}selectNode(){this.dom.style.outline="2px solid #ffca6f"}deselectNode(){this.dom.style.outline=""}}class _r{constructor(e,n,r={}){this.match=e,this.match=e,this.handler=typeof n=="string"?L4(n):n,this.undoable=r.undoable!==!1,this.inCode=r.inCode||!1}}function L4(t){return function(e,n,r,i){let o=t;if(n[1]){let s=n[0].lastIndexOf(n[1]);o+=n[0].slice(s+n[1].length),r+=s;let a=r-i;a>0&&(o=n[0].slice(s-a,s)+o,r=i)}return e.tr.insertText(o,r,i)}}const j4=500;function H4({rules:t}){let e=new bs({state:{init(){return null},apply(n,r){let i=n.getMeta(this);return i||(n.selectionSet||n.docChanged?null:r)}},props:{handleTextInput(n,r,i,o){return c1(n,r,i,o,t,e)},handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&c1(n,r.pos,r.pos,"",t,e)})}}},isInputRules:!0});return e}function c1(t,e,n,r,i,o){if(t.composing)return!1;let s=t.state,a=s.doc.resolve(e),l=a.parent.textBetween(Math.max(0,a.parentOffset-j4),a.parentOffset,null,"")+r;for(let c=0;c<i.length;c++){let u=i[c];if(a.parent.type.spec.code){if(!u.inCode)continue}else if(u.inCode==="only")continue;let f=u.match.exec(l),d=f&&u.handler(s,f,e-(f[0].length-r.length),n);if(d)return u.undoable&&d.setMeta(o,{transform:d,from:e,to:n,text:r}),t.dispatch(d),!0}return!1}const I4=new _r(/--$/,"—"),B4=new _r(/\.\.\.$/,"…"),$4=new _r(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),z4=new _r(/"$/,"”"),F4=new _r(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),W4=new _r(/'$/,"’"),U4=[$4,z4,F4,W4];function $f(t,e,n=null,r){return new _r(t,(i,o,s,a)=>{let l=n instanceof Function?n(o):n,c=i.tr.delete(s,a),u=c.doc.resolve(s),f=u.blockRange(),d=f&&Zg(f,e,l);if(!d)return null;c.wrap(f,d);let p=c.doc.resolve(s-1).nodeBefore;return p&&p.type==e&&Cl(c.doc,s-1)&&(!r||r(o,p))&&c.join(s-1),c})}function pb(t,e,n=null){return new _r(t,(r,i,o,s)=>{let a=r.doc.resolve(o),l=n instanceof Function?n(i):n;return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),e)?r.tr.delete(o,s).setBlockType(o,o,e,l):null})}function q4(t){return $f(/^\s*>\s$/,t)}function G4(t){return $f(/^(\d+)\.\s$/,t,e=>({order:+e[1]}),(e,n)=>n.childCount+n.attrs.order==+e[1])}function K4(t){return $f(/^\s*([-+*])\s$/,t)}function Z4(t){return pb(/^```$/,t)}function J4(t,e){return pb(new RegExp("^(#{1,"+e+"})\\s$"),t,n=>({level:n[1].length}))}function Y4(t){const e=U4.concat(B4,I4);let n;return(n=t.nodes.blockquote)&&e.push(q4(n)),(n=t.nodes.orderedList)&&e.push(G4(n)),(n=t.nodes.bulletList)&&e.push(K4(n)),(n=t.nodes.codeBlock)&&e.push(Z4(n)),(n=t.nodes.heading)&&e.push(J4(n,6)),H4({rules:e})}const X4="rteProseMirror",Q4=function(t,e={}){const n={plugins:s=>s.plugins,...e},r=(s,a)=>{var h,m;const l=((h=n.schema)==null?void 0:h.call(n,{editor:t,schema:s1}))||s1,{nodes:c,marks:u}=l,f=Cf.fromSchema(l).parse(s),d=Ri.create({doc:f,schema:l,plugins:(m=n.plugins)==null?void 0:m.call(n,{editor:t,plugins:[t4(),f4(),Y4(l),j_(),Pc({Tab:Jh(1),"Shift-Tab":Jh(-1)}),Pc({Enter:Qo(u0,U_(c.listItem),w4),"Shift-Enter":Qo(c0,(g,y)=>(y&&y(g.tr.replaceSelectionWith(c.inlineBreak.create()).scrollIntoView()),!0)),"Mod-z":v0,"Mod-y":_u,"Mod-Shift-z":_u,"Mod-b":Lr(u.strong),"Mod-i":Lr(u.em),"Shift-Tab":ku(c.listItem),Tab:K_(c.listItem)}),Pc(A_)]})}),p=new _k({mount:s},{state:d,dispatchTransaction(g){var v;const{state:y}=p,w=y.apply(g),x=!y.doc.eq(w.doc);p.updateState(w);const C=!y.selection.eq(w.selection);x&&(b4(((v=a==null?void 0:a.view)==null?void 0:v.el)||s),p.focus()),(C||x)&&t.trigger(Kt)}});return s.__rteView=p,p.setProps({nodeViews:{image(g){return new D4(g,p,t)}}}),p},i=s=>V4(s,n);t.setCustomRte({toolbar:i,parseContent:!0,async enable(s,a,l){const c=Bc(s);if(c)return c;const u=r(s,l);return h4(s,u),A4(u,l),u},disable(s){const a=Bc(s);if(a)return m4(s,a),a.destroy(),{forceSync:!0}},getContent(s){const a=Bc(s);if(a){const{schema:l,doc:c}=a.state,u=document.createElement("div"),f=di.fromSchema(l).serializeFragment(c.content);return f.childNodes.forEach(d=>{d.nodeType===Node.ELEMENT_NODE&&d.innerHTML===""&&(d.innerHTML="<br/>")}),u.appendChild(f),v4(u),s.classList.remove("ProseMirror-focused"),u.innerHTML}return s.innerHTML}});const o=y4(t,n);wr({editor:t,licenseKey:n.licenseKey,plan:St.free,pluginName:X4,cleanup:()=>{t.RichTextEditor.customRte=void 0,o()}})},eA=yr(Q4);exports.dialogComponent=Vb;exports.fsLightboxComponent=gv;exports.lightGalleryComponent=_v;exports.listPagesComponent=dv;exports.rteProseMirror=eA;exports.rteTinyMce=mE;exports.swiperComponent=$v;exports.tableComponent=ov;
|
|
360
|
+
`);return{dom:a,text:f,slice:e}}function Nx(t,e,n,r,o){let i=o.parent.type.spec.code,s,l;if(!n&&!e)return null;let a=e&&(r||i||!n);if(a){if(t.someProp("transformPastedText",f=>{e=f(e,i||r,t)}),i)return e?new ne(K.from(t.state.schema.text(e.replace(/\r\n?/g,`
|
|
361
|
+
`))),0,0):ne.empty;let d=t.someProp("clipboardTextParser",f=>f(e,o,r,t));if(d)l=d;else{let f=o.marks(),{schema:p}=t.state,g=wi.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(b=>{let v=s.appendChild(document.createElement("p"));b&&v.appendChild(g.serializeNode(p.text(b,f)))})}}else t.someProp("transformPastedHTML",d=>{n=d(n,t)}),s=_P(n),Wl&&kP(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||ah.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(a||u),context:o,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!CP.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)l=TP(B1(l,+u[1],+u[2]),u[4]);else if(l=ne.maxOpen(EP(l.content,o),!0),l.openStart||l.openEnd){let d=0,f=0;for(let p=l.content.firstChild;d<l.openStart&&!p.type.spec.isolating;d++,p=p.firstChild);for(let p=l.content.lastChild;f<l.openEnd&&!p.type.spec.isolating;f++,p=p.lastChild);l=B1(l,d,f)}return t.someProp("transformPasted",d=>{l=d(l,t)}),l}const CP=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function EP(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let o=e.node(n).contentMatchAt(e.index(n)),i,s=[];if(t.forEach(l=>{if(!s)return;let a=o.findWrapping(l.type),c;if(!a)return s=null;if(c=s.length&&i.length&&Dx(a,i,l,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=Lx(s[s.length-1],i.length));let u=Px(l,a);s.push(u),o=o.matchType(u.type),i=a}}),s)return K.from(s)}return t}function Px(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,K.from(t));return t}function Dx(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let i=Dx(t,e,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(K.from(Px(n,t,o+1))))}}function Lx(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Lx(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(K.empty,!0);return t.copy(n.append(r))}function Ff(t,e,n,r,o,i){let s=e<0?t.firstChild:t.lastChild,l=s.content;return t.childCount>1&&(i=0),o<r-1&&(l=Ff(l,e,n,r,o+1,i)),o>=n&&(l=e<0?s.contentMatchAt(0).fillBefore(l,i<=o).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(K.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function B1(t,e,n){return e<t.openStart&&(t=new ne(Ff(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new ne(Ff(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Vx={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let z1=null;function Ix(){return z1||(z1=document.implementation.createHTMLDocument("title"))}let Md=null;function OP(t){let e=window.trustedTypes;return e?(Md||(Md=e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Md.createHTML(t)):t}function _P(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Ix().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),o;if((o=r&&Vx[r[1].toLowerCase()])&&(t=o.map(i=>"<"+i+">").join("")+t+o.map(i=>"</"+i+">").reverse().join("")),n.innerHTML=OP(t),o)for(let i=0;i<o.length;i++)n=n.querySelector(o[i])||n;return n}function kP(t){let e=t.querySelectorAll(Dt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function TP(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:o,openStart:i,openEnd:s}=t;for(let l=r.length-2;l>=0;l-=2){let a=n.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;o=K.from(a.create(r[l+1],o)),i++,s++}return new ne(o,i,s)}const Ft={},Wt={},AP={touchstart:!0,touchmove:!0};class MP{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function jP(t){for(let e in Ft){let n=Ft[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{NP(t,r)&&!bh(t,r)&&(t.editable||!(r.type in Wt))&&n(t,r)},AP[e]?{passive:!0}:void 0)}zt&&t.dom.addEventListener("input",()=>null),Wf(t)}function ho(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function RP(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Wf(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>bh(t,r))})}function bh(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function NP(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function PP(t,e){!bh(t,e)&&Ft[e.type]&&(t.editable||!(e.type in Wt))&&Ft[e.type](t,e)}Wt.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Hx(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Fn&&Dt&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),ds&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",o=>o(t,Fo(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||SP(t,n)?n.preventDefault():ho(t,"key")};Wt.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};Wt.keypress=(t,e)=>{let n=e;if(Hx(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||_n&&n.metaKey)return;if(t.someProp("handleKeyPress",o=>o(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof ke)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode);!/[\r\n]/.test(o)&&!t.someProp("handleTextInput",i=>i(t,r.$from.pos,r.$to.pos,o))&&t.dispatch(t.state.tr.insertText(o).scrollIntoView()),n.preventDefault()}};function mu(t){return{left:t.clientX,top:t.clientY}}function DP(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function vh(t,e,n,r,o){if(r==-1)return!1;let i=t.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(t.someProp(e,l=>s>i.depth?l(t,n,i.nodeAfter,i.before(s),o,!0):l(t,n,i.node(s),i.before(s),o,!1)))return!0;return!1}function Gi(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function LP(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&Se.isSelectable(r)?(Gi(t,new Se(n)),!0):!1}function VP(t,e){if(e==-1)return!1;let n=t.state.selection,r,o;n instanceof Se&&(r=n.node);let i=t.state.doc.resolve(e);for(let s=i.depth+1;s>0;s--){let l=s>i.depth?i.nodeAfter:i.node(s);if(Se.isSelectable(l)){r&&n.$from.depth>0&&s>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?o=i.before(n.$from.depth):o=i.before(s);break}}return o!=null?(Gi(t,Se.create(t.state.doc,o)),!0):!1}function IP(t,e,n,r,o){return vh(t,"handleClickOn",e,n,r)||t.someProp("handleClick",i=>i(t,e,r))||(o?VP(t,n):LP(t,n))}function $P(t,e,n,r){return vh(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",o=>o(t,e,r))}function HP(t,e,n,r){return vh(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",o=>o(t,e,r))||BP(t,n,r)}function BP(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Gi(t,ke.create(r,0,r.content.size)),!0):!1;let o=r.resolve(e);for(let i=o.depth+1;i>0;i--){let s=i>o.depth?o.nodeAfter:o.node(i),l=o.before(i);if(s.inlineContent)Gi(t,ke.create(r,l+1,l+1+s.content.size));else if(Se.isSelectable(s))Gi(t,Se.create(r,l));else continue;return!0}}function yh(t){return Oc(t)}const $x=_n?"metaKey":"ctrlKey";Ft.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=yh(t),o=Date.now(),i="singleClick";o-t.input.lastClick.time<500&&DP(n,t.input.lastClick)&&!n[$x]&&(t.input.lastClick.type=="singleClick"?i="doubleClick":t.input.lastClick.type=="doubleClick"&&(i="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=t.posAtCoords(mu(n));s&&(i=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new zP(t,s,n,!!r)):(i=="doubleClick"?$P:HP)(t,s.pos,s.inside,n)?n.preventDefault():ho(t,"pointer"))};class zP{constructor(e,n,r,o){this.view=e,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[$x],this.allowDefault=r.shiftKey;let i,s;if(n.inside>-1)i=e.state.doc.nodeAt(n.inside),s=n.inside;else{let u=e.state.doc.resolve(n.pos);i=u.parent,s=u.depth?u.before():0}const l=o?null:r.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a&&a.dom.nodeType==1?a.dom:null;let{selection:c}=e.state;(r.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof Se&&c.from<=s&&c.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Jn&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),ho(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>$r(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(mu(e))),this.updateAllowDefault(e),this.allowDefault||!n?ho(this.view,"pointer"):IP(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||zt&&this.mightDrag&&!this.mightDrag.node.isAtom||Dt&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Gi(this.view,Ee.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):ho(this.view,"pointer")}move(e){this.updateAllowDefault(e),ho(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Ft.touchstart=t=>{t.input.lastTouch=Date.now(),yh(t),ho(t,"pointer")};Ft.touchmove=t=>{t.input.lastTouch=Date.now(),ho(t,"pointer")};Ft.contextmenu=t=>yh(t);function Hx(t,e){return t.composing?!0:zt&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const FP=Fn?5e3:-1;Wt.compositionstart=Wt.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof ke&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Oc(t,!0),t.markCursor=null;else if(Oc(t,!e.selection.empty),Jn&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let o=r.focusNode,i=r.focusOffset;o&&o.nodeType==1&&i!=0;){let s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){let l=t.domSelection();l&&l.collapse(s,s.nodeValue.length);break}else o=s,i=-1}}t.input.composing=!0}Bx(t,FP)};Wt.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,Bx(t,20))};function Bx(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Oc(t),e))}function zx(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=UP());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function WP(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=LN(e.focusNode,e.focusOffset),r=VN(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let o=r.pmViewDesc,i=t.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!o||!o.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function UP(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Oc(t,e=!1){if(!(Fn&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),zx(t),e||t.docView&&t.docView.dirty){let n=gh(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!t.state.selection.empty?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function qP(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const Sl=tn&&bo<15||ds&&zN<604;Ft.copy=Wt.cut=(t,e)=>{let n=e,r=t.state.selection,o=n.type=="cut";if(r.empty)return;let i=Sl?null:n.clipboardData,s=r.content(),{dom:l,text:a}=Rx(t,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",l.innerHTML),i.setData("text/plain",a)):qP(t,l),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function GP(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function KP(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Cl(t,r.value,null,o,e):Cl(t,r.textContent,r.innerHTML,o,e)},50)}function Cl(t,e,n,r,o){let i=Nx(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",a=>a(t,o,i||ne.empty)))return!0;if(!i)return!1;let s=GP(i),l=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(i);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Fx(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Wt.paste=(t,e)=>{let n=e;if(t.composing&&!Fn)return;let r=Sl?null:n.clipboardData,o=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Cl(t,Fx(r),r.getData("text/html"),o,n)?n.preventDefault():KP(t,n)};class Wx{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const Ux=_n?"altKey":"ctrlKey";Ft.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,i=o.empty?null:t.posAtCoords(mu(n)),s;if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof Se?o.to-1:o.to))){if(r&&r.mightDrag)s=Se.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=t.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=t.docView&&(s=Se.create(t.state.doc,d.posBefore))}}let l=(s||t.state.selection).content(),{dom:a,text:c,slice:u}=Rx(t,l);(!n.dataTransfer.files.length||!Dt||mx>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Sl?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",Sl||n.dataTransfer.setData("text/plain",c),t.dragging=new Wx(u,!n[Ux],s)};Ft.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};Wt.dragover=Wt.dragenter=(t,e)=>e.preventDefault();Wt.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords(mu(n));if(!o)return;let i=t.state.doc.resolve(o.pos),s=r&&r.slice;s?t.someProp("transformPasted",g=>{s=g(s,t)}):s=Nx(t,Fx(n.dataTransfer),Sl?null:n.dataTransfer.getData("text/html"),!1,i);let l=!!(r&&!n[Ux]);if(t.someProp("handleDrop",g=>g(t,n,s||ne.empty,l))){n.preventDefault();return}if(!s)return;n.preventDefault();let a=s?zR(t.state.doc,i.pos,s):i.pos;a==null&&(a=i.pos);let c=t.state.tr;if(l){let{node:g}=r;g?g.replace(c):c.deleteSelection()}let u=c.mapping.map(a),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(f))return;let p=c.doc.resolve(u);if(d&&Se.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Se(p));else{let g=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach((b,v,y,w)=>g=w),c.setSelection(mh(t,p,c.doc.resolve(g)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))};Ft.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&$r(t)},20))};Ft.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};Ft.beforeinput=(t,e)=>{if(Dt&&Fn&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",i=>i(t,Fo(8,"Backspace")))))return;let{$cursor:o}=t.state.selection;o&&o.pos>0&&t.dispatch(t.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let t in Wt)Ft[t]=Wt[t];function El(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class _c{constructor(e,n){this.toDOM=e,this.spec=n||ti,this.side=this.spec.side||0}map(e,n,r,o){let{pos:i,deleted:s}=e.mapResult(n.from+o,this.side<0?-1:1);return s?null:new Zt(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof _c&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&El(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class yo{constructor(e,n){this.attrs=e,this.spec=n||ti}map(e,n,r,o){let i=e.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return i>=s?null:new Zt(i,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof yo&&El(this.attrs,e.attrs)&&El(this.spec,e.spec)}static is(e){return e.type instanceof yo}destroy(){}}class xh{constructor(e,n){this.attrs=e,this.spec=n||ti}map(e,n,r,o){let i=e.mapResult(n.from+o,1);if(i.deleted)return null;let s=e.mapResult(n.to+o,-1);return s.deleted||s.pos<=i.pos?null:new Zt(i.pos-r,s.pos-r,this)}valid(e,n){let{index:r,offset:o}=e.content.findIndex(n.from),i;return o==n.from&&!(i=e.child(r)).isText&&o+i.nodeSize==n.to}eq(e){return this==e||e instanceof xh&&El(this.attrs,e.attrs)&&El(this.spec,e.spec)}destroy(){}}class Zt{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Zt(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new Zt(e,e,new _c(n,r))}static inline(e,n,r,o){return new Zt(e,n,new yo(r,o))}static node(e,n,r,o){return new Zt(e,n,new xh(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof yo}get widget(){return this.type instanceof _c}}const ji=[],ti={};class ut{constructor(e,n){this.local=e.length?e:ji,this.children=n.length?n:ji}static create(e,n){return n.length?kc(n,e,0,ti):Nt}find(e,n,r){let o=[];return this.findInner(e??0,n??1e9,o,0,r),o}findInner(e,n,r,o,i){for(let s=0;s<this.local.length;s++){let l=this.local[s];l.from<=n&&l.to>=e&&(!i||i(l.spec))&&r.push(l.copy(l.from+o,l.to+o))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let l=this.children[s]+1;this.children[s+2].findInner(e-l,n-l,r,o+l,i)}}map(e,n,r){return this==Nt||e.maps.length==0?this:this.mapInner(e,n,0,0,r||ti)}mapInner(e,n,r,o,i){let s;for(let l=0;l<this.local.length;l++){let a=this.local[l].map(e,r,o);a&&a.type.valid(n,a)?(s||(s=[])).push(a):i.onRemove&&i.onRemove(this.local[l].spec)}return this.children.length?YP(this.children,s||[],e,n,r,o,i):s?new ut(s.sort(ni),ji):Nt}add(e,n){return n.length?this==Nt?ut.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let o,i=0;e.forEach((l,a)=>{let c=a+r,u;if(u=Gx(n,l,c)){for(o||(o=this.children.slice());i<o.length&&o[i]<a;)i+=3;o[i]==a?o[i+2]=o[i+2].addInner(l,u,c+1):o.splice(i,0,a,a+l.nodeSize,kc(u,l,c+1,ti)),i+=3}});let s=qx(i?Kx(n):n,-r);for(let l=0;l<s.length;l++)s[l].type.valid(e,s[l])||s.splice(l--,1);return new ut(s.length?this.local.concat(s).sort(ni):this.local,o||this.children)}remove(e){return e.length==0||this==Nt?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,o=this.local;for(let i=0;i<r.length;i+=3){let s,l=r[i]+n,a=r[i+1]+n;for(let u=0,d;u<e.length;u++)(d=e[u])&&d.from>l&&d.to<a&&(e[u]=null,(s||(s=[])).push(d));if(!s)continue;r==this.children&&(r=this.children.slice());let c=r[i+2].removeInner(s,l+1);c!=Nt?r[i+2]=c:(r.splice(i,3),i-=3)}if(o.length){for(let i=0,s;i<e.length;i++)if(s=e[i])for(let l=0;l<o.length;l++)o[l].eq(s,n)&&(o==this.local&&(o=this.local.slice()),o.splice(l--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new ut(o,r):Nt}forChild(e,n){if(this==Nt)return this;if(n.isLeaf)return ut.empty;let r,o;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(r=this.children[l+2]);break}let i=e+1,s=i+n.content.size;for(let l=0;l<this.local.length;l++){let a=this.local[l];if(a.from<s&&a.to>i&&a.type instanceof yo){let c=Math.max(i,a.from)-i,u=Math.min(s,a.to)-i;c<u&&(o||(o=[])).push(a.copy(c,u))}}if(o){let l=new ut(o.sort(ni),ji);return r?new so([l,r]):l}return r||Nt}eq(e){if(this==e)return!0;if(!(e instanceof ut)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return wh(this.localsInner(e))}localsInner(e){if(this==Nt)return ji;if(e.inlineContent||!this.local.some(yo.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof yo||n.push(this.local[r]);return n}forEachSet(e){e(this)}}ut.empty=new ut([],[]);ut.removeOverlap=wh;const Nt=ut.empty;class so{constructor(e){this.members=e}map(e,n){const r=this.members.map(o=>o.map(e,n,ti));return so.from(r)}forChild(e,n){if(n.isLeaf)return ut.empty;let r=[];for(let o=0;o<this.members.length;o++){let i=this.members[o].forChild(e,n);i!=Nt&&(i instanceof so?r=r.concat(i.members):r.push(i))}return so.from(r)}eq(e){if(!(e instanceof so)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let o=0;o<this.members.length;o++){let i=this.members[o].localsInner(e);if(i.length)if(!n)n=i;else{r&&(n=n.slice(),r=!1);for(let s=0;s<i.length;s++)n.push(i[s])}}return n?wh(r?n:n.sort(ni)):ji}static from(e){switch(e.length){case 0:return Nt;case 1:return e[0];default:return new so(e.every(n=>n instanceof ut)?e:e.reduce((n,r)=>n.concat(r instanceof ut?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function YP(t,e,n,r,o,i,s){let l=t.slice();for(let c=0,u=i;c<n.maps.length;c++){let d=0;n.maps[c].forEach((f,p,g,b)=>{let v=b-g-(p-f);for(let y=0;y<l.length;y+=3){let w=l[y+1];if(w<0||f>w+u-d)continue;let S=l[y]+u-d;p>=S?l[y+1]=f<=S?-2:-1:f>=u&&v&&(l[y]+=v,l[y+1]+=v)}d+=v}),u=n.maps[c].map(u,-1)}let a=!1;for(let c=0;c<l.length;c+=3)if(l[c+1]<0){if(l[c+1]==-2){a=!0,l[c+1]=-1;continue}let u=n.map(t[c]+i),d=u-o;if(d<0||d>=r.content.size){a=!0;continue}let f=n.map(t[c+1]+i,-1),p=f-o,{index:g,offset:b}=r.content.findIndex(d),v=r.maybeChild(g);if(v&&b==d&&b+v.nodeSize==p){let y=l[c+2].mapInner(n,v,u+1,t[c]+i+1,s);y!=Nt?(l[c]=d,l[c+1]=p,l[c+2]=y):(l[c+1]=-2,a=!0)}else a=!0}if(a){let c=JP(l,t,e,n,o,i,s),u=kc(c,r,0,s);e=u.local;for(let d=0;d<l.length;d+=3)l[d+1]<0&&(l.splice(d,3),d-=3);for(let d=0,f=0;d<u.children.length;d+=3){let p=u.children[d];for(;f<l.length&&l[f]<p;)f+=3;l.splice(f,0,u.children[d],u.children[d+1],u.children[d+2])}}return new ut(e.sort(ni),l)}function qx(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let o=t[r];n.push(new Zt(o.from+e,o.to+e,o.type))}return n}function JP(t,e,n,r,o,i,s){function l(a,c){for(let u=0;u<a.local.length;u++){let d=a.local[u].map(r,o,c);d?n.push(d):s.onRemove&&s.onRemove(a.local[u].spec)}for(let u=0;u<a.children.length;u+=3)l(a.children[u+2],a.children[u]+c+1)}for(let a=0;a<t.length;a+=3)t[a+1]==-1&&l(t[a+2],e[a]+i+1);return n}function Gx(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let i=0,s;i<t.length;i++)(s=t[i])&&s.from>n&&s.to<r&&((o||(o=[])).push(s),t[i]=null);return o}function Kx(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function kc(t,e,n,r){let o=[],i=!1;e.forEach((l,a)=>{let c=Gx(t,l,a+n);if(c){i=!0;let u=kc(c,l,n+a+1,r);u!=Nt&&o.push(a,a+l.nodeSize,u)}});let s=qx(i?Kx(t):t,-n).sort(ni);for(let l=0;l<s.length;l++)s[l].type.valid(e,s[l])||(r.onRemove&&r.onRemove(s[l].spec),s.splice(l--,1));return s.length||o.length?new ut(s,o):Nt}function ni(t,e){return t.from-e.from||t.to-e.to}function wh(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let o=n+1;o<e.length;o++){let i=e[o];if(i.from==r.from){i.to!=r.to&&(e==t&&(e=t.slice()),e[o]=i.copy(i.from,r.to),F1(e,o+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),F1(e,o,r.copy(i.from,r.to)));break}}}return e}function F1(t,e,n){for(;e<t.length&&ni(n,t[e])>0;)e++;t.splice(e,0,n)}function jd(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Nt&&e.push(r)}),t.cursorWrapper&&e.push(ut.create(t.state.doc,[t.cursorWrapper.deco])),so.from(e)}const ZP={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},XP=tn&&bo<=11;class QP{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class eD{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new QP,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;o<r.length;o++)this.queue.push(r[o]);tn&&bo<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),XP&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,ZP)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(D1(this.view)){if(this.suppressingSelectionUpdates)return $r(this.view);if(tn&&bo<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&hi(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let i=e.focusNode;i;i=wl(i))n.add(i);for(let i=e.anchorNode;i;i=wl(i))if(n.has(i)){r=i;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&D1(e)&&!this.ignoreSelectionChange(r),i=-1,s=-1,l=!1,a=[];if(e.editable)for(let u=0;u<n.length;u++){let d=this.registerMutation(n[u],a);d&&(i=i<0?d.from:Math.min(d.from,i),s=s<0?d.to:Math.max(d.to,s),d.typeOver&&(l=!0))}if(Jn&&a.length){let u=a.filter(d=>d.nodeName=="BR");if(u.length==2){let[d,f]=u;d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let f of u){let p=f.parentNode;p&&p.nodeName=="LI"&&(!d||rD(e,d)!=p)&&f.remove()}}}let c=null;i<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&hu(r)&&(c=gh(e))&&c.eq(Ee.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,$r(e),this.currentSelection.set(r),e.scrollToSelection()):(i>-1||o)&&(i>-1&&(e.docView.markDirty(i,s),tD(e)),this.handleDOMChange(i,s,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||$r(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++){let d=e.addedNodes[u];n.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let o=e.previousSibling,i=e.nextSibling;if(tn&&bo<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:d,nextSibling:f}=e.addedNodes[u];(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(o=d),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f)}let s=o&&o.parentNode==e.target?kt(o)+1:0,l=r.localPosFromDOM(e.target,s,-1),a=i&&i.parentNode==e.target?kt(i):e.target.childNodes.length,c=r.localPosFromDOM(e.target,a,1);return{from:l,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let W1=new WeakMap,U1=!1;function tD(t){if(!W1.has(t)&&(W1.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Jn,U1)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),U1=!0}}function q1(t,e){let n=e.startContainer,r=e.startOffset,o=e.endContainer,i=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return hi(s.node,s.offset,o,i)&&([n,r,o,i]=[o,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}function nD(t,e){if(e.getComposedRanges){let o=e.getComposedRanges(t.root)[0];if(o)return q1(t,o)}let n;function r(o){o.preventDefault(),o.stopImmediatePropagation(),n=o.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?q1(t,n):null}function rD(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function oD(t,e,n){let{node:r,fromOffset:o,toOffset:i,from:s,to:l}=t.docView.parseRange(e,n),a=t.domSelectionRange(),c,u=a.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:a.anchorOffset}],hu(a)||c.push({node:a.focusNode,offset:a.focusOffset})),Dt&&t.input.lastKeyCode===8)for(let v=i;v>o;v--){let y=r.childNodes[v-1],w=y.pmViewDesc;if(y.nodeName=="BR"&&!w){i=v;break}if(!w||w.size)break}let d=t.state.doc,f=t.someProp("domParser")||ah.fromSchema(t.state.schema),p=d.resolve(s),g=null,b=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:o,to:i,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:iD,context:p});if(c&&c[0].pos!=null){let v=c[0].pos,y=c[1]&&c[1].pos;y==null&&(y=v),g={anchor:v+s,head:y+s}}return{doc:b,sel:g,from:s,to:l}}function iD(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(zt&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||zt&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const sD=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function lD(t,e,n,r,o){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let k=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,j=gh(t,k);if(j&&!t.state.selection.eq(j)){if(Dt&&Fn&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",P=>P(t,Fo(13,"Enter"))))return;let N=t.state.tr.setSelection(j);k=="pointer"?N.setMeta("pointer",!0):k=="key"&&N.scrollIntoView(),i&&N.setMeta("composition",i),t.dispatch(N)}return}let s=t.state.doc.resolve(e),l=s.sharedDepth(n);e=s.before(l+1),n=t.state.doc.resolve(n).after(l+1);let a=t.state.selection,c=oD(t,e,n),u=t.state.doc,d=u.slice(c.from,c.to),f,p;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(f=t.state.selection.to,p="end"):(f=t.state.selection.from,p="start"),t.input.lastKeyCode=null;let g=uD(d.content,c.doc.content,c.from,f,p);if(g&&t.input.domChangeCount++,(ds&&t.input.lastIOSEnter>Date.now()-225||Fn)&&o.some(k=>k.nodeType==1&&!sD.test(k.nodeName))&&(!g||g.endA>=g.endB)&&t.someProp("handleKeyDown",k=>k(t,Fo(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!g)if(r&&a instanceof ke&&!a.empty&&a.$head.sameParent(a.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))g={start:a.from,endA:a.to,endB:a.to};else{if(c.sel){let k=G1(t,t.state.doc,c.sel);if(k&&!k.eq(t.state.selection)){let j=t.state.tr.setSelection(k);i&&j.setMeta("composition",i),t.dispatch(j)}}return}t.state.selection.from<t.state.selection.to&&g.start==g.endB&&t.state.selection instanceof ke&&(g.start>t.state.selection.from&&g.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?g.start=t.state.selection.from:g.endA<t.state.selection.to&&g.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(g.endB+=t.state.selection.to-g.endA,g.endA=t.state.selection.to)),tn&&bo<=11&&g.endB==g.start+1&&g.endA==g.start&&g.start>c.from&&c.doc.textBetween(g.start-c.from-1,g.start-c.from+1)==" "&&(g.start--,g.endA--,g.endB--);let b=c.doc.resolveNoCache(g.start-c.from),v=c.doc.resolveNoCache(g.endB-c.from),y=u.resolve(g.start),w=b.sameParent(v)&&b.parent.inlineContent&&y.end()>=g.endA,S;if((ds&&t.input.lastIOSEnter>Date.now()-225&&(!w||o.some(k=>k.nodeName=="DIV"||k.nodeName=="P"))||!w&&b.pos<c.doc.content.size&&!b.sameParent(v)&&(S=Ee.findFrom(c.doc.resolve(b.pos+1),1,!0))&&S.head==v.pos)&&t.someProp("handleKeyDown",k=>k(t,Fo(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>g.start&&cD(u,g.start,g.endA,b,v)&&t.someProp("handleKeyDown",k=>k(t,Fo(8,"Backspace")))){Fn&&Dt&&t.domObserver.suppressSelectionUpdates();return}Dt&&Fn&&g.endB==g.start&&(t.input.lastAndroidDelete=Date.now()),Fn&&!w&&b.start()!=v.start()&&v.parentOffset==0&&b.depth==v.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==g.endA&&(g.endB-=2,v=c.doc.resolveNoCache(g.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(k){return k(t,Fo(13,"Enter"))})},20));let C=g.start,x=g.endA,E,_,M;if(w){if(b.pos==v.pos)tn&&bo<=11&&b.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>$r(t),20)),E=t.state.tr.delete(C,x),_=u.resolve(g.start).marksAcross(u.resolve(g.endA));else if(g.endA==g.endB&&(M=aD(b.parent.content.cut(b.parentOffset,v.parentOffset),y.parent.content.cut(y.parentOffset,g.endA-y.start()))))E=t.state.tr,M.type=="add"?E.addMark(C,x,M.mark):E.removeMark(C,x,M.mark);else if(b.parent.child(b.index()).isText&&b.index()==v.index()-(v.textOffset?0:1)){let k=b.parent.textBetween(b.parentOffset,v.parentOffset);if(t.someProp("handleTextInput",j=>j(t,C,x,k)))return;E=t.state.tr.insertText(k,C,x)}}if(E||(E=t.state.tr.replace(C,x,c.doc.slice(g.start-c.from,g.endB-c.from))),c.sel){let k=G1(t,E.doc,c.sel);k&&!(Dt&&Fn&&t.composing&&k.empty&&(g.start!=g.endB||t.input.lastAndroidDelete<Date.now()-100)&&(k.head==C||k.head==E.mapping.map(x)-1)||tn&&k.empty&&k.head==C)&&E.setSelection(k)}_&&E.ensureMarks(_),i&&E.setMeta("composition",i),t.dispatch(E.scrollIntoView())}function G1(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:mh(t,e.resolve(n.anchor),e.resolve(n.head))}function aD(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,o=n,i=r,s,l,a;for(let u=0;u<r.length;u++)o=r[u].removeFromSet(o);for(let u=0;u<n.length;u++)i=n[u].removeFromSet(i);if(o.length==1&&i.length==0)l=o[0],s="add",a=u=>u.mark(l.addToSet(u.marks));else if(o.length==0&&i.length==1)l=i[0],s="remove",a=u=>u.mark(l.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<e.childCount;u++)c.push(a(e.child(u)));if(K.from(c).eq(t))return{mark:l,type:s}}function cD(t,e,n,r,o){if(n-e<=o.pos-r.pos||Rd(r,!0,!1)<o.pos)return!1;let i=t.resolve(e);if(!r.parent.isTextblock){let l=i.nodeAfter;return l!=null&&n==e+l.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=t.resolve(Rd(i,!0,!0));return!s.parent.isTextblock||s.pos>n||Rd(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function Rd(t,e,n){let r=t.depth,o=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n){let i=t.node(r).maybeChild(t.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function uD(t,e,n,r,o){let i=t.findDiffStart(e,n);if(i==null)return null;let{a:s,b:l}=t.findDiffEnd(e,n+t.size,n+e.size);if(o=="end"){let a=Math.max(0,i-Math.min(s,l));r-=s+a-i}if(s<i&&t.size<e.size){let a=r<=i&&r>=s?i-r:0;i-=a,i&&i<e.size&&K1(e.textBetween(i-1,i+1))&&(i+=a?1:-1),l=i+(l-s),s=i}else if(l<i){let a=r<=i&&r>=l?i-r:0;i-=a,i&&i<t.size&&K1(t.textBetween(i-1,i+1))&&(i+=a?1:-1),s=i+(s-l),l=i}return{start:i,endA:s,endB:l}}function K1(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class dD{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new MP,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Q1),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Z1(this),J1(this),this.nodeViews=X1(this),this.docView=A1(this.state.doc,Y1(this),jd(this),this.dom,this),this.domObserver=new eD(this,(r,o,i,s)=>lD(this,r,o,i,s)),this.domObserver.start(),jP(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Wf(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Q1),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let o=this.state,i=!1,s=!1;e.storedMarks&&this.composing&&(zx(this),s=!0),this.state=e;let l=o.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=X1(this);pD(p,this.nodeViews)&&(this.nodeViews=p,i=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&Wf(this),this.editable=Z1(this),J1(this);let a=jd(this),c=Y1(this),u=o.plugins!=e.plugins&&!o.doc.eq(e.doc)?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",d=i||!this.docView.matchesNode(e.doc,c,a);(d||!e.selection.eq(o.selection))&&(s=!0);let f=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&UN(this);if(s){this.domObserver.stop();let p=d&&(tn||Dt)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&fD(o.selection,e.selection);if(d){let g=Dt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=WP(this)),(i||!this.docView.update(e.doc,c,a,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=A1(e.doc,c,a,this.dom,this)),g&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&gP(this))?$r(this,p):(Ax(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((r=this.dragging)===null||r===void 0)&&r.node&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():f&&qN(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof Se){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&C1(this,n.getBoundingClientRect(),e)}else C1(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,o=-1;if(this.state.doc.nodeAt(r.from)==r.node)o=r.from;else{let i=r.from+(this.state.doc.content.size-n.doc.content.size);(i>0&&this.state.doc.nodeAt(i))==r.node&&(o=i)}this.dragging=new Wx(e.slice,e.move,o<0?void 0:Se.create(this.state.doc,o))}someProp(e,n){let r=this._props&&this._props[e],o;if(r!=null&&(o=n?n(r):r))return o;for(let s=0;s<this.directPlugins.length;s++){let l=this.directPlugins[s].props[e];if(l!=null&&(o=n?n(l):l))return o}let i=this.state.plugins;if(i)for(let s=0;s<i.length;s++){let l=i[s].props[e];if(l!=null&&(o=n?n(l):l))return o}}hasFocus(){if(tn){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&GN(this.dom),$r(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return XN(this,e)}coordsAtPos(e,n=1){return wx(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let o=this.docView.posFromDOM(e,n,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(e,n){return rP(this,n||this.state,e)}pasteHTML(e,n){return Cl(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Cl(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(RP(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],jd(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,PN())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return PP(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?zt&&this.root.nodeType===11&&$N(this.dom.ownerDocument)==this.dom&&nD(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function Y1(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Zt.node(0,t.state.doc.content.size,e)]}function J1(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Zt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Z1(t){return!t.someProp("editable",e=>e(t.state)===!1)}function fD(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function X1(t){let e=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(e,o)||(e[o]=r[o])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function pD(t,e){let n=0,r=0;for(let o in t){if(t[o]!=e[o])return!0;n++}for(let o in e)r++;return n!=r}function Q1(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Uf,qf;if(typeof WeakMap<"u"){let t=new WeakMap;Uf=e=>t.get(e),qf=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;Uf=r=>{for(let o=0;o<t.length;o+=2)if(t[o]==r)return t[o+1]},qf=(r,o)=>(n==10&&(n=0),t[n++]=r,t[n++]=o)}var gt=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const r=e%this.width,o=e/this.width|0;let i=r+1,s=o+1;for(let l=1;i<this.width&&this.map[e+l]==n;l++)i++;for(let l=1;s<this.height&&this.map[e+this.width*l]==n;l++)s++;return{left:r,top:o,right:i,bottom:s}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){const{left:r,right:o,top:i,bottom:s}=this.findCell(t);return e=="horiz"?(n<0?r==0:o==this.width)?null:this.map[i*this.width+(n<0?r-1:o)]:(n<0?i==0:s==this.height)?null:this.map[r+this.width*(n<0?i-1:s)]}rectBetween(t,e){const{left:n,right:r,top:o,bottom:i}=this.findCell(t),{left:s,right:l,top:a,bottom:c}=this.findCell(e);return{left:Math.min(n,s),top:Math.min(o,a),right:Math.max(r,l),bottom:Math.max(i,c)}}cellsInRect(t){const e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let o=t.left;o<t.right;o++){const i=r*this.width+o,s=this.map[i];n[s]||(n[s]=!0,!(o==t.left&&o&&this.map[i-1]==s||r==t.top&&r&&this.map[i-this.width]==s)&&e.push(s))}return e}positionAt(t,e,n){for(let r=0,o=0;;r++){const i=o+n.child(r).nodeSize;if(r==t){let s=e+t*this.width;const l=(t+1)*this.width;for(;s<l&&this.map[s]<o;)s++;return s==l?i-1:this.map[s]}o=i}}static get(t){return Uf(t)||qf(t,hD(t))}};function hD(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=gD(t),n=t.childCount,r=[];let o=0,i=null;const s=[];for(let c=0,u=e*n;c<u;c++)r[c]=0;for(let c=0,u=0;c<n;c++){const d=t.child(c);u++;for(let g=0;;g++){for(;o<r.length&&r[o]!=0;)o++;if(g==d.childCount)break;const b=d.child(g),{colspan:v,rowspan:y,colwidth:w}=b.attrs;for(let S=0;S<y;S++){if(S+c>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:u,n:y-S});break}const C=o+S*e;for(let x=0;x<v;x++){r[C+x]==0?r[C+x]=u:(i||(i=[])).push({type:"collision",row:c,pos:u,n:v-x});const E=w&&w[x];if(E){const _=(C+x)%e*2,M=s[_];M==null||M!=E&&s[_+1]==1?(s[_]=E,s[_+1]=1):M==E&&s[_+1]++}}}o+=v,u+=b.nodeSize}const f=(c+1)*e;let p=0;for(;o<f;)r[o++]==0&&p++;p&&(i||(i=[])).push({type:"missing",row:c,n:p}),u++}const l=new gt(e,n,r,i);let a=!1;for(let c=0;!a&&c<s.length;c+=2)s[c]!=null&&s[c+1]<n&&(a=!0);return a&&mD(l,s,t),l}function gD(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const o=t.child(r);let i=0;if(n)for(let s=0;s<r;s++){const l=t.child(s);for(let a=0;a<l.childCount;a++){const c=l.child(a);s+c.attrs.rowspan>r&&(i+=c.attrs.colspan)}}for(let s=0;s<o.childCount;s++){const l=o.child(s);i+=l.attrs.colspan,l.attrs.rowspan>1&&(n=!0)}e==-1?e=i:e!=i&&(e=Math.max(e,i))}return e}function mD(t,e,n){t.problems||(t.problems=[]);const r={};for(let o=0;o<t.map.length;o++){const i=t.map[o];if(r[i])continue;r[i]=!0;const s=n.nodeAt(i);if(!s)throw new RangeError(`No cell with offset ${i} found`);let l=null;const a=s.attrs;for(let c=0;c<a.colspan;c++){const u=(o+c)%t.width,d=e[u*2];d!=null&&(!a.colwidth||a.colwidth[c]!=d)&&((l||(l=bD(a)))[c]=d)}l&&t.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:l})}}function bD(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function e0(t,e){if(typeof t=="string")return{};const n=t.getAttribute("data-colwidth"),r=n&&/^\d+(,\d+)*$/.test(n)?n.split(",").map(s=>Number(s)):null,o=Number(t.getAttribute("colspan")||1),i={colspan:o,rowspan:Number(t.getAttribute("rowspan")||1),colwidth:r&&r.length==o?r:null};for(const s in e){const l=e[s].getFromDOM,a=l&&l(t);a!=null&&(i[s]=a)}return i}function t0(t,e){const n={};t.attrs.colspan!=1&&(n.colspan=t.attrs.colspan),t.attrs.rowspan!=1&&(n.rowspan=t.attrs.rowspan),t.attrs.colwidth&&(n["data-colwidth"]=t.attrs.colwidth.join(","));for(const r in e){const o=e[r].setDOMAttr;o&&o(t.attrs[r],n)}return n}function vD(t){const e=t.cellAttributes||{},n={colspan:{default:1},rowspan:{default:1},colwidth:{default:null}};for(const r in e)n[r]={default:e[r].default};return{table:{content:"table_row+",tableRole:"table",isolating:!0,group:t.tableGroup,parseDOM:[{tag:"table"}],toDOM(){return["table",["tbody",0]]}},table_row:{content:"(table_cell | table_header)*",tableRole:"row",parseDOM:[{tag:"tr"}],toDOM(){return["tr",0]}},table_cell:{content:t.cellContent,attrs:n,tableRole:"cell",isolating:!0,parseDOM:[{tag:"td",getAttrs:r=>e0(r,e)}],toDOM(r){return["td",t0(r,e),0]}},table_header:{content:t.cellContent,attrs:n,tableRole:"header_cell",isolating:!0,parseDOM:[{tag:"th",getAttrs:r=>e0(r,e)}],toDOM(r){return["th",t0(r,e),0]}}}}function yr(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],o=r.spec.tableRole;o&&(e[o]=r)}}return e}var lo=new zl("selectingCells");function ql(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function bu(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function Sh(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=ql(e.$head)||yD(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function yD(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function Gf(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function xD(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function Ch(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function Yx(t,e,n){const r=t.node(-1),o=gt.get(r),i=t.start(-1),s=o.nextCell(t.pos-i,e,n);return s==null?null:t.node(0).resolve(i+s)}function fs(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(o=>o>0)||(r.colwidth=null)),r}var Et=class Mr extends Ee{constructor(e,n=e){const r=e.node(-1),o=gt.get(r),i=e.start(-1),s=o.rectBetween(e.pos-i,n.pos-i),l=e.node(0),a=o.cellsInRect(s).filter(u=>u!=n.pos-i);a.unshift(n.pos-i);const c=a.map(u=>{const d=r.nodeAt(u);if(!d)throw RangeError(`No cell with offset ${u} found`);const f=i+u+1;return new Xy(l.resolve(f),l.resolve(f+d.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),o=e.resolve(n.map(this.$headCell.pos));if(Gf(r)&&Gf(o)&&Ch(r,o)){const i=this.$anchorCell.node(-1)!=r.node(-1);return i&&this.isRowSelection()?Mr.rowSelection(r,o):i&&this.isColSelection()?Mr.colSelection(r,o):new Mr(r,o)}return ke.between(r,o)}content(){const e=this.$anchorCell.node(-1),n=gt.get(e),r=this.$anchorCell.start(-1),o=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),i={},s=[];for(let a=o.top;a<o.bottom;a++){const c=[];for(let u=a*n.width+o.left,d=o.left;d<o.right;d++,u++){const f=n.map[u];if(i[f])continue;i[f]=!0;const p=n.findCell(f);let g=e.nodeAt(f);if(!g)throw RangeError(`No cell with offset ${f} found`);const b=o.left-p.left,v=p.right-o.right;if(b>0||v>0){let y=g.attrs;if(b>0&&(y=fs(y,0,b)),v>0&&(y=fs(y,y.colspan-v,v)),p.left<o.left){if(g=g.type.createAndFill(y),!g)throw RangeError(`Could not create cell with attrs ${JSON.stringify(y)}`)}else g=g.type.create(y,g.content)}if(p.top<o.top||p.bottom>o.bottom){const y={...g.attrs,rowspan:Math.min(p.bottom,o.bottom)-Math.max(p.top,o.top)};p.top<o.top?g=g.type.createAndFill(y):g=g.type.create(y,g.content)}c.push(g)}s.push(e.child(a).copy(K.from(c)))}const l=this.isColSelection()&&this.isRowSelection()?e:s;return new ne(K.from(l),1,1)}replace(e,n=ne.empty){const r=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){const{$from:l,$to:a}=o[s],c=e.mapping.slice(r);e.replace(c.map(l.pos),c.map(a.pos),s?ne.empty:n)}const i=Ee.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,n){this.replace(e,new ne(K.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=gt.get(n),o=this.$anchorCell.start(-1),i=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o));for(let s=0;s<i.length;s++)e(n.nodeAt(i[s]),o+i[s])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,o=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,o)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),o=gt.get(r),i=e.start(-1),s=o.findCell(e.pos-i),l=o.findCell(n.pos-i),a=e.node(0);return s.top<=l.top?(s.top>0&&(e=a.resolve(i+o.map[s.left])),l.bottom<o.height&&(n=a.resolve(i+o.map[o.width*(o.height-1)+l.right-1]))):(l.top>0&&(n=a.resolve(i+o.map[l.left])),s.bottom<o.height&&(e=a.resolve(i+o.map[o.width*(o.height-1)+s.right-1]))),new Mr(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=gt.get(e),r=this.$anchorCell.start(-1),o=n.colCount(this.$anchorCell.pos-r),i=n.colCount(this.$headCell.pos-r);if(Math.min(o,i)>0)return!1;const s=o+this.$anchorCell.nodeAfter.attrs.colspan,l=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,l)==n.width}eq(e){return e instanceof Mr&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),o=gt.get(r),i=e.start(-1),s=o.findCell(e.pos-i),l=o.findCell(n.pos-i),a=e.node(0);return s.left<=l.left?(s.left>0&&(e=a.resolve(i+o.map[s.top*o.width])),l.right<o.width&&(n=a.resolve(i+o.map[o.width*(l.top+1)-1]))):(l.left>0&&(n=a.resolve(i+o.map[l.top*o.width])),s.right<o.width&&(e=a.resolve(i+o.map[o.width*(s.top+1)-1]))),new Mr(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new Mr(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new Mr(e.resolve(n),e.resolve(r))}getBookmark(){return new wD(this.$anchorCell.pos,this.$headCell.pos)}};Et.prototype.visible=!1;Ee.jsonID("cell",Et);var wD=class Jx{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Jx(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&Ch(n,r)?new Et(n,r):Ee.near(r,1)}};function SD(t){if(!(t.selection instanceof Et))return null;const e=[];return t.selection.forEachCell((n,r)=>{e.push(Zt.node(r,r+n.nodeSize,{class:"selectedCell"}))}),ut.create(t.doc,e)}function CD({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return!1;let n=t.pos,r=e.pos,o=t.depth;for(;o>=0&&!(t.after(o+1)<t.end(o));o--,n++);for(let i=e.depth;i>=0&&!(e.before(i+1)>e.start(i));i--,r--);return n==r&&/row|table/.test(t.node(o).type.spec.tableRole)}function ED({$from:t,$to:e}){let n,r;for(let o=t.depth;o>0;o--){const i=t.node(o);if(i.type.spec.tableRole==="cell"||i.type.spec.tableRole==="header_cell"){n=i;break}}for(let o=e.depth;o>0;o--){const i=e.node(o);if(i.type.spec.tableRole==="cell"||i.type.spec.tableRole==="header_cell"){r=i;break}}return n!==r&&e.parentOffset===0}function OD(t,e,n){const r=(e||t).selection,o=(e||t).doc;let i,s;if(r instanceof Se&&(s=r.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")i=Et.create(o,r.from);else if(s=="row"){const l=o.resolve(r.from+1);i=Et.rowSelection(l,l)}else if(!n){const l=gt.get(r.node),a=r.from+1,c=a+l.map[l.width*l.height-1];i=Et.create(o,a+1,c)}}else r instanceof ke&&CD(r)?i=ke.create(o,r.from):r instanceof ke&&ED(r)&&(i=ke.create(o,r.$from.start(),r.$from.end()));return i&&(e||(e=t.tr)).setSelection(i),e}var _D=new zl("fix-tables");function Zx(t,e,n,r){const o=t.childCount,i=e.childCount;e:for(let s=0,l=0;s<i;s++){const a=e.child(s);for(let c=l,u=Math.min(o,s+3);c<u;c++)if(t.child(c)==a){l=c+1,n+=a.nodeSize;continue e}r(a,n),l<o&&t.child(l).sameMarkup(a)?Zx(t.child(l),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function kD(t,e){let n;const r=(o,i)=>{o.type.spec.tableRole=="table"&&(n=TD(t,o,i,n))};return e?e.doc!=t.doc&&Zx(e.doc,t.doc,0,r):t.doc.descendants(r),n}function TD(t,e,n,r){const o=gt.get(e);if(!o.problems)return r;r||(r=t.tr);const i=[];for(let a=0;a<o.height;a++)i.push(0);for(let a=0;a<o.problems.length;a++){const c=o.problems[a];if(c.type=="collision"){const u=e.nodeAt(c.pos);if(!u)continue;const d=u.attrs;for(let f=0;f<d.rowspan;f++)i[c.row+f]+=c.n;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,fs(d,d.colspan-c.n,c.n))}else if(c.type=="missing")i[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const u=e.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...u.attrs,rowspan:u.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const u=e.nodeAt(c.pos);if(!u)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...u.attrs,colwidth:c.colwidth})}}let s,l;for(let a=0;a<i.length;a++)i[a]&&(s==null&&(s=a),l=a);for(let a=0,c=n+1;a<o.height;a++){const u=e.child(a),d=c+u.nodeSize,f=i[a];if(f>0){let p="cell";u.firstChild&&(p=u.firstChild.type.spec.tableRole);const g=[];for(let v=0;v<f;v++){const y=yr(t.schema)[p].createAndFill();y&&g.push(y)}const b=(a==0||s==a-1)&&l==a?c+1:d-1;r.insert(r.mapping.map(b),g)}c=d}return r.setMeta(_D,{fixTables:!0})}function Xx(t){const e=t.selection,n=Sh(t),r=n.node(-1),o=n.start(-1),i=gt.get(r);return{...e instanceof Et?i.rectBetween(e.$anchorCell.pos-o,e.$headCell.pos-o):i.findCell(n.pos-o),tableStart:o,map:i,table:r}}function AD(t){return function(e,n){if(!bu(e))return!1;if(n){const r=yr(e.schema),o=Xx(e),i=e.tr,s=o.map.cellsInRect(t=="column"?{left:o.left,top:0,right:o.right,bottom:o.map.height}:t=="row"?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),l=s.map(a=>o.table.nodeAt(a));for(let a=0;a<s.length;a++)l[a].type==r.header_cell&&i.setNodeMarkup(o.tableStart+s[a],r.cell,l[a].attrs);if(i.steps.length==0)for(let a=0;a<s.length;a++)i.setNodeMarkup(o.tableStart+s[a],r.header_cell,l[a].attrs);n(i)}return!0}}function n0(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let o=0;o<r.length;o++){const i=e.table.nodeAt(r[o]);if(i&&i.type!==n.header_cell)return!1}return!0}function Eh(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?AD(t):function(n,r){if(!bu(n))return!1;if(r){const o=yr(n.schema),i=Xx(n),s=n.tr,l=n0("row",i,o),a=n0("column",i,o),u=(t==="column"?l:t==="row"?a:!1)?1:0,d=t=="column"?{left:0,top:u,right:1,bottom:i.map.height}:t=="row"?{left:u,top:0,right:i.map.width,bottom:1}:i,f=t=="column"?a?o.cell:o.header_cell:t=="row"?l?o.cell:o.header_cell:o.cell;i.map.cellsInRect(d).forEach(p=>{const g=p+i.tableStart,b=s.doc.nodeAt(g);b&&s.setNodeMarkup(g,f,b.attrs)}),r(s)}return!0}}Eh("row",{useDeprecatedLogic:!0});Eh("column",{useDeprecatedLogic:!0});Eh("cell",{useDeprecatedLogic:!0});function MD(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,o=t.before();r>=0;r--){const i=t.node(-1).child(r),s=i.lastChild;if(s)return o-1-s.nodeSize;o-=i.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const n=t.node(-1);for(let r=t.indexAfter(-1),o=t.after();r<n.childCount;r++){const i=n.child(r);if(i.childCount)return o+1;o+=i.nodeSize}}return null}function r0(t){return function(e,n){if(!bu(e))return!1;const r=MD(Sh(e),t);if(r==null)return!1;if(n){const o=e.doc.resolve(r);n(e.tr.setSelection(ke.between(o,xD(o))).scrollIntoView())}return!0}}function ka(t,e){const n=t.selection;if(!(n instanceof Et))return!1;if(e){const r=t.tr,o=yr(t.schema).cell.createAndFill().content;n.forEachCell((i,s)=>{i.content.eq(o)||r.replace(r.mapping.map(s+1),r.mapping.map(s+i.nodeSize-1),new ne(o,0,0))}),r.docChanged&&e(r)}return!0}function jD(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;const o=e.child(0),i=o.type.spec.tableRole,s=o.type.schema,l=[];if(i=="row")for(let a=0;a<e.childCount;a++){let c=e.child(a).content;const u=a?0:Math.max(0,n-1),d=a<e.childCount-1?0:Math.max(0,r-1);(u||d)&&(c=Kf(yr(s).row,new ne(c,u,d)).content),l.push(c)}else if(i=="cell"||i=="header_cell")l.push(n||r?Kf(yr(s).row,new ne(e,n,r)).content:e);else return null;return RD(s,l)}function RD(t,e){const n=[];for(let o=0;o<e.length;o++){const i=e[o];for(let s=i.childCount-1;s>=0;s--){const{rowspan:l,colspan:a}=i.child(s).attrs;for(let c=o;c<o+l;c++)n[c]=(n[c]||0)+a}}let r=0;for(let o=0;o<n.length;o++)r=Math.max(r,n[o]);for(let o=0;o<n.length;o++)if(o>=e.length&&e.push(K.empty),n[o]<r){const i=yr(t).cell.createAndFill(),s=[];for(let l=n[o];l<r;l++)s.push(i);e[o]=e[o].append(K.from(s))}return{height:e.length,width:r,rows:e}}function Kf(t,e){const n=t.createAndFill();return new Zy(n).replace(0,n.content.size,e).doc}function ND({width:t,height:e,rows:n},r,o){if(t!=r){const i=[],s=[];for(let l=0;l<n.length;l++){const a=n[l],c=[];for(let u=i[l]||0,d=0;u<r;d++){let f=a.child(d%a.childCount);u+f.attrs.colspan>r&&(f=f.type.createChecked(fs(f.attrs,f.attrs.colspan,u+f.attrs.colspan-r),f.content)),c.push(f),u+=f.attrs.colspan;for(let p=1;p<f.attrs.rowspan;p++)i[l+p]=(i[l+p]||0)+f.attrs.colspan}s.push(K.from(c))}n=s,t=r}if(e!=o){const i=[];for(let s=0,l=0;s<o;s++,l++){const a=[],c=n[l%e];for(let u=0;u<c.childCount;u++){let d=c.child(u);s+d.attrs.rowspan>o&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,o-d.attrs.rowspan)},d.content)),a.push(d)}i.push(K.from(a))}n=i,e=o}return{width:t,height:e,rows:n}}function PD(t,e,n,r,o,i,s){const l=t.doc.type.schema,a=yr(l);let c,u;if(o>e.width)for(let d=0,f=0;d<e.height;d++){const p=n.child(d);f+=p.nodeSize;const g=[];let b;p.lastChild==null||p.lastChild.type==a.cell?b=c||(c=a.cell.createAndFill()):b=u||(u=a.header_cell.createAndFill());for(let v=e.width;v<o;v++)g.push(b);t.insert(t.mapping.slice(s).map(f-1+r),g)}if(i>e.height){const d=[];for(let g=0,b=(e.height-1)*e.width;g<Math.max(e.width,o);g++){const v=g>=e.width?!1:n.nodeAt(e.map[b+g]).type==a.header_cell;d.push(v?u||(u=a.header_cell.createAndFill()):c||(c=a.cell.createAndFill()))}const f=a.row.create(null,K.from(d)),p=[];for(let g=e.height;g<i;g++)p.push(f);t.insert(t.mapping.slice(s).map(r+n.nodeSize-2),p)}return!!(c||u)}function o0(t,e,n,r,o,i,s,l){if(s==0||s==e.height)return!1;let a=!1;for(let c=o;c<i;c++){const u=s*e.width+c,d=e.map[u];if(e.map[u-e.width]==d){a=!0;const f=n.nodeAt(d),{top:p,left:g}=e.findCell(d);t.setNodeMarkup(t.mapping.slice(l).map(d+r),null,{...f.attrs,rowspan:s-p}),t.insert(t.mapping.slice(l).map(e.positionAt(s,g,n)),f.type.createAndFill({...f.attrs,rowspan:p+f.attrs.rowspan-s})),c+=f.attrs.colspan-1}}return a}function i0(t,e,n,r,o,i,s,l){if(s==0||s==e.width)return!1;let a=!1;for(let c=o;c<i;c++){const u=c*e.width+s,d=e.map[u];if(e.map[u-1]==d){a=!0;const f=n.nodeAt(d),p=e.colCount(d),g=t.mapping.slice(l).map(d+r);t.setNodeMarkup(g,null,fs(f.attrs,s-p,f.attrs.colspan-(s-p))),t.insert(g+f.nodeSize,f.type.createAndFill(fs(f.attrs,0,s-p))),c+=f.attrs.rowspan-1}}return a}function s0(t,e,n,r,o){let i=n?t.doc.nodeAt(n-1):t.doc;if(!i)throw new Error("No table found");let s=gt.get(i);const{top:l,left:a}=r,c=a+o.width,u=l+o.height,d=t.tr;let f=0;function p(){if(i=n?d.doc.nodeAt(n-1):d.doc,!i)throw new Error("No table found");s=gt.get(i),f=d.mapping.maps.length}PD(d,s,i,n,c,u,f)&&p(),o0(d,s,i,n,a,c,l,f)&&p(),o0(d,s,i,n,a,c,u,f)&&p(),i0(d,s,i,n,l,u,a,f)&&p(),i0(d,s,i,n,l,u,c,f)&&p();for(let g=l;g<u;g++){const b=s.positionAt(g,a,i),v=s.positionAt(g,c,i);d.replace(d.mapping.slice(f).map(b+n),d.mapping.slice(f).map(v+n),new ne(o.rows[g-l],0,0))}p(),d.setSelection(new Et(d.doc.resolve(n+s.positionAt(l,a,i)),d.doc.resolve(n+s.positionAt(u-1,c-1,i)))),e(d)}var DD=hx({ArrowLeft:Ta("horiz",-1),ArrowRight:Ta("horiz",1),ArrowUp:Ta("vert",-1),ArrowDown:Ta("vert",1),"Shift-ArrowLeft":Aa("horiz",-1),"Shift-ArrowRight":Aa("horiz",1),"Shift-ArrowUp":Aa("vert",-1),"Shift-ArrowDown":Aa("vert",1),Backspace:ka,"Mod-Backspace":ka,Delete:ka,"Mod-Delete":ka});function za(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function Ta(t,e){return(n,r,o)=>{if(!o)return!1;const i=n.selection;if(i instanceof Et)return za(n,r,Ee.near(i.$headCell,e));if(t!="horiz"&&!i.empty)return!1;const s=Qx(o,t,e);if(s==null)return!1;if(t=="horiz")return za(n,r,Ee.near(n.doc.resolve(i.head+e),e));{const l=n.doc.resolve(s),a=Yx(l,t,e);let c;return a?c=Ee.near(a,1):e<0?c=Ee.near(n.doc.resolve(l.before(-1)),-1):c=Ee.near(n.doc.resolve(l.after(-1)),1),za(n,r,c)}}}function Aa(t,e){return(n,r,o)=>{if(!o)return!1;const i=n.selection;let s;if(i instanceof Et)s=i;else{const a=Qx(o,t,e);if(a==null)return!1;s=new Et(n.doc.resolve(a))}const l=Yx(s.$headCell,t,e);return l?za(n,r,new Et(s.$anchorCell,l)):!1}}function LD(t,e){const n=t.state.doc,r=ql(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new Et(r))),!0):!1}function VD(t,e,n){if(!bu(t.state))return!1;let r=jD(n);const o=t.state.selection;if(o instanceof Et){r||(r={width:1,height:1,rows:[K.from(Kf(yr(t.state.schema).cell,n))]});const i=o.$anchorCell.node(-1),s=o.$anchorCell.start(-1),l=gt.get(i).rectBetween(o.$anchorCell.pos-s,o.$headCell.pos-s);return r=ND(r,l.right-l.left,l.bottom-l.top),s0(t.state,t.dispatch,s,l,r),!0}else if(r){const i=Sh(t.state),s=i.start(-1);return s0(t.state,t.dispatch,s,gt.get(i.node(-1)).findCell(i.pos-s),r),!0}else return!1}function ID(t,e){var n;if(e.ctrlKey||e.metaKey)return;const r=l0(t,e.target);let o;if(e.shiftKey&&t.state.selection instanceof Et)i(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(o=ql(t.state.selection.$anchor))!=null&&((n=Nd(t,e))==null?void 0:n.pos)!=o.pos)i(o,e),e.preventDefault();else if(!r)return;function i(a,c){let u=Nd(t,c);const d=lo.getState(t.state)==null;if(!u||!Ch(a,u))if(d)u=a;else return;const f=new Et(a,u);if(d||!t.state.selection.eq(f)){const p=t.state.tr.setSelection(f);d&&p.setMeta(lo,a.pos),t.dispatch(p)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",l),lo.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(lo,-1))}function l(a){const c=a,u=lo.getState(t.state);let d;if(u!=null)d=t.state.doc.resolve(u);else if(l0(t,c.target)!=r&&(d=Nd(t,e),!d))return s();d&&i(d,c)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",l)}function Qx(t,e,n){if(!(t.state.selection instanceof ke))return null;const{$head:r}=t.state.selection;for(let o=r.depth-1;o>=0;o--){const i=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:i.childCount))return null;if(i.type.spec.tableRole=="cell"||i.type.spec.tableRole=="header_cell"){const l=r.before(o),a=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(a)?l:null}}return null}function l0(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Nd(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?ql(t.state.doc.resolve(n.pos)):null}var $D=class{constructor(t,e){this.node=t,this.defaultCellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${e}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Yf(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,Yf(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function Yf(t,e,n,r,o,i){var s;let l=0,a=!0,c=e.firstChild;const u=t.firstChild;if(u){for(let d=0,f=0;d<u.childCount;d++){const{colspan:p,colwidth:g}=u.child(d).attrs;for(let b=0;b<p;b++,f++){const v=o==f?i:g&&g[b],y=v?v+"px":"";if(l+=v||r,v||(a=!1),c)c.style.width!=y&&(c.style.width=y),c=c.nextSibling;else{const w=document.createElement("col");w.style.width=y,e.appendChild(w)}}}for(;c;){const d=c.nextSibling;(s=c.parentNode)==null||s.removeChild(c),c=d}a?(n.style.width=l+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=l+"px")}}var un=new zl("tableColumnResizing");function HD({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:n=100,View:r=$D,lastColumnResizable:o=!0}={}){const i=new Bl({key:un,state:{init(s,l){var a,c;const u=(c=(a=i.spec)==null?void 0:a.props)==null?void 0:c.nodeViews,d=yr(l.schema).table.name;return r&&u&&(u[d]=(f,p)=>new r(f,n,p)),new BD(-1,!1)},apply(s,l){return l.apply(s)}},props:{attributes:s=>{const l=un.getState(s);return l&&l.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,l)=>{zD(s,l,t,o)},mouseleave:s=>{FD(s)},mousedown:(s,l)=>{WD(s,l,e,n)}},decorations:s=>{const l=un.getState(s);if(l&&l.activeHandle>-1)return YD(s,l.activeHandle)},nodeViews:{}}});return i}var BD=class Fa{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,r=e.getMeta(un);if(r&&r.setHandle!=null)return new Fa(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new Fa(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let o=e.mapping.map(n.activeHandle,-1);return Gf(e.doc.resolve(o))||(o=-1),new Fa(o,n.dragging)}return n}};function zD(t,e,n,r){const o=un.getState(t.state);if(o&&!o.dragging){const i=qD(e.target);let s=-1;if(i){const{left:l,right:a}=i.getBoundingClientRect();e.clientX-l<=n?s=a0(t,e,"left",n):a-e.clientX<=n&&(s=a0(t,e,"right",n))}if(s!=o.activeHandle){if(!r&&s!==-1){const l=t.state.doc.resolve(s),a=l.node(-1),c=gt.get(a),u=l.start(-1);if(c.colCount(l.pos-u)+l.nodeAfter.attrs.colspan-1==c.width-1)return}e2(t,s)}}}function FD(t){const e=un.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&e2(t,-1)}function WD(t,e,n,r){var o;const i=(o=t.dom.ownerDocument.defaultView)!=null?o:window,s=un.getState(t.state);if(!s||s.activeHandle==-1||s.dragging)return!1;const l=t.state.doc.nodeAt(s.activeHandle),a=UD(t,s.activeHandle,l.attrs);t.dispatch(t.state.tr.setMeta(un,{setDragging:{startX:e.clientX,startWidth:a}}));function c(d){i.removeEventListener("mouseup",c),i.removeEventListener("mousemove",u);const f=un.getState(t.state);f!=null&&f.dragging&&(GD(t,f.activeHandle,c0(f.dragging,d,n)),t.dispatch(t.state.tr.setMeta(un,{setDragging:null})))}function u(d){if(!d.which)return c(d);const f=un.getState(t.state);if(f&&f.dragging){const p=c0(f.dragging,d,n);u0(t,f.activeHandle,p,r)}}return u0(t,s.activeHandle,a,r),i.addEventListener("mouseup",c),i.addEventListener("mousemove",u),e.preventDefault(),!0}function UD(t,e,{colspan:n,colwidth:r}){const o=r&&r[r.length-1];if(o)return o;const i=t.domAtPos(e);let l=i.node.childNodes[i.offset].offsetWidth,a=n;if(r)for(let c=0;c<n;c++)r[c]&&(l-=r[c],a--);return l/a}function qD(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function a0(t,e,n,r){const o=n=="right"?-r:r,i=t.posAtCoords({left:e.clientX+o,top:e.clientY});if(!i)return-1;const{pos:s}=i,l=ql(t.state.doc.resolve(s));if(!l)return-1;if(n=="right")return l.pos;const a=gt.get(l.node(-1)),c=l.start(-1),u=a.map.indexOf(l.pos-c);return u%a.width==0?-1:c+a.map[u-1]}function c0(t,e,n){const r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function e2(t,e){t.dispatch(t.state.tr.setMeta(un,{setHandle:e}))}function GD(t,e,n){const r=t.state.doc.resolve(e),o=r.node(-1),i=gt.get(o),s=r.start(-1),l=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,a=t.state.tr;for(let c=0;c<i.height;c++){const u=c*i.width+l;if(c&&i.map[u]==i.map[u-i.width])continue;const d=i.map[u],f=o.nodeAt(d).attrs,p=f.colspan==1?0:l-i.colCount(d);if(f.colwidth&&f.colwidth[p]==n)continue;const g=f.colwidth?f.colwidth.slice():KD(f.colspan);g[p]=n,a.setNodeMarkup(s+d,null,{...f,colwidth:g})}a.docChanged&&t.dispatch(a)}function u0(t,e,n,r){const o=t.state.doc.resolve(e),i=o.node(-1),s=o.start(-1),l=gt.get(i).colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1;let a=t.domAtPos(o.start(-1)).node;for(;a&&a.nodeName!="TABLE";)a=a.parentNode;a&&Yf(i,a.firstChild,a,r,l,n)}function KD(t){return Array(t).fill(0)}function YD(t,e){var n;const r=[],o=t.doc.resolve(e),i=o.node(-1);if(!i)return ut.empty;const s=gt.get(i),l=o.start(-1),a=s.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1;for(let c=0;c<s.height;c++){const u=a+c*s.width;if((a==s.width-1||s.map[u]!=s.map[u+1])&&(c==0||s.map[u]!=s.map[u-s.width])){const d=s.map[u],f=l+d+i.nodeAt(d).nodeSize-1,p=document.createElement("div");p.className="column-resize-handle",(n=un.getState(t))!=null&&n.dragging&&r.push(Zt.node(l+d,l+d+i.nodeAt(d).nodeSize,{class:"column-resize-dragging"})),r.push(Zt.widget(f,p))}}return ut.create(t.doc,r)}function JD({allowTableNodeSelection:t=!1}={}){return new Bl({key:lo,state:{init(){return null},apply(e,n){const r=e.getMeta(lo);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;const{deleted:o,pos:i}=e.mapping.mapResult(n);return o?null:i}},props:{decorations:SD,handleDOMEvents:{mousedown:ID},createSelectionBetween(e){return lo.getState(e.state)!=null?e.state.selection:null},handleTripleClick:LD,handleKeyDown:DD,handlePaste:VD},appendTransaction(e,n,r){return OD(r,kD(r,n),t)}})}const sl=t=>{const e=Object.fromEntries(Array.from(t.attributes).map(n=>[n.name,n.value]));return delete e.draggable,e},d0="data-gs-mrk-fs",f0="data-gs-ib",Tc="data-gs-ifrg",qr="attrs",t2={[qr]:{default:"{}"}},Tr={[qr]:{default:{}}},n2=t=>({[qr]:JSON.stringify(sl(t))}),Ar=t=>({attrs:sl(t)}),Is=t=>e=>[t,e.attrs.attrs,0],io=t=>t.attrs[qr]?JSON.parse(t.attrs[qr]):{},ZD={doc:{content:"block+"},text:{group:"inline",inline:!0},inlineFragment:{group:"block",content:"inline*",isTextBlock:!0,parseDOM:[{tag:`span[${Tc}]`,getAttrs:Ar}],toDOM:()=>["span",{[Tc]:""},0]},div:{group:"block",content:"inline*",attrs:Tr,parseDOM:[{tag:"div",getAttrs:Ar}],toDOM:Is("div")},paragraph:{group:"block",content:"inline*",attrs:Tr,parseDOM:[{tag:"p",getAttrs:Ar}],toDOM:Is("p")},orderedList:{group:"block",content:"listItem+",attrs:Tr,parseDOM:[{tag:"ol",getAttrs:Ar}],toDOM:Is("ol")},bulletList:{group:"block",content:"listItem+",attrs:Tr,parseDOM:[{tag:"ul",getAttrs:Ar}],toDOM:Is("ul")},listItem:{content:"block*",group:"block",attrs:Tr,parseDOM:[{tag:"li",getAttrs:Ar}],toDOM:Is("li"),defining:!0},codeBlock:{group:"block",content:"text*",marks:"",attrs:Tr,parseDOM:[{tag:"pre",getAttrs:Ar}],toDOM:t=>["pre",t.attrs.attrs,["code",0]]},image:{inline:!0,group:"inline",selectable:!0,attrs:Tr,parseDOM:[{tag:"img[src]",getAttrs:Ar}],toDOM:t=>["img",t.attrs.attrs]},inlineBreak:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:`br[${f0}]`}],toDOM(){return["br",{[f0]:""}]}},hardBreak:{inline:!1,group:"block",selectable:!1,attrs:Tr,parseDOM:[{tag:"br",getAttrs:Ar}],toDOM:t=>["br",{...t.attrs.attrs}]},heading:{group:"block",content:"inline*",attrs:{level:{default:1},attrs:{default:{}}},defining:!0,parseDOM:Array.from({length:6},(t,e)=>({tag:`h${e+1}`,getAttrs:n=>({level:e+1,attrs:sl(n)})})),toDOM({attrs:t}){const{level:e}=t;return[e?`h${e}`:"div",t.attrs,0]}},...vD({tableGroup:"block",cellContent:"block+",cellAttributes:{[qr]:{default:Tr[qr].default,getFromDOM:sl,setDOMAttr:(t,e)=>{t&&Object.assign(e,t)}},background:{default:null,getFromDOM(t){return t.style.backgroundColor||null},setDOMAttr(t,e){t&&(e.style=(e.style||"")+`background-color: ${t};`)}}}}),nonTextNode:{group:"block",content:"block*",attrs:{tagName:{default:"span"},attrs:{default:{}}},parseDOM:[{tag:"*:not(tbody)",getAttrs:t=>({tagName:t.tagName.toLowerCase(),attrs:sl(t)}),priority:0}],toDOM(t){const{tagName:e,attrs:n}=t.attrs;return[e,n,0]}}},$s=(t,e)=>({attrs:t2,parseDOM:t.map(n=>({tag:n,getAttrs:n2})),toDOM:e}),XD={strong:$s(["strong","b"],t=>["b",io(t)]),link:$s(["a"],t=>["a",io(t),0]),em:$s(["em","i"],t=>["em",io(t)]),underline:$s(["u"],t=>["u",io(t),0]),strikethrough:$s(["s"],t=>["s",io(t),0]),font_size:{attrs:{...t2,size:{default:null}},parseDOM:[{tag:`span[${d0}]`,getAttrs:t=>({...n2(t),size:t.style.fontSize})}],toDOM(t){const{size:e}=t.attrs,n={...io(t),[d0]:!0};return e&&(n.style=`font-size: ${e}`),["span",n,0]}}},p0=new bR({nodes:ZD,marks:XD}),vu=new WeakMap,Oh=new WeakMap,QD=(t,e)=>{vu.set(t,e),Oh.set(e,t)},eL=(t,e)=>{vu.delete(t),Oh.delete(e)},Pd=t=>vu.get(t),tL=t=>Oh.get(t),h0=t=>{var n;const e=tL(t);return(n=e==null?void 0:e.__gjsv)==null?void 0:n.model},nL=t=>t.dispatchEvent(new CustomEvent("input"));function rL(t){const e=n=>{if(n.tagName==="SPAN"&&n.hasAttribute(Tc)){if(n.getAttribute("style")){n.removeAttribute(Tc);return}const r=n.parentElement;if(r){for(;n.firstChild;)r.insertBefore(n.firstChild,n);r.removeChild(n)}}else Array.from(n.children).forEach(r=>e(r))};e(t)}function oL(t,e={}){if(!e.enableOnClick)return()=>{};const n=t.Components.events,r=u=>t.getSelectedAll().includes(u),o=u=>u.isInstanceOf("text")&&!u.isChildOf("text"),i=u=>u.isChildOf("text"),s=u=>t.getEditing()===u,l=(u,d={})=>{u.trigger("focus",d.event)},a=(u,d)=>{r(u)&&o(u)&&!s(u)&&l(u,d)},c=(u,d)=>{if(r(u)&&!o(u)&&i(u)){const f=u.parents().find(p=>p.isInstanceOf("text"));f&&(l(f,d),setTimeout(()=>t.select(f),0))}};return t.on(n.select,a),t.on(n.selectBefore,c),()=>{t.off(n.select,a),t.off(n.selectBefore,c)}}const iL=(t,e)=>{const n=sL(t);return n&&gL(n)?lL(t,e):n?sx(()=>({type:t.schema.nodes.div}))(t,e):!1};function sL(t){const e=t.selection.$from;if(e.node(e.depth).type===t.schema.nodes.inlineFragment){const n=e.depth-1;return e.node(n)}return e.node(e.depth)}function lL(t,e){const{selection:n,schema:r,tr:o}=t;o.split(n.from,1);const i=n.from+1,s=o.doc.nodeAt(i),l={...s.attrs.attrs,id:void 0},a=s.textContent.length>0,c=s.textContent.length||0,u=s.textContent||" ",d=r.text(u),f=r.nodes.div.create(l,a?d:[],[]);return o.replaceRangeWith(i,i+c+2,f),o.setSelection(ke.create(o.doc,i+1)),e==null||e(o.scrollIntoView()),!0}function aL(t,e,n){const{state:r,dispatch:o}=t,{selection:i,tr:s}=r,l=(a,c,u)=>{const d={};return a.split(";").forEach(f=>{const[p,g]=f.split(":").map(b=>b.trim());p&&(d[p]=g)}),d[c]=u,Object.entries(d).map(([f,p])=>`${f}: ${p}`).join("; ")};if(!i.empty||n)s.doc.nodesBetween(i.from,i.to,(a,c)=>{var u,d;if(a.type===r.schema.nodes.image){const f=l(((u=a.attrs.attrs)==null?void 0:u.style)||"","float",e);s.setNodeMarkup(c,void 0,{...a.attrs,attrs:{...a.attrs.attrs,style:f}})}else if(a.type.isBlock){const f=l(((d=a.attrs.attrs)==null?void 0:d.style)||"","text-align",e);r2(a)?s.setBlockType(i.from,void 0,r.schema.nodes.div,{attrs:{style:f}}):s.setNodeMarkup(c,void 0,{...a.attrs,attrs:{...a.attrs.attrs,style:f}})}});else{const a=r.doc.resolve(i.from),c=a.start(a.depth),u=r.doc.nodeAt(c);if(u!=null&&u.type.isBlock){const d=l(u.attrs.style||"","text-align",e);s.setNodeMarkup(c,void 0,{...u.attrs,style:d})}}s.docChanged&&o(s.scrollIntoView())}const Hs=(t,e)=>{const{from:n,to:r}=t.selection;let o=!1;return t.doc.nodesBetween(n,r,i=>{if(o)return!1;i.marks.some(s=>s.type===e)&&(o=!0)}),o};function cL(t,e,n="_blank"){const{state:r,dispatch:o}=t,{schema:i,selection:s,tr:l}=r,a=i.marks.link;try{const c=a.create({[qr]:JSON.stringify({href:e,target:n})});l.addMark(s.from,s.to,c),o(l.scrollIntoView())}catch(c){console.error("Error applying link mark:",c)}}function uL(t,e){const{state:n,dispatch:r}=t,{selection:o,tr:i}=n;if(o.empty)return;const s=n.schema.marks.font_size;if(!s){console.error("Font size mark is not defined in the schema.");return}i.addMark(o.from,o.to,s.create({size:e})),r(i.scrollIntoView())}const Ko=(t,e)=>{const{doc:n,selection:r}=t.state,o=n.resolve(r.from);for(let i=o.depth;i>0;i--){const s=o.node(i);if(e(s))return{pos:i>0?o.before(i):0,start:o.start(i),depth:i,node:s}}},dL=t=>(t||"").split(";").map(e=>e.split(":")).reduce((e,[n,r])=>(n=n.replace(/-./g,o=>o.toUpperCase()[1]).trim(),e[n]=`${r}`.trim(),e),{});function fL(...t){return(e,n)=>{const r=s=>{e=e.apply(s),n==null||n(s)},o=t.pop();return t.reduce((s,l)=>s||l(e,r),!1)&&o!==void 0&&o(e,n)}}const pL=(t,e)=>{const{state:n,dispatch:r}=t;if(e!=null&&e.event){const{event:o}=e,i=t.posAtCoords({left:o.clientX,top:o.clientY});i!=null&&i.pos&&r(n.tr.setSelection(ke.create(n.doc,i.pos)))}else lx(n,r);setTimeout(()=>setTimeout(()=>t.focus()))},Jf=t=>t.isBlock,r2=t=>t.type.name==="inlineFragment",hL=t=>Jf(t)&&!r2(t),o2=t=>t.type.name==="bulletList",i2=t=>t.type.name==="orderedList",gL=t=>t.type.name==="heading",mL=t=>o2(t)||i2(t),g0=(t,e)=>{var i,s;const n=(i=Ko(t,l=>l.type===e))==null?void 0:i.node,r=t.state.schema.nodes.listItem;let o;return n?o=Pf(r):(s=Ko(t,mL))!=null&&s.node?o=fL(Pf(r),x1(e)):o=x1(e),o(t.state,t.dispatch)},s2=(t,e)=>{const{selection:n}=t.state;return[...n.$from.marks(),...n.$to.marks()].find(r=>r.type.name===e)},bL=t=>{var s;const{view:e,prop:n,editor:r,propCSS:o}=t,i=(s=Ko(e,hL))==null?void 0:s.node;if(i){const l=i.attrs.attrs||{},a=dL(l.style);if(n in a)return a[n]||"";if(l.id){const c=r.Components.getById(l.id);return((c==null?void 0:c.getStyle())||{})[o]||""}}return""},vL=t=>{const{view:e,prop:n,markName:r,editor:o,propCSS:i}=t,s=s2(e,r);if(s){const l=s.attrs;if(l[n])return l[n];if(l[qr]){const a=io(s).id;if(a){const c=o.Components.getById(a);return((c==null?void 0:c.getStyle())||{})[i]||""}}}return""},l2=(t,e)=>{const{dispatch:n}=t,{nodes:r,marks:o}=t.state.schema;return{text:{selected:()=>{const{selection:i,doc:s}=t.state;return s.textBetween(i.from,i.to," ")},replace:(i,s={})=>{const{state:l}=t,{from:a}=l.selection;let c=l.tr.replaceSelectionWith(l.schema.text(i));s.select&&(c=c.setSelection(ke.create(c.doc,a,a+i.length))),n==null||n(c)}},bold:{toggle:()=>zo(o.strong)(t.state,n),isActive:()=>Hs(t.state,o.strong)},italic:{toggle:()=>zo(o.em)(t.state,n),isActive:()=>Hs(t.state,o.em)},underline:{toggle:()=>zo(o.underline)(t.state,n),isActive:()=>Hs(t.state,o.underline)},strikethrough:{toggle:()=>zo(o.strikethrough)(t.state,n),isActive:()=>Hs(t.state,o.strikethrough)},link:{get:()=>{const i=h0(t);if(i!=null&&i.is("link"))return i.getAttributes();{const s=s2(t,"link");return s?io(s):{}}},toggle:()=>zo(o.link)(t.state,n),isActive:()=>Hs(t.state,o.link),create:i=>{const s=h0(t);s!=null&&s.is("link")?(s.addAttributes({href:i.url,target:i.target}),t.focus()):cL(t,i.url,i.target)}},alignText:{get:()=>bL({view:t,editor:e,prop:"textAlign",propCSS:"text-align"}),set:i=>aL(t,i.value,!0)},fontSize:{get:()=>vL({view:t,editor:e,markName:"font_size",prop:"size",propCSS:"font-size"}),set:i=>uL(t,i.value)},image:{open(){const i="assetLayout",{state:s,dispatch:l}=t,{selection:a,doc:c}=s,u=c.textBetween(a.from,a.to," "),d={id:i,disablePropagation:!0,placer:{type:"dialog",title:"Select image",size:"l"},header:!1,layout:{type:"panelAssets",onSelect:f=>{const p={alt:u,src:f.asset.getSrc()};l(s.tr.replaceSelectionWith(r.image.createAndFill({attrs:p})))}}};e.runCommand(vt.layoutToggle,d)}},heading:{get:()=>{var s;const i=(s=Ko(t,Jf))==null?void 0:s.node;return`${(i==null?void 0:i.attrs.level)||""}`},set:({value:i})=>{var a;const{state:s}=t,l=(a=Ko(t,Jf))==null?void 0:a.node;uN(s.schema.nodes.heading,{attrs:l==null?void 0:l.attrs.attrs,level:i?parseInt(i,10):0})(s,n)}},listBullet:{isActive:()=>{var i;return!!((i=Ko(t,o2))!=null&&i.node)},toggle:()=>g0(t,r.bulletList)},listOrdered:{isActive:()=>{var i;return!!((i=Ko(t,i2))!=null&&i.node)},toggle:()=>g0(t,r.orderedList)}}},zn="rte:selectionchange",En={bold:'<svg viewBox="0 0 24 24"><path d="M13.5,15.5H10V12.5H13.5A1.5,1.5 0 0,1 15,14A1.5,1.5 0 0,1 13.5,15.5M10,6.5H13A1.5,1.5 0 0,1 14.5,8A1.5,1.5 0 0,1 13,9.5H10M15.6,10.79C16.57,10.11 17.25,9 17.25,8C17.25,5.74 15.5,4 13.25,4H7V18H14.04C16.14,18 17.75,16.3 17.75,14.21C17.75,12.69 16.89,11.39 15.6,10.79Z" /></svg>',italic:'<svg viewBox="0 0 24 24"><path d="M10,4V7H12.21L8.79,15H6V18H14V15H11.79L15.21,7H18V4H10Z" /></svg>',underline:'<svg viewBox="0 0 24 24"><path d="M5,21H19V19H5V21M12,17A6,6 0 0,0 18,11V3H15.5V11A3.5,3.5 0 0,1 12,14.5A3.5,3.5 0 0,1 8.5,11V3H6V11A6,6 0 0,0 12,17Z" /></svg>',strikethrough:'<svg viewBox="0 0 24 24"><path d="M7.2 9.8c-1.2-2.3.5-5 2.9-5.5 3.1-1 7.6.4 7.5 4.2h-3l-.1-.8c-.2-.6-.6-.9-1.2-1.1-.8-.3-2.1-.2-2.8.3C9 8.2 10.4 9.5 12 10H7.4l-.2-.2M21 13v-2H3v2h9.6l.6.2c.6.3 1.1.5 1.3 1.1.1.4.2.9 0 1.3-.2.5-.6.7-1.1.9-1.8.5-4-.2-3.9-2.4h-3c-.1 2.6 2.1 4.4 4.5 4.7 3.8.8 8.3-1.6 6.3-5.9l3.7.1Z"/></svg>',link:'<svg viewBox="0 0 24 24"><path d="M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z" /></svg>',image:'<svg viewBox="0 0 24 24"><path d="M19,19H5V5H19M19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3M13.96,12.29L11.21,15.83L9.25,13.47L6.5,17H17.5L13.96,12.29Z"></path></svg>',listBullet:'<svg viewBox="0 0 24 24"><path d="M7 5h14v2H7V5m0 8v-2h14v2H7M4 4.5A1.5 1.5 0 0 1 5.5 6 1.5 1.5 0 0 1 4 7.5 1.5 1.5 0 0 1 2.5 6 1.5 1.5 0 0 1 4 4.5m0 6A1.5 1.5 0 0 1 5.5 12 1.5 1.5 0 0 1 4 13.5 1.5 1.5 0 0 1 2.5 12 1.5 1.5 0 0 1 4 10.5M7 19v-2h14v2H7m-3-2.5A1.5 1.5 0 0 1 5.5 18 1.5 1.5 0 0 1 4 19.5 1.5 1.5 0 0 1 2.5 18 1.5 1.5 0 0 1 4 16.5Z"/></svg>',listOrdered:'<svg viewBox="0 0 24 24"><path d="M7 13v-2h14v2H7m0 6v-2h14v2H7M7 7V5h14v2H7M3 8V5H2V4h2v4H3m-1 9v-1h3v4H2v-1h2v-.5H3v-1h1V17H2m2.3-7a.8.8 0 0 1 .7.8c0 .1 0 .3-.2.5L3 13h2v1H2v-1l2-2H2v-1h2.3Z"/></svg>',alignTextLeft:'<svg viewBox="0 0 24 24"><path d="M3,3H21V5H3V3M3,7H15V9H3V7M3,11H21V13H3V11M3,15H15V17H3V15M3,19H21V21H3V19Z" /></svg>',alignTextCenter:'<svg viewBox="0 0 24 24"><path d="M3,3H21V5H3V3M7,7H17V9H7V7M3,11H21V13H3V11M7,15H17V17H7V15M3,19H21V21H3V19Z" /></svg>',alignTextRight:'<svg viewBox="0 0 24 24"><path d="M3,3H21V5H3V3M9,7H21V9H9V7M3,11H21V13H3V11M9,15H21V17H9V15M3,19H21V21H3V19Z" /></svg>',alignTextJustify:'<svg viewBox="0 0 24 24"><path d="M3,3H21V5H3V3M3,7H21V9H3V7M3,11H21V13H3V11M3,15H21V17H3V15M3,19H21V21H3V19Z" /></svg>'},yL=(t,e)=>{var a;const{editor:n,el:r}=t,o=vu.get(r),i=l2(o,n),s={separator:{type:"column",style:{borderRightWidth:"1px",borderRightStyle:"solid",alignSelf:"stretch",margin:3}},bold:{id:"bold",icon:En.bold,size:"s",type:"button",editorEvents:{[zn]:({setState:c})=>{c({active:i.bold.isActive()})}},onClick:({setState:c})=>{i.bold.toggle(),c({active:i.bold.isActive()})}},italic:{id:"italic",icon:En.italic,size:"s",type:"button",editorEvents:{[zn]:({setState:c})=>{c({active:i.italic.isActive()})}},onClick:({setState:c})=>{i.italic.toggle(),c({active:i.italic.isActive()})}},underline:{id:"underline",icon:En.underline,size:"s",type:"button",editorEvents:{[zn]:({setState:c})=>{c({active:i.underline.isActive()})}},onClick:({setState:c})=>{i.underline.toggle(),c({active:i.underline.isActive()})}},strikethrough:{id:"strikethrough",icon:En.strikethrough,size:"s",type:"button",editorEvents:{[zn]:({setState:c})=>{c({active:i.strikethrough.isActive()})}},onClick:({setState:c})=>{i.strikethrough.toggle(),c({active:i.strikethrough.isActive()})}},image:{id:"image",icon:En.image,size:"s",type:"button",onClick:()=>i.image.open()},link:{id:"link",icon:En.link,size:"s",type:"button",editorEvents:{[zn]:({setState:c})=>{c({active:i.link.isActive(),disabled:o.state.selection.empty})}},onClick:({event:c})=>{const u=c.currentTarget||c.target,{x:d,y:f,width:p,height:g}=u.getBoundingClientRect(),b="linkLayout",v=()=>n.runCommand(vt.layoutRemove,{id:b}),y=i.link.get(),w={id:b,style:{width:240},disablePropagation:!0,placer:{type:"popover",closeOnClickAway:!0,x:d,y:f,w:p,h:g},header:{label:"Link"},layout:{type:"column",as:"form",style:{padding:"0 10px 15px",gap:10},onSubmit:S=>{S.preventDefault();const C=new FormData(S.currentTarget);i.link.create({url:C.get("url"),target:C.get("target")}),v()},children:[{type:"inputField",name:"url",label:"URL",placeholder:"eg. https://google.com",required:!0,value:(y==null?void 0:y.href)||"",onChange:({value:S,setState:C})=>C({value:S})},{type:"selectField",name:"target",label:"Open link in",emptyState:"Current window",value:(y==null?void 0:y.target)||"",options:[{id:"",label:"Current window"},{id:"_blank",label:"New window"}],onChange:({value:S,setState:C})=>C({value:S})},{type:"row",style:{gap:10,justifyContent:"end"},children:[i.link.isActive()&&{type:"button",label:"Clear",buttonType:"button",onClick:()=>{i.link.toggle(),v()}},{type:"button",variant:"primary",label:"Submit",buttonType:"submit"}]}]}};n.runCommand(vt.layoutToggle,w)}},alignText:{id:"alignText",type:"buttonGroupField",size:"s",value:"",options:[{id:"left",icon:En.alignTextLeft},{id:"center",icon:En.alignTextCenter},{id:"right",icon:En.alignTextRight},{id:"justify",icon:En.alignTextJustify}],editorEvents:{[zn]:({setState:c})=>{c({value:i.alignText.get()})}},onChange:({value:c,setState:u})=>{u({value:c}),i.alignText.set({value:c})}},listBullet:{id:"listBullet",icon:En.listBullet,size:"s",type:"button",editorEvents:{[zn]:({setState:c})=>{c({active:i.listBullet.isActive()})}},onClick:({setState:c})=>{i.listBullet.toggle(),c({active:i.listBullet.isActive()})}},listOrdered:{id:"listOrdered",icon:En.listOrdered,size:"s",type:"button",editorEvents:{[zn]:({setState:c})=>{c({active:i.listOrdered.isActive()})}},onClick:({setState:c})=>{i.listOrdered.toggle(),c({active:i.listOrdered.isActive()})}},heading:{id:"heading",type:"selectField",size:"s",value:"",emptyState:"Heading",options:[{id:"",label:"Normal"},{id:"1",label:"Heading 1"},{id:"2",label:"Heading 2"},{id:"3",label:"Heading 3"},{id:"4",label:"Heading 4"},{id:"5",label:"Heading 5"},{id:"6",label:"Heading 6"}],editorEvents:{[zn]:({setState:c})=>{c({value:i.heading.get()})}},onChange:({value:c,setState:u})=>{u({value:c}),i.heading.set({value:c}),o.focus()}},fontSize:{id:"fontSize",type:"selectField",size:"s",value:"",emptyState:"Font size",options:[{id:"8pt",label:"8pt"},{id:"10pt",label:"10pt"},{id:"12pt",label:"12pt"},{id:"14pt",label:"14pt"},{id:"18pt",label:"18pt"},{id:"24pt",label:"24pt"},{id:"36pt",label:"36pt"}],editorEvents:{[zn]:({setState:c})=>{c({value:i.fontSize.get()})}},onChange:({value:c,setState:u})=>{u({value:c}),i.fontSize.set({value:c}),o.focus()}}},l=[s.bold,s.italic,s.underline,s.strikethrough,s.image,s.link,s.listBullet,s.listOrdered,s.alignText,s.heading,s.fontSize];return((a=e.toolbar)==null?void 0:a.call(e,{...t,commands:i,layouts:s,proseMirror:{view:o},items:l}))||l};class xL{constructor(e,n,r){this.editor=r,this.node=e,this.dom=document.createElement("img"),this.view=n,Object.keys(e.attrs.attrs).forEach(o=>{this.dom.setAttribute(o,e.attrs.attrs[o])}),this.dom.addEventListener("dblclick",o=>this.handleDoubleClick(o))}handleDoubleClick(e){const{editor:n,view:r}=this;l2(r,n).image.open(),e.preventDefault()}update(e){return e.type!==this.node.type?!1:(this.node=e,Object.keys(e.attrs.attrs).forEach(n=>{this.dom.setAttribute(n,e.attrs.attrs[n])}),!0)}selectNode(){this.dom.style.outline="2px solid #ffca6f"}deselectNode(){this.dom.style.outline=""}}class No{constructor(e,n,r={}){this.match=e,this.match=e,this.handler=typeof n=="string"?wL(n):n,this.undoable=r.undoable!==!1,this.inCode=r.inCode||!1}}function wL(t){return function(e,n,r,o){let i=t;if(n[1]){let s=n[0].lastIndexOf(n[1]);i+=n[0].slice(s+n[1].length),r+=s;let l=r-o;l>0&&(i=n[0].slice(s-l,s)+i,r=o)}return e.tr.insertText(i,r,o)}}const SL=500;function CL({rules:t}){let e=new Bl({state:{init(){return null},apply(n,r){let o=n.getMeta(this);return o||(n.selectionSet||n.docChanged?null:r)}},props:{handleTextInput(n,r,o,i){return m0(n,r,o,i,t,e)},handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&m0(n,r.pos,r.pos,"",t,e)})}}},isInputRules:!0});return e}function m0(t,e,n,r,o,i){if(t.composing)return!1;let s=t.state,l=s.doc.resolve(e),a=l.parent.textBetween(Math.max(0,l.parentOffset-SL),l.parentOffset,null,"")+r;for(let c=0;c<o.length;c++){let u=o[c];if(l.parent.type.spec.code){if(!u.inCode)continue}else if(u.inCode==="only")continue;let d=u.match.exec(a),f=d&&u.handler(s,d,e-(d[0].length-r.length),n);if(f)return u.undoable&&f.setMeta(i,{transform:f,from:e,to:n,text:r}),t.dispatch(f),!0}return!1}const EL=new No(/--$/,"—"),OL=new No(/\.\.\.$/,"…"),_L=new No(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),kL=new No(/"$/,"”"),TL=new No(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),AL=new No(/'$/,"’"),ML=[_L,kL,TL,AL];function _h(t,e,n=null,r){return new No(t,(o,i,s,l)=>{let a=n instanceof Function?n(i):n,c=o.tr.delete(s,l),u=c.doc.resolve(s),d=u.blockRange(),f=d&&Wy(d,e,a);if(!f)return null;c.wrap(d,f);let p=c.doc.resolve(s-1).nodeBefore;return p&&p.type==e&&fu(c.doc,s-1)&&(!r||r(i,p))&&c.join(s-1),c})}function a2(t,e,n=null){return new No(t,(r,o,i,s)=>{let l=r.doc.resolve(i),a=n instanceof Function?n(o):n;return l.node(-1).canReplaceWith(l.index(-1),l.indexAfter(-1),e)?r.tr.delete(i,s).setBlockType(i,i,e,a):null})}function jL(t){return _h(/^\s*>\s$/,t)}function RL(t){return _h(/^(\d+)\.\s$/,t,e=>({order:+e[1]}),(e,n)=>n.childCount+n.attrs.order==+e[1])}function NL(t){return _h(/^\s*([-+*])\s$/,t)}function PL(t){return a2(/^```$/,t)}function DL(t,e){return a2(new RegExp("^(#{1,"+e+"})\\s$"),t,n=>({level:n[1].length}))}function LL(t){const e=ML.concat(OL,EL);let n;return(n=t.nodes.blockquote)&&e.push(jL(n)),(n=t.nodes.orderedList)&&e.push(RL(n)),(n=t.nodes.bulletList)&&e.push(NL(n)),(n=t.nodes.codeBlock)&&e.push(PL(n)),(n=t.nodes.heading)&&e.push(DL(n,6)),CL({rules:e})}const VL="rteProseMirror",IL=function(t,e={}){const n={plugins:s=>s.plugins,...e},r=(s,l)=>{var g,b;const a=((g=n.schema)==null?void 0:g.call(n,{editor:t,schema:p0}))||p0,{nodes:c,marks:u}=a,d=ah.fromSchema(a).parse(s),f=$i.create({doc:d,schema:a,plugins:(b=n.plugins)==null?void 0:b.call(n,{editor:t,plugins:[HD(),JD(),LL(a),SN(),kd({Tab:r0(1),"Shift-Tab":r0(-1)}),kd({Enter:xl(ix,MN(c.listItem),iL),"Shift-Enter":xl(ox,(v,y)=>(y&&y(v.tr.replaceSelectionWith(c.inlineBreak.create()).scrollIntoView()),!0)),"Mod-z":px,"Mod-y":Nf,"Mod-Shift-z":Nf,"Mod-b":zo(u.strong),"Mod-i":zo(u.em),"Shift-Tab":Pf(c.listItem),Tab:NN(c.listItem)}),kd(pN)]})}),p=new dD({mount:s},{state:f,dispatchTransaction(v){var x;const{state:y}=p,w=y.apply(v),S=!y.doc.eq(w.doc);p.updateState(w);const C=!y.selection.eq(w.selection);S&&(nL(((x=l==null?void 0:l.view)==null?void 0:x.el)||s),p.focus()),(C||S)&&t.trigger(zn)}});return s.__rteView=p,p.setProps({nodeViews:{image(v){return new xL(v,p,t)}}}),p},o=s=>yL(s,n);t.setCustomRte({toolbar:o,parseContent:!0,async enable(s,l,a){const c=Pd(s);if(c)return c;const u=r(s,a);return QD(s,u),pL(u,a),u},disable(s){const l=Pd(s);if(l)return eL(s,l),l.destroy(),{forceSync:!0}},getContent(s){const l=Pd(s);if(l){const{schema:a,doc:c}=l.state,u=document.createElement("div"),d=wi.fromSchema(a).serializeFragment(c.content);return d.childNodes.forEach(f=>{f.nodeType===Node.ELEMENT_NODE&&f.innerHTML===""&&(f.innerHTML="<br/>")}),u.appendChild(d),rL(u),s.classList.remove("ProseMirror-focused"),u.innerHTML}return s.innerHTML}});const i=oL(t,n);wr({editor:t,licenseKey:n.licenseKey,plan:Ht.free,pluginName:VL,cleanup:()=>{t.RichTextEditor.customRte=void 0,i()}})},$L=xr(IL),HL=t=>{const e={};for(const n of Object.keys(t)){let r=t[n];r&&(Array.isArray(r)?r=r.map(o=>o.toString()).join(","):r=r.toString(),e[n]=r)}return new URLSearchParams(e)},BL=t=>{const{apiKey:e,searchParams:n,thumbnailQuality:r="high"}=t,o=(l={})=>{const c="https://www.googleapis.com/youtube/v3/search",u=HL(l);return`${c}?${u}`},i=l=>{var a,c,u;return((a=l[r])==null?void 0:a.url)||((c=l.high)==null?void 0:c.url)||((u=l.medium)==null?void 0:u.url)||l.default.url},s=l=>{const a=i(l.snippet.thumbnails);return{id:l.id.videoId,src:`https://www.youtube.com/watch?v=${l.id.videoId}`,name:l.snippet.title,customData:{thumbnailUrl:a,videoItem:l}}};return{id:"youtube",types:["youtube-video"],label:"YouTube Videos",search:{reloadOnInput:!0,debounceMs:1e3},async onLoad({searchValue:l,pageCustomData:a}){var b;const c={maxResults:25,q:l,pageToken:a==null?void 0:a.token,type:["video"],key:e},u=n==null?void 0:n({searchValue:l}),d={...c,...u};d.part?d.part.includes("snippet")||d.part.push("snippet"):d.part=["snippet"];const p=await(await fetch(o(d))).json();return(b=p.items)!=null&&b.length?{items:p.items.map(s),nextPageCustomData:{token:p.nextPageToken},isLastPage:!p.nextPageToken}:{items:[],isLastPage:!0}},itemLayout:({assetProps:l,onSelect:a})=>({type:"column",onClick:()=>a(l),htmlAttrs:{title:l.name},style:{border:"1px solid gray",borderRadius:8,overflow:"hidden",cursor:"pointer"},children:[{type:"custom",render:()=>{var c;return`<img src="${(c=l.customData)==null?void 0:c.thumbnailUrl}" alt="${l.name}" style="width: 100%; height: 100px; object-fit: cover">`}},{type:"text",content:l.name,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",paddingLeft:8,paddingRight:8}}]})}},zL="youtubeAssetProvider",FL=function(t,e){const{skipVideoComponent:n}=e,r=BL(e);t.runCommand(vt.assetProviderAdd,{provider:r});const o="search-on-youtube",i="video";if(!n){const s=t.Components.getType(i).model.prototype;t.Components.addType(i,{model:{getYoutubeTraits(){const[l,...a]=s.getYoutubeTraits.apply(this);return[l,{id:o,type:"button",label:t.I18n.t("youtube.searchBtn"),command:()=>{t.AssetManager.open({select:c=>{t.Assets.close(),this.set({videoId:c.attributes.id})},content:{header:{addUrl:!1,upload:!1}}})}},...a]}}})}wr({editor:t,licenseKey:e.licenseKey,plan:Ht.startup,pluginName:zL,cleanup:()=>{if(t.runCommand(vt.assetProviderRemove,{id:r.id}),!n){const s=t.Components.getType(i).model.prototype;t.Components.addType(i,{model:{getYoutubeTraits(){return s.getYoutubeTraits.apply(this).filter(l=>l.id!==o)}}})}}})},WL=xr(FL);exports.dialogComponent=D2;exports.fsLightboxComponent=xj;exports.iconifyComponent=I4;exports.lightGalleryComponent=Mj;exports.listPagesComponent=mj;exports.rteProseMirror=$L;exports.rteTinyMce=eR;exports.swiperComponent=Uj;exports.tableComponent=cj;exports.youtubeAssetProvider=WL;
|