@strands.gg/accui 2.17.37 → 2.17.39

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.
@@ -1,7 +1,7 @@
1
1
  "use strict";const a=require("vue"),de=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},fd={class:"accui-component-scope"},hd={class:"alert-content"},pd={class:"alert-icon-container"},md={class:"alert-main-icon",fill:"currentColor",viewBox:"0 0 20 20","aria-hidden":"true"},gd=["d"],yd={class:"alert-text-container"},kd={key:0,class:"alert-dismiss-container"},bd=a.defineComponent({__name:"UiAlert",props:{variant:{default:"info"},title:{},message:{},dismissible:{type:Boolean,default:!1}},emits:["dismiss"],setup(n){const e=n,t=a.computed(()=>({success:"alert alert-success",error:"alert alert-error",warning:"alert alert-warning",info:"alert alert-info"})[e.variant]),r=a.computed(()=>"alert-title"),i=a.computed(()=>"alert-message"),o=a.computed(()=>({success:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",error:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",warning:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",info:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z"})[e.variant]);return(s,l)=>(a.openBlock(),a.createElementBlock("div",fd,[a.createElementVNode("div",{class:a.normalizeClass(t.value),role:"alert"},[a.createElementVNode("div",hd,[a.createElementVNode("div",pd,[(a.openBlock(),a.createElementBlock("svg",md,[a.createElementVNode("path",{"fill-rule":"evenodd",d:o.value,"clip-rule":"evenodd"},null,8,gd)]))]),a.createElementVNode("div",yd,[n.title?(a.openBlock(),a.createElementBlock("h3",{key:0,class:a.normalizeClass(r.value)},a.toDisplayString(n.title),3)):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(i.value)},[a.renderSlot(s.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(n.message),1)],!0)],2)]),n.dismissible?(a.openBlock(),a.createElementBlock("div",kd,[a.createElementVNode("button",{type:"button",class:"alert-dismiss-button",onClick:l[0]||(l[0]=c=>s.$emit("dismiss"))},[...l[1]||(l[1]=[a.createElementVNode("span",{class:"sr-only"},"Dismiss",-1),a.createElementVNode("svg",{class:"alert-dismiss-icon",fill:"currentColor",viewBox:"0 0 20 20"},[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)])])])):a.createCommentVNode("",!0)])],2)]))}}),co=de(bd,[["__scopeId","data-v-68f69cce"]]),vd=`<svg width="302" height="438" viewBox="0 0 302 438" fill="none" xmlns="http://www.w3.org/2000/svg">
2
2
  <path d="M71.5001 96C71.5001 96 132 106 137 61.5C142 17 117.5 3.50005 94.5001 1.50003C71.5001 -0.499996 16.0001 8.5 2.00014 72.5C-6.5 130.5 71.5003 227.5 165 218C258.5 208.5 280.758 148.5 283.5 121C286.242 93.5 277.5 61.5 238.5 61.5C153 61.5 150.501 185 170.5 235C190.5 285 199 279 213 314C227.001 349 217.296 411.458 183 427C129.456 450.65 92 426 78.5 407.5C65 389 68.0003 357 94.5001 344.5C121 332 212.41 393.5 301.5 361" stroke="black"/>
3
3
  </svg>
4
- `,xd={key:0,class:"loader-icon"},wd=["width","height"],Cd=["d"],Sd=["stroke-width"],Md=["stroke-width"],Td=["width","height"],Ed={key:3,class:"loader-text"},Nd=a.defineComponent({__name:"UiLoader",props:{size:{default:"md"},color:{default:"primary"},variant:{default:"circle"},text:{},centered:{type:Boolean,default:!0},weight:{default:30},fullWidth:{type:Boolean,default:!1}},setup(n){const t=vd.replace(/<svg[^>]*>/,"").replace(/<\/svg>/,"").trim().match(/d="([^"]*)"/)?.[1]||"",r=n,i={sm:32,md:48,lg:64,xl:80},o=a.computed(()=>typeof r.size=="number"?r.size:i[r.size]||i.md);return(s,l)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["loader-container",[{"loader-centered":n.centered},`loader-color-${n.color}`]])},[n.variant==="spinner"?(a.openBlock(),a.createElementBlock("div",xd,[(a.openBlock(),a.createElementBlock("svg",{width:o.value,height:o.value,viewBox:"0 0 500 500"},[a.createElementVNode("defs",null,[a.createElementVNode("path",{id:"logo-path",d:a.unref(t),transform:"translate(81, 13) scale(1.0)"},null,8,Cd)]),a.createElementVNode("use",{href:"#logo-path",fill:"none",stroke:"var(--loader-semi-color)","stroke-width":n.weight,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,Sd),a.createElementVNode("use",{href:"#logo-path",fill:"none",stroke:"var(--loader-solid-color)","stroke-width":n.weight,"stroke-linecap":"round","stroke-linejoin":"round",class:"loader-animated-path"},null,8,Md)],8,wd))])):n.variant==="circle"?(a.openBlock(),a.createElementBlock("div",{key:1,class:"loader-circle",style:a.normalizeStyle({width:`${o.value}px`,height:`${o.value}px`})},[(a.openBlock(),a.createElementBlock("svg",{width:o.value,height:o.value,viewBox:"0 0 50 50"},[...l[0]||(l[0]=[a.createElementVNode("circle",{cx:"25",cy:"25",r:"20",fill:"none",stroke:"var(--loader-solid-color)","stroke-width":"4","stroke-linecap":"round",class:"loader-circle-path"},null,-1)])],8,Td))],4)):n.variant==="bar"?(a.openBlock(),a.createElementBlock("div",{key:2,class:"loader-bar",style:a.normalizeStyle({width:n.fullWidth?"100%":`${o.value*1.5}px`,height:`${Math.max(o.value*.1,4)}px`})},[...l[1]||(l[1]=[a.createElementVNode("div",{class:"loader-bar-track"},[a.createElementVNode("div",{class:"loader-bar-fill"})],-1)])],4)):a.createCommentVNode("",!0),n.text?(a.openBlock(),a.createElementBlock("p",Ed,a.toDisplayString(n.text),1)):a.createCommentVNode("",!0)],2))}}),zr=de(Nd,[["__scopeId","data-v-4b565c5d"]]),Ad={key:0,class:"button-loading-content"},Bd={key:0},Od={key:0,class:"leading-icon"},Dd={class:"button-text-content"},Id={key:1,class:"trailing-icon"},$d=a.defineComponent({__name:"UiButton.Content",props:{loading:{type:Boolean,default:!1},loadingText:{},icon:{type:Boolean,default:!1},size:{},textAlign:{default:"center"}},setup(n){const e=a.useSlots(),t=a.computed(()=>!!e["leading-icon"]),r=a.computed(()=>!!e["trailing-icon"]),i=n,o=a.computed(()=>{switch(i.size){case"xs":return 16;case"sm":return 18;case"md":return 20;case"lg":return 24;case"xl":return 28;default:return 20}}),s=a.computed(()=>i.size?`button-content-${i.size}`:"button-content-md");return(l,c)=>n.loading?(a.openBlock(),a.createElementBlock("span",Ad,[a.createVNode(zr,{variant:"circle",size:o.value,centered:!1,color:"white"},null,8,["size"]),n.icon?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("span",Bd,a.toDisplayString(n.loadingText||"Loading..."),1))])):(a.openBlock(),a.createElementBlock("span",{key:1,class:a.normalizeClass(["button-content",s.value,`button-content-align-${n.textAlign}`])},[n.icon?a.renderSlot(l.$slots,"icon",{key:0},void 0,!0):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[t.value?(a.openBlock(),a.createElementBlock("span",Od,[a.renderSlot(l.$slots,"leading-icon",{},void 0,!0)])):a.createCommentVNode("",!0),a.renderSlot(l.$slots,"icon",{},void 0,!0),a.createElementVNode("span",Dd,[a.renderSlot(l.$slots,"default",{},void 0,!0)]),r.value?(a.openBlock(),a.createElementBlock("span",Id,[a.renderSlot(l.$slots,"trailing-icon",{},void 0,!0)])):a.createCommentVNode("",!0)],64))],2))}}),Wt=de($d,[["__scopeId","data-v-12d1d1fc"]]),Rd=["href","target","rel"],Oi=a.defineComponent({__name:"UiButton.Anchor",props:{to:{},href:{},external:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},loadingText:{},icon:{type:Boolean,default:!1},buttonClasses:{},buttonStyles:{},textAlign:{default:"center"}},emits:["click"],setup(n,{emit:e}){const t=n,r=e,i=a.computed(()=>{if(t.href)return t.href;if(t.to){if(typeof t.to=="string")return t.to;if(typeof t.to=="object"&&t.to)return"#route-object-not-supported"}return"#"}),o=s=>{if(t.disabled||t.loading){s.preventDefault();return}r("click",s)};return(s,l)=>(a.openBlock(),a.createElementBlock("a",{href:i.value,target:n.external?"_blank":void 0,rel:n.external?"noopener noreferrer":void 0,class:a.normalizeClass(n.buttonClasses),style:a.normalizeStyle(n.buttonStyles),onClick:o},[a.createVNode(Wt,{loading:n.loading,"loading-text":n.loadingText,icon:n.icon,"text-align":n.textAlign},{"leading-icon":a.withCtx(()=>[a.renderSlot(s.$slots,"leading-icon")]),icon:a.withCtx(()=>[a.renderSlot(s.$slots,"icon")]),default:a.withCtx(()=>[a.renderSlot(s.$slots,"default")]),"trailing-icon":a.withCtx(()=>[a.renderSlot(s.$slots,"trailing-icon")]),_:3},8,["loading","loading-text","icon","text-align"])],14,Rd))}}),Di=a.defineComponent({__name:"UiButton.Nuxt",props:{to:{},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},loadingText:{},icon:{type:Boolean,default:!1},buttonClasses:{},buttonStyles:{},textAlign:{default:"center"}},emits:["click"],setup(n,{emit:e}){const t=a.getCurrentInstance(),r=a.computed(()=>t?.appContext.app.component("NuxtLink")?"NuxtLink":t?.appContext.app.component("RouterLink")?"RouterLink":"a"),i=n,o=e,s=l=>{if(i.disabled||i.loading){l.preventDefault();return}o("click",l)};return(l,c)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(r.value),{to:r.value!=="a"?n.to:void 0,href:r.value==="a"?typeof n.to=="string"?n.to:"/":void 0,class:a.normalizeClass(n.buttonClasses),style:a.normalizeStyle(n.buttonStyles),onClick:s},{default:a.withCtx(()=>[a.createVNode(Wt,{loading:n.loading,"loading-text":n.loadingText,icon:n.icon,"text-align":n.textAlign},{"leading-icon":a.withCtx(()=>[a.renderSlot(l.$slots,"leading-icon")]),icon:a.withCtx(()=>[a.renderSlot(l.$slots,"icon")]),default:a.withCtx(()=>[a.renderSlot(l.$slots,"default")]),"trailing-icon":a.withCtx(()=>[a.renderSlot(l.$slots,"trailing-icon")]),_:3},8,["loading","loading-text","icon","text-align"])]),_:3},8,["to","href","class","style"]))}}),Ii=a.defineComponent({__name:"UiButton.Vue",props:{to:{},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},loadingText:{},icon:{type:Boolean,default:!1},buttonClasses:{},buttonStyles:{},textAlign:{default:"center"}},emits:["click"],setup(n,{emit:e}){const t=n,r=e,i=o=>{if(t.disabled||t.loading){o.preventDefault();return}r("click",o)};return(o,s)=>{const l=a.resolveComponent("router-link");return a.openBlock(),a.createBlock(l,{to:n.to,class:a.normalizeClass(n.buttonClasses),style:a.normalizeStyle(n.buttonStyles),onClick:i},{default:a.withCtx(()=>[a.createVNode(Wt,{loading:n.loading,"loading-text":n.loadingText,icon:n.icon,"text-align":n.textAlign},{"leading-icon":a.withCtx(()=>[a.renderSlot(o.$slots,"leading-icon")]),icon:a.withCtx(()=>[a.renderSlot(o.$slots,"icon")]),default:a.withCtx(()=>[a.renderSlot(o.$slots,"default")]),"trailing-icon":a.withCtx(()=>[a.renderSlot(o.$slots,"trailing-icon")]),_:3},8,["loading","loading-text","icon","text-align"])]),_:3},8,["to","class","style"])}}}),Ld={class:"ui-tooltip-content"},zd=a.defineComponent({inheritAttrs:!1,__name:"UiTooltip",props:{content:{default:""},position:{default:"top"},delay:{default:500},disabled:{type:Boolean,default:!1},offset:{default:8},maxWidth:{default:250}},setup(n){const e=n,t=a.ref(),r=a.ref(),i=a.ref(!1),o=a.ref(!1);let s=null,l=null;const c=a.ref({}),d=async()=>{if(!t.value||!r.value||!o.value)return;await a.nextTick();const h=t.value.getBoundingClientRect();r.value.style.visibility="hidden",r.value.style.opacity="1";const p=r.value.getBoundingClientRect(),m=p.width,g=p.height;r.value.style.visibility="",r.value.style.opacity="";const y=window.innerWidth,k=window.innerHeight;let S=0,x=0;switch(e.position){case"top":S=h.top-g-e.offset,x=h.left+h.width/2-m/2;break;case"bottom":S=h.bottom+e.offset,x=h.left+h.width/2-m/2;break;case"left":S=h.top+h.height/2-g/2,x=h.left-m-e.offset;break;case"right":S=h.top+h.height/2-g/2,x=h.right+e.offset;break}const b=8;x<b?x=b:x+m>y-b&&(x=y-m-b),S<b?S=b:S+g>k-b&&(S=k-g-b),c.value={position:"fixed",top:`${S}px`,left:`${x}px`,zIndex:"9999"}},u=()=>{e.disabled||(l&&(clearTimeout(l),l=null),o.value=!0,a.nextTick(()=>{d()}),s=setTimeout(()=>{i.value=!0},e.delay))},f=()=>{s&&(clearTimeout(s),s=null),l=setTimeout(()=>{i.value=!1,setTimeout(()=>{o.value=!1},200)},100)};return a.onUnmounted(()=>{s&&clearTimeout(s),l&&clearTimeout(l)}),(h,p)=>(a.openBlock(),a.createElementBlock("div",a.mergeProps({ref_key:"tooltipContainer",ref:t,class:"ui-tooltip-container"},h.$attrs,{onMouseenter:u,onMouseleave:f}),[a.renderSlot(h.$slots,"default",{},void 0,!0),(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[o.value?(a.openBlock(),a.createElementBlock("div",{key:0,ref_key:"tooltipRef",ref:r,class:a.normalizeClass(["ui-tooltip",[`ui-tooltip--${n.position}`,{"ui-tooltip--visible":i.value}]]),style:a.normalizeStyle(c.value),role:"tooltip"},[a.createElementVNode("div",Ld,[a.renderSlot(h.$slots,"tooltip",{},()=>[a.createTextVNode(a.toDisplayString(n.content),1)],!0)]),a.createElementVNode("div",{class:a.normalizeClass(["ui-tooltip-arrow",`ui-tooltip-arrow--${n.position}`])},null,2)],6)):a.createCommentVNode("",!0)]))],16))}}),Tl=de(zd,[["__scopeId","data-v-ba66edda"]]),Pd=["type","disabled","tabindex"],Vd=["type","disabled","tabindex"],Fd=a.defineComponent({inheritAttrs:!1,__name:"UiButton",props:{variant:{default:"primary"},size:{default:"md"},type:{default:"button"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},loadingText:{},fullWidth:{type:Boolean,default:!1},color:{default:"primary"},fontWeight:{default:600},icon:{type:Boolean,default:!1},squircle:{type:Boolean,default:!1},to:{},href:{},external:{type:Boolean,default:!1},tabindex:{},title:{},textAlign:{default:"center"}},emits:["click"],setup(n,{emit:e}){const t=n,r=a.computed(()=>t.title?typeof t.title=="string"?{content:t.title,position:"top",disabled:t.disabled||t.loading}:{...t.title,disabled:t.title.disabled??(t.disabled||t.loading)}:null),i=a.computed(()=>!!(typeof process<"u"&&process.client!==void 0||typeof window<"u"&&(window.__NUXT__||window.$nuxt))),o=a.computed(()=>{try{if(typeof window<"u"&&window.Vue?.Router)return!0}catch{}return!1}),s=a.computed(()=>["ui-button",`ui-button-${t.variant}`,`ui-button-${t.size}`,`ui-button-color-${t.color}`,t.loading?"ui-button-loading":"",t.disabled?"ui-button-disabled":"",t.fullWidth?"ui-button-full-width":"",t.icon?"ui-button-icon":"",t.squircle?"ui-button-squircle":""].filter(Boolean)),l=a.computed(()=>s.value.join(" ")),c=a.computed(()=>({fontWeight:t.fontWeight})),d=a.computed(()=>t.disabled||t.loading?-1:t.tabindex??void 0);return(u,f)=>n.title?(a.openBlock(),a.createBlock(Tl,a.normalizeProps(a.mergeProps({key:0},r.value)),{default:a.withCtx(()=>[n.to?i.value&&n.to?(a.openBlock(),a.createBlock(Di,{key:1,to:n.to,disabled:n.disabled,loading:n.loading,"loading-text":n.loadingText,icon:n.icon,"button-classes":s.value,"button-styles":c.value,tabindex:d.value,"text-align":n.textAlign,onClick:f[1]||(f[1]=h=>u.$emit("click",h))},a.createSlots({icon:a.withCtx(()=>[a.renderSlot(u.$slots,"icon",{},void 0,!0)]),default:a.withCtx(()=>[a.renderSlot(u.$slots,"default",{},void 0,!0)]),_:2},[u.$slots["leading-icon"]?{name:"leading-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"leading-icon",{},void 0,!0)]),key:"0"}:void 0,u.$slots["trailing-icon"]?{name:"trailing-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"trailing-icon",{},void 0,!0)]),key:"1"}:void 0]),1032,["to","disabled","loading","loading-text","icon","button-classes","button-styles","tabindex","text-align"])):o.value&&n.to?(a.openBlock(),a.createBlock(Ii,{key:2,to:n.to,disabled:n.disabled,loading:n.loading,"loading-text":n.loadingText,icon:n.icon,"button-classes":s.value,"button-styles":c.value,tabindex:d.value,"text-align":n.textAlign,onClick:f[2]||(f[2]=h=>u.$emit("click",h))},a.createSlots({icon:a.withCtx(()=>[a.renderSlot(u.$slots,"icon",{},void 0,!0)]),default:a.withCtx(()=>[a.renderSlot(u.$slots,"default",{},void 0,!0)]),_:2},[u.$slots["leading-icon"]?{name:"leading-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"leading-icon",{},void 0,!0)]),key:"0"}:void 0,u.$slots["trailing-icon"]?{name:"trailing-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"trailing-icon",{},void 0,!0)]),key:"1"}:void 0]),1032,["to","disabled","loading","loading-text","icon","button-classes","button-styles","tabindex","text-align"])):(a.openBlock(),a.createBlock(Oi,{key:3,to:n.to,href:n.href,external:n.external,disabled:n.disabled,loading:n.loading,"loading-text":n.loadingText,icon:n.icon,"button-classes":s.value,"button-styles":c.value,tabindex:d.value,"text-align":n.textAlign,onClick:f[3]||(f[3]=h=>u.$emit("click",h))},a.createSlots({icon:a.withCtx(()=>[a.renderSlot(u.$slots,"icon",{},void 0,!0)]),default:a.withCtx(()=>[a.renderSlot(u.$slots,"default",{},void 0,!0)]),_:2},[u.$slots["leading-icon"]?{name:"leading-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"leading-icon",{},void 0,!0)]),key:"0"}:void 0,u.$slots["trailing-icon"]?{name:"trailing-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"trailing-icon",{},void 0,!0)]),key:"1"}:void 0]),1032,["to","href","external","disabled","loading","loading-text","icon","button-classes","button-styles","tabindex","text-align"])):(a.openBlock(),a.createElementBlock("button",a.mergeProps({key:0},u.$attrs,{type:n.type,disabled:n.disabled||n.loading,class:l.value,style:c.value,tabindex:d.value,onClick:f[0]||(f[0]=h=>u.$emit("click",h))}),[a.createVNode(Wt,{loading:n.loading,"loading-text":n.loadingText,icon:n.icon,size:n.size,"text-align":n.textAlign},a.createSlots({icon:a.withCtx(()=>[a.renderSlot(u.$slots,"icon",{},void 0,!0)]),default:a.withCtx(()=>[a.renderSlot(u.$slots,"default",{},void 0,!0)]),_:2},[u.$slots["leading-icon"]?{name:"leading-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"leading-icon",{},void 0,!0)]),key:"0"}:void 0,u.$slots["trailing-icon"]?{name:"trailing-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"trailing-icon",{},void 0,!0)]),key:"1"}:void 0]),1032,["loading","loading-text","icon","size","text-align"])],16,Pd))]),_:3},16)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[n.to?i.value&&n.to?(a.openBlock(),a.createBlock(Di,{key:1,to:n.to,disabled:n.disabled,loading:n.loading,"loading-text":n.loadingText,icon:n.icon,"button-classes":s.value,"button-styles":c.value,tabindex:d.value,"text-align":n.textAlign,onClick:f[5]||(f[5]=h=>u.$emit("click",h))},a.createSlots({icon:a.withCtx(()=>[a.renderSlot(u.$slots,"icon",{},void 0,!0)]),default:a.withCtx(()=>[a.renderSlot(u.$slots,"default",{},void 0,!0)]),_:2},[u.$slots["leading-icon"]?{name:"leading-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"leading-icon",{},void 0,!0)]),key:"0"}:void 0,u.$slots["trailing-icon"]?{name:"trailing-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"trailing-icon",{},void 0,!0)]),key:"1"}:void 0]),1032,["to","disabled","loading","loading-text","icon","button-classes","button-styles","tabindex","text-align"])):o.value&&n.to?(a.openBlock(),a.createBlock(Ii,{key:2,to:n.to,disabled:n.disabled,loading:n.loading,"loading-text":n.loadingText,icon:n.icon,"button-classes":s.value,"button-styles":c.value,tabindex:d.value,"text-align":n.textAlign,onClick:f[6]||(f[6]=h=>u.$emit("click",h))},a.createSlots({icon:a.withCtx(()=>[a.renderSlot(u.$slots,"icon",{},void 0,!0)]),default:a.withCtx(()=>[a.renderSlot(u.$slots,"default",{},void 0,!0)]),_:2},[u.$slots["leading-icon"]?{name:"leading-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"leading-icon",{},void 0,!0)]),key:"0"}:void 0,u.$slots["trailing-icon"]?{name:"trailing-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"trailing-icon",{},void 0,!0)]),key:"1"}:void 0]),1032,["to","disabled","loading","loading-text","icon","button-classes","button-styles","tabindex","text-align"])):(a.openBlock(),a.createBlock(Oi,{key:3,to:n.to,href:n.href,external:n.external,disabled:n.disabled,loading:n.loading,"loading-text":n.loadingText,icon:n.icon,"button-classes":s.value,"button-styles":c.value,tabindex:d.value,"text-align":n.textAlign,onClick:f[7]||(f[7]=h=>u.$emit("click",h))},a.createSlots({icon:a.withCtx(()=>[a.renderSlot(u.$slots,"icon",{},void 0,!0)]),default:a.withCtx(()=>[a.renderSlot(u.$slots,"default",{},void 0,!0)]),_:2},[u.$slots["leading-icon"]?{name:"leading-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"leading-icon",{},void 0,!0)]),key:"0"}:void 0,u.$slots["trailing-icon"]?{name:"trailing-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"trailing-icon",{},void 0,!0)]),key:"1"}:void 0]),1032,["to","href","external","disabled","loading","loading-text","icon","button-classes","button-styles","tabindex","text-align"])):(a.openBlock(),a.createElementBlock("button",a.mergeProps({key:0},u.$attrs,{type:n.type,disabled:n.disabled||n.loading,class:l.value,style:c.value,tabindex:d.value,onClick:f[4]||(f[4]=h=>u.$emit("click",h))}),[a.createVNode(Wt,{loading:n.loading,"loading-text":n.loadingText,icon:n.icon,size:n.size,"text-align":n.textAlign},a.createSlots({icon:a.withCtx(()=>[a.renderSlot(u.$slots,"icon",{},void 0,!0)]),default:a.withCtx(()=>[a.renderSlot(u.$slots,"default",{},void 0,!0)]),_:2},[u.$slots["leading-icon"]?{name:"leading-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"leading-icon",{},void 0,!0)]),key:"0"}:void 0,u.$slots["trailing-icon"]?{name:"trailing-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"trailing-icon",{},void 0,!0)]),key:"1"}:void 0]),1032,["loading","loading-text","icon","size","text-align"])],16,Vd))],64))}}),W=de(Fd,[["__scopeId","data-v-0e5b129a"]]),Hd={key:0,class:"ui-card-header"},jd={key:0,class:"ui-card-title-wrapper"},Ud={key:0,class:"ui-card-title"},qd={key:0,class:"ui-card-subtitle"},Wd={key:1,class:"ui-card-content"},Kd={key:2,class:"ui-card-footer"},Jd=a.defineComponent({inheritAttrs:!1,__name:"UiCard",props:{variant:{default:"default"},padding:{default:"md"},shadow:{default:"sm"},color:{default:"default"},title:{},subtitle:{}},setup(n){const e=a.useAttrs();return(t,r)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["ui-card",[`ui-card-${n.variant}`,`ui-card-padding-${n.padding}`,`ui-card-shadow-${n.shadow}`,`ui-card-color-${n.color}`,a.unref(e).class]])},[t.$slots.header||n.title||n.subtitle||t.$slots["leading-icon"]||t.$slots["trailing-icon"]?(a.openBlock(),a.createElementBlock("div",Hd,[a.renderSlot(t.$slots,"header",{},()=>[a.renderSlot(t.$slots,"leading-icon",{},void 0,!0),n.title||t.$slots.title||n.subtitle||t.$slots.subtitle?(a.openBlock(),a.createElementBlock("div",jd,[n.title||t.$slots.title?a.renderSlot(t.$slots,"title",{key:0},()=>[n.title?(a.openBlock(),a.createElementBlock("h2",Ud,a.toDisplayString(n.title),1)):a.createCommentVNode("",!0)],!0):a.createCommentVNode("",!0),n.subtitle||t.$slots.subtitle?a.renderSlot(t.$slots,"subtitle",{key:1},()=>[n.subtitle?(a.openBlock(),a.createElementBlock("p",qd,a.toDisplayString(n.subtitle),1)):a.createCommentVNode("",!0)],!0):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),a.renderSlot(t.$slots,"trailing-icon",{},void 0,!0),a.renderSlot(t.$slots,"actions",{},void 0,!0)],!0)])):a.createCommentVNode("",!0),t.$slots.default?(a.openBlock(),a.createElementBlock("div",Wd,[a.renderSlot(t.$slots,"default",{},void 0,!0)])):a.createCommentVNode("",!0),t.$slots.footer?(a.openBlock(),a.createElementBlock("div",Kd,[a.renderSlot(t.$slots,"footer",{},void 0,!0)])):a.createCommentVNode("",!0)],2))}}),uo=de(Jd,[["__scopeId","data-v-fc43a75a"]]);const es=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Gd=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase()),Yd=n=>{const e=Gd(n);return e.charAt(0).toUpperCase()+e.slice(1)},Qd=(...n)=>n.filter((e,t,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===t).join(" ").trim(),ts=n=>n==="";var en={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const Xd=({name:n,iconNode:e,absoluteStrokeWidth:t,"absolute-stroke-width":r,strokeWidth:i,"stroke-width":o,size:s=en.width,color:l=en.stroke,...c},{slots:d})=>a.h("svg",{...en,...c,width:s,height:s,stroke:l,"stroke-width":ts(t)||ts(r)||t===!0||r===!0?Number(i||o||en["stroke-width"])*24/Number(s):i||o||en["stroke-width"],class:Qd("lucide",c.class,...n?[`lucide-${es(Yd(n))}-icon`,`lucide-${es(n)}`]:["lucide-icon"])},[...e.map(u=>a.h(...u)),...d.default?[d.default()]:[]]);const J=(n,e)=>(t,{slots:r,attrs:i})=>a.h(Xd,{...i,...t,iconNode:e,name:n},r);const Zd=J("align-center",[["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 18H5",key:"18s9l3"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);const _d=J("align-left",[["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 18H3",key:"1amg6g"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);const eu=J("align-right",[["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 18H7",key:"1ygte8"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);const tu=J("bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);const nu=J("calendar-clock",[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]);const ru=J("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);const iu=J("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Pr=J("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const ou=J("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);const su=J("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const lu=J("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const au=J("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);const cu=J("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);const du=J("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const uu=J("file-input",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 15h10",key:"jfw4w8"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);const fu=J("heading-1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]);const hu=J("heading-2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]);const pu=J("heading-3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]);const mu=J("italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);const gu=J("list-ordered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);const yu=J("list",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);const El=J("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const ku=J("quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);const bu=J("redo",[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]]);const vu=J("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);const xu=J("strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]);const wu=J("underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);const Cu=J("undo",[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]]);const fo=J("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Su={key:0,class:"input-leading-icon"},Mu=["id","type","value","placeholder","disabled","readonly","required","min","max","step","autocomplete","spellcheck","tabindex"],Tu={key:1,class:"input-trailing-icon"},Eu={key:2,class:"input-trailing-icon"},Nu={key:3,class:"input-trailing-icon"},Au=a.defineComponent({__name:"UiInput.Text",props:{type:{default:"text"},min:{},max:{},step:{},autocomplete:{},spellcheck:{type:Boolean,default:!0},hasLeadingIcon:{type:Boolean,default:!1},hasTrailingIcon:{type:Boolean,default:!1},label:{},helpText:{},modelValue:{},value:{},placeholder:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},fullWidth:{type:Boolean},inputId:{},error:{type:[Boolean,String,Error],default:!1},size:{default:"md"},tabindex:{}},emits:["update:modelValue","blur","focus","keydown"],setup(n,{emit:e}){const t=n,r=e,i=a.ref(!1),o=a.computed(()=>t.type==="password"?i.value?"text":"password":t.type),s=a.computed(()=>t.hasTrailingIcon||t.type==="password"||t.type==="search"&&t.modelValue),l=a.computed(()=>{if(t.tabindex!==void 0)return t.tabindex+1}),c=a.computed(()=>{const y=[];return t.error&&y.push("input-error"),t.disabled&&y.push("input-disabled"),t.readonly&&y.push("input-readonly"),y.push(`input-size-${t.size}`),y}),d=a.computed(()=>{const y=[];return t.hasLeadingIcon?y.push("input-padding-left-icon"):y.push("input-padding-left"),s.value?y.push("input-padding-right-icon"):y.push("input-padding-right"),y}),u=y=>{let S=y.target.value;t.type==="number"&&S!==""&&(S=parseFloat(S)||0),r("update:modelValue",S)},f=y=>{r("blur",y)},h=y=>{r("focus",y)},p=y=>{r("keydown",y)},m=()=>{i.value=!i.value},g=()=>{r("update:modelValue","")};return(y,k)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["input-field-wrapper",c.value])},[a.renderSlot(y.$slots,"leading",{},void 0,!0),t.hasLeadingIcon?(a.openBlock(),a.createElementBlock("div",Su,[a.renderSlot(y.$slots,"leading-icon",{},void 0,!0)])):a.createCommentVNode("",!0),a.createElementVNode("input",{id:n.inputId,type:o.value,value:n.modelValue,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,required:n.required,min:n.min,max:n.max,step:n.step,autocomplete:n.autocomplete,spellcheck:n.spellcheck,tabindex:n.tabindex,class:a.normalizeClass(["input-base",d.value]),onInput:u,onBlur:f,onFocus:h,onKeydown:p},null,42,Mu),n.type==="password"?(a.openBlock(),a.createElementBlock("div",Tu,[a.createVNode(W,{color:i.value?"primary":"secondary",variant:i.value?"primary":"ghost",size:"sm",icon:"",squircle:"",tabindex:l.value,"aria-label":i.value?"Hide password":"Show password",onClick:m},{icon:a.withCtx(()=>[i.value?(a.openBlock(),a.createBlock(a.unref(cu),{key:0})):(a.openBlock(),a.createBlock(a.unref(du),{key:1}))]),_:1},8,["color","variant","tabindex","aria-label"])])):n.type==="search"&&n.modelValue&&!n.disabled&&!n.readonly?(a.openBlock(),a.createElementBlock("div",Eu,[a.createVNode(W,{color:"danger",variant:"ghost",size:"sm",icon:"",squircle:"",tabindex:l.value,"aria-label":"Clear search",onClick:g},{icon:a.withCtx(()=>[a.createVNode(a.unref(fo))]),_:1},8,["tabindex"])])):t.hasTrailingIcon?(a.openBlock(),a.createElementBlock("div",Nu,[a.renderSlot(y.$slots,"trailing-icon",{},void 0,!0)])):a.createCommentVNode("",!0),a.renderSlot(y.$slots,"trailing",{},void 0,!0)],2))}}),Bu=de(Au,[["__scopeId","data-v-4807b700"]]),Ou={key:0,class:"input-leading-icon"},Du=["id","value","placeholder","disabled","readonly","required","rows","cols","maxlength","autocomplete","spellcheck"],Iu={key:1,class:"input-trailing-icon"},$u=a.defineComponent({__name:"UiInput.Textarea",props:{rows:{default:3},cols:{},maxlength:{},autocomplete:{},spellcheck:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},hasLeadingIcon:{type:Boolean,default:!1},hasTrailingIcon:{type:Boolean,default:!1},label:{},helpText:{},modelValue:{},value:{},placeholder:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},fullWidth:{type:Boolean},inputId:{},error:{type:[Boolean,String,Error],default:!1},size:{default:"md"},tabindex:{}},emits:["update:modelValue","blur","focus","keydown"],setup(n,{emit:e}){const t=n,r=e,i=a.useSlots(),o=a.computed(()=>!!i.default),s=a.ref(null);a.onMounted(()=>{(t.modelValue===void 0||t.modelValue==="")&&o.value&&setTimeout(()=>{if(s.value){const p=s.value.textContent?.trim()||"";p&&r("update:modelValue",p)}},0)});const l=a.computed(()=>{const p=[];return t.error&&p.push("input-error"),t.disabled&&p.push("input-disabled"),t.readonly&&p.push("input-readonly"),p.push(`input-size-${t.size}`),p}),c=a.computed(()=>{const p=[];return t.hasLeadingIcon?p.push("input-padding-left-icon"):p.push("input-padding-left"),t.hasTrailingIcon?p.push("input-padding-right-icon"):p.push("input-padding-right"),p}),d=p=>{const m=p.target;r("update:modelValue",m.value)},u=p=>{r("blur",p)},f=p=>{r("focus",p)},h=p=>{r("keydown",p)};return(p,m)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["input-field-wrapper input-textarea",l.value])},[a.renderSlot(p.$slots,"leading",{},void 0,!0),t.hasLeadingIcon?(a.openBlock(),a.createElementBlock("div",Ou,[a.renderSlot(p.$slots,"leading-icon",{},void 0,!0)])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["textarea-wrapper",{"textarea-resizable":n.resizable}])},[a.createElementVNode("textarea",{id:n.inputId,value:n.modelValue,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,required:n.required,rows:n.rows,cols:n.cols,maxlength:n.maxlength,autocomplete:n.autocomplete,spellcheck:n.spellcheck,class:a.normalizeClass(["input-base",[{"input-textarea-resize":n.resizable},c.value]]),onInput:d,onBlur:u,onFocus:f,onKeydown:h},null,42,Du)],2),t.hasTrailingIcon?(a.openBlock(),a.createElementBlock("div",Iu,[a.renderSlot(p.$slots,"trailing-icon",{},void 0,!0)])):a.createCommentVNode("",!0),a.renderSlot(p.$slots,"trailing",{},void 0,!0),o.value?(a.openBlock(),a.createElementBlock("span",{key:2,ref_key:"slotContentRef",ref:s,class:"sr-only","aria-hidden":"true"},[a.renderSlot(p.$slots,"default",{},void 0,!0)],512)):a.createCommentVNode("",!0)],2))}}),Ru=de($u,[["__scopeId","data-v-5728c58e"]]);function Vr(n){const{trigger:e,floating:t,placement:r="bottom-start",offset:i=8,flip:o=!0,shift:s=!0,sameWidth:l=!1,autoUpdate:c=!1,clickOutside:d}=n,u=a.ref({position:"fixed",top:"0px",left:"0px",zIndex:"9999"}),f=async()=>{if(await a.nextTick(),!e.value||!t.value||typeof e.value.getBoundingClientRect!="function"||typeof t.value.getBoundingClientRect!="function")return;const x=e.value.getBoundingClientRect(),b=t.value.getBoundingClientRect(),[v,C="start"]=r.split("-");let w=0,M=0;switch(v){case"bottom":w=x.left,M=x.bottom+i;break;case"top":w=x.left,M=x.top-b.height-i;break;case"right":w=x.right+i,M=x.top;break;case"left":w=x.left-b.width-i,M=x.top;break}if(v==="top"||v==="bottom")switch(C){case"center":w=x.left+(x.width-b.width)/2;break;case"end":w=x.right-b.width;break}else if(v==="left"||v==="right")switch(C){case"center":M=x.top+(x.height-b.height)/2;break;case"end":M=x.bottom-b.height;break}let A=l?x.width:void 0;const $=window.innerWidth,U=window.innerHeight,j=8;let K=!1,N=!1;if(o){if(v==="bottom"&&M+b.height>U-j){const R=x.top-b.height-i;R>=j&&(M=R,K=!0)}else if(v==="top"&&M<j){const R=x.bottom+i;R+b.height<=U-j&&(M=R,K=!1)}if(v==="right"&&w+b.width>$-j){const R=x.left-b.width-i;R>=j&&(w=R,N=!0)}else if(v==="left"&&w<j){const R=x.right+i;R+b.width<=$-j&&(w=R,N=!1)}}s&&(w<j?w=j:w+b.width>$-j&&(w=$-b.width-j),M<j?M=j:M+b.height>U-j&&(M=U-b.height-j));const D={position:"fixed",zIndex:"9999",...A?{width:`${A}px`}:{}};K?D.bottom=`${U-M-b.height}px`:D.top=`${M}px`,N?D.right=`${$-w-b.width}px`:D.left=`${w}px`,u.value=D},h=()=>{f()};let p=null;const m=()=>{h()},g=()=>{if(h(),d?.enabled&&d.handler&&e.value){if(typeof e.value.getBoundingClientRect!="function")return;const x=e.value.getBoundingClientRect(),b=window.innerHeight,v=window.innerWidth;(x.bottom<0||x.top>b||x.right<0||x.left>v)&&d.handler()}},y=x=>{if(!d?.enabled||!d.handler)return;const b=x.target;if(!b||!e.value||!t.value||typeof e.value.contains!="function"||typeof t.value.contains!="function")return;const v=e.value.contains(b),C=t.value.contains(b);!v&&!C&&d.handler()},k=()=>{c&&(window.addEventListener("resize",m),window.addEventListener("scroll",g,!0),typeof ResizeObserver<"u"&&(p=new ResizeObserver(()=>{h()}),a.nextTick(()=>{e.value&&p&&typeof e.value.getBoundingClientRect=="function"&&p.observe(e.value),t.value&&p&&typeof t.value.getBoundingClientRect=="function"&&p.observe(t.value)}))),d?.enabled&&document.addEventListener("click",y,!0)},S=()=>{c&&(window.removeEventListener("resize",m),window.removeEventListener("scroll",g,!0)),d?.enabled&&document.removeEventListener("click",y,!0),p&&(p.disconnect(),p=null)};return a.onMounted(()=>{k()}),a.onUnmounted(()=>{S()}),{floatingStyle:u,updatePosition:h,cleanup:S}}const Lu={key:0,class:"input-leading-icon"},zu=["tabindex","aria-expanded","aria-controls","aria-disabled"],Pu={class:"input-select-value"},Vu={key:0,class:"input-select-text"},Fu={key:1,class:"input-select-placeholder"},Hu={key:1,class:"input-trailing-icon"},ju=["id","aria-multiselectable"],Uu={key:0,class:"input-dropdown-search"},qu={key:0,class:"input-dropdown-no-options"},Wu=["onClick","onMouseenter","aria-selected"],Ku={class:"input-dropdown-option-content"},Ju={class:"input-dropdown-option-text"},Gu={key:0,class:"input-dropdown-option-description"},Yu={key:0,class:"input-dropdown-option-check"},Qu=a.defineComponent({__name:"UiInput.Select",props:{options:{default:()=>[]},multiple:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},allowInsert:{type:Boolean,default:!1},maxDropdownHeight:{default:400},noOptionsText:{default:"No options available"},searchPlaceholder:{default:""},hasLeadingIcon:{type:Boolean,default:!1},hasTrailingIcon:{type:Boolean,default:!1},label:{},helpText:{},modelValue:{},value:{},placeholder:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean},required:{type:Boolean},fullWidth:{type:Boolean},inputId:{},error:{type:[Boolean,String,Error],default:!1},size:{default:"md"},tabindex:{}},emits:["update:modelValue","blur","focus"],setup(n,{emit:e}){const t=n,r=e,i=a.ref(),o=a.ref(),s=a.ref(),l=a.computed(()=>`dropdown-${t.inputId||Math.random().toString(36).substr(2,9)}`),c=a.computed(()=>{if(i.value){const N=i.value.closest('[role="dialog"][aria-modal="true"]');if(N)return N}return"body"}),d=a.ref({isOpen:!1,searchQuery:"",highlightedIndex:-1}),{floatingStyle:u,updatePosition:f,cleanup:h}=Vr({trigger:i,floating:o,placement:"bottom-start",offset:10,shift:!0,flip:!0,sameWidth:!0,autoUpdate:!0,clickOutside:{enabled:!0,handler:()=>{C()}}}),p=a.computed(()=>t.multiple?Array.isArray(t.modelValue)?t.modelValue:[]:t.modelValue!==void 0?[t.modelValue]:[]),m=a.computed(()=>{if(t.multiple){const N=t.options.filter(D=>p.value.includes(D.value));return N.length>0?`${N.length} selected`:null}else return t.options.find(D=>D.value===t.modelValue)?.label||null}),g=a.computed(()=>{let N=t.options;if(t.searchable&&d.value.searchQuery){const D=d.value.searchQuery.toLowerCase();N=t.options.filter(R=>R.label.toLowerCase().includes(D)||R.description?.toLowerCase().includes(D)),t.allowInsert&&t.multiple&&d.value.searchQuery.trim()&&(t.options.some(ke=>ke.label.toLowerCase()===d.value.searchQuery.toLowerCase())||(N=[{value:`__insert__${d.value.searchQuery}`,label:`Add "${d.value.searchQuery}"`,description:"Add as new item",disabled:!1},...N]))}return N}),y=a.computed(()=>t.searchPlaceholder&&t.searchPlaceholder.trim()!==""?t.searchPlaceholder:t.allowInsert&&t.multiple?"Search or create...":"Search..."),k=a.computed(()=>t.disabled?-1:t.tabindex??0),S=a.computed(()=>{if(t.tabindex!==void 0)return t.tabindex+1}),x=a.computed(()=>{const N=[];return t.error&&N.push("input-error"),t.disabled&&N.push("input-disabled"),N.push(`input-size-${t.size}`),N}),b=a.computed(()=>{const N=[];return t.hasLeadingIcon?N.push("input-padding-left-icon"):N.push("input-padding-left"),t.hasTrailingIcon?N.push("input-padding-right-icon"):N.push("input-padding-right"),N}),v=async()=>{if(!t.disabled){if(d.value.isOpen=!0,d.value.searchQuery="",await a.nextTick(),f(),d.value.highlightedIndex===-1){const N=g.value.findIndex(D=>!D.disabled);d.value.highlightedIndex=N>=0?N:0}if(t.searchable&&s.value){const N=s.value.$el?.querySelector("input");N&&N.focus()}document.addEventListener("keydown",j),r("focus",new FocusEvent("focus"))}},C=()=>{d.value.isOpen&&(d.value.isOpen=!1,d.value.highlightedIndex=-1,d.value.searchQuery="",document.removeEventListener("keydown",j),r("blur",new FocusEvent("blur")))},w=()=>{d.value.isOpen?C():v()},M=N=>N.value&&typeof N.value=="string"&&N.value.startsWith("__insert__")?!1:p.value.includes(N.value),A=N=>{if(!N.disabled)if(t.multiple){const D=[...p.value];if(N.value&&typeof N.value=="string"&&N.value.startsWith("__insert__")){const R=N.value.replace("__insert__","");D.includes(R)||D.push(R),d.value.searchQuery=""}else{const R=D.indexOf(N.value);R>-1?D.splice(R,1):D.push(N.value)}r("update:modelValue",D)}else r("update:modelValue",N.value),C()},$=N=>{if(["Enter"," ","ArrowDown","ArrowUp","Escape"].includes(N.key)&&(N.preventDefault(),!(d.value.isOpen&&(N.key==="ArrowDown"||N.key==="ArrowUp"))))switch(N.key){case"Enter":case" ":w();break;case"ArrowDown":case"ArrowUp":v();break;case"Escape":C();break}},U=N=>{switch(N.key){case"ArrowDown":N.preventDefault(),K(1);break;case"ArrowUp":N.preventDefault(),K(-1);break;case"Enter":if(N.preventDefault(),d.value.highlightedIndex>=0){const D=g.value[d.value.highlightedIndex];D&&!D.disabled&&A(D)}break;case"Escape":C();break}},j=N=>{if(d.value.isOpen)switch(N.key){case"Escape":C();break;case"ArrowDown":N.preventDefault(),K(1);break;case"ArrowUp":N.preventDefault(),K(-1);break;case"Enter":if(N.preventDefault(),d.value.highlightedIndex>=0){const D=g.value[d.value.highlightedIndex];D&&!D.disabled&&A(D)}break}},K=N=>{const D=g.value;if(D.length===0)return;let R=d.value.highlightedIndex+N;R<0?R=D.length-1:R>=D.length&&(R=0);let ke=0;for(;D[R]?.disabled&&ke<D.length;)R+=N,R<0&&(R=D.length-1),R>=D.length&&(R=0),ke++;d.value.highlightedIndex=R};return a.onUnmounted(()=>{d.value.isOpen&&C(),document.removeEventListener("keydown",j),h()}),(N,D)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",{class:a.normalizeClass(["input-field-wrapper",[x.value,b.value]])},[a.renderSlot(N.$slots,"leading",{},void 0,!0),t.hasLeadingIcon?(a.openBlock(),a.createElementBlock("div",Lu,[a.renderSlot(N.$slots,"leading-icon",{},void 0,!0)])):a.createCommentVNode("",!0),a.createElementVNode("div",{ref_key:"selectTriggerRef",ref:i,class:a.normalizeClass(["input-select-trigger",{"input-select-open":d.value.isOpen}]),onClick:w,onKeydown:$,tabindex:k.value,role:"combobox","aria-expanded":d.value.isOpen,"aria-haspopup":!0,"aria-controls":l.value,"aria-disabled":n.disabled},[a.createElementVNode("div",Pu,[m.value?(a.openBlock(),a.createElementBlock("span",Vu,a.toDisplayString(m.value),1)):(a.openBlock(),a.createElementBlock("span",Fu,a.toDisplayString(n.placeholder||"Select an option..."),1))]),a.createElementVNode("div",{class:a.normalizeClass(["input-select-arrow",{"input-select-arrow-open":d.value.isOpen}])},[a.createVNode(a.unref(Pr))],2)],42,zu),t.hasTrailingIcon?(a.openBlock(),a.createElementBlock("div",Hu,[a.renderSlot(N.$slots,"trailing-icon",{},void 0,!0)])):a.createCommentVNode("",!0),a.renderSlot(N.$slots,"trailing",{},void 0,!0)],2),(a.openBlock(),a.createBlock(a.Teleport,{to:c.value},[d.value.isOpen?(a.openBlock(),a.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:o,id:l.value,class:a.normalizeClass(["input-dropdown",{"input-dropdown--multiple":n.multiple}]),style:a.normalizeStyle(a.unref(u)),role:"listbox","aria-multiselectable":n.multiple,onMousedown:D[1]||(D[1]=a.withModifiers(()=>{},["prevent"]))},[n.searchable?(a.openBlock(),a.createElementBlock("div",Uu,[a.createVNode(ni,{ref_key:"searchInputRef",ref:s,modelValue:d.value.searchQuery,"onUpdate:modelValue":D[0]||(D[0]=R=>d.value.searchQuery=R),type:"search",placeholder:y.value,size:"sm",tabindex:S.value,onKeydown:U},{"leading-icon":a.withCtx(()=>[a.createVNode(a.unref(vu))]),_:1},8,["modelValue","placeholder","tabindex"])])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:"input-dropdown-options",style:a.normalizeStyle({maxHeight:`${n.maxDropdownHeight}px`})},[g.value.length===0?(a.openBlock(),a.createElementBlock("div",qu,[a.renderSlot(N.$slots,"zero-state",{},()=>[a.createTextVNode(a.toDisplayString(n.noOptionsText),1)],!0)])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(g.value,(R,ke)=>(a.openBlock(),a.createElementBlock("div",{key:R.value,class:a.normalizeClass(["input-dropdown-option",{"input-dropdown-option--selected":M(R),"input-dropdown-option--highlighted":ke===d.value.highlightedIndex,"input-dropdown-option--disabled":R.disabled,"input-dropdown-option--insert":R.value&&typeof R.value=="string"&&R.value.startsWith("__insert__")}]),onClick:ri=>A(R),onMouseenter:ri=>d.value.highlightedIndex=ke,role:"option","aria-selected":M(R)},[a.createElementVNode("div",Ku,[a.createElementVNode("div",Ju,a.toDisplayString(R.label),1),R.description?(a.openBlock(),a.createElementBlock("div",Gu,a.toDisplayString(R.description),1)):a.createCommentVNode("",!0)]),n.multiple&&M(R)?(a.openBlock(),a.createElementBlock("div",Yu,[a.createVNode(a.unref(iu))])):a.createCommentVNode("",!0)],42,Wu))),128))],4)],46,ju)):a.createCommentVNode("",!0)],8,["to"]))],64))}}),Xu=de(Qu,[["__scopeId","data-v-e9ac7d68"]]),Zu={class:"input-leading-icon"},_u=["src"],ef=["id","accept","multiple","disabled","required"],tf={class:"input-file-content"},nf={key:0,class:"input-file-selected"},rf={class:"input-file-list"},of={class:"input-file-item"},sf={class:"input-file-name"},lf={key:1,class:"input-file-prompt"},af={class:"input-file-prompt-text"},cf={key:0,class:"input-file-accept-text"},df={key:2,class:"input-file-selected"},uf={class:"input-file-selected-text"},ff={class:"input-file-list"},hf={class:"input-file-name"},pf={class:"input-file-size"},mf={key:0,class:"input-trailing-icon"},gf={key:1,class:"input-trailing-icon"},yf=a.defineComponent({__name:"UiInput.File",props:{accept:{},multiple:{type:Boolean,default:!1},maxFileSize:{default:10*1024*1024},dragDropText:{},selectedText:{},preview:{},hasLeadingIcon:{type:Boolean,default:!1},hasTrailingIcon:{type:Boolean,default:!1},label:{},helpText:{},modelValue:{},value:{},placeholder:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean},required:{type:Boolean,default:!1},fullWidth:{type:Boolean},inputId:{},error:{type:[Boolean,String,Error],default:!1},size:{default:"md"},tabindex:{}},emits:["update:modelValue","file-error","clear-preview","blur","focus"],setup(n,{emit:e}){const t=n,r=e,i=a.ref(),o=a.ref(!1),s=a.ref(null),l=a.ref([]),c=a.computed(()=>t.preview?t.preview:s.value);a.computed(()=>!!t.preview);const d=a.computed(()=>t.preview?t.preview:null),u=a.computed(()=>{const M=[];return t.error&&M.push("input-error"),t.disabled&&M.push("input-disabled"),M.push(`input-size-${t.size}`),M}),f=a.computed(()=>{const M=[];return M.push("input-padding-left-icon"),l.value.length>0||d.value||t.disabled?M.push("input-padding-right-icon"):M.push("input-padding-right"),M}),h=M=>{if(t.maxFileSize&&M.size>t.maxFileSize)return`File "${M.name}" is too large. Maximum size is ${y(t.maxFileSize)}.`;if(t.accept){const A=t.accept.split(",").map(K=>K.trim().toLowerCase()),$=M.type.toLowerCase(),U="."+M.name.split(".").pop()?.toLowerCase();if(!A.some(K=>{if(K.startsWith("."))return U===K;if(K.includes("*")){const N=K.split("/")[0];return $.startsWith(N)}return $===K}))return`File "${M.name}" is not an accepted file type.`}return null},p=M=>{for(const A of M){const $=h(A);if($){r("file-error",$);return}}t.multiple?l.value=[...l.value,...M]:l.value=M.slice(0,1),t.multiple?r("update:modelValue",l.value):r("update:modelValue",l.value[0]||null),!t.multiple&&l.value.length>0&&l.value[0].type.startsWith("image/")&&m(l.value[0])},m=M=>{s.value&&URL.revokeObjectURL(s.value);const A=new FileReader;A.onload=$=>{s.value=$.target?.result},A.readAsDataURL(M)},g=()=>{l.value=[],r("update:modelValue",t.multiple?[]:null),s.value&&(URL.revokeObjectURL(s.value),s.value=null),i.value&&(i.value.value=""),t.preview&&r("clear-preview")},y=M=>{if(M===0)return"0 Bytes";const A=1024,$=["Bytes","KB","MB","GB"],U=Math.floor(Math.log(M)/Math.log(A));return parseFloat((M/Math.pow(A,U)).toFixed(2))+" "+$[U]},k=()=>{!t.disabled&&i.value&&i.value.click()},S=M=>{const A=M.target,$=Array.from(A.files||[]);$.length>0&&p($)},x=M=>{t.disabled||(o.value=!0)},b=M=>{o.value=!1},v=M=>{if(t.disabled)return;o.value=!1;const A=Array.from(M.dataTransfer?.files||[]);A.length>0&&p(A)},C=M=>{r("blur",M)},w=M=>{r("focus",M)};return a.watch(()=>t.modelValue,M=>{M?Array.isArray(M)?l.value=M:(l.value=[M],M.type.startsWith("image/")&&m(M)):(l.value=[],s.value&&(URL.revokeObjectURL(s.value),s.value=null))},{immediate:!0}),a.onUnmounted(()=>{s.value&&URL.revokeObjectURL(s.value)}),(M,A)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["input-field-wrapper",[u.value,f.value]])},[a.renderSlot(M.$slots,"leading",{},void 0,!0),a.createElementVNode("div",Zu,[c.value?(a.openBlock(),a.createElementBlock("img",{key:0,src:c.value,alt:"Preview",class:"input-file-preview"},null,8,_u)):t.hasLeadingIcon?a.renderSlot(M.$slots,"leading-icon",{key:1},void 0,!0):(a.openBlock(),a.createBlock(a.unref(uu),{key:2}))]),a.createElementVNode("div",{class:a.normalizeClass(["input-file-area",{"input-file-dragover":o.value,"input-file-disabled":n.disabled}]),onClick:k,onDragover:a.withModifiers(x,["prevent"]),onDragleave:a.withModifiers(b,["prevent"]),onDrop:a.withModifiers(v,["prevent"])},[a.createElementVNode("input",{ref_key:"fileInputRef",ref:i,id:n.inputId,type:"file",accept:n.accept,multiple:n.multiple,disabled:n.disabled,required:n.required,class:"input-file-hidden",onChange:S,onBlur:C,onFocus:w},null,40,ef),a.createElementVNode("div",tf,[d.value&&l.value.length===0?(a.openBlock(),a.createElementBlock("div",nf,[A[0]||(A[0]=a.createElementVNode("div",{class:"input-file-selected-text"}," File loaded ",-1)),a.createElementVNode("div",rf,[a.createElementVNode("div",of,[a.createElementVNode("span",sf,a.toDisplayString(d.value),1)])])])):l.value.length===0?(a.openBlock(),a.createElementBlock("div",lf,[a.createElementVNode("div",af,a.toDisplayString(n.dragDropText||"Click to select or drag and drop"),1),n.accept?(a.openBlock(),a.createElementBlock("div",cf,a.toDisplayString(n.accept),1)):a.createCommentVNode("",!0)])):(a.openBlock(),a.createElementBlock("div",df,[a.createElementVNode("div",uf,a.toDisplayString(n.selectedText||`${l.value.length} file(s) selected`),1),a.createElementVNode("div",ff,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(l.value,($,U)=>(a.openBlock(),a.createElementBlock("div",{key:U,class:"input-file-item"},[a.createElementVNode("span",hf,a.toDisplayString($.name),1),a.createElementVNode("span",pf,"("+a.toDisplayString(y($.size))+")",1)]))),128))])]))])],34),(l.value.length>0||d.value)&&!n.disabled?(a.openBlock(),a.createElementBlock("div",mf,[a.createElementVNode("button",{type:"button",class:"input-file-clear",onClick:a.withModifiers(g,["stop"]),"aria-label":"Clear selected files"},[a.createVNode(a.unref(fo))])])):t.hasTrailingIcon?(a.openBlock(),a.createElementBlock("div",gf,[a.renderSlot(M.$slots,"trailing-icon",{},void 0,!0)])):a.createCommentVNode("",!0),a.renderSlot(M.$slots,"trailing",{},void 0,!0)],2))}}),kf=de(yf,[["__scopeId","data-v-3c7bee41"]]),bf={class:"tabs-wrapper"},vf={key:0,class:"tabs-before"},xf=["aria-selected","id","onClick"],wf={key:1,class:"tabs-after"},Cf=["aria-labelledby"],Sf=a.defineComponent({__name:"UiTabs",props:{modelValue:{},tabs:{},underlineWidth:{default:"5rem"},orientation:{default:"horizontal"},size:{default:"md"},variant:{default:"default"},tabWidth:{default:"fill"},sticky:{default:null}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=e,i=a.useSlots(),o=a.computed(()=>!!i.content),s=a.computed(()=>t.tabs.find(x=>x.value===t.modelValue)),l=a.ref([]),c=a.ref(!1),d=a.ref({width:"0px",height:"0px",left:"0px",top:"0px",opacity:"0"}),u=a.ref({width:"0px",height:"0px",left:"0px",top:"0px",opacity:"0"});let f=-1,h=!1;const p=(x,b)=>{const v=x.getBoundingClientRect(),C=b.getBoundingClientRect(),w=getComputedStyle(b),M=parseFloat(w.getPropertyValue("--underline-thickness")||"5");let A=5;t.size==="sm"?A=4:t.size==="lg"&&(A=6);const $=C.height;if(t.orientation==="vertical"){const U=v.top-C.top;return{height:v.height-A*4,top:U+A*2,width:M,left:A-M/2}}else{const U=v.left-C.left,j=v.width;if(t.underlineWidth==="full")return{width:j-30,left:U+15,height:M,top:$-A-M/2};let K;if(t.underlineWidth.endsWith("%")){const D=parseFloat(t.underlineWidth)/100;K=j*D}else if(t.underlineWidth.endsWith("px"))K=parseFloat(t.underlineWidth);else if(t.underlineWidth.endsWith("rem")){const D=parseFloat(t.underlineWidth),R=parseFloat(getComputedStyle(document.documentElement).fontSize);K=D*R}else K=parseFloat(t.underlineWidth)||j;const N=(j-K)/2;return{width:K,left:U+N,height:M,top:$-A-M/2}}},m=async(x,b)=>{h||(r("update:modelValue",x),await a.nextTick(),g(b))},g=async x=>{if(!l.value[x]||x===f)return;h=!0;const b=l.value[x],v=b.parentElement;if(!v)return;const C=p(b,v),w=b.getBoundingClientRect(),M=v.getBoundingClientRect();let A,$;if(t.orientation==="vertical"?(A=w.top-M.top,$=w.height):(A=w.left-M.left,$=w.width),f===-1){t.orientation==="vertical"?(d.value={height:`${C.height}px`,top:`${C.top}px`,width:`${C.width}px`,left:`${C.left}px`,opacity:"1"},u.value={height:`${$}px`,top:`${A}px`,width:`${w.width}px`,left:"0",opacity:"1"}):(d.value={width:`${C.width}px`,left:`${C.left}px`,height:`${C.height}px`,top:`${C.top}px`,opacity:"1"},u.value={width:`${$}px`,left:`${A}px`,height:"100%",top:"0",opacity:"1"}),f=x,h=!1;return}const U=l.value[f];if(p(U,v),U.getBoundingClientRect(),window.matchMedia("(prefers-reduced-motion: reduce)").matches){d.value={width:`${C.width||0}px`,left:`${C.left||0}px`,height:`${C.height||7}px`,top:`${C.top}px`,opacity:"1"},t.orientation==="vertical"?u.value={height:`${$}px`,top:`${A}px`,width:"100%",left:"0",opacity:"1"}:u.value={width:`${$}px`,left:`${A}px`,height:"100%",top:"0",opacity:"1"},f=x,h=!1;return}requestAnimationFrame(()=>{t.orientation==="vertical"?(d.value={height:`${C.height}px`,top:`${C.top}px`,width:`${C.width||7}px`,left:`${C.left}px`,opacity:"1"},u.value={height:`${$}px`,top:`${A}px`,width:"100%",left:"0",opacity:"1"}):(d.value={width:`${C.width}px`,left:`${C.left}px`,height:`${C.height||7}px`,top:`${C.top}px`,opacity:"1"},u.value={width:`${$}px`,left:`${A}px`,height:"100%",top:"0",opacity:"1"}),f=x,setTimeout(()=>{h=!1},200)})};let y=null;const k=()=>{const x=t.tabs.findIndex(b=>b.value===t.modelValue);if(x!==-1&&l.value&&l.value[x]){const b=c.value;c.value=!1;const v=l.value[x],C=v.parentElement;if(C){const w=p(v,C),M=v.getBoundingClientRect(),A=C.getBoundingClientRect();let $,U;t.orientation==="vertical"?($=M.top-A.top,U=M.height,d.value={height:`${w.height}px`,top:`${w.top}px`,width:`${w.width}px`,left:`${w.left}px`,opacity:"1"},u.value={height:`${U}px`,top:`${$}px`,width:`${M.width}px`,left:"0",opacity:"1"}):($=M.left-A.left,U=M.width,d.value={width:`${w.width}px`,left:`${w.left}px`,height:`${w.height}px`,top:`${w.top}px`,opacity:"1"},u.value={width:`${U}px`,left:`${$}px`,height:"100%",top:"0",opacity:"1"})}f=x,h=!1,setTimeout(()=>{c.value=b},10)}y&&clearTimeout(y),y=setTimeout(()=>{y=null},50)};a.onMounted(async()=>{await a.nextTick();const x=t.tabs.findIndex(b=>b.value===t.modelValue);x!==-1&&(g(x),setTimeout(()=>{c.value=!0},50)),window.addEventListener("resize",k)}),a.onUnmounted(()=>{window.removeEventListener("resize",k),y&&(clearTimeout(y),y=null)});const{modelValue:S}=a.toRefs(t);return a.watch(S,async()=>{await a.nextTick();const x=t.tabs.findIndex(b=>b.value===t.modelValue);x!==-1&&g(x)}),(x,b)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["tabs-container",[`tabs-container--${n.orientation}`,`tabs-container--${n.size}`,`tabs-container--${n.variant}`,{"tabs-container--with-content":o.value}]])},[a.createElementVNode("div",bf,[a.createElementVNode("div",{class:a.normalizeClass(["tabs-list",[`tabs-list--${n.orientation}`,`tabs-list--${n.size}`,`tabs-list--${n.variant}`]]),style:a.normalizeStyle(n.sticky?{position:"sticky",[n.sticky.side]:`${n.sticky.offset}px`,zIndex:10}:{})},[x.$slots.before?(a.openBlock(),a.createElementBlock("div",vf,[a.renderSlot(x.$slots,"before",{},void 0,!0)])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["tabs-buttons-wrapper",`tabs-buttons-wrapper--${n.tabWidth}`]),role:"tablist"},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.tabs,(v,C)=>(a.openBlock(),a.createElementBlock("button",{key:v.value,ref_for:!0,ref_key:"tabButtons",ref:l,class:a.normalizeClass(["tab-button",[`tab-button--${n.size}`,`tab-button--${n.variant}`,`tab-button--${n.tabWidth}`,{"tab-button-active":a.unref(S)===v.value}]]),"aria-selected":a.unref(S)===v.value,"aria-controls":"tabpanel",id:`tab-${v.value}`,role:"tab",onClick:w=>m(v.value,C)},a.toDisplayString(v.label),11,xf))),128)),a.createElementVNode("div",{class:a.normalizeClass(["tab-background",{"no-transition":!c.value}]),style:a.normalizeStyle(u.value)},null,6),a.createElementVNode("div",{class:a.normalizeClass(["tab-underline",{"no-transition":!c.value}]),style:a.normalizeStyle(d.value)},null,6)],2),x.$slots.after?(a.openBlock(),a.createElementBlock("div",wf,[a.renderSlot(x.$slots,"after",{},void 0,!0)])):a.createCommentVNode("",!0)],6)]),o.value?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["tabs-content",`tabs-content--${n.orientation}`]),role:"tabpanel","aria-labelledby":`tab-${a.unref(S)}`,id:"tabpanel"},[a.renderSlot(x.$slots,"content",{activeTab:s.value},void 0,!0)],10,Cf)):a.createCommentVNode("",!0)],2))}}),Fr=de(Sf,[["__scopeId","data-v-901716e3"]]),Mf={key:0,class:"ui-divider-text"},Tf=a.defineComponent({__name:"UiDivider",props:{orientation:{default:"horizontal"},variant:{default:"solid"},text:{},textPosition:{default:"center"},color:{default:"var(--accui-divider-color)"},thickness:{default:"1px"},margin:{default:"1rem"},spacing:{default:"auto"}},setup(n){const e=n,t=a.useSlots(),r=a.computed(()=>!!(e.text||t.default)),i=a.computed(()=>{const o={};return e.orientation==="horizontal"?(o.width=e.spacing==="auto"?"100%":typeof e.spacing=="number"?`${e.spacing}px`:e.spacing,o.marginTop=typeof e.margin=="number"?`${e.margin}px`:e.margin,o.marginBottom=typeof e.margin=="number"?`${e.margin}px`:e.margin,r.value||(o.height=typeof e.thickness=="number"?`${e.thickness}px`:e.thickness),o["--divider-color"]=e.color==="#e5e7eb"?"var(--accui-divider-color)":e.color,o["--divider-thickness"]=typeof e.thickness=="number"?`${e.thickness}px`:e.thickness):(o.height=e.spacing==="auto"?"100%":typeof e.spacing=="number"?`${e.spacing}px`:e.spacing,o.marginLeft=typeof e.margin=="number"?`${e.margin}px`:e.margin,o.marginRight=typeof e.margin=="number"?`${e.margin}px`:e.margin,r.value||(o.width=typeof e.thickness=="number"?`${e.thickness}px`:e.thickness),o["--divider-color"]=e.color==="#e5e7eb"?"var(--accui-divider-color)":e.color,o["--divider-thickness"]=typeof e.thickness=="number"?`${e.thickness}px`:e.thickness),o});return(o,s)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["ui-divider",`ui-divider--${n.orientation}`,`ui-divider--${n.variant}`,{"ui-divider--with-text":r.value,[`ui-divider--text-${n.textPosition}`]:r.value}]),style:a.normalizeStyle(i.value)},[r.value?(a.openBlock(),a.createElementBlock("span",Mf,[a.renderSlot(o.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(n.text),1)],!0)])):a.createCommentVNode("",!0)],6))}}),tt=de(Tf,[["__scopeId","data-v-1c798024"]]),Ef={class:"datetime-picker-wrapper"},Nf={class:"datetime-picker-leading-icon"},Af={class:"datetime-picker-display"},Bf={key:0,class:"datetime-picker-value"},Of={key:1,class:"datetime-picker-placeholder"},Df={key:1,class:"datetime-picker-trailing-icon"},If={key:1,class:"datetime-picker-panel"},$f={class:"datetime-picker-header"},Rf={class:"datetime-picker-month-year"},Lf=["value"],zf=["value"],Pf={class:"datetime-picker-weekdays"},Vf={class:"datetime-picker-grid"},Ff={key:2,class:"datetime-picker-panel datetime-picker-time-panel"},Hf={class:"time-selector"},jf={class:"time-column"},Uf={class:"time-scroll"},qf={class:"time-column"},Wf={class:"time-scroll"},Kf={key:0,class:"time-column"},Jf={class:"time-scroll"},Gf={class:"datetime-picker-footer"},Yf=a.defineComponent({__name:"UiDateTimePicker",props:{modelValue:{},type:{default:"date"},placeholder:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},min:{},max:{},error:{type:Boolean,default:!1},size:{default:"md"},format:{default:"iso"},is24Hour:{type:Boolean,default:!0},minuteStep:{default:1}},emits:["update:modelValue","change"],setup(n,{emit:e}){const t=n,r=e,i=a.ref(),o=a.ref(),s=a.ref(!1),{floatingStyle:l,updatePosition:c,cleanup:d}=Vr({trigger:i,floating:o,placement:"bottom-start",offset:8,shift:!0,flip:!0,autoUpdate:!0,clickOutside:{enabled:!0,handler:()=>{f()}}}),u=async()=>{t.disabled||t.readonly||(s.value=!0,await a.nextTick(),c())},f=()=>{s.value=!1},h=()=>{s.value?f():u()},p=a.ref(t.type==="time"?"time":"date"),m=a.ref(new Date().getMonth()),g=a.ref(new Date().getFullYear()),y=a.ref(new Date().getHours()),k=a.ref(new Date().getMinutes()),S=a.ref("AM"),x=["January","February","March","April","May","June","July","August","September","October","November","December"],b=["Su","Mo","Tu","We","Th","Fr","Sa"],v=a.computed(()=>t.min?t.min instanceof Date?t.min:new Date(t.min):null),C=a.computed(()=>t.max?t.max instanceof Date?t.max:new Date(t.max):null),w=a.computed(()=>{if(!t.modelValue)return null;if(t.modelValue instanceof Date)return t.modelValue;if(t.type==="time"&&typeof t.modelValue=="string"){const L=t.modelValue.match(/^(\d{1,2}):(\d{2})(?::(\d{2}))?$/);if(L){const I=new Date;return I.setHours(parseInt(L[1]),parseInt(L[2]),parseInt(L[3]||"0"),0),I}}return new Date(t.modelValue)}),M=a.computed(()=>{if(!w.value||isNaN(w.value.getTime()))return"";const L=w.value;if(t.type==="time"){if(t.is24Hour)return`${String(L.getHours()).padStart(2,"0")}:${String(L.getMinutes()).padStart(2,"0")}`;{const pt=L.getHours()%12||12,se=L.getHours()>=12?"PM":"AM";return`${pt}:${String(L.getMinutes()).padStart(2,"0")} ${se}`}}const I=L.getDate(),O=L.getMonth()+1,q=L.getFullYear();let we="";switch(t.format){case"us":we=`${O}/${I}/${q}`;break;case"eu":we=`${I}/${O}/${q}`;break;default:we=`${q}-${String(O).padStart(2,"0")}-${String(I).padStart(2,"0")}`;break}if(t.type==="date")return we;let $t="";if(t.is24Hour)$t=`${String(L.getHours()).padStart(2,"0")}:${String(L.getMinutes()).padStart(2,"0")}`;else{const pt=L.getHours()%12||12,se=L.getHours()>=12?"PM":"AM";$t=`${pt}:${String(L.getMinutes()).padStart(2,"0")} ${se}`}return`${we} ${$t}`}),A=a.computed(()=>{const L=[];return t.error&&L.push("datetime-picker-error"),t.disabled&&L.push("datetime-picker-disabled"),t.readonly&&L.push("datetime-picker-readonly"),L.push(`datetime-picker-size-${t.size}`),L}),$=a.computed(()=>t.type==="date"||t.type==="datetime"&&p.value==="date"),U=a.computed(()=>t.type==="time"||t.type==="datetime"&&p.value==="time"),j=a.computed(()=>[{label:"Date",value:"date"},{label:"Time",value:"time"}]),K=a.computed(()=>{const L=[],I=t.is24Hour?23:12,O=t.is24Hour?0:1;for(let q=O;q<=I;q++)L.push(q);return L}),N=a.computed(()=>{const L=[];for(let I=0;I<60;I+=t.minuteStep)L.push(I);return L}),D=a.computed(()=>{const L=new Date().getFullYear(),I=v.value?.getFullYear()||L-100,O=C.value?.getFullYear()||L+100,q=[];for(let we=I;we<=O;we++)q.push(we);return q}),R=a.computed(()=>v.value?new Date(g.value,m.value,1)<=v.value:!1),ke=a.computed(()=>C.value?new Date(g.value,m.value+1,0)>=C.value:!1),ri=a.computed(()=>{const L=[],I=g.value,O=m.value,q=new Date(I,O,1),we=new Date(q);we.setDate(we.getDate()-q.getDay());const $t=new Date;$t.setHours(0,0,0,0);for(let pt=0;pt<42;pt++){const se=new Date(we);se.setDate(we.getDate()+pt);const ad=se.getMonth()!==O,cd=se.getTime()===$t.getTime(),dd=w.value&&se.getFullYear()===w.value.getFullYear()&&se.getMonth()===w.value.getMonth()&&se.getDate()===w.value.getDate(),ud=!!(v.value&&se<v.value||C.value&&se>C.value);L.push({key:`${se.getFullYear()}-${se.getMonth()}-${se.getDate()}`,date:se.getDate(),month:se.getMonth(),year:se.getFullYear(),otherMonth:ad,isToday:cd,isSelected:dd||!1,isDisabled:ud})}return L}),rd=()=>{switch(t.type){case"time":return"Select time";case"datetime":return"Select date and time";default:return"Select date"}},id=()=>{m.value===0?(m.value=11,g.value--):m.value--},od=()=>{m.value===11?(m.value=0,g.value++):m.value++},sd=L=>{if(L.isDisabled||L.otherMonth)return;const I=w.value||new Date,O=new Date(L.year,L.month,L.date,I.getHours(),I.getMinutes());r("update:modelValue",O),r("change",O),t.type==="datetime"?p.value="time":t.type==="date"&&f()},Dn=(L,I)=>{let O=w.value?new Date(w.value):new Date;if(!w.value){const q=new Date;O.setFullYear(q.getFullYear(),q.getMonth(),q.getDate())}if(L==="hour"){let q=I;t.is24Hour||(S.value==="PM"&&q!==12&&(q+=12),S.value==="AM"&&q===12&&(q=0)),y.value=I,O.setHours(q)}else if(L==="minute")k.value=I,O.setMinutes(I);else if(L==="period"){S.value=I;let q=y.value;I==="PM"&&q!==12&&(q+=12),I==="AM"&&q===12&&(q=0),O.setHours(q)}r("update:modelValue",O),r("change",O)},ld=()=>{const L=new Date;v.value&&L<v.value||C.value&&L>C.value||(r("update:modelValue",L),r("change",L),f())},_o=()=>{r("update:modelValue",null),r("change",null)};return a.watch(()=>t.modelValue,L=>{if(L){const I=L instanceof Date?L:new Date(L);if(!isNaN(I.getTime())){if(m.value=I.getMonth(),g.value=I.getFullYear(),t.is24Hour)y.value=I.getHours();else{const O=I.getHours();y.value=O%12||12,S.value=O>=12?"PM":"AM"}k.value=I.getMinutes()}}},{immediate:!0}),a.onUnmounted(()=>{d()}),(L,I)=>(a.openBlock(),a.createElementBlock("div",Ef,[a.createElementVNode("div",{ref_key:"triggerElement",ref:i,class:a.normalizeClass(["datetime-picker-trigger",[A.value,{"datetime-picker-open":s.value}]]),onClick:h},[a.createElementVNode("div",Nf,[n.type==="date"?(a.openBlock(),a.createBlock(a.unref(ru),{key:0})):n.type==="time"?(a.openBlock(),a.createBlock(a.unref(lu),{key:1})):(a.openBlock(),a.createBlock(a.unref(nu),{key:2}))]),a.createElementVNode("div",Af,[M.value?(a.openBlock(),a.createElementBlock("span",Bf,a.toDisplayString(M.value),1)):(a.openBlock(),a.createElementBlock("span",Of,a.toDisplayString(n.placeholder||rd()),1))]),n.modelValue&&!n.disabled&&!n.readonly?(a.openBlock(),a.createElementBlock("div",{key:0,class:"datetime-picker-trailing-icon",onClick:a.withModifiers(_o,["stop"])},[a.createVNode(a.unref(fo))])):(a.openBlock(),a.createElementBlock("div",Df,[a.createVNode(a.unref(Pr))]))],2),(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[s.value?(a.openBlock(),a.createElementBlock("div",{key:0,ref_key:"floatingElement",ref:o,class:"datetime-picker-dropdown",style:a.normalizeStyle(a.unref(l))},[n.type==="datetime"?(a.openBlock(),a.createBlock(Fr,{key:0,modelValue:p.value,"onUpdate:modelValue":I[0]||(I[0]=O=>p.value=O),tabs:j.value,variant:"default",size:"sm",style:{"margin-bottom":"1rem"}},null,8,["modelValue","tabs"])):a.createCommentVNode("",!0),$.value?(a.openBlock(),a.createElementBlock("div",If,[a.createElementVNode("div",$f,[a.createVNode(W,{onClick:id,disabled:R.value,color:"secondary",variant:"primary",icon:"",squircle:""},{icon:a.withCtx(()=>[a.createVNode(a.unref(ou))]),_:1},8,["disabled"]),a.createElementVNode("div",Rf,[a.withDirectives(a.createElementVNode("select",{"onUpdate:modelValue":I[1]||(I[1]=O=>m.value=O),class:"datetime-picker-select"},[(a.openBlock(),a.createElementBlock(a.Fragment,null,a.renderList(x,(O,q)=>a.createElementVNode("option",{key:q,value:q},a.toDisplayString(O),9,Lf)),64))],512),[[a.vModelSelect,m.value]]),a.withDirectives(a.createElementVNode("select",{"onUpdate:modelValue":I[2]||(I[2]=O=>g.value=O),class:"datetime-picker-select"},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(D.value,O=>(a.openBlock(),a.createElementBlock("option",{key:O,value:O},a.toDisplayString(O),9,zf))),128))],512),[[a.vModelSelect,g.value]])]),a.createVNode(W,{onClick:od,disabled:ke.value,color:"secondary",variant:"primary",icon:"",squircle:""},{icon:a.withCtx(()=>[a.createVNode(a.unref(su))]),_:1},8,["disabled"])]),a.createElementVNode("div",Pf,[(a.openBlock(),a.createElementBlock(a.Fragment,null,a.renderList(b,O=>a.createElementVNode("div",{key:O,class:"datetime-picker-weekday"},a.toDisplayString(O),1)),64))]),a.createElementVNode("div",Vf,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(ri.value,O=>(a.openBlock(),a.createBlock(W,{key:O.key,color:O.isSelected||O.isToday?"primary":"secondary",variant:O.isSelected?"primary":O.isToday?"outline":"primary",disabled:O.isDisabled||O.otherMonth,class:a.normalizeClass(["datetime-picker-day",{"datetime-picker-day-other":O.otherMonth,"datetime-picker-day-disabled":O.isDisabled}]),icon:"",squircle:"",onClick:q=>sd(O)},{icon:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(O.date),1)]),_:2},1032,["color","variant","disabled","class","onClick"]))),128))])])):a.createCommentVNode("",!0),U.value?(a.openBlock(),a.createElementBlock("div",Ff,[a.createElementVNode("div",Hf,[a.createElementVNode("div",jf,[I[6]||(I[6]=a.createElementVNode("label",{class:"time-label"},"Hour",-1)),a.createElementVNode("div",Uf,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(K.value,O=>(a.openBlock(),a.createBlock(W,{key:O,color:y.value===O?"primary":"secondary",variant:y.value===O?"primary":"ghost",size:"sm",squircle:"",onClick:q=>Dn("hour",O)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(String(O).padStart(2,"0")),1)]),_:2},1032,["color","variant","onClick"]))),128))])]),a.createElementVNode("div",qf,[I[7]||(I[7]=a.createElementVNode("label",{class:"time-label"},"Minute",-1)),a.createElementVNode("div",Wf,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(N.value,O=>(a.openBlock(),a.createBlock(W,{key:O,color:k.value===O?"primary":"secondary",variant:k.value===O?"primary":"ghost",size:"sm",squircle:"",onClick:q=>Dn("minute",O)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(String(O).padStart(2,"0")),1)]),_:2},1032,["color","variant","onClick"]))),128))])]),n.is24Hour?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",Kf,[I[10]||(I[10]=a.createElementVNode("label",{class:"time-label"},"Period",-1)),a.createElementVNode("div",Jf,[a.createVNode(W,{color:S.value==="AM"?"primary":"secondary",variant:S.value==="AM"?"primary":"ghost",size:"sm",squircle:"",class:"time-option",onClick:I[3]||(I[3]=O=>Dn("period","AM"))},{default:a.withCtx(()=>[...I[8]||(I[8]=[a.createTextVNode(" AM ",-1)])]),_:1},8,["color","variant"]),a.createVNode(W,{color:S.value==="PM"?"primary":"secondary",variant:S.value==="PM"?"primary":"ghost",size:"sm",squircle:"",class:"time-option",onClick:I[4]||(I[4]=O=>Dn("period","PM"))},{default:a.withCtx(()=>[...I[9]||(I[9]=[a.createTextVNode(" PM ",-1)])]),_:1},8,["color","variant"])])]))])])):a.createCommentVNode("",!0),a.createVNode(tt),a.createElementVNode("div",Gf,[a.createVNode(W,{onClick:ld,color:"primary",variant:"primary",squircle:"",style:{flex:"1"}},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(n.type==="time"?"Now":"Today"),1)]),_:1}),a.createVNode(W,{onClick:I[5]||(I[5]=O=>{_o(),f()}),color:"danger",variant:"primary",squircle:"",style:{flex:"1"}},{default:a.withCtx(()=>[...I[11]||(I[11]=[a.createTextVNode(" Clear ",-1)])]),_:1}),a.createVNode(W,{onClick:f,color:"secondary",variant:"primary",squircle:"",style:{flex:"1"}},{default:a.withCtx(()=>[...I[12]||(I[12]=[a.createTextVNode(" Close ",-1)])]),_:1})])],4)):a.createCommentVNode("",!0)]))]))}}),ho=de(Yf,[["__scopeId","data-v-f688c330"]]),Qf=a.defineComponent({__name:"UiInput.Date",props:{min:{},max:{},format:{default:"iso"},label:{},helpText:{},modelValue:{},value:{},placeholder:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},fullWidth:{type:Boolean},inputId:{},error:{type:[Boolean,String,Error],default:!1},size:{default:"md"},tabindex:{}},emits:["update:modelValue","change","blur","focus","keydown"],setup(n,{emit:e}){const t=e,r=o=>{t("update:modelValue",o)},i=o=>{t("change",o)};return(o,s)=>(a.openBlock(),a.createBlock(ho,{"model-value":n.modelValue,type:"date",placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,required:n.required,min:n.min,max:n.max,error:!!n.error,size:n.size,format:n.format,"onUpdate:modelValue":r,onChange:i},null,8,["model-value","placeholder","disabled","readonly","required","min","max","error","size","format"]))}}),Xf=a.defineComponent({__name:"UiInput.Time",props:{is24Hour:{type:Boolean,default:!0},minuteStep:{default:1},label:{},helpText:{},modelValue:{},value:{},placeholder:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},fullWidth:{type:Boolean},inputId:{},error:{type:[Boolean,String,Error],default:!1},size:{default:"md"},tabindex:{}},emits:["update:modelValue","change","blur","focus","keydown"],setup(n,{emit:e}){const t=e,r=o=>{t("update:modelValue",o)},i=o=>{t("change",o)};return(o,s)=>(a.openBlock(),a.createBlock(ho,{"model-value":n.modelValue,type:"time",placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,required:n.required,error:!!n.error,size:n.size,is24Hour:n.is24Hour,minuteStep:n.minuteStep,"onUpdate:modelValue":r,onChange:i},null,8,["model-value","placeholder","disabled","readonly","required","error","size","is24Hour","minuteStep"]))}}),Zf=a.defineComponent({__name:"UiInput.DateTime",props:{min:{},max:{},format:{default:"iso"},is24Hour:{type:Boolean,default:!0},minuteStep:{default:1},label:{},helpText:{},modelValue:{},value:{},placeholder:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},fullWidth:{type:Boolean},inputId:{},error:{type:[Boolean,String,Error],default:!1},size:{default:"md"},tabindex:{}},emits:["update:modelValue","change","blur","focus","keydown"],setup(n,{emit:e}){const t=e,r=o=>{t("update:modelValue",o)},i=o=>{t("change",o)};return(o,s)=>(a.openBlock(),a.createBlock(ho,{"model-value":n.modelValue,type:"datetime",placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,required:n.required,min:n.min,max:n.max,error:!!n.error,size:n.size,format:n.format,is24Hour:n.is24Hour,minuteStep:n.minuteStep,"onUpdate:modelValue":r,onChange:i},null,8,["model-value","placeholder","disabled","readonly","required","min","max","error","size","format","is24Hour","minuteStep"]))}});function ue(n){this.content=n}ue.prototype={constructor:ue,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),o=r.content.slice();return i==-1?o.push(t||n,e):(o[i+1]=e,t&&(o[i]=t)),new ue(o)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new ue(t)},addToStart:function(n,e){return new ue([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new ue(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),o=r.find(n);return i.splice(o==-1?i.length:o,0,e,t),new ue(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=ue.from(n),n.size?new ue(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=ue.from(n),n.size?new ue(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=ue.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};ue.from=function(n){if(n instanceof ue)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new ue(e)};function Nl(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i==o){t+=i.nodeSize;continue}if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)t++;return t}if(i.content.size||o.content.size){let s=Nl(i.content,o.content,t+1);if(s!=null)return s}t+=i.nodeSize}}function Al(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:r};let s=n.child(--i),l=e.child(--o),c=s.nodeSize;if(s==l){t-=c,r-=c;continue}if(!s.sameMarkup(l))return{a:t,b:r};if(s.isText&&s.text!=l.text){let d=0,u=Math.min(s.text.length,l.text.length);for(;d<u&&s.text[s.text.length-d-1]==l.text[l.text.length-d-1];)d++,t--,r--;return{a:t,b:r}}if(s.content.size||l.content.size){let d=Al(s.content,l.content,t-1,r-1);if(d)return d}t-=c,r-=c}}class T{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,o){for(let s=0,l=0;l<t;s++){let c=this.content[s],d=l+c.nodeSize;if(d>e&&r(c,i+l,o||null,s)!==!1&&c.content.size){let u=l+1;c.nodesBetween(Math.max(0,e-u),Math.min(c.content.size,t-u),r,i+u)}l=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",s=!0;return this.nodesBetween(e,t,(l,c)=>{let d=l.isText?l.text.slice(Math.max(e,c)-c,t-c):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&d||l.isTextblock)&&r&&(s?s=!1:o+=r),o+=d},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new T(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let o=0,s=0;s<t;o++){let l=this.content[o],c=s+l.nodeSize;c>e&&((s<e||c>t)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,t-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,t-s-1))),r.push(l),i+=l.nodeSize),s=c}return new T(r,i)}cutByIndex(e,t){return e==t?T.empty:e==0&&t==this.content.length?this:new T(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new T(i,o)}addToStart(e){return new T([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new T(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return Nl(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Al(this,e,t,r)}findIndex(e){if(e==0)return In(0,e);if(e==this.size)return In(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let i=this.child(t),o=r+i.nodeSize;if(o>=e)return o==e?In(t+1,o):In(t,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return T.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new T(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return T.empty;let t,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)?(t||(t=e.slice(0,i)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new T(t||e,r)}static from(e){if(!e)return T.empty;if(e instanceof T)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new T([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}T.empty=new T([],0);const ii={index:0,offset:0};function In(n,e){return ii.index=n,ii.offset=e,ii}function Yn(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Yn(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Yn(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let Y=class $i{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,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))t||(t=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Yn(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let i=r.create(t.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return $i.none;if(e instanceof $i)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};Y.none=[];class Qn extends Error{}class B{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=Ol(this.content,e+this.openStart,t);return r&&new B(r,this.openStart,this.openEnd)}removeBetween(e,t){return new B(Bl(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return B.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new B(T.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new B(e,r,i)}}B.empty=new B(T.empty,0,0);function Bl(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:s,offset:l}=n.findIndex(t);if(i==e||o.isText){if(l!=t&&!n.child(s).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=s)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(Bl(o.content,e-i-1,t-i-1)))}function Ol(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),s=n.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=Ol(s.content,e-o-1,t,s);return l&&n.replaceChild(i,s.copy(l))}function _f(n,e,t){if(t.openStart>n.depth)throw new Qn("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Qn("Inconsistent open depths");return Dl(n,e,t,0)}function Dl(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let s=Dl(n,e,t,r+1);return o.copy(o.content.replaceChild(i,s))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let s=n.parent,l=s.content;return wt(s,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:s,end:l}=eh(t,n);return wt(o,$l(n,s,l,e,r))}else return wt(o,Xn(n,e,r))}function Il(n,e){if(!e.type.compatibleContent(n.type))throw new Qn("Cannot join "+e.type.name+" onto "+n.type.name)}function Ri(n,e,t){let r=n.node(t);return Il(r,e.node(t)),r}function xt(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function an(n,e,t,r){let i=(e||n).node(t),o=0,s=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(xt(n.nodeAfter,r),o++));for(let l=o;l<s;l++)xt(i.child(l),r);e&&e.depth==t&&e.textOffset&&xt(e.nodeBefore,r)}function wt(n,e){return n.type.checkContent(e),n.copy(e)}function $l(n,e,t,r,i){let o=n.depth>i&&Ri(n,e,i+1),s=r.depth>i&&Ri(t,r,i+1),l=[];return an(null,n,i,l),o&&s&&e.index(i)==t.index(i)?(Il(o,s),xt(wt(o,$l(n,e,t,r,i+1)),l)):(o&&xt(wt(o,Xn(n,e,i+1)),l),an(e,t,i,l),s&&xt(wt(s,Xn(t,r,i+1)),l)),an(r,null,i,l),new T(l)}function Xn(n,e,t){let r=[];if(an(null,n,t,r),n.depth>t){let i=Ri(n,e,t+1);xt(wt(i,Xn(n,e,t+1)),r)}return an(e,null,t,r),new T(r)}function eh(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)i=e.node(o).copy(T.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class kn{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Y.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let l=r;r=i,i=l}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 t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.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 t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Zn(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 t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,o=t;for(let s=e;;){let{index:l,offset:c}=s.content.findIndex(o),d=o-c;if(r.push(s,l,i+c),!d||(s=s.child(l),s.isText))break;o=d-1,i+=c+1}return new kn(t,r,o)}static resolveCached(e,t){let r=ns.get(e);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==t)return s}else ns.set(e,r=new th);let i=r.elts[r.i]=kn.resolve(e,t);return r.i=(r.i+1)%nh,i}}class th{constructor(){this.elts=[],this.i=0}}const nh=12,ns=new WeakMap;class Zn{constructor(e,t,r){this.$from=e,this.$to=t,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 rh=Object.create(null);class Re{constructor(e,t,r,i=Y.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||T.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,i=0){this.content.nodesBetween(e,t,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,t,r,i){return this.content.textBetween(e,t,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,t,r){return this.type==e&&Yn(this.attrs,t||e.defaultAttrs||rh)&&Y.sameSet(this.marks,r||Y.none)}copy(e=null){return e==this.content?this:new Re(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Re(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return B.empty;let i=this.resolve(e),o=this.resolve(t),s=r?0:i.sharedDepth(t),l=i.start(s),d=i.node(s).content.cut(i.pos-l,o.pos-l);return new B(d,i.depth-s,o.depth-s)}replace(e,t,r){return _f(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return kn.resolveCached(this,e)}resolveNoCache(e){return kn.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,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()+")"),Rl(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=T.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let c=i;c<o;c++)if(!this.type.allowsMarks(r.child(c).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,t);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=Y.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!Y.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=T.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,i,r);return o.type.checkAttrs(o.attrs),o}}Re.prototype.text=void 0;class _n extends Re{constructor(e,t,r,i){if(super(e,t,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):Rl(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new _n(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new _n(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Rl(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Tt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new ih(e,t);if(r.next==null)return Tt.empty;let i=Ll(r);r.next&&r.err("Unexpected trailing text");let o=uh(dh(i));return fh(o,r),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let i=this;for(let o=t;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:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];function o(s,l){let c=s.matchFragment(e,r);if(c&&(!t||c.validEnd))return T.from(l.map(d=>d.createAndFill()));for(let d=0;d<s.next.length;d++){let{type:u,next:f}=s.next[d];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let h=o(f,l.concat(u));if(h)return h}}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 t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=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 l=i;l.type;l=l.via)s.push(l.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:l,next:c}=o.next[s];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!i.type||c.validEnd)&&(r.push({match:l.contentMatch,type:l,via:i}),t[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 t(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}return t(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(`
4
+ `,xd={key:0,class:"loader-icon"},wd=["width","height"],Cd=["d"],Sd=["stroke-width"],Md=["stroke-width"],Td=["width","height"],Ed={key:3,class:"loader-text"},Nd=a.defineComponent({__name:"UiLoader",props:{size:{default:"md"},color:{default:"primary"},variant:{default:"circle"},text:{},centered:{type:Boolean,default:!0},weight:{default:30},fullWidth:{type:Boolean,default:!1}},setup(n){const t=vd.replace(/<svg[^>]*>/,"").replace(/<\/svg>/,"").trim().match(/d="([^"]*)"/)?.[1]||"",r=n,i={sm:32,md:48,lg:64,xl:80},o=a.computed(()=>typeof r.size=="number"?r.size:i[r.size]||i.md);return(s,l)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["loader-container",[{"loader-centered":n.centered},`loader-color-${n.color}`]])},[n.variant==="spinner"?(a.openBlock(),a.createElementBlock("div",xd,[(a.openBlock(),a.createElementBlock("svg",{width:o.value,height:o.value,viewBox:"0 0 500 500"},[a.createElementVNode("defs",null,[a.createElementVNode("path",{id:"logo-path",d:a.unref(t),transform:"translate(81, 13) scale(1.0)"},null,8,Cd)]),a.createElementVNode("use",{href:"#logo-path",fill:"none",stroke:"var(--loader-semi-color)","stroke-width":n.weight,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,Sd),a.createElementVNode("use",{href:"#logo-path",fill:"none",stroke:"var(--loader-solid-color)","stroke-width":n.weight,"stroke-linecap":"round","stroke-linejoin":"round",class:"loader-animated-path"},null,8,Md)],8,wd))])):n.variant==="circle"?(a.openBlock(),a.createElementBlock("div",{key:1,class:"loader-circle",style:a.normalizeStyle({width:`${o.value}px`,height:`${o.value}px`})},[(a.openBlock(),a.createElementBlock("svg",{width:o.value,height:o.value,viewBox:"0 0 50 50"},[...l[0]||(l[0]=[a.createElementVNode("circle",{cx:"25",cy:"25",r:"20",fill:"none",stroke:"var(--loader-solid-color)","stroke-width":"4","stroke-linecap":"round",class:"loader-circle-path"},null,-1)])],8,Td))],4)):n.variant==="bar"?(a.openBlock(),a.createElementBlock("div",{key:2,class:"loader-bar",style:a.normalizeStyle({width:n.fullWidth?"100%":`${o.value*1.5}px`,height:`${Math.max(o.value*.1,4)}px`})},[...l[1]||(l[1]=[a.createElementVNode("div",{class:"loader-bar-track"},[a.createElementVNode("div",{class:"loader-bar-fill"})],-1)])],4)):a.createCommentVNode("",!0),n.text?(a.openBlock(),a.createElementBlock("p",Ed,a.toDisplayString(n.text),1)):a.createCommentVNode("",!0)],2))}}),zr=de(Nd,[["__scopeId","data-v-4b565c5d"]]),Ad={key:0,class:"button-loading-content"},Bd={key:0},Od={key:0,class:"leading-icon"},Dd={class:"button-text-content"},Id={key:1,class:"trailing-icon"},$d=a.defineComponent({__name:"UiButton.Content",props:{loading:{type:Boolean,default:!1},loadingText:{},icon:{type:Boolean,default:!1},size:{},textAlign:{default:"center"}},setup(n){const e=a.useSlots(),t=a.computed(()=>!!e["leading-icon"]),r=a.computed(()=>!!e["trailing-icon"]),i=n,o=a.computed(()=>{switch(i.size){case"xs":return 16;case"sm":return 18;case"md":return 20;case"lg":return 24;case"xl":return 28;default:return 20}}),s=a.computed(()=>i.size?`button-content-${i.size}`:"button-content-md");return(l,c)=>n.loading?(a.openBlock(),a.createElementBlock("span",Ad,[a.createVNode(zr,{variant:"circle",size:o.value,centered:!1,color:"white"},null,8,["size"]),n.icon?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("span",Bd,a.toDisplayString(n.loadingText||"Loading..."),1))])):(a.openBlock(),a.createElementBlock("span",{key:1,class:a.normalizeClass(["button-content",s.value,`button-content-align-${n.textAlign}`])},[n.icon?a.renderSlot(l.$slots,"icon",{key:0},void 0,!0):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[t.value?(a.openBlock(),a.createElementBlock("span",Od,[a.renderSlot(l.$slots,"leading-icon",{},void 0,!0)])):a.createCommentVNode("",!0),a.renderSlot(l.$slots,"icon",{},void 0,!0),a.createElementVNode("span",Dd,[a.renderSlot(l.$slots,"default",{},void 0,!0)]),r.value?(a.openBlock(),a.createElementBlock("span",Id,[a.renderSlot(l.$slots,"trailing-icon",{},void 0,!0)])):a.createCommentVNode("",!0)],64))],2))}}),Wt=de($d,[["__scopeId","data-v-12d1d1fc"]]),Rd=["href","target","rel"],Oi=a.defineComponent({__name:"UiButton.Anchor",props:{to:{},href:{},external:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},loadingText:{},icon:{type:Boolean,default:!1},buttonClasses:{},buttonStyles:{},textAlign:{default:"center"}},emits:["click"],setup(n,{emit:e}){const t=n,r=e,i=a.computed(()=>{if(t.href)return t.href;if(t.to){if(typeof t.to=="string")return t.to;if(typeof t.to=="object"&&t.to)return"#route-object-not-supported"}return"#"}),o=s=>{if(t.disabled||t.loading){s.preventDefault();return}r("click",s)};return(s,l)=>(a.openBlock(),a.createElementBlock("a",{href:i.value,target:n.external?"_blank":void 0,rel:n.external?"noopener noreferrer":void 0,class:a.normalizeClass(n.buttonClasses),style:a.normalizeStyle(n.buttonStyles),onClick:o},[a.createVNode(Wt,{loading:n.loading,"loading-text":n.loadingText,icon:n.icon,"text-align":n.textAlign},{"leading-icon":a.withCtx(()=>[a.renderSlot(s.$slots,"leading-icon")]),icon:a.withCtx(()=>[a.renderSlot(s.$slots,"icon")]),default:a.withCtx(()=>[a.renderSlot(s.$slots,"default")]),"trailing-icon":a.withCtx(()=>[a.renderSlot(s.$slots,"trailing-icon")]),_:3},8,["loading","loading-text","icon","text-align"])],14,Rd))}}),Di=a.defineComponent({__name:"UiButton.Nuxt",props:{to:{},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},loadingText:{},icon:{type:Boolean,default:!1},buttonClasses:{},buttonStyles:{},textAlign:{default:"center"}},emits:["click"],setup(n,{emit:e}){const t=a.getCurrentInstance(),r=a.computed(()=>t?.appContext.app.component("NuxtLink")?"NuxtLink":t?.appContext.app.component("RouterLink")?"RouterLink":"a"),i=n,o=e,s=l=>{if(i.disabled||i.loading){l.preventDefault();return}o("click",l)};return(l,c)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(r.value),{to:r.value!=="a"?n.to:void 0,href:r.value==="a"?typeof n.to=="string"?n.to:"/":void 0,class:a.normalizeClass(n.buttonClasses),style:a.normalizeStyle(n.buttonStyles),onClick:s},{default:a.withCtx(()=>[a.createVNode(Wt,{loading:n.loading,"loading-text":n.loadingText,icon:n.icon,"text-align":n.textAlign},{"leading-icon":a.withCtx(()=>[a.renderSlot(l.$slots,"leading-icon")]),icon:a.withCtx(()=>[a.renderSlot(l.$slots,"icon")]),default:a.withCtx(()=>[a.renderSlot(l.$slots,"default")]),"trailing-icon":a.withCtx(()=>[a.renderSlot(l.$slots,"trailing-icon")]),_:3},8,["loading","loading-text","icon","text-align"])]),_:3},8,["to","href","class","style"]))}}),Ii=a.defineComponent({__name:"UiButton.Vue",props:{to:{},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},loadingText:{},icon:{type:Boolean,default:!1},buttonClasses:{},buttonStyles:{},textAlign:{default:"center"}},emits:["click"],setup(n,{emit:e}){const t=n,r=e,i=o=>{if(t.disabled||t.loading){o.preventDefault();return}r("click",o)};return(o,s)=>{const l=a.resolveComponent("router-link");return a.openBlock(),a.createBlock(l,{to:n.to,class:a.normalizeClass(n.buttonClasses),style:a.normalizeStyle(n.buttonStyles),onClick:i},{default:a.withCtx(()=>[a.createVNode(Wt,{loading:n.loading,"loading-text":n.loadingText,icon:n.icon,"text-align":n.textAlign},{"leading-icon":a.withCtx(()=>[a.renderSlot(o.$slots,"leading-icon")]),icon:a.withCtx(()=>[a.renderSlot(o.$slots,"icon")]),default:a.withCtx(()=>[a.renderSlot(o.$slots,"default")]),"trailing-icon":a.withCtx(()=>[a.renderSlot(o.$slots,"trailing-icon")]),_:3},8,["loading","loading-text","icon","text-align"])]),_:3},8,["to","class","style"])}}}),Ld={class:"ui-tooltip-content"},zd=a.defineComponent({inheritAttrs:!1,__name:"UiTooltip",props:{content:{default:""},position:{default:"top"},delay:{default:500},disabled:{type:Boolean,default:!1},offset:{default:8},maxWidth:{default:250}},setup(n){const e=n,t=a.ref(),r=a.ref(),i=a.ref(!1),o=a.ref(!1);let s=null,l=null;const c=a.ref({}),d=async()=>{if(!t.value||!r.value||!o.value)return;await a.nextTick();const h=t.value.getBoundingClientRect();r.value.style.visibility="hidden",r.value.style.opacity="1";const p=r.value.getBoundingClientRect(),m=p.width,g=p.height;r.value.style.visibility="",r.value.style.opacity="";const y=window.innerWidth,k=window.innerHeight;let S=0,x=0;switch(e.position){case"top":S=h.top-g-e.offset,x=h.left+h.width/2-m/2;break;case"bottom":S=h.bottom+e.offset,x=h.left+h.width/2-m/2;break;case"left":S=h.top+h.height/2-g/2,x=h.left-m-e.offset;break;case"right":S=h.top+h.height/2-g/2,x=h.right+e.offset;break}const b=8;x<b?x=b:x+m>y-b&&(x=y-m-b),S<b?S=b:S+g>k-b&&(S=k-g-b),c.value={position:"fixed",top:`${S}px`,left:`${x}px`,zIndex:"9999"}},u=()=>{e.disabled||(l&&(clearTimeout(l),l=null),o.value=!0,a.nextTick(()=>{d()}),s=setTimeout(()=>{i.value=!0},e.delay))},f=()=>{s&&(clearTimeout(s),s=null),l=setTimeout(()=>{i.value=!1,setTimeout(()=>{o.value=!1},200)},100)};return a.onUnmounted(()=>{s&&clearTimeout(s),l&&clearTimeout(l)}),(h,p)=>(a.openBlock(),a.createElementBlock("div",a.mergeProps({ref_key:"tooltipContainer",ref:t,class:"ui-tooltip-container"},h.$attrs,{onMouseenter:u,onMouseleave:f}),[a.renderSlot(h.$slots,"default",{},void 0,!0),(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[o.value?(a.openBlock(),a.createElementBlock("div",{key:0,ref_key:"tooltipRef",ref:r,class:a.normalizeClass(["ui-tooltip",[`ui-tooltip--${n.position}`,{"ui-tooltip--visible":i.value}]]),style:a.normalizeStyle(c.value),role:"tooltip"},[a.createElementVNode("div",Ld,[a.renderSlot(h.$slots,"tooltip",{},()=>[a.createTextVNode(a.toDisplayString(n.content),1)],!0)]),a.createElementVNode("div",{class:a.normalizeClass(["ui-tooltip-arrow",`ui-tooltip-arrow--${n.position}`])},null,2)],6)):a.createCommentVNode("",!0)]))],16))}}),Tl=de(zd,[["__scopeId","data-v-ba66edda"]]),Pd=["type","disabled","tabindex"],Vd=["type","disabled","tabindex"],Fd=a.defineComponent({inheritAttrs:!1,__name:"UiButton",props:{variant:{default:"primary"},size:{default:"md"},type:{default:"button"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},loadingText:{},fullWidth:{type:Boolean,default:!1},color:{default:"primary"},fontWeight:{default:600},icon:{type:Boolean,default:!1},squircle:{type:Boolean,default:!1},to:{},href:{},external:{type:Boolean,default:!1},tabindex:{},title:{},textAlign:{default:"center"}},emits:["click"],setup(n,{emit:e}){const t=n,r=a.computed(()=>t.title?typeof t.title=="string"?{content:t.title,position:"top",disabled:t.disabled||t.loading}:{...t.title,disabled:t.title.disabled??(t.disabled||t.loading)}:null),i=a.computed(()=>!!(typeof process<"u"&&process.client!==void 0||typeof window<"u"&&(window.__NUXT__||window.$nuxt))),o=a.computed(()=>{try{if(typeof window<"u"&&window.Vue?.Router)return!0}catch{}return!1}),s=a.computed(()=>["ui-button",`ui-button-${t.variant}`,`ui-button-${t.size}`,`ui-button-color-${t.color}`,t.loading?"ui-button-loading":"",t.disabled?"ui-button-disabled":"",t.fullWidth?"ui-button-full-width":"",t.icon?"ui-button-icon":"",t.squircle?"ui-button-squircle":""].filter(Boolean)),l=a.computed(()=>s.value.join(" ")),c=a.computed(()=>({fontWeight:t.fontWeight})),d=a.computed(()=>t.disabled||t.loading?-1:t.tabindex??void 0);return(u,f)=>n.title?(a.openBlock(),a.createBlock(Tl,a.normalizeProps(a.mergeProps({key:0},r.value)),{default:a.withCtx(()=>[n.to?i.value&&n.to?(a.openBlock(),a.createBlock(Di,{key:1,to:n.to,disabled:n.disabled,loading:n.loading,"loading-text":n.loadingText,icon:n.icon,"button-classes":s.value,"button-styles":c.value,tabindex:d.value,"text-align":n.textAlign,onClick:f[1]||(f[1]=h=>u.$emit("click",h))},a.createSlots({icon:a.withCtx(()=>[a.renderSlot(u.$slots,"icon",{},void 0,!0)]),default:a.withCtx(()=>[a.renderSlot(u.$slots,"default",{},void 0,!0)]),_:2},[u.$slots["leading-icon"]?{name:"leading-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"leading-icon",{},void 0,!0)]),key:"0"}:void 0,u.$slots["trailing-icon"]?{name:"trailing-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"trailing-icon",{},void 0,!0)]),key:"1"}:void 0]),1032,["to","disabled","loading","loading-text","icon","button-classes","button-styles","tabindex","text-align"])):o.value&&n.to?(a.openBlock(),a.createBlock(Ii,{key:2,to:n.to,disabled:n.disabled,loading:n.loading,"loading-text":n.loadingText,icon:n.icon,"button-classes":s.value,"button-styles":c.value,tabindex:d.value,"text-align":n.textAlign,onClick:f[2]||(f[2]=h=>u.$emit("click",h))},a.createSlots({icon:a.withCtx(()=>[a.renderSlot(u.$slots,"icon",{},void 0,!0)]),default:a.withCtx(()=>[a.renderSlot(u.$slots,"default",{},void 0,!0)]),_:2},[u.$slots["leading-icon"]?{name:"leading-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"leading-icon",{},void 0,!0)]),key:"0"}:void 0,u.$slots["trailing-icon"]?{name:"trailing-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"trailing-icon",{},void 0,!0)]),key:"1"}:void 0]),1032,["to","disabled","loading","loading-text","icon","button-classes","button-styles","tabindex","text-align"])):(a.openBlock(),a.createBlock(Oi,{key:3,to:n.to,href:n.href,external:n.external,disabled:n.disabled,loading:n.loading,"loading-text":n.loadingText,icon:n.icon,"button-classes":s.value,"button-styles":c.value,tabindex:d.value,"text-align":n.textAlign,onClick:f[3]||(f[3]=h=>u.$emit("click",h))},a.createSlots({icon:a.withCtx(()=>[a.renderSlot(u.$slots,"icon",{},void 0,!0)]),default:a.withCtx(()=>[a.renderSlot(u.$slots,"default",{},void 0,!0)]),_:2},[u.$slots["leading-icon"]?{name:"leading-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"leading-icon",{},void 0,!0)]),key:"0"}:void 0,u.$slots["trailing-icon"]?{name:"trailing-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"trailing-icon",{},void 0,!0)]),key:"1"}:void 0]),1032,["to","href","external","disabled","loading","loading-text","icon","button-classes","button-styles","tabindex","text-align"])):(a.openBlock(),a.createElementBlock("button",a.mergeProps({key:0},u.$attrs,{type:n.type,disabled:n.disabled||n.loading,class:l.value,style:c.value,tabindex:d.value,onClick:f[0]||(f[0]=h=>u.$emit("click",h))}),[a.createVNode(Wt,{loading:n.loading,"loading-text":n.loadingText,icon:n.icon,size:n.size,"text-align":n.textAlign},a.createSlots({icon:a.withCtx(()=>[a.renderSlot(u.$slots,"icon",{},void 0,!0)]),default:a.withCtx(()=>[a.renderSlot(u.$slots,"default",{},void 0,!0)]),_:2},[u.$slots["leading-icon"]?{name:"leading-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"leading-icon",{},void 0,!0)]),key:"0"}:void 0,u.$slots["trailing-icon"]?{name:"trailing-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"trailing-icon",{},void 0,!0)]),key:"1"}:void 0]),1032,["loading","loading-text","icon","size","text-align"])],16,Pd))]),_:3},16)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[n.to?i.value&&n.to?(a.openBlock(),a.createBlock(Di,{key:1,to:n.to,disabled:n.disabled,loading:n.loading,"loading-text":n.loadingText,icon:n.icon,"button-classes":s.value,"button-styles":c.value,tabindex:d.value,"text-align":n.textAlign,onClick:f[5]||(f[5]=h=>u.$emit("click",h))},a.createSlots({icon:a.withCtx(()=>[a.renderSlot(u.$slots,"icon",{},void 0,!0)]),default:a.withCtx(()=>[a.renderSlot(u.$slots,"default",{},void 0,!0)]),_:2},[u.$slots["leading-icon"]?{name:"leading-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"leading-icon",{},void 0,!0)]),key:"0"}:void 0,u.$slots["trailing-icon"]?{name:"trailing-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"trailing-icon",{},void 0,!0)]),key:"1"}:void 0]),1032,["to","disabled","loading","loading-text","icon","button-classes","button-styles","tabindex","text-align"])):o.value&&n.to?(a.openBlock(),a.createBlock(Ii,{key:2,to:n.to,disabled:n.disabled,loading:n.loading,"loading-text":n.loadingText,icon:n.icon,"button-classes":s.value,"button-styles":c.value,tabindex:d.value,"text-align":n.textAlign,onClick:f[6]||(f[6]=h=>u.$emit("click",h))},a.createSlots({icon:a.withCtx(()=>[a.renderSlot(u.$slots,"icon",{},void 0,!0)]),default:a.withCtx(()=>[a.renderSlot(u.$slots,"default",{},void 0,!0)]),_:2},[u.$slots["leading-icon"]?{name:"leading-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"leading-icon",{},void 0,!0)]),key:"0"}:void 0,u.$slots["trailing-icon"]?{name:"trailing-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"trailing-icon",{},void 0,!0)]),key:"1"}:void 0]),1032,["to","disabled","loading","loading-text","icon","button-classes","button-styles","tabindex","text-align"])):(a.openBlock(),a.createBlock(Oi,{key:3,to:n.to,href:n.href,external:n.external,disabled:n.disabled,loading:n.loading,"loading-text":n.loadingText,icon:n.icon,"button-classes":s.value,"button-styles":c.value,tabindex:d.value,"text-align":n.textAlign,onClick:f[7]||(f[7]=h=>u.$emit("click",h))},a.createSlots({icon:a.withCtx(()=>[a.renderSlot(u.$slots,"icon",{},void 0,!0)]),default:a.withCtx(()=>[a.renderSlot(u.$slots,"default",{},void 0,!0)]),_:2},[u.$slots["leading-icon"]?{name:"leading-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"leading-icon",{},void 0,!0)]),key:"0"}:void 0,u.$slots["trailing-icon"]?{name:"trailing-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"trailing-icon",{},void 0,!0)]),key:"1"}:void 0]),1032,["to","href","external","disabled","loading","loading-text","icon","button-classes","button-styles","tabindex","text-align"])):(a.openBlock(),a.createElementBlock("button",a.mergeProps({key:0},u.$attrs,{type:n.type,disabled:n.disabled||n.loading,class:l.value,style:c.value,tabindex:d.value,onClick:f[4]||(f[4]=h=>u.$emit("click",h))}),[a.createVNode(Wt,{loading:n.loading,"loading-text":n.loadingText,icon:n.icon,size:n.size,"text-align":n.textAlign},a.createSlots({icon:a.withCtx(()=>[a.renderSlot(u.$slots,"icon",{},void 0,!0)]),default:a.withCtx(()=>[a.renderSlot(u.$slots,"default",{},void 0,!0)]),_:2},[u.$slots["leading-icon"]?{name:"leading-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"leading-icon",{},void 0,!0)]),key:"0"}:void 0,u.$slots["trailing-icon"]?{name:"trailing-icon",fn:a.withCtx(()=>[a.renderSlot(u.$slots,"trailing-icon",{},void 0,!0)]),key:"1"}:void 0]),1032,["loading","loading-text","icon","size","text-align"])],16,Vd))],64))}}),W=de(Fd,[["__scopeId","data-v-0e5b129a"]]),Hd={key:0,class:"ui-card-header"},jd={key:0,class:"ui-card-title-wrapper"},Ud={key:0,class:"ui-card-title"},qd={key:0,class:"ui-card-subtitle"},Wd={key:1,class:"ui-card-content"},Kd={key:2,class:"ui-card-footer"},Jd=a.defineComponent({inheritAttrs:!1,__name:"UiCard",props:{variant:{default:"default"},padding:{default:"md"},shadow:{default:"sm"},color:{default:"default"},title:{},subtitle:{},to:{}},setup(n){const e=n,t=a.useAttrs(),r=a.getCurrentInstance(),i=a.computed(()=>e.to?r?.appContext.app.component("NuxtLink")?"NuxtLink":r?.appContext.app.component("RouterLink")?"RouterLink":"a":null),o=a.computed(()=>e.to?i.value||"a":"div"),s=a.computed(()=>{const d=o.value;return d==="NuxtLink"||d==="RouterLink"}),l=a.computed(()=>o.value==="a"&&!!e.to),c=a.computed(()=>[`ui-card-${e.variant}`,`ui-card-padding-${e.padding}`,`ui-card-shadow-${e.shadow}`,`ui-card-color-${e.color}`,t.class]);return(d,u)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.value),{to:s.value?n.to:void 0,href:l.value?typeof n.to=="string"?n.to:"":void 0,class:a.normalizeClass(["ui-card",[c.value,{"ui-card-linkable":!!n.to}]])},{default:a.withCtx(()=>[d.$slots.header||n.title||n.subtitle||d.$slots["leading-icon"]||d.$slots["trailing-icon"]?(a.openBlock(),a.createElementBlock("div",Hd,[a.renderSlot(d.$slots,"header",{},()=>[a.renderSlot(d.$slots,"leading-icon",{},void 0,!0),n.title||d.$slots.title||n.subtitle||d.$slots.subtitle?(a.openBlock(),a.createElementBlock("div",jd,[n.title||d.$slots.title?a.renderSlot(d.$slots,"title",{key:0},()=>[n.title?(a.openBlock(),a.createElementBlock("h2",Ud,a.toDisplayString(n.title),1)):a.createCommentVNode("",!0)],!0):a.createCommentVNode("",!0),n.subtitle||d.$slots.subtitle?a.renderSlot(d.$slots,"subtitle",{key:1},()=>[n.subtitle?(a.openBlock(),a.createElementBlock("p",qd,a.toDisplayString(n.subtitle),1)):a.createCommentVNode("",!0)],!0):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),a.renderSlot(d.$slots,"trailing-icon",{},void 0,!0),a.renderSlot(d.$slots,"actions",{},void 0,!0)],!0)])):a.createCommentVNode("",!0),d.$slots.default?(a.openBlock(),a.createElementBlock("div",Wd,[a.renderSlot(d.$slots,"default",{},void 0,!0)])):a.createCommentVNode("",!0),d.$slots.footer?(a.openBlock(),a.createElementBlock("div",Kd,[a.renderSlot(d.$slots,"footer",{},void 0,!0)])):a.createCommentVNode("",!0)]),_:3},8,["to","href","class"]))}}),uo=de(Jd,[["__scopeId","data-v-5bb4dec2"]]);const es=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Gd=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase()),Yd=n=>{const e=Gd(n);return e.charAt(0).toUpperCase()+e.slice(1)},Qd=(...n)=>n.filter((e,t,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===t).join(" ").trim(),ts=n=>n==="";var en={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const Xd=({name:n,iconNode:e,absoluteStrokeWidth:t,"absolute-stroke-width":r,strokeWidth:i,"stroke-width":o,size:s=en.width,color:l=en.stroke,...c},{slots:d})=>a.h("svg",{...en,...c,width:s,height:s,stroke:l,"stroke-width":ts(t)||ts(r)||t===!0||r===!0?Number(i||o||en["stroke-width"])*24/Number(s):i||o||en["stroke-width"],class:Qd("lucide",c.class,...n?[`lucide-${es(Yd(n))}-icon`,`lucide-${es(n)}`]:["lucide-icon"])},[...e.map(u=>a.h(...u)),...d.default?[d.default()]:[]]);const J=(n,e)=>(t,{slots:r,attrs:i})=>a.h(Xd,{...i,...t,iconNode:e,name:n},r);const Zd=J("align-center",[["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 18H5",key:"18s9l3"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);const _d=J("align-left",[["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 18H3",key:"1amg6g"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);const eu=J("align-right",[["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 18H7",key:"1ygte8"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);const tu=J("bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);const nu=J("calendar-clock",[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]);const ru=J("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);const iu=J("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Pr=J("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const ou=J("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);const su=J("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const lu=J("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const au=J("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);const cu=J("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);const du=J("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const uu=J("file-input",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 15h10",key:"jfw4w8"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);const fu=J("heading-1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]);const hu=J("heading-2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]);const pu=J("heading-3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]);const mu=J("italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);const gu=J("list-ordered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);const yu=J("list",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);const El=J("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const ku=J("quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);const bu=J("redo",[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]]);const vu=J("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);const xu=J("strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]);const wu=J("underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);const Cu=J("undo",[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]]);const fo=J("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Su={key:0,class:"input-leading-icon"},Mu=["id","type","value","placeholder","disabled","readonly","required","min","max","step","autocomplete","spellcheck","tabindex"],Tu={key:1,class:"input-trailing-icon"},Eu={key:2,class:"input-trailing-icon"},Nu={key:3,class:"input-trailing-icon"},Au=a.defineComponent({__name:"UiInput.Text",props:{type:{default:"text"},min:{},max:{},step:{},autocomplete:{},spellcheck:{type:Boolean,default:!0},hasLeadingIcon:{type:Boolean,default:!1},hasTrailingIcon:{type:Boolean,default:!1},label:{},helpText:{},modelValue:{},value:{},placeholder:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},fullWidth:{type:Boolean},inputId:{},error:{type:[Boolean,String,Error],default:!1},size:{default:"md"},tabindex:{}},emits:["update:modelValue","blur","focus","keydown"],setup(n,{emit:e}){const t=n,r=e,i=a.ref(!1),o=a.computed(()=>t.type==="password"?i.value?"text":"password":t.type),s=a.computed(()=>t.hasTrailingIcon||t.type==="password"||t.type==="search"&&t.modelValue),l=a.computed(()=>{if(t.tabindex!==void 0)return t.tabindex+1}),c=a.computed(()=>{const y=[];return t.error&&y.push("input-error"),t.disabled&&y.push("input-disabled"),t.readonly&&y.push("input-readonly"),y.push(`input-size-${t.size}`),y}),d=a.computed(()=>{const y=[];return t.hasLeadingIcon?y.push("input-padding-left-icon"):y.push("input-padding-left"),s.value?y.push("input-padding-right-icon"):y.push("input-padding-right"),y}),u=y=>{let S=y.target.value;t.type==="number"&&S!==""&&(S=parseFloat(S)||0),r("update:modelValue",S)},f=y=>{r("blur",y)},h=y=>{r("focus",y)},p=y=>{r("keydown",y)},m=()=>{i.value=!i.value},g=()=>{r("update:modelValue","")};return(y,k)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["input-field-wrapper",c.value])},[a.renderSlot(y.$slots,"leading",{},void 0,!0),t.hasLeadingIcon?(a.openBlock(),a.createElementBlock("div",Su,[a.renderSlot(y.$slots,"leading-icon",{},void 0,!0)])):a.createCommentVNode("",!0),a.createElementVNode("input",{id:n.inputId,type:o.value,value:n.modelValue,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,required:n.required,min:n.min,max:n.max,step:n.step,autocomplete:n.autocomplete,spellcheck:n.spellcheck,tabindex:n.tabindex,class:a.normalizeClass(["input-base",d.value]),onInput:u,onBlur:f,onFocus:h,onKeydown:p},null,42,Mu),n.type==="password"?(a.openBlock(),a.createElementBlock("div",Tu,[a.createVNode(W,{color:i.value?"primary":"secondary",variant:i.value?"primary":"ghost",size:"sm",icon:"",squircle:"",tabindex:l.value,"aria-label":i.value?"Hide password":"Show password",onClick:m},{icon:a.withCtx(()=>[i.value?(a.openBlock(),a.createBlock(a.unref(cu),{key:0})):(a.openBlock(),a.createBlock(a.unref(du),{key:1}))]),_:1},8,["color","variant","tabindex","aria-label"])])):n.type==="search"&&n.modelValue&&!n.disabled&&!n.readonly?(a.openBlock(),a.createElementBlock("div",Eu,[a.createVNode(W,{color:"danger",variant:"ghost",size:"sm",icon:"",squircle:"",tabindex:l.value,"aria-label":"Clear search",onClick:g},{icon:a.withCtx(()=>[a.createVNode(a.unref(fo))]),_:1},8,["tabindex"])])):t.hasTrailingIcon?(a.openBlock(),a.createElementBlock("div",Nu,[a.renderSlot(y.$slots,"trailing-icon",{},void 0,!0)])):a.createCommentVNode("",!0),a.renderSlot(y.$slots,"trailing",{},void 0,!0)],2))}}),Bu=de(Au,[["__scopeId","data-v-4807b700"]]),Ou={key:0,class:"input-leading-icon"},Du=["id","value","placeholder","disabled","readonly","required","rows","cols","maxlength","autocomplete","spellcheck"],Iu={key:1,class:"input-trailing-icon"},$u=a.defineComponent({__name:"UiInput.Textarea",props:{rows:{default:3},cols:{},maxlength:{},autocomplete:{},spellcheck:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},hasLeadingIcon:{type:Boolean,default:!1},hasTrailingIcon:{type:Boolean,default:!1},label:{},helpText:{},modelValue:{},value:{},placeholder:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},fullWidth:{type:Boolean},inputId:{},error:{type:[Boolean,String,Error],default:!1},size:{default:"md"},tabindex:{}},emits:["update:modelValue","blur","focus","keydown"],setup(n,{emit:e}){const t=n,r=e,i=a.useSlots(),o=a.computed(()=>!!i.default),s=a.ref(null);a.onMounted(()=>{(t.modelValue===void 0||t.modelValue==="")&&o.value&&setTimeout(()=>{if(s.value){const p=s.value.textContent?.trim()||"";p&&r("update:modelValue",p)}},0)});const l=a.computed(()=>{const p=[];return t.error&&p.push("input-error"),t.disabled&&p.push("input-disabled"),t.readonly&&p.push("input-readonly"),p.push(`input-size-${t.size}`),p}),c=a.computed(()=>{const p=[];return t.hasLeadingIcon?p.push("input-padding-left-icon"):p.push("input-padding-left"),t.hasTrailingIcon?p.push("input-padding-right-icon"):p.push("input-padding-right"),p}),d=p=>{const m=p.target;r("update:modelValue",m.value)},u=p=>{r("blur",p)},f=p=>{r("focus",p)},h=p=>{r("keydown",p)};return(p,m)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["input-field-wrapper input-textarea",l.value])},[a.renderSlot(p.$slots,"leading",{},void 0,!0),t.hasLeadingIcon?(a.openBlock(),a.createElementBlock("div",Ou,[a.renderSlot(p.$slots,"leading-icon",{},void 0,!0)])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["textarea-wrapper",{"textarea-resizable":n.resizable}])},[a.createElementVNode("textarea",{id:n.inputId,value:n.modelValue,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,required:n.required,rows:n.rows,cols:n.cols,maxlength:n.maxlength,autocomplete:n.autocomplete,spellcheck:n.spellcheck,class:a.normalizeClass(["input-base",[{"input-textarea-resize":n.resizable},c.value]]),onInput:d,onBlur:u,onFocus:f,onKeydown:h},null,42,Du)],2),t.hasTrailingIcon?(a.openBlock(),a.createElementBlock("div",Iu,[a.renderSlot(p.$slots,"trailing-icon",{},void 0,!0)])):a.createCommentVNode("",!0),a.renderSlot(p.$slots,"trailing",{},void 0,!0),o.value?(a.openBlock(),a.createElementBlock("span",{key:2,ref_key:"slotContentRef",ref:s,class:"sr-only","aria-hidden":"true"},[a.renderSlot(p.$slots,"default",{},void 0,!0)],512)):a.createCommentVNode("",!0)],2))}}),Ru=de($u,[["__scopeId","data-v-5728c58e"]]);function Vr(n){const{trigger:e,floating:t,placement:r="bottom-start",offset:i=8,flip:o=!0,shift:s=!0,sameWidth:l=!1,autoUpdate:c=!1,clickOutside:d}=n,u=a.ref({position:"fixed",top:"0px",left:"0px",zIndex:"9999"}),f=async()=>{if(await a.nextTick(),!e.value||!t.value||typeof e.value.getBoundingClientRect!="function"||typeof t.value.getBoundingClientRect!="function")return;const x=e.value.getBoundingClientRect(),b=t.value.getBoundingClientRect(),[v,C="start"]=r.split("-");let w=0,M=0;switch(v){case"bottom":w=x.left,M=x.bottom+i;break;case"top":w=x.left,M=x.top-b.height-i;break;case"right":w=x.right+i,M=x.top;break;case"left":w=x.left-b.width-i,M=x.top;break}if(v==="top"||v==="bottom")switch(C){case"center":w=x.left+(x.width-b.width)/2;break;case"end":w=x.right-b.width;break}else if(v==="left"||v==="right")switch(C){case"center":M=x.top+(x.height-b.height)/2;break;case"end":M=x.bottom-b.height;break}let A=l?x.width:void 0;const $=window.innerWidth,U=window.innerHeight,j=8;let K=!1,N=!1;if(o){if(v==="bottom"&&M+b.height>U-j){const R=x.top-b.height-i;R>=j&&(M=R,K=!0)}else if(v==="top"&&M<j){const R=x.bottom+i;R+b.height<=U-j&&(M=R,K=!1)}if(v==="right"&&w+b.width>$-j){const R=x.left-b.width-i;R>=j&&(w=R,N=!0)}else if(v==="left"&&w<j){const R=x.right+i;R+b.width<=$-j&&(w=R,N=!1)}}s&&(w<j?w=j:w+b.width>$-j&&(w=$-b.width-j),M<j?M=j:M+b.height>U-j&&(M=U-b.height-j));const D={position:"fixed",zIndex:"9999",...A?{width:`${A}px`}:{}};K?D.bottom=`${U-M-b.height}px`:D.top=`${M}px`,N?D.right=`${$-w-b.width}px`:D.left=`${w}px`,u.value=D},h=()=>{f()};let p=null;const m=()=>{h()},g=()=>{if(h(),d?.enabled&&d.handler&&e.value){if(typeof e.value.getBoundingClientRect!="function")return;const x=e.value.getBoundingClientRect(),b=window.innerHeight,v=window.innerWidth;(x.bottom<0||x.top>b||x.right<0||x.left>v)&&d.handler()}},y=x=>{if(!d?.enabled||!d.handler)return;const b=x.target;if(!b||!e.value||!t.value||typeof e.value.contains!="function"||typeof t.value.contains!="function")return;const v=e.value.contains(b),C=t.value.contains(b);!v&&!C&&d.handler()},k=()=>{c&&(window.addEventListener("resize",m),window.addEventListener("scroll",g,!0),typeof ResizeObserver<"u"&&(p=new ResizeObserver(()=>{h()}),a.nextTick(()=>{e.value&&p&&typeof e.value.getBoundingClientRect=="function"&&p.observe(e.value),t.value&&p&&typeof t.value.getBoundingClientRect=="function"&&p.observe(t.value)}))),d?.enabled&&document.addEventListener("click",y,!0)},S=()=>{c&&(window.removeEventListener("resize",m),window.removeEventListener("scroll",g,!0)),d?.enabled&&document.removeEventListener("click",y,!0),p&&(p.disconnect(),p=null)};return a.onMounted(()=>{k()}),a.onUnmounted(()=>{S()}),{floatingStyle:u,updatePosition:h,cleanup:S}}const Lu={key:0,class:"input-leading-icon"},zu=["tabindex","aria-expanded","aria-controls","aria-disabled"],Pu={class:"input-select-value"},Vu={key:0,class:"input-select-text"},Fu={key:1,class:"input-select-placeholder"},Hu={key:1,class:"input-trailing-icon"},ju=["id","aria-multiselectable"],Uu={key:0,class:"input-dropdown-search"},qu={key:0,class:"input-dropdown-no-options"},Wu=["onClick","onMouseenter","aria-selected"],Ku={class:"input-dropdown-option-content"},Ju={class:"input-dropdown-option-text"},Gu={key:0,class:"input-dropdown-option-description"},Yu={key:0,class:"input-dropdown-option-check"},Qu=a.defineComponent({__name:"UiInput.Select",props:{options:{default:()=>[]},multiple:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},allowInsert:{type:Boolean,default:!1},maxDropdownHeight:{default:400},noOptionsText:{default:"No options available"},searchPlaceholder:{default:""},hasLeadingIcon:{type:Boolean,default:!1},hasTrailingIcon:{type:Boolean,default:!1},label:{},helpText:{},modelValue:{},value:{},placeholder:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean},required:{type:Boolean},fullWidth:{type:Boolean},inputId:{},error:{type:[Boolean,String,Error],default:!1},size:{default:"md"},tabindex:{}},emits:["update:modelValue","blur","focus"],setup(n,{emit:e}){const t=n,r=e,i=a.ref(),o=a.ref(),s=a.ref(),l=a.computed(()=>`dropdown-${t.inputId||Math.random().toString(36).substr(2,9)}`),c=a.computed(()=>{if(i.value){const N=i.value.closest('[role="dialog"][aria-modal="true"]');if(N)return N}return"body"}),d=a.ref({isOpen:!1,searchQuery:"",highlightedIndex:-1}),{floatingStyle:u,updatePosition:f,cleanup:h}=Vr({trigger:i,floating:o,placement:"bottom-start",offset:10,shift:!0,flip:!0,sameWidth:!0,autoUpdate:!0,clickOutside:{enabled:!0,handler:()=>{C()}}}),p=a.computed(()=>t.multiple?Array.isArray(t.modelValue)?t.modelValue:[]:t.modelValue!==void 0?[t.modelValue]:[]),m=a.computed(()=>{if(t.multiple){const N=t.options.filter(D=>p.value.includes(D.value));return N.length>0?`${N.length} selected`:null}else return t.options.find(D=>D.value===t.modelValue)?.label||null}),g=a.computed(()=>{let N=t.options;if(t.searchable&&d.value.searchQuery){const D=d.value.searchQuery.toLowerCase();N=t.options.filter(R=>R.label.toLowerCase().includes(D)||R.description?.toLowerCase().includes(D)),t.allowInsert&&t.multiple&&d.value.searchQuery.trim()&&(t.options.some(ke=>ke.label.toLowerCase()===d.value.searchQuery.toLowerCase())||(N=[{value:`__insert__${d.value.searchQuery}`,label:`Add "${d.value.searchQuery}"`,description:"Add as new item",disabled:!1},...N]))}return N}),y=a.computed(()=>t.searchPlaceholder&&t.searchPlaceholder.trim()!==""?t.searchPlaceholder:t.allowInsert&&t.multiple?"Search or create...":"Search..."),k=a.computed(()=>t.disabled?-1:t.tabindex??0),S=a.computed(()=>{if(t.tabindex!==void 0)return t.tabindex+1}),x=a.computed(()=>{const N=[];return t.error&&N.push("input-error"),t.disabled&&N.push("input-disabled"),N.push(`input-size-${t.size}`),N}),b=a.computed(()=>{const N=[];return t.hasLeadingIcon?N.push("input-padding-left-icon"):N.push("input-padding-left"),t.hasTrailingIcon?N.push("input-padding-right-icon"):N.push("input-padding-right"),N}),v=async()=>{if(!t.disabled){if(d.value.isOpen=!0,d.value.searchQuery="",await a.nextTick(),f(),d.value.highlightedIndex===-1){const N=g.value.findIndex(D=>!D.disabled);d.value.highlightedIndex=N>=0?N:0}if(t.searchable&&s.value){const N=s.value.$el?.querySelector("input");N&&N.focus()}document.addEventListener("keydown",j),r("focus",new FocusEvent("focus"))}},C=()=>{d.value.isOpen&&(d.value.isOpen=!1,d.value.highlightedIndex=-1,d.value.searchQuery="",document.removeEventListener("keydown",j),r("blur",new FocusEvent("blur")))},w=()=>{d.value.isOpen?C():v()},M=N=>N.value&&typeof N.value=="string"&&N.value.startsWith("__insert__")?!1:p.value.includes(N.value),A=N=>{if(!N.disabled)if(t.multiple){const D=[...p.value];if(N.value&&typeof N.value=="string"&&N.value.startsWith("__insert__")){const R=N.value.replace("__insert__","");D.includes(R)||D.push(R),d.value.searchQuery=""}else{const R=D.indexOf(N.value);R>-1?D.splice(R,1):D.push(N.value)}r("update:modelValue",D)}else r("update:modelValue",N.value),C()},$=N=>{if(["Enter"," ","ArrowDown","ArrowUp","Escape"].includes(N.key)&&(N.preventDefault(),!(d.value.isOpen&&(N.key==="ArrowDown"||N.key==="ArrowUp"))))switch(N.key){case"Enter":case" ":w();break;case"ArrowDown":case"ArrowUp":v();break;case"Escape":C();break}},U=N=>{switch(N.key){case"ArrowDown":N.preventDefault(),K(1);break;case"ArrowUp":N.preventDefault(),K(-1);break;case"Enter":if(N.preventDefault(),d.value.highlightedIndex>=0){const D=g.value[d.value.highlightedIndex];D&&!D.disabled&&A(D)}break;case"Escape":C();break}},j=N=>{if(d.value.isOpen)switch(N.key){case"Escape":C();break;case"ArrowDown":N.preventDefault(),K(1);break;case"ArrowUp":N.preventDefault(),K(-1);break;case"Enter":if(N.preventDefault(),d.value.highlightedIndex>=0){const D=g.value[d.value.highlightedIndex];D&&!D.disabled&&A(D)}break}},K=N=>{const D=g.value;if(D.length===0)return;let R=d.value.highlightedIndex+N;R<0?R=D.length-1:R>=D.length&&(R=0);let ke=0;for(;D[R]?.disabled&&ke<D.length;)R+=N,R<0&&(R=D.length-1),R>=D.length&&(R=0),ke++;d.value.highlightedIndex=R};return a.onUnmounted(()=>{d.value.isOpen&&C(),document.removeEventListener("keydown",j),h()}),(N,D)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",{class:a.normalizeClass(["input-field-wrapper",[x.value,b.value]])},[a.renderSlot(N.$slots,"leading",{},void 0,!0),t.hasLeadingIcon?(a.openBlock(),a.createElementBlock("div",Lu,[a.renderSlot(N.$slots,"leading-icon",{},void 0,!0)])):a.createCommentVNode("",!0),a.createElementVNode("div",{ref_key:"selectTriggerRef",ref:i,class:a.normalizeClass(["input-select-trigger",{"input-select-open":d.value.isOpen}]),onClick:w,onKeydown:$,tabindex:k.value,role:"combobox","aria-expanded":d.value.isOpen,"aria-haspopup":!0,"aria-controls":l.value,"aria-disabled":n.disabled},[a.createElementVNode("div",Pu,[m.value?(a.openBlock(),a.createElementBlock("span",Vu,a.toDisplayString(m.value),1)):(a.openBlock(),a.createElementBlock("span",Fu,a.toDisplayString(n.placeholder||"Select an option..."),1))]),a.createElementVNode("div",{class:a.normalizeClass(["input-select-arrow",{"input-select-arrow-open":d.value.isOpen}])},[a.createVNode(a.unref(Pr))],2)],42,zu),t.hasTrailingIcon?(a.openBlock(),a.createElementBlock("div",Hu,[a.renderSlot(N.$slots,"trailing-icon",{},void 0,!0)])):a.createCommentVNode("",!0),a.renderSlot(N.$slots,"trailing",{},void 0,!0)],2),(a.openBlock(),a.createBlock(a.Teleport,{to:c.value},[d.value.isOpen?(a.openBlock(),a.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:o,id:l.value,class:a.normalizeClass(["input-dropdown",{"input-dropdown--multiple":n.multiple}]),style:a.normalizeStyle(a.unref(u)),role:"listbox","aria-multiselectable":n.multiple,onMousedown:D[1]||(D[1]=a.withModifiers(()=>{},["prevent"]))},[n.searchable?(a.openBlock(),a.createElementBlock("div",Uu,[a.createVNode(ni,{ref_key:"searchInputRef",ref:s,modelValue:d.value.searchQuery,"onUpdate:modelValue":D[0]||(D[0]=R=>d.value.searchQuery=R),type:"search",placeholder:y.value,size:"sm",tabindex:S.value,onKeydown:U},{"leading-icon":a.withCtx(()=>[a.createVNode(a.unref(vu))]),_:1},8,["modelValue","placeholder","tabindex"])])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:"input-dropdown-options",style:a.normalizeStyle({maxHeight:`${n.maxDropdownHeight}px`})},[g.value.length===0?(a.openBlock(),a.createElementBlock("div",qu,[a.renderSlot(N.$slots,"zero-state",{},()=>[a.createTextVNode(a.toDisplayString(n.noOptionsText),1)],!0)])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(g.value,(R,ke)=>(a.openBlock(),a.createElementBlock("div",{key:R.value,class:a.normalizeClass(["input-dropdown-option",{"input-dropdown-option--selected":M(R),"input-dropdown-option--highlighted":ke===d.value.highlightedIndex,"input-dropdown-option--disabled":R.disabled,"input-dropdown-option--insert":R.value&&typeof R.value=="string"&&R.value.startsWith("__insert__")}]),onClick:ri=>A(R),onMouseenter:ri=>d.value.highlightedIndex=ke,role:"option","aria-selected":M(R)},[a.createElementVNode("div",Ku,[a.createElementVNode("div",Ju,a.toDisplayString(R.label),1),R.description?(a.openBlock(),a.createElementBlock("div",Gu,a.toDisplayString(R.description),1)):a.createCommentVNode("",!0)]),n.multiple&&M(R)?(a.openBlock(),a.createElementBlock("div",Yu,[a.createVNode(a.unref(iu))])):a.createCommentVNode("",!0)],42,Wu))),128))],4)],46,ju)):a.createCommentVNode("",!0)],8,["to"]))],64))}}),Xu=de(Qu,[["__scopeId","data-v-e9ac7d68"]]),Zu={class:"input-leading-icon"},_u=["src"],ef=["id","accept","multiple","disabled","required"],tf={class:"input-file-content"},nf={key:0,class:"input-file-selected"},rf={class:"input-file-list"},of={class:"input-file-item"},sf={class:"input-file-name"},lf={key:1,class:"input-file-prompt"},af={class:"input-file-prompt-text"},cf={key:0,class:"input-file-accept-text"},df={key:2,class:"input-file-selected"},uf={class:"input-file-selected-text"},ff={class:"input-file-list"},hf={class:"input-file-name"},pf={class:"input-file-size"},mf={key:0,class:"input-trailing-icon"},gf={key:1,class:"input-trailing-icon"},yf=a.defineComponent({__name:"UiInput.File",props:{accept:{},multiple:{type:Boolean,default:!1},maxFileSize:{default:10*1024*1024},dragDropText:{},selectedText:{},preview:{},hasLeadingIcon:{type:Boolean,default:!1},hasTrailingIcon:{type:Boolean,default:!1},label:{},helpText:{},modelValue:{},value:{},placeholder:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean},required:{type:Boolean,default:!1},fullWidth:{type:Boolean},inputId:{},error:{type:[Boolean,String,Error],default:!1},size:{default:"md"},tabindex:{}},emits:["update:modelValue","file-error","clear-preview","blur","focus"],setup(n,{emit:e}){const t=n,r=e,i=a.ref(),o=a.ref(!1),s=a.ref(null),l=a.ref([]),c=a.computed(()=>t.preview?t.preview:s.value);a.computed(()=>!!t.preview);const d=a.computed(()=>t.preview?t.preview:null),u=a.computed(()=>{const M=[];return t.error&&M.push("input-error"),t.disabled&&M.push("input-disabled"),M.push(`input-size-${t.size}`),M}),f=a.computed(()=>{const M=[];return M.push("input-padding-left-icon"),l.value.length>0||d.value||t.disabled?M.push("input-padding-right-icon"):M.push("input-padding-right"),M}),h=M=>{if(t.maxFileSize&&M.size>t.maxFileSize)return`File "${M.name}" is too large. Maximum size is ${y(t.maxFileSize)}.`;if(t.accept){const A=t.accept.split(",").map(K=>K.trim().toLowerCase()),$=M.type.toLowerCase(),U="."+M.name.split(".").pop()?.toLowerCase();if(!A.some(K=>{if(K.startsWith("."))return U===K;if(K.includes("*")){const N=K.split("/")[0];return $.startsWith(N)}return $===K}))return`File "${M.name}" is not an accepted file type.`}return null},p=M=>{for(const A of M){const $=h(A);if($){r("file-error",$);return}}t.multiple?l.value=[...l.value,...M]:l.value=M.slice(0,1),t.multiple?r("update:modelValue",l.value):r("update:modelValue",l.value[0]||null),!t.multiple&&l.value.length>0&&l.value[0].type.startsWith("image/")&&m(l.value[0])},m=M=>{s.value&&URL.revokeObjectURL(s.value);const A=new FileReader;A.onload=$=>{s.value=$.target?.result},A.readAsDataURL(M)},g=()=>{l.value=[],r("update:modelValue",t.multiple?[]:null),s.value&&(URL.revokeObjectURL(s.value),s.value=null),i.value&&(i.value.value=""),t.preview&&r("clear-preview")},y=M=>{if(M===0)return"0 Bytes";const A=1024,$=["Bytes","KB","MB","GB"],U=Math.floor(Math.log(M)/Math.log(A));return parseFloat((M/Math.pow(A,U)).toFixed(2))+" "+$[U]},k=()=>{!t.disabled&&i.value&&i.value.click()},S=M=>{const A=M.target,$=Array.from(A.files||[]);$.length>0&&p($)},x=M=>{t.disabled||(o.value=!0)},b=M=>{o.value=!1},v=M=>{if(t.disabled)return;o.value=!1;const A=Array.from(M.dataTransfer?.files||[]);A.length>0&&p(A)},C=M=>{r("blur",M)},w=M=>{r("focus",M)};return a.watch(()=>t.modelValue,M=>{M?Array.isArray(M)?l.value=M:(l.value=[M],M.type.startsWith("image/")&&m(M)):(l.value=[],s.value&&(URL.revokeObjectURL(s.value),s.value=null))},{immediate:!0}),a.onUnmounted(()=>{s.value&&URL.revokeObjectURL(s.value)}),(M,A)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["input-field-wrapper",[u.value,f.value]])},[a.renderSlot(M.$slots,"leading",{},void 0,!0),a.createElementVNode("div",Zu,[c.value?(a.openBlock(),a.createElementBlock("img",{key:0,src:c.value,alt:"Preview",class:"input-file-preview"},null,8,_u)):t.hasLeadingIcon?a.renderSlot(M.$slots,"leading-icon",{key:1},void 0,!0):(a.openBlock(),a.createBlock(a.unref(uu),{key:2}))]),a.createElementVNode("div",{class:a.normalizeClass(["input-file-area",{"input-file-dragover":o.value,"input-file-disabled":n.disabled}]),onClick:k,onDragover:a.withModifiers(x,["prevent"]),onDragleave:a.withModifiers(b,["prevent"]),onDrop:a.withModifiers(v,["prevent"])},[a.createElementVNode("input",{ref_key:"fileInputRef",ref:i,id:n.inputId,type:"file",accept:n.accept,multiple:n.multiple,disabled:n.disabled,required:n.required,class:"input-file-hidden",onChange:S,onBlur:C,onFocus:w},null,40,ef),a.createElementVNode("div",tf,[d.value&&l.value.length===0?(a.openBlock(),a.createElementBlock("div",nf,[A[0]||(A[0]=a.createElementVNode("div",{class:"input-file-selected-text"}," File loaded ",-1)),a.createElementVNode("div",rf,[a.createElementVNode("div",of,[a.createElementVNode("span",sf,a.toDisplayString(d.value),1)])])])):l.value.length===0?(a.openBlock(),a.createElementBlock("div",lf,[a.createElementVNode("div",af,a.toDisplayString(n.dragDropText||"Click to select or drag and drop"),1),n.accept?(a.openBlock(),a.createElementBlock("div",cf,a.toDisplayString(n.accept),1)):a.createCommentVNode("",!0)])):(a.openBlock(),a.createElementBlock("div",df,[a.createElementVNode("div",uf,a.toDisplayString(n.selectedText||`${l.value.length} file(s) selected`),1),a.createElementVNode("div",ff,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(l.value,($,U)=>(a.openBlock(),a.createElementBlock("div",{key:U,class:"input-file-item"},[a.createElementVNode("span",hf,a.toDisplayString($.name),1),a.createElementVNode("span",pf,"("+a.toDisplayString(y($.size))+")",1)]))),128))])]))])],34),(l.value.length>0||d.value)&&!n.disabled?(a.openBlock(),a.createElementBlock("div",mf,[a.createElementVNode("button",{type:"button",class:"input-file-clear",onClick:a.withModifiers(g,["stop"]),"aria-label":"Clear selected files"},[a.createVNode(a.unref(fo))])])):t.hasTrailingIcon?(a.openBlock(),a.createElementBlock("div",gf,[a.renderSlot(M.$slots,"trailing-icon",{},void 0,!0)])):a.createCommentVNode("",!0),a.renderSlot(M.$slots,"trailing",{},void 0,!0)],2))}}),kf=de(yf,[["__scopeId","data-v-3c7bee41"]]),bf={class:"tabs-wrapper"},vf={key:0,class:"tabs-before"},xf=["aria-selected","id","onClick"],wf={key:1,class:"tabs-after"},Cf=["aria-labelledby"],Sf=a.defineComponent({__name:"UiTabs",props:{modelValue:{},tabs:{},underlineWidth:{default:"5rem"},orientation:{default:"horizontal"},size:{default:"md"},variant:{default:"default"},tabWidth:{default:"fill"},sticky:{default:null}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,r=e,i=a.useSlots(),o=a.computed(()=>!!i.content),s=a.computed(()=>t.tabs.find(x=>x.value===t.modelValue)),l=a.ref([]),c=a.ref(!1),d=a.ref({width:"0px",height:"0px",left:"0px",top:"0px",opacity:"0"}),u=a.ref({width:"0px",height:"0px",left:"0px",top:"0px",opacity:"0"});let f=-1,h=!1;const p=(x,b)=>{const v=x.getBoundingClientRect(),C=b.getBoundingClientRect(),w=getComputedStyle(b),M=parseFloat(w.getPropertyValue("--underline-thickness")||"5");let A=5;t.size==="sm"?A=4:t.size==="lg"&&(A=6);const $=C.height;if(t.orientation==="vertical"){const U=v.top-C.top;return{height:v.height-A*4,top:U+A*2,width:M,left:A-M/2}}else{const U=v.left-C.left,j=v.width;if(t.underlineWidth==="full")return{width:j-30,left:U+15,height:M,top:$-A-M/2};let K;if(t.underlineWidth.endsWith("%")){const D=parseFloat(t.underlineWidth)/100;K=j*D}else if(t.underlineWidth.endsWith("px"))K=parseFloat(t.underlineWidth);else if(t.underlineWidth.endsWith("rem")){const D=parseFloat(t.underlineWidth),R=parseFloat(getComputedStyle(document.documentElement).fontSize);K=D*R}else K=parseFloat(t.underlineWidth)||j;const N=(j-K)/2;return{width:K,left:U+N,height:M,top:$-A-M/2}}},m=async(x,b)=>{h||(r("update:modelValue",x),await a.nextTick(),g(b))},g=async x=>{if(!l.value[x]||x===f)return;h=!0;const b=l.value[x],v=b.parentElement;if(!v)return;const C=p(b,v),w=b.getBoundingClientRect(),M=v.getBoundingClientRect();let A,$;if(t.orientation==="vertical"?(A=w.top-M.top,$=w.height):(A=w.left-M.left,$=w.width),f===-1){t.orientation==="vertical"?(d.value={height:`${C.height}px`,top:`${C.top}px`,width:`${C.width}px`,left:`${C.left}px`,opacity:"1"},u.value={height:`${$}px`,top:`${A}px`,width:`${w.width}px`,left:"0",opacity:"1"}):(d.value={width:`${C.width}px`,left:`${C.left}px`,height:`${C.height}px`,top:`${C.top}px`,opacity:"1"},u.value={width:`${$}px`,left:`${A}px`,height:"100%",top:"0",opacity:"1"}),f=x,h=!1;return}const U=l.value[f];if(p(U,v),U.getBoundingClientRect(),window.matchMedia("(prefers-reduced-motion: reduce)").matches){d.value={width:`${C.width||0}px`,left:`${C.left||0}px`,height:`${C.height||7}px`,top:`${C.top}px`,opacity:"1"},t.orientation==="vertical"?u.value={height:`${$}px`,top:`${A}px`,width:"100%",left:"0",opacity:"1"}:u.value={width:`${$}px`,left:`${A}px`,height:"100%",top:"0",opacity:"1"},f=x,h=!1;return}requestAnimationFrame(()=>{t.orientation==="vertical"?(d.value={height:`${C.height}px`,top:`${C.top}px`,width:`${C.width||7}px`,left:`${C.left}px`,opacity:"1"},u.value={height:`${$}px`,top:`${A}px`,width:"100%",left:"0",opacity:"1"}):(d.value={width:`${C.width}px`,left:`${C.left}px`,height:`${C.height||7}px`,top:`${C.top}px`,opacity:"1"},u.value={width:`${$}px`,left:`${A}px`,height:"100%",top:"0",opacity:"1"}),f=x,setTimeout(()=>{h=!1},200)})};let y=null;const k=()=>{const x=t.tabs.findIndex(b=>b.value===t.modelValue);if(x!==-1&&l.value&&l.value[x]){const b=c.value;c.value=!1;const v=l.value[x],C=v.parentElement;if(C){const w=p(v,C),M=v.getBoundingClientRect(),A=C.getBoundingClientRect();let $,U;t.orientation==="vertical"?($=M.top-A.top,U=M.height,d.value={height:`${w.height}px`,top:`${w.top}px`,width:`${w.width}px`,left:`${w.left}px`,opacity:"1"},u.value={height:`${U}px`,top:`${$}px`,width:`${M.width}px`,left:"0",opacity:"1"}):($=M.left-A.left,U=M.width,d.value={width:`${w.width}px`,left:`${w.left}px`,height:`${w.height}px`,top:`${w.top}px`,opacity:"1"},u.value={width:`${U}px`,left:`${$}px`,height:"100%",top:"0",opacity:"1"})}f=x,h=!1,setTimeout(()=>{c.value=b},10)}y&&clearTimeout(y),y=setTimeout(()=>{y=null},50)};a.onMounted(async()=>{await a.nextTick();const x=t.tabs.findIndex(b=>b.value===t.modelValue);x!==-1&&(g(x),setTimeout(()=>{c.value=!0},50)),window.addEventListener("resize",k)}),a.onUnmounted(()=>{window.removeEventListener("resize",k),y&&(clearTimeout(y),y=null)});const{modelValue:S}=a.toRefs(t);return a.watch(S,async()=>{await a.nextTick();const x=t.tabs.findIndex(b=>b.value===t.modelValue);x!==-1&&g(x)}),(x,b)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["tabs-container",[`tabs-container--${n.orientation}`,`tabs-container--${n.size}`,`tabs-container--${n.variant}`,{"tabs-container--with-content":o.value}]])},[a.createElementVNode("div",bf,[a.createElementVNode("div",{class:a.normalizeClass(["tabs-list",[`tabs-list--${n.orientation}`,`tabs-list--${n.size}`,`tabs-list--${n.variant}`]]),style:a.normalizeStyle(n.sticky?{position:"sticky",[n.sticky.side]:`${n.sticky.offset}px`,zIndex:10}:{})},[x.$slots.before?(a.openBlock(),a.createElementBlock("div",vf,[a.renderSlot(x.$slots,"before",{},void 0,!0)])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["tabs-buttons-wrapper",`tabs-buttons-wrapper--${n.tabWidth}`]),role:"tablist"},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.tabs,(v,C)=>(a.openBlock(),a.createElementBlock("button",{key:v.value,ref_for:!0,ref_key:"tabButtons",ref:l,class:a.normalizeClass(["tab-button",[`tab-button--${n.size}`,`tab-button--${n.variant}`,`tab-button--${n.tabWidth}`,{"tab-button-active":a.unref(S)===v.value}]]),"aria-selected":a.unref(S)===v.value,"aria-controls":"tabpanel",id:`tab-${v.value}`,role:"tab",onClick:w=>m(v.value,C)},a.toDisplayString(v.label),11,xf))),128)),a.createElementVNode("div",{class:a.normalizeClass(["tab-background",{"no-transition":!c.value}]),style:a.normalizeStyle(u.value)},null,6),a.createElementVNode("div",{class:a.normalizeClass(["tab-underline",{"no-transition":!c.value}]),style:a.normalizeStyle(d.value)},null,6)],2),x.$slots.after?(a.openBlock(),a.createElementBlock("div",wf,[a.renderSlot(x.$slots,"after",{},void 0,!0)])):a.createCommentVNode("",!0)],6)]),o.value?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["tabs-content",`tabs-content--${n.orientation}`]),role:"tabpanel","aria-labelledby":`tab-${a.unref(S)}`,id:"tabpanel"},[a.renderSlot(x.$slots,"content",{activeTab:s.value},void 0,!0)],10,Cf)):a.createCommentVNode("",!0)],2))}}),Fr=de(Sf,[["__scopeId","data-v-901716e3"]]),Mf={key:0,class:"ui-divider-text"},Tf=a.defineComponent({__name:"UiDivider",props:{orientation:{default:"horizontal"},variant:{default:"solid"},text:{},textPosition:{default:"center"},color:{default:"var(--accui-divider-color)"},thickness:{default:"1px"},margin:{default:"1rem"},spacing:{default:"auto"}},setup(n){const e=n,t=a.useSlots(),r=a.computed(()=>!!(e.text||t.default)),i=a.computed(()=>{const o={};return e.orientation==="horizontal"?(o.width=e.spacing==="auto"?"100%":typeof e.spacing=="number"?`${e.spacing}px`:e.spacing,o.marginTop=typeof e.margin=="number"?`${e.margin}px`:e.margin,o.marginBottom=typeof e.margin=="number"?`${e.margin}px`:e.margin,r.value||(o.height=typeof e.thickness=="number"?`${e.thickness}px`:e.thickness),o["--divider-color"]=e.color==="#e5e7eb"?"var(--accui-divider-color)":e.color,o["--divider-thickness"]=typeof e.thickness=="number"?`${e.thickness}px`:e.thickness):(o.height=e.spacing==="auto"?"100%":typeof e.spacing=="number"?`${e.spacing}px`:e.spacing,o.marginLeft=typeof e.margin=="number"?`${e.margin}px`:e.margin,o.marginRight=typeof e.margin=="number"?`${e.margin}px`:e.margin,r.value||(o.width=typeof e.thickness=="number"?`${e.thickness}px`:e.thickness),o["--divider-color"]=e.color==="#e5e7eb"?"var(--accui-divider-color)":e.color,o["--divider-thickness"]=typeof e.thickness=="number"?`${e.thickness}px`:e.thickness),o});return(o,s)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["ui-divider",`ui-divider--${n.orientation}`,`ui-divider--${n.variant}`,{"ui-divider--with-text":r.value,[`ui-divider--text-${n.textPosition}`]:r.value}]),style:a.normalizeStyle(i.value)},[r.value?(a.openBlock(),a.createElementBlock("span",Mf,[a.renderSlot(o.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(n.text),1)],!0)])):a.createCommentVNode("",!0)],6))}}),tt=de(Tf,[["__scopeId","data-v-1c798024"]]),Ef={class:"datetime-picker-wrapper"},Nf={class:"datetime-picker-leading-icon"},Af={class:"datetime-picker-display"},Bf={key:0,class:"datetime-picker-value"},Of={key:1,class:"datetime-picker-placeholder"},Df={key:1,class:"datetime-picker-trailing-icon"},If={key:1,class:"datetime-picker-panel"},$f={class:"datetime-picker-header"},Rf={class:"datetime-picker-month-year"},Lf=["value"],zf=["value"],Pf={class:"datetime-picker-weekdays"},Vf={class:"datetime-picker-grid"},Ff={key:2,class:"datetime-picker-panel datetime-picker-time-panel"},Hf={class:"time-selector"},jf={class:"time-column"},Uf={class:"time-scroll"},qf={class:"time-column"},Wf={class:"time-scroll"},Kf={key:0,class:"time-column"},Jf={class:"time-scroll"},Gf={class:"datetime-picker-footer"},Yf=a.defineComponent({__name:"UiDateTimePicker",props:{modelValue:{},type:{default:"date"},placeholder:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},min:{},max:{},error:{type:Boolean,default:!1},size:{default:"md"},format:{default:"iso"},is24Hour:{type:Boolean,default:!0},minuteStep:{default:1}},emits:["update:modelValue","change"],setup(n,{emit:e}){const t=n,r=e,i=a.ref(),o=a.ref(),s=a.ref(!1),{floatingStyle:l,updatePosition:c,cleanup:d}=Vr({trigger:i,floating:o,placement:"bottom-start",offset:8,shift:!0,flip:!0,autoUpdate:!0,clickOutside:{enabled:!0,handler:()=>{f()}}}),u=async()=>{t.disabled||t.readonly||(s.value=!0,await a.nextTick(),c())},f=()=>{s.value=!1},h=()=>{s.value?f():u()},p=a.ref(t.type==="time"?"time":"date"),m=a.ref(new Date().getMonth()),g=a.ref(new Date().getFullYear()),y=a.ref(new Date().getHours()),k=a.ref(new Date().getMinutes()),S=a.ref("AM"),x=["January","February","March","April","May","June","July","August","September","October","November","December"],b=["Su","Mo","Tu","We","Th","Fr","Sa"],v=a.computed(()=>t.min?t.min instanceof Date?t.min:new Date(t.min):null),C=a.computed(()=>t.max?t.max instanceof Date?t.max:new Date(t.max):null),w=a.computed(()=>{if(!t.modelValue)return null;if(t.modelValue instanceof Date)return t.modelValue;if(t.type==="time"&&typeof t.modelValue=="string"){const L=t.modelValue.match(/^(\d{1,2}):(\d{2})(?::(\d{2}))?$/);if(L){const I=new Date;return I.setHours(parseInt(L[1]),parseInt(L[2]),parseInt(L[3]||"0"),0),I}}return new Date(t.modelValue)}),M=a.computed(()=>{if(!w.value||isNaN(w.value.getTime()))return"";const L=w.value;if(t.type==="time"){if(t.is24Hour)return`${String(L.getHours()).padStart(2,"0")}:${String(L.getMinutes()).padStart(2,"0")}`;{const pt=L.getHours()%12||12,se=L.getHours()>=12?"PM":"AM";return`${pt}:${String(L.getMinutes()).padStart(2,"0")} ${se}`}}const I=L.getDate(),O=L.getMonth()+1,q=L.getFullYear();let we="";switch(t.format){case"us":we=`${O}/${I}/${q}`;break;case"eu":we=`${I}/${O}/${q}`;break;default:we=`${q}-${String(O).padStart(2,"0")}-${String(I).padStart(2,"0")}`;break}if(t.type==="date")return we;let $t="";if(t.is24Hour)$t=`${String(L.getHours()).padStart(2,"0")}:${String(L.getMinutes()).padStart(2,"0")}`;else{const pt=L.getHours()%12||12,se=L.getHours()>=12?"PM":"AM";$t=`${pt}:${String(L.getMinutes()).padStart(2,"0")} ${se}`}return`${we} ${$t}`}),A=a.computed(()=>{const L=[];return t.error&&L.push("datetime-picker-error"),t.disabled&&L.push("datetime-picker-disabled"),t.readonly&&L.push("datetime-picker-readonly"),L.push(`datetime-picker-size-${t.size}`),L}),$=a.computed(()=>t.type==="date"||t.type==="datetime"&&p.value==="date"),U=a.computed(()=>t.type==="time"||t.type==="datetime"&&p.value==="time"),j=a.computed(()=>[{label:"Date",value:"date"},{label:"Time",value:"time"}]),K=a.computed(()=>{const L=[],I=t.is24Hour?23:12,O=t.is24Hour?0:1;for(let q=O;q<=I;q++)L.push(q);return L}),N=a.computed(()=>{const L=[];for(let I=0;I<60;I+=t.minuteStep)L.push(I);return L}),D=a.computed(()=>{const L=new Date().getFullYear(),I=v.value?.getFullYear()||L-100,O=C.value?.getFullYear()||L+100,q=[];for(let we=I;we<=O;we++)q.push(we);return q}),R=a.computed(()=>v.value?new Date(g.value,m.value,1)<=v.value:!1),ke=a.computed(()=>C.value?new Date(g.value,m.value+1,0)>=C.value:!1),ri=a.computed(()=>{const L=[],I=g.value,O=m.value,q=new Date(I,O,1),we=new Date(q);we.setDate(we.getDate()-q.getDay());const $t=new Date;$t.setHours(0,0,0,0);for(let pt=0;pt<42;pt++){const se=new Date(we);se.setDate(we.getDate()+pt);const ad=se.getMonth()!==O,cd=se.getTime()===$t.getTime(),dd=w.value&&se.getFullYear()===w.value.getFullYear()&&se.getMonth()===w.value.getMonth()&&se.getDate()===w.value.getDate(),ud=!!(v.value&&se<v.value||C.value&&se>C.value);L.push({key:`${se.getFullYear()}-${se.getMonth()}-${se.getDate()}`,date:se.getDate(),month:se.getMonth(),year:se.getFullYear(),otherMonth:ad,isToday:cd,isSelected:dd||!1,isDisabled:ud})}return L}),rd=()=>{switch(t.type){case"time":return"Select time";case"datetime":return"Select date and time";default:return"Select date"}},id=()=>{m.value===0?(m.value=11,g.value--):m.value--},od=()=>{m.value===11?(m.value=0,g.value++):m.value++},sd=L=>{if(L.isDisabled||L.otherMonth)return;const I=w.value||new Date,O=new Date(L.year,L.month,L.date,I.getHours(),I.getMinutes());r("update:modelValue",O),r("change",O),t.type==="datetime"?p.value="time":t.type==="date"&&f()},Dn=(L,I)=>{let O=w.value?new Date(w.value):new Date;if(!w.value){const q=new Date;O.setFullYear(q.getFullYear(),q.getMonth(),q.getDate())}if(L==="hour"){let q=I;t.is24Hour||(S.value==="PM"&&q!==12&&(q+=12),S.value==="AM"&&q===12&&(q=0)),y.value=I,O.setHours(q)}else if(L==="minute")k.value=I,O.setMinutes(I);else if(L==="period"){S.value=I;let q=y.value;I==="PM"&&q!==12&&(q+=12),I==="AM"&&q===12&&(q=0),O.setHours(q)}r("update:modelValue",O),r("change",O)},ld=()=>{const L=new Date;v.value&&L<v.value||C.value&&L>C.value||(r("update:modelValue",L),r("change",L),f())},_o=()=>{r("update:modelValue",null),r("change",null)};return a.watch(()=>t.modelValue,L=>{if(L){const I=L instanceof Date?L:new Date(L);if(!isNaN(I.getTime())){if(m.value=I.getMonth(),g.value=I.getFullYear(),t.is24Hour)y.value=I.getHours();else{const O=I.getHours();y.value=O%12||12,S.value=O>=12?"PM":"AM"}k.value=I.getMinutes()}}},{immediate:!0}),a.onUnmounted(()=>{d()}),(L,I)=>(a.openBlock(),a.createElementBlock("div",Ef,[a.createElementVNode("div",{ref_key:"triggerElement",ref:i,class:a.normalizeClass(["datetime-picker-trigger",[A.value,{"datetime-picker-open":s.value}]]),onClick:h},[a.createElementVNode("div",Nf,[n.type==="date"?(a.openBlock(),a.createBlock(a.unref(ru),{key:0})):n.type==="time"?(a.openBlock(),a.createBlock(a.unref(lu),{key:1})):(a.openBlock(),a.createBlock(a.unref(nu),{key:2}))]),a.createElementVNode("div",Af,[M.value?(a.openBlock(),a.createElementBlock("span",Bf,a.toDisplayString(M.value),1)):(a.openBlock(),a.createElementBlock("span",Of,a.toDisplayString(n.placeholder||rd()),1))]),n.modelValue&&!n.disabled&&!n.readonly?(a.openBlock(),a.createElementBlock("div",{key:0,class:"datetime-picker-trailing-icon",onClick:a.withModifiers(_o,["stop"])},[a.createVNode(a.unref(fo))])):(a.openBlock(),a.createElementBlock("div",Df,[a.createVNode(a.unref(Pr))]))],2),(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[s.value?(a.openBlock(),a.createElementBlock("div",{key:0,ref_key:"floatingElement",ref:o,class:"datetime-picker-dropdown",style:a.normalizeStyle(a.unref(l))},[n.type==="datetime"?(a.openBlock(),a.createBlock(Fr,{key:0,modelValue:p.value,"onUpdate:modelValue":I[0]||(I[0]=O=>p.value=O),tabs:j.value,variant:"default",size:"sm",style:{"margin-bottom":"1rem"}},null,8,["modelValue","tabs"])):a.createCommentVNode("",!0),$.value?(a.openBlock(),a.createElementBlock("div",If,[a.createElementVNode("div",$f,[a.createVNode(W,{onClick:id,disabled:R.value,color:"secondary",variant:"primary",icon:"",squircle:""},{icon:a.withCtx(()=>[a.createVNode(a.unref(ou))]),_:1},8,["disabled"]),a.createElementVNode("div",Rf,[a.withDirectives(a.createElementVNode("select",{"onUpdate:modelValue":I[1]||(I[1]=O=>m.value=O),class:"datetime-picker-select"},[(a.openBlock(),a.createElementBlock(a.Fragment,null,a.renderList(x,(O,q)=>a.createElementVNode("option",{key:q,value:q},a.toDisplayString(O),9,Lf)),64))],512),[[a.vModelSelect,m.value]]),a.withDirectives(a.createElementVNode("select",{"onUpdate:modelValue":I[2]||(I[2]=O=>g.value=O),class:"datetime-picker-select"},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(D.value,O=>(a.openBlock(),a.createElementBlock("option",{key:O,value:O},a.toDisplayString(O),9,zf))),128))],512),[[a.vModelSelect,g.value]])]),a.createVNode(W,{onClick:od,disabled:ke.value,color:"secondary",variant:"primary",icon:"",squircle:""},{icon:a.withCtx(()=>[a.createVNode(a.unref(su))]),_:1},8,["disabled"])]),a.createElementVNode("div",Pf,[(a.openBlock(),a.createElementBlock(a.Fragment,null,a.renderList(b,O=>a.createElementVNode("div",{key:O,class:"datetime-picker-weekday"},a.toDisplayString(O),1)),64))]),a.createElementVNode("div",Vf,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(ri.value,O=>(a.openBlock(),a.createBlock(W,{key:O.key,color:O.isSelected||O.isToday?"primary":"secondary",variant:O.isSelected?"primary":O.isToday?"outline":"primary",disabled:O.isDisabled||O.otherMonth,class:a.normalizeClass(["datetime-picker-day",{"datetime-picker-day-other":O.otherMonth,"datetime-picker-day-disabled":O.isDisabled}]),icon:"",squircle:"",onClick:q=>sd(O)},{icon:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(O.date),1)]),_:2},1032,["color","variant","disabled","class","onClick"]))),128))])])):a.createCommentVNode("",!0),U.value?(a.openBlock(),a.createElementBlock("div",Ff,[a.createElementVNode("div",Hf,[a.createElementVNode("div",jf,[I[6]||(I[6]=a.createElementVNode("label",{class:"time-label"},"Hour",-1)),a.createElementVNode("div",Uf,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(K.value,O=>(a.openBlock(),a.createBlock(W,{key:O,color:y.value===O?"primary":"secondary",variant:y.value===O?"primary":"ghost",size:"sm",squircle:"",onClick:q=>Dn("hour",O)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(String(O).padStart(2,"0")),1)]),_:2},1032,["color","variant","onClick"]))),128))])]),a.createElementVNode("div",qf,[I[7]||(I[7]=a.createElementVNode("label",{class:"time-label"},"Minute",-1)),a.createElementVNode("div",Wf,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(N.value,O=>(a.openBlock(),a.createBlock(W,{key:O,color:k.value===O?"primary":"secondary",variant:k.value===O?"primary":"ghost",size:"sm",squircle:"",onClick:q=>Dn("minute",O)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(String(O).padStart(2,"0")),1)]),_:2},1032,["color","variant","onClick"]))),128))])]),n.is24Hour?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",Kf,[I[10]||(I[10]=a.createElementVNode("label",{class:"time-label"},"Period",-1)),a.createElementVNode("div",Jf,[a.createVNode(W,{color:S.value==="AM"?"primary":"secondary",variant:S.value==="AM"?"primary":"ghost",size:"sm",squircle:"",class:"time-option",onClick:I[3]||(I[3]=O=>Dn("period","AM"))},{default:a.withCtx(()=>[...I[8]||(I[8]=[a.createTextVNode(" AM ",-1)])]),_:1},8,["color","variant"]),a.createVNode(W,{color:S.value==="PM"?"primary":"secondary",variant:S.value==="PM"?"primary":"ghost",size:"sm",squircle:"",class:"time-option",onClick:I[4]||(I[4]=O=>Dn("period","PM"))},{default:a.withCtx(()=>[...I[9]||(I[9]=[a.createTextVNode(" PM ",-1)])]),_:1},8,["color","variant"])])]))])])):a.createCommentVNode("",!0),a.createVNode(tt),a.createElementVNode("div",Gf,[a.createVNode(W,{onClick:ld,color:"primary",variant:"primary",squircle:"",style:{flex:"1"}},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(n.type==="time"?"Now":"Today"),1)]),_:1}),a.createVNode(W,{onClick:I[5]||(I[5]=O=>{_o(),f()}),color:"danger",variant:"primary",squircle:"",style:{flex:"1"}},{default:a.withCtx(()=>[...I[11]||(I[11]=[a.createTextVNode(" Clear ",-1)])]),_:1}),a.createVNode(W,{onClick:f,color:"secondary",variant:"primary",squircle:"",style:{flex:"1"}},{default:a.withCtx(()=>[...I[12]||(I[12]=[a.createTextVNode(" Close ",-1)])]),_:1})])],4)):a.createCommentVNode("",!0)]))]))}}),ho=de(Yf,[["__scopeId","data-v-f688c330"]]),Qf=a.defineComponent({__name:"UiInput.Date",props:{min:{},max:{},format:{default:"iso"},label:{},helpText:{},modelValue:{},value:{},placeholder:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},fullWidth:{type:Boolean},inputId:{},error:{type:[Boolean,String,Error],default:!1},size:{default:"md"},tabindex:{}},emits:["update:modelValue","change","blur","focus","keydown"],setup(n,{emit:e}){const t=e,r=o=>{t("update:modelValue",o)},i=o=>{t("change",o)};return(o,s)=>(a.openBlock(),a.createBlock(ho,{"model-value":n.modelValue,type:"date",placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,required:n.required,min:n.min,max:n.max,error:!!n.error,size:n.size,format:n.format,"onUpdate:modelValue":r,onChange:i},null,8,["model-value","placeholder","disabled","readonly","required","min","max","error","size","format"]))}}),Xf=a.defineComponent({__name:"UiInput.Time",props:{is24Hour:{type:Boolean,default:!0},minuteStep:{default:1},label:{},helpText:{},modelValue:{},value:{},placeholder:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},fullWidth:{type:Boolean},inputId:{},error:{type:[Boolean,String,Error],default:!1},size:{default:"md"},tabindex:{}},emits:["update:modelValue","change","blur","focus","keydown"],setup(n,{emit:e}){const t=e,r=o=>{t("update:modelValue",o)},i=o=>{t("change",o)};return(o,s)=>(a.openBlock(),a.createBlock(ho,{"model-value":n.modelValue,type:"time",placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,required:n.required,error:!!n.error,size:n.size,is24Hour:n.is24Hour,minuteStep:n.minuteStep,"onUpdate:modelValue":r,onChange:i},null,8,["model-value","placeholder","disabled","readonly","required","error","size","is24Hour","minuteStep"]))}}),Zf=a.defineComponent({__name:"UiInput.DateTime",props:{min:{},max:{},format:{default:"iso"},is24Hour:{type:Boolean,default:!0},minuteStep:{default:1},label:{},helpText:{},modelValue:{},value:{},placeholder:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},fullWidth:{type:Boolean},inputId:{},error:{type:[Boolean,String,Error],default:!1},size:{default:"md"},tabindex:{}},emits:["update:modelValue","change","blur","focus","keydown"],setup(n,{emit:e}){const t=e,r=o=>{t("update:modelValue",o)},i=o=>{t("change",o)};return(o,s)=>(a.openBlock(),a.createBlock(ho,{"model-value":n.modelValue,type:"datetime",placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,required:n.required,min:n.min,max:n.max,error:!!n.error,size:n.size,format:n.format,is24Hour:n.is24Hour,minuteStep:n.minuteStep,"onUpdate:modelValue":r,onChange:i},null,8,["model-value","placeholder","disabled","readonly","required","min","max","error","size","format","is24Hour","minuteStep"]))}});function ue(n){this.content=n}ue.prototype={constructor:ue,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),o=r.content.slice();return i==-1?o.push(t||n,e):(o[i+1]=e,t&&(o[i]=t)),new ue(o)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new ue(t)},addToStart:function(n,e){return new ue([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new ue(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),o=r.find(n);return i.splice(o==-1?i.length:o,0,e,t),new ue(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=ue.from(n),n.size?new ue(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=ue.from(n),n.size?new ue(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=ue.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};ue.from=function(n){if(n instanceof ue)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new ue(e)};function Nl(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i==o){t+=i.nodeSize;continue}if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)t++;return t}if(i.content.size||o.content.size){let s=Nl(i.content,o.content,t+1);if(s!=null)return s}t+=i.nodeSize}}function Al(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:r};let s=n.child(--i),l=e.child(--o),c=s.nodeSize;if(s==l){t-=c,r-=c;continue}if(!s.sameMarkup(l))return{a:t,b:r};if(s.isText&&s.text!=l.text){let d=0,u=Math.min(s.text.length,l.text.length);for(;d<u&&s.text[s.text.length-d-1]==l.text[l.text.length-d-1];)d++,t--,r--;return{a:t,b:r}}if(s.content.size||l.content.size){let d=Al(s.content,l.content,t-1,r-1);if(d)return d}t-=c,r-=c}}class T{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,o){for(let s=0,l=0;l<t;s++){let c=this.content[s],d=l+c.nodeSize;if(d>e&&r(c,i+l,o||null,s)!==!1&&c.content.size){let u=l+1;c.nodesBetween(Math.max(0,e-u),Math.min(c.content.size,t-u),r,i+u)}l=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",s=!0;return this.nodesBetween(e,t,(l,c)=>{let d=l.isText?l.text.slice(Math.max(e,c)-c,t-c):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&d||l.isTextblock)&&r&&(s?s=!1:o+=r),o+=d},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new T(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let o=0,s=0;s<t;o++){let l=this.content[o],c=s+l.nodeSize;c>e&&((s<e||c>t)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,t-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,t-s-1))),r.push(l),i+=l.nodeSize),s=c}return new T(r,i)}cutByIndex(e,t){return e==t?T.empty:e==0&&t==this.content.length?this:new T(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new T(i,o)}addToStart(e){return new T([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new T(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return Nl(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Al(this,e,t,r)}findIndex(e){if(e==0)return In(0,e);if(e==this.size)return In(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let i=this.child(t),o=r+i.nodeSize;if(o>=e)return o==e?In(t+1,o):In(t,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return T.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new T(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return T.empty;let t,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)?(t||(t=e.slice(0,i)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new T(t||e,r)}static from(e){if(!e)return T.empty;if(e instanceof T)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new T([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}T.empty=new T([],0);const ii={index:0,offset:0};function In(n,e){return ii.index=n,ii.offset=e,ii}function Yn(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Yn(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Yn(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let Y=class $i{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,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))t||(t=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Yn(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let i=r.create(t.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return $i.none;if(e instanceof $i)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};Y.none=[];class Qn extends Error{}class B{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=Ol(this.content,e+this.openStart,t);return r&&new B(r,this.openStart,this.openEnd)}removeBetween(e,t){return new B(Bl(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return B.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new B(T.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new B(e,r,i)}}B.empty=new B(T.empty,0,0);function Bl(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:s,offset:l}=n.findIndex(t);if(i==e||o.isText){if(l!=t&&!n.child(s).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=s)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(Bl(o.content,e-i-1,t-i-1)))}function Ol(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),s=n.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=Ol(s.content,e-o-1,t,s);return l&&n.replaceChild(i,s.copy(l))}function _f(n,e,t){if(t.openStart>n.depth)throw new Qn("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Qn("Inconsistent open depths");return Dl(n,e,t,0)}function Dl(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let s=Dl(n,e,t,r+1);return o.copy(o.content.replaceChild(i,s))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let s=n.parent,l=s.content;return wt(s,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:s,end:l}=eh(t,n);return wt(o,$l(n,s,l,e,r))}else return wt(o,Xn(n,e,r))}function Il(n,e){if(!e.type.compatibleContent(n.type))throw new Qn("Cannot join "+e.type.name+" onto "+n.type.name)}function Ri(n,e,t){let r=n.node(t);return Il(r,e.node(t)),r}function xt(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function an(n,e,t,r){let i=(e||n).node(t),o=0,s=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(xt(n.nodeAfter,r),o++));for(let l=o;l<s;l++)xt(i.child(l),r);e&&e.depth==t&&e.textOffset&&xt(e.nodeBefore,r)}function wt(n,e){return n.type.checkContent(e),n.copy(e)}function $l(n,e,t,r,i){let o=n.depth>i&&Ri(n,e,i+1),s=r.depth>i&&Ri(t,r,i+1),l=[];return an(null,n,i,l),o&&s&&e.index(i)==t.index(i)?(Il(o,s),xt(wt(o,$l(n,e,t,r,i+1)),l)):(o&&xt(wt(o,Xn(n,e,i+1)),l),an(e,t,i,l),s&&xt(wt(s,Xn(t,r,i+1)),l)),an(r,null,i,l),new T(l)}function Xn(n,e,t){let r=[];if(an(null,n,t,r),n.depth>t){let i=Ri(n,e,t+1);xt(wt(i,Xn(n,e,t+1)),r)}return an(e,null,t,r),new T(r)}function eh(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)i=e.node(o).copy(T.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class kn{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Y.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let l=r;r=i,i=l}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 t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.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 t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Zn(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 t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,o=t;for(let s=e;;){let{index:l,offset:c}=s.content.findIndex(o),d=o-c;if(r.push(s,l,i+c),!d||(s=s.child(l),s.isText))break;o=d-1,i+=c+1}return new kn(t,r,o)}static resolveCached(e,t){let r=ns.get(e);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==t)return s}else ns.set(e,r=new th);let i=r.elts[r.i]=kn.resolve(e,t);return r.i=(r.i+1)%nh,i}}class th{constructor(){this.elts=[],this.i=0}}const nh=12,ns=new WeakMap;class Zn{constructor(e,t,r){this.$from=e,this.$to=t,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 rh=Object.create(null);class Re{constructor(e,t,r,i=Y.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||T.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,i=0){this.content.nodesBetween(e,t,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,t,r,i){return this.content.textBetween(e,t,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,t,r){return this.type==e&&Yn(this.attrs,t||e.defaultAttrs||rh)&&Y.sameSet(this.marks,r||Y.none)}copy(e=null){return e==this.content?this:new Re(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Re(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return B.empty;let i=this.resolve(e),o=this.resolve(t),s=r?0:i.sharedDepth(t),l=i.start(s),d=i.node(s).content.cut(i.pos-l,o.pos-l);return new B(d,i.depth-s,o.depth-s)}replace(e,t,r){return _f(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return kn.resolveCached(this,e)}resolveNoCache(e){return kn.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,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()+")"),Rl(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=T.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let c=i;c<o;c++)if(!this.type.allowsMarks(r.child(c).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,t);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=Y.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!Y.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=T.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,i,r);return o.type.checkAttrs(o.attrs),o}}Re.prototype.text=void 0;class _n extends Re{constructor(e,t,r,i){if(super(e,t,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):Rl(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new _n(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new _n(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Rl(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Tt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new ih(e,t);if(r.next==null)return Tt.empty;let i=Ll(r);r.next&&r.err("Unexpected trailing text");let o=uh(dh(i));return fh(o,r),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let i=this;for(let o=t;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:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];function o(s,l){let c=s.matchFragment(e,r);if(c&&(!t||c.validEnd))return T.from(l.map(d=>d.createAndFill()));for(let d=0;d<s.next.length;d++){let{type:u,next:f}=s.next[d];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let h=o(f,l.concat(u));if(h)return h}}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 t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=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 l=i;l.type;l=l.via)s.push(l.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:l,next:c}=o.next[s];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!i.type||c.validEnd)&&(r.push({match:l.contentMatch,type:l,via:i}),t[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 t(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}return t(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(`
5
5
  `)}}Tt.empty=new Tt(!0);class ih{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Ll(n){let e=[];do e.push(oh(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function oh(n){let e=[];do e.push(sh(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function sh(n){let e=ch(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=lh(n,e);else break;return e}function rs(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function lh(n,e){let t=rs(n),r=t;return n.eat(",")&&(n.next!="}"?r=rs(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function ah(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let o in t){let s=t[o];s.isInGroup(e)&&i.push(s)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function ch(n){if(n.eat("(")){let e=Ll(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=ah(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function dh(n){let e=[[]];return i(o(n,0),t()),e;function t(){return e.push([])-1}function r(s,l,c){let d={term:c,to:l};return e[s].push(d),d}function i(s,l){s.forEach(c=>c.to=l)}function o(s,l){if(s.type=="choice")return s.exprs.reduce((c,d)=>c.concat(o(d,l)),[]);if(s.type=="seq")for(let c=0;;c++){let d=o(s.exprs[c],l);if(c==s.exprs.length-1)return d;i(d,l=t())}else if(s.type=="star"){let c=t();return r(l,c),i(o(s.expr,c),c),[r(c)]}else if(s.type=="plus"){let c=t();return i(o(s.expr,l),c),i(o(s.expr,c),c),[r(c)]}else{if(s.type=="opt")return[r(l)].concat(o(s.expr,l));if(s.type=="range"){let c=l;for(let d=0;d<s.min;d++){let u=t();i(o(s.expr,c),u),c=u}if(s.max==-1)i(o(s.expr,c),c);else for(let d=s.min;d<s.max;d++){let u=t();r(c,u),i(o(s.expr,c),u),c=u}return[r(c)]}else{if(s.type=="name")return[r(l,void 0,s.value)];throw new Error("Unknown expr type")}}}}function zl(n,e){return e-n}function is(n,e){let t=[];return r(e),t.sort(zl);function r(i){let o=n[i];if(o.length==1&&!o[0].term)return r(o[0].to);t.push(i);for(let s=0;s<o.length;s++){let{term:l,to:c}=o[s];!l&&t.indexOf(c)==-1&&r(c)}}}function uh(n){let e=Object.create(null);return t(is(n,0));function t(r){let i=[];r.forEach(s=>{n[s].forEach(({term:l,to:c})=>{if(!l)return;let d;for(let u=0;u<i.length;u++)i[u][0]==l&&(d=i[u][1]);is(n,c).forEach(u=>{d||i.push([l,d=[]]),d.indexOf(u)==-1&&d.push(u)})})});let o=e[r.join(",")]=new Tt(r.indexOf(n.length-1)>-1);for(let s=0;s<i.length;s++){let l=i[s][1].sort(zl);o.next.push({type:i[s][0],next:e[l.join(",")]||t(l)})}return o}}function fh(n,e){for(let t=0,r=[n];t<r.length;t++){let i=r[t],o=!i.validEnd,s=[];for(let l=0;l<i.next.length;l++){let{type:c,next:d}=i.next[l];s.push(c.name),o&&!(c.isText||c.hasRequiredAttrs())&&(o=!1),r.indexOf(d)==-1&&r.push(d)}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Pl(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function Vl(n,e){let t=Object.create(null);for(let r in n){let i=e&&e[r];if(i===void 0){let o=n[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=i}return t}function Fl(n,e,t,r){for(let i in e)if(!(i in n))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${i}`);for(let i in n){let o=n[i];o.validate&&o.validate(e[i])}}function Hl(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new ph(n,r,e[r]);return t}let ss=class jl{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Hl(e,r.attrs),this.defaultAttrs=Pl(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==Tt.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:Vl(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Re(this,this.computeAttrs(e),T.from(t),Y.setFrom(r))}createChecked(e=null,t,r){return t=T.from(t),this.checkContent(t),new Re(this,this.computeAttrs(e),t,Y.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=T.from(t),t.size){let s=this.contentMatch.fillBefore(t);if(!s)return null;t=s.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(T.empty,!0);return o?new Re(this,e,t.append(o),Y.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.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){Fl(this.attrs,e,"node")}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:Y.none:e}static compile(e,t){let r=Object.create(null);e.forEach((o,s)=>r[o]=new jl(o,t,s));let i=t.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 hh(n,e,t){let r=t.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 ${n}, got ${o}`)}}class ph{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?hh(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Hr{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=Hl(e,i.attrs),this.excluded=null;let o=Pl(this.attrs);this.instance=o?new Y(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Y(this,Vl(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new Hr(o,i++,t,s)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Fl(this.attrs,e,"mark")}excludes(e){return this.excluded.indexOf(e)>-1}}class Ul{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=ue.from(e.nodes),t.marks=ue.from(e.marks||{}),this.nodes=ss.compile(this.spec.nodes,this),this.marks=Hr.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||"",l=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=Tt.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=l=="_"?null:l?ls(this,l.split(" ")):l==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:ls(this,s.split(" "))}this.nodeFromJSON=i=>Re.fromJSON(this,i),this.markFromJSON=i=>Y.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof ss){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,i)}text(e,t){let r=this.nodes.text;return new _n(r,r.defaultAttrs,e,Y.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function ls(n,e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],o=n.marks[i],s=o;if(o)t.push(o);else for(let l in n.marks){let c=n.marks[l];(i=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(i)>-1)&&t.push(s=c)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function mh(n){return n.tag!=null}function gh(n){return n.style!=null}class lt{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(i=>{if(mh(i))this.tags.push(i);else if(gh(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,t={}){let r=new cs(this,t,!1);return r.addAll(e,Y.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new cs(this,t,!0);return r.addAll(e,Y.none,t.from,t.to),B.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(bh(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||t.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(e,t,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],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)!=t))){if(s.getAttrs){let c=s.getAttrs(t);if(c===!1)continue;s.attrs=c||void 0}return s}}}static schemaRules(e){let t=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<t.length;s++){let l=t[s];if((l.priority==null?50:l.priority)<o)break}t.splice(s,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=ds(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=ds(s)),s.node||s.ignore||s.mark||(s.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new lt(e,lt.schemaRules(e)))}}const ql={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},yh={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Wl={ol:!0,ul:!0},bn=1,Li=2,cn=4;function as(n,e,t){return e!=null?(e?bn:0)|(e==="full"?Li:0):n&&n.whitespace=="pre"?bn|Li:t&~cn}class $n{constructor(e,t,r,i,o,s){this.type=e,this.attrs=t,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=Y.none,this.match=o||(s&cn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(T.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);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&bn)){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 t=T.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(T.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!ql.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class cs{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=t.topNode,o,s=as(null,t.preserveWhitespace,0)|(r?cn:0);i?o=new $n(i.type,i.attrs,Y.none,!0,t.topMatch||i.type.contentMatch,s):r?o=new $n(null,null,Y.none,!0,null,s):o=new $n(e.schema.topNodeType,null,Y.none,!0,null,s),this.nodes=[o],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,i=this.top,o=i.options&Li?"full":this.localPreserveWS||(i.options&bn)>0,{schema:s}=this.parser;if(o==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o)if(o==="full")r=r.replace(/\r\n?/g,`
6
6
  `);else if(s.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(s.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let c=0;c<l.length;c++)c&&this.insertNode(s.linebreakReplacement.create(),t,!0),l[c]&&this.insertNode(s.text(l[c]),t,!/\S/.test(l[c]));r=""}else 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 l=i.content[i.content.length-1],c=e.previousSibling;(!l||c&&c.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(s.text(r),t,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let i=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),l;Wl.hasOwnProperty(s)&&this.parser.normalizeLists&&kh(e);let c=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(c?c.ignore:yh.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,t);else if(!c||c.skip||c.closeParent){c&&c.closeParent?this.open=Math.max(0,this.open-1):c&&c.skip.nodeType&&(e=c.skip);let d,u=this.needsBlock;if(ql.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),d=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let f=c&&c.skip?t:this.readStyles(e,t);f&&this.addAll(e,f),d&&this.sync(o),this.needsBlock=u}else{let d=this.readStyles(e,t);d&&this.addElementByRule(e,c,d,c.consuming===!1?l:void 0)}this.localPreserveWS=i}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
7
7
  `),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let 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 l=void 0;;){let c=this.parser.matchStyle(o,s,this,l);if(!c)break;if(c.ignore)return null;if(c.clearMark?t=t.filter(d=>!c.clearMark(d)):t=t.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)l=c;else break}}return t}addElementByRule(e,t,r,i){let o,s;if(t.node)if(s=this.parser.schema.nodes[t.node],s.isLeaf)this.insertNode(s.create(t.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let c=this.enter(s,t.attrs||null,r,t.preserveWhitespace);c&&(o=!0,r=c)}else{let c=this.parser.schema.marks[t.mark];r=r.concat(c.create(t.attrs))}let l=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c,r,!1));else{let c=e;typeof t.contentElement=="string"?c=e.querySelector(t.contentElement):typeof t.contentElement=="function"?c=t.contentElement(e):t.contentElement&&(c=t.contentElement),this.findAround(e,c,!0),this.addAll(c,r),this.findAround(e,c,!1)}o&&this.sync(l)&&this.open--}addAll(e,t,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,l=i==null?null:e.childNodes[i];s!=l;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,t);this.findAtPoint(e,o)}findPlace(e,t,r){let i,o;for(let s=this.open,l=0;s>=0;s--){let c=this.nodes[s],d=c.findWrapping(e);if(d&&(!i||i.length>d.length+l)&&(i=d,o=c,!d.length))break;if(c.solid){if(r)break;l+=2}}if(!i)return null;this.sync(o);for(let s=0;s<i.length;s++)t=this.enterInner(i[s],null,t,!1);return t}insertNode(e,t,r){if(e.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(t=this.enterInner(o,null,t))}let i=this.findPlace(e,t,r);if(i){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(e.type));let s=Y.none;for(let l of i.concat(e.marks))(o.type?o.type.allowsMarkType(l.type):us(l.type,e.type))&&(s=l.addToSet(s));return o.content.push(e.mark(s)),!0}return!1}enter(e,t,r,i){let o=this.findPlace(e.create(t),r,!1);return o&&(o=this.enterInner(e,t,r,!0,i)),o}enterInner(e,t,r,i=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let l=as(e,o,s.options);s.options&cn&&s.content.length==0&&(l|=cn);let c=Y.none;return r=r.filter(d=>(s.type?s.type.allowsMarkType(d.type):us(d.type,e))?(c=d.addToSet(c),!1):!0),this.nodes.push(new $n(e,t,c,i,null,l)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=bn)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),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=(l,c)=>{for(;l>=0;l--){let d=t[l];if(d==""){if(l==t.length-1||l==0)continue;for(;c>=o;c--)if(s(l-1,c))return!0;return!1}else{let u=c>0||c==0&&i?this.nodes[c].type:r&&c>=o?r.node(c-o).type:null;if(!u||u.name!=d&&!u.isInGroup(d))return!1;c--}}return!0};return s(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function kh(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Wl.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function bh(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function ds(n){let e={};for(let t in n)e[t]=n[t];return e}function us(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],s=l=>{o.push(l);for(let c=0;c<l.edgeCount;c++){let{type:d,next:u}=l.edge(c);if(d==e||o.indexOf(u)<0&&s(u))return!0}};if(s(i.contentMatch))return!0}}class Ot{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=oi(t).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let l=0,c=0;for(;l<o.length&&c<s.marks.length;){let d=s.marks[c];if(!this.marks[d.type.name]){c++;continue}if(!d.eq(o[l][0])||d.type.spec.spanning===!1)break;l++,c++}for(;l<o.length;)i=o.pop()[1];for(;c<s.marks.length;){let d=s.marks[c++],u=this.serializeMark(d,s.isInline,t);u&&(o.push([d,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(s,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:i}=qn(oi(t),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&qn(oi(r),i(e,t),null,e.attrs)}static renderSpec(e,t,r=null,i){return qn(e,t,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Ot(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=fs(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return fs(e.marks)}}function fs(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function oi(n){return n.document||window.document}const hs=new WeakMap;function vh(n){let e=hs.get(n);return e===void 0&&hs.set(n,e=xh(n)),e}function xh(n){let e=null;function t(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++)t(r[i]);else for(let i in r)t(r[i])}return t(n),e}function qn(n,e,t,r){if(typeof e=="string")return{dom:n.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=vh(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&&(t=i.slice(0,s),i=i.slice(s+1));let l,c=t?n.createElementNS(t,i):n.createElement(i),d=e[1],u=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){u=2;for(let f in d)if(d[f]!=null){let h=f.indexOf(" ");h>0?c.setAttributeNS(f.slice(0,h),f.slice(h+1),d[f]):f=="style"&&c.style?c.style.cssText=d[f]:c.setAttribute(f,d[f])}}for(let f=u;f<e.length;f++){let h=e[f];if(h===0){if(f<e.length-1||f>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else{let{dom:p,contentDOM:m}=qn(n,h,t,r);if(c.appendChild(p),m){if(l)throw new RangeError("Multiple content holes");l=m}}}return{dom:c,contentDOM:l}}const Kl=65535,Jl=Math.pow(2,16);function wh(n,e){return n+e*Jl}function ps(n){return n&Kl}function Ch(n){return(n-(n&Kl))/Jl}const Gl=1,Yl=2,Wn=4,Ql=8;class zi{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Ql)>0}get deletedBefore(){return(this.delInfo&(Gl|Wn))>0}get deletedAfter(){return(this.delInfo&(Yl|Wn))>0}get deletedAcross(){return(this.delInfo&Wn)>0}}class Me{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Me.empty)return Me.empty}recover(e){let t=0,r=ps(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+t+Ch(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?i:0);if(c>e)break;let d=this.ranges[l+o],u=this.ranges[l+s],f=c+d;if(e<=f){let h=d?e==c?-1:e==f?1:t:t,p=c+i+(h<0?0:u);if(r)return p;let m=e==(t<0?c:f)?null:wh(l/3,e-c),g=e==c?Yl:e==f?Gl:Wn;return(t<0?e!=c:e!=f)&&(g|=Ql),new zi(p,g,m)}i+=u-d}return r?e+i:new zi(e+i,0,null)}touches(e,t){let r=0,i=ps(t),o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?r:0);if(c>e)break;let d=this.ranges[l+o],u=c+d;if(e<=u&&l==i*3)return!0;r+=this.ranges[l+s]-d}return!1}forEach(e){let t=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],l=s-(this.inverted?o:0),c=s+(this.inverted?0:o),d=this.ranges[i+t],u=this.ranges[i+r];e(l,l+d,c,c+u),o+=u-d}}invert(){return new Me(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Me.empty:new Me(e<0?[0,-e,0]:[0,0,e])}}Me.empty=new Me([]);class vn{constructor(e,t,r=0,i=e?e.length:0){this.mirror=t,this.from=r,this.to=i,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new vn(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,r=this._maps.length;t<e._maps.length;t++){let i=e.getMirror(t);this.appendMap(e._maps[t],i!=null&&i<t?r+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this._maps.length+e._maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e._maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new vn;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this._maps[o],l=s.mapResult(e,t);if(l.recover!=null){let c=this.getMirror(o);if(c!=null&&c>o&&c<this.to){o=c,e=this._maps[c].recover(l.recover);continue}}i|=l.delInfo,e=l.pos}return r?e:new zi(e,i,null)}}const si=Object.create(null);class ye{getMap(){return Me.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=si[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in si)throw new RangeError("Duplicate use of step JSON ID "+e);return si[e]=t,t.prototype.jsonID=e,t}}class ne{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new ne(e,null)}static fail(e){return new ne(null,e)}static fromReplace(e,t,r,i){try{return ne.ok(e.replace(t,r,i))}catch(o){if(o instanceof Qn)return ne.fail(o.message);throw o}}}function po(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(po(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return T.fromArray(r)}class it extends ye{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new B(po(t.content,(s,l)=>!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),t.openStart,t.openEnd);return ne.fromReplace(e,this.from,this.to,o)}invert(){return new $e(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new it(t.pos,r.pos,this.mark)}merge(e){return e instanceof it&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new it(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new it(t.from,t.to,e.markFromJSON(t.mark))}}ye.jsonID("addMark",it);class $e extends ye{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new B(po(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return ne.fromReplace(e,this.from,this.to,r)}invert(){return new it(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new $e(t.pos,r.pos,this.mark)}merge(e){return e instanceof $e&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new $e(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new $e(t.from,t.to,e.markFromJSON(t.mark))}}ye.jsonID("removeMark",$e);class ot extends ye{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return ne.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return ne.fromReplace(e,this.pos,this.pos+1,new B(T.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new ot(this.pos,t.marks[i]);return new ot(this.pos,this.mark)}}return new Et(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ot(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new ot(t.pos,e.markFromJSON(t.mark))}}ye.jsonID("addNodeMark",ot);class Et extends ye{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return ne.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return ne.fromReplace(e,this.pos,this.pos+1,new B(T.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new ot(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Et(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Et(t.pos,e.markFromJSON(t.mark))}}ye.jsonID("removeNodeMark",Et);class le extends ye{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&Pi(e,this.from,this.to)?ne.fail("Structure replace would overwrite content"):ne.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Me([this.from,this.to-this.from,this.slice.size])}invert(e){return new le(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new le(t.pos,Math.max(t.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof le)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?B.empty:new B(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new le(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?B.empty:new B(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new le(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new le(t.from,t.to,B.fromJSON(e,t.slice),!!t.structure)}}ye.jsonID("replace",le);class ce extends ye{constructor(e,t,r,i,o,s,l=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=l}apply(e){if(this.structure&&(Pi(e,this.from,this.gapFrom)||Pi(e,this.gapTo,this.to)))return ne.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return ne.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?ne.fromReplace(e,this.from,this.to,r):ne.fail("Content does not fit in gap")}getMap(){return new Me([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new ce(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||o>r.pos?null:new ce(t.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,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ce(t.from,t.to,t.gapFrom,t.gapTo,B.fromJSON(e,t.slice),t.insert,!!t.structure)}}ye.jsonID("replaceAround",ce);function Pi(n,e,t){let r=n.resolve(e),i=t-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 Sh(n,e,t,r){let i=[],o=[],s,l;n.doc.nodesBetween(e,t,(c,d,u)=>{if(!c.isInline)return;let f=c.marks;if(!r.isInSet(f)&&u.type.allowsMarkType(r.type)){let h=Math.max(d,e),p=Math.min(d+c.nodeSize,t),m=r.addToSet(f);for(let g=0;g<f.length;g++)f[g].isInSet(m)||(s&&s.to==h&&s.mark.eq(f[g])?s.to=p:i.push(s=new $e(h,p,f[g])));l&&l.to==h?l.to=p:o.push(l=new it(h,p,r))}}),i.forEach(c=>n.step(c)),o.forEach(c=>n.step(c))}function Mh(n,e,t,r){let i=[],o=0;n.doc.nodesBetween(e,t,(s,l)=>{if(!s.isInline)return;o++;let c=null;if(r instanceof Hr){let d=s.marks,u;for(;u=r.isInSet(d);)(c||(c=[])).push(u),d=u.removeFromSet(d)}else r?r.isInSet(s.marks)&&(c=[r]):c=s.marks;if(c&&c.length){let d=Math.min(l+s.nodeSize,t);for(let u=0;u<c.length;u++){let f=c[u],h;for(let p=0;p<i.length;p++){let m=i[p];m.step==o-1&&f.eq(i[p].style)&&(h=m)}h?(h.to=d,h.step=o):i.push({style:f,from:Math.max(l,e),to:d,step:o})}}}),i.forEach(s=>n.step(new $e(s.from,s.to,s.style)))}function mo(n,e,t,r=t.contentMatch,i=!0){let o=n.doc.nodeAt(e),s=[],l=e+1;for(let c=0;c<o.childCount;c++){let d=o.child(c),u=l+d.nodeSize,f=r.matchType(d.type);if(!f)s.push(new le(l,u,B.empty));else{r=f;for(let h=0;h<d.marks.length;h++)t.allowsMarkType(d.marks[h].type)||n.step(new $e(l,u,d.marks[h]));if(i&&d.isText&&t.whitespace!="pre"){let h,p=/\r?\n|\r/g,m;for(;h=p.exec(d.text);)m||(m=new B(T.from(t.schema.text(" ",t.allowedMarks(d.marks))),0,0)),s.push(new le(l+h.index,l+h.index+h[0].length,m))}}l=u}if(!r.validEnd){let c=r.fillBefore(T.empty,!0);n.replace(l,l,new B(c,0,0))}for(let c=s.length-1;c>=0;c--)n.step(s[c])}function Th(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function _t(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth,i=0,o=0;;--r){let s=n.$from.node(r),l=n.$from.index(r)+i,c=n.$to.indexAfter(r)-o;if(r<n.depth&&s.canReplace(l,c,t))return r;if(r==0||s.type.spec.isolating||!Th(s,l,c))break;l&&(i=1),c<s.childCount&&(o=1)}return null}function Eh(n,e,t){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),l=i.after(o+1),c=s,d=l,u=T.empty,f=0;for(let m=o,g=!1;m>t;m--)g||r.index(m)>0?(g=!0,u=T.from(r.node(m).copy(u)),f++):c--;let h=T.empty,p=0;for(let m=o,g=!1;m>t;m--)g||i.after(m+1)<i.end(m)?(g=!0,h=T.from(i.node(m).copy(h)),p++):d++;n.step(new ce(c,d,s,l,new B(u.append(h),f,p),u.size-f,!0))}function go(n,e,t=null,r=n){let i=Nh(n,e),o=i&&Ah(r,e);return o?i.map(ms).concat({type:e,attrs:t}).concat(o.map(ms)):null}function ms(n){return{type:n,attrs:null}}function Nh(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.contentMatchAt(r).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return t.canReplaceWith(r,i,s)?o:null}function Ah(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let c=(s.length?s[s.length-1]:e).contentMatch;for(let d=r;c&&d<i;d++)c=c.matchType(t.child(d).type);return!c||!c.validEnd?null:s}function Bh(n,e,t){let r=T.empty;for(let s=t.length-1;s>=0;s--){if(r.size){let l=t[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=T.from(t[s].type.create(t[s].attrs,r))}let i=e.start,o=e.end;n.step(new ce(i,o,i,o,new B(r,0,0),t.length,!0))}function Oh(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=n.steps.length;n.doc.nodesBetween(e,t,(s,l)=>{let c=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,c)&&Dh(n.doc,n.mapping.slice(o).map(l),r)){let d=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!m?d=!1:!p&&m&&(d=!0)}d===!1&&Zl(n,s,l,o),mo(n,n.mapping.slice(o).map(l,1),r,void 0,d===null);let u=n.mapping.slice(o),f=u.map(l,1),h=u.map(l+s.nodeSize,1);return n.step(new ce(f,h,f+1,h-1,new B(T.from(r.create(c,null,s.marks)),0,0),1,!0)),d===!0&&Xl(n,s,l,o),!1}})}function Xl(n,e,t,r){e.forEach((i,o)=>{if(i.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(i.text);){let c=n.mapping.slice(r).map(t+1+o+s.index);n.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function Zl(n,e,t,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=n.mapping.slice(r).map(t+1+o);n.replaceWith(s,s+1,e.type.schema.text(`
@@ -13,7 +13,7 @@
13
13
  `))),0,0),n.someProp("transformPasted",h=>{l=h(l,n,!0)}),l;let f=n.someProp("clipboardTextParser",h=>h(e,i,r,n));if(f)l=f;else{let h=i.marks(),{schema:p}=n.state,m=Ot.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let y=s.appendChild(document.createElement("p"));g&&y.appendChild(m.serializeNode(p.text(g,h)))})}}else n.someProp("transformPastedHTML",f=>{t=f(t,n)}),s=um(t),An&&fm(s);let d=s&&s.querySelector("[data-pm-slice]"),u=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let f=+u[3];f>0;f--){let h=s.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;s=h}if(l||(l=(n.someProp("clipboardParser")||n.someProp("domParser")||lt.fromSchema(n.state.schema)).parseSlice(s,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!am.test(h.parentNode.nodeName)?{ignore:!0}:null}})),u)l=hm(Us(l,+u[1],+u[2]),u[4]);else if(l=B.maxOpen(cm(l.content,i),!0),l.openStart||l.openEnd){let f=0,h=0;for(let p=l.content.firstChild;f<l.openStart&&!p.type.spec.isolating;f++,p=p.firstChild);for(let p=l.content.lastChild;h<l.openEnd&&!p.type.spec.isolating;h++,p=p.lastChild);l=Us(l,f,h)}return n.someProp("transformPasted",f=>{l=f(l,n,c)}),l}const am=/^(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 cm(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),o,s=[];if(n.forEach(l=>{if(!s)return;let c=i.findWrapping(l.type),d;if(!c)return s=null;if(d=s.length&&o.length&&$a(c,o,l,s[s.length-1],0))s[s.length-1]=d;else{s.length&&(s[s.length-1]=Ra(s[s.length-1],o.length));let u=Ia(l,c);s.push(u),i=i.matchType(u.type),o=c}}),s)return T.from(s)}return n}function Ia(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,T.from(n));return n}function $a(n,e,t,r,i){if(i<n.length&&i<e.length&&n[i]==e[i]){let o=$a(n,e,t,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==n.length-1?t.type:n[i+1]))return r.copy(r.content.append(T.from(Ia(t,n,i+1))))}}function Ra(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,Ra(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(T.empty,!0);return n.copy(t.append(r))}function Ji(n,e,t,r,i,o){let s=e<0?n.firstChild:n.lastChild,l=s.content;return n.childCount>1&&(o=0),i<r-1&&(l=Ji(l,e,t,r,i+1,o)),i>=t&&(l=e<0?s.contentMatchAt(0).fillBefore(l,o<=i).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(T.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,s.copy(l))}function Us(n,e,t){return e<n.openStart&&(n=new B(Ji(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new B(Ji(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const La={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 qs=null;function za(){return qs||(qs=document.implementation.createHTMLDocument("title"))}let pi=null;function dm(n){let e=window.trustedTypes;return e?(pi||(pi=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})),pi.createHTML(n)):n}function um(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=za().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&La[r[1].toLowerCase()])&&(n=i.map(o=>"<"+o+">").join("")+n+i.map(o=>"</"+o+">").reverse().join("")),t.innerHTML=dm(n),i)for(let o=0;o<i.length;o++)t=t.querySelector(i[o])||t;return t}function fm(n){let e=n.querySelectorAll(ae?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let r=e[t];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "),r)}}function hm(n,e){if(!n.size)return n;let t=n.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return n}let{content:i,openStart:o,openEnd:s}=n;for(let l=r.length-2;l>=0;l-=2){let c=t.nodes[r[l]];if(!c||c.hasRequiredAttrs())break;i=T.from(c.create(r[l+1],i)),o++,s++}return new B(i,o,s)}const ve={},xe={},pm={touchstart:!0,touchmove:!0};class mm{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=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 gm(n){for(let e in ve){let t=ve[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=r=>{km(n,r)&&!So(n,r)&&(n.editable||!(r.type in xe))&&t(n,r)},pm[e]?{passive:!0}:void 0)}ge&&n.dom.addEventListener("input",()=>null),Gi(n)}function st(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function ym(n){n.domObserver.stop();for(let e in n.input.eventHandlers)n.dom.removeEventListener(e,n.input.eventHandlers[e]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}function Gi(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=r=>So(n,r))})}function So(n,e){return n.someProp("handleDOMEvents",t=>{let r=t[e.type];return r?r(n,e)||e.defaultPrevented:!1})}function km(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function bm(n,e){!So(n,e)&&ve[e.type]&&(n.editable||!(e.type in xe))&&ve[e.type](n,e)}xe.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!Va(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(Je&&ae&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),Yt&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",i=>i(n,gt(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||lm(n,t)?t.preventDefault():st(n,"key")};xe.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)};xe.keypress=(n,e)=>{let t=e;if(Va(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||Ae&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof V)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(t.charCode),o=()=>n.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!n.someProp("handleTextInput",s=>s(n,r.$from.pos,r.$to.pos,i,o))&&n.dispatch(o()),t.preventDefault()}};function Jr(n){return{left:n.clientX,top:n.clientY}}function vm(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function Mo(n,e,t,r,i){if(r==-1)return!1;let o=n.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(n.someProp(e,l=>s>o.depth?l(n,t,o.nodeAfter,o.before(s),i,!0):l(n,t,o.node(s),o.before(s),i,!1)))return!0;return!1}function qt(n,e,t){if(n.focused||n.focus(),n.state.selection.eq(e))return;let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function xm(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&P.isSelectable(r)?(qt(n,new P(t)),!0):!1}function wm(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof P&&(r=t.node);let o=n.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let l=s>o.depth?o.nodeAfter:o.node(s);if(P.isSelectable(l)){r&&t.$from.depth>0&&s>=t.$from.depth&&o.before(t.$from.depth+1)==t.$from.pos?i=o.before(t.$from.depth):i=o.before(s);break}}return i!=null?(qt(n,P.create(n.state.doc,i)),!0):!1}function Cm(n,e,t,r,i){return Mo(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?wm(n,t):xm(n,t))}function Sm(n,e,t,r){return Mo(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function Mm(n,e,t,r){return Mo(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||Tm(n,t,r)}function Tm(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(qt(n,V.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),l=i.before(o);if(s.inlineContent)qt(n,V.create(r,l+1,l+1+s.content.size));else if(P.isSelectable(s))qt(n,P.create(r,l));else continue;return!0}}function To(n){return nr(n)}const Pa=Ae?"metaKey":"ctrlKey";ve.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=To(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&vm(t,n.input.lastClick)&&!t[Pa]&&n.input.lastClick.button==t.button&&(n.input.lastClick.type=="singleClick"?o="doubleClick":n.input.lastClick.type=="doubleClick"&&(o="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:o,button:t.button};let s=n.posAtCoords(Jr(t));s&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new Em(n,s,t,!!r)):(o=="doubleClick"?Sm:Mm)(n,s.pos,s.inside,t)?t.preventDefault():st(n,"pointer"))};class Em{constructor(e,t,r,i){this.view=e,this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Pa],this.allowDefault=r.shiftKey;let o,s;if(t.inside>-1)o=e.state.doc.nodeAt(t.inside),s=t.inside;else{let u=e.state.doc.resolve(t.pos);o=u.parent,s=u.depth?u.before():0}const l=i?null:r.target,c=l?e.docView.nearestDesc(l,!0):null;this.target=c&&c.nodeDOM.nodeType==1?c.nodeDOM:null;let{selection:d}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||d instanceof P&&d.from<=s&&d.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Le&&!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)),st(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(()=>Ge(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Jr(e))),this.updateAllowDefault(e),this.allowDefault||!t?st(this.view,"pointer"):Cm(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||ge&&this.mightDrag&&!this.mightDrag.node.isAtom||ae&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(qt(this.view,H.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):st(this.view,"pointer")}move(e){this.updateAllowDefault(e),st(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)}}ve.touchstart=n=>{n.input.lastTouch=Date.now(),To(n),st(n,"pointer")};ve.touchmove=n=>{n.input.lastTouch=Date.now(),st(n,"pointer")};ve.contextmenu=n=>To(n);function Va(n,e){return n.composing?!0:ge&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const Nm=Je?5e3:-1;xe.compositionstart=xe.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$to;if(e.selection instanceof V&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||ae&&ga&&Am(n)))n.markCursor=n.state.storedMarks||t.marks(),nr(n,!0),n.markCursor=null;else if(nr(n,!e.selection.empty),Le&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.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 l=n.domSelection();l&&l.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}n.input.composing=!0}Fa(n,Nm)};function Am(n){let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(!e||e.nodeType!=1||t>=e.childNodes.length)return!1;let r=e.childNodes[t];return r.nodeType==1&&r.contentEditable=="false"}xe.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,Fa(n,20))};function Fa(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>nr(n),e))}function Ha(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Om());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function Bm(n){let e=n.domSelectionRange();if(!e.focusNode)return null;let t=wp(e.focusNode,e.focusOffset),r=Cp(e.focusNode,e.focusOffset);if(t&&r&&t!=r){let i=r.pmViewDesc,o=n.domObserver.lastChangedTextNode;if(t==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(n.input.compositionNode==r){let s=t.pmViewDesc;if(!(!s||!s.isText(t.nodeValue)))return r}}return t||r}function Om(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function nr(n,e=!1){if(!(Je&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),Ha(n),e||n.docView&&n.docView.dirty){let t=xo(n),r=n.state.selection;return t&&!t.eq(r)?n.dispatch(n.state.tr.setSelection(t)):(n.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?n.dispatch(n.state.tr.deleteSelection()):n.updateState(n.state),!0}return!1}}function Dm(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const wn=Se&&at<15||Yt&&Ep<604;ve.copy=xe.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let o=wn?null:t.clipboardData,s=r.content(),{dom:l,text:c}=Co(n,s);o?(t.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",c)):Dm(n,l),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Im(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function $m(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?Cn(n,r.value,null,i,e):Cn(n,r.textContent,r.innerHTML,i,e)},50)}function Cn(n,e,t,r,i){let o=Da(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",c=>c(n,i,o||B.empty)))return!0;if(!o)return!1;let s=Im(o),l=s?n.state.tr.replaceSelectionWith(s,r):n.state.tr.replaceSelection(o);return n.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function ja(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}xe.paste=(n,e)=>{let t=e;if(n.composing&&!Je)return;let r=wn?null:t.clipboardData,i=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&Cn(n,ja(r),r.getData("text/html"),i,t)?t.preventDefault():$m(n,t)};class Ua{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const Rm=Ae?"altKey":"ctrlKey";function qa(n,e){let t=n.someProp("dragCopies",r=>!r(e));return t??!e[Rm]}ve.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=n.state.selection,o=i.empty?null:n.posAtCoords(Jr(t)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof P?i.to-1:i.to))){if(r&&r.mightDrag)s=P.create(n.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let f=n.docView.nearestDesc(t.target,!0);f&&f.node.type.spec.draggable&&f!=n.docView&&(s=P.create(n.state.doc,f.posBefore))}}let l=(s||n.state.selection).content(),{dom:c,text:d,slice:u}=Co(n,l);(!t.dataTransfer.files.length||!ae||ma>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(wn?"Text":"text/html",c.innerHTML),t.dataTransfer.effectAllowed="copyMove",wn||t.dataTransfer.setData("text/plain",d),n.dragging=new Ua(u,qa(n,t),s)};ve.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)};xe.dragover=xe.dragenter=(n,e)=>e.preventDefault();xe.drop=(n,e)=>{try{Lm(n,e,n.dragging)}finally{n.dragging=null}};function Lm(n,e,t){if(!e.dataTransfer)return;let r=n.posAtCoords(Jr(e));if(!r)return;let i=n.state.doc.resolve(r.pos),o=t&&t.slice;o?n.someProp("transformPasted",p=>{o=p(o,n,!1)}):o=Da(n,ja(e.dataTransfer),wn?null:e.dataTransfer.getData("text/html"),!1,i);let s=!!(t&&qa(n,e));if(n.someProp("handleDrop",p=>p(n,e,o||B.empty,s))){e.preventDefault();return}if(!o)return;e.preventDefault();let l=o?ea(n.state.doc,i.pos,o):i.pos;l==null&&(l=i.pos);let c=n.state.tr;if(s){let{node:p}=t;p?p.replace(c):c.deleteSelection()}let d=c.mapping.map(l),u=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,f=c.doc;if(u?c.replaceRangeWith(d,d,o.content.firstChild):c.replaceRange(d,d,o),c.doc.eq(f))return;let h=c.doc.resolve(d);if(u&&P.isSelectable(o.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(o.content.firstChild))c.setSelection(new P(h));else{let p=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((m,g,y,k)=>p=k),c.setSelection(wo(n,h,c.doc.resolve(p)))}n.focus(),n.dispatch(c.setMeta("uiEvent","drop"))}ve.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&Ge(n)},20))};ve.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)};ve.beforeinput=(n,e)=>{if(ae&&Je&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",o=>o(n,gt(8,"Backspace")))))return;let{$cursor:i}=n.state.selection;i&&i.pos>0&&n.dispatch(n.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let n in xe)ve[n]=xe[n];function Sn(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class rr{constructor(e,t){this.toDOM=e,this.spec=t||Ct,this.side=this.spec.side||0}map(e,t,r,i){let{pos:o,deleted:s}=e.mapResult(t.from+i,this.side<0?-1:1);return s?null:new be(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof rr&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Sn(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class dt{constructor(e,t){this.attrs=e,this.spec=t||Ct}map(e,t,r,i){let o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new be(o,s,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof dt&&Sn(this.attrs,e.attrs)&&Sn(this.spec,e.spec)}static is(e){return e.type instanceof dt}destroy(){}}class Eo{constructor(e,t){this.attrs=e,this.spec=t||Ct}map(e,t,r,i){let o=e.mapResult(t.from+i,1);if(o.deleted)return null;let s=e.mapResult(t.to+i,-1);return s.deleted||s.pos<=o.pos?null:new be(o.pos-r,s.pos-r,this)}valid(e,t){let{index:r,offset:i}=e.content.findIndex(t.from),o;return i==t.from&&!(o=e.child(r)).isText&&i+o.nodeSize==t.to}eq(e){return this==e||e instanceof Eo&&Sn(this.attrs,e.attrs)&&Sn(this.spec,e.spec)}destroy(){}}class be{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new be(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,r){return this.type.map(e,this,t,r)}static widget(e,t,r){return new be(e,e,new rr(t,r))}static inline(e,t,r,i){return new be(e,t,new dt(r,i))}static node(e,t,r,i){return new be(e,t,new Eo(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof dt}get widget(){return this.type instanceof rr}}const Pt=[],Ct={};class X{constructor(e,t){this.local=e.length?e:Pt,this.children=t.length?t:Pt}static create(e,t){return t.length?ir(t,e,0,Ct):me}find(e,t,r){let i=[];return this.findInner(e??0,t??1e9,i,0,r),i}findInner(e,t,r,i,o){for(let s=0;s<this.local.length;s++){let l=this.local[s];l.from<=t&&l.to>=e&&(!o||o(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<t&&this.children[s+1]>e){let l=this.children[s]+1;this.children[s+2].findInner(e-l,t-l,r,i+l,o)}}map(e,t,r){return this==me||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Ct)}mapInner(e,t,r,i,o){let s;for(let l=0;l<this.local.length;l++){let c=this.local[l].map(e,r,i);c&&c.type.valid(t,c)?(s||(s=[])).push(c):o.onRemove&&o.onRemove(this.local[l].spec)}return this.children.length?zm(this.children,s||[],e,t,r,i,o):s?new X(s.sort(St),Pt):me}add(e,t){return t.length?this==me?X.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let i,o=0;e.forEach((l,c)=>{let d=c+r,u;if(u=Ka(t,l,d)){for(i||(i=this.children.slice());o<i.length&&i[o]<c;)o+=3;i[o]==c?i[o+2]=i[o+2].addInner(l,u,d+1):i.splice(o,0,c,c+l.nodeSize,ir(u,l,d+1,Ct)),o+=3}});let s=Wa(o?Ja(t):t,-r);for(let l=0;l<s.length;l++)s[l].type.valid(e,s[l])||s.splice(l--,1);return new X(s.length?this.local.concat(s).sort(St):this.local,i||this.children)}remove(e){return e.length==0||this==me?this:this.removeInner(e,0)}removeInner(e,t){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let s,l=r[o]+t,c=r[o+1]+t;for(let u=0,f;u<e.length;u++)(f=e[u])&&f.from>l&&f.to<c&&(e[u]=null,(s||(s=[])).push(f));if(!s)continue;r==this.children&&(r=this.children.slice());let d=r[o+2].removeInner(s,l+1);d!=me?r[o+2]=d:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,s;o<e.length;o++)if(s=e[o])for(let l=0;l<i.length;l++)i[l].eq(s,t)&&(i==this.local&&(i=this.local.slice()),i.splice(l--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new X(i,r):me}forChild(e,t){if(this==me)return this;if(t.isLeaf)return X.empty;let r,i;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 o=e+1,s=o+t.content.size;for(let l=0;l<this.local.length;l++){let c=this.local[l];if(c.from<s&&c.to>o&&c.type instanceof dt){let d=Math.max(o,c.from)-o,u=Math.min(s,c.to)-o;d<u&&(i||(i=[])).push(c.copy(d,u))}}if(i){let l=new X(i.sort(St),Pt);return r?new nt([l,r]):l}return r||me}eq(e){if(this==e)return!0;if(!(e instanceof X)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return No(this.localsInner(e))}localsInner(e){if(this==me)return Pt;if(e.inlineContent||!this.local.some(dt.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof dt||t.push(this.local[r]);return t}forEachSet(e){e(this)}}X.empty=new X([],[]);X.removeOverlap=No;const me=X.empty;class nt{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,Ct));return nt.from(r)}forChild(e,t){if(t.isLeaf)return X.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,t);o!=me&&(o instanceof nt?r=r.concat(o.members):r.push(o))}return nt.from(r)}eq(e){if(!(e instanceof nt)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!t)t=o;else{r&&(t=t.slice(),r=!1);for(let s=0;s<o.length;s++)t.push(o[s])}}return t?No(r?t:t.sort(St)):Pt}static from(e){switch(e.length){case 0:return me;case 1:return e[0];default:return new nt(e.every(t=>t instanceof X)?e:e.reduce((t,r)=>t.concat(r instanceof X?r:r.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function zm(n,e,t,r,i,o,s){let l=n.slice();for(let d=0,u=o;d<t.maps.length;d++){let f=0;t.maps[d].forEach((h,p,m,g)=>{let y=g-m-(p-h);for(let k=0;k<l.length;k+=3){let S=l[k+1];if(S<0||h>S+u-f)continue;let x=l[k]+u-f;p>=x?l[k+1]=h<=x?-2:-1:h>=u&&y&&(l[k]+=y,l[k+1]+=y)}f+=y}),u=t.maps[d].map(u,-1)}let c=!1;for(let d=0;d<l.length;d+=3)if(l[d+1]<0){if(l[d+1]==-2){c=!0,l[d+1]=-1;continue}let u=t.map(n[d]+o),f=u-i;if(f<0||f>=r.content.size){c=!0;continue}let h=t.map(n[d+1]+o,-1),p=h-i,{index:m,offset:g}=r.content.findIndex(f),y=r.maybeChild(m);if(y&&g==f&&g+y.nodeSize==p){let k=l[d+2].mapInner(t,y,u+1,n[d]+o+1,s);k!=me?(l[d]=f,l[d+1]=p,l[d+2]=k):(l[d+1]=-2,c=!0)}else c=!0}if(c){let d=Pm(l,n,e,t,i,o,s),u=ir(d,r,0,s);e=u.local;for(let f=0;f<l.length;f+=3)l[f+1]<0&&(l.splice(f,3),f-=3);for(let f=0,h=0;f<u.children.length;f+=3){let p=u.children[f];for(;h<l.length&&l[h]<p;)h+=3;l.splice(h,0,u.children[f],u.children[f+1],u.children[f+2])}}return new X(e.sort(St),l)}function Wa(n,e){if(!e||!n.length)return n;let t=[];for(let r=0;r<n.length;r++){let i=n[r];t.push(new be(i.from+e,i.to+e,i.type))}return t}function Pm(n,e,t,r,i,o,s){function l(c,d){for(let u=0;u<c.local.length;u++){let f=c.local[u].map(r,i,d);f?t.push(f):s.onRemove&&s.onRemove(c.local[u].spec)}for(let u=0;u<c.children.length;u+=3)l(c.children[u+2],c.children[u]+d+1)}for(let c=0;c<n.length;c+=3)n[c+1]==-1&&l(n[c+2],e[c]+o+1);return t}function Ka(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,i=null;for(let o=0,s;o<n.length;o++)(s=n[o])&&s.from>t&&s.to<r&&((i||(i=[])).push(s),n[o]=null);return i}function Ja(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function ir(n,e,t,r){let i=[],o=!1;e.forEach((l,c)=>{let d=Ka(n,l,c+t);if(d){o=!0;let u=ir(d,l,t+c+1,r);u!=me&&i.push(c,c+l.nodeSize,u)}});let s=Wa(o?Ja(n):n,-t).sort(St);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||i.length?new X(s,i):me}function St(n,e){return n.from-e.from||n.to-e.to}function No(n){let e=n;for(let t=0;t<e.length-1;t++){let r=e[t];if(r.from!=r.to)for(let i=t+1;i<e.length;i++){let o=e[i];if(o.from==r.from){o.to!=r.to&&(e==n&&(e=n.slice()),e[i]=o.copy(o.from,r.to),Ws(e,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(e==n&&(e=n.slice()),e[t]=r.copy(r.from,o.from),Ws(e,i,r.copy(o.from,r.to)));break}}}return e}function Ws(n,e,t){for(;e<n.length&&St(t,n[e])>0;)e++;n.splice(e,0,t)}function mi(n){let e=[];return n.someProp("decorations",t=>{let r=t(n.state);r&&r!=me&&e.push(r)}),n.cursorWrapper&&e.push(X.create(n.state.doc,[n.cursorWrapper.deco])),nt.from(e)}const Vm={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Fm=Se&&at<=11;class Hm{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 jm{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Hm,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]);Se&&at<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),Fm&&(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,Vm)),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 t=0;t<e.length;t++)this.queue.push(e[t]);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(zs(this.view)){if(this.suppressingSelectionUpdates)return Ge(this.view);if(Se&&at<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Nt(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 t=new Set,r;for(let o=e.focusNode;o;o=Gt(o))t.add(o);for(let o=e.anchorNode;o;o=Gt(o))if(t.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 t=this.pendingRecords();t.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&zs(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,l=!1,c=[];if(e.editable)for(let u=0;u<t.length;u++){let f=this.registerMutation(t[u],c);f&&(o=o<0?f.from:Math.min(f.from,o),s=s<0?f.to:Math.max(f.to,s),f.typeOver&&(l=!0))}if(Le&&c.length){let u=c.filter(f=>f.nodeName=="BR");if(u.length==2){let[f,h]=u;f.parentNode&&f.parentNode.parentNode==h.parentNode?h.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let h of u){let p=h.parentNode;p&&p.nodeName=="LI"&&(!f||Wm(e,f)!=p)&&h.remove()}}}else if((ae||ge)&&c.some(u=>u.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let u of c)if(u.nodeName=="BR"&&u.parentNode){let f=u.nextSibling;f&&f.nodeType==1&&f.contentEditable=="false"&&u.parentNode.removeChild(u)}}let d=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Wr(r)&&(d=xo(e))&&d.eq(H.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Ge(e),this.currentSelection.set(r),e.scrollToSelection()):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),Um(e)),this.handleDOMChange(o,s,l,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Ge(e),this.currentSelection.set(r))}registerMutation(e,t){if(t.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];t.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(Se&&at<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:f,nextSibling:h}=e.addedNodes[u];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f),(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(o=h)}let s=i&&i.parentNode==e.target?fe(i)+1:0,l=r.localPosFromDOM(e.target,s,-1),c=o&&o.parentNode==e.target?fe(o):e.target.childNodes.length,d=r.localPosFromDOM(e.target,c,1);return{from:l,to:d}}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 Ks=new WeakMap,Js=!1;function Um(n){if(!Ks.has(n)&&(Ks.set(n,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace)!==-1)){if(n.requiresGeckoHackNode=Le,Js)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."),Js=!0}}function Gs(n,e){let t=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=n.domAtPos(n.state.selection.anchor);return Nt(s.node,s.offset,i,o)&&([t,r,i,o]=[i,o,t,r]),{anchorNode:t,anchorOffset:r,focusNode:i,focusOffset:o}}function qm(n,e){if(e.getComposedRanges){let i=e.getComposedRanges(n.root)[0];if(i)return Gs(n,i)}let t;function r(i){i.preventDefault(),i.stopImmediatePropagation(),t=i.getTargetRanges()[0]}return n.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),n.dom.removeEventListener("beforeinput",r,!0),t?Gs(n,t):null}function Wm(n,e){for(let t=e.parentNode;t&&t!=n.dom;t=t.parentNode){let r=n.docView.nearestDesc(t,!0);if(r&&r.node.isBlock)return t}return null}function Km(n,e,t){let{node:r,fromOffset:i,toOffset:o,from:s,to:l}=n.docView.parseRange(e,t),c=n.domSelectionRange(),d,u=c.anchorNode;if(u&&n.dom.contains(u.nodeType==1?u:u.parentNode)&&(d=[{node:u,offset:c.anchorOffset}],Wr(c)||d.push({node:c.focusNode,offset:c.focusOffset})),ae&&n.input.lastKeyCode===8)for(let y=o;y>i;y--){let k=r.childNodes[y-1],S=k.pmViewDesc;if(k.nodeName=="BR"&&!S){o=y;break}if(!S||S.size)break}let f=n.state.doc,h=n.someProp("domParser")||lt.fromSchema(n.state.schema),p=f.resolve(s),m=null,g=h.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:d,ruleFromNode:Jm,context:p});if(d&&d[0].pos!=null){let y=d[0].pos,k=d[1]&&d[1].pos;k==null&&(k=y),m={anchor:y+s,head:k+s}}return{doc:g,sel:m,from:s,to:l}}function Jm(n){let e=n.pmViewDesc;if(e)return e.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(ge&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(n.parentNode.lastChild==n||ge&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}else if(n.nodeName=="IMG"&&n.getAttribute("mark-placeholder"))return{ignore:!0};return null}const Gm=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Ym(n,e,t,r,i){let o=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let w=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,M=xo(n,w);if(M&&!n.state.selection.eq(M)){if(ae&&Je&&n.input.lastKeyCode===13&&Date.now()-100<n.input.lastKeyCodeTime&&n.someProp("handleKeyDown",$=>$(n,gt(13,"Enter"))))return;let A=n.state.tr.setSelection(M);w=="pointer"?A.setMeta("pointer",!0):w=="key"&&A.scrollIntoView(),o&&A.setMeta("composition",o),n.dispatch(A)}return}let s=n.state.doc.resolve(e),l=s.sharedDepth(t);e=s.before(l+1),t=n.state.doc.resolve(t).after(l+1);let c=n.state.selection,d=Km(n,e,t),u=n.state.doc,f=u.slice(d.from,d.to),h,p;n.input.lastKeyCode===8&&Date.now()-100<n.input.lastKeyCodeTime?(h=n.state.selection.to,p="end"):(h=n.state.selection.from,p="start"),n.input.lastKeyCode=null;let m=Zm(f.content,d.doc.content,d.from,h,p);if(m&&n.input.domChangeCount++,(Yt&&n.input.lastIOSEnter>Date.now()-225||Je)&&i.some(w=>w.nodeType==1&&!Gm.test(w.nodeName))&&(!m||m.endA>=m.endB)&&n.someProp("handleKeyDown",w=>w(n,gt(13,"Enter")))){n.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof V&&!c.empty&&c.$head.sameParent(c.$anchor)&&!n.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(d.sel){let w=Ys(n,n.state.doc,d.sel);if(w&&!w.eq(n.state.selection)){let M=n.state.tr.setSelection(w);o&&M.setMeta("composition",o),n.dispatch(M)}}return}n.state.selection.from<n.state.selection.to&&m.start==m.endB&&n.state.selection instanceof V&&(m.start>n.state.selection.from&&m.start<=n.state.selection.from+2&&n.state.selection.from>=d.from?m.start=n.state.selection.from:m.endA<n.state.selection.to&&m.endA>=n.state.selection.to-2&&n.state.selection.to<=d.to&&(m.endB+=n.state.selection.to-m.endA,m.endA=n.state.selection.to)),Se&&at<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>d.from&&d.doc.textBetween(m.start-d.from-1,m.start-d.from+1)=="  "&&(m.start--,m.endA--,m.endB--);let g=d.doc.resolveNoCache(m.start-d.from),y=d.doc.resolveNoCache(m.endB-d.from),k=u.resolve(m.start),S=g.sameParent(y)&&g.parent.inlineContent&&k.end()>=m.endA;if((Yt&&n.input.lastIOSEnter>Date.now()-225&&(!S||i.some(w=>w.nodeName=="DIV"||w.nodeName=="P"))||!S&&g.pos<d.doc.content.size&&(!g.sameParent(y)||!g.parent.inlineContent)&&g.pos<y.pos&&!/\S/.test(d.doc.textBetween(g.pos,y.pos,"","")))&&n.someProp("handleKeyDown",w=>w(n,gt(13,"Enter")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>m.start&&Xm(u,m.start,m.endA,g,y)&&n.someProp("handleKeyDown",w=>w(n,gt(8,"Backspace")))){Je&&ae&&n.domObserver.suppressSelectionUpdates();return}ae&&m.endB==m.start&&(n.input.lastChromeDelete=Date.now()),Je&&!S&&g.start()!=y.start()&&y.parentOffset==0&&g.depth==y.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==m.endA&&(m.endB-=2,y=d.doc.resolveNoCache(m.endB-d.from),setTimeout(()=>{n.someProp("handleKeyDown",function(w){return w(n,gt(13,"Enter"))})},20));let x=m.start,b=m.endA,v=w=>{let M=w||n.state.tr.replace(x,b,d.doc.slice(m.start-d.from,m.endB-d.from));if(d.sel){let A=Ys(n,M.doc,d.sel);A&&!(ae&&n.composing&&A.empty&&(m.start!=m.endB||n.input.lastChromeDelete<Date.now()-100)&&(A.head==x||A.head==M.mapping.map(b)-1)||Se&&A.empty&&A.head==x)&&M.setSelection(A)}return o&&M.setMeta("composition",o),M.scrollIntoView()},C;if(S)if(g.pos==y.pos){Se&&at<=11&&g.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>Ge(n),20));let w=v(n.state.tr.delete(x,b)),M=u.resolve(m.start).marksAcross(u.resolve(m.endA));M&&w.ensureMarks(M),n.dispatch(w)}else if(m.endA==m.endB&&(C=Qm(g.parent.content.cut(g.parentOffset,y.parentOffset),k.parent.content.cut(k.parentOffset,m.endA-k.start())))){let w=v(n.state.tr);C.type=="add"?w.addMark(x,b,C.mark):w.removeMark(x,b,C.mark),n.dispatch(w)}else if(g.parent.child(g.index()).isText&&g.index()==y.index()-(y.textOffset?0:1)){let w=g.parent.textBetween(g.parentOffset,y.parentOffset),M=()=>v(n.state.tr.insertText(w,x,b));n.someProp("handleTextInput",A=>A(n,x,b,w,M))||n.dispatch(M())}else n.dispatch(v());else n.dispatch(v())}function Ys(n,e,t){return Math.max(t.anchor,t.head)>e.content.size?null:wo(n,e.resolve(t.anchor),e.resolve(t.head))}function Qm(n,e){let t=n.firstChild.marks,r=e.firstChild.marks,i=t,o=r,s,l,c;for(let u=0;u<r.length;u++)i=r[u].removeFromSet(i);for(let u=0;u<t.length;u++)o=t[u].removeFromSet(o);if(i.length==1&&o.length==0)l=i[0],s="add",c=u=>u.mark(l.addToSet(u.marks));else if(i.length==0&&o.length==1)l=o[0],s="remove",c=u=>u.mark(l.removeFromSet(u.marks));else return null;let d=[];for(let u=0;u<e.childCount;u++)d.push(c(e.child(u)));if(T.from(d).eq(n))return{mark:l,type:s}}function Xm(n,e,t,r,i){if(t-e<=i.pos-r.pos||gi(r,!0,!1)<i.pos)return!1;let o=n.resolve(e);if(!r.parent.isTextblock){let l=o.nodeAfter;return l!=null&&t==e+l.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=n.resolve(gi(o,!0,!0));return!s.parent.isTextblock||s.pos>t||gi(s,!0,!1)<t?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function gi(n,e,t){let r=n.depth,i=e?n.end():n.pos;for(;r>0&&(e||n.indexAfter(r)==n.node(r).childCount);)r--,i++,e=!1;if(t){let o=n.node(r).maybeChild(n.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function Zm(n,e,t,r,i){let o=n.findDiffStart(e,t);if(o==null)return null;let{a:s,b:l}=n.findDiffEnd(e,t+n.size,t+e.size);if(i=="end"){let c=Math.max(0,o-Math.min(s,l));r-=s+c-o}if(s<o&&n.size<e.size){let c=r<=o&&r>=s?o-r:0;o-=c,o&&o<e.size&&Qs(e.textBetween(o-1,o+1))&&(o+=c?1:-1),l=o+(l-s),s=o}else if(l<o){let c=r<=o&&r>=l?o-r:0;o-=c,o&&o<n.size&&Qs(n.textBetween(o-1,o+1))&&(o+=c?1:-1),s=o+(s-l),l=o}return{start:o,endA:s,endB:l}}function Qs(n){if(n.length!=2)return!1;let e=n.charCodeAt(0),t=n.charCodeAt(1);return e>=56320&&e<=57343&&t>=55296&&t<=56319}class Ga{constructor(e,t){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 mm,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(tl),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=_s(this),Zs(this),this.nodeViews=el(this),this.docView=Os(this.state.doc,Xs(this),mi(this),this.dom,this),this.domObserver=new jm(this,(r,i,o,s)=>Ym(this,r,i,o,s)),this.domObserver.start(),gm(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 t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Gi(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(tl),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let r in this._props)t[r]=this._props[r];t.state=this.state;for(let r in e)t[r]=e[r];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(Ha(this),s=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(l||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let p=el(this);eg(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(l||t.handleDOMEvents!=this._props.handleDOMEvents)&&Gi(this),this.editable=_s(this),Zs(this);let c=mi(this),d=Xs(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,d,c);(f||!e.selection.eq(i.selection))&&(s=!0);let h=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&Bp(this);if(s){this.domObserver.stop();let p=f&&(Se||ae)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&_m(i.selection,e.selection);if(f){let m=ae?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Bm(this)),(o||!this.docView.update(e.doc,d,c,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=Os(e.doc,d,c,this.dom,this)),m&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&em(this))?Ge(this,p):(Aa(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():h&&Op(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof P){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Ms(this,t.getBoundingClientRect(),e)}else Ms(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 t=0;t<this.directPlugins.length;t++){let r=this.directPlugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let r=this.state.plugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let r=this.pluginViews[t];r.update&&r.update(this,e)}}updateDraggedNode(e,t){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-t.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new Ua(e.slice,e.move,i<0?void 0:P.create(this.state.doc,i))}someProp(e,t){let r=this._props&&this._props[e],i;if(r!=null&&(i=t?t(r):r))return i;for(let s=0;s<this.directPlugins.length;s++){let l=this.directPlugins[s].props[e];if(l!=null&&(i=t?t(l):l))return i}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let l=o[s].props[e];if(l!=null&&(i=t?t(l):l))return i}}hasFocus(){if(Se){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&&Dp(this.dom),Ge(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let t=this.dom.parentNode;t;t=t.parentNode)if(t.nodeType==9||t.nodeType==11&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return zp(this,e)}coordsAtPos(e,t=1){return xa(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,r=-1){let i=this.docView.posFromDOM(e,t,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return jp(this,t||this.state,e)}pasteHTML(e,t){return Cn(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return Cn(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return Co(this,e)}destroy(){this.docView&&(ym(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],mi(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,vp())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return bm(this,e)}domSelectionRange(){let e=this.domSelection();return e?ge&&this.root.nodeType===11&&Mp(this.dom.ownerDocument)==this.dom&&qm(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}Ga.prototype.dispatch=function(n){let e=this._props.dispatchTransaction;e?e.call(this,n):this.updateState(this.state.apply(n))};function Xs(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(n.state)),t)for(let r in t)r=="class"?e.class+=" "+t[r]:r=="style"?e.style=(e.style?e.style+";":"")+t[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(t[r]))}),e.translate||(e.translate="no"),[be.node(0,n.state.doc.content.size,e)]}function Zs(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:be.widget(n.state.selection.from,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function _s(n){return!n.someProp("editable",e=>e(n.state)===!1)}function _m(n,e){let t=Math.min(n.$anchor.sharedDepth(n.head),e.$anchor.sharedDepth(e.head));return n.$anchor.start(t)!=e.$anchor.start(t)}function el(n){let e=Object.create(null);function t(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function eg(n,e){let t=0,r=0;for(let i in n){if(n[i]!=e[i])return!0;t++}for(let i in e)r++;return t!=r}function tl(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var ut={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:"'"},or={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},tg=typeof navigator<"u"&&/Mac/.test(navigator.platform),ng=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var he=0;he<10;he++)ut[48+he]=ut[96+he]=String(he);for(var he=1;he<=24;he++)ut[he+111]="F"+he;for(var he=65;he<=90;he++)ut[he]=String.fromCharCode(he+32),or[he]=String.fromCharCode(he);for(var yi in ut)or.hasOwnProperty(yi)||(or[yi]=ut[yi]);function rg(n){var e=tg&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||ng&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?or:ut)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const ig=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),og=typeof navigator<"u"&&/Win/.test(navigator.platform);function sg(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,o,s;for(let l=0;l<e.length-1;l++){let c=e[l];if(/^(cmd|meta|m)$/i.test(c))s=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))ig?s=!0:i=!0;else throw new Error("Unrecognized modifier name: "+c)}return r&&(t="Alt-"+t),i&&(t="Ctrl-"+t),s&&(t="Meta-"+t),o&&(t="Shift-"+t),t}function lg(n){let e=Object.create(null);for(let t in n)e[sg(t)]=n[t];return e}function ki(n,e,t=!0){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t&&e.shiftKey&&(n="Shift-"+n),n}function ag(n){return new Z({props:{handleKeyDown:Ya(n)}})}function Ya(n){let e=lg(n);return function(t,r){let i=rg(r),o,s=e[ki(i,r)];if(s&&s(t.state,t.dispatch,t))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let l=e[ki(i,r,!1)];if(l&&l(t.state,t.dispatch,t))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(og&&r.ctrlKey&&r.altKey)&&(o=ut[r.keyCode])&&o!=i){let l=e[ki(o,r)];if(l&&l(t.state,t.dispatch,t))return!0}}return!1}}var cg=Object.defineProperty,Ao=(n,e)=>{for(var t in e)cg(n,t,{get:e[t],enumerable:!0})};function Gr(n){const{state:e,transaction:t}=n;let{selection:r}=t,{doc:i}=t,{storedMarks:o}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=t.selection,i=t.doc,o=t.storedMarks,t}}}var Yr=class{constructor(n){this.editor=n.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=n.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:n,editor:e,state:t}=this,{view:r}=e,{tr:i}=t,o=this.buildProps(i);return Object.fromEntries(Object.entries(n).map(([s,l])=>[s,(...d)=>{const u=l(...d)(o);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(i),u}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(n,e=!0){const{rawCommands:t,editor:r,state:i}=this,{view:o}=r,s=[],l=!!n,c=n||i.tr,d=()=>(!l&&e&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(c),s.every(f=>f===!0)),u={...Object.fromEntries(Object.entries(t).map(([f,h])=>[f,(...m)=>{const g=this.buildProps(c,e),y=h(...m)(g);return s.push(y),u}])),run:d};return u}createCan(n){const{rawCommands:e,state:t}=this,r=!1,i=n||t.tr,o=this.buildProps(i,r);return{...Object.fromEntries(Object.entries(e).map(([l,c])=>[l,(...d)=>c(...d)({...o,dispatch:void 0})])),chain:()=>this.createChain(i,r)}}buildProps(n,e=!0){const{rawCommands:t,editor:r,state:i}=this,{view:o}=r,s={tr:n,editor:r,view:o,state:Gr({state:i,transaction:n}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(n,e),can:()=>this.createCan(n),get commands(){return Object.fromEntries(Object.entries(t).map(([l,c])=>[l,(...d)=>c(...d)(s)]))}};return s}},Qa={};Ao(Qa,{blur:()=>dg,clearContent:()=>ug,clearNodes:()=>fg,command:()=>hg,createParagraphNear:()=>pg,cut:()=>mg,deleteCurrentNode:()=>gg,deleteNode:()=>yg,deleteRange:()=>kg,deleteSelection:()=>bg,enter:()=>vg,exitCode:()=>xg,extendMarkRange:()=>wg,first:()=>Cg,focus:()=>Mg,forEach:()=>Tg,insertContent:()=>Eg,insertContentAt:()=>Bg,joinBackward:()=>Ig,joinDown:()=>Dg,joinForward:()=>$g,joinItemBackward:()=>Rg,joinItemForward:()=>Lg,joinTextblockBackward:()=>zg,joinTextblockForward:()=>Pg,joinUp:()=>Og,keyboardShortcut:()=>Fg,lift:()=>Hg,liftEmptyBlock:()=>jg,liftListItem:()=>Ug,newlineInCode:()=>qg,resetAttributes:()=>Wg,scrollIntoView:()=>Kg,selectAll:()=>Jg,selectNodeBackward:()=>Gg,selectNodeForward:()=>Yg,selectParentNode:()=>Qg,selectTextblockEnd:()=>Xg,selectTextblockStart:()=>Zg,setContent:()=>_g,setMark:()=>by,setMeta:()=>vy,setNode:()=>xy,setNodeSelection:()=>wy,setTextDirection:()=>Cy,setTextSelection:()=>Sy,sinkListItem:()=>My,splitBlock:()=>Ty,splitListItem:()=>Ey,toggleList:()=>Ny,toggleMark:()=>Ay,toggleNode:()=>By,toggleWrap:()=>Oy,undoInputRule:()=>Dy,unsetAllMarks:()=>Iy,unsetMark:()=>$y,unsetTextDirection:()=>Ry,updateAttributes:()=>Ly,wrapIn:()=>zy,wrapInList:()=>Py});var dg=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window?.getSelection())==null||t.removeAllRanges())}),!0),ug=(n=!0)=>({commands:e})=>e.setContent("",{emitUpdate:n}),fg=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:i}=r;return t&&i.forEach(({$from:o,$to:s})=>{n.doc.nodesBetween(o.pos,s.pos,(l,c)=>{if(l.type.isText)return;const{doc:d,mapping:u}=e,f=d.resolve(u.map(c)),h=d.resolve(u.map(c+l.nodeSize)),p=f.blockRange(h);if(!p)return;const m=_t(p);if(l.type.isTextblock){const{defaultType:g}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(p.start,g)}(m||m===0)&&e.lift(p,m)})}),!0},hg=n=>e=>n(e),pg=()=>({state:n,dispatch:e})=>sp(n,e),mg=(n,e)=>({editor:t,tr:r})=>{const{state:i}=t,o=i.doc.slice(n.from,n.to);r.deleteRange(n.from,n.to);const s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new V(r.doc.resolve(Math.max(s-1,0)))),!0},gg=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,r=t.$anchor.node();if(r.content.size>0)return!1;const i=n.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const l=i.before(o),c=i.after(o);n.delete(l,c).scrollIntoView()}return!0}return!1};function re(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}var yg=n=>({tr:e,state:t,dispatch:r})=>{const i=re(n,t.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const c=o.before(s),d=o.after(s);e.delete(c,d).scrollIntoView()}return!0}return!1},kg=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},bg=()=>({state:n,dispatch:e})=>Gh(n,e),vg=()=>({commands:n})=>n.keyboardShortcut("Enter"),xg=()=>({state:n,dispatch:e})=>op(n,e);function Bo(n){return Object.prototype.toString.call(n)==="[object RegExp]"}function sr(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:Bo(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function Xa(n,e,t={}){return n.find(r=>r.type===e&&sr(Object.fromEntries(Object.keys(t).map(i=>[i,r.attrs[i]])),t))}function nl(n,e,t={}){return!!Xa(n,e,t)}function Oo(n,e,t){var r;if(!n||!e)return;let i=n.parent.childAfter(n.parentOffset);if((!i.node||!i.node.marks.some(u=>u.type===e))&&(i=n.parent.childBefore(n.parentOffset)),!i.node||!i.node.marks.some(u=>u.type===e)||(t=t||((r=i.node.marks[0])==null?void 0:r.attrs),!Xa([...i.node.marks],e,t)))return;let s=i.index,l=n.start()+i.offset,c=s+1,d=l+i.node.nodeSize;for(;s>0&&nl([...n.parent.child(s-1).marks],e,t);)s-=1,l-=n.parent.child(s).nodeSize;for(;c<n.parent.childCount&&nl([...n.parent.child(c).marks],e,t);)d+=n.parent.child(c).nodeSize,c+=1;return{from:l,to:d}}function Ye(n,e){if(typeof n=="string"){if(!e.marks[n])throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);return e.marks[n]}return n}var wg=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const o=Ye(n,r.schema),{doc:s,selection:l}=t,{$from:c,from:d,to:u}=l;if(i){const f=Oo(c,o,e);if(f&&f.from<=d&&f.to>=u){const h=V.create(s,f.from,f.to);t.setSelection(h)}}return!0},Cg=n=>e=>{const t=typeof n=="function"?n(e):n;for(let r=0;r<t.length;r+=1)if(t[r](e))return!0;return!1};function Za(n){return n instanceof V}function bt(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function _a(n,e=null){if(!e)return null;const t=H.atStart(n),r=H.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return r;const i=t.from,o=r.to;return e==="all"?V.create(n,bt(0,i,o),bt(n.content.size,i,o)):V.create(n,bt(e,i,o),bt(e,i,o))}function Sg(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Do(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var Mg=(n=null,e={})=>({editor:t,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{(Do()||Sg())&&r.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e?.scrollIntoView&&t.commands.scrollIntoView())})};if(r.hasFocus()&&n===null||n===!1)return!0;if(o&&n===null&&!Za(t.state.selection))return s(),!0;const l=_a(i.doc,n)||t.state.selection,c=t.state.selection.eq(l);return o&&(c||i.setSelection(l),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},Tg=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),Eg=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e),ec=n=>{const e=n.childNodes;for(let t=e.length-1;t>=0;t-=1){const r=e[t];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?n.removeChild(r):r.nodeType===1&&ec(r)}return n};function Ln(n){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${n}</body>`,t=new window.DOMParser().parseFromString(e,"text/html").body;return ec(t)}function Mn(n,e,t){if(n instanceof Re||n instanceof T)return n;t={slice:!0,parseOptions:{},...t};const r=typeof n=="object"&&n!==null,i=typeof n=="string";if(r)try{if(Array.isArray(n)&&n.length>0)return T.fromArray(n.map(l=>e.nodeFromJSON(l)));const s=e.nodeFromJSON(n);return t.errorOnInvalidContent&&s.check(),s}catch(o){if(t.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",o),Mn("",e,t)}if(i){if(t.errorOnInvalidContent){let s=!1,l="";const c=new Ul({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:d=>(s=!0,l=typeof d=="string"?d:d.outerHTML,null)}]}})});if(t.slice?lt.fromSchema(c).parseSlice(Ln(n),t.parseOptions):lt.fromSchema(c).parse(Ln(n),t.parseOptions),t.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const o=lt.fromSchema(e);return t.slice?o.parseSlice(Ln(n),t.parseOptions).content:o.parse(Ln(n),t.parseOptions)}return Mn("",e,t)}function Ng(n,e,t){const r=n.steps.length-1;if(r<e)return;const i=n.steps[r];if(!(i instanceof le||i instanceof ce))return;const o=n.mapping.maps[r];let s=0;o.forEach((l,c,d,u)=>{s===0&&(s=u)}),n.setSelection(H.near(n.doc.resolve(s),t))}var Ag=n=>!("type"in n),Bg=(n,e,t)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){t={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...t};let l;const c=y=>{o.emit("contentError",{editor:o,error:y,disableCollaboration:()=>{"collaboration"in o.storage&&typeof o.storage.collaboration=="object"&&o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}})},d={preserveWhitespace:"full",...t.parseOptions};if(!t.errorOnInvalidContent&&!o.options.enableContentCheck&&o.options.emitContentError)try{Mn(e,o.schema,{parseOptions:d,errorOnInvalidContent:!0})}catch(y){c(y)}try{l=Mn(e,o.schema,{parseOptions:d,errorOnInvalidContent:(s=t.errorOnInvalidContent)!=null?s:o.options.enableContentCheck})}catch(y){return c(y),!1}let{from:u,to:f}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},h=!0,p=!0;if((Ag(l)?l:[l]).forEach(y=>{y.check(),h=h?y.isText&&y.marks.length===0:!1,p=p?y.isBlock:!1}),u===f&&p){const{parent:y}=r.doc.resolve(u);y.isTextblock&&!y.type.spec.code&&!y.childCount&&(u-=1,f+=1)}let g;if(h){if(Array.isArray(e))g=e.map(y=>y.text||"").join("");else if(e instanceof T){let y="";e.forEach(k=>{k.text&&(y+=k.text)}),g=y}else typeof e=="object"&&e&&e.text?g=e.text:g=e;r.insertText(g,u,f)}else{g=l;const y=r.doc.resolve(u),k=y.node(),S=y.parentOffset===0,x=k.isText||k.isTextblock,b=k.content.size>0;S&&x&&b&&(u=Math.max(0,u-1)),r.replaceWith(u,f,g)}t.updateSelection&&Ng(r,r.steps.length-1,-1),t.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:g}),t.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:g})}return!0},Og=()=>({state:n,dispatch:e})=>tp(n,e),Dg=()=>({state:n,dispatch:e})=>np(n,e),Ig=()=>({state:n,dispatch:e})=>Yh(n,e),$g=()=>({state:n,dispatch:e})=>_h(n,e),Rg=()=>({state:n,dispatch:e,tr:t})=>{try{const r=jr(n.doc,n.selection.$from.pos,-1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},Lg=()=>({state:n,dispatch:e,tr:t})=>{try{const r=jr(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},zg=()=>({state:n,dispatch:e})=>Qh(n,e),Pg=()=>({state:n,dispatch:e})=>Xh(n,e);function tc(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function Vg(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,i,o,s;for(let l=0;l<e.length-1;l+=1){const c=e[l];if(/^(cmd|meta|m)$/i.test(c))s=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))Do()||tc()?s=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return r&&(t=`Alt-${t}`),i&&(t=`Ctrl-${t}`),s&&(t=`Meta-${t}`),o&&(t=`Shift-${t}`),t}var Fg=n=>({editor:e,view:t,tr:r,dispatch:i})=>{const o=Vg(n).split(/-(?!$)/),s=o.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),l=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{t.someProp("handleKeyDown",d=>d(t,l))});return c?.steps.forEach(d=>{const u=d.map(r.mapping);u&&i&&r.maybeStep(u)}),!0};function ft(n,e,t={}){const{from:r,to:i,empty:o}=n.selection,s=e?re(e,n.schema):null,l=[];n.doc.nodesBetween(r,i,(f,h)=>{if(f.isText)return;const p=Math.max(r,h),m=Math.min(i,h+f.nodeSize);l.push({node:f,from:p,to:m})});const c=i-r,d=l.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>sr(f.node.attrs,t,{strict:!1}));return o?!!d.length:d.reduce((f,h)=>f+h.to-h.from,0)>=c}var Hg=(n,e={})=>({state:t,dispatch:r})=>{const i=re(n,t.schema);return ft(t,i,e)?rp(t,r):!1},jg=()=>({state:n,dispatch:e})=>lp(n,e),Ug=n=>({state:e,dispatch:t})=>{const r=re(n,e.schema);return gp(r)(e,t)},qg=()=>({state:n,dispatch:e})=>ip(n,e);function Qr(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function rl(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((r,i)=>(t.includes(i)||(r[i]=n[i]),r),{})}var Wg=(n,e)=>({tr:t,state:r,dispatch:i})=>{let o=null,s=null;const l=Qr(typeof n=="string"?n:n.name,r.schema);if(!l)return!1;l==="node"&&(o=re(n,r.schema)),l==="mark"&&(s=Ye(n,r.schema));let c=!1;return t.selection.ranges.forEach(d=>{r.doc.nodesBetween(d.$from.pos,d.$to.pos,(u,f)=>{o&&o===u.type&&(c=!0,i&&t.setNodeMarkup(f,void 0,rl(u.attrs,e))),s&&u.marks.length&&u.marks.forEach(h=>{s===h.type&&(c=!0,i&&t.addMark(f,f+u.nodeSize,s.create(rl(h.attrs,e))))})})}),c},Kg=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),Jg=()=>({tr:n,dispatch:e})=>{if(e){const t=new Oe(n.doc);n.setSelection(t)}return!0},Gg=()=>({state:n,dispatch:e})=>Zh(n,e),Yg=()=>({state:n,dispatch:e})=>ep(n,e),Qg=()=>({state:n,dispatch:e})=>ap(n,e),Xg=()=>({state:n,dispatch:e})=>up(n,e),Zg=()=>({state:n,dispatch:e})=>dp(n,e);function Yi(n,e,t={},r={}){return Mn(n,e,{slice:!1,parseOptions:t,errorOnInvalidContent:r.errorOnInvalidContent})}var _g=(n,{errorOnInvalidContent:e,emitUpdate:t=!0,parseOptions:r={}}={})=>({editor:i,tr:o,dispatch:s,commands:l})=>{const{doc:c}=o;if(r.preserveWhitespace!=="full"){const d=Yi(n,i.schema,r,{errorOnInvalidContent:e??i.options.enableContentCheck});return s&&o.replaceWith(0,c.content.size,d).setMeta("preventUpdate",!t),!0}return s&&o.setMeta("preventUpdate",!t),l.insertContentAt({from:0,to:c.content.size},n,{parseOptions:r,errorOnInvalidContent:e??i.options.enableContentCheck})};function nc(n,e){const t=Ye(e,n.schema),{from:r,to:i,empty:o}=n.selection,s=[];o?(n.storedMarks&&s.push(...n.storedMarks),s.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,i,c=>{s.push(...c.marks)});const l=s.find(c=>c.type.name===t.name);return l?{...l.attrs}:{}}function rc(n,e){const t=new oa(n);return e.forEach(r=>{r.steps.forEach(i=>{t.step(i)})}),t}function ey(n){for(let e=0;e<n.edgeCount;e+=1){const{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}function ty(n,e,t){const r=[];return n.nodesBetween(e.from,e.to,(i,o)=>{t(i)&&r.push({node:i,pos:o})}),r}function ny(n,e){for(let t=n.depth;t>0;t-=1){const r=n.node(t);if(e(r))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:r}}}function Xr(n){return e=>ny(e.$from,n)}function z(n,e,t){return n.config[e]===void 0&&n.parent?z(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?z(n.parent,e,t):null}):n.config[e]}function Io(n){return n.map(e=>{const t={name:e.name,options:e.options,storage:e.storage},r=z(e,"addExtensions",t);return r?[e,...Io(r())]:e}).flat(10)}function $o(n,e){const t=Ot.fromSchema(e).serializeFragment(n),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(t),i.innerHTML}function ic(n){return typeof n=="function"}function G(n,e=void 0,...t){return ic(n)?e?n.bind(e)(...t):n(...t):n}function ry(n={}){return Object.keys(n).length===0&&n.constructor===Object}function Qt(n){const e=n.filter(i=>i.type==="extension"),t=n.filter(i=>i.type==="node"),r=n.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:r}}function oc(n){const e=[],{nodeExtensions:t,markExtensions:r}=Qt(n),i=[...t,...r],o={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return n.forEach(s=>{const l={name:s.name,options:s.options,storage:s.storage,extensions:i},c=z(s,"addGlobalAttributes",l);if(!c)return;c().forEach(u=>{u.types.forEach(f=>{Object.entries(u.attributes).forEach(([h,p])=>{e.push({type:f,name:h,attribute:{...o,...p}})})})})}),i.forEach(s=>{const l={name:s.name,options:s.options,storage:s.storage},c=z(s,"addAttributes",l);if(!c)return;const d=c();Object.entries(d).forEach(([u,f])=>{const h={...o,...f};typeof h?.default=="function"&&(h.default=h.default()),h?.isRequired&&h?.default===void 0&&delete h.default,e.push({type:s.name,name:u,attribute:h})})}),e}function ie(...n){return n.filter(e=>!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const l=o?String(o).split(" "):[],c=r[i]?r[i].split(" "):[],d=l.filter(u=>!c.includes(u));r[i]=[...c,...d].join(" ")}else if(i==="style"){const l=o?o.split(";").map(u=>u.trim()).filter(Boolean):[],c=r[i]?r[i].split(";").map(u=>u.trim()).filter(Boolean):[],d=new Map;c.forEach(u=>{const[f,h]=u.split(":").map(p=>p.trim());d.set(f,h)}),l.forEach(u=>{const[f,h]=u.split(":").map(p=>p.trim());d.set(f,h)}),r[i]=Array.from(d.entries()).map(([u,f])=>`${u}: ${f}`).join("; ")}else r[i]=o}),r},{})}function lr(n,e){return e.filter(t=>t.type===n.type.name).filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>ie(t,r),{})}function iy(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function il(n,e){return"style"in n?n:{...n,getAttrs:t=>{const r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;const i=e.reduce((o,s)=>{const l=s.attribute.parseHTML?s.attribute.parseHTML(t):iy(t.getAttribute(s.name));return l==null?o:{...o,[s.name]:l}},{});return{...r,...i}}}}function ol(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&ry(t)?!1:t!=null))}function sl(n){var e,t;const r={};return!((e=n?.attribute)!=null&&e.isRequired)&&"default"in(n?.attribute||{})&&(r.default=n.attribute.default),((t=n?.attribute)==null?void 0:t.validate)!==void 0&&(r.validate=n.attribute.validate),[n.name,r]}function oy(n,e){var t;const r=oc(n),{nodeExtensions:i,markExtensions:o}=Qt(n),s=(t=i.find(d=>z(d,"topNode")))==null?void 0:t.name,l=Object.fromEntries(i.map(d=>{const u=r.filter(k=>k.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:e},h=n.reduce((k,S)=>{const x=z(S,"extendNodeSchema",f);return{...k,...x?x(d):{}}},{}),p=ol({...h,content:G(z(d,"content",f)),marks:G(z(d,"marks",f)),group:G(z(d,"group",f)),inline:G(z(d,"inline",f)),atom:G(z(d,"atom",f)),selectable:G(z(d,"selectable",f)),draggable:G(z(d,"draggable",f)),code:G(z(d,"code",f)),whitespace:G(z(d,"whitespace",f)),linebreakReplacement:G(z(d,"linebreakReplacement",f)),defining:G(z(d,"defining",f)),isolating:G(z(d,"isolating",f)),attrs:Object.fromEntries(u.map(sl))}),m=G(z(d,"parseHTML",f));m&&(p.parseDOM=m.map(k=>il(k,u)));const g=z(d,"renderHTML",f);g&&(p.toDOM=k=>g({node:k,HTMLAttributes:lr(k,u)}));const y=z(d,"renderText",f);return y&&(p.toText=y),[d.name,p]})),c=Object.fromEntries(o.map(d=>{const u=r.filter(y=>y.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:e},h=n.reduce((y,k)=>{const S=z(k,"extendMarkSchema",f);return{...y,...S?S(d):{}}},{}),p=ol({...h,inclusive:G(z(d,"inclusive",f)),excludes:G(z(d,"excludes",f)),group:G(z(d,"group",f)),spanning:G(z(d,"spanning",f)),code:G(z(d,"code",f)),attrs:Object.fromEntries(u.map(sl))}),m=G(z(d,"parseHTML",f));m&&(p.parseDOM=m.map(y=>il(y,u)));const g=z(d,"renderHTML",f);return g&&(p.toDOM=y=>g({mark:y,HTMLAttributes:lr(y,u)})),[d.name,p]}));return new Ul({topNode:s,nodes:l,marks:c})}function sy(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return Array.from(new Set(e))}function Ro(n){return n.sort((t,r)=>{const i=z(t,"priority")||100,o=z(r,"priority")||100;return i>o?-1:i<o?1:0})}function sc(n){const e=Ro(Io(n)),t=sy(e.map(r=>r.name));return t.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${t.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function lc(n,e,t){const{from:r,to:i}=e,{blockSeparator:o=`
14
14
 
15
15
  `,textSerializers:s={}}=t||{};let l="";return n.nodesBetween(r,i,(c,d,u,f)=>{var h;c.isBlock&&d>r&&(l+=o);const p=s?.[c.type.name];if(p)return u&&(l+=p({node:c,pos:d,parent:u,index:f,range:e})),!1;c.isText&&(l+=(h=c?.text)==null?void 0:h.slice(Math.max(r,d)-d,i-d))}),l}function ly(n,e){const t={from:0,to:n.content.size};return lc(n,t,e)}function ac(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function ay(n,e){const t=re(e,n.schema),{from:r,to:i}=n.selection,o=[];n.doc.nodesBetween(r,i,l=>{o.push(l)});const s=o.reverse().find(l=>l.type.name===t.name);return s?{...s.attrs}:{}}function cc(n,e){const t=Qr(typeof e=="string"?e:e.name,n.schema);return t==="node"?ay(n,e):t==="mark"?nc(n,e):{}}function cy(n,e=JSON.stringify){const t={};return n.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(t,i)?!1:t[i]=!0})}function dy(n){const e=cy(n);return e.length===1?e:e.filter((t,r)=>!e.filter((o,s)=>s!==r).some(o=>t.oldRange.from>=o.oldRange.from&&t.oldRange.to<=o.oldRange.to&&t.newRange.from>=o.newRange.from&&t.newRange.to<=o.newRange.to))}function dc(n){const{mapping:e,steps:t}=n,r=[];return e.maps.forEach((i,o)=>{const s=[];if(i.ranges.length)i.forEach((l,c)=>{s.push({from:l,to:c})});else{const{from:l,to:c}=t[o];if(l===void 0||c===void 0)return;s.push({from:l,to:c})}s.forEach(({from:l,to:c})=>{const d=e.slice(o).map(l,-1),u=e.slice(o).map(c),f=e.invert().map(d,-1),h=e.invert().map(u);r.push({oldRange:{from:f,to:h},newRange:{from:d,to:u}})})}),dy(r)}function Lo(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(i=>{const o=t.resolve(n),s=Oo(o,i.type);s&&r.push({mark:i,...s})}):t.nodesBetween(n,e,(i,o)=>{!i||i?.nodeSize===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}var uy=(n,e,t,r=20)=>{const i=n.doc.resolve(t);let o=r,s=null;for(;o>0&&s===null;){const l=i.node(o);l?.type.name===e?s=l:o-=1}return[s,o]};function bi(n,e){return e.nodes[n]||e.marks[n]||null}function Kn(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{const i=n.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}var fy=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,l)=>{var c,d;const u=((d=(c=i.type.spec).toText)==null?void 0:d.call(c,{node:i,pos:o,parent:s,index:l}))||i.textContent||"%leaf%";t+=i.isAtom&&!i.isText?u:u.slice(0,Math.max(0,r-o))}),t};function Qi(n,e,t={}){const{empty:r,ranges:i}=n.selection,o=e?Ye(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>sr(f.attrs,t,{strict:!1}));let s=0;const l=[];if(i.forEach(({$from:f,$to:h})=>{const p=f.pos,m=h.pos;n.doc.nodesBetween(p,m,(g,y)=>{if(!g.isText&&!g.marks.length)return;const k=Math.max(p,y),S=Math.min(m,y+g.nodeSize),x=S-k;s+=x,l.push(...g.marks.map(b=>({mark:b,from:k,to:S})))})}),s===0)return!1;const c=l.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>sr(f.mark.attrs,t,{strict:!1})).reduce((f,h)=>f+h.to-h.from,0),d=l.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,h)=>f+h.to-h.from,0);return(c>0?c+d:c)>=s}function hy(n,e,t={}){if(!e)return ft(n,null,t)||Qi(n,null,t);const r=Qr(e,n.schema);return r==="node"?ft(n,e,t):r==="mark"?Qi(n,e,t):!1}var py=(n,e)=>{const{$from:t,$to:r,$anchor:i}=n.selection;if(e){const o=Xr(l=>l.type.name===e)(n.selection);if(!o)return!1;const s=n.doc.resolve(o.pos+1);return i.pos+1===s.end()}return!(r.parentOffset<r.parent.nodeSize-2||t.pos!==r.pos)},my=n=>{const{$from:e,$to:t}=n.selection;return!(e.parentOffset>0||e.pos!==t.pos)};function ll(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}function al(n,e){const{nodeExtensions:t}=Qt(e),r=t.find(s=>s.name===n);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=G(z(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function Zr(n,{checkChildren:e=!0,ignoreWhitespace:t=!1}={}){var r;if(t){if(n.type.name==="hardBreak")return!0;if(n.isText)return/^\s*$/m.test((r=n.text)!=null?r:"")}if(n.isText)return!n.text;if(n.isAtom||n.isLeaf)return!1;if(n.content.childCount===0)return!0;if(e){let i=!0;return n.content.forEach(o=>{i!==!1&&(Zr(o,{ignoreWhitespace:t,checkChildren:e})||(i=!1))}),i}return!1}function uc(n){return n instanceof P}var fc=class hc{constructor(e){this.position=e}static fromJSON(e){return new hc(e.position)}toJSON(){return{position:this.position}}};function gy(n,e){const t=e.mapping.mapResult(n.position);return{position:new fc(t.pos),mapResult:t}}function yy(n){return new fc(n)}function ky(n,e,t){var r;const{selection:i}=e;let o=null;if(Za(i)&&(o=i.$cursor),o){const l=(r=n.storedMarks)!=null?r:o.marks();return o.parent.type.allowsMarkType(t)&&(!!t.isInSet(l)||!l.some(d=>d.type.excludes(t)))}const{ranges:s}=i;return s.some(({$from:l,$to:c})=>{let d=l.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(l.pos,c.pos,(u,f,h)=>{if(d)return!1;if(u.isInline){const p=!h||h.type.allowsMarkType(t),m=!!t.isInSet(u.marks)||!u.marks.some(g=>g.type.excludes(t));d=p&&m}return!d}),d})}var by=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{selection:o}=t,{empty:s,ranges:l}=o,c=Ye(n,r.schema);if(i)if(s){const d=nc(r,c);t.addStoredMark(c.create({...d,...e}))}else l.forEach(d=>{const u=d.$from.pos,f=d.$to.pos;r.doc.nodesBetween(u,f,(h,p)=>{const m=Math.max(p,u),g=Math.min(p+h.nodeSize,f);h.marks.find(k=>k.type===c)?h.marks.forEach(k=>{c===k.type&&t.addMark(m,g,c.create({...k.attrs,...e}))}):t.addMark(m,g,c.create(e))})});return ky(r,t,c)},vy=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),xy=(n,e={})=>({state:t,dispatch:r,chain:i})=>{const o=re(n,t.schema);let s;return t.selection.$anchor.sameParent(t.selection.$head)&&(s=t.selection.$anchor.parent.attrs),o.isTextblock?i().command(({commands:l})=>ws(o,{...s,...e})(t)?!0:l.clearNodes()).command(({state:l})=>ws(o,{...s,...e})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},wy=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,i=bt(n,0,r.content.size),o=P.create(r,i);e.setSelection(o)}return!0},Cy=(n,e)=>({tr:t,state:r,dispatch:i})=>{const{selection:o}=r;let s,l;return typeof e=="number"?(s=e,l=e):e&&"from"in e&&"to"in e?(s=e.from,l=e.to):(s=o.from,l=o.to),i&&t.doc.nodesBetween(s,l,(c,d)=>{c.isText||t.setNodeMarkup(d,void 0,{...c.attrs,dir:n})}),!0},Sy=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:i,to:o}=typeof n=="number"?{from:n,to:n}:n,s=V.atStart(r).from,l=V.atEnd(r).to,c=bt(i,s,l),d=bt(o,s,l),u=V.create(r,c,d);e.setSelection(u)}return!0},My=n=>({state:e,dispatch:t})=>{const r=re(n,e.schema);return bp(r)(e,t)};function cl(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const r=t.filter(i=>e?.includes(i.type.name));n.tr.ensureMarks(r)}}var Ty=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{const{selection:o,doc:s}=e,{$from:l,$to:c}=o,d=i.extensionManager.attributes,u=Kn(d,l.node().type.name,l.node().attrs);if(o instanceof P&&o.node.isBlock)return!l.parentOffset||!jt(s,l.pos)?!1:(r&&(n&&cl(t,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const f=c.parentOffset===c.parent.content.size,h=l.depth===0?void 0:ey(l.node(-1).contentMatchAt(l.indexAfter(-1)));let p=f&&h?[{type:h,attrs:u}]:void 0,m=jt(e.doc,e.mapping.map(l.pos),1,p);if(!p&&!m&&jt(e.doc,e.mapping.map(l.pos),1,h?[{type:h}]:void 0)&&(m=!0,p=h?[{type:h,attrs:u}]:void 0),r){if(m&&(o instanceof V&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,p),h&&!f&&!l.parentOffset&&l.parent.type!==h)){const g=e.mapping.map(l.before()),y=e.doc.resolve(g);l.node(-1).canReplaceWith(y.index(),y.index()+1,h)&&e.setNodeMarkup(e.mapping.map(l.before()),h)}n&&cl(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return m},Ey=(n,e={})=>({tr:t,state:r,dispatch:i,editor:o})=>{var s;const l=re(n,r.schema),{$from:c,$to:d}=r.selection,u=r.selection.node;if(u&&u.isBlock||c.depth<2||!c.sameParent(d))return!1;const f=c.node(-1);if(f.type!==l)return!1;const h=o.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==l||c.index(-2)!==c.node(-2).childCount-1)return!1;if(i){let k=T.empty;const S=c.index(-1)?1:c.index(-2)?2:3;for(let M=c.depth-S;M>=c.depth-3;M-=1)k=T.from(c.node(M).copy(k));const x=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,b={...Kn(h,c.node().type.name,c.node().attrs),...e},v=((s=l.contentMatch.defaultType)==null?void 0:s.createAndFill(b))||void 0;k=k.append(T.from(l.createAndFill(null,v)||void 0));const C=c.before(c.depth-(S-1));t.replace(C,c.after(-x),new B(k,4-S,0));let w=-1;t.doc.nodesBetween(C,t.doc.content.size,(M,A)=>{if(w>-1)return!1;M.isTextblock&&M.content.size===0&&(w=A+1)}),w>-1&&t.setSelection(V.near(t.doc.resolve(w))),t.scrollIntoView()}return!0}const p=d.pos===c.end()?f.contentMatchAt(0).defaultType:null,m={...Kn(h,f.type.name,f.attrs),...e},g={...Kn(h,c.node().type.name,c.node().attrs),...e};t.delete(c.pos,d.pos);const y=p?[{type:l,attrs:m},{type:p,attrs:g}]:[{type:l,attrs:m}];if(!jt(t.doc,c.pos,2))return!1;if(i){const{selection:k,storedMarks:S}=r,{splittableMarks:x}=o.extensionManager,b=S||k.$to.parentOffset&&k.$from.marks();if(t.split(c.pos,2,y).scrollIntoView(),!b||!i)return!0;const v=b.filter(C=>x.includes(C.type.name));t.ensureMarks(v)}return!0},vi=(n,e)=>{const t=Xr(s=>s.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===i?.type&&ht(n.doc,t.pos)&&n.join(t.pos),!0},xi=(n,e)=>{const t=Xr(s=>s.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(t.start).after(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===i?.type&&ht(n.doc,r)&&n.join(r),!0},Ny=(n,e,t,r={})=>({editor:i,tr:o,state:s,dispatch:l,chain:c,commands:d,can:u})=>{const{extensions:f,splittableMarks:h}=i.extensionManager,p=re(n,s.schema),m=re(e,s.schema),{selection:g,storedMarks:y}=s,{$from:k,$to:S}=g,x=k.blockRange(S),b=y||g.$to.parentOffset&&g.$from.marks();if(!x)return!1;const v=Xr(C=>al(C.type.name,f))(g);if(x.depth>=1&&v&&x.depth-v.depth<=1){if(v.node.type===p)return d.liftListItem(m);if(al(v.node.type.name,f)&&p.validContent(v.node.content)&&l)return c().command(()=>(o.setNodeMarkup(v.pos,p),!0)).command(()=>vi(o,p)).command(()=>xi(o,p)).run()}return!t||!b||!l?c().command(()=>u().wrapInList(p,r)?!0:d.clearNodes()).wrapInList(p,r).command(()=>vi(o,p)).command(()=>xi(o,p)).run():c().command(()=>{const C=u().wrapInList(p,r),w=b.filter(M=>h.includes(M.type.name));return o.ensureMarks(w),C?!0:d.clearNodes()}).wrapInList(p,r).command(()=>vi(o,p)).command(()=>xi(o,p)).run()},Ay=(n,e={},t={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=t,s=Ye(n,r.schema);return Qi(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},By=(n,e,t={})=>({state:r,commands:i})=>{const o=re(n,r.schema),s=re(e,r.schema),l=ft(r,o,t);let c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),l?i.setNode(s,c):i.setNode(o,{...c,...t})},Oy=(n,e={})=>({state:t,commands:r})=>{const i=re(n,t.schema);return ft(t,i,e)?r.lift(i):r.wrapIn(i,e)},Dy=()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let r=0;r<t.length;r+=1){const i=t[r];let o;if(i.spec.isInputRules&&(o=i.getState(n))){if(e){const s=n.tr,l=o.transform;for(let c=l.steps.length-1;c>=0;c-=1)s.step(l.steps[c].invert(l.docs[c]));if(o.text){const c=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,n.schema.text(o.text,c))}else s.delete(o.from,o.to)}return!0}}return!1},Iy=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,{empty:r,ranges:i}=t;return r||e&&i.forEach(o=>{n.removeMark(o.$from.pos,o.$to.pos)}),!0},$y=(n,e={})=>({tr:t,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=e,{selection:l}=t,c=Ye(n,r.schema),{$from:d,empty:u,ranges:f}=l;if(!i)return!0;if(u&&s){let{from:h,to:p}=l;const m=(o=d.marks().find(y=>y.type===c))==null?void 0:o.attrs,g=Oo(d,c,m);g&&(h=g.from,p=g.to),t.removeMark(h,p,c)}else f.forEach(h=>{t.removeMark(h.$from.pos,h.$to.pos,c)});return t.removeStoredMark(c),!0},Ry=n=>({tr:e,state:t,dispatch:r})=>{const{selection:i}=t;let o,s;return typeof n=="number"?(o=n,s=n):n&&"from"in n&&"to"in n?(o=n.from,s=n.to):(o=i.from,s=i.to),r&&e.doc.nodesBetween(o,s,(l,c)=>{if(l.isText)return;const d={...l.attrs};delete d.dir,e.setNodeMarkup(c,void 0,d)}),!0},Ly=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let o=null,s=null;const l=Qr(typeof n=="string"?n:n.name,r.schema);if(!l)return!1;l==="node"&&(o=re(n,r.schema)),l==="mark"&&(s=Ye(n,r.schema));let c=!1;return t.selection.ranges.forEach(d=>{const u=d.$from.pos,f=d.$to.pos;let h,p,m,g;t.selection.empty?r.doc.nodesBetween(u,f,(y,k)=>{o&&o===y.type&&(c=!0,m=Math.max(k,u),g=Math.min(k+y.nodeSize,f),h=k,p=y)}):r.doc.nodesBetween(u,f,(y,k)=>{k<u&&o&&o===y.type&&(c=!0,m=Math.max(k,u),g=Math.min(k+y.nodeSize,f),h=k,p=y),k>=u&&k<=f&&(o&&o===y.type&&(c=!0,i&&t.setNodeMarkup(k,void 0,{...y.attrs,...e})),s&&y.marks.length&&y.marks.forEach(S=>{if(s===S.type&&(c=!0,i)){const x=Math.max(k,u),b=Math.min(k+y.nodeSize,f);t.addMark(x,b,s.create({...S.attrs,...e}))}}))}),p&&(h!==void 0&&i&&t.setNodeMarkup(h,void 0,{...p.attrs,...e}),s&&p.marks.length&&p.marks.forEach(y=>{s===y.type&&i&&t.addMark(m,g,s.create({...y.attrs,...e}))}))}),c},zy=(n,e={})=>({state:t,dispatch:r})=>{const i=re(n,t.schema);return fp(i,e)(t,r)},Py=(n,e={})=>({state:t,dispatch:r})=>{const i=re(n,t.schema);return hp(i,e)(t,r)},Vy=class{constructor(){this.callbacks={}}on(n,e){return this.callbacks[n]||(this.callbacks[n]=[]),this.callbacks[n].push(e),this}emit(n,...e){const t=this.callbacks[n];return t&&t.forEach(r=>r.apply(this,e)),this}off(n,e){const t=this.callbacks[n];return t&&(e?this.callbacks[n]=t.filter(r=>r!==e):delete this.callbacks[n]),this}once(n,e){const t=(...r)=>{this.off(n,t),e.apply(this,r)};return this.on(n,t)}removeAllListeners(){this.callbacks={}}},_r=class{constructor(n){var e;this.find=n.find,this.handler=n.handler,this.undoable=(e=n.undoable)!=null?e:!0}},Fy=(n,e)=>{if(Bo(e))return e.exec(n);const t=e(n);if(!t)return null;const r=[t.text];return r.index=t.index,r.input=n,r.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(t.replaceWith)),r};function zn(n){var e;const{editor:t,from:r,to:i,text:o,rules:s,plugin:l}=n,{view:c}=t;if(c.composing)return!1;const d=c.state.doc.resolve(r);if(d.parent.type.spec.code||(e=d.nodeBefore||d.nodeAfter)!=null&&e.marks.find(h=>h.type.spec.code))return!1;let u=!1;const f=fy(d)+o;return s.forEach(h=>{if(u)return;const p=Fy(f,h.find);if(!p)return;const m=c.state.tr,g=Gr({state:c.state,transaction:m}),y={from:r-(p[0].length-o.length),to:i},{commands:k,chain:S,can:x}=new Yr({editor:t,state:g});h.handler({state:g,range:y,match:p,commands:k,chain:S,can:x})===null||!m.steps.length||(h.undoable&&m.setMeta(l,{transform:m,from:r,to:i,text:o}),c.dispatch(m),u=!0)}),u}function Hy(n){const{editor:e,rules:t}=n,r=new Z({state:{init(){return null},apply(i,o,s){const l=i.getMeta(r);if(l)return l;const c=i.getMeta("applyInputRules");return c&&setTimeout(()=>{let{text:u}=c;typeof u=="string"?u=u:u=$o(T.from(u),s.schema);const{from:f}=c,h=f+u.length;zn({editor:e,from:f,to:h,text:u,rules:t,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,l){return zn({editor:e,from:o,to:s,text:l,rules:t,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&zn({editor:e,from:o.pos,to:o.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:s}=i.state.selection;return s?zn({editor:e,from:s.pos,to:s.pos,text:`
16
- `,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function jy(n){return Object.prototype.toString.call(n).slice(8,-1)}function Pn(n){return jy(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function pc(n,e){const t={...n};return Pn(n)&&Pn(e)&&Object.keys(e).forEach(r=>{Pn(e[r])&&Pn(n[r])?t[r]=pc(n[r],e[r]):t[r]=e[r]}),t}var zo=class{constructor(n={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...n},this.name=this.config.name}get options(){return{...G(z(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...G(z(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(n={}){const e=this.extend({...this.config,addOptions:()=>pc(this.options,n)});return e.name=this.name,e.parent=this.parent,e}extend(n={}){const e=new this.constructor({...this.config,...n});return e.parent=this,this.child=e,e.name="name"in n?n.name:e.parent.name,e}},It=class mc extends zo{constructor(){super(...arguments),this.type="mark"}static create(e={}){const t=typeof e=="function"?e():e;return new mc(t)}static handleExit({editor:e,mark:t}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(d=>d?.type.name===t.name))return!1;const c=s.find(d=>d?.type.name===t.name);return c&&r.removeStoredMark(c),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}};function Uy(n){return typeof n=="number"}var qy=class{constructor(n){this.find=n.find,this.handler=n.handler}},Wy=(n,e,t)=>{if(Bo(e))return[...n.matchAll(e)];const r=e(n,t);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=n,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function Ky(n){const{editor:e,state:t,from:r,to:i,rule:o,pasteEvent:s,dropEvent:l}=n,{commands:c,chain:d,can:u}=new Yr({editor:e,state:t}),f=[];return t.doc.nodesBetween(r,i,(p,m)=>{var g,y,k,S,x;if((y=(g=p.type)==null?void 0:g.spec)!=null&&y.code||!(p.isText||p.isTextblock||p.isInline))return;const b=(x=(S=(k=p.content)==null?void 0:k.size)!=null?S:p.nodeSize)!=null?x:0,v=Math.max(r,m),C=Math.min(i,m+b);if(v>=C)return;const w=p.isText?p.text||"":p.textBetween(v-m,C-m,void 0,"");Wy(w,o.find,s).forEach(A=>{if(A.index===void 0)return;const $=v+A.index+1,U=$+A[0].length,j={from:t.tr.mapping.map($),to:t.tr.mapping.map(U)},K=o.handler({state:t,range:j,match:A,commands:c,chain:d,can:u,pasteEvent:s,dropEvent:l});f.push(K)})}),f.every(p=>p!==null)}var Vn=null,Jy=n=>{var e;const t=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=t.clipboardData)==null||e.setData("text/html",n),t};function Gy(n){const{editor:e,rules:t}=n;let r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}const c=({state:u,from:f,to:h,rule:p,pasteEvt:m})=>{const g=u.tr,y=Gr({state:u,transaction:g});if(!(!Ky({editor:e,state:y,from:Math.max(f-1,0),to:h.b-1,rule:p,pasteEvent:m,dropEvent:l})||!g.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g}};return t.map(u=>new Z({view(f){const h=m=>{var g;r=(g=f.dom.parentElement)!=null&&g.contains(m.target)?f.dom.parentElement:null,r&&(Vn=e)},p=()=>{Vn&&(Vn=null)};return window.addEventListener("dragstart",h),window.addEventListener("dragend",p),{destroy(){window.removeEventListener("dragstart",h),window.removeEventListener("dragend",p)}}},props:{handleDOMEvents:{drop:(f,h)=>{if(o=r===f.dom.parentElement,l=h,!o){const p=Vn;p?.isEditable&&setTimeout(()=>{const m=p.state.selection;m&&p.commands.deleteRange({from:m.from,to:m.to})},10)}return!1},paste:(f,h)=>{var p;const m=(p=h.clipboardData)==null?void 0:p.getData("text/html");return s=h,i=!!m?.includes("data-pm-slice"),!1}}},appendTransaction:(f,h,p)=>{const m=f[0],g=m.getMeta("uiEvent")==="paste"&&!i,y=m.getMeta("uiEvent")==="drop"&&!o,k=m.getMeta("applyPasteRules"),S=!!k;if(!g&&!y&&!S)return;if(S){let{text:v}=k;typeof v=="string"?v=v:v=$o(T.from(v),p.schema);const{from:C}=k,w=C+v.length,M=Jy(v);return c({rule:u,state:p,from:C,to:{b:w},pasteEvt:M})}const x=h.doc.content.findDiffStart(p.doc.content),b=h.doc.content.findDiffEnd(p.doc.content);if(!(!Uy(x)||!b||x===b.b))return c({rule:u,state:p,from:x,to:b,pasteEvt:s})}}))}var ei=class{constructor(n,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=n,this.extensions=sc(n),this.schema=oy(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((n,e)=>{const t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:bi(e.name,this.schema)},r=z(e,"addCommands",t);return r?{...n,...r()}:n},{})}get plugins(){const{editor:n}=this;return Ro([...this.extensions].reverse()).flatMap(r=>{const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:n,type:bi(r.name,this.schema)},o=[],s=z(r,"addKeyboardShortcuts",i);let l={};if(r.type==="mark"&&z(r,"exitable",i)&&(l.ArrowRight=()=>It.handleExit({editor:n,mark:r})),s){const h=Object.fromEntries(Object.entries(s()).map(([p,m])=>[p,()=>m({editor:n})]));l={...l,...h}}const c=ag(l);o.push(c);const d=z(r,"addInputRules",i);if(ll(r,n.options.enableInputRules)&&d){const h=d();if(h&&h.length){const p=Hy({editor:n,rules:h}),m=Array.isArray(p)?p:[p];o.push(...m)}}const u=z(r,"addPasteRules",i);if(ll(r,n.options.enablePasteRules)&&u){const h=u();if(h&&h.length){const p=Gy({editor:n,rules:h});o.push(...p)}}const f=z(r,"addProseMirrorPlugins",i);if(f){const h=f();o.push(...h)}return o})}get attributes(){return oc(this.extensions)}get nodeViews(){const{editor:n}=this,{nodeExtensions:e}=Qt(this.extensions);return Object.fromEntries(e.filter(t=>!!z(t,"addNodeView")).map(t=>{const r=this.attributes.filter(c=>c.type===t.name),i={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:n,type:re(t.name,this.schema)},o=z(t,"addNodeView",i);if(!o)return[];const s=o();if(!s)return[];const l=(c,d,u,f,h)=>{const p=lr(c,r);return s({node:c,view:d,getPos:u,decorations:f,innerDecorations:h,editor:n,extension:t,HTMLAttributes:p})};return[t.name,l]}))}get markViews(){const{editor:n}=this,{markExtensions:e}=Qt(this.extensions);return Object.fromEntries(e.filter(t=>!!z(t,"addMarkView")).map(t=>{const r=this.attributes.filter(l=>l.type===t.name),i={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:n,type:Ye(t.name,this.schema)},o=z(t,"addMarkView",i);if(!o)return[];const s=(l,c,d)=>{const u=lr(l,r);return o()({mark:l,view:c,inline:d,editor:n,extension:t,HTMLAttributes:u,updateAttributes:f=>{a0(l,n,f)}})};return[t.name,s]}))}setupExtensions(){const n=this.extensions;this.editor.extensionStorage=Object.fromEntries(n.map(e=>[e.name,e.storage])),n.forEach(e=>{var t;const r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:bi(e.name,this.schema)};e.type==="mark"&&((t=G(z(e,"keepOnSplit",r)))==null||t)&&this.splittableMarks.push(e.name);const i=z(e,"onBeforeCreate",r),o=z(e,"onCreate",r),s=z(e,"onUpdate",r),l=z(e,"onSelectionUpdate",r),c=z(e,"onTransaction",r),d=z(e,"onFocus",r),u=z(e,"onBlur",r),f=z(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),s&&this.editor.on("update",s),l&&this.editor.on("selectionUpdate",l),c&&this.editor.on("transaction",c),d&&this.editor.on("focus",d),u&&this.editor.on("blur",u),f&&this.editor.on("destroy",f)})}};ei.resolve=sc;ei.sort=Ro;ei.flatten=Io;var Yy={};Ao(Yy,{ClipboardTextSerializer:()=>yc,Commands:()=>kc,Delete:()=>bc,Drop:()=>vc,Editable:()=>xc,FocusEvents:()=>Cc,Keymap:()=>Sc,Paste:()=>Mc,Tabindex:()=>Tc,TextDirection:()=>Ec,focusEventsPluginKey:()=>wc});var te=class gc extends zo{constructor(){super(...arguments),this.type="extension"}static create(e={}){const t=typeof e=="function"?e():e;return new gc(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}},yc=te.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Z({key:new oe("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(u=>u.$from.pos)),l=Math.max(...o.map(u=>u.$to.pos)),c=ac(t);return lc(r,{from:s,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),kc=te.create({name:"commands",addCommands(){return{...Qa}}}),bc=te.create({name:"delete",onUpdate({transaction:n,appendedTransactions:e}){var t,r,i;const o=()=>{var s,l,c,d;if((d=(c=(l=(s=this.editor.options.coreExtensionOptions)==null?void 0:s.delete)==null?void 0:l.filterTransaction)==null?void 0:c.call(l,n))!=null?d:n.getMeta("y-sync$"))return;const u=rc(n.before,[n,...e]);dc(u).forEach(p=>{u.mapping.mapResult(p.oldRange.from).deletedAfter&&u.mapping.mapResult(p.oldRange.to).deletedBefore&&u.before.nodesBetween(p.oldRange.from,p.oldRange.to,(m,g)=>{const y=g+m.nodeSize-2,k=p.oldRange.from<=g&&y<=p.oldRange.to;this.editor.emit("delete",{type:"node",node:m,from:g,to:y,newFrom:u.mapping.map(g),newTo:u.mapping.map(y),deletedRange:p.oldRange,newRange:p.newRange,partial:!k,editor:this.editor,transaction:n,combinedTransform:u})})});const h=u.mapping;u.steps.forEach((p,m)=>{var g,y;if(p instanceof $e){const k=h.slice(m).map(p.from,-1),S=h.slice(m).map(p.to),x=h.invert().map(k,-1),b=h.invert().map(S),v=(g=u.doc.nodeAt(k-1))==null?void 0:g.marks.some(w=>w.eq(p.mark)),C=(y=u.doc.nodeAt(S))==null?void 0:y.marks.some(w=>w.eq(p.mark));this.editor.emit("delete",{type:"mark",mark:p.mark,from:p.from,to:p.to,deletedRange:{from:x,to:b},newRange:{from:k,to:S},partial:!!(C||v),editor:this.editor,transaction:n,combinedTransform:u})}})};(i=(r=(t=this.editor.options.coreExtensionOptions)==null?void 0:t.delete)==null?void 0:r.async)==null||i?setTimeout(o,0):o()}}),vc=te.create({name:"drop",addProseMirrorPlugins(){return[new Z({key:new oe("tiptapDrop"),props:{handleDrop:(n,e,t,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:r})}}})]}}),xc=te.create({name:"editable",addProseMirrorPlugins(){return[new Z({key:new oe("editable"),props:{editable:()=>this.editor.options.editable}})]}}),wc=new oe("focusEvents"),Cc=te.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new Z({key:wc,props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Sc=te.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:l})=>{const{selection:c,doc:d}=l,{empty:u,$anchor:f}=c,{pos:h,parent:p}=f,m=f.parent.isTextblock&&h>0?l.doc.resolve(h-1):f,g=m.parent.type.spec.isolating,y=f.pos-f.parentOffset,k=g&&m.parent.childCount===1?y===f.pos:H.atStart(d).from===h;return!u||!p.type.isTextblock||p.textContent.length||!k||k&&f.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":n,"Alt-Backspace":n,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Do()||tc()?o:i},addProseMirrorPlugins(){return[new Z({key:new oe("clearDocument"),appendTransaction:(n,e,t)=>{if(n.some(g=>g.getMeta("composition")))return;const r=n.some(g=>g.docChanged)&&!e.doc.eq(t.doc),i=n.some(g=>g.getMeta("preventClearDocument"));if(!r||i)return;const{empty:o,from:s,to:l}=e.selection,c=H.atStart(e.doc).from,d=H.atEnd(e.doc).to;if(o||!(s===c&&l===d)||!Zr(t.doc))return;const h=t.tr,p=Gr({state:t,transaction:h}),{commands:m}=new Yr({editor:this.editor,state:p});if(m.clearNodes(),!!h.steps.length)return h}})]}}),Mc=te.create({name:"paste",addProseMirrorPlugins(){return[new Z({key:new oe("tiptapPaste"),props:{handlePaste:(n,e,t)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}}),Tc=te.create({name:"tabindex",addProseMirrorPlugins(){return[new Z({key:new oe("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),Ec=te.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:n}=Qt(this.extensions);return[{types:n.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const t=e.getAttribute("dir");return t&&(t==="ltr"||t==="rtl"||t==="auto")?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new Z({key:new oe("textDirection"),props:{attributes:()=>{const n=this.options.direction;return n?{dir:n}:{}}}})]}}),Qy=class Vt{constructor(e,t,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=t,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:t,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),t=this.resolvedPos.doc.resolve(e);return new Vt(t,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Vt(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Vt(e,this.editor)}get children(){const e=[];return this.node.content.forEach((t,r)=>{const i=t.isBlock&&!t.isTextblock,o=t.isAtom&&!t.isText,s=this.pos+r+(o?0:1);if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;const l=this.resolvedPos.doc.resolve(s);if(!i&&l.depth<=this.depth)return;const c=new Vt(l,this.editor,i,i?t:null);i&&(c.actualDepth=this.depth+1),e.push(new Vt(l,this.editor,i,i?t:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,t={}){let r=null,i=this.parent;for(;i&&!r;)i.node.type.name===e&&(Object.keys(t).length>0||(r=i)),i=i.parent;return r}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const o=Object.keys(t);return this.children.forEach(s=>{r&&i.length>0||(s.node.type.name===e&&o.every(c=>t[c]===s.node.attrs[c])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(e,t,r))))}),i}setAttribute(e){const{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},Xy=`.ProseMirror {
16
+ `,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function jy(n){return Object.prototype.toString.call(n).slice(8,-1)}function Pn(n){return jy(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function pc(n,e){const t={...n};return Pn(n)&&Pn(e)&&Object.keys(e).forEach(r=>{Pn(e[r])&&Pn(n[r])?t[r]=pc(n[r],e[r]):t[r]=e[r]}),t}var zo=class{constructor(n={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...n},this.name=this.config.name}get options(){return{...G(z(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...G(z(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(n={}){const e=this.extend({...this.config,addOptions:()=>pc(this.options,n)});return e.name=this.name,e.parent=this.parent,e}extend(n={}){const e=new this.constructor({...this.config,...n});return e.parent=this,this.child=e,e.name="name"in n?n.name:e.parent.name,e}},It=class mc extends zo{constructor(){super(...arguments),this.type="mark"}static create(e={}){const t=typeof e=="function"?e():e;return new mc(t)}static handleExit({editor:e,mark:t}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(d=>d?.type.name===t.name))return!1;const c=s.find(d=>d?.type.name===t.name);return c&&r.removeStoredMark(c),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}};function Uy(n){return typeof n=="number"}var qy=class{constructor(n){this.find=n.find,this.handler=n.handler}},Wy=(n,e,t)=>{if(Bo(e))return[...n.matchAll(e)];const r=e(n,t);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=n,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function Ky(n){const{editor:e,state:t,from:r,to:i,rule:o,pasteEvent:s,dropEvent:l}=n,{commands:c,chain:d,can:u}=new Yr({editor:e,state:t}),f=[];return t.doc.nodesBetween(r,i,(p,m)=>{var g,y,k,S,x;if((y=(g=p.type)==null?void 0:g.spec)!=null&&y.code||!(p.isText||p.isTextblock||p.isInline))return;const b=(x=(S=(k=p.content)==null?void 0:k.size)!=null?S:p.nodeSize)!=null?x:0,v=Math.max(r,m),C=Math.min(i,m+b);if(v>=C)return;const w=p.isText?p.text||"":p.textBetween(v-m,C-m,void 0,"");Wy(w,o.find,s).forEach(A=>{if(A.index===void 0)return;const $=v+A.index+1,U=$+A[0].length,j={from:t.tr.mapping.map($),to:t.tr.mapping.map(U)},K=o.handler({state:t,range:j,match:A,commands:c,chain:d,can:u,pasteEvent:s,dropEvent:l});f.push(K)})}),f.every(p=>p!==null)}var Vn=null,Jy=n=>{var e;const t=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=t.clipboardData)==null||e.setData("text/html",n),t};function Gy(n){const{editor:e,rules:t}=n;let r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}const c=({state:u,from:f,to:h,rule:p,pasteEvt:m})=>{const g=u.tr,y=Gr({state:u,transaction:g});if(!(!Ky({editor:e,state:y,from:Math.max(f-1,0),to:h.b-1,rule:p,pasteEvent:m,dropEvent:l})||!g.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g}};return t.map(u=>new Z({view(f){const h=m=>{var g;r=(g=f.dom.parentElement)!=null&&g.contains(m.target)?f.dom.parentElement:null,r&&(Vn=e)},p=()=>{Vn&&(Vn=null)};return window.addEventListener("dragstart",h),window.addEventListener("dragend",p),{destroy(){window.removeEventListener("dragstart",h),window.removeEventListener("dragend",p)}}},props:{handleDOMEvents:{drop:(f,h)=>{if(o=r===f.dom.parentElement,l=h,!o){const p=Vn;p?.isEditable&&setTimeout(()=>{const m=p.state.selection;m&&p.commands.deleteRange({from:m.from,to:m.to})},10)}return!1},paste:(f,h)=>{var p;const m=(p=h.clipboardData)==null?void 0:p.getData("text/html");return s=h,i=!!m?.includes("data-pm-slice"),!1}}},appendTransaction:(f,h,p)=>{const m=f[0],g=m.getMeta("uiEvent")==="paste"&&!i,y=m.getMeta("uiEvent")==="drop"&&!o,k=m.getMeta("applyPasteRules"),S=!!k;if(!g&&!y&&!S)return;if(S){let{text:v}=k;typeof v=="string"?v=v:v=$o(T.from(v),p.schema);const{from:C}=k,w=C+v.length,M=Jy(v);return c({rule:u,state:p,from:C,to:{b:w},pasteEvt:M})}const x=h.doc.content.findDiffStart(p.doc.content),b=h.doc.content.findDiffEnd(p.doc.content);if(!(!Uy(x)||!b||x===b.b))return c({rule:u,state:p,from:x,to:b,pasteEvt:s})}}))}var ei=class{constructor(n,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=n,this.extensions=sc(n),this.schema=oy(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((n,e)=>{const t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:bi(e.name,this.schema)},r=z(e,"addCommands",t);return r?{...n,...r()}:n},{})}get plugins(){const{editor:n}=this;return Ro([...this.extensions].reverse()).flatMap(r=>{const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:n,type:bi(r.name,this.schema)},o=[],s=z(r,"addKeyboardShortcuts",i);let l={};if(r.type==="mark"&&z(r,"exitable",i)&&(l.ArrowRight=()=>It.handleExit({editor:n,mark:r})),s){const h=Object.fromEntries(Object.entries(s()).map(([p,m])=>[p,()=>m({editor:n})]));l={...l,...h}}const c=ag(l);o.push(c);const d=z(r,"addInputRules",i);if(ll(r,n.options.enableInputRules)&&d){const h=d();if(h&&h.length){const p=Hy({editor:n,rules:h}),m=Array.isArray(p)?p:[p];o.push(...m)}}const u=z(r,"addPasteRules",i);if(ll(r,n.options.enablePasteRules)&&u){const h=u();if(h&&h.length){const p=Gy({editor:n,rules:h});o.push(...p)}}const f=z(r,"addProseMirrorPlugins",i);if(f){const h=f();o.push(...h)}return o})}get attributes(){return oc(this.extensions)}get nodeViews(){const{editor:n}=this,{nodeExtensions:e}=Qt(this.extensions);return Object.fromEntries(e.filter(t=>!!z(t,"addNodeView")).map(t=>{const r=this.attributes.filter(c=>c.type===t.name),i={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:n,type:re(t.name,this.schema)},o=z(t,"addNodeView",i);if(!o)return[];const s=o();if(!s)return[];const l=(c,d,u,f,h)=>{const p=lr(c,r);return s({node:c,view:d,getPos:u,decorations:f,innerDecorations:h,editor:n,extension:t,HTMLAttributes:p})};return[t.name,l]}))}get markViews(){const{editor:n}=this,{markExtensions:e}=Qt(this.extensions);return Object.fromEntries(e.filter(t=>!!z(t,"addMarkView")).map(t=>{const r=this.attributes.filter(l=>l.type===t.name),i={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:n,type:Ye(t.name,this.schema)},o=z(t,"addMarkView",i);if(!o)return[];const s=(l,c,d)=>{const u=lr(l,r);return o()({mark:l,view:c,inline:d,editor:n,extension:t,HTMLAttributes:u,updateAttributes:f=>{ak(l,n,f)}})};return[t.name,s]}))}setupExtensions(){const n=this.extensions;this.editor.extensionStorage=Object.fromEntries(n.map(e=>[e.name,e.storage])),n.forEach(e=>{var t;const r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:bi(e.name,this.schema)};e.type==="mark"&&((t=G(z(e,"keepOnSplit",r)))==null||t)&&this.splittableMarks.push(e.name);const i=z(e,"onBeforeCreate",r),o=z(e,"onCreate",r),s=z(e,"onUpdate",r),l=z(e,"onSelectionUpdate",r),c=z(e,"onTransaction",r),d=z(e,"onFocus",r),u=z(e,"onBlur",r),f=z(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),s&&this.editor.on("update",s),l&&this.editor.on("selectionUpdate",l),c&&this.editor.on("transaction",c),d&&this.editor.on("focus",d),u&&this.editor.on("blur",u),f&&this.editor.on("destroy",f)})}};ei.resolve=sc;ei.sort=Ro;ei.flatten=Io;var Yy={};Ao(Yy,{ClipboardTextSerializer:()=>yc,Commands:()=>kc,Delete:()=>bc,Drop:()=>vc,Editable:()=>xc,FocusEvents:()=>Cc,Keymap:()=>Sc,Paste:()=>Mc,Tabindex:()=>Tc,TextDirection:()=>Ec,focusEventsPluginKey:()=>wc});var te=class gc extends zo{constructor(){super(...arguments),this.type="extension"}static create(e={}){const t=typeof e=="function"?e():e;return new gc(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}},yc=te.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Z({key:new oe("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(u=>u.$from.pos)),l=Math.max(...o.map(u=>u.$to.pos)),c=ac(t);return lc(r,{from:s,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),kc=te.create({name:"commands",addCommands(){return{...Qa}}}),bc=te.create({name:"delete",onUpdate({transaction:n,appendedTransactions:e}){var t,r,i;const o=()=>{var s,l,c,d;if((d=(c=(l=(s=this.editor.options.coreExtensionOptions)==null?void 0:s.delete)==null?void 0:l.filterTransaction)==null?void 0:c.call(l,n))!=null?d:n.getMeta("y-sync$"))return;const u=rc(n.before,[n,...e]);dc(u).forEach(p=>{u.mapping.mapResult(p.oldRange.from).deletedAfter&&u.mapping.mapResult(p.oldRange.to).deletedBefore&&u.before.nodesBetween(p.oldRange.from,p.oldRange.to,(m,g)=>{const y=g+m.nodeSize-2,k=p.oldRange.from<=g&&y<=p.oldRange.to;this.editor.emit("delete",{type:"node",node:m,from:g,to:y,newFrom:u.mapping.map(g),newTo:u.mapping.map(y),deletedRange:p.oldRange,newRange:p.newRange,partial:!k,editor:this.editor,transaction:n,combinedTransform:u})})});const h=u.mapping;u.steps.forEach((p,m)=>{var g,y;if(p instanceof $e){const k=h.slice(m).map(p.from,-1),S=h.slice(m).map(p.to),x=h.invert().map(k,-1),b=h.invert().map(S),v=(g=u.doc.nodeAt(k-1))==null?void 0:g.marks.some(w=>w.eq(p.mark)),C=(y=u.doc.nodeAt(S))==null?void 0:y.marks.some(w=>w.eq(p.mark));this.editor.emit("delete",{type:"mark",mark:p.mark,from:p.from,to:p.to,deletedRange:{from:x,to:b},newRange:{from:k,to:S},partial:!!(C||v),editor:this.editor,transaction:n,combinedTransform:u})}})};(i=(r=(t=this.editor.options.coreExtensionOptions)==null?void 0:t.delete)==null?void 0:r.async)==null||i?setTimeout(o,0):o()}}),vc=te.create({name:"drop",addProseMirrorPlugins(){return[new Z({key:new oe("tiptapDrop"),props:{handleDrop:(n,e,t,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:r})}}})]}}),xc=te.create({name:"editable",addProseMirrorPlugins(){return[new Z({key:new oe("editable"),props:{editable:()=>this.editor.options.editable}})]}}),wc=new oe("focusEvents"),Cc=te.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new Z({key:wc,props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Sc=te.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:l})=>{const{selection:c,doc:d}=l,{empty:u,$anchor:f}=c,{pos:h,parent:p}=f,m=f.parent.isTextblock&&h>0?l.doc.resolve(h-1):f,g=m.parent.type.spec.isolating,y=f.pos-f.parentOffset,k=g&&m.parent.childCount===1?y===f.pos:H.atStart(d).from===h;return!u||!p.type.isTextblock||p.textContent.length||!k||k&&f.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":n,"Alt-Backspace":n,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Do()||tc()?o:i},addProseMirrorPlugins(){return[new Z({key:new oe("clearDocument"),appendTransaction:(n,e,t)=>{if(n.some(g=>g.getMeta("composition")))return;const r=n.some(g=>g.docChanged)&&!e.doc.eq(t.doc),i=n.some(g=>g.getMeta("preventClearDocument"));if(!r||i)return;const{empty:o,from:s,to:l}=e.selection,c=H.atStart(e.doc).from,d=H.atEnd(e.doc).to;if(o||!(s===c&&l===d)||!Zr(t.doc))return;const h=t.tr,p=Gr({state:t,transaction:h}),{commands:m}=new Yr({editor:this.editor,state:p});if(m.clearNodes(),!!h.steps.length)return h}})]}}),Mc=te.create({name:"paste",addProseMirrorPlugins(){return[new Z({key:new oe("tiptapPaste"),props:{handlePaste:(n,e,t)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}}),Tc=te.create({name:"tabindex",addProseMirrorPlugins(){return[new Z({key:new oe("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),Ec=te.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:n}=Qt(this.extensions);return[{types:n.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const t=e.getAttribute("dir");return t&&(t==="ltr"||t==="rtl"||t==="auto")?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new Z({key:new oe("textDirection"),props:{attributes:()=>{const n=this.options.direction;return n?{dir:n}:{}}}})]}}),Qy=class Vt{constructor(e,t,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=t,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:t,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),t=this.resolvedPos.doc.resolve(e);return new Vt(t,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Vt(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Vt(e,this.editor)}get children(){const e=[];return this.node.content.forEach((t,r)=>{const i=t.isBlock&&!t.isTextblock,o=t.isAtom&&!t.isText,s=this.pos+r+(o?0:1);if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;const l=this.resolvedPos.doc.resolve(s);if(!i&&l.depth<=this.depth)return;const c=new Vt(l,this.editor,i,i?t:null);i&&(c.actualDepth=this.depth+1),e.push(new Vt(l,this.editor,i,i?t:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,t={}){let r=null,i=this.parent;for(;i&&!r;)i.node.type.name===e&&(Object.keys(t).length>0||(r=i)),i=i.parent;return r}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const o=Object.keys(t);return this.children.forEach(s=>{r&&i.length>0||(s.node.type.name===e&&o.every(c=>t[c]===s.node.attrs[c])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(e,t,r))))}),i}setAttribute(e){const{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},Xy=`.ProseMirror {
17
17
  position: relative;
18
18
  }
19
19
 
@@ -85,13 +85,13 @@ img.ProseMirror-separator {
85
85
  display: block;
86
86
  }`;function Zy(n,e,t){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=n,document.getElementsByTagName("head")[0].appendChild(i),i}var _y=class extends Vy{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:i})=>{throw i},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:gy,createMappablePosition:yy},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:i,slice:o,moved:s})=>this.options.onDrop(i,o,s)),this.on("paste",({event:i,slice:o})=>this.options.onPaste(i,o)),this.on("delete",this.options.onDelete);const t=this.createDoc(),r=_a(t,this.options.autofocus);this.editorState=Ht.create({doc:t,schema:this.schema,selection:r||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=Zy(Xy,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t==="state")return this.editorState;if(t in e)return Reflect.get(e,t);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){const r=ic(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}unregisterPlugin(e){if(this.isDestroyed)return;const t=this.state.plugins;let r=t;if([].concat(e).forEach(o=>{const s=typeof o=="string"?`${o}$`:o.key;r=r.filter(l=>!l.key.startsWith(s))}),t.length===r.length)return;const i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}createExtensionManager(){var e,t;const i=[...this.options.enableCoreExtensions?[xc,yc.configure({blockSeparator:(t=(e=this.options.coreExtensionOptions)==null?void 0:e.clipboardTextSerializer)==null?void 0:t.blockSeparator}),kc,Cc,Sc,Tc,vc,Mc,bc,Ec.configure({direction:this.options.textDirection})].filter(o=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[o.name]!==!1:!0):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o?.type));this.extensionManager=new ei(i,this)}createCommandManager(){this.commandManager=new Yr({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=Yi(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message))throw t;this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(r=>r.name!=="collaboration"),this.createExtensionManager()}}),e=Yi(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){var t;this.editorView=new Ga(e,{...this.options.editorProps,attributes:{role:"textbox",...(t=this.options.editorProps)==null?void 0:t.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.prependClass(),this.injectCSS();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(u=>{var f;return(f=this.capturedTransaction)==null?void 0:f.step(u)});return}const{state:t,transactions:r}=this.state.applyTransaction(e),i=!this.state.selection.eq(t.selection),o=r.includes(e),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!o)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:r.slice(1)}),i&&this.emit("selectionUpdate",{editor:this,transaction:e});const l=r.findLast(u=>u.getMeta("focus")||u.getMeta("blur")),c=l?.getMeta("focus"),d=l?.getMeta("blur");c&&this.emit("focus",{editor:this,event:c.event,transaction:l}),d&&this.emit("blur",{editor:this,event:d.event,transaction:l}),!(e.getMeta("preventUpdate")||!r.some(u=>u.docChanged)||s.doc.eq(t.doc))&&this.emit("update",{editor:this,transaction:e,appendedTransactions:r.slice(1)})}getAttributes(e){return cc(this.state,e)}isActive(e,t){const r=typeof e=="string"?e:null,i=typeof e=="string"?t:e;return hy(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return $o(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=`
87
87
 
88
- `,textSerializers:r={}}=e||{};return ly(this.state.doc,{blockSeparator:t,textSerializers:{...ac(this.schema),...r}})}get isEmpty(){return Zr(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var e,t;return(t=(e=this.editorView)==null?void 0:e.isDestroyed)!=null?t:!0}$node(e,t){var r;return((r=this.$doc)==null?void 0:r.querySelector(e,t))||null}$nodes(e,t){var r;return((r=this.$doc)==null?void 0:r.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e);return new Qy(t,this)}get $doc(){return this.$pos(0)}};function Xt(n){return new _r({find:n.find,handler:({state:e,range:t,match:r})=>{const i=G(n.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=e,s=r[r.length-1],l=r[0];if(s){const c=l.search(/\S/),d=t.from+l.indexOf(s),u=d+s.length;if(Lo(t.from,t.to,e.doc).filter(p=>p.mark.type.excluded.find(g=>g===n.type&&g!==p.mark.type)).filter(p=>p.to>d).length)return null;u<t.to&&o.delete(u,t.to),d>t.from&&o.delete(t.from+c,d);const h=t.from+c+s.length;o.addMark(t.from+c,h,n.type.create(i||{})),o.removeStoredMark(n.type)}},undoable:n.undoable})}function e0(n){return new _r({find:n.find,handler:({state:e,range:t,match:r})=>{const i=G(n.getAttributes,void 0,r)||{},{tr:o}=e,s=t.from;let l=t.to;const c=n.type.create(i);if(r[1]){const d=r[0].lastIndexOf(r[1]);let u=s+d;u>l?u=l:l=u+r[1].length;const f=r[0][r[0].length-1];o.insertText(f,s+r[0].length-1),o.replaceWith(u,l,c)}else if(r[0]){const d=n.type.isInline?s:s-1;o.insert(d,n.type.create(i)).delete(o.mapping.map(s),o.mapping.map(l))}o.scrollIntoView()},undoable:n.undoable})}function Xi(n){return new _r({find:n.find,handler:({state:e,range:t,match:r})=>{const i=e.doc.resolve(t.from),o=G(n.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,o)},undoable:n.undoable})}function Zt(n){return new _r({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{const o=G(n.getAttributes,void 0,r)||{},s=e.tr.delete(t.from,t.to),c=s.doc.resolve(t.from).blockRange(),d=c&&go(c,n.type,o);if(!d)return null;if(s.wrap(c,d),n.keepMarks&&n.editor){const{selection:f,storedMarks:h}=e,{splittableMarks:p}=n.editor.extensionManager,m=h||f.$to.parentOffset&&f.$from.marks();if(m){const g=m.filter(y=>p.includes(y.type.name));s.ensureMarks(g)}}if(n.keepAttributes){const f=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,o).run()}const u=s.doc.resolve(t.from-1).nodeBefore;u&&u.type===n.type&&ht(s.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,u))&&s.join(t.from-1)},undoable:n.undoable})}function t0(n,e){const{selection:t}=n,{$from:r}=t;if(t instanceof P){const o=r.index();return r.parent.canReplaceWith(o,o+1,e)}let i=r.depth;for(;i>=0;){const o=r.index(i);if(r.node(i).contentMatchAt(o).matchType(e))return!0;i-=1}return!1}var n0={};Ao(n0,{createAtomBlockMarkdownSpec:()=>r0,createBlockMarkdownSpec:()=>i0,createInlineMarkdownSpec:()=>l0,parseAttributes:()=>Po,parseIndentedBlocks:()=>Zi,renderNestedMarkdownContent:()=>Fo,serializeAttributes:()=>Vo});function Po(n){if(!n?.trim())return{};const e={},t=[],r=n.replace(/["']([^"']*)["']/g,d=>(t.push(d),`__QUOTED_${t.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){const d=i.map(u=>u.trim().slice(1));e.class=d.join(" ")}const o=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);o&&(e.id=o[1]);const s=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(s)).forEach(([,d,u])=>{var f;const h=parseInt(((f=u.match(/__QUOTED_(\d+)__/))==null?void 0:f[1])||"0",10),p=t[h];p&&(e[d]=p.slice(1,-1))});const c=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return c&&c.split(/\s+/).filter(Boolean).forEach(u=>{u.match(/^[a-zA-Z][\w-]*$/)&&(e[u]=!0)}),e}function Vo(n){if(!n||Object.keys(n).length===0)return"";const e=[];return n.class&&String(n.class).split(/\s+/).filter(Boolean).forEach(r=>e.push(`.${r}`)),n.id&&e.push(`#${n.id}`),Object.entries(n).forEach(([t,r])=>{t==="class"||t==="id"||(r===!0?e.push(t):r!==!1&&r!=null&&e.push(`${t}="${String(r)}"`))}),e.join(" ")}function r0(n){const{nodeName:e,name:t,parseAttributes:r=Po,serializeAttributes:i=Vo,defaultAttributes:o={},requiredAttributes:s=[],allowedAttributes:l}=n,c=t||e,d=u=>{if(!l)return u;const f={};return l.forEach(h=>{h in u&&(f[h]=u[h])}),f};return{parseMarkdown:(u,f)=>{const h={...o,...u.attributes};return f.createNode(e,h,[])},markdownTokenizer:{name:e,level:"block",start(u){var f;const h=new RegExp(`^:::${c}(?:\\s|$)`,"m"),p=(f=u.match(h))==null?void 0:f.index;return p!==void 0?p:-1},tokenize(u,f,h){const p=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),m=u.match(p);if(!m)return;const g=m[1]||"",y=r(g);if(!s.find(S=>!(S in y)))return{type:e,raw:m[0],attributes:y}}},renderMarkdown:u=>{const f=d(u.attrs||{}),h=i(f),p=h?` {${h}}`:"";return`:::${c}${p} :::`}}}function i0(n){const{nodeName:e,name:t,getContent:r,parseAttributes:i=Po,serializeAttributes:o=Vo,defaultAttributes:s={},content:l="block",allowedAttributes:c}=n,d=t||e,u=f=>{if(!c)return f;const h={};return c.forEach(p=>{p in f&&(h[p]=f[p])}),h};return{parseMarkdown:(f,h)=>{let p;if(r){const g=r(f);p=typeof g=="string"?[{type:"text",text:g}]:g}else l==="block"?p=h.parseChildren(f.tokens||[]):p=h.parseInline(f.tokens||[]);const m={...s,...f.attributes};return h.createNode(e,m,p)},markdownTokenizer:{name:e,level:"block",start(f){var h;const p=new RegExp(`^:::${d}`,"m"),m=(h=f.match(p))==null?void 0:h.index;return m!==void 0?m:-1},tokenize(f,h,p){var m;const g=new RegExp(`^:::${d}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),y=f.match(g);if(!y)return;const[k,S=""]=y,x=i(S);let b=1;const v=k.length;let C="";const w=/^:::([\w-]*)(\s.*)?/gm,M=f.slice(v);for(w.lastIndex=0;;){const A=w.exec(M);if(A===null)break;const $=A.index,U=A[1];if(!((m=A[2])!=null&&m.endsWith(":::"))){if(U)b+=1;else if(b-=1,b===0){const j=M.slice(0,$);C=j.trim();const K=f.slice(0,v+$+A[0].length);let N=[];if(C)if(l==="block")for(N=p.blockTokens(j),N.forEach(D=>{D.text&&(!D.tokens||D.tokens.length===0)&&(D.tokens=p.inlineTokens(D.text))});N.length>0;){const D=N[N.length-1];if(D.type==="paragraph"&&(!D.text||D.text.trim()===""))N.pop();else break}else N=p.inlineTokens(C);return{type:e,raw:K,attributes:x,content:C,tokens:N}}}}}},renderMarkdown:(f,h)=>{const p=u(f.attrs||{}),m=o(p),g=m?` {${m}}`:"",y=h.renderChildren(f.content||[],`
88
+ `,textSerializers:r={}}=e||{};return ly(this.state.doc,{blockSeparator:t,textSerializers:{...ac(this.schema),...r}})}get isEmpty(){return Zr(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var e,t;return(t=(e=this.editorView)==null?void 0:e.isDestroyed)!=null?t:!0}$node(e,t){var r;return((r=this.$doc)==null?void 0:r.querySelector(e,t))||null}$nodes(e,t){var r;return((r=this.$doc)==null?void 0:r.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e);return new Qy(t,this)}get $doc(){return this.$pos(0)}};function Xt(n){return new _r({find:n.find,handler:({state:e,range:t,match:r})=>{const i=G(n.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=e,s=r[r.length-1],l=r[0];if(s){const c=l.search(/\S/),d=t.from+l.indexOf(s),u=d+s.length;if(Lo(t.from,t.to,e.doc).filter(p=>p.mark.type.excluded.find(g=>g===n.type&&g!==p.mark.type)).filter(p=>p.to>d).length)return null;u<t.to&&o.delete(u,t.to),d>t.from&&o.delete(t.from+c,d);const h=t.from+c+s.length;o.addMark(t.from+c,h,n.type.create(i||{})),o.removeStoredMark(n.type)}},undoable:n.undoable})}function ek(n){return new _r({find:n.find,handler:({state:e,range:t,match:r})=>{const i=G(n.getAttributes,void 0,r)||{},{tr:o}=e,s=t.from;let l=t.to;const c=n.type.create(i);if(r[1]){const d=r[0].lastIndexOf(r[1]);let u=s+d;u>l?u=l:l=u+r[1].length;const f=r[0][r[0].length-1];o.insertText(f,s+r[0].length-1),o.replaceWith(u,l,c)}else if(r[0]){const d=n.type.isInline?s:s-1;o.insert(d,n.type.create(i)).delete(o.mapping.map(s),o.mapping.map(l))}o.scrollIntoView()},undoable:n.undoable})}function Xi(n){return new _r({find:n.find,handler:({state:e,range:t,match:r})=>{const i=e.doc.resolve(t.from),o=G(n.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,o)},undoable:n.undoable})}function Zt(n){return new _r({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{const o=G(n.getAttributes,void 0,r)||{},s=e.tr.delete(t.from,t.to),c=s.doc.resolve(t.from).blockRange(),d=c&&go(c,n.type,o);if(!d)return null;if(s.wrap(c,d),n.keepMarks&&n.editor){const{selection:f,storedMarks:h}=e,{splittableMarks:p}=n.editor.extensionManager,m=h||f.$to.parentOffset&&f.$from.marks();if(m){const g=m.filter(y=>p.includes(y.type.name));s.ensureMarks(g)}}if(n.keepAttributes){const f=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,o).run()}const u=s.doc.resolve(t.from-1).nodeBefore;u&&u.type===n.type&&ht(s.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,u))&&s.join(t.from-1)},undoable:n.undoable})}function tk(n,e){const{selection:t}=n,{$from:r}=t;if(t instanceof P){const o=r.index();return r.parent.canReplaceWith(o,o+1,e)}let i=r.depth;for(;i>=0;){const o=r.index(i);if(r.node(i).contentMatchAt(o).matchType(e))return!0;i-=1}return!1}var nk={};Ao(nk,{createAtomBlockMarkdownSpec:()=>rk,createBlockMarkdownSpec:()=>ik,createInlineMarkdownSpec:()=>lk,parseAttributes:()=>Po,parseIndentedBlocks:()=>Zi,renderNestedMarkdownContent:()=>Fo,serializeAttributes:()=>Vo});function Po(n){if(!n?.trim())return{};const e={},t=[],r=n.replace(/["']([^"']*)["']/g,d=>(t.push(d),`__QUOTED_${t.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){const d=i.map(u=>u.trim().slice(1));e.class=d.join(" ")}const o=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);o&&(e.id=o[1]);const s=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(s)).forEach(([,d,u])=>{var f;const h=parseInt(((f=u.match(/__QUOTED_(\d+)__/))==null?void 0:f[1])||"0",10),p=t[h];p&&(e[d]=p.slice(1,-1))});const c=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return c&&c.split(/\s+/).filter(Boolean).forEach(u=>{u.match(/^[a-zA-Z][\w-]*$/)&&(e[u]=!0)}),e}function Vo(n){if(!n||Object.keys(n).length===0)return"";const e=[];return n.class&&String(n.class).split(/\s+/).filter(Boolean).forEach(r=>e.push(`.${r}`)),n.id&&e.push(`#${n.id}`),Object.entries(n).forEach(([t,r])=>{t==="class"||t==="id"||(r===!0?e.push(t):r!==!1&&r!=null&&e.push(`${t}="${String(r)}"`))}),e.join(" ")}function rk(n){const{nodeName:e,name:t,parseAttributes:r=Po,serializeAttributes:i=Vo,defaultAttributes:o={},requiredAttributes:s=[],allowedAttributes:l}=n,c=t||e,d=u=>{if(!l)return u;const f={};return l.forEach(h=>{h in u&&(f[h]=u[h])}),f};return{parseMarkdown:(u,f)=>{const h={...o,...u.attributes};return f.createNode(e,h,[])},markdownTokenizer:{name:e,level:"block",start(u){var f;const h=new RegExp(`^:::${c}(?:\\s|$)`,"m"),p=(f=u.match(h))==null?void 0:f.index;return p!==void 0?p:-1},tokenize(u,f,h){const p=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),m=u.match(p);if(!m)return;const g=m[1]||"",y=r(g);if(!s.find(S=>!(S in y)))return{type:e,raw:m[0],attributes:y}}},renderMarkdown:u=>{const f=d(u.attrs||{}),h=i(f),p=h?` {${h}}`:"";return`:::${c}${p} :::`}}}function ik(n){const{nodeName:e,name:t,getContent:r,parseAttributes:i=Po,serializeAttributes:o=Vo,defaultAttributes:s={},content:l="block",allowedAttributes:c}=n,d=t||e,u=f=>{if(!c)return f;const h={};return c.forEach(p=>{p in f&&(h[p]=f[p])}),h};return{parseMarkdown:(f,h)=>{let p;if(r){const g=r(f);p=typeof g=="string"?[{type:"text",text:g}]:g}else l==="block"?p=h.parseChildren(f.tokens||[]):p=h.parseInline(f.tokens||[]);const m={...s,...f.attributes};return h.createNode(e,m,p)},markdownTokenizer:{name:e,level:"block",start(f){var h;const p=new RegExp(`^:::${d}`,"m"),m=(h=f.match(p))==null?void 0:h.index;return m!==void 0?m:-1},tokenize(f,h,p){var m;const g=new RegExp(`^:::${d}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),y=f.match(g);if(!y)return;const[k,S=""]=y,x=i(S);let b=1;const v=k.length;let C="";const w=/^:::([\w-]*)(\s.*)?/gm,M=f.slice(v);for(w.lastIndex=0;;){const A=w.exec(M);if(A===null)break;const $=A.index,U=A[1];if(!((m=A[2])!=null&&m.endsWith(":::"))){if(U)b+=1;else if(b-=1,b===0){const j=M.slice(0,$);C=j.trim();const K=f.slice(0,v+$+A[0].length);let N=[];if(C)if(l==="block")for(N=p.blockTokens(j),N.forEach(D=>{D.text&&(!D.tokens||D.tokens.length===0)&&(D.tokens=p.inlineTokens(D.text))});N.length>0;){const D=N[N.length-1];if(D.type==="paragraph"&&(!D.text||D.text.trim()===""))N.pop();else break}else N=p.inlineTokens(C);return{type:e,raw:K,attributes:x,content:C,tokens:N}}}}}},renderMarkdown:(f,h)=>{const p=u(f.attrs||{}),m=o(p),g=m?` {${m}}`:"",y=h.renderChildren(f.content||[],`
89
89
 
90
90
  `);return`:::${d}${g}
91
91
 
92
92
  ${y}
93
93
 
94
- :::`}}}function o0(n){if(!n.trim())return{};const e={},t=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=t.exec(n);for(;r!==null;){const[,i,o,s]=r;e[i]=o||s,r=t.exec(n)}return e}function s0(n){return Object.entries(n).filter(([,e])=>e!=null).map(([e,t])=>`${e}="${t}"`).join(" ")}function l0(n){const{nodeName:e,name:t,getContent:r,parseAttributes:i=o0,serializeAttributes:o=s0,defaultAttributes:s={},selfClosing:l=!1,allowedAttributes:c}=n,d=t||e,u=h=>{if(!c)return h;const p={};return c.forEach(m=>{const g=typeof m=="string"?m:m.name,y=typeof m=="string"?void 0:m.skipIfDefault;if(g in h){const k=h[g];if(y!==void 0&&k===y)return;p[g]=k}}),p},f=d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(h,p)=>{const m={...s,...h.attributes};if(l)return p.createNode(e,m);const g=r?r(h):h.content||"";return g?p.createNode(e,m,[p.createTextNode(g)]):p.createNode(e,m,[])},markdownTokenizer:{name:e,level:"inline",start(h){const p=l?new RegExp(`\\[${f}\\s*[^\\]]*\\]`):new RegExp(`\\[${f}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${f}\\]`),m=h.match(p),g=m?.index;return g!==void 0?g:-1},tokenize(h,p,m){const g=l?new RegExp(`^\\[${f}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${f}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${f}\\]`),y=h.match(g);if(!y)return;let k="",S="";if(l){const[,b]=y;S=b}else{const[,b,v]=y;S=b,k=v||""}const x=i(S.trim());return{type:e,raw:y[0],content:k.trim(),attributes:x}}},renderMarkdown:h=>{let p="";r?p=r(h):h.content&&h.content.length>0&&(p=h.content.filter(k=>k.type==="text").map(k=>k.text).join(""));const m=u(h.attrs||{}),g=o(m),y=g?` ${g}`:"";return l?`[${d}${y}]`:`[${d}${y}]${p}[/${d}]`}}}function Zi(n,e,t){var r,i,o,s;const l=n.split(`
94
+ :::`}}}function ok(n){if(!n.trim())return{};const e={},t=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=t.exec(n);for(;r!==null;){const[,i,o,s]=r;e[i]=o||s,r=t.exec(n)}return e}function sk(n){return Object.entries(n).filter(([,e])=>e!=null).map(([e,t])=>`${e}="${t}"`).join(" ")}function lk(n){const{nodeName:e,name:t,getContent:r,parseAttributes:i=ok,serializeAttributes:o=sk,defaultAttributes:s={},selfClosing:l=!1,allowedAttributes:c}=n,d=t||e,u=h=>{if(!c)return h;const p={};return c.forEach(m=>{const g=typeof m=="string"?m:m.name,y=typeof m=="string"?void 0:m.skipIfDefault;if(g in h){const k=h[g];if(y!==void 0&&k===y)return;p[g]=k}}),p},f=d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(h,p)=>{const m={...s,...h.attributes};if(l)return p.createNode(e,m);const g=r?r(h):h.content||"";return g?p.createNode(e,m,[p.createTextNode(g)]):p.createNode(e,m,[])},markdownTokenizer:{name:e,level:"inline",start(h){const p=l?new RegExp(`\\[${f}\\s*[^\\]]*\\]`):new RegExp(`\\[${f}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${f}\\]`),m=h.match(p),g=m?.index;return g!==void 0?g:-1},tokenize(h,p,m){const g=l?new RegExp(`^\\[${f}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${f}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${f}\\]`),y=h.match(g);if(!y)return;let k="",S="";if(l){const[,b]=y;S=b}else{const[,b,v]=y;S=b,k=v||""}const x=i(S.trim());return{type:e,raw:y[0],content:k.trim(),attributes:x}}},renderMarkdown:h=>{let p="";r?p=r(h):h.content&&h.content.length>0&&(p=h.content.filter(k=>k.type==="text").map(k=>k.text).join(""));const m=u(h.attrs||{}),g=o(m),y=g?` ${g}`:"";return l?`[${d}${y}]`:`[${d}${y}]${p}[/${d}]`}}}function Zi(n,e,t){var r,i,o,s;const l=n.split(`
95
95
  `),c=[];let d="",u=0;const f=e.baseIndentSize||2;for(;u<l.length;){const h=l[u],p=h.match(e.itemPattern);if(!p){if(c.length>0)break;if(h.trim()===""){u+=1,d=`${d}${h}
96
96
  `;continue}else return}const m=e.extractItemData(p),{indentLevel:g,mainContent:y}=m;d=`${d}${h}
97
97
  `;const k=[y];for(u+=1;u<l.length;){const v=l[u];if(v.trim()===""){const w=l.slice(u+1).findIndex($=>$.trim()!=="");if(w===-1)break;if((((i=(r=l[u+1+w].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:i.length)||0)>g){k.push(v),d=`${d}${v}
@@ -100,11 +100,11 @@ ${y}
100
100
  `);v.trim()&&(e.customNestedParser?S=e.customNestedParser(v):S=t.blockTokens(v))}const b=e.createToken(m,S);c.push(b)}if(c.length!==0)return{items:c,raw:d}}function Fo(n,e,t,r){if(!n||!Array.isArray(n.content))return"";const i=typeof t=="function"?t(r):t,[o,...s]=n.content,l=e.renderChildren([o]),c=[`${i}${l}`];return s&&s.length>0&&s.forEach(d=>{const u=e.renderChildren([d]);if(u){const f=u.split(`
101
101
  `).map(h=>h?e.indent(h):"").join(`
102
102
  `);c.push(f)}}),c.join(`
103
- `)}function a0(n,e,t={}){const{state:r}=e,{doc:i,tr:o}=r,s=n;i.descendants((l,c)=>{const d=o.mapping.map(c),u=o.mapping.map(c)+l.nodeSize;let f=null;if(l.marks.forEach(p=>{if(p!==s)return!1;f=p}),!f)return;let h=!1;if(Object.keys(t).forEach(p=>{t[p]!==f.attrs[p]&&(h=!0)}),h){const p=n.type.create({...n.attrs,...t});o.removeMark(d,u,n.type),o.addMark(d,u,p)}}),o.docChanged&&e.view.dispatch(o)}var Te=class Nc extends zo{constructor(){super(...arguments),this.type="node"}static create(e={}){const t=typeof e=="function"?e():e;return new Nc(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}};function Bt(n){return new qy({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{const o=G(n.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:s}=e,l=r[r.length-1],c=r[0];let d=t.to;if(l){const u=c.search(/\S/),f=t.from+c.indexOf(l),h=f+l.length;if(Lo(t.from,t.to,e.doc).filter(m=>m.mark.type.excluded.find(y=>y===n.type&&y!==m.mark.type)).filter(m=>m.to>f).length)return null;h<t.to&&s.delete(h,t.to),f>t.from&&s.delete(t.from+u,f),d=t.from+u+l.length,s.addMark(t.from+u,d,n.type.create(o||{})),s.removeStoredMark(n.type)}}})}function dl(n){return a.customRef((e,t)=>({get(){return e(),n},set(r){n=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{t()})})}}))}var c0=class extends _y{constructor(n={}){return super(n),this.contentComponent=null,this.appContext=null,this.reactiveState=dl(this.view.state),this.reactiveExtensionStorage=dl(this.extensionStorage),this.on("beforeTransaction",({nextState:e})=>{this.reactiveState.value=e,this.reactiveExtensionStorage.value=this.extensionStorage}),a.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(n,e){const t=super.registerPlugin(n,e);return this.reactiveState&&(this.reactiveState.value=t),t}unregisterPlugin(n){const e=super.unregisterPlugin(n);return this.reactiveState&&e&&(this.reactiveState.value=e),e}},d0=a.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(n){const e=a.ref(),t=a.getCurrentInstance();return a.watchEffect(()=>{const r=n.editor;r&&r.options.element&&e.value&&a.nextTick(()=>{var i;if(!e.value||!((i=r.view.dom)!=null&&i.parentNode))return;const o=a.unref(e.value);e.value.append(...r.view.dom.parentNode.childNodes),r.contentComponent=t.ctx._,t&&(r.appContext={...t.appContext,provides:t.provides}),r.setOptions({element:o}),r.createNodeViews()})}),a.onBeforeUnmount(()=>{const r=n.editor;r&&(r.contentComponent=null,r.appContext=null)}),{rootEl:e}},render(){return a.h("div",{ref:n=>{this.rootEl=n}})}});a.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return a.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}});a.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var n,e;return a.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(n=this.$slots).default)==null?void 0:e.call(n))}});var u0=(n={})=>{const e=a.shallowRef();return a.onMounted(()=>{e.value=new c0(n)}),a.onBeforeUnmount(()=>{var t,r,i,o;const s=(r=(t=e.value)==null?void 0:t.view.dom)==null?void 0:r.parentNode,l=s?.cloneNode(!0);(i=s?.parentNode)==null||i.replaceChild(l,s),(o=e.value)==null||o.destroy()}),e};a.defineComponent({name:"MarkViewContent",props:{as:{type:String,default:"span"}},render(){return a.h(this.as,{style:{whiteSpace:"inherit"},"data-mark-view-content":""})}});var ar=(n,e)=>{if(n==="slot")return 0;if(n instanceof Function)return n(e);const{children:t,...r}=e??{};if(n==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[n,r,t]},f0=/^\s*>\s$/,h0=Te.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return ar("blockquote",{...ie(this.options.HTMLAttributes,n),children:ar("slot",{})})},parseMarkdown:(n,e)=>e.createNode("blockquote",void 0,e.parseChildren(n.tokens||[])),renderMarkdown:(n,e)=>{if(!n.content)return"";const t=">",r=[];return n.content.forEach(i=>{const l=e.renderChildren([i]).split(`
103
+ `)}function ak(n,e,t={}){const{state:r}=e,{doc:i,tr:o}=r,s=n;i.descendants((l,c)=>{const d=o.mapping.map(c),u=o.mapping.map(c)+l.nodeSize;let f=null;if(l.marks.forEach(p=>{if(p!==s)return!1;f=p}),!f)return;let h=!1;if(Object.keys(t).forEach(p=>{t[p]!==f.attrs[p]&&(h=!0)}),h){const p=n.type.create({...n.attrs,...t});o.removeMark(d,u,n.type),o.addMark(d,u,p)}}),o.docChanged&&e.view.dispatch(o)}var Te=class Nc extends zo{constructor(){super(...arguments),this.type="node"}static create(e={}){const t=typeof e=="function"?e():e;return new Nc(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}};function Bt(n){return new qy({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{const o=G(n.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:s}=e,l=r[r.length-1],c=r[0];let d=t.to;if(l){const u=c.search(/\S/),f=t.from+c.indexOf(l),h=f+l.length;if(Lo(t.from,t.to,e.doc).filter(m=>m.mark.type.excluded.find(y=>y===n.type&&y!==m.mark.type)).filter(m=>m.to>f).length)return null;h<t.to&&s.delete(h,t.to),f>t.from&&s.delete(t.from+u,f),d=t.from+u+l.length,s.addMark(t.from+u,d,n.type.create(o||{})),s.removeStoredMark(n.type)}}})}function dl(n){return a.customRef((e,t)=>({get(){return e(),n},set(r){n=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{t()})})}}))}var ck=class extends _y{constructor(n={}){return super(n),this.contentComponent=null,this.appContext=null,this.reactiveState=dl(this.view.state),this.reactiveExtensionStorage=dl(this.extensionStorage),this.on("beforeTransaction",({nextState:e})=>{this.reactiveState.value=e,this.reactiveExtensionStorage.value=this.extensionStorage}),a.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(n,e){const t=super.registerPlugin(n,e);return this.reactiveState&&(this.reactiveState.value=t),t}unregisterPlugin(n){const e=super.unregisterPlugin(n);return this.reactiveState&&e&&(this.reactiveState.value=e),e}},dk=a.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(n){const e=a.ref(),t=a.getCurrentInstance();return a.watchEffect(()=>{const r=n.editor;r&&r.options.element&&e.value&&a.nextTick(()=>{var i;if(!e.value||!((i=r.view.dom)!=null&&i.parentNode))return;const o=a.unref(e.value);e.value.append(...r.view.dom.parentNode.childNodes),r.contentComponent=t.ctx._,t&&(r.appContext={...t.appContext,provides:t.provides}),r.setOptions({element:o}),r.createNodeViews()})}),a.onBeforeUnmount(()=>{const r=n.editor;r&&(r.contentComponent=null,r.appContext=null)}),{rootEl:e}},render(){return a.h("div",{ref:n=>{this.rootEl=n}})}});a.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return a.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}});a.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var n,e;return a.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(n=this.$slots).default)==null?void 0:e.call(n))}});var uk=(n={})=>{const e=a.shallowRef();return a.onMounted(()=>{e.value=new ck(n)}),a.onBeforeUnmount(()=>{var t,r,i,o;const s=(r=(t=e.value)==null?void 0:t.view.dom)==null?void 0:r.parentNode,l=s?.cloneNode(!0);(i=s?.parentNode)==null||i.replaceChild(l,s),(o=e.value)==null||o.destroy()}),e};a.defineComponent({name:"MarkViewContent",props:{as:{type:String,default:"span"}},render(){return a.h(this.as,{style:{whiteSpace:"inherit"},"data-mark-view-content":""})}});var ar=(n,e)=>{if(n==="slot")return 0;if(n instanceof Function)return n(e);const{children:t,...r}=e??{};if(n==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[n,r,t]},fk=/^\s*>\s$/,hk=Te.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return ar("blockquote",{...ie(this.options.HTMLAttributes,n),children:ar("slot",{})})},parseMarkdown:(n,e)=>e.createNode("blockquote",void 0,e.parseChildren(n.tokens||[])),renderMarkdown:(n,e)=>{if(!n.content)return"";const t=">",r=[];return n.content.forEach(i=>{const l=e.renderChildren([i]).split(`
104
104
  `).map(c=>c.trim()===""?t:`${t} ${c}`);r.push(l.join(`
105
105
  `))}),r.join(`
106
106
  ${t}
107
- `)},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn(this.name),toggleBlockquote:()=>({commands:n})=>n.toggleWrap(this.name),unsetBlockquote:()=>({commands:n})=>n.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Zt({find:f0,type:this.type})]}}),p0=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,m0=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,g0=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,y0=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,k0=It.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:n=>n.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:n=>n.type.name===this.name},{style:"font-weight",getAttrs:n=>/^(bold(er)?|[5-9]\d{2,})$/.test(n)&&null}]},renderHTML({HTMLAttributes:n}){return ar("strong",{...ie(this.options.HTMLAttributes,n),children:ar("slot",{})})},markdownTokenName:"strong",parseMarkdown:(n,e)=>e.applyMark("bold",e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>`**${e.renderChildren(n)}**`,addCommands(){return{setBold:()=>({commands:n})=>n.setMark(this.name),toggleBold:()=>({commands:n})=>n.toggleMark(this.name),unsetBold:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Xt({find:p0,type:this.type}),Xt({find:g0,type:this.type})]},addPasteRules(){return[Bt({find:m0,type:this.type}),Bt({find:y0,type:this.type})]}}),b0=/(^|[^`])`([^`]+)`(?!`)$/,v0=/(^|[^`])`([^`]+)`(?!`)/g,x0=It.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:n}){return["code",ie(this.options.HTMLAttributes,n),0]},markdownTokenName:"codespan",parseMarkdown:(n,e)=>e.applyMark("code",[{type:"text",text:n.text||""}]),renderMarkdown:(n,e)=>n.content?`\`${e.renderChildren(n.content)}\``:"",addCommands(){return{setCode:()=>({commands:n})=>n.setMark(this.name),toggleCode:()=>({commands:n})=>n.toggleMark(this.name),unsetCode:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Xt({find:b0,type:this.type})]},addPasteRules(){return[Bt({find:v0,type:this.type})]}}),wi=4,w0=/^```([a-z]+)?[\s\n]$/,C0=/^~~~([a-z]+)?[\s\n]$/,S0=Te.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:wi,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:n=>{var e;const{languageClassPrefix:t}=this.options;if(!t)return null;const o=[...((e=n.firstElementChild)==null?void 0:e.classList)||[]].filter(s=>s.startsWith(t)).map(s=>s.replace(t,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:n,HTMLAttributes:e}){return["pre",ie(this.options.HTMLAttributes,e),["code",{class:n.attrs.language?this.options.languageClassPrefix+n.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(n,e)=>{var t;return((t=n.raw)==null?void 0:t.startsWith("```"))===!1&&n.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:n.lang||null},n.text?[e.createTextNode(n.text)]:[])},renderMarkdown:(n,e)=>{var t;let r="";const i=((t=n.attrs)==null?void 0:t.language)||"";return n.content?r=[`\`\`\`${i}`,e.renderChildren(n.content),"```"].join(`
107
+ `)},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn(this.name),toggleBlockquote:()=>({commands:n})=>n.toggleWrap(this.name),unsetBlockquote:()=>({commands:n})=>n.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Zt({find:fk,type:this.type})]}}),pk=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,mk=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,gk=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,yk=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,kk=It.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:n=>n.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:n=>n.type.name===this.name},{style:"font-weight",getAttrs:n=>/^(bold(er)?|[5-9]\d{2,})$/.test(n)&&null}]},renderHTML({HTMLAttributes:n}){return ar("strong",{...ie(this.options.HTMLAttributes,n),children:ar("slot",{})})},markdownTokenName:"strong",parseMarkdown:(n,e)=>e.applyMark("bold",e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>`**${e.renderChildren(n)}**`,addCommands(){return{setBold:()=>({commands:n})=>n.setMark(this.name),toggleBold:()=>({commands:n})=>n.toggleMark(this.name),unsetBold:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Xt({find:pk,type:this.type}),Xt({find:gk,type:this.type})]},addPasteRules(){return[Bt({find:mk,type:this.type}),Bt({find:yk,type:this.type})]}}),bk=/(^|[^`])`([^`]+)`(?!`)$/,vk=/(^|[^`])`([^`]+)`(?!`)/g,xk=It.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:n}){return["code",ie(this.options.HTMLAttributes,n),0]},markdownTokenName:"codespan",parseMarkdown:(n,e)=>e.applyMark("code",[{type:"text",text:n.text||""}]),renderMarkdown:(n,e)=>n.content?`\`${e.renderChildren(n.content)}\``:"",addCommands(){return{setCode:()=>({commands:n})=>n.setMark(this.name),toggleCode:()=>({commands:n})=>n.toggleMark(this.name),unsetCode:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Xt({find:bk,type:this.type})]},addPasteRules(){return[Bt({find:vk,type:this.type})]}}),wi=4,wk=/^```([a-z]+)?[\s\n]$/,Ck=/^~~~([a-z]+)?[\s\n]$/,Sk=Te.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:wi,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:n=>{var e;const{languageClassPrefix:t}=this.options;if(!t)return null;const o=[...((e=n.firstElementChild)==null?void 0:e.classList)||[]].filter(s=>s.startsWith(t)).map(s=>s.replace(t,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:n,HTMLAttributes:e}){return["pre",ie(this.options.HTMLAttributes,e),["code",{class:n.attrs.language?this.options.languageClassPrefix+n.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(n,e)=>{var t;return((t=n.raw)==null?void 0:t.startsWith("```"))===!1&&n.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:n.lang||null},n.text?[e.createTextNode(n.text)]:[])},renderMarkdown:(n,e)=>{var t;let r="";const i=((t=n.attrs)==null?void 0:t.language)||"";return n.content?r=[`\`\`\`${i}`,e.renderChildren(n.content),"```"].join(`
108
108
  `):r=`\`\`\`${i}
109
109
 
110
110
  \`\`\``,r},addCommands(){return{setCodeBlock:n=>({commands:e})=>e.setNode(this.name,n),toggleCodeBlock:n=>({commands:e})=>e.toggleNode(this.name,"paragraph",n)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:n,$anchor:e}=this.editor.state.selection,t=e.pos===1;return!n||e.parent.type.name!==this.name?!1:t||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:n})=>{var e;if(!this.options.enableTabIndentation)return!1;const t=(e=this.options.tabSize)!=null?e:wi,{state:r}=n,{selection:i}=r,{$from:o,empty:s}=i;if(o.parent.type!==this.type)return!1;const l=" ".repeat(t);return s?n.commands.insertContent(l):n.commands.command(({tr:c})=>{const{from:d,to:u}=i,p=r.doc.textBetween(d,u,`
@@ -120,24 +120,24 @@ ${t}
120
120
  `).map(p=>{var m;const g=((m=p.match(/^ */))==null?void 0:m[0])||"",y=Math.min(g.length,t);return p.slice(y)}).join(`
121
121
  `);return l.replaceWith(c,d,r.schema.text(h)),!0})},Enter:({editor:n})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=n,{selection:t}=e,{$from:r,empty:i}=t;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(`
122
122
 
123
- `);return!o||!s?!1:n.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:n})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=n,{selection:t,doc:r}=e,{$from:i,empty:o}=t;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const l=i.after();return l===void 0?!1:r.nodeAt(l)?n.commands.command(({tr:d})=>(d.setSelection(H.near(r.resolve(l))),!0)):n.commands.exitCode()}}},addInputRules(){return[Xi({find:w0,type:this.type,getAttributes:n=>({language:n[1]})}),Xi({find:C0,type:this.type,getAttributes:n=>({language:n[1]})})]},addProseMirrorPlugins(){return[new Z({key:new oe("codeBlockVSCodeHandler"),props:{handlePaste:(n,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const t=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i?.mode;if(!t||!o)return!1;const{tr:s,schema:l}=n.state,c=l.text(t.replace(/\r\n?/g,`
124
- `));return s.replaceSelectionWith(this.type.create({language:o},c)),s.selection.$from.parent.type!==this.type&&s.setSelection(V.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),n.dispatch(s),!0}}})]}}),M0=Te.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,`
123
+ `);return!o||!s?!1:n.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:n})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=n,{selection:t,doc:r}=e,{$from:i,empty:o}=t;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const l=i.after();return l===void 0?!1:r.nodeAt(l)?n.commands.command(({tr:d})=>(d.setSelection(H.near(r.resolve(l))),!0)):n.commands.exitCode()}}},addInputRules(){return[Xi({find:wk,type:this.type,getAttributes:n=>({language:n[1]})}),Xi({find:Ck,type:this.type,getAttributes:n=>({language:n[1]})})]},addProseMirrorPlugins(){return[new Z({key:new oe("codeBlockVSCodeHandler"),props:{handlePaste:(n,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const t=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i?.mode;if(!t||!o)return!1;const{tr:s,schema:l}=n.state,c=l.text(t.replace(/\r\n?/g,`
124
+ `));return s.replaceSelectionWith(this.type.create({language:o},c)),s.selection.$from.parent.type!==this.type&&s.setSelection(V.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),n.dispatch(s),!0}}})]}}),Mk=Te.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,`
125
125
 
126
- `):""}),T0=Te.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:n}){return["br",ie(this.options.HTMLAttributes,n)]},renderText(){return`
126
+ `):""}),Tk=Te.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:n}){return["br",ie(this.options.HTMLAttributes,n)]},renderText(){return`
127
127
  `},renderMarkdown:()=>`
128
- `,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:n,chain:e,state:t,editor:r})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:i,storedMarks:o}=t;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:l}=r.extensionManager,c=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:u})=>{if(u&&c&&s){const f=c.filter(h=>l.includes(h.type.name));d.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Ac=Te.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,ie(this.options.HTMLAttributes,e),0]},parseMarkdown:(n,e)=>e.createNode("heading",{level:n.depth||1},e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>{var t;const r=(t=n.attrs)!=null&&t.level?parseInt(n.attrs.level,10):1,i="#".repeat(r);return n.content?`${i} ${e.renderChildren(n.content)}`:""},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>Xi({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),E0=Ac,N0=Te.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",ie(this.options.HTMLAttributes,n)]},markdownTokenName:"hr",parseMarkdown:(n,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:n,state:e})=>{if(!t0(e,e.schema.nodes[this.name]))return!1;const{selection:t}=e,{$to:r}=t,i=n();return uc(t)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:o,tr:s,dispatch:l})=>{if(l){const{$to:c}=s.selection,d=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?s.setSelection(V.create(s.doc,c.pos+1)):c.nodeAfter.isBlock?s.setSelection(P.create(s.doc,c.pos)):s.setSelection(V.create(s.doc,c.pos));else{const u=o.schema.nodes[this.options.nextNodeType]||c.parent.type.contentMatch.defaultType,f=u?.create();f&&(s.insert(d,f),s.setSelection(V.create(s.doc,d+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[e0({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),A0=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,B0=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,O0=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,D0=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,I0=It.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:n=>n.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",ie(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(n,e)=>e.applyMark("italic",e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>`*${e.renderChildren(n)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Xt({find:A0,type:this.type}),Xt({find:O0,type:this.type})]},addPasteRules(){return[Bt({find:B0,type:this.type}),Bt({find:D0,type:this.type})]}});const $0="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",R0="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",_i="numeric",eo="ascii",to="alpha",fn="asciinumeric",ln="alphanumeric",no="domain",Bc="emoji",L0="scheme",z0="slashscheme",Ci="whitespace";function P0(n,e){return n in e||(e[n]=[]),e[n]}function vt(n,e,t){e[_i]&&(e[fn]=!0,e[ln]=!0),e[eo]&&(e[fn]=!0,e[to]=!0),e[fn]&&(e[ln]=!0),e[to]&&(e[ln]=!0),e[ln]&&(e[no]=!0),e[Bc]&&(e[no]=!0);for(const r in e){const i=P0(r,t);i.indexOf(n)<0&&i.push(n)}}function V0(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function Ce(n=null){this.j={},this.jr=[],this.jd=null,this.t=n}Ce.groups={};Ce.prototype={accepts(){return!!this.t},go(n){const e=this,t=e.j[n];if(t)return t;for(let r=0;r<e.jr.length;r++){const i=e.jr[r][0],o=e.jr[r][1];if(o&&i.test(n))return o}return e.jd},has(n,e=!1){return e?n in this.j:!!this.go(n)},ta(n,e,t,r){for(let i=0;i<n.length;i++)this.tt(n[i],e,t,r)},tr(n,e,t,r){r=r||Ce.groups;let i;return e&&e.j?i=e:(i=new Ce(e),t&&r&&vt(e,t,r)),this.jr.push([n,i]),i},ts(n,e,t,r){let i=this;const o=n.length;if(!o)return i;for(let s=0;s<o-1;s++)i=i.tt(n[s]);return i.tt(n[o-1],e,t,r)},tt(n,e,t,r){r=r||Ce.groups;const i=this;if(e&&e.j)return i.j[n]=e,e;const o=e;let s,l=i.go(n);if(l?(s=new Ce,Object.assign(s.j,l.j),s.jr.push.apply(s.jr,l.jr),s.jd=l.jd,s.t=l.t):s=new Ce,o){if(r)if(s.t&&typeof s.t=="string"){const c=Object.assign(V0(s.t,r),t);vt(o,c,r)}else t&&vt(o,t,r);s.t=o}return i.j[n]=s,s}};const F=(n,e,t,r,i)=>n.ta(e,t,r,i),_=(n,e,t,r,i)=>n.tr(e,t,r,i),ul=(n,e,t,r,i)=>n.ts(e,t,r,i),E=(n,e,t,r,i)=>n.tt(e,t,r,i),We="WORD",ro="UWORD",Oc="ASCIINUMERICAL",Dc="ALPHANUMERICAL",Tn="LOCALHOST",io="TLD",oo="UTLD",Jn="SCHEME",Ft="SLASH_SCHEME",Ho="NUM",so="WS",jo="NL",hn="OPENBRACE",pn="CLOSEBRACE",cr="OPENBRACKET",dr="CLOSEBRACKET",ur="OPENPAREN",fr="CLOSEPAREN",hr="OPENANGLEBRACKET",pr="CLOSEANGLEBRACKET",mr="FULLWIDTHLEFTPAREN",gr="FULLWIDTHRIGHTPAREN",yr="LEFTCORNERBRACKET",kr="RIGHTCORNERBRACKET",br="LEFTWHITECORNERBRACKET",vr="RIGHTWHITECORNERBRACKET",xr="FULLWIDTHLESSTHAN",wr="FULLWIDTHGREATERTHAN",Cr="AMPERSAND",Sr="APOSTROPHE",Mr="ASTERISK",_e="AT",Tr="BACKSLASH",Er="BACKTICK",Nr="CARET",rt="COLON",Uo="COMMA",Ar="DOLLAR",ze="DOT",Br="EQUALS",qo="EXCLAMATION",Ne="HYPHEN",mn="PERCENT",Or="PIPE",Dr="PLUS",Ir="POUND",gn="QUERY",Wo="QUOTE",Ic="FULLWIDTHMIDDLEDOT",Ko="SEMI",Pe="SLASH",yn="TILDE",$r="UNDERSCORE",$c="EMOJI",Rr="SYM";var Rc=Object.freeze({__proto__:null,ALPHANUMERICAL:Dc,AMPERSAND:Cr,APOSTROPHE:Sr,ASCIINUMERICAL:Oc,ASTERISK:Mr,AT:_e,BACKSLASH:Tr,BACKTICK:Er,CARET:Nr,CLOSEANGLEBRACKET:pr,CLOSEBRACE:pn,CLOSEBRACKET:dr,CLOSEPAREN:fr,COLON:rt,COMMA:Uo,DOLLAR:Ar,DOT:ze,EMOJI:$c,EQUALS:Br,EXCLAMATION:qo,FULLWIDTHGREATERTHAN:wr,FULLWIDTHLEFTPAREN:mr,FULLWIDTHLESSTHAN:xr,FULLWIDTHMIDDLEDOT:Ic,FULLWIDTHRIGHTPAREN:gr,HYPHEN:Ne,LEFTCORNERBRACKET:yr,LEFTWHITECORNERBRACKET:br,LOCALHOST:Tn,NL:jo,NUM:Ho,OPENANGLEBRACKET:hr,OPENBRACE:hn,OPENBRACKET:cr,OPENPAREN:ur,PERCENT:mn,PIPE:Or,PLUS:Dr,POUND:Ir,QUERY:gn,QUOTE:Wo,RIGHTCORNERBRACKET:kr,RIGHTWHITECORNERBRACKET:vr,SCHEME:Jn,SEMI:Ko,SLASH:Pe,SLASH_SCHEME:Ft,SYM:Rr,TILDE:yn,TLD:io,UNDERSCORE:$r,UTLD:oo,UWORD:ro,WORD:We,WS:so});const Ue=/[a-z]/,nn=new RegExp("\\p{L}","u"),Si=new RegExp("\\p{Emoji}","u"),qe=/\d/,Mi=/\s/,fl="\r",Ti=`
129
- `,F0="️",H0="‍",Ei="";let Fn=null,Hn=null;function j0(n=[]){const e={};Ce.groups=e;const t=new Ce;Fn==null&&(Fn=hl($0)),Hn==null&&(Hn=hl(R0)),E(t,"'",Sr),E(t,"{",hn),E(t,"}",pn),E(t,"[",cr),E(t,"]",dr),E(t,"(",ur),E(t,")",fr),E(t,"<",hr),E(t,">",pr),E(t,"(",mr),E(t,")",gr),E(t,"「",yr),E(t,"」",kr),E(t,"『",br),E(t,"』",vr),E(t,"<",xr),E(t,">",wr),E(t,"&",Cr),E(t,"*",Mr),E(t,"@",_e),E(t,"`",Er),E(t,"^",Nr),E(t,":",rt),E(t,",",Uo),E(t,"$",Ar),E(t,".",ze),E(t,"=",Br),E(t,"!",qo),E(t,"-",Ne),E(t,"%",mn),E(t,"|",Or),E(t,"+",Dr),E(t,"#",Ir),E(t,"?",gn),E(t,'"',Wo),E(t,"/",Pe),E(t,";",Ko),E(t,"~",yn),E(t,"_",$r),E(t,"\\",Tr),E(t,"・",Ic);const r=_(t,qe,Ho,{[_i]:!0});_(r,qe,r);const i=_(r,Ue,Oc,{[fn]:!0}),o=_(r,nn,Dc,{[ln]:!0}),s=_(t,Ue,We,{[eo]:!0});_(s,qe,i),_(s,Ue,s),_(i,qe,i),_(i,Ue,i);const l=_(t,nn,ro,{[to]:!0});_(l,Ue),_(l,qe,o),_(l,nn,l),_(o,qe,o),_(o,Ue),_(o,nn,o);const c=E(t,Ti,jo,{[Ci]:!0}),d=E(t,fl,so,{[Ci]:!0}),u=_(t,Mi,so,{[Ci]:!0});E(t,Ei,u),E(d,Ti,c),E(d,Ei,u),_(d,Mi,u),E(u,fl),E(u,Ti),_(u,Mi,u),E(u,Ei,u);const f=_(t,Si,$c,{[Bc]:!0});E(f,"#"),_(f,Si,f),E(f,F0,f);const h=E(f,H0);E(h,"#"),_(h,Si,f);const p=[[Ue,s],[qe,i]],m=[[Ue,null],[nn,l],[qe,o]];for(let g=0;g<Fn.length;g++)Qe(t,Fn[g],io,We,p);for(let g=0;g<Hn.length;g++)Qe(t,Hn[g],oo,ro,m);vt(io,{tld:!0,ascii:!0},e),vt(oo,{utld:!0,alpha:!0},e),Qe(t,"file",Jn,We,p),Qe(t,"mailto",Jn,We,p),Qe(t,"http",Ft,We,p),Qe(t,"https",Ft,We,p),Qe(t,"ftp",Ft,We,p),Qe(t,"ftps",Ft,We,p),vt(Jn,{scheme:!0,ascii:!0},e),vt(Ft,{slashscheme:!0,ascii:!0},e),n=n.sort((g,y)=>g[0]>y[0]?1:-1);for(let g=0;g<n.length;g++){const y=n[g][0],S=n[g][1]?{[L0]:!0}:{[z0]:!0};y.indexOf("-")>=0?S[no]=!0:Ue.test(y)?qe.test(y)?S[fn]=!0:S[eo]=!0:S[_i]=!0,ul(t,y,y,S)}return ul(t,"localhost",Tn,{ascii:!0}),t.jd=new Ce(Rr),{start:t,tokens:Object.assign({groups:e},Rc)}}function Lc(n,e){const t=U0(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=t.length,i=[];let o=0,s=0;for(;s<r;){let l=n,c=null,d=0,u=null,f=-1,h=-1;for(;s<r&&(c=l.go(t[s]));)l=c,l.accepts()?(f=0,h=0,u=l):f>=0&&(f+=t[s].length,h++),d+=t[s].length,o+=t[s].length,s++;o-=f,s-=h,d-=f,i.push({t:u.t,v:e.slice(o-d,o),s:o-d,e:o})}return i}function U0(n){const e=[],t=n.length;let r=0;for(;r<t;){let i=n.charCodeAt(r),o,s=i<55296||i>56319||r+1===t||(o=n.charCodeAt(r+1))<56320||o>57343?n[r]:n.slice(r,r+2);e.push(s),r+=s.length}return e}function Qe(n,e,t,r,i){let o;const s=e.length;for(let l=0;l<s-1;l++){const c=e[l];n.j[c]?o=n.j[c]:(o=new Ce(r),o.jr=i.slice(),n.j[c]=o),n=o}return o=new Ce(t),o.jr=i.slice(),n.j[e[s-1]]=o,o}function hl(n){const e=[],t=[];let r=0,i="0123456789";for(;r<n.length;){let o=0;for(;i.indexOf(n[r+o])>=0;)o++;if(o>0){e.push(t.join(""));for(let s=parseInt(n.substring(r,r+o),10);s>0;s--)t.pop();r+=o}else t.push(n[r]),r++}return e}const En={defaultProtocol:"http",events:null,format:pl,formatHref:pl,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Jo(n,e=null){let t=Object.assign({},En);n&&(t=Object.assign(t,n instanceof Jo?n.o:n));const r=t.ignoreTags,i=[];for(let o=0;o<r.length;o++)i.push(r[o].toUpperCase());this.o=t,e&&(this.defaultRender=e),this.ignoreTags=i}Jo.prototype={o:En,ignoreTags:[],defaultRender(n){return n},check(n){return this.get("validate",n.toString(),n)},get(n,e,t){const r=e!=null;let i=this.o[n];return i&&(typeof i=="object"?(i=t.t in i?i[t.t]:En[n],typeof i=="function"&&r&&(i=i(e,t))):typeof i=="function"&&r&&(i=i(e,t.t,t)),i)},getObj(n,e,t){let r=this.o[n];return typeof r=="function"&&e!=null&&(r=r(e,t.t,t)),r},render(n){const e=n.render(this);return(this.get("render",null,n)||this.defaultRender)(e,n.t,n)}};function pl(n){return n}function zc(n,e){this.t="token",this.v=n,this.tk=e}zc.prototype={isLink:!1,toString(){return this.v},toHref(n){return this.toString()},toFormattedString(n){const e=this.toString(),t=n.get("truncate",e,this),r=n.get("format",e,this);return t&&r.length>t?r.substring(0,t)+"…":r},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n=En.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){const e=this,t=this.toHref(n.get("defaultProtocol")),r=n.get("formatHref",t,this),i=n.get("tagName",t,e),o=this.toFormattedString(n),s={},l=n.get("className",t,e),c=n.get("target",t,e),d=n.get("rel",t,e),u=n.getObj("attributes",t,e),f=n.getObj("events",t,e);return s.href=r,l&&(s.class=l),c&&(s.target=c),d&&(s.rel=d),u&&Object.assign(s,u),{tagName:i,attributes:s,content:o,eventListeners:f}}};function ti(n,e){class t extends zc{constructor(i,o){super(i,o),this.t=n}}for(const r in e)t.prototype[r]=e[r];return t.t=n,t}const ml=ti("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),gl=ti("text"),q0=ti("nl"),jn=ti("url",{isLink:!0,toHref(n=En.defaultProtocol){return this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==Tn&&n[1].t===rt}}),Ee=n=>new Ce(n);function W0({groups:n}){const e=n.domain.concat([Cr,Mr,_e,Tr,Er,Nr,Ar,Br,Ne,Ho,mn,Or,Dr,Ir,Pe,Rr,yn,$r]),t=[Sr,rt,Uo,ze,qo,mn,gn,Wo,Ko,hr,pr,hn,pn,dr,cr,ur,fr,mr,gr,yr,kr,br,vr,xr,wr],r=[Cr,Sr,Mr,Tr,Er,Nr,Ar,Br,Ne,hn,pn,mn,Or,Dr,Ir,gn,Pe,Rr,yn,$r],i=Ee(),o=E(i,yn);F(o,r,o),F(o,n.domain,o);const s=Ee(),l=Ee(),c=Ee();F(i,n.domain,s),F(i,n.scheme,l),F(i,n.slashscheme,c),F(s,r,o),F(s,n.domain,s);const d=E(s,_e);E(o,_e,d),E(l,_e,d),E(c,_e,d);const u=E(o,ze);F(u,r,o),F(u,n.domain,o);const f=Ee();F(d,n.domain,f),F(f,n.domain,f);const h=E(f,ze);F(h,n.domain,f);const p=Ee(ml);F(h,n.tld,p),F(h,n.utld,p),E(d,Tn,p);const m=E(f,Ne);E(m,Ne,m),F(m,n.domain,f),F(p,n.domain,f),E(p,ze,h),E(p,Ne,m);const g=E(p,rt);F(g,n.numeric,ml);const y=E(s,Ne),k=E(s,ze);E(y,Ne,y),F(y,n.domain,s),F(k,r,o),F(k,n.domain,s);const S=Ee(jn);F(k,n.tld,S),F(k,n.utld,S),F(S,n.domain,s),F(S,r,o),E(S,ze,k),E(S,Ne,y),E(S,_e,d);const x=E(S,rt),b=Ee(jn);F(x,n.numeric,b);const v=Ee(jn),C=Ee();F(v,e,v),F(v,t,C),F(C,e,v),F(C,t,C),E(S,Pe,v),E(b,Pe,v);const w=E(l,rt),M=E(c,rt),A=E(M,Pe),$=E(A,Pe);F(l,n.domain,s),E(l,ze,k),E(l,Ne,y),F(c,n.domain,s),E(c,ze,k),E(c,Ne,y),F(w,n.domain,v),E(w,Pe,v),E(w,gn,v),F($,n.domain,v),F($,e,v),E($,Pe,v);const U=[[hn,pn],[cr,dr],[ur,fr],[hr,pr],[mr,gr],[yr,kr],[br,vr],[xr,wr]];for(let j=0;j<U.length;j++){const[K,N]=U[j],D=E(v,K);E(C,K,D),E(D,N,v);const R=Ee(jn);F(D,e,R);const ke=Ee();F(D,t),F(R,e,R),F(R,t,ke),F(ke,e,R),F(ke,t,ke),E(R,N,v),E(ke,N,v)}return E(i,Tn,S),E(i,jo,q0),{start:i,tokens:Rc}}function K0(n,e,t){let r=t.length,i=0,o=[],s=[];for(;i<r;){let l=n,c=null,d=null,u=0,f=null,h=-1;for(;i<r&&!(c=l.go(t[i].t));)s.push(t[i++]);for(;i<r&&(d=c||l.go(t[i].t));)c=null,l=d,l.accepts()?(h=0,f=l):h>=0&&h++,i++,u++;if(h<0)i-=u,i<r&&(s.push(t[i]),i++);else{s.length>0&&(o.push(Ni(gl,e,s)),s=[]),i-=h,u-=h;const p=f.t,m=t.slice(i-u,i);o.push(Ni(p,e,m))}}return s.length>0&&o.push(Ni(gl,e,s)),o}function Ni(n,e,t){const r=t[0].s,i=t[t.length-1].e,o=e.slice(r,i);return new n(o,t)}const J0=typeof console<"u"&&console&&console.warn||(()=>{}),G0="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Q={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Y0(){return Ce.groups={},Q.scanner=null,Q.parser=null,Q.tokenQueue=[],Q.pluginQueue=[],Q.customSchemes=[],Q.initialized=!1,Q}function yl(n,e=!1){if(Q.initialized&&J0(`linkifyjs: already initialized - will not register custom scheme "${n}" ${G0}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format.
128
+ `,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:n,chain:e,state:t,editor:r})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:i,storedMarks:o}=t;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:l}=r.extensionManager,c=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:u})=>{if(u&&c&&s){const f=c.filter(h=>l.includes(h.type.name));d.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Ac=Te.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,ie(this.options.HTMLAttributes,e),0]},parseMarkdown:(n,e)=>e.createNode("heading",{level:n.depth||1},e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>{var t;const r=(t=n.attrs)!=null&&t.level?parseInt(n.attrs.level,10):1,i="#".repeat(r);return n.content?`${i} ${e.renderChildren(n.content)}`:""},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>Xi({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),Ek=Ac,Nk=Te.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",ie(this.options.HTMLAttributes,n)]},markdownTokenName:"hr",parseMarkdown:(n,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:n,state:e})=>{if(!tk(e,e.schema.nodes[this.name]))return!1;const{selection:t}=e,{$to:r}=t,i=n();return uc(t)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:o,tr:s,dispatch:l})=>{if(l){const{$to:c}=s.selection,d=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?s.setSelection(V.create(s.doc,c.pos+1)):c.nodeAfter.isBlock?s.setSelection(P.create(s.doc,c.pos)):s.setSelection(V.create(s.doc,c.pos));else{const u=o.schema.nodes[this.options.nextNodeType]||c.parent.type.contentMatch.defaultType,f=u?.create();f&&(s.insert(d,f),s.setSelection(V.create(s.doc,d+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[ek({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Ak=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Bk=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Ok=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Dk=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Ik=It.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:n=>n.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",ie(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(n,e)=>e.applyMark("italic",e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>`*${e.renderChildren(n)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Xt({find:Ak,type:this.type}),Xt({find:Ok,type:this.type})]},addPasteRules(){return[Bt({find:Bk,type:this.type}),Bt({find:Dk,type:this.type})]}});const $k="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Rk="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",_i="numeric",eo="ascii",to="alpha",fn="asciinumeric",ln="alphanumeric",no="domain",Bc="emoji",Lk="scheme",zk="slashscheme",Ci="whitespace";function Pk(n,e){return n in e||(e[n]=[]),e[n]}function vt(n,e,t){e[_i]&&(e[fn]=!0,e[ln]=!0),e[eo]&&(e[fn]=!0,e[to]=!0),e[fn]&&(e[ln]=!0),e[to]&&(e[ln]=!0),e[ln]&&(e[no]=!0),e[Bc]&&(e[no]=!0);for(const r in e){const i=Pk(r,t);i.indexOf(n)<0&&i.push(n)}}function Vk(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function Ce(n=null){this.j={},this.jr=[],this.jd=null,this.t=n}Ce.groups={};Ce.prototype={accepts(){return!!this.t},go(n){const e=this,t=e.j[n];if(t)return t;for(let r=0;r<e.jr.length;r++){const i=e.jr[r][0],o=e.jr[r][1];if(o&&i.test(n))return o}return e.jd},has(n,e=!1){return e?n in this.j:!!this.go(n)},ta(n,e,t,r){for(let i=0;i<n.length;i++)this.tt(n[i],e,t,r)},tr(n,e,t,r){r=r||Ce.groups;let i;return e&&e.j?i=e:(i=new Ce(e),t&&r&&vt(e,t,r)),this.jr.push([n,i]),i},ts(n,e,t,r){let i=this;const o=n.length;if(!o)return i;for(let s=0;s<o-1;s++)i=i.tt(n[s]);return i.tt(n[o-1],e,t,r)},tt(n,e,t,r){r=r||Ce.groups;const i=this;if(e&&e.j)return i.j[n]=e,e;const o=e;let s,l=i.go(n);if(l?(s=new Ce,Object.assign(s.j,l.j),s.jr.push.apply(s.jr,l.jr),s.jd=l.jd,s.t=l.t):s=new Ce,o){if(r)if(s.t&&typeof s.t=="string"){const c=Object.assign(Vk(s.t,r),t);vt(o,c,r)}else t&&vt(o,t,r);s.t=o}return i.j[n]=s,s}};const F=(n,e,t,r,i)=>n.ta(e,t,r,i),_=(n,e,t,r,i)=>n.tr(e,t,r,i),ul=(n,e,t,r,i)=>n.ts(e,t,r,i),E=(n,e,t,r,i)=>n.tt(e,t,r,i),We="WORD",ro="UWORD",Oc="ASCIINUMERICAL",Dc="ALPHANUMERICAL",Tn="LOCALHOST",io="TLD",oo="UTLD",Jn="SCHEME",Ft="SLASH_SCHEME",Ho="NUM",so="WS",jo="NL",hn="OPENBRACE",pn="CLOSEBRACE",cr="OPENBRACKET",dr="CLOSEBRACKET",ur="OPENPAREN",fr="CLOSEPAREN",hr="OPENANGLEBRACKET",pr="CLOSEANGLEBRACKET",mr="FULLWIDTHLEFTPAREN",gr="FULLWIDTHRIGHTPAREN",yr="LEFTCORNERBRACKET",kr="RIGHTCORNERBRACKET",br="LEFTWHITECORNERBRACKET",vr="RIGHTWHITECORNERBRACKET",xr="FULLWIDTHLESSTHAN",wr="FULLWIDTHGREATERTHAN",Cr="AMPERSAND",Sr="APOSTROPHE",Mr="ASTERISK",_e="AT",Tr="BACKSLASH",Er="BACKTICK",Nr="CARET",rt="COLON",Uo="COMMA",Ar="DOLLAR",ze="DOT",Br="EQUALS",qo="EXCLAMATION",Ne="HYPHEN",mn="PERCENT",Or="PIPE",Dr="PLUS",Ir="POUND",gn="QUERY",Wo="QUOTE",Ic="FULLWIDTHMIDDLEDOT",Ko="SEMI",Pe="SLASH",yn="TILDE",$r="UNDERSCORE",$c="EMOJI",Rr="SYM";var Rc=Object.freeze({__proto__:null,ALPHANUMERICAL:Dc,AMPERSAND:Cr,APOSTROPHE:Sr,ASCIINUMERICAL:Oc,ASTERISK:Mr,AT:_e,BACKSLASH:Tr,BACKTICK:Er,CARET:Nr,CLOSEANGLEBRACKET:pr,CLOSEBRACE:pn,CLOSEBRACKET:dr,CLOSEPAREN:fr,COLON:rt,COMMA:Uo,DOLLAR:Ar,DOT:ze,EMOJI:$c,EQUALS:Br,EXCLAMATION:qo,FULLWIDTHGREATERTHAN:wr,FULLWIDTHLEFTPAREN:mr,FULLWIDTHLESSTHAN:xr,FULLWIDTHMIDDLEDOT:Ic,FULLWIDTHRIGHTPAREN:gr,HYPHEN:Ne,LEFTCORNERBRACKET:yr,LEFTWHITECORNERBRACKET:br,LOCALHOST:Tn,NL:jo,NUM:Ho,OPENANGLEBRACKET:hr,OPENBRACE:hn,OPENBRACKET:cr,OPENPAREN:ur,PERCENT:mn,PIPE:Or,PLUS:Dr,POUND:Ir,QUERY:gn,QUOTE:Wo,RIGHTCORNERBRACKET:kr,RIGHTWHITECORNERBRACKET:vr,SCHEME:Jn,SEMI:Ko,SLASH:Pe,SLASH_SCHEME:Ft,SYM:Rr,TILDE:yn,TLD:io,UNDERSCORE:$r,UTLD:oo,UWORD:ro,WORD:We,WS:so});const Ue=/[a-z]/,nn=new RegExp("\\p{L}","u"),Si=new RegExp("\\p{Emoji}","u"),qe=/\d/,Mi=/\s/,fl="\r",Ti=`
129
+ `,Fk="️",Hk="‍",Ei="";let Fn=null,Hn=null;function jk(n=[]){const e={};Ce.groups=e;const t=new Ce;Fn==null&&(Fn=hl($k)),Hn==null&&(Hn=hl(Rk)),E(t,"'",Sr),E(t,"{",hn),E(t,"}",pn),E(t,"[",cr),E(t,"]",dr),E(t,"(",ur),E(t,")",fr),E(t,"<",hr),E(t,">",pr),E(t,"(",mr),E(t,")",gr),E(t,"「",yr),E(t,"」",kr),E(t,"『",br),E(t,"』",vr),E(t,"<",xr),E(t,">",wr),E(t,"&",Cr),E(t,"*",Mr),E(t,"@",_e),E(t,"`",Er),E(t,"^",Nr),E(t,":",rt),E(t,",",Uo),E(t,"$",Ar),E(t,".",ze),E(t,"=",Br),E(t,"!",qo),E(t,"-",Ne),E(t,"%",mn),E(t,"|",Or),E(t,"+",Dr),E(t,"#",Ir),E(t,"?",gn),E(t,'"',Wo),E(t,"/",Pe),E(t,";",Ko),E(t,"~",yn),E(t,"_",$r),E(t,"\\",Tr),E(t,"・",Ic);const r=_(t,qe,Ho,{[_i]:!0});_(r,qe,r);const i=_(r,Ue,Oc,{[fn]:!0}),o=_(r,nn,Dc,{[ln]:!0}),s=_(t,Ue,We,{[eo]:!0});_(s,qe,i),_(s,Ue,s),_(i,qe,i),_(i,Ue,i);const l=_(t,nn,ro,{[to]:!0});_(l,Ue),_(l,qe,o),_(l,nn,l),_(o,qe,o),_(o,Ue),_(o,nn,o);const c=E(t,Ti,jo,{[Ci]:!0}),d=E(t,fl,so,{[Ci]:!0}),u=_(t,Mi,so,{[Ci]:!0});E(t,Ei,u),E(d,Ti,c),E(d,Ei,u),_(d,Mi,u),E(u,fl),E(u,Ti),_(u,Mi,u),E(u,Ei,u);const f=_(t,Si,$c,{[Bc]:!0});E(f,"#"),_(f,Si,f),E(f,Fk,f);const h=E(f,Hk);E(h,"#"),_(h,Si,f);const p=[[Ue,s],[qe,i]],m=[[Ue,null],[nn,l],[qe,o]];for(let g=0;g<Fn.length;g++)Qe(t,Fn[g],io,We,p);for(let g=0;g<Hn.length;g++)Qe(t,Hn[g],oo,ro,m);vt(io,{tld:!0,ascii:!0},e),vt(oo,{utld:!0,alpha:!0},e),Qe(t,"file",Jn,We,p),Qe(t,"mailto",Jn,We,p),Qe(t,"http",Ft,We,p),Qe(t,"https",Ft,We,p),Qe(t,"ftp",Ft,We,p),Qe(t,"ftps",Ft,We,p),vt(Jn,{scheme:!0,ascii:!0},e),vt(Ft,{slashscheme:!0,ascii:!0},e),n=n.sort((g,y)=>g[0]>y[0]?1:-1);for(let g=0;g<n.length;g++){const y=n[g][0],S=n[g][1]?{[Lk]:!0}:{[zk]:!0};y.indexOf("-")>=0?S[no]=!0:Ue.test(y)?qe.test(y)?S[fn]=!0:S[eo]=!0:S[_i]=!0,ul(t,y,y,S)}return ul(t,"localhost",Tn,{ascii:!0}),t.jd=new Ce(Rr),{start:t,tokens:Object.assign({groups:e},Rc)}}function Lc(n,e){const t=Uk(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=t.length,i=[];let o=0,s=0;for(;s<r;){let l=n,c=null,d=0,u=null,f=-1,h=-1;for(;s<r&&(c=l.go(t[s]));)l=c,l.accepts()?(f=0,h=0,u=l):f>=0&&(f+=t[s].length,h++),d+=t[s].length,o+=t[s].length,s++;o-=f,s-=h,d-=f,i.push({t:u.t,v:e.slice(o-d,o),s:o-d,e:o})}return i}function Uk(n){const e=[],t=n.length;let r=0;for(;r<t;){let i=n.charCodeAt(r),o,s=i<55296||i>56319||r+1===t||(o=n.charCodeAt(r+1))<56320||o>57343?n[r]:n.slice(r,r+2);e.push(s),r+=s.length}return e}function Qe(n,e,t,r,i){let o;const s=e.length;for(let l=0;l<s-1;l++){const c=e[l];n.j[c]?o=n.j[c]:(o=new Ce(r),o.jr=i.slice(),n.j[c]=o),n=o}return o=new Ce(t),o.jr=i.slice(),n.j[e[s-1]]=o,o}function hl(n){const e=[],t=[];let r=0,i="0123456789";for(;r<n.length;){let o=0;for(;i.indexOf(n[r+o])>=0;)o++;if(o>0){e.push(t.join(""));for(let s=parseInt(n.substring(r,r+o),10);s>0;s--)t.pop();r+=o}else t.push(n[r]),r++}return e}const En={defaultProtocol:"http",events:null,format:pl,formatHref:pl,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Jo(n,e=null){let t=Object.assign({},En);n&&(t=Object.assign(t,n instanceof Jo?n.o:n));const r=t.ignoreTags,i=[];for(let o=0;o<r.length;o++)i.push(r[o].toUpperCase());this.o=t,e&&(this.defaultRender=e),this.ignoreTags=i}Jo.prototype={o:En,ignoreTags:[],defaultRender(n){return n},check(n){return this.get("validate",n.toString(),n)},get(n,e,t){const r=e!=null;let i=this.o[n];return i&&(typeof i=="object"?(i=t.t in i?i[t.t]:En[n],typeof i=="function"&&r&&(i=i(e,t))):typeof i=="function"&&r&&(i=i(e,t.t,t)),i)},getObj(n,e,t){let r=this.o[n];return typeof r=="function"&&e!=null&&(r=r(e,t.t,t)),r},render(n){const e=n.render(this);return(this.get("render",null,n)||this.defaultRender)(e,n.t,n)}};function pl(n){return n}function zc(n,e){this.t="token",this.v=n,this.tk=e}zc.prototype={isLink:!1,toString(){return this.v},toHref(n){return this.toString()},toFormattedString(n){const e=this.toString(),t=n.get("truncate",e,this),r=n.get("format",e,this);return t&&r.length>t?r.substring(0,t)+"…":r},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n=En.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){const e=this,t=this.toHref(n.get("defaultProtocol")),r=n.get("formatHref",t,this),i=n.get("tagName",t,e),o=this.toFormattedString(n),s={},l=n.get("className",t,e),c=n.get("target",t,e),d=n.get("rel",t,e),u=n.getObj("attributes",t,e),f=n.getObj("events",t,e);return s.href=r,l&&(s.class=l),c&&(s.target=c),d&&(s.rel=d),u&&Object.assign(s,u),{tagName:i,attributes:s,content:o,eventListeners:f}}};function ti(n,e){class t extends zc{constructor(i,o){super(i,o),this.t=n}}for(const r in e)t.prototype[r]=e[r];return t.t=n,t}const ml=ti("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),gl=ti("text"),qk=ti("nl"),jn=ti("url",{isLink:!0,toHref(n=En.defaultProtocol){return this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==Tn&&n[1].t===rt}}),Ee=n=>new Ce(n);function Wk({groups:n}){const e=n.domain.concat([Cr,Mr,_e,Tr,Er,Nr,Ar,Br,Ne,Ho,mn,Or,Dr,Ir,Pe,Rr,yn,$r]),t=[Sr,rt,Uo,ze,qo,mn,gn,Wo,Ko,hr,pr,hn,pn,dr,cr,ur,fr,mr,gr,yr,kr,br,vr,xr,wr],r=[Cr,Sr,Mr,Tr,Er,Nr,Ar,Br,Ne,hn,pn,mn,Or,Dr,Ir,gn,Pe,Rr,yn,$r],i=Ee(),o=E(i,yn);F(o,r,o),F(o,n.domain,o);const s=Ee(),l=Ee(),c=Ee();F(i,n.domain,s),F(i,n.scheme,l),F(i,n.slashscheme,c),F(s,r,o),F(s,n.domain,s);const d=E(s,_e);E(o,_e,d),E(l,_e,d),E(c,_e,d);const u=E(o,ze);F(u,r,o),F(u,n.domain,o);const f=Ee();F(d,n.domain,f),F(f,n.domain,f);const h=E(f,ze);F(h,n.domain,f);const p=Ee(ml);F(h,n.tld,p),F(h,n.utld,p),E(d,Tn,p);const m=E(f,Ne);E(m,Ne,m),F(m,n.domain,f),F(p,n.domain,f),E(p,ze,h),E(p,Ne,m);const g=E(p,rt);F(g,n.numeric,ml);const y=E(s,Ne),k=E(s,ze);E(y,Ne,y),F(y,n.domain,s),F(k,r,o),F(k,n.domain,s);const S=Ee(jn);F(k,n.tld,S),F(k,n.utld,S),F(S,n.domain,s),F(S,r,o),E(S,ze,k),E(S,Ne,y),E(S,_e,d);const x=E(S,rt),b=Ee(jn);F(x,n.numeric,b);const v=Ee(jn),C=Ee();F(v,e,v),F(v,t,C),F(C,e,v),F(C,t,C),E(S,Pe,v),E(b,Pe,v);const w=E(l,rt),M=E(c,rt),A=E(M,Pe),$=E(A,Pe);F(l,n.domain,s),E(l,ze,k),E(l,Ne,y),F(c,n.domain,s),E(c,ze,k),E(c,Ne,y),F(w,n.domain,v),E(w,Pe,v),E(w,gn,v),F($,n.domain,v),F($,e,v),E($,Pe,v);const U=[[hn,pn],[cr,dr],[ur,fr],[hr,pr],[mr,gr],[yr,kr],[br,vr],[xr,wr]];for(let j=0;j<U.length;j++){const[K,N]=U[j],D=E(v,K);E(C,K,D),E(D,N,v);const R=Ee(jn);F(D,e,R);const ke=Ee();F(D,t),F(R,e,R),F(R,t,ke),F(ke,e,R),F(ke,t,ke),E(R,N,v),E(ke,N,v)}return E(i,Tn,S),E(i,jo,qk),{start:i,tokens:Rc}}function Kk(n,e,t){let r=t.length,i=0,o=[],s=[];for(;i<r;){let l=n,c=null,d=null,u=0,f=null,h=-1;for(;i<r&&!(c=l.go(t[i].t));)s.push(t[i++]);for(;i<r&&(d=c||l.go(t[i].t));)c=null,l=d,l.accepts()?(h=0,f=l):h>=0&&h++,i++,u++;if(h<0)i-=u,i<r&&(s.push(t[i]),i++);else{s.length>0&&(o.push(Ni(gl,e,s)),s=[]),i-=h,u-=h;const p=f.t,m=t.slice(i-u,i);o.push(Ni(p,e,m))}}return s.length>0&&o.push(Ni(gl,e,s)),o}function Ni(n,e,t){const r=t[0].s,i=t[t.length-1].e,o=e.slice(r,i);return new n(o,t)}const Jk=typeof console<"u"&&console&&console.warn||(()=>{}),Gk="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Q={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Yk(){return Ce.groups={},Q.scanner=null,Q.parser=null,Q.tokenQueue=[],Q.pluginQueue=[],Q.customSchemes=[],Q.initialized=!1,Q}function yl(n,e=!1){if(Q.initialized&&Jk(`linkifyjs: already initialized - will not register custom scheme "${n}" ${Gk}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format.
130
130
  1. Must only contain digits, lowercase ASCII letters or "-"
131
131
  2. Cannot start or end with "-"
132
- 3. "-" cannot repeat`);Q.customSchemes.push([n,e])}function Q0(){Q.scanner=j0(Q.customSchemes);for(let n=0;n<Q.tokenQueue.length;n++)Q.tokenQueue[n][1]({scanner:Q.scanner});Q.parser=W0(Q.scanner.tokens);for(let n=0;n<Q.pluginQueue.length;n++)Q.pluginQueue[n][1]({scanner:Q.scanner,parser:Q.parser});return Q.initialized=!0,Q}function Go(n){return Q.initialized||Q0(),K0(Q.parser.start,n,Lc(Q.scanner.start,n))}Go.scan=Lc;function Pc(n,e=null,t=null){if(e&&typeof e=="object"){if(t)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);t=e,e=null}const r=new Jo(t),i=Go(n),o=[];for(let s=0;s<i.length;s++){const l=i[s];l.isLink&&(!e||l.t===e)&&r.check(l)&&o.push(l.toFormattedObject(r))}return o}var Yo="[\0-   ᠎ -\u2029  ]",X0=new RegExp(Yo),Z0=new RegExp(`${Yo}$`),_0=new RegExp(Yo,"g");function ek(n){return n.length===1?n[0].isLink:n.length===3&&n[1].isLink?["()","[]"].includes(n[0].value+n[2].value):!1}function tk(n){return new Z({key:new oe("autolink"),appendTransaction:(e,t,r)=>{const i=e.some(d=>d.docChanged)&&!t.doc.eq(r.doc),o=e.some(d=>d.getMeta("preventAutolink"));if(!i||o)return;const{tr:s}=r,l=rc(t.doc,[...e]);if(dc(l).forEach(({newRange:d})=>{const u=ty(r.doc,d,p=>p.isTextblock);let f,h;if(u.length>1)f=u[0],h=r.doc.textBetween(f.pos,f.pos+f.node.nodeSize,void 0," ");else if(u.length){const p=r.doc.textBetween(d.from,d.to," "," ");if(!Z0.test(p))return;f=u[0],h=r.doc.textBetween(f.pos,d.to,void 0," ")}if(f&&h){const p=h.split(X0).filter(Boolean);if(p.length<=0)return!1;const m=p[p.length-1],g=f.pos+h.lastIndexOf(m);if(!m)return!1;const y=Go(m).map(k=>k.toObject(n.defaultProtocol));if(!ek(y))return!1;y.filter(k=>k.isLink).map(k=>({...k,from:g+k.start+1,to:g+k.end+1})).filter(k=>r.schema.marks.code?!r.doc.rangeHasMark(k.from,k.to,r.schema.marks.code):!0).filter(k=>n.validate(k.value)).filter(k=>n.shouldAutoLink(k.value)).forEach(k=>{Lo(k.from,k.to,r.doc).some(S=>S.mark.type===n.type)||s.addMark(k.from,k.to,n.type.create({href:k.href}))})}}),!!s.steps.length)return s}})}function nk(n){return new Z({key:new oe("handleClickLink"),props:{handleClick:(e,t,r)=>{var i,o;if(r.button!==0||!e.editable)return!1;let s=!1;if(n.enableClickSelection&&(s=n.editor.commands.extendMarkRange(n.type.name)),n.openOnClick){let l=null;if(r.target instanceof HTMLAnchorElement)l=r.target;else{let f=r.target;const h=[];for(;f.nodeName!=="DIV";)h.push(f),f=f.parentNode;l=h.find(p=>p.nodeName==="A")}if(!l)return s;const c=cc(e.state,n.type.name),d=(i=l?.href)!=null?i:c.href,u=(o=l?.target)!=null?o:c.target;l&&d&&(window.open(d,u),s=!0)}return s}}})}function rk(n){return new Z({key:new oe("handlePasteLink"),props:{handlePaste:(e,t,r)=>{const{shouldAutoLink:i}=n,{state:o}=e,{selection:s}=o,{empty:l}=s;if(l)return!1;let c="";r.content.forEach(u=>{c+=u.textContent});const d=Pc(c,{defaultProtocol:n.defaultProtocol}).find(u=>u.isLink&&u.value===c);return!c||!d||i!==void 0&&!i(d.href)?!1:n.editor.commands.setMark(n.type,{href:d.href})}}})}function mt(n,e){const t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&t.push(i)}),!n||n.replace(_0,"").match(new RegExp(`^(?:(?:${t.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var ik=It.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(n=>{if(typeof n=="string"){yl(n);return}yl(n.scheme,n.optionalSlashes)})},onDestroy(){Y0()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(n,e)=>!!mt(n,e.protocols),validate:n=>!!n,shouldAutoLink:n=>!!n}},addAttributes(){return{href:{default:null,parseHTML(n){return n.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:n=>{const e=n.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!mt(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:n}){return this.options.isAllowedUri(n.href,{defaultValidate:e=>!!mt(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",ie(this.options.HTMLAttributes,n),0]:["a",ie(this.options.HTMLAttributes,{...n,href:""}),0]},markdownTokenName:"link",parseMarkdown:(n,e)=>e.applyMark("link",e.parseInline(n.tokens||[]),{href:n.href,title:n.title||null}),renderMarkdown:(n,e)=>{var t;const r=((t=n.attrs)==null?void 0:t.href)||"";return`[${e.renderChildren(n)}](${r})`},addCommands(){return{setLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!mt(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,n).setMeta("preventAutolink",!0).run():!1},toggleLink:n=>({chain:e})=>{const{href:t}=n||{};return t&&!this.options.isAllowedUri(t,{defaultValidate:r=>!!mt(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Bt({find:n=>{const e=[];if(n){const{protocols:t,defaultProtocol:r}=this.options,i=Pc(n).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:s=>!!mt(s,t),protocols:t,defaultProtocol:r}));i.length&&i.forEach(o=>{this.options.shouldAutoLink(o.value)&&e.push({text:o.value,data:{href:o.href},index:o.start})})}return e},type:this.type,getAttributes:n=>{var e;return{href:(e=n.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const n=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&n.push(tk({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!mt(i,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),n.push(nk({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&n.push(rk({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),n}}),ok=Object.defineProperty,sk=(n,e)=>{for(var t in e)ok(n,t,{get:e[t],enumerable:!0})},lk="listItem",kl="textStyle",bl=/^\s*([-+*])\s$/,Vc=Te.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:n}){return["ul",ie(this.options.HTMLAttributes,n),0]},markdownTokenName:"list",parseMarkdown:(n,e)=>n.type!=="list"||n.ordered?[]:{type:"bulletList",content:n.items?e.parseChildren(n.items):[]},renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,`
133
- `):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(lk,this.editor.getAttributes(kl)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let n=Zt({find:bl,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(n=Zt({find:bl,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(kl),editor:this.editor})),[n]}}),Fc=Te.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",ie(this.options.HTMLAttributes,n),0]},markdownTokenName:"list_item",parseMarkdown:(n,e)=>{if(n.type!=="list_item")return[];let t=[];if(n.tokens&&n.tokens.length>0)if(n.tokens.some(i=>i.type==="paragraph"))t=e.parseChildren(n.tokens);else{const i=n.tokens[0];if(i&&i.type==="text"&&i.tokens&&i.tokens.length>0){if(t=[{type:"paragraph",content:e.parseInline(i.tokens)}],n.tokens.length>1){const s=n.tokens.slice(1),l=e.parseChildren(s);t.push(...l)}}else t=e.parseChildren(n.tokens)}return t.length===0&&(t=[{type:"paragraph",content:[]}]),{type:"listItem",content:t}},renderMarkdown:(n,e,t)=>Fo(n,e,r=>r.parentType==="bulletList"?"- ":r.parentType==="orderedList"?`${r.index+1}. `:"- ",t),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),ak={};sk(ak,{findListItemPos:()=>On,getNextListDepth:()=>Qo,handleBackspace:()=>lo,handleDelete:()=>ao,hasListBefore:()=>Hc,hasListItemAfter:()=>ck,hasListItemBefore:()=>jc,listItemHasSubList:()=>Uc,nextListIsDeeper:()=>qc,nextListIsHigher:()=>Wc});var On=(n,e)=>{const{$from:t}=e.selection,r=re(n,e.schema);let i=null,o=t.depth,s=t.pos,l=null;for(;o>0&&l===null;)i=t.node(o),i.type===r?l=o:(o-=1,s-=1);return l===null?null:{$pos:e.doc.resolve(s),depth:l}},Qo=(n,e)=>{const t=On(n,e);if(!t)return!1;const[,r]=uy(e,n,t.$pos.pos+4);return r},Hc=(n,e,t)=>{const{$anchor:r}=n.selection,i=Math.max(0,r.pos-2),o=n.doc.resolve(i).node();return!(!o||!t.includes(o.type.name))},jc=(n,e)=>{var t;const{$anchor:r}=e.selection,i=e.doc.resolve(r.pos-2);return!(i.index()===0||((t=i.nodeBefore)==null?void 0:t.type.name)!==n)},Uc=(n,e,t)=>{if(!t)return!1;const r=re(n,e.schema);let i=!1;return t.descendants(o=>{o.type===r&&(i=!0)}),i},lo=(n,e,t)=>{if(n.commands.undoInputRule())return!0;if(n.state.selection.from!==n.state.selection.to)return!1;if(!ft(n.state,e)&&Hc(n.state,e,t)){const{$anchor:l}=n.state.selection,c=n.state.doc.resolve(l.before()-1),d=[];c.node().descendants((h,p)=>{h.type.name===e&&d.push({node:h,pos:p})});const u=d.at(-1);if(!u)return!1;const f=n.state.doc.resolve(c.start()+u.pos+1);return n.chain().cut({from:l.start()-1,to:l.end()+1},f.end()).joinForward().run()}if(!ft(n.state,e)||!my(n.state))return!1;const r=On(e,n.state);if(!r)return!1;const o=n.state.doc.resolve(r.$pos.pos-2).node(r.depth),s=Uc(e,n.state,o);return jc(e,n.state)&&!s?n.commands.joinItemBackward():n.chain().liftListItem(e).run()},qc=(n,e)=>{const t=Qo(n,e),r=On(n,e);return!r||!t?!1:t>r.depth},Wc=(n,e)=>{const t=Qo(n,e),r=On(n,e);return!r||!t?!1:t<r.depth},ao=(n,e)=>{if(!ft(n.state,e)||!py(n.state,e))return!1;const{selection:t}=n.state,{$from:r,$to:i}=t;return!t.empty&&r.sameParent(i)?!1:qc(e,n.state)?n.chain().focus(n.state.selection.from+4).lift(e).joinBackward().run():Wc(e,n.state)?n.chain().joinForward().joinBackward().run():n.commands.joinItemForward()},ck=(n,e)=>{var t;const{$anchor:r}=e.selection,i=e.doc.resolve(r.pos-r.parentOffset-2);return!(i.index()===i.parent.childCount-1||((t=i.nodeAfter)==null?void 0:t.type.name)!==n)},Kc=te.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{n.state.schema.nodes[t]!==void 0&&ao(n,t)&&(e=!0)}),e},"Mod-Delete":({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{n.state.schema.nodes[t]!==void 0&&ao(n,t)&&(e=!0)}),e},Backspace:({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:r})=>{n.state.schema.nodes[t]!==void 0&&lo(n,t,r)&&(e=!0)}),e},"Mod-Backspace":({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:r})=>{n.state.schema.nodes[t]!==void 0&&lo(n,t,r)&&(e=!0)}),e}}}}),vl=/^(\s*)(\d+)\.\s+(.*)$/,dk=/^\s/;function uk(n){const e=[];let t=0,r=0;for(;t<n.length;){const i=n[t],o=i.match(vl);if(!o)break;const[,s,l,c]=o,d=s.length;let u=c,f=t+1;const h=[i];for(;f<n.length;){const p=n[f];if(p.match(vl))break;if(p.trim()==="")h.push(p),u+=`
134
- `,f+=1;else if(p.match(dk))h.push(p),u+=`
132
+ 3. "-" cannot repeat`);Q.customSchemes.push([n,e])}function Qk(){Q.scanner=jk(Q.customSchemes);for(let n=0;n<Q.tokenQueue.length;n++)Q.tokenQueue[n][1]({scanner:Q.scanner});Q.parser=Wk(Q.scanner.tokens);for(let n=0;n<Q.pluginQueue.length;n++)Q.pluginQueue[n][1]({scanner:Q.scanner,parser:Q.parser});return Q.initialized=!0,Q}function Go(n){return Q.initialized||Qk(),Kk(Q.parser.start,n,Lc(Q.scanner.start,n))}Go.scan=Lc;function Pc(n,e=null,t=null){if(e&&typeof e=="object"){if(t)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);t=e,e=null}const r=new Jo(t),i=Go(n),o=[];for(let s=0;s<i.length;s++){const l=i[s];l.isLink&&(!e||l.t===e)&&r.check(l)&&o.push(l.toFormattedObject(r))}return o}var Yo="[\0-   ᠎ -\u2029  ]",Xk=new RegExp(Yo),Zk=new RegExp(`${Yo}$`),_k=new RegExp(Yo,"g");function e0(n){return n.length===1?n[0].isLink:n.length===3&&n[1].isLink?["()","[]"].includes(n[0].value+n[2].value):!1}function t0(n){return new Z({key:new oe("autolink"),appendTransaction:(e,t,r)=>{const i=e.some(d=>d.docChanged)&&!t.doc.eq(r.doc),o=e.some(d=>d.getMeta("preventAutolink"));if(!i||o)return;const{tr:s}=r,l=rc(t.doc,[...e]);if(dc(l).forEach(({newRange:d})=>{const u=ty(r.doc,d,p=>p.isTextblock);let f,h;if(u.length>1)f=u[0],h=r.doc.textBetween(f.pos,f.pos+f.node.nodeSize,void 0," ");else if(u.length){const p=r.doc.textBetween(d.from,d.to," "," ");if(!Zk.test(p))return;f=u[0],h=r.doc.textBetween(f.pos,d.to,void 0," ")}if(f&&h){const p=h.split(Xk).filter(Boolean);if(p.length<=0)return!1;const m=p[p.length-1],g=f.pos+h.lastIndexOf(m);if(!m)return!1;const y=Go(m).map(k=>k.toObject(n.defaultProtocol));if(!e0(y))return!1;y.filter(k=>k.isLink).map(k=>({...k,from:g+k.start+1,to:g+k.end+1})).filter(k=>r.schema.marks.code?!r.doc.rangeHasMark(k.from,k.to,r.schema.marks.code):!0).filter(k=>n.validate(k.value)).filter(k=>n.shouldAutoLink(k.value)).forEach(k=>{Lo(k.from,k.to,r.doc).some(S=>S.mark.type===n.type)||s.addMark(k.from,k.to,n.type.create({href:k.href}))})}}),!!s.steps.length)return s}})}function n0(n){return new Z({key:new oe("handleClickLink"),props:{handleClick:(e,t,r)=>{var i,o;if(r.button!==0||!e.editable)return!1;let s=!1;if(n.enableClickSelection&&(s=n.editor.commands.extendMarkRange(n.type.name)),n.openOnClick){let l=null;if(r.target instanceof HTMLAnchorElement)l=r.target;else{let f=r.target;const h=[];for(;f.nodeName!=="DIV";)h.push(f),f=f.parentNode;l=h.find(p=>p.nodeName==="A")}if(!l)return s;const c=cc(e.state,n.type.name),d=(i=l?.href)!=null?i:c.href,u=(o=l?.target)!=null?o:c.target;l&&d&&(window.open(d,u),s=!0)}return s}}})}function r0(n){return new Z({key:new oe("handlePasteLink"),props:{handlePaste:(e,t,r)=>{const{shouldAutoLink:i}=n,{state:o}=e,{selection:s}=o,{empty:l}=s;if(l)return!1;let c="";r.content.forEach(u=>{c+=u.textContent});const d=Pc(c,{defaultProtocol:n.defaultProtocol}).find(u=>u.isLink&&u.value===c);return!c||!d||i!==void 0&&!i(d.href)?!1:n.editor.commands.setMark(n.type,{href:d.href})}}})}function mt(n,e){const t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&t.push(i)}),!n||n.replace(_k,"").match(new RegExp(`^(?:(?:${t.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var i0=It.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(n=>{if(typeof n=="string"){yl(n);return}yl(n.scheme,n.optionalSlashes)})},onDestroy(){Yk()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(n,e)=>!!mt(n,e.protocols),validate:n=>!!n,shouldAutoLink:n=>!!n}},addAttributes(){return{href:{default:null,parseHTML(n){return n.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:n=>{const e=n.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!mt(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:n}){return this.options.isAllowedUri(n.href,{defaultValidate:e=>!!mt(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",ie(this.options.HTMLAttributes,n),0]:["a",ie(this.options.HTMLAttributes,{...n,href:""}),0]},markdownTokenName:"link",parseMarkdown:(n,e)=>e.applyMark("link",e.parseInline(n.tokens||[]),{href:n.href,title:n.title||null}),renderMarkdown:(n,e)=>{var t;const r=((t=n.attrs)==null?void 0:t.href)||"";return`[${e.renderChildren(n)}](${r})`},addCommands(){return{setLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!mt(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,n).setMeta("preventAutolink",!0).run():!1},toggleLink:n=>({chain:e})=>{const{href:t}=n||{};return t&&!this.options.isAllowedUri(t,{defaultValidate:r=>!!mt(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Bt({find:n=>{const e=[];if(n){const{protocols:t,defaultProtocol:r}=this.options,i=Pc(n).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:s=>!!mt(s,t),protocols:t,defaultProtocol:r}));i.length&&i.forEach(o=>{this.options.shouldAutoLink(o.value)&&e.push({text:o.value,data:{href:o.href},index:o.start})})}return e},type:this.type,getAttributes:n=>{var e;return{href:(e=n.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const n=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&n.push(t0({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!mt(i,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),n.push(n0({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&n.push(r0({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),n}}),o0=Object.defineProperty,s0=(n,e)=>{for(var t in e)o0(n,t,{get:e[t],enumerable:!0})},l0="listItem",kl="textStyle",bl=/^\s*([-+*])\s$/,Vc=Te.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:n}){return["ul",ie(this.options.HTMLAttributes,n),0]},markdownTokenName:"list",parseMarkdown:(n,e)=>n.type!=="list"||n.ordered?[]:{type:"bulletList",content:n.items?e.parseChildren(n.items):[]},renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,`
133
+ `):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(l0,this.editor.getAttributes(kl)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let n=Zt({find:bl,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(n=Zt({find:bl,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(kl),editor:this.editor})),[n]}}),Fc=Te.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",ie(this.options.HTMLAttributes,n),0]},markdownTokenName:"list_item",parseMarkdown:(n,e)=>{if(n.type!=="list_item")return[];let t=[];if(n.tokens&&n.tokens.length>0)if(n.tokens.some(i=>i.type==="paragraph"))t=e.parseChildren(n.tokens);else{const i=n.tokens[0];if(i&&i.type==="text"&&i.tokens&&i.tokens.length>0){if(t=[{type:"paragraph",content:e.parseInline(i.tokens)}],n.tokens.length>1){const s=n.tokens.slice(1),l=e.parseChildren(s);t.push(...l)}}else t=e.parseChildren(n.tokens)}return t.length===0&&(t=[{type:"paragraph",content:[]}]),{type:"listItem",content:t}},renderMarkdown:(n,e,t)=>Fo(n,e,r=>r.parentType==="bulletList"?"- ":r.parentType==="orderedList"?`${r.index+1}. `:"- ",t),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),a0={};s0(a0,{findListItemPos:()=>On,getNextListDepth:()=>Qo,handleBackspace:()=>lo,handleDelete:()=>ao,hasListBefore:()=>Hc,hasListItemAfter:()=>c0,hasListItemBefore:()=>jc,listItemHasSubList:()=>Uc,nextListIsDeeper:()=>qc,nextListIsHigher:()=>Wc});var On=(n,e)=>{const{$from:t}=e.selection,r=re(n,e.schema);let i=null,o=t.depth,s=t.pos,l=null;for(;o>0&&l===null;)i=t.node(o),i.type===r?l=o:(o-=1,s-=1);return l===null?null:{$pos:e.doc.resolve(s),depth:l}},Qo=(n,e)=>{const t=On(n,e);if(!t)return!1;const[,r]=uy(e,n,t.$pos.pos+4);return r},Hc=(n,e,t)=>{const{$anchor:r}=n.selection,i=Math.max(0,r.pos-2),o=n.doc.resolve(i).node();return!(!o||!t.includes(o.type.name))},jc=(n,e)=>{var t;const{$anchor:r}=e.selection,i=e.doc.resolve(r.pos-2);return!(i.index()===0||((t=i.nodeBefore)==null?void 0:t.type.name)!==n)},Uc=(n,e,t)=>{if(!t)return!1;const r=re(n,e.schema);let i=!1;return t.descendants(o=>{o.type===r&&(i=!0)}),i},lo=(n,e,t)=>{if(n.commands.undoInputRule())return!0;if(n.state.selection.from!==n.state.selection.to)return!1;if(!ft(n.state,e)&&Hc(n.state,e,t)){const{$anchor:l}=n.state.selection,c=n.state.doc.resolve(l.before()-1),d=[];c.node().descendants((h,p)=>{h.type.name===e&&d.push({node:h,pos:p})});const u=d.at(-1);if(!u)return!1;const f=n.state.doc.resolve(c.start()+u.pos+1);return n.chain().cut({from:l.start()-1,to:l.end()+1},f.end()).joinForward().run()}if(!ft(n.state,e)||!my(n.state))return!1;const r=On(e,n.state);if(!r)return!1;const o=n.state.doc.resolve(r.$pos.pos-2).node(r.depth),s=Uc(e,n.state,o);return jc(e,n.state)&&!s?n.commands.joinItemBackward():n.chain().liftListItem(e).run()},qc=(n,e)=>{const t=Qo(n,e),r=On(n,e);return!r||!t?!1:t>r.depth},Wc=(n,e)=>{const t=Qo(n,e),r=On(n,e);return!r||!t?!1:t<r.depth},ao=(n,e)=>{if(!ft(n.state,e)||!py(n.state,e))return!1;const{selection:t}=n.state,{$from:r,$to:i}=t;return!t.empty&&r.sameParent(i)?!1:qc(e,n.state)?n.chain().focus(n.state.selection.from+4).lift(e).joinBackward().run():Wc(e,n.state)?n.chain().joinForward().joinBackward().run():n.commands.joinItemForward()},c0=(n,e)=>{var t;const{$anchor:r}=e.selection,i=e.doc.resolve(r.pos-r.parentOffset-2);return!(i.index()===i.parent.childCount-1||((t=i.nodeAfter)==null?void 0:t.type.name)!==n)},Kc=te.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{n.state.schema.nodes[t]!==void 0&&ao(n,t)&&(e=!0)}),e},"Mod-Delete":({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{n.state.schema.nodes[t]!==void 0&&ao(n,t)&&(e=!0)}),e},Backspace:({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:r})=>{n.state.schema.nodes[t]!==void 0&&lo(n,t,r)&&(e=!0)}),e},"Mod-Backspace":({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:r})=>{n.state.schema.nodes[t]!==void 0&&lo(n,t,r)&&(e=!0)}),e}}}}),vl=/^(\s*)(\d+)\.\s+(.*)$/,d0=/^\s/;function u0(n){const e=[];let t=0,r=0;for(;t<n.length;){const i=n[t],o=i.match(vl);if(!o)break;const[,s,l,c]=o,d=s.length;let u=c,f=t+1;const h=[i];for(;f<n.length;){const p=n[f];if(p.match(vl))break;if(p.trim()==="")h.push(p),u+=`
134
+ `,f+=1;else if(p.match(d0))h.push(p),u+=`
135
135
  ${p.slice(d+2)}`,f+=1;else break}e.push({indent:d,number:parseInt(l,10),content:u.trim(),raw:h.join(`
136
136
  `)}),r=f,t=f}return[e,r]}function Jc(n,e,t){var r;const i=[];let o=0;for(;o<n.length;){const s=n[o];if(s.indent===e){const l=s.content.split(`
137
137
  `),c=((r=l[0])==null?void 0:r.trim())||"",d=[];c&&d.push({type:"paragraph",raw:c,tokens:t.inlineTokens(c)});const u=l.slice(1).join(`
138
138
  `).trim();if(u){const p=t.blockTokens(u);d.push(...p)}let f=o+1;const h=[];for(;f<n.length&&n[f].indent>e;)h.push(n[f]),f+=1;if(h.length>0){const p=Math.min(...h.map(g=>g.indent)),m=Jc(h,p,t);d.push({type:"list",ordered:!0,start:h[0].number,items:m,raw:h.map(g=>g.raw).join(`
139
- `)})}i.push({type:"list_item",raw:s.raw,tokens:d}),o=f}else o+=1}return i}function fk(n,e){return n.map(t=>{if(t.type!=="list_item")return e.parseChildren([t])[0];const r=[];return t.tokens&&t.tokens.length>0&&t.tokens.forEach(i=>{if(i.type==="paragraph"||i.type==="list"||i.type==="blockquote"||i.type==="code")r.push(...e.parseChildren([i]));else if(i.type==="text"&&i.tokens){const o=e.parseChildren([i]);r.push({type:"paragraph",content:o})}else{const o=e.parseChildren([i]);o.length>0&&r.push(...o)}}),{type:"listItem",content:r}})}var hk="listItem",xl="textStyle",wl=/^(\d+)\.\s$/,Gc=Te.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1},type:{default:null,parseHTML:n=>n.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:e,...t}=n;return e===1?["ol",ie(this.options.HTMLAttributes,t),0]:["ol",ie(this.options.HTMLAttributes,n),0]},markdownTokenName:"list",parseMarkdown:(n,e)=>{if(n.type!=="list"||!n.ordered)return[];const t=n.start||1,r=n.items?fk(n.items,e):[];return t!==1?{type:"orderedList",attrs:{start:t},content:r}:{type:"orderedList",content:r}},renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,`
139
+ `)})}i.push({type:"list_item",raw:s.raw,tokens:d}),o=f}else o+=1}return i}function f0(n,e){return n.map(t=>{if(t.type!=="list_item")return e.parseChildren([t])[0];const r=[];return t.tokens&&t.tokens.length>0&&t.tokens.forEach(i=>{if(i.type==="paragraph"||i.type==="list"||i.type==="blockquote"||i.type==="code")r.push(...e.parseChildren([i]));else if(i.type==="text"&&i.tokens){const o=e.parseChildren([i]);r.push({type:"paragraph",content:o})}else{const o=e.parseChildren([i]);o.length>0&&r.push(...o)}}),{type:"listItem",content:r}})}var h0="listItem",xl="textStyle",wl=/^(\d+)\.\s$/,Gc=Te.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1},type:{default:null,parseHTML:n=>n.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:e,...t}=n;return e===1?["ol",ie(this.options.HTMLAttributes,t),0]:["ol",ie(this.options.HTMLAttributes,n),0]},markdownTokenName:"list",parseMarkdown:(n,e)=>{if(n.type!=="list"||!n.ordered)return[];const t=n.start||1,r=n.items?f0(n.items,e):[];return t!==1?{type:"orderedList",attrs:{start:t},content:r}:{type:"orderedList",content:r}},renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,`
140
140
  `):"",markdownTokenizer:{name:"orderedList",level:"block",start:n=>{const e=n.match(/^(\s*)(\d+)\.\s+/),t=e?.index;return t!==void 0?t:-1},tokenize:(n,e,t)=>{var r;const i=n.split(`
141
- `),[o,s]=uk(i);if(o.length===0)return;const l=Jc(o,0,t);return l.length===0?void 0:{type:"list",ordered:!0,start:((r=o[0])==null?void 0:r.number)||1,items:l,raw:i.slice(0,s).join(`
142
- `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(hk,this.editor.getAttributes(xl)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=Zt({find:wl,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=Zt({find:wl,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(xl)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[n]}}),pk=/^\s*(\[([( |x])?\])\s$/,mk=Te.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:n=>{const e=n.getAttribute("data-checked");return e===""||e==="true"},renderHTML:n=>({"data-checked":n.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:n,HTMLAttributes:e}){return["li",ie(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:n.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(n,e)=>{const t=[];if(n.tokens&&n.tokens.length>0?t.push(e.createNode("paragraph",{},e.parseInline(n.tokens))):n.text?t.push(e.createNode("paragraph",{},[e.createNode("text",{text:n.text})])):t.push(e.createNode("paragraph",{},[])),n.nestedTokens&&n.nestedTokens.length>0){const r=e.parseChildren(n.nestedTokens);t.push(...r)}return e.createNode("taskItem",{checked:n.checked||!1},t)},renderMarkdown:(n,e)=>{var t;const i=`- [${(t=n.attrs)!=null&&t.checked?"x":" "}] `;return Fo(n,e,i)},addKeyboardShortcuts(){const n={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...n,Tab:()=>this.editor.commands.sinkListItem(this.name)}:n},addNodeView(){return({node:n,HTMLAttributes:e,getPos:t,editor:r})=>{const i=document.createElement("li"),o=document.createElement("label"),s=document.createElement("span"),l=document.createElement("input"),c=document.createElement("div"),d=u=>{var f,h;l.ariaLabel=((h=(f=this.options.a11y)==null?void 0:f.checkboxLabel)==null?void 0:h.call(f,u,l.checked))||`Task item checkbox for ${u.textContent||"empty task item"}`};return d(n),o.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",u=>u.preventDefault()),l.addEventListener("change",u=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:f}=u.target;r.isEditable&&typeof t=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:h})=>{const p=t();if(typeof p!="number")return!1;const m=h.doc.nodeAt(p);return h.setNodeMarkup(p,void 0,{...m?.attrs,checked:f}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(n,f)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([u,f])=>{i.setAttribute(u,f)}),i.dataset.checked=n.attrs.checked,l.checked=n.attrs.checked,o.append(l,s),i.append(o,c),Object.entries(e).forEach(([u,f])=>{i.setAttribute(u,f)}),{dom:i,contentDOM:c,update:u=>u.type!==this.type?!1:(i.dataset.checked=u.attrs.checked,l.checked=u.attrs.checked,d(u),!0)}}},addInputRules(){return[Zt({find:pk,type:this.type,getAttributes:n=>({checked:n[n.length-1]==="x"})})]}}),gk=Te.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:n}){return["ul",ie(this.options.HTMLAttributes,n,{"data-type":this.name}),0]},parseMarkdown:(n,e)=>e.createNode("taskList",{},e.parseChildren(n.items||[])),renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,`
143
- `):"",markdownTokenizer:{name:"taskList",level:"block",start(n){var e;const t=(e=n.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return t!==void 0?t:-1},tokenize(n,e,t){const r=o=>{const s=Zi(o,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,c)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:t.inlineTokens(l.mainContent),nestedTokens:c}),customNestedParser:r},t);return s?[{type:"taskList",raw:s.raw,items:s.items}]:t.blockTokens(o)},i=Zi(n,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:o=>({indentLevel:o[1].length,mainContent:o[4],checked:o[3].toLowerCase()==="x"}),createToken:(o,s)=>({type:"taskItem",raw:"",mainContent:o.mainContent,indentLevel:o.indentLevel,checked:o.checked,text:o.mainContent,tokens:t.inlineTokens(o.mainContent),nestedTokens:s}),customNestedParser:r},t);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:n})=>n.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});te.create({name:"listKit",addExtensions(){const n=[];return this.options.bulletList!==!1&&n.push(Vc.configure(this.options.bulletList)),this.options.listItem!==!1&&n.push(Fc.configure(this.options.listItem)),this.options.listKeymap!==!1&&n.push(Kc.configure(this.options.listKeymap)),this.options.orderedList!==!1&&n.push(Gc.configure(this.options.orderedList)),this.options.taskItem!==!1&&n.push(mk.configure(this.options.taskItem)),this.options.taskList!==!1&&n.push(gk.configure(this.options.taskList)),n}});var yk=Te.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",ie(this.options.HTMLAttributes,n),0]},parseMarkdown:(n,e)=>{const t=n.tokens||[];return t.length===1&&t[0].type==="image"?e.parseChildren([t[0]]):e.createNode("paragraph",void 0,e.parseInline(t))},renderMarkdown:(n,e)=>!n||!Array.isArray(n.content)?"":e.renderChildren(n.content),addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),kk=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,bk=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,vk=It.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",ie(this.options.HTMLAttributes,n),0]},markdownTokenName:"del",parseMarkdown:(n,e)=>e.applyMark("strike",e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>`~~${e.renderChildren(n)}~~`,addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Xt({find:kk,type:this.type})]},addPasteRules(){return[Bt({find:bk,type:this.type})]}}),xk=Te.create({name:"text",group:"inline",parseMarkdown:n=>({type:"text",text:n.text||""}),renderMarkdown:n=>n.text||""}),Yc=It.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["u",ie(this.options.HTMLAttributes,n),0]},parseMarkdown(n,e){return e.applyMark(this.name||"underline",e.parseInline(n.tokens||[]))},renderMarkdown(n,e){return`++${e.renderChildren(n)}++`},markdownTokenizer:{name:"underline",level:"inline",start(n){return n.indexOf("++")},tokenize(n,e,t){const i=/^(\+\+)([\s\S]+?)(\+\+)/.exec(n);if(!i)return;const o=i[2].trim();return{type:"underline",raw:i[0],text:o,tokens:t.inlineTokens(o)}}},addCommands(){return{setUnderline:()=>({commands:n})=>n.setMark(this.name),toggleUnderline:()=>({commands:n})=>n.toggleMark(this.name),unsetUnderline:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),wk=Yc;function Ck(n={}){return new Z({view(e){return new Sk(e,n)}})}class Sk{constructor(e,t){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=t.width)!==null&&r!==void 0?r:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,r,i=this.editorView.dom,o=i.getBoundingClientRect(),s=o.width/i.offsetWidth,l=o.height/i.offsetHeight;if(t){let f=e.nodeBefore,h=e.nodeAfter;if(f||h){let p=this.editorView.nodeDOM(this.cursorPos-(f?f.nodeSize:0));if(p){let m=p.getBoundingClientRect(),g=f?m.bottom:m.top;f&&h&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let y=this.width/2*l;r={left:m.left,right:m.right,top:g-y,bottom:g+y}}}}if(!r){let f=this.editorView.coordsAtPos(this.cursorPos),h=this.width/2*s;r={left:f.left-h,right:f.left+h,top:f.top,bottom:f.bottom}}let c=this.editorView.dom.offsetParent;this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let d,u;if(!c||c==document.body&&getComputedStyle(c).position=="static")d=-pageXOffset,u=-pageYOffset;else{let f=c.getBoundingClientRect(),h=f.width/c.offsetWidth,p=f.height/c.offsetHeight;d=f.left-c.scrollLeft*h,u=f.top-c.scrollTop*p}this.element.style.left=(r.left-d)/s+"px",this.element.style.top=(r.top-u)/l+"px",this.element.style.width=(r.right-r.left)/s+"px",this.element.style.height=(r.bottom-r.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,t,e):i;if(t&&!o){let s=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=ea(this.editorView.state.doc,s,this.editorView.dragging.slice);l!=null&&(s=l)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class ee extends H{constructor(e){super(e,e)}map(e,t){let r=e.resolve(t.map(this.head));return ee.valid(r)?new ee(r):H.near(r)}content(){return B.empty}eq(e){return e instanceof ee&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new ee(e.resolve(t.pos))}getBookmark(){return new Xo(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!Mk(e)||!Tk(e))return!1;let r=t.type.spec.allowGapCursor;if(r!=null)return r;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,r=!1){e:for(;;){if(!r&&ee.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let l=e.node(s);if(t>0?e.indexAfter(s)<l.childCount:e.index(s)>0){o=l.child(t>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=t;let c=e.doc.resolve(i);if(ee.valid(c))return c}for(;;){let s=t>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!P.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*t),r=!1;continue e}break}o=s,i+=t;let l=e.doc.resolve(i);if(ee.valid(l))return l}return null}}}ee.prototype.visible=!1;ee.findFrom=ee.findGapCursorFrom;H.jsonID("gapcursor",ee);class Xo{constructor(e){this.pos=e}map(e){return new Xo(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return ee.valid(t)?new ee(t):H.near(t)}}function Qc(n){return n.isAtom||n.spec.isolating||n.spec.createGapCursor}function Mk(n){for(let e=n.depth;e>=0;e--){let t=n.index(e),r=n.node(e);if(t==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||Qc(i.type))return!0;if(i.inlineContent)return!1}}return!0}function Tk(n){for(let e=n.depth;e>=0;e--){let t=n.indexAfter(e),r=n.node(e);if(t==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||Qc(i.type))return!0;if(i.inlineContent)return!1}}return!0}function Ek(){return new Z({props:{decorations:Ok,createSelectionBetween(n,e,t){return e.pos==t.pos&&ee.valid(t)?new ee(t):null},handleClick:Ak,handleKeyDown:Nk,handleDOMEvents:{beforeinput:Bk}}})}const Nk=Ya({ArrowLeft:Un("horiz",-1),ArrowRight:Un("horiz",1),ArrowUp:Un("vert",-1),ArrowDown:Un("vert",1)});function Un(n,e){const t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,l=e>0?s.$to:s.$from,c=s.empty;if(s instanceof V){if(!o.endOfTextblock(t)||l.depth==0)return!1;c=!1,l=r.doc.resolve(e>0?l.after():l.before())}let d=ee.findGapCursorFrom(l,e,c);return d?(i&&i(r.tr.setSelection(new ee(d))),!0):!1}}function Ak(n,e,t){if(!n||!n.editable)return!1;let r=n.state.doc.resolve(e);if(!ee.valid(r))return!1;let i=n.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&P.isSelectable(n.state.doc.nodeAt(i.inside))?!1:(n.dispatch(n.state.tr.setSelection(new ee(r))),!0)}function Bk(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof ee))return!1;let{$from:t}=n.state.selection,r=t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);if(!r)return!1;let i=T.empty;for(let s=r.length-1;s>=0;s--)i=T.from(r[s].createAndFill(null,i));let o=n.state.tr.replace(t.pos,t.pos,new B(i,0,0));return o.setSelection(V.near(o.doc.resolve(t.pos+1))),n.dispatch(o),!1}function Ok(n){if(!(n.selection instanceof ee))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",X.create(n.doc,[be.widget(n.selection.head,e,{key:"gapcursor"})])}var Lr=200,pe=function(){};pe.prototype.append=function(e){return e.length?(e=pe.from(e),!this.length&&e||e.length<Lr&&this.leafAppend(e)||this.length<Lr&&e.leafPrepend(this)||this.appendInner(e)):this};pe.prototype.prepend=function(e){return e.length?pe.from(e).append(this):this};pe.prototype.appendInner=function(e){return new Dk(this,e)};pe.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?pe.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};pe.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};pe.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)};pe.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},t,r),i};pe.from=function(e){return e instanceof pe?e:e&&e.length?new Xc(e):pe.empty};var Xc=(function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={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,l){for(var c=o;c<s;c++)if(i(this.values[c],l+c)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,s,l){for(var c=o-1;c>=s;c--)if(i(this.values[c],l+c)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Lr)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Lr)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e})(pe);pe.empty=new Xc([]);var Dk=(function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.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 l=this.left.length;if(i<l&&this.left.forEachInner(r,i,Math.min(o,l),s)===!1||o>l&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,o)-l,s+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(o,l)-l,s+l)===!1||o<l&&this.left.forEachInvertedInner(r,Math.min(i,l),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})(pe);const Zc=pe,Ik=500;class Ie{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){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;t&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,l,c,d=[],u=[];return this.items.forEach((f,h)=>{if(!f.step){i||(i=this.remapping(r,h+1),o=i.maps.length),o--,u.push(f);return}if(i){u.push(new Ve(f.map));let p=f.step.map(i.slice(o)),m;p&&s.maybeStep(p).doc&&(m=s.mapping.maps[s.mapping.maps.length-1],d.push(new Ve(m,void 0,void 0,d.length+u.length))),o--,m&&i.appendMap(m,o)}else s.maybeStep(f.step);if(f.selection)return l=i?f.selection.map(i.slice(o)):f.selection,c=new Ie(this.items.slice(0,r).append(u.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:s,selection:l}}addTransform(e,t,r,i){let o=[],s=this.eventCount,l=this.items,c=!i&&l.length?l.get(l.length-1):null;for(let u=0;u<e.steps.length;u++){let f=e.steps[u].invert(e.docs[u]),h=new Ve(e.mapping.maps[u],f,t),p;(p=c&&c.merge(h))&&(h=p,u?o.pop():l=l.slice(0,l.length-1)),o.push(h),t&&(s++,t=void 0),i||(c=h)}let d=s-r.depth;return d>Rk&&(l=$k(l,d),s-=d),new Ie(l.append(o),s)}remapping(e,t){let r=new vn;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,t),r}addMaps(e){return this.eventCount==0?this:new Ie(this.items.append(e.map(t=>new Ve(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,s=e.steps.length,l=this.eventCount;this.items.forEach(h=>{h.selection&&l--},i);let c=t;this.items.forEach(h=>{let p=o.getMirror(--c);if(p==null)return;s=Math.min(s,p);let m=o.maps[p];if(h.step){let g=e.steps[p].invert(e.docs[p]),y=h.selection&&h.selection.map(o.slice(c+1,p));y&&l++,r.push(new Ve(m,g,y))}else r.push(new Ve(m))},i);let d=[];for(let h=t;h<s;h++)d.push(new Ve(o.maps[h]));let u=this.items.slice(0,i).append(d).append(r),f=new Ie(u,l);return f.emptyItemCount()>Ik&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],o=0;return this.items.forEach((s,l)=>{if(l>=e)i.push(s),s.selection&&o++;else if(s.step){let c=s.step.map(t.slice(r)),d=c&&c.getMap();if(r--,d&&t.appendMap(d,r),c){let u=s.selection&&s.selection.map(t.slice(r));u&&o++;let f=new Ve(d.invert(),c,u),h,p=i.length-1;(h=i.length&&i[p].merge(f))?i[p]=h:i.push(f)}}else s.map&&r--},this.items.length,0),new Ie(Zc.from(i.reverse()),o)}}Ie.empty=new Ie(Zc.empty,0);function $k(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class Ve{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new Ve(t.getMap().invert(),t,this.selection)}}}class et{constructor(e,t,r,i,o){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const Rk=20;function Lk(n,e,t,r){let i=t.getMeta(Mt),o;if(i)return i.historyState;t.getMeta(Vk)&&(n=new et(n.done,n.undone,null,0,-1));let s=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(s&&s.getMeta(Mt))return s.getMeta(Mt).redo?new et(n.done.addTransform(t,void 0,r,Gn(e)),n.undone,Cl(t.mapping.maps),n.prevTime,n.prevComposition):new et(n.done,n.undone.addTransform(t,void 0,r,Gn(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let l=t.getMeta("composition"),c=n.prevTime==0||!s&&n.prevComposition!=l&&(n.prevTime<(t.time||0)-r.newGroupDelay||!zk(t,n.prevRanges)),d=s?Ai(n.prevRanges,t.mapping):Cl(t.mapping.maps);return new et(n.done.addTransform(t,c?e.selection.getBookmark():void 0,r,Gn(e)),Ie.empty,d,t.time,l??n.prevComposition)}else return(o=t.getMeta("rebased"))?new et(n.done.rebased(t,o),n.undone.rebased(t,o),Ai(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new et(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),Ai(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function zk(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(t=!0)}),t}function Cl(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((r,i,o,s)=>e.push(o,s));return e}function Ai(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let i=e.map(n[r],1),o=e.map(n[r+1],-1);i<=o&&t.push(i,o)}return t}function Pk(n,e,t){let r=Gn(e),i=Mt.get(e).spec.config,o=(t?n.undone:n.done).popEvent(e,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),l=(t?n.done:n.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),c=new et(t?l:o.remaining,t?o.remaining:l,null,0,-1);return o.transform.setSelection(s).setMeta(Mt,{redo:t,historyState:c})}let Bi=!1,Sl=null;function Gn(n){let e=n.plugins;if(Sl!=e){Bi=!1,Sl=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){Bi=!0;break}}return Bi}const Mt=new oe("history"),Vk=new oe("closeHistory");function Fk(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new Z({key:Mt,state:{init(){return new et(Ie.empty,Ie.empty,null,0,-1)},apply(e,t,r){return Lk(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?ed:r=="historyRedo"?td:null;return!i||!e.editable?!1:(t.preventDefault(),i(e.state,e.dispatch))}}}})}function _c(n,e){return(t,r)=>{let i=Mt.getState(t);if(!i||(n?i.undone:i.done).eventCount==0)return!1;if(r){let o=Pk(i,t,n);o&&r(e?o.scrollIntoView():o)}return!0}}const ed=_c(!1,!0),td=_c(!0,!0);te.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:n=>n.length,wordCounter:n=>n.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=n=>{const e=n?.node||this.editor.state.doc;if((n?.mode||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=n=>{const e=n?.node||this.editor.state.doc,t=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(t)}},addProseMirrorPlugins(){let n=!1;return[new Z({key:new oe("characterCount"),appendTransaction:(e,t,r)=>{if(n)return;const i=this.options.limit;if(i==null||i===0){n=!0;return}const o=this.storage.characters({node:r.doc});if(o>i){const s=o-i,l=0,c=s;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const d=r.tr.deleteRange(l,c);return n=!0,d}n=!0},filterTransaction:(e,t)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const i=this.storage.characters({node:t.doc}),o=this.storage.characters({node:e.doc});if(o<=r||i>r&&o>r&&o<=i)return!0;if(i>r&&o>r&&o>i||!e.getMeta("paste"))return!1;const l=e.selection.$head.pos,c=o-r,d=l-c,u=l;return e.deleteRange(d,u),!(this.storage.characters({node:e.doc})>r)}})]}});var Hk=te.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Ck(this.options)]}});te.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Z({key:new oe("focus"),props:{decorations:({doc:n,selection:e})=>{const{isEditable:t,isFocused:r}=this.editor,{anchor:i}=e,o=[];if(!t||!r)return X.create(n,[]);let s=0;this.options.mode==="deepest"&&n.descendants((c,d)=>{if(c.isText)return;if(!(i>=d&&i<=d+c.nodeSize-1))return!1;s+=1});let l=0;return n.descendants((c,d)=>{if(c.isText||!(i>=d&&i<=d+c.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&s-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";o.push(be.node(d,d+c.nodeSize,{class:this.options.className}))}),X.create(n,o)}}})]}});var jk=te.create({name:"gapCursor",addProseMirrorPlugins(){return[Ek()]},extendNodeSchema(n){var e;const t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=G(z(n,"allowGapCursor",t)))!=null?e:null}}}),Uk=te.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Z({key:new oe("placeholder"),props:{decorations:({doc:n,selection:e})=>{const t=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,i=[];if(!t)return null;const o=this.editor.isEmpty;return n.descendants((s,l)=>{const c=r>=l&&r<=l+s.nodeSize,d=!s.isLeaf&&Zr(s);if((c||!this.options.showOnlyCurrent)&&d){const u=[this.options.emptyNodeClass];o&&u.push(this.options.emptyEditorClass);const f=be.node(l,l+s.nodeSize,{class:u.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:l,hasAnchor:c}):this.options.placeholder});i.push(f)}return this.options.includeChildren}),X.create(n,i)}}})]}});te.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:n,options:e}=this;return[new Z({key:new oe("selection"),props:{decorations(t){return t.selection.empty||n.isFocused||!n.isEditable||uc(t.selection)||n.view.dragging?null:X.create(t.doc,[be.inline(t.selection.from,t.selection.to,{class:e.className})])}}})]}});function Ml({types:n,node:e}){return e&&Array.isArray(n)&&n.includes(e.type)||e?.type===n}var qk=te.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var n;const e=new oe(this.name),t=this.options.node||((n=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:n.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(t).includes(i.name));return[new Z({key:e,appendTransaction:(i,o,s)=>{const{doc:l,tr:c,schema:d}=s,u=e.getState(s),f=l.content.size,h=d.nodes[t];if(u)return c.insert(f,h.create())},state:{init:(i,o)=>{const s=o.tr.doc.lastChild;return!Ml({node:s,types:r})},apply:(i,o)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return o;const s=i.doc.lastChild;return!Ml({node:s,types:r})}}})]}}),Wk=te.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>ed(n,e),redo:()=>({state:n,dispatch:e})=>td(n,e)}},addProseMirrorPlugins(){return[Fk(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Kk=te.create({name:"starterKit",addExtensions(){var n,e,t,r;const i=[];return this.options.bold!==!1&&i.push(k0.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(h0.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(Vc.configure(this.options.bulletList)),this.options.code!==!1&&i.push(x0.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(S0.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(M0.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(Hk.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(jk.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(T0.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(Ac.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(Wk.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(N0.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(I0.configure(this.options.italic)),this.options.listItem!==!1&&i.push(Fc.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(Kc.configure((n=this.options)==null?void 0:n.listKeymap)),this.options.link!==!1&&i.push(ik.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&i.push(Gc.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(yk.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(vk.configure(this.options.strike)),this.options.text!==!1&&i.push(xk.configure(this.options.text)),this.options.underline!==!1&&i.push(Yc.configure((t=this.options)==null?void 0:t.underline)),this.options.trailingNode!==!1&&i.push(qk.configure((r=this.options)==null?void 0:r.trailingNode)),i}}),Jk=Kk,Gk=te.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:n=>{const e=n.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:n=>n.textAlign?{style:`text-align: ${n.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:n=>({commands:e})=>this.options.alignments.includes(n)?this.options.types.map(t=>e.updateAttributes(t,{textAlign:n})).some(t=>t):!1,unsetTextAlign:()=>({commands:n})=>this.options.types.map(e=>n.resetAttributes(e,"textAlign")).some(e=>e),toggleTextAlign:n=>({editor:e,commands:t})=>this.options.alignments.includes(n)?e.isActive({textAlign:n})?t.unsetTextAlign():t.setTextAlign(n):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),Yk=Gk,Qk=Uk;const Xk={class:"input-richtext-toolbar"},Zk={class:"input-richtext-group"},_k={class:"input-richtext-group"},e1={class:"input-richtext-group"},t1={class:"input-richtext-group"},n1={class:"input-richtext-group"},r1={class:"input-richtext-group"},i1={key:0},o1={key:1,class:"input-richtext-dropdown-wrapper"},s1={key:0},l1=["onClick"],a1={class:"input-richtext-dropdown-item-label"},c1={class:"input-richtext-editor-wrapper"},d1=a.defineComponent({__name:"UiInput.RichText",props:{minHeight:{default:"200px"},maxHeight:{default:"400px"},customControls:{default:()=>[]},label:{},helpText:{},modelValue:{},value:{},placeholder:{default:"Start typing..."},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},required:{type:Boolean},fullWidth:{type:Boolean},inputId:{},error:{type:[Boolean,String,Error],default:!1},size:{},tabindex:{}},emits:["update:modelValue","blur","focus"],setup(n,{emit:e}){a.useCssVars(v=>({c4d6a996:v.minHeight,v6f8994c7:v.maxHeight}));const t=n,r=e,i=a.useSlots(),o=a.computed(()=>!!i.default),s=a.ref(null),l=a.ref(typeof t.modelValue=="string"?t.modelValue:"");a.onMounted(()=>{(t.modelValue===void 0||t.modelValue==="")&&o.value&&setTimeout(()=>{if(s.value&&b.value){const v=s.value.innerHTML?.trim()||"";v&&(b.value.commands.setContent(v),l.value=v,r("update:modelValue",v))}},0)});const c=a.ref(null),d=a.ref([]),u=a.ref(),{floatingStyle:f,updatePosition:h,cleanup:p}=Vr({trigger:a.computed(()=>c.value!==null?d.value[c.value]:void 0),floating:u,placement:"bottom-start",offset:4,shift:!0,flip:!0,autoUpdate:!0,clickOutside:{enabled:!0,handler:()=>{g()}}}),m=async v=>{c.value=v,await a.nextTick(),h()},g=()=>{c.value=null},y=v=>{c.value===v?g():m(v)},k=v=>{v.action&&b.value&&v.action(b.value)},S=v=>{b.value&&v.action(b.value),g()},x=(v,C)=>{v&&(d.value[C]=v.$el||v)},b=u0({content:l.value,editable:!t.disabled&&!t.readonly,extensions:[Jk,E0.configure({levels:[1,2,3]}),wk,Yk.configure({types:["heading","paragraph"]}),Qk.configure({placeholder:t.placeholder})],onUpdate:({editor:v})=>{const C=v.getHTML();l.value=C,r("update:modelValue",C)},onFocus:v=>{r("focus",v.event)},onBlur:v=>{r("blur",v.event)}});return a.watch(()=>t.modelValue,v=>{typeof v=="string"&&b.value&&b.value.getHTML()!==v&&(b.value.commands.setContent(v),l.value=v)}),a.watch(()=>t.disabled,v=>{b.value&&b.value.setEditable(!v&&!t.readonly)}),a.watch(()=>t.readonly,v=>{b.value&&b.value.setEditable(!t.disabled&&!v)}),a.onBeforeUnmount(()=>{b.value&&b.value.destroy(),p()}),(v,C)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["input-richtext-container",{"input-error":n.error,"input-disabled":n.disabled}])},[a.createElementVNode("div",Xk,[a.createElementVNode("div",Zk,[a.createVNode(W,{color:a.unref(b)?.isActive("bold")?"primary":"secondary",size:"sm",icon:"",squircle:"",onClick:C[0]||(C[0]=w=>a.unref(b)?.chain().focus().toggleBold().run()),disabled:n.disabled,title:"Bold (Ctrl+B)"},{icon:a.withCtx(()=>[a.createVNode(a.unref(tu),{size:16})]),_:1},8,["color","disabled"]),a.createVNode(W,{color:a.unref(b)?.isActive("italic")?"primary":"secondary",size:"sm",icon:"",squircle:"",onClick:C[1]||(C[1]=w=>a.unref(b)?.chain().focus().toggleItalic().run()),disabled:n.disabled,title:"Italic (Ctrl+I)"},{icon:a.withCtx(()=>[a.createVNode(a.unref(mu),{size:16})]),_:1},8,["color","disabled"]),a.createVNode(W,{color:a.unref(b)?.isActive("underline")?"primary":"secondary",size:"sm",icon:"",squircle:"",onClick:C[2]||(C[2]=w=>a.unref(b)?.chain().focus().toggleUnderline().run()),disabled:n.disabled,title:"Underline (Ctrl+U)"},{icon:a.withCtx(()=>[a.createVNode(a.unref(wu),{size:16})]),_:1},8,["color","disabled"]),a.createVNode(W,{color:a.unref(b)?.isActive("strike")?"primary":"secondary",size:"sm",icon:"",squircle:"",onClick:C[3]||(C[3]=w=>a.unref(b)?.chain().focus().toggleStrike().run()),disabled:n.disabled,title:"Strikethrough"},{icon:a.withCtx(()=>[a.createVNode(a.unref(xu),{size:16})]),_:1},8,["color","disabled"])]),a.createVNode(tt,{orientation:"vertical",spacing:"28px",margin:"4px"}),a.createElementVNode("div",_k,[a.createVNode(W,{color:a.unref(b)?.isActive("heading",{level:1})?"primary":"secondary",size:"sm",icon:"",squircle:"",onClick:C[4]||(C[4]=w=>a.unref(b)?.chain().focus().toggleHeading({level:1}).run()),disabled:n.disabled,title:"Heading 1"},{icon:a.withCtx(()=>[a.createVNode(a.unref(fu),{size:16})]),_:1},8,["color","disabled"]),a.createVNode(W,{color:a.unref(b)?.isActive("heading",{level:2})?"primary":"secondary",size:"sm",icon:"",squircle:"",onClick:C[5]||(C[5]=w=>a.unref(b)?.chain().focus().toggleHeading({level:2}).run()),disabled:n.disabled,title:"Heading 2"},{icon:a.withCtx(()=>[a.createVNode(a.unref(hu),{size:16})]),_:1},8,["color","disabled"]),a.createVNode(W,{color:a.unref(b)?.isActive("heading",{level:3})?"primary":"secondary",size:"sm",icon:"",squircle:"",onClick:C[6]||(C[6]=w=>a.unref(b)?.chain().focus().toggleHeading({level:3}).run()),disabled:n.disabled,title:"Heading 3"},{icon:a.withCtx(()=>[a.createVNode(a.unref(pu),{size:16})]),_:1},8,["color","disabled"])]),a.createVNode(tt,{orientation:"vertical",spacing:"28px",margin:"4px"}),a.createElementVNode("div",e1,[a.createVNode(W,{color:a.unref(b)?.isActive({textAlign:"left"})?"primary":"secondary",size:"sm",icon:"",squircle:"",onClick:C[7]||(C[7]=w=>a.unref(b)?.chain().focus().setTextAlign("left").run()),disabled:n.disabled,title:"Align Left"},{icon:a.withCtx(()=>[a.createVNode(a.unref(_d),{size:16})]),_:1},8,["color","disabled"]),a.createVNode(W,{color:a.unref(b)?.isActive({textAlign:"center"})?"primary":"secondary",size:"sm",icon:"",squircle:"",onClick:C[8]||(C[8]=w=>a.unref(b)?.chain().focus().setTextAlign("center").run()),disabled:n.disabled,title:"Align Center"},{icon:a.withCtx(()=>[a.createVNode(a.unref(Zd),{size:16})]),_:1},8,["color","disabled"]),a.createVNode(W,{color:a.unref(b)?.isActive({textAlign:"right"})?"primary":"secondary",size:"sm",icon:"",squircle:"",onClick:C[9]||(C[9]=w=>a.unref(b)?.chain().focus().setTextAlign("right").run()),disabled:n.disabled,title:"Align Right"},{icon:a.withCtx(()=>[a.createVNode(a.unref(eu),{size:16})]),_:1},8,["color","disabled"])]),a.createVNode(tt,{orientation:"vertical",spacing:"28px",margin:"4px"}),a.createElementVNode("div",t1,[a.createVNode(W,{color:a.unref(b)?.isActive("bulletList")?"primary":"secondary",size:"sm",icon:"",squircle:"",onClick:C[10]||(C[10]=w=>a.unref(b)?.chain().focus().toggleBulletList().run()),disabled:n.disabled,title:"Bullet List"},{icon:a.withCtx(()=>[a.createVNode(a.unref(yu),{size:16})]),_:1},8,["color","disabled"]),a.createVNode(W,{color:a.unref(b)?.isActive("orderedList")?"primary":"secondary",size:"sm",icon:"",squircle:"",onClick:C[11]||(C[11]=w=>a.unref(b)?.chain().focus().toggleOrderedList().run()),disabled:n.disabled,title:"Numbered List"},{icon:a.withCtx(()=>[a.createVNode(a.unref(gu),{size:16})]),_:1},8,["color","disabled"]),a.createVNode(W,{color:a.unref(b)?.isActive("blockquote")?"primary":"secondary",size:"sm",icon:"",squircle:"",onClick:C[12]||(C[12]=w=>a.unref(b)?.chain().focus().toggleBlockquote().run()),disabled:n.disabled,title:"Quote"},{icon:a.withCtx(()=>[a.createVNode(a.unref(ku),{size:16})]),_:1},8,["color","disabled"]),a.createVNode(W,{color:a.unref(b)?.isActive("codeBlock")?"primary":"secondary",size:"sm",icon:"",squircle:"",onClick:C[13]||(C[13]=w=>a.unref(b)?.chain().focus().toggleCodeBlock().run()),disabled:n.disabled,title:"Code Block"},{icon:a.withCtx(()=>[a.createVNode(a.unref(au),{size:16})]),_:1},8,["color","disabled"])]),a.createVNode(tt,{orientation:"vertical",spacing:"28px",margin:"4px"}),a.createElementVNode("div",n1,[a.createVNode(W,{color:"secondary",size:"sm",icon:"",squircle:"",onClick:C[14]||(C[14]=w=>a.unref(b)?.chain().focus().setHorizontalRule().run()),disabled:n.disabled,title:"Horizontal Rule"},{icon:a.withCtx(()=>[a.createVNode(a.unref(El),{size:16})]),_:1},8,["disabled"]),a.createVNode(W,{color:"secondary",size:"sm",icon:"",squircle:"",disabled:!a.unref(b)?.can().undo()||n.disabled,onClick:C[15]||(C[15]=w=>a.unref(b)?.chain().focus().undo().run()),title:"Undo (Ctrl+Z)"},{icon:a.withCtx(()=>[a.createVNode(a.unref(Cu),{size:16})]),_:1},8,["disabled"]),a.createVNode(W,{color:"secondary",size:"sm",icon:"",squircle:"",disabled:!a.unref(b)?.can().redo()||n.disabled,onClick:C[16]||(C[16]=w=>a.unref(b)?.chain().focus().redo().run()),title:"Redo (Ctrl+Y)"},{icon:a.withCtx(()=>[a.createVNode(a.unref(bu),{size:16})]),_:1},8,["disabled"])]),n.customControls&&n.customControls.length>0?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createVNode(tt,{orientation:"vertical",spacing:"28px",margin:"4px"}),a.createElementVNode("div",r1,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.customControls,(w,M)=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:M},[w.action?(a.openBlock(),a.createBlock(W,{key:0,color:"secondary",size:"sm",icon:!w.label,squircle:"",onClick:A=>k(w),disabled:n.disabled,title:w.tooltip||w.label},a.createSlots({default:a.withCtx(()=>[w.label&&w.icon?(a.openBlock(),a.createElementBlock("span",i1,a.toDisplayString(w.label),1)):w.label?(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createTextVNode(a.toDisplayString(w.label),1)],64)):a.createCommentVNode("",!0)]),_:2},[w.icon?{name:"icon",fn:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(w.icon),{size:16}))]),key:"0"}:void 0]),1032,["icon","onClick","disabled","title"])):w.list?(a.openBlock(),a.createElementBlock("div",o1,[a.createVNode(W,{ref_for:!0,ref:A=>x(A,M),color:"secondary",size:"sm",squircle:"",onClick:A=>y(M),disabled:n.disabled,title:w.tooltip||w.label,class:a.normalizeClass({"input-richtext-dropdown-open":c.value===M})},a.createSlots({"trailing-icon":a.withCtx(()=>[a.createVNode(a.unref(Pr),{size:14,class:"input-richtext-dropdown-arrow"})]),default:a.withCtx(()=>[w.label?(a.openBlock(),a.createElementBlock("span",s1,a.toDisplayString(w.label),1)):a.createCommentVNode("",!0)]),_:2},[w.icon?{name:"leading-icon",fn:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(w.icon),{size:16}))]),key:"0"}:void 0]),1032,["onClick","disabled","title","class"])])):a.createCommentVNode("",!0)],64))),128))])],64)):a.createCommentVNode("",!0)]),(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[c.value!==null&&n.customControls?.[c.value]?.list?(a.openBlock(),a.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:u,class:"input-richtext-dropdown",style:a.normalizeStyle(a.unref(f))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.customControls[c.value].list,(w,M)=>(a.openBlock(),a.createElementBlock("button",{key:M,class:"input-richtext-dropdown-item",onClick:A=>S(w),type:"button"},[w.icon?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(w.icon),{key:0,size:16,class:"input-richtext-dropdown-item-icon"})):a.createCommentVNode("",!0),a.createElementVNode("span",a1,a.toDisplayString(w.label),1)],8,l1))),128))],4)):a.createCommentVNode("",!0)])),a.createElementVNode("div",c1,[a.createVNode(a.unref(d0),{editor:a.unref(b),class:"input-richtext-editor",id:n.inputId},null,8,["editor","id"])]),o.value?(a.openBlock(),a.createElementBlock("span",{key:0,ref_key:"slotContentRef",ref:s,class:"sr-only","aria-hidden":"true"},[a.renderSlot(v.$slots,"default",{},void 0,!0)],512)):a.createCommentVNode("",!0)],2))}}),u1=de(d1,[["__scopeId","data-v-5216bae2"]]),f1={class:"pincode-inputs"},h1={key:0,class:"pincode-icon pincode-icon-leading"},p1=["value","disabled","readonly","tabindex","data-index","onInput","onKeydown","onFocus"],m1={key:1,class:"pincode-divider"},g1={key:1,class:"pincode-icon pincode-icon-trailing"},y1=a.defineComponent({__name:"UiInput.Pincode",props:{maxLength:{default:6},variant:{default:"numeric"},divider:{},hasLeadingIcon:{type:Boolean,default:!1},hasTrailingIcon:{type:Boolean,default:!1},label:{},helpText:{},modelValue:{},value:{},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},required:{type:Boolean},fullWidth:{type:Boolean},inputId:{},error:{type:[Boolean,String,Error]},size:{default:"md"},tabindex:{}},emits:["update:modelValue","blur","focus","complete"],setup(n,{emit:e}){const t=n,r=e,i=a.ref([]),o=a.ref(-1),s=a.computed(()=>{const x=(t.modelValue||"").split("");for(;x.length<t.maxLength;)x.push("");return x.slice(0,t.maxLength)}),l=a.computed(()=>t.divider?typeof t.divider=="number"?t.divider:t.divider.count:0),c=a.computed(()=>t.divider?typeof t.divider=="number"?"-":typeof t.divider=="object"&&"character"in t.divider&&t.divider.character||"-":""),d=a.computed(()=>typeof t.divider=="object"&&"component"in t.divider&&t.divider.component==="divider"),u=a.computed(()=>d.value?{orientation:"vertical",variant:"solid",thickness:"1px",margin:"0",spacing:"1.5rem",...t.divider.props}:{}),f=S=>!l.value||S===t.maxLength?!1:S%l.value===0,h=()=>{switch(t.variant){case"numeric":return/^[0-9]$/;case"alpha":return/^[a-zA-Z]$/;case"alphanumeric":return/^[a-zA-Z0-9]$/;default:return/^[0-9]$/}},p=(S,x)=>{const b=S.target,C=b.value.slice(-1);if(!h().test(C)&&C!==""){b.value=s.value[x];return}const M=[...s.value];M[x]=C;const A=M.join("");r("update:modelValue",A),C&&x<t.maxLength-1&&a.nextTick(()=>{const $=i.value[x+1];$&&($.focus(),$.select())}),A.length===t.maxLength&&r("complete",A)},m=(S,x)=>{const b=S.key;if(b==="Backspace"){S.preventDefault();const v=[...s.value];s.value[x]?(v[x]="",r("update:modelValue",v.join(""))):x>0&&(v[x-1]="",r("update:modelValue",v.join("")),a.nextTick(()=>{const C=i.value[x-1];C&&C.focus()}))}else if(b==="ArrowLeft"&&x>0){S.preventDefault();const v=i.value[x-1];v&&v.focus()}else if(b==="ArrowRight"&&x<t.maxLength-1){S.preventDefault();const v=i.value[x+1];v&&v.focus()}else if(b==="Delete"){S.preventDefault();const v=[...s.value];v[x]="",r("update:modelValue",v.join(""))}},g=S=>{S.preventDefault();const x=S.clipboardData?.getData("text")||"",b=h(),v=x.split("").filter(C=>b.test(C)).slice(0,t.maxLength).join("");if(v){r("update:modelValue",v);const C=v.length<t.maxLength?v.length:t.maxLength-1;a.nextTick(()=>{const w=i.value[C];w&&w.focus()}),v.length===t.maxLength&&r("complete",v)}},y=S=>{o.value=S;const x=i.value[S];x&&x.select()},k=S=>{o.value=-1,r("blur",S)};return a.watch(()=>t.modelValue,S=>{S||a.nextTick(()=>{const x=i.value[0];x&&!t.disabled&&!t.readonly&&x.focus()})}),(S,x)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["pincode-wrapper",[`pincode-size-${n.size}`,{"pincode-error":n.error}]])},[a.createElementVNode("div",f1,[a.renderSlot(S.$slots,"leading",{},void 0,!0),t.hasLeadingIcon?(a.openBlock(),a.createElementBlock("div",h1,[a.renderSlot(S.$slots,"leading-icon",{},void 0,!0)])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.maxLength,b=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:b},[a.createElementVNode("input",{ref_for:!0,ref_key:"pincodeRefs",ref:i,type:"text",class:a.normalizeClass(["pincode-input",{"pincode-input-filled":s.value[b-1],"pincode-input-focused":o.value===b-1}]),value:s.value[b-1],disabled:n.disabled,readonly:n.readonly,tabindex:n.disabled?-1:void 0,"data-index":b-1,maxlength:"1",onInput:v=>p(v,b-1),onKeydown:v=>m(v,b-1),onFocus:v=>y(b-1),onBlur:k,onPaste:g},null,42,p1),f(b)&&d.value?(a.openBlock(),a.createBlock(tt,a.mergeProps({key:0,ref_for:!0},u.value,{class:"pincode-custom-divider"}),null,16)):f(b)?(a.openBlock(),a.createElementBlock("span",m1,a.toDisplayString(c.value),1)):a.createCommentVNode("",!0)],64))),128)),t.hasTrailingIcon?(a.openBlock(),a.createElementBlock("div",g1,[a.renderSlot(S.$slots,"trailing-icon",{},void 0,!0)])):a.createCommentVNode("",!0),a.renderSlot(S.$slots,"trailing",{},void 0,!0)])],2))}}),k1=de(y1,[["__scopeId","data-v-12f41567"]]);function b1(n,e){const t=n[e];if(!t)return!1;const r=t();return!r||r.length===0?!1:r.some(i=>!!(i.children&&i.children!==""||i.type&&typeof i.type=="object"||i.props&&Object.keys(i.props).length>0))}const v1=["for"],x1={key:0,class:"input-required"},w1={key:1,class:"input-hint"},C1={key:2,class:"input-error-text"},S1={key:3,class:"input-help-text"},M1=a.defineComponent({__name:"UiInput",props:{type:{},min:{},max:{},step:{},autocomplete:{},spellcheck:{type:Boolean},hasLeadingIcon:{type:Boolean},hasTrailingIcon:{type:Boolean},label:{},helpText:{},modelValue:{},value:{},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},required:{type:Boolean},fullWidth:{type:Boolean},inputId:{},error:{type:[Boolean,String,Error]},size:{},tabindex:{},options:{},multiple:{type:Boolean},searchable:{type:Boolean},allowInsert:{type:Boolean},maxDropdownHeight:{},noOptionsText:{},searchPlaceholder:{},rows:{},cols:{},maxlength:{},resizable:{type:Boolean},accept:{},maxFileSize:{},dragDropText:{},selectedText:{},preview:{},format:{},is24Hour:{type:Boolean},minuteStep:{},minHeight:{},maxHeight:{},customControls:{},maxLength:{},variant:{},divider:{}},emits:["update:modelValue","input","change","blur","focus","keydown","file-error","clear-preview","complete"],setup(n,{emit:e}){const t=n,r=e,i=a.useSlots(),o=a.ref(""),s=a.computed(()=>t.modelValue!==void 0?t.modelValue:t.value!==void 0?t.value:o.value);a.watch(()=>t.value,k=>{k!==void 0&&(o.value=k)},{immediate:!0}),a.watch(()=>t.modelValue,k=>{k!==void 0&&(o.value=k)},{immediate:!0});const l=a.computed(()=>`input-${Math.random().toString(36).substring(2,11)}`),c=k=>b1(i,k),d=a.computed(()=>{const k=["text","email","password","number","tel","url","search"],S=t.type||"text";return k.includes(S)}),u=k=>{o.value=k,r("update:modelValue",k),r("input",k),r("change",k)},f=k=>{r("blur",k)},h=k=>{r("focus",k)},p=k=>{r("keydown",k)},m=k=>{r("file-error",k)},g=()=>{r("clear-preview")},y=k=>{r("complete",k)};return(k,S)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["input-container",{"input-container--full-width":t.fullWidth,[`input-container--${t.size||"md"}`]:!0}])},[t.label?(a.openBlock(),a.createElementBlock("label",{key:0,for:l.value,tabindex:"-1",class:"input-label"},[a.createTextVNode(a.toDisplayString(t.label)+" ",1),t.required?(a.openBlock(),a.createElementBlock("span",x1,"*")):a.createCommentVNode("",!0)],8,v1)):a.createCommentVNode("",!0),a.createElementVNode("div",null,[d.value?(a.openBlock(),a.createBlock(Bu,{key:0,"model-value":s.value,type:n.type,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,required:t.required,min:t.min,max:t.max,step:t.step,autocomplete:t.autocomplete,spellcheck:t.spellcheck,"input-id":l.value,error:!!(t.error&&t.error!==!0&&t.error!==""),size:t.size,tabindex:n.tabindex,"has-leading-icon":c("leading-icon"),"has-trailing-icon":c("trailing-icon"),"onUpdate:modelValue":u,onBlur:f,onFocus:h,onKeydown:p},{leading:a.withCtx(()=>[a.renderSlot(k.$slots,"leading",{},void 0,!0)]),"leading-icon":a.withCtx(()=>[a.renderSlot(k.$slots,"leading-icon",{},void 0,!0)]),"trailing-icon":a.withCtx(()=>[a.renderSlot(k.$slots,"trailing-icon",{},void 0,!0)]),trailing:a.withCtx(()=>[a.renderSlot(k.$slots,"trailing",{},void 0,!0)]),_:3},8,["model-value","type","placeholder","disabled","readonly","required","min","max","step","autocomplete","spellcheck","input-id","error","size","tabindex","has-leading-icon","has-trailing-icon"])):n.type==="textarea"?(a.openBlock(),a.createBlock(Ru,{key:1,"model-value":s.value,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,required:t.required,rows:t.rows,cols:t.cols,maxlength:t.maxlength,autocomplete:t.autocomplete,spellcheck:t.spellcheck,resizable:t.resizable,"input-id":l.value,error:t.error,size:t.size,tabindex:n.tabindex,"has-leading-icon":c("leading-icon"),"has-trailing-icon":c("trailing-icon"),"onUpdate:modelValue":u,onBlur:f,onFocus:h,onKeydown:p},a.createSlots({leading:a.withCtx(()=>[a.renderSlot(k.$slots,"leading",{},void 0,!0)]),"leading-icon":a.withCtx(()=>[a.renderSlot(k.$slots,"leading-icon",{},void 0,!0)]),"trailing-icon":a.withCtx(()=>[a.renderSlot(k.$slots,"trailing-icon",{},void 0,!0)]),trailing:a.withCtx(()=>[a.renderSlot(k.$slots,"trailing",{},void 0,!0)]),_:2},[c("default")?{name:"default",fn:a.withCtx(()=>[a.renderSlot(k.$slots,"default",{},void 0,!0)]),key:"0"}:void 0]),1032,["model-value","placeholder","disabled","readonly","required","rows","cols","maxlength","autocomplete","spellcheck","resizable","input-id","error","size","tabindex","has-leading-icon","has-trailing-icon"])):n.type==="select"?(a.openBlock(),a.createBlock(Xu,{key:2,"model-value":s.value,options:t.options,placeholder:n.placeholder,disabled:n.disabled,multiple:t.multiple,searchable:t.searchable,"allow-insert":t.allowInsert,"max-dropdown-height":t.maxDropdownHeight,"no-options-text":t.noOptionsText,"search-placeholder":t.searchPlaceholder,"input-id":l.value,error:t.error,size:t.size,tabindex:n.tabindex,"has-leading-icon":c("leading-icon"),"has-trailing-icon":c("trailing-icon"),"onUpdate:modelValue":u,onBlur:f,onFocus:h},{leading:a.withCtx(()=>[a.renderSlot(k.$slots,"leading",{},void 0,!0)]),"leading-icon":a.withCtx(()=>[a.renderSlot(k.$slots,"leading-icon",{},void 0,!0)]),"trailing-icon":a.withCtx(()=>[a.renderSlot(k.$slots,"trailing-icon",{},void 0,!0)]),trailing:a.withCtx(()=>[a.renderSlot(k.$slots,"trailing",{},void 0,!0)]),_:3},8,["model-value","options","placeholder","disabled","multiple","searchable","allow-insert","max-dropdown-height","no-options-text","search-placeholder","input-id","error","size","tabindex","has-leading-icon","has-trailing-icon"])):n.type==="file"?(a.openBlock(),a.createBlock(kf,{key:3,"model-value":s.value,accept:t.accept,multiple:t.multiple,"max-file-size":t.maxFileSize,"drag-drop-text":t.dragDropText,"selected-text":t.selectedText,preview:t.preview,disabled:n.disabled,required:t.required,"input-id":l.value,error:t.error,size:t.size,tabindex:n.tabindex,"has-leading-icon":c("leading-icon"),"has-trailing-icon":c("trailing-icon"),"onUpdate:modelValue":u,onFileError:m,onClearPreview:g,onBlur:f,onFocus:h},{leading:a.withCtx(()=>[a.renderSlot(k.$slots,"leading",{},void 0,!0)]),"leading-icon":a.withCtx(()=>[a.renderSlot(k.$slots,"leading-icon",{},void 0,!0)]),"trailing-icon":a.withCtx(()=>[a.renderSlot(k.$slots,"trailing-icon",{},void 0,!0)]),trailing:a.withCtx(()=>[a.renderSlot(k.$slots,"trailing",{},void 0,!0)]),_:3},8,["model-value","accept","multiple","max-file-size","drag-drop-text","selected-text","preview","disabled","required","input-id","error","size","tabindex","has-leading-icon","has-trailing-icon"])):n.type==="date"?(a.openBlock(),a.createBlock(Qf,{key:4,"model-value":s.value,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,required:t.required,min:t.min,max:t.max,"input-id":l.value,error:t.error,size:t.size,tabindex:n.tabindex,"onUpdate:modelValue":u,onBlur:f,onFocus:h},null,8,["model-value","placeholder","disabled","readonly","required","min","max","input-id","error","size","tabindex"])):n.type==="time"?(a.openBlock(),a.createBlock(Xf,{key:5,"model-value":s.value,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,required:t.required,"input-id":l.value,error:t.error,size:t.size,tabindex:n.tabindex,"onUpdate:modelValue":u,onBlur:f,onFocus:h},null,8,["model-value","placeholder","disabled","readonly","required","input-id","error","size","tabindex"])):n.type==="datetime"?(a.openBlock(),a.createBlock(Zf,{key:6,"model-value":s.value,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,required:t.required,min:t.min,max:t.max,"input-id":l.value,error:t.error,size:t.size,tabindex:n.tabindex,"onUpdate:modelValue":u,onBlur:f,onFocus:h},null,8,["model-value","placeholder","disabled","readonly","required","min","max","input-id","error","size","tabindex"])):n.type==="richtext"?(a.openBlock(),a.createBlock(u1,{key:7,"model-value":s.value,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,"input-id":l.value,error:t.error,"min-height":t.minHeight,"max-height":t.maxHeight,"custom-controls":t.customControls,tabindex:n.tabindex,"onUpdate:modelValue":u,onBlur:f,onFocus:h},a.createSlots({_:2},[c("default")?{name:"default",fn:a.withCtx(()=>[a.renderSlot(k.$slots,"default",{},void 0,!0)]),key:"0"}:void 0]),1032,["model-value","placeholder","disabled","readonly","input-id","error","min-height","max-height","custom-controls","tabindex"])):n.type==="pincode"?(a.openBlock(),a.createBlock(k1,{key:8,"model-value":s.value,"max-length":t.maxLength||6,variant:t.variant||"numeric",divider:t.divider,disabled:n.disabled,readonly:n.readonly,"input-id":l.value,error:t.error,size:t.size,tabindex:n.tabindex,"onUpdate:modelValue":u,onBlur:f,onFocus:h,onComplete:y},a.createSlots({_:2},[c("leading")?{name:"leading",fn:a.withCtx(()=>[a.renderSlot(k.$slots,"leading",{},void 0,!0)]),key:"0"}:void 0,c("leading-icon")?{name:"leading-icon",fn:a.withCtx(()=>[a.renderSlot(k.$slots,"leading-icon",{},void 0,!0)]),key:"1"}:void 0,c("trailing-icon")?{name:"trailing-icon",fn:a.withCtx(()=>[a.renderSlot(k.$slots,"trailing-icon",{},void 0,!0)]),key:"2"}:void 0,c("trailing")?{name:"trailing",fn:a.withCtx(()=>[a.renderSlot(k.$slots,"trailing",{},void 0,!0)]),key:"3"}:void 0]),1032,["model-value","max-length","variant","divider","disabled","readonly","input-id","error","size","tabindex"])):a.createCommentVNode("",!0)]),k.$slots.hint?(a.openBlock(),a.createElementBlock("div",w1,[a.renderSlot(k.$slots,"hint",{},void 0,!0)])):a.createCommentVNode("",!0),t.error&&t.error!==!0?(a.openBlock(),a.createElementBlock("p",C1,a.toDisplayString(typeof t.error=="string"?t.error:t.error?.message||String(t.error)),1)):t.helpText?(a.openBlock(),a.createElementBlock("p",S1,a.toDisplayString(t.helpText),1)):a.createCommentVNode("",!0)],2))}}),ni=de(M1,[["__scopeId","data-v-e216292d"]]),T1=["disabled","aria-disabled"],E1=["href","target","rel","aria-disabled"],N1=a.defineComponent({__name:"UiLink",props:{href:{},to:{},variant:{default:"primary"},size:{default:"md"},disabled:{type:Boolean,default:!1},external:{type:Boolean,default:!1},color:{}},emits:["click"],setup(n,{emit:e}){const t=n,r=e,i=a.computed(()=>{if(t.href)return t.href;if(t.to){if(typeof t.to=="string")return t.to;if(typeof t.to=="object"&&t.to)return"#route-object-not-supported"}return"#"});function o(){if(typeof window<"u"){const u=getComputedStyle(document.documentElement).getPropertyValue("--strands-accent").trim();if(u)return u}return"#EA00A8"}const s=()=>({primary:o(),success:"#059669",warning:"#d97706",danger:"#dc2626"}),l=u=>{const f=s();return`color-mix(in srgb, ${f[u]||f.primary} 85%, black 15%)`},c=a.computed(()=>{if(!t.color)return{};const u=s(),f=u[t.color]||u.primary,h=l(t.color),p={"--link-color":f,"--link-hover-color":h,color:f};return t.variant==="underline"?{...p,textDecorationColor:f}:p}),d=u=>{t.disabled||r("click",u)};return(u,f)=>!n.to&&!n.href?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:a.normalizeClass(["ui-link",[`ui-link-${n.variant}`,`ui-link-${n.size}`,{"ui-link-disabled":n.disabled},{"ui-link-custom-color":n.color}]]),style:a.normalizeStyle(c.value),disabled:n.disabled,"aria-disabled":n.disabled,onClick:d},[a.renderSlot(u.$slots,"default",{},void 0,!0)],14,T1)):(a.openBlock(),a.createElementBlock("a",{key:1,class:a.normalizeClass(["ui-link",[`ui-link-${n.variant}`,`ui-link-${n.size}`,{"ui-link-disabled":n.disabled},{"ui-link-custom-color":n.color}]]),style:a.normalizeStyle(c.value),href:i.value,target:n.external?"_blank":void 0,rel:n.external?"noopener noreferrer":void 0,"aria-disabled":n.disabled,onClick:d},[a.renderSlot(u.$slots,"default",{},void 0,!0)],14,E1))}}),Zo=de(N1,[["__scopeId","data-v-3bf99110"]]),A1={StrandsUiAlert:co,StrandsUiButton:W,StrandsUiCard:uo,StrandsUiInput:ni,StrandsUiLink:Zo,StrandsUiTabs:Fr,StrandsUiLoader:zr},nd={install(n,e={}){const{prefix:t=""}=e;Object.entries(A1).forEach(([r,i])=>{const o=t?`${t}${r}`:r;n.component(o,i)})}},B1=Object.freeze(Object.defineProperty({__proto__:null,StrandsUiAlert:co,StrandsUiButton:W,StrandsUiCard:uo,StrandsUiInput:ni,StrandsUiLink:Zo,StrandsUiLoader:zr,StrandsUiTabs:Fr,default:nd},Symbol.toStringTag,{value:"Module"}));exports.ChevronDown=Pr;exports.Minus=El;exports.StrandsUIPlugin=nd;exports.StrandsUIPlugin$1=B1;exports.StrandsUiAlert=co;exports.StrandsUiButton=W;exports.StrandsUiCard=uo;exports.StrandsUiInput=ni;exports.StrandsUiLink=Zo;exports.StrandsUiLoader=zr;exports.StrandsUiTabs=Fr;exports.UiButtonContent=Wt;exports.UiDivider=tt;exports.UiTooltip=Tl;exports._export_sfc=de;exports._sfc_main=Oi;exports._sfc_main$1=Di;exports._sfc_main$2=Ii;exports.createLucideIcon=J;exports.useFloatingPosition=Vr;
141
+ `),[o,s]=u0(i);if(o.length===0)return;const l=Jc(o,0,t);return l.length===0?void 0:{type:"list",ordered:!0,start:((r=o[0])==null?void 0:r.number)||1,items:l,raw:i.slice(0,s).join(`
142
+ `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(h0,this.editor.getAttributes(xl)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=Zt({find:wl,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=Zt({find:wl,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(xl)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[n]}}),p0=/^\s*(\[([( |x])?\])\s$/,m0=Te.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:n=>{const e=n.getAttribute("data-checked");return e===""||e==="true"},renderHTML:n=>({"data-checked":n.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:n,HTMLAttributes:e}){return["li",ie(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:n.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(n,e)=>{const t=[];if(n.tokens&&n.tokens.length>0?t.push(e.createNode("paragraph",{},e.parseInline(n.tokens))):n.text?t.push(e.createNode("paragraph",{},[e.createNode("text",{text:n.text})])):t.push(e.createNode("paragraph",{},[])),n.nestedTokens&&n.nestedTokens.length>0){const r=e.parseChildren(n.nestedTokens);t.push(...r)}return e.createNode("taskItem",{checked:n.checked||!1},t)},renderMarkdown:(n,e)=>{var t;const i=`- [${(t=n.attrs)!=null&&t.checked?"x":" "}] `;return Fo(n,e,i)},addKeyboardShortcuts(){const n={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...n,Tab:()=>this.editor.commands.sinkListItem(this.name)}:n},addNodeView(){return({node:n,HTMLAttributes:e,getPos:t,editor:r})=>{const i=document.createElement("li"),o=document.createElement("label"),s=document.createElement("span"),l=document.createElement("input"),c=document.createElement("div"),d=u=>{var f,h;l.ariaLabel=((h=(f=this.options.a11y)==null?void 0:f.checkboxLabel)==null?void 0:h.call(f,u,l.checked))||`Task item checkbox for ${u.textContent||"empty task item"}`};return d(n),o.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",u=>u.preventDefault()),l.addEventListener("change",u=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:f}=u.target;r.isEditable&&typeof t=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:h})=>{const p=t();if(typeof p!="number")return!1;const m=h.doc.nodeAt(p);return h.setNodeMarkup(p,void 0,{...m?.attrs,checked:f}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(n,f)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([u,f])=>{i.setAttribute(u,f)}),i.dataset.checked=n.attrs.checked,l.checked=n.attrs.checked,o.append(l,s),i.append(o,c),Object.entries(e).forEach(([u,f])=>{i.setAttribute(u,f)}),{dom:i,contentDOM:c,update:u=>u.type!==this.type?!1:(i.dataset.checked=u.attrs.checked,l.checked=u.attrs.checked,d(u),!0)}}},addInputRules(){return[Zt({find:p0,type:this.type,getAttributes:n=>({checked:n[n.length-1]==="x"})})]}}),g0=Te.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:n}){return["ul",ie(this.options.HTMLAttributes,n,{"data-type":this.name}),0]},parseMarkdown:(n,e)=>e.createNode("taskList",{},e.parseChildren(n.items||[])),renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,`
143
+ `):"",markdownTokenizer:{name:"taskList",level:"block",start(n){var e;const t=(e=n.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return t!==void 0?t:-1},tokenize(n,e,t){const r=o=>{const s=Zi(o,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,c)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:t.inlineTokens(l.mainContent),nestedTokens:c}),customNestedParser:r},t);return s?[{type:"taskList",raw:s.raw,items:s.items}]:t.blockTokens(o)},i=Zi(n,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:o=>({indentLevel:o[1].length,mainContent:o[4],checked:o[3].toLowerCase()==="x"}),createToken:(o,s)=>({type:"taskItem",raw:"",mainContent:o.mainContent,indentLevel:o.indentLevel,checked:o.checked,text:o.mainContent,tokens:t.inlineTokens(o.mainContent),nestedTokens:s}),customNestedParser:r},t);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:n})=>n.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});te.create({name:"listKit",addExtensions(){const n=[];return this.options.bulletList!==!1&&n.push(Vc.configure(this.options.bulletList)),this.options.listItem!==!1&&n.push(Fc.configure(this.options.listItem)),this.options.listKeymap!==!1&&n.push(Kc.configure(this.options.listKeymap)),this.options.orderedList!==!1&&n.push(Gc.configure(this.options.orderedList)),this.options.taskItem!==!1&&n.push(m0.configure(this.options.taskItem)),this.options.taskList!==!1&&n.push(g0.configure(this.options.taskList)),n}});var y0=Te.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",ie(this.options.HTMLAttributes,n),0]},parseMarkdown:(n,e)=>{const t=n.tokens||[];return t.length===1&&t[0].type==="image"?e.parseChildren([t[0]]):e.createNode("paragraph",void 0,e.parseInline(t))},renderMarkdown:(n,e)=>!n||!Array.isArray(n.content)?"":e.renderChildren(n.content),addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),k0=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,b0=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,v0=It.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",ie(this.options.HTMLAttributes,n),0]},markdownTokenName:"del",parseMarkdown:(n,e)=>e.applyMark("strike",e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>`~~${e.renderChildren(n)}~~`,addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Xt({find:k0,type:this.type})]},addPasteRules(){return[Bt({find:b0,type:this.type})]}}),x0=Te.create({name:"text",group:"inline",parseMarkdown:n=>({type:"text",text:n.text||""}),renderMarkdown:n=>n.text||""}),Yc=It.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["u",ie(this.options.HTMLAttributes,n),0]},parseMarkdown(n,e){return e.applyMark(this.name||"underline",e.parseInline(n.tokens||[]))},renderMarkdown(n,e){return`++${e.renderChildren(n)}++`},markdownTokenizer:{name:"underline",level:"inline",start(n){return n.indexOf("++")},tokenize(n,e,t){const i=/^(\+\+)([\s\S]+?)(\+\+)/.exec(n);if(!i)return;const o=i[2].trim();return{type:"underline",raw:i[0],text:o,tokens:t.inlineTokens(o)}}},addCommands(){return{setUnderline:()=>({commands:n})=>n.setMark(this.name),toggleUnderline:()=>({commands:n})=>n.toggleMark(this.name),unsetUnderline:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),w0=Yc;function C0(n={}){return new Z({view(e){return new S0(e,n)}})}class S0{constructor(e,t){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=t.width)!==null&&r!==void 0?r:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,r,i=this.editorView.dom,o=i.getBoundingClientRect(),s=o.width/i.offsetWidth,l=o.height/i.offsetHeight;if(t){let f=e.nodeBefore,h=e.nodeAfter;if(f||h){let p=this.editorView.nodeDOM(this.cursorPos-(f?f.nodeSize:0));if(p){let m=p.getBoundingClientRect(),g=f?m.bottom:m.top;f&&h&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let y=this.width/2*l;r={left:m.left,right:m.right,top:g-y,bottom:g+y}}}}if(!r){let f=this.editorView.coordsAtPos(this.cursorPos),h=this.width/2*s;r={left:f.left-h,right:f.left+h,top:f.top,bottom:f.bottom}}let c=this.editorView.dom.offsetParent;this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let d,u;if(!c||c==document.body&&getComputedStyle(c).position=="static")d=-pageXOffset,u=-pageYOffset;else{let f=c.getBoundingClientRect(),h=f.width/c.offsetWidth,p=f.height/c.offsetHeight;d=f.left-c.scrollLeft*h,u=f.top-c.scrollTop*p}this.element.style.left=(r.left-d)/s+"px",this.element.style.top=(r.top-u)/l+"px",this.element.style.width=(r.right-r.left)/s+"px",this.element.style.height=(r.bottom-r.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,t,e):i;if(t&&!o){let s=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=ea(this.editorView.state.doc,s,this.editorView.dragging.slice);l!=null&&(s=l)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class ee extends H{constructor(e){super(e,e)}map(e,t){let r=e.resolve(t.map(this.head));return ee.valid(r)?new ee(r):H.near(r)}content(){return B.empty}eq(e){return e instanceof ee&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new ee(e.resolve(t.pos))}getBookmark(){return new Xo(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!M0(e)||!T0(e))return!1;let r=t.type.spec.allowGapCursor;if(r!=null)return r;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,r=!1){e:for(;;){if(!r&&ee.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let l=e.node(s);if(t>0?e.indexAfter(s)<l.childCount:e.index(s)>0){o=l.child(t>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=t;let c=e.doc.resolve(i);if(ee.valid(c))return c}for(;;){let s=t>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!P.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*t),r=!1;continue e}break}o=s,i+=t;let l=e.doc.resolve(i);if(ee.valid(l))return l}return null}}}ee.prototype.visible=!1;ee.findFrom=ee.findGapCursorFrom;H.jsonID("gapcursor",ee);class Xo{constructor(e){this.pos=e}map(e){return new Xo(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return ee.valid(t)?new ee(t):H.near(t)}}function Qc(n){return n.isAtom||n.spec.isolating||n.spec.createGapCursor}function M0(n){for(let e=n.depth;e>=0;e--){let t=n.index(e),r=n.node(e);if(t==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||Qc(i.type))return!0;if(i.inlineContent)return!1}}return!0}function T0(n){for(let e=n.depth;e>=0;e--){let t=n.indexAfter(e),r=n.node(e);if(t==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||Qc(i.type))return!0;if(i.inlineContent)return!1}}return!0}function E0(){return new Z({props:{decorations:O0,createSelectionBetween(n,e,t){return e.pos==t.pos&&ee.valid(t)?new ee(t):null},handleClick:A0,handleKeyDown:N0,handleDOMEvents:{beforeinput:B0}}})}const N0=Ya({ArrowLeft:Un("horiz",-1),ArrowRight:Un("horiz",1),ArrowUp:Un("vert",-1),ArrowDown:Un("vert",1)});function Un(n,e){const t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,l=e>0?s.$to:s.$from,c=s.empty;if(s instanceof V){if(!o.endOfTextblock(t)||l.depth==0)return!1;c=!1,l=r.doc.resolve(e>0?l.after():l.before())}let d=ee.findGapCursorFrom(l,e,c);return d?(i&&i(r.tr.setSelection(new ee(d))),!0):!1}}function A0(n,e,t){if(!n||!n.editable)return!1;let r=n.state.doc.resolve(e);if(!ee.valid(r))return!1;let i=n.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&P.isSelectable(n.state.doc.nodeAt(i.inside))?!1:(n.dispatch(n.state.tr.setSelection(new ee(r))),!0)}function B0(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof ee))return!1;let{$from:t}=n.state.selection,r=t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);if(!r)return!1;let i=T.empty;for(let s=r.length-1;s>=0;s--)i=T.from(r[s].createAndFill(null,i));let o=n.state.tr.replace(t.pos,t.pos,new B(i,0,0));return o.setSelection(V.near(o.doc.resolve(t.pos+1))),n.dispatch(o),!1}function O0(n){if(!(n.selection instanceof ee))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",X.create(n.doc,[be.widget(n.selection.head,e,{key:"gapcursor"})])}var Lr=200,pe=function(){};pe.prototype.append=function(e){return e.length?(e=pe.from(e),!this.length&&e||e.length<Lr&&this.leafAppend(e)||this.length<Lr&&e.leafPrepend(this)||this.appendInner(e)):this};pe.prototype.prepend=function(e){return e.length?pe.from(e).append(this):this};pe.prototype.appendInner=function(e){return new D0(this,e)};pe.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?pe.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};pe.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};pe.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)};pe.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},t,r),i};pe.from=function(e){return e instanceof pe?e:e&&e.length?new Xc(e):pe.empty};var Xc=(function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={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,l){for(var c=o;c<s;c++)if(i(this.values[c],l+c)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,s,l){for(var c=o-1;c>=s;c--)if(i(this.values[c],l+c)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Lr)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Lr)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e})(pe);pe.empty=new Xc([]);var D0=(function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.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 l=this.left.length;if(i<l&&this.left.forEachInner(r,i,Math.min(o,l),s)===!1||o>l&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,o)-l,s+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(o,l)-l,s+l)===!1||o<l&&this.left.forEachInvertedInner(r,Math.min(i,l),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})(pe);const Zc=pe,I0=500;class Ie{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){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;t&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,l,c,d=[],u=[];return this.items.forEach((f,h)=>{if(!f.step){i||(i=this.remapping(r,h+1),o=i.maps.length),o--,u.push(f);return}if(i){u.push(new Ve(f.map));let p=f.step.map(i.slice(o)),m;p&&s.maybeStep(p).doc&&(m=s.mapping.maps[s.mapping.maps.length-1],d.push(new Ve(m,void 0,void 0,d.length+u.length))),o--,m&&i.appendMap(m,o)}else s.maybeStep(f.step);if(f.selection)return l=i?f.selection.map(i.slice(o)):f.selection,c=new Ie(this.items.slice(0,r).append(u.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:s,selection:l}}addTransform(e,t,r,i){let o=[],s=this.eventCount,l=this.items,c=!i&&l.length?l.get(l.length-1):null;for(let u=0;u<e.steps.length;u++){let f=e.steps[u].invert(e.docs[u]),h=new Ve(e.mapping.maps[u],f,t),p;(p=c&&c.merge(h))&&(h=p,u?o.pop():l=l.slice(0,l.length-1)),o.push(h),t&&(s++,t=void 0),i||(c=h)}let d=s-r.depth;return d>R0&&(l=$0(l,d),s-=d),new Ie(l.append(o),s)}remapping(e,t){let r=new vn;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,t),r}addMaps(e){return this.eventCount==0?this:new Ie(this.items.append(e.map(t=>new Ve(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,s=e.steps.length,l=this.eventCount;this.items.forEach(h=>{h.selection&&l--},i);let c=t;this.items.forEach(h=>{let p=o.getMirror(--c);if(p==null)return;s=Math.min(s,p);let m=o.maps[p];if(h.step){let g=e.steps[p].invert(e.docs[p]),y=h.selection&&h.selection.map(o.slice(c+1,p));y&&l++,r.push(new Ve(m,g,y))}else r.push(new Ve(m))},i);let d=[];for(let h=t;h<s;h++)d.push(new Ve(o.maps[h]));let u=this.items.slice(0,i).append(d).append(r),f=new Ie(u,l);return f.emptyItemCount()>I0&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],o=0;return this.items.forEach((s,l)=>{if(l>=e)i.push(s),s.selection&&o++;else if(s.step){let c=s.step.map(t.slice(r)),d=c&&c.getMap();if(r--,d&&t.appendMap(d,r),c){let u=s.selection&&s.selection.map(t.slice(r));u&&o++;let f=new Ve(d.invert(),c,u),h,p=i.length-1;(h=i.length&&i[p].merge(f))?i[p]=h:i.push(f)}}else s.map&&r--},this.items.length,0),new Ie(Zc.from(i.reverse()),o)}}Ie.empty=new Ie(Zc.empty,0);function $0(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class Ve{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new Ve(t.getMap().invert(),t,this.selection)}}}class et{constructor(e,t,r,i,o){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const R0=20;function L0(n,e,t,r){let i=t.getMeta(Mt),o;if(i)return i.historyState;t.getMeta(V0)&&(n=new et(n.done,n.undone,null,0,-1));let s=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(s&&s.getMeta(Mt))return s.getMeta(Mt).redo?new et(n.done.addTransform(t,void 0,r,Gn(e)),n.undone,Cl(t.mapping.maps),n.prevTime,n.prevComposition):new et(n.done,n.undone.addTransform(t,void 0,r,Gn(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let l=t.getMeta("composition"),c=n.prevTime==0||!s&&n.prevComposition!=l&&(n.prevTime<(t.time||0)-r.newGroupDelay||!z0(t,n.prevRanges)),d=s?Ai(n.prevRanges,t.mapping):Cl(t.mapping.maps);return new et(n.done.addTransform(t,c?e.selection.getBookmark():void 0,r,Gn(e)),Ie.empty,d,t.time,l??n.prevComposition)}else return(o=t.getMeta("rebased"))?new et(n.done.rebased(t,o),n.undone.rebased(t,o),Ai(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new et(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),Ai(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function z0(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(t=!0)}),t}function Cl(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((r,i,o,s)=>e.push(o,s));return e}function Ai(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let i=e.map(n[r],1),o=e.map(n[r+1],-1);i<=o&&t.push(i,o)}return t}function P0(n,e,t){let r=Gn(e),i=Mt.get(e).spec.config,o=(t?n.undone:n.done).popEvent(e,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),l=(t?n.done:n.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),c=new et(t?l:o.remaining,t?o.remaining:l,null,0,-1);return o.transform.setSelection(s).setMeta(Mt,{redo:t,historyState:c})}let Bi=!1,Sl=null;function Gn(n){let e=n.plugins;if(Sl!=e){Bi=!1,Sl=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){Bi=!0;break}}return Bi}const Mt=new oe("history"),V0=new oe("closeHistory");function F0(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new Z({key:Mt,state:{init(){return new et(Ie.empty,Ie.empty,null,0,-1)},apply(e,t,r){return L0(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?ed:r=="historyRedo"?td:null;return!i||!e.editable?!1:(t.preventDefault(),i(e.state,e.dispatch))}}}})}function _c(n,e){return(t,r)=>{let i=Mt.getState(t);if(!i||(n?i.undone:i.done).eventCount==0)return!1;if(r){let o=P0(i,t,n);o&&r(e?o.scrollIntoView():o)}return!0}}const ed=_c(!1,!0),td=_c(!0,!0);te.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:n=>n.length,wordCounter:n=>n.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=n=>{const e=n?.node||this.editor.state.doc;if((n?.mode||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=n=>{const e=n?.node||this.editor.state.doc,t=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(t)}},addProseMirrorPlugins(){let n=!1;return[new Z({key:new oe("characterCount"),appendTransaction:(e,t,r)=>{if(n)return;const i=this.options.limit;if(i==null||i===0){n=!0;return}const o=this.storage.characters({node:r.doc});if(o>i){const s=o-i,l=0,c=s;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const d=r.tr.deleteRange(l,c);return n=!0,d}n=!0},filterTransaction:(e,t)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const i=this.storage.characters({node:t.doc}),o=this.storage.characters({node:e.doc});if(o<=r||i>r&&o>r&&o<=i)return!0;if(i>r&&o>r&&o>i||!e.getMeta("paste"))return!1;const l=e.selection.$head.pos,c=o-r,d=l-c,u=l;return e.deleteRange(d,u),!(this.storage.characters({node:e.doc})>r)}})]}});var H0=te.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[C0(this.options)]}});te.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Z({key:new oe("focus"),props:{decorations:({doc:n,selection:e})=>{const{isEditable:t,isFocused:r}=this.editor,{anchor:i}=e,o=[];if(!t||!r)return X.create(n,[]);let s=0;this.options.mode==="deepest"&&n.descendants((c,d)=>{if(c.isText)return;if(!(i>=d&&i<=d+c.nodeSize-1))return!1;s+=1});let l=0;return n.descendants((c,d)=>{if(c.isText||!(i>=d&&i<=d+c.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&s-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";o.push(be.node(d,d+c.nodeSize,{class:this.options.className}))}),X.create(n,o)}}})]}});var j0=te.create({name:"gapCursor",addProseMirrorPlugins(){return[E0()]},extendNodeSchema(n){var e;const t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=G(z(n,"allowGapCursor",t)))!=null?e:null}}}),U0=te.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Z({key:new oe("placeholder"),props:{decorations:({doc:n,selection:e})=>{const t=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,i=[];if(!t)return null;const o=this.editor.isEmpty;return n.descendants((s,l)=>{const c=r>=l&&r<=l+s.nodeSize,d=!s.isLeaf&&Zr(s);if((c||!this.options.showOnlyCurrent)&&d){const u=[this.options.emptyNodeClass];o&&u.push(this.options.emptyEditorClass);const f=be.node(l,l+s.nodeSize,{class:u.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:l,hasAnchor:c}):this.options.placeholder});i.push(f)}return this.options.includeChildren}),X.create(n,i)}}})]}});te.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:n,options:e}=this;return[new Z({key:new oe("selection"),props:{decorations(t){return t.selection.empty||n.isFocused||!n.isEditable||uc(t.selection)||n.view.dragging?null:X.create(t.doc,[be.inline(t.selection.from,t.selection.to,{class:e.className})])}}})]}});function Ml({types:n,node:e}){return e&&Array.isArray(n)&&n.includes(e.type)||e?.type===n}var q0=te.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var n;const e=new oe(this.name),t=this.options.node||((n=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:n.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(t).includes(i.name));return[new Z({key:e,appendTransaction:(i,o,s)=>{const{doc:l,tr:c,schema:d}=s,u=e.getState(s),f=l.content.size,h=d.nodes[t];if(u)return c.insert(f,h.create())},state:{init:(i,o)=>{const s=o.tr.doc.lastChild;return!Ml({node:s,types:r})},apply:(i,o)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return o;const s=i.doc.lastChild;return!Ml({node:s,types:r})}}})]}}),W0=te.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>ed(n,e),redo:()=>({state:n,dispatch:e})=>td(n,e)}},addProseMirrorPlugins(){return[F0(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),K0=te.create({name:"starterKit",addExtensions(){var n,e,t,r;const i=[];return this.options.bold!==!1&&i.push(kk.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(hk.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(Vc.configure(this.options.bulletList)),this.options.code!==!1&&i.push(xk.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(Sk.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(Mk.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(H0.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(j0.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(Tk.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(Ac.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(W0.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(Nk.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(Ik.configure(this.options.italic)),this.options.listItem!==!1&&i.push(Fc.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(Kc.configure((n=this.options)==null?void 0:n.listKeymap)),this.options.link!==!1&&i.push(i0.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&i.push(Gc.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(y0.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(v0.configure(this.options.strike)),this.options.text!==!1&&i.push(x0.configure(this.options.text)),this.options.underline!==!1&&i.push(Yc.configure((t=this.options)==null?void 0:t.underline)),this.options.trailingNode!==!1&&i.push(q0.configure((r=this.options)==null?void 0:r.trailingNode)),i}}),J0=K0,G0=te.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:n=>{const e=n.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:n=>n.textAlign?{style:`text-align: ${n.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:n=>({commands:e})=>this.options.alignments.includes(n)?this.options.types.map(t=>e.updateAttributes(t,{textAlign:n})).some(t=>t):!1,unsetTextAlign:()=>({commands:n})=>this.options.types.map(e=>n.resetAttributes(e,"textAlign")).some(e=>e),toggleTextAlign:n=>({editor:e,commands:t})=>this.options.alignments.includes(n)?e.isActive({textAlign:n})?t.unsetTextAlign():t.setTextAlign(n):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),Y0=G0,Q0=U0;const X0={class:"input-richtext-toolbar"},Z0={class:"input-richtext-group"},_0={class:"input-richtext-group"},e1={class:"input-richtext-group"},t1={class:"input-richtext-group"},n1={class:"input-richtext-group"},r1={class:"input-richtext-group"},i1={key:0},o1={key:1,class:"input-richtext-dropdown-wrapper"},s1={key:0},l1=["onClick"],a1={class:"input-richtext-dropdown-item-label"},c1={class:"input-richtext-editor-wrapper"},d1=a.defineComponent({__name:"UiInput.RichText",props:{minHeight:{default:"200px"},maxHeight:{default:"400px"},customControls:{default:()=>[]},label:{},helpText:{},modelValue:{},value:{},placeholder:{default:"Start typing..."},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},required:{type:Boolean},fullWidth:{type:Boolean},inputId:{},error:{type:[Boolean,String,Error],default:!1},size:{},tabindex:{}},emits:["update:modelValue","blur","focus"],setup(n,{emit:e}){a.useCssVars(v=>({c4d6a996:v.minHeight,v6f8994c7:v.maxHeight}));const t=n,r=e,i=a.useSlots(),o=a.computed(()=>!!i.default),s=a.ref(null),l=a.ref(typeof t.modelValue=="string"?t.modelValue:"");a.onMounted(()=>{(t.modelValue===void 0||t.modelValue==="")&&o.value&&setTimeout(()=>{if(s.value&&b.value){const v=s.value.innerHTML?.trim()||"";v&&(b.value.commands.setContent(v),l.value=v,r("update:modelValue",v))}},0)});const c=a.ref(null),d=a.ref([]),u=a.ref(),{floatingStyle:f,updatePosition:h,cleanup:p}=Vr({trigger:a.computed(()=>c.value!==null?d.value[c.value]:void 0),floating:u,placement:"bottom-start",offset:4,shift:!0,flip:!0,autoUpdate:!0,clickOutside:{enabled:!0,handler:()=>{g()}}}),m=async v=>{c.value=v,await a.nextTick(),h()},g=()=>{c.value=null},y=v=>{c.value===v?g():m(v)},k=v=>{v.action&&b.value&&v.action(b.value)},S=v=>{b.value&&v.action(b.value),g()},x=(v,C)=>{v&&(d.value[C]=v.$el||v)},b=uk({content:l.value,editable:!t.disabled&&!t.readonly,extensions:[J0,Ek.configure({levels:[1,2,3]}),w0,Y0.configure({types:["heading","paragraph"]}),Q0.configure({placeholder:t.placeholder})],onUpdate:({editor:v})=>{const C=v.getHTML();l.value=C,r("update:modelValue",C)},onFocus:v=>{r("focus",v.event)},onBlur:v=>{r("blur",v.event)}});return a.watch(()=>t.modelValue,v=>{typeof v=="string"&&b.value&&b.value.getHTML()!==v&&(b.value.commands.setContent(v),l.value=v)}),a.watch(()=>t.disabled,v=>{b.value&&b.value.setEditable(!v&&!t.readonly)}),a.watch(()=>t.readonly,v=>{b.value&&b.value.setEditable(!t.disabled&&!v)}),a.onBeforeUnmount(()=>{b.value&&b.value.destroy(),p()}),(v,C)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["input-richtext-container",{"input-error":n.error,"input-disabled":n.disabled}])},[a.createElementVNode("div",X0,[a.createElementVNode("div",Z0,[a.createVNode(W,{color:a.unref(b)?.isActive("bold")?"primary":"secondary",size:"sm",icon:"",squircle:"",onClick:C[0]||(C[0]=w=>a.unref(b)?.chain().focus().toggleBold().run()),disabled:n.disabled,title:"Bold (Ctrl+B)"},{icon:a.withCtx(()=>[a.createVNode(a.unref(tu),{size:16})]),_:1},8,["color","disabled"]),a.createVNode(W,{color:a.unref(b)?.isActive("italic")?"primary":"secondary",size:"sm",icon:"",squircle:"",onClick:C[1]||(C[1]=w=>a.unref(b)?.chain().focus().toggleItalic().run()),disabled:n.disabled,title:"Italic (Ctrl+I)"},{icon:a.withCtx(()=>[a.createVNode(a.unref(mu),{size:16})]),_:1},8,["color","disabled"]),a.createVNode(W,{color:a.unref(b)?.isActive("underline")?"primary":"secondary",size:"sm",icon:"",squircle:"",onClick:C[2]||(C[2]=w=>a.unref(b)?.chain().focus().toggleUnderline().run()),disabled:n.disabled,title:"Underline (Ctrl+U)"},{icon:a.withCtx(()=>[a.createVNode(a.unref(wu),{size:16})]),_:1},8,["color","disabled"]),a.createVNode(W,{color:a.unref(b)?.isActive("strike")?"primary":"secondary",size:"sm",icon:"",squircle:"",onClick:C[3]||(C[3]=w=>a.unref(b)?.chain().focus().toggleStrike().run()),disabled:n.disabled,title:"Strikethrough"},{icon:a.withCtx(()=>[a.createVNode(a.unref(xu),{size:16})]),_:1},8,["color","disabled"])]),a.createVNode(tt,{orientation:"vertical",spacing:"28px",margin:"4px"}),a.createElementVNode("div",_0,[a.createVNode(W,{color:a.unref(b)?.isActive("heading",{level:1})?"primary":"secondary",size:"sm",icon:"",squircle:"",onClick:C[4]||(C[4]=w=>a.unref(b)?.chain().focus().toggleHeading({level:1}).run()),disabled:n.disabled,title:"Heading 1"},{icon:a.withCtx(()=>[a.createVNode(a.unref(fu),{size:16})]),_:1},8,["color","disabled"]),a.createVNode(W,{color:a.unref(b)?.isActive("heading",{level:2})?"primary":"secondary",size:"sm",icon:"",squircle:"",onClick:C[5]||(C[5]=w=>a.unref(b)?.chain().focus().toggleHeading({level:2}).run()),disabled:n.disabled,title:"Heading 2"},{icon:a.withCtx(()=>[a.createVNode(a.unref(hu),{size:16})]),_:1},8,["color","disabled"]),a.createVNode(W,{color:a.unref(b)?.isActive("heading",{level:3})?"primary":"secondary",size:"sm",icon:"",squircle:"",onClick:C[6]||(C[6]=w=>a.unref(b)?.chain().focus().toggleHeading({level:3}).run()),disabled:n.disabled,title:"Heading 3"},{icon:a.withCtx(()=>[a.createVNode(a.unref(pu),{size:16})]),_:1},8,["color","disabled"])]),a.createVNode(tt,{orientation:"vertical",spacing:"28px",margin:"4px"}),a.createElementVNode("div",e1,[a.createVNode(W,{color:a.unref(b)?.isActive({textAlign:"left"})?"primary":"secondary",size:"sm",icon:"",squircle:"",onClick:C[7]||(C[7]=w=>a.unref(b)?.chain().focus().setTextAlign("left").run()),disabled:n.disabled,title:"Align Left"},{icon:a.withCtx(()=>[a.createVNode(a.unref(_d),{size:16})]),_:1},8,["color","disabled"]),a.createVNode(W,{color:a.unref(b)?.isActive({textAlign:"center"})?"primary":"secondary",size:"sm",icon:"",squircle:"",onClick:C[8]||(C[8]=w=>a.unref(b)?.chain().focus().setTextAlign("center").run()),disabled:n.disabled,title:"Align Center"},{icon:a.withCtx(()=>[a.createVNode(a.unref(Zd),{size:16})]),_:1},8,["color","disabled"]),a.createVNode(W,{color:a.unref(b)?.isActive({textAlign:"right"})?"primary":"secondary",size:"sm",icon:"",squircle:"",onClick:C[9]||(C[9]=w=>a.unref(b)?.chain().focus().setTextAlign("right").run()),disabled:n.disabled,title:"Align Right"},{icon:a.withCtx(()=>[a.createVNode(a.unref(eu),{size:16})]),_:1},8,["color","disabled"])]),a.createVNode(tt,{orientation:"vertical",spacing:"28px",margin:"4px"}),a.createElementVNode("div",t1,[a.createVNode(W,{color:a.unref(b)?.isActive("bulletList")?"primary":"secondary",size:"sm",icon:"",squircle:"",onClick:C[10]||(C[10]=w=>a.unref(b)?.chain().focus().toggleBulletList().run()),disabled:n.disabled,title:"Bullet List"},{icon:a.withCtx(()=>[a.createVNode(a.unref(yu),{size:16})]),_:1},8,["color","disabled"]),a.createVNode(W,{color:a.unref(b)?.isActive("orderedList")?"primary":"secondary",size:"sm",icon:"",squircle:"",onClick:C[11]||(C[11]=w=>a.unref(b)?.chain().focus().toggleOrderedList().run()),disabled:n.disabled,title:"Numbered List"},{icon:a.withCtx(()=>[a.createVNode(a.unref(gu),{size:16})]),_:1},8,["color","disabled"]),a.createVNode(W,{color:a.unref(b)?.isActive("blockquote")?"primary":"secondary",size:"sm",icon:"",squircle:"",onClick:C[12]||(C[12]=w=>a.unref(b)?.chain().focus().toggleBlockquote().run()),disabled:n.disabled,title:"Quote"},{icon:a.withCtx(()=>[a.createVNode(a.unref(ku),{size:16})]),_:1},8,["color","disabled"]),a.createVNode(W,{color:a.unref(b)?.isActive("codeBlock")?"primary":"secondary",size:"sm",icon:"",squircle:"",onClick:C[13]||(C[13]=w=>a.unref(b)?.chain().focus().toggleCodeBlock().run()),disabled:n.disabled,title:"Code Block"},{icon:a.withCtx(()=>[a.createVNode(a.unref(au),{size:16})]),_:1},8,["color","disabled"])]),a.createVNode(tt,{orientation:"vertical",spacing:"28px",margin:"4px"}),a.createElementVNode("div",n1,[a.createVNode(W,{color:"secondary",size:"sm",icon:"",squircle:"",onClick:C[14]||(C[14]=w=>a.unref(b)?.chain().focus().setHorizontalRule().run()),disabled:n.disabled,title:"Horizontal Rule"},{icon:a.withCtx(()=>[a.createVNode(a.unref(El),{size:16})]),_:1},8,["disabled"]),a.createVNode(W,{color:"secondary",size:"sm",icon:"",squircle:"",disabled:!a.unref(b)?.can().undo()||n.disabled,onClick:C[15]||(C[15]=w=>a.unref(b)?.chain().focus().undo().run()),title:"Undo (Ctrl+Z)"},{icon:a.withCtx(()=>[a.createVNode(a.unref(Cu),{size:16})]),_:1},8,["disabled"]),a.createVNode(W,{color:"secondary",size:"sm",icon:"",squircle:"",disabled:!a.unref(b)?.can().redo()||n.disabled,onClick:C[16]||(C[16]=w=>a.unref(b)?.chain().focus().redo().run()),title:"Redo (Ctrl+Y)"},{icon:a.withCtx(()=>[a.createVNode(a.unref(bu),{size:16})]),_:1},8,["disabled"])]),n.customControls&&n.customControls.length>0?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createVNode(tt,{orientation:"vertical",spacing:"28px",margin:"4px"}),a.createElementVNode("div",r1,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.customControls,(w,M)=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:M},[w.action?(a.openBlock(),a.createBlock(W,{key:0,color:"secondary",size:"sm",icon:!w.label,squircle:"",onClick:A=>k(w),disabled:n.disabled,title:w.tooltip||w.label},a.createSlots({default:a.withCtx(()=>[w.label&&w.icon?(a.openBlock(),a.createElementBlock("span",i1,a.toDisplayString(w.label),1)):w.label?(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createTextVNode(a.toDisplayString(w.label),1)],64)):a.createCommentVNode("",!0)]),_:2},[w.icon?{name:"icon",fn:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(w.icon),{size:16}))]),key:"0"}:void 0]),1032,["icon","onClick","disabled","title"])):w.list?(a.openBlock(),a.createElementBlock("div",o1,[a.createVNode(W,{ref_for:!0,ref:A=>x(A,M),color:"secondary",size:"sm",squircle:"",onClick:A=>y(M),disabled:n.disabled,title:w.tooltip||w.label,class:a.normalizeClass({"input-richtext-dropdown-open":c.value===M})},a.createSlots({"trailing-icon":a.withCtx(()=>[a.createVNode(a.unref(Pr),{size:14,class:"input-richtext-dropdown-arrow"})]),default:a.withCtx(()=>[w.label?(a.openBlock(),a.createElementBlock("span",s1,a.toDisplayString(w.label),1)):a.createCommentVNode("",!0)]),_:2},[w.icon?{name:"leading-icon",fn:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(w.icon),{size:16}))]),key:"0"}:void 0]),1032,["onClick","disabled","title","class"])])):a.createCommentVNode("",!0)],64))),128))])],64)):a.createCommentVNode("",!0)]),(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[c.value!==null&&n.customControls?.[c.value]?.list?(a.openBlock(),a.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:u,class:"input-richtext-dropdown",style:a.normalizeStyle(a.unref(f))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.customControls[c.value].list,(w,M)=>(a.openBlock(),a.createElementBlock("button",{key:M,class:"input-richtext-dropdown-item",onClick:A=>S(w),type:"button"},[w.icon?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(w.icon),{key:0,size:16,class:"input-richtext-dropdown-item-icon"})):a.createCommentVNode("",!0),a.createElementVNode("span",a1,a.toDisplayString(w.label),1)],8,l1))),128))],4)):a.createCommentVNode("",!0)])),a.createElementVNode("div",c1,[a.createVNode(a.unref(dk),{editor:a.unref(b),class:"input-richtext-editor",id:n.inputId},null,8,["editor","id"])]),o.value?(a.openBlock(),a.createElementBlock("span",{key:0,ref_key:"slotContentRef",ref:s,class:"sr-only","aria-hidden":"true"},[a.renderSlot(v.$slots,"default",{},void 0,!0)],512)):a.createCommentVNode("",!0)],2))}}),u1=de(d1,[["__scopeId","data-v-5216bae2"]]),f1={class:"pincode-inputs"},h1={key:0,class:"pincode-icon pincode-icon-leading"},p1=["value","disabled","readonly","tabindex","data-index","onInput","onKeydown","onFocus"],m1={key:1,class:"pincode-divider"},g1={key:1,class:"pincode-icon pincode-icon-trailing"},y1=a.defineComponent({__name:"UiInput.Pincode",props:{maxLength:{default:6},variant:{default:"numeric"},divider:{},hasLeadingIcon:{type:Boolean,default:!1},hasTrailingIcon:{type:Boolean,default:!1},label:{},helpText:{},modelValue:{},value:{},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},required:{type:Boolean},fullWidth:{type:Boolean},inputId:{},error:{type:[Boolean,String,Error]},size:{default:"md"},tabindex:{}},emits:["update:modelValue","blur","focus","complete"],setup(n,{emit:e}){const t=n,r=e,i=a.ref([]),o=a.ref(-1),s=a.computed(()=>{const x=(t.modelValue||"").split("");for(;x.length<t.maxLength;)x.push("");return x.slice(0,t.maxLength)}),l=a.computed(()=>t.divider?typeof t.divider=="number"?t.divider:t.divider.count:0),c=a.computed(()=>t.divider?typeof t.divider=="number"?"-":typeof t.divider=="object"&&"character"in t.divider&&t.divider.character||"-":""),d=a.computed(()=>typeof t.divider=="object"&&"component"in t.divider&&t.divider.component==="divider"),u=a.computed(()=>d.value?{orientation:"vertical",variant:"solid",thickness:"1px",margin:"0",spacing:"1.5rem",...t.divider.props}:{}),f=S=>!l.value||S===t.maxLength?!1:S%l.value===0,h=()=>{switch(t.variant){case"numeric":return/^[0-9]$/;case"alpha":return/^[a-zA-Z]$/;case"alphanumeric":return/^[a-zA-Z0-9]$/;default:return/^[0-9]$/}},p=(S,x)=>{const b=S.target,C=b.value.slice(-1);if(!h().test(C)&&C!==""){b.value=s.value[x];return}const M=[...s.value];M[x]=C;const A=M.join("");r("update:modelValue",A),C&&x<t.maxLength-1&&a.nextTick(()=>{const $=i.value[x+1];$&&($.focus(),$.select())}),A.length===t.maxLength&&r("complete",A)},m=(S,x)=>{const b=S.key;if(b==="Backspace"){S.preventDefault();const v=[...s.value];s.value[x]?(v[x]="",r("update:modelValue",v.join(""))):x>0&&(v[x-1]="",r("update:modelValue",v.join("")),a.nextTick(()=>{const C=i.value[x-1];C&&C.focus()}))}else if(b==="ArrowLeft"&&x>0){S.preventDefault();const v=i.value[x-1];v&&v.focus()}else if(b==="ArrowRight"&&x<t.maxLength-1){S.preventDefault();const v=i.value[x+1];v&&v.focus()}else if(b==="Delete"){S.preventDefault();const v=[...s.value];v[x]="",r("update:modelValue",v.join(""))}},g=S=>{S.preventDefault();const x=S.clipboardData?.getData("text")||"",b=h(),v=x.split("").filter(C=>b.test(C)).slice(0,t.maxLength).join("");if(v){r("update:modelValue",v);const C=v.length<t.maxLength?v.length:t.maxLength-1;a.nextTick(()=>{const w=i.value[C];w&&w.focus()}),v.length===t.maxLength&&r("complete",v)}},y=S=>{o.value=S;const x=i.value[S];x&&x.select()},k=S=>{o.value=-1,r("blur",S)};return a.watch(()=>t.modelValue,S=>{S||a.nextTick(()=>{const x=i.value[0];x&&!t.disabled&&!t.readonly&&x.focus()})}),(S,x)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["pincode-wrapper",[`pincode-size-${n.size}`,{"pincode-error":n.error}]])},[a.createElementVNode("div",f1,[a.renderSlot(S.$slots,"leading",{},void 0,!0),t.hasLeadingIcon?(a.openBlock(),a.createElementBlock("div",h1,[a.renderSlot(S.$slots,"leading-icon",{},void 0,!0)])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.maxLength,b=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:b},[a.createElementVNode("input",{ref_for:!0,ref_key:"pincodeRefs",ref:i,type:"text",class:a.normalizeClass(["pincode-input",{"pincode-input-filled":s.value[b-1],"pincode-input-focused":o.value===b-1}]),value:s.value[b-1],disabled:n.disabled,readonly:n.readonly,tabindex:n.disabled?-1:void 0,"data-index":b-1,maxlength:"1",onInput:v=>p(v,b-1),onKeydown:v=>m(v,b-1),onFocus:v=>y(b-1),onBlur:k,onPaste:g},null,42,p1),f(b)&&d.value?(a.openBlock(),a.createBlock(tt,a.mergeProps({key:0,ref_for:!0},u.value,{class:"pincode-custom-divider"}),null,16)):f(b)?(a.openBlock(),a.createElementBlock("span",m1,a.toDisplayString(c.value),1)):a.createCommentVNode("",!0)],64))),128)),t.hasTrailingIcon?(a.openBlock(),a.createElementBlock("div",g1,[a.renderSlot(S.$slots,"trailing-icon",{},void 0,!0)])):a.createCommentVNode("",!0),a.renderSlot(S.$slots,"trailing",{},void 0,!0)])],2))}}),k1=de(y1,[["__scopeId","data-v-12f41567"]]);function b1(n,e){const t=n[e];if(!t)return!1;const r=t();return!r||r.length===0?!1:r.some(i=>!!(i.children&&i.children!==""||i.type&&typeof i.type=="object"||i.props&&Object.keys(i.props).length>0))}const v1=["for"],x1={key:0,class:"input-required"},w1={key:1,class:"input-hint"},C1={key:2,class:"input-error-text"},S1={key:3,class:"input-help-text"},M1=a.defineComponent({__name:"UiInput",props:{type:{},min:{},max:{},step:{},autocomplete:{},spellcheck:{type:Boolean},hasLeadingIcon:{type:Boolean},hasTrailingIcon:{type:Boolean},label:{},helpText:{},modelValue:{},value:{},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},required:{type:Boolean},fullWidth:{type:Boolean},inputId:{},error:{type:[Boolean,String,Error]},size:{},tabindex:{},options:{},multiple:{type:Boolean},searchable:{type:Boolean},allowInsert:{type:Boolean},maxDropdownHeight:{},noOptionsText:{},searchPlaceholder:{},rows:{},cols:{},maxlength:{},resizable:{type:Boolean},accept:{},maxFileSize:{},dragDropText:{},selectedText:{},preview:{},format:{},is24Hour:{type:Boolean},minuteStep:{},minHeight:{},maxHeight:{},customControls:{},maxLength:{},variant:{},divider:{}},emits:["update:modelValue","input","change","blur","focus","keydown","file-error","clear-preview","complete"],setup(n,{emit:e}){const t=n,r=e,i=a.useSlots(),o=a.ref(""),s=a.computed(()=>t.modelValue!==void 0?t.modelValue:t.value!==void 0?t.value:o.value);a.watch(()=>t.value,k=>{k!==void 0&&(o.value=k)},{immediate:!0}),a.watch(()=>t.modelValue,k=>{k!==void 0&&(o.value=k)},{immediate:!0});const l=a.computed(()=>`input-${Math.random().toString(36).substring(2,11)}`),c=k=>b1(i,k),d=a.computed(()=>{const k=["text","email","password","number","tel","url","search"],S=t.type||"text";return k.includes(S)}),u=k=>{o.value=k,r("update:modelValue",k),r("input",k),r("change",k)},f=k=>{r("blur",k)},h=k=>{r("focus",k)},p=k=>{r("keydown",k)},m=k=>{r("file-error",k)},g=()=>{r("clear-preview")},y=k=>{r("complete",k)};return(k,S)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["input-container",{"input-container--full-width":t.fullWidth,[`input-container--${t.size||"md"}`]:!0}])},[t.label?(a.openBlock(),a.createElementBlock("label",{key:0,for:l.value,tabindex:"-1",class:"input-label"},[a.createTextVNode(a.toDisplayString(t.label)+" ",1),t.required?(a.openBlock(),a.createElementBlock("span",x1,"*")):a.createCommentVNode("",!0)],8,v1)):a.createCommentVNode("",!0),a.createElementVNode("div",null,[d.value?(a.openBlock(),a.createBlock(Bu,{key:0,"model-value":s.value,type:n.type,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,required:t.required,min:t.min,max:t.max,step:t.step,autocomplete:t.autocomplete,spellcheck:t.spellcheck,"input-id":l.value,error:!!(t.error&&t.error!==!0&&t.error!==""),size:t.size,tabindex:n.tabindex,"has-leading-icon":c("leading-icon"),"has-trailing-icon":c("trailing-icon"),"onUpdate:modelValue":u,onBlur:f,onFocus:h,onKeydown:p},{leading:a.withCtx(()=>[a.renderSlot(k.$slots,"leading",{},void 0,!0)]),"leading-icon":a.withCtx(()=>[a.renderSlot(k.$slots,"leading-icon",{},void 0,!0)]),"trailing-icon":a.withCtx(()=>[a.renderSlot(k.$slots,"trailing-icon",{},void 0,!0)]),trailing:a.withCtx(()=>[a.renderSlot(k.$slots,"trailing",{},void 0,!0)]),_:3},8,["model-value","type","placeholder","disabled","readonly","required","min","max","step","autocomplete","spellcheck","input-id","error","size","tabindex","has-leading-icon","has-trailing-icon"])):n.type==="textarea"?(a.openBlock(),a.createBlock(Ru,{key:1,"model-value":s.value,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,required:t.required,rows:t.rows,cols:t.cols,maxlength:t.maxlength,autocomplete:t.autocomplete,spellcheck:t.spellcheck,resizable:t.resizable,"input-id":l.value,error:t.error,size:t.size,tabindex:n.tabindex,"has-leading-icon":c("leading-icon"),"has-trailing-icon":c("trailing-icon"),"onUpdate:modelValue":u,onBlur:f,onFocus:h,onKeydown:p},a.createSlots({leading:a.withCtx(()=>[a.renderSlot(k.$slots,"leading",{},void 0,!0)]),"leading-icon":a.withCtx(()=>[a.renderSlot(k.$slots,"leading-icon",{},void 0,!0)]),"trailing-icon":a.withCtx(()=>[a.renderSlot(k.$slots,"trailing-icon",{},void 0,!0)]),trailing:a.withCtx(()=>[a.renderSlot(k.$slots,"trailing",{},void 0,!0)]),_:2},[c("default")?{name:"default",fn:a.withCtx(()=>[a.renderSlot(k.$slots,"default",{},void 0,!0)]),key:"0"}:void 0]),1032,["model-value","placeholder","disabled","readonly","required","rows","cols","maxlength","autocomplete","spellcheck","resizable","input-id","error","size","tabindex","has-leading-icon","has-trailing-icon"])):n.type==="select"?(a.openBlock(),a.createBlock(Xu,{key:2,"model-value":s.value,options:t.options,placeholder:n.placeholder,disabled:n.disabled,multiple:t.multiple,searchable:t.searchable,"allow-insert":t.allowInsert,"max-dropdown-height":t.maxDropdownHeight,"no-options-text":t.noOptionsText,"search-placeholder":t.searchPlaceholder,"input-id":l.value,error:t.error,size:t.size,tabindex:n.tabindex,"has-leading-icon":c("leading-icon"),"has-trailing-icon":c("trailing-icon"),"onUpdate:modelValue":u,onBlur:f,onFocus:h},{leading:a.withCtx(()=>[a.renderSlot(k.$slots,"leading",{},void 0,!0)]),"leading-icon":a.withCtx(()=>[a.renderSlot(k.$slots,"leading-icon",{},void 0,!0)]),"trailing-icon":a.withCtx(()=>[a.renderSlot(k.$slots,"trailing-icon",{},void 0,!0)]),trailing:a.withCtx(()=>[a.renderSlot(k.$slots,"trailing",{},void 0,!0)]),_:3},8,["model-value","options","placeholder","disabled","multiple","searchable","allow-insert","max-dropdown-height","no-options-text","search-placeholder","input-id","error","size","tabindex","has-leading-icon","has-trailing-icon"])):n.type==="file"?(a.openBlock(),a.createBlock(kf,{key:3,"model-value":s.value,accept:t.accept,multiple:t.multiple,"max-file-size":t.maxFileSize,"drag-drop-text":t.dragDropText,"selected-text":t.selectedText,preview:t.preview,disabled:n.disabled,required:t.required,"input-id":l.value,error:t.error,size:t.size,tabindex:n.tabindex,"has-leading-icon":c("leading-icon"),"has-trailing-icon":c("trailing-icon"),"onUpdate:modelValue":u,onFileError:m,onClearPreview:g,onBlur:f,onFocus:h},{leading:a.withCtx(()=>[a.renderSlot(k.$slots,"leading",{},void 0,!0)]),"leading-icon":a.withCtx(()=>[a.renderSlot(k.$slots,"leading-icon",{},void 0,!0)]),"trailing-icon":a.withCtx(()=>[a.renderSlot(k.$slots,"trailing-icon",{},void 0,!0)]),trailing:a.withCtx(()=>[a.renderSlot(k.$slots,"trailing",{},void 0,!0)]),_:3},8,["model-value","accept","multiple","max-file-size","drag-drop-text","selected-text","preview","disabled","required","input-id","error","size","tabindex","has-leading-icon","has-trailing-icon"])):n.type==="date"?(a.openBlock(),a.createBlock(Qf,{key:4,"model-value":s.value,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,required:t.required,min:t.min,max:t.max,"input-id":l.value,error:t.error,size:t.size,tabindex:n.tabindex,"onUpdate:modelValue":u,onBlur:f,onFocus:h},null,8,["model-value","placeholder","disabled","readonly","required","min","max","input-id","error","size","tabindex"])):n.type==="time"?(a.openBlock(),a.createBlock(Xf,{key:5,"model-value":s.value,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,required:t.required,"input-id":l.value,error:t.error,size:t.size,tabindex:n.tabindex,"onUpdate:modelValue":u,onBlur:f,onFocus:h},null,8,["model-value","placeholder","disabled","readonly","required","input-id","error","size","tabindex"])):n.type==="datetime"?(a.openBlock(),a.createBlock(Zf,{key:6,"model-value":s.value,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,required:t.required,min:t.min,max:t.max,"input-id":l.value,error:t.error,size:t.size,tabindex:n.tabindex,"onUpdate:modelValue":u,onBlur:f,onFocus:h},null,8,["model-value","placeholder","disabled","readonly","required","min","max","input-id","error","size","tabindex"])):n.type==="richtext"?(a.openBlock(),a.createBlock(u1,{key:7,"model-value":s.value,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,"input-id":l.value,error:t.error,"min-height":t.minHeight,"max-height":t.maxHeight,"custom-controls":t.customControls,tabindex:n.tabindex,"onUpdate:modelValue":u,onBlur:f,onFocus:h},a.createSlots({_:2},[c("default")?{name:"default",fn:a.withCtx(()=>[a.renderSlot(k.$slots,"default",{},void 0,!0)]),key:"0"}:void 0]),1032,["model-value","placeholder","disabled","readonly","input-id","error","min-height","max-height","custom-controls","tabindex"])):n.type==="pincode"?(a.openBlock(),a.createBlock(k1,{key:8,"model-value":s.value,"max-length":t.maxLength||6,variant:t.variant||"numeric",divider:t.divider,disabled:n.disabled,readonly:n.readonly,"input-id":l.value,error:t.error,size:t.size,tabindex:n.tabindex,"onUpdate:modelValue":u,onBlur:f,onFocus:h,onComplete:y},a.createSlots({_:2},[c("leading")?{name:"leading",fn:a.withCtx(()=>[a.renderSlot(k.$slots,"leading",{},void 0,!0)]),key:"0"}:void 0,c("leading-icon")?{name:"leading-icon",fn:a.withCtx(()=>[a.renderSlot(k.$slots,"leading-icon",{},void 0,!0)]),key:"1"}:void 0,c("trailing-icon")?{name:"trailing-icon",fn:a.withCtx(()=>[a.renderSlot(k.$slots,"trailing-icon",{},void 0,!0)]),key:"2"}:void 0,c("trailing")?{name:"trailing",fn:a.withCtx(()=>[a.renderSlot(k.$slots,"trailing",{},void 0,!0)]),key:"3"}:void 0]),1032,["model-value","max-length","variant","divider","disabled","readonly","input-id","error","size","tabindex"])):a.createCommentVNode("",!0)]),k.$slots.hint?(a.openBlock(),a.createElementBlock("div",w1,[a.renderSlot(k.$slots,"hint",{},void 0,!0)])):a.createCommentVNode("",!0),t.error&&t.error!==!0?(a.openBlock(),a.createElementBlock("p",C1,a.toDisplayString(typeof t.error=="string"?t.error:t.error?.message||String(t.error)),1)):t.helpText?(a.openBlock(),a.createElementBlock("p",S1,a.toDisplayString(t.helpText),1)):a.createCommentVNode("",!0)],2))}}),ni=de(M1,[["__scopeId","data-v-e216292d"]]),T1=["disabled","aria-disabled"],E1=["href","target","rel","aria-disabled"],N1=a.defineComponent({__name:"UiLink",props:{href:{},to:{},variant:{default:"primary"},size:{default:"md"},disabled:{type:Boolean,default:!1},external:{type:Boolean,default:!1},color:{}},emits:["click"],setup(n,{emit:e}){const t=n,r=e,i=a.computed(()=>{if(t.href)return t.href;if(t.to){if(typeof t.to=="string")return t.to;if(typeof t.to=="object"&&t.to)return"#route-object-not-supported"}return"#"});function o(){if(typeof window<"u"){const u=getComputedStyle(document.documentElement).getPropertyValue("--strands-accent").trim();if(u)return u}return"#EA00A8"}const s=()=>({primary:o(),success:"#059669",warning:"#d97706",danger:"#dc2626"}),l=u=>{const f=s();return`color-mix(in srgb, ${f[u]||f.primary} 85%, black 15%)`},c=a.computed(()=>{if(!t.color)return{};const u=s(),f=u[t.color]||u.primary,h=l(t.color),p={"--link-color":f,"--link-hover-color":h,color:f};return t.variant==="underline"?{...p,textDecorationColor:f}:p}),d=u=>{t.disabled||r("click",u)};return(u,f)=>!n.to&&!n.href?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:a.normalizeClass(["ui-link",[`ui-link-${n.variant}`,`ui-link-${n.size}`,{"ui-link-disabled":n.disabled},{"ui-link-custom-color":n.color}]]),style:a.normalizeStyle(c.value),disabled:n.disabled,"aria-disabled":n.disabled,onClick:d},[a.renderSlot(u.$slots,"default",{},void 0,!0)],14,T1)):(a.openBlock(),a.createElementBlock("a",{key:1,class:a.normalizeClass(["ui-link",[`ui-link-${n.variant}`,`ui-link-${n.size}`,{"ui-link-disabled":n.disabled},{"ui-link-custom-color":n.color}]]),style:a.normalizeStyle(c.value),href:i.value,target:n.external?"_blank":void 0,rel:n.external?"noopener noreferrer":void 0,"aria-disabled":n.disabled,onClick:d},[a.renderSlot(u.$slots,"default",{},void 0,!0)],14,E1))}}),Zo=de(N1,[["__scopeId","data-v-3bf99110"]]),A1={StrandsUiAlert:co,StrandsUiButton:W,StrandsUiCard:uo,StrandsUiInput:ni,StrandsUiLink:Zo,StrandsUiTabs:Fr,StrandsUiLoader:zr},nd={install(n,e={}){const{prefix:t=""}=e;Object.entries(A1).forEach(([r,i])=>{const o=t?`${t}${r}`:r;n.component(o,i)})}},B1=Object.freeze(Object.defineProperty({__proto__:null,StrandsUiAlert:co,StrandsUiButton:W,StrandsUiCard:uo,StrandsUiInput:ni,StrandsUiLink:Zo,StrandsUiLoader:zr,StrandsUiTabs:Fr,default:nd},Symbol.toStringTag,{value:"Module"}));exports.ChevronDown=Pr;exports.Minus=El;exports.StrandsUIPlugin=nd;exports.StrandsUIPlugin$1=B1;exports.StrandsUiAlert=co;exports.StrandsUiButton=W;exports.StrandsUiCard=uo;exports.StrandsUiInput=ni;exports.StrandsUiLink=Zo;exports.StrandsUiLoader=zr;exports.StrandsUiTabs=Fr;exports.UiButtonContent=Wt;exports.UiDivider=tt;exports.UiTooltip=Tl;exports._export_sfc=de;exports._sfc_main=Oi;exports._sfc_main$1=Di;exports._sfc_main$2=Ii;exports.createLucideIcon=J;exports.useFloatingPosition=Vr;