@oneclick.dev/cms-core-modules 0.0.61 → 0.0.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ContentEditor-BAepN3Yd.js → ContentEditor-DKFCmfOs.js} +1 -1
- package/dist/{ContentEditor-BPjWW3d1.mjs → ContentEditor-owdOIage.mjs} +1 -1
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-DRVxQswt.js +1 -0
- package/dist/{NewReservationDialog.vue_vue_type_script_setup_true_lang-BJitmbPE.mjs → NewReservationDialog.vue_vue_type_script_setup_true_lang-DkgDWC2i.mjs} +130 -125
- package/dist/{Overview-DtWvKB3W.mjs → Overview-DiBYtvEX.mjs} +124 -119
- package/dist/Overview-qP1guKjx.js +1 -0
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-B7ks5mbf.mjs +2332 -0
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-Vxubki_v.js +349 -0
- package/dist/{TableView-_2cP-w_7.js → TableView-BqhL_P45.js} +100 -100
- package/dist/{TableView-DlhHyuUZ.mjs → TableView-Dbl8qcUy.mjs} +14991 -14728
- package/dist/agenda-DFNJ8C1N.mjs +1136 -0
- package/dist/agenda-MjkwV63A.js +1 -0
- package/dist/floating-ui.dom-CBBY0Ism.js +1 -0
- package/dist/floating-ui.dom-xfqXu4GA.mjs +1138 -0
- package/dist/{index-DTago6vW-Bhr8E1Y6.js → index-CgfL8UKf-DAN7RkzR.js} +10 -10
- package/dist/{index-DTago6vW-CnomHQ_S.mjs → index-CgfL8UKf-DUUg9HDA.mjs} +904 -875
- package/dist/index-DBDq-h4j.js +245 -0
- package/dist/{index-BDaVYdkD.mjs → index-X0L4AHBR.mjs} +2406 -2394
- package/dist/index-YMaY4uuk-BgpTtr73.js +1 -0
- package/dist/{index-YMaY4uuk-BshejgNP.mjs → index-YMaY4uuk-C_xV5K9Z.mjs} +13 -14
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +6 -6
- package/dist/orders-Bqa3Z3tH.mjs +356 -0
- package/dist/orders-D5GJOZXN.js +1 -0
- package/dist/src/appointments/components/edit/EventDialog/ApproveReservationDialog.vue.d.ts +8 -0
- package/dist/src/appointments/components/edit/EventDialog/BookingsList.vue.d.ts +39 -9
- package/dist/src/appointments/components/edit/EventDialog/CancelReservationDialog.vue.d.ts +2 -2
- package/dist/src/appointments/components/edit/EventDialog/RejectReservationDialog.vue.d.ts +8 -0
- package/dist/src/appointments/components/edit/EventDialog/ReservationDetailDialog.vue.d.ts +36 -8
- package/dist/src/appointments/components/edit/dashboard/BookingsList.vue.d.ts +46 -9
- package/dist/src/appointments/components/edit/dashboard/Timeline.vue.d.ts +19 -0
- package/dist/src/appointments/pages/edit/orders.vue.d.ts +39 -9
- package/package.json +1 -1
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-D50uTpZY.js +0 -1
- package/dist/Overview-B_99j5eA.js +0 -1
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CI8YgHdU.js +0 -345
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-P-MWwcVh.mjs +0 -2093
- package/dist/agenda-D81m29_4.mjs +0 -1135
- package/dist/agenda-uzPPxgsW.js +0 -1
- package/dist/floating-ui.dom-C82nbomj.js +0 -1
- package/dist/floating-ui.dom-ouSgPqty.mjs +0 -1133
- package/dist/index-DfV8-6ON.js +0 -245
- package/dist/index-YMaY4uuk-BxVT7IpO.js +0 -1
- package/dist/orders-Bh8w0ueq.mjs +0 -346
- package/dist/orders-Dt0zMz97.js +0 -1
- package/dist/src/appointments/components/edit/EventDialog/ResendConfirmationDialog.vue.d.ts +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("vue"),rt=require("@oneclick.dev/cms-kit"),ms=require("./interpolation-We8hT28L.js"),T=require("lucide-vue-next"),se=require("./_plugin-vue_export-helper-BHFhmbuH.js"),Mf=require("./utils-D6CaKJbp.js"),Kp=require("./floating-ui.dom-C82nbomj.js"),Ju=require("./index-4tjmIans.js"),Jp=require("./google-D4N3gb01.js"),Gp={class:"flex flex-wrap gap-1"},Yp={key:0,class:"font-medium"},Xp={key:1,class:"font-medium"},Zp={key:2,class:"font-medium"},Qp={key:3,class:"font-medium"},eF=s.defineComponent({__name:"Status",setup(n){const e=s.inject("status",s.ref(""));return(t,i)=>(s.openBlock(),s.createElementBlock("p",Gp,[s.unref(e)?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[i[0]||(i[0]=s.createElementVNode("span",{class:"opacity-70"},"Status:",-1)),i[1]||(i[1]=s.createTextVNode(" "+s.toDisplayString(" ")+" ",-1)),s.unref(e)==="new"?(s.openBlock(),s.createElementBlock("strong",Yp,"New Draft")):s.createCommentVNode("",!0),s.unref(e)==="draft"?(s.openBlock(),s.createElementBlock("strong",Xp,"Draft")):s.createCommentVNode("",!0),s.unref(e)==="archived"?(s.openBlock(),s.createElementBlock("strong",Zp,"Archived")):s.unref(e)==="published"?(s.openBlock(),s.createElementBlock("strong",Qp,"Published")):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0)]))}}),tF={class:"flex flex-col"},nF={class:"flex justify-between items-center p-3 xl:p-4"},iF={class:"relative group min-w-[320px] @2xl:min-w-[500px] max-w-4xl"},aF={class:"pl-4 pr-6 py-2 -ml-1.5 -my-2 rounded text-2xl pointer-events-none opacity-0 select-none whitespace-nowrap overflow-hidden"},oF={class:"flex items-center justify-between gap-12 bg-input/30 pl-2 xl:pl-5 pr-3 xl:pr-4 py-3 xl:py-4 border-y"},rF={class:"flex gap-4 xl:gap-6 text-sm"},sF={key:0,class:"flex flex-wrap gap-1"},lF={class:"font-medium"},uF={key:1,class:"flex flex-wrap gap-1"},dF={class:"font-medium"},fF={class:"flex gap-2"},cF={class:"flex"},gF={key:0},_F={key:0},hF={key:0},mF=s.defineComponent({__name:"Header",props:{config:{type:Object,required:!0},createdAt:{type:Date,required:!0},updatedAt:{type:Date,required:!1},liveByLocale:{type:Array,default:()=>[]}},emits:["saveDraft","publishEntry","unpublishEntry","archiveEntry","unarchiveToDrafts","publishAllEntries","deleteEntry","previewEntry"],setup(n,{emit:e}){const t=e,i=s.inject("activeView",s.ref("edit")),a=s.inject("status",s.ref("")),o=s.inject("entryId",s.ref("")),r=s.inject("activeEntryVersion",s.ref("")),l=s.inject("isSaving",s.ref(!1)),u=s.inject("title",s.ref("")),d=s.ref(u.value);function f(){u.value=d.value}return(c,g)=>{const _=s.resolveComponent("SegmentedControlButton"),h=s.resolveComponent("SegmentedControl"),p=s.resolveComponent("Button"),m=s.resolveComponent("DropdownMenuTrigger"),F=s.resolveComponent("DropdownMenuItem"),y=s.resolveComponent("DropdownMenuGroup"),k=s.resolveComponent("DropdownMenuContent"),b=s.resolveComponent("DropdownMenu");return s.openBlock(),s.createElementBlock("div",tF,[s.createElementVNode("div",nF,[s.createElementVNode("div",iF,[s.createElementVNode("p",aF,s.toDisplayString(s.unref(u)||"Please enter a title"),1),s.withDirectives(s.createElementVNode("input",{class:"absolute w-[calc(100%+1rem)] top-0 pl-4 pr-6 py-2 -ml-1.5 -my-2 rounded text-2xl group-hover:bg-input/30 focus:bg-input/50 focus-visible:outline-0 focus-visible:ring-1 focus-visible:ring-ring/50","onUpdate:modelValue":g[0]||(g[0]=w=>s.isRef(u)?u.value=w:null),onFocus:g[1]||(g[1]=w=>d.value=s.unref(u)),onKeydown:s.withKeys(f,["esc"]),placeholder:"Please enter a title"},null,544),[[s.vModelText,s.unref(u)]])]),s.createElementVNode("div",null,[s.unref(o)?(s.openBlock(),s.createBlock(h,{key:0,modelValue:s.unref(i),"onUpdate:modelValue":g[2]||(g[2]=w=>s.isRef(i)?i.value=w:null),"allow-empty":""},{default:s.withCtx(()=>[s.createVNode(_,{value:"edit"},{default:s.withCtx(()=>[...g[13]||(g[13]=[s.createElementVNode("span",{class:"block whitespace-nowrap"},"Edit",-1)])]),_:1}),s.createVNode(_,{value:"preview"},{default:s.withCtx(()=>[...g[14]||(g[14]=[s.createElementVNode("span",{class:"block whitespace-nowrap"},"Live Preview",-1)])]),_:1}),s.unref(o)!=="new"&&s.unref(r)?(s.openBlock(),s.createBlock(_,{key:0,value:"versions"},{default:s.withCtx(()=>[...g[15]||(g[15]=[s.createElementVNode("span",{class:"block whitespace-nowrap"},"Versions",-1)])]),_:1})):s.createCommentVNode("",!0),s.createVNode(_,{value:"api"},{default:s.withCtx(()=>[...g[16]||(g[16]=[s.createElementVNode("span",{class:"block whitespace-nowrap"},"API",-1)])]),_:1})]),_:1},8,["modelValue"])):s.createCommentVNode("",!0)])]),s.createElementVNode("div",oF,[s.createElementVNode("div",rF,[s.createVNode(eF),s.unref(a)!=="new"&&n.updatedAt?(s.openBlock(),s.createElementBlock("p",sF,[g[17]||(g[17]=s.createElementVNode("span",{class:"opacity-70"},"Last Modified:",-1)),g[18]||(g[18]=s.createTextVNode()),s.createElementVNode("strong",lF,s.toDisplayString(new Date(n.updatedAt)?.toLocaleString()),1)])):s.createCommentVNode("",!0),s.unref(a)!=="new"&&n.createdAt?(s.openBlock(),s.createElementBlock("p",uF,[g[19]||(g[19]=s.createElementVNode("span",{class:"opacity-70"},"Created:",-1)),g[20]||(g[20]=s.createTextVNode()),s.createElementVNode("strong",dF,s.toDisplayString(new Date(n.createdAt)?.toLocaleString()),1)])):s.createCommentVNode("",!0)]),s.createElementVNode("div",fF,[s.createVNode(p,{variant:"secondary",class:"border bg-white hover:bg-white dark:bg-transparent dark:hover:bg-muted/20",onClick:g[3]||(g[3]=w=>t("previewEntry"))},{default:s.withCtx(()=>[s.createVNode(s.unref(T.Link),{class:"size-4"}),g[21]||(g[21]=s.createTextVNode(" Preview ",-1))]),_:1}),s.createElementVNode("div",cF,[s.unref(a)==="published"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createVNode(p,{class:"rounded-r-none",onClick:g[4]||(g[4]=w=>t("publishEntry"))},{default:s.withCtx(()=>[s.unref(l)?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createVNode(s.unref(T.Loader2),{class:"size-4 animate-spin ml-2"}),g[22]||(g[22]=s.createElementVNode("span",null,"Publishing...",-1))],64)):(s.openBlock(),s.createElementBlock("span",gF,"Publish changes"))]),_:1}),g[25]||(g[25]=s.createElementVNode("div",{class:"w-[1px] h-full bg-muted/30"},null,-1)),s.createVNode(b,null,{default:s.withCtx(()=>[s.createVNode(m,{"as-child":""},{default:s.withCtx(()=>[s.createVNode(p,{class:"rounded-l-none",size:"icon"},{default:s.withCtx(()=>[s.createVNode(s.unref(T.ChevronDown),{class:"size-4"})]),_:1})]),_:1}),s.createVNode(k,{class:"w-56"},{default:s.withCtx(()=>[s.createVNode(y,null,{default:s.withCtx(()=>[s.createVNode(F,{onClick:g[5]||(g[5]=w=>t("unpublishEntry"))},{default:s.withCtx(()=>[...g[23]||(g[23]=[s.createTextVNode("Unpublish (draft)",-1)])]),_:1}),s.createVNode(F,{onClick:g[6]||(g[6]=w=>t("archiveEntry"))},{default:s.withCtx(()=>[...g[24]||(g[24]=[s.createTextVNode("Archive",-1)])]),_:1})]),_:1})]),_:1})]),_:1})],64)):s.unref(a)==="archived"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createVNode(p,{class:"rounded-r-none",onClick:g[7]||(g[7]=w=>t("unarchiveToDrafts"))},{default:s.withCtx(()=>[s.unref(l)?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createVNode(s.unref(T.Loader2),{class:"size-4 animate-spin ml-2"}),g[26]||(g[26]=s.createElementVNode("span",null,"Unarchiving...",-1))],64)):(s.openBlock(),s.createElementBlock("span",_F,"Unarchive (to Drafts)"))]),_:1}),g[29]||(g[29]=s.createElementVNode("div",{class:"w-[1px] h-full bg-muted/30"},null,-1)),s.createVNode(b,null,{default:s.withCtx(()=>[s.createVNode(m,{"as-child":""},{default:s.withCtx(()=>[s.createVNode(p,{class:"rounded-l-none",size:"icon"},{default:s.withCtx(()=>[s.createVNode(s.unref(T.ChevronDown),{class:"size-4"})]),_:1})]),_:1}),s.createVNode(k,{class:"w-56"},{default:s.withCtx(()=>[s.createVNode(y,null,{default:s.withCtx(()=>[s.createVNode(F,{onClick:g[8]||(g[8]=w=>t("publishAllEntries"))},{default:s.withCtx(()=>[...g[27]||(g[27]=[s.createTextVNode("Publish all",-1)])]),_:1}),s.createVNode(F,{onClick:g[9]||(g[9]=w=>t("deleteEntry"))},{default:s.withCtx(()=>[...g[28]||(g[28]=[s.createTextVNode("Delete completely",-1)])]),_:1})]),_:1})]),_:1})]),_:1})],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:2},[s.createVNode(p,{class:s.normalizeClass({"rounded-r-none":s.unref(a)!=="new"||n.config?.supportedLanguages?.length===1}),onClick:g[10]||(g[10]=w=>t("saveDraft"))},{default:s.withCtx(()=>[s.unref(l)?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createVNode(s.unref(T.Loader2),{class:"size-4 animate-spin ml-2"}),g[30]||(g[30]=s.createElementVNode("span",null,"Saving...",-1))],64)):(s.openBlock(),s.createElementBlock("span",hF,"Save draft"))]),_:1},8,["class"]),g[33]||(g[33]=s.createElementVNode("div",{class:"w-[1px] h-full bg-muted/30"},null,-1)),s.unref(a)!=="new"||n.config?.supportedLanguages?.length===1?(s.openBlock(),s.createBlock(b,{key:0},{default:s.withCtx(()=>[s.createVNode(m,{"as-child":""},{default:s.withCtx(()=>[s.createVNode(p,{class:"rounded-l-none",size:"icon"},{default:s.withCtx(()=>[s.createVNode(s.unref(T.ChevronDown),{class:"size-4"})]),_:1})]),_:1}),s.createVNode(k,{class:"w-56"},{default:s.withCtx(()=>[s.createVNode(y,null,{default:s.withCtx(()=>[s.createVNode(F,{onClick:g[11]||(g[11]=w=>t("publishEntry"))},{default:s.withCtx(()=>[...g[31]||(g[31]=[s.createTextVNode("Publish now",-1)])]),_:1}),n.liveByLocale?.length>0?(s.openBlock(),s.createBlock(F,{key:0,onClick:g[12]||(g[12]=w=>t("archiveEntry"))},{default:s.withCtx(()=>[...g[32]||(g[32]=[s.createTextVNode("Archive",-1)])]),_:1})):s.createCommentVNode("",!0)]),_:1})]),_:1})]),_:1})):s.createCommentVNode("",!0)],64))])])])])}}}),pF={key:0,class:"border-b px-2 xl:px-4 py-4"},r_=s.defineComponent({__name:"ContentSettings",props:{customSettings:{type:Object,required:!0},inputValues:{type:Object,default:()=>({})}},setup(n){const e=s.inject("customSettingsOutput",s.ref(null)),t=i=>{e.value=i};return(i,a)=>{const o=s.resolveComponent("FormDisplayer");return n.customSettings?.layout?(s.openBlock(),s.createElementBlock("div",pF,[s.createVNode(o,{ref:"formDisplayer",settings:n.customSettings,inputValues:n.inputValues,onSetOutput:t},null,8,["settings","inputValues"])])):s.createCommentVNode("",!0)}}}),FF={class:"bg-muted/50"},bF={key:0,class:"flex items-center justify-between p-4"},yF={class:"flex gap-2"},kF={key:1,class:"grid gap-2 px-2 my-4"},wF={class:"relative flex items-center justify-between px-4 py-2 bg-white dark:bg-muted rounded-md border border-muted-foreground/20 z-2"},DF=["onClick"],vF={key:0,class:"flex items-center"},EF={class:"overflow-hidden"},xF={class:"grid gap-4 mb-2"},CF={class:"grid gap-3"},BF={class:"grid gap-3"},SF={class:"grid gap-1"},jF={key:0,class:"text-red-500 text-xs"},AF={class:"grid gap-3"},NF={class:"flex justify-between gap-2 w-full"},qF={class:"flex gap-2 ml-auto"},MF=s.defineComponent({__name:"ContentStructuredContentSections",setup(n){const{isAdmin:e}=rt.useModulePermissions(),{confirm:t}=rt.useConfirmation(),i=s.inject("structuredContentSections",s.ref([])),a=s.inject("structuredContentInput",s.ref(null)),o=s.inject("structuredContentOutput",s.ref(null)),r=s.ref(!1),l=s.ref("add"),u=s.ref(null),d=s.reactive({displayName:"",key:"",form:null}),f=s.ref([]);s.watch(()=>d.displayName,(k,b)=>{let w=b.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9\-]/g,""),D=k.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9\-]/g,"");(d.key===w||d.key==="")&&(d.key=D)});const c=k=>{k||(d.displayName="",d.key="",d.form=null)},g=()=>{i.value.push({displayName:d.displayName,key:d.key,form:d.form?JSON.parse(JSON.stringify(d.form)):null}),r.value=!1,c(!1)},_=()=>{const k=i.value.findIndex(b=>b.key===u.value);if(k!==-1){if(d.key!==u.value){const b=f.value.indexOf(u.value);b!==-1&&f.value.splice(b,1,d.key),o.value&&typeof o.value=="object"&&u.value&&o.value.hasOwnProperty(u.value)&&(o.value[d.key]=o.value[u.value],delete o.value[u.value]),a.value=o.value?JSON.parse(JSON.stringify(o.value)):{}}i.value[k]={displayName:d.displayName,key:d.key,form:d.form?JSON.parse(JSON.stringify(d.form)):null}}r.value=!1,c(!1)},h=(k,b)=>{const w=k+b;if(w<0||w>=i.value.length)return;const D=i.value[k];i.value.splice(k,1),i.value.splice(w,0,D)},p=async()=>{if(!await t("Are you sure you want to delete this section? This action cannot be undone."))return;const b=i.value.findIndex(w=>w.key===u.value);b!==-1&&i.value.splice(b,1),r.value=!1,c(!1)},m=()=>{r.value=!0,l.value="add"},F=k=>{r.value=!0,l.value="edit",u.value=k.key,d.displayName=k.displayName,d.key=k.key,d.form=k.form?JSON.parse(JSON.stringify(k.form)):null},y=(k,b)=>{console.log("setOutput called for key",k,"with val",b),(!o.value||typeof o.value!="object")&&(o.value={}),o.value[k]=b};return(k,b)=>{const w=s.resolveComponent("Button"),D=s.resolveComponent("FormDisplayer"),C=s.resolveComponent("DialogTitle"),E=s.resolveComponent("DialogDescription"),v=s.resolveComponent("DialogHeader"),x=s.resolveComponent("Label"),M=s.resolveComponent("Input"),W=s.resolveComponent("FormBuilderSelect"),G=s.resolveComponent("DialogClose"),S=s.resolveComponent("DialogFooter"),N=s.resolveComponent("DialogContent"),U=s.resolveComponent("Dialog");return s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createElementVNode("div",FF,[s.unref(e)()?(s.openBlock(),s.createElementBlock("div",bF,[s.createElementVNode("p",{class:s.normalizeClass({"opacity-40":!s.unref(i).length,"text-primary":s.unref(i).length})}," Structured content sections ("+s.toDisplayString(s.unref(i).length)+") ",3),s.createElementVNode("div",yF,[s.createVNode(w,{variant:"ghost",size:"icon",onClick:m},{default:s.withCtx(()=>[s.createVNode(s.unref(T.Plus),{class:"size-4 text-primary"})]),_:1}),s.createVNode(w,{variant:"ghost",size:"icon"},{default:s.withCtx(()=>[s.createVNode(s.unref(T.Braces),{class:"size-4 text-primary"})]),_:1})])])):s.createCommentVNode("",!0),s.unref(i).length>0?(s.openBlock(),s.createElementBlock("div",kF,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(i),(j,X)=>(s.openBlock(),s.createElementBlock("div",{key:j.key},[s.createElementVNode("div",wF,[s.createElementVNode("p",{class:"select-none cursor-default hover:bg-background/15 px-3 py-1.5 rounded -ml-3",onClick:ne=>s.unref(f).includes(j.key)?s.unref(f).splice(s.unref(f).indexOf(j.key),1):s.unref(f).push(j.key)},s.toDisplayString(j.displayName||j.key),9,DF),s.unref(e)()?(s.openBlock(),s.createElementBlock("div",vF,[s.createVNode(w,{variant:"ghost",size:"icon",disabled:X===0,onClick:ne=>h(X,-1)},{default:s.withCtx(()=>[s.createVNode(s.unref(T.ArrowUp),{class:"size-4"})]),_:1},8,["disabled","onClick"]),s.createVNode(w,{variant:"ghost",size:"icon",disabled:X===s.unref(i).length-1,onClick:ne=>h(X,1)},{default:s.withCtx(()=>[s.createVNode(s.unref(T.ArrowDown),{class:"size-4"})]),_:1},8,["disabled","onClick"]),s.createVNode(w,{variant:"ghost",size:"icon",onClick:ne=>F(j)},{default:s.withCtx(()=>[s.createVNode(s.unref(T.Cog),{class:"size-4"})]),_:1},8,["onClick"])])):s.createCommentVNode("",!0)]),s.createElementVNode("div",{class:s.normalizeClass(["relative grid transition-all duration-300 z-1 -translate-y-1",{"grid-rows-[1fr]":!s.unref(f).includes(j.key),"grid-rows-[0fr]":s.unref(f).includes(j.key)}])},[s.createElementVNode("div",EF,[s.createElementVNode("div",{class:s.normalizeClass(["px-2 bg-muted/80 dark:bg-background/80 border border-muted-foreground/20 rounded-b-md transition-all duration-300",{"pt-3 pb-2":!s.unref(f).includes(j.key)}])},[(s.openBlock(),s.createBlock(D,{key:`${j.key}-${JSON.stringify(j.form)}`,ref_for:!0,ref:"formDisplayer",settings:j.form,inputValues:s.unref(a)?.[j.key]||{},onSetOutput:ne=>y(j.key,ne),class:"bg-transparent"},null,8,["settings","inputValues","onSetOutput"]))],2)])],2)]))),128))])):s.createCommentVNode("",!0)]),s.createVNode(U,{open:s.unref(r),"onUpdate:open":[b[4]||(b[4]=j=>s.isRef(r)?r.value=j:null),c]},{default:s.withCtx(()=>[s.createVNode(N,{class:"sm:max-w-[425px]"},{default:s.withCtx(()=>[s.unref(l)==="add"?(s.openBlock(),s.createBlock(v,{key:0},{default:s.withCtx(()=>[s.createVNode(C,null,{default:s.withCtx(()=>[...b[5]||(b[5]=[s.createTextVNode("Add structured content section",-1)])]),_:1}),s.createVNode(E,null,{default:s.withCtx(()=>[...b[6]||(b[6]=[s.createTextVNode(" Add a new structured content section to this page. ",-1)])]),_:1})]),_:1})):(s.openBlock(),s.createBlock(v,{key:1},{default:s.withCtx(()=>[s.createVNode(C,null,{default:s.withCtx(()=>[...b[7]||(b[7]=[s.createTextVNode("Edit structured content section",-1)])]),_:1}),s.createVNode(E,null,{default:s.withCtx(()=>[...b[8]||(b[8]=[s.createTextVNode(" Edit the structured content section on this page. ",-1)])]),_:1})]),_:1})),s.createElementVNode("div",xF,[s.createElementVNode("div",CF,[s.createVNode(x,{for:"new-display-name"},{default:s.withCtx(()=>[...b[9]||(b[9]=[s.createTextVNode("Display Name (only visible in editor)",-1)])]),_:1}),s.createVNode(M,{id:"new-display-name",name:"new-display-name",modelValue:s.unref(d).displayName,"onUpdate:modelValue":b[0]||(b[0]=j=>s.unref(d).displayName=j)},null,8,["modelValue"])]),s.createElementVNode("div",BF,[s.createVNode(x,{for:"new-key"},{default:s.withCtx(()=>[...b[10]||(b[10]=[s.createTextVNode("Key (unique identifier)",-1)])]),_:1}),s.createElementVNode("div",SF,[s.createVNode(M,{id:"new-key",name:"new-key",modelValue:s.unref(d).key,"onUpdate:modelValue":b[1]||(b[1]=j=>s.unref(d).key=j)},null,8,["modelValue"]),s.unref(d).key!==s.unref(u)&&s.unref(i).find(j=>j.key===s.unref(d).key)?(s.openBlock(),s.createElementBlock("p",jF," A section with this key already exists. ")):s.createCommentVNode("",!0)])]),s.createElementVNode("div",AF,[s.createVNode(x,null,{default:s.withCtx(()=>[...b[11]||(b[11]=[s.createTextVNode("Form",-1)])]),_:1}),s.createVNode(W,{modelValue:s.unref(d).form,"onUpdate:modelValue":b[2]||(b[2]=j=>s.unref(d).form=j)},null,8,["modelValue"])])]),s.createVNode(S,null,{default:s.withCtx(()=>[s.createElementVNode("div",NF,[s.unref(l)==="edit"?(s.openBlock(),s.createBlock(w,{key:0,variant:"destructive",onClick:b[3]||(b[3]=j=>p())},{default:s.withCtx(()=>[...b[12]||(b[12]=[s.createTextVNode(" Delete Section ",-1)])]),_:1})):s.createCommentVNode("",!0),s.createElementVNode("div",qF,[s.createVNode(G,{"as-child":""},{default:s.withCtx(()=>[s.createVNode(w,{variant:"outline"},{default:s.withCtx(()=>[...b[13]||(b[13]=[s.createTextVNode(" Cancel ",-1)])]),_:1})]),_:1}),s.unref(l)==="add"?(s.openBlock(),s.createBlock(w,{key:0,onClick:g,disabled:!s.unref(d).key||!s.unref(d).displayName||s.unref(i).find(j=>j.key===s.unref(d).key)},{default:s.withCtx(()=>[...b[14]||(b[14]=[s.createTextVNode(" Add Section ",-1)])]),_:1},8,["disabled"])):(s.openBlock(),s.createBlock(w,{key:1,onClick:_,disabled:!s.unref(d).key||!s.unref(d).displayName||s.unref(d).key!==s.unref(u)&&s.unref(i).find(j=>j.key===s.unref(d).key)},{default:s.withCtx(()=>[...b[15]||(b[15]=[s.createTextVNode(" Save Changes ",-1)])]),_:1},8,["disabled"]))])])]),_:1})]),_:1})]),_:1},8,["open"])],64)}}});function Ne(n){this.content=n}Ne.prototype={constructor:Ne,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 i=t&&t!=n?this.remove(t):this,a=i.find(n),o=i.content.slice();return a==-1?o.push(t||n,e):(o[a+1]=e,t&&(o[a]=t)),new Ne(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 Ne(t)},addToStart:function(n,e){return new Ne([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Ne(t)},addBefore:function(n,e,t){var i=this.remove(e),a=i.content.slice(),o=i.find(n);return a.splice(o==-1?a.length:o,0,e,t),new Ne(a)},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=Ne.from(n),n.size?new Ne(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Ne.from(n),n.size?new Ne(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Ne.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}};Ne.from=function(n){if(n instanceof Ne)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Ne(e)};function s_(n,e,t){for(let i=0;;i++){if(i==n.childCount||i==e.childCount)return n.childCount==e.childCount?null:t;let a=n.child(i),o=e.child(i);if(a==o){t+=a.nodeSize;continue}if(!a.sameMarkup(o))return t;if(a.isText&&a.text!=o.text){for(let r=0;a.text[r]==o.text[r];r++)t++;return t}if(a.content.size||o.content.size){let r=s_(a.content,o.content,t+1);if(r!=null)return r}t+=a.nodeSize}}function l_(n,e,t,i){for(let a=n.childCount,o=e.childCount;;){if(a==0||o==0)return a==o?null:{a:t,b:i};let r=n.child(--a),l=e.child(--o),u=r.nodeSize;if(r==l){t-=u,i-=u;continue}if(!r.sameMarkup(l))return{a:t,b:i};if(r.isText&&r.text!=l.text){let d=0,f=Math.min(r.text.length,l.text.length);for(;d<f&&r.text[r.text.length-d-1]==l.text[l.text.length-d-1];)d++,t--,i--;return{a:t,b:i}}if(r.content.size||l.content.size){let d=l_(r.content,l.content,t-1,i-1);if(d)return d}t-=u,i-=u}}let A=class Ze{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let i=0;i<e.length;i++)this.size+=e[i].nodeSize}nodesBetween(e,t,i,a=0,o){for(let r=0,l=0;l<t;r++){let u=this.content[r],d=l+u.nodeSize;if(d>e&&i(u,a+l,o||null,r)!==!1&&u.content.size){let f=l+1;u.nodesBetween(Math.max(0,e-f),Math.min(u.content.size,t-f),i,a+f)}l=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,i,a){let o="",r=!0;return this.nodesBetween(e,t,(l,u)=>{let d=l.isText?l.text.slice(Math.max(e,u)-u,t-u):l.isLeaf?a?typeof a=="function"?a(l):a:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&d||l.isTextblock)&&i&&(r?r=!1:o+=i),o+=d},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,i=e.firstChild,a=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(i)&&(a[a.length-1]=t.withText(t.text+i.text),o=1);o<e.content.length;o++)a.push(e.content[o]);return new Ze(a,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let i=[],a=0;if(t>e)for(let o=0,r=0;r<t;o++){let l=this.content[o],u=r+l.nodeSize;u>e&&((r<e||u>t)&&(l.isText?l=l.cut(Math.max(0,e-r),Math.min(l.text.length,t-r)):l=l.cut(Math.max(0,e-r-1),Math.min(l.content.size,t-r-1))),i.push(l),a+=l.nodeSize),r=u}return new Ze(i,a)}cutByIndex(e,t){return e==t?Ze.empty:e==0&&t==this.content.length?this:new Ze(this.content.slice(e,t))}replaceChild(e,t){let i=this.content[e];if(i==t)return this;let a=this.content.slice(),o=this.size+t.nodeSize-i.nodeSize;return a[e]=t,new Ze(a,o)}addToStart(e){return new Ze([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Ze(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,i=0;t<this.content.length;t++){let a=this.content[t];e(a,i,t),i+=a.nodeSize}}findDiffStart(e,t=0){return s_(this,e,t)}findDiffEnd(e,t=this.size,i=e.size){return l_(this,e,t,i)}findIndex(e){if(e==0)return Wo(0,e);if(e==this.size)return Wo(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,i=0;;t++){let a=this.child(t),o=i+a.nodeSize;if(o>=e)return o==e?Wo(t+1,o):Wo(t,i);i=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return Ze.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new Ze(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Ze.empty;let t,i=0;for(let a=0;a<e.length;a++){let o=e[a];i+=o.nodeSize,a&&o.isText&&e[a-1].sameMarkup(o)?(t||(t=e.slice(0,a)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new Ze(t||e,i)}static from(e){if(!e)return Ze.empty;if(e instanceof Ze)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Ze([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};A.empty=new A([],0);const nl={index:0,offset:0};function Wo(n,e){return nl.index=n,nl.offset=e,nl}function Sr(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 i=0;i<n.length;i++)if(!Sr(n[i],e[i]))return!1}else{for(let i in n)if(!(i in e)||!Sr(n[i],e[i]))return!1;for(let i in e)if(!(i in n))return!1}return!0}let re=class Jl{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,i=!1;for(let a=0;a<e.length;a++){let o=e[a];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,a));else{if(o.type.excludes(this.type))return e;!i&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,a)),t.push(this),i=!0),t&&t.push(o)}}return t||(t=e.slice()),i||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&&Sr(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 i=e.marks[t.type];if(!i)throw new RangeError(`There is no mark type ${t.type} in this schema`);let a=i.create(t.attrs);return i.checkAttrs(a.attrs),a}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++)if(!e[i].eq(t[i]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Jl.none;if(e instanceof Jl)return[e];let t=e.slice();return t.sort((i,a)=>i.type.rank-a.type.rank),t}};re.none=[];let jr=class extends Error{},V=class Ki{constructor(e,t,i){this.content=e,this.openStart=t,this.openEnd=i}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let i=d_(this.content,e+this.openStart,t);return i&&new Ki(i,this.openStart,this.openEnd)}removeBetween(e,t){return new Ki(u_(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 Ki.empty;let i=t.openStart||0,a=t.openEnd||0;if(typeof i!="number"||typeof a!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Ki(A.fromJSON(e,t.content),i,a)}static maxOpen(e,t=!0){let i=0,a=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)i++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)a++;return new Ki(e,i,a)}};V.empty=new V(A.empty,0,0);function u_(n,e,t){let{index:i,offset:a}=n.findIndex(e),o=n.maybeChild(i),{index:r,offset:l}=n.findIndex(t);if(a==e||o.isText){if(l!=t&&!n.child(r).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(i!=r)throw new RangeError("Removing non-flat range");return n.replaceChild(i,o.copy(u_(o.content,e-a-1,t-a-1)))}function d_(n,e,t,i){let{index:a,offset:o}=n.findIndex(e),r=n.maybeChild(a);if(o==e||r.isText)return i&&!i.canReplace(a,a,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=d_(r.content,e-o-1,t,r);return l&&n.replaceChild(a,r.copy(l))}function TF(n,e,t){if(t.openStart>n.depth)throw new jr("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new jr("Inconsistent open depths");return f_(n,e,t,0)}function f_(n,e,t,i){let a=n.index(i),o=n.node(i);if(a==e.index(i)&&i<n.depth-t.openStart){let r=f_(n,e,t,i+1);return o.copy(o.content.replaceChild(a,r))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==i&&e.depth==i){let r=n.parent,l=r.content;return mi(r,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:r,end:l}=OF(t,n);return mi(o,g_(n,r,l,e,i))}else return mi(o,Ar(n,e,i))}function c_(n,e){if(!e.type.compatibleContent(n.type))throw new jr("Cannot join "+e.type.name+" onto "+n.type.name)}function Gl(n,e,t){let i=n.node(t);return c_(i,e.node(t)),i}function hi(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 La(n,e,t,i){let a=(e||n).node(t),o=0,r=e?e.index(t):a.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(hi(n.nodeAfter,i),o++));for(let l=o;l<r;l++)hi(a.child(l),i);e&&e.depth==t&&e.textOffset&&hi(e.nodeBefore,i)}function mi(n,e){return n.type.checkContent(e),n.copy(e)}function g_(n,e,t,i,a){let o=n.depth>a&&Gl(n,e,a+1),r=i.depth>a&&Gl(t,i,a+1),l=[];return La(null,n,a,l),o&&r&&e.index(a)==t.index(a)?(c_(o,r),hi(mi(o,g_(n,e,t,i,a+1)),l)):(o&&hi(mi(o,Ar(n,e,a+1)),l),La(e,t,a,l),r&&hi(mi(r,Ar(t,i,a+1)),l)),La(i,null,a,l),new A(l)}function Ar(n,e,t){let i=[];if(La(null,n,t,i),n.depth>t){let a=Gl(n,e,t+1);hi(mi(a,Ar(n,e,t+1)),i)}return La(e,null,t,i),new A(i)}function OF(n,e){let t=e.depth-n.openStart,a=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)a=e.node(o).copy(A.from(a));return{start:a.resolveNoCache(n.openStart+t),end:a.resolveNoCache(a.content.size-n.openEnd-t)}}class Qa{constructor(e,t,i){this.pos=e,this.path=t,this.parentOffset=i,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 i=this.pos-this.path[this.path.length-1],a=e.child(t);return i?e.child(t).cut(i):a}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 i=this.path[t*3],a=t==0?0:this.path[t*3-1]+1;for(let o=0;o<e;o++)a+=i.child(o).nodeSize;return a}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return re.none;if(this.textOffset)return e.child(t).marks;let i=e.maybeChild(t-1),a=e.maybeChild(t);if(!i){let l=i;i=a,a=l}let o=i.marks;for(var r=0;r<o.length;r++)o[r].type.spec.inclusive===!1&&(!a||!o[r].isInSet(a.marks))&&(o=o[r--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let i=t.marks,a=e.parent.maybeChild(e.index());for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!a||!i[o].isInSet(a.marks))&&(i=i[o--].removeFromSet(i));return i}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 i=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);i>=0;i--)if(e.pos<=this.end(i)&&(!t||t(this.node(i))))return new Nr(this,e,i);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 i=[],a=0,o=t;for(let r=e;;){let{index:l,offset:u}=r.content.findIndex(o),d=o-u;if(i.push(r,l,a+u),!d||(r=r.child(l),r.isText))break;o=d-1,a+=u+1}return new Qa(t,i,o)}static resolveCached(e,t){let i=Tf.get(e);if(i)for(let o=0;o<i.elts.length;o++){let r=i.elts[o];if(r.pos==t)return r}else Tf.set(e,i=new VF);let a=i.elts[i.i]=Qa.resolve(e,t);return i.i=(i.i+1)%IF,a}}class VF{constructor(){this.elts=[],this.i=0}}const IF=12,Tf=new WeakMap;class Nr{constructor(e,t,i){this.$from=e,this.$to=t,this.depth=i}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 PF=Object.create(null);let on=class Yl{constructor(e,t,i,a=re.none){this.type=e,this.attrs=t,this.marks=a,this.content=i||A.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,i,a=0){this.content.nodesBetween(e,t,i,a,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,i,a){return this.content.textBetween(e,t,i,a)}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,i){return this.type==e&&Sr(this.attrs,t||e.defaultAttrs||PF)&&re.sameSet(this.marks,i||re.none)}copy(e=null){return e==this.content?this:new Yl(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Yl(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,i=!1){if(e==t)return V.empty;let a=this.resolve(e),o=this.resolve(t),r=i?0:a.sharedDepth(t),l=a.start(r),d=a.node(r).content.cut(a.pos-l,o.pos-l);return new V(d,a.depth-r,o.depth-r)}replace(e,t,i){return TF(this.resolve(e),this.resolve(t),i)}nodeAt(e){for(let t=this;;){let{index:i,offset:a}=t.content.findIndex(e);if(t=t.maybeChild(i),!t)return null;if(a==e||t.isText)return t;e-=a+1}}childAfter(e){let{index:t,offset:i}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:i}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:i}=this.content.findIndex(e);if(i<e)return{node:this.content.child(t),index:t,offset:i};let a=this.content.child(t-1);return{node:a,index:t-1,offset:i-a.nodeSize}}resolve(e){return Qa.resolveCached(this,e)}resolveNoCache(e){return Qa.resolve(this,e)}rangeHasMark(e,t,i){let a=!1;return t>e&&this.nodesBetween(e,t,o=>(i.isInSet(o.marks)&&(a=!0),!a)),a}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()+")"),__(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,i=A.empty,a=0,o=i.childCount){let r=this.contentMatchAt(e).matchFragment(i,a,o),l=r&&r.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let u=a;u<o;u++)if(!this.type.allowsMarks(i.child(u).marks))return!1;return!0}canReplaceWith(e,t,i,a){if(a&&!this.type.allowsMarks(a))return!1;let o=this.contentMatchAt(e).matchType(i),r=o&&o.matchFragment(this.content,t);return r?r.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=re.none;for(let t=0;t<this.marks.length;t++){let i=this.marks[t];i.type.checkAttrs(i.attrs),e=i.addToSet(e)}if(!re.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 i;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=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,i)}let a=A.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,a,i);return o.type.checkAttrs(o.attrs),o}};on.prototype.text=void 0;class qr extends on{constructor(e,t,i,a){if(super(e,t,null,a),!i)throw new RangeError("Empty text nodes are not allowed");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):__(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 qr(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new qr(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 __(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class wi{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let i=new $F(e,t);if(i.next==null)return wi.empty;let a=h_(i);i.next&&i.err("Unexpected trailing text");let o=KF(UF(a));return JF(o,i),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,i=e.childCount){let a=this;for(let o=t;a&&o<i;o++)a=a.matchType(e.child(o).type);return a}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 i=0;i<e.next.length;i++)if(this.next[t].type==e.next[i].type)return!0;return!1}fillBefore(e,t=!1,i=0){let a=[this];function o(r,l){let u=r.matchFragment(e,i);if(u&&(!t||u.validEnd))return A.from(l.map(d=>d.createAndFill()));for(let d=0;d<r.next.length;d++){let{type:f,next:c}=r.next[d];if(!(f.isText||f.hasRequiredAttrs())&&a.indexOf(c)==-1){a.push(c);let g=o(c,l.concat(f));if(g)return g}}return null}return o(this,[])}findWrapping(e){for(let i=0;i<this.wrapCache.length;i+=2)if(this.wrapCache[i]==e)return this.wrapCache[i+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),i=[{match:this,type:null,via:null}];for(;i.length;){let a=i.shift(),o=a.match;if(o.matchType(e)){let r=[];for(let l=a;l.type;l=l.via)r.push(l.type);return r.reverse()}for(let r=0;r<o.next.length;r++){let{type:l,next:u}=o.next[r];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!a.type||u.validEnd)&&(i.push({match:l.contentMatch,type:l,via:a}),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(i){e.push(i);for(let a=0;a<i.next.length;a++)e.indexOf(i.next[a].next)==-1&&t(i.next[a].next)}return t(this),e.map((i,a)=>{let o=a+(i.validEnd?"*":" ")+" ";for(let r=0;r<i.next.length;r++)o+=(r?", ":"")+i.next[r].type.name+"->"+e.indexOf(i.next[r].next);return o}).join(`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("vue"),rt=require("@oneclick.dev/cms-kit"),ms=require("./interpolation-We8hT28L.js"),T=require("lucide-vue-next"),se=require("./_plugin-vue_export-helper-BHFhmbuH.js"),Mf=require("./utils-D6CaKJbp.js"),Kp=require("./floating-ui.dom-CBBY0Ism.js"),Ju=require("./index-4tjmIans.js"),Jp=require("./google-D4N3gb01.js"),Gp={class:"flex flex-wrap gap-1"},Yp={key:0,class:"font-medium"},Xp={key:1,class:"font-medium"},Zp={key:2,class:"font-medium"},Qp={key:3,class:"font-medium"},eF=s.defineComponent({__name:"Status",setup(n){const e=s.inject("status",s.ref(""));return(t,i)=>(s.openBlock(),s.createElementBlock("p",Gp,[s.unref(e)?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[i[0]||(i[0]=s.createElementVNode("span",{class:"opacity-70"},"Status:",-1)),i[1]||(i[1]=s.createTextVNode(" "+s.toDisplayString(" ")+" ",-1)),s.unref(e)==="new"?(s.openBlock(),s.createElementBlock("strong",Yp,"New Draft")):s.createCommentVNode("",!0),s.unref(e)==="draft"?(s.openBlock(),s.createElementBlock("strong",Xp,"Draft")):s.createCommentVNode("",!0),s.unref(e)==="archived"?(s.openBlock(),s.createElementBlock("strong",Zp,"Archived")):s.unref(e)==="published"?(s.openBlock(),s.createElementBlock("strong",Qp,"Published")):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0)]))}}),tF={class:"flex flex-col"},nF={class:"flex justify-between items-center p-3 xl:p-4"},iF={class:"relative group min-w-[320px] @2xl:min-w-[500px] max-w-4xl"},aF={class:"pl-4 pr-6 py-2 -ml-1.5 -my-2 rounded text-2xl pointer-events-none opacity-0 select-none whitespace-nowrap overflow-hidden"},oF={class:"flex items-center justify-between gap-12 bg-input/30 pl-2 xl:pl-5 pr-3 xl:pr-4 py-3 xl:py-4 border-y"},rF={class:"flex gap-4 xl:gap-6 text-sm"},sF={key:0,class:"flex flex-wrap gap-1"},lF={class:"font-medium"},uF={key:1,class:"flex flex-wrap gap-1"},dF={class:"font-medium"},fF={class:"flex gap-2"},cF={class:"flex"},gF={key:0},_F={key:0},hF={key:0},mF=s.defineComponent({__name:"Header",props:{config:{type:Object,required:!0},createdAt:{type:Date,required:!0},updatedAt:{type:Date,required:!1},liveByLocale:{type:Array,default:()=>[]}},emits:["saveDraft","publishEntry","unpublishEntry","archiveEntry","unarchiveToDrafts","publishAllEntries","deleteEntry","previewEntry"],setup(n,{emit:e}){const t=e,i=s.inject("activeView",s.ref("edit")),a=s.inject("status",s.ref("")),o=s.inject("entryId",s.ref("")),r=s.inject("activeEntryVersion",s.ref("")),l=s.inject("isSaving",s.ref(!1)),u=s.inject("title",s.ref("")),d=s.ref(u.value);function f(){u.value=d.value}return(c,g)=>{const _=s.resolveComponent("SegmentedControlButton"),h=s.resolveComponent("SegmentedControl"),p=s.resolveComponent("Button"),m=s.resolveComponent("DropdownMenuTrigger"),F=s.resolveComponent("DropdownMenuItem"),y=s.resolveComponent("DropdownMenuGroup"),k=s.resolveComponent("DropdownMenuContent"),b=s.resolveComponent("DropdownMenu");return s.openBlock(),s.createElementBlock("div",tF,[s.createElementVNode("div",nF,[s.createElementVNode("div",iF,[s.createElementVNode("p",aF,s.toDisplayString(s.unref(u)||"Please enter a title"),1),s.withDirectives(s.createElementVNode("input",{class:"absolute w-[calc(100%+1rem)] top-0 pl-4 pr-6 py-2 -ml-1.5 -my-2 rounded text-2xl group-hover:bg-input/30 focus:bg-input/50 focus-visible:outline-0 focus-visible:ring-1 focus-visible:ring-ring/50","onUpdate:modelValue":g[0]||(g[0]=w=>s.isRef(u)?u.value=w:null),onFocus:g[1]||(g[1]=w=>d.value=s.unref(u)),onKeydown:s.withKeys(f,["esc"]),placeholder:"Please enter a title"},null,544),[[s.vModelText,s.unref(u)]])]),s.createElementVNode("div",null,[s.unref(o)?(s.openBlock(),s.createBlock(h,{key:0,modelValue:s.unref(i),"onUpdate:modelValue":g[2]||(g[2]=w=>s.isRef(i)?i.value=w:null),"allow-empty":""},{default:s.withCtx(()=>[s.createVNode(_,{value:"edit"},{default:s.withCtx(()=>[...g[13]||(g[13]=[s.createElementVNode("span",{class:"block whitespace-nowrap"},"Edit",-1)])]),_:1}),s.createVNode(_,{value:"preview"},{default:s.withCtx(()=>[...g[14]||(g[14]=[s.createElementVNode("span",{class:"block whitespace-nowrap"},"Live Preview",-1)])]),_:1}),s.unref(o)!=="new"&&s.unref(r)?(s.openBlock(),s.createBlock(_,{key:0,value:"versions"},{default:s.withCtx(()=>[...g[15]||(g[15]=[s.createElementVNode("span",{class:"block whitespace-nowrap"},"Versions",-1)])]),_:1})):s.createCommentVNode("",!0),s.createVNode(_,{value:"api"},{default:s.withCtx(()=>[...g[16]||(g[16]=[s.createElementVNode("span",{class:"block whitespace-nowrap"},"API",-1)])]),_:1})]),_:1},8,["modelValue"])):s.createCommentVNode("",!0)])]),s.createElementVNode("div",oF,[s.createElementVNode("div",rF,[s.createVNode(eF),s.unref(a)!=="new"&&n.updatedAt?(s.openBlock(),s.createElementBlock("p",sF,[g[17]||(g[17]=s.createElementVNode("span",{class:"opacity-70"},"Last Modified:",-1)),g[18]||(g[18]=s.createTextVNode()),s.createElementVNode("strong",lF,s.toDisplayString(new Date(n.updatedAt)?.toLocaleString()),1)])):s.createCommentVNode("",!0),s.unref(a)!=="new"&&n.createdAt?(s.openBlock(),s.createElementBlock("p",uF,[g[19]||(g[19]=s.createElementVNode("span",{class:"opacity-70"},"Created:",-1)),g[20]||(g[20]=s.createTextVNode()),s.createElementVNode("strong",dF,s.toDisplayString(new Date(n.createdAt)?.toLocaleString()),1)])):s.createCommentVNode("",!0)]),s.createElementVNode("div",fF,[s.createVNode(p,{variant:"secondary",class:"border bg-white hover:bg-white dark:bg-transparent dark:hover:bg-muted/20",onClick:g[3]||(g[3]=w=>t("previewEntry"))},{default:s.withCtx(()=>[s.createVNode(s.unref(T.Link),{class:"size-4"}),g[21]||(g[21]=s.createTextVNode(" Preview ",-1))]),_:1}),s.createElementVNode("div",cF,[s.unref(a)==="published"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createVNode(p,{class:"rounded-r-none",onClick:g[4]||(g[4]=w=>t("publishEntry"))},{default:s.withCtx(()=>[s.unref(l)?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createVNode(s.unref(T.Loader2),{class:"size-4 animate-spin ml-2"}),g[22]||(g[22]=s.createElementVNode("span",null,"Publishing...",-1))],64)):(s.openBlock(),s.createElementBlock("span",gF,"Publish changes"))]),_:1}),g[25]||(g[25]=s.createElementVNode("div",{class:"w-[1px] h-full bg-muted/30"},null,-1)),s.createVNode(b,null,{default:s.withCtx(()=>[s.createVNode(m,{"as-child":""},{default:s.withCtx(()=>[s.createVNode(p,{class:"rounded-l-none",size:"icon"},{default:s.withCtx(()=>[s.createVNode(s.unref(T.ChevronDown),{class:"size-4"})]),_:1})]),_:1}),s.createVNode(k,{class:"w-56"},{default:s.withCtx(()=>[s.createVNode(y,null,{default:s.withCtx(()=>[s.createVNode(F,{onClick:g[5]||(g[5]=w=>t("unpublishEntry"))},{default:s.withCtx(()=>[...g[23]||(g[23]=[s.createTextVNode("Unpublish (draft)",-1)])]),_:1}),s.createVNode(F,{onClick:g[6]||(g[6]=w=>t("archiveEntry"))},{default:s.withCtx(()=>[...g[24]||(g[24]=[s.createTextVNode("Archive",-1)])]),_:1})]),_:1})]),_:1})]),_:1})],64)):s.unref(a)==="archived"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createVNode(p,{class:"rounded-r-none",onClick:g[7]||(g[7]=w=>t("unarchiveToDrafts"))},{default:s.withCtx(()=>[s.unref(l)?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createVNode(s.unref(T.Loader2),{class:"size-4 animate-spin ml-2"}),g[26]||(g[26]=s.createElementVNode("span",null,"Unarchiving...",-1))],64)):(s.openBlock(),s.createElementBlock("span",_F,"Unarchive (to Drafts)"))]),_:1}),g[29]||(g[29]=s.createElementVNode("div",{class:"w-[1px] h-full bg-muted/30"},null,-1)),s.createVNode(b,null,{default:s.withCtx(()=>[s.createVNode(m,{"as-child":""},{default:s.withCtx(()=>[s.createVNode(p,{class:"rounded-l-none",size:"icon"},{default:s.withCtx(()=>[s.createVNode(s.unref(T.ChevronDown),{class:"size-4"})]),_:1})]),_:1}),s.createVNode(k,{class:"w-56"},{default:s.withCtx(()=>[s.createVNode(y,null,{default:s.withCtx(()=>[s.createVNode(F,{onClick:g[8]||(g[8]=w=>t("publishAllEntries"))},{default:s.withCtx(()=>[...g[27]||(g[27]=[s.createTextVNode("Publish all",-1)])]),_:1}),s.createVNode(F,{onClick:g[9]||(g[9]=w=>t("deleteEntry"))},{default:s.withCtx(()=>[...g[28]||(g[28]=[s.createTextVNode("Delete completely",-1)])]),_:1})]),_:1})]),_:1})]),_:1})],64)):(s.openBlock(),s.createElementBlock(s.Fragment,{key:2},[s.createVNode(p,{class:s.normalizeClass({"rounded-r-none":s.unref(a)!=="new"||n.config?.supportedLanguages?.length===1}),onClick:g[10]||(g[10]=w=>t("saveDraft"))},{default:s.withCtx(()=>[s.unref(l)?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[s.createVNode(s.unref(T.Loader2),{class:"size-4 animate-spin ml-2"}),g[30]||(g[30]=s.createElementVNode("span",null,"Saving...",-1))],64)):(s.openBlock(),s.createElementBlock("span",hF,"Save draft"))]),_:1},8,["class"]),g[33]||(g[33]=s.createElementVNode("div",{class:"w-[1px] h-full bg-muted/30"},null,-1)),s.unref(a)!=="new"||n.config?.supportedLanguages?.length===1?(s.openBlock(),s.createBlock(b,{key:0},{default:s.withCtx(()=>[s.createVNode(m,{"as-child":""},{default:s.withCtx(()=>[s.createVNode(p,{class:"rounded-l-none",size:"icon"},{default:s.withCtx(()=>[s.createVNode(s.unref(T.ChevronDown),{class:"size-4"})]),_:1})]),_:1}),s.createVNode(k,{class:"w-56"},{default:s.withCtx(()=>[s.createVNode(y,null,{default:s.withCtx(()=>[s.createVNode(F,{onClick:g[11]||(g[11]=w=>t("publishEntry"))},{default:s.withCtx(()=>[...g[31]||(g[31]=[s.createTextVNode("Publish now",-1)])]),_:1}),n.liveByLocale?.length>0?(s.openBlock(),s.createBlock(F,{key:0,onClick:g[12]||(g[12]=w=>t("archiveEntry"))},{default:s.withCtx(()=>[...g[32]||(g[32]=[s.createTextVNode("Archive",-1)])]),_:1})):s.createCommentVNode("",!0)]),_:1})]),_:1})]),_:1})):s.createCommentVNode("",!0)],64))])])])])}}}),pF={key:0,class:"border-b px-2 xl:px-4 py-4"},r_=s.defineComponent({__name:"ContentSettings",props:{customSettings:{type:Object,required:!0},inputValues:{type:Object,default:()=>({})}},setup(n){const e=s.inject("customSettingsOutput",s.ref(null)),t=i=>{e.value=i};return(i,a)=>{const o=s.resolveComponent("FormDisplayer");return n.customSettings?.layout?(s.openBlock(),s.createElementBlock("div",pF,[s.createVNode(o,{ref:"formDisplayer",settings:n.customSettings,inputValues:n.inputValues,onSetOutput:t},null,8,["settings","inputValues"])])):s.createCommentVNode("",!0)}}}),FF={class:"bg-muted/50"},bF={key:0,class:"flex items-center justify-between p-4"},yF={class:"flex gap-2"},kF={key:1,class:"grid gap-2 px-2 my-4"},wF={class:"relative flex items-center justify-between px-4 py-2 bg-white dark:bg-muted rounded-md border border-muted-foreground/20 z-2"},DF=["onClick"],vF={key:0,class:"flex items-center"},EF={class:"overflow-hidden"},xF={class:"grid gap-4 mb-2"},CF={class:"grid gap-3"},BF={class:"grid gap-3"},SF={class:"grid gap-1"},jF={key:0,class:"text-red-500 text-xs"},AF={class:"grid gap-3"},NF={class:"flex justify-between gap-2 w-full"},qF={class:"flex gap-2 ml-auto"},MF=s.defineComponent({__name:"ContentStructuredContentSections",setup(n){const{isAdmin:e}=rt.useModulePermissions(),{confirm:t}=rt.useConfirmation(),i=s.inject("structuredContentSections",s.ref([])),a=s.inject("structuredContentInput",s.ref(null)),o=s.inject("structuredContentOutput",s.ref(null)),r=s.ref(!1),l=s.ref("add"),u=s.ref(null),d=s.reactive({displayName:"",key:"",form:null}),f=s.ref([]);s.watch(()=>d.displayName,(k,b)=>{let w=b.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9\-]/g,""),D=k.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9\-]/g,"");(d.key===w||d.key==="")&&(d.key=D)});const c=k=>{k||(d.displayName="",d.key="",d.form=null)},g=()=>{i.value.push({displayName:d.displayName,key:d.key,form:d.form?JSON.parse(JSON.stringify(d.form)):null}),r.value=!1,c(!1)},_=()=>{const k=i.value.findIndex(b=>b.key===u.value);if(k!==-1){if(d.key!==u.value){const b=f.value.indexOf(u.value);b!==-1&&f.value.splice(b,1,d.key),o.value&&typeof o.value=="object"&&u.value&&o.value.hasOwnProperty(u.value)&&(o.value[d.key]=o.value[u.value],delete o.value[u.value]),a.value=o.value?JSON.parse(JSON.stringify(o.value)):{}}i.value[k]={displayName:d.displayName,key:d.key,form:d.form?JSON.parse(JSON.stringify(d.form)):null}}r.value=!1,c(!1)},h=(k,b)=>{const w=k+b;if(w<0||w>=i.value.length)return;const D=i.value[k];i.value.splice(k,1),i.value.splice(w,0,D)},p=async()=>{if(!await t("Are you sure you want to delete this section? This action cannot be undone."))return;const b=i.value.findIndex(w=>w.key===u.value);b!==-1&&i.value.splice(b,1),r.value=!1,c(!1)},m=()=>{r.value=!0,l.value="add"},F=k=>{r.value=!0,l.value="edit",u.value=k.key,d.displayName=k.displayName,d.key=k.key,d.form=k.form?JSON.parse(JSON.stringify(k.form)):null},y=(k,b)=>{console.log("setOutput called for key",k,"with val",b),(!o.value||typeof o.value!="object")&&(o.value={}),o.value[k]=b};return(k,b)=>{const w=s.resolveComponent("Button"),D=s.resolveComponent("FormDisplayer"),C=s.resolveComponent("DialogTitle"),E=s.resolveComponent("DialogDescription"),v=s.resolveComponent("DialogHeader"),x=s.resolveComponent("Label"),M=s.resolveComponent("Input"),W=s.resolveComponent("FormBuilderSelect"),G=s.resolveComponent("DialogClose"),S=s.resolveComponent("DialogFooter"),N=s.resolveComponent("DialogContent"),U=s.resolveComponent("Dialog");return s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createElementVNode("div",FF,[s.unref(e)()?(s.openBlock(),s.createElementBlock("div",bF,[s.createElementVNode("p",{class:s.normalizeClass({"opacity-40":!s.unref(i).length,"text-primary":s.unref(i).length})}," Structured content sections ("+s.toDisplayString(s.unref(i).length)+") ",3),s.createElementVNode("div",yF,[s.createVNode(w,{variant:"ghost",size:"icon",onClick:m},{default:s.withCtx(()=>[s.createVNode(s.unref(T.Plus),{class:"size-4 text-primary"})]),_:1}),s.createVNode(w,{variant:"ghost",size:"icon"},{default:s.withCtx(()=>[s.createVNode(s.unref(T.Braces),{class:"size-4 text-primary"})]),_:1})])])):s.createCommentVNode("",!0),s.unref(i).length>0?(s.openBlock(),s.createElementBlock("div",kF,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(s.unref(i),(j,X)=>(s.openBlock(),s.createElementBlock("div",{key:j.key},[s.createElementVNode("div",wF,[s.createElementVNode("p",{class:"select-none cursor-default hover:bg-background/15 px-3 py-1.5 rounded -ml-3",onClick:ne=>s.unref(f).includes(j.key)?s.unref(f).splice(s.unref(f).indexOf(j.key),1):s.unref(f).push(j.key)},s.toDisplayString(j.displayName||j.key),9,DF),s.unref(e)()?(s.openBlock(),s.createElementBlock("div",vF,[s.createVNode(w,{variant:"ghost",size:"icon",disabled:X===0,onClick:ne=>h(X,-1)},{default:s.withCtx(()=>[s.createVNode(s.unref(T.ArrowUp),{class:"size-4"})]),_:1},8,["disabled","onClick"]),s.createVNode(w,{variant:"ghost",size:"icon",disabled:X===s.unref(i).length-1,onClick:ne=>h(X,1)},{default:s.withCtx(()=>[s.createVNode(s.unref(T.ArrowDown),{class:"size-4"})]),_:1},8,["disabled","onClick"]),s.createVNode(w,{variant:"ghost",size:"icon",onClick:ne=>F(j)},{default:s.withCtx(()=>[s.createVNode(s.unref(T.Cog),{class:"size-4"})]),_:1},8,["onClick"])])):s.createCommentVNode("",!0)]),s.createElementVNode("div",{class:s.normalizeClass(["relative grid transition-all duration-300 z-1 -translate-y-1",{"grid-rows-[1fr]":!s.unref(f).includes(j.key),"grid-rows-[0fr]":s.unref(f).includes(j.key)}])},[s.createElementVNode("div",EF,[s.createElementVNode("div",{class:s.normalizeClass(["px-2 bg-muted/80 dark:bg-background/80 border border-muted-foreground/20 rounded-b-md transition-all duration-300",{"pt-3 pb-2":!s.unref(f).includes(j.key)}])},[(s.openBlock(),s.createBlock(D,{key:`${j.key}-${JSON.stringify(j.form)}`,ref_for:!0,ref:"formDisplayer",settings:j.form,inputValues:s.unref(a)?.[j.key]||{},onSetOutput:ne=>y(j.key,ne),class:"bg-transparent"},null,8,["settings","inputValues","onSetOutput"]))],2)])],2)]))),128))])):s.createCommentVNode("",!0)]),s.createVNode(U,{open:s.unref(r),"onUpdate:open":[b[4]||(b[4]=j=>s.isRef(r)?r.value=j:null),c]},{default:s.withCtx(()=>[s.createVNode(N,{class:"sm:max-w-[425px]"},{default:s.withCtx(()=>[s.unref(l)==="add"?(s.openBlock(),s.createBlock(v,{key:0},{default:s.withCtx(()=>[s.createVNode(C,null,{default:s.withCtx(()=>[...b[5]||(b[5]=[s.createTextVNode("Add structured content section",-1)])]),_:1}),s.createVNode(E,null,{default:s.withCtx(()=>[...b[6]||(b[6]=[s.createTextVNode(" Add a new structured content section to this page. ",-1)])]),_:1})]),_:1})):(s.openBlock(),s.createBlock(v,{key:1},{default:s.withCtx(()=>[s.createVNode(C,null,{default:s.withCtx(()=>[...b[7]||(b[7]=[s.createTextVNode("Edit structured content section",-1)])]),_:1}),s.createVNode(E,null,{default:s.withCtx(()=>[...b[8]||(b[8]=[s.createTextVNode(" Edit the structured content section on this page. ",-1)])]),_:1})]),_:1})),s.createElementVNode("div",xF,[s.createElementVNode("div",CF,[s.createVNode(x,{for:"new-display-name"},{default:s.withCtx(()=>[...b[9]||(b[9]=[s.createTextVNode("Display Name (only visible in editor)",-1)])]),_:1}),s.createVNode(M,{id:"new-display-name",name:"new-display-name",modelValue:s.unref(d).displayName,"onUpdate:modelValue":b[0]||(b[0]=j=>s.unref(d).displayName=j)},null,8,["modelValue"])]),s.createElementVNode("div",BF,[s.createVNode(x,{for:"new-key"},{default:s.withCtx(()=>[...b[10]||(b[10]=[s.createTextVNode("Key (unique identifier)",-1)])]),_:1}),s.createElementVNode("div",SF,[s.createVNode(M,{id:"new-key",name:"new-key",modelValue:s.unref(d).key,"onUpdate:modelValue":b[1]||(b[1]=j=>s.unref(d).key=j)},null,8,["modelValue"]),s.unref(d).key!==s.unref(u)&&s.unref(i).find(j=>j.key===s.unref(d).key)?(s.openBlock(),s.createElementBlock("p",jF," A section with this key already exists. ")):s.createCommentVNode("",!0)])]),s.createElementVNode("div",AF,[s.createVNode(x,null,{default:s.withCtx(()=>[...b[11]||(b[11]=[s.createTextVNode("Form",-1)])]),_:1}),s.createVNode(W,{modelValue:s.unref(d).form,"onUpdate:modelValue":b[2]||(b[2]=j=>s.unref(d).form=j)},null,8,["modelValue"])])]),s.createVNode(S,null,{default:s.withCtx(()=>[s.createElementVNode("div",NF,[s.unref(l)==="edit"?(s.openBlock(),s.createBlock(w,{key:0,variant:"destructive",onClick:b[3]||(b[3]=j=>p())},{default:s.withCtx(()=>[...b[12]||(b[12]=[s.createTextVNode(" Delete Section ",-1)])]),_:1})):s.createCommentVNode("",!0),s.createElementVNode("div",qF,[s.createVNode(G,{"as-child":""},{default:s.withCtx(()=>[s.createVNode(w,{variant:"outline"},{default:s.withCtx(()=>[...b[13]||(b[13]=[s.createTextVNode(" Cancel ",-1)])]),_:1})]),_:1}),s.unref(l)==="add"?(s.openBlock(),s.createBlock(w,{key:0,onClick:g,disabled:!s.unref(d).key||!s.unref(d).displayName||s.unref(i).find(j=>j.key===s.unref(d).key)},{default:s.withCtx(()=>[...b[14]||(b[14]=[s.createTextVNode(" Add Section ",-1)])]),_:1},8,["disabled"])):(s.openBlock(),s.createBlock(w,{key:1,onClick:_,disabled:!s.unref(d).key||!s.unref(d).displayName||s.unref(d).key!==s.unref(u)&&s.unref(i).find(j=>j.key===s.unref(d).key)},{default:s.withCtx(()=>[...b[15]||(b[15]=[s.createTextVNode(" Save Changes ",-1)])]),_:1},8,["disabled"]))])])]),_:1})]),_:1})]),_:1},8,["open"])],64)}}});function Ne(n){this.content=n}Ne.prototype={constructor:Ne,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 i=t&&t!=n?this.remove(t):this,a=i.find(n),o=i.content.slice();return a==-1?o.push(t||n,e):(o[a+1]=e,t&&(o[a]=t)),new Ne(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 Ne(t)},addToStart:function(n,e){return new Ne([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new Ne(t)},addBefore:function(n,e,t){var i=this.remove(e),a=i.content.slice(),o=i.find(n);return a.splice(o==-1?a.length:o,0,e,t),new Ne(a)},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=Ne.from(n),n.size?new Ne(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=Ne.from(n),n.size?new Ne(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=Ne.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}};Ne.from=function(n){if(n instanceof Ne)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Ne(e)};function s_(n,e,t){for(let i=0;;i++){if(i==n.childCount||i==e.childCount)return n.childCount==e.childCount?null:t;let a=n.child(i),o=e.child(i);if(a==o){t+=a.nodeSize;continue}if(!a.sameMarkup(o))return t;if(a.isText&&a.text!=o.text){for(let r=0;a.text[r]==o.text[r];r++)t++;return t}if(a.content.size||o.content.size){let r=s_(a.content,o.content,t+1);if(r!=null)return r}t+=a.nodeSize}}function l_(n,e,t,i){for(let a=n.childCount,o=e.childCount;;){if(a==0||o==0)return a==o?null:{a:t,b:i};let r=n.child(--a),l=e.child(--o),u=r.nodeSize;if(r==l){t-=u,i-=u;continue}if(!r.sameMarkup(l))return{a:t,b:i};if(r.isText&&r.text!=l.text){let d=0,f=Math.min(r.text.length,l.text.length);for(;d<f&&r.text[r.text.length-d-1]==l.text[l.text.length-d-1];)d++,t--,i--;return{a:t,b:i}}if(r.content.size||l.content.size){let d=l_(r.content,l.content,t-1,i-1);if(d)return d}t-=u,i-=u}}let A=class Ze{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let i=0;i<e.length;i++)this.size+=e[i].nodeSize}nodesBetween(e,t,i,a=0,o){for(let r=0,l=0;l<t;r++){let u=this.content[r],d=l+u.nodeSize;if(d>e&&i(u,a+l,o||null,r)!==!1&&u.content.size){let f=l+1;u.nodesBetween(Math.max(0,e-f),Math.min(u.content.size,t-f),i,a+f)}l=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,i,a){let o="",r=!0;return this.nodesBetween(e,t,(l,u)=>{let d=l.isText?l.text.slice(Math.max(e,u)-u,t-u):l.isLeaf?a?typeof a=="function"?a(l):a:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&d||l.isTextblock)&&i&&(r?r=!1:o+=i),o+=d},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,i=e.firstChild,a=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(i)&&(a[a.length-1]=t.withText(t.text+i.text),o=1);o<e.content.length;o++)a.push(e.content[o]);return new Ze(a,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let i=[],a=0;if(t>e)for(let o=0,r=0;r<t;o++){let l=this.content[o],u=r+l.nodeSize;u>e&&((r<e||u>t)&&(l.isText?l=l.cut(Math.max(0,e-r),Math.min(l.text.length,t-r)):l=l.cut(Math.max(0,e-r-1),Math.min(l.content.size,t-r-1))),i.push(l),a+=l.nodeSize),r=u}return new Ze(i,a)}cutByIndex(e,t){return e==t?Ze.empty:e==0&&t==this.content.length?this:new Ze(this.content.slice(e,t))}replaceChild(e,t){let i=this.content[e];if(i==t)return this;let a=this.content.slice(),o=this.size+t.nodeSize-i.nodeSize;return a[e]=t,new Ze(a,o)}addToStart(e){return new Ze([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Ze(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,i=0;t<this.content.length;t++){let a=this.content[t];e(a,i,t),i+=a.nodeSize}}findDiffStart(e,t=0){return s_(this,e,t)}findDiffEnd(e,t=this.size,i=e.size){return l_(this,e,t,i)}findIndex(e){if(e==0)return Wo(0,e);if(e==this.size)return Wo(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,i=0;;t++){let a=this.child(t),o=i+a.nodeSize;if(o>=e)return o==e?Wo(t+1,o):Wo(t,i);i=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return Ze.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new Ze(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Ze.empty;let t,i=0;for(let a=0;a<e.length;a++){let o=e[a];i+=o.nodeSize,a&&o.isText&&e[a-1].sameMarkup(o)?(t||(t=e.slice(0,a)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new Ze(t||e,i)}static from(e){if(!e)return Ze.empty;if(e instanceof Ze)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Ze([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};A.empty=new A([],0);const nl={index:0,offset:0};function Wo(n,e){return nl.index=n,nl.offset=e,nl}function Sr(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 i=0;i<n.length;i++)if(!Sr(n[i],e[i]))return!1}else{for(let i in n)if(!(i in e)||!Sr(n[i],e[i]))return!1;for(let i in e)if(!(i in n))return!1}return!0}let re=class Jl{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,i=!1;for(let a=0;a<e.length;a++){let o=e[a];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,a));else{if(o.type.excludes(this.type))return e;!i&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,a)),t.push(this),i=!0),t&&t.push(o)}}return t||(t=e.slice()),i||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&&Sr(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 i=e.marks[t.type];if(!i)throw new RangeError(`There is no mark type ${t.type} in this schema`);let a=i.create(t.attrs);return i.checkAttrs(a.attrs),a}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++)if(!e[i].eq(t[i]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Jl.none;if(e instanceof Jl)return[e];let t=e.slice();return t.sort((i,a)=>i.type.rank-a.type.rank),t}};re.none=[];let jr=class extends Error{},V=class Ki{constructor(e,t,i){this.content=e,this.openStart=t,this.openEnd=i}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let i=d_(this.content,e+this.openStart,t);return i&&new Ki(i,this.openStart,this.openEnd)}removeBetween(e,t){return new Ki(u_(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 Ki.empty;let i=t.openStart||0,a=t.openEnd||0;if(typeof i!="number"||typeof a!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Ki(A.fromJSON(e,t.content),i,a)}static maxOpen(e,t=!0){let i=0,a=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)i++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)a++;return new Ki(e,i,a)}};V.empty=new V(A.empty,0,0);function u_(n,e,t){let{index:i,offset:a}=n.findIndex(e),o=n.maybeChild(i),{index:r,offset:l}=n.findIndex(t);if(a==e||o.isText){if(l!=t&&!n.child(r).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(i!=r)throw new RangeError("Removing non-flat range");return n.replaceChild(i,o.copy(u_(o.content,e-a-1,t-a-1)))}function d_(n,e,t,i){let{index:a,offset:o}=n.findIndex(e),r=n.maybeChild(a);if(o==e||r.isText)return i&&!i.canReplace(a,a,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=d_(r.content,e-o-1,t,r);return l&&n.replaceChild(a,r.copy(l))}function TF(n,e,t){if(t.openStart>n.depth)throw new jr("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new jr("Inconsistent open depths");return f_(n,e,t,0)}function f_(n,e,t,i){let a=n.index(i),o=n.node(i);if(a==e.index(i)&&i<n.depth-t.openStart){let r=f_(n,e,t,i+1);return o.copy(o.content.replaceChild(a,r))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==i&&e.depth==i){let r=n.parent,l=r.content;return mi(r,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:r,end:l}=OF(t,n);return mi(o,g_(n,r,l,e,i))}else return mi(o,Ar(n,e,i))}function c_(n,e){if(!e.type.compatibleContent(n.type))throw new jr("Cannot join "+e.type.name+" onto "+n.type.name)}function Gl(n,e,t){let i=n.node(t);return c_(i,e.node(t)),i}function hi(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 La(n,e,t,i){let a=(e||n).node(t),o=0,r=e?e.index(t):a.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(hi(n.nodeAfter,i),o++));for(let l=o;l<r;l++)hi(a.child(l),i);e&&e.depth==t&&e.textOffset&&hi(e.nodeBefore,i)}function mi(n,e){return n.type.checkContent(e),n.copy(e)}function g_(n,e,t,i,a){let o=n.depth>a&&Gl(n,e,a+1),r=i.depth>a&&Gl(t,i,a+1),l=[];return La(null,n,a,l),o&&r&&e.index(a)==t.index(a)?(c_(o,r),hi(mi(o,g_(n,e,t,i,a+1)),l)):(o&&hi(mi(o,Ar(n,e,a+1)),l),La(e,t,a,l),r&&hi(mi(r,Ar(t,i,a+1)),l)),La(i,null,a,l),new A(l)}function Ar(n,e,t){let i=[];if(La(null,n,t,i),n.depth>t){let a=Gl(n,e,t+1);hi(mi(a,Ar(n,e,t+1)),i)}return La(e,null,t,i),new A(i)}function OF(n,e){let t=e.depth-n.openStart,a=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)a=e.node(o).copy(A.from(a));return{start:a.resolveNoCache(n.openStart+t),end:a.resolveNoCache(a.content.size-n.openEnd-t)}}class Qa{constructor(e,t,i){this.pos=e,this.path=t,this.parentOffset=i,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 i=this.pos-this.path[this.path.length-1],a=e.child(t);return i?e.child(t).cut(i):a}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 i=this.path[t*3],a=t==0?0:this.path[t*3-1]+1;for(let o=0;o<e;o++)a+=i.child(o).nodeSize;return a}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return re.none;if(this.textOffset)return e.child(t).marks;let i=e.maybeChild(t-1),a=e.maybeChild(t);if(!i){let l=i;i=a,a=l}let o=i.marks;for(var r=0;r<o.length;r++)o[r].type.spec.inclusive===!1&&(!a||!o[r].isInSet(a.marks))&&(o=o[r--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let i=t.marks,a=e.parent.maybeChild(e.index());for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!a||!i[o].isInSet(a.marks))&&(i=i[o--].removeFromSet(i));return i}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 i=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);i>=0;i--)if(e.pos<=this.end(i)&&(!t||t(this.node(i))))return new Nr(this,e,i);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 i=[],a=0,o=t;for(let r=e;;){let{index:l,offset:u}=r.content.findIndex(o),d=o-u;if(i.push(r,l,a+u),!d||(r=r.child(l),r.isText))break;o=d-1,a+=u+1}return new Qa(t,i,o)}static resolveCached(e,t){let i=Tf.get(e);if(i)for(let o=0;o<i.elts.length;o++){let r=i.elts[o];if(r.pos==t)return r}else Tf.set(e,i=new VF);let a=i.elts[i.i]=Qa.resolve(e,t);return i.i=(i.i+1)%IF,a}}class VF{constructor(){this.elts=[],this.i=0}}const IF=12,Tf=new WeakMap;class Nr{constructor(e,t,i){this.$from=e,this.$to=t,this.depth=i}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 PF=Object.create(null);let on=class Yl{constructor(e,t,i,a=re.none){this.type=e,this.attrs=t,this.marks=a,this.content=i||A.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,i,a=0){this.content.nodesBetween(e,t,i,a,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,i,a){return this.content.textBetween(e,t,i,a)}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,i){return this.type==e&&Sr(this.attrs,t||e.defaultAttrs||PF)&&re.sameSet(this.marks,i||re.none)}copy(e=null){return e==this.content?this:new Yl(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Yl(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,i=!1){if(e==t)return V.empty;let a=this.resolve(e),o=this.resolve(t),r=i?0:a.sharedDepth(t),l=a.start(r),d=a.node(r).content.cut(a.pos-l,o.pos-l);return new V(d,a.depth-r,o.depth-r)}replace(e,t,i){return TF(this.resolve(e),this.resolve(t),i)}nodeAt(e){for(let t=this;;){let{index:i,offset:a}=t.content.findIndex(e);if(t=t.maybeChild(i),!t)return null;if(a==e||t.isText)return t;e-=a+1}}childAfter(e){let{index:t,offset:i}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:i}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:i}=this.content.findIndex(e);if(i<e)return{node:this.content.child(t),index:t,offset:i};let a=this.content.child(t-1);return{node:a,index:t-1,offset:i-a.nodeSize}}resolve(e){return Qa.resolveCached(this,e)}resolveNoCache(e){return Qa.resolve(this,e)}rangeHasMark(e,t,i){let a=!1;return t>e&&this.nodesBetween(e,t,o=>(i.isInSet(o.marks)&&(a=!0),!a)),a}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()+")"),__(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,i=A.empty,a=0,o=i.childCount){let r=this.contentMatchAt(e).matchFragment(i,a,o),l=r&&r.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let u=a;u<o;u++)if(!this.type.allowsMarks(i.child(u).marks))return!1;return!0}canReplaceWith(e,t,i,a){if(a&&!this.type.allowsMarks(a))return!1;let o=this.contentMatchAt(e).matchType(i),r=o&&o.matchFragment(this.content,t);return r?r.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=re.none;for(let t=0;t<this.marks.length;t++){let i=this.marks[t];i.type.checkAttrs(i.attrs),e=i.addToSet(e)}if(!re.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 i;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=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,i)}let a=A.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,a,i);return o.type.checkAttrs(o.attrs),o}};on.prototype.text=void 0;class qr extends on{constructor(e,t,i,a){if(super(e,t,null,a),!i)throw new RangeError("Empty text nodes are not allowed");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):__(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 qr(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new qr(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 __(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class wi{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let i=new $F(e,t);if(i.next==null)return wi.empty;let a=h_(i);i.next&&i.err("Unexpected trailing text");let o=KF(UF(a));return JF(o,i),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,i=e.childCount){let a=this;for(let o=t;a&&o<i;o++)a=a.matchType(e.child(o).type);return a}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 i=0;i<e.next.length;i++)if(this.next[t].type==e.next[i].type)return!0;return!1}fillBefore(e,t=!1,i=0){let a=[this];function o(r,l){let u=r.matchFragment(e,i);if(u&&(!t||u.validEnd))return A.from(l.map(d=>d.createAndFill()));for(let d=0;d<r.next.length;d++){let{type:f,next:c}=r.next[d];if(!(f.isText||f.hasRequiredAttrs())&&a.indexOf(c)==-1){a.push(c);let g=o(c,l.concat(f));if(g)return g}}return null}return o(this,[])}findWrapping(e){for(let i=0;i<this.wrapCache.length;i+=2)if(this.wrapCache[i]==e)return this.wrapCache[i+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),i=[{match:this,type:null,via:null}];for(;i.length;){let a=i.shift(),o=a.match;if(o.matchType(e)){let r=[];for(let l=a;l.type;l=l.via)r.push(l.type);return r.reverse()}for(let r=0;r<o.next.length;r++){let{type:l,next:u}=o.next[r];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!a.type||u.validEnd)&&(i.push({match:l.contentMatch,type:l,via:a}),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(i){e.push(i);for(let a=0;a<i.next.length;a++)e.indexOf(i.next[a].next)==-1&&t(i.next[a].next)}return t(this),e.map((i,a)=>{let o=a+(i.validEnd?"*":" ")+" ";for(let r=0;r<i.next.length;r++)o+=(r?", ":"")+i.next[r].type.name+"->"+e.indexOf(i.next[r].next);return o}).join(`
|
|
2
2
|
`)}}wi.empty=new wi(!0);class $F{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 h_(n){let e=[];do e.push(zF(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function zF(n){let e=[];do e.push(LF(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function LF(n){let e=WF(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=RF(n,e);else break;return e}function Of(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function RF(n,e){let t=Of(n),i=t;return n.eat(",")&&(n.next!="}"?i=Of(n):i=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:i,expr:e}}function HF(n,e){let t=n.nodeTypes,i=t[e];if(i)return[i];let a=[];for(let o in t){let r=t[o];r.isInGroup(e)&&a.push(r)}return a.length==0&&n.err("No node type or group '"+e+"' found"),a}function WF(n){if(n.eat("(")){let e=h_(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=HF(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 UF(n){let e=[[]];return a(o(n,0),t()),e;function t(){return e.push([])-1}function i(r,l,u){let d={term:u,to:l};return e[r].push(d),d}function a(r,l){r.forEach(u=>u.to=l)}function o(r,l){if(r.type=="choice")return r.exprs.reduce((u,d)=>u.concat(o(d,l)),[]);if(r.type=="seq")for(let u=0;;u++){let d=o(r.exprs[u],l);if(u==r.exprs.length-1)return d;a(d,l=t())}else if(r.type=="star"){let u=t();return i(l,u),a(o(r.expr,u),u),[i(u)]}else if(r.type=="plus"){let u=t();return a(o(r.expr,l),u),a(o(r.expr,u),u),[i(u)]}else{if(r.type=="opt")return[i(l)].concat(o(r.expr,l));if(r.type=="range"){let u=l;for(let d=0;d<r.min;d++){let f=t();a(o(r.expr,u),f),u=f}if(r.max==-1)a(o(r.expr,u),u);else for(let d=r.min;d<r.max;d++){let f=t();i(u,f),a(o(r.expr,u),f),u=f}return[i(u)]}else{if(r.type=="name")return[i(l,void 0,r.value)];throw new Error("Unknown expr type")}}}}function m_(n,e){return e-n}function Vf(n,e){let t=[];return i(e),t.sort(m_);function i(a){let o=n[a];if(o.length==1&&!o[0].term)return i(o[0].to);t.push(a);for(let r=0;r<o.length;r++){let{term:l,to:u}=o[r];!l&&t.indexOf(u)==-1&&i(u)}}}function KF(n){let e=Object.create(null);return t(Vf(n,0));function t(i){let a=[];i.forEach(r=>{n[r].forEach(({term:l,to:u})=>{if(!l)return;let d;for(let f=0;f<a.length;f++)a[f][0]==l&&(d=a[f][1]);Vf(n,u).forEach(f=>{d||a.push([l,d=[]]),d.indexOf(f)==-1&&d.push(f)})})});let o=e[i.join(",")]=new wi(i.indexOf(n.length-1)>-1);for(let r=0;r<a.length;r++){let l=a[r][1].sort(m_);o.next.push({type:a[r][0],next:e[l.join(",")]||t(l)})}return o}}function JF(n,e){for(let t=0,i=[n];t<i.length;t++){let a=i[t],o=!a.validEnd,r=[];for(let l=0;l<a.next.length;l++){let{type:u,next:d}=a.next[l];r.push(u.name),o&&!(u.isText||u.hasRequiredAttrs())&&(o=!1),i.indexOf(d)==-1&&i.push(d)}o&&e.err("Only non-generatable nodes ("+r.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function p_(n){let e=Object.create(null);for(let t in n){let i=n[t];if(!i.hasDefault)return null;e[t]=i.default}return e}function F_(n,e){let t=Object.create(null);for(let i in n){let a=e&&e[i];if(a===void 0){let o=n[i];if(o.hasDefault)a=o.default;else throw new RangeError("No value supplied for attribute "+i)}t[i]=a}return t}function b_(n,e,t,i){for(let a in e)if(!(a in n))throw new RangeError(`Unsupported attribute ${a} for ${t} of type ${a}`);for(let a in n){let o=n[a];o.validate&&o.validate(e[a])}}function y_(n,e){let t=Object.create(null);if(e)for(let i in e)t[i]=new YF(n,i,e[i]);return t}let If=class k_{constructor(e,t,i){this.name=e,this.schema=t,this.spec=i,this.markSet=null,this.groups=i.group?i.group.split(" "):[],this.attrs=y_(e,i.attrs),this.defaultAttrs=p_(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(i.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==wi.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:F_(this.attrs,e)}create(e=null,t,i){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new on(this,this.computeAttrs(e),A.from(t),re.setFrom(i))}createChecked(e=null,t,i){return t=A.from(t),this.checkContent(t),new on(this,this.computeAttrs(e),t,re.setFrom(i))}createAndFill(e=null,t,i){if(e=this.computeAttrs(e),t=A.from(t),t.size){let r=this.contentMatch.fillBefore(t);if(!r)return null;t=r.append(t)}let a=this.contentMatch.matchFragment(t),o=a&&a.fillBefore(A.empty,!0);return o?new on(this,e,t.append(o),re.setFrom(i)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let i=0;i<e.childCount;i++)if(!this.allowsMarks(e.child(i).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){b_(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let i=0;i<e.length;i++)this.allowsMarkType(e[i].type)?t&&t.push(e[i]):t||(t=e.slice(0,i));return t?t.length?t:re.none:e}static compile(e,t){let i=Object.create(null);e.forEach((o,r)=>i[o]=new k_(o,t,r));let a=t.spec.topNode||"doc";if(!i[a])throw new RangeError("Schema is missing its top node type ('"+a+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(let o in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i}};function GF(n,e,t){let i=t.split("|");return a=>{let o=a===null?"null":typeof a;if(i.indexOf(o)<0)throw new RangeError(`Expected value of type ${i} for attribute ${e} on type ${n}, got ${o}`)}}class YF{constructor(e,t,i){this.hasDefault=Object.prototype.hasOwnProperty.call(i,"default"),this.default=i.default,this.validate=typeof i.validate=="string"?GF(e,t,i.validate):i.validate}get isRequired(){return!this.hasDefault}}class ps{constructor(e,t,i,a){this.name=e,this.rank=t,this.schema=i,this.spec=a,this.attrs=y_(e,a.attrs),this.excluded=null;let o=p_(this.attrs);this.instance=o?new re(this,o):null}create(e=null){return!e&&this.instance?this.instance:new re(this,F_(this.attrs,e))}static compile(e,t){let i=Object.create(null),a=0;return e.forEach((o,r)=>i[o]=new ps(o,a++,t,r)),i}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){b_(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}let Fs=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let a in e)t[a]=e[a];t.nodes=Ne.from(e.nodes),t.marks=Ne.from(e.marks||{}),this.nodes=If.compile(this.spec.nodes,this),this.marks=ps.compile(this.spec.marks,this);let i=Object.create(null);for(let a in this.nodes){if(a in this.marks)throw new RangeError(a+" can not be both a node and a mark");let o=this.nodes[a],r=o.spec.content||"",l=o.spec.marks;if(o.contentMatch=i[r]||(i[r]=wi.parse(r,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?Pf(this,l.split(" ")):l==""||!o.inlineContent?[]:null}for(let a in this.marks){let o=this.marks[a],r=o.spec.excludes;o.excluded=r==null?[o]:r==""?[]:Pf(this,r.split(" "))}this.nodeFromJSON=a=>on.fromJSON(this,a),this.markFromJSON=a=>re.fromJSON(this,a),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,i,a){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof If){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,i,a)}text(e,t){let i=this.nodes.text;return new qr(i,i.defaultAttrs,e,re.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 Pf(n,e){let t=[];for(let i=0;i<e.length;i++){let a=e[i],o=n.marks[a],r=o;if(o)t.push(o);else for(let l in n.marks){let u=n.marks[l];(a=="_"||u.spec.group&&u.spec.group.split(" ").indexOf(a)>-1)&&t.push(r=u)}if(!r)throw new SyntaxError("Unknown mark type: '"+e[i]+"'")}return t}function XF(n){return n.tag!=null}function ZF(n){return n.style!=null}let Jt=class Xl{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let i=this.matchedStyles=[];t.forEach(a=>{if(XF(a))this.tags.push(a);else if(ZF(a)){let o=/[^=]*/.exec(a.style)[0];i.indexOf(o)<0&&i.push(o),this.styles.push(a)}}),this.normalizeLists=!this.tags.some(a=>{if(!/^(ul|ol)\b/.test(a.tag)||!a.node)return!1;let o=e.nodes[a.node];return o.contentMatch.matchType(o)})}parse(e,t={}){let i=new zf(this,t,!1);return i.addAll(e,re.none,t.from,t.to),i.finish()}parseSlice(e,t={}){let i=new zf(this,t,!0);return i.addAll(e,re.none,t.from,t.to),V.maxOpen(i.finish())}matchTag(e,t,i){for(let a=i?this.tags.indexOf(i)+1:0;a<this.tags.length;a++){let o=this.tags[a];if(t0(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||t.matchesContext(o.context))){if(o.getAttrs){let r=o.getAttrs(e);if(r===!1)continue;o.attrs=r||void 0}return o}}}matchStyle(e,t,i,a){for(let o=a?this.styles.indexOf(a)+1:0;o<this.styles.length;o++){let r=this.styles[o],l=r.style;if(!(l.indexOf(e)!=0||r.context&&!i.matchesContext(r.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(r.getAttrs){let u=r.getAttrs(t);if(u===!1)continue;r.attrs=u||void 0}return r}}}static schemaRules(e){let t=[];function i(a){let o=a.priority==null?50:a.priority,r=0;for(;r<t.length;r++){let l=t[r];if((l.priority==null?50:l.priority)<o)break}t.splice(r,0,a)}for(let a in e.marks){let o=e.marks[a].spec.parseDOM;o&&o.forEach(r=>{i(r=Lf(r)),r.mark||r.ignore||r.clearMark||(r.mark=a)})}for(let a in e.nodes){let o=e.nodes[a].spec.parseDOM;o&&o.forEach(r=>{i(r=Lf(r)),r.node||r.ignore||r.mark||(r.node=a)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Xl(e,Xl.schemaRules(e)))}};const w_={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},QF={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},D_={ol:!0,ul:!0},eo=1,Zl=2,Ra=4;function $f(n,e,t){return e!=null?(e?eo:0)|(e==="full"?Zl:0):n&&n.whitespace=="pre"?eo|Zl:t&~Ra}class Uo{constructor(e,t,i,a,o,r){this.type=e,this.attrs=t,this.marks=i,this.solid=a,this.options=r,this.content=[],this.activeMarks=re.none,this.match=o||(r&Ra?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(A.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let i=this.type.contentMatch,a;return(a=i.findWrapping(e.type))?(this.match=i,a):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&eo)){let i=this.content[this.content.length-1],a;if(i&&i.isText&&(a=/[ \t\r\n\u000c]+$/.exec(i.text))){let o=i;i.text.length==a[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-a[0].length))}}let t=A.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(A.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&&!w_.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class zf{constructor(e,t,i){this.parser=e,this.options=t,this.isOpen=i,this.open=0,this.localPreserveWS=!1;let a=t.topNode,o,r=$f(null,t.preserveWhitespace,0)|(i?Ra:0);a?o=new Uo(a.type,a.attrs,re.none,!0,t.topMatch||a.type.contentMatch,r):i?o=new Uo(null,null,re.none,!0,null,r):o=new Uo(e.schema.topNodeType,null,re.none,!0,null,r),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 i=e.nodeValue,a=this.top,o=a.options&Zl?"full":this.localPreserveWS||(a.options&eo)>0,{schema:r}=this.parser;if(o==="full"||a.inlineContext(e)||/[^ \t\r\n\u000c]/.test(i)){if(o)if(o==="full")i=i.replace(/\r\n?/g,`
|
|
3
3
|
`);else if(r.linebreakReplacement&&/[\r\n]/.test(i)&&this.top.findWrapping(r.linebreakReplacement.create())){let l=i.split(/\r?\n|\r/);for(let u=0;u<l.length;u++)u&&this.insertNode(r.linebreakReplacement.create(),t,!0),l[u]&&this.insertNode(r.text(l[u]),t,!/\S/.test(l[u]));i=""}else i=i.replace(/\r?\n|\r/g," ");else if(i=i.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(i)&&this.open==this.nodes.length-1){let l=a.content[a.content.length-1],u=e.previousSibling;(!l||u&&u.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(i=i.slice(1))}i&&this.insertNode(r.text(i),t,!/\S/.test(i)),this.findInText(e)}else this.findInside(e)}addElement(e,t,i){let a=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let r=e.nodeName.toLowerCase(),l;D_.hasOwnProperty(r)&&this.parser.normalizeLists&&e0(e);let u=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,i));e:if(u?u.ignore:QF.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e,t);else if(!u||u.skip||u.closeParent){u&&u.closeParent?this.open=Math.max(0,this.open-1):u&&u.skip.nodeType&&(e=u.skip);let d,f=this.needsBlock;if(w_.hasOwnProperty(r))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 c=u&&u.skip?t:this.readStyles(e,t);c&&this.addAll(e,c),d&&this.sync(o),this.needsBlock=f}else{let d=this.readStyles(e,t);d&&this.addElementByRule(e,u,d,u.consuming===!1?l:void 0)}this.localPreserveWS=a}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
4
4
|
`),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let i=e.style;if(i&&i.length)for(let a=0;a<this.parser.matchedStyles.length;a++){let o=this.parser.matchedStyles[a],r=i.getPropertyValue(o);if(r)for(let l=void 0;;){let u=this.parser.matchStyle(o,r,this,l);if(!u)break;if(u.ignore)return null;if(u.clearMark?t=t.filter(d=>!u.clearMark(d)):t=t.concat(this.parser.schema.marks[u.mark].create(u.attrs)),u.consuming===!1)l=u;else break}}return t}addElementByRule(e,t,i,a){let o,r;if(t.node)if(r=this.parser.schema.nodes[t.node],r.isLeaf)this.insertNode(r.create(t.attrs),i,e.nodeName=="BR")||this.leafFallback(e,i);else{let u=this.enter(r,t.attrs||null,i,t.preserveWhitespace);u&&(o=!0,i=u)}else{let u=this.parser.schema.marks[t.mark];i=i.concat(u.create(t.attrs))}let l=this.top;if(r&&r.isLeaf)this.findInside(e);else if(a)this.addElement(e,i,a);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(u=>this.insertNode(u,i,!1));else{let u=e;typeof t.contentElement=="string"?u=e.querySelector(t.contentElement):typeof t.contentElement=="function"?u=t.contentElement(e):t.contentElement&&(u=t.contentElement),this.findAround(e,u,!0),this.addAll(u,i),this.findAround(e,u,!1)}o&&this.sync(l)&&this.open--}addAll(e,t,i,a){let o=i||0;for(let r=i?e.childNodes[i]:e.firstChild,l=a==null?null:e.childNodes[a];r!=l;r=r.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(r,t);this.findAtPoint(e,o)}findPlace(e,t,i){let a,o;for(let r=this.open,l=0;r>=0;r--){let u=this.nodes[r],d=u.findWrapping(e);if(d&&(!a||a.length>d.length+l)&&(a=d,o=u,!d.length))break;if(u.solid){if(i)break;l+=2}}if(!a)return null;this.sync(o);for(let r=0;r<a.length;r++)t=this.enterInner(a[r],null,t,!1);return t}insertNode(e,t,i){if(e.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(t=this.enterInner(o,null,t))}let a=this.findPlace(e,t,i);if(a){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(e.type));let r=re.none;for(let l of a.concat(e.marks))(o.type?o.type.allowsMarkType(l.type):Rf(l.type,e.type))&&(r=l.addToSet(r));return o.content.push(e.mark(r)),!0}return!1}enter(e,t,i,a){let o=this.findPlace(e.create(t),i,!1);return o&&(o=this.enterInner(e,t,i,!0,a)),o}enterInner(e,t,i,a=!1,o){this.closeExtra();let r=this.top;r.match=r.match&&r.match.matchType(e);let l=$f(e,o,r.options);r.options&Ra&&r.content.length==0&&(l|=Ra);let u=re.none;return i=i.filter(d=>(r.type?r.type.allowsMarkType(d.type):Rf(d.type,e))?(u=d.addToSet(u),!1):!0),this.nodes.push(new Uo(e,t,u,a,null,l)),this.open++,i}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|=eo)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let i=this.nodes[t].content;for(let a=i.length-1;a>=0;a--)e+=i[a].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let i=0;i<this.find.length;i++)this.find[i].node==e&&this.find[i].offset==t&&(this.find[i].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,i){if(e!=t&&this.find)for(let a=0;a<this.find.length;a++)this.find[a].pos==null&&e.nodeType==1&&e.contains(this.find[a].node)&&t.compareDocumentPosition(this.find[a].node)&(i?2:4)&&(this.find[a].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("/"),i=this.options.context,a=!this.isOpen&&(!i||i.parent.type==this.nodes[0].type),o=-(i?i.depth+1:0)+(a?0:1),r=(l,u)=>{for(;l>=0;l--){let d=t[l];if(d==""){if(l==t.length-1||l==0)continue;for(;u>=o;u--)if(r(l-1,u))return!0;return!1}else{let f=u>0||u==0&&a?this.nodes[u].type:i&&u>=o?i.node(u-o).type:null;if(!f||f.name!=d&&!f.isInGroup(d))return!1;u--}}return!0};return r(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(let t in this.parser.schema.nodes){let i=this.parser.schema.nodes[t];if(i.isTextblock&&i.defaultAttrs)return i}}}function e0(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let i=e.nodeType==1?e.nodeName.toLowerCase():null;i&&D_.hasOwnProperty(i)&&t?(t.appendChild(e),e=t):i=="li"?t=e:i&&(t=null)}}function t0(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function Lf(n){let e={};for(let t in n)e[t]=n[t];return e}function Rf(n,e){let t=e.schema.nodes;for(let i in t){let a=t[i];if(!a.allowsMarkType(n))continue;let o=[],r=l=>{o.push(l);for(let u=0;u<l.edgeCount;u++){let{type:d,next:f}=l.edge(u);if(d==e||o.indexOf(f)<0&&r(f))return!0}};if(r(a.contentMatch))return!0}}class Ni{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},i){i||(i=il(t).createDocumentFragment());let a=i,o=[];return e.forEach(r=>{if(o.length||r.marks.length){let l=0,u=0;for(;l<o.length&&u<r.marks.length;){let d=r.marks[u];if(!this.marks[d.type.name]){u++;continue}if(!d.eq(o[l][0])||d.type.spec.spanning===!1)break;l++,u++}for(;l<o.length;)a=o.pop()[1];for(;u<r.marks.length;){let d=r.marks[u++],f=this.serializeMark(d,r.isInline,t);f&&(o.push([d,a]),a.appendChild(f.dom),a=f.contentDOM||f.dom)}}a.appendChild(this.serializeNodeInner(r,t))}),i}serializeNodeInner(e,t){let{dom:i,contentDOM:a}=cr(il(t),this.nodes[e.type.name](e),null,e.attrs);if(a){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,a)}return i}serializeNode(e,t={}){let i=this.serializeNodeInner(e,t);for(let a=e.marks.length-1;a>=0;a--){let o=this.serializeMark(e.marks[a],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(i),i=o.dom)}return i}serializeMark(e,t,i={}){let a=this.marks[e.type.name];return a&&cr(il(i),a(e,t),null,e.attrs)}static renderSpec(e,t,i=null,a){return cr(e,t,i,a)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Ni(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Hf(e.nodes);return t.text||(t.text=i=>i.text),t}static marksFromSchema(e){return Hf(e.marks)}}function Hf(n){let e={};for(let t in n){let i=n[t].spec.toDOM;i&&(e[t]=i)}return e}function il(n){return n.document||window.document}const Wf=new WeakMap;function n0(n){let e=Wf.get(n);return e===void 0&&Wf.set(n,e=i0(n)),e}function i0(n){let e=null;function t(i){if(i&&typeof i=="object")if(Array.isArray(i))if(typeof i[0]=="string")e||(e=[]),e.push(i);else for(let a=0;a<i.length;a++)t(i[a]);else for(let a in i)t(i[a])}return t(n),e}function cr(n,e,t,i){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 a=e[0],o;if(typeof a!="string")throw new RangeError("Invalid array passed to renderSpec");if(i&&(o=n0(i))&&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 r=a.indexOf(" ");r>0&&(t=a.slice(0,r),a=a.slice(r+1));let l,u=t?n.createElementNS(t,a):n.createElement(a),d=e[1],f=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){f=2;for(let c in d)if(d[c]!=null){let g=c.indexOf(" ");g>0?u.setAttributeNS(c.slice(0,g),c.slice(g+1),d[c]):c=="style"&&u.style?u.style.cssText=d[c]:u.setAttribute(c,d[c])}}for(let c=f;c<e.length;c++){let g=e[c];if(g===0){if(c<e.length-1||c>f)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else{let{dom:_,contentDOM:h}=cr(n,g,t,i);if(u.appendChild(_),h){if(l)throw new RangeError("Multiple content holes");l=h}}}return{dom:u,contentDOM:l}}const v_=65535,E_=Math.pow(2,16);function a0(n,e){return n+e*E_}function Uf(n){return n&v_}function o0(n){return(n-(n&v_))/E_}const x_=1,C_=2,gr=4,B_=8;let Ql=class{constructor(e,t,i){this.pos=e,this.delInfo=t,this.recover=i}get deleted(){return(this.delInfo&B_)>0}get deletedBefore(){return(this.delInfo&(x_|gr))>0}get deletedAfter(){return(this.delInfo&(C_|gr))>0}get deletedAcross(){return(this.delInfo&gr)>0}},Di=class Ji{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Ji.empty)return Ji.empty}recover(e){let t=0,i=Uf(e);if(!this.inverted)for(let a=0;a<i;a++)t+=this.ranges[a*3+2]-this.ranges[a*3+1];return this.ranges[i*3]+t+o0(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,i){let a=0,o=this.inverted?2:1,r=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let u=this.ranges[l]-(this.inverted?a:0);if(u>e)break;let d=this.ranges[l+o],f=this.ranges[l+r],c=u+d;if(e<=c){let g=d?e==u?-1:e==c?1:t:t,_=u+a+(g<0?0:f);if(i)return _;let h=e==(t<0?u:c)?null:a0(l/3,e-u),p=e==u?C_:e==c?x_:gr;return(t<0?e!=u:e!=c)&&(p|=B_),new Ql(_,p,h)}a+=f-d}return i?e+a:new Ql(e+a,0,null)}touches(e,t){let i=0,a=Uf(t),o=this.inverted?2:1,r=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let u=this.ranges[l]-(this.inverted?i:0);if(u>e)break;let d=this.ranges[l+o],f=u+d;if(e<=f&&l==a*3)return!0;i+=this.ranges[l+r]-d}return!1}forEach(e){let t=this.inverted?2:1,i=this.inverted?1:2;for(let a=0,o=0;a<this.ranges.length;a+=3){let r=this.ranges[a],l=r-(this.inverted?o:0),u=r+(this.inverted?0:o),d=this.ranges[a+t],f=this.ranges[a+i];e(l,l+d,u,u+f),o+=f-d}}invert(){return new Ji(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Ji.empty:new Ji(e<0?[0,-e,0]:[0,0,e])}};Di.empty=new Di([]);class to{constructor(e,t,i=0,a=e?e.length:0){this.mirror=t,this.from=i,this.to=a,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new to(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,i=this._maps.length;t<e._maps.length;t++){let a=e.getMirror(t);this.appendMap(e._maps[t],a!=null&&a<t?i+a: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,i=this._maps.length+e._maps.length;t>=0;t--){let a=e.getMirror(t);this.appendMap(e._maps[t].invert(),a!=null&&a>t?i-a-1:void 0)}}invert(){let e=new to;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let i=this.from;i<this.to;i++)e=this._maps[i].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,i){let a=0;for(let o=this.from;o<this.to;o++){let r=this._maps[o],l=r.mapResult(e,t);if(l.recover!=null){let u=this.getMirror(o);if(u!=null&&u>o&&u<this.to){o=u,e=this._maps[u].recover(l.recover);continue}}a|=l.delInfo,e=l.pos}return i?e:new Ql(e,a,null)}}const al=Object.create(null);let Je=class{getMap(){return Di.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let i=al[t.stepType];if(!i)throw new RangeError(`No step type ${t.stepType} defined`);return i.fromJSON(e,t)}static jsonID(e,t){if(e in al)throw new RangeError("Duplicate use of step JSON ID "+e);return al[e]=t,t.prototype.jsonID=e,t}},Qe=class Ma{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Ma(e,null)}static fail(e){return new Ma(null,e)}static fromReplace(e,t,i,a){try{return Ma.ok(e.replace(t,i,a))}catch(o){if(o instanceof jr)return Ma.fail(o.message);throw o}}};function Gu(n,e,t){let i=[];for(let a=0;a<n.childCount;a++){let o=n.child(a);o.content.size&&(o=o.copy(Gu(o.content,e,o))),o.isInline&&(o=e(o,t,a)),i.push(o)}return A.fromArray(i)}let Yu=class Ta extends Je{constructor(e,t,i){super(),this.from=e,this.to=t,this.mark=i}apply(e){let t=e.slice(this.from,this.to),i=e.resolve(this.from),a=i.node(i.sharedDepth(this.to)),o=new V(Gu(t.content,(r,l)=>!r.isAtom||!l.type.allowsMarkType(this.mark.type)?r:r.mark(this.mark.addToSet(r.marks)),a),t.openStart,t.openEnd);return Qe.fromReplace(e,this.from,this.to,o)}invert(){return new qi(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return t.deleted&&i.deleted||t.pos>=i.pos?null:new Ta(t.pos,i.pos,this.mark)}merge(e){return e instanceof Ta&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ta(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 Ta(t.from,t.to,e.markFromJSON(t.mark))}};Je.jsonID("addMark",Yu);let qi=class Oa extends Je{constructor(e,t,i){super(),this.from=e,this.to=t,this.mark=i}apply(e){let t=e.slice(this.from,this.to),i=new V(Gu(t.content,a=>a.mark(this.mark.removeFromSet(a.marks)),e),t.openStart,t.openEnd);return Qe.fromReplace(e,this.from,this.to,i)}invert(){return new Yu(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return t.deleted&&i.deleted||t.pos>=i.pos?null:new Oa(t.pos,i.pos,this.mark)}merge(e){return e instanceof Oa&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Oa(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 Oa(t.from,t.to,e.markFromJSON(t.mark))}};Je.jsonID("removeMark",qi);let Xu=class Va extends Je{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Qe.fail("No node at mark step's position");let i=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Qe.fromReplace(e,this.pos,this.pos+1,new V(A.from(i),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let i=this.mark.addToSet(t.marks);if(i.length==t.marks.length){for(let a=0;a<t.marks.length;a++)if(!t.marks[a].isInSet(i))return new Va(this.pos,t.marks[a]);return new Va(this.pos,this.mark)}}return new Mr(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Va(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 Va(t.pos,e.markFromJSON(t.mark))}};Je.jsonID("addNodeMark",Xu);let Mr=class eu extends Je{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Qe.fail("No node at mark step's position");let i=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Qe.fromReplace(e,this.pos,this.pos+1,new V(A.from(i),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Xu(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new eu(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 eu(t.pos,e.markFromJSON(t.mark))}};Je.jsonID("removeNodeMark",Mr);let wt=class ai extends Je{constructor(e,t,i,a=!1){super(),this.from=e,this.to=t,this.slice=i,this.structure=a}apply(e){return this.structure&&tu(e,this.from,this.to)?Qe.fail("Structure replace would overwrite content"):Qe.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Di([this.from,this.to-this.from,this.slice.size])}invert(e){return new ai(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return t.deletedAcross&&i.deletedAcross?null:new ai(t.pos,Math.max(t.pos,i.pos),this.slice,this.structure)}merge(e){if(!(e instanceof ai)||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?V.empty:new V(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new ai(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?V.empty:new V(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new ai(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 ai(t.from,t.to,V.fromJSON(e,t.slice),!!t.structure)}};Je.jsonID("replace",wt);let We=class _r extends Je{constructor(e,t,i,a,o,r,l=!1){super(),this.from=e,this.to=t,this.gapFrom=i,this.gapTo=a,this.slice=o,this.insert=r,this.structure=l}apply(e){if(this.structure&&(tu(e,this.from,this.gapFrom)||tu(e,this.gapTo,this.to)))return Qe.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Qe.fail("Gap is not a flat range");let i=this.slice.insertAt(this.insert,t.content);return i?Qe.fromReplace(e,this.from,this.to,i):Qe.fail("Content does not fit in gap")}getMap(){return new Di([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 _r(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),i=e.mapResult(this.to,-1),a=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?i.pos:e.map(this.gapTo,1);return t.deletedAcross&&i.deletedAcross||a<t.pos||o>i.pos?null:new _r(t.pos,i.pos,a,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 _r(t.from,t.to,t.gapFrom,t.gapTo,V.fromJSON(e,t.slice),t.insert,!!t.structure)}};Je.jsonID("replaceAround",We);function tu(n,e,t){let i=n.resolve(e),a=t-e,o=i.depth;for(;a>0&&o>0&&i.indexAfter(o)==i.node(o).childCount;)o--,a--;if(a>0){let r=i.node(o).maybeChild(i.indexAfter(o));for(;a>0;){if(!r||r.isLeaf)return!0;r=r.firstChild,a--}}return!1}function r0(n,e,t,i){let a=[],o=[],r,l;n.doc.nodesBetween(e,t,(u,d,f)=>{if(!u.isInline)return;let c=u.marks;if(!i.isInSet(c)&&f.type.allowsMarkType(i.type)){let g=Math.max(d,e),_=Math.min(d+u.nodeSize,t),h=i.addToSet(c);for(let p=0;p<c.length;p++)c[p].isInSet(h)||(r&&r.to==g&&r.mark.eq(c[p])?r.to=_:a.push(r=new qi(g,_,c[p])));l&&l.to==g?l.to=_:o.push(l=new Yu(g,_,i))}}),a.forEach(u=>n.step(u)),o.forEach(u=>n.step(u))}function s0(n,e,t,i){let a=[],o=0;n.doc.nodesBetween(e,t,(r,l)=>{if(!r.isInline)return;o++;let u=null;if(i instanceof ps){let d=r.marks,f;for(;f=i.isInSet(d);)(u||(u=[])).push(f),d=f.removeFromSet(d)}else i?i.isInSet(r.marks)&&(u=[i]):u=r.marks;if(u&&u.length){let d=Math.min(l+r.nodeSize,t);for(let f=0;f<u.length;f++){let c=u[f],g;for(let _=0;_<a.length;_++){let h=a[_];h.step==o-1&&c.eq(a[_].style)&&(g=h)}g?(g.to=d,g.step=o):a.push({style:c,from:Math.max(l,e),to:d,step:o})}}}),a.forEach(r=>n.step(new qi(r.from,r.to,r.style)))}function Zu(n,e,t,i=t.contentMatch,a=!0){let o=n.doc.nodeAt(e),r=[],l=e+1;for(let u=0;u<o.childCount;u++){let d=o.child(u),f=l+d.nodeSize,c=i.matchType(d.type);if(!c)r.push(new wt(l,f,V.empty));else{i=c;for(let g=0;g<d.marks.length;g++)t.allowsMarkType(d.marks[g].type)||n.step(new qi(l,f,d.marks[g]));if(a&&d.isText&&t.whitespace!="pre"){let g,_=/\r?\n|\r/g,h;for(;g=_.exec(d.text);)h||(h=new V(A.from(t.schema.text(" ",t.allowedMarks(d.marks))),0,0)),r.push(new wt(l+g.index,l+g.index+g[0].length,h))}}l=f}if(!i.validEnd){let u=i.fillBefore(A.empty,!0);n.replace(l,l,new V(u,0,0))}for(let u=r.length-1;u>=0;u--)n.step(r[u])}function l0(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Wn(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let i=n.depth,a=0,o=0;;--i){let r=n.$from.node(i),l=n.$from.index(i)+a,u=n.$to.indexAfter(i)-o;if(i<n.depth&&r.canReplace(l,u,t))return i;if(i==0||r.type.spec.isolating||!l0(r,l,u))break;l&&(a=1),u<r.childCount&&(o=1)}return null}function u0(n,e,t){let{$from:i,$to:a,depth:o}=e,r=i.before(o+1),l=a.after(o+1),u=r,d=l,f=A.empty,c=0;for(let h=o,p=!1;h>t;h--)p||i.index(h)>0?(p=!0,f=A.from(i.node(h).copy(f)),c++):u--;let g=A.empty,_=0;for(let h=o,p=!1;h>t;h--)p||a.after(h+1)<a.end(h)?(p=!0,g=A.from(a.node(h).copy(g)),_++):d++;n.step(new We(u,d,r,l,new V(f.append(g),c,_),f.size-c,!0))}function Qu(n,e,t=null,i=n){let a=d0(n,e),o=a&&f0(i,e);return o?a.map(Kf).concat({type:e,attrs:t}).concat(o.map(Kf)):null}function Kf(n){return{type:n,attrs:null}}function d0(n,e){let{parent:t,startIndex:i,endIndex:a}=n,o=t.contentMatchAt(i).findWrapping(e);if(!o)return null;let r=o.length?o[0]:e;return t.canReplaceWith(i,a,r)?o:null}function f0(n,e){let{parent:t,startIndex:i,endIndex:a}=n,o=t.child(i),r=e.contentMatch.findWrapping(o.type);if(!r)return null;let u=(r.length?r[r.length-1]:e).contentMatch;for(let d=i;u&&d<a;d++)u=u.matchType(t.child(d).type);return!u||!u.validEnd?null:r}function c0(n,e,t){let i=A.empty;for(let r=t.length-1;r>=0;r--){if(i.size){let l=t[r].type.contentMatch.matchFragment(i);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=A.from(t[r].type.create(t[r].attrs,i))}let a=e.start,o=e.end;n.step(new We(a,o,a,o,new V(i,0,0),t.length,!0))}function g0(n,e,t,i,a){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=n.steps.length;n.doc.nodesBetween(e,t,(r,l)=>{let u=typeof a=="function"?a(r):a;if(r.isTextblock&&!r.hasMarkup(i,u)&&_0(n.doc,n.mapping.slice(o).map(l),i)){let d=null;if(i.schema.linebreakReplacement){let _=i.whitespace=="pre",h=!!i.contentMatch.matchType(i.schema.linebreakReplacement);_&&!h?d=!1:!_&&h&&(d=!0)}d===!1&&j_(n,r,l,o),Zu(n,n.mapping.slice(o).map(l,1),i,void 0,d===null);let f=n.mapping.slice(o),c=f.map(l,1),g=f.map(l+r.nodeSize,1);return n.step(new We(c,g,c+1,g-1,new V(A.from(i.create(u,null,r.marks)),0,0),1,!0)),d===!0&&S_(n,r,l,o),!1}})}function S_(n,e,t,i){e.forEach((a,o)=>{if(a.isText){let r,l=/\r?\n|\r/g;for(;r=l.exec(a.text);){let u=n.mapping.slice(i).map(t+1+o+r.index);n.replaceWith(u,u+1,e.type.schema.linebreakReplacement.create())}}})}function j_(n,e,t,i){e.forEach((a,o)=>{if(a.type==a.type.schema.linebreakReplacement){let r=n.mapping.slice(i).map(t+1+o);n.replaceWith(r,r+1,e.type.schema.text(`
|
|
@@ -4,7 +4,7 @@ import { i as Xs } from "./interpolation-BHSqsh8Q.mjs";
|
|
|
4
4
|
import { Link as ih, Loader2 as Il, ChevronDown as Wr, Plus as ju, Braces as a0, ArrowUp as o0, ArrowDown as r0, Cog as s0, List as l0, ListOrdered as u0, MousePointerClick as d0, CornerDownLeft as f0, Pilcrow as Dc, icons as vc, Heading1 as nh, Columns3 as c0, Rows3 as g0, LayoutPanelTop as _0, Square as h0, Minus as m0, Maximize as p0, ListCollapse as F0, Image as b0, Clapperboard as y0, Smile as k0, MapPin as w0, ExternalLink as D0, SwatchBook as v0, Copy as Au, Trash2 as ah, ImageIcon as E0, VideoIcon as x0, Zap as C0, Bold as B0, Italic as S0, Underline as j0, Strikethrough as A0, AlignStartVertical as oa, AlignCenterVertical as ra, AlignEndVertical as sa, ImagePlus as q0, GripVertical as M0, X as T0, RotateCcw as N0, ChevronRight as Ec, SendToBack as O0, Globe as I0 } from "lucide-vue-next";
|
|
5
5
|
import { _ as ve } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
6
6
|
import { c as xc } from "./utils-BVKy9S2J.mjs";
|
|
7
|
-
import { c as P0 } from "./floating-ui.dom-
|
|
7
|
+
import { c as P0 } from "./floating-ui.dom-xfqXu4GA.mjs";
|
|
8
8
|
import { w as Od } from "./index-Uf7TwBuW.mjs";
|
|
9
9
|
import { g as $0 } from "./google-CvtuJwgk.mjs";
|
|
10
10
|
const L0 = { class: "flex flex-wrap gap-1" }, z0 = {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),O=require("lucide-vue-next"),S=require("@oneclick.dev/cms-kit"),X=require("./utils-D6CaKJbp.js"),f=require("./DateFormatter-BPPBZp1j.js"),Y={class:"@container/new-res-form space-y-5 py-4"},Z={class:"grid gap-4"},ee={class:"grid gap-4 @md/new-res-form:grid-cols-2"},te={class:"grid gap-2"},oe={class:"flex gap-2 items-center"},ae={class:"grid gap-2"},le={class:"flex gap-2 items-center"},ne={class:"grid gap-2"},re={class:"grid gap-2"},se={class:"grid gap-4"},de={class:"grid gap-4 @md/new-res-form:grid-cols-2"},ie={class:"grid gap-2"},ue={class:"grid gap-4 @md/new-res-form:grid-cols-2"},ce={class:"grid gap-2"},pe={class:"grid gap-2"},me={class:"flex items-center h-9 px-3 text-sm text-muted-foreground"},ve={class:"grid gap-4"},fe={class:"grid gap-4 @md/new-res-form:grid-cols-2"},Ve={class:"grid gap-2"},ge={class:"grid gap-2"},Ne={class:"grid gap-4 @md/new-res-form:grid-cols-2"},_e={class:"grid gap-2"},xe={class:"grid gap-2"},Ce={class:"mt-4 text-red-400"},we={class:"list-disc pl-4"},he={key:0},De={key:1},Ee=e.defineComponent({__name:"NewReservationDialog",setup(Se){const{params:I}=S.useModuleRoute(),{config:T}=S.useModule(),U=S.useFirebaseIntegration(T.project),N=e.ref(!1);e.watch(N,a=>{a&&(x.value=[],c.value=1,i.value=0,n.value=l.value?.resources?.[0]?.id??"",s.value=l.value?.pricingOptions?.find(t=>t.isDefault===!0)?.id??"",r.value="",V.value="",g.value="",p.value="",C.value="")});const _=e.ref(!1),l=e.inject("agendaData",e.ref({})),x=e.ref([]),c=e.ref(1),i=e.ref(0),n=e.ref(""),s=e.ref(""),r=e.ref(""),V=e.ref(""),g=e.ref(""),p=e.ref(""),C=e.ref(""),L=f.$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(f.$14e0f24ef4ac5c92$export$aa8b41735afcabd2()),u=e.ref(),M=new f.$fb18d541ea1ad717$export$ad991b66133851cf("en-US",{dateStyle:"long"}),b=e.computed(()=>{if(!r.value||!s.value)return"";const a=l.value?.pricingOptions?.find(E=>E.id===s.value);if(!a?.duration)return r.value;const[t,m]=r.value.split(":").map(Number);if(isNaN(t)||isNaN(m))return"";const w=t*60+m+a.duration,h=Math.floor(w/60)%24,D=w%60;return`${h.toString().padStart(2,"0")}:${D.toString().padStart(2,"0")}`}),R=()=>{const a=[];return x.value=[],c.value<1&&c.value>9999&&a.push("Please fill in a correct number of spots."),i.value<0&&(i.value=0),n.value||a.push("Please select a resource."),s.value||a.push("Please select a type."),u.value||a.push("Please select the booking date."),(!r.value||r.value.length!==5||r.value?.indexOf(":")===-1||!parseInt(r.value?.replace(":","")))&&a.push("Please select a correct booking time."),V.value||a.push("Please fill in the first name of the customer."),g.value||a.push("Please fill in the last name of the customer."),(!p.value||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(p.value)===!1)&&a.push("Please fill in the correct email of the customer."),x.value=a,a.length===0},q=async()=>{if(R())try{_.value=!0;const a={agendaId:I.value.id,customerInfo:{firstName:V.value,lastName:g.value,email:p.value,phone:C.value},amountPaid:parseFloat(i.value)??0,amountDue:0,subtotal:parseFloat(i.value)??0,total:parseFloat(i.value)??0,createdAt:new Date,updatedAt:new Date,discount:0,flattenedReservationDates:[`${n.value}_${u.value}`],flattenedReservations:[`${n.value}_${u.value}_${r.value?.replace(":","")}`],paymentStatus:"paid",paymentType:"full",reservations:[{status:"approved",totalPrice:parseFloat(i.value?.toFixed(2))??0,basePrice:parseFloat((i.value/c.value).toFixed(2))??0,addOnsPrice:0,addOns:[],date:`${u.value}`,id:`res_${Date.now()}_${Math.random().toString(36).substring(2,9)}`,pricingOption:{duration:l.value?.pricingOptions?.find(t=>t.id===s.value)?.duration||"",id:l.value?.pricingOptions?.find(t=>t.id===s.value)?.id||"",name:l.value?.pricingOptions?.find(t=>t.id===s.value)?.name||"",price:l.value?.pricingOptions?.find(t=>t.id===s.value)?.price||""},pricingOptionId:s.value,resource:{avatarLabel:l.value?.resources?.find(t=>t.id===n.value)?.avatarLabel||"",color:l.value?.resources?.find(t=>t.id===n.value)?.color||"",description:l.value?.resources?.find(t=>t.id===n.value)?.description||"",id:l.value?.resources?.find(t=>t.id===n.value)?.id||"",name:l.value?.resources?.find(t=>t.id===n.value)?.name||""},resourceId:n.value,spots:c.value,timeslot:{startTime:r.value,endTime:b.value}}],status:"confirmed"};await U.add(T.reservationsCollection,a)}catch{}finally{_.value=!1,N.value=!1}};return(a,t)=>{const m=e.resolveComponent("Button"),w=e.resolveComponent("DialogTrigger"),h=e.resolveComponent("DialogTitle"),D=e.resolveComponent("DialogDescription"),E=e.resolveComponent("DialogHeader"),d=e.resolveComponent("Label"),v=e.resolveComponent("Input"),y=e.resolveComponent("SelectValue"),$=e.resolveComponent("SelectTrigger"),k=e.resolveComponent("SelectItem"),P=e.resolveComponent("SelectGroup"),B=e.resolveComponent("SelectContent"),F=e.resolveComponent("Select"),j=e.resolveComponent("PopoverTrigger"),A=e.resolveComponent("Calendar"),H=e.resolveComponent("PopoverContent"),z=e.resolveComponent("Popover"),G=e.resolveComponent("TimeInput"),K=e.resolveComponent("DialogFooter"),J=e.resolveComponent("DialogScrollContent"),Q=e.resolveComponent("Dialog");return e.openBlock(),e.createBlock(Q,{open:N.value,"onUpdate:open":t[10]||(t[10]=o=>N.value=o)},{default:e.withCtx(()=>[e.createVNode(w,{"as-child":""},{default:e.withCtx(()=>[e.createVNode(m,null,{default:e.withCtx(()=>[e.createVNode(e.unref(O.Plus),{class:"size-4"}),t[11]||(t[11]=e.createTextVNode(" Add Reservation ",-1))]),_:1})]),_:1}),e.createVNode(J,{class:"sm:max-w-xl"},{default:e.withCtx(()=>[e.createVNode(E,null,{default:e.withCtx(()=>[e.createVNode(h,null,{default:e.withCtx(()=>[...t[12]||(t[12]=[e.createTextVNode("Create new reservation",-1)])]),_:1}),e.createVNode(D)]),_:1}),e.createElementVNode("div",Y,[e.createElementVNode("div",Z,[e.createElementVNode("div",ee,[e.createElementVNode("div",te,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[13]||(t[13]=[e.createTextVNode("Spots/tickets",-1)])]),_:1}),e.createElementVNode("div",oe,[e.createVNode(v,{modelValue:c.value,"onUpdate:modelValue":t[0]||(t[0]=o=>c.value=o),modelModifiers:{number:!0},type:"number",min:"1",class:"no-spinner"},null,8,["modelValue"])])]),e.createElementVNode("div",ae,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[14]||(t[14]=[e.createTextVNode("Total price paid",-1)])]),_:1}),e.createElementVNode("div",le,[e.createVNode(v,{modelValue:i.value,"onUpdate:modelValue":t[1]||(t[1]=o=>i.value=o),modelModifiers:{number:!0},type:"number",min:"0",class:"no-spinner"},null,8,["modelValue"]),e.createTextVNode(" "+e.toDisplayString(e.unref(l).currency),1)])]),e.createElementVNode("div",ne,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[15]||(t[15]=[e.createTextVNode("Resource",-1)])]),_:1}),e.createVNode(F,{modelValue:n.value,"onUpdate:modelValue":t[2]||(t[2]=o=>n.value=o)},{default:e.withCtx(()=>[e.createVNode($,{class:"w-full"},{default:e.withCtx(()=>[e.createVNode(y,{placeholder:"Select resource"})]),_:1}),e.createVNode(B,null,{default:e.withCtx(()=>[e.createVNode(P,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l).resources,o=>(e.openBlock(),e.createBlock(k,{value:o.id},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.name),1)]),_:2},1032,["value"]))),256))]),_:1})]),_:1})]),_:1},8,["modelValue"])]),e.createElementVNode("div",re,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[16]||(t[16]=[e.createTextVNode("Type",-1)])]),_:1}),e.createVNode(F,{modelValue:s.value,"onUpdate:modelValue":t[3]||(t[3]=o=>s.value=o)},{default:e.withCtx(()=>[e.createVNode($,{class:"w-full"},{default:e.withCtx(()=>[e.createVNode(y,{placeholder:"Select type"})]),_:1}),e.createVNode(B,null,{default:e.withCtx(()=>[e.createVNode(P,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l).pricingOptions,o=>(e.openBlock(),e.createBlock(k,{value:o.id},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.name)+" ("+e.toDisplayString(o.duration)+"min) ",1)]),_:2},1032,["value"]))),256))]),_:1})]),_:1})]),_:1},8,["modelValue"])])])]),e.createElementVNode("div",se,[e.createElementVNode("div",de,[e.createElementVNode("div",ie,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[17]||(t[17]=[e.createTextVNode("Date",-1)])]),_:1}),e.createVNode(z,null,{default:e.withCtx(({close:o})=>[e.createVNode(j,{"as-child":""},{default:e.withCtx(()=>[e.createVNode(m,{variant:"outline",class:e.normalizeClass(e.unref(X.classNames)("w-[240px] justify-start text-left font-normal",!u.value&&"text-muted-foreground"))},{default:e.withCtx(()=>[e.createVNode(e.unref(O.CalendarIcon)),e.createTextVNode(" "+e.toDisplayString(u.value?e.unref(M).format(u.value.toDate(e.unref(f.$14e0f24ef4ac5c92$export$aa8b41735afcabd2)())):"Pick a date"),1)]),_:1},8,["class"])]),_:1}),e.createVNode(H,{class:"w-auto p-0",align:"start"},{default:e.withCtx(()=>[e.createVNode(A,{modelValue:u.value,"onUpdate:modelValue":[t[4]||(t[4]=W=>u.value=W),o],"default-placeholder":e.unref(L),layout:"month-and-year","initial-focus":"",minValue:e.unref(f.$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3)(e.unref(f.$14e0f24ef4ac5c92$export$aa8b41735afcabd2)())},null,8,["modelValue","default-placeholder","onUpdate:modelValue","minValue"])]),_:2},1024)]),_:1})])]),e.createElementVNode("div",ue,[e.createElementVNode("div",ce,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[18]||(t[18]=[e.createTextVNode("Start time",-1)])]),_:1}),e.createVNode(G,{modelValue:r.value,"onUpdate:modelValue":t[5]||(t[5]=o=>r.value=o)},null,8,["modelValue"])]),e.createElementVNode("div",pe,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[19]||(t[19]=[e.createTextVNode("End time",-1)])]),_:1}),e.createElementVNode("div",me,e.toDisplayString(e.unref(b)||"--:--"),1)])])]),e.createElementVNode("div",ve,[e.createElementVNode("div",fe,[e.createElementVNode("div",Ve,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[20]||(t[20]=[e.createTextVNode("Firstname",-1)])]),_:1}),e.createVNode(v,{modelValue:V.value,"onUpdate:modelValue":t[6]||(t[6]=o=>V.value=o)},null,8,["modelValue"])]),e.createElementVNode("div",ge,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[21]||(t[21]=[e.createTextVNode("Lastname",-1)])]),_:1}),e.createVNode(v,{modelValue:g.value,"onUpdate:modelValue":t[7]||(t[7]=o=>g.value=o)},null,8,["modelValue"])])]),e.createElementVNode("div",Ne,[e.createElementVNode("div",_e,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[22]||(t[22]=[e.createTextVNode("E-mail",-1)])]),_:1}),e.createVNode(v,{modelValue:p.value,"onUpdate:modelValue":t[8]||(t[8]=o=>p.value=o)},null,8,["modelValue"])]),e.createElementVNode("div",xe,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[23]||(t[23]=[e.createTextVNode("Phone Nr ",-1),e.createElementVNode("span",{class:"italic text-xs opacity-50"},"optional",-1)])]),_:1}),e.createVNode(v,{modelValue:C.value,"onUpdate:modelValue":t[9]||(t[9]=o=>C.value=o)},null,8,["modelValue"])])])]),e.createElementVNode("div",Ce,[e.createElementVNode("ul",we,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,o=>(e.openBlock(),e.createElementBlock("li",{key:o},e.toDisplayString(o),1))),128))])])]),e.createVNode(K,{class:"gap-2"},{default:e.withCtx(()=>[e.createVNode(m,{onClick:q,disabled:_.value},{default:e.withCtx(()=>[_.value?(e.openBlock(),e.createElementBlock("span",he,"Creating...")):(e.openBlock(),e.createElementBlock("span",De,"Create reservation"))]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["open"])}}});exports._sfc_main=Ee;
|