@dcrackel/hematournamentui 1.0.20 → 1.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- (function(_e,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],l):(_e=typeof globalThis<"u"?globalThis:_e||self,l(_e.HemaTournamentUI={},_e.Vue))})(this,function(_e,l){"use strict";const He=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},Uh={name:"BaseIcon",props:{iconName:{type:String,required:!0},style:{type:String,default:"fa-solid",validator:function(n){return["fa-solid","fa-regular","fa-solid","fa-light","fa-thing"].indexOf(n)!==-1}},size:{type:String,validator:function(n){return["xs","sm","md","lg","xl","2xl","3xl","4xl"].indexOf(n)!==-1},default:"sm"},color:{type:String,default:"primary"}},computed:{computedIconClass(){return[this.style,this.iconName,`text-${this.size}`,this.colorClass]},colorClass(){return`text-${this.color}`}}};function jh(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("i",{class:l.normalizeClass(o.computedIconClass)},null,2)}const hc=He(Uh,[["render",jh]]),Wh={name:"BaseInput",props:{placeholder:{type:String,default:""},value:{type:String,default:""},type:{type:String,default:"borderless",validator:function(n){return["formInput","borderless"].indexOf(n)!==-1}},invalid:{type:Boolean,default:!1}},setup(n,{emit:e}){const t=l.ref(n.value),r=l.ref(null);l.watch(()=>n.value,a=>{t.value=a});const i=l.computed(()=>{let a="appearance-none focus:outline-none";switch(n.type){case"borderless":a+=" w-full text-sm";break;case"formInput":a+=" border rounded-lg text-secondary placeholder:text-xs text-sm p-2 w-full",n.invalid?a+=" border-alarm":a+=" border border-dropdownSelect";break}return a});return{internalValue:t,baseClasses:i,onInput:()=>{clearTimeout(r.value),r.value=setTimeout(()=>{e("update:value",t.value)},300)}}}},qh=["placeholder"];function Kh(n,e,t,r,i,o){return l.withDirectives((l.openBlock(),l.createElementBlock("input",{class:l.normalizeClass(r.baseClasses),placeholder:t.placeholder,"onUpdate:modelValue":e[0]||(e[0]=a=>r.internalValue=a),onInput:e[1]||(e[1]=(...a)=>r.onInput&&r.onInput(...a))},null,42,qh)),[[l.vModelText,r.internalValue]])}const bo=He(Wh,[["render",Kh]]),Gh={name:"BaseRadioGroup",props:{invalid:{type:Boolean,default:!1},items:{type:Array,required:!0}},data(){return{selectedIndex:null}},methods:{selectItem(n){this.selectedIndex=n,this.$emit("update:value",this.items[n].value)}}},Qh={class:"text-xl",role:"radiogroup"},Jh=["onClick","aria-checked","onKeydown"],Xh={class:"flex flex-col"};function Zh(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",Qh,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.items,(a,s)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["flex flex-row p-4 text-quaternary rounded-lg mb-2 shadow border hover:bg-tertiary",[i.selectedIndex===s?" bg-tertiary":" bg-white",t.invalid?" border-alarm":" border-dropdownSelect"]]),key:s,onClick:c=>o.selectItem(s),role:"radio","aria-checked":i.selectedIndex===s?"true":"false",tabindex:"0",onKeydown:l.withKeys(l.withModifiers(c=>o.selectItem(s),["prevent"]),["enter"])},[l.createElementVNode("i",{class:l.normalizeClass([[i.selectedIndex===s?"fa-circle-dot text-quaternary ":"fa-circle "],"fa-regular pr-4 pt-2"])},null,2),l.createElementVNode("div",Xh,[l.createElementVNode("p",{class:l.normalizeClass([[i.selectedIndex===s?"text-quaternary ":""],"font-bold text-sm"])},l.toDisplayString(a.label),3),l.createElementVNode("p",{class:l.normalizeClass([[i.selectedIndex===s?"text-quaternary ":""],"text-sm"])},l.toDisplayString(a.description),3)])],42,Jh))),128))])}const mc=He(Gh,[["render",Zh]]),em={name:"base-tag",props:{label:{type:String,required:!0},backgroundColor:{type:String,validator:function(n){return["primary","secondary","tertiary","neutral","bright"].indexOf(n)!==-1}}},setup(n){return n=l.reactive(n),{classes:l.computed(()=>{let e="cursor-pointer inline-block py-1 px-3 my-2 ml-3 text-xs font-normal rounded-full text-neutral";switch(n.backgroundColor){case"primary":e+=" bg-primary";break;case"secondary":e+=" bg-secondary";break;case"tertiary":e+=" bg-tertiary";break;case"neutral":e+=" bg-neutral";break;case"bright":e+=" bg-bright";break;default:e+=" bg-primary";break}return e})}}};function tm(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(r.classes)},l.toDisplayString(t.label),3)}const gc=He(em,[["render",tm]]),nm={name:"BaseText",props:{text:{type:String,required:!0,default:""},weight:{type:String,default:"normal",validator:function(n){return["light","normal","medium","semi-bold","bold","extra-bold"].indexOf(n)!==-1}},size:{type:String,default:"sm",validator:function(n){return["xs","sm","md","lg","xl","2xl","3xl"].indexOf(n)!==-1}},color:{type:String,default:"primary",validator:function(n){return["neutral","quaternary","tertiary","secondary","primary","bright","primaryHighlight","alarm"].indexOf(n)!==-1}},invalid:{type:Boolean,default:!1},hoverColor:{type:String,default:"none",validator:function(n){return["primary","secondary","tertiary","quaternary","neutral","bright","none"].indexOf(n)!==-1}}},setup(n){return{classes:l.computed(()=>{let e="";switch(n.color){case"neutral":e+=" text-neutral";break;case"tertiary":e+=" text-tertiary";break;case"secondary":e+=" text-secondary";break;case"quaternary":e+=" text-quaternary";break;case"primary":e+=" text-primary";break;case"primaryHighlight":e+=" text-primaryHighlight";break;case"bright":e+=" text-bright";break;case"alarm":e+=" text-alarmText";break}switch(n.invalid&&(e=" text-alarm"),n.hoverColor){case"neutral":e+=" hover:text-neutral";break;case"tertiary":e+=" hover:text-tertiary";break;case"secondary":e+=" hover:text-secondary";break;case"quaternary":e+=" hover:text-quaternary";break;case"primary":e+=" hover:text-primary";break;case"bright":e+=" hover:text-bright";break;case"none":e+="";break}switch(n.weight){case"light":e+=" font-light";break;case"normal":e+=" font-normal";break;case"medium":e+=" font-medium";break;case"semi-bold":e+=" font-semibold";break;case"bold":e+=" font-bold";break;case"extra-bold":e+=" font-extrabold";break}switch(n.size){case"xs":e+=" text-xs";break;case"sm":e+=" text-sm";break;case"md":e+=" text-md";break;case"lg":e+=" text-lg";break;case"xl":e+=" text-xl";break;case"2xl":e+=" text-2xl";break;case"3xl":e+=" text-3xl";break}return e})}}};function rm(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(r.classes)},l.toDisplayString(t.text),3)}const sr=He(nm,[["render",rm]]),im={name:"Breadcrumb",components:{BaseText:sr},props:{items:{type:Array,required:!0,default:()=>[]},onLinkClick:{type:Function,default:()=>{}}}},om={class:"flex flex-row"};function am(n,e,t,r,i,o){const a=l.resolveComponent("BaseText"),s=l.resolveComponent("router-link");return l.openBlock(),l.createElementBlock("nav",om,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.items,(c,d)=>(l.openBlock(),l.createElementBlock("div",{key:d},[d>0?(l.openBlock(),l.createBlock(a,{key:0,text:" > ",size:"lg",color:"quaternary",class:"mr-2"})):l.createCommentVNode("",!0),c.link?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(a,{key:1,class:"mr-2",text:c.text,size:"lg",color:"quaternary"},null,8,["text"])),c.link?(l.openBlock(),l.createBlock(s,{key:2,to:c.link,onClick:t.onLinkClick,class:"mr-2"},{default:l.withCtx(()=>[l.createVNode(a,{text:c.text,size:"lg",color:"quaternary","hover-color":"bright",class:"underline"},null,8,["text"])]),_:2},1032,["to","onClick"])):l.createCommentVNode("",!0)]))),128))])}const sm=He(im,[["render",am]]),lm={name:"base-button",components:{BaseText:sr,BaseIcon:hc},props:{label:{type:String,required:!0},iconName:{type:String,default:""},iconStyle:{type:String,default:"fa-solid",validator:n=>["fa-solid","fa-regular","fa-light","fa-thing"].includes(n)},size:{type:String,default:"sm",validator:n=>["xs","sm","md","lg","xl","2xl","3xl","4xl"].includes(n)},type:{type:String,default:"primary",validator:n=>["primary","secondary","tertiary","bright","admin","adminSecondary","continue","iconOnly","editor"].includes(n)},selected:{type:Boolean,default:!1}},emits:["click"],setup(n,{emit:e}){const t={primary:"px-2.5 mx-1 py-0.5 items-center gap-2.5 rounded-md text-center shadow border border-dropdownSelect justify-center hover:bg-tertiary "+(n.selected?"bg-dropdownSelect":"bg-neutral"),secondary:"px-2.5 mx-1 py-0.5 items-center gap-2.5 rounded-md text-center shadow justify-center hover:bg-primary text-neutral "+(n.selected?"bg-dropdownSelect":"bg-secondary"),tertiary:"px-2.5 mx-1 py-0.5 items-center gap-2.5 rounded-md text-center justify-center hover:bg-primary text-primary "+(n.selected?"bg-primary":"bg-tertiary"),bright:"px-2.5 mx-1 py-0.5 items-center gap-2.5 rounded-md text-center justify-center hover:bg-primary text-neutral "+(n.selected?"bg-primary":"bg-bright"),admin:"px-2.5 mx-1 py-2 items-center rounded-md gap-2.5 text-center hover:bg-primary my-1 text-neutral hover:bg-primaryHighlight "+(n.selected,"bg-primary"),adminSecondary:"px-2.5 mx-1 py-0.5 items-center gap-2.5 text-center my-1 pb-0.5 border-b border-secondary hover:border-b hover:border-neutral w-11/12 text-neutral "+(n.selected,"bg-primary"),continue:"px-2.5 mx-1 items-center gap-2.5 text-center my-1 p-3 border-b border-secondary hover:border-b hover:border-neutral w-full rounded-lg flex flex-row justify-center "+(n.selected?"bg-secondary":"bg-primary"),iconOnly:"py-0.5 items-center rounded-md text-center shadow border border-dropdownSelect justify-center hover:bg-tertiary",editor:"px-1 items-center rounded-md text-center justify-center hover:bg-tertiary"},r={xs:"text-xs",sm:"text-sm",md:"text-md",lg:"text-lg",xl:"text-xl","2xl":"text-2xl","3xl":"text-3xl","4xl":"text-4xl"};return{textColor:l.computed(()=>({primary:"primary",secondary:"secondary",tertiary:"tertiary",bright:"bright",admin:"neutral",adminSecondary:"neutral",continue:"neutral",editor:n.selected?"bright":"quaternary"})[n.type]),classes:l.computed(()=>{let i="inline-flex",o=t[n.type];if(n.selected)switch(n.type){case"primary":o=o.replace("bg-neutral","bg-dropdownSelect");break;case"secondary":o=o.replace("bg-secondary","bg-dropdownSelect");break}let a=r[n.size];return`${i} ${o} ${a}`}),onClick(){e("click")}}}};function cm(n,e,t,r,i,o){const a=l.resolveComponent("BaseIcon"),s=l.resolveComponent("BaseText");return l.openBlock(),l.createElementBlock("button",{"data-testid":"base-button",class:l.normalizeClass(r.classes),type:"button",onClick:e[0]||(e[0]=(...c)=>r.onClick&&r.onClick(...c))},[t.iconName?(l.openBlock(),l.createBlock(a,{key:0,"data-testid":"base-icon","icon-name":t.iconName,style:l.normalizeStyle(t.iconStyle),color:r.textColor,size:t.size},null,8,["icon-name","style","color","size"])):l.createCommentVNode("",!0),l.createVNode(s,{"data-testid":"base-text",color:r.textColor,size:t.size,text:t.label,weight:"normal"},null,8,["color","size","text"])],2)}const Rr=He(lm,[["render",cm]]),dm={name:"tournament-card-details",components:{BaseButton:Rr,BaseText:sr},props:{detail:{type:Object,required:!0,default:()=>({name:"",date:"",closes:"",location:""})}}},um={class:"flex flex-col w-full pt-4 pb-3 px-3"},fm={class:"mt-4 flex flex-col"},pm={class:"flex flex-row w-full justify-end"};function hm(n,e,t,r,i,o){const a=l.resolveComponent("BaseText"),s=l.resolveComponent("BaseButton");return l.openBlock(),l.createElementBlock("div",um,[l.createVNode(a,{text:t.detail.name,color:"primary",size:"xl",weight:"semi-bold"},null,8,["text"]),l.createVNode(a,{text:t.detail.location,color:"primary",size:"sm",weight:"normal"},null,8,["text"]),l.createElementVNode("div",fm,[l.createVNode(a,{text:`${t.detail.date}`,color:"primaryHighlight",size:"sm",weight:"light"},null,8,["text"]),l.createVNode(a,{text:`${t.detail.closes}`,color:"primaryHighlight",size:"sm",weight:"light"},null,8,["text"])]),l.createElementVNode("div",pm,[l.createVNode(s,{label:"Edit",class:"mt-2",primary:""})])])}const yc=He(dm,[["render",hm]]),vc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADICAYAAABS39xVAAAAAXNSR0IArs4c6QAABdlJREFUeF7t1AEJACAQBEGNaiOzWkDBFgvzCY655+ba5w5HgACBgMA0WIGWRCRA4AsYLI9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBB4p/0F3nyMcxwAAAABJRU5ErkJggg==",mm={name:"tournament-card-header",components:{BaseTag:gc},props:{artwork:{type:String,required:!0,default:vc},tags:{type:Array,default:()=>[]}},computed:{backgroundStyle(){return`background-image: url('${this.artwork||vc}');`}}},gm={class:"rounded-t-xl w-full"},ym={class:"flex flex-row"};function vm(n,e,t,r,i,o){const a=l.resolveComponent("BaseTag");return l.openBlock(),l.createElementBlock("div",gm,[l.createElementVNode("div",{style:l.normalizeStyle(o.backgroundStyle),class:"h-36 w-full flex flex-col justify-end rounded-t-xl bg-cover bg-no-repeat bg-center"},[l.createElementVNode("div",ym,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.tags,s=>(l.openBlock(),l.createBlock(a,{key:s,label:s},null,8,["label"]))),128))])],4)])}const bc=He(mm,[["render",vm]]),bm={name:"DropDownMenu",components:{BaseText:sr},props:{label:{type:String},items:{type:Array,validator:n=>n.every(e=>typeof e.text=="string")},selectedItem:{type:Object,default:()=>({text:""}),validator:n=>typeof n.text=="string"}},data:()=>({isDropDownOpen:!1}),methods:{handleClick(n){this.isDropDownOpen=!1,this.$emit("update:selectedItem",n)},handleDropDown(){this.isDropDownOpen=!this.isDropDownOpen}}},wm={class:"flex flex-row"},km=l.createElementVNode("i",{class:"fa-solid fa-chevron-down text-xs"},null,-1),xm={key:0,class:"flex flex-col w-32 shadow mt-2 z-10 rounded-xl py-1 absolute bg-neutral"},Cm=["onClick"];function Mm(n,e,t,r,i,o){const a=l.resolveComponent("BaseText");return l.openBlock(),l.createElementBlock("div",wm,[l.createElementVNode("span",null,[l.createElementVNode("div",{class:"z-10 rounded-lg shadow px-2 py-2 w-40 flex flex-row justify-between",onClick:e[0]||(e[0]=s=>o.handleDropDown())},[l.createVNode(a,{text:t.label,color:"quaternary",size:"sm",weight:"normal"},null,8,["text"]),l.createVNode(a,{text:t.selectedItem.text,color:"secondary",size:"sm",weight:"normal"},null,8,["text"]),km]),n.isDropDownOpen?(l.openBlock(),l.createElementBlock("div",xm,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.items,s=>(l.openBlock(),l.createElementBlock("a",{key:s.id,onClick:c=>o.handleClick(s),class:"hover:bg-dropdownSelect py-1 px-2 border-b border-dropdownSelect last:border-0"},[l.createVNode(a,{text:s.text,color:"primary",size:"xs",weight:"normal"},null,8,["text"])],8,Cm))),128))])):l.createCommentVNode("",!0)])])}const _a=He(bm,[["render",Mm]]),Tm={name:"FilterAndSortBar",components:{DropDownMenu:_a,BaseInput:bo},props:{label:{type:String},items:{type:Array,default:()=>[]},selectedItem:null},data(){return{filterText:"",localSelectedItem:this.selectedItem}},methods:{handleFilter(n){this.$emit("filterbar",n)},handleSelectedItem(n){this.$emit("sort",n),this.localSelectedItem=n}}},Sm={class:"flex flex-row w-full justify-between"},Dm={class:"rounded-lg shadow px-2 py-1 w-full flex flex-row mt-0.5 mr-4"},Am=l.createElementVNode("i",{class:"fa-solid fa-magnifying-glass text-primaryHighlight w-6 mt-1"},null,-1);function Em(n,e,t,r,i,o){const a=l.resolveComponent("BaseInput"),s=l.resolveComponent("DropDownMenu");return l.openBlock(),l.createElementBlock("section",Sm,[l.createElementVNode("div",Dm,[Am,l.createVNode(a,{placeholder:"Search on Name, Location, or Date",class:"text-quaternary",value:i.filterText,"onUpdate:value":o.handleFilter},null,8,["value","onUpdate:value"])]),l.createElementVNode("div",null,[l.createVNode(s,{label:t.label,items:t.items,selectedItem:i.localSelectedItem,"onUpdate:selectedItem":o.handleSelectedItem},null,8,["label","items","selectedItem","onUpdate:selectedItem"])])])}const Om=He(Tm,[["render",Em]]),Nm={name:"FilterUpcomingPast",components:{BaseText:sr,BaseButton:Rr,DropDownMenu:_a,BaseInput:bo},props:{selected:{type:String,default:"All"}},data(){return{localSelected:this.selected}},methods:{handleTimeFrame(n){this.$emit("timeFrame",n),this.localSelected=n}}},_m={class:"flex flex-row w-full justify-between"},Bm={class:"rounded-lg w-3/4"},Pm={class:"flex flex-row h-8 w-1/4 justify-end"};function Im(n,e,t,r,i,o){const a=l.resolveComponent("BaseText"),s=l.resolveComponent("BaseButton");return l.openBlock(),l.createElementBlock("section",_m,[l.createElementVNode("div",Bm,[l.createVNode(a,{text:"Tournament",color:"primary",size:"2xl",weight:"normal"})]),l.createElementVNode("div",Pm,[l.createVNode(s,{label:"All",color:"primary",size:"sm",selected:i.localSelected==="All",onClick:e[0]||(e[0]=c=>o.handleTimeFrame("ALL"))},null,8,["selected"]),l.createVNode(s,{label:"Upcoming",color:"primary",size:"sm",selected:i.localSelected==="Upcoming",onClick:e[1]||(e[1]=c=>o.handleTimeFrame("Upcoming"))},null,8,["selected"]),l.createVNode(s,{label:"Past",color:"primary",size:"sm",selected:i.localSelected==="Past",onClick:e[2]||(e[2]=c=>o.handleTimeFrame("Past"))},null,8,["selected"])])])}const Rm=He(Nm,[["render",Im]]),wc={subpremise:"short_name",street_number:"short_name",route:"long_name",locality:"long_name",administrative_area_level_1:"short_name",administrative_area_level_2:"long_name",country:"long_name",postal_code:"short_name"},Vm=["locality","administrative_area_level_3"],Lm=["locality","sublocality","postal_code","country","administrative_area_level_1","administrative_area_level_2"],$m=["address_components","adr_address","alt_id","formatted_address","geometry","icon","id","name","business_status","photo","place_id","scope","type","url","utc_offset_minutes","vicinity"],Fm={name:"VueGoogleAutocomplete",props:{id:{type:String,required:!0},classname:String,placeholder:{type:String,default:"Start typing"},disabled:{type:Boolean,default:!1},types:{type:String,default:"address"},fields:{type:Array,default:function(){return $m}},country:{type:[String,Array],default:null},enableGeolocation:{type:Boolean,default:!1},geolocationOptions:{type:Object,default:null}},data(){return{autocomplete:null,autocompleteText:"",geolocation:{geocoder:null,loc:null,position:null}}},watch:{autocompleteText:function(n,e){this.$emit("inputChange",{newVal:n,oldVal:e},this.id)},country:function(n,e){this.autocomplete.setComponentRestrictions({country:this.country===null?[]:this.country})}},mounted:function(){const n={};this.types&&(n.types=[this.types]),this.country&&(n.componentRestrictions={country:this.country}),this.autocomplete=new google.maps.places.Autocomplete(document.getElementById(this.id),n),this.autocomplete.setFields(this.fields),this.autocomplete.addListener("place_changed",this.onPlaceChanged)},methods:{onPlaceChanged(){let n=this.autocomplete.getPlace();if(!n.geometry){this.$emit("no-results-found",n,this.id);return}n.address_components!==void 0&&(this.$emit("placechanged",this.formatResult(n),n,this.id),this.autocompleteText=document.getElementById(this.id).value,this.onChange())},onFocus(){this.biasAutocompleteLocation(),this.$emit("focus")},onBlur(){this.$emit("blur")},onChange(){this.$emit("change",this.autocompleteText)},onKeyPress(n){this.$emit("keypress",n)},onKeyUp(n){this.$emit("keyup",n)},clear(){this.autocompleteText=""},focus(){this.$refs.autocomplete.focus()},blur(){this.$refs.autocomplete.blur()},update(n){this.autocompleteText=n},updateCoordinates(n){!n&&!(n.lat||n.lng)||(this.geolocation.geocoder||(this.geolocation.geocoder=new google.maps.Geocoder),this.geolocation.geocoder.geocode({location:n},(e,t)=>{t==="OK"?(e=this.filterGeocodeResultTypes(e),e[0]?(this.$emit("placechanged",this.formatResult(e[0]),e[0],this.id),this.update(e[0].formatted_address)):this.$emit("error","no result for provided coordinates")):this.$emit("error","error getting address from coords")}))},geolocate(){this.updateGeolocation((n,e)=>{this.updateCoordinates(n)})},updateGeolocation(n=null){if(navigator.geolocation){let e={};this.geolocationOptions&&Object.assign(e,this.geolocationOptions),navigator.geolocation.getCurrentPosition(t=>{let r={lat:t.coords.latitude,lng:t.coords.longitude};this.geolocation.loc=r,this.geolocation.position=t,n&&n(r,t)},t=>{this.$emit("error","Cannot get Coordinates from navigator",t)},e)}},biasAutocompleteLocation(){this.enableGeolocation&&this.updateGeolocation((n,e)=>{let t=new google.maps.Circle({center:n,radius:e.coords.accuracy});this.autocomplete.setBounds(t.getBounds())})},formatResult(n){let e={};for(let t=0;t<n.address_components.length;t++){let r=n.address_components[t].types[0];if(wc[r]){let i=n.address_components[t][wc[r]];e[r]=i}}return e.latitude=n.geometry.location.lat(),e.longitude=n.geometry.location.lng(),e},filterGeocodeResultTypes(n){if(!n||!this.types)return n;let e=[],t=[this.types];t.includes("(cities)")&&(t=t.concat(Vm)),t.includes("(regions)")&&(t=t.concat(Lm));for(let r of n)for(let i of r.types)if(t.includes(i)){e.push(r);break}return e}}},zm=["id","placeholder","disabled"];function Hm(n,e,t,r,i,o){return l.withDirectives((l.openBlock(),l.createElementBlock("input",{ref:"autocomplete",type:"text",class:l.normalizeClass(t.classname),id:t.id,placeholder:t.placeholder,disabled:t.disabled,"onUpdate:modelValue":e[0]||(e[0]=a=>i.autocompleteText=a),onFocus:e[1]||(e[1]=a=>o.onFocus()),onBlur:e[2]||(e[2]=a=>o.onBlur()),onChange:e[3]||(e[3]=(...a)=>o.onChange&&o.onChange(...a)),onKeypress:e[4]||(e[4]=(...a)=>o.onKeyPress&&o.onKeyPress(...a)),onKeyup:e[5]||(e[5]=(...a)=>o.onKeyUp&&o.onKeyUp(...a))},null,42,zm)),[[l.vModelText,i.autocompleteText]])}const Ym={components:{VueGoogleAutocomplete:He(Fm,[["render",Hm]])},props:{invalid:{type:Boolean,default:!1}},data(){return{address:"",coordinates:""}},methods:{getAddressData(n){const e=`${n.street_number} ${n.route}`,t=n.locality,r=n.administrative_area_level_1;this.address=`${e}, ${t}, ${r}`,this.coordinates=`${n.latitude},${n.longitude}`;const i={address:this.address,coordinates:this.coordinates};this.$emit("update:address",i)}}};function Um(n,e,t,r,i,o){const a=l.resolveComponent("vue-google-autocomplete");return l.openBlock(),l.createBlock(a,{class:l.normalizeClass(["border rounded-lg text-secondary text-xs p-2 w-full appearance-none focus:outline-none",t.invalid?"border-alarm":"border-dropdownSelect"]),id:"map",ref:"address",modelValue:i.address,"onUpdate:modelValue":e[0]||(e[0]=s=>i.address=s),placeholder:"Venue Address",onPlacechanged:o.getAddressData},null,8,["class","modelValue","onPlacechanged"])}const kc=He(Ym,[["render",Um]]);function Pt(n){"@babel/helpers - typeof";return Pt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pt(n)}function pe(n){if(n===null||n===!0||n===!1)return NaN;var e=Number(n);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function se(n,e){if(e.length<n)throw new TypeError(n+" argument"+(n>1?"s":"")+" required, but only "+e.length+" present")}function ue(n){se(1,arguments);var e=Object.prototype.toString.call(n);return n instanceof Date||Pt(n)==="object"&&e==="[object Date]"?new Date(n.getTime()):typeof n=="number"||e==="[object Number]"?new Date(n):((typeof n=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Cn(n,e){se(2,arguments);var t=ue(n),r=pe(e);return isNaN(r)?new Date(NaN):(r&&t.setDate(t.getDate()+r),t)}function jt(n,e){se(2,arguments);var t=ue(n),r=pe(e);if(isNaN(r))return new Date(NaN);if(!r)return t;var i=t.getDate(),o=new Date(t.getTime());o.setMonth(t.getMonth()+r+1,0);var a=o.getDate();return i>=a?o:(t.setFullYear(o.getFullYear(),o.getMonth(),i),t)}function xc(n,e){if(se(2,arguments),!e||Pt(e)!=="object")return new Date(NaN);var t=e.years?pe(e.years):0,r=e.months?pe(e.months):0,i=e.weeks?pe(e.weeks):0,o=e.days?pe(e.days):0,a=e.hours?pe(e.hours):0,s=e.minutes?pe(e.minutes):0,c=e.seconds?pe(e.seconds):0,d=ue(n),u=r||t?jt(d,r+t*12):d,f=o||i?Cn(u,o+i*7):u,p=s+a*60,h=c+p*60,m=h*1e3,g=new Date(f.getTime()+m);return g}function jm(n,e){se(2,arguments);var t=ue(n).getTime(),r=pe(e);return new Date(t+r)}var Wm={};function on(){return Wm}function lr(n,e){var t,r,i,o,a,s,c,d;se(1,arguments);var u=on(),f=pe((t=(r=(i=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(c=u.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&t!==void 0?t:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=ue(n),h=p.getDay(),m=(h<f?7:0)+h-f;return p.setDate(p.getDate()-m),p.setHours(0,0,0,0),p}function wo(n){return se(1,arguments),lr(n,{weekStartsOn:1})}function qm(n){se(1,arguments);var e=ue(n),t=e.getFullYear(),r=new Date(0);r.setFullYear(t+1,0,4),r.setHours(0,0,0,0);var i=wo(r),o=new Date(0);o.setFullYear(t,0,4),o.setHours(0,0,0,0);var a=wo(o);return e.getTime()>=i.getTime()?t+1:e.getTime()>=a.getTime()?t:t-1}function Km(n){se(1,arguments);var e=qm(n),t=new Date(0);t.setFullYear(e,0,4),t.setHours(0,0,0,0);var r=wo(t);return r}function ko(n){var e=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return e.setUTCFullYear(n.getFullYear()),n.getTime()-e.getTime()}function Cc(n){se(1,arguments);var e=ue(n);return e.setHours(0,0,0,0),e}var Gm=864e5;function Qm(n,e){se(2,arguments);var t=Cc(n),r=Cc(e),i=t.getTime()-ko(t),o=r.getTime()-ko(r);return Math.round((i-o)/Gm)}function Jm(n,e){se(2,arguments);var t=pe(e),r=t*3;return jt(n,r)}function Ba(n,e){se(2,arguments);var t=pe(e);return jt(n,t*12)}var Pa=6e4,Ia=36e5,Xm=1e3;function Mc(n){return se(1,arguments),n instanceof Date||Pt(n)==="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Mi(n){if(se(1,arguments),!Mc(n)&&typeof n!="number")return!1;var e=ue(n);return!isNaN(Number(e))}function Tc(n,e){var t;se(1,arguments);var r=n||{},i=ue(r.start),o=ue(r.end),a=o.getTime();if(!(i.getTime()<=a))throw new RangeError("Invalid interval");var s=[],c=i;c.setHours(0,0,0,0);var d=Number((t=e==null?void 0:e.step)!==null&&t!==void 0?t:1);if(d<1||isNaN(d))throw new RangeError("`options.step` must be a number greater than 1");for(;c.getTime()<=a;)s.push(ue(c)),c.setDate(c.getDate()+d),c.setHours(0,0,0,0);return s}function Ti(n){se(1,arguments);var e=ue(n),t=e.getMonth(),r=t-t%3;return e.setMonth(r,1),e.setHours(0,0,0,0),e}function Zm(n){se(1,arguments);var e=n||{},t=ue(e.start),r=ue(e.end),i=r.getTime();if(!(t.getTime()<=i))throw new RangeError("Invalid interval");var o=Ti(t),a=Ti(r);i=a.getTime();for(var s=[],c=o;c.getTime()<=i;)s.push(ue(c)),c=Jm(c,1);return s}function eg(n){se(1,arguments);var e=ue(n),t=e.getFullYear();return e.setFullYear(t+1,0,0),e.setHours(23,59,59,999),e}function tg(n){se(1,arguments);var e=ue(n),t=new Date(0);return t.setFullYear(e.getFullYear(),0,1),t.setHours(0,0,0,0),t}function ng(n,e){var t,r,i,o,a,s,c,d;se(1,arguments);var u=on(),f=pe((t=(r=(i=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(c=u.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&t!==void 0?t:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=ue(n),h=p.getDay(),m=(h<f?-7:0)+6-(h-f);return p.setDate(p.getDate()+m),p.setHours(23,59,59,999),p}function Sc(n){se(1,arguments);var e=ue(n),t=e.getMonth(),r=t-t%3+3;return e.setMonth(r,0),e.setHours(23,59,59,999),e}function Dc(n,e){se(2,arguments);var t=pe(e);return jm(n,-t)}var rg=864e5;function ig(n){se(1,arguments);var e=ue(n),t=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var r=e.getTime(),i=t-r;return Math.floor(i/rg)+1}function Vr(n){se(1,arguments);var e=1,t=ue(n),r=t.getUTCDay(),i=(r<e?7:0)+r-e;return t.setUTCDate(t.getUTCDate()-i),t.setUTCHours(0,0,0,0),t}function Ac(n){se(1,arguments);var e=ue(n),t=e.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(t+1,0,4),r.setUTCHours(0,0,0,0);var i=Vr(r),o=new Date(0);o.setUTCFullYear(t,0,4),o.setUTCHours(0,0,0,0);var a=Vr(o);return e.getTime()>=i.getTime()?t+1:e.getTime()>=a.getTime()?t:t-1}function og(n){se(1,arguments);var e=Ac(n),t=new Date(0);t.setUTCFullYear(e,0,4),t.setUTCHours(0,0,0,0);var r=Vr(t);return r}var ag=6048e5;function Ec(n){se(1,arguments);var e=ue(n),t=Vr(e).getTime()-og(e).getTime();return Math.round(t/ag)+1}function cr(n,e){var t,r,i,o,a,s,c,d;se(1,arguments);var u=on(),f=pe((t=(r=(i=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(c=u.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&t!==void 0?t:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=ue(n),h=p.getUTCDay(),m=(h<f?7:0)+h-f;return p.setUTCDate(p.getUTCDate()-m),p.setUTCHours(0,0,0,0),p}function Ra(n,e){var t,r,i,o,a,s,c,d;se(1,arguments);var u=ue(n),f=u.getUTCFullYear(),p=on(),h=pe((t=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&i!==void 0?i:p.firstWeekContainsDate)!==null&&r!==void 0?r:(c=p.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var m=new Date(0);m.setUTCFullYear(f+1,0,h),m.setUTCHours(0,0,0,0);var g=cr(m,e),k=new Date(0);k.setUTCFullYear(f,0,h),k.setUTCHours(0,0,0,0);var x=cr(k,e);return u.getTime()>=g.getTime()?f+1:u.getTime()>=x.getTime()?f:f-1}function sg(n,e){var t,r,i,o,a,s,c,d;se(1,arguments);var u=on(),f=pe((t=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&i!==void 0?i:u.firstWeekContainsDate)!==null&&r!==void 0?r:(c=u.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&t!==void 0?t:1),p=Ra(n,e),h=new Date(0);h.setUTCFullYear(p,0,f),h.setUTCHours(0,0,0,0);var m=cr(h,e);return m}var lg=6048e5;function Oc(n,e){se(1,arguments);var t=ue(n),r=cr(t,e).getTime()-sg(t,e).getTime();return Math.round(r/lg)+1}function Ee(n,e){for(var t=n<0?"-":"",r=Math.abs(n).toString();r.length<e;)r="0"+r;return t+r}var cg={y:function(e,t){var r=e.getUTCFullYear(),i=r>0?r:1-r;return Ee(t==="yy"?i%100:i,t.length)},M:function(e,t){var r=e.getUTCMonth();return t==="M"?String(r+1):Ee(r+1,2)},d:function(e,t){return Ee(e.getUTCDate(),t.length)},a:function(e,t){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(e,t){return Ee(e.getUTCHours()%12||12,t.length)},H:function(e,t){return Ee(e.getUTCHours(),t.length)},m:function(e,t){return Ee(e.getUTCMinutes(),t.length)},s:function(e,t){return Ee(e.getUTCSeconds(),t.length)},S:function(e,t){var r=t.length,i=e.getUTCMilliseconds(),o=Math.floor(i*Math.pow(10,r-3));return Ee(o,t.length)}};const Bn=cg;var Lr={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},dg={G:function(e,t,r){var i=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(i,{width:"abbreviated"});case"GGGGG":return r.era(i,{width:"narrow"});case"GGGG":default:return r.era(i,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){var i=e.getUTCFullYear(),o=i>0?i:1-i;return r.ordinalNumber(o,{unit:"year"})}return Bn.y(e,t)},Y:function(e,t,r,i){var o=Ra(e,i),a=o>0?o:1-o;if(t==="YY"){var s=a%100;return Ee(s,2)}return t==="Yo"?r.ordinalNumber(a,{unit:"year"}):Ee(a,t.length)},R:function(e,t){var r=Ac(e);return Ee(r,t.length)},u:function(e,t){var r=e.getUTCFullYear();return Ee(r,t.length)},Q:function(e,t,r){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Ee(i,2);case"Qo":return r.ordinalNumber(i,{unit:"quarter"});case"QQQ":return r.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,r){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Ee(i,2);case"qo":return r.ordinalNumber(i,{unit:"quarter"});case"qqq":return r.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,r){var i=e.getUTCMonth();switch(t){case"M":case"MM":return Bn.M(e,t);case"Mo":return r.ordinalNumber(i+1,{unit:"month"});case"MMM":return r.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,r){var i=e.getUTCMonth();switch(t){case"L":return String(i+1);case"LL":return Ee(i+1,2);case"Lo":return r.ordinalNumber(i+1,{unit:"month"});case"LLL":return r.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,r,i){var o=Oc(e,i);return t==="wo"?r.ordinalNumber(o,{unit:"week"}):Ee(o,t.length)},I:function(e,t,r){var i=Ec(e);return t==="Io"?r.ordinalNumber(i,{unit:"week"}):Ee(i,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):Bn.d(e,t)},D:function(e,t,r){var i=ig(e);return t==="Do"?r.ordinalNumber(i,{unit:"dayOfYear"}):Ee(i,t.length)},E:function(e,t,r){var i=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return r.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(i,{width:"short",context:"formatting"});case"EEEE":default:return r.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,r,i){var o=e.getUTCDay(),a=(o-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return Ee(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});case"eeee":default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,r,i){var o=e.getUTCDay(),a=(o-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return Ee(a,t.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});case"cccc":default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,r){var i=e.getUTCDay(),o=i===0?7:i;switch(t){case"i":return String(o);case"ii":return Ee(o,t.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(i,{width:"short",context:"formatting"});case"iiii":default:return r.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,r){var i=e.getUTCHours(),o=i/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,r){var i=e.getUTCHours(),o;switch(i===12?o=Lr.noon:i===0?o=Lr.midnight:o=i/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,r){var i=e.getUTCHours(),o;switch(i>=17?o=Lr.evening:i>=12?o=Lr.afternoon:i>=4?o=Lr.morning:o=Lr.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){var i=e.getUTCHours()%12;return i===0&&(i=12),r.ordinalNumber(i,{unit:"hour"})}return Bn.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):Bn.H(e,t)},K:function(e,t,r){var i=e.getUTCHours()%12;return t==="Ko"?r.ordinalNumber(i,{unit:"hour"}):Ee(i,t.length)},k:function(e,t,r){var i=e.getUTCHours();return i===0&&(i=24),t==="ko"?r.ordinalNumber(i,{unit:"hour"}):Ee(i,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):Bn.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):Bn.s(e,t)},S:function(e,t){return Bn.S(e,t)},X:function(e,t,r,i){var o=i._originalDate||e,a=o.getTimezoneOffset();if(a===0)return"Z";switch(t){case"X":return _c(a);case"XXXX":case"XX":return dr(a);case"XXXXX":case"XXX":default:return dr(a,":")}},x:function(e,t,r,i){var o=i._originalDate||e,a=o.getTimezoneOffset();switch(t){case"x":return _c(a);case"xxxx":case"xx":return dr(a);case"xxxxx":case"xxx":default:return dr(a,":")}},O:function(e,t,r,i){var o=i._originalDate||e,a=o.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Nc(a,":");case"OOOO":default:return"GMT"+dr(a,":")}},z:function(e,t,r,i){var o=i._originalDate||e,a=o.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Nc(a,":");case"zzzz":default:return"GMT"+dr(a,":")}},t:function(e,t,r,i){var o=i._originalDate||e,a=Math.floor(o.getTime()/1e3);return Ee(a,t.length)},T:function(e,t,r,i){var o=i._originalDate||e,a=o.getTime();return Ee(a,t.length)}};function Nc(n,e){var t=n>0?"-":"+",r=Math.abs(n),i=Math.floor(r/60),o=r%60;if(o===0)return t+String(i);var a=e||"";return t+String(i)+a+Ee(o,2)}function _c(n,e){if(n%60===0){var t=n>0?"-":"+";return t+Ee(Math.abs(n)/60,2)}return dr(n,e)}function dr(n,e){var t=e||"",r=n>0?"-":"+",i=Math.abs(n),o=Ee(Math.floor(i/60),2),a=Ee(i%60,2);return r+o+t+a}const ug=dg;var Bc=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Pc=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},fg=function(e,t){var r=e.match(/(P+)(p+)?/)||[],i=r[1],o=r[2];if(!o)return Bc(e,t);var a;switch(i){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",Bc(i,t)).replace("{{time}}",Pc(o,t))},pg={p:Pc,P:fg};const Va=pg;var hg=["D","DD"],mg=["YY","YYYY"];function Ic(n){return hg.indexOf(n)!==-1}function Rc(n){return mg.indexOf(n)!==-1}function xo(n,e,t){if(n==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var gg={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},yg=function(e,t,r){var i,o=gg[e];return typeof o=="string"?i=o:t===1?i=o.one:i=o.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+i:i+" ago":i};const vg=yg;function La(n){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.width?String(e.width):n.defaultWidth,r=n.formats[t]||n.formats[n.defaultWidth];return r}}var bg={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},wg={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},kg={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},xg={date:La({formats:bg,defaultWidth:"full"}),time:La({formats:wg,defaultWidth:"full"}),dateTime:La({formats:kg,defaultWidth:"full"})};const Cg=xg;var Mg={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Tg=function(e,t,r,i){return Mg[e]};const Sg=Tg;function Si(n){return function(e,t){var r=t!=null&&t.context?String(t.context):"standalone",i;if(r==="formatting"&&n.formattingValues){var o=n.defaultFormattingWidth||n.defaultWidth,a=t!=null&&t.width?String(t.width):o;i=n.formattingValues[a]||n.formattingValues[o]}else{var s=n.defaultWidth,c=t!=null&&t.width?String(t.width):n.defaultWidth;i=n.values[c]||n.values[s]}var d=n.argumentCallback?n.argumentCallback(e):e;return i[d]}}var Dg={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ag={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Eg={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Og={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Ng={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},_g={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Bg=function(e,t){var r=Number(e),i=r%100;if(i>20||i<10)switch(i%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},Pg={ordinalNumber:Bg,era:Si({values:Dg,defaultWidth:"wide"}),quarter:Si({values:Ag,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:Si({values:Eg,defaultWidth:"wide"}),day:Si({values:Og,defaultWidth:"wide"}),dayPeriod:Si({values:Ng,defaultWidth:"wide",formattingValues:_g,defaultFormattingWidth:"wide"})};const Ig=Pg;function Di(n){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.width,i=r&&n.matchPatterns[r]||n.matchPatterns[n.defaultMatchWidth],o=e.match(i);if(!o)return null;var a=o[0],s=r&&n.parsePatterns[r]||n.parsePatterns[n.defaultParseWidth],c=Array.isArray(s)?Vg(s,function(f){return f.test(a)}):Rg(s,function(f){return f.test(a)}),d;d=n.valueCallback?n.valueCallback(c):c,d=t.valueCallback?t.valueCallback(d):d;var u=e.slice(a.length);return{value:d,rest:u}}}function Rg(n,e){for(var t in n)if(n.hasOwnProperty(t)&&e(n[t]))return t}function Vg(n,e){for(var t=0;t<n.length;t++)if(e(n[t]))return t}function Lg(n){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.match(n.matchPattern);if(!r)return null;var i=r[0],o=e.match(n.parsePattern);if(!o)return null;var a=n.valueCallback?n.valueCallback(o[0]):o[0];a=t.valueCallback?t.valueCallback(a):a;var s=e.slice(i.length);return{value:a,rest:s}}}var $g=/^(\d+)(th|st|nd|rd)?/i,Fg=/\d+/i,zg={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Hg={any:[/^b/i,/^(a|c)/i]},Yg={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ug={any:[/1/i,/2/i,/3/i,/4/i]},jg={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Wg={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},qg={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Kg={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Gg={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Qg={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Jg={ordinalNumber:Lg({matchPattern:$g,parsePattern:Fg,valueCallback:function(e){return parseInt(e,10)}}),era:Di({matchPatterns:zg,defaultMatchWidth:"wide",parsePatterns:Hg,defaultParseWidth:"any"}),quarter:Di({matchPatterns:Yg,defaultMatchWidth:"wide",parsePatterns:Ug,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:Di({matchPatterns:jg,defaultMatchWidth:"wide",parsePatterns:Wg,defaultParseWidth:"any"}),day:Di({matchPatterns:qg,defaultMatchWidth:"wide",parsePatterns:Kg,defaultParseWidth:"any"}),dayPeriod:Di({matchPatterns:Gg,defaultMatchWidth:"any",parsePatterns:Qg,defaultParseWidth:"any"})},Xg={code:"en-US",formatDistance:vg,formatLong:Cg,formatRelative:Sg,localize:Ig,match:Jg,options:{weekStartsOn:0,firstWeekContainsDate:1}};const Vc=Xg;var Zg=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ey=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ty=/^'([^]*?)'?$/,ny=/''/g,ry=/[a-zA-Z]/;function Pn(n,e,t){var r,i,o,a,s,c,d,u,f,p,h,m,g,k,x,S,T,y;se(2,arguments);var B=String(e),w=on(),V=(r=(i=t==null?void 0:t.locale)!==null&&i!==void 0?i:w.locale)!==null&&r!==void 0?r:Vc,$=pe((o=(a=(s=(c=t==null?void 0:t.firstWeekContainsDate)!==null&&c!==void 0?c:t==null||(d=t.locale)===null||d===void 0||(u=d.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&s!==void 0?s:w.firstWeekContainsDate)!==null&&a!==void 0?a:(f=w.locale)===null||f===void 0||(p=f.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&o!==void 0?o:1);if(!($>=1&&$<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var M=pe((h=(m=(g=(k=t==null?void 0:t.weekStartsOn)!==null&&k!==void 0?k:t==null||(x=t.locale)===null||x===void 0||(S=x.options)===null||S===void 0?void 0:S.weekStartsOn)!==null&&g!==void 0?g:w.weekStartsOn)!==null&&m!==void 0?m:(T=w.locale)===null||T===void 0||(y=T.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&h!==void 0?h:0);if(!(M>=0&&M<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!V.localize)throw new RangeError("locale must contain localize property");if(!V.formatLong)throw new RangeError("locale must contain formatLong property");var _=ue(n);if(!Mi(_))throw new RangeError("Invalid time value");var z=ko(_),N=Dc(_,z),W={firstWeekContainsDate:$,weekStartsOn:M,locale:V,_originalDate:_},F=B.match(ey).map(function(O){var I=O[0];if(I==="p"||I==="P"){var H=Va[I];return H(O,V.formatLong)}return O}).join("").match(Zg).map(function(O){if(O==="''")return"'";var I=O[0];if(I==="'")return iy(O);var H=ug[I];if(H)return!(t!=null&&t.useAdditionalWeekYearTokens)&&Rc(O)&&xo(O,e,String(n)),!(t!=null&&t.useAdditionalDayOfYearTokens)&&Ic(O)&&xo(O,e,String(n)),H(N,O,V.localize,W);if(I.match(ry))throw new RangeError("Format string contains an unescaped latin alphabet character `"+I+"`");return O}).join("");return F}function iy(n){var e=n.match(ty);return e?e[1].replace(ny,"'"):n}function oy(n,e){if(n==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t]);return n}function ay(n){se(1,arguments);var e=ue(n),t=e.getDay();return t}function sy(n){se(1,arguments);var e=ue(n),t=e.getFullYear(),r=e.getMonth(),i=new Date(0);return i.setFullYear(t,r+1,0),i.setHours(0,0,0,0),i.getDate()}function Wt(n){se(1,arguments);var e=ue(n),t=e.getHours();return t}var ly=6048e5;function cy(n){se(1,arguments);var e=ue(n),t=wo(e).getTime()-Km(e).getTime();return Math.round(t/ly)+1}function an(n){se(1,arguments);var e=ue(n),t=e.getMinutes();return t}function Ce(n){se(1,arguments);var e=ue(n),t=e.getMonth();return t}function $r(n){se(1,arguments);var e=ue(n),t=e.getSeconds();return t}function dy(n,e){var t,r,i,o,a,s,c,d;se(1,arguments);var u=ue(n),f=u.getFullYear(),p=on(),h=pe((t=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&i!==void 0?i:p.firstWeekContainsDate)!==null&&r!==void 0?r:(c=p.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var m=new Date(0);m.setFullYear(f+1,0,h),m.setHours(0,0,0,0);var g=lr(m,e),k=new Date(0);k.setFullYear(f,0,h),k.setHours(0,0,0,0);var x=lr(k,e);return u.getTime()>=g.getTime()?f+1:u.getTime()>=x.getTime()?f:f-1}function uy(n,e){var t,r,i,o,a,s,c,d;se(1,arguments);var u=on(),f=pe((t=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&i!==void 0?i:u.firstWeekContainsDate)!==null&&r!==void 0?r:(c=u.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&t!==void 0?t:1),p=dy(n,e),h=new Date(0);h.setFullYear(p,0,f),h.setHours(0,0,0,0);var m=lr(h,e);return m}var fy=6048e5;function py(n,e){se(1,arguments);var t=ue(n),r=lr(t,e).getTime()-uy(t,e).getTime();return Math.round(r/fy)+1}function Me(n){return se(1,arguments),ue(n).getFullYear()}function Ai(n,e){se(2,arguments);var t=ue(n),r=ue(e);return t.getTime()>r.getTime()}function Ei(n,e){se(2,arguments);var t=ue(n),r=ue(e);return t.getTime()<r.getTime()}function Fr(n,e){se(2,arguments);var t=ue(n),r=ue(e);return t.getTime()===r.getTime()}function Lc(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function $c(n,e){if(n){if(typeof n=="string")return Lc(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Lc(n,e)}}function Fc(n,e){var t=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=$c(n))||e&&n&&typeof n.length=="number"){t&&(n=t);var r=0,i=function(){};return{s:i,n:function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}},e:function(d){throw d},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,s;return{s:function(){t=t.call(n)},n:function(){var d=t.next();return o=d.done,d},e:function(d){a=!0,s=d},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(a)throw s}}}}function oe(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function $a(n,e){return $a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},$a(n,e)}function Te(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&$a(n,e)}function Co(n){return Co=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Co(n)}function hy(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function my(n,e){if(e&&(Pt(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oe(n)}function Se(n){var e=hy();return function(){var r=Co(n),i;if(e){var o=Co(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return my(this,i)}}function we(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function gy(n,e){if(Pt(n)!=="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(Pt(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function zc(n){var e=gy(n,"string");return Pt(e)==="symbol"?e:String(e)}function Hc(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,zc(r.key),r)}}function ke(n,e,t){return e&&Hc(n.prototype,e),t&&Hc(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function re(n,e,t){return e=zc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var yy=10,Yc=function(){function n(){we(this,n),re(this,"priority",void 0),re(this,"subPriority",0)}return ke(n,[{key:"validate",value:function(t,r){return!0}}]),n}(),vy=function(n){Te(t,n);var e=Se(t);function t(r,i,o,a,s){var c;return we(this,t),c=e.call(this),c.value=r,c.validateValue=i,c.setValue=o,c.priority=a,s&&(c.subPriority=s),c}return ke(t,[{key:"validate",value:function(i,o){return this.validateValue(i,this.value,o)}},{key:"set",value:function(i,o,a){return this.setValue(i,o,this.value,a)}}]),t}(Yc),by=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",yy),re(oe(r),"subPriority",-1),r}return ke(t,[{key:"set",value:function(i,o){if(o.timestampIsSet)return i;var a=new Date(0);return a.setFullYear(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()),a.setHours(i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()),a}}]),t}(Yc),De=function(){function n(){we(this,n),re(this,"incompatibleTokens",void 0),re(this,"priority",void 0),re(this,"subPriority",void 0)}return ke(n,[{key:"run",value:function(t,r,i,o){var a=this.parse(t,r,i,o);return a?{setter:new vy(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}},{key:"validate",value:function(t,r,i){return!0}}]),n}(),wy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",140),re(oe(r),"incompatibleTokens",["R","u","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"G":case"GG":case"GGG":return a.era(i,{width:"abbreviated"})||a.era(i,{width:"narrow"});case"GGGGG":return a.era(i,{width:"narrow"});case"GGGG":default:return a.era(i,{width:"wide"})||a.era(i,{width:"abbreviated"})||a.era(i,{width:"narrow"})}}},{key:"set",value:function(i,o,a){return o.era=a,i.setUTCFullYear(a,0,1),i.setUTCHours(0,0,0,0),i}}]),t}(De),Fe={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},sn={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function ze(n,e){return n&&{value:e(n.value),rest:n.rest}}function Ve(n,e){var t=e.match(n);return t?{value:parseInt(t[0],10),rest:e.slice(t[0].length)}:null}function ln(n,e){var t=e.match(n);if(!t)return null;if(t[0]==="Z")return{value:0,rest:e.slice(1)};var r=t[1]==="+"?1:-1,i=t[2]?parseInt(t[2],10):0,o=t[3]?parseInt(t[3],10):0,a=t[5]?parseInt(t[5],10):0;return{value:r*(i*Ia+o*Pa+a*Xm),rest:e.slice(t[0].length)}}function Uc(n){return Ve(Fe.anyDigitsSigned,n)}function Le(n,e){switch(n){case 1:return Ve(Fe.singleDigit,e);case 2:return Ve(Fe.twoDigits,e);case 3:return Ve(Fe.threeDigits,e);case 4:return Ve(Fe.fourDigits,e);default:return Ve(new RegExp("^\\d{1,"+n+"}"),e)}}function Mo(n,e){switch(n){case 1:return Ve(Fe.singleDigitSigned,e);case 2:return Ve(Fe.twoDigitsSigned,e);case 3:return Ve(Fe.threeDigitsSigned,e);case 4:return Ve(Fe.fourDigitsSigned,e);default:return Ve(new RegExp("^-?\\d{1,"+n+"}"),e)}}function Fa(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function jc(n,e){var t=e>0,r=t?e:1-e,i;if(r<=50)i=n||100;else{var o=r+50,a=Math.floor(o/100)*100,s=n>=o%100;i=n+a-(s?100:0)}return t?i:1-i}function Wc(n){return n%400===0||n%4===0&&n%100!==0}var ky=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",130),re(oe(r),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){var s=function(d){return{year:d,isTwoDigitYear:o==="yy"}};switch(o){case"y":return ze(Le(4,i),s);case"yo":return ze(a.ordinalNumber(i,{unit:"year"}),s);default:return ze(Le(o.length,i),s)}}},{key:"validate",value:function(i,o){return o.isTwoDigitYear||o.year>0}},{key:"set",value:function(i,o,a){var s=i.getUTCFullYear();if(a.isTwoDigitYear){var c=jc(a.year,s);return i.setUTCFullYear(c,0,1),i.setUTCHours(0,0,0,0),i}var d=!("era"in o)||o.era===1?a.year:1-a.year;return i.setUTCFullYear(d,0,1),i.setUTCHours(0,0,0,0),i}}]),t}(De),xy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",130),re(oe(r),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){var s=function(d){return{year:d,isTwoDigitYear:o==="YY"}};switch(o){case"Y":return ze(Le(4,i),s);case"Yo":return ze(a.ordinalNumber(i,{unit:"year"}),s);default:return ze(Le(o.length,i),s)}}},{key:"validate",value:function(i,o){return o.isTwoDigitYear||o.year>0}},{key:"set",value:function(i,o,a,s){var c=Ra(i,s);if(a.isTwoDigitYear){var d=jc(a.year,c);return i.setUTCFullYear(d,0,s.firstWeekContainsDate),i.setUTCHours(0,0,0,0),cr(i,s)}var u=!("era"in o)||o.era===1?a.year:1-a.year;return i.setUTCFullYear(u,0,s.firstWeekContainsDate),i.setUTCHours(0,0,0,0),cr(i,s)}}]),t}(De),Cy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",130),re(oe(r),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o){return Mo(o==="R"?4:o.length,i)}},{key:"set",value:function(i,o,a){var s=new Date(0);return s.setUTCFullYear(a,0,4),s.setUTCHours(0,0,0,0),Vr(s)}}]),t}(De),My=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",130),re(oe(r),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o){return Mo(o==="u"?4:o.length,i)}},{key:"set",value:function(i,o,a){return i.setUTCFullYear(a,0,1),i.setUTCHours(0,0,0,0),i}}]),t}(De),Ty=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",120),re(oe(r),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"Q":case"QQ":return Le(o.length,i);case"Qo":return a.ordinalNumber(i,{unit:"quarter"});case"QQQ":return a.quarter(i,{width:"abbreviated",context:"formatting"})||a.quarter(i,{width:"narrow",context:"formatting"});case"QQQQQ":return a.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(i,{width:"wide",context:"formatting"})||a.quarter(i,{width:"abbreviated",context:"formatting"})||a.quarter(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,o){return o>=1&&o<=4}},{key:"set",value:function(i,o,a){return i.setUTCMonth((a-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),t}(De),Sy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",120),re(oe(r),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"q":case"qq":return Le(o.length,i);case"qo":return a.ordinalNumber(i,{unit:"quarter"});case"qqq":return a.quarter(i,{width:"abbreviated",context:"standalone"})||a.quarter(i,{width:"narrow",context:"standalone"});case"qqqqq":return a.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(i,{width:"wide",context:"standalone"})||a.quarter(i,{width:"abbreviated",context:"standalone"})||a.quarter(i,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(i,o){return o>=1&&o<=4}},{key:"set",value:function(i,o,a){return i.setUTCMonth((a-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),t}(De),Dy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),re(oe(r),"priority",110),r}return ke(t,[{key:"parse",value:function(i,o,a){var s=function(d){return d-1};switch(o){case"M":return ze(Ve(Fe.month,i),s);case"MM":return ze(Le(2,i),s);case"Mo":return ze(a.ordinalNumber(i,{unit:"month"}),s);case"MMM":return a.month(i,{width:"abbreviated",context:"formatting"})||a.month(i,{width:"narrow",context:"formatting"});case"MMMMM":return a.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(i,{width:"wide",context:"formatting"})||a.month(i,{width:"abbreviated",context:"formatting"})||a.month(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,o){return o>=0&&o<=11}},{key:"set",value:function(i,o,a){return i.setUTCMonth(a,1),i.setUTCHours(0,0,0,0),i}}]),t}(De),Ay=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",110),re(oe(r),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){var s=function(d){return d-1};switch(o){case"L":return ze(Ve(Fe.month,i),s);case"LL":return ze(Le(2,i),s);case"Lo":return ze(a.ordinalNumber(i,{unit:"month"}),s);case"LLL":return a.month(i,{width:"abbreviated",context:"standalone"})||a.month(i,{width:"narrow",context:"standalone"});case"LLLLL":return a.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(i,{width:"wide",context:"standalone"})||a.month(i,{width:"abbreviated",context:"standalone"})||a.month(i,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(i,o){return o>=0&&o<=11}},{key:"set",value:function(i,o,a){return i.setUTCMonth(a,1),i.setUTCHours(0,0,0,0),i}}]),t}(De);function Ey(n,e,t){se(2,arguments);var r=ue(n),i=pe(e),o=Oc(r,t)-i;return r.setUTCDate(r.getUTCDate()-o*7),r}var Oy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",100),re(oe(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"w":return Ve(Fe.week,i);case"wo":return a.ordinalNumber(i,{unit:"week"});default:return Le(o.length,i)}}},{key:"validate",value:function(i,o){return o>=1&&o<=53}},{key:"set",value:function(i,o,a,s){return cr(Ey(i,a,s),s)}}]),t}(De);function Ny(n,e){se(2,arguments);var t=ue(n),r=pe(e),i=Ec(t)-r;return t.setUTCDate(t.getUTCDate()-i*7),t}var _y=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",100),re(oe(r),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"I":return Ve(Fe.week,i);case"Io":return a.ordinalNumber(i,{unit:"week"});default:return Le(o.length,i)}}},{key:"validate",value:function(i,o){return o>=1&&o<=53}},{key:"set",value:function(i,o,a){return Vr(Ny(i,a))}}]),t}(De),By=[31,28,31,30,31,30,31,31,30,31,30,31],Py=[31,29,31,30,31,30,31,31,30,31,30,31],Iy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",90),re(oe(r),"subPriority",1),re(oe(r),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"d":return Ve(Fe.date,i);case"do":return a.ordinalNumber(i,{unit:"date"});default:return Le(o.length,i)}}},{key:"validate",value:function(i,o){var a=i.getUTCFullYear(),s=Wc(a),c=i.getUTCMonth();return s?o>=1&&o<=Py[c]:o>=1&&o<=By[c]}},{key:"set",value:function(i,o,a){return i.setUTCDate(a),i.setUTCHours(0,0,0,0),i}}]),t}(De),Ry=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",90),re(oe(r),"subpriority",1),re(oe(r),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"D":case"DD":return Ve(Fe.dayOfYear,i);case"Do":return a.ordinalNumber(i,{unit:"date"});default:return Le(o.length,i)}}},{key:"validate",value:function(i,o){var a=i.getUTCFullYear(),s=Wc(a);return s?o>=1&&o<=366:o>=1&&o<=365}},{key:"set",value:function(i,o,a){return i.setUTCMonth(0,a),i.setUTCHours(0,0,0,0),i}}]),t}(De);function za(n,e,t){var r,i,o,a,s,c,d,u;se(2,arguments);var f=on(),p=pe((r=(i=(o=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(c=s.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&o!==void 0?o:f.weekStartsOn)!==null&&i!==void 0?i:(d=f.locale)===null||d===void 0||(u=d.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&r!==void 0?r:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=ue(n),m=pe(e),g=h.getUTCDay(),k=m%7,x=(k+7)%7,S=(x<p?7:0)+m-g;return h.setUTCDate(h.getUTCDate()+S),h}var Vy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",90),re(oe(r),"incompatibleTokens",["D","i","e","c","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"E":case"EE":case"EEE":return a.day(i,{width:"abbreviated",context:"formatting"})||a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"});case"EEEEE":return a.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"});case"EEEE":default:return a.day(i,{width:"wide",context:"formatting"})||a.day(i,{width:"abbreviated",context:"formatting"})||a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,o){return o>=0&&o<=6}},{key:"set",value:function(i,o,a,s){return i=za(i,a,s),i.setUTCHours(0,0,0,0),i}}]),t}(De),Ly=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",90),re(oe(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a,s){var c=function(u){var f=Math.floor((u-1)/7)*7;return(u+s.weekStartsOn+6)%7+f};switch(o){case"e":case"ee":return ze(Le(o.length,i),c);case"eo":return ze(a.ordinalNumber(i,{unit:"day"}),c);case"eee":return a.day(i,{width:"abbreviated",context:"formatting"})||a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"});case"eeeee":return a.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"});case"eeee":default:return a.day(i,{width:"wide",context:"formatting"})||a.day(i,{width:"abbreviated",context:"formatting"})||a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,o){return o>=0&&o<=6}},{key:"set",value:function(i,o,a,s){return i=za(i,a,s),i.setUTCHours(0,0,0,0),i}}]),t}(De),$y=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",90),re(oe(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a,s){var c=function(u){var f=Math.floor((u-1)/7)*7;return(u+s.weekStartsOn+6)%7+f};switch(o){case"c":case"cc":return ze(Le(o.length,i),c);case"co":return ze(a.ordinalNumber(i,{unit:"day"}),c);case"ccc":return a.day(i,{width:"abbreviated",context:"standalone"})||a.day(i,{width:"short",context:"standalone"})||a.day(i,{width:"narrow",context:"standalone"});case"ccccc":return a.day(i,{width:"narrow",context:"standalone"});case"cccccc":return a.day(i,{width:"short",context:"standalone"})||a.day(i,{width:"narrow",context:"standalone"});case"cccc":default:return a.day(i,{width:"wide",context:"standalone"})||a.day(i,{width:"abbreviated",context:"standalone"})||a.day(i,{width:"short",context:"standalone"})||a.day(i,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(i,o){return o>=0&&o<=6}},{key:"set",value:function(i,o,a,s){return i=za(i,a,s),i.setUTCHours(0,0,0,0),i}}]),t}(De);function Fy(n,e){se(2,arguments);var t=pe(e);t%7===0&&(t=t-7);var r=1,i=ue(n),o=i.getUTCDay(),a=t%7,s=(a+7)%7,c=(s<r?7:0)+t-o;return i.setUTCDate(i.getUTCDate()+c),i}var zy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",90),re(oe(r),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){var s=function(d){return d===0?7:d};switch(o){case"i":case"ii":return Le(o.length,i);case"io":return a.ordinalNumber(i,{unit:"day"});case"iii":return ze(a.day(i,{width:"abbreviated",context:"formatting"})||a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"}),s);case"iiiii":return ze(a.day(i,{width:"narrow",context:"formatting"}),s);case"iiiiii":return ze(a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"}),s);case"iiii":default:return ze(a.day(i,{width:"wide",context:"formatting"})||a.day(i,{width:"abbreviated",context:"formatting"})||a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"}),s)}}},{key:"validate",value:function(i,o){return o>=1&&o<=7}},{key:"set",value:function(i,o,a){return i=Fy(i,a),i.setUTCHours(0,0,0,0),i}}]),t}(De),Hy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",80),re(oe(r),"incompatibleTokens",["b","B","H","k","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"a":case"aa":case"aaa":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"})||a.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaaa":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})||a.dayPeriod(i,{width:"abbreviated",context:"formatting"})||a.dayPeriod(i,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(i,o,a){return i.setUTCHours(Fa(a),0,0,0),i}}]),t}(De),Yy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",80),re(oe(r),"incompatibleTokens",["a","B","H","k","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"b":case"bb":case"bbb":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"})||a.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbbb":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})||a.dayPeriod(i,{width:"abbreviated",context:"formatting"})||a.dayPeriod(i,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(i,o,a){return i.setUTCHours(Fa(a),0,0,0),i}}]),t}(De),Uy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",80),re(oe(r),"incompatibleTokens",["a","b","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"B":case"BB":case"BBB":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"})||a.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBBB":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})||a.dayPeriod(i,{width:"abbreviated",context:"formatting"})||a.dayPeriod(i,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(i,o,a){return i.setUTCHours(Fa(a),0,0,0),i}}]),t}(De),jy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",70),re(oe(r),"incompatibleTokens",["H","K","k","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"h":return Ve(Fe.hour12h,i);case"ho":return a.ordinalNumber(i,{unit:"hour"});default:return Le(o.length,i)}}},{key:"validate",value:function(i,o){return o>=1&&o<=12}},{key:"set",value:function(i,o,a){var s=i.getUTCHours()>=12;return s&&a<12?i.setUTCHours(a+12,0,0,0):!s&&a===12?i.setUTCHours(0,0,0,0):i.setUTCHours(a,0,0,0),i}}]),t}(De),Wy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",70),re(oe(r),"incompatibleTokens",["a","b","h","K","k","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"H":return Ve(Fe.hour23h,i);case"Ho":return a.ordinalNumber(i,{unit:"hour"});default:return Le(o.length,i)}}},{key:"validate",value:function(i,o){return o>=0&&o<=23}},{key:"set",value:function(i,o,a){return i.setUTCHours(a,0,0,0),i}}]),t}(De),qy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",70),re(oe(r),"incompatibleTokens",["h","H","k","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"K":return Ve(Fe.hour11h,i);case"Ko":return a.ordinalNumber(i,{unit:"hour"});default:return Le(o.length,i)}}},{key:"validate",value:function(i,o){return o>=0&&o<=11}},{key:"set",value:function(i,o,a){var s=i.getUTCHours()>=12;return s&&a<12?i.setUTCHours(a+12,0,0,0):i.setUTCHours(a,0,0,0),i}}]),t}(De),Ky=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",70),re(oe(r),"incompatibleTokens",["a","b","h","H","K","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"k":return Ve(Fe.hour24h,i);case"ko":return a.ordinalNumber(i,{unit:"hour"});default:return Le(o.length,i)}}},{key:"validate",value:function(i,o){return o>=1&&o<=24}},{key:"set",value:function(i,o,a){var s=a<=24?a%24:a;return i.setUTCHours(s,0,0,0),i}}]),t}(De),Gy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",60),re(oe(r),"incompatibleTokens",["t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"m":return Ve(Fe.minute,i);case"mo":return a.ordinalNumber(i,{unit:"minute"});default:return Le(o.length,i)}}},{key:"validate",value:function(i,o){return o>=0&&o<=59}},{key:"set",value:function(i,o,a){return i.setUTCMinutes(a,0,0),i}}]),t}(De),Qy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",50),re(oe(r),"incompatibleTokens",["t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"s":return Ve(Fe.second,i);case"so":return a.ordinalNumber(i,{unit:"second"});default:return Le(o.length,i)}}},{key:"validate",value:function(i,o){return o>=0&&o<=59}},{key:"set",value:function(i,o,a){return i.setUTCSeconds(a,0),i}}]),t}(De),Jy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",30),re(oe(r),"incompatibleTokens",["t","T"]),r}return ke(t,[{key:"parse",value:function(i,o){var a=function(c){return Math.floor(c*Math.pow(10,-o.length+3))};return ze(Le(o.length,i),a)}},{key:"set",value:function(i,o,a){return i.setUTCMilliseconds(a),i}}]),t}(De),Xy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",10),re(oe(r),"incompatibleTokens",["t","T","x"]),r}return ke(t,[{key:"parse",value:function(i,o){switch(o){case"X":return ln(sn.basicOptionalMinutes,i);case"XX":return ln(sn.basic,i);case"XXXX":return ln(sn.basicOptionalSeconds,i);case"XXXXX":return ln(sn.extendedOptionalSeconds,i);case"XXX":default:return ln(sn.extended,i)}}},{key:"set",value:function(i,o,a){return o.timestampIsSet?i:new Date(i.getTime()-a)}}]),t}(De),Zy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",10),re(oe(r),"incompatibleTokens",["t","T","X"]),r}return ke(t,[{key:"parse",value:function(i,o){switch(o){case"x":return ln(sn.basicOptionalMinutes,i);case"xx":return ln(sn.basic,i);case"xxxx":return ln(sn.basicOptionalSeconds,i);case"xxxxx":return ln(sn.extendedOptionalSeconds,i);case"xxx":default:return ln(sn.extended,i)}}},{key:"set",value:function(i,o,a){return o.timestampIsSet?i:new Date(i.getTime()-a)}}]),t}(De),e0=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",40),re(oe(r),"incompatibleTokens","*"),r}return ke(t,[{key:"parse",value:function(i){return Uc(i)}},{key:"set",value:function(i,o,a){return[new Date(a*1e3),{timestampIsSet:!0}]}}]),t}(De),t0=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",20),re(oe(r),"incompatibleTokens","*"),r}return ke(t,[{key:"parse",value:function(i){return Uc(i)}},{key:"set",value:function(i,o,a){return[new Date(a),{timestampIsSet:!0}]}}]),t}(De),n0={G:new wy,y:new ky,Y:new xy,R:new Cy,u:new My,Q:new Ty,q:new Sy,M:new Dy,L:new Ay,w:new Oy,I:new _y,d:new Iy,D:new Ry,E:new Vy,e:new Ly,c:new $y,i:new zy,a:new Hy,b:new Yy,B:new Uy,h:new jy,H:new Wy,K:new qy,k:new Ky,m:new Gy,s:new Qy,S:new Jy,X:new Xy,x:new Zy,t:new e0,T:new t0},r0=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,i0=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,o0=/^'([^]*?)'?$/,a0=/''/g,s0=/\S/,l0=/[a-zA-Z]/;function Ha(n,e,t,r){var i,o,a,s,c,d,u,f,p,h,m,g,k,x,S,T,y,B;se(3,arguments);var w=String(n),V=String(e),$=on(),M=(i=(o=r==null?void 0:r.locale)!==null&&o!==void 0?o:$.locale)!==null&&i!==void 0?i:Vc;if(!M.match)throw new RangeError("locale must contain match property");var _=pe((a=(s=(c=(d=r==null?void 0:r.firstWeekContainsDate)!==null&&d!==void 0?d:r==null||(u=r.locale)===null||u===void 0||(f=u.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&c!==void 0?c:$.firstWeekContainsDate)!==null&&s!==void 0?s:(p=$.locale)===null||p===void 0||(h=p.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(_>=1&&_<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var z=pe((m=(g=(k=(x=r==null?void 0:r.weekStartsOn)!==null&&x!==void 0?x:r==null||(S=r.locale)===null||S===void 0||(T=S.options)===null||T===void 0?void 0:T.weekStartsOn)!==null&&k!==void 0?k:$.weekStartsOn)!==null&&g!==void 0?g:(y=$.locale)===null||y===void 0||(B=y.options)===null||B===void 0?void 0:B.weekStartsOn)!==null&&m!==void 0?m:0);if(!(z>=0&&z<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(V==="")return w===""?ue(t):new Date(NaN);var N={firstWeekContainsDate:_,weekStartsOn:z,locale:M},W=[new by],F=V.match(i0).map(function(Y){var Z=Y[0];if(Z in Va){var ce=Va[Z];return ce(Y,M.formatLong)}return Y}).join("").match(r0),O=[],I=Fc(F),H;try{var b=function(){var Z=H.value;!(r!=null&&r.useAdditionalWeekYearTokens)&&Rc(Z)&&xo(Z,V,n),!(r!=null&&r.useAdditionalDayOfYearTokens)&&Ic(Z)&&xo(Z,V,n);var ce=Z[0],j=n0[ce];if(j){var J=j.incompatibleTokens;if(Array.isArray(J)){var de=O.find(function(Ge){return J.includes(Ge.token)||Ge.token===ce});if(de)throw new RangeError("The format string mustn't contain `".concat(de.fullToken,"` and `").concat(Z,"` at the same time"))}else if(j.incompatibleTokens==="*"&&O.length>0)throw new RangeError("The format string mustn't contain `".concat(Z,"` and any other token at the same time"));O.push({token:ce,fullToken:Z});var te=j.run(w,Z,M.match,N);if(!te)return{v:new Date(NaN)};W.push(te.setter),w=te.rest}else{if(ce.match(l0))throw new RangeError("Format string contains an unescaped latin alphabet character `"+ce+"`");if(Z==="''"?Z="'":ce==="'"&&(Z=c0(Z)),w.indexOf(Z)===0)w=w.slice(Z.length);else return{v:new Date(NaN)}}};for(I.s();!(H=I.n()).done;){var C=b();if(Pt(C)==="object")return C.v}}catch(Y){I.e(Y)}finally{I.f()}if(w.length>0&&s0.test(w))return new Date(NaN);var v=W.map(function(Y){return Y.priority}).sort(function(Y,Z){return Z-Y}).filter(function(Y,Z,ce){return ce.indexOf(Y)===Z}).map(function(Y){return W.filter(function(Z){return Z.priority===Y}).sort(function(Z,ce){return ce.subPriority-Z.subPriority})}).map(function(Y){return Y[0]}),A=ue(t);if(isNaN(A.getTime()))return new Date(NaN);var E=Dc(A,ko(A)),P={},q=Fc(v),D;try{for(q.s();!(D=q.n()).done;){var X=D.value;if(!X.validate(E,N))return new Date(NaN);var ne=X.set(E,P,N);Array.isArray(ne)?(E=ne[0],oy(P,ne[1])):E=ne}}catch(Y){q.e(Y)}finally{q.f()}return E}function c0(n){return n.match(o0)[1].replace(a0,"'")}function qc(n,e){se(2,arguments);var t=Ti(n),r=Ti(e);return t.getTime()===r.getTime()}function d0(n,e){se(2,arguments);var t=pe(e);return Cn(n,-t)}function u0(n,e){var t;se(1,arguments);var r=pe((t=e==null?void 0:e.additionalDigits)!==null&&t!==void 0?t:2);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var i=m0(n),o;if(i.date){var a=g0(i.date,r);o=y0(a.restDateString,a.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);var s=o.getTime(),c=0,d;if(i.time&&(c=v0(i.time),isNaN(c)))return new Date(NaN);if(i.timezone){if(d=b0(i.timezone),isNaN(d))return new Date(NaN)}else{var u=new Date(s+c),f=new Date(0);return f.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),f.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),f}return new Date(s+c+d)}var To={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},f0=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,p0=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,h0=/^([+-])(\d{2})(?::?(\d{2}))?$/;function m0(n){var e={},t=n.split(To.dateTimeDelimiter),r;if(t.length>2)return e;if(/:/.test(t[0])?r=t[0]:(e.date=t[0],r=t[1],To.timeZoneDelimiter.test(e.date)&&(e.date=n.split(To.timeZoneDelimiter)[0],r=n.substr(e.date.length,n.length))),r){var i=To.timezone.exec(r);i?(e.time=r.replace(i[1],""),e.timezone=i[1]):e.time=r}return e}function g0(n,e){var t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=n.match(t);if(!r)return{year:NaN,restDateString:""};var i=r[1]?parseInt(r[1]):null,o=r[2]?parseInt(r[2]):null;return{year:o===null?i:o*100,restDateString:n.slice((r[1]||r[2]).length)}}function y0(n,e){if(e===null)return new Date(NaN);var t=n.match(f0);if(!t)return new Date(NaN);var r=!!t[4],i=Oi(t[1]),o=Oi(t[2])-1,a=Oi(t[3]),s=Oi(t[4]),c=Oi(t[5])-1;if(r)return M0(e,s,c)?w0(e,s,c):new Date(NaN);var d=new Date(0);return!x0(e,o,a)||!C0(e,i)?new Date(NaN):(d.setUTCFullYear(e,o,Math.max(i,a)),d)}function Oi(n){return n?parseInt(n):1}function v0(n){var e=n.match(p0);if(!e)return NaN;var t=Ya(e[1]),r=Ya(e[2]),i=Ya(e[3]);return T0(t,r,i)?t*Ia+r*Pa+i*1e3:NaN}function Ya(n){return n&&parseFloat(n.replace(",","."))||0}function b0(n){if(n==="Z")return 0;var e=n.match(h0);if(!e)return 0;var t=e[1]==="+"?-1:1,r=parseInt(e[2]),i=e[3]&&parseInt(e[3])||0;return S0(r,i)?t*(r*Ia+i*Pa):NaN}function w0(n,e,t){var r=new Date(0);r.setUTCFullYear(n,0,4);var i=r.getUTCDay()||7,o=(e-1)*7+t+1-i;return r.setUTCDate(r.getUTCDate()+o),r}var k0=[31,null,31,30,31,30,31,31,30,31,30,31];function Kc(n){return n%400===0||n%4===0&&n%100!==0}function x0(n,e,t){return e>=0&&e<=11&&t>=1&&t<=(k0[e]||(Kc(n)?29:28))}function C0(n,e){return e>=1&&e<=(Kc(n)?366:365)}function M0(n,e,t){return e>=1&&e<=53&&t>=0&&t<=6}function T0(n,e,t){return n===24?e===0&&t===0:t>=0&&t<60&&e>=0&&e<60&&n>=0&&n<25}function S0(n,e){return e>=0&&e<=59}function Gc(n,e){se(2,arguments);var t=ue(n),r=pe(e),i=t.getFullYear(),o=t.getDate(),a=new Date(0);a.setFullYear(i,r,15),a.setHours(0,0,0,0);var s=sy(a);return t.setMonth(r,Math.min(o,s)),t}function Be(n,e){if(se(2,arguments),Pt(e)!=="object"||e===null)throw new RangeError("values parameter must be an object");var t=ue(n);return isNaN(t.getTime())?new Date(NaN):(e.year!=null&&t.setFullYear(e.year),e.month!=null&&(t=Gc(t,e.month)),e.date!=null&&t.setDate(pe(e.date)),e.hours!=null&&t.setHours(pe(e.hours)),e.minutes!=null&&t.setMinutes(pe(e.minutes)),e.seconds!=null&&t.setSeconds(pe(e.seconds)),e.milliseconds!=null&&t.setMilliseconds(pe(e.milliseconds)),t)}function Qc(n,e){se(2,arguments);var t=ue(n),r=pe(e);return t.setHours(r),t}function Ua(n,e){se(2,arguments);var t=ue(n),r=pe(e);return t.setMilliseconds(r),t}function Jc(n,e){se(2,arguments);var t=ue(n),r=pe(e);return t.setMinutes(r),t}function ja(n,e){se(2,arguments);var t=ue(n),r=pe(e);return t.setSeconds(r),t}function ur(n,e){se(2,arguments);var t=ue(n),r=pe(e);return isNaN(t.getTime())?new Date(NaN):(t.setFullYear(r),t)}function zr(n,e){se(2,arguments);var t=pe(e);return jt(n,-t)}function D0(n,e){if(se(2,arguments),!e||Pt(e)!=="object")return new Date(NaN);var t=e.years?pe(e.years):0,r=e.months?pe(e.months):0,i=e.weeks?pe(e.weeks):0,o=e.days?pe(e.days):0,a=e.hours?pe(e.hours):0,s=e.minutes?pe(e.minutes):0,c=e.seconds?pe(e.seconds):0,d=zr(n,r+t*12),u=d0(d,o+i*7),f=s+a*60,p=c+f*60,h=p*1e3,m=new Date(u.getTime()-h);return m}function Xc(n,e){se(2,arguments);var t=pe(e);return Ba(n,-t)}function Ni(){return l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon"},[l.createElementVNode("path",{d:"M29.333 8c0-2.208-1.792-4-4-4h-18.667c-2.208 0-4 1.792-4 4v18.667c0 2.208 1.792 4 4 4h18.667c2.208 0 4-1.792 4-4v-18.667zM26.667 8v18.667c0 0.736-0.597 1.333-1.333 1.333 0 0-18.667 0-18.667 0-0.736 0-1.333-0.597-1.333-1.333 0 0 0-18.667 0-18.667 0-0.736 0.597-1.333 1.333-1.333 0 0 18.667 0 18.667 0 0.736 0 1.333 0.597 1.333 1.333z"}),l.createElementVNode("path",{d:"M20 2.667v5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"}),l.createElementVNode("path",{d:"M9.333 2.667v5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"}),l.createElementVNode("path",{d:"M4 14.667h24c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-24c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333z"})])}Ni.compatConfig={MODE:3};function Zc(){return l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon"},[l.createElementVNode("path",{d:"M23.057 7.057l-16 16c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l16-16c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0z"}),l.createElementVNode("path",{d:"M7.057 8.943l16 16c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885l-16-16c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"})])}Zc.compatConfig={MODE:3};function Wa(){return l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon"},[l.createElementVNode("path",{d:"M20.943 23.057l-7.057-7.057c0 0 7.057-7.057 7.057-7.057 0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0l-8 8c-0.521 0.521-0.521 1.365 0 1.885l8 8c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885z"})])}Wa.compatConfig={MODE:3};function qa(){return l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon"},[l.createElementVNode("path",{d:"M12.943 24.943l8-8c0.521-0.521 0.521-1.365 0-1.885l-8-8c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885l7.057 7.057c0 0-7.057 7.057-7.057 7.057-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0z"})])}qa.compatConfig={MODE:3};function Ka(){return l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon"},[l.createElementVNode("path",{d:"M16 1.333c-8.095 0-14.667 6.572-14.667 14.667s6.572 14.667 14.667 14.667c8.095 0 14.667-6.572 14.667-14.667s-6.572-14.667-14.667-14.667zM16 4c6.623 0 12 5.377 12 12s-5.377 12-12 12c-6.623 0-12-5.377-12-12s5.377-12 12-12z"}),l.createElementVNode("path",{d:"M14.667 8v8c0 0.505 0.285 0.967 0.737 1.193l5.333 2.667c0.658 0.329 1.46 0.062 1.789-0.596s0.062-1.46-0.596-1.789l-4.596-2.298c0 0 0-7.176 0-7.176 0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"})])}Ka.compatConfig={MODE:3};function Ga(){return l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon"},[l.createElementVNode("path",{d:"M24.943 19.057l-8-8c-0.521-0.521-1.365-0.521-1.885 0l-8 8c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l7.057-7.057c0 0 7.057 7.057 7.057 7.057 0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885z"})])}Ga.compatConfig={MODE:3};function Qa(){return l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon"},[l.createElementVNode("path",{d:"M7.057 12.943l8 8c0.521 0.521 1.365 0.521 1.885 0l8-8c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0l-7.057 7.057c0 0-7.057-7.057-7.057-7.057-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"})])}Qa.compatConfig={MODE:3};function Ja(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ed={exports:{}};(function(n){function e(t){return t&&t.__esModule?t:{default:t}}n.exports=e,n.exports.__esModule=!0,n.exports.default=n.exports})(ed);var A0=ed.exports,Xa={exports:{}};(function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=t;function t(r){if(r===null||r===!0||r===!1)return NaN;var i=Number(r);return isNaN(i)?i:i<0?Math.ceil(i):Math.floor(i)}n.exports=e.default})(Xa,Xa.exports);var E0=Xa.exports;const O0=Ja(E0);var Za={exports:{}};(function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=t;function t(r){var i=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return i.setUTCFullYear(r.getFullYear()),r.getTime()-i.getTime()}n.exports=e.default})(Za,Za.exports);var N0=Za.exports;const td=Ja(N0);function _0(n,e){var t=R0(e);return t.formatToParts?P0(t,n):I0(t,n)}var B0={year:0,month:1,day:2,hour:3,minute:4,second:5};function P0(n,e){try{for(var t=n.formatToParts(e),r=[],i=0;i<t.length;i++){var o=B0[t[i].type];o>=0&&(r[o]=parseInt(t[i].value,10))}return r}catch(a){if(a instanceof RangeError)return[NaN];throw a}}function I0(n,e){var t=n.format(e).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(t);return[r[3],r[1],r[2],r[4],r[5],r[6]]}var es={};function R0(n){if(!es[n]){var e=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:"America/New_York",year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),t=e==="06/25/2014, 00:00:00"||e==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";es[n]=t?new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return es[n]}function ts(n,e,t,r,i,o,a){var s=new Date(0);return s.setUTCFullYear(n,e,t),s.setUTCHours(r,i,o,a),s}var nd=36e5,V0=6e4,ns={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-]\d{2}):?(\d{2})$/};function rs(n,e,t){var r,i;if(!n||(r=ns.timezoneZ.exec(n),r))return 0;var o;if(r=ns.timezoneHH.exec(n),r)return o=parseInt(r[1],10),rd(o)?-(o*nd):NaN;if(r=ns.timezoneHHMM.exec(n),r){o=parseInt(r[1],10);var a=parseInt(r[2],10);return rd(o,a)?(i=Math.abs(o)*nd+a*V0,o>0?-i:i):NaN}if(F0(n)){e=new Date(e||Date.now());var s=t?e:L0(e),c=is(s,n),d=t?c:$0(e,c,n);return-d}return NaN}function L0(n){return ts(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function is(n,e){var t=_0(n,e),r=ts(t[0],t[1]-1,t[2],t[3]%24,t[4],t[5],0).getTime(),i=n.getTime(),o=i%1e3;return i-=o>=0?o:1e3+o,r-i}function $0(n,e,t){var r=n.getTime(),i=r-e,o=is(new Date(i),t);if(e===o)return e;i-=o-e;var a=is(new Date(i),t);return o===a?o:Math.max(o,a)}function rd(n,e){return-23<=n&&n<=23&&(e==null||0<=e&&e<=59)}var id={};function F0(n){if(id[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),id[n]=!0,!0}catch{return!1}}var od=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,as=36e5,ad=6e4,z0=2,mt={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:od};function ss(n,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);var t=e||{},r=t.additionalDigits==null?z0:O0(t.additionalDigits);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var i=H0(n),o=Y0(i.date,r),a=o.year,s=o.restDateString,c=U0(s,a);if(isNaN(c))return new Date(NaN);if(c){var d=c.getTime(),u=0,f;if(i.time&&(u=j0(i.time),isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(f=rs(i.timeZone||t.timeZone,new Date(d+u)),isNaN(f))return new Date(NaN)}else f=td(new Date(d+u)),f=td(new Date(d+u+f));return new Date(d+u+f)}else return new Date(NaN)}function H0(n){var e={},t=mt.dateTimePattern.exec(n),r;if(t?(e.date=t[1],r=t[3]):(t=mt.datePattern.exec(n),t?(e.date=t[1],r=t[2]):(e.date=null,r=n)),r){var i=mt.timeZone.exec(r);i?(e.time=r.replace(i[1],""),e.timeZone=i[1].trim()):e.time=r}return e}function Y0(n,e){var t=mt.YYY[e],r=mt.YYYYY[e],i;if(i=mt.YYYY.exec(n)||r.exec(n),i){var o=i[1];return{year:parseInt(o,10),restDateString:n.slice(o.length)}}if(i=mt.YY.exec(n)||t.exec(n),i){var a=i[1];return{year:parseInt(a,10)*100,restDateString:n.slice(a.length)}}return{year:null}}function U0(n,e){if(e===null)return null;var t,r,i,o;if(n.length===0)return r=new Date(0),r.setUTCFullYear(e),r;if(t=mt.MM.exec(n),t)return r=new Date(0),i=parseInt(t[1],10)-1,cd(e,i)?(r.setUTCFullYear(e,i),r):new Date(NaN);if(t=mt.DDD.exec(n),t){r=new Date(0);var a=parseInt(t[1],10);return K0(e,a)?(r.setUTCFullYear(e,0,a),r):new Date(NaN)}if(t=mt.MMDD.exec(n),t){r=new Date(0),i=parseInt(t[1],10)-1;var s=parseInt(t[2],10);return cd(e,i,s)?(r.setUTCFullYear(e,i,s),r):new Date(NaN)}if(t=mt.Www.exec(n),t)return o=parseInt(t[1],10)-1,dd(e,o)?sd(e,o):new Date(NaN);if(t=mt.WwwD.exec(n),t){o=parseInt(t[1],10)-1;var c=parseInt(t[2],10)-1;return dd(e,o,c)?sd(e,o,c):new Date(NaN)}return null}function j0(n){var e,t,r;if(e=mt.HH.exec(n),e)return t=parseFloat(e[1].replace(",",".")),ls(t)?t%24*as:NaN;if(e=mt.HHMM.exec(n),e)return t=parseInt(e[1],10),r=parseFloat(e[2].replace(",",".")),ls(t,r)?t%24*as+r*ad:NaN;if(e=mt.HHMMSS.exec(n),e){t=parseInt(e[1],10),r=parseInt(e[2],10);var i=parseFloat(e[3].replace(",","."));return ls(t,r,i)?t%24*as+r*ad+i*1e3:NaN}return null}function sd(n,e,t){e=e||0,t=t||0;var r=new Date(0);r.setUTCFullYear(n,0,4);var i=r.getUTCDay()||7,o=e*7+t+1-i;return r.setUTCDate(r.getUTCDate()+o),r}var W0=[31,28,31,30,31,30,31,31,30,31,30,31],q0=[31,29,31,30,31,30,31,31,30,31,30,31];function ld(n){return n%400===0||n%4===0&&n%100!==0}function cd(n,e,t){if(e<0||e>11)return!1;if(t!=null){if(t<1)return!1;var r=ld(n);if(r&&t>q0[e]||!r&&t>W0[e])return!1}return!0}function K0(n,e){if(e<1)return!1;var t=ld(n);return!(t&&e>366||!t&&e>365)}function dd(n,e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function ls(n,e,t){return!(n!=null&&(n<0||n>=25)||e!=null&&(e<0||e>=60)||t!=null&&(t<0||t>=60))}var cs={exports:{}},ds={exports:{}};(function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=t;function t(r,i){if(r==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o]);return r}n.exports=e.default})(ds,ds.exports);var G0=ds.exports;(function(n,e){var t=A0.default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=i;var r=t(G0);function i(o){return(0,r.default)({},o)}n.exports=e.default})(cs,cs.exports);var Q0=cs.exports;const J0=Ja(Q0);function X0(n,e,t){var r=ss(n,t),i=rs(e,r,!0),o=new Date(r.getTime()-i),a=new Date(0);return a.setFullYear(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()),a.setHours(o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.getUTCMilliseconds()),a}function Z0(n,e,t){if(typeof n=="string"&&!n.match(od)){var r=J0(t);return r.timeZone=e,ss(n,r)}var i=ss(n,t),o=ts(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()).getTime(),a=rs(e,new Date(o));return new Date(o+a)}function ud(n){return e=>new Intl.DateTimeFormat(n,{weekday:"short",timeZone:"UTC"}).format(new Date(`2017-01-0${e}T00:00:00+00:00`)).slice(0,2)}function ev(n){return e=>Pn(new Date(`2017-01-0${e}T00:00:00+00:00`),"EEEEEE",{locale:n})}const tv=(n,e,t)=>{const r=[1,2,3,4,5,6,7];let i;if(n!==null)try{i=r.map(ev(n))}catch{i=r.map(ud(e))}else i=r.map(ud(e));const o=i.slice(0,t),a=i.slice(t+1,i.length);return[i[t]].concat(...a).concat(...o)},us=(n,e)=>{const t=[];for(let r=+n[0];r<=+n[1];r++)t.push({value:+r,text:`${r}`});return e?t.reverse():t},fd=(n,e,t)=>{const r=[1,2,3,4,5,6,7,8,9,10,11,12].map(o=>{const a=o<10?`0${o}`:o;return new Date(`2017-${a}-01T00:00:00+00:00`)});if(n!==null)try{const o=t==="long"?"MMMM":"MMM";return r.map((a,s)=>{const c=Pn(a,o,{locale:n});return{text:c.charAt(0).toUpperCase()+c.substring(1),value:s}})}catch{}const i=new Intl.DateTimeFormat(e,{month:t,timeZone:"UTC"});return r.map((o,a)=>{const s=i.format(o);return{text:s.charAt(0).toUpperCase()+s.substring(1),value:a}})},nv=n=>[12,1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11][n],qe=n=>{const e=l.unref(n);return e!=null&&e.$el?e==null?void 0:e.$el:e},rv=n=>Object.assign({type:"dot"},n),pd=n=>Array.isArray(n)?!!n[0]&&!!n[1]:!1,So={prop:n=>`"${n}" prop must be enabled!`,dateArr:n=>`You need to use array as "model-value" binding in order to support "${n}"`},Je=n=>n,hd=n=>n===0?n:!n||isNaN(+n)?null:+n,md=n=>n===null,iv=n=>{if(n)return[...n.querySelectorAll("input, button, select, textarea, a[href]")][0]},ov=n=>{const e=[],t=r=>r.filter(i=>i);for(let r=0;r<n.length;r+=3){const i=[n[r],n[r+1],n[r+2]];e.push(t(i))}return e},_i=(n,e,t)=>{const r=t??t===0,i=e??e===0;if(!r&&!i)return!1;const o=+t,a=+e;return r&&i?+n>o||+n<a:r?+n>o:i?+n<a:!1},Hr=(n,e)=>ov(n).map(t=>t.map(r=>{const{active:i,disabled:o,isBetween:a}=e(r);return{...r,active:i,disabled:o,className:{dp__overlay_cell_active:i,dp__overlay_cell:!i,dp__overlay_cell_disabled:o,dp__overlay_cell_pad:!0,dp__overlay_cell_active_disabled:o&&i,dp__cell_in_between:a}}})),In=(n,e,t=!1)=>{n&&e.allowStopPropagation&&(t&&n.stopImmediatePropagation(),n.stopPropagation())},gd=(n,e,t,r,i)=>{const o=Ha(n,e.slice(0,n.length),new Date);return Mi(o)&&Mc(o)?r||i?o:Be(o,{hours:+t.hours,minutes:+(t==null?void 0:t.minutes),seconds:+(t==null?void 0:t.seconds),milliseconds:0}):null},av=(n,e,t,r,i)=>{const o=Array.isArray(t)?t[0]:t;if(typeof e=="string")return gd(n,e,o,r,i);if(Array.isArray(e)){let a=null;for(const s of e)if(a=gd(n,s,o,r,i),a)break;return a}return typeof e=="function"?e(n):null},G=n=>n?new Date(n):new Date,sv=(n,e,t)=>{if(e){const i=(n.getMonth()+1).toString().padStart(2,"0"),o=n.getDate().toString().padStart(2,"0"),a=n.getHours().toString().padStart(2,"0"),s=n.getMinutes().toString().padStart(2,"0"),c=t?n.getSeconds().toString().padStart(2,"0"):"00";return`${n.getFullYear()}-${i}-${o}T${a}:${s}:${c}.000Z`}const r=Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds());return new Date(r).toISOString()},It=n=>{let e=G(JSON.parse(JSON.stringify(n)));return e=Qc(e,0),e=Jc(e,0),e=ja(e,0),e=Ua(e,0),e},Rn=(n,e,t,r)=>{let i=n?G(n):G();return(e||e===0)&&(i=Qc(i,+e)),(t||t===0)&&(i=Jc(i,+t)),(r||r===0)&&(i=ja(i,+r)),Ua(i,0)},nt=(n,e)=>!n||!e?!1:Ei(It(n),It(e)),Ae=(n,e)=>!n||!e?!1:Fr(It(n),It(e)),lt=(n,e)=>!n||!e?!1:Ai(It(n),It(e)),Do=(n,e,t)=>n!=null&&n[0]&&n!=null&&n[1]?lt(t,n[0])&&nt(t,n[1]):n!=null&&n[0]&&e?lt(t,n[0])&&nt(t,e)||nt(t,n[0])&&lt(t,e):!1,qt=n=>{const e=Be(new Date(n),{date:1});return It(e)},fs=(n,e,t)=>e&&(t||t===0)?Object.fromEntries(["hours","minutes","seconds"].map(r=>r===e?[r,t]:[r,isNaN(+n[r])?void 0:+n[r]])):{hours:isNaN(+n.hours)?void 0:+n.hours,minutes:isNaN(+n.minutes)?void 0:+n.minutes,seconds:isNaN(+n.seconds)?void 0:+n.seconds},fr=n=>({hours:Wt(n),minutes:an(n),seconds:$r(n)}),yd=(n,e)=>{if(e){const t=Me(G(e));if(t>n)return 12;if(t===n)return Ce(G(e))}},vd=(n,e)=>{if(e){const t=Me(G(e));return t<n?-1:t===n?Ce(G(e)):void 0}},Yr=n=>{if(n)return Me(G(n))},Rt=(n,e)=>e?X0(n,e):n,bd=(n,e)=>e?Z0(n,e):n,wd=n=>n instanceof Date?n:u0(n),kd=(n,e)=>{const t=lt(n,e)?e:n,r=lt(e,n)?e:n;return Tc({start:t,end:r})},lv=n=>{const e=jt(n,1);return{month:Ce(e),year:Me(e)}},Ao=(n,e,t)=>{const r=lr(Rt(n,e),{weekStartsOn:+t}),i=ng(Rt(n,e),{weekStartsOn:+t});return[r,i]},xd=(n,e)=>{const t={hours:Wt(G()),minutes:an(G()),seconds:e?$r(G()):0};return Object.assign(t,n)},Vn=(n,e,t)=>[Be(G(n),{date:1}),Be(G(),{month:e,year:t,date:1})],Mn=(n,e,t)=>{let r=n?G(n):G();return(e||e===0)&&(r=Gc(r,e)),t&&(r=ur(r,t)),r},Cd=(n,e,t,r,i)=>{if(!r||i&&!e||!i&&!t)return!1;const o=i?jt(n,1):zr(n,1),a=[Ce(o),Me(o)];return i?!dv(...a,e):!cv(...a,t)},cv=(n,e,t)=>nt(...Vn(t,n,e))||Ae(...Vn(t,n,e)),dv=(n,e,t)=>lt(...Vn(t,n,e))||Ae(...Vn(t,n,e)),Md=(n,e,t,r,i,o,a)=>{if(typeof e=="function"&&!a)return e(n);const s=t?{locale:t}:void 0;return Array.isArray(n)?`${Pn(n[0],o,s)}${i&&!n[1]?"":r}${n[1]?Pn(n[1],o,s):""}`:Pn(n,o,s)},Ur=n=>{if(n)return null;throw new Error(So.prop("partial-range"))},Eo=(n,e)=>{if(e)return n();throw new Error(So.prop("range"))},ps=n=>Array.isArray(n)?Mi(n[0])&&(n[1]?Mi(n[1]):!0):n?Mi(n):!1,uv=n=>Be(G(),{hours:+n.hours||0,minutes:+n.minutes||0,seconds:+n.seconds||0}),hs=(n,e,t,r)=>{if(!n)return!0;if(r){const i=t==="max"?Ei(n,e):Ai(n,e),o={seconds:0,milliseconds:0};return i||Fr(Be(n,o),Be(e,o))}return t==="max"?n.getTime()<=e.getTime():n.getTime()>=e.getTime()},Td=(n,e,t,r,i)=>{const o=n?uv(n):G(e);return Array.isArray(r)?hs(r[0],o,t,!!e)&&hs(r[1],o,t,!!e)&&i:hs(r,o,t,!!e)&&i},ms=n=>Be(G(),fr(n)),fv=(n,e)=>Array.isArray(n)?n.map(t=>G(t)).filter(t=>Me(G(t))===e).map(t=>Ce(t)):[],Bi=l.reactive({menuFocused:!1,shiftKeyInMenu:!1}),Sd=()=>{const n=t=>{Bi.menuFocused=t},e=t=>{Bi.shiftKeyInMenu!==t&&(Bi.shiftKeyInMenu=t)};return{control:l.computed(()=>({shiftKeyInMenu:Bi.shiftKeyInMenu,menuFocused:Bi.menuFocused})),setMenuFocused:n,setShiftKey:e}},Pe=l.reactive({monthYear:[],calendar:[],time:[],actionRow:[],selectionGrid:[],timePicker:{0:[],1:[]},monthPicker:[]}),gs=l.ref(null),Oo=l.ref(!1),ys=l.ref(!1),vs=l.ref(!1),bs=l.ref(!1),gt=l.ref(0),rt=l.ref(0),Ln=()=>{const n=l.computed(()=>Oo.value?[...Pe.selectionGrid,Pe.actionRow].filter(f=>f.length):ys.value?[...Pe.timePicker[0],...Pe.timePicker[1],bs.value?[]:[gs.value],Pe.actionRow].filter(f=>f.length):vs.value?[...Pe.monthPicker,Pe.actionRow]:[Pe.monthYear,...Pe.calendar,Pe.time,Pe.actionRow].filter(f=>f.length)),e=f=>{gt.value=f?gt.value+1:gt.value-1;let p=null;n.value[rt.value]&&(p=n.value[rt.value][gt.value]),p||(gt.value=f?gt.value-1:gt.value+1)},t=f=>{rt.value===0&&!f||rt.value===n.value.length&&f||(rt.value=f?rt.value+1:rt.value-1,n.value[rt.value]?n.value[rt.value]&&!n.value[rt.value][gt.value]&&gt.value!==0&&(gt.value=n.value[rt.value].length-1):rt.value=f?rt.value-1:rt.value+1)},r=f=>{let p=null;n.value[rt.value]&&(p=n.value[rt.value][gt.value]),p?p.focus({preventScroll:!Oo.value}):gt.value=f?gt.value-1:gt.value+1},i=()=>{e(!0),r(!0)},o=()=>{e(!1),r(!1)},a=()=>{t(!1),r(!0)},s=()=>{t(!0),r(!0)},c=(f,p)=>{Pe[p]=f},d=(f,p)=>{Pe[p]=f},u=()=>{gt.value=0,rt.value=0};return{buildMatrix:c,buildMultiLevelMatrix:d,setTimePickerBackRef:f=>{gs.value=f},setSelectionGrid:f=>{Oo.value=f,u(),f||(Pe.selectionGrid=[])},setTimePicker:(f,p=!1)=>{ys.value=f,bs.value=p,u(),f||(Pe.timePicker[0]=[],Pe.timePicker[1]=[])},setTimePickerElements:(f,p=0)=>{Pe.timePicker[p]=f},arrowRight:i,arrowLeft:o,arrowUp:a,arrowDown:s,clearArrowNav:()=>{Pe.monthYear=[],Pe.calendar=[],Pe.time=[],Pe.actionRow=[],Pe.selectionGrid=[],Pe.timePicker[0]=[],Pe.timePicker[1]=[],Oo.value=!1,ys.value=!1,bs.value=!1,vs.value=!1,u(),gs.value=null},setMonthPicker:f=>{vs.value=f,u()},refSets:Pe}},Dd=n=>({menuAppearTop:"dp-menu-appear-top",menuAppearBottom:"dp-menu-appear-bottom",open:"dp-slide-down",close:"dp-slide-up",next:"calendar-next",previous:"calendar-prev",vNext:"dp-slide-up",vPrevious:"dp-slide-down",...n??{}}),pv=n=>({toggleOverlay:"Toggle overlay",menu:"Datepicker menu",input:"Datepicker input",calendarWrap:"Calendar wrapper",calendarDays:"Calendar days",openTimePicker:"Open time picker",closeTimePicker:"Close time Picker",incrementValue:e=>`Increment ${e}`,decrementValue:e=>`Decrement ${e}`,openTpOverlay:e=>`Open ${e} overlay`,amPmButton:"Switch AM/PM mode",openYearsOverlay:"Open years overlay",openMonthsOverlay:"Open months overlay",nextMonth:"Next month",prevMonth:"Previous month",nextYear:"Next year",prevYear:"Previous year",day:()=>"",...n??{}}),Ad=n=>n?typeof n=="boolean"?n?2:0:+n>=2?+n:2:0,hv=n=>{const e=typeof n=="object"&&n,t={static:!0,solo:!1};if(!n)return{...t,count:Ad(!1)};const r=e?n:{},i=e?r.count??!0:n,o=Ad(i);return Object.assign(t,r,{count:o})},mv=(n,e,t)=>n||(typeof t=="string"?t:e),gv=n=>typeof n=="boolean"?n?Dd({}):!1:Dd(n),yv=n=>{const e={enterSubmit:!0,tabSubmit:!0,openMenu:!0,selectOnFocus:!1,rangeSeparator:" - "};return typeof n=="object"?{...e,...n??{},enabled:!0}:{...e,enabled:n}},vv=n=>({months:[],years:[],times:{hours:[],minutes:[],seconds:[]},...n??{}}),bv=n=>({showSelect:!0,showCancel:!0,showNow:!1,showPreview:!0,...n??{}}),wv=n=>{const e={input:!1};return typeof n=="object"?{...e,...n??{},enabled:!0}:{enabled:n,...e}},kv=n=>({allowStopPropagation:!0,closeOnScroll:!1,modeHeight:255,allowPreventDefault:!1,closeOnClearValue:!0,closeOnAutoApply:!0,noSwipe:!1,keepActionRow:!1,onClickOutside:void 0,...n??{}}),Ye=n=>{const e=()=>{const g=n.enableSeconds?":ss":"";return n.is24?`HH:mm${g}`:`hh:mm${g} aa`},t=()=>n.format?n.format:n.monthPicker?"MM/yyyy":n.timePicker?e():n.weekPicker?"MM/dd/yyyy":n.yearPicker?"yyyy":n.quarterPicker?"QQQ/yyyy":n.enableTimePicker?`MM/dd/yyyy, ${e()}`:"MM/dd/yyyy",r=g=>xd(g,n.enableSeconds),i=()=>n.range?n.startTime&&Array.isArray(n.startTime)?[r(n.startTime[0]),r(n.startTime[1])]:null:n.startTime&&!Array.isArray(n.startTime)?r(n.startTime):null,o=l.computed(()=>hv(n.multiCalendars)),a=l.computed(()=>i()),s=l.computed(()=>pv(n.ariaLabels)),c=l.computed(()=>vv(n.filters)),d=l.computed(()=>gv(n.transitions)),u=l.computed(()=>bv(n.actionRow)),f=l.computed(()=>mv(n.previewFormat,n.format,t())),p=l.computed(()=>yv(n.textInput)),h=l.computed(()=>wv(n.inline)),m=l.computed(()=>kv(n.config));return{defaultedTransitions:d,defaultedMultiCalendars:o,defaultedStartTime:a,defaultedAriaLabels:s,defaultedFilters:c,defaultedActionRow:u,defaultedPreviewFormat:f,defaultedTextInput:p,defaultedInline:h,defaultedConfig:m,getDefaultPattern:t,getDefaultStartTime:i}},xv=(n,e,t)=>{const r=l.ref(),{defaultedTextInput:i,getDefaultPattern:o}=Ye(e),a=l.ref(""),s=l.toRef(e,"format");l.watch(r,()=>{n("internal-model-change",r.value)}),l.watch(s,()=>{F()});const c=v=>bd(v,e.timezone),d=v=>Rt(v,e.timezone),u=(v,A,E=!1)=>Md(v,e.format,e.formatLocale,i.value.rangeSeparator,e.modelAuto,A??o(),E),f=v=>v?e.modelType?I(v):{hours:Wt(v),minutes:an(v),seconds:e.enableSeconds?$r(v):0}:null,p=v=>e.modelType?I(v):{month:Ce(v),year:Me(v)},h=v=>Array.isArray(v)?Eo(()=>[ur(G(),v[0]),v[1]?ur(G(),v[1]):Ur(e.partialRange)],e.range):ur(G(),+v),m=(v,A)=>(typeof v=="string"||typeof v=="number")&&e.modelType?O(v):A,g=v=>Array.isArray(v)?[m(v[0],Rn(null,+v[0].hours,+v[0].minutes,v[0].seconds)),m(v[1],Rn(null,+v[1].hours,+v[1].minutes,v[1].seconds))]:m(v,Rn(null,v.hours,v.minutes,v.seconds)),k=v=>Array.isArray(v)?e.multiDates?v.map(A=>m(A,Mn(null,+A.month,+A.year))):Eo(()=>[m(v[0],Mn(null,+v[0].month,+v[0].year)),m(v[1],v[1]?Mn(null,+v[1].month,+v[1].year):Ur(e.partialRange))],e.range):m(v,Mn(null,+v.month,+v.year)),x=v=>{if(Array.isArray(v))return v.map(A=>O(A));throw new Error(So.dateArr("multi-dates"))},S=v=>{if(Array.isArray(v))return[G(v[0]),G(v[1])];throw new Error(So.dateArr("week-picker"))},T=v=>e.modelAuto?Array.isArray(v)?[O(v[0]),O(v[1])]:e.autoApply?[O(v)]:[O(v),null]:Array.isArray(v)?Eo(()=>[O(v[0]),v[1]?O(v[1]):Ur(e.partialRange)],e.range):O(v),y=()=>{Array.isArray(r.value)&&e.range&&r.value.length===1&&r.value.push(Ur(e.partialRange))},B=()=>{const v=r.value;return[I(v[0]),v[1]?I(v[1]):Ur(e.partialRange)]},w=()=>r.value[1]?B():I(Je(r.value[0])),V=()=>(r.value||[]).map(v=>I(v)),$=()=>(y(),e.modelAuto?w():e.multiDates?V():Array.isArray(r.value)?Eo(()=>B(),e.range):I(Je(r.value))),M=v=>!v||Array.isArray(v)&&!v.length?null:e.timePicker?g(Je(v)):e.monthPicker?k(Je(v)):e.yearPicker?h(Je(v)):e.multiDates?x(Je(v)):e.weekPicker?S(Je(v)):T(Je(v)),_=v=>{const A=M(v);ps(Je(A))?(r.value=Je(A),F()):(r.value=null,a.value="")},z=()=>{const v=A=>Pn(A,i.value.format);return`${v(r.value[0])} ${i.value.rangeSeparator} ${r.value[1]?v(r.value[1]):""}`},N=()=>t.value&&r.value?Array.isArray(r.value)?z():Pn(r.value,i.value.format):u(r.value),W=()=>r.value?e.multiDates?r.value.map(v=>u(v)).join("; "):i.value.enabled&&typeof i.value.format=="string"?N():u(r.value):"",F=()=>{!e.format||typeof e.format=="string"||i.value.enabled&&typeof i.value.format=="string"?a.value=W():a.value=e.format(r.value)},O=v=>{if(e.utc){const A=new Date(v);return e.utc==="preserve"?new Date(A.getTime()+A.getTimezoneOffset()*6e4):A}return e.modelType?e.modelType==="date"||e.modelType==="timestamp"?d(new Date(v)):e.modelType==="format"&&(typeof e.format=="string"||!e.format)?Ha(v,o(),new Date):d(Ha(v,e.modelType,new Date)):d(new Date(v))},I=v=>v?e.utc?sv(v,e.utc==="preserve",e.enableSeconds):e.modelType?e.modelType==="timestamp"?+c(v):e.modelType==="format"&&(typeof e.format=="string"||!e.format)?u(c(v)):u(c(v),e.modelType,!0):c(v):"",H=(v,A=!1)=>{if(n("update:model-value",v),e.emitTimezone&&A){const E=Array.isArray(v)?v.map(P=>Rt(Je(P)),e.emitTimezone):Rt(Je(v),e.emitTimezone);n("update:model-timezone-value",E)}},b=v=>Array.isArray(r.value)?e.multiDates?r.value.map(A=>v(A)):[v(r.value[0]),r.value[1]?v(r.value[1]):Ur(e.partialRange)]:v(Je(r.value)),C=v=>H(Je(b(v)));return{inputValue:a,internalModelValue:r,checkBeforeEmit:()=>r.value?e.range?e.partialRange?r.value.length>=1:r.value.length===2:!!r.value:!1,parseExternalModelValue:_,formatInputValue:F,emitModelValue:()=>(F(),e.monthPicker?C(p):e.timePicker?C(f):e.yearPicker?C(Me):e.weekPicker?H(r.value.map(v=>I(v)),!0):H($(),!0))}},Cv=(n,e)=>{const{defaultedFilters:t}=Ye(n),{validateMonthYearInRange:r}=Wr(n),i=(d,u)=>{let f=d;return t.value.months.includes(Ce(f))?(f=u?jt(d,1):zr(d,1),i(f,u)):f},o=(d,u)=>{let f=d;return t.value.years.includes(Me(f))?(f=u?Ba(d,1):Xc(d,1),o(f,u)):f},a=(d,u=!1)=>{const f=Be(new Date,{month:n.month,year:n.year});let p=d?jt(f,1):zr(f,1);n.disableYearSelect&&(p=ur(p,n.year));let h=Ce(p),m=Me(p);t.value.months.includes(h)&&(p=i(p,d),h=Ce(p),m=Me(p)),t.value.years.includes(m)&&(p=o(p,d),m=Me(p)),r(h,m,d,n.preventMinMaxNavigation)&&s(h,m,u)},s=(d,u,f)=>{e("update-month-year",{month:d,year:u,fromNav:f})},c=l.computed(()=>d=>Cd(Be(new Date,{month:n.month,year:n.year}),n.maxDate,n.minDate,n.preventMinMaxNavigation,d));return{handleMonthYearChange:a,isDisabled:c,updateMonthYear:s}};var jr=(n=>(n.center="center",n.left="left",n.right="right",n))(jr||{}),Kt=(n=>(n.month="month",n.year="year",n))(Kt||{}),pr=(n=>(n.top="top",n.bottom="bottom",n))(pr||{}),hr=(n=>(n.header="header",n.calendar="calendar",n.timePicker="timePicker",n))(hr||{}),cn=(n=>(n.month="month",n.year="year",n.calendar="calendar",n.time="time",n.minutes="minutes",n.hours="hours",n.seconds="seconds",n))(cn||{});const Mv=({menuRef:n,menuRefInner:e,inputRef:t,pickerWrapperRef:r,inline:i,emit:o,props:a,slots:s})=>{const c=l.ref({}),d=l.ref(!1),u=l.ref({top:"0",left:"0"}),f=l.ref(!1),p=l.toRef(a,"teleportCenter");l.watch(p,()=>{u.value=JSON.parse(JSON.stringify({})),y()});const h=O=>{if(a.teleport){const I=O.getBoundingClientRect();return{left:I.left+window.scrollX,top:I.top+window.scrollY}}return{top:0,left:0}},m=(O,I)=>{u.value.left=`${O+I-c.value.width}px`},g=O=>{u.value.left=`${O}px`},k=(O,I)=>{a.position===jr.left&&g(O),a.position===jr.right&&m(O,I),a.position===jr.center&&(u.value.left=`${O+I/2-c.value.width/2}px`)},x=O=>{const{width:I,height:H}=O.getBoundingClientRect(),{top:b,left:C}=a.altPosition?a.altPosition(O):h(O);return{top:+b,left:+C,width:I,height:H}},S=()=>{u.value.left="50%",u.value.top="50%",u.value.transform="translate(-50%, -50%)",u.value.position="fixed",delete u.value.opacity},T=()=>{const O=qe(t),{top:I,left:H,transform:b}=a.altPosition(O);u.value={top:`${I}px`,left:`${H}px`,transform:b??""}},y=(O=!0)=>{var I;if(!i.value.enabled){if(p.value)return S();if(a.altPosition!==null)return T();if(O){const H=a.teleport?(I=e.value)==null?void 0:I.$el:n.value;H&&(c.value=H.getBoundingClientRect()),o("recalculate-position")}return z()}},B=({inputEl:O,left:I,width:H})=>{window.screen.width>768&&!d.value&&k(I,H),$(O)},w=O=>{const{top:I,left:H,height:b,width:C}=x(O);u.value.top=`${b+I+ +a.offset}px`,f.value=!1,d.value||(u.value.left=`${H+C/2-c.value.width/2}px`),B({inputEl:O,left:H,width:C})},V=O=>{const{top:I,left:H,width:b}=x(O);u.value.top=`${I-+a.offset-c.value.height}px`,f.value=!0,B({inputEl:O,left:H,width:b})},$=O=>{if(a.autoPosition){const{left:I,width:H}=x(O),{left:b,right:C}=c.value;if(!d.value){if(Math.abs(b)!==Math.abs(C)){if(b<=0)return d.value=!0,g(I);if(C>=document.documentElement.clientWidth)return d.value=!0,m(I,H)}return k(I,H)}}},M=()=>{const O=qe(t);if(O){const{height:I}=c.value,{top:H,height:b}=O.getBoundingClientRect(),C=window.innerHeight-H-b,v=H;return I<=C?pr.bottom:I>C&&I<=v?pr.top:C>=v?pr.bottom:pr.top}return pr.bottom},_=O=>M()===pr.bottom?w(O):V(O),z=()=>{const O=qe(t);if(O)return a.autoPosition?_(O):w(O)},N=function(O){if(O){const I=O.scrollHeight>O.clientHeight,H=window.getComputedStyle(O).overflowY.indexOf("hidden")!==-1;return I&&!H}return!0},W=function(O){return!O||O===document.body||O.nodeType===Node.DOCUMENT_FRAGMENT_NODE?window:N(O)?O:W(O.parentNode)},F=O=>{if(O)switch(a.position){case jr.left:return{left:0,transform:"translateX(0)"};case jr.right:return{left:`${O.width}px`,transform:"translateX(-100%)"};default:return{left:`${O.width/2}px`,transform:"translateX(-50%)"}}return{}};return{openOnTop:f,menuStyle:u,xCorrect:d,setMenuPosition:y,getScrollableParent:W,shadowRender:(O,I)=>{var H,b,C;const v=document.createElement("div"),A=(H=qe(t))==null?void 0:H.getBoundingClientRect();v.setAttribute("id","dp--temp-container");const E=(b=r.value)!=null&&b.clientWidth?r.value:document.body;E.append(v);const P=document.getElementById("dp--temp-container"),q=F(A),D=l.h(O,{...I,shadow:!0,style:{opacity:0,position:"absolute",...q}},Object.fromEntries(Object.keys(s).filter(X=>["right-sidebar","left-sidebar"].includes(X)).map(X=>[X,s[X]])));l.render(D,P),c.value=(C=D.el)==null?void 0:C.getBoundingClientRect(),l.render(null,P),E.removeChild(P)}}},$n=[{name:"clock-icon",use:["time","calendar","shared"]},{name:"arrow-left",use:["month-year","calendar","shared","year-mode"]},{name:"arrow-right",use:["month-year","calendar","shared","year-mode"]},{name:"arrow-up",use:["time","calendar","month-year","shared"]},{name:"arrow-down",use:["time","calendar","month-year","shared"]},{name:"calendar-icon",use:["month-year","time","calendar","shared","year-mode"]},{name:"day",use:["calendar","shared"]},{name:"month-overlay-value",use:["calendar","month-year","shared"]},{name:"year-overlay-value",use:["calendar","month-year","shared","year-mode"]},{name:"year-overlay",use:["month-year","shared"]},{name:"month-overlay",use:["month-year","shared"]},{name:"month-overlay-header",use:["month-year","shared"]},{name:"year-overlay-header",use:["month-year","shared"]},{name:"hours-overlay-value",use:["calendar","time","shared"]},{name:"minutes-overlay-value",use:["calendar","time","shared"]},{name:"seconds-overlay-value",use:["calendar","time","shared"]},{name:"hours",use:["calendar","time","shared"]},{name:"minutes",use:["calendar","time","shared"]},{name:"month",use:["calendar","month-year","shared"]},{name:"year",use:["calendar","month-year","shared","year-mode"]},{name:"action-buttons",use:["action"]},{name:"action-preview",use:["action"]},{name:"calendar-header",use:["calendar","shared"]},{name:"marker-tooltip",use:["calendar","shared"]},{name:"action-extra",use:["menu"]},{name:"time-picker-overlay",use:["calendar","time","shared"]},{name:"am-pm-button",use:["calendar","time","shared"]},{name:"left-sidebar",use:["menu"]},{name:"right-sidebar",use:["menu"]},{name:"month-year",use:["month-year","shared"]},{name:"time-picker",use:["menu","shared"]},{name:"action-row",use:["action"]},{name:"marker",use:["calendar","shared"]},{name:"quarter",use:["shared"]}],Tv=[{name:"trigger"},{name:"input-icon"},{name:"clear-icon"},{name:"dp-input"}],Sv={all:()=>$n,monthYear:()=>$n.filter(n=>n.use.includes("month-year")),input:()=>Tv,timePicker:()=>$n.filter(n=>n.use.includes("time")),action:()=>$n.filter(n=>n.use.includes("action")),calendar:()=>$n.filter(n=>n.use.includes("calendar")),menu:()=>$n.filter(n=>n.use.includes("menu")),shared:()=>$n.filter(n=>n.use.includes("shared")),yearMode:()=>$n.filter(n=>n.use.includes("year-mode"))},At=(n,e,t)=>{const r=[];return Sv[e]().forEach(i=>{n[i.name]&&r.push(i.name)}),t!=null&&t.length&&t.forEach(i=>{i.slot&&r.push(i.slot)}),r},Pi=n=>{const e=l.computed(()=>r=>n.value?r?n.value.open:n.value.close:""),t=l.computed(()=>r=>n.value?r?n.value.menuAppearTop:n.value.menuAppearBottom:"");return{transitionName:e,showTransition:!!n.value,menuTransition:t}},Ii=(n,e)=>{const t=G(Rt(new Date,n.timezone)),r=l.ref([{month:Ce(t),year:Me(t)}]),i=l.reactive({hours:n.range?[Wt(t),Wt(t)]:Wt(t),minutes:n.range?[an(t),an(t)]:an(t),seconds:n.range?[0,0]:0}),o=l.computed({get:()=>n.internalModelValue,set:c=>{!n.readonly&&!n.disabled&&e("update:internal-model-value",c)}}),a=l.computed(()=>c=>r.value[c]?r.value[c].month:0),s=l.computed(()=>c=>r.value[c]?r.value[c].year:0);return{calendars:r,time:i,modelValue:o,month:a,year:s}},Dv=(n,e)=>{const{defaultedMultiCalendars:t}=Ye(e),{isDisabled:r,matchDate:i}=Wr(e),o=l.ref(null),a=l.ref(G(Rt(new Date,e.timezone))),s=b=>{!b.current&&e.hideOffsetDates||(o.value=b.value)},c=()=>{o.value=null},d=b=>Array.isArray(n.value)&&e.range&&n.value[0]&&o.value?b?lt(o.value,n.value[0]):nt(o.value,n.value[0]):!0,u=(b,C)=>{const v=()=>n.value?C?n.value[0]||null:n.value[1]:null,A=n.value&&Array.isArray(n.value)?v():null;return Ae(G(b.value),A)},f=b=>{const C=Array.isArray(n.value)?n.value[0]:null;return b?!nt(o.value??null,C):!0},p=(b,C=!0)=>(e.range||e.weekPicker)&&Array.isArray(n.value)&&n.value.length===2?e.hideOffsetDates&&!b.current?!1:Ae(G(b.value),n.value[C?0:1]):e.range?u(b,C)&&f(C)||Ae(b.value,Array.isArray(n.value)?n.value[0]:null)&&d(C):!1,h=(b,C,v)=>Array.isArray(n.value)&&n.value[0]&&n.value.length===1?b?!1:v?lt(n.value[0],C.value):nt(n.value[0],C.value):!1,m=b=>!n.value||e.hideOffsetDates&&!b.current?!1:e.range?e.modelAuto&&Array.isArray(n.value)?Ae(b.value,n.value[0]?n.value[0]:a.value):!1:e.multiDates&&Array.isArray(n.value)?n.value.some(C=>Ae(C,b.value)):Ae(b.value,n.value?n.value:a.value),g=b=>{if(e.autoRange||e.weekPicker){if(o.value){if(e.hideOffsetDates&&!b.current)return!1;const C=Cn(o.value,+e.autoRange),v=Ao(G(o.value),e.timezone,e.weekStart);return e.weekPicker?Ae(v[1],G(b.value)):Ae(C,G(b.value))}return!1}return!1},k=b=>{if(e.autoRange||e.weekPicker){if(o.value){const C=Cn(o.value,+e.autoRange);if(e.hideOffsetDates&&!b.current)return!1;const v=Ao(G(o.value),e.timezone,e.weekStart);return e.weekPicker?lt(b.value,v[0])&&nt(b.value,v[1]):lt(b.value,o.value)&&nt(b.value,C)}return!1}return!1},x=b=>{if(e.autoRange||e.weekPicker){if(o.value){if(e.hideOffsetDates&&!b.current)return!1;const C=Ao(G(o.value),e.timezone,e.weekStart);return e.weekPicker?Ae(C[0],b.value):Ae(o.value,b.value)}return!1}return!1},S=b=>Do(n.value,o.value,b.value),T=()=>e.modelAuto&&Array.isArray(e.internalModelValue)?!!e.internalModelValue[0]:!1,y=()=>e.modelAuto?pd(e.internalModelValue):!0,B=b=>{if(Array.isArray(n.value)&&n.value.length||e.weekPicker)return!1;const C=e.range?!p(b)&&!p(b,!1):!0;return!r(b.value)&&!m(b)&&!(!b.current&&e.hideOffsetDates)&&C},w=b=>e.range?e.modelAuto?T()&&m(b):!1:m(b),V=b=>{var C;return e.highlight?i(b.value,(C=e.arrMapValues)!=null&&C.highlightedDates?e.arrMapValues.highlightedDates:e.highlight):!1},$=b=>r(b.value)&&e.highlightDisabledDays===!1,M=b=>{var C;return(C=e.highlightWeekDays)==null?void 0:C.includes(b.value.getDay())},_=b=>(e.range||e.weekPicker)&&(!(t.value.count>0)||b.current)&&y()&&!(!b.current&&e.hideOffsetDates)&&!m(b)?S(b):!1,z=b=>{const{isRangeStart:C,isRangeEnd:v}=F(b),A=e.range?C||v:!1;return{dp__cell_offset:!b.current,dp__pointer:!e.disabled&&!(!b.current&&e.hideOffsetDates)&&!r(b.value),dp__cell_disabled:r(b.value),dp__cell_highlight:!$(b)&&(V(b)||M(b))&&!w(b)&&!A,dp__cell_highlight_active:!$(b)&&(V(b)||M(b))&&w(b),dp__today:!e.noToday&&Ae(b.value,a.value)&&b.current}},N=b=>({dp__active_date:w(b),dp__date_hover:B(b)}),W=b=>({...O(b),...I(b),dp__range_between_week:_(b)&&e.weekPicker}),F=b=>{const C=t.value.count>0?b.current&&p(b)&&y():p(b)&&y(),v=t.value.count>0?b.current&&p(b,!1)&&y():p(b,!1)&&y();return{isRangeStart:C,isRangeEnd:v}},O=b=>{const{isRangeStart:C,isRangeEnd:v}=F(b);return{dp__range_start:C,dp__range_end:v,dp__range_between:_(b)&&!e.weekPicker,dp__date_hover_start:h(B(b),b,!0),dp__date_hover_end:h(B(b),b,!1)}},I=b=>({...O(b),dp__cell_auto_range:k(b),dp__cell_auto_range_start:x(b),dp__cell_auto_range_end:g(b)}),H=b=>e.range?e.autoRange?I(b):e.modelAuto?{...N(b),...O(b)}:O(b):e.weekPicker?W(b):N(b);return{setHoverDate:s,clearHoverDate:c,getDayClassData:b=>e.hideOffsetDates&&!b.current?{}:{...z(b),...H(b),[e.dayClass?e.dayClass(b.value):""]:!0,[e.calendarCellClassName]:!!e.calendarCellClassName}}},Wr=n=>{const{defaultedFilters:e}=Ye(n),t=()=>{if(n.timezone)return n.timezone;if(n.utc)return"UTC"},r=M=>{const _=It(i(G(M))).toISOString(),[z]=_.split("T");return z},i=M=>n.utc==="preserve"?bd(M,t()):Rt(M,t()),o=M=>{var _;const z=n.maxDate?lt(i(M),i(G(n.maxDate))):!1,N=n.minDate?nt(i(M),i(G(n.minDate))):!1,W=d(i(M),(_=n.arrMapValues)!=null&&_.disabledDates?n.arrMapValues.disabledDates:n.disabledDates),F=e.value.months.map(C=>+C).includes(Ce(M)),O=n.disabledWeekDays.length?n.disabledWeekDays.some(C=>+C===ay(M)):!1,I=f(M),H=Me(M),b=H<+n.yearRange[0]||H>+n.yearRange[1];return!(z||N||W||F||b||O||I)},a=(M,_)=>nt(...Vn(n.minDate,M,_))||Ae(...Vn(n.minDate,M,_)),s=(M,_)=>lt(...Vn(n.maxDate,M,_))||Ae(...Vn(n.maxDate,M,_)),c=(M,_,z)=>{let N=!1;return n.maxDate&&z&&s(M,_)&&(N=!0),n.minDate&&!z&&a(M,_)&&(N=!0),N},d=(M,_)=>M?_ instanceof Map?!!_.get(r(M)):Array.isArray(_)?_.some(z=>Ae(i(G(z)),i(M))):_?_(G(JSON.parse(JSON.stringify(M)))):!1:!0,u=(M,_,z,N)=>{let W=!1;return N?n.minDate&&n.maxDate?W=c(M,_,z):(n.minDate&&a(M,_)||n.maxDate&&s(M,_))&&(W=!0):W=!0,W},f=M=>{var _,z,N,W,F;return Array.isArray(n.allowedDates)&&!((_=n.allowedDates)!=null&&_.length)?!0:(z=n.arrMapValues)!=null&&z.allowedDates?!d(M,(N=n.arrMapValues)==null?void 0:N.allowedDates):(W=n.allowedDates)!=null&&W.length?!((F=n.allowedDates)!=null&&F.some(O=>Ae(i(G(O)),i(M)))):!1},p=M=>!o(M),h=M=>n.noDisabledRange?!Tc({start:M[0],end:M[1]}).some(_=>p(_)):!0,m=(M,_,z=0)=>{if(Array.isArray(_)&&_[z]){const N=Qm(M,_[z]),W=kd(_[z],M),F=W.length===1?0:W.filter(I=>p(I)).length,O=Math.abs(N)-F;if(n.minRange&&n.maxRange)return O>=+n.minRange&&O<=+n.maxRange;if(n.minRange)return O>=+n.minRange;if(n.maxRange)return O<=+n.maxRange}return!0},g=M=>new Map(M.map(_=>[r(_),!0])),k=M=>Array.isArray(M)&&M.length>0,x=()=>{const M={disabledDates:null,allowedDates:null,highlightedDates:null};return k(n.allowedDates)&&(M.allowedDates=g(n.allowedDates)),k(n.highlight)&&(M.highlightedDates=g(n.highlight)),k(n.disabledDates)&&(M.disabledDates=g(n.disabledDates)),M},S=()=>!n.enableTimePicker||n.monthPicker||n.yearPicker||n.ignoreTimeValidation,T=M=>Array.isArray(M)?[M[0]?ms(M[0]):null,M[1]?ms(M[1]):null]:ms(M),y=(M,_,z)=>M.find(N=>+N.hours===Wt(_)&&N.minutes==="*"?!0:+N.minutes===an(_)&&+N.hours===Wt(_))&&z,B=(M,_,z)=>{const[N,W]=M,[F,O]=_;return!y(N,F,z)&&!y(W,O,z)&&z},w=(M,_)=>{const z=Array.isArray(_)?_:[_];return Array.isArray(n.disabledTimes)?Array.isArray(n.disabledTimes[0])?B(n.disabledTimes,z,M):!z.some(N=>y(n.disabledTimes,N,M)):M},V=(M,_)=>{const z=Array.isArray(_)?[fr(_[0]),_[1]?fr(_[1]):void 0]:fr(_),N=!n.disabledTimes(z);return M&&N},$=(M,_)=>n.disabledTimes?Array.isArray(n.disabledTimes)?w(_,M):V(_,M):_;return{isDisabled:p,validateDate:o,validateMonthYearInRange:u,isDateRangeAllowed:h,checkMinMaxRange:m,matchDate:d,mapDatesArrToMap:x,isValidTime:M=>{let _=!0;if(!M||S())return!0;const z=!n.minDate&&!n.maxDate?T(M):M;return(n.maxTime||n.maxDate)&&(_=Td(n.maxTime,n.maxDate,"max",Je(z),_)),(n.minTime||n.minDate)&&(_=Td(n.minTime,n.minDate,"min",Je(z),_)),$(M,_)}}},No=()=>{const n=l.computed(()=>(r,i)=>r==null?void 0:r.includes(i)),e=l.computed(()=>(r,i)=>r.count?r.solo?!0:i===0:!0),t=l.computed(()=>(r,i)=>r.count?r.solo?!0:i===r.count-1:!0);return{hideNavigationButtons:n,showLeftIcon:e,showRightIcon:t}},Av=(n,e,t)=>{const r=l.ref(0),i=l.reactive({[hr.timePicker]:!n.enableTimePicker||n.timePicker||n.monthPicker,[hr.calendar]:!1,[hr.header]:!1}),o=(...u)=>{var f;(f=n.flow)!=null&&f.length&&(i[u]=!0,Object.keys(i).filter(p=>!i[p]).length||d())},a=()=>{var u;(u=n.flow)!=null&&u.length&&r.value!==-1&&(r.value+=1,e("flow-step",r.value),d())},s=()=>{r.value=-1},c=(u,f,...p)=>{n.flow[r.value]===u&&t.value&&t.value[f](...p)},d=()=>{c(cn.month,"toggleMonthPicker",!0),c(cn.year,"toggleYearPicker",!0),c(cn.calendar,"toggleTimePicker",!1,!0),c(cn.time,"toggleTimePicker",!0,!0);const u=n.flow[r.value];(u===cn.hours||u===cn.minutes||u===cn.seconds)&&c(u,"toggleTimePicker",!0,!0,u)};return{childMount:o,updateFlowStep:a,resetFlow:s,flowStep:r}},_o={multiCalendars:{type:[Boolean,Number,String,Object],default:void 0},modelValue:{type:[String,Date,Array,Object,Number],default:null},modelType:{type:String,default:null},position:{type:String,default:"center"},dark:{type:Boolean,default:!1},format:{type:[String,Function],default:()=>null},autoPosition:{type:Boolean,default:!0},altPosition:{type:Function,default:null},transitions:{type:[Boolean,Object],default:!0},formatLocale:{type:Object,default:null},utc:{type:[Boolean,String],default:!1},ariaLabels:{type:Object,default:()=>({})},offset:{type:[Number,String],default:10},hideNavigation:{type:Array,default:()=>[]},timezone:{type:String,default:null},emitTimezone:{type:String,default:null},vertical:{type:Boolean,default:!1},disableMonthYearSelect:{type:Boolean,default:!1},disableYearSelect:{type:Boolean,default:!1},menuClassName:{type:String,default:null},dayClass:{type:Function,default:null},yearRange:{type:Array,default:()=>[1900,2100]},calendarCellClassName:{type:String,default:null},enableTimePicker:{type:Boolean,default:!0},autoApply:{type:Boolean,default:!1},disabledDates:{type:[Array,Function],default:()=>[]},monthNameFormat:{type:String,default:"short"},startDate:{type:[Date,String],default:null},startTime:{type:[Object,Array],default:null},hideOffsetDates:{type:Boolean,default:!1},autoRange:{type:[Number,String],default:null},noToday:{type:Boolean,default:!1},disabledWeekDays:{type:Array,default:()=>[]},allowedDates:{type:Array,default:null},nowButtonLabel:{type:String,default:"Now"},markers:{type:Array,default:()=>[]},escClose:{type:Boolean,default:!0},spaceConfirm:{type:Boolean,default:!0},monthChangeOnArrows:{type:Boolean,default:!0},presetDates:{type:Array,default:()=>[]},flow:{type:Array,default:()=>[]},partialFlow:{type:Boolean,default:!1},preventMinMaxNavigation:{type:Boolean,default:!1},minRange:{type:[Number,String],default:null},maxRange:{type:[Number,String],default:null},multiDatesLimit:{type:[Number,String],default:null},reverseYears:{type:Boolean,default:!1},weekPicker:{type:Boolean,default:!1},filters:{type:Object,default:()=>({})},arrowNavigation:{type:Boolean,default:!1},disableTimeRangeValidation:{type:Boolean,default:!1},highlight:{type:[Array,Function],default:null},highlightWeekDays:{type:Array,default:null},highlightDisabledDays:{type:Boolean,default:!1},teleport:{type:[String,Boolean],default:null},teleportCenter:{type:Boolean,default:!1},locale:{type:String,default:"en-Us"},weekNumName:{type:String,default:"W"},weekStart:{type:[Number,String],default:1},weekNumbers:{type:[String,Function],default:null},calendarClassName:{type:String,default:null},monthChangeOnScroll:{type:[Boolean,String],default:!0},dayNames:{type:[Function,Array],default:null},monthPicker:{type:Boolean,default:!1},customProps:{type:Object,default:null},yearPicker:{type:Boolean,default:!1},modelAuto:{type:Boolean,default:!1},selectText:{type:String,default:"Select"},cancelText:{type:String,default:"Cancel"},previewFormat:{type:[String,Function],default:()=>""},multiDates:{type:Boolean,default:!1},partialRange:{type:Boolean,default:!0},ignoreTimeValidation:{type:Boolean,default:!1},minDate:{type:[Date,String],default:null},maxDate:{type:[Date,String],default:null},minTime:{type:Object,default:null},maxTime:{type:Object,default:null},name:{type:String,default:null},placeholder:{type:String,default:""},hideInputIcon:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},state:{type:Boolean,default:null},required:{type:Boolean,default:!1},autocomplete:{type:String,default:"off"},inputClassName:{type:String,default:null},fixedStart:{type:Boolean,default:!1},fixedEnd:{type:Boolean,default:!1},timePicker:{type:Boolean,default:!1},enableSeconds:{type:Boolean,default:!1},is24:{type:Boolean,default:!0},noHoursOverlay:{type:Boolean,default:!1},noMinutesOverlay:{type:Boolean,default:!1},noSecondsOverlay:{type:Boolean,default:!1},hoursGridIncrement:{type:[String,Number],default:1},minutesGridIncrement:{type:[String,Number],default:5},secondsGridIncrement:{type:[String,Number],default:5},hoursIncrement:{type:[Number,String],default:1},minutesIncrement:{type:[Number,String],default:1},secondsIncrement:{type:[Number,String],default:1},range:{type:Boolean,default:!1},uid:{type:String,default:null},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},inline:{type:[Boolean,Object],default:!1},textInput:{type:[Boolean,Object],default:!1},noDisabledRange:{type:Boolean,default:!1},sixWeeks:{type:[Boolean,String],default:!1},actionRow:{type:Object,default:()=>({})},focusStartDate:{type:Boolean,default:!1},disabledTimes:{type:[Function,Array],default:void 0},showLastInRange:{type:Boolean,default:!0},timePickerInline:{type:Boolean,default:!1},calendar:{type:Function,default:null},config:{type:Object,default:void 0},quarterPicker:{type:Boolean,default:!1}},Gt={..._o,shadow:{type:Boolean,default:!1},flowStep:{type:Number,default:0},internalModelValue:{type:[Date,Array],default:null},arrMapValues:{type:Object,default:()=>({})},noOverlayFocus:{type:Boolean,default:!1}},Ev={key:1,class:"dp__input_wrap"},Ov=["id","name","inputmode","placeholder","disabled","readonly","required","value","autocomplete","aria-label","aria-disabled","aria-invalid","onKeydown"],Nv={key:2,class:"dp__clear_icon"},_v=l.defineComponent({compatConfig:{MODE:3},__name:"DatepickerInput",props:{isMenuOpen:{type:Boolean,default:!1},inputValue:{type:String,default:""},..._o},emits:["clear","open","update:input-value","set-input-date","close","select-date","set-empty-date","toggle","focus-prev","focus","blur","real-blur"],setup(n,{expose:e,emit:t}){const r=n,{defaultedTextInput:i,defaultedAriaLabels:o,defaultedInline:a,defaultedConfig:s,getDefaultPattern:c,getDefaultStartTime:d}=Ye(r),u=l.ref(),f=l.ref(null),p=l.ref(!1),h=l.ref(!1),m=l.computed(()=>({dp__pointer:!r.disabled&&!r.readonly&&!i.value.enabled,dp__disabled:r.disabled,dp__input_readonly:!i.value.enabled,dp__input:!0,dp__input_icon_pad:!r.hideInputIcon,dp__input_valid:!!r.state,dp__input_invalid:r.state===!1,dp__input_focus:p.value||r.isMenuOpen,dp__input_reg:!i.value.enabled,[r.inputClassName]:!!r.inputClassName})),g=()=>{t("set-input-date",null),r.autoApply&&(t("set-empty-date"),u.value=null)},k=N=>{const W=d();return av(N,i.value.format??c(),W??xd({},r.enableSeconds),r.inputValue,h.value)},x=N=>{const{rangeSeparator:W}=i.value,[F,O]=N.split(`${W}`);if(F){const I=k(F.trim()),H=O?k(O.trim()):null,b=I&&H?[I,H]:[I];u.value=I?b:null}},S=()=>{h.value=!0},T=N=>{if(r.range)x(N);else if(r.multiDates){const W=N.split(";");u.value=W.map(F=>k(F.trim())).filter(F=>F)}else u.value=k(N)},y=N=>{var W;const F=typeof N=="string"?N:(W=N.target)==null?void 0:W.value;F!==""?(i.value.openMenu&&!r.isMenuOpen&&t("open"),T(F),t("set-input-date",u.value)):g(),h.value=!1,t("update:input-value",F)},B=N=>{i.value.enabled?(T(N.target.value),i.value.enterSubmit&&ps(u.value)&&r.inputValue!==""?(t("set-input-date",u.value,!0),u.value=null):i.value.enterSubmit&&r.inputValue===""&&(u.value=null,t("clear"))):$(N)},w=N=>{i.value.enabled&&i.value.tabSubmit&&T(N.target.value),i.value.tabSubmit&&ps(u.value)&&r.inputValue!==""?(t("set-input-date",u.value,!0),u.value=null):i.value.tabSubmit&&r.inputValue===""&&(u.value=null,t("clear"))},V=()=>{var N;p.value=!0,t("focus"),i.value.enabled&&i.value.selectOnFocus&&((N=f.value)==null||N.select())},$=N=>{N.preventDefault(),In(N,s.value,!0),i.value.enabled&&i.value.openMenu&&!a.value.input&&!r.isMenuOpen?t("open"):i.value.enabled||t("toggle")},M=()=>{t("real-blur"),p.value=!1,(!r.isMenuOpen||a.value.enabled&&a.value.input)&&t("blur"),r.autoApply&&i.value.enabled&&u.value&&!r.isMenuOpen&&(t("set-input-date",u.value),t("select-date"),u.value=null)},_=N=>{In(N,s.value,!0),t("clear")},z=N=>{if(!i.value.enabled){if(N.code==="Tab")return;N.preventDefault()}};return e({focusInput:()=>{var N;(N=f.value)==null||N.focus({preventScroll:!0})},setParsedDate:N=>{u.value=N}}),(N,W)=>{var F;return l.openBlock(),l.createElementBlock("div",{onClick:$},[N.$slots.trigger&&!N.$slots["dp-input"]&&!l.unref(a).enabled?l.renderSlot(N.$slots,"trigger",{key:0}):l.createCommentVNode("",!0),!N.$slots.trigger&&(!l.unref(a).enabled||l.unref(a).input)?(l.openBlock(),l.createElementBlock("div",Ev,[N.$slots["dp-input"]&&!N.$slots.trigger&&!l.unref(a).enabled?l.renderSlot(N.$slots,"dp-input",{key:0,value:n.inputValue,isMenuOpen:n.isMenuOpen,onInput:y,onEnter:B,onTab:w,onClear:_,onBlur:M,onKeypress:z,onPaste:S}):l.createCommentVNode("",!0),N.$slots["dp-input"]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("input",{key:1,ref_key:"inputRef",ref:f,id:N.uid?`dp-input-${N.uid}`:void 0,name:N.name,class:l.normalizeClass(m.value),inputmode:l.unref(i).enabled?"text":"none",placeholder:N.placeholder,disabled:N.disabled,readonly:N.readonly,required:N.required,value:n.inputValue,autocomplete:N.autocomplete,"aria-label":(F=l.unref(o))==null?void 0:F.input,"aria-disabled":N.disabled||void 0,"aria-invalid":N.state===!1?!0:void 0,onInput:y,onKeydown:[l.withKeys(B,["enter"]),l.withKeys(w,["tab"]),z],onBlur:M,onFocus:V,onKeypress:z,onPaste:S},null,42,Ov)),l.createElementVNode("div",{onClick:W[2]||(W[2]=O=>t("toggle"))},[N.$slots["input-icon"]&&!N.hideInputIcon?(l.openBlock(),l.createElementBlock("span",{key:0,class:"dp__input_icon",onClick:W[0]||(W[0]=O=>t("toggle"))},[l.renderSlot(N.$slots,"input-icon")])):l.createCommentVNode("",!0),!N.$slots["input-icon"]&&!N.hideInputIcon&&!N.$slots["dp-input"]?(l.openBlock(),l.createBlock(l.unref(Ni),{key:1,onClick:W[1]||(W[1]=O=>t("toggle")),class:"dp__input_icon dp__input_icons"})):l.createCommentVNode("",!0)]),N.$slots["clear-icon"]&&n.inputValue&&N.clearable&&!N.disabled&&!N.readonly?(l.openBlock(),l.createElementBlock("span",Nv,[l.renderSlot(N.$slots,"clear-icon",{clear:_})])):l.createCommentVNode("",!0),N.clearable&&!N.$slots["clear-icon"]&&n.inputValue&&!N.disabled&&!N.readonly?(l.openBlock(),l.createBlock(l.unref(Zc),{key:3,class:"dp__clear_icon dp__input_icons",onClick:W[3]||(W[3]=l.withModifiers(O=>_(O),["prevent"]))})):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)])}}}),Bv=["title"],Pv={class:"dp__action_buttons"},Iv=["onKeydown","disabled"],Rv=l.defineComponent({compatConfig:{MODE:3},__name:"ActionRow",props:{menuMount:{type:Boolean,default:!1},calendarWidth:{type:Number,default:0},...Gt},emits:["close-picker","select-date","select-now","invalid-select"],setup(n,{emit:e}){const t=n,{defaultedActionRow:r,defaultedPreviewFormat:i,defaultedMultiCalendars:o,defaultedTextInput:a,defaultedInline:s,getDefaultPattern:c}=Ye(t),{isValidTime:d}=Wr(t),{buildMatrix:u}=Ln(),f=l.ref(null),p=l.ref(null);l.onMounted(()=>{t.arrowNavigation&&u([qe(f),qe(p)],"actionRow")});const h=l.computed(()=>t.range&&!t.partialRange&&t.internalModelValue?t.internalModelValue.length===2:!0),m=l.computed(()=>!g.value||!k.value||!h.value),g=l.computed(()=>!t.enableTimePicker||t.ignoreTimeValidation?!0:d(t.internalModelValue)),k=l.computed(()=>t.monthPicker?t.range&&Array.isArray(t.internalModelValue)?!t.internalModelValue.filter(M=>!V(M)).length:V(t.internalModelValue):!0),x=()=>{const M=i.value;return t.timePicker||t.monthPicker,M(Je(t.internalModelValue))},S=()=>{const M=t.internalModelValue;return o.value.count>0?`${T(M[0])} - ${T(M[1])}`:[T(M[0]),T(M[1])]},T=M=>Md(M,i.value,t.formatLocale,a.value.rangeSeparator,t.modelAuto,c()),y=l.computed(()=>!t.internalModelValue||!t.menuMount?"":typeof i.value=="string"?Array.isArray(t.internalModelValue)?t.internalModelValue.length===2&&t.internalModelValue[1]?S():t.multiDates?t.internalModelValue.map(M=>`${T(M)}`):t.modelAuto?`${T(t.internalModelValue[0])}`:`${T(t.internalModelValue[0])} -`:T(t.internalModelValue):x()),B=()=>t.multiDates?"; ":" - ",w=l.computed(()=>Array.isArray(y.value)?y.value.join(B()):y.value),V=M=>{if(!t.monthPicker)return!0;let _=!0;const z=G(qt(M));if(t.minDate&&t.maxDate){const N=G(qt(t.minDate)),W=G(qt(t.maxDate));return lt(z,N)&&nt(z,W)||Ae(z,N)||Ae(z,W)}if(t.minDate){const N=G(qt(t.minDate));_=lt(z,N)||Ae(z,N)}if(t.maxDate){const N=G(qt(t.maxDate));_=nt(z,N)||Ae(z,N)}return _},$=()=>{g.value&&k.value&&h.value?e("select-date"):e("invalid-select")};return(M,_)=>(l.openBlock(),l.createElementBlock("div",{class:"dp__action_row",style:l.normalizeStyle(n.calendarWidth?{width:`${n.calendarWidth}px`}:{})},[M.$slots["action-row"]?l.renderSlot(M.$slots,"action-row",l.normalizeProps(l.mergeProps({key:0},{internalModelValue:M.internalModelValue,disabled:m.value,selectDate:()=>M.$emit("select-date"),closePicker:()=>M.$emit("close-picker")}))):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.unref(r).showPreview?(l.openBlock(),l.createElementBlock("div",{key:0,class:"dp__selection_preview",title:w.value},[M.$slots["action-preview"]?l.renderSlot(M.$slots,"action-preview",{key:0,value:M.internalModelValue}):l.createCommentVNode("",!0),M.$slots["action-preview"]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(w.value),1)],64))],8,Bv)):l.createCommentVNode("",!0),l.createElementVNode("div",Pv,[M.$slots["action-buttons"]?l.renderSlot(M.$slots,"action-buttons",{key:0,value:M.internalModelValue}):l.createCommentVNode("",!0),M.$slots["action-buttons"]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[!l.unref(s).enabled&&l.unref(r).showCancel?(l.openBlock(),l.createElementBlock("button",{key:0,type:"button",ref_key:"cancelButtonRef",ref:f,class:"dp__action_button dp__action_cancel",onClick:_[0]||(_[0]=z=>M.$emit("close-picker")),onKeydown:[_[1]||(_[1]=l.withKeys(z=>M.$emit("close-picker"),["enter"])),_[2]||(_[2]=l.withKeys(z=>M.$emit("close-picker"),["space"]))]},l.toDisplayString(M.cancelText),545)):l.createCommentVNode("",!0),l.unref(r).showNow?(l.openBlock(),l.createElementBlock("button",{key:1,type:"button",ref_key:"cancelButtonRef",ref:f,class:"dp__action_button dp__action_cancel",onClick:_[3]||(_[3]=z=>M.$emit("select-now")),onKeydown:[_[4]||(_[4]=l.withKeys(z=>M.$emit("select-now"),["enter"])),_[5]||(_[5]=l.withKeys(z=>M.$emit("select-now"),["space"]))]},l.toDisplayString(M.nowButtonLabel),545)):l.createCommentVNode("",!0),l.unref(r).showSelect?(l.openBlock(),l.createElementBlock("button",{key:2,type:"button",class:"dp__action_button dp__action_select",onKeydown:[l.withKeys($,["enter"]),l.withKeys($,["space"])],onClick:$,disabled:m.value,ref_key:"selectButtonRef",ref:p},l.toDisplayString(M.selectText),41,Iv)):l.createCommentVNode("",!0)],64))])],64))],4))}}),Vv=["onKeydown"],Lv={class:"dp__selection_grid_header"},$v=["aria-selected","aria-disabled","onClick","onKeydown","onMouseover"],Fv=["aria-label","onKeydown"],Ri=l.defineComponent({__name:"SelectionOverlay",props:{items:{},type:{},isLast:{type:Boolean},arrowNavigation:{type:Boolean},skipButtonRef:{type:Boolean},headerRefs:{},hideNavigation:{},escClose:{type:Boolean},useRelative:{type:Boolean},height:{},textInput:{type:[Boolean,Object]},config:{},noOverlayFocus:{type:Boolean}},emits:["selected","toggle","reset-flow","hover-value"],setup(n,{expose:e,emit:t}){const r=n,{setSelectionGrid:i,buildMultiLevelMatrix:o,setMonthPicker:a}=Ln(),{defaultedAriaLabels:s,defaultedTextInput:c,defaultedConfig:d}=Ye(r),{hideNavigationButtons:u}=No(),f=l.ref(!1),p=l.ref(null),h=l.ref(null),m=l.ref([]),g=l.ref(),k=l.ref(null),x=l.ref(0),S=l.ref(null);l.onBeforeUpdate(()=>{p.value=null}),l.onMounted(()=>{l.nextTick().then(()=>_()),r.noOverlayFocus||y(),T(!0)}),l.onUnmounted(()=>T(!1));const T=b=>{var C;r.arrowNavigation&&((C=r.headerRefs)!=null&&C.length?a(b):i(b))},y=()=>{var b;const C=qe(h);C&&(c.value.enabled||(p.value?(b=p.value)==null||b.focus({preventScroll:!0}):C.focus({preventScroll:!0})),f.value=C.clientHeight<C.scrollHeight)},B=l.computed(()=>({dp__overlay:!0,"dp--overlay-absolute":!r.useRelative,"dp--overlay-relative":r.useRelative})),w=l.computed(()=>r.useRelative?{height:`${r.height}px`,width:"260px"}:void 0),V=l.computed(()=>({dp__overlay_col:!0})),$=l.computed(()=>({dp__btn:!0,dp__button:!0,dp__overlay_action:!0,dp__over_action_scroll:f.value,dp__button_bottom:r.isLast})),M=l.computed(()=>{var b,C;return{dp__overlay_container:!0,dp__container_flex:((b=r.items)==null?void 0:b.length)<=6,dp__container_block:((C=r.items)==null?void 0:C.length)>6}}),_=()=>{l.nextTick().then(()=>{const b=qe(p),C=qe(h),v=qe(k),A=qe(S),E=v?v.getBoundingClientRect().height:0;C&&(C.getBoundingClientRect().height?x.value=C.getBoundingClientRect().height-E:x.value=d.value.modeHeight-E),b&&A&&(A.scrollTop=b.offsetTop-A.offsetTop-(x.value/2-b.getBoundingClientRect().height)-E)})},z=b=>{b.disabled||t("selected",b.value)},N=()=>{t("toggle"),t("reset-flow")},W=()=>{r.escClose&&N()},F=(b,C,v,A)=>{b&&(C.active&&(p.value=b),r.arrowNavigation&&(Array.isArray(m.value[v])?m.value[v][A]=b:m.value[v]=[b],O()))},O=()=>{var b,C;const v=(b=r.headerRefs)!=null&&b.length?[r.headerRefs].concat(m.value):m.value.concat([r.skipButtonRef?[]:[k.value]]);o(Je(v),(C=r.headerRefs)!=null&&C.length?"monthPicker":"selectionGrid")},I=b=>{r.arrowNavigation||In(b,d.value,!0)},H=b=>{g.value=b,t("hover-value",b)};return e({focusGrid:y}),(b,C)=>{var v;return l.openBlock(),l.createElementBlock("div",{ref_key:"gridWrapRef",ref:h,class:l.normalizeClass(B.value),style:l.normalizeStyle(w.value),role:"dialog",tabindex:"0",onKeydown:[l.withKeys(l.withModifiers(W,["prevent"]),["esc"]),C[0]||(C[0]=l.withKeys(l.withModifiers(A=>I(A),["prevent"]),["left"])),C[1]||(C[1]=l.withKeys(l.withModifiers(A=>I(A),["prevent"]),["up"])),C[2]||(C[2]=l.withKeys(l.withModifiers(A=>I(A),["prevent"]),["down"])),C[3]||(C[3]=l.withKeys(l.withModifiers(A=>I(A),["prevent"]),["right"]))]},[l.createElementVNode("div",{class:l.normalizeClass(M.value),ref_key:"containerRef",ref:S,role:"grid",style:l.normalizeStyle({height:`${x.value}px`})},[l.createElementVNode("div",Lv,[l.renderSlot(b.$slots,"header")]),b.$slots.overlay?l.renderSlot(b.$slots,"overlay",{key:0}):(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:1},l.renderList(b.items,(A,E)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["dp__overlay_row",{dp__flex_row:b.items.length>=3}]),key:E,role:"row"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(A,(P,q)=>(l.openBlock(),l.createElementBlock("div",{role:"gridcell",class:l.normalizeClass(V.value),key:P.value,"aria-selected":P.active,"aria-disabled":P.disabled||void 0,ref_for:!0,ref:D=>F(D,P,E,q),tabindex:"0",onClick:D=>z(P),onKeydown:[l.withKeys(l.withModifiers(D=>z(P),["prevent"]),["enter"]),l.withKeys(l.withModifiers(D=>z(P),["prevent"]),["space"])],onMouseover:D=>H(P.value)},[l.createElementVNode("div",{class:l.normalizeClass(P.className)},[b.$slots.item?l.renderSlot(b.$slots,"item",{key:0,item:P}):l.createCommentVNode("",!0),b.$slots.item?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(P.text),1)],64))],2)],42,$v))),128))],2))),128))],6),b.$slots["button-icon"]?l.withDirectives((l.openBlock(),l.createElementBlock("button",{key:0,type:"button","aria-label":(v=l.unref(s))==null?void 0:v.toggleOverlay,class:l.normalizeClass($.value),tabindex:"0",ref_key:"toggleButton",ref:k,onClick:N,onKeydown:[l.withKeys(N,["enter"]),l.withKeys(N,["tab"])]},[l.renderSlot(b.$slots,"button-icon")],42,Fv)),[[l.vShow,!l.unref(u)(b.hideNavigation,b.type)]]):l.createCommentVNode("",!0)],46,Vv)}}}),Bo=l.defineComponent({__name:"InstanceWrap",props:{multiCalendars:{},stretch:{type:Boolean}},setup(n){const e=n,t=l.computed(()=>e.multiCalendars>0?[...Array(e.multiCalendars).keys()]:[0]),r=l.computed(()=>({dp__instance_calendar:e.multiCalendars>0}));return(i,o)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass({dp__menu_inner:!i.stretch,"dp--menu--inner-stretched":i.stretch,dp__flex_display:i.multiCalendars>0})},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.value,(a,s)=>(l.openBlock(),l.createElementBlock("div",{key:a,class:l.normalizeClass(r.value)},[l.renderSlot(i.$slots,"default",{instance:a,index:s})],2))),128))],2))}}),zv=["aria-label","aria-disabled"],Vi=l.defineComponent({compatConfig:{MODE:3},__name:"ArrowBtn",props:{ariaLabel:{},disabled:{type:Boolean}},emits:["activate","set-ref"],setup(n,{emit:e}){const t=l.ref(null);return l.onMounted(()=>e("set-ref",t)),(r,i)=>(l.openBlock(),l.createElementBlock("button",{type:"button",class:"dp__btn dp--arrow-btn-nav",onClick:i[0]||(i[0]=o=>r.$emit("activate")),onKeydown:[i[1]||(i[1]=l.withKeys(l.withModifiers(o=>r.$emit("activate"),["prevent"]),["enter"])),i[2]||(i[2]=l.withKeys(l.withModifiers(o=>r.$emit("activate"),["prevent"]),["space"]))],tabindex:"0","aria-label":r.ariaLabel,"aria-disabled":r.disabled||void 0,ref_key:"elRef",ref:t},[l.createElementVNode("span",{class:l.normalizeClass(["dp__inner_nav",{dp__inner_nav_disabled:r.disabled}])},[l.renderSlot(r.$slots,"default")],2)],40,zv))}}),Hv={class:"dp--year-mode-picker"},Yv=["aria-label"],Ed=l.defineComponent({__name:"YearModePicker",props:{...Gt,showYearPicker:{type:Boolean,default:!1},items:{type:Array,default:()=>[]},instance:{type:Number,default:0},year:{type:Number,default:0},isDisabled:{type:Function,default:()=>!1}},emits:["toggle-year-picker","year-select","handle-year"],setup(n,{emit:e}){const t=n,{showRightIcon:r,showLeftIcon:i}=No(),{defaultedConfig:o,defaultedMultiCalendars:a,defaultedAriaLabels:s,defaultedTransitions:c}=Ye(t),{showTransition:d,transitionName:u}=Pi(c),f=(m=!1,g)=>{e("toggle-year-picker",{flow:m,show:g})},p=m=>{e("year-select",m)},h=(m=!1)=>{e("handle-year",m)};return(m,g)=>{var k,x,S;return l.openBlock(),l.createElementBlock("div",Hv,[l.unref(i)(l.unref(a),n.instance)?(l.openBlock(),l.createBlock(Vi,{key:0,ref:"mpPrevIconRef","aria-label":(k=l.unref(s))==null?void 0:k.prevYear,disabled:n.isDisabled(!1),onActivate:g[0]||(g[0]=T=>h(!1))},{default:l.withCtx(()=>[m.$slots["arrow-left"]?l.renderSlot(m.$slots,"arrow-left",{key:0}):l.createCommentVNode("",!0),m.$slots["arrow-left"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Wa),{key:1}))]),_:3},8,["aria-label","disabled"])):l.createCommentVNode("",!0),l.createElementVNode("button",{class:"dp__btn dp--year-select",type:"button",ref:"mpYearButtonRef","aria-label":(x=l.unref(s))==null?void 0:x.openYearsOverlay,onClick:g[1]||(g[1]=()=>f(!1)),onKeydown:g[2]||(g[2]=l.withKeys(()=>f(!1),["enter"]))},[m.$slots.year?l.renderSlot(m.$slots,"year",{key:0,year:n.year}):l.createCommentVNode("",!0),m.$slots.year?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(n.year),1)],64))],40,Yv),l.unref(r)(l.unref(a),n.instance)?(l.openBlock(),l.createBlock(Vi,{key:1,ref:"mpNextIconRef","aria-label":(S=l.unref(s))==null?void 0:S.nextYear,disabled:n.isDisabled(!0),onActivate:g[3]||(g[3]=T=>h(!0))},{default:l.withCtx(()=>[m.$slots["arrow-right"]?l.renderSlot(m.$slots,"arrow-right",{key:0}):l.createCommentVNode("",!0),m.$slots["arrow-right"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(qa),{key:1}))]),_:3},8,["aria-label","disabled"])):l.createCommentVNode("",!0),l.createVNode(l.Transition,{name:l.unref(u)(n.showYearPicker),css:l.unref(d)},{default:l.withCtx(()=>[n.showYearPicker?(l.openBlock(),l.createBlock(Ri,{key:0,items:n.items,"text-input":m.textInput,"esc-close":m.escClose,config:m.config,onToggle:f,onSelected:g[4]||(g[4]=T=>p(T)),"is-last":m.autoApply&&!l.unref(o).keepActionRow,type:"year"},l.createSlots({"button-icon":l.withCtx(()=>[m.$slots["calendar-icon"]?l.renderSlot(m.$slots,"calendar-icon",{key:0}):l.createCommentVNode("",!0),m.$slots["calendar-icon"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Ni),{key:1}))]),_:2},[m.$slots["year-overlay-value"]?{name:"item",fn:l.withCtx(({item:T})=>[l.renderSlot(m.$slots,"year-overlay-value",{text:T.text,value:T.value})]),key:"0"}:void 0]),1032,["items","text-input","esc-close","config","is-last"])):l.createCommentVNode("",!0)]),_:3},8,["name","css"])])}}}),Po=(n,e,t)=>{if(e.value&&Array.isArray(e.value))if(e.value.some(r=>Ae(n,r))){const r=e.value.filter(i=>!Ae(i,n));e.value=r.length?r:null}else(t&&+t>e.value.length||!t)&&e.value.push(n);else e.value=[n]},ws=(n,e,t)=>{let r=n.value?n.value.slice():[];return r.length===2&&r[1]!==null&&(r=[]),r.length?nt(e,r[0])?(r.unshift(e),t("range-start",r[0]),t("range-start",r[1])):(r[1]=e,t("range-end",e)):(r=[e],t("range-start",e)),n.value=r,r},Io=(n,e,t,r)=>{n[0]&&n[1]&&t&&e("auto-apply"),n[0]&&!n[1]&&r&&t&&e("auto-apply")},Od=({multiCalendars:n,calendars:e,modelValue:t,props:r,year:i,month:o,emit:a})=>{const s=l.computed(()=>us(r.yearRange,r.reverseYears)),c=l.ref([!1]),d=l.computed(()=>(T,y)=>{const B=Be(qt(new Date),{month:o.value(T),year:i.value(T)});return Cd(B,r.maxDate,r.minDate,r.preventMinMaxNavigation,y)}),u=()=>{for(let T=0;T<n.value.count;T++)if(T===0)e.value[T]=e.value[0];else{const y=Be(G(),e.value[T-1]);e.value[T]={month:Ce(y),year:Me(Ba(y,1))}}},f=T=>{if(!T)return u();const y=Be(G(),e.value[T]);return e.value[0].year=Me(Xc(y,n.value.count-1)),u()},p=T=>r.focusStartDate?T[0]:T[1]?T[1]:T[0],h=()=>{if(t.value){const T=Array.isArray(t.value)?p(t.value):t.value;e.value[0]={month:Ce(T),year:Me(T)}}};l.onMounted(()=>{h(),n.value.count&&u()});const m=(T,y)=>{e.value[y].year=T,n.value.count&&!n.value.solo&&f(y)},g=l.computed(()=>T=>Hr(s.value,y=>{const B=i.value(T)===y.value,w=_i(y.value,Yr(r.minDate),Yr(r.maxDate));return{active:B,disabled:w}})),k=(T,y)=>{m(T,y),S(y)},x=(T,y=!1)=>{if(!d.value(T,y)){const B=y?i.value(T)+1:i.value(T)-1;m(B,T)}},S=(T,y=!1,B)=>{y||a("reset-flow"),B!==void 0?c.value[T]=B:c.value[T]=!c.value[T],c.value||a("overlay-closed")};return{isDisabled:d,groupedYears:g,showYearPicker:c,selectYear:m,toggleYearPicker:S,handleYearSelect:k,handleYear:x}},Uv=(n,e)=>{const{defaultedMultiCalendars:t,defaultedAriaLabels:r,defaultedTransitions:i,defaultedConfig:o}=Ye(n),{modelValue:a,year:s,month:c,calendars:d}=Ii(n,e),u=l.computed(()=>fd(n.formatLocale,n.locale,n.monthNameFormat)),f=l.ref(null),{selectYear:p,groupedYears:h,showYearPicker:m,toggleYearPicker:g,handleYearSelect:k,handleYear:x,isDisabled:S}=Od({modelValue:a,multiCalendars:t,calendars:d,year:s,month:c,props:n,emit:e}),T=I=>I?{month:Ce(I),year:Me(I)}:{month:null,year:null},y=()=>a.value?Array.isArray(a.value)?a.value.map(I=>T(I)):T(a.value):T(),B=(I,H)=>{const b=d.value[I],C=y();return Array.isArray(C)?C.some(v=>v.year===(b==null?void 0:b.year)&&v.month===H):(b==null?void 0:b.year)===C.year&&H===C.month},w=(I,H,b)=>{var C,v;const A=y();return Array.isArray(A)?s.value(H)===((C=A[b])==null?void 0:C.year)&&I===((v=A[b])==null?void 0:v.month):!1},V=(I,H)=>{if(n.range){const b=y();if(Array.isArray(a.value)&&Array.isArray(b)){const C=w(I,H,0)||w(I,H,1),v=Mn(qt(G()),I,s.value(H));return Do(a.value,f.value,v)&&!C}return!1}return!1},$=l.computed(()=>I=>Hr(u.value,H=>{const b=B(I,H.value),C=_i(H.value,yd(s.value(I),n.minDate),vd(s.value(I),n.maxDate))||fv(n.disabledDates,s.value(I)).includes(H.value),v=V(H.value,I);return{active:b,disabled:C,isBetween:v}})),M=(I,H)=>Mn(qt(G()),I,s.value(H)),_=(I,H)=>{const b=a.value?a.value:qt(new Date);a.value=Mn(b,I,s.value(H)),e("auto-apply")},z=(I,H)=>{const b=ws(a,M(I,H),e);Io(b,e,n.autoApply,n.modelAuto)},N=(I,H)=>{Po(M(I,H),a,n.multiDatesLimit),e("auto-apply",!0)},W=(I,H)=>(d.value[H].month=I,O(H,d.value[H].year,I),n.multiDates?N(I,H):n.range?z(I,H):_(I,H)),F=(I,H)=>{p(I,H),O(H,I,null)},O=(I,H,b)=>{let C=b;if(!C){const v=y();C=Array.isArray(v)?v[I].month:v.month}e("update-month-year",{instance:I,year:H,month:C})};return{groupedMonths:$,groupedYears:h,year:s,isDisabled:S,defaultedMultiCalendars:t,defaultedAriaLabels:r,defaultedTransitions:i,defaultedConfig:o,showYearPicker:m,modelValue:a,setHoverDate:(I,H)=>{f.value=M(I,H)},selectMonth:W,selectYear:F,toggleYearPicker:g,handleYearSelect:k,handleYear:x,getModelMonthYear:y}},jv=l.defineComponent({compatConfig:{MODE:3},__name:"MonthPicker",props:{...Gt},emits:["update:internal-model-value","overlay-closed","reset-flow","range-start","range-end","auto-apply","update-month-year"],setup(n,{expose:e,emit:t}){const r=n,i=l.useSlots(),o=At(i,"yearMode"),{groupedMonths:a,groupedYears:s,year:c,isDisabled:d,defaultedMultiCalendars:u,defaultedConfig:f,showYearPicker:p,modelValue:h,setHoverDate:m,selectMonth:g,selectYear:k,toggleYearPicker:x,handleYearSelect:S,handleYear:T,getModelMonthYear:y}=Uv(r,t);return e({getSidebarProps:()=>({modelValue:h,year:c,getModelMonthYear:y,selectMonth:g,selectYear:k,handleYear:T})}),(B,w)=>(l.openBlock(),l.createBlock(Bo,{"multi-calendars":l.unref(u).count,stretch:""},{default:l.withCtx(({instance:V})=>[B.$slots["month-year"]?l.renderSlot(B.$slots,"month-year",l.normalizeProps(l.mergeProps({key:0},{year:l.unref(c),months:l.unref(a)(V),years:l.unref(s)(V),selectMonth:l.unref(g),selectYear:l.unref(k),instance:V}))):(l.openBlock(),l.createBlock(Ri,{key:1,items:l.unref(a)(V),"arrow-navigation":B.arrowNavigation,"is-last":B.autoApply&&!l.unref(f).keepActionRow,"esc-close":B.escClose,height:l.unref(f).modeHeight,config:B.config,"no-overlay-focus":B.noOverlayFocus,onSelected:$=>l.unref(g)($,V),onHoverValue:$=>l.unref(m)($,V),"use-relative":"",type:"month"},{header:l.withCtx(()=>[l.createVNode(Ed,l.mergeProps(B.$props,{items:l.unref(s)(V),instance:V,"show-year-picker":l.unref(p)[V],year:l.unref(c)(V),"is-disabled":$=>l.unref(d)(V,$),onHandleYear:$=>l.unref(T)(V,$),onYearSelect:$=>l.unref(S)($,V),onToggleYearPicker:$=>l.unref(x)(V,$==null?void 0:$.flow,$==null?void 0:$.show)}),l.createSlots({_:2},[l.renderList(l.unref(o),($,M)=>({name:$,fn:l.withCtx(_=>[l.renderSlot(B.$slots,$,l.normalizeProps(l.guardReactiveProps(_)))])}))]),1040,["items","instance","show-year-picker","year","is-disabled","onHandleYear","onYearSelect","onToggleYearPicker"])]),_:2},1032,["items","arrow-navigation","is-last","esc-close","height","config","no-overlay-focus","onSelected","onHoverValue"]))]),_:3},8,["multi-calendars"]))}}),Wv=(n,e)=>{const{modelValue:t}=Ii(n,e),r=l.ref(null),i=c=>Array.isArray(t.value)?t.value.some(d=>Me(d)===c):t.value?Me(t.value)===c:!1,o=c=>n.range&&Array.isArray(t.value)?Do(t.value,r.value,s(c)):!1,a=l.computed(()=>Hr(us(n.yearRange,n.reverseYears),c=>{const d=i(c.value),u=_i(c.value,Yr(n.minDate),Yr(n.maxDate)),f=o(c.value);return{active:d,disabled:u,isBetween:f}})),s=c=>ur(qt(new Date),c);return{groupedYears:a,modelValue:t,setHoverValue:c=>{r.value=ur(qt(new Date),c)},selectYear:c=>{if(n.multiDates)return Po(s(c),t,n.multiDatesLimit),e("auto-apply",!0);if(n.range){const d=ws(t,s(c),e);return Io(d,e,n.autoApply,n.modelAuto)}t.value=s(c),e("auto-apply")}}},qv=l.defineComponent({compatConfig:{MODE:3},__name:"YearPicker",props:{...Gt},emits:["update:internal-model-value","reset-flow","range-start","range-end","auto-apply"],setup(n,{expose:e,emit:t}){const r=n,{groupedYears:i,modelValue:o,selectYear:a,setHoverValue:s}=Wv(r,t),{defaultedConfig:c}=Ye(r);return e({getSidebarProps:()=>({modelValue:o,selectYear:a})}),(d,u)=>(l.openBlock(),l.createElementBlock("div",null,[d.$slots["month-year"]?l.renderSlot(d.$slots,"month-year",l.normalizeProps(l.mergeProps({key:0},{years:l.unref(i),selectYear:l.unref(a)}))):(l.openBlock(),l.createBlock(Ri,{key:1,items:l.unref(i),"is-last":d.autoApply&&!l.unref(c).keepActionRow,height:l.unref(c).modeHeight,config:d.config,"no-overlay-focus":d.noOverlayFocus,type:"year","use-relative":"",onSelected:l.unref(a),onHoverValue:l.unref(s)},l.createSlots({_:2},[d.$slots["year-overlay-value"]?{name:"item",fn:l.withCtx(({item:f})=>[l.renderSlot(d.$slots,"year-overlay-value",{text:f.text,value:f.value})]),key:"0"}:void 0]),1032,["items","is-last","height","config","no-overlay-focus","onSelected","onHoverValue"]))]))}}),Kv={key:0,class:"dp__time_input"},Gv=["aria-label","onKeydown","onClick"],Qv=l.createElementVNode("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_l"},null,-1),Jv=l.createElementVNode("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_r"},null,-1),Xv=["aria-label","disabled","onKeydown","onClick"],Zv=["aria-label","onKeydown","onClick"],eb=l.createElementVNode("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_l"},null,-1),tb=l.createElementVNode("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_r"},null,-1),nb={key:0},rb=["aria-label","onKeydown"],ib=l.defineComponent({compatConfig:{MODE:3},__name:"TimeInput",props:{hours:{type:Number,default:0},minutes:{type:Number,default:0},seconds:{type:Number,default:0},closeTimePickerBtn:{type:Object,default:null},order:{type:Number,default:0},disabledTimesConfig:{type:Function,default:null},validateTime:{type:Function,default:()=>!1},...Gt},emits:["set-hours","set-minutes","update:hours","update:minutes","update:seconds","reset-flow","mounted","overlay-closed","am-pm-change"],setup(n,{expose:e,emit:t}){const r=n,{setTimePickerElements:i,setTimePickerBackRef:o}=Ln(),{defaultedAriaLabels:a,defaultedTransitions:s,defaultedFilters:c,defaultedConfig:d}=Ye(r),{transitionName:u,showTransition:f}=Pi(s),p=l.reactive({hours:!1,minutes:!1,seconds:!1}),h=l.ref("AM"),m=l.ref(null),g=l.ref([]);l.onMounted(()=>{t("mounted")});const k=D=>Be(new Date,{hours:D.hours,minutes:D.minutes,seconds:r.enableSeconds?D.seconds:0,milliseconds:0}),x=l.computed(()=>D=>W(D,r[D])||T(D,r[D])),S=l.computed(()=>({hours:r.hours,minutes:r.minutes,seconds:r.seconds})),T=(D,X)=>r.range&&!r.disableTimeRangeValidation?!r.validateTime(D,X):!1,y=(D,X)=>{if(r.range&&!r.disableTimeRangeValidation){const ne=X?+r[`${D}Increment`]:-+r[`${D}Increment`],Y=r[D]+ne;return!r.validateTime(D,Y)}return!1},B=l.computed(()=>D=>!O(+r[D]+ +r[`${D}Increment`],D)||y(D,!0)),w=l.computed(()=>D=>!O(+r[D]-+r[`${D}Increment`],D)||y(D,!1)),V=(D,X)=>xc(Be(G(),D),X),$=(D,X)=>D0(Be(G(),D),X),M=l.computed(()=>({dp__time_col:!0,dp__time_col_block:!r.timePickerInline,dp__time_col_reg_block:!r.enableSeconds&&r.is24&&!r.timePickerInline,dp__time_col_reg_inline:!r.enableSeconds&&r.is24&&r.timePickerInline,dp__time_col_reg_with_button:!r.enableSeconds&&!r.is24,dp__time_col_sec:r.enableSeconds&&r.is24,dp__time_col_sec_with_button:r.enableSeconds&&!r.is24})),_=l.computed(()=>{const D=[{type:"hours"},{type:"",separator:!0},{type:"minutes"}];return r.enableSeconds?D.concat([{type:"",separator:!0},{type:"seconds"}]):D}),z=l.computed(()=>_.value.filter(D=>!D.separator)),N=l.computed(()=>D=>{if(D==="hours"){const X=v(+r.hours);return{text:X<10?`0${X}`:`${X}`,value:X}}return{text:r[D]<10?`0${r[D]}`:`${r[D]}`,value:r[D]}}),W=(D,X)=>{var ne;if(!r.disabledTimesConfig)return!1;const Y=r.disabledTimesConfig(r.order,D==="hours"?X:void 0);return Y[D]?!!((ne=Y[D])!=null&&ne.includes(X)):!0},F=D=>{const X=r.is24?24:12,ne=D==="hours"?X:60,Y=+r[`${D}GridIncrement`],Z=D==="hours"&&!r.is24?Y:0,ce=[];for(let j=Z;j<ne;j+=Y)ce.push({value:j,text:j<10?`0${j}`:`${j}`});return D==="hours"&&!r.is24&&ce.push({value:0,text:"12"}),Hr(ce,j=>({active:!1,disabled:c.value.times[D].includes(j.value)||!O(j.value,D)||W(D,j.value)||T(D,j.value)}))},O=(D,X)=>{const ne=r.minTime?k(fs(r.minTime)):null,Y=r.maxTime?k(fs(r.maxTime)):null,Z=k(fs(S.value,X,D));return ne&&Y?(Ei(Z,Y)||Fr(Z,Y))&&(Ai(Z,ne)||Fr(Z,ne)):ne?Ai(Z,ne)||Fr(Z,ne):Y?Ei(Z,Y)||Fr(Z,Y):!0},I=D=>r[`no${D[0].toUpperCase()+D.slice(1)}Overlay`],H=D=>{I(D)||(p[D]=!p[D],p[D]||t("overlay-closed"))},b=D=>D==="hours"?Wt:D==="minutes"?an:$r,C=(D,X=!0)=>{const ne=X?V:$,Y=X?+r[`${D}Increment`]:-+r[`${D}Increment`];O(+r[D]+Y,D)&&t(`update:${D}`,b(D)(ne({[D]:+r[D]},{[D]:+r[`${D}Increment`]})))},v=D=>r.is24?D:(D>=12?h.value="PM":h.value="AM",nv(D)),A=()=>{h.value==="PM"?(h.value="AM",t("update:hours",r.hours-12)):(h.value="PM",t("update:hours",r.hours+12)),t("am-pm-change",h.value)},E=D=>{p[D]=!0},P=(D,X,ne)=>{if(D&&r.arrowNavigation){Array.isArray(g.value[X])?g.value[X][ne]=D:g.value[X]=[D];const Y=g.value.reduce((Z,ce)=>ce.map((j,J)=>[...Z[J]||[],ce[J]]),[]);o(r.closeTimePickerBtn),m.value&&(Y[1]=Y[1].concat(m.value)),i(Y,r.order)}},q=(D,X)=>(H(D),D==="hours"&&!r.is24?t(`update:${D}`,h.value==="PM"?X+12:X):t(`update:${D}`,X));return e({openChildCmp:E}),(D,X)=>{var ne;return D.disabled?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",Kv,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(_.value,(Y,Z)=>{var ce,j,J;return l.openBlock(),l.createElementBlock("div",{key:Z,class:l.normalizeClass(M.value)},[Y.separator?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createTextVNode(" : ")],64)):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createElementVNode("button",{type:"button",class:l.normalizeClass({dp__btn:!0,dp__inc_dec_button:!D.timePickerInline,dp__inc_dec_button_inline:D.timePickerInline,dp__tp_inline_btn_top:D.timePickerInline,dp__inc_dec_button_disabled:B.value(Y.type)}),"aria-label":(ce=l.unref(a))==null?void 0:ce.incrementValue(Y.type),tabindex:"0",onKeydown:[l.withKeys(l.withModifiers(de=>C(Y.type),["prevent"]),["enter"]),l.withKeys(l.withModifiers(de=>C(Y.type),["prevent"]),["space"])],onClick:de=>C(Y.type),ref_for:!0,ref:de=>P(de,Z,0)},[r.timePickerInline?(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[Qv,Jv],64)):(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[D.$slots["arrow-up"]?l.renderSlot(D.$slots,"arrow-up",{key:0}):l.createCommentVNode("",!0),D.$slots["arrow-up"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Ga),{key:1}))],64))],42,Gv),l.createElementVNode("button",{type:"button","aria-label":(j=l.unref(a))==null?void 0:j.openTpOverlay(Y.type),class:l.normalizeClass({dp__time_display:!0,dp__time_display_block:!D.timePickerInline,dp__time_display_inline:D.timePickerInline,"dp--time-invalid":x.value(Y.type),"dp--time-overlay-btn":!x.value(Y.type)}),disabled:I(Y.type),tabindex:"0",onKeydown:[l.withKeys(l.withModifiers(de=>H(Y.type),["prevent"]),["enter"]),l.withKeys(l.withModifiers(de=>H(Y.type),["prevent"]),["space"])],onClick:de=>H(Y.type),ref_for:!0,ref:de=>P(de,Z,1)},[D.$slots[Y.type]?l.renderSlot(D.$slots,Y.type,{key:0,text:N.value(Y.type).text,value:N.value(Y.type).value}):l.createCommentVNode("",!0),D.$slots[Y.type]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(N.value(Y.type).text),1)],64))],42,Xv),l.createElementVNode("button",{type:"button",class:l.normalizeClass({dp__btn:!0,dp__inc_dec_button:!D.timePickerInline,dp__inc_dec_button_inline:D.timePickerInline,dp__tp_inline_btn_bottom:D.timePickerInline,dp__inc_dec_button_disabled:w.value(Y.type)}),"aria-label":(J=l.unref(a))==null?void 0:J.decrementValue(Y.type),tabindex:"0",onKeydown:[l.withKeys(l.withModifiers(de=>C(Y.type,!1),["prevent"]),["enter"]),l.withKeys(l.withModifiers(de=>C(Y.type,!1),["prevent"]),["space"])],onClick:de=>C(Y.type,!1),ref_for:!0,ref:de=>P(de,Z,2)},[r.timePickerInline?(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[eb,tb],64)):(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[D.$slots["arrow-down"]?l.renderSlot(D.$slots,"arrow-down",{key:0}):l.createCommentVNode("",!0),D.$slots["arrow-down"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Qa),{key:1}))],64))],42,Zv)],64))],2)}),128)),D.is24?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",nb,[D.$slots["am-pm-button"]?l.renderSlot(D.$slots,"am-pm-button",{key:0,toggle:A,value:h.value}):l.createCommentVNode("",!0),D.$slots["am-pm-button"]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("button",{key:1,ref_key:"amPmButton",ref:m,type:"button",class:"dp__pm_am_button",role:"button","aria-label":(ne=l.unref(a))==null?void 0:ne.amPmButton,tabindex:"0",onClick:A,onKeydown:[l.withKeys(l.withModifiers(A,["prevent"]),["enter"]),l.withKeys(l.withModifiers(A,["prevent"]),["space"])]},l.toDisplayString(h.value),41,rb))])),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(z.value,(Y,Z)=>(l.openBlock(),l.createBlock(l.Transition,{key:Z,name:l.unref(u)(p[Y.type]),css:l.unref(f)},{default:l.withCtx(()=>[p[Y.type]?(l.openBlock(),l.createBlock(Ri,{key:0,items:F(Y.type),"is-last":D.autoApply&&!l.unref(d).keepActionRow,"esc-close":D.escClose,type:Y.type,"text-input":D.textInput,config:D.config,"arrow-navigation":D.arrowNavigation,onSelected:ce=>q(Y.type,ce),onToggle:ce=>H(Y.type),onResetFlow:X[0]||(X[0]=ce=>D.$emit("reset-flow"))},l.createSlots({"button-icon":l.withCtx(()=>[D.$slots["clock-icon"]?l.renderSlot(D.$slots,"clock-icon",{key:0}):l.createCommentVNode("",!0),D.$slots["clock-icon"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Ka),{key:1}))]),_:2},[D.$slots[`${Y.type}-overlay-value`]?{name:"item",fn:l.withCtx(({item:ce})=>[l.renderSlot(D.$slots,`${Y.type}-overlay-value`,{text:ce.text,value:ce.value})]),key:"0"}:void 0]),1032,["items","is-last","esc-close","type","text-input","config","arrow-navigation","onSelected","onToggle"])):l.createCommentVNode("",!0)]),_:2},1032,["name","css"]))),128))]))}}}),ob={class:"dp--tp-wrap"},ab=["aria-label","tabindex"],sb=["tabindex"],lb=["aria-label"],Nd=l.defineComponent({compatConfig:{MODE:3},__name:"TimePicker",props:{hours:{type:[Number,Array],default:0},minutes:{type:[Number,Array],default:0},seconds:{type:[Number,Array],default:0},disabledTimesConfig:{type:Function,default:null},validateTime:{type:Function,default:()=>!1},...Gt},emits:["update:hours","update:minutes","update:seconds","mount","reset-flow","overlay-opened","overlay-closed","am-pm-change"],setup(n,{expose:e,emit:t}){const r=n,{buildMatrix:i,setTimePicker:o}=Ln(),a=l.useSlots(),{defaultedTransitions:s,defaultedAriaLabels:c,defaultedTextInput:d,defaultedConfig:u}=Ye(r),{transitionName:f,showTransition:p}=Pi(s),{hideNavigationButtons:h}=No(),m=l.ref(null),g=l.ref(null),k=l.ref([]),x=l.ref(null);l.onMounted(()=>{t("mount"),!r.timePicker&&r.arrowNavigation?i([qe(m.value)],"time"):o(!0,r.timePicker)});const S=l.computed(()=>r.range&&r.modelAuto?pd(r.internalModelValue):!0),T=l.ref(!1),y=F=>({hours:Array.isArray(r.hours)?r.hours[F]:r.hours,minutes:Array.isArray(r.minutes)?r.minutes[F]:r.minutes,seconds:Array.isArray(r.seconds)?r.seconds[F]:r.seconds}),B=l.computed(()=>{const F=[];if(r.range)for(let O=0;O<2;O++)F.push(y(O));else F.push(y(0));return F}),w=(F,O=!1,I="")=>{O||t("reset-flow"),T.value=F,t(F?"overlay-opened":"overlay-closed"),r.arrowNavigation&&o(F),l.nextTick(()=>{I!==""&&k.value[0]&&k.value[0].openChildCmp(I)})},V=l.computed(()=>({dp__btn:!0,dp__button:!0,dp__button_bottom:r.autoApply&&!u.value.keepActionRow})),$=At(a,"timePicker"),M=(F,O,I)=>r.range?O===0?[F,B.value[1][I]]:[B.value[0][I],F]:F,_=F=>{t("update:hours",F)},z=F=>{t("update:minutes",F)},N=F=>{t("update:seconds",F)},W=()=>{if(x.value&&!d.value.enabled&&!r.noOverlayFocus){const F=iv(x.value);F&&F.focus({preventScroll:!0})}};return e({toggleTimePicker:w}),(F,O)=>{var I;return l.openBlock(),l.createElementBlock("div",ob,[!F.timePicker&&!F.timePickerInline?l.withDirectives((l.openBlock(),l.createElementBlock("button",{key:0,type:"button",class:l.normalizeClass(V.value),"aria-label":(I=l.unref(c))==null?void 0:I.openTimePicker,tabindex:F.noOverlayFocus?void 0:0,ref_key:"openTimePickerBtn",ref:m,onKeydown:[O[0]||(O[0]=l.withKeys(H=>w(!0),["enter"])),O[1]||(O[1]=l.withKeys(H=>w(!0),["space"]))],onClick:O[2]||(O[2]=H=>w(!0))},[F.$slots["clock-icon"]?l.renderSlot(F.$slots,"clock-icon",{key:0}):l.createCommentVNode("",!0),F.$slots["clock-icon"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Ka),{key:1}))],42,ab)),[[l.vShow,!l.unref(h)(F.hideNavigation,"time")]]):l.createCommentVNode("",!0),l.createVNode(l.Transition,{name:l.unref(f)(T.value),css:l.unref(p)&&!F.timePickerInline},{default:l.withCtx(()=>{var H;return[T.value||F.timePicker||F.timePickerInline?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass({dp__overlay:!F.timePickerInline,"dp--overlay-absolute":!r.timePicker&&!F.timePickerInline,"dp--overlay-relative":r.timePicker}),style:l.normalizeStyle(F.timePicker?{height:`${l.unref(u).modeHeight}px`}:void 0),ref_key:"overlayRef",ref:x,tabindex:F.timePickerInline?void 0:0},[l.createElementVNode("div",{class:l.normalizeClass(F.timePickerInline?"dp__time_picker_inline_container":"dp__overlay_container dp__container_flex dp__time_picker_overlay_container"),style:{display:"flex"}},[F.$slots["time-picker-overlay"]?l.renderSlot(F.$slots,"time-picker-overlay",{key:0,hours:n.hours,minutes:n.minutes,seconds:n.seconds,setHours:_,setMinutes:z,setSeconds:N}):l.createCommentVNode("",!0),F.$slots["time-picker-overlay"]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(F.timePickerInline?"dp__flex":"dp__overlay_row dp__flex_row")},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(B.value,(b,C)=>l.withDirectives((l.openBlock(),l.createBlock(ib,l.mergeProps({key:C},{...F.$props,order:C,hours:b.hours,minutes:b.minutes,seconds:b.seconds,closeTimePickerBtn:g.value,disabledTimesConfig:n.disabledTimesConfig,disabled:C===0?F.fixedStart:F.fixedEnd},{"validate-time":(v,A)=>n.validateTime(v,M(A,C,v)),ref_for:!0,ref_key:"timeInputRefs",ref:k,"onUpdate:hours":v=>_(M(v,C,"hours")),"onUpdate:minutes":v=>z(M(v,C,"minutes")),"onUpdate:seconds":v=>N(M(v,C,"seconds")),onMounted:W,onOverlayClosed:W,onAmPmChange:O[3]||(O[3]=v=>F.$emit("am-pm-change",v))}),l.createSlots({_:2},[l.renderList(l.unref($),(v,A)=>({name:v,fn:l.withCtx(E=>[l.renderSlot(F.$slots,v,l.normalizeProps(l.guardReactiveProps(E)))])}))]),1040,["validate-time","onUpdate:hours","onUpdate:minutes","onUpdate:seconds"])),[[l.vShow,C===0?!0:S.value]])),128))],2)),!F.timePicker&&!F.timePickerInline?l.withDirectives((l.openBlock(),l.createElementBlock("button",{key:2,type:"button",ref_key:"closeTimePickerBtn",ref:g,class:l.normalizeClass(V.value),"aria-label":(H=l.unref(c))==null?void 0:H.closeTimePicker,tabindex:"0",onKeydown:[O[4]||(O[4]=l.withKeys(b=>w(!1),["enter"])),O[5]||(O[5]=l.withKeys(b=>w(!1),["space"]))],onClick:O[6]||(O[6]=b=>w(!1))},[F.$slots["calendar-icon"]?l.renderSlot(F.$slots,"calendar-icon",{key:0}):l.createCommentVNode("",!0),F.$slots["calendar-icon"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Ni),{key:1}))],42,lb)),[[l.vShow,!l.unref(h)(F.hideNavigation,"time")]]):l.createCommentVNode("",!0)],2)],14,sb)):l.createCommentVNode("",!0)]}),_:3},8,["name","css"])])}}}),_d=(n,e,t,r)=>{const i=(x,S)=>Array.isArray(e[x])?e[x][S]:e[x],o=x=>n.enableSeconds?Array.isArray(e.seconds)?e.seconds[x]:e.seconds:0,a=(x,S)=>x?S!==void 0?Rn(x,i("hours",S),i("minutes",S),o(S)):Rn(x,e.hours,e.minutes,o()):ja(G(),o(S)),s=(x,S)=>{e[x]=S},c=(x,S)=>{const T=Object.fromEntries(Object.keys(e).map(y=>y===x?[y,S]:[y,e[y]].slice()));if(n.range&&!n.disableTimeRangeValidation){const y=w=>t.value?Rn(t.value[w],T.hours[w],T.minutes[w],T.seconds[w]):null,B=w=>Ua(t.value[w],0);return!(Ae(y(0),y(1))&&(Ai(y(0),B(1))||Ei(y(1),B(0))))}return!0},d=(x,S)=>{c(x,S)&&(s(x,S),r&&r())},u=x=>{d("hours",x)},f=x=>{d("minutes",x)},p=x=>{d("seconds",x)},h=(x,S,T,y)=>{S&&u(x),!S&&!T&&f(x),T&&p(x),t.value&&y(t.value)},m=x=>{if(x){const S=Array.isArray(x),T=S?[+x[0].hours,+x[1].hours]:+x.hours,y=S?[+x[0].minutes,+x[1].minutes]:+x.minutes,B=S?[+x[0].seconds,+x[1].seconds]:+x.seconds;s("hours",T),s("minutes",y),n.enableSeconds&&s("seconds",B)}},g=(x,S)=>{const T={hours:Array.isArray(e.hours)?e.hours[x]:e.hours,disabledArr:[]};return(S||S===0)&&(T.hours=S),Array.isArray(n.disabledTimes)&&(T.disabledArr=n.range&&Array.isArray(n.disabledTimes[x])?n.disabledTimes[x]:n.disabledTimes),T},k=l.computed(()=>(x,S)=>{var T;if(Array.isArray(n.disabledTimes)){const{disabledArr:y,hours:B}=g(x,S),w=y.filter(V=>+V.hours===B);return((T=w[0])==null?void 0:T.minutes)==="*"?{hours:[B],minutes:void 0,seconds:void 0}:{hours:[],minutes:(w==null?void 0:w.map(V=>+V.minutes))??[],seconds:(w==null?void 0:w.map(V=>V.seconds?+V.seconds:void 0))??[]}}return{hours:[],minutes:[],seconds:[]}});return{setTime:s,updateHours:u,updateMinutes:f,updateSeconds:p,getSetDateTime:a,updateTimeValues:h,getSecondsValue:o,assignStartTime:m,validateTime:c,disabledTimesConfig:k}},cb=(n,e)=>{const{modelValue:t,time:r}=Ii(n,e),{defaultedStartTime:i}=Ye(n),{updateTimeValues:o,getSetDateTime:a,setTime:s,assignStartTime:c,disabledTimesConfig:d,validateTime:u}=_d(n,r,t),f=S=>{const{hours:T,minutes:y,seconds:B}=S;return{hours:+T,minutes:+y,seconds:B?+B:0}},p=()=>{if(n.startTime){if(Array.isArray(n.startTime)){const T=f(n.startTime[0]),y=f(n.startTime[1]);return[Be(G(),T),Be(G(),y)]}const S=f(n.startTime);return Be(G(),S)}return n.range?[null,null]:null},h=()=>{if(n.range){const[S,T]=p();t.value=[a(S,0),a(T,1)]}else t.value=a(p())},m=S=>Array.isArray(S)?[fr(G(S[0])),fr(G(S[1]))]:[fr(S??G())],g=(S,T,y)=>{s("hours",S),s("minutes",T),s("seconds",n.enableSeconds?y:0)},k=()=>{const[S,T]=m(t.value);return n.range?g([S.hours,T.hours],[S.minutes,T.minutes],[S.seconds,T.minutes]):g(S.hours,S.minutes,S.seconds)};l.onMounted(()=>{if(!n.shadow)return c(i.value),t.value?k():h()});const x=()=>{Array.isArray(t.value)?t.value=t.value.map((S,T)=>S&&a(S,T)):t.value=a(t.value),e("time-update")};return{modelValue:t,time:r,disabledTimesConfig:d,updateTime:(S,T=!0,y=!1)=>{o(S,T,y,x)},validateTime:u}},db=l.defineComponent({compatConfig:{MODE:3},__name:"TimePickerSolo",props:{...Gt},emits:["update:internal-model-value","time-update","am-pm-change"],setup(n,{expose:e,emit:t}){const r=n,i=l.useSlots(),o=At(i,"timePicker"),{time:a,modelValue:s,disabledTimesConfig:c,updateTime:d,validateTime:u}=cb(r,t);return e({getSidebarProps:()=>({modelValue:s,time:a,updateTime:d})}),(f,p)=>(l.openBlock(),l.createBlock(Bo,{"multi-calendars":0,stretch:""},{default:l.withCtx(()=>[l.createVNode(Nd,l.mergeProps(f.$props,{hours:l.unref(a).hours,minutes:l.unref(a).minutes,seconds:l.unref(a).seconds,"internal-model-value":f.internalModelValue,"disabled-times-config":l.unref(c),"validate-time":l.unref(u),"onUpdate:hours":p[0]||(p[0]=h=>l.unref(d)(h)),"onUpdate:minutes":p[1]||(p[1]=h=>l.unref(d)(h,!1)),"onUpdate:seconds":p[2]||(p[2]=h=>l.unref(d)(h,!1,!0)),onAmPmChange:p[3]||(p[3]=h=>f.$emit("am-pm-change",h))}),l.createSlots({_:2},[l.renderList(l.unref(o),(h,m)=>({name:h,fn:l.withCtx(g=>[l.renderSlot(f.$slots,h,l.normalizeProps(l.guardReactiveProps(g)))])}))]),1040,["hours","minutes","seconds","internal-model-value","disabled-times-config","validate-time"])]),_:3}))}}),ub={class:"dp__month_year_row"},fb=["aria-label","onClick","onKeydown"],pb=l.defineComponent({compatConfig:{MODE:3},__name:"DpHeader",props:{month:{type:Number,default:0},year:{type:Number,default:0},instance:{type:Number,default:0},years:{type:Array,default:()=>[]},months:{type:Array,default:()=>[]},...Gt},emits:["update-month-year","mount","reset-flow","overlay-closed"],setup(n,{expose:e,emit:t}){const r=n,{defaultedTransitions:i,defaultedAriaLabels:o,defaultedMultiCalendars:a,defaultedFilters:s,defaultedConfig:c}=Ye(r),{transitionName:d,showTransition:u}=Pi(i),{buildMatrix:f}=Ln(),{handleMonthYearChange:p,isDisabled:h,updateMonthYear:m}=Cv(r,t),{showLeftIcon:g,showRightIcon:k}=No(),x=l.ref(!1),S=l.ref(!1),T=l.ref([null,null,null,null]);l.onMounted(()=>{t("mount")});const y=b=>({get:()=>r[b],set:C=>{const v=b===Kt.month?Kt.year:Kt.month;t("update-month-year",{[b]:C,[v]:r[v]}),b===Kt.month?N(!0):W(!0)}}),B=l.computed(y(Kt.month)),w=l.computed(y(Kt.year)),V=l.computed(()=>b=>({month:r.month,year:r.year,items:b===Kt.month?r.months:r.years,instance:r.instance,updateMonthYear:m,toggle:b===Kt.month?N:W})),$=l.computed(()=>r.months.find(C=>C.value===r.month)||{text:"",value:0}),M=l.computed(()=>Hr(r.months,b=>{const C=r.month===b.value,v=_i(b.value,yd(r.year,r.minDate),vd(r.year,r.maxDate))||s.value.months.includes(b.value);return{active:C,disabled:v}})),_=l.computed(()=>Hr(r.years,b=>{const C=r.year===b.value,v=_i(b.value,Yr(r.minDate),Yr(r.maxDate))||s.value.years.includes(b.value);return{active:C,disabled:v}})),z=(b,C)=>{C!==void 0?b.value=C:b.value=!b.value,b.value||t("overlay-closed")},N=(b=!1,C)=>{F(b),z(x,C)},W=(b=!1,C)=>{F(b),z(S,C)},F=b=>{b||t("reset-flow")},O=(b,C)=>{r.arrowNavigation&&(T.value[C]=qe(b),f(T.value,"monthYear"))},I=l.computed(()=>{var b,C;return[{type:Kt.month,index:1,toggle:N,modelValue:B.value,updateModelValue:v=>B.value=v,text:$.value.text,showSelectionGrid:x.value,items:M.value,ariaLabel:(b=o.value)==null?void 0:b.openMonthsOverlay},{type:Kt.year,index:2,toggle:W,modelValue:w.value,updateModelValue:v=>w.value=v,text:r.year,showSelectionGrid:S.value,items:_.value,ariaLabel:(C=o.value)==null?void 0:C.openYearsOverlay}]}),H=l.computed(()=>r.disableYearSelect?[I.value[0]]:I.value);return e({toggleMonthPicker:N,toggleYearPicker:W,handleMonthYearChange:p}),(b,C)=>{var v,A,E;return l.openBlock(),l.createElementBlock("div",ub,[b.$slots["month-year"]?l.renderSlot(b.$slots,"month-year",l.normalizeProps(l.mergeProps({key:0},{month:n.month,year:n.year,months:n.months,years:n.years,updateMonthYear:l.unref(m),handleMonthYearChange:l.unref(p),instance:n.instance}))):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.unref(g)(l.unref(a),n.instance)&&!b.vertical?(l.openBlock(),l.createBlock(Vi,{key:0,"aria-label":(v=l.unref(o))==null?void 0:v.prevMonth,disabled:l.unref(h)(!1),onActivate:C[0]||(C[0]=P=>l.unref(p)(!1,!0)),onSetRef:C[1]||(C[1]=P=>O(P,0))},{default:l.withCtx(()=>[b.$slots["arrow-left"]?l.renderSlot(b.$slots,"arrow-left",{key:0}):l.createCommentVNode("",!0),b.$slots["arrow-left"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Wa),{key:1}))]),_:3},8,["aria-label","disabled"])):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass(["dp__month_year_wrap",{dp__year_disable_select:b.disableYearSelect}])},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(H.value,(P,q)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:P.type},[l.createElementVNode("button",{type:"button",class:"dp__btn dp__month_year_select",tabindex:"0","aria-label":P.ariaLabel,ref_for:!0,ref:D=>O(D,q+1),onClick:P.toggle,onKeydown:[l.withKeys(l.withModifiers(P.toggle,["prevent"]),["enter"]),l.withKeys(l.withModifiers(P.toggle,["prevent"]),["space"])]},[b.$slots[P.type]?l.renderSlot(b.$slots,P.type,{key:0,text:P.text,value:r[P.type]}):l.createCommentVNode("",!0),b.$slots[P.type]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(P.text),1)],64))],40,fb),l.createVNode(l.Transition,{name:l.unref(d)(P.showSelectionGrid),css:l.unref(u)},{default:l.withCtx(()=>[P.showSelectionGrid?(l.openBlock(),l.createBlock(Ri,{key:0,items:P.items,"arrow-navigation":b.arrowNavigation,"hide-navigation":b.hideNavigation,"is-last":b.autoApply&&!l.unref(c).keepActionRow,"skip-button-ref":!1,config:b.config,type:P.type,"header-refs":[],"esc-close":b.escClose,"text-input":b.textInput,onSelected:P.updateModelValue,onToggle:P.toggle},l.createSlots({"button-icon":l.withCtx(()=>[b.$slots["calendar-icon"]?l.renderSlot(b.$slots,"calendar-icon",{key:0}):l.createCommentVNode("",!0),b.$slots["calendar-icon"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Ni),{key:1}))]),_:2},[b.$slots[`${P.type}-overlay-value`]?{name:"item",fn:l.withCtx(({item:D})=>[l.renderSlot(b.$slots,`${P.type}-overlay-value`,{text:D.text,value:D.value})]),key:"0"}:void 0,b.$slots[`${P.type}-overlay`]?{name:"overlay",fn:l.withCtx(()=>[l.renderSlot(b.$slots,`${P.type}-overlay`,l.normalizeProps(l.guardReactiveProps(V.value(P.type))))]),key:"1"}:void 0,b.$slots[`${P.type}-overlay-header`]?{name:"header",fn:l.withCtx(()=>[l.renderSlot(b.$slots,`${P.type}-overlay-header`,{toggle:P.toggle})]),key:"2"}:void 0]),1032,["items","arrow-navigation","hide-navigation","is-last","config","type","esc-close","text-input","onSelected","onToggle"])):l.createCommentVNode("",!0)]),_:2},1032,["name","css"])],64))),128))],2),l.unref(g)(l.unref(a),n.instance)&&b.vertical?(l.openBlock(),l.createBlock(Vi,{key:1,"aria-label":(A=l.unref(o))==null?void 0:A.prevMonth,disabled:l.unref(h)(!1),onActivate:C[2]||(C[2]=P=>l.unref(p)(!1,!0))},{default:l.withCtx(()=>[b.$slots["arrow-up"]?l.renderSlot(b.$slots,"arrow-up",{key:0}):l.createCommentVNode("",!0),b.$slots["arrow-up"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Ga),{key:1}))]),_:3},8,["aria-label","disabled"])):l.createCommentVNode("",!0),l.unref(k)(l.unref(a),n.instance)?(l.openBlock(),l.createBlock(Vi,{key:2,ref:"rightIcon",disabled:l.unref(h)(!0),"aria-label":(E=l.unref(o))==null?void 0:E.nextMonth,onActivate:C[3]||(C[3]=P=>l.unref(p)(!0,!0)),onSetRef:C[4]||(C[4]=P=>O(P,b.disableYearSelect?2:3))},{default:l.withCtx(()=>[b.$slots[b.vertical?"arrow-down":"arrow-right"]?l.renderSlot(b.$slots,b.vertical?"arrow-down":"arrow-right",{key:0}):l.createCommentVNode("",!0),b.$slots[b.vertical?"arrow-down":"arrow-right"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.resolveDynamicComponent(b.vertical?l.unref(Qa):l.unref(qa)),{key:1}))]),_:3},8,["disabled","aria-label"])):l.createCommentVNode("",!0)],64))])}}}),hb=["aria-label"],mb={class:"dp__calendar_header",role:"row"},gb={key:0,class:"dp__calendar_header_item",role:"gridcell"},yb=l.createElementVNode("div",{class:"dp__calendar_header_separator"},null,-1),vb=["aria-label"],bb={key:0,role:"gridcell",class:"dp__calendar_item dp__week_num"},wb={class:"dp__cell_inner"},kb=["aria-selected","aria-disabled","aria-label","onClick","onKeydown","onMouseenter","onMouseleave"],xb=l.defineComponent({compatConfig:{MODE:3},__name:"DpCalendar",props:{mappedDates:{type:Array,default:()=>[]},instance:{type:Number,default:0},month:{type:Number,default:0},year:{type:Number,default:0},...Gt},emits:["select-date","set-hover-date","handle-scroll","mount","handle-swipe","handle-space","tooltip-open","tooltip-close"],setup(n,{expose:e,emit:t}){const r=n,{buildMultiLevelMatrix:i}=Ln(),{defaultedTransitions:o,defaultedConfig:a,defaultedAriaLabels:s,defaultedMultiCalendars:c}=Ye(r),d=l.ref(null),u=l.ref({bottom:"",left:"",transform:""}),f=l.ref([]),p=l.ref(null),h=l.ref(!0),m=l.ref(""),g=l.ref({startX:0,endX:0,startY:0,endY:0}),k=l.ref([]),x=l.ref({left:"50%"}),S=l.computed(()=>r.calendar?r.calendar(r.mappedDates):r.mappedDates),T=l.computed(()=>r.dayNames?Array.isArray(r.dayNames)?r.dayNames:r.dayNames(r.locale,+r.weekStart):tv(r.formatLocale,r.locale,+r.weekStart));l.onMounted(()=>{t("mount",{cmp:"calendar",refs:f}),a.value.noSwipe||p.value&&(p.value.addEventListener("touchstart",W,{passive:!1}),p.value.addEventListener("touchend",F,{passive:!1}),p.value.addEventListener("touchmove",O,{passive:!1})),r.monthChangeOnScroll&&p.value&&p.value.addEventListener("wheel",b,{passive:!1})});const y=E=>E?r.vertical?"vNext":"next":r.vertical?"vPrevious":"previous",B=(E,P)=>{if(r.transitions){const q=It(Mn(G(),r.month,r.year));m.value=lt(It(Mn(G(),E,P)),q)?o.value[y(!0)]:o.value[y(!1)],h.value=!1,l.nextTick(()=>{h.value=!0})}},w=l.computed(()=>({[r.calendarClassName]:!!r.calendarClassName})),V=l.computed(()=>E=>{const P=rv(E);return{dp__marker_dot:P.type==="dot",dp__marker_line:P.type==="line"}}),$=l.computed(()=>E=>Ae(E,d.value)),M=l.computed(()=>({dp__calendar:!0,dp__calendar_next:c.value.count>0&&r.instance!==0})),_=l.computed(()=>E=>r.hideOffsetDates?E.current:!0),z=async(E,P,q)=>{var D,X;if(t("set-hover-date",E),(X=(D=E.marker)==null?void 0:D.tooltip)!=null&&X.length){const ne=qe(f.value[P][q]);if(ne){const{width:Y,height:Z}=ne.getBoundingClientRect();d.value=E.value;let ce={left:`${Y/2}px`},j=-50;if(await l.nextTick(),k.value[0]){const{left:J,width:de}=k.value[0].getBoundingClientRect();J<0&&(ce={left:"0"},j=0,x.value.left=`${Y/2}px`),window.innerWidth<J+de&&(ce={right:"0"},j=0,x.value.left=`${de-Y/2}px`)}u.value={bottom:`${Z}px`,...ce,transform:`translateX(${j}%)`},t("tooltip-open",E.marker)}}},N=E=>{d.value&&(d.value=null,u.value=JSON.parse(JSON.stringify({bottom:"",left:"",transform:""})),t("tooltip-close",E.marker))},W=E=>{g.value.startX=E.changedTouches[0].screenX,g.value.startY=E.changedTouches[0].screenY},F=E=>{g.value.endX=E.changedTouches[0].screenX,g.value.endY=E.changedTouches[0].screenY,I()},O=E=>{r.vertical&&!r.inline&&E.preventDefault()},I=()=>{const E=r.vertical?"Y":"X";Math.abs(g.value[`start${E}`]-g.value[`end${E}`])>10&&t("handle-swipe",g.value[`start${E}`]>g.value[`end${E}`]?"right":"left")},H=(E,P,q)=>{E&&(Array.isArray(f.value[P])?f.value[P][q]=E:f.value[P]=[E]),r.arrowNavigation&&i(f.value,"calendar")},b=E=>{r.monthChangeOnScroll&&(E.preventDefault(),t("handle-scroll",E))},C=E=>{const P=E[0];return r.weekNumbers==="local"?py(P.value,{weekStartsOn:+r.weekStart}):r.weekNumbers==="iso"?cy(P.value):typeof r.weekNumbers=="function"?r.weekNumbers(P.value):""},v=(E,P)=>{In(E,a.value),t("select-date",P)},A=E=>{In(E,a.value)};return e({triggerTransition:B}),(E,P)=>{var q;return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(M.value)},[l.createElementVNode("div",{ref_key:"calendarWrapRef",ref:p,role:"grid",class:l.normalizeClass(w.value),"aria-label":(q=l.unref(s))==null?void 0:q.calendarWrap},[(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createElementVNode("div",mb,[E.weekNumbers?(l.openBlock(),l.createElementBlock("div",gb,l.toDisplayString(E.weekNumName),1)):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(T.value,(D,X)=>(l.openBlock(),l.createElementBlock("div",{class:"dp__calendar_header_item",role:"gridcell",key:X},[E.$slots["calendar-header"]?l.renderSlot(E.$slots,"calendar-header",{key:0,day:D,index:X}):l.createCommentVNode("",!0),E.$slots["calendar-header"]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(D),1)],64))]))),128))]),yb,l.createVNode(l.Transition,{name:m.value,css:!!E.transitions},{default:l.withCtx(()=>{var D;return[h.value?(l.openBlock(),l.createElementBlock("div",{key:0,class:"dp__calendar",role:"rowgroup","aria-label":((D=l.unref(s))==null?void 0:D.calendarDays)||void 0},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(S.value,(X,ne)=>(l.openBlock(),l.createElementBlock("div",{class:"dp__calendar_row",role:"row",key:ne},[E.weekNumbers?(l.openBlock(),l.createElementBlock("div",bb,[l.createElementVNode("div",wb,l.toDisplayString(C(X.days)),1)])):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(X.days,(Y,Z)=>{var ce,j,J;return l.openBlock(),l.createElementBlock("div",{role:"gridcell",class:"dp__calendar_item",ref_for:!0,ref:de=>H(de,ne,Z),key:Z+ne,"aria-selected":Y.classData.dp__active_date||Y.classData.dp__range_start||Y.classData.dp__range_start,"aria-disabled":Y.classData.dp__cell_disabled||void 0,"aria-label":(j=(ce=l.unref(s))==null?void 0:ce.day)==null?void 0:j.call(ce,Y),tabindex:"0",onClick:l.withModifiers(de=>v(de,Y),["prevent"]),onKeydown:[l.withKeys(de=>E.$emit("select-date",Y),["enter"]),l.withKeys(de=>E.$emit("handle-space",Y),["space"])],onMouseenter:de=>z(Y,ne,Z),onMouseleave:de=>N(Y)},[l.createElementVNode("div",{class:l.normalizeClass(["dp__cell_inner",Y.classData])},[E.$slots.day&&_.value(Y)?l.renderSlot(E.$slots,"day",{key:0,day:+Y.text,date:Y.value}):l.createCommentVNode("",!0),E.$slots.day?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(Y.text),1)],64)),Y.marker&&_.value(Y)?(l.openBlock(),l.createElementBlock(l.Fragment,{key:2},[E.$slots.marker?l.renderSlot(E.$slots,"marker",{key:0,marker:Y.marker,day:+Y.text,date:Y.value}):(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(V.value(Y.marker)),style:l.normalizeStyle(Y.marker.color?{backgroundColor:Y.marker.color}:{})},null,6))],64)):l.createCommentVNode("",!0),$.value(Y.value)?(l.openBlock(),l.createElementBlock("div",{key:3,class:"dp__marker_tooltip",ref_for:!0,ref_key:"activeTooltip",ref:k,style:l.normalizeStyle(u.value)},[(J=Y.marker)!=null&&J.tooltip?(l.openBlock(),l.createElementBlock("div",{key:0,class:"dp__tooltip_content",onClick:A},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(Y.marker.tooltip,(de,te)=>(l.openBlock(),l.createElementBlock("div",{key:te,class:"dp__tooltip_text"},[E.$slots["marker-tooltip"]?l.renderSlot(E.$slots,"marker-tooltip",{key:0,tooltip:de,day:Y.value}):l.createCommentVNode("",!0),E.$slots["marker-tooltip"]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createElementVNode("div",{class:"dp__tooltip_mark",style:l.normalizeStyle(de.color?{backgroundColor:de.color}:{})},null,4),l.createElementVNode("div",null,l.toDisplayString(de.text),1)],64))]))),128)),l.createElementVNode("div",{class:"dp__arrow_bottom_tp",style:l.normalizeStyle(x.value)},null,4)])):l.createCommentVNode("",!0)],4)):l.createCommentVNode("",!0)],2)],40,kb)}),128))]))),128))],8,vb)):l.createCommentVNode("",!0)]}),_:3},8,["name","css"])],64))],10,hb)],2)}}}),Bd=n=>Array.isArray(n),Cb=(n,e,t,r)=>{const i=l.ref([]),{modelValue:o,calendars:a,time:s}=Ii(n,e),{defaultedMultiCalendars:c,defaultedStartTime:d}=Ye(n),{validateMonthYearInRange:u,isDisabled:f,isDateRangeAllowed:p,checkMinMaxRange:h}=Wr(n),{updateTimeValues:m,getSetDateTime:g,setTime:k,assignStartTime:x,validateTime:S,disabledTimesConfig:T}=_d(n,s,o,r),y=l.computed(()=>R=>a.value[R]?a.value[R].month:0),B=l.computed(()=>R=>a.value[R]?a.value[R].year:0),w=(R,L,Q)=>{var ee,Ne;a.value[R]||(a.value[R]={month:0,year:0}),a.value[R].month=md(L)?(ee=a.value[R])==null?void 0:ee.month:L,a.value[R].year=md(Q)?(Ne=a.value[R])==null?void 0:Ne.year:Q},V=()=>{n.autoApply&&e("select-date")};l.watch(o,(R,L)=>{JSON.stringify(R)!==JSON.stringify(L)&&_()}),l.onMounted(()=>{n.shadow||(o.value||(v(),d.value&&x(d.value)),_(!0),n.focusStartDate&&n.startDate&&v())});const $=l.computed(()=>{var R;return(R=n.flow)!=null&&R.length&&!n.partialFlow?n.flowStep===n.flow.length:!0}),M=()=>{n.autoApply&&$.value&&e("auto-apply",n.partialFlow)},_=(R=!1)=>{if(o.value)return Array.isArray(o.value)?(i.value=o.value,I(R)):N(o.value,R);if(c.value.count&&R&&!n.startDate)return z(G(),R)},z=(R,L=!1)=>{if((!c.value.count||!c.value.static||L)&&w(0,Ce(R),Me(R)),c.value.count)for(let Q=1;Q<c.value.count;Q++){const ee=Be(G(),{month:y.value(Q-1),year:B.value(Q-1)}),Ne=xc(ee,{months:1});a.value[Q]={month:Ce(Ne),year:Me(Ne)}}},N=(R,L)=>{z(R),k("hours",Wt(R)),k("minutes",an(R)),k("seconds",$r(R)),c.value.count&&L&&C()},W=R=>{if(c.value.count){if(c.value.solo)return 0;const L=Ce(R[0]),Q=Ce(R[1]);return Math.abs(Q-L)<c.value.count?0:1}return 1},F=(R,L)=>{R[1]&&n.showLastInRange?z(R[W(R)],L):z(R[0],L);const Q=(ee,Ne)=>[ee(R[0]),R[1]?ee(R[1]):s[Ne][1]];k("hours",Q(Wt,"hours")),k("minutes",Q(an,"minutes")),k("seconds",Q($r,"seconds"))},O=(R,L)=>{if((n.range||n.weekPicker)&&!n.multiDates)return F(R,L);if(n.multiDates&&L){const Q=R[R.length-1];return N(Q,L)}},I=R=>{const L=o.value;O(L,R),c.value.count&&c.value.solo&&C()},H=(R,L)=>{const Q=Be(G(),{month:y.value(L),year:B.value(L)}),ee=R<0?jt(Q,1):zr(Q,1);u(Ce(ee),Me(ee),R<0,n.preventMinMaxNavigation)&&(w(L,Ce(ee),Me(ee)),e("update-month-year",{instance:L,month:Ce(ee),year:Me(ee)}),c.value.count&&!c.value.solo&&b(L),t())},b=R=>{for(let L=R-1;L>=0;L--){const Q=zr(Be(G(),{month:y.value(L+1),year:B.value(L+1)}),1);w(L,Ce(Q),Me(Q))}for(let L=R+1;L<=c.value.count-1;L++){const Q=jt(Be(G(),{month:y.value(L-1),year:B.value(L-1)}),1);w(L,Ce(Q),Me(Q))}},C=()=>{if(Array.isArray(o.value)&&o.value.length===2){const R=G(G(o.value[1]?o.value[1]:jt(o.value[0],1))),[L,Q]=[Ce(o.value[0]),Me(o.value[0])],[ee,Ne]=[Ce(o.value[1]),Me(o.value[1])];(L!==ee||L===ee&&Q!==Ne)&&c.value.solo&&w(1,Ce(R),Me(R))}else o.value&&!Array.isArray(o.value)&&(w(0,Ce(o.value),Me(o.value)),z(G()))},v=()=>{n.startDate&&(w(0,Ce(G(n.startDate)),Me(G(n.startDate))),c.value.count&&b(0))},A=(R,L)=>{n.monthChangeOnScroll&&H(n.monthChangeOnScroll!=="inverse"?-R.deltaY:R.deltaY,L)},E=(R,L,Q=!1)=>{n.monthChangeOnArrows&&n.vertical===Q&&P(R,L)},P=(R,L)=>{H(R==="right"?-1:1,L)},q=R=>n.markers.find(L=>Ae(wd(R.value),wd(L.date))),D=(R,L)=>{switch(n.sixWeeks===!0?"append":n.sixWeeks){case"prepend":return[!0,!1];case"center":return[R==0,!0];case"fair":return[R==0||L>R,!0];case"append":return[!1,!1];default:return[!1,!1]}},X=(R,L,Q,ee)=>{if(n.sixWeeks&&R.length<6){const Ne=6-R.length,ht=(L.getDay()+7-ee)%7,U=6-(Q.getDay()+7-ee)%7,[ae,fe]=D(ht,U);for(let xe=1;xe<=Ne;xe++)if(fe?!!(xe%2)==ae:ae){const me=R[0].days[0],Qe=ne(Cn(me.value,-7),Ce(L));R.unshift({days:Qe})}else{const me=R[R.length-1],Qe=me.days[me.days.length-1],Dt=ne(Cn(Qe.value,1),Ce(L));R.push({days:Dt})}}return R},ne=(R,L)=>{const Q=G(R),ee=[];for(let Ne=0;Ne<7;Ne++){const ht=Cn(Q,Ne),U=Ce(ht)!==L;ee.push({text:n.hideOffsetDates&&U?"":ht.getDate(),value:ht,current:!U,classData:{}})}return ee},Y=(R,L)=>{const Q=[],ee=G(Rt(new Date(L,R),n.timezone)),Ne=G(Rt(new Date(L,R+1,0),n.timezone)),ht=n.weekStart,U=lr(ee,{weekStartsOn:ht}),ae=fe=>{const xe=ne(fe,R);if(Q.push({days:xe}),!Q[Q.length-1].days.some(me=>Ae(It(me.value),It(Ne)))){const me=Cn(fe,7);ae(me)}};return ae(U),X(Q,ee,Ne,ht)},Z=R=>(o.value=Ao(G(R.value),n.timezone,n.weekStart),e("date-update",R.value),M()),ce=R=>{const L=Rn(G(R.value),s.hours,s.minutes,st());e("date-update",L),n.multiDates?Po(L,o,n.multiDatesLimit):o.value=L,r(),l.nextTick().then(()=>{M()})},j=R=>n.noDisabledRange?kd(i.value[0],R).some(L=>f(L)):!1,J=()=>{i.value=o.value?o.value.slice():[],i.value.length===2&&!(n.fixedStart||n.fixedEnd)&&(i.value=[])},de=(R,L)=>{const Q=[G(R.value),Cn(G(R.value),+n.autoRange)];p(Q)&&(L&&te(R.value),i.value=Q)},te=R=>{const L=Ce(G(R)),Q=Me(G(R));if(w(0,L,Q),c.value.count>0)for(let ee=1;ee<c.value.count;ee++){const Ne=lv(Be(G(R),{year:y.value(ee-1),month:B.value(ee-1)}));w(ee,Ne.month,Ne.year)}},Ge=R=>Array.isArray(o.value)&&o.value.length===2?n.fixedStart&&(lt(R,o.value[0])||Ae(R,o.value[0]))?[o.value[0],R]:n.fixedEnd&&(nt(R,o.value[1])||Ae(R,o.value[1]))?[R,o.value[1]]:(e("invalid-fixed-range",R),o.value):[],pt=R=>{j(R.value)||!h(R.value,o.value,n.fixedStart?0:1)||(i.value=Ge(G(R.value)))},nn=(R,L)=>{if(J(),n.autoRange)return de(R,L);if(n.fixedStart||n.fixedEnd)return pt(R);i.value[0]?h(G(R.value),o.value)&&!j(R.value)?nt(G(R.value),G(i.value[0]))?(i.value.unshift(G(R.value)),e("range-end",i.value[0])):(i.value[1]=G(R.value),e("range-end",i.value[1])):n.autoApply&&e("auto-apply-invalid",R.value):(i.value[0]=G(R.value),e("range-start",i.value[0]))},st=(R=!0)=>n.enableSeconds?Array.isArray(s.seconds)?R?s.seconds[0]:s.seconds[1]:s.seconds:0,xn=R=>{i.value[R]=Rn(i.value[R],s.hours[R],s.minutes[R],st(R!==1))},Bt=()=>{var R,L;i.value[0]&&i.value[1]&&+((R=i.value)==null?void 0:R[0])>+((L=i.value)==null?void 0:L[1])&&(i.value.reverse(),e("range-start",i.value[0]),e("range-end",i.value[1]))},Ut=()=>{i.value.length&&(i.value[0]&&!i.value[1]?xn(0):(xn(0),xn(1),r()),Bt(),o.value=i.value.slice(),Io(i.value,e,n.autoApply,n.modelAuto))},Nn=(R,L=!1)=>{if(!(f(R.value)||!R.current&&n.hideOffsetDates)){if(n.weekPicker)return Z(R);if(!n.range)return ce(R);Bd(s.hours)&&Bd(s.minutes)&&!n.multiDates&&(nn(R,L),Ut())}},rn=(R,L)=>{var Q;w(R,L.month,L.year),c.value.count&&!c.value.solo&&b(R),e("update-month-year",{instance:R,month:L.month,year:L.year}),t(c.value.solo?R:void 0);const ee=(Q=n.flow)!=null&&Q.length?n.flow[n.flowStep]:void 0;!L.fromNav&&(ee===cn.month||ee===cn.year)&&r()},_n=(R,L)=>{Array.isArray(R)&&R.length<=2&&n.range?o.value=R.map(Q=>Rt(G(Q),L?void 0:n.timezone)):Array.isArray(R)||(o.value=Rt(G(R),L?void 0:n.timezone)),V(),n.multiCalendars&&l.nextTick().then(()=>_(!0))},ir=()=>{n.range?o.value&&Array.isArray(o.value)&&o.value[0]?o.value=nt(G(),o.value[0])?[G(),o.value[0]]:[o.value[0],G()]:o.value=[G()]:o.value=G(),V()},or=()=>{if(Array.isArray(o.value))if(n.multiDates){const R=ar();o.value[o.value.length-1]=g(R)}else o.value=o.value.map((R,L)=>R&&g(R,L));else o.value=g(o.value);e("time-update")},ar=()=>Array.isArray(o.value)&&o.value.length?o.value[o.value.length-1]:null;return{calendars:a,modelValue:o,month:y,year:B,time:s,disabledTimesConfig:T,validateTime:S,getCalendarDays:Y,getMarker:q,handleScroll:A,handleSwipe:P,handleArrow:E,selectDate:Nn,updateMonthYear:rn,presetDate:_n,selectCurrentDate:ir,updateTime:(R,L=!0,Q=!1)=>{m(R,L,Q,or)}}},Mb={key:0},Tb=l.defineComponent({__name:"DatePicker",props:{...Gt},emits:["tooltip-open","tooltip-close","mount","update:internal-model-value","update-flow-step","reset-flow","auto-apply","focus-menu","select-date","range-start","range-end","invalid-fixed-range","time-update","am-pm-change","time-picker-open","time-picker-close","recalculate-position","update-month-year","auto-apply-invalid","date-update"],setup(n,{expose:e,emit:t}){const r=n,{calendars:i,month:o,year:a,modelValue:s,time:c,disabledTimesConfig:d,validateTime:u,getCalendarDays:f,getMarker:p,handleArrow:h,handleScroll:m,handleSwipe:g,selectDate:k,updateMonthYear:x,presetDate:S,selectCurrentDate:T,updateTime:y}=Cb(r,t,b,C),B=l.useSlots(),{setHoverDate:w,getDayClassData:V,clearHoverDate:$}=Dv(s,r),{defaultedMultiCalendars:M}=Ye(r),_=l.ref([]),z=l.ref([]),N=l.ref(null),W=At(B,"calendar"),F=At(B,"monthYear"),O=At(B,"timePicker"),I=A=>{r.shadow||t("mount",A)};l.watch(i,()=>{r.shadow||setTimeout(()=>{t("recalculate-position")},0)},{deep:!0});const H=l.computed(()=>A=>f(o.value(A),a.value(A)).map(E=>({...E,days:E.days.map(P=>(P.marker=p(P),P.classData=V(P),P))})));function b(A){var E;A||A===0?(E=z.value[A])==null||E.triggerTransition(o.value(A),a.value(A)):z.value.forEach((P,q)=>P.triggerTransition(o.value(q),a.value(q)))}function C(){t("update-flow-step")}const v=(A,E=!1)=>{k(A,E),r.spaceConfirm&&t("select-date")};return e({clearHoverDate:$,presetDate:S,selectCurrentDate:T,toggleMonthPicker:(A,E,P=0)=>{var q;(q=_.value[P])==null||q.toggleMonthPicker(A,E)},toggleYearPicker:(A,E,P=0)=>{var q;(q=_.value[P])==null||q.toggleYearPicker(A,E)},toggleTimePicker:(A,E,P)=>{var q;(q=N.value)==null||q.toggleTimePicker(A,E,P)},handleArrow:h,updateMonthYear:x,getSidebarProps:()=>({modelValue:s,month:o,year:a,time:c,updateTime:y,updateMonthYear:x,selectDate:k,presetDate:S})}),(A,E)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createVNode(Bo,{"multi-calendars":l.unref(M).count},{default:l.withCtx(({instance:P,index:q})=>[A.disableMonthYearSelect?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(pb,l.mergeProps({key:0,ref:D=>{D&&(_.value[q]=D)},months:l.unref(fd)(A.formatLocale,A.locale,A.monthNameFormat),years:l.unref(us)(A.yearRange,A.reverseYears),month:l.unref(o)(P),year:l.unref(a)(P),instance:P},A.$props,{onMount:E[0]||(E[0]=D=>I(l.unref(hr).header)),onResetFlow:E[1]||(E[1]=D=>A.$emit("reset-flow")),onUpdateMonthYear:D=>l.unref(x)(P,D),onOverlayClosed:E[2]||(E[2]=D=>A.$emit("focus-menu"))}),l.createSlots({_:2},[l.renderList(l.unref(F),(D,X)=>({name:D,fn:l.withCtx(ne=>[l.renderSlot(A.$slots,D,l.normalizeProps(l.guardReactiveProps(ne)))])}))]),1040,["months","years","month","year","instance","onUpdateMonthYear"])),l.createVNode(xb,l.mergeProps({ref:D=>{D&&(z.value[q]=D)},"mapped-dates":H.value(P),month:l.unref(o)(P),year:l.unref(a)(P),instance:P},A.$props,{onSelectDate:D=>l.unref(k)(D,P!==1),onHandleSpace:D=>v(D,P!==1),onSetHoverDate:E[3]||(E[3]=D=>l.unref(w)(D)),onHandleScroll:D=>l.unref(m)(D,P),onHandleSwipe:D=>l.unref(g)(D,P),onMount:E[4]||(E[4]=D=>I(l.unref(hr).calendar)),onResetFlow:E[5]||(E[5]=D=>A.$emit("reset-flow")),onTooltipOpen:E[6]||(E[6]=D=>A.$emit("tooltip-open",D)),onTooltipClose:E[7]||(E[7]=D=>A.$emit("tooltip-close",D))}),l.createSlots({_:2},[l.renderList(l.unref(W),(D,X)=>({name:D,fn:l.withCtx(ne=>[l.renderSlot(A.$slots,D,l.normalizeProps(l.guardReactiveProps({...ne})))])}))]),1040,["mapped-dates","month","year","instance","onSelectDate","onHandleSpace","onHandleScroll","onHandleSwipe"])]),_:3},8,["multi-calendars"]),A.enableTimePicker?(l.openBlock(),l.createElementBlock("div",Mb,[A.$slots["time-picker"]?l.renderSlot(A.$slots,"time-picker",l.normalizeProps(l.mergeProps({key:0},{time:l.unref(c),updateTime:l.unref(y)}))):(l.openBlock(),l.createBlock(Nd,l.mergeProps({key:1,ref_key:"timePickerRef",ref:N},A.$props,{hours:l.unref(c).hours,minutes:l.unref(c).minutes,seconds:l.unref(c).seconds,"internal-model-value":A.internalModelValue,"disabled-times-config":l.unref(d),"validate-time":l.unref(u),onMount:E[8]||(E[8]=P=>I(l.unref(hr).timePicker)),"onUpdate:hours":E[9]||(E[9]=P=>l.unref(y)(P)),"onUpdate:minutes":E[10]||(E[10]=P=>l.unref(y)(P,!1)),"onUpdate:seconds":E[11]||(E[11]=P=>l.unref(y)(P,!1,!0)),onResetFlow:E[12]||(E[12]=P=>A.$emit("reset-flow")),onOverlayClosed:E[13]||(E[13]=P=>A.$emit("time-picker-close")),onOverlayOpened:E[14]||(E[14]=P=>A.$emit("time-picker-open",P)),onAmPmChange:E[15]||(E[15]=P=>A.$emit("am-pm-change",P))}),l.createSlots({_:2},[l.renderList(l.unref(O),(P,q)=>({name:P,fn:l.withCtx(D=>[l.renderSlot(A.$slots,P,l.normalizeProps(l.guardReactiveProps(D)))])}))]),1040,["hours","minutes","seconds","internal-model-value","disabled-times-config","validate-time"]))])):l.createCommentVNode("",!0)],64))}}),Sb=(n,e)=>{const t=l.ref(),{defaultedMultiCalendars:r,defaultedConfig:i}=Ye(n),{modelValue:o,year:a,month:s,calendars:c}=Ii(n,e),{isDisabled:d}=Wr(n),{selectYear:u,groupedYears:f,showYearPicker:p,isDisabled:h,toggleYearPicker:m,handleYearSelect:g,handleYear:k}=Od({modelValue:o,multiCalendars:r,calendars:c,month:s,year:a,props:n,emit:e}),x=($,M)=>[$,M].map(_=>Pn(_,"MMMM",{locale:n.formatLocale})).join("-"),S=l.computed(()=>$=>o.value?Array.isArray(o.value)?o.value.some(M=>qc($,M)):qc(o.value,$):!1),T=$=>{if(n.range){if(Array.isArray(o.value)){const M=Ae($,o.value[0])||Ae($,o.value[1]);return Do(o.value,t.value,$)&&!M}return!1}return!1},y=l.computed(()=>$=>{const M=Be(new Date,{year:a.value($)});return Zm({start:tg(M),end:eg(M)}).map(_=>{const z=Ti(_),N=Sc(_),W=d(_),F=T(z);return{text:x(z,N),value:z,active:S.value(z),disabled:W,isBetween:F}})}),B=$=>{Po($,o,n.multiDatesLimit),e("auto-apply",!0)},w=$=>{const M=ws(o,$,e);Io(M,e,n.autoApply,n.modelAuto)},V=$=>{o.value=$,e("auto-apply")};return{defaultedConfig:i,defaultedMultiCalendars:r,groupedYears:f,year:a,isDisabled:h,quarters:y,showYearPicker:p,modelValue:o,setHoverDate:$=>{t.value=$},selectYear:u,selectQuarter:($,M,_)=>{if(!_)return c.value[M].month=Ce(Sc($)),n.multiDates?B($):n.range?w($):V($)},toggleYearPicker:m,handleYearSelect:g,handleYear:k}},Db={class:"dp--quarter-items"},Ab=["disabled","onClick","onMouseover"],Eb=l.defineComponent({compatConfig:{MODE:3},__name:"QuarterPicker",props:{...Gt},emits:["update:internal-model-value","reset-flow","overlay-closed","auto-apply","range-start","range-end"],setup(n,{expose:e,emit:t}){const r=n,i=l.useSlots(),o=At(i,"yearMode"),{defaultedMultiCalendars:a,defaultedConfig:s,groupedYears:c,year:d,isDisabled:u,quarters:f,modelValue:p,showYearPicker:h,setHoverDate:m,selectQuarter:g,toggleYearPicker:k,handleYearSelect:x,handleYear:S}=Sb(r,t);return e({getSidebarProps:()=>({modelValue:p,year:d,selectQuarter:g,handleYearSelect:x,handleYear:S})}),(T,y)=>(l.openBlock(),l.createBlock(Bo,{"multi-calendars":l.unref(a).count,stretch:""},{default:l.withCtx(({instance:B})=>[l.createElementVNode("div",{class:"dp-quarter-picker-wrap",style:l.normalizeStyle({minHeight:`${l.unref(s).modeHeight}px`})},[l.createElementVNode("div",null,[l.createVNode(Ed,l.mergeProps(T.$props,{items:l.unref(c)(B),instance:B,"show-year-picker":l.unref(h)[B],year:l.unref(d)(B),"is-disabled":w=>l.unref(u)(B,w),onHandleYear:w=>l.unref(S)(B,w),onYearSelect:w=>l.unref(x)(w,B),onToggleYearPicker:w=>l.unref(k)(B,w==null?void 0:w.flow,w==null?void 0:w.show)}),l.createSlots({_:2},[l.renderList(l.unref(o),(w,V)=>({name:w,fn:l.withCtx($=>[l.renderSlot(T.$slots,w,l.normalizeProps(l.guardReactiveProps($)))])}))]),1040,["items","instance","show-year-picker","year","is-disabled","onHandleYear","onYearSelect","onToggleYearPicker"])]),l.createElementVNode("div",Db,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(f)(B),(w,V)=>(l.openBlock(),l.createElementBlock("div",{key:V},[l.createElementVNode("button",{type:"button",class:l.normalizeClass(["dp--qr-btn",{"dp--qr-btn-active":w.active,"dp--qr-btn-between":w.isBetween,"dp--qr-btn-disabled":w.disabled}]),disabled:w.disabled,onClick:$=>l.unref(g)(w.value,B,w.disabled),onMouseover:$=>l.unref(m)(w.value)},[T.$slots.quarter?l.renderSlot(T.$slots,"quarter",{key:0,value:w.value,text:w.text}):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(w.text),1)],64))],42,Ab)]))),128))])],4)]),_:3},8,["multi-calendars"]))}}),Ob=["id","onKeydown"],Nb={key:0,class:"dp__sidebar_left"},_b={key:1,class:"dp--preset-dates"},Bb=["onClick","onKeydown"],Pb={key:2,class:"dp__sidebar_right"},Ib={key:3,class:"dp__action_extra"},Pd=l.defineComponent({compatConfig:{MODE:3},__name:"DatepickerMenu",props:{..._o,shadow:{type:Boolean,default:!1},openOnTop:{type:Boolean,default:!1},internalModelValue:{type:[Date,Array],default:null},arrMapValues:{type:Object,default:()=>({})},noOverlayFocus:{type:Boolean,default:!1}},emits:["close-picker","select-date","auto-apply","time-update","flow-step","update-month-year","invalid-select","update:internal-model-value","recalculate-position","invalid-fixed-range","tooltip-open","tooltip-close","time-picker-open","time-picker-close","am-pm-change","range-start","range-end","auto-apply-invalid","date-update"],setup(n,{expose:e,emit:t}){const r=n,i=l.computed(()=>{const{openOnTop:j,...J}=r;return{...J,flowStep:V.value,noOverlayFocus:r.noOverlayFocus}}),{setMenuFocused:o,setShiftKey:a,control:s}=Sd(),c=l.useSlots(),{defaultedTextInput:d,defaultedInline:u,defaultedConfig:f}=Ye(r),p=l.ref(null),h=l.ref(0),m=l.ref(null),g=l.ref(null),k=l.ref(!1),x=l.ref(null);l.onMounted(()=>{if(!r.shadow){k.value=!0,S(),window.addEventListener("resize",S);const j=qe(m);if(j&&!d.value.enabled&&!u.value.enabled&&(o(!0),N()),j){const J=de=>{f.value.allowPreventDefault&&de.preventDefault(),In(de,f.value,!0)};j.addEventListener("pointerdown",J),j.addEventListener("mousedown",J)}}}),l.onUnmounted(()=>{window.removeEventListener("resize",S)});const S=()=>{const j=qe(g);j&&(h.value=j.getBoundingClientRect().width)},{arrowRight:T,arrowLeft:y,arrowDown:B,arrowUp:w}=Ln(),{flowStep:V,updateFlowStep:$,childMount:M,resetFlow:_}=Av(r,t,x),z=l.computed(()=>r.monthPicker?jv:r.yearPicker?qv:r.timePicker?db:r.quarterPicker?Eb:Tb),N=()=>{const j=qe(m);j&&j.focus({preventScroll:!0})},W=l.computed(()=>{var j;return((j=x.value)==null?void 0:j.getSidebarProps())||{}}),F=()=>{r.openOnTop&&t("recalculate-position")},O=At(c,"action"),I=l.computed(()=>r.monthPicker||r.yearPicker?At(c,"monthYear"):r.timePicker?At(c,"timePicker"):At(c,"shared")),H=l.computed(()=>r.openOnTop?"dp__arrow_bottom":"dp__arrow_top"),b=l.computed(()=>({dp__menu_disabled:r.disabled,dp__menu_readonly:r.readonly})),C=l.computed(()=>({dp__menu:!0,dp__menu_index:!u.value.enabled,dp__relative:u.value.enabled,[r.menuClassName]:!!r.menuClassName})),v=j=>{In(j,f.value,!0)},A=()=>{r.escClose&&t("close-picker")},E=j=>{if(r.arrowNavigation){if(j==="up")return w();if(j==="down")return B();if(j==="left")return y();if(j==="right")return T()}else j==="left"||j==="up"?ne("handleArrow","left",0,j==="up"):ne("handleArrow","right",0,j==="down")},P=j=>{a(j.shiftKey),!r.disableMonthYearSelect&&j.code==="Tab"&&j.target.classList.contains("dp__menu")&&s.value.shiftKeyInMenu&&(j.preventDefault(),In(j,f.value,!0),t("close-picker"))},q=()=>{N(),t("time-picker-close")},D=j=>{var J,de,te;(J=x.value)==null||J.toggleTimePicker(!1,!1),(de=x.value)==null||de.toggleMonthPicker(!1,!1,j),(te=x.value)==null||te.toggleYearPicker(!1,!1,j)},X=(j,J=0)=>{var de,te,Ge;return j==="month"?(de=x.value)==null?void 0:de.toggleMonthPicker(!1,!0,J):j==="year"?(te=x.value)==null?void 0:te.toggleYearPicker(!1,!0,J):j==="time"?(Ge=x.value)==null?void 0:Ge.toggleTimePicker(!0,!1):D(J)},ne=(j,...J)=>{var de,te;(de=x.value)!=null&&de[j]&&((te=x.value)==null||te[j](...J))},Y=()=>{ne("selectCurrentDate")},Z=(j,J)=>{ne("presetDate",j,J)},ce=()=>{ne("clearHoverDate")};return e({updateMonthYear:(j,J)=>{ne("updateMonthYear",j,J)},switchView:X}),(j,J)=>{var de;return l.openBlock(),l.createElementBlock("div",{id:j.uid?`dp-menu-${j.uid}`:void 0,tabindex:"0",ref_key:"dpMenuRef",ref:m,role:"dialog",class:l.normalizeClass(C.value),onMouseleave:ce,onClick:v,onKeydown:[l.withKeys(A,["esc"]),J[17]||(J[17]=l.withKeys(l.withModifiers(te=>E("left"),["prevent"]),["left"])),J[18]||(J[18]=l.withKeys(l.withModifiers(te=>E("up"),["prevent"]),["up"])),J[19]||(J[19]=l.withKeys(l.withModifiers(te=>E("down"),["prevent"]),["down"])),J[20]||(J[20]=l.withKeys(l.withModifiers(te=>E("right"),["prevent"]),["right"])),P]},[(j.disabled||j.readonly)&&l.unref(u).enabled?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(b.value)},null,2)):l.createCommentVNode("",!0),!l.unref(u).enabled&&!j.teleportCenter?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(H.value)},null,2)):l.createCommentVNode("",!0),l.createElementVNode("div",{ref_key:"innerMenuRef",ref:g,class:l.normalizeClass({dp__menu_content_wrapper:((de=j.presetDates)==null?void 0:de.length)||!!j.$slots["left-sidebar"]||!!j.$slots["right-sidebar"]}),style:l.normalizeStyle({"--dp-menu-width":`${h.value}px`})},[j.$slots["left-sidebar"]?(l.openBlock(),l.createElementBlock("div",Nb,[l.renderSlot(j.$slots,"left-sidebar",l.normalizeProps(l.guardReactiveProps(W.value)))])):l.createCommentVNode("",!0),j.presetDates.length?(l.openBlock(),l.createElementBlock("div",_b,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(j.presetDates,(te,Ge)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:Ge},[te.slot?l.renderSlot(j.$slots,te.slot,{key:0,presetDate:Z,label:te.label,value:te.value}):(l.openBlock(),l.createElementBlock("button",{key:1,type:"button",style:l.normalizeStyle(te.style||{}),class:"dp__btn dp--preset-range",onClick:l.withModifiers(pt=>Z(te.value,te.noTz),["prevent"]),onKeydown:[l.withKeys(l.withModifiers(pt=>Z(te.value,te.noTz),["prevent"]),["enter"]),l.withKeys(l.withModifiers(pt=>Z(te.value,te.noTz),["prevent"]),["space"])]},l.toDisplayString(te.label),45,Bb))],64))),128))])):l.createCommentVNode("",!0),l.createElementVNode("div",{class:"dp__instance_calendar",ref_key:"calendarWrapperRef",ref:p,role:"document"},[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(z.value),l.mergeProps({ref_key:"dynCmpRef",ref:x},i.value,{"flow-step":l.unref(V),onMount:l.unref(M),onUpdateFlowStep:l.unref($),onResetFlow:l.unref(_),onFocusMenu:N,onSelectDate:J[0]||(J[0]=te=>j.$emit("select-date")),onDateUpdate:J[1]||(J[1]=te=>j.$emit("date-update",te)),onTooltipOpen:J[2]||(J[2]=te=>j.$emit("tooltip-open",te)),onTooltipClose:J[3]||(J[3]=te=>j.$emit("tooltip-close",te)),onAutoApply:J[4]||(J[4]=te=>j.$emit("auto-apply",te)),onRangeStart:J[5]||(J[5]=te=>j.$emit("range-start",te)),onRangeEnd:J[6]||(J[6]=te=>j.$emit("range-end",te)),onInvalidFixedRange:J[7]||(J[7]=te=>j.$emit("invalid-fixed-range",te)),onTimeUpdate:J[8]||(J[8]=te=>j.$emit("time-update")),onAmPmChange:J[9]||(J[9]=te=>j.$emit("am-pm-change",te)),onTimePickerOpen:J[10]||(J[10]=te=>j.$emit("time-picker-open",te)),onTimePickerClose:q,onRecalculatePosition:F,onUpdateMonthYear:J[11]||(J[11]=te=>j.$emit("update-month-year",te)),onAutoApplyInvalid:J[12]||(J[12]=te=>j.$emit("auto-apply-invalid",te)),"onUpdate:internalModelValue":J[13]||(J[13]=te=>j.$emit("update:internal-model-value",te))}),l.createSlots({_:2},[l.renderList(I.value,(te,Ge)=>({name:te,fn:l.withCtx(pt=>[l.renderSlot(j.$slots,te,l.normalizeProps(l.guardReactiveProps({...pt})))])}))]),1040,["flow-step","onMount","onUpdateFlowStep","onResetFlow"]))],512),j.$slots["right-sidebar"]?(l.openBlock(),l.createElementBlock("div",Pb,[l.renderSlot(j.$slots,"right-sidebar",l.normalizeProps(l.guardReactiveProps(W.value)))])):l.createCommentVNode("",!0),j.$slots["action-extra"]?(l.openBlock(),l.createElementBlock("div",Ib,[j.$slots["action-extra"]?l.renderSlot(j.$slots,"action-extra",{key:0,selectCurrentDate:Y}):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)],6),!j.autoApply||l.unref(f).keepActionRow?(l.openBlock(),l.createBlock(Rv,l.mergeProps({key:2,"menu-mount":k.value},i.value,{"calendar-width":h.value,onClosePicker:J[14]||(J[14]=te=>j.$emit("close-picker")),onSelectDate:J[15]||(J[15]=te=>j.$emit("select-date")),onInvalidSelect:J[16]||(J[16]=te=>j.$emit("invalid-select")),onSelectNow:Y}),l.createSlots({_:2},[l.renderList(l.unref(O),(te,Ge)=>({name:te,fn:l.withCtx(pt=>[l.renderSlot(j.$slots,te,l.normalizeProps(l.guardReactiveProps({...pt})))])}))]),1040,["menu-mount","calendar-width"])):l.createCommentVNode("",!0)],42,Ob)}}}),Rb=typeof window<"u"?window:void 0,ks=()=>{},Vb=n=>l.getCurrentScope()?(l.onScopeDispose(n),!0):!1,Lb=(n,e,t,r)=>{if(!n)return ks;let i=ks;const o=l.watch(()=>l.unref(n),s=>{i(),s&&(s.addEventListener(e,t,r),i=()=>{s.removeEventListener(e,t,r),i=ks})},{immediate:!0,flush:"post"}),a=()=>{o(),i()};return Vb(a),a},$b=(n,e,t,r={})=>{const{window:i=Rb,event:o="pointerdown"}=r;return i?Lb(i,o,a=>{const s=qe(n),c=qe(e);!s||!c||s===a.target||a.composedPath().includes(s)||a.composedPath().includes(c)||t(a)},{passive:!0}):void 0},Fb=l.defineComponent({compatConfig:{MODE:3},__name:"VueDatePicker",props:{..._o},emits:["update:model-value","update:model-timezone-value","text-submit","closed","cleared","open","focus","blur","internal-model-change","recalculate-position","flow-step","update-month-year","invalid-select","invalid-fixed-range","tooltip-open","tooltip-close","time-picker-open","time-picker-close","am-pm-change","range-start","range-end","date-update"],setup(n,{expose:e,emit:t}){const r=n,i=l.useSlots(),o=l.ref(!1),a=l.toRef(r,"modelValue"),s=l.toRef(r,"timezone"),c=l.ref(null),d=l.ref(null),u=l.ref(null),f=l.ref(!1),p=l.ref(null),{setMenuFocused:h,setShiftKey:m}=Sd(),{clearArrowNav:g}=Ln(),{mapDatesArrToMap:k,validateDate:x,isValidTime:S}=Wr(r),{defaultedTransitions:T,defaultedTextInput:y,defaultedInline:B,defaultedConfig:w}=Ye(r),{menuTransition:V,showTransition:$}=Pi(T);l.onMounted(()=>{v(r.modelValue),l.nextTick().then(()=>{B.value.enabled||(I(p.value).addEventListener("scroll",Y),window.addEventListener("resize",Z))}),B.value.enabled&&(o.value=!0)});const M=l.computed(()=>k());l.onUnmounted(()=>{if(!B.value.enabled){const L=I(p.value);L&&L.removeEventListener("scroll",Y),window.removeEventListener("resize",Z)}});const _=At(i,"all",r.presetDates),z=At(i,"input");l.watch([a,s],()=>{v(a.value)},{deep:!0});const{openOnTop:N,menuStyle:W,xCorrect:F,setMenuPosition:O,getScrollableParent:I,shadowRender:H}=Mv({menuRef:c,menuRefInner:d,inputRef:u,pickerWrapperRef:p,inline:B,emit:t,props:r,slots:i}),{inputValue:b,internalModelValue:C,parseExternalModelValue:v,emitModelValue:A,formatInputValue:E,checkBeforeEmit:P}=xv(t,r,f),q=l.computed(()=>({dp__main:!0,dp__theme_dark:r.dark,dp__theme_light:!r.dark,dp__flex_display:B.value.enabled,dp__flex_display_with_input:B.value.input})),D=l.computed(()=>r.dark?"dp__theme_dark":"dp__theme_light"),X=l.computed(()=>r.teleport?{to:typeof r.teleport=="boolean"?"body":r.teleport,disabled:B.value.enabled}:{class:"dp__outer_menu_wrap"}),ne=l.computed(()=>B.value.enabled&&(r.timePicker||r.monthPicker||r.yearPicker||r.quarterPicker)),Y=()=>{o.value&&(w.value.closeOnScroll?st():O())},Z=()=>{o.value&&O()},ce=()=>{!r.disabled&&!r.readonly&&(H(Pd,r),O(!1),o.value=!0,o.value&&t("open"),o.value||nn(),v(r.modelValue))},j=()=>{var L;b.value="",nn(),(L=u.value)==null||L.setParsedDate(null),t("update:model-value",null),t("update:model-timezone-value",null),t("cleared"),w.value.closeOnClearValue&&st()},J=()=>{const L=C.value;return!L||!Array.isArray(L)&&x(L)?!0:Array.isArray(L)?L.length===2&&x(L[0])&&x(L[1])?!0:r.partialRange&&!r.timePicker?x(L[0]):!1:!1},de=()=>{P()&&J()?(A(),st()):t("invalid-select",C.value)},te=L=>{Ge(),A(),w.value.closeOnAutoApply&&!L&&st()},Ge=()=>{u.value&&y.value.enabled&&u.value.setParsedDate(C.value)},pt=(L=!1)=>{r.autoApply&&S(C.value)&&J()&&(r.range&&Array.isArray(C.value)?(r.partialRange||C.value.length===2)&&te(L):te(L))},nn=()=>{y.value.enabled||(C.value=null)},st=()=>{B.value.enabled||(o.value&&(o.value=!1,F.value=!1,h(!1),m(!1),g(),t("closed"),b.value&&v(a.value)),nn(),t("blur"))},xn=(L,Q)=>{if(!L){C.value=null;return}const ee=Array.isArray(L)?!L.some(ht=>!x(ht)):x(L),Ne=S(L);ee&&Ne&&(C.value=L,Q&&(de(),t("text-submit")))},Bt=()=>{r.autoApply&&S(C.value)&&A(),Ge()},Ut=()=>o.value?st():ce(),Nn=L=>{C.value=L},rn=()=>{y.value.enabled&&(f.value=!0,E()),t("focus")},_n=()=>{y.value.enabled&&(f.value=!1,v(r.modelValue)),t("blur")},ir=L=>{d.value&&d.value.updateMonthYear(0,{month:hd(L.month),year:hd(L.year)})},or=L=>{v(L??r.modelValue)},ar=(L,Q)=>{var ee;(ee=d.value)==null||ee.switchView(L,Q)},R=L=>w.value.onClickOutside?w.value.onClickOutside(L):st();return $b(c,u,()=>R(J)),e({closeMenu:st,selectDate:de,clearValue:j,openMenu:ce,onScroll:Y,formatInputValue:E,updateInternalModelValue:Nn,setMonthYear:ir,parseModel:or,switchView:ar}),(L,Q)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(q.value),ref_key:"pickerWrapperRef",ref:p},[l.createVNode(_v,l.mergeProps({ref_key:"inputRef",ref:u,"is-menu-open":o.value,"input-value":l.unref(b),"onUpdate:inputValue":Q[0]||(Q[0]=ee=>l.isRef(b)?b.value=ee:null)},L.$props,{onClear:j,onOpen:ce,onSetInputDate:xn,onSetEmptyDate:l.unref(A),onSelectDate:de,onToggle:Ut,onClose:st,onFocus:rn,onBlur:_n,onRealBlur:Q[1]||(Q[1]=ee=>f.value=!1)}),l.createSlots({_:2},[l.renderList(l.unref(z),(ee,Ne)=>({name:ee,fn:l.withCtx(ht=>[l.renderSlot(L.$slots,ee,l.normalizeProps(l.guardReactiveProps(ht)))])}))]),1040,["is-menu-open","input-value","onSetEmptyDate"]),l.createVNode(l.Transition,{name:l.unref(V)(l.unref(N)),css:l.unref($)&&!l.unref(B).enabled},{default:l.withCtx(()=>[o.value?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(L.teleport?l.Teleport:"div"),l.mergeProps({key:0,ref_key:"dpWrapMenuRef",ref:c},X.value,{class:{"dp--menu-wrapper":!l.unref(B).enabled},style:l.unref(B).enabled?void 0:l.unref(W)}),{default:l.withCtx(()=>[l.createVNode(Pd,l.mergeProps({ref_key:"dpMenuRef",ref:d,class:{[D.value]:!0,"dp--menu-wrapper":L.teleport},style:L.teleport?l.unref(W):void 0,"open-on-top":l.unref(N),"arr-map-values":M.value,"no-overlay-focus":ne.value},L.$props,{"internal-model-value":l.unref(C),"onUpdate:internalModelValue":Q[2]||(Q[2]=ee=>l.isRef(C)?C.value=ee:null),onClosePicker:st,onSelectDate:de,onAutoApply:pt,onTimeUpdate:Bt,onFlowStep:Q[3]||(Q[3]=ee=>L.$emit("flow-step",ee)),onUpdateMonthYear:Q[4]||(Q[4]=ee=>L.$emit("update-month-year",ee)),onInvalidSelect:Q[5]||(Q[5]=ee=>L.$emit("invalid-select",l.unref(C))),onAutoApplyInvalid:Q[6]||(Q[6]=ee=>L.$emit("invalid-select",ee)),onInvalidFixedRange:Q[7]||(Q[7]=ee=>L.$emit("invalid-fixed-range",ee)),onRecalculatePosition:l.unref(O),onTooltipOpen:Q[8]||(Q[8]=ee=>L.$emit("tooltip-open",ee)),onTooltipClose:Q[9]||(Q[9]=ee=>L.$emit("tooltip-close",ee)),onTimePickerOpen:Q[10]||(Q[10]=ee=>L.$emit("time-picker-open",ee)),onTimePickerClose:Q[11]||(Q[11]=ee=>L.$emit("time-picker-close",ee)),onAmPmChange:Q[12]||(Q[12]=ee=>L.$emit("am-pm-change",ee)),onRangeStart:Q[13]||(Q[13]=ee=>L.$emit("range-start",ee)),onRangeEnd:Q[14]||(Q[14]=ee=>L.$emit("range-end",ee)),onDateUpdate:Q[15]||(Q[15]=ee=>L.$emit("date-update",ee))}),l.createSlots({_:2},[l.renderList(l.unref(_),(ee,Ne)=>({name:ee,fn:l.withCtx(ht=>[l.renderSlot(L.$slots,ee,l.normalizeProps(l.guardReactiveProps({...ht})))])}))]),1040,["class","style","open-on-top","arr-map-values","no-overlay-focus","internal-model-value","onRecalculatePosition"])]),_:3},16,["class","style"])):l.createCommentVNode("",!0)]),_:3},8,["name","css"])],2))}}),xs=(()=>{const n=Fb;return n.install=e=>{e.component("Vue3DatePicker",n)},n})();Object.entries(Object.freeze(Object.defineProperty({__proto__:null,default:xs},Symbol.toStringTag,{value:"Module"}))).forEach(([n,e])=>{n!=="default"&&(xs[n]=e)});const dA="",uA="",zb={components:{VueDatePicker:xs},props:{setDate:{type:[Date,String],default:()=>new Date,required:!0},invalid:{type:Boolean,default:!1}},data(){return{selectedDate:this.setDate?new Date(this.setDate):null,minDate:new Date}},watch:{selectedDate(n){this.$emit("update:selectedDate",n)}}};function Hb(n,e,t,r,i,o){const a=l.resolveComponent("VueDatePicker");return l.openBlock(),l.createElementBlock("div",null,[l.createVNode(a,{modelValue:i.selectedDate,"onUpdate:modelValue":e[0]||(e[0]=s=>i.selectedDate=s),placeholder:"Select Start Date",mode:"date",format:"MM/dd/yyyy","enable-time-picker":!1,"min-date":i.minDate,state:t.invalid},null,8,["modelValue","min-date","state"])])}const Id=He(zb,[["render",Hb],["__scopeId","data-v-a30d4641"]]);function Yb(n){if(Array.isArray(n))return n}function Ub(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],c=!0,d=!1;try{if(o=(t=t.call(n)).next,e===0){if(Object(t)!==t)return;c=!1}else for(;!(c=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);c=!0);}catch(u){d=!0,i=u}finally{try{if(!c&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(d)throw i}}return s}}function jb(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wb(n,e){return Yb(n)||Ub(n,e)||$c(n,e)||jb()}function Rd(n,e,t,r,i,o,a){try{var s=n[o](a),c=s.value}catch(d){t(d);return}s.done?e(c):Promise.resolve(c).then(r,i)}function qb(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(c){Rd(o,r,i,a,s,"next",c)}function s(c){Rd(o,r,i,a,s,"throw",c)}a(void 0)})}}function Vd(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ld={exports:{}},$d={exports:{}};(function(n){function e(t){"@babel/helpers - typeof";return n.exports=e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},n.exports.__esModule=!0,n.exports.default=n.exports,e(t)}n.exports=e,n.exports.__esModule=!0,n.exports.default=n.exports})($d);var Kb=$d.exports;(function(n){var e=Kb.default;function t(){n.exports=t=function(){return i},n.exports.__esModule=!0,n.exports.default=n.exports;var r,i={},o=Object.prototype,a=o.hasOwnProperty,s=Object.defineProperty||function(C,v,A){C[v]=A.value},c=typeof Symbol=="function"?Symbol:{},d=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function p(C,v,A){return Object.defineProperty(C,v,{value:A,enumerable:!0,configurable:!0,writable:!0}),C[v]}try{p({},"")}catch{p=function(A,E,P){return A[E]=P}}function h(C,v,A,E){var P=v&&v.prototype instanceof y?v:y,q=Object.create(P.prototype),D=new H(E||[]);return s(q,"_invoke",{value:W(C,A,D)}),q}function m(C,v,A){try{return{type:"normal",arg:C.call(v,A)}}catch(E){return{type:"throw",arg:E}}}i.wrap=h;var g="suspendedStart",k="suspendedYield",x="executing",S="completed",T={};function y(){}function B(){}function w(){}var V={};p(V,d,function(){return this});var $=Object.getPrototypeOf,M=$&&$($(b([])));M&&M!==o&&a.call(M,d)&&(V=M);var _=w.prototype=y.prototype=Object.create(V);function z(C){["next","throw","return"].forEach(function(v){p(C,v,function(A){return this._invoke(v,A)})})}function N(C,v){function A(P,q,D,X){var ne=m(C[P],C,q);if(ne.type!=="throw"){var Y=ne.arg,Z=Y.value;return Z&&e(Z)=="object"&&a.call(Z,"__await")?v.resolve(Z.__await).then(function(ce){A("next",ce,D,X)},function(ce){A("throw",ce,D,X)}):v.resolve(Z).then(function(ce){Y.value=ce,D(Y)},function(ce){return A("throw",ce,D,X)})}X(ne.arg)}var E;s(this,"_invoke",{value:function(q,D){function X(){return new v(function(ne,Y){A(q,D,ne,Y)})}return E=E?E.then(X,X):X()}})}function W(C,v,A){var E=g;return function(P,q){if(E===x)throw new Error("Generator is already running");if(E===S){if(P==="throw")throw q;return{value:r,done:!0}}for(A.method=P,A.arg=q;;){var D=A.delegate;if(D){var X=F(D,A);if(X){if(X===T)continue;return X}}if(A.method==="next")A.sent=A._sent=A.arg;else if(A.method==="throw"){if(E===g)throw E=S,A.arg;A.dispatchException(A.arg)}else A.method==="return"&&A.abrupt("return",A.arg);E=x;var ne=m(C,v,A);if(ne.type==="normal"){if(E=A.done?S:k,ne.arg===T)continue;return{value:ne.arg,done:A.done}}ne.type==="throw"&&(E=S,A.method="throw",A.arg=ne.arg)}}}function F(C,v){var A=v.method,E=C.iterator[A];if(E===r)return v.delegate=null,A==="throw"&&C.iterator.return&&(v.method="return",v.arg=r,F(C,v),v.method==="throw")||A!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+A+"' method")),T;var P=m(E,C.iterator,v.arg);if(P.type==="throw")return v.method="throw",v.arg=P.arg,v.delegate=null,T;var q=P.arg;return q?q.done?(v[C.resultName]=q.value,v.next=C.nextLoc,v.method!=="return"&&(v.method="next",v.arg=r),v.delegate=null,T):q:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,T)}function O(C){var v={tryLoc:C[0]};1 in C&&(v.catchLoc=C[1]),2 in C&&(v.finallyLoc=C[2],v.afterLoc=C[3]),this.tryEntries.push(v)}function I(C){var v=C.completion||{};v.type="normal",delete v.arg,C.completion=v}function H(C){this.tryEntries=[{tryLoc:"root"}],C.forEach(O,this),this.reset(!0)}function b(C){if(C||C===""){var v=C[d];if(v)return v.call(C);if(typeof C.next=="function")return C;if(!isNaN(C.length)){var A=-1,E=function P(){for(;++A<C.length;)if(a.call(C,A))return P.value=C[A],P.done=!1,P;return P.value=r,P.done=!0,P};return E.next=E}}throw new TypeError(e(C)+" is not iterable")}return B.prototype=w,s(_,"constructor",{value:w,configurable:!0}),s(w,"constructor",{value:B,configurable:!0}),B.displayName=p(w,f,"GeneratorFunction"),i.isGeneratorFunction=function(C){var v=typeof C=="function"&&C.constructor;return!!v&&(v===B||(v.displayName||v.name)==="GeneratorFunction")},i.mark=function(C){return Object.setPrototypeOf?Object.setPrototypeOf(C,w):(C.__proto__=w,p(C,f,"GeneratorFunction")),C.prototype=Object.create(_),C},i.awrap=function(C){return{__await:C}},z(N.prototype),p(N.prototype,u,function(){return this}),i.AsyncIterator=N,i.async=function(C,v,A,E,P){P===void 0&&(P=Promise);var q=new N(h(C,v,A,E),P);return i.isGeneratorFunction(v)?q:q.next().then(function(D){return D.done?D.value:q.next()})},z(_),p(_,f,"Generator"),p(_,d,function(){return this}),p(_,"toString",function(){return"[object Generator]"}),i.keys=function(C){var v=Object(C),A=[];for(var E in v)A.push(E);return A.reverse(),function P(){for(;A.length;){var q=A.pop();if(q in v)return P.value=q,P.done=!1,P}return P.done=!0,P}},i.values=b,H.prototype={constructor:H,reset:function(v){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(I),!v)for(var A in this)A.charAt(0)==="t"&&a.call(this,A)&&!isNaN(+A.slice(1))&&(this[A]=r)},stop:function(){this.done=!0;var v=this.tryEntries[0].completion;if(v.type==="throw")throw v.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var A=this;function E(Y,Z){return D.type="throw",D.arg=v,A.next=Y,Z&&(A.method="next",A.arg=r),!!Z}for(var P=this.tryEntries.length-1;P>=0;--P){var q=this.tryEntries[P],D=q.completion;if(q.tryLoc==="root")return E("end");if(q.tryLoc<=this.prev){var X=a.call(q,"catchLoc"),ne=a.call(q,"finallyLoc");if(X&&ne){if(this.prev<q.catchLoc)return E(q.catchLoc,!0);if(this.prev<q.finallyLoc)return E(q.finallyLoc)}else if(X){if(this.prev<q.catchLoc)return E(q.catchLoc,!0)}else{if(!ne)throw new Error("try statement without catch or finally");if(this.prev<q.finallyLoc)return E(q.finallyLoc)}}}},abrupt:function(v,A){for(var E=this.tryEntries.length-1;E>=0;--E){var P=this.tryEntries[E];if(P.tryLoc<=this.prev&&a.call(P,"finallyLoc")&&this.prev<P.finallyLoc){var q=P;break}}q&&(v==="break"||v==="continue")&&q.tryLoc<=A&&A<=q.finallyLoc&&(q=null);var D=q?q.completion:{};return D.type=v,D.arg=A,q?(this.method="next",this.next=q.finallyLoc,T):this.complete(D)},complete:function(v,A){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&A&&(this.next=A),T},finish:function(v){for(var A=this.tryEntries.length-1;A>=0;--A){var E=this.tryEntries[A];if(E.finallyLoc===v)return this.complete(E.completion,E.afterLoc),I(E),T}},catch:function(v){for(var A=this.tryEntries.length-1;A>=0;--A){var E=this.tryEntries[A];if(E.tryLoc===v){var P=E.completion;if(P.type==="throw"){var q=P.arg;I(E)}return q}}throw new Error("illegal catch attempt")},delegateYield:function(v,A,E){return this.delegate={iterator:b(v),resultName:A,nextLoc:E},this.method==="next"&&(this.arg=r),T}},i}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(Ld);var Gb=Ld.exports,Ro=Gb(),Qb=Ro;try{regeneratorRuntime=Ro}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=Ro:Function("r","regeneratorRuntime = r")(Ro)}const Fd=Vd(Qb),fA="";/*!
1
+ (function(_e,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],l):(_e=typeof globalThis<"u"?globalThis:_e||self,l(_e.HemaTournamentUI={},_e.Vue))})(this,function(_e,l){"use strict";const Fe=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},qh={name:"BaseIcon",props:{iconName:{type:String,required:!0},style:{type:String,default:"fa-solid",validator:function(n){return["fa-solid","fa-regular","fa-solid","fa-light","fa-thing"].indexOf(n)!==-1}},size:{type:String,validator:function(n){return["xs","sm","md","lg","xl","2xl","3xl","4xl"].indexOf(n)!==-1},default:"sm"},color:{type:String,default:"primary"}},computed:{computedIconClass(){return[this.style,this.iconName,`text-${this.size}`,this.colorClass]},colorClass(){return`text-${this.color}`}}};function Kh(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("i",{class:l.normalizeClass(o.computedIconClass)},null,2)}const hc=Fe(qh,[["render",Kh]]),Gh={name:"BaseInput",props:{placeholder:{type:String,default:""},value:{type:String,default:""},type:{type:String,default:"borderless",validator:function(n){return["formInput","borderless"].indexOf(n)!==-1}},invalid:{type:Boolean,default:!1}},setup(n,{emit:e}){const t=l.ref(n.value),r=l.ref(null);l.watch(()=>n.value,a=>{t.value=a});const i=l.computed(()=>{let a="appearance-none focus:outline-none";switch(n.type){case"borderless":a+=" w-full text-sm";break;case"formInput":a+=" border rounded-lg text-secondary placeholder:text-xs text-sm p-2 w-full",n.invalid?a+=" border-alarm":a+=" border border-dropdownSelect";break}return a});return{internalValue:t,baseClasses:i,onInput:()=>{clearTimeout(r.value),r.value=setTimeout(()=>{e("update:value",t.value)},300)}}}},Qh=["placeholder"];function Jh(n,e,t,r,i,o){return l.withDirectives((l.openBlock(),l.createElementBlock("input",{class:l.normalizeClass(r.baseClasses),placeholder:t.placeholder,"onUpdate:modelValue":e[0]||(e[0]=a=>r.internalValue=a),onInput:e[1]||(e[1]=(...a)=>r.onInput&&r.onInput(...a))},null,42,Qh)),[[l.vModelText,r.internalValue]])}const bo=Fe(Gh,[["render",Jh]]),Xh={name:"BaseRadioGroup",props:{invalid:{type:Boolean,default:!1},items:{type:Array,required:!0}},data(){return{selectedIndex:null}},methods:{selectItem(n){this.selectedIndex=n,this.$emit("update:value",this.items[n].value)}}},Zh={class:"text-xl",role:"radiogroup"},em=["onClick","aria-checked","onKeydown"],tm={class:"flex flex-col"};function nm(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",Zh,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.items,(a,s)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["flex flex-row p-4 text-quaternary rounded-lg mb-2 shadow border hover:bg-tertiary",[i.selectedIndex===s?" bg-tertiary":" bg-white",t.invalid?" border-alarm":" border-dropdownSelect"]]),key:s,onClick:c=>o.selectItem(s),role:"radio","aria-checked":i.selectedIndex===s?"true":"false",tabindex:"0",onKeydown:l.withKeys(l.withModifiers(c=>o.selectItem(s),["prevent"]),["enter"])},[l.createElementVNode("i",{class:l.normalizeClass([[i.selectedIndex===s?"fa-circle-dot text-quaternary ":"fa-circle "],"fa-regular pr-4 pt-2"])},null,2),l.createElementVNode("div",tm,[l.createElementVNode("p",{class:l.normalizeClass([[i.selectedIndex===s?"text-quaternary ":""],"font-bold text-sm"])},l.toDisplayString(a.label),3),l.createElementVNode("p",{class:l.normalizeClass([[i.selectedIndex===s?"text-quaternary ":""],"text-sm"])},l.toDisplayString(a.description),3)])],42,em))),128))])}const mc=Fe(Xh,[["render",nm]]),rm={name:"base-tag",props:{label:{type:String,required:!0},backgroundColor:{type:String,validator:function(n){return["primary","secondary","tertiary","neutral","bright"].indexOf(n)!==-1}}},setup(n){return n=l.reactive(n),{classes:l.computed(()=>{let e="cursor-pointer inline-block py-1 px-3 my-2 ml-3 text-xs font-normal rounded-full text-neutral";switch(n.backgroundColor){case"primary":e+=" bg-primary";break;case"secondary":e+=" bg-secondary";break;case"tertiary":e+=" bg-tertiary";break;case"neutral":e+=" bg-neutral";break;case"bright":e+=" bg-bright";break;default:e+=" bg-primary";break}return e})}}};function im(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(r.classes)},l.toDisplayString(t.label),3)}const gc=Fe(rm,[["render",im]]),om={name:"BaseText",props:{text:{type:String,required:!0,default:""},weight:{type:String,default:"normal",validator:function(n){return["light","normal","medium","semi-bold","bold","extra-bold"].indexOf(n)!==-1}},size:{type:String,default:"sm",validator:function(n){return["xs","sm","md","lg","xl","2xl","3xl"].indexOf(n)!==-1}},color:{type:String,default:"primary",validator:function(n){return["neutral","quaternary","tertiary","secondary","primary","bright","primaryHighlight","alarm"].indexOf(n)!==-1}},invalid:{type:Boolean,default:!1},hoverColor:{type:String,default:"none",validator:function(n){return["primary","secondary","tertiary","quaternary","neutral","bright","none"].indexOf(n)!==-1}}},setup(n){return{classes:l.computed(()=>{let e="";switch(n.color){case"neutral":e+=" text-neutral";break;case"tertiary":e+=" text-tertiary";break;case"secondary":e+=" text-secondary";break;case"quaternary":e+=" text-quaternary";break;case"primary":e+=" text-primary";break;case"primaryHighlight":e+=" text-primaryHighlight";break;case"bright":e+=" text-bright";break;case"alarm":e+=" text-alarmText";break}switch(n.invalid&&(e=" text-alarm"),n.hoverColor){case"neutral":e+=" hover:text-neutral";break;case"tertiary":e+=" hover:text-tertiary";break;case"secondary":e+=" hover:text-secondary";break;case"quaternary":e+=" hover:text-quaternary";break;case"primary":e+=" hover:text-primary";break;case"bright":e+=" hover:text-bright";break;case"none":e+="";break}switch(n.weight){case"light":e+=" font-light";break;case"normal":e+=" font-normal";break;case"medium":e+=" font-medium";break;case"semi-bold":e+=" font-semibold";break;case"bold":e+=" font-bold";break;case"extra-bold":e+=" font-extrabold";break}switch(n.size){case"xs":e+=" text-xs";break;case"sm":e+=" text-sm";break;case"md":e+=" text-md";break;case"lg":e+=" text-lg";break;case"xl":e+=" text-xl";break;case"2xl":e+=" text-2xl";break;case"3xl":e+=" text-3xl";break}return e})}}};function am(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(r.classes)},l.toDisplayString(t.text),3)}const Bn=Fe(om,[["render",am]]),sm={name:"Breadcrumb",components:{BaseText:Bn},props:{items:{type:Array,required:!0,default:()=>[]},onLinkClick:{type:Function,default:()=>{}}}},lm={class:"flex flex-row"};function cm(n,e,t,r,i,o){const a=l.resolveComponent("BaseText"),s=l.resolveComponent("router-link");return l.openBlock(),l.createElementBlock("nav",lm,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.items,(c,d)=>(l.openBlock(),l.createElementBlock("div",{key:d},[d>0?(l.openBlock(),l.createBlock(a,{key:0,text:" > ",size:"lg",color:"quaternary",class:"mr-2"})):l.createCommentVNode("",!0),c.link?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(a,{key:1,class:"mr-2",text:c.text,size:"lg",color:"quaternary"},null,8,["text"])),c.link?(l.openBlock(),l.createBlock(s,{key:2,to:c.link,onClick:t.onLinkClick,class:"mr-2"},{default:l.withCtx(()=>[l.createVNode(a,{text:c.text,size:"lg",color:"quaternary","hover-color":"bright",class:"underline"},null,8,["text"])]),_:2},1032,["to","onClick"])):l.createCommentVNode("",!0)]))),128))])}const dm=Fe(sm,[["render",cm]]),um={name:"base-button",components:{BaseText:Bn,BaseIcon:hc},props:{label:{type:String,required:!0},iconName:{type:String,default:""},iconStyle:{type:String,default:"fa-solid",validator:n=>["fa-solid","fa-regular","fa-light","fa-thing"].includes(n)},size:{type:String,default:"sm",validator:n=>["xs","sm","md","lg","xl","2xl","3xl","4xl"].includes(n)},type:{type:String,default:"primary",validator:n=>["primary","secondary","tertiary","bright","admin","adminSecondary","continue","iconOnly","editor"].includes(n)},selected:{type:Boolean,default:!1}},emits:["click"],setup(n,{emit:e}){const t={primary:"px-2.5 mx-1 py-0.5 items-center gap-2.5 rounded-md text-center shadow border border-dropdownSelect justify-center hover:bg-tertiary "+(n.selected?"bg-dropdownSelect":"bg-neutral"),secondary:"px-2.5 mx-1 py-0.5 items-center gap-2.5 rounded-md text-center shadow justify-center hover:bg-primary text-neutral "+(n.selected?"bg-dropdownSelect":"bg-secondary"),tertiary:"px-2.5 mx-1 py-0.5 items-center gap-2.5 rounded-md text-center justify-center hover:bg-primary text-primary "+(n.selected?"bg-primary":"bg-tertiary"),bright:"px-2.5 mx-1 py-0.5 items-center gap-2.5 rounded-md text-center justify-center hover:bg-primary text-neutral "+(n.selected?"bg-primary":"bg-bright"),admin:"px-2.5 mx-1 py-2 items-center rounded-md gap-2.5 text-center hover:bg-primary my-1 text-neutral hover:bg-primaryHighlight "+(n.selected,"bg-primary"),adminSecondary:"px-2.5 mx-1 py-0.5 items-center gap-2.5 text-center my-1 pb-0.5 border-b border-secondary hover:border-b hover:border-neutral w-11/12 text-neutral "+(n.selected,"bg-primary"),continue:"px-2.5 mx-1 items-center gap-2.5 text-center my-1 p-3 border-b border-secondary hover:border-b hover:border-neutral w-full rounded-lg flex flex-row justify-center "+(n.selected?"bg-secondary":"bg-primary"),iconOnly:"py-0.5 items-center rounded-md text-center shadow border border-dropdownSelect justify-center hover:bg-tertiary",editor:"px-1 items-center rounded-md text-center justify-center hover:bg-tertiary"},r={xs:"text-xs",sm:"text-sm",md:"text-md",lg:"text-lg",xl:"text-xl","2xl":"text-2xl","3xl":"text-3xl","4xl":"text-4xl"};return{textColor:l.computed(()=>({primary:"primary",secondary:"secondary",tertiary:"tertiary",bright:"bright",admin:"neutral",adminSecondary:"neutral",continue:"neutral",editor:n.selected?"bright":"quaternary"})[n.type]),classes:l.computed(()=>{let i="inline-flex",o=t[n.type];if(n.selected)switch(n.type){case"primary":o=o.replace("bg-neutral","bg-dropdownSelect");break;case"secondary":o=o.replace("bg-secondary","bg-dropdownSelect");break}let a=r[n.size];return`${i} ${o} ${a}`}),onClick(){e("click")}}}};function fm(n,e,t,r,i,o){const a=l.resolveComponent("BaseIcon"),s=l.resolveComponent("BaseText");return l.openBlock(),l.createElementBlock("button",{"data-testid":"base-button",class:l.normalizeClass(r.classes),type:"button",onClick:e[0]||(e[0]=(...c)=>r.onClick&&r.onClick(...c))},[t.iconName?(l.openBlock(),l.createBlock(a,{key:0,"data-testid":"base-icon","icon-name":t.iconName,style:l.normalizeStyle(t.iconStyle),color:r.textColor,size:t.size},null,8,["icon-name","style","color","size"])):l.createCommentVNode("",!0),l.createVNode(s,{"data-testid":"base-text",color:r.textColor,size:t.size,text:t.label,weight:"normal"},null,8,["color","size","text"])],2)}const Rr=Fe(um,[["render",fm]]),pm={name:"tournament-card-details",components:{BaseButton:Rr,BaseText:Bn},props:{detail:{type:Object,required:!0,default:()=>({name:"",date:"",closes:"",location:""})}}},hm={class:"flex flex-col w-full pt-4 pb-3 px-3"},mm={class:"mt-4 flex flex-col"},gm={class:"flex flex-row w-full justify-end"};function ym(n,e,t,r,i,o){const a=l.resolveComponent("BaseText"),s=l.resolveComponent("BaseButton");return l.openBlock(),l.createElementBlock("div",hm,[l.createVNode(a,{text:t.detail.name,color:"primary",size:"xl",weight:"semi-bold"},null,8,["text"]),l.createVNode(a,{text:t.detail.location,color:"primary",size:"sm",weight:"normal"},null,8,["text"]),l.createElementVNode("div",mm,[l.createVNode(a,{text:`${t.detail.date}`,color:"primaryHighlight",size:"sm",weight:"light"},null,8,["text"]),l.createVNode(a,{text:`${t.detail.closes}`,color:"primaryHighlight",size:"sm",weight:"light"},null,8,["text"])]),l.createElementVNode("div",gm,[l.createVNode(s,{label:"Edit",class:"mt-2",primary:""})])])}const yc=Fe(pm,[["render",ym]]),vc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADICAYAAABS39xVAAAAAXNSR0IArs4c6QAABdlJREFUeF7t1AEJACAQBEGNaiOzWkDBFgvzCY655+ba5w5HgACBgMA0WIGWRCRA4AsYLI9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBB4p/0F3nyMcxwAAAABJRU5ErkJggg==",vm={name:"tournament-card-header",components:{BaseTag:gc},props:{artwork:{type:String,required:!0,default:vc},tags:{type:Array,default:()=>[]}},computed:{backgroundStyle(){return`background-image: url('${this.artwork||vc}');`}}},bm={class:"rounded-t-xl w-full"},wm={class:"flex flex-row"};function km(n,e,t,r,i,o){const a=l.resolveComponent("BaseTag");return l.openBlock(),l.createElementBlock("div",bm,[l.createElementVNode("div",{style:l.normalizeStyle(o.backgroundStyle),class:"h-36 w-full flex flex-col justify-end rounded-t-xl bg-cover bg-no-repeat bg-center"},[l.createElementVNode("div",wm,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.tags,s=>(l.openBlock(),l.createBlock(a,{key:s,label:s},null,8,["label"]))),128))])],4)])}const bc=Fe(vm,[["render",km]]),xm={name:"DropDownMenu",components:{BaseText:Bn},props:{label:{type:String},items:{type:Array,validator:n=>n.every(e=>typeof e.text=="string")},selectedItem:{type:Object,default:()=>({text:""}),validator:n=>typeof n.text=="string"}},data:()=>({isDropDownOpen:!1}),methods:{handleClick(n){this.isDropDownOpen=!1,this.$emit("update:selectedItem",n)},handleDropDown(){this.isDropDownOpen=!this.isDropDownOpen}}},Cm={class:"flex flex-row"},Mm=l.createElementVNode("i",{class:"fa-solid fa-chevron-down text-xs"},null,-1),Tm={key:0,class:"flex flex-col w-32 shadow mt-2 z-10 rounded-xl py-1 absolute bg-neutral"},Sm=["onClick"];function Dm(n,e,t,r,i,o){const a=l.resolveComponent("BaseText");return l.openBlock(),l.createElementBlock("div",Cm,[l.createElementVNode("span",null,[l.createElementVNode("div",{class:"z-10 rounded-lg shadow px-2 py-2 w-40 flex flex-row justify-between",onClick:e[0]||(e[0]=s=>o.handleDropDown())},[l.createVNode(a,{text:t.label,color:"quaternary",size:"sm",weight:"normal"},null,8,["text"]),l.createVNode(a,{text:t.selectedItem.text,color:"secondary",size:"sm",weight:"normal"},null,8,["text"]),Mm]),n.isDropDownOpen?(l.openBlock(),l.createElementBlock("div",Tm,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.items,s=>(l.openBlock(),l.createElementBlock("a",{key:s.id,onClick:c=>o.handleClick(s),class:"hover:bg-dropdownSelect py-1 px-2 border-b border-dropdownSelect last:border-0"},[l.createVNode(a,{text:s.text,color:"primary",size:"xs",weight:"normal"},null,8,["text"])],8,Sm))),128))])):l.createCommentVNode("",!0)])])}const _a=Fe(xm,[["render",Dm]]),Am={name:"FilterAndSortBar",components:{DropDownMenu:_a,BaseInput:bo},props:{label:{type:String},items:{type:Array,default:()=>[]},selectedItem:null},data(){return{filterText:"",localSelectedItem:this.selectedItem}},methods:{handleFilter(n){this.$emit("filterbar",n)},handleSelectedItem(n){this.$emit("sort",n),this.localSelectedItem=n}}},Em={class:"flex flex-row w-full justify-between"},Om={class:"rounded-lg shadow px-2 py-1 w-full flex flex-row mt-0.5 mr-4"},Nm=l.createElementVNode("i",{class:"fa-solid fa-magnifying-glass text-primaryHighlight w-6 mt-1"},null,-1);function _m(n,e,t,r,i,o){const a=l.resolveComponent("BaseInput"),s=l.resolveComponent("DropDownMenu");return l.openBlock(),l.createElementBlock("section",Em,[l.createElementVNode("div",Om,[Nm,l.createVNode(a,{placeholder:"Search on Name, Location, or Date",class:"text-quaternary",value:i.filterText,"onUpdate:value":o.handleFilter},null,8,["value","onUpdate:value"])]),l.createElementVNode("div",null,[l.createVNode(s,{label:t.label,items:t.items,selectedItem:i.localSelectedItem,"onUpdate:selectedItem":o.handleSelectedItem},null,8,["label","items","selectedItem","onUpdate:selectedItem"])])])}const wc=Fe(Am,[["render",_m]]),Bm={name:"FilterUpcomingPast",components:{BaseText:Bn,BaseButton:Rr,DropDownMenu:_a,BaseInput:bo},props:{selected:{type:String,default:"All"}},data(){return{localSelected:this.selected}},methods:{handleTimeFrame(n){this.$emit("timeFrame",n),this.localSelected=n}}},Pm={class:"flex flex-row w-full justify-between"},Im={class:"rounded-lg w-3/4"},Rm={class:"flex flex-row h-8 w-1/4 justify-end"};function Vm(n,e,t,r,i,o){const a=l.resolveComponent("BaseText"),s=l.resolveComponent("BaseButton");return l.openBlock(),l.createElementBlock("section",Pm,[l.createElementVNode("div",Im,[l.createVNode(a,{text:"Tournament",color:"primary",size:"2xl",weight:"normal"})]),l.createElementVNode("div",Rm,[l.createVNode(s,{label:"All",color:"primary",size:"sm",selected:i.localSelected==="All",onClick:e[0]||(e[0]=c=>o.handleTimeFrame("ALL"))},null,8,["selected"]),l.createVNode(s,{label:"Upcoming",color:"primary",size:"sm",selected:i.localSelected==="Upcoming",onClick:e[1]||(e[1]=c=>o.handleTimeFrame("Upcoming"))},null,8,["selected"]),l.createVNode(s,{label:"Past",color:"primary",size:"sm",selected:i.localSelected==="Past",onClick:e[2]||(e[2]=c=>o.handleTimeFrame("Past"))},null,8,["selected"])])])}const kc=Fe(Bm,[["render",Vm]]),xc={subpremise:"short_name",street_number:"short_name",route:"long_name",locality:"long_name",administrative_area_level_1:"short_name",administrative_area_level_2:"long_name",country:"long_name",postal_code:"short_name"},Lm=["locality","administrative_area_level_3"],$m=["locality","sublocality","postal_code","country","administrative_area_level_1","administrative_area_level_2"],Fm=["address_components","adr_address","alt_id","formatted_address","geometry","icon","id","name","business_status","photo","place_id","scope","type","url","utc_offset_minutes","vicinity"],zm={name:"VueGoogleAutocomplete",props:{id:{type:String,required:!0},classname:String,placeholder:{type:String,default:"Start typing"},disabled:{type:Boolean,default:!1},types:{type:String,default:"address"},fields:{type:Array,default:function(){return Fm}},country:{type:[String,Array],default:null},enableGeolocation:{type:Boolean,default:!1},geolocationOptions:{type:Object,default:null}},data(){return{autocomplete:null,autocompleteText:"",geolocation:{geocoder:null,loc:null,position:null}}},watch:{autocompleteText:function(n,e){this.$emit("inputChange",{newVal:n,oldVal:e},this.id)},country:function(n,e){this.autocomplete.setComponentRestrictions({country:this.country===null?[]:this.country})}},mounted:function(){const n={};this.types&&(n.types=[this.types]),this.country&&(n.componentRestrictions={country:this.country}),this.autocomplete=new google.maps.places.Autocomplete(document.getElementById(this.id),n),this.autocomplete.setFields(this.fields),this.autocomplete.addListener("place_changed",this.onPlaceChanged)},methods:{onPlaceChanged(){let n=this.autocomplete.getPlace();if(!n.geometry){this.$emit("no-results-found",n,this.id);return}n.address_components!==void 0&&(this.$emit("placechanged",this.formatResult(n),n,this.id),this.autocompleteText=document.getElementById(this.id).value,this.onChange())},onFocus(){this.biasAutocompleteLocation(),this.$emit("focus")},onBlur(){this.$emit("blur")},onChange(){this.$emit("change",this.autocompleteText)},onKeyPress(n){this.$emit("keypress",n)},onKeyUp(n){this.$emit("keyup",n)},clear(){this.autocompleteText=""},focus(){this.$refs.autocomplete.focus()},blur(){this.$refs.autocomplete.blur()},update(n){this.autocompleteText=n},updateCoordinates(n){!n&&!(n.lat||n.lng)||(this.geolocation.geocoder||(this.geolocation.geocoder=new google.maps.Geocoder),this.geolocation.geocoder.geocode({location:n},(e,t)=>{t==="OK"?(e=this.filterGeocodeResultTypes(e),e[0]?(this.$emit("placechanged",this.formatResult(e[0]),e[0],this.id),this.update(e[0].formatted_address)):this.$emit("error","no result for provided coordinates")):this.$emit("error","error getting address from coords")}))},geolocate(){this.updateGeolocation((n,e)=>{this.updateCoordinates(n)})},updateGeolocation(n=null){if(navigator.geolocation){let e={};this.geolocationOptions&&Object.assign(e,this.geolocationOptions),navigator.geolocation.getCurrentPosition(t=>{let r={lat:t.coords.latitude,lng:t.coords.longitude};this.geolocation.loc=r,this.geolocation.position=t,n&&n(r,t)},t=>{this.$emit("error","Cannot get Coordinates from navigator",t)},e)}},biasAutocompleteLocation(){this.enableGeolocation&&this.updateGeolocation((n,e)=>{let t=new google.maps.Circle({center:n,radius:e.coords.accuracy});this.autocomplete.setBounds(t.getBounds())})},formatResult(n){let e={};for(let t=0;t<n.address_components.length;t++){let r=n.address_components[t].types[0];if(xc[r]){let i=n.address_components[t][xc[r]];e[r]=i}}return e.latitude=n.geometry.location.lat(),e.longitude=n.geometry.location.lng(),e},filterGeocodeResultTypes(n){if(!n||!this.types)return n;let e=[],t=[this.types];t.includes("(cities)")&&(t=t.concat(Lm)),t.includes("(regions)")&&(t=t.concat($m));for(let r of n)for(let i of r.types)if(t.includes(i)){e.push(r);break}return e}}},Hm=["id","placeholder","disabled"];function Ym(n,e,t,r,i,o){return l.withDirectives((l.openBlock(),l.createElementBlock("input",{ref:"autocomplete",type:"text",class:l.normalizeClass(t.classname),id:t.id,placeholder:t.placeholder,disabled:t.disabled,"onUpdate:modelValue":e[0]||(e[0]=a=>i.autocompleteText=a),onFocus:e[1]||(e[1]=a=>o.onFocus()),onBlur:e[2]||(e[2]=a=>o.onBlur()),onChange:e[3]||(e[3]=(...a)=>o.onChange&&o.onChange(...a)),onKeypress:e[4]||(e[4]=(...a)=>o.onKeyPress&&o.onKeyPress(...a)),onKeyup:e[5]||(e[5]=(...a)=>o.onKeyUp&&o.onKeyUp(...a))},null,42,Hm)),[[l.vModelText,i.autocompleteText]])}const Um={components:{VueGoogleAutocomplete:Fe(zm,[["render",Ym]])},props:{invalid:{type:Boolean,default:!1}},data(){return{address:"",coordinates:""}},methods:{getAddressData(n){const e=`${n.street_number} ${n.route}`,t=n.locality,r=n.administrative_area_level_1;this.address=`${e}, ${t}, ${r}`,this.coordinates=`${n.latitude},${n.longitude}`;const i={address:this.address,coordinates:this.coordinates};this.$emit("update:address",i)}}};function jm(n,e,t,r,i,o){const a=l.resolveComponent("vue-google-autocomplete");return l.openBlock(),l.createBlock(a,{class:l.normalizeClass(["border rounded-lg text-secondary text-xs p-2 w-full appearance-none focus:outline-none",t.invalid?"border-alarm":"border-dropdownSelect"]),id:"map",ref:"address",modelValue:i.address,"onUpdate:modelValue":e[0]||(e[0]=s=>i.address=s),placeholder:"Venue Address",onPlacechanged:o.getAddressData},null,8,["class","modelValue","onPlacechanged"])}const Cc=Fe(Um,[["render",jm]]);function Pt(n){"@babel/helpers - typeof";return Pt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pt(n)}function pe(n){if(n===null||n===!0||n===!1)return NaN;var e=Number(n);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function se(n,e){if(e.length<n)throw new TypeError(n+" argument"+(n>1?"s":"")+" required, but only "+e.length+" present")}function ue(n){se(1,arguments);var e=Object.prototype.toString.call(n);return n instanceof Date||Pt(n)==="object"&&e==="[object Date]"?new Date(n.getTime()):typeof n=="number"||e==="[object Number]"?new Date(n):((typeof n=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Cn(n,e){se(2,arguments);var t=ue(n),r=pe(e);return isNaN(r)?new Date(NaN):(r&&t.setDate(t.getDate()+r),t)}function jt(n,e){se(2,arguments);var t=ue(n),r=pe(e);if(isNaN(r))return new Date(NaN);if(!r)return t;var i=t.getDate(),o=new Date(t.getTime());o.setMonth(t.getMonth()+r+1,0);var a=o.getDate();return i>=a?o:(t.setFullYear(o.getFullYear(),o.getMonth(),i),t)}function Mc(n,e){if(se(2,arguments),!e||Pt(e)!=="object")return new Date(NaN);var t=e.years?pe(e.years):0,r=e.months?pe(e.months):0,i=e.weeks?pe(e.weeks):0,o=e.days?pe(e.days):0,a=e.hours?pe(e.hours):0,s=e.minutes?pe(e.minutes):0,c=e.seconds?pe(e.seconds):0,d=ue(n),u=r||t?jt(d,r+t*12):d,f=o||i?Cn(u,o+i*7):u,p=s+a*60,h=c+p*60,m=h*1e3,g=new Date(f.getTime()+m);return g}function Wm(n,e){se(2,arguments);var t=ue(n).getTime(),r=pe(e);return new Date(t+r)}var qm={};function on(){return qm}function lr(n,e){var t,r,i,o,a,s,c,d;se(1,arguments);var u=on(),f=pe((t=(r=(i=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(c=u.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&t!==void 0?t:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=ue(n),h=p.getDay(),m=(h<f?7:0)+h-f;return p.setDate(p.getDate()-m),p.setHours(0,0,0,0),p}function wo(n){return se(1,arguments),lr(n,{weekStartsOn:1})}function Km(n){se(1,arguments);var e=ue(n),t=e.getFullYear(),r=new Date(0);r.setFullYear(t+1,0,4),r.setHours(0,0,0,0);var i=wo(r),o=new Date(0);o.setFullYear(t,0,4),o.setHours(0,0,0,0);var a=wo(o);return e.getTime()>=i.getTime()?t+1:e.getTime()>=a.getTime()?t:t-1}function Gm(n){se(1,arguments);var e=Km(n),t=new Date(0);t.setFullYear(e,0,4),t.setHours(0,0,0,0);var r=wo(t);return r}function ko(n){var e=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return e.setUTCFullYear(n.getFullYear()),n.getTime()-e.getTime()}function Tc(n){se(1,arguments);var e=ue(n);return e.setHours(0,0,0,0),e}var Qm=864e5;function Jm(n,e){se(2,arguments);var t=Tc(n),r=Tc(e),i=t.getTime()-ko(t),o=r.getTime()-ko(r);return Math.round((i-o)/Qm)}function Xm(n,e){se(2,arguments);var t=pe(e),r=t*3;return jt(n,r)}function Ba(n,e){se(2,arguments);var t=pe(e);return jt(n,t*12)}var Pa=6e4,Ia=36e5,Zm=1e3;function Sc(n){return se(1,arguments),n instanceof Date||Pt(n)==="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Mi(n){if(se(1,arguments),!Sc(n)&&typeof n!="number")return!1;var e=ue(n);return!isNaN(Number(e))}function Dc(n,e){var t;se(1,arguments);var r=n||{},i=ue(r.start),o=ue(r.end),a=o.getTime();if(!(i.getTime()<=a))throw new RangeError("Invalid interval");var s=[],c=i;c.setHours(0,0,0,0);var d=Number((t=e==null?void 0:e.step)!==null&&t!==void 0?t:1);if(d<1||isNaN(d))throw new RangeError("`options.step` must be a number greater than 1");for(;c.getTime()<=a;)s.push(ue(c)),c.setDate(c.getDate()+d),c.setHours(0,0,0,0);return s}function Ti(n){se(1,arguments);var e=ue(n),t=e.getMonth(),r=t-t%3;return e.setMonth(r,1),e.setHours(0,0,0,0),e}function eg(n){se(1,arguments);var e=n||{},t=ue(e.start),r=ue(e.end),i=r.getTime();if(!(t.getTime()<=i))throw new RangeError("Invalid interval");var o=Ti(t),a=Ti(r);i=a.getTime();for(var s=[],c=o;c.getTime()<=i;)s.push(ue(c)),c=Xm(c,1);return s}function tg(n){se(1,arguments);var e=ue(n),t=e.getFullYear();return e.setFullYear(t+1,0,0),e.setHours(23,59,59,999),e}function ng(n){se(1,arguments);var e=ue(n),t=new Date(0);return t.setFullYear(e.getFullYear(),0,1),t.setHours(0,0,0,0),t}function rg(n,e){var t,r,i,o,a,s,c,d;se(1,arguments);var u=on(),f=pe((t=(r=(i=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(c=u.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&t!==void 0?t:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=ue(n),h=p.getDay(),m=(h<f?-7:0)+6-(h-f);return p.setDate(p.getDate()+m),p.setHours(23,59,59,999),p}function Ac(n){se(1,arguments);var e=ue(n),t=e.getMonth(),r=t-t%3+3;return e.setMonth(r,0),e.setHours(23,59,59,999),e}function Ec(n,e){se(2,arguments);var t=pe(e);return Wm(n,-t)}var ig=864e5;function og(n){se(1,arguments);var e=ue(n),t=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var r=e.getTime(),i=t-r;return Math.floor(i/ig)+1}function Vr(n){se(1,arguments);var e=1,t=ue(n),r=t.getUTCDay(),i=(r<e?7:0)+r-e;return t.setUTCDate(t.getUTCDate()-i),t.setUTCHours(0,0,0,0),t}function Oc(n){se(1,arguments);var e=ue(n),t=e.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(t+1,0,4),r.setUTCHours(0,0,0,0);var i=Vr(r),o=new Date(0);o.setUTCFullYear(t,0,4),o.setUTCHours(0,0,0,0);var a=Vr(o);return e.getTime()>=i.getTime()?t+1:e.getTime()>=a.getTime()?t:t-1}function ag(n){se(1,arguments);var e=Oc(n),t=new Date(0);t.setUTCFullYear(e,0,4),t.setUTCHours(0,0,0,0);var r=Vr(t);return r}var sg=6048e5;function Nc(n){se(1,arguments);var e=ue(n),t=Vr(e).getTime()-ag(e).getTime();return Math.round(t/sg)+1}function cr(n,e){var t,r,i,o,a,s,c,d;se(1,arguments);var u=on(),f=pe((t=(r=(i=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(c=u.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&t!==void 0?t:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=ue(n),h=p.getUTCDay(),m=(h<f?7:0)+h-f;return p.setUTCDate(p.getUTCDate()-m),p.setUTCHours(0,0,0,0),p}function Ra(n,e){var t,r,i,o,a,s,c,d;se(1,arguments);var u=ue(n),f=u.getUTCFullYear(),p=on(),h=pe((t=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&i!==void 0?i:p.firstWeekContainsDate)!==null&&r!==void 0?r:(c=p.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var m=new Date(0);m.setUTCFullYear(f+1,0,h),m.setUTCHours(0,0,0,0);var g=cr(m,e),k=new Date(0);k.setUTCFullYear(f,0,h),k.setUTCHours(0,0,0,0);var x=cr(k,e);return u.getTime()>=g.getTime()?f+1:u.getTime()>=x.getTime()?f:f-1}function lg(n,e){var t,r,i,o,a,s,c,d;se(1,arguments);var u=on(),f=pe((t=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&i!==void 0?i:u.firstWeekContainsDate)!==null&&r!==void 0?r:(c=u.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&t!==void 0?t:1),p=Ra(n,e),h=new Date(0);h.setUTCFullYear(p,0,f),h.setUTCHours(0,0,0,0);var m=cr(h,e);return m}var cg=6048e5;function _c(n,e){se(1,arguments);var t=ue(n),r=cr(t,e).getTime()-lg(t,e).getTime();return Math.round(r/cg)+1}function Ee(n,e){for(var t=n<0?"-":"",r=Math.abs(n).toString();r.length<e;)r="0"+r;return t+r}var dg={y:function(e,t){var r=e.getUTCFullYear(),i=r>0?r:1-r;return Ee(t==="yy"?i%100:i,t.length)},M:function(e,t){var r=e.getUTCMonth();return t==="M"?String(r+1):Ee(r+1,2)},d:function(e,t){return Ee(e.getUTCDate(),t.length)},a:function(e,t){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(e,t){return Ee(e.getUTCHours()%12||12,t.length)},H:function(e,t){return Ee(e.getUTCHours(),t.length)},m:function(e,t){return Ee(e.getUTCMinutes(),t.length)},s:function(e,t){return Ee(e.getUTCSeconds(),t.length)},S:function(e,t){var r=t.length,i=e.getUTCMilliseconds(),o=Math.floor(i*Math.pow(10,r-3));return Ee(o,t.length)}};const Pn=dg;var Lr={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ug={G:function(e,t,r){var i=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(i,{width:"abbreviated"});case"GGGGG":return r.era(i,{width:"narrow"});case"GGGG":default:return r.era(i,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){var i=e.getUTCFullYear(),o=i>0?i:1-i;return r.ordinalNumber(o,{unit:"year"})}return Pn.y(e,t)},Y:function(e,t,r,i){var o=Ra(e,i),a=o>0?o:1-o;if(t==="YY"){var s=a%100;return Ee(s,2)}return t==="Yo"?r.ordinalNumber(a,{unit:"year"}):Ee(a,t.length)},R:function(e,t){var r=Oc(e);return Ee(r,t.length)},u:function(e,t){var r=e.getUTCFullYear();return Ee(r,t.length)},Q:function(e,t,r){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Ee(i,2);case"Qo":return r.ordinalNumber(i,{unit:"quarter"});case"QQQ":return r.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,r){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Ee(i,2);case"qo":return r.ordinalNumber(i,{unit:"quarter"});case"qqq":return r.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,r){var i=e.getUTCMonth();switch(t){case"M":case"MM":return Pn.M(e,t);case"Mo":return r.ordinalNumber(i+1,{unit:"month"});case"MMM":return r.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,r){var i=e.getUTCMonth();switch(t){case"L":return String(i+1);case"LL":return Ee(i+1,2);case"Lo":return r.ordinalNumber(i+1,{unit:"month"});case"LLL":return r.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,r,i){var o=_c(e,i);return t==="wo"?r.ordinalNumber(o,{unit:"week"}):Ee(o,t.length)},I:function(e,t,r){var i=Nc(e);return t==="Io"?r.ordinalNumber(i,{unit:"week"}):Ee(i,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):Pn.d(e,t)},D:function(e,t,r){var i=og(e);return t==="Do"?r.ordinalNumber(i,{unit:"dayOfYear"}):Ee(i,t.length)},E:function(e,t,r){var i=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return r.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(i,{width:"short",context:"formatting"});case"EEEE":default:return r.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,r,i){var o=e.getUTCDay(),a=(o-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return Ee(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});case"eeee":default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,r,i){var o=e.getUTCDay(),a=(o-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return Ee(a,t.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});case"cccc":default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,r){var i=e.getUTCDay(),o=i===0?7:i;switch(t){case"i":return String(o);case"ii":return Ee(o,t.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(i,{width:"short",context:"formatting"});case"iiii":default:return r.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,r){var i=e.getUTCHours(),o=i/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,r){var i=e.getUTCHours(),o;switch(i===12?o=Lr.noon:i===0?o=Lr.midnight:o=i/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,r){var i=e.getUTCHours(),o;switch(i>=17?o=Lr.evening:i>=12?o=Lr.afternoon:i>=4?o=Lr.morning:o=Lr.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){var i=e.getUTCHours()%12;return i===0&&(i=12),r.ordinalNumber(i,{unit:"hour"})}return Pn.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):Pn.H(e,t)},K:function(e,t,r){var i=e.getUTCHours()%12;return t==="Ko"?r.ordinalNumber(i,{unit:"hour"}):Ee(i,t.length)},k:function(e,t,r){var i=e.getUTCHours();return i===0&&(i=24),t==="ko"?r.ordinalNumber(i,{unit:"hour"}):Ee(i,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):Pn.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):Pn.s(e,t)},S:function(e,t){return Pn.S(e,t)},X:function(e,t,r,i){var o=i._originalDate||e,a=o.getTimezoneOffset();if(a===0)return"Z";switch(t){case"X":return Pc(a);case"XXXX":case"XX":return dr(a);case"XXXXX":case"XXX":default:return dr(a,":")}},x:function(e,t,r,i){var o=i._originalDate||e,a=o.getTimezoneOffset();switch(t){case"x":return Pc(a);case"xxxx":case"xx":return dr(a);case"xxxxx":case"xxx":default:return dr(a,":")}},O:function(e,t,r,i){var o=i._originalDate||e,a=o.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Bc(a,":");case"OOOO":default:return"GMT"+dr(a,":")}},z:function(e,t,r,i){var o=i._originalDate||e,a=o.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Bc(a,":");case"zzzz":default:return"GMT"+dr(a,":")}},t:function(e,t,r,i){var o=i._originalDate||e,a=Math.floor(o.getTime()/1e3);return Ee(a,t.length)},T:function(e,t,r,i){var o=i._originalDate||e,a=o.getTime();return Ee(a,t.length)}};function Bc(n,e){var t=n>0?"-":"+",r=Math.abs(n),i=Math.floor(r/60),o=r%60;if(o===0)return t+String(i);var a=e||"";return t+String(i)+a+Ee(o,2)}function Pc(n,e){if(n%60===0){var t=n>0?"-":"+";return t+Ee(Math.abs(n)/60,2)}return dr(n,e)}function dr(n,e){var t=e||"",r=n>0?"-":"+",i=Math.abs(n),o=Ee(Math.floor(i/60),2),a=Ee(i%60,2);return r+o+t+a}const fg=ug;var Ic=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Rc=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},pg=function(e,t){var r=e.match(/(P+)(p+)?/)||[],i=r[1],o=r[2];if(!o)return Ic(e,t);var a;switch(i){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",Ic(i,t)).replace("{{time}}",Rc(o,t))},hg={p:Rc,P:pg};const Va=hg;var mg=["D","DD"],gg=["YY","YYYY"];function Vc(n){return mg.indexOf(n)!==-1}function Lc(n){return gg.indexOf(n)!==-1}function xo(n,e,t){if(n==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var yg={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},vg=function(e,t,r){var i,o=yg[e];return typeof o=="string"?i=o:t===1?i=o.one:i=o.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+i:i+" ago":i};const bg=vg;function La(n){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.width?String(e.width):n.defaultWidth,r=n.formats[t]||n.formats[n.defaultWidth];return r}}var wg={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},kg={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},xg={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Cg={date:La({formats:wg,defaultWidth:"full"}),time:La({formats:kg,defaultWidth:"full"}),dateTime:La({formats:xg,defaultWidth:"full"})};const Mg=Cg;var Tg={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Sg=function(e,t,r,i){return Tg[e]};const Dg=Sg;function Si(n){return function(e,t){var r=t!=null&&t.context?String(t.context):"standalone",i;if(r==="formatting"&&n.formattingValues){var o=n.defaultFormattingWidth||n.defaultWidth,a=t!=null&&t.width?String(t.width):o;i=n.formattingValues[a]||n.formattingValues[o]}else{var s=n.defaultWidth,c=t!=null&&t.width?String(t.width):n.defaultWidth;i=n.values[c]||n.values[s]}var d=n.argumentCallback?n.argumentCallback(e):e;return i[d]}}var Ag={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Eg={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Og={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Ng={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},_g={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Bg={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Pg=function(e,t){var r=Number(e),i=r%100;if(i>20||i<10)switch(i%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},Ig={ordinalNumber:Pg,era:Si({values:Ag,defaultWidth:"wide"}),quarter:Si({values:Eg,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:Si({values:Og,defaultWidth:"wide"}),day:Si({values:Ng,defaultWidth:"wide"}),dayPeriod:Si({values:_g,defaultWidth:"wide",formattingValues:Bg,defaultFormattingWidth:"wide"})};const Rg=Ig;function Di(n){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.width,i=r&&n.matchPatterns[r]||n.matchPatterns[n.defaultMatchWidth],o=e.match(i);if(!o)return null;var a=o[0],s=r&&n.parsePatterns[r]||n.parsePatterns[n.defaultParseWidth],c=Array.isArray(s)?Lg(s,function(f){return f.test(a)}):Vg(s,function(f){return f.test(a)}),d;d=n.valueCallback?n.valueCallback(c):c,d=t.valueCallback?t.valueCallback(d):d;var u=e.slice(a.length);return{value:d,rest:u}}}function Vg(n,e){for(var t in n)if(n.hasOwnProperty(t)&&e(n[t]))return t}function Lg(n,e){for(var t=0;t<n.length;t++)if(e(n[t]))return t}function $g(n){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.match(n.matchPattern);if(!r)return null;var i=r[0],o=e.match(n.parsePattern);if(!o)return null;var a=n.valueCallback?n.valueCallback(o[0]):o[0];a=t.valueCallback?t.valueCallback(a):a;var s=e.slice(i.length);return{value:a,rest:s}}}var Fg=/^(\d+)(th|st|nd|rd)?/i,zg=/\d+/i,Hg={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Yg={any:[/^b/i,/^(a|c)/i]},Ug={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},jg={any:[/1/i,/2/i,/3/i,/4/i]},Wg={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},qg={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Kg={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Gg={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Qg={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Jg={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Xg={ordinalNumber:$g({matchPattern:Fg,parsePattern:zg,valueCallback:function(e){return parseInt(e,10)}}),era:Di({matchPatterns:Hg,defaultMatchWidth:"wide",parsePatterns:Yg,defaultParseWidth:"any"}),quarter:Di({matchPatterns:Ug,defaultMatchWidth:"wide",parsePatterns:jg,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:Di({matchPatterns:Wg,defaultMatchWidth:"wide",parsePatterns:qg,defaultParseWidth:"any"}),day:Di({matchPatterns:Kg,defaultMatchWidth:"wide",parsePatterns:Gg,defaultParseWidth:"any"}),dayPeriod:Di({matchPatterns:Qg,defaultMatchWidth:"any",parsePatterns:Jg,defaultParseWidth:"any"})},Zg={code:"en-US",formatDistance:bg,formatLong:Mg,formatRelative:Dg,localize:Rg,match:Xg,options:{weekStartsOn:0,firstWeekContainsDate:1}};const $c=Zg;var ey=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ty=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ny=/^'([^]*?)'?$/,ry=/''/g,iy=/[a-zA-Z]/;function In(n,e,t){var r,i,o,a,s,c,d,u,f,p,h,m,g,k,x,S,T,y;se(2,arguments);var B=String(e),w=on(),V=(r=(i=t==null?void 0:t.locale)!==null&&i!==void 0?i:w.locale)!==null&&r!==void 0?r:$c,$=pe((o=(a=(s=(c=t==null?void 0:t.firstWeekContainsDate)!==null&&c!==void 0?c:t==null||(d=t.locale)===null||d===void 0||(u=d.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&s!==void 0?s:w.firstWeekContainsDate)!==null&&a!==void 0?a:(f=w.locale)===null||f===void 0||(p=f.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&o!==void 0?o:1);if(!($>=1&&$<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var M=pe((h=(m=(g=(k=t==null?void 0:t.weekStartsOn)!==null&&k!==void 0?k:t==null||(x=t.locale)===null||x===void 0||(S=x.options)===null||S===void 0?void 0:S.weekStartsOn)!==null&&g!==void 0?g:w.weekStartsOn)!==null&&m!==void 0?m:(T=w.locale)===null||T===void 0||(y=T.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&h!==void 0?h:0);if(!(M>=0&&M<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!V.localize)throw new RangeError("locale must contain localize property");if(!V.formatLong)throw new RangeError("locale must contain formatLong property");var _=ue(n);if(!Mi(_))throw new RangeError("Invalid time value");var z=ko(_),N=Ec(_,z),W={firstWeekContainsDate:$,weekStartsOn:M,locale:V,_originalDate:_},F=B.match(ty).map(function(O){var I=O[0];if(I==="p"||I==="P"){var H=Va[I];return H(O,V.formatLong)}return O}).join("").match(ey).map(function(O){if(O==="''")return"'";var I=O[0];if(I==="'")return oy(O);var H=fg[I];if(H)return!(t!=null&&t.useAdditionalWeekYearTokens)&&Lc(O)&&xo(O,e,String(n)),!(t!=null&&t.useAdditionalDayOfYearTokens)&&Vc(O)&&xo(O,e,String(n)),H(N,O,V.localize,W);if(I.match(iy))throw new RangeError("Format string contains an unescaped latin alphabet character `"+I+"`");return O}).join("");return F}function oy(n){var e=n.match(ny);return e?e[1].replace(ry,"'"):n}function ay(n,e){if(n==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t]);return n}function sy(n){se(1,arguments);var e=ue(n),t=e.getDay();return t}function ly(n){se(1,arguments);var e=ue(n),t=e.getFullYear(),r=e.getMonth(),i=new Date(0);return i.setFullYear(t,r+1,0),i.setHours(0,0,0,0),i.getDate()}function Wt(n){se(1,arguments);var e=ue(n),t=e.getHours();return t}var cy=6048e5;function dy(n){se(1,arguments);var e=ue(n),t=wo(e).getTime()-Gm(e).getTime();return Math.round(t/cy)+1}function an(n){se(1,arguments);var e=ue(n),t=e.getMinutes();return t}function Ce(n){se(1,arguments);var e=ue(n),t=e.getMonth();return t}function $r(n){se(1,arguments);var e=ue(n),t=e.getSeconds();return t}function uy(n,e){var t,r,i,o,a,s,c,d;se(1,arguments);var u=ue(n),f=u.getFullYear(),p=on(),h=pe((t=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&i!==void 0?i:p.firstWeekContainsDate)!==null&&r!==void 0?r:(c=p.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var m=new Date(0);m.setFullYear(f+1,0,h),m.setHours(0,0,0,0);var g=lr(m,e),k=new Date(0);k.setFullYear(f,0,h),k.setHours(0,0,0,0);var x=lr(k,e);return u.getTime()>=g.getTime()?f+1:u.getTime()>=x.getTime()?f:f-1}function fy(n,e){var t,r,i,o,a,s,c,d;se(1,arguments);var u=on(),f=pe((t=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&i!==void 0?i:u.firstWeekContainsDate)!==null&&r!==void 0?r:(c=u.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&t!==void 0?t:1),p=uy(n,e),h=new Date(0);h.setFullYear(p,0,f),h.setHours(0,0,0,0);var m=lr(h,e);return m}var py=6048e5;function hy(n,e){se(1,arguments);var t=ue(n),r=lr(t,e).getTime()-fy(t,e).getTime();return Math.round(r/py)+1}function Me(n){return se(1,arguments),ue(n).getFullYear()}function Ai(n,e){se(2,arguments);var t=ue(n),r=ue(e);return t.getTime()>r.getTime()}function Ei(n,e){se(2,arguments);var t=ue(n),r=ue(e);return t.getTime()<r.getTime()}function Fr(n,e){se(2,arguments);var t=ue(n),r=ue(e);return t.getTime()===r.getTime()}function Fc(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function zc(n,e){if(n){if(typeof n=="string")return Fc(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Fc(n,e)}}function Hc(n,e){var t=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=zc(n))||e&&n&&typeof n.length=="number"){t&&(n=t);var r=0,i=function(){};return{s:i,n:function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}},e:function(d){throw d},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,s;return{s:function(){t=t.call(n)},n:function(){var d=t.next();return o=d.done,d},e:function(d){a=!0,s=d},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(a)throw s}}}}function oe(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function $a(n,e){return $a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},$a(n,e)}function Te(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&$a(n,e)}function Co(n){return Co=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Co(n)}function my(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function gy(n,e){if(e&&(Pt(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oe(n)}function Se(n){var e=my();return function(){var r=Co(n),i;if(e){var o=Co(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return gy(this,i)}}function we(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function yy(n,e){if(Pt(n)!=="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(Pt(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Yc(n){var e=yy(n,"string");return Pt(e)==="symbol"?e:String(e)}function Uc(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,Yc(r.key),r)}}function ke(n,e,t){return e&&Uc(n.prototype,e),t&&Uc(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function re(n,e,t){return e=Yc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var vy=10,jc=function(){function n(){we(this,n),re(this,"priority",void 0),re(this,"subPriority",0)}return ke(n,[{key:"validate",value:function(t,r){return!0}}]),n}(),by=function(n){Te(t,n);var e=Se(t);function t(r,i,o,a,s){var c;return we(this,t),c=e.call(this),c.value=r,c.validateValue=i,c.setValue=o,c.priority=a,s&&(c.subPriority=s),c}return ke(t,[{key:"validate",value:function(i,o){return this.validateValue(i,this.value,o)}},{key:"set",value:function(i,o,a){return this.setValue(i,o,this.value,a)}}]),t}(jc),wy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",vy),re(oe(r),"subPriority",-1),r}return ke(t,[{key:"set",value:function(i,o){if(o.timestampIsSet)return i;var a=new Date(0);return a.setFullYear(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()),a.setHours(i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()),a}}]),t}(jc),De=function(){function n(){we(this,n),re(this,"incompatibleTokens",void 0),re(this,"priority",void 0),re(this,"subPriority",void 0)}return ke(n,[{key:"run",value:function(t,r,i,o){var a=this.parse(t,r,i,o);return a?{setter:new by(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}},{key:"validate",value:function(t,r,i){return!0}}]),n}(),ky=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",140),re(oe(r),"incompatibleTokens",["R","u","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"G":case"GG":case"GGG":return a.era(i,{width:"abbreviated"})||a.era(i,{width:"narrow"});case"GGGGG":return a.era(i,{width:"narrow"});case"GGGG":default:return a.era(i,{width:"wide"})||a.era(i,{width:"abbreviated"})||a.era(i,{width:"narrow"})}}},{key:"set",value:function(i,o,a){return o.era=a,i.setUTCFullYear(a,0,1),i.setUTCHours(0,0,0,0),i}}]),t}(De),ze={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},sn={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function He(n,e){return n&&{value:e(n.value),rest:n.rest}}function Ve(n,e){var t=e.match(n);return t?{value:parseInt(t[0],10),rest:e.slice(t[0].length)}:null}function ln(n,e){var t=e.match(n);if(!t)return null;if(t[0]==="Z")return{value:0,rest:e.slice(1)};var r=t[1]==="+"?1:-1,i=t[2]?parseInt(t[2],10):0,o=t[3]?parseInt(t[3],10):0,a=t[5]?parseInt(t[5],10):0;return{value:r*(i*Ia+o*Pa+a*Zm),rest:e.slice(t[0].length)}}function Wc(n){return Ve(ze.anyDigitsSigned,n)}function Le(n,e){switch(n){case 1:return Ve(ze.singleDigit,e);case 2:return Ve(ze.twoDigits,e);case 3:return Ve(ze.threeDigits,e);case 4:return Ve(ze.fourDigits,e);default:return Ve(new RegExp("^\\d{1,"+n+"}"),e)}}function Mo(n,e){switch(n){case 1:return Ve(ze.singleDigitSigned,e);case 2:return Ve(ze.twoDigitsSigned,e);case 3:return Ve(ze.threeDigitsSigned,e);case 4:return Ve(ze.fourDigitsSigned,e);default:return Ve(new RegExp("^-?\\d{1,"+n+"}"),e)}}function Fa(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function qc(n,e){var t=e>0,r=t?e:1-e,i;if(r<=50)i=n||100;else{var o=r+50,a=Math.floor(o/100)*100,s=n>=o%100;i=n+a-(s?100:0)}return t?i:1-i}function Kc(n){return n%400===0||n%4===0&&n%100!==0}var xy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",130),re(oe(r),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){var s=function(d){return{year:d,isTwoDigitYear:o==="yy"}};switch(o){case"y":return He(Le(4,i),s);case"yo":return He(a.ordinalNumber(i,{unit:"year"}),s);default:return He(Le(o.length,i),s)}}},{key:"validate",value:function(i,o){return o.isTwoDigitYear||o.year>0}},{key:"set",value:function(i,o,a){var s=i.getUTCFullYear();if(a.isTwoDigitYear){var c=qc(a.year,s);return i.setUTCFullYear(c,0,1),i.setUTCHours(0,0,0,0),i}var d=!("era"in o)||o.era===1?a.year:1-a.year;return i.setUTCFullYear(d,0,1),i.setUTCHours(0,0,0,0),i}}]),t}(De),Cy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",130),re(oe(r),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){var s=function(d){return{year:d,isTwoDigitYear:o==="YY"}};switch(o){case"Y":return He(Le(4,i),s);case"Yo":return He(a.ordinalNumber(i,{unit:"year"}),s);default:return He(Le(o.length,i),s)}}},{key:"validate",value:function(i,o){return o.isTwoDigitYear||o.year>0}},{key:"set",value:function(i,o,a,s){var c=Ra(i,s);if(a.isTwoDigitYear){var d=qc(a.year,c);return i.setUTCFullYear(d,0,s.firstWeekContainsDate),i.setUTCHours(0,0,0,0),cr(i,s)}var u=!("era"in o)||o.era===1?a.year:1-a.year;return i.setUTCFullYear(u,0,s.firstWeekContainsDate),i.setUTCHours(0,0,0,0),cr(i,s)}}]),t}(De),My=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",130),re(oe(r),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o){return Mo(o==="R"?4:o.length,i)}},{key:"set",value:function(i,o,a){var s=new Date(0);return s.setUTCFullYear(a,0,4),s.setUTCHours(0,0,0,0),Vr(s)}}]),t}(De),Ty=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",130),re(oe(r),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o){return Mo(o==="u"?4:o.length,i)}},{key:"set",value:function(i,o,a){return i.setUTCFullYear(a,0,1),i.setUTCHours(0,0,0,0),i}}]),t}(De),Sy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",120),re(oe(r),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"Q":case"QQ":return Le(o.length,i);case"Qo":return a.ordinalNumber(i,{unit:"quarter"});case"QQQ":return a.quarter(i,{width:"abbreviated",context:"formatting"})||a.quarter(i,{width:"narrow",context:"formatting"});case"QQQQQ":return a.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(i,{width:"wide",context:"formatting"})||a.quarter(i,{width:"abbreviated",context:"formatting"})||a.quarter(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,o){return o>=1&&o<=4}},{key:"set",value:function(i,o,a){return i.setUTCMonth((a-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),t}(De),Dy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",120),re(oe(r),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"q":case"qq":return Le(o.length,i);case"qo":return a.ordinalNumber(i,{unit:"quarter"});case"qqq":return a.quarter(i,{width:"abbreviated",context:"standalone"})||a.quarter(i,{width:"narrow",context:"standalone"});case"qqqqq":return a.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(i,{width:"wide",context:"standalone"})||a.quarter(i,{width:"abbreviated",context:"standalone"})||a.quarter(i,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(i,o){return o>=1&&o<=4}},{key:"set",value:function(i,o,a){return i.setUTCMonth((a-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),t}(De),Ay=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),re(oe(r),"priority",110),r}return ke(t,[{key:"parse",value:function(i,o,a){var s=function(d){return d-1};switch(o){case"M":return He(Ve(ze.month,i),s);case"MM":return He(Le(2,i),s);case"Mo":return He(a.ordinalNumber(i,{unit:"month"}),s);case"MMM":return a.month(i,{width:"abbreviated",context:"formatting"})||a.month(i,{width:"narrow",context:"formatting"});case"MMMMM":return a.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(i,{width:"wide",context:"formatting"})||a.month(i,{width:"abbreviated",context:"formatting"})||a.month(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,o){return o>=0&&o<=11}},{key:"set",value:function(i,o,a){return i.setUTCMonth(a,1),i.setUTCHours(0,0,0,0),i}}]),t}(De),Ey=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",110),re(oe(r),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){var s=function(d){return d-1};switch(o){case"L":return He(Ve(ze.month,i),s);case"LL":return He(Le(2,i),s);case"Lo":return He(a.ordinalNumber(i,{unit:"month"}),s);case"LLL":return a.month(i,{width:"abbreviated",context:"standalone"})||a.month(i,{width:"narrow",context:"standalone"});case"LLLLL":return a.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(i,{width:"wide",context:"standalone"})||a.month(i,{width:"abbreviated",context:"standalone"})||a.month(i,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(i,o){return o>=0&&o<=11}},{key:"set",value:function(i,o,a){return i.setUTCMonth(a,1),i.setUTCHours(0,0,0,0),i}}]),t}(De);function Oy(n,e,t){se(2,arguments);var r=ue(n),i=pe(e),o=_c(r,t)-i;return r.setUTCDate(r.getUTCDate()-o*7),r}var Ny=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",100),re(oe(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"w":return Ve(ze.week,i);case"wo":return a.ordinalNumber(i,{unit:"week"});default:return Le(o.length,i)}}},{key:"validate",value:function(i,o){return o>=1&&o<=53}},{key:"set",value:function(i,o,a,s){return cr(Oy(i,a,s),s)}}]),t}(De);function _y(n,e){se(2,arguments);var t=ue(n),r=pe(e),i=Nc(t)-r;return t.setUTCDate(t.getUTCDate()-i*7),t}var By=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",100),re(oe(r),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"I":return Ve(ze.week,i);case"Io":return a.ordinalNumber(i,{unit:"week"});default:return Le(o.length,i)}}},{key:"validate",value:function(i,o){return o>=1&&o<=53}},{key:"set",value:function(i,o,a){return Vr(_y(i,a))}}]),t}(De),Py=[31,28,31,30,31,30,31,31,30,31,30,31],Iy=[31,29,31,30,31,30,31,31,30,31,30,31],Ry=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",90),re(oe(r),"subPriority",1),re(oe(r),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"d":return Ve(ze.date,i);case"do":return a.ordinalNumber(i,{unit:"date"});default:return Le(o.length,i)}}},{key:"validate",value:function(i,o){var a=i.getUTCFullYear(),s=Kc(a),c=i.getUTCMonth();return s?o>=1&&o<=Iy[c]:o>=1&&o<=Py[c]}},{key:"set",value:function(i,o,a){return i.setUTCDate(a),i.setUTCHours(0,0,0,0),i}}]),t}(De),Vy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",90),re(oe(r),"subpriority",1),re(oe(r),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"D":case"DD":return Ve(ze.dayOfYear,i);case"Do":return a.ordinalNumber(i,{unit:"date"});default:return Le(o.length,i)}}},{key:"validate",value:function(i,o){var a=i.getUTCFullYear(),s=Kc(a);return s?o>=1&&o<=366:o>=1&&o<=365}},{key:"set",value:function(i,o,a){return i.setUTCMonth(0,a),i.setUTCHours(0,0,0,0),i}}]),t}(De);function za(n,e,t){var r,i,o,a,s,c,d,u;se(2,arguments);var f=on(),p=pe((r=(i=(o=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(c=s.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&o!==void 0?o:f.weekStartsOn)!==null&&i!==void 0?i:(d=f.locale)===null||d===void 0||(u=d.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&r!==void 0?r:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=ue(n),m=pe(e),g=h.getUTCDay(),k=m%7,x=(k+7)%7,S=(x<p?7:0)+m-g;return h.setUTCDate(h.getUTCDate()+S),h}var Ly=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",90),re(oe(r),"incompatibleTokens",["D","i","e","c","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"E":case"EE":case"EEE":return a.day(i,{width:"abbreviated",context:"formatting"})||a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"});case"EEEEE":return a.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"});case"EEEE":default:return a.day(i,{width:"wide",context:"formatting"})||a.day(i,{width:"abbreviated",context:"formatting"})||a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,o){return o>=0&&o<=6}},{key:"set",value:function(i,o,a,s){return i=za(i,a,s),i.setUTCHours(0,0,0,0),i}}]),t}(De),$y=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",90),re(oe(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a,s){var c=function(u){var f=Math.floor((u-1)/7)*7;return(u+s.weekStartsOn+6)%7+f};switch(o){case"e":case"ee":return He(Le(o.length,i),c);case"eo":return He(a.ordinalNumber(i,{unit:"day"}),c);case"eee":return a.day(i,{width:"abbreviated",context:"formatting"})||a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"});case"eeeee":return a.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"});case"eeee":default:return a.day(i,{width:"wide",context:"formatting"})||a.day(i,{width:"abbreviated",context:"formatting"})||a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,o){return o>=0&&o<=6}},{key:"set",value:function(i,o,a,s){return i=za(i,a,s),i.setUTCHours(0,0,0,0),i}}]),t}(De),Fy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",90),re(oe(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a,s){var c=function(u){var f=Math.floor((u-1)/7)*7;return(u+s.weekStartsOn+6)%7+f};switch(o){case"c":case"cc":return He(Le(o.length,i),c);case"co":return He(a.ordinalNumber(i,{unit:"day"}),c);case"ccc":return a.day(i,{width:"abbreviated",context:"standalone"})||a.day(i,{width:"short",context:"standalone"})||a.day(i,{width:"narrow",context:"standalone"});case"ccccc":return a.day(i,{width:"narrow",context:"standalone"});case"cccccc":return a.day(i,{width:"short",context:"standalone"})||a.day(i,{width:"narrow",context:"standalone"});case"cccc":default:return a.day(i,{width:"wide",context:"standalone"})||a.day(i,{width:"abbreviated",context:"standalone"})||a.day(i,{width:"short",context:"standalone"})||a.day(i,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(i,o){return o>=0&&o<=6}},{key:"set",value:function(i,o,a,s){return i=za(i,a,s),i.setUTCHours(0,0,0,0),i}}]),t}(De);function zy(n,e){se(2,arguments);var t=pe(e);t%7===0&&(t=t-7);var r=1,i=ue(n),o=i.getUTCDay(),a=t%7,s=(a+7)%7,c=(s<r?7:0)+t-o;return i.setUTCDate(i.getUTCDate()+c),i}var Hy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",90),re(oe(r),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){var s=function(d){return d===0?7:d};switch(o){case"i":case"ii":return Le(o.length,i);case"io":return a.ordinalNumber(i,{unit:"day"});case"iii":return He(a.day(i,{width:"abbreviated",context:"formatting"})||a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"}),s);case"iiiii":return He(a.day(i,{width:"narrow",context:"formatting"}),s);case"iiiiii":return He(a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"}),s);case"iiii":default:return He(a.day(i,{width:"wide",context:"formatting"})||a.day(i,{width:"abbreviated",context:"formatting"})||a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"}),s)}}},{key:"validate",value:function(i,o){return o>=1&&o<=7}},{key:"set",value:function(i,o,a){return i=zy(i,a),i.setUTCHours(0,0,0,0),i}}]),t}(De),Yy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",80),re(oe(r),"incompatibleTokens",["b","B","H","k","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"a":case"aa":case"aaa":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"})||a.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaaa":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})||a.dayPeriod(i,{width:"abbreviated",context:"formatting"})||a.dayPeriod(i,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(i,o,a){return i.setUTCHours(Fa(a),0,0,0),i}}]),t}(De),Uy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",80),re(oe(r),"incompatibleTokens",["a","B","H","k","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"b":case"bb":case"bbb":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"})||a.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbbb":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})||a.dayPeriod(i,{width:"abbreviated",context:"formatting"})||a.dayPeriod(i,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(i,o,a){return i.setUTCHours(Fa(a),0,0,0),i}}]),t}(De),jy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",80),re(oe(r),"incompatibleTokens",["a","b","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"B":case"BB":case"BBB":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"})||a.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBBB":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})||a.dayPeriod(i,{width:"abbreviated",context:"formatting"})||a.dayPeriod(i,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(i,o,a){return i.setUTCHours(Fa(a),0,0,0),i}}]),t}(De),Wy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",70),re(oe(r),"incompatibleTokens",["H","K","k","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"h":return Ve(ze.hour12h,i);case"ho":return a.ordinalNumber(i,{unit:"hour"});default:return Le(o.length,i)}}},{key:"validate",value:function(i,o){return o>=1&&o<=12}},{key:"set",value:function(i,o,a){var s=i.getUTCHours()>=12;return s&&a<12?i.setUTCHours(a+12,0,0,0):!s&&a===12?i.setUTCHours(0,0,0,0):i.setUTCHours(a,0,0,0),i}}]),t}(De),qy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",70),re(oe(r),"incompatibleTokens",["a","b","h","K","k","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"H":return Ve(ze.hour23h,i);case"Ho":return a.ordinalNumber(i,{unit:"hour"});default:return Le(o.length,i)}}},{key:"validate",value:function(i,o){return o>=0&&o<=23}},{key:"set",value:function(i,o,a){return i.setUTCHours(a,0,0,0),i}}]),t}(De),Ky=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",70),re(oe(r),"incompatibleTokens",["h","H","k","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"K":return Ve(ze.hour11h,i);case"Ko":return a.ordinalNumber(i,{unit:"hour"});default:return Le(o.length,i)}}},{key:"validate",value:function(i,o){return o>=0&&o<=11}},{key:"set",value:function(i,o,a){var s=i.getUTCHours()>=12;return s&&a<12?i.setUTCHours(a+12,0,0,0):i.setUTCHours(a,0,0,0),i}}]),t}(De),Gy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",70),re(oe(r),"incompatibleTokens",["a","b","h","H","K","t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"k":return Ve(ze.hour24h,i);case"ko":return a.ordinalNumber(i,{unit:"hour"});default:return Le(o.length,i)}}},{key:"validate",value:function(i,o){return o>=1&&o<=24}},{key:"set",value:function(i,o,a){var s=a<=24?a%24:a;return i.setUTCHours(s,0,0,0),i}}]),t}(De),Qy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",60),re(oe(r),"incompatibleTokens",["t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"m":return Ve(ze.minute,i);case"mo":return a.ordinalNumber(i,{unit:"minute"});default:return Le(o.length,i)}}},{key:"validate",value:function(i,o){return o>=0&&o<=59}},{key:"set",value:function(i,o,a){return i.setUTCMinutes(a,0,0),i}}]),t}(De),Jy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",50),re(oe(r),"incompatibleTokens",["t","T"]),r}return ke(t,[{key:"parse",value:function(i,o,a){switch(o){case"s":return Ve(ze.second,i);case"so":return a.ordinalNumber(i,{unit:"second"});default:return Le(o.length,i)}}},{key:"validate",value:function(i,o){return o>=0&&o<=59}},{key:"set",value:function(i,o,a){return i.setUTCSeconds(a,0),i}}]),t}(De),Xy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",30),re(oe(r),"incompatibleTokens",["t","T"]),r}return ke(t,[{key:"parse",value:function(i,o){var a=function(c){return Math.floor(c*Math.pow(10,-o.length+3))};return He(Le(o.length,i),a)}},{key:"set",value:function(i,o,a){return i.setUTCMilliseconds(a),i}}]),t}(De),Zy=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",10),re(oe(r),"incompatibleTokens",["t","T","x"]),r}return ke(t,[{key:"parse",value:function(i,o){switch(o){case"X":return ln(sn.basicOptionalMinutes,i);case"XX":return ln(sn.basic,i);case"XXXX":return ln(sn.basicOptionalSeconds,i);case"XXXXX":return ln(sn.extendedOptionalSeconds,i);case"XXX":default:return ln(sn.extended,i)}}},{key:"set",value:function(i,o,a){return o.timestampIsSet?i:new Date(i.getTime()-a)}}]),t}(De),e0=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",10),re(oe(r),"incompatibleTokens",["t","T","X"]),r}return ke(t,[{key:"parse",value:function(i,o){switch(o){case"x":return ln(sn.basicOptionalMinutes,i);case"xx":return ln(sn.basic,i);case"xxxx":return ln(sn.basicOptionalSeconds,i);case"xxxxx":return ln(sn.extendedOptionalSeconds,i);case"xxx":default:return ln(sn.extended,i)}}},{key:"set",value:function(i,o,a){return o.timestampIsSet?i:new Date(i.getTime()-a)}}]),t}(De),t0=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",40),re(oe(r),"incompatibleTokens","*"),r}return ke(t,[{key:"parse",value:function(i){return Wc(i)}},{key:"set",value:function(i,o,a){return[new Date(a*1e3),{timestampIsSet:!0}]}}]),t}(De),n0=function(n){Te(t,n);var e=Se(t);function t(){var r;we(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(oe(r),"priority",20),re(oe(r),"incompatibleTokens","*"),r}return ke(t,[{key:"parse",value:function(i){return Wc(i)}},{key:"set",value:function(i,o,a){return[new Date(a),{timestampIsSet:!0}]}}]),t}(De),r0={G:new ky,y:new xy,Y:new Cy,R:new My,u:new Ty,Q:new Sy,q:new Dy,M:new Ay,L:new Ey,w:new Ny,I:new By,d:new Ry,D:new Vy,E:new Ly,e:new $y,c:new Fy,i:new Hy,a:new Yy,b:new Uy,B:new jy,h:new Wy,H:new qy,K:new Ky,k:new Gy,m:new Qy,s:new Jy,S:new Xy,X:new Zy,x:new e0,t:new t0,T:new n0},i0=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,o0=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,a0=/^'([^]*?)'?$/,s0=/''/g,l0=/\S/,c0=/[a-zA-Z]/;function Ha(n,e,t,r){var i,o,a,s,c,d,u,f,p,h,m,g,k,x,S,T,y,B;se(3,arguments);var w=String(n),V=String(e),$=on(),M=(i=(o=r==null?void 0:r.locale)!==null&&o!==void 0?o:$.locale)!==null&&i!==void 0?i:$c;if(!M.match)throw new RangeError("locale must contain match property");var _=pe((a=(s=(c=(d=r==null?void 0:r.firstWeekContainsDate)!==null&&d!==void 0?d:r==null||(u=r.locale)===null||u===void 0||(f=u.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&c!==void 0?c:$.firstWeekContainsDate)!==null&&s!==void 0?s:(p=$.locale)===null||p===void 0||(h=p.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(_>=1&&_<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var z=pe((m=(g=(k=(x=r==null?void 0:r.weekStartsOn)!==null&&x!==void 0?x:r==null||(S=r.locale)===null||S===void 0||(T=S.options)===null||T===void 0?void 0:T.weekStartsOn)!==null&&k!==void 0?k:$.weekStartsOn)!==null&&g!==void 0?g:(y=$.locale)===null||y===void 0||(B=y.options)===null||B===void 0?void 0:B.weekStartsOn)!==null&&m!==void 0?m:0);if(!(z>=0&&z<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(V==="")return w===""?ue(t):new Date(NaN);var N={firstWeekContainsDate:_,weekStartsOn:z,locale:M},W=[new wy],F=V.match(o0).map(function(Y){var Z=Y[0];if(Z in Va){var ce=Va[Z];return ce(Y,M.formatLong)}return Y}).join("").match(i0),O=[],I=Hc(F),H;try{var b=function(){var Z=H.value;!(r!=null&&r.useAdditionalWeekYearTokens)&&Lc(Z)&&xo(Z,V,n),!(r!=null&&r.useAdditionalDayOfYearTokens)&&Vc(Z)&&xo(Z,V,n);var ce=Z[0],j=r0[ce];if(j){var J=j.incompatibleTokens;if(Array.isArray(J)){var de=O.find(function(Ge){return J.includes(Ge.token)||Ge.token===ce});if(de)throw new RangeError("The format string mustn't contain `".concat(de.fullToken,"` and `").concat(Z,"` at the same time"))}else if(j.incompatibleTokens==="*"&&O.length>0)throw new RangeError("The format string mustn't contain `".concat(Z,"` and any other token at the same time"));O.push({token:ce,fullToken:Z});var te=j.run(w,Z,M.match,N);if(!te)return{v:new Date(NaN)};W.push(te.setter),w=te.rest}else{if(ce.match(c0))throw new RangeError("Format string contains an unescaped latin alphabet character `"+ce+"`");if(Z==="''"?Z="'":ce==="'"&&(Z=d0(Z)),w.indexOf(Z)===0)w=w.slice(Z.length);else return{v:new Date(NaN)}}};for(I.s();!(H=I.n()).done;){var C=b();if(Pt(C)==="object")return C.v}}catch(Y){I.e(Y)}finally{I.f()}if(w.length>0&&l0.test(w))return new Date(NaN);var v=W.map(function(Y){return Y.priority}).sort(function(Y,Z){return Z-Y}).filter(function(Y,Z,ce){return ce.indexOf(Y)===Z}).map(function(Y){return W.filter(function(Z){return Z.priority===Y}).sort(function(Z,ce){return ce.subPriority-Z.subPriority})}).map(function(Y){return Y[0]}),A=ue(t);if(isNaN(A.getTime()))return new Date(NaN);var E=Ec(A,ko(A)),P={},q=Hc(v),D;try{for(q.s();!(D=q.n()).done;){var X=D.value;if(!X.validate(E,N))return new Date(NaN);var ne=X.set(E,P,N);Array.isArray(ne)?(E=ne[0],ay(P,ne[1])):E=ne}}catch(Y){q.e(Y)}finally{q.f()}return E}function d0(n){return n.match(a0)[1].replace(s0,"'")}function Gc(n,e){se(2,arguments);var t=Ti(n),r=Ti(e);return t.getTime()===r.getTime()}function u0(n,e){se(2,arguments);var t=pe(e);return Cn(n,-t)}function f0(n,e){var t;se(1,arguments);var r=pe((t=e==null?void 0:e.additionalDigits)!==null&&t!==void 0?t:2);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var i=g0(n),o;if(i.date){var a=y0(i.date,r);o=v0(a.restDateString,a.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);var s=o.getTime(),c=0,d;if(i.time&&(c=b0(i.time),isNaN(c)))return new Date(NaN);if(i.timezone){if(d=w0(i.timezone),isNaN(d))return new Date(NaN)}else{var u=new Date(s+c),f=new Date(0);return f.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),f.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),f}return new Date(s+c+d)}var To={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},p0=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,h0=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,m0=/^([+-])(\d{2})(?::?(\d{2}))?$/;function g0(n){var e={},t=n.split(To.dateTimeDelimiter),r;if(t.length>2)return e;if(/:/.test(t[0])?r=t[0]:(e.date=t[0],r=t[1],To.timeZoneDelimiter.test(e.date)&&(e.date=n.split(To.timeZoneDelimiter)[0],r=n.substr(e.date.length,n.length))),r){var i=To.timezone.exec(r);i?(e.time=r.replace(i[1],""),e.timezone=i[1]):e.time=r}return e}function y0(n,e){var t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=n.match(t);if(!r)return{year:NaN,restDateString:""};var i=r[1]?parseInt(r[1]):null,o=r[2]?parseInt(r[2]):null;return{year:o===null?i:o*100,restDateString:n.slice((r[1]||r[2]).length)}}function v0(n,e){if(e===null)return new Date(NaN);var t=n.match(p0);if(!t)return new Date(NaN);var r=!!t[4],i=Oi(t[1]),o=Oi(t[2])-1,a=Oi(t[3]),s=Oi(t[4]),c=Oi(t[5])-1;if(r)return T0(e,s,c)?k0(e,s,c):new Date(NaN);var d=new Date(0);return!C0(e,o,a)||!M0(e,i)?new Date(NaN):(d.setUTCFullYear(e,o,Math.max(i,a)),d)}function Oi(n){return n?parseInt(n):1}function b0(n){var e=n.match(h0);if(!e)return NaN;var t=Ya(e[1]),r=Ya(e[2]),i=Ya(e[3]);return S0(t,r,i)?t*Ia+r*Pa+i*1e3:NaN}function Ya(n){return n&&parseFloat(n.replace(",","."))||0}function w0(n){if(n==="Z")return 0;var e=n.match(m0);if(!e)return 0;var t=e[1]==="+"?-1:1,r=parseInt(e[2]),i=e[3]&&parseInt(e[3])||0;return D0(r,i)?t*(r*Ia+i*Pa):NaN}function k0(n,e,t){var r=new Date(0);r.setUTCFullYear(n,0,4);var i=r.getUTCDay()||7,o=(e-1)*7+t+1-i;return r.setUTCDate(r.getUTCDate()+o),r}var x0=[31,null,31,30,31,30,31,31,30,31,30,31];function Qc(n){return n%400===0||n%4===0&&n%100!==0}function C0(n,e,t){return e>=0&&e<=11&&t>=1&&t<=(x0[e]||(Qc(n)?29:28))}function M0(n,e){return e>=1&&e<=(Qc(n)?366:365)}function T0(n,e,t){return e>=1&&e<=53&&t>=0&&t<=6}function S0(n,e,t){return n===24?e===0&&t===0:t>=0&&t<60&&e>=0&&e<60&&n>=0&&n<25}function D0(n,e){return e>=0&&e<=59}function Jc(n,e){se(2,arguments);var t=ue(n),r=pe(e),i=t.getFullYear(),o=t.getDate(),a=new Date(0);a.setFullYear(i,r,15),a.setHours(0,0,0,0);var s=ly(a);return t.setMonth(r,Math.min(o,s)),t}function Be(n,e){if(se(2,arguments),Pt(e)!=="object"||e===null)throw new RangeError("values parameter must be an object");var t=ue(n);return isNaN(t.getTime())?new Date(NaN):(e.year!=null&&t.setFullYear(e.year),e.month!=null&&(t=Jc(t,e.month)),e.date!=null&&t.setDate(pe(e.date)),e.hours!=null&&t.setHours(pe(e.hours)),e.minutes!=null&&t.setMinutes(pe(e.minutes)),e.seconds!=null&&t.setSeconds(pe(e.seconds)),e.milliseconds!=null&&t.setMilliseconds(pe(e.milliseconds)),t)}function Xc(n,e){se(2,arguments);var t=ue(n),r=pe(e);return t.setHours(r),t}function Ua(n,e){se(2,arguments);var t=ue(n),r=pe(e);return t.setMilliseconds(r),t}function Zc(n,e){se(2,arguments);var t=ue(n),r=pe(e);return t.setMinutes(r),t}function ja(n,e){se(2,arguments);var t=ue(n),r=pe(e);return t.setSeconds(r),t}function ur(n,e){se(2,arguments);var t=ue(n),r=pe(e);return isNaN(t.getTime())?new Date(NaN):(t.setFullYear(r),t)}function zr(n,e){se(2,arguments);var t=pe(e);return jt(n,-t)}function A0(n,e){if(se(2,arguments),!e||Pt(e)!=="object")return new Date(NaN);var t=e.years?pe(e.years):0,r=e.months?pe(e.months):0,i=e.weeks?pe(e.weeks):0,o=e.days?pe(e.days):0,a=e.hours?pe(e.hours):0,s=e.minutes?pe(e.minutes):0,c=e.seconds?pe(e.seconds):0,d=zr(n,r+t*12),u=u0(d,o+i*7),f=s+a*60,p=c+f*60,h=p*1e3,m=new Date(u.getTime()-h);return m}function ed(n,e){se(2,arguments);var t=pe(e);return Ba(n,-t)}function Ni(){return l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon"},[l.createElementVNode("path",{d:"M29.333 8c0-2.208-1.792-4-4-4h-18.667c-2.208 0-4 1.792-4 4v18.667c0 2.208 1.792 4 4 4h18.667c2.208 0 4-1.792 4-4v-18.667zM26.667 8v18.667c0 0.736-0.597 1.333-1.333 1.333 0 0-18.667 0-18.667 0-0.736 0-1.333-0.597-1.333-1.333 0 0 0-18.667 0-18.667 0-0.736 0.597-1.333 1.333-1.333 0 0 18.667 0 18.667 0 0.736 0 1.333 0.597 1.333 1.333z"}),l.createElementVNode("path",{d:"M20 2.667v5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"}),l.createElementVNode("path",{d:"M9.333 2.667v5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"}),l.createElementVNode("path",{d:"M4 14.667h24c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-24c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333z"})])}Ni.compatConfig={MODE:3};function td(){return l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon"},[l.createElementVNode("path",{d:"M23.057 7.057l-16 16c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l16-16c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0z"}),l.createElementVNode("path",{d:"M7.057 8.943l16 16c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885l-16-16c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"})])}td.compatConfig={MODE:3};function Wa(){return l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon"},[l.createElementVNode("path",{d:"M20.943 23.057l-7.057-7.057c0 0 7.057-7.057 7.057-7.057 0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0l-8 8c-0.521 0.521-0.521 1.365 0 1.885l8 8c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885z"})])}Wa.compatConfig={MODE:3};function qa(){return l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon"},[l.createElementVNode("path",{d:"M12.943 24.943l8-8c0.521-0.521 0.521-1.365 0-1.885l-8-8c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885l7.057 7.057c0 0-7.057 7.057-7.057 7.057-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0z"})])}qa.compatConfig={MODE:3};function Ka(){return l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon"},[l.createElementVNode("path",{d:"M16 1.333c-8.095 0-14.667 6.572-14.667 14.667s6.572 14.667 14.667 14.667c8.095 0 14.667-6.572 14.667-14.667s-6.572-14.667-14.667-14.667zM16 4c6.623 0 12 5.377 12 12s-5.377 12-12 12c-6.623 0-12-5.377-12-12s5.377-12 12-12z"}),l.createElementVNode("path",{d:"M14.667 8v8c0 0.505 0.285 0.967 0.737 1.193l5.333 2.667c0.658 0.329 1.46 0.062 1.789-0.596s0.062-1.46-0.596-1.789l-4.596-2.298c0 0 0-7.176 0-7.176 0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"})])}Ka.compatConfig={MODE:3};function Ga(){return l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon"},[l.createElementVNode("path",{d:"M24.943 19.057l-8-8c-0.521-0.521-1.365-0.521-1.885 0l-8 8c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l7.057-7.057c0 0 7.057 7.057 7.057 7.057 0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885z"})])}Ga.compatConfig={MODE:3};function Qa(){return l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon"},[l.createElementVNode("path",{d:"M7.057 12.943l8 8c0.521 0.521 1.365 0.521 1.885 0l8-8c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0l-7.057 7.057c0 0-7.057-7.057-7.057-7.057-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"})])}Qa.compatConfig={MODE:3};function Ja(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var nd={exports:{}};(function(n){function e(t){return t&&t.__esModule?t:{default:t}}n.exports=e,n.exports.__esModule=!0,n.exports.default=n.exports})(nd);var E0=nd.exports,Xa={exports:{}};(function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=t;function t(r){if(r===null||r===!0||r===!1)return NaN;var i=Number(r);return isNaN(i)?i:i<0?Math.ceil(i):Math.floor(i)}n.exports=e.default})(Xa,Xa.exports);var O0=Xa.exports;const N0=Ja(O0);var Za={exports:{}};(function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=t;function t(r){var i=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return i.setUTCFullYear(r.getFullYear()),r.getTime()-i.getTime()}n.exports=e.default})(Za,Za.exports);var _0=Za.exports;const rd=Ja(_0);function B0(n,e){var t=V0(e);return t.formatToParts?I0(t,n):R0(t,n)}var P0={year:0,month:1,day:2,hour:3,minute:4,second:5};function I0(n,e){try{for(var t=n.formatToParts(e),r=[],i=0;i<t.length;i++){var o=P0[t[i].type];o>=0&&(r[o]=parseInt(t[i].value,10))}return r}catch(a){if(a instanceof RangeError)return[NaN];throw a}}function R0(n,e){var t=n.format(e).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(t);return[r[3],r[1],r[2],r[4],r[5],r[6]]}var es={};function V0(n){if(!es[n]){var e=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:"America/New_York",year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),t=e==="06/25/2014, 00:00:00"||e==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";es[n]=t?new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return es[n]}function ts(n,e,t,r,i,o,a){var s=new Date(0);return s.setUTCFullYear(n,e,t),s.setUTCHours(r,i,o,a),s}var id=36e5,L0=6e4,ns={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-]\d{2}):?(\d{2})$/};function rs(n,e,t){var r,i;if(!n||(r=ns.timezoneZ.exec(n),r))return 0;var o;if(r=ns.timezoneHH.exec(n),r)return o=parseInt(r[1],10),od(o)?-(o*id):NaN;if(r=ns.timezoneHHMM.exec(n),r){o=parseInt(r[1],10);var a=parseInt(r[2],10);return od(o,a)?(i=Math.abs(o)*id+a*L0,o>0?-i:i):NaN}if(z0(n)){e=new Date(e||Date.now());var s=t?e:$0(e),c=is(s,n),d=t?c:F0(e,c,n);return-d}return NaN}function $0(n){return ts(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function is(n,e){var t=B0(n,e),r=ts(t[0],t[1]-1,t[2],t[3]%24,t[4],t[5],0).getTime(),i=n.getTime(),o=i%1e3;return i-=o>=0?o:1e3+o,r-i}function F0(n,e,t){var r=n.getTime(),i=r-e,o=is(new Date(i),t);if(e===o)return e;i-=o-e;var a=is(new Date(i),t);return o===a?o:Math.max(o,a)}function od(n,e){return-23<=n&&n<=23&&(e==null||0<=e&&e<=59)}var ad={};function z0(n){if(ad[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),ad[n]=!0,!0}catch{return!1}}var sd=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,as=36e5,ld=6e4,H0=2,mt={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:sd};function ss(n,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);var t=e||{},r=t.additionalDigits==null?H0:N0(t.additionalDigits);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var i=Y0(n),o=U0(i.date,r),a=o.year,s=o.restDateString,c=j0(s,a);if(isNaN(c))return new Date(NaN);if(c){var d=c.getTime(),u=0,f;if(i.time&&(u=W0(i.time),isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(f=rs(i.timeZone||t.timeZone,new Date(d+u)),isNaN(f))return new Date(NaN)}else f=rd(new Date(d+u)),f=rd(new Date(d+u+f));return new Date(d+u+f)}else return new Date(NaN)}function Y0(n){var e={},t=mt.dateTimePattern.exec(n),r;if(t?(e.date=t[1],r=t[3]):(t=mt.datePattern.exec(n),t?(e.date=t[1],r=t[2]):(e.date=null,r=n)),r){var i=mt.timeZone.exec(r);i?(e.time=r.replace(i[1],""),e.timeZone=i[1].trim()):e.time=r}return e}function U0(n,e){var t=mt.YYY[e],r=mt.YYYYY[e],i;if(i=mt.YYYY.exec(n)||r.exec(n),i){var o=i[1];return{year:parseInt(o,10),restDateString:n.slice(o.length)}}if(i=mt.YY.exec(n)||t.exec(n),i){var a=i[1];return{year:parseInt(a,10)*100,restDateString:n.slice(a.length)}}return{year:null}}function j0(n,e){if(e===null)return null;var t,r,i,o;if(n.length===0)return r=new Date(0),r.setUTCFullYear(e),r;if(t=mt.MM.exec(n),t)return r=new Date(0),i=parseInt(t[1],10)-1,ud(e,i)?(r.setUTCFullYear(e,i),r):new Date(NaN);if(t=mt.DDD.exec(n),t){r=new Date(0);var a=parseInt(t[1],10);return G0(e,a)?(r.setUTCFullYear(e,0,a),r):new Date(NaN)}if(t=mt.MMDD.exec(n),t){r=new Date(0),i=parseInt(t[1],10)-1;var s=parseInt(t[2],10);return ud(e,i,s)?(r.setUTCFullYear(e,i,s),r):new Date(NaN)}if(t=mt.Www.exec(n),t)return o=parseInt(t[1],10)-1,fd(e,o)?cd(e,o):new Date(NaN);if(t=mt.WwwD.exec(n),t){o=parseInt(t[1],10)-1;var c=parseInt(t[2],10)-1;return fd(e,o,c)?cd(e,o,c):new Date(NaN)}return null}function W0(n){var e,t,r;if(e=mt.HH.exec(n),e)return t=parseFloat(e[1].replace(",",".")),ls(t)?t%24*as:NaN;if(e=mt.HHMM.exec(n),e)return t=parseInt(e[1],10),r=parseFloat(e[2].replace(",",".")),ls(t,r)?t%24*as+r*ld:NaN;if(e=mt.HHMMSS.exec(n),e){t=parseInt(e[1],10),r=parseInt(e[2],10);var i=parseFloat(e[3].replace(",","."));return ls(t,r,i)?t%24*as+r*ld+i*1e3:NaN}return null}function cd(n,e,t){e=e||0,t=t||0;var r=new Date(0);r.setUTCFullYear(n,0,4);var i=r.getUTCDay()||7,o=e*7+t+1-i;return r.setUTCDate(r.getUTCDate()+o),r}var q0=[31,28,31,30,31,30,31,31,30,31,30,31],K0=[31,29,31,30,31,30,31,31,30,31,30,31];function dd(n){return n%400===0||n%4===0&&n%100!==0}function ud(n,e,t){if(e<0||e>11)return!1;if(t!=null){if(t<1)return!1;var r=dd(n);if(r&&t>K0[e]||!r&&t>q0[e])return!1}return!0}function G0(n,e){if(e<1)return!1;var t=dd(n);return!(t&&e>366||!t&&e>365)}function fd(n,e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function ls(n,e,t){return!(n!=null&&(n<0||n>=25)||e!=null&&(e<0||e>=60)||t!=null&&(t<0||t>=60))}var cs={exports:{}},ds={exports:{}};(function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=t;function t(r,i){if(r==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o]);return r}n.exports=e.default})(ds,ds.exports);var Q0=ds.exports;(function(n,e){var t=E0.default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=i;var r=t(Q0);function i(o){return(0,r.default)({},o)}n.exports=e.default})(cs,cs.exports);var J0=cs.exports;const X0=Ja(J0);function Z0(n,e,t){var r=ss(n,t),i=rs(e,r,!0),o=new Date(r.getTime()-i),a=new Date(0);return a.setFullYear(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()),a.setHours(o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.getUTCMilliseconds()),a}function ev(n,e,t){if(typeof n=="string"&&!n.match(sd)){var r=X0(t);return r.timeZone=e,ss(n,r)}var i=ss(n,t),o=ts(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()).getTime(),a=rs(e,new Date(o));return new Date(o+a)}function pd(n){return e=>new Intl.DateTimeFormat(n,{weekday:"short",timeZone:"UTC"}).format(new Date(`2017-01-0${e}T00:00:00+00:00`)).slice(0,2)}function tv(n){return e=>In(new Date(`2017-01-0${e}T00:00:00+00:00`),"EEEEEE",{locale:n})}const nv=(n,e,t)=>{const r=[1,2,3,4,5,6,7];let i;if(n!==null)try{i=r.map(tv(n))}catch{i=r.map(pd(e))}else i=r.map(pd(e));const o=i.slice(0,t),a=i.slice(t+1,i.length);return[i[t]].concat(...a).concat(...o)},us=(n,e)=>{const t=[];for(let r=+n[0];r<=+n[1];r++)t.push({value:+r,text:`${r}`});return e?t.reverse():t},hd=(n,e,t)=>{const r=[1,2,3,4,5,6,7,8,9,10,11,12].map(o=>{const a=o<10?`0${o}`:o;return new Date(`2017-${a}-01T00:00:00+00:00`)});if(n!==null)try{const o=t==="long"?"MMMM":"MMM";return r.map((a,s)=>{const c=In(a,o,{locale:n});return{text:c.charAt(0).toUpperCase()+c.substring(1),value:s}})}catch{}const i=new Intl.DateTimeFormat(e,{month:t,timeZone:"UTC"});return r.map((o,a)=>{const s=i.format(o);return{text:s.charAt(0).toUpperCase()+s.substring(1),value:a}})},rv=n=>[12,1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11][n],qe=n=>{const e=l.unref(n);return e!=null&&e.$el?e==null?void 0:e.$el:e},iv=n=>Object.assign({type:"dot"},n),md=n=>Array.isArray(n)?!!n[0]&&!!n[1]:!1,So={prop:n=>`"${n}" prop must be enabled!`,dateArr:n=>`You need to use array as "model-value" binding in order to support "${n}"`},Je=n=>n,gd=n=>n===0?n:!n||isNaN(+n)?null:+n,yd=n=>n===null,ov=n=>{if(n)return[...n.querySelectorAll("input, button, select, textarea, a[href]")][0]},av=n=>{const e=[],t=r=>r.filter(i=>i);for(let r=0;r<n.length;r+=3){const i=[n[r],n[r+1],n[r+2]];e.push(t(i))}return e},_i=(n,e,t)=>{const r=t??t===0,i=e??e===0;if(!r&&!i)return!1;const o=+t,a=+e;return r&&i?+n>o||+n<a:r?+n>o:i?+n<a:!1},Hr=(n,e)=>av(n).map(t=>t.map(r=>{const{active:i,disabled:o,isBetween:a}=e(r);return{...r,active:i,disabled:o,className:{dp__overlay_cell_active:i,dp__overlay_cell:!i,dp__overlay_cell_disabled:o,dp__overlay_cell_pad:!0,dp__overlay_cell_active_disabled:o&&i,dp__cell_in_between:a}}})),Rn=(n,e,t=!1)=>{n&&e.allowStopPropagation&&(t&&n.stopImmediatePropagation(),n.stopPropagation())},vd=(n,e,t,r,i)=>{const o=Ha(n,e.slice(0,n.length),new Date);return Mi(o)&&Sc(o)?r||i?o:Be(o,{hours:+t.hours,minutes:+(t==null?void 0:t.minutes),seconds:+(t==null?void 0:t.seconds),milliseconds:0}):null},sv=(n,e,t,r,i)=>{const o=Array.isArray(t)?t[0]:t;if(typeof e=="string")return vd(n,e,o,r,i);if(Array.isArray(e)){let a=null;for(const s of e)if(a=vd(n,s,o,r,i),a)break;return a}return typeof e=="function"?e(n):null},G=n=>n?new Date(n):new Date,lv=(n,e,t)=>{if(e){const i=(n.getMonth()+1).toString().padStart(2,"0"),o=n.getDate().toString().padStart(2,"0"),a=n.getHours().toString().padStart(2,"0"),s=n.getMinutes().toString().padStart(2,"0"),c=t?n.getSeconds().toString().padStart(2,"0"):"00";return`${n.getFullYear()}-${i}-${o}T${a}:${s}:${c}.000Z`}const r=Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds());return new Date(r).toISOString()},It=n=>{let e=G(JSON.parse(JSON.stringify(n)));return e=Xc(e,0),e=Zc(e,0),e=ja(e,0),e=Ua(e,0),e},Vn=(n,e,t,r)=>{let i=n?G(n):G();return(e||e===0)&&(i=Xc(i,+e)),(t||t===0)&&(i=Zc(i,+t)),(r||r===0)&&(i=ja(i,+r)),Ua(i,0)},nt=(n,e)=>!n||!e?!1:Ei(It(n),It(e)),Ae=(n,e)=>!n||!e?!1:Fr(It(n),It(e)),lt=(n,e)=>!n||!e?!1:Ai(It(n),It(e)),Do=(n,e,t)=>n!=null&&n[0]&&n!=null&&n[1]?lt(t,n[0])&&nt(t,n[1]):n!=null&&n[0]&&e?lt(t,n[0])&&nt(t,e)||nt(t,n[0])&&lt(t,e):!1,qt=n=>{const e=Be(new Date(n),{date:1});return It(e)},fs=(n,e,t)=>e&&(t||t===0)?Object.fromEntries(["hours","minutes","seconds"].map(r=>r===e?[r,t]:[r,isNaN(+n[r])?void 0:+n[r]])):{hours:isNaN(+n.hours)?void 0:+n.hours,minutes:isNaN(+n.minutes)?void 0:+n.minutes,seconds:isNaN(+n.seconds)?void 0:+n.seconds},fr=n=>({hours:Wt(n),minutes:an(n),seconds:$r(n)}),bd=(n,e)=>{if(e){const t=Me(G(e));if(t>n)return 12;if(t===n)return Ce(G(e))}},wd=(n,e)=>{if(e){const t=Me(G(e));return t<n?-1:t===n?Ce(G(e)):void 0}},Yr=n=>{if(n)return Me(G(n))},Rt=(n,e)=>e?Z0(n,e):n,kd=(n,e)=>e?ev(n,e):n,xd=n=>n instanceof Date?n:f0(n),Cd=(n,e)=>{const t=lt(n,e)?e:n,r=lt(e,n)?e:n;return Dc({start:t,end:r})},cv=n=>{const e=jt(n,1);return{month:Ce(e),year:Me(e)}},Ao=(n,e,t)=>{const r=lr(Rt(n,e),{weekStartsOn:+t}),i=rg(Rt(n,e),{weekStartsOn:+t});return[r,i]},Md=(n,e)=>{const t={hours:Wt(G()),minutes:an(G()),seconds:e?$r(G()):0};return Object.assign(t,n)},Ln=(n,e,t)=>[Be(G(n),{date:1}),Be(G(),{month:e,year:t,date:1})],Mn=(n,e,t)=>{let r=n?G(n):G();return(e||e===0)&&(r=Jc(r,e)),t&&(r=ur(r,t)),r},Td=(n,e,t,r,i)=>{if(!r||i&&!e||!i&&!t)return!1;const o=i?jt(n,1):zr(n,1),a=[Ce(o),Me(o)];return i?!uv(...a,e):!dv(...a,t)},dv=(n,e,t)=>nt(...Ln(t,n,e))||Ae(...Ln(t,n,e)),uv=(n,e,t)=>lt(...Ln(t,n,e))||Ae(...Ln(t,n,e)),Sd=(n,e,t,r,i,o,a)=>{if(typeof e=="function"&&!a)return e(n);const s=t?{locale:t}:void 0;return Array.isArray(n)?`${In(n[0],o,s)}${i&&!n[1]?"":r}${n[1]?In(n[1],o,s):""}`:In(n,o,s)},Ur=n=>{if(n)return null;throw new Error(So.prop("partial-range"))},Eo=(n,e)=>{if(e)return n();throw new Error(So.prop("range"))},ps=n=>Array.isArray(n)?Mi(n[0])&&(n[1]?Mi(n[1]):!0):n?Mi(n):!1,fv=n=>Be(G(),{hours:+n.hours||0,minutes:+n.minutes||0,seconds:+n.seconds||0}),hs=(n,e,t,r)=>{if(!n)return!0;if(r){const i=t==="max"?Ei(n,e):Ai(n,e),o={seconds:0,milliseconds:0};return i||Fr(Be(n,o),Be(e,o))}return t==="max"?n.getTime()<=e.getTime():n.getTime()>=e.getTime()},Dd=(n,e,t,r,i)=>{const o=n?fv(n):G(e);return Array.isArray(r)?hs(r[0],o,t,!!e)&&hs(r[1],o,t,!!e)&&i:hs(r,o,t,!!e)&&i},ms=n=>Be(G(),fr(n)),pv=(n,e)=>Array.isArray(n)?n.map(t=>G(t)).filter(t=>Me(G(t))===e).map(t=>Ce(t)):[],Bi=l.reactive({menuFocused:!1,shiftKeyInMenu:!1}),Ad=()=>{const n=t=>{Bi.menuFocused=t},e=t=>{Bi.shiftKeyInMenu!==t&&(Bi.shiftKeyInMenu=t)};return{control:l.computed(()=>({shiftKeyInMenu:Bi.shiftKeyInMenu,menuFocused:Bi.menuFocused})),setMenuFocused:n,setShiftKey:e}},Pe=l.reactive({monthYear:[],calendar:[],time:[],actionRow:[],selectionGrid:[],timePicker:{0:[],1:[]},monthPicker:[]}),gs=l.ref(null),Oo=l.ref(!1),ys=l.ref(!1),vs=l.ref(!1),bs=l.ref(!1),gt=l.ref(0),rt=l.ref(0),$n=()=>{const n=l.computed(()=>Oo.value?[...Pe.selectionGrid,Pe.actionRow].filter(f=>f.length):ys.value?[...Pe.timePicker[0],...Pe.timePicker[1],bs.value?[]:[gs.value],Pe.actionRow].filter(f=>f.length):vs.value?[...Pe.monthPicker,Pe.actionRow]:[Pe.monthYear,...Pe.calendar,Pe.time,Pe.actionRow].filter(f=>f.length)),e=f=>{gt.value=f?gt.value+1:gt.value-1;let p=null;n.value[rt.value]&&(p=n.value[rt.value][gt.value]),p||(gt.value=f?gt.value-1:gt.value+1)},t=f=>{rt.value===0&&!f||rt.value===n.value.length&&f||(rt.value=f?rt.value+1:rt.value-1,n.value[rt.value]?n.value[rt.value]&&!n.value[rt.value][gt.value]&&gt.value!==0&&(gt.value=n.value[rt.value].length-1):rt.value=f?rt.value-1:rt.value+1)},r=f=>{let p=null;n.value[rt.value]&&(p=n.value[rt.value][gt.value]),p?p.focus({preventScroll:!Oo.value}):gt.value=f?gt.value-1:gt.value+1},i=()=>{e(!0),r(!0)},o=()=>{e(!1),r(!1)},a=()=>{t(!1),r(!0)},s=()=>{t(!0),r(!0)},c=(f,p)=>{Pe[p]=f},d=(f,p)=>{Pe[p]=f},u=()=>{gt.value=0,rt.value=0};return{buildMatrix:c,buildMultiLevelMatrix:d,setTimePickerBackRef:f=>{gs.value=f},setSelectionGrid:f=>{Oo.value=f,u(),f||(Pe.selectionGrid=[])},setTimePicker:(f,p=!1)=>{ys.value=f,bs.value=p,u(),f||(Pe.timePicker[0]=[],Pe.timePicker[1]=[])},setTimePickerElements:(f,p=0)=>{Pe.timePicker[p]=f},arrowRight:i,arrowLeft:o,arrowUp:a,arrowDown:s,clearArrowNav:()=>{Pe.monthYear=[],Pe.calendar=[],Pe.time=[],Pe.actionRow=[],Pe.selectionGrid=[],Pe.timePicker[0]=[],Pe.timePicker[1]=[],Oo.value=!1,ys.value=!1,bs.value=!1,vs.value=!1,u(),gs.value=null},setMonthPicker:f=>{vs.value=f,u()},refSets:Pe}},Ed=n=>({menuAppearTop:"dp-menu-appear-top",menuAppearBottom:"dp-menu-appear-bottom",open:"dp-slide-down",close:"dp-slide-up",next:"calendar-next",previous:"calendar-prev",vNext:"dp-slide-up",vPrevious:"dp-slide-down",...n??{}}),hv=n=>({toggleOverlay:"Toggle overlay",menu:"Datepicker menu",input:"Datepicker input",calendarWrap:"Calendar wrapper",calendarDays:"Calendar days",openTimePicker:"Open time picker",closeTimePicker:"Close time Picker",incrementValue:e=>`Increment ${e}`,decrementValue:e=>`Decrement ${e}`,openTpOverlay:e=>`Open ${e} overlay`,amPmButton:"Switch AM/PM mode",openYearsOverlay:"Open years overlay",openMonthsOverlay:"Open months overlay",nextMonth:"Next month",prevMonth:"Previous month",nextYear:"Next year",prevYear:"Previous year",day:()=>"",...n??{}}),Od=n=>n?typeof n=="boolean"?n?2:0:+n>=2?+n:2:0,mv=n=>{const e=typeof n=="object"&&n,t={static:!0,solo:!1};if(!n)return{...t,count:Od(!1)};const r=e?n:{},i=e?r.count??!0:n,o=Od(i);return Object.assign(t,r,{count:o})},gv=(n,e,t)=>n||(typeof t=="string"?t:e),yv=n=>typeof n=="boolean"?n?Ed({}):!1:Ed(n),vv=n=>{const e={enterSubmit:!0,tabSubmit:!0,openMenu:!0,selectOnFocus:!1,rangeSeparator:" - "};return typeof n=="object"?{...e,...n??{},enabled:!0}:{...e,enabled:n}},bv=n=>({months:[],years:[],times:{hours:[],minutes:[],seconds:[]},...n??{}}),wv=n=>({showSelect:!0,showCancel:!0,showNow:!1,showPreview:!0,...n??{}}),kv=n=>{const e={input:!1};return typeof n=="object"?{...e,...n??{},enabled:!0}:{enabled:n,...e}},xv=n=>({allowStopPropagation:!0,closeOnScroll:!1,modeHeight:255,allowPreventDefault:!1,closeOnClearValue:!0,closeOnAutoApply:!0,noSwipe:!1,keepActionRow:!1,onClickOutside:void 0,...n??{}}),Ye=n=>{const e=()=>{const g=n.enableSeconds?":ss":"";return n.is24?`HH:mm${g}`:`hh:mm${g} aa`},t=()=>n.format?n.format:n.monthPicker?"MM/yyyy":n.timePicker?e():n.weekPicker?"MM/dd/yyyy":n.yearPicker?"yyyy":n.quarterPicker?"QQQ/yyyy":n.enableTimePicker?`MM/dd/yyyy, ${e()}`:"MM/dd/yyyy",r=g=>Md(g,n.enableSeconds),i=()=>n.range?n.startTime&&Array.isArray(n.startTime)?[r(n.startTime[0]),r(n.startTime[1])]:null:n.startTime&&!Array.isArray(n.startTime)?r(n.startTime):null,o=l.computed(()=>mv(n.multiCalendars)),a=l.computed(()=>i()),s=l.computed(()=>hv(n.ariaLabels)),c=l.computed(()=>bv(n.filters)),d=l.computed(()=>yv(n.transitions)),u=l.computed(()=>wv(n.actionRow)),f=l.computed(()=>gv(n.previewFormat,n.format,t())),p=l.computed(()=>vv(n.textInput)),h=l.computed(()=>kv(n.inline)),m=l.computed(()=>xv(n.config));return{defaultedTransitions:d,defaultedMultiCalendars:o,defaultedStartTime:a,defaultedAriaLabels:s,defaultedFilters:c,defaultedActionRow:u,defaultedPreviewFormat:f,defaultedTextInput:p,defaultedInline:h,defaultedConfig:m,getDefaultPattern:t,getDefaultStartTime:i}},Cv=(n,e,t)=>{const r=l.ref(),{defaultedTextInput:i,getDefaultPattern:o}=Ye(e),a=l.ref(""),s=l.toRef(e,"format");l.watch(r,()=>{n("internal-model-change",r.value)}),l.watch(s,()=>{F()});const c=v=>kd(v,e.timezone),d=v=>Rt(v,e.timezone),u=(v,A,E=!1)=>Sd(v,e.format,e.formatLocale,i.value.rangeSeparator,e.modelAuto,A??o(),E),f=v=>v?e.modelType?I(v):{hours:Wt(v),minutes:an(v),seconds:e.enableSeconds?$r(v):0}:null,p=v=>e.modelType?I(v):{month:Ce(v),year:Me(v)},h=v=>Array.isArray(v)?Eo(()=>[ur(G(),v[0]),v[1]?ur(G(),v[1]):Ur(e.partialRange)],e.range):ur(G(),+v),m=(v,A)=>(typeof v=="string"||typeof v=="number")&&e.modelType?O(v):A,g=v=>Array.isArray(v)?[m(v[0],Vn(null,+v[0].hours,+v[0].minutes,v[0].seconds)),m(v[1],Vn(null,+v[1].hours,+v[1].minutes,v[1].seconds))]:m(v,Vn(null,v.hours,v.minutes,v.seconds)),k=v=>Array.isArray(v)?e.multiDates?v.map(A=>m(A,Mn(null,+A.month,+A.year))):Eo(()=>[m(v[0],Mn(null,+v[0].month,+v[0].year)),m(v[1],v[1]?Mn(null,+v[1].month,+v[1].year):Ur(e.partialRange))],e.range):m(v,Mn(null,+v.month,+v.year)),x=v=>{if(Array.isArray(v))return v.map(A=>O(A));throw new Error(So.dateArr("multi-dates"))},S=v=>{if(Array.isArray(v))return[G(v[0]),G(v[1])];throw new Error(So.dateArr("week-picker"))},T=v=>e.modelAuto?Array.isArray(v)?[O(v[0]),O(v[1])]:e.autoApply?[O(v)]:[O(v),null]:Array.isArray(v)?Eo(()=>[O(v[0]),v[1]?O(v[1]):Ur(e.partialRange)],e.range):O(v),y=()=>{Array.isArray(r.value)&&e.range&&r.value.length===1&&r.value.push(Ur(e.partialRange))},B=()=>{const v=r.value;return[I(v[0]),v[1]?I(v[1]):Ur(e.partialRange)]},w=()=>r.value[1]?B():I(Je(r.value[0])),V=()=>(r.value||[]).map(v=>I(v)),$=()=>(y(),e.modelAuto?w():e.multiDates?V():Array.isArray(r.value)?Eo(()=>B(),e.range):I(Je(r.value))),M=v=>!v||Array.isArray(v)&&!v.length?null:e.timePicker?g(Je(v)):e.monthPicker?k(Je(v)):e.yearPicker?h(Je(v)):e.multiDates?x(Je(v)):e.weekPicker?S(Je(v)):T(Je(v)),_=v=>{const A=M(v);ps(Je(A))?(r.value=Je(A),F()):(r.value=null,a.value="")},z=()=>{const v=A=>In(A,i.value.format);return`${v(r.value[0])} ${i.value.rangeSeparator} ${r.value[1]?v(r.value[1]):""}`},N=()=>t.value&&r.value?Array.isArray(r.value)?z():In(r.value,i.value.format):u(r.value),W=()=>r.value?e.multiDates?r.value.map(v=>u(v)).join("; "):i.value.enabled&&typeof i.value.format=="string"?N():u(r.value):"",F=()=>{!e.format||typeof e.format=="string"||i.value.enabled&&typeof i.value.format=="string"?a.value=W():a.value=e.format(r.value)},O=v=>{if(e.utc){const A=new Date(v);return e.utc==="preserve"?new Date(A.getTime()+A.getTimezoneOffset()*6e4):A}return e.modelType?e.modelType==="date"||e.modelType==="timestamp"?d(new Date(v)):e.modelType==="format"&&(typeof e.format=="string"||!e.format)?Ha(v,o(),new Date):d(Ha(v,e.modelType,new Date)):d(new Date(v))},I=v=>v?e.utc?lv(v,e.utc==="preserve",e.enableSeconds):e.modelType?e.modelType==="timestamp"?+c(v):e.modelType==="format"&&(typeof e.format=="string"||!e.format)?u(c(v)):u(c(v),e.modelType,!0):c(v):"",H=(v,A=!1)=>{if(n("update:model-value",v),e.emitTimezone&&A){const E=Array.isArray(v)?v.map(P=>Rt(Je(P)),e.emitTimezone):Rt(Je(v),e.emitTimezone);n("update:model-timezone-value",E)}},b=v=>Array.isArray(r.value)?e.multiDates?r.value.map(A=>v(A)):[v(r.value[0]),r.value[1]?v(r.value[1]):Ur(e.partialRange)]:v(Je(r.value)),C=v=>H(Je(b(v)));return{inputValue:a,internalModelValue:r,checkBeforeEmit:()=>r.value?e.range?e.partialRange?r.value.length>=1:r.value.length===2:!!r.value:!1,parseExternalModelValue:_,formatInputValue:F,emitModelValue:()=>(F(),e.monthPicker?C(p):e.timePicker?C(f):e.yearPicker?C(Me):e.weekPicker?H(r.value.map(v=>I(v)),!0):H($(),!0))}},Mv=(n,e)=>{const{defaultedFilters:t}=Ye(n),{validateMonthYearInRange:r}=Wr(n),i=(d,u)=>{let f=d;return t.value.months.includes(Ce(f))?(f=u?jt(d,1):zr(d,1),i(f,u)):f},o=(d,u)=>{let f=d;return t.value.years.includes(Me(f))?(f=u?Ba(d,1):ed(d,1),o(f,u)):f},a=(d,u=!1)=>{const f=Be(new Date,{month:n.month,year:n.year});let p=d?jt(f,1):zr(f,1);n.disableYearSelect&&(p=ur(p,n.year));let h=Ce(p),m=Me(p);t.value.months.includes(h)&&(p=i(p,d),h=Ce(p),m=Me(p)),t.value.years.includes(m)&&(p=o(p,d),m=Me(p)),r(h,m,d,n.preventMinMaxNavigation)&&s(h,m,u)},s=(d,u,f)=>{e("update-month-year",{month:d,year:u,fromNav:f})},c=l.computed(()=>d=>Td(Be(new Date,{month:n.month,year:n.year}),n.maxDate,n.minDate,n.preventMinMaxNavigation,d));return{handleMonthYearChange:a,isDisabled:c,updateMonthYear:s}};var jr=(n=>(n.center="center",n.left="left",n.right="right",n))(jr||{}),Kt=(n=>(n.month="month",n.year="year",n))(Kt||{}),pr=(n=>(n.top="top",n.bottom="bottom",n))(pr||{}),hr=(n=>(n.header="header",n.calendar="calendar",n.timePicker="timePicker",n))(hr||{}),cn=(n=>(n.month="month",n.year="year",n.calendar="calendar",n.time="time",n.minutes="minutes",n.hours="hours",n.seconds="seconds",n))(cn||{});const Tv=({menuRef:n,menuRefInner:e,inputRef:t,pickerWrapperRef:r,inline:i,emit:o,props:a,slots:s})=>{const c=l.ref({}),d=l.ref(!1),u=l.ref({top:"0",left:"0"}),f=l.ref(!1),p=l.toRef(a,"teleportCenter");l.watch(p,()=>{u.value=JSON.parse(JSON.stringify({})),y()});const h=O=>{if(a.teleport){const I=O.getBoundingClientRect();return{left:I.left+window.scrollX,top:I.top+window.scrollY}}return{top:0,left:0}},m=(O,I)=>{u.value.left=`${O+I-c.value.width}px`},g=O=>{u.value.left=`${O}px`},k=(O,I)=>{a.position===jr.left&&g(O),a.position===jr.right&&m(O,I),a.position===jr.center&&(u.value.left=`${O+I/2-c.value.width/2}px`)},x=O=>{const{width:I,height:H}=O.getBoundingClientRect(),{top:b,left:C}=a.altPosition?a.altPosition(O):h(O);return{top:+b,left:+C,width:I,height:H}},S=()=>{u.value.left="50%",u.value.top="50%",u.value.transform="translate(-50%, -50%)",u.value.position="fixed",delete u.value.opacity},T=()=>{const O=qe(t),{top:I,left:H,transform:b}=a.altPosition(O);u.value={top:`${I}px`,left:`${H}px`,transform:b??""}},y=(O=!0)=>{var I;if(!i.value.enabled){if(p.value)return S();if(a.altPosition!==null)return T();if(O){const H=a.teleport?(I=e.value)==null?void 0:I.$el:n.value;H&&(c.value=H.getBoundingClientRect()),o("recalculate-position")}return z()}},B=({inputEl:O,left:I,width:H})=>{window.screen.width>768&&!d.value&&k(I,H),$(O)},w=O=>{const{top:I,left:H,height:b,width:C}=x(O);u.value.top=`${b+I+ +a.offset}px`,f.value=!1,d.value||(u.value.left=`${H+C/2-c.value.width/2}px`),B({inputEl:O,left:H,width:C})},V=O=>{const{top:I,left:H,width:b}=x(O);u.value.top=`${I-+a.offset-c.value.height}px`,f.value=!0,B({inputEl:O,left:H,width:b})},$=O=>{if(a.autoPosition){const{left:I,width:H}=x(O),{left:b,right:C}=c.value;if(!d.value){if(Math.abs(b)!==Math.abs(C)){if(b<=0)return d.value=!0,g(I);if(C>=document.documentElement.clientWidth)return d.value=!0,m(I,H)}return k(I,H)}}},M=()=>{const O=qe(t);if(O){const{height:I}=c.value,{top:H,height:b}=O.getBoundingClientRect(),C=window.innerHeight-H-b,v=H;return I<=C?pr.bottom:I>C&&I<=v?pr.top:C>=v?pr.bottom:pr.top}return pr.bottom},_=O=>M()===pr.bottom?w(O):V(O),z=()=>{const O=qe(t);if(O)return a.autoPosition?_(O):w(O)},N=function(O){if(O){const I=O.scrollHeight>O.clientHeight,H=window.getComputedStyle(O).overflowY.indexOf("hidden")!==-1;return I&&!H}return!0},W=function(O){return!O||O===document.body||O.nodeType===Node.DOCUMENT_FRAGMENT_NODE?window:N(O)?O:W(O.parentNode)},F=O=>{if(O)switch(a.position){case jr.left:return{left:0,transform:"translateX(0)"};case jr.right:return{left:`${O.width}px`,transform:"translateX(-100%)"};default:return{left:`${O.width/2}px`,transform:"translateX(-50%)"}}return{}};return{openOnTop:f,menuStyle:u,xCorrect:d,setMenuPosition:y,getScrollableParent:W,shadowRender:(O,I)=>{var H,b,C;const v=document.createElement("div"),A=(H=qe(t))==null?void 0:H.getBoundingClientRect();v.setAttribute("id","dp--temp-container");const E=(b=r.value)!=null&&b.clientWidth?r.value:document.body;E.append(v);const P=document.getElementById("dp--temp-container"),q=F(A),D=l.h(O,{...I,shadow:!0,style:{opacity:0,position:"absolute",...q}},Object.fromEntries(Object.keys(s).filter(X=>["right-sidebar","left-sidebar"].includes(X)).map(X=>[X,s[X]])));l.render(D,P),c.value=(C=D.el)==null?void 0:C.getBoundingClientRect(),l.render(null,P),E.removeChild(P)}}},Fn=[{name:"clock-icon",use:["time","calendar","shared"]},{name:"arrow-left",use:["month-year","calendar","shared","year-mode"]},{name:"arrow-right",use:["month-year","calendar","shared","year-mode"]},{name:"arrow-up",use:["time","calendar","month-year","shared"]},{name:"arrow-down",use:["time","calendar","month-year","shared"]},{name:"calendar-icon",use:["month-year","time","calendar","shared","year-mode"]},{name:"day",use:["calendar","shared"]},{name:"month-overlay-value",use:["calendar","month-year","shared"]},{name:"year-overlay-value",use:["calendar","month-year","shared","year-mode"]},{name:"year-overlay",use:["month-year","shared"]},{name:"month-overlay",use:["month-year","shared"]},{name:"month-overlay-header",use:["month-year","shared"]},{name:"year-overlay-header",use:["month-year","shared"]},{name:"hours-overlay-value",use:["calendar","time","shared"]},{name:"minutes-overlay-value",use:["calendar","time","shared"]},{name:"seconds-overlay-value",use:["calendar","time","shared"]},{name:"hours",use:["calendar","time","shared"]},{name:"minutes",use:["calendar","time","shared"]},{name:"month",use:["calendar","month-year","shared"]},{name:"year",use:["calendar","month-year","shared","year-mode"]},{name:"action-buttons",use:["action"]},{name:"action-preview",use:["action"]},{name:"calendar-header",use:["calendar","shared"]},{name:"marker-tooltip",use:["calendar","shared"]},{name:"action-extra",use:["menu"]},{name:"time-picker-overlay",use:["calendar","time","shared"]},{name:"am-pm-button",use:["calendar","time","shared"]},{name:"left-sidebar",use:["menu"]},{name:"right-sidebar",use:["menu"]},{name:"month-year",use:["month-year","shared"]},{name:"time-picker",use:["menu","shared"]},{name:"action-row",use:["action"]},{name:"marker",use:["calendar","shared"]},{name:"quarter",use:["shared"]}],Sv=[{name:"trigger"},{name:"input-icon"},{name:"clear-icon"},{name:"dp-input"}],Dv={all:()=>Fn,monthYear:()=>Fn.filter(n=>n.use.includes("month-year")),input:()=>Sv,timePicker:()=>Fn.filter(n=>n.use.includes("time")),action:()=>Fn.filter(n=>n.use.includes("action")),calendar:()=>Fn.filter(n=>n.use.includes("calendar")),menu:()=>Fn.filter(n=>n.use.includes("menu")),shared:()=>Fn.filter(n=>n.use.includes("shared")),yearMode:()=>Fn.filter(n=>n.use.includes("year-mode"))},At=(n,e,t)=>{const r=[];return Dv[e]().forEach(i=>{n[i.name]&&r.push(i.name)}),t!=null&&t.length&&t.forEach(i=>{i.slot&&r.push(i.slot)}),r},Pi=n=>{const e=l.computed(()=>r=>n.value?r?n.value.open:n.value.close:""),t=l.computed(()=>r=>n.value?r?n.value.menuAppearTop:n.value.menuAppearBottom:"");return{transitionName:e,showTransition:!!n.value,menuTransition:t}},Ii=(n,e)=>{const t=G(Rt(new Date,n.timezone)),r=l.ref([{month:Ce(t),year:Me(t)}]),i=l.reactive({hours:n.range?[Wt(t),Wt(t)]:Wt(t),minutes:n.range?[an(t),an(t)]:an(t),seconds:n.range?[0,0]:0}),o=l.computed({get:()=>n.internalModelValue,set:c=>{!n.readonly&&!n.disabled&&e("update:internal-model-value",c)}}),a=l.computed(()=>c=>r.value[c]?r.value[c].month:0),s=l.computed(()=>c=>r.value[c]?r.value[c].year:0);return{calendars:r,time:i,modelValue:o,month:a,year:s}},Av=(n,e)=>{const{defaultedMultiCalendars:t}=Ye(e),{isDisabled:r,matchDate:i}=Wr(e),o=l.ref(null),a=l.ref(G(Rt(new Date,e.timezone))),s=b=>{!b.current&&e.hideOffsetDates||(o.value=b.value)},c=()=>{o.value=null},d=b=>Array.isArray(n.value)&&e.range&&n.value[0]&&o.value?b?lt(o.value,n.value[0]):nt(o.value,n.value[0]):!0,u=(b,C)=>{const v=()=>n.value?C?n.value[0]||null:n.value[1]:null,A=n.value&&Array.isArray(n.value)?v():null;return Ae(G(b.value),A)},f=b=>{const C=Array.isArray(n.value)?n.value[0]:null;return b?!nt(o.value??null,C):!0},p=(b,C=!0)=>(e.range||e.weekPicker)&&Array.isArray(n.value)&&n.value.length===2?e.hideOffsetDates&&!b.current?!1:Ae(G(b.value),n.value[C?0:1]):e.range?u(b,C)&&f(C)||Ae(b.value,Array.isArray(n.value)?n.value[0]:null)&&d(C):!1,h=(b,C,v)=>Array.isArray(n.value)&&n.value[0]&&n.value.length===1?b?!1:v?lt(n.value[0],C.value):nt(n.value[0],C.value):!1,m=b=>!n.value||e.hideOffsetDates&&!b.current?!1:e.range?e.modelAuto&&Array.isArray(n.value)?Ae(b.value,n.value[0]?n.value[0]:a.value):!1:e.multiDates&&Array.isArray(n.value)?n.value.some(C=>Ae(C,b.value)):Ae(b.value,n.value?n.value:a.value),g=b=>{if(e.autoRange||e.weekPicker){if(o.value){if(e.hideOffsetDates&&!b.current)return!1;const C=Cn(o.value,+e.autoRange),v=Ao(G(o.value),e.timezone,e.weekStart);return e.weekPicker?Ae(v[1],G(b.value)):Ae(C,G(b.value))}return!1}return!1},k=b=>{if(e.autoRange||e.weekPicker){if(o.value){const C=Cn(o.value,+e.autoRange);if(e.hideOffsetDates&&!b.current)return!1;const v=Ao(G(o.value),e.timezone,e.weekStart);return e.weekPicker?lt(b.value,v[0])&&nt(b.value,v[1]):lt(b.value,o.value)&&nt(b.value,C)}return!1}return!1},x=b=>{if(e.autoRange||e.weekPicker){if(o.value){if(e.hideOffsetDates&&!b.current)return!1;const C=Ao(G(o.value),e.timezone,e.weekStart);return e.weekPicker?Ae(C[0],b.value):Ae(o.value,b.value)}return!1}return!1},S=b=>Do(n.value,o.value,b.value),T=()=>e.modelAuto&&Array.isArray(e.internalModelValue)?!!e.internalModelValue[0]:!1,y=()=>e.modelAuto?md(e.internalModelValue):!0,B=b=>{if(Array.isArray(n.value)&&n.value.length||e.weekPicker)return!1;const C=e.range?!p(b)&&!p(b,!1):!0;return!r(b.value)&&!m(b)&&!(!b.current&&e.hideOffsetDates)&&C},w=b=>e.range?e.modelAuto?T()&&m(b):!1:m(b),V=b=>{var C;return e.highlight?i(b.value,(C=e.arrMapValues)!=null&&C.highlightedDates?e.arrMapValues.highlightedDates:e.highlight):!1},$=b=>r(b.value)&&e.highlightDisabledDays===!1,M=b=>{var C;return(C=e.highlightWeekDays)==null?void 0:C.includes(b.value.getDay())},_=b=>(e.range||e.weekPicker)&&(!(t.value.count>0)||b.current)&&y()&&!(!b.current&&e.hideOffsetDates)&&!m(b)?S(b):!1,z=b=>{const{isRangeStart:C,isRangeEnd:v}=F(b),A=e.range?C||v:!1;return{dp__cell_offset:!b.current,dp__pointer:!e.disabled&&!(!b.current&&e.hideOffsetDates)&&!r(b.value),dp__cell_disabled:r(b.value),dp__cell_highlight:!$(b)&&(V(b)||M(b))&&!w(b)&&!A,dp__cell_highlight_active:!$(b)&&(V(b)||M(b))&&w(b),dp__today:!e.noToday&&Ae(b.value,a.value)&&b.current}},N=b=>({dp__active_date:w(b),dp__date_hover:B(b)}),W=b=>({...O(b),...I(b),dp__range_between_week:_(b)&&e.weekPicker}),F=b=>{const C=t.value.count>0?b.current&&p(b)&&y():p(b)&&y(),v=t.value.count>0?b.current&&p(b,!1)&&y():p(b,!1)&&y();return{isRangeStart:C,isRangeEnd:v}},O=b=>{const{isRangeStart:C,isRangeEnd:v}=F(b);return{dp__range_start:C,dp__range_end:v,dp__range_between:_(b)&&!e.weekPicker,dp__date_hover_start:h(B(b),b,!0),dp__date_hover_end:h(B(b),b,!1)}},I=b=>({...O(b),dp__cell_auto_range:k(b),dp__cell_auto_range_start:x(b),dp__cell_auto_range_end:g(b)}),H=b=>e.range?e.autoRange?I(b):e.modelAuto?{...N(b),...O(b)}:O(b):e.weekPicker?W(b):N(b);return{setHoverDate:s,clearHoverDate:c,getDayClassData:b=>e.hideOffsetDates&&!b.current?{}:{...z(b),...H(b),[e.dayClass?e.dayClass(b.value):""]:!0,[e.calendarCellClassName]:!!e.calendarCellClassName}}},Wr=n=>{const{defaultedFilters:e}=Ye(n),t=()=>{if(n.timezone)return n.timezone;if(n.utc)return"UTC"},r=M=>{const _=It(i(G(M))).toISOString(),[z]=_.split("T");return z},i=M=>n.utc==="preserve"?kd(M,t()):Rt(M,t()),o=M=>{var _;const z=n.maxDate?lt(i(M),i(G(n.maxDate))):!1,N=n.minDate?nt(i(M),i(G(n.minDate))):!1,W=d(i(M),(_=n.arrMapValues)!=null&&_.disabledDates?n.arrMapValues.disabledDates:n.disabledDates),F=e.value.months.map(C=>+C).includes(Ce(M)),O=n.disabledWeekDays.length?n.disabledWeekDays.some(C=>+C===sy(M)):!1,I=f(M),H=Me(M),b=H<+n.yearRange[0]||H>+n.yearRange[1];return!(z||N||W||F||b||O||I)},a=(M,_)=>nt(...Ln(n.minDate,M,_))||Ae(...Ln(n.minDate,M,_)),s=(M,_)=>lt(...Ln(n.maxDate,M,_))||Ae(...Ln(n.maxDate,M,_)),c=(M,_,z)=>{let N=!1;return n.maxDate&&z&&s(M,_)&&(N=!0),n.minDate&&!z&&a(M,_)&&(N=!0),N},d=(M,_)=>M?_ instanceof Map?!!_.get(r(M)):Array.isArray(_)?_.some(z=>Ae(i(G(z)),i(M))):_?_(G(JSON.parse(JSON.stringify(M)))):!1:!0,u=(M,_,z,N)=>{let W=!1;return N?n.minDate&&n.maxDate?W=c(M,_,z):(n.minDate&&a(M,_)||n.maxDate&&s(M,_))&&(W=!0):W=!0,W},f=M=>{var _,z,N,W,F;return Array.isArray(n.allowedDates)&&!((_=n.allowedDates)!=null&&_.length)?!0:(z=n.arrMapValues)!=null&&z.allowedDates?!d(M,(N=n.arrMapValues)==null?void 0:N.allowedDates):(W=n.allowedDates)!=null&&W.length?!((F=n.allowedDates)!=null&&F.some(O=>Ae(i(G(O)),i(M)))):!1},p=M=>!o(M),h=M=>n.noDisabledRange?!Dc({start:M[0],end:M[1]}).some(_=>p(_)):!0,m=(M,_,z=0)=>{if(Array.isArray(_)&&_[z]){const N=Jm(M,_[z]),W=Cd(_[z],M),F=W.length===1?0:W.filter(I=>p(I)).length,O=Math.abs(N)-F;if(n.minRange&&n.maxRange)return O>=+n.minRange&&O<=+n.maxRange;if(n.minRange)return O>=+n.minRange;if(n.maxRange)return O<=+n.maxRange}return!0},g=M=>new Map(M.map(_=>[r(_),!0])),k=M=>Array.isArray(M)&&M.length>0,x=()=>{const M={disabledDates:null,allowedDates:null,highlightedDates:null};return k(n.allowedDates)&&(M.allowedDates=g(n.allowedDates)),k(n.highlight)&&(M.highlightedDates=g(n.highlight)),k(n.disabledDates)&&(M.disabledDates=g(n.disabledDates)),M},S=()=>!n.enableTimePicker||n.monthPicker||n.yearPicker||n.ignoreTimeValidation,T=M=>Array.isArray(M)?[M[0]?ms(M[0]):null,M[1]?ms(M[1]):null]:ms(M),y=(M,_,z)=>M.find(N=>+N.hours===Wt(_)&&N.minutes==="*"?!0:+N.minutes===an(_)&&+N.hours===Wt(_))&&z,B=(M,_,z)=>{const[N,W]=M,[F,O]=_;return!y(N,F,z)&&!y(W,O,z)&&z},w=(M,_)=>{const z=Array.isArray(_)?_:[_];return Array.isArray(n.disabledTimes)?Array.isArray(n.disabledTimes[0])?B(n.disabledTimes,z,M):!z.some(N=>y(n.disabledTimes,N,M)):M},V=(M,_)=>{const z=Array.isArray(_)?[fr(_[0]),_[1]?fr(_[1]):void 0]:fr(_),N=!n.disabledTimes(z);return M&&N},$=(M,_)=>n.disabledTimes?Array.isArray(n.disabledTimes)?w(_,M):V(_,M):_;return{isDisabled:p,validateDate:o,validateMonthYearInRange:u,isDateRangeAllowed:h,checkMinMaxRange:m,matchDate:d,mapDatesArrToMap:x,isValidTime:M=>{let _=!0;if(!M||S())return!0;const z=!n.minDate&&!n.maxDate?T(M):M;return(n.maxTime||n.maxDate)&&(_=Dd(n.maxTime,n.maxDate,"max",Je(z),_)),(n.minTime||n.minDate)&&(_=Dd(n.minTime,n.minDate,"min",Je(z),_)),$(M,_)}}},No=()=>{const n=l.computed(()=>(r,i)=>r==null?void 0:r.includes(i)),e=l.computed(()=>(r,i)=>r.count?r.solo?!0:i===0:!0),t=l.computed(()=>(r,i)=>r.count?r.solo?!0:i===r.count-1:!0);return{hideNavigationButtons:n,showLeftIcon:e,showRightIcon:t}},Ev=(n,e,t)=>{const r=l.ref(0),i=l.reactive({[hr.timePicker]:!n.enableTimePicker||n.timePicker||n.monthPicker,[hr.calendar]:!1,[hr.header]:!1}),o=(...u)=>{var f;(f=n.flow)!=null&&f.length&&(i[u]=!0,Object.keys(i).filter(p=>!i[p]).length||d())},a=()=>{var u;(u=n.flow)!=null&&u.length&&r.value!==-1&&(r.value+=1,e("flow-step",r.value),d())},s=()=>{r.value=-1},c=(u,f,...p)=>{n.flow[r.value]===u&&t.value&&t.value[f](...p)},d=()=>{c(cn.month,"toggleMonthPicker",!0),c(cn.year,"toggleYearPicker",!0),c(cn.calendar,"toggleTimePicker",!1,!0),c(cn.time,"toggleTimePicker",!0,!0);const u=n.flow[r.value];(u===cn.hours||u===cn.minutes||u===cn.seconds)&&c(u,"toggleTimePicker",!0,!0,u)};return{childMount:o,updateFlowStep:a,resetFlow:s,flowStep:r}},_o={multiCalendars:{type:[Boolean,Number,String,Object],default:void 0},modelValue:{type:[String,Date,Array,Object,Number],default:null},modelType:{type:String,default:null},position:{type:String,default:"center"},dark:{type:Boolean,default:!1},format:{type:[String,Function],default:()=>null},autoPosition:{type:Boolean,default:!0},altPosition:{type:Function,default:null},transitions:{type:[Boolean,Object],default:!0},formatLocale:{type:Object,default:null},utc:{type:[Boolean,String],default:!1},ariaLabels:{type:Object,default:()=>({})},offset:{type:[Number,String],default:10},hideNavigation:{type:Array,default:()=>[]},timezone:{type:String,default:null},emitTimezone:{type:String,default:null},vertical:{type:Boolean,default:!1},disableMonthYearSelect:{type:Boolean,default:!1},disableYearSelect:{type:Boolean,default:!1},menuClassName:{type:String,default:null},dayClass:{type:Function,default:null},yearRange:{type:Array,default:()=>[1900,2100]},calendarCellClassName:{type:String,default:null},enableTimePicker:{type:Boolean,default:!0},autoApply:{type:Boolean,default:!1},disabledDates:{type:[Array,Function],default:()=>[]},monthNameFormat:{type:String,default:"short"},startDate:{type:[Date,String],default:null},startTime:{type:[Object,Array],default:null},hideOffsetDates:{type:Boolean,default:!1},autoRange:{type:[Number,String],default:null},noToday:{type:Boolean,default:!1},disabledWeekDays:{type:Array,default:()=>[]},allowedDates:{type:Array,default:null},nowButtonLabel:{type:String,default:"Now"},markers:{type:Array,default:()=>[]},escClose:{type:Boolean,default:!0},spaceConfirm:{type:Boolean,default:!0},monthChangeOnArrows:{type:Boolean,default:!0},presetDates:{type:Array,default:()=>[]},flow:{type:Array,default:()=>[]},partialFlow:{type:Boolean,default:!1},preventMinMaxNavigation:{type:Boolean,default:!1},minRange:{type:[Number,String],default:null},maxRange:{type:[Number,String],default:null},multiDatesLimit:{type:[Number,String],default:null},reverseYears:{type:Boolean,default:!1},weekPicker:{type:Boolean,default:!1},filters:{type:Object,default:()=>({})},arrowNavigation:{type:Boolean,default:!1},disableTimeRangeValidation:{type:Boolean,default:!1},highlight:{type:[Array,Function],default:null},highlightWeekDays:{type:Array,default:null},highlightDisabledDays:{type:Boolean,default:!1},teleport:{type:[String,Boolean],default:null},teleportCenter:{type:Boolean,default:!1},locale:{type:String,default:"en-Us"},weekNumName:{type:String,default:"W"},weekStart:{type:[Number,String],default:1},weekNumbers:{type:[String,Function],default:null},calendarClassName:{type:String,default:null},monthChangeOnScroll:{type:[Boolean,String],default:!0},dayNames:{type:[Function,Array],default:null},monthPicker:{type:Boolean,default:!1},customProps:{type:Object,default:null},yearPicker:{type:Boolean,default:!1},modelAuto:{type:Boolean,default:!1},selectText:{type:String,default:"Select"},cancelText:{type:String,default:"Cancel"},previewFormat:{type:[String,Function],default:()=>""},multiDates:{type:Boolean,default:!1},partialRange:{type:Boolean,default:!0},ignoreTimeValidation:{type:Boolean,default:!1},minDate:{type:[Date,String],default:null},maxDate:{type:[Date,String],default:null},minTime:{type:Object,default:null},maxTime:{type:Object,default:null},name:{type:String,default:null},placeholder:{type:String,default:""},hideInputIcon:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},state:{type:Boolean,default:null},required:{type:Boolean,default:!1},autocomplete:{type:String,default:"off"},inputClassName:{type:String,default:null},fixedStart:{type:Boolean,default:!1},fixedEnd:{type:Boolean,default:!1},timePicker:{type:Boolean,default:!1},enableSeconds:{type:Boolean,default:!1},is24:{type:Boolean,default:!0},noHoursOverlay:{type:Boolean,default:!1},noMinutesOverlay:{type:Boolean,default:!1},noSecondsOverlay:{type:Boolean,default:!1},hoursGridIncrement:{type:[String,Number],default:1},minutesGridIncrement:{type:[String,Number],default:5},secondsGridIncrement:{type:[String,Number],default:5},hoursIncrement:{type:[Number,String],default:1},minutesIncrement:{type:[Number,String],default:1},secondsIncrement:{type:[Number,String],default:1},range:{type:Boolean,default:!1},uid:{type:String,default:null},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},inline:{type:[Boolean,Object],default:!1},textInput:{type:[Boolean,Object],default:!1},noDisabledRange:{type:Boolean,default:!1},sixWeeks:{type:[Boolean,String],default:!1},actionRow:{type:Object,default:()=>({})},focusStartDate:{type:Boolean,default:!1},disabledTimes:{type:[Function,Array],default:void 0},showLastInRange:{type:Boolean,default:!0},timePickerInline:{type:Boolean,default:!1},calendar:{type:Function,default:null},config:{type:Object,default:void 0},quarterPicker:{type:Boolean,default:!1}},Gt={..._o,shadow:{type:Boolean,default:!1},flowStep:{type:Number,default:0},internalModelValue:{type:[Date,Array],default:null},arrMapValues:{type:Object,default:()=>({})},noOverlayFocus:{type:Boolean,default:!1}},Ov={key:1,class:"dp__input_wrap"},Nv=["id","name","inputmode","placeholder","disabled","readonly","required","value","autocomplete","aria-label","aria-disabled","aria-invalid","onKeydown"],_v={key:2,class:"dp__clear_icon"},Bv=l.defineComponent({compatConfig:{MODE:3},__name:"DatepickerInput",props:{isMenuOpen:{type:Boolean,default:!1},inputValue:{type:String,default:""},..._o},emits:["clear","open","update:input-value","set-input-date","close","select-date","set-empty-date","toggle","focus-prev","focus","blur","real-blur"],setup(n,{expose:e,emit:t}){const r=n,{defaultedTextInput:i,defaultedAriaLabels:o,defaultedInline:a,defaultedConfig:s,getDefaultPattern:c,getDefaultStartTime:d}=Ye(r),u=l.ref(),f=l.ref(null),p=l.ref(!1),h=l.ref(!1),m=l.computed(()=>({dp__pointer:!r.disabled&&!r.readonly&&!i.value.enabled,dp__disabled:r.disabled,dp__input_readonly:!i.value.enabled,dp__input:!0,dp__input_icon_pad:!r.hideInputIcon,dp__input_valid:!!r.state,dp__input_invalid:r.state===!1,dp__input_focus:p.value||r.isMenuOpen,dp__input_reg:!i.value.enabled,[r.inputClassName]:!!r.inputClassName})),g=()=>{t("set-input-date",null),r.autoApply&&(t("set-empty-date"),u.value=null)},k=N=>{const W=d();return sv(N,i.value.format??c(),W??Md({},r.enableSeconds),r.inputValue,h.value)},x=N=>{const{rangeSeparator:W}=i.value,[F,O]=N.split(`${W}`);if(F){const I=k(F.trim()),H=O?k(O.trim()):null,b=I&&H?[I,H]:[I];u.value=I?b:null}},S=()=>{h.value=!0},T=N=>{if(r.range)x(N);else if(r.multiDates){const W=N.split(";");u.value=W.map(F=>k(F.trim())).filter(F=>F)}else u.value=k(N)},y=N=>{var W;const F=typeof N=="string"?N:(W=N.target)==null?void 0:W.value;F!==""?(i.value.openMenu&&!r.isMenuOpen&&t("open"),T(F),t("set-input-date",u.value)):g(),h.value=!1,t("update:input-value",F)},B=N=>{i.value.enabled?(T(N.target.value),i.value.enterSubmit&&ps(u.value)&&r.inputValue!==""?(t("set-input-date",u.value,!0),u.value=null):i.value.enterSubmit&&r.inputValue===""&&(u.value=null,t("clear"))):$(N)},w=N=>{i.value.enabled&&i.value.tabSubmit&&T(N.target.value),i.value.tabSubmit&&ps(u.value)&&r.inputValue!==""?(t("set-input-date",u.value,!0),u.value=null):i.value.tabSubmit&&r.inputValue===""&&(u.value=null,t("clear"))},V=()=>{var N;p.value=!0,t("focus"),i.value.enabled&&i.value.selectOnFocus&&((N=f.value)==null||N.select())},$=N=>{N.preventDefault(),Rn(N,s.value,!0),i.value.enabled&&i.value.openMenu&&!a.value.input&&!r.isMenuOpen?t("open"):i.value.enabled||t("toggle")},M=()=>{t("real-blur"),p.value=!1,(!r.isMenuOpen||a.value.enabled&&a.value.input)&&t("blur"),r.autoApply&&i.value.enabled&&u.value&&!r.isMenuOpen&&(t("set-input-date",u.value),t("select-date"),u.value=null)},_=N=>{Rn(N,s.value,!0),t("clear")},z=N=>{if(!i.value.enabled){if(N.code==="Tab")return;N.preventDefault()}};return e({focusInput:()=>{var N;(N=f.value)==null||N.focus({preventScroll:!0})},setParsedDate:N=>{u.value=N}}),(N,W)=>{var F;return l.openBlock(),l.createElementBlock("div",{onClick:$},[N.$slots.trigger&&!N.$slots["dp-input"]&&!l.unref(a).enabled?l.renderSlot(N.$slots,"trigger",{key:0}):l.createCommentVNode("",!0),!N.$slots.trigger&&(!l.unref(a).enabled||l.unref(a).input)?(l.openBlock(),l.createElementBlock("div",Ov,[N.$slots["dp-input"]&&!N.$slots.trigger&&!l.unref(a).enabled?l.renderSlot(N.$slots,"dp-input",{key:0,value:n.inputValue,isMenuOpen:n.isMenuOpen,onInput:y,onEnter:B,onTab:w,onClear:_,onBlur:M,onKeypress:z,onPaste:S}):l.createCommentVNode("",!0),N.$slots["dp-input"]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("input",{key:1,ref_key:"inputRef",ref:f,id:N.uid?`dp-input-${N.uid}`:void 0,name:N.name,class:l.normalizeClass(m.value),inputmode:l.unref(i).enabled?"text":"none",placeholder:N.placeholder,disabled:N.disabled,readonly:N.readonly,required:N.required,value:n.inputValue,autocomplete:N.autocomplete,"aria-label":(F=l.unref(o))==null?void 0:F.input,"aria-disabled":N.disabled||void 0,"aria-invalid":N.state===!1?!0:void 0,onInput:y,onKeydown:[l.withKeys(B,["enter"]),l.withKeys(w,["tab"]),z],onBlur:M,onFocus:V,onKeypress:z,onPaste:S},null,42,Nv)),l.createElementVNode("div",{onClick:W[2]||(W[2]=O=>t("toggle"))},[N.$slots["input-icon"]&&!N.hideInputIcon?(l.openBlock(),l.createElementBlock("span",{key:0,class:"dp__input_icon",onClick:W[0]||(W[0]=O=>t("toggle"))},[l.renderSlot(N.$slots,"input-icon")])):l.createCommentVNode("",!0),!N.$slots["input-icon"]&&!N.hideInputIcon&&!N.$slots["dp-input"]?(l.openBlock(),l.createBlock(l.unref(Ni),{key:1,onClick:W[1]||(W[1]=O=>t("toggle")),class:"dp__input_icon dp__input_icons"})):l.createCommentVNode("",!0)]),N.$slots["clear-icon"]&&n.inputValue&&N.clearable&&!N.disabled&&!N.readonly?(l.openBlock(),l.createElementBlock("span",_v,[l.renderSlot(N.$slots,"clear-icon",{clear:_})])):l.createCommentVNode("",!0),N.clearable&&!N.$slots["clear-icon"]&&n.inputValue&&!N.disabled&&!N.readonly?(l.openBlock(),l.createBlock(l.unref(td),{key:3,class:"dp__clear_icon dp__input_icons",onClick:W[3]||(W[3]=l.withModifiers(O=>_(O),["prevent"]))})):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)])}}}),Pv=["title"],Iv={class:"dp__action_buttons"},Rv=["onKeydown","disabled"],Vv=l.defineComponent({compatConfig:{MODE:3},__name:"ActionRow",props:{menuMount:{type:Boolean,default:!1},calendarWidth:{type:Number,default:0},...Gt},emits:["close-picker","select-date","select-now","invalid-select"],setup(n,{emit:e}){const t=n,{defaultedActionRow:r,defaultedPreviewFormat:i,defaultedMultiCalendars:o,defaultedTextInput:a,defaultedInline:s,getDefaultPattern:c}=Ye(t),{isValidTime:d}=Wr(t),{buildMatrix:u}=$n(),f=l.ref(null),p=l.ref(null);l.onMounted(()=>{t.arrowNavigation&&u([qe(f),qe(p)],"actionRow")});const h=l.computed(()=>t.range&&!t.partialRange&&t.internalModelValue?t.internalModelValue.length===2:!0),m=l.computed(()=>!g.value||!k.value||!h.value),g=l.computed(()=>!t.enableTimePicker||t.ignoreTimeValidation?!0:d(t.internalModelValue)),k=l.computed(()=>t.monthPicker?t.range&&Array.isArray(t.internalModelValue)?!t.internalModelValue.filter(M=>!V(M)).length:V(t.internalModelValue):!0),x=()=>{const M=i.value;return t.timePicker||t.monthPicker,M(Je(t.internalModelValue))},S=()=>{const M=t.internalModelValue;return o.value.count>0?`${T(M[0])} - ${T(M[1])}`:[T(M[0]),T(M[1])]},T=M=>Sd(M,i.value,t.formatLocale,a.value.rangeSeparator,t.modelAuto,c()),y=l.computed(()=>!t.internalModelValue||!t.menuMount?"":typeof i.value=="string"?Array.isArray(t.internalModelValue)?t.internalModelValue.length===2&&t.internalModelValue[1]?S():t.multiDates?t.internalModelValue.map(M=>`${T(M)}`):t.modelAuto?`${T(t.internalModelValue[0])}`:`${T(t.internalModelValue[0])} -`:T(t.internalModelValue):x()),B=()=>t.multiDates?"; ":" - ",w=l.computed(()=>Array.isArray(y.value)?y.value.join(B()):y.value),V=M=>{if(!t.monthPicker)return!0;let _=!0;const z=G(qt(M));if(t.minDate&&t.maxDate){const N=G(qt(t.minDate)),W=G(qt(t.maxDate));return lt(z,N)&&nt(z,W)||Ae(z,N)||Ae(z,W)}if(t.minDate){const N=G(qt(t.minDate));_=lt(z,N)||Ae(z,N)}if(t.maxDate){const N=G(qt(t.maxDate));_=nt(z,N)||Ae(z,N)}return _},$=()=>{g.value&&k.value&&h.value?e("select-date"):e("invalid-select")};return(M,_)=>(l.openBlock(),l.createElementBlock("div",{class:"dp__action_row",style:l.normalizeStyle(n.calendarWidth?{width:`${n.calendarWidth}px`}:{})},[M.$slots["action-row"]?l.renderSlot(M.$slots,"action-row",l.normalizeProps(l.mergeProps({key:0},{internalModelValue:M.internalModelValue,disabled:m.value,selectDate:()=>M.$emit("select-date"),closePicker:()=>M.$emit("close-picker")}))):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.unref(r).showPreview?(l.openBlock(),l.createElementBlock("div",{key:0,class:"dp__selection_preview",title:w.value},[M.$slots["action-preview"]?l.renderSlot(M.$slots,"action-preview",{key:0,value:M.internalModelValue}):l.createCommentVNode("",!0),M.$slots["action-preview"]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(w.value),1)],64))],8,Pv)):l.createCommentVNode("",!0),l.createElementVNode("div",Iv,[M.$slots["action-buttons"]?l.renderSlot(M.$slots,"action-buttons",{key:0,value:M.internalModelValue}):l.createCommentVNode("",!0),M.$slots["action-buttons"]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[!l.unref(s).enabled&&l.unref(r).showCancel?(l.openBlock(),l.createElementBlock("button",{key:0,type:"button",ref_key:"cancelButtonRef",ref:f,class:"dp__action_button dp__action_cancel",onClick:_[0]||(_[0]=z=>M.$emit("close-picker")),onKeydown:[_[1]||(_[1]=l.withKeys(z=>M.$emit("close-picker"),["enter"])),_[2]||(_[2]=l.withKeys(z=>M.$emit("close-picker"),["space"]))]},l.toDisplayString(M.cancelText),545)):l.createCommentVNode("",!0),l.unref(r).showNow?(l.openBlock(),l.createElementBlock("button",{key:1,type:"button",ref_key:"cancelButtonRef",ref:f,class:"dp__action_button dp__action_cancel",onClick:_[3]||(_[3]=z=>M.$emit("select-now")),onKeydown:[_[4]||(_[4]=l.withKeys(z=>M.$emit("select-now"),["enter"])),_[5]||(_[5]=l.withKeys(z=>M.$emit("select-now"),["space"]))]},l.toDisplayString(M.nowButtonLabel),545)):l.createCommentVNode("",!0),l.unref(r).showSelect?(l.openBlock(),l.createElementBlock("button",{key:2,type:"button",class:"dp__action_button dp__action_select",onKeydown:[l.withKeys($,["enter"]),l.withKeys($,["space"])],onClick:$,disabled:m.value,ref_key:"selectButtonRef",ref:p},l.toDisplayString(M.selectText),41,Rv)):l.createCommentVNode("",!0)],64))])],64))],4))}}),Lv=["onKeydown"],$v={class:"dp__selection_grid_header"},Fv=["aria-selected","aria-disabled","onClick","onKeydown","onMouseover"],zv=["aria-label","onKeydown"],Ri=l.defineComponent({__name:"SelectionOverlay",props:{items:{},type:{},isLast:{type:Boolean},arrowNavigation:{type:Boolean},skipButtonRef:{type:Boolean},headerRefs:{},hideNavigation:{},escClose:{type:Boolean},useRelative:{type:Boolean},height:{},textInput:{type:[Boolean,Object]},config:{},noOverlayFocus:{type:Boolean}},emits:["selected","toggle","reset-flow","hover-value"],setup(n,{expose:e,emit:t}){const r=n,{setSelectionGrid:i,buildMultiLevelMatrix:o,setMonthPicker:a}=$n(),{defaultedAriaLabels:s,defaultedTextInput:c,defaultedConfig:d}=Ye(r),{hideNavigationButtons:u}=No(),f=l.ref(!1),p=l.ref(null),h=l.ref(null),m=l.ref([]),g=l.ref(),k=l.ref(null),x=l.ref(0),S=l.ref(null);l.onBeforeUpdate(()=>{p.value=null}),l.onMounted(()=>{l.nextTick().then(()=>_()),r.noOverlayFocus||y(),T(!0)}),l.onUnmounted(()=>T(!1));const T=b=>{var C;r.arrowNavigation&&((C=r.headerRefs)!=null&&C.length?a(b):i(b))},y=()=>{var b;const C=qe(h);C&&(c.value.enabled||(p.value?(b=p.value)==null||b.focus({preventScroll:!0}):C.focus({preventScroll:!0})),f.value=C.clientHeight<C.scrollHeight)},B=l.computed(()=>({dp__overlay:!0,"dp--overlay-absolute":!r.useRelative,"dp--overlay-relative":r.useRelative})),w=l.computed(()=>r.useRelative?{height:`${r.height}px`,width:"260px"}:void 0),V=l.computed(()=>({dp__overlay_col:!0})),$=l.computed(()=>({dp__btn:!0,dp__button:!0,dp__overlay_action:!0,dp__over_action_scroll:f.value,dp__button_bottom:r.isLast})),M=l.computed(()=>{var b,C;return{dp__overlay_container:!0,dp__container_flex:((b=r.items)==null?void 0:b.length)<=6,dp__container_block:((C=r.items)==null?void 0:C.length)>6}}),_=()=>{l.nextTick().then(()=>{const b=qe(p),C=qe(h),v=qe(k),A=qe(S),E=v?v.getBoundingClientRect().height:0;C&&(C.getBoundingClientRect().height?x.value=C.getBoundingClientRect().height-E:x.value=d.value.modeHeight-E),b&&A&&(A.scrollTop=b.offsetTop-A.offsetTop-(x.value/2-b.getBoundingClientRect().height)-E)})},z=b=>{b.disabled||t("selected",b.value)},N=()=>{t("toggle"),t("reset-flow")},W=()=>{r.escClose&&N()},F=(b,C,v,A)=>{b&&(C.active&&(p.value=b),r.arrowNavigation&&(Array.isArray(m.value[v])?m.value[v][A]=b:m.value[v]=[b],O()))},O=()=>{var b,C;const v=(b=r.headerRefs)!=null&&b.length?[r.headerRefs].concat(m.value):m.value.concat([r.skipButtonRef?[]:[k.value]]);o(Je(v),(C=r.headerRefs)!=null&&C.length?"monthPicker":"selectionGrid")},I=b=>{r.arrowNavigation||Rn(b,d.value,!0)},H=b=>{g.value=b,t("hover-value",b)};return e({focusGrid:y}),(b,C)=>{var v;return l.openBlock(),l.createElementBlock("div",{ref_key:"gridWrapRef",ref:h,class:l.normalizeClass(B.value),style:l.normalizeStyle(w.value),role:"dialog",tabindex:"0",onKeydown:[l.withKeys(l.withModifiers(W,["prevent"]),["esc"]),C[0]||(C[0]=l.withKeys(l.withModifiers(A=>I(A),["prevent"]),["left"])),C[1]||(C[1]=l.withKeys(l.withModifiers(A=>I(A),["prevent"]),["up"])),C[2]||(C[2]=l.withKeys(l.withModifiers(A=>I(A),["prevent"]),["down"])),C[3]||(C[3]=l.withKeys(l.withModifiers(A=>I(A),["prevent"]),["right"]))]},[l.createElementVNode("div",{class:l.normalizeClass(M.value),ref_key:"containerRef",ref:S,role:"grid",style:l.normalizeStyle({height:`${x.value}px`})},[l.createElementVNode("div",$v,[l.renderSlot(b.$slots,"header")]),b.$slots.overlay?l.renderSlot(b.$slots,"overlay",{key:0}):(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:1},l.renderList(b.items,(A,E)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["dp__overlay_row",{dp__flex_row:b.items.length>=3}]),key:E,role:"row"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(A,(P,q)=>(l.openBlock(),l.createElementBlock("div",{role:"gridcell",class:l.normalizeClass(V.value),key:P.value,"aria-selected":P.active,"aria-disabled":P.disabled||void 0,ref_for:!0,ref:D=>F(D,P,E,q),tabindex:"0",onClick:D=>z(P),onKeydown:[l.withKeys(l.withModifiers(D=>z(P),["prevent"]),["enter"]),l.withKeys(l.withModifiers(D=>z(P),["prevent"]),["space"])],onMouseover:D=>H(P.value)},[l.createElementVNode("div",{class:l.normalizeClass(P.className)},[b.$slots.item?l.renderSlot(b.$slots,"item",{key:0,item:P}):l.createCommentVNode("",!0),b.$slots.item?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(P.text),1)],64))],2)],42,Fv))),128))],2))),128))],6),b.$slots["button-icon"]?l.withDirectives((l.openBlock(),l.createElementBlock("button",{key:0,type:"button","aria-label":(v=l.unref(s))==null?void 0:v.toggleOverlay,class:l.normalizeClass($.value),tabindex:"0",ref_key:"toggleButton",ref:k,onClick:N,onKeydown:[l.withKeys(N,["enter"]),l.withKeys(N,["tab"])]},[l.renderSlot(b.$slots,"button-icon")],42,zv)),[[l.vShow,!l.unref(u)(b.hideNavigation,b.type)]]):l.createCommentVNode("",!0)],46,Lv)}}}),Bo=l.defineComponent({__name:"InstanceWrap",props:{multiCalendars:{},stretch:{type:Boolean}},setup(n){const e=n,t=l.computed(()=>e.multiCalendars>0?[...Array(e.multiCalendars).keys()]:[0]),r=l.computed(()=>({dp__instance_calendar:e.multiCalendars>0}));return(i,o)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass({dp__menu_inner:!i.stretch,"dp--menu--inner-stretched":i.stretch,dp__flex_display:i.multiCalendars>0})},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.value,(a,s)=>(l.openBlock(),l.createElementBlock("div",{key:a,class:l.normalizeClass(r.value)},[l.renderSlot(i.$slots,"default",{instance:a,index:s})],2))),128))],2))}}),Hv=["aria-label","aria-disabled"],Vi=l.defineComponent({compatConfig:{MODE:3},__name:"ArrowBtn",props:{ariaLabel:{},disabled:{type:Boolean}},emits:["activate","set-ref"],setup(n,{emit:e}){const t=l.ref(null);return l.onMounted(()=>e("set-ref",t)),(r,i)=>(l.openBlock(),l.createElementBlock("button",{type:"button",class:"dp__btn dp--arrow-btn-nav",onClick:i[0]||(i[0]=o=>r.$emit("activate")),onKeydown:[i[1]||(i[1]=l.withKeys(l.withModifiers(o=>r.$emit("activate"),["prevent"]),["enter"])),i[2]||(i[2]=l.withKeys(l.withModifiers(o=>r.$emit("activate"),["prevent"]),["space"]))],tabindex:"0","aria-label":r.ariaLabel,"aria-disabled":r.disabled||void 0,ref_key:"elRef",ref:t},[l.createElementVNode("span",{class:l.normalizeClass(["dp__inner_nav",{dp__inner_nav_disabled:r.disabled}])},[l.renderSlot(r.$slots,"default")],2)],40,Hv))}}),Yv={class:"dp--year-mode-picker"},Uv=["aria-label"],Nd=l.defineComponent({__name:"YearModePicker",props:{...Gt,showYearPicker:{type:Boolean,default:!1},items:{type:Array,default:()=>[]},instance:{type:Number,default:0},year:{type:Number,default:0},isDisabled:{type:Function,default:()=>!1}},emits:["toggle-year-picker","year-select","handle-year"],setup(n,{emit:e}){const t=n,{showRightIcon:r,showLeftIcon:i}=No(),{defaultedConfig:o,defaultedMultiCalendars:a,defaultedAriaLabels:s,defaultedTransitions:c}=Ye(t),{showTransition:d,transitionName:u}=Pi(c),f=(m=!1,g)=>{e("toggle-year-picker",{flow:m,show:g})},p=m=>{e("year-select",m)},h=(m=!1)=>{e("handle-year",m)};return(m,g)=>{var k,x,S;return l.openBlock(),l.createElementBlock("div",Yv,[l.unref(i)(l.unref(a),n.instance)?(l.openBlock(),l.createBlock(Vi,{key:0,ref:"mpPrevIconRef","aria-label":(k=l.unref(s))==null?void 0:k.prevYear,disabled:n.isDisabled(!1),onActivate:g[0]||(g[0]=T=>h(!1))},{default:l.withCtx(()=>[m.$slots["arrow-left"]?l.renderSlot(m.$slots,"arrow-left",{key:0}):l.createCommentVNode("",!0),m.$slots["arrow-left"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Wa),{key:1}))]),_:3},8,["aria-label","disabled"])):l.createCommentVNode("",!0),l.createElementVNode("button",{class:"dp__btn dp--year-select",type:"button",ref:"mpYearButtonRef","aria-label":(x=l.unref(s))==null?void 0:x.openYearsOverlay,onClick:g[1]||(g[1]=()=>f(!1)),onKeydown:g[2]||(g[2]=l.withKeys(()=>f(!1),["enter"]))},[m.$slots.year?l.renderSlot(m.$slots,"year",{key:0,year:n.year}):l.createCommentVNode("",!0),m.$slots.year?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(n.year),1)],64))],40,Uv),l.unref(r)(l.unref(a),n.instance)?(l.openBlock(),l.createBlock(Vi,{key:1,ref:"mpNextIconRef","aria-label":(S=l.unref(s))==null?void 0:S.nextYear,disabled:n.isDisabled(!0),onActivate:g[3]||(g[3]=T=>h(!0))},{default:l.withCtx(()=>[m.$slots["arrow-right"]?l.renderSlot(m.$slots,"arrow-right",{key:0}):l.createCommentVNode("",!0),m.$slots["arrow-right"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(qa),{key:1}))]),_:3},8,["aria-label","disabled"])):l.createCommentVNode("",!0),l.createVNode(l.Transition,{name:l.unref(u)(n.showYearPicker),css:l.unref(d)},{default:l.withCtx(()=>[n.showYearPicker?(l.openBlock(),l.createBlock(Ri,{key:0,items:n.items,"text-input":m.textInput,"esc-close":m.escClose,config:m.config,onToggle:f,onSelected:g[4]||(g[4]=T=>p(T)),"is-last":m.autoApply&&!l.unref(o).keepActionRow,type:"year"},l.createSlots({"button-icon":l.withCtx(()=>[m.$slots["calendar-icon"]?l.renderSlot(m.$slots,"calendar-icon",{key:0}):l.createCommentVNode("",!0),m.$slots["calendar-icon"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Ni),{key:1}))]),_:2},[m.$slots["year-overlay-value"]?{name:"item",fn:l.withCtx(({item:T})=>[l.renderSlot(m.$slots,"year-overlay-value",{text:T.text,value:T.value})]),key:"0"}:void 0]),1032,["items","text-input","esc-close","config","is-last"])):l.createCommentVNode("",!0)]),_:3},8,["name","css"])])}}}),Po=(n,e,t)=>{if(e.value&&Array.isArray(e.value))if(e.value.some(r=>Ae(n,r))){const r=e.value.filter(i=>!Ae(i,n));e.value=r.length?r:null}else(t&&+t>e.value.length||!t)&&e.value.push(n);else e.value=[n]},ws=(n,e,t)=>{let r=n.value?n.value.slice():[];return r.length===2&&r[1]!==null&&(r=[]),r.length?nt(e,r[0])?(r.unshift(e),t("range-start",r[0]),t("range-start",r[1])):(r[1]=e,t("range-end",e)):(r=[e],t("range-start",e)),n.value=r,r},Io=(n,e,t,r)=>{n[0]&&n[1]&&t&&e("auto-apply"),n[0]&&!n[1]&&r&&t&&e("auto-apply")},_d=({multiCalendars:n,calendars:e,modelValue:t,props:r,year:i,month:o,emit:a})=>{const s=l.computed(()=>us(r.yearRange,r.reverseYears)),c=l.ref([!1]),d=l.computed(()=>(T,y)=>{const B=Be(qt(new Date),{month:o.value(T),year:i.value(T)});return Td(B,r.maxDate,r.minDate,r.preventMinMaxNavigation,y)}),u=()=>{for(let T=0;T<n.value.count;T++)if(T===0)e.value[T]=e.value[0];else{const y=Be(G(),e.value[T-1]);e.value[T]={month:Ce(y),year:Me(Ba(y,1))}}},f=T=>{if(!T)return u();const y=Be(G(),e.value[T]);return e.value[0].year=Me(ed(y,n.value.count-1)),u()},p=T=>r.focusStartDate?T[0]:T[1]?T[1]:T[0],h=()=>{if(t.value){const T=Array.isArray(t.value)?p(t.value):t.value;e.value[0]={month:Ce(T),year:Me(T)}}};l.onMounted(()=>{h(),n.value.count&&u()});const m=(T,y)=>{e.value[y].year=T,n.value.count&&!n.value.solo&&f(y)},g=l.computed(()=>T=>Hr(s.value,y=>{const B=i.value(T)===y.value,w=_i(y.value,Yr(r.minDate),Yr(r.maxDate));return{active:B,disabled:w}})),k=(T,y)=>{m(T,y),S(y)},x=(T,y=!1)=>{if(!d.value(T,y)){const B=y?i.value(T)+1:i.value(T)-1;m(B,T)}},S=(T,y=!1,B)=>{y||a("reset-flow"),B!==void 0?c.value[T]=B:c.value[T]=!c.value[T],c.value||a("overlay-closed")};return{isDisabled:d,groupedYears:g,showYearPicker:c,selectYear:m,toggleYearPicker:S,handleYearSelect:k,handleYear:x}},jv=(n,e)=>{const{defaultedMultiCalendars:t,defaultedAriaLabels:r,defaultedTransitions:i,defaultedConfig:o}=Ye(n),{modelValue:a,year:s,month:c,calendars:d}=Ii(n,e),u=l.computed(()=>hd(n.formatLocale,n.locale,n.monthNameFormat)),f=l.ref(null),{selectYear:p,groupedYears:h,showYearPicker:m,toggleYearPicker:g,handleYearSelect:k,handleYear:x,isDisabled:S}=_d({modelValue:a,multiCalendars:t,calendars:d,year:s,month:c,props:n,emit:e}),T=I=>I?{month:Ce(I),year:Me(I)}:{month:null,year:null},y=()=>a.value?Array.isArray(a.value)?a.value.map(I=>T(I)):T(a.value):T(),B=(I,H)=>{const b=d.value[I],C=y();return Array.isArray(C)?C.some(v=>v.year===(b==null?void 0:b.year)&&v.month===H):(b==null?void 0:b.year)===C.year&&H===C.month},w=(I,H,b)=>{var C,v;const A=y();return Array.isArray(A)?s.value(H)===((C=A[b])==null?void 0:C.year)&&I===((v=A[b])==null?void 0:v.month):!1},V=(I,H)=>{if(n.range){const b=y();if(Array.isArray(a.value)&&Array.isArray(b)){const C=w(I,H,0)||w(I,H,1),v=Mn(qt(G()),I,s.value(H));return Do(a.value,f.value,v)&&!C}return!1}return!1},$=l.computed(()=>I=>Hr(u.value,H=>{const b=B(I,H.value),C=_i(H.value,bd(s.value(I),n.minDate),wd(s.value(I),n.maxDate))||pv(n.disabledDates,s.value(I)).includes(H.value),v=V(H.value,I);return{active:b,disabled:C,isBetween:v}})),M=(I,H)=>Mn(qt(G()),I,s.value(H)),_=(I,H)=>{const b=a.value?a.value:qt(new Date);a.value=Mn(b,I,s.value(H)),e("auto-apply")},z=(I,H)=>{const b=ws(a,M(I,H),e);Io(b,e,n.autoApply,n.modelAuto)},N=(I,H)=>{Po(M(I,H),a,n.multiDatesLimit),e("auto-apply",!0)},W=(I,H)=>(d.value[H].month=I,O(H,d.value[H].year,I),n.multiDates?N(I,H):n.range?z(I,H):_(I,H)),F=(I,H)=>{p(I,H),O(H,I,null)},O=(I,H,b)=>{let C=b;if(!C){const v=y();C=Array.isArray(v)?v[I].month:v.month}e("update-month-year",{instance:I,year:H,month:C})};return{groupedMonths:$,groupedYears:h,year:s,isDisabled:S,defaultedMultiCalendars:t,defaultedAriaLabels:r,defaultedTransitions:i,defaultedConfig:o,showYearPicker:m,modelValue:a,setHoverDate:(I,H)=>{f.value=M(I,H)},selectMonth:W,selectYear:F,toggleYearPicker:g,handleYearSelect:k,handleYear:x,getModelMonthYear:y}},Wv=l.defineComponent({compatConfig:{MODE:3},__name:"MonthPicker",props:{...Gt},emits:["update:internal-model-value","overlay-closed","reset-flow","range-start","range-end","auto-apply","update-month-year"],setup(n,{expose:e,emit:t}){const r=n,i=l.useSlots(),o=At(i,"yearMode"),{groupedMonths:a,groupedYears:s,year:c,isDisabled:d,defaultedMultiCalendars:u,defaultedConfig:f,showYearPicker:p,modelValue:h,setHoverDate:m,selectMonth:g,selectYear:k,toggleYearPicker:x,handleYearSelect:S,handleYear:T,getModelMonthYear:y}=jv(r,t);return e({getSidebarProps:()=>({modelValue:h,year:c,getModelMonthYear:y,selectMonth:g,selectYear:k,handleYear:T})}),(B,w)=>(l.openBlock(),l.createBlock(Bo,{"multi-calendars":l.unref(u).count,stretch:""},{default:l.withCtx(({instance:V})=>[B.$slots["month-year"]?l.renderSlot(B.$slots,"month-year",l.normalizeProps(l.mergeProps({key:0},{year:l.unref(c),months:l.unref(a)(V),years:l.unref(s)(V),selectMonth:l.unref(g),selectYear:l.unref(k),instance:V}))):(l.openBlock(),l.createBlock(Ri,{key:1,items:l.unref(a)(V),"arrow-navigation":B.arrowNavigation,"is-last":B.autoApply&&!l.unref(f).keepActionRow,"esc-close":B.escClose,height:l.unref(f).modeHeight,config:B.config,"no-overlay-focus":B.noOverlayFocus,onSelected:$=>l.unref(g)($,V),onHoverValue:$=>l.unref(m)($,V),"use-relative":"",type:"month"},{header:l.withCtx(()=>[l.createVNode(Nd,l.mergeProps(B.$props,{items:l.unref(s)(V),instance:V,"show-year-picker":l.unref(p)[V],year:l.unref(c)(V),"is-disabled":$=>l.unref(d)(V,$),onHandleYear:$=>l.unref(T)(V,$),onYearSelect:$=>l.unref(S)($,V),onToggleYearPicker:$=>l.unref(x)(V,$==null?void 0:$.flow,$==null?void 0:$.show)}),l.createSlots({_:2},[l.renderList(l.unref(o),($,M)=>({name:$,fn:l.withCtx(_=>[l.renderSlot(B.$slots,$,l.normalizeProps(l.guardReactiveProps(_)))])}))]),1040,["items","instance","show-year-picker","year","is-disabled","onHandleYear","onYearSelect","onToggleYearPicker"])]),_:2},1032,["items","arrow-navigation","is-last","esc-close","height","config","no-overlay-focus","onSelected","onHoverValue"]))]),_:3},8,["multi-calendars"]))}}),qv=(n,e)=>{const{modelValue:t}=Ii(n,e),r=l.ref(null),i=c=>Array.isArray(t.value)?t.value.some(d=>Me(d)===c):t.value?Me(t.value)===c:!1,o=c=>n.range&&Array.isArray(t.value)?Do(t.value,r.value,s(c)):!1,a=l.computed(()=>Hr(us(n.yearRange,n.reverseYears),c=>{const d=i(c.value),u=_i(c.value,Yr(n.minDate),Yr(n.maxDate)),f=o(c.value);return{active:d,disabled:u,isBetween:f}})),s=c=>ur(qt(new Date),c);return{groupedYears:a,modelValue:t,setHoverValue:c=>{r.value=ur(qt(new Date),c)},selectYear:c=>{if(n.multiDates)return Po(s(c),t,n.multiDatesLimit),e("auto-apply",!0);if(n.range){const d=ws(t,s(c),e);return Io(d,e,n.autoApply,n.modelAuto)}t.value=s(c),e("auto-apply")}}},Kv=l.defineComponent({compatConfig:{MODE:3},__name:"YearPicker",props:{...Gt},emits:["update:internal-model-value","reset-flow","range-start","range-end","auto-apply"],setup(n,{expose:e,emit:t}){const r=n,{groupedYears:i,modelValue:o,selectYear:a,setHoverValue:s}=qv(r,t),{defaultedConfig:c}=Ye(r);return e({getSidebarProps:()=>({modelValue:o,selectYear:a})}),(d,u)=>(l.openBlock(),l.createElementBlock("div",null,[d.$slots["month-year"]?l.renderSlot(d.$slots,"month-year",l.normalizeProps(l.mergeProps({key:0},{years:l.unref(i),selectYear:l.unref(a)}))):(l.openBlock(),l.createBlock(Ri,{key:1,items:l.unref(i),"is-last":d.autoApply&&!l.unref(c).keepActionRow,height:l.unref(c).modeHeight,config:d.config,"no-overlay-focus":d.noOverlayFocus,type:"year","use-relative":"",onSelected:l.unref(a),onHoverValue:l.unref(s)},l.createSlots({_:2},[d.$slots["year-overlay-value"]?{name:"item",fn:l.withCtx(({item:f})=>[l.renderSlot(d.$slots,"year-overlay-value",{text:f.text,value:f.value})]),key:"0"}:void 0]),1032,["items","is-last","height","config","no-overlay-focus","onSelected","onHoverValue"]))]))}}),Gv={key:0,class:"dp__time_input"},Qv=["aria-label","onKeydown","onClick"],Jv=l.createElementVNode("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_l"},null,-1),Xv=l.createElementVNode("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_r"},null,-1),Zv=["aria-label","disabled","onKeydown","onClick"],eb=["aria-label","onKeydown","onClick"],tb=l.createElementVNode("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_l"},null,-1),nb=l.createElementVNode("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_r"},null,-1),rb={key:0},ib=["aria-label","onKeydown"],ob=l.defineComponent({compatConfig:{MODE:3},__name:"TimeInput",props:{hours:{type:Number,default:0},minutes:{type:Number,default:0},seconds:{type:Number,default:0},closeTimePickerBtn:{type:Object,default:null},order:{type:Number,default:0},disabledTimesConfig:{type:Function,default:null},validateTime:{type:Function,default:()=>!1},...Gt},emits:["set-hours","set-minutes","update:hours","update:minutes","update:seconds","reset-flow","mounted","overlay-closed","am-pm-change"],setup(n,{expose:e,emit:t}){const r=n,{setTimePickerElements:i,setTimePickerBackRef:o}=$n(),{defaultedAriaLabels:a,defaultedTransitions:s,defaultedFilters:c,defaultedConfig:d}=Ye(r),{transitionName:u,showTransition:f}=Pi(s),p=l.reactive({hours:!1,minutes:!1,seconds:!1}),h=l.ref("AM"),m=l.ref(null),g=l.ref([]);l.onMounted(()=>{t("mounted")});const k=D=>Be(new Date,{hours:D.hours,minutes:D.minutes,seconds:r.enableSeconds?D.seconds:0,milliseconds:0}),x=l.computed(()=>D=>W(D,r[D])||T(D,r[D])),S=l.computed(()=>({hours:r.hours,minutes:r.minutes,seconds:r.seconds})),T=(D,X)=>r.range&&!r.disableTimeRangeValidation?!r.validateTime(D,X):!1,y=(D,X)=>{if(r.range&&!r.disableTimeRangeValidation){const ne=X?+r[`${D}Increment`]:-+r[`${D}Increment`],Y=r[D]+ne;return!r.validateTime(D,Y)}return!1},B=l.computed(()=>D=>!O(+r[D]+ +r[`${D}Increment`],D)||y(D,!0)),w=l.computed(()=>D=>!O(+r[D]-+r[`${D}Increment`],D)||y(D,!1)),V=(D,X)=>Mc(Be(G(),D),X),$=(D,X)=>A0(Be(G(),D),X),M=l.computed(()=>({dp__time_col:!0,dp__time_col_block:!r.timePickerInline,dp__time_col_reg_block:!r.enableSeconds&&r.is24&&!r.timePickerInline,dp__time_col_reg_inline:!r.enableSeconds&&r.is24&&r.timePickerInline,dp__time_col_reg_with_button:!r.enableSeconds&&!r.is24,dp__time_col_sec:r.enableSeconds&&r.is24,dp__time_col_sec_with_button:r.enableSeconds&&!r.is24})),_=l.computed(()=>{const D=[{type:"hours"},{type:"",separator:!0},{type:"minutes"}];return r.enableSeconds?D.concat([{type:"",separator:!0},{type:"seconds"}]):D}),z=l.computed(()=>_.value.filter(D=>!D.separator)),N=l.computed(()=>D=>{if(D==="hours"){const X=v(+r.hours);return{text:X<10?`0${X}`:`${X}`,value:X}}return{text:r[D]<10?`0${r[D]}`:`${r[D]}`,value:r[D]}}),W=(D,X)=>{var ne;if(!r.disabledTimesConfig)return!1;const Y=r.disabledTimesConfig(r.order,D==="hours"?X:void 0);return Y[D]?!!((ne=Y[D])!=null&&ne.includes(X)):!0},F=D=>{const X=r.is24?24:12,ne=D==="hours"?X:60,Y=+r[`${D}GridIncrement`],Z=D==="hours"&&!r.is24?Y:0,ce=[];for(let j=Z;j<ne;j+=Y)ce.push({value:j,text:j<10?`0${j}`:`${j}`});return D==="hours"&&!r.is24&&ce.push({value:0,text:"12"}),Hr(ce,j=>({active:!1,disabled:c.value.times[D].includes(j.value)||!O(j.value,D)||W(D,j.value)||T(D,j.value)}))},O=(D,X)=>{const ne=r.minTime?k(fs(r.minTime)):null,Y=r.maxTime?k(fs(r.maxTime)):null,Z=k(fs(S.value,X,D));return ne&&Y?(Ei(Z,Y)||Fr(Z,Y))&&(Ai(Z,ne)||Fr(Z,ne)):ne?Ai(Z,ne)||Fr(Z,ne):Y?Ei(Z,Y)||Fr(Z,Y):!0},I=D=>r[`no${D[0].toUpperCase()+D.slice(1)}Overlay`],H=D=>{I(D)||(p[D]=!p[D],p[D]||t("overlay-closed"))},b=D=>D==="hours"?Wt:D==="minutes"?an:$r,C=(D,X=!0)=>{const ne=X?V:$,Y=X?+r[`${D}Increment`]:-+r[`${D}Increment`];O(+r[D]+Y,D)&&t(`update:${D}`,b(D)(ne({[D]:+r[D]},{[D]:+r[`${D}Increment`]})))},v=D=>r.is24?D:(D>=12?h.value="PM":h.value="AM",rv(D)),A=()=>{h.value==="PM"?(h.value="AM",t("update:hours",r.hours-12)):(h.value="PM",t("update:hours",r.hours+12)),t("am-pm-change",h.value)},E=D=>{p[D]=!0},P=(D,X,ne)=>{if(D&&r.arrowNavigation){Array.isArray(g.value[X])?g.value[X][ne]=D:g.value[X]=[D];const Y=g.value.reduce((Z,ce)=>ce.map((j,J)=>[...Z[J]||[],ce[J]]),[]);o(r.closeTimePickerBtn),m.value&&(Y[1]=Y[1].concat(m.value)),i(Y,r.order)}},q=(D,X)=>(H(D),D==="hours"&&!r.is24?t(`update:${D}`,h.value==="PM"?X+12:X):t(`update:${D}`,X));return e({openChildCmp:E}),(D,X)=>{var ne;return D.disabled?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",Gv,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(_.value,(Y,Z)=>{var ce,j,J;return l.openBlock(),l.createElementBlock("div",{key:Z,class:l.normalizeClass(M.value)},[Y.separator?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createTextVNode(" : ")],64)):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createElementVNode("button",{type:"button",class:l.normalizeClass({dp__btn:!0,dp__inc_dec_button:!D.timePickerInline,dp__inc_dec_button_inline:D.timePickerInline,dp__tp_inline_btn_top:D.timePickerInline,dp__inc_dec_button_disabled:B.value(Y.type)}),"aria-label":(ce=l.unref(a))==null?void 0:ce.incrementValue(Y.type),tabindex:"0",onKeydown:[l.withKeys(l.withModifiers(de=>C(Y.type),["prevent"]),["enter"]),l.withKeys(l.withModifiers(de=>C(Y.type),["prevent"]),["space"])],onClick:de=>C(Y.type),ref_for:!0,ref:de=>P(de,Z,0)},[r.timePickerInline?(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[Jv,Xv],64)):(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[D.$slots["arrow-up"]?l.renderSlot(D.$slots,"arrow-up",{key:0}):l.createCommentVNode("",!0),D.$slots["arrow-up"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Ga),{key:1}))],64))],42,Qv),l.createElementVNode("button",{type:"button","aria-label":(j=l.unref(a))==null?void 0:j.openTpOverlay(Y.type),class:l.normalizeClass({dp__time_display:!0,dp__time_display_block:!D.timePickerInline,dp__time_display_inline:D.timePickerInline,"dp--time-invalid":x.value(Y.type),"dp--time-overlay-btn":!x.value(Y.type)}),disabled:I(Y.type),tabindex:"0",onKeydown:[l.withKeys(l.withModifiers(de=>H(Y.type),["prevent"]),["enter"]),l.withKeys(l.withModifiers(de=>H(Y.type),["prevent"]),["space"])],onClick:de=>H(Y.type),ref_for:!0,ref:de=>P(de,Z,1)},[D.$slots[Y.type]?l.renderSlot(D.$slots,Y.type,{key:0,text:N.value(Y.type).text,value:N.value(Y.type).value}):l.createCommentVNode("",!0),D.$slots[Y.type]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(N.value(Y.type).text),1)],64))],42,Zv),l.createElementVNode("button",{type:"button",class:l.normalizeClass({dp__btn:!0,dp__inc_dec_button:!D.timePickerInline,dp__inc_dec_button_inline:D.timePickerInline,dp__tp_inline_btn_bottom:D.timePickerInline,dp__inc_dec_button_disabled:w.value(Y.type)}),"aria-label":(J=l.unref(a))==null?void 0:J.decrementValue(Y.type),tabindex:"0",onKeydown:[l.withKeys(l.withModifiers(de=>C(Y.type,!1),["prevent"]),["enter"]),l.withKeys(l.withModifiers(de=>C(Y.type,!1),["prevent"]),["space"])],onClick:de=>C(Y.type,!1),ref_for:!0,ref:de=>P(de,Z,2)},[r.timePickerInline?(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[tb,nb],64)):(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[D.$slots["arrow-down"]?l.renderSlot(D.$slots,"arrow-down",{key:0}):l.createCommentVNode("",!0),D.$slots["arrow-down"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Qa),{key:1}))],64))],42,eb)],64))],2)}),128)),D.is24?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",rb,[D.$slots["am-pm-button"]?l.renderSlot(D.$slots,"am-pm-button",{key:0,toggle:A,value:h.value}):l.createCommentVNode("",!0),D.$slots["am-pm-button"]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("button",{key:1,ref_key:"amPmButton",ref:m,type:"button",class:"dp__pm_am_button",role:"button","aria-label":(ne=l.unref(a))==null?void 0:ne.amPmButton,tabindex:"0",onClick:A,onKeydown:[l.withKeys(l.withModifiers(A,["prevent"]),["enter"]),l.withKeys(l.withModifiers(A,["prevent"]),["space"])]},l.toDisplayString(h.value),41,ib))])),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(z.value,(Y,Z)=>(l.openBlock(),l.createBlock(l.Transition,{key:Z,name:l.unref(u)(p[Y.type]),css:l.unref(f)},{default:l.withCtx(()=>[p[Y.type]?(l.openBlock(),l.createBlock(Ri,{key:0,items:F(Y.type),"is-last":D.autoApply&&!l.unref(d).keepActionRow,"esc-close":D.escClose,type:Y.type,"text-input":D.textInput,config:D.config,"arrow-navigation":D.arrowNavigation,onSelected:ce=>q(Y.type,ce),onToggle:ce=>H(Y.type),onResetFlow:X[0]||(X[0]=ce=>D.$emit("reset-flow"))},l.createSlots({"button-icon":l.withCtx(()=>[D.$slots["clock-icon"]?l.renderSlot(D.$slots,"clock-icon",{key:0}):l.createCommentVNode("",!0),D.$slots["clock-icon"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Ka),{key:1}))]),_:2},[D.$slots[`${Y.type}-overlay-value`]?{name:"item",fn:l.withCtx(({item:ce})=>[l.renderSlot(D.$slots,`${Y.type}-overlay-value`,{text:ce.text,value:ce.value})]),key:"0"}:void 0]),1032,["items","is-last","esc-close","type","text-input","config","arrow-navigation","onSelected","onToggle"])):l.createCommentVNode("",!0)]),_:2},1032,["name","css"]))),128))]))}}}),ab={class:"dp--tp-wrap"},sb=["aria-label","tabindex"],lb=["tabindex"],cb=["aria-label"],Bd=l.defineComponent({compatConfig:{MODE:3},__name:"TimePicker",props:{hours:{type:[Number,Array],default:0},minutes:{type:[Number,Array],default:0},seconds:{type:[Number,Array],default:0},disabledTimesConfig:{type:Function,default:null},validateTime:{type:Function,default:()=>!1},...Gt},emits:["update:hours","update:minutes","update:seconds","mount","reset-flow","overlay-opened","overlay-closed","am-pm-change"],setup(n,{expose:e,emit:t}){const r=n,{buildMatrix:i,setTimePicker:o}=$n(),a=l.useSlots(),{defaultedTransitions:s,defaultedAriaLabels:c,defaultedTextInput:d,defaultedConfig:u}=Ye(r),{transitionName:f,showTransition:p}=Pi(s),{hideNavigationButtons:h}=No(),m=l.ref(null),g=l.ref(null),k=l.ref([]),x=l.ref(null);l.onMounted(()=>{t("mount"),!r.timePicker&&r.arrowNavigation?i([qe(m.value)],"time"):o(!0,r.timePicker)});const S=l.computed(()=>r.range&&r.modelAuto?md(r.internalModelValue):!0),T=l.ref(!1),y=F=>({hours:Array.isArray(r.hours)?r.hours[F]:r.hours,minutes:Array.isArray(r.minutes)?r.minutes[F]:r.minutes,seconds:Array.isArray(r.seconds)?r.seconds[F]:r.seconds}),B=l.computed(()=>{const F=[];if(r.range)for(let O=0;O<2;O++)F.push(y(O));else F.push(y(0));return F}),w=(F,O=!1,I="")=>{O||t("reset-flow"),T.value=F,t(F?"overlay-opened":"overlay-closed"),r.arrowNavigation&&o(F),l.nextTick(()=>{I!==""&&k.value[0]&&k.value[0].openChildCmp(I)})},V=l.computed(()=>({dp__btn:!0,dp__button:!0,dp__button_bottom:r.autoApply&&!u.value.keepActionRow})),$=At(a,"timePicker"),M=(F,O,I)=>r.range?O===0?[F,B.value[1][I]]:[B.value[0][I],F]:F,_=F=>{t("update:hours",F)},z=F=>{t("update:minutes",F)},N=F=>{t("update:seconds",F)},W=()=>{if(x.value&&!d.value.enabled&&!r.noOverlayFocus){const F=ov(x.value);F&&F.focus({preventScroll:!0})}};return e({toggleTimePicker:w}),(F,O)=>{var I;return l.openBlock(),l.createElementBlock("div",ab,[!F.timePicker&&!F.timePickerInline?l.withDirectives((l.openBlock(),l.createElementBlock("button",{key:0,type:"button",class:l.normalizeClass(V.value),"aria-label":(I=l.unref(c))==null?void 0:I.openTimePicker,tabindex:F.noOverlayFocus?void 0:0,ref_key:"openTimePickerBtn",ref:m,onKeydown:[O[0]||(O[0]=l.withKeys(H=>w(!0),["enter"])),O[1]||(O[1]=l.withKeys(H=>w(!0),["space"]))],onClick:O[2]||(O[2]=H=>w(!0))},[F.$slots["clock-icon"]?l.renderSlot(F.$slots,"clock-icon",{key:0}):l.createCommentVNode("",!0),F.$slots["clock-icon"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Ka),{key:1}))],42,sb)),[[l.vShow,!l.unref(h)(F.hideNavigation,"time")]]):l.createCommentVNode("",!0),l.createVNode(l.Transition,{name:l.unref(f)(T.value),css:l.unref(p)&&!F.timePickerInline},{default:l.withCtx(()=>{var H;return[T.value||F.timePicker||F.timePickerInline?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass({dp__overlay:!F.timePickerInline,"dp--overlay-absolute":!r.timePicker&&!F.timePickerInline,"dp--overlay-relative":r.timePicker}),style:l.normalizeStyle(F.timePicker?{height:`${l.unref(u).modeHeight}px`}:void 0),ref_key:"overlayRef",ref:x,tabindex:F.timePickerInline?void 0:0},[l.createElementVNode("div",{class:l.normalizeClass(F.timePickerInline?"dp__time_picker_inline_container":"dp__overlay_container dp__container_flex dp__time_picker_overlay_container"),style:{display:"flex"}},[F.$slots["time-picker-overlay"]?l.renderSlot(F.$slots,"time-picker-overlay",{key:0,hours:n.hours,minutes:n.minutes,seconds:n.seconds,setHours:_,setMinutes:z,setSeconds:N}):l.createCommentVNode("",!0),F.$slots["time-picker-overlay"]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(F.timePickerInline?"dp__flex":"dp__overlay_row dp__flex_row")},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(B.value,(b,C)=>l.withDirectives((l.openBlock(),l.createBlock(ob,l.mergeProps({key:C},{...F.$props,order:C,hours:b.hours,minutes:b.minutes,seconds:b.seconds,closeTimePickerBtn:g.value,disabledTimesConfig:n.disabledTimesConfig,disabled:C===0?F.fixedStart:F.fixedEnd},{"validate-time":(v,A)=>n.validateTime(v,M(A,C,v)),ref_for:!0,ref_key:"timeInputRefs",ref:k,"onUpdate:hours":v=>_(M(v,C,"hours")),"onUpdate:minutes":v=>z(M(v,C,"minutes")),"onUpdate:seconds":v=>N(M(v,C,"seconds")),onMounted:W,onOverlayClosed:W,onAmPmChange:O[3]||(O[3]=v=>F.$emit("am-pm-change",v))}),l.createSlots({_:2},[l.renderList(l.unref($),(v,A)=>({name:v,fn:l.withCtx(E=>[l.renderSlot(F.$slots,v,l.normalizeProps(l.guardReactiveProps(E)))])}))]),1040,["validate-time","onUpdate:hours","onUpdate:minutes","onUpdate:seconds"])),[[l.vShow,C===0?!0:S.value]])),128))],2)),!F.timePicker&&!F.timePickerInline?l.withDirectives((l.openBlock(),l.createElementBlock("button",{key:2,type:"button",ref_key:"closeTimePickerBtn",ref:g,class:l.normalizeClass(V.value),"aria-label":(H=l.unref(c))==null?void 0:H.closeTimePicker,tabindex:"0",onKeydown:[O[4]||(O[4]=l.withKeys(b=>w(!1),["enter"])),O[5]||(O[5]=l.withKeys(b=>w(!1),["space"]))],onClick:O[6]||(O[6]=b=>w(!1))},[F.$slots["calendar-icon"]?l.renderSlot(F.$slots,"calendar-icon",{key:0}):l.createCommentVNode("",!0),F.$slots["calendar-icon"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Ni),{key:1}))],42,cb)),[[l.vShow,!l.unref(h)(F.hideNavigation,"time")]]):l.createCommentVNode("",!0)],2)],14,lb)):l.createCommentVNode("",!0)]}),_:3},8,["name","css"])])}}}),Pd=(n,e,t,r)=>{const i=(x,S)=>Array.isArray(e[x])?e[x][S]:e[x],o=x=>n.enableSeconds?Array.isArray(e.seconds)?e.seconds[x]:e.seconds:0,a=(x,S)=>x?S!==void 0?Vn(x,i("hours",S),i("minutes",S),o(S)):Vn(x,e.hours,e.minutes,o()):ja(G(),o(S)),s=(x,S)=>{e[x]=S},c=(x,S)=>{const T=Object.fromEntries(Object.keys(e).map(y=>y===x?[y,S]:[y,e[y]].slice()));if(n.range&&!n.disableTimeRangeValidation){const y=w=>t.value?Vn(t.value[w],T.hours[w],T.minutes[w],T.seconds[w]):null,B=w=>Ua(t.value[w],0);return!(Ae(y(0),y(1))&&(Ai(y(0),B(1))||Ei(y(1),B(0))))}return!0},d=(x,S)=>{c(x,S)&&(s(x,S),r&&r())},u=x=>{d("hours",x)},f=x=>{d("minutes",x)},p=x=>{d("seconds",x)},h=(x,S,T,y)=>{S&&u(x),!S&&!T&&f(x),T&&p(x),t.value&&y(t.value)},m=x=>{if(x){const S=Array.isArray(x),T=S?[+x[0].hours,+x[1].hours]:+x.hours,y=S?[+x[0].minutes,+x[1].minutes]:+x.minutes,B=S?[+x[0].seconds,+x[1].seconds]:+x.seconds;s("hours",T),s("minutes",y),n.enableSeconds&&s("seconds",B)}},g=(x,S)=>{const T={hours:Array.isArray(e.hours)?e.hours[x]:e.hours,disabledArr:[]};return(S||S===0)&&(T.hours=S),Array.isArray(n.disabledTimes)&&(T.disabledArr=n.range&&Array.isArray(n.disabledTimes[x])?n.disabledTimes[x]:n.disabledTimes),T},k=l.computed(()=>(x,S)=>{var T;if(Array.isArray(n.disabledTimes)){const{disabledArr:y,hours:B}=g(x,S),w=y.filter(V=>+V.hours===B);return((T=w[0])==null?void 0:T.minutes)==="*"?{hours:[B],minutes:void 0,seconds:void 0}:{hours:[],minutes:(w==null?void 0:w.map(V=>+V.minutes))??[],seconds:(w==null?void 0:w.map(V=>V.seconds?+V.seconds:void 0))??[]}}return{hours:[],minutes:[],seconds:[]}});return{setTime:s,updateHours:u,updateMinutes:f,updateSeconds:p,getSetDateTime:a,updateTimeValues:h,getSecondsValue:o,assignStartTime:m,validateTime:c,disabledTimesConfig:k}},db=(n,e)=>{const{modelValue:t,time:r}=Ii(n,e),{defaultedStartTime:i}=Ye(n),{updateTimeValues:o,getSetDateTime:a,setTime:s,assignStartTime:c,disabledTimesConfig:d,validateTime:u}=Pd(n,r,t),f=S=>{const{hours:T,minutes:y,seconds:B}=S;return{hours:+T,minutes:+y,seconds:B?+B:0}},p=()=>{if(n.startTime){if(Array.isArray(n.startTime)){const T=f(n.startTime[0]),y=f(n.startTime[1]);return[Be(G(),T),Be(G(),y)]}const S=f(n.startTime);return Be(G(),S)}return n.range?[null,null]:null},h=()=>{if(n.range){const[S,T]=p();t.value=[a(S,0),a(T,1)]}else t.value=a(p())},m=S=>Array.isArray(S)?[fr(G(S[0])),fr(G(S[1]))]:[fr(S??G())],g=(S,T,y)=>{s("hours",S),s("minutes",T),s("seconds",n.enableSeconds?y:0)},k=()=>{const[S,T]=m(t.value);return n.range?g([S.hours,T.hours],[S.minutes,T.minutes],[S.seconds,T.minutes]):g(S.hours,S.minutes,S.seconds)};l.onMounted(()=>{if(!n.shadow)return c(i.value),t.value?k():h()});const x=()=>{Array.isArray(t.value)?t.value=t.value.map((S,T)=>S&&a(S,T)):t.value=a(t.value),e("time-update")};return{modelValue:t,time:r,disabledTimesConfig:d,updateTime:(S,T=!0,y=!1)=>{o(S,T,y,x)},validateTime:u}},ub=l.defineComponent({compatConfig:{MODE:3},__name:"TimePickerSolo",props:{...Gt},emits:["update:internal-model-value","time-update","am-pm-change"],setup(n,{expose:e,emit:t}){const r=n,i=l.useSlots(),o=At(i,"timePicker"),{time:a,modelValue:s,disabledTimesConfig:c,updateTime:d,validateTime:u}=db(r,t);return e({getSidebarProps:()=>({modelValue:s,time:a,updateTime:d})}),(f,p)=>(l.openBlock(),l.createBlock(Bo,{"multi-calendars":0,stretch:""},{default:l.withCtx(()=>[l.createVNode(Bd,l.mergeProps(f.$props,{hours:l.unref(a).hours,minutes:l.unref(a).minutes,seconds:l.unref(a).seconds,"internal-model-value":f.internalModelValue,"disabled-times-config":l.unref(c),"validate-time":l.unref(u),"onUpdate:hours":p[0]||(p[0]=h=>l.unref(d)(h)),"onUpdate:minutes":p[1]||(p[1]=h=>l.unref(d)(h,!1)),"onUpdate:seconds":p[2]||(p[2]=h=>l.unref(d)(h,!1,!0)),onAmPmChange:p[3]||(p[3]=h=>f.$emit("am-pm-change",h))}),l.createSlots({_:2},[l.renderList(l.unref(o),(h,m)=>({name:h,fn:l.withCtx(g=>[l.renderSlot(f.$slots,h,l.normalizeProps(l.guardReactiveProps(g)))])}))]),1040,["hours","minutes","seconds","internal-model-value","disabled-times-config","validate-time"])]),_:3}))}}),fb={class:"dp__month_year_row"},pb=["aria-label","onClick","onKeydown"],hb=l.defineComponent({compatConfig:{MODE:3},__name:"DpHeader",props:{month:{type:Number,default:0},year:{type:Number,default:0},instance:{type:Number,default:0},years:{type:Array,default:()=>[]},months:{type:Array,default:()=>[]},...Gt},emits:["update-month-year","mount","reset-flow","overlay-closed"],setup(n,{expose:e,emit:t}){const r=n,{defaultedTransitions:i,defaultedAriaLabels:o,defaultedMultiCalendars:a,defaultedFilters:s,defaultedConfig:c}=Ye(r),{transitionName:d,showTransition:u}=Pi(i),{buildMatrix:f}=$n(),{handleMonthYearChange:p,isDisabled:h,updateMonthYear:m}=Mv(r,t),{showLeftIcon:g,showRightIcon:k}=No(),x=l.ref(!1),S=l.ref(!1),T=l.ref([null,null,null,null]);l.onMounted(()=>{t("mount")});const y=b=>({get:()=>r[b],set:C=>{const v=b===Kt.month?Kt.year:Kt.month;t("update-month-year",{[b]:C,[v]:r[v]}),b===Kt.month?N(!0):W(!0)}}),B=l.computed(y(Kt.month)),w=l.computed(y(Kt.year)),V=l.computed(()=>b=>({month:r.month,year:r.year,items:b===Kt.month?r.months:r.years,instance:r.instance,updateMonthYear:m,toggle:b===Kt.month?N:W})),$=l.computed(()=>r.months.find(C=>C.value===r.month)||{text:"",value:0}),M=l.computed(()=>Hr(r.months,b=>{const C=r.month===b.value,v=_i(b.value,bd(r.year,r.minDate),wd(r.year,r.maxDate))||s.value.months.includes(b.value);return{active:C,disabled:v}})),_=l.computed(()=>Hr(r.years,b=>{const C=r.year===b.value,v=_i(b.value,Yr(r.minDate),Yr(r.maxDate))||s.value.years.includes(b.value);return{active:C,disabled:v}})),z=(b,C)=>{C!==void 0?b.value=C:b.value=!b.value,b.value||t("overlay-closed")},N=(b=!1,C)=>{F(b),z(x,C)},W=(b=!1,C)=>{F(b),z(S,C)},F=b=>{b||t("reset-flow")},O=(b,C)=>{r.arrowNavigation&&(T.value[C]=qe(b),f(T.value,"monthYear"))},I=l.computed(()=>{var b,C;return[{type:Kt.month,index:1,toggle:N,modelValue:B.value,updateModelValue:v=>B.value=v,text:$.value.text,showSelectionGrid:x.value,items:M.value,ariaLabel:(b=o.value)==null?void 0:b.openMonthsOverlay},{type:Kt.year,index:2,toggle:W,modelValue:w.value,updateModelValue:v=>w.value=v,text:r.year,showSelectionGrid:S.value,items:_.value,ariaLabel:(C=o.value)==null?void 0:C.openYearsOverlay}]}),H=l.computed(()=>r.disableYearSelect?[I.value[0]]:I.value);return e({toggleMonthPicker:N,toggleYearPicker:W,handleMonthYearChange:p}),(b,C)=>{var v,A,E;return l.openBlock(),l.createElementBlock("div",fb,[b.$slots["month-year"]?l.renderSlot(b.$slots,"month-year",l.normalizeProps(l.mergeProps({key:0},{month:n.month,year:n.year,months:n.months,years:n.years,updateMonthYear:l.unref(m),handleMonthYearChange:l.unref(p),instance:n.instance}))):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.unref(g)(l.unref(a),n.instance)&&!b.vertical?(l.openBlock(),l.createBlock(Vi,{key:0,"aria-label":(v=l.unref(o))==null?void 0:v.prevMonth,disabled:l.unref(h)(!1),onActivate:C[0]||(C[0]=P=>l.unref(p)(!1,!0)),onSetRef:C[1]||(C[1]=P=>O(P,0))},{default:l.withCtx(()=>[b.$slots["arrow-left"]?l.renderSlot(b.$slots,"arrow-left",{key:0}):l.createCommentVNode("",!0),b.$slots["arrow-left"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Wa),{key:1}))]),_:3},8,["aria-label","disabled"])):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass(["dp__month_year_wrap",{dp__year_disable_select:b.disableYearSelect}])},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(H.value,(P,q)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:P.type},[l.createElementVNode("button",{type:"button",class:"dp__btn dp__month_year_select",tabindex:"0","aria-label":P.ariaLabel,ref_for:!0,ref:D=>O(D,q+1),onClick:P.toggle,onKeydown:[l.withKeys(l.withModifiers(P.toggle,["prevent"]),["enter"]),l.withKeys(l.withModifiers(P.toggle,["prevent"]),["space"])]},[b.$slots[P.type]?l.renderSlot(b.$slots,P.type,{key:0,text:P.text,value:r[P.type]}):l.createCommentVNode("",!0),b.$slots[P.type]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(P.text),1)],64))],40,pb),l.createVNode(l.Transition,{name:l.unref(d)(P.showSelectionGrid),css:l.unref(u)},{default:l.withCtx(()=>[P.showSelectionGrid?(l.openBlock(),l.createBlock(Ri,{key:0,items:P.items,"arrow-navigation":b.arrowNavigation,"hide-navigation":b.hideNavigation,"is-last":b.autoApply&&!l.unref(c).keepActionRow,"skip-button-ref":!1,config:b.config,type:P.type,"header-refs":[],"esc-close":b.escClose,"text-input":b.textInput,onSelected:P.updateModelValue,onToggle:P.toggle},l.createSlots({"button-icon":l.withCtx(()=>[b.$slots["calendar-icon"]?l.renderSlot(b.$slots,"calendar-icon",{key:0}):l.createCommentVNode("",!0),b.$slots["calendar-icon"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Ni),{key:1}))]),_:2},[b.$slots[`${P.type}-overlay-value`]?{name:"item",fn:l.withCtx(({item:D})=>[l.renderSlot(b.$slots,`${P.type}-overlay-value`,{text:D.text,value:D.value})]),key:"0"}:void 0,b.$slots[`${P.type}-overlay`]?{name:"overlay",fn:l.withCtx(()=>[l.renderSlot(b.$slots,`${P.type}-overlay`,l.normalizeProps(l.guardReactiveProps(V.value(P.type))))]),key:"1"}:void 0,b.$slots[`${P.type}-overlay-header`]?{name:"header",fn:l.withCtx(()=>[l.renderSlot(b.$slots,`${P.type}-overlay-header`,{toggle:P.toggle})]),key:"2"}:void 0]),1032,["items","arrow-navigation","hide-navigation","is-last","config","type","esc-close","text-input","onSelected","onToggle"])):l.createCommentVNode("",!0)]),_:2},1032,["name","css"])],64))),128))],2),l.unref(g)(l.unref(a),n.instance)&&b.vertical?(l.openBlock(),l.createBlock(Vi,{key:1,"aria-label":(A=l.unref(o))==null?void 0:A.prevMonth,disabled:l.unref(h)(!1),onActivate:C[2]||(C[2]=P=>l.unref(p)(!1,!0))},{default:l.withCtx(()=>[b.$slots["arrow-up"]?l.renderSlot(b.$slots,"arrow-up",{key:0}):l.createCommentVNode("",!0),b.$slots["arrow-up"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Ga),{key:1}))]),_:3},8,["aria-label","disabled"])):l.createCommentVNode("",!0),l.unref(k)(l.unref(a),n.instance)?(l.openBlock(),l.createBlock(Vi,{key:2,ref:"rightIcon",disabled:l.unref(h)(!0),"aria-label":(E=l.unref(o))==null?void 0:E.nextMonth,onActivate:C[3]||(C[3]=P=>l.unref(p)(!0,!0)),onSetRef:C[4]||(C[4]=P=>O(P,b.disableYearSelect?2:3))},{default:l.withCtx(()=>[b.$slots[b.vertical?"arrow-down":"arrow-right"]?l.renderSlot(b.$slots,b.vertical?"arrow-down":"arrow-right",{key:0}):l.createCommentVNode("",!0),b.$slots[b.vertical?"arrow-down":"arrow-right"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.resolveDynamicComponent(b.vertical?l.unref(Qa):l.unref(qa)),{key:1}))]),_:3},8,["disabled","aria-label"])):l.createCommentVNode("",!0)],64))])}}}),mb=["aria-label"],gb={class:"dp__calendar_header",role:"row"},yb={key:0,class:"dp__calendar_header_item",role:"gridcell"},vb=l.createElementVNode("div",{class:"dp__calendar_header_separator"},null,-1),bb=["aria-label"],wb={key:0,role:"gridcell",class:"dp__calendar_item dp__week_num"},kb={class:"dp__cell_inner"},xb=["aria-selected","aria-disabled","aria-label","onClick","onKeydown","onMouseenter","onMouseleave"],Cb=l.defineComponent({compatConfig:{MODE:3},__name:"DpCalendar",props:{mappedDates:{type:Array,default:()=>[]},instance:{type:Number,default:0},month:{type:Number,default:0},year:{type:Number,default:0},...Gt},emits:["select-date","set-hover-date","handle-scroll","mount","handle-swipe","handle-space","tooltip-open","tooltip-close"],setup(n,{expose:e,emit:t}){const r=n,{buildMultiLevelMatrix:i}=$n(),{defaultedTransitions:o,defaultedConfig:a,defaultedAriaLabels:s,defaultedMultiCalendars:c}=Ye(r),d=l.ref(null),u=l.ref({bottom:"",left:"",transform:""}),f=l.ref([]),p=l.ref(null),h=l.ref(!0),m=l.ref(""),g=l.ref({startX:0,endX:0,startY:0,endY:0}),k=l.ref([]),x=l.ref({left:"50%"}),S=l.computed(()=>r.calendar?r.calendar(r.mappedDates):r.mappedDates),T=l.computed(()=>r.dayNames?Array.isArray(r.dayNames)?r.dayNames:r.dayNames(r.locale,+r.weekStart):nv(r.formatLocale,r.locale,+r.weekStart));l.onMounted(()=>{t("mount",{cmp:"calendar",refs:f}),a.value.noSwipe||p.value&&(p.value.addEventListener("touchstart",W,{passive:!1}),p.value.addEventListener("touchend",F,{passive:!1}),p.value.addEventListener("touchmove",O,{passive:!1})),r.monthChangeOnScroll&&p.value&&p.value.addEventListener("wheel",b,{passive:!1})});const y=E=>E?r.vertical?"vNext":"next":r.vertical?"vPrevious":"previous",B=(E,P)=>{if(r.transitions){const q=It(Mn(G(),r.month,r.year));m.value=lt(It(Mn(G(),E,P)),q)?o.value[y(!0)]:o.value[y(!1)],h.value=!1,l.nextTick(()=>{h.value=!0})}},w=l.computed(()=>({[r.calendarClassName]:!!r.calendarClassName})),V=l.computed(()=>E=>{const P=iv(E);return{dp__marker_dot:P.type==="dot",dp__marker_line:P.type==="line"}}),$=l.computed(()=>E=>Ae(E,d.value)),M=l.computed(()=>({dp__calendar:!0,dp__calendar_next:c.value.count>0&&r.instance!==0})),_=l.computed(()=>E=>r.hideOffsetDates?E.current:!0),z=async(E,P,q)=>{var D,X;if(t("set-hover-date",E),(X=(D=E.marker)==null?void 0:D.tooltip)!=null&&X.length){const ne=qe(f.value[P][q]);if(ne){const{width:Y,height:Z}=ne.getBoundingClientRect();d.value=E.value;let ce={left:`${Y/2}px`},j=-50;if(await l.nextTick(),k.value[0]){const{left:J,width:de}=k.value[0].getBoundingClientRect();J<0&&(ce={left:"0"},j=0,x.value.left=`${Y/2}px`),window.innerWidth<J+de&&(ce={right:"0"},j=0,x.value.left=`${de-Y/2}px`)}u.value={bottom:`${Z}px`,...ce,transform:`translateX(${j}%)`},t("tooltip-open",E.marker)}}},N=E=>{d.value&&(d.value=null,u.value=JSON.parse(JSON.stringify({bottom:"",left:"",transform:""})),t("tooltip-close",E.marker))},W=E=>{g.value.startX=E.changedTouches[0].screenX,g.value.startY=E.changedTouches[0].screenY},F=E=>{g.value.endX=E.changedTouches[0].screenX,g.value.endY=E.changedTouches[0].screenY,I()},O=E=>{r.vertical&&!r.inline&&E.preventDefault()},I=()=>{const E=r.vertical?"Y":"X";Math.abs(g.value[`start${E}`]-g.value[`end${E}`])>10&&t("handle-swipe",g.value[`start${E}`]>g.value[`end${E}`]?"right":"left")},H=(E,P,q)=>{E&&(Array.isArray(f.value[P])?f.value[P][q]=E:f.value[P]=[E]),r.arrowNavigation&&i(f.value,"calendar")},b=E=>{r.monthChangeOnScroll&&(E.preventDefault(),t("handle-scroll",E))},C=E=>{const P=E[0];return r.weekNumbers==="local"?hy(P.value,{weekStartsOn:+r.weekStart}):r.weekNumbers==="iso"?dy(P.value):typeof r.weekNumbers=="function"?r.weekNumbers(P.value):""},v=(E,P)=>{Rn(E,a.value),t("select-date",P)},A=E=>{Rn(E,a.value)};return e({triggerTransition:B}),(E,P)=>{var q;return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(M.value)},[l.createElementVNode("div",{ref_key:"calendarWrapRef",ref:p,role:"grid",class:l.normalizeClass(w.value),"aria-label":(q=l.unref(s))==null?void 0:q.calendarWrap},[(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createElementVNode("div",gb,[E.weekNumbers?(l.openBlock(),l.createElementBlock("div",yb,l.toDisplayString(E.weekNumName),1)):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(T.value,(D,X)=>(l.openBlock(),l.createElementBlock("div",{class:"dp__calendar_header_item",role:"gridcell",key:X},[E.$slots["calendar-header"]?l.renderSlot(E.$slots,"calendar-header",{key:0,day:D,index:X}):l.createCommentVNode("",!0),E.$slots["calendar-header"]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(D),1)],64))]))),128))]),vb,l.createVNode(l.Transition,{name:m.value,css:!!E.transitions},{default:l.withCtx(()=>{var D;return[h.value?(l.openBlock(),l.createElementBlock("div",{key:0,class:"dp__calendar",role:"rowgroup","aria-label":((D=l.unref(s))==null?void 0:D.calendarDays)||void 0},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(S.value,(X,ne)=>(l.openBlock(),l.createElementBlock("div",{class:"dp__calendar_row",role:"row",key:ne},[E.weekNumbers?(l.openBlock(),l.createElementBlock("div",wb,[l.createElementVNode("div",kb,l.toDisplayString(C(X.days)),1)])):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(X.days,(Y,Z)=>{var ce,j,J;return l.openBlock(),l.createElementBlock("div",{role:"gridcell",class:"dp__calendar_item",ref_for:!0,ref:de=>H(de,ne,Z),key:Z+ne,"aria-selected":Y.classData.dp__active_date||Y.classData.dp__range_start||Y.classData.dp__range_start,"aria-disabled":Y.classData.dp__cell_disabled||void 0,"aria-label":(j=(ce=l.unref(s))==null?void 0:ce.day)==null?void 0:j.call(ce,Y),tabindex:"0",onClick:l.withModifiers(de=>v(de,Y),["prevent"]),onKeydown:[l.withKeys(de=>E.$emit("select-date",Y),["enter"]),l.withKeys(de=>E.$emit("handle-space",Y),["space"])],onMouseenter:de=>z(Y,ne,Z),onMouseleave:de=>N(Y)},[l.createElementVNode("div",{class:l.normalizeClass(["dp__cell_inner",Y.classData])},[E.$slots.day&&_.value(Y)?l.renderSlot(E.$slots,"day",{key:0,day:+Y.text,date:Y.value}):l.createCommentVNode("",!0),E.$slots.day?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(Y.text),1)],64)),Y.marker&&_.value(Y)?(l.openBlock(),l.createElementBlock(l.Fragment,{key:2},[E.$slots.marker?l.renderSlot(E.$slots,"marker",{key:0,marker:Y.marker,day:+Y.text,date:Y.value}):(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(V.value(Y.marker)),style:l.normalizeStyle(Y.marker.color?{backgroundColor:Y.marker.color}:{})},null,6))],64)):l.createCommentVNode("",!0),$.value(Y.value)?(l.openBlock(),l.createElementBlock("div",{key:3,class:"dp__marker_tooltip",ref_for:!0,ref_key:"activeTooltip",ref:k,style:l.normalizeStyle(u.value)},[(J=Y.marker)!=null&&J.tooltip?(l.openBlock(),l.createElementBlock("div",{key:0,class:"dp__tooltip_content",onClick:A},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(Y.marker.tooltip,(de,te)=>(l.openBlock(),l.createElementBlock("div",{key:te,class:"dp__tooltip_text"},[E.$slots["marker-tooltip"]?l.renderSlot(E.$slots,"marker-tooltip",{key:0,tooltip:de,day:Y.value}):l.createCommentVNode("",!0),E.$slots["marker-tooltip"]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createElementVNode("div",{class:"dp__tooltip_mark",style:l.normalizeStyle(de.color?{backgroundColor:de.color}:{})},null,4),l.createElementVNode("div",null,l.toDisplayString(de.text),1)],64))]))),128)),l.createElementVNode("div",{class:"dp__arrow_bottom_tp",style:l.normalizeStyle(x.value)},null,4)])):l.createCommentVNode("",!0)],4)):l.createCommentVNode("",!0)],2)],40,xb)}),128))]))),128))],8,bb)):l.createCommentVNode("",!0)]}),_:3},8,["name","css"])],64))],10,mb)],2)}}}),Id=n=>Array.isArray(n),Mb=(n,e,t,r)=>{const i=l.ref([]),{modelValue:o,calendars:a,time:s}=Ii(n,e),{defaultedMultiCalendars:c,defaultedStartTime:d}=Ye(n),{validateMonthYearInRange:u,isDisabled:f,isDateRangeAllowed:p,checkMinMaxRange:h}=Wr(n),{updateTimeValues:m,getSetDateTime:g,setTime:k,assignStartTime:x,validateTime:S,disabledTimesConfig:T}=Pd(n,s,o,r),y=l.computed(()=>R=>a.value[R]?a.value[R].month:0),B=l.computed(()=>R=>a.value[R]?a.value[R].year:0),w=(R,L,Q)=>{var ee,Ne;a.value[R]||(a.value[R]={month:0,year:0}),a.value[R].month=yd(L)?(ee=a.value[R])==null?void 0:ee.month:L,a.value[R].year=yd(Q)?(Ne=a.value[R])==null?void 0:Ne.year:Q},V=()=>{n.autoApply&&e("select-date")};l.watch(o,(R,L)=>{JSON.stringify(R)!==JSON.stringify(L)&&_()}),l.onMounted(()=>{n.shadow||(o.value||(v(),d.value&&x(d.value)),_(!0),n.focusStartDate&&n.startDate&&v())});const $=l.computed(()=>{var R;return(R=n.flow)!=null&&R.length&&!n.partialFlow?n.flowStep===n.flow.length:!0}),M=()=>{n.autoApply&&$.value&&e("auto-apply",n.partialFlow)},_=(R=!1)=>{if(o.value)return Array.isArray(o.value)?(i.value=o.value,I(R)):N(o.value,R);if(c.value.count&&R&&!n.startDate)return z(G(),R)},z=(R,L=!1)=>{if((!c.value.count||!c.value.static||L)&&w(0,Ce(R),Me(R)),c.value.count)for(let Q=1;Q<c.value.count;Q++){const ee=Be(G(),{month:y.value(Q-1),year:B.value(Q-1)}),Ne=Mc(ee,{months:1});a.value[Q]={month:Ce(Ne),year:Me(Ne)}}},N=(R,L)=>{z(R),k("hours",Wt(R)),k("minutes",an(R)),k("seconds",$r(R)),c.value.count&&L&&C()},W=R=>{if(c.value.count){if(c.value.solo)return 0;const L=Ce(R[0]),Q=Ce(R[1]);return Math.abs(Q-L)<c.value.count?0:1}return 1},F=(R,L)=>{R[1]&&n.showLastInRange?z(R[W(R)],L):z(R[0],L);const Q=(ee,Ne)=>[ee(R[0]),R[1]?ee(R[1]):s[Ne][1]];k("hours",Q(Wt,"hours")),k("minutes",Q(an,"minutes")),k("seconds",Q($r,"seconds"))},O=(R,L)=>{if((n.range||n.weekPicker)&&!n.multiDates)return F(R,L);if(n.multiDates&&L){const Q=R[R.length-1];return N(Q,L)}},I=R=>{const L=o.value;O(L,R),c.value.count&&c.value.solo&&C()},H=(R,L)=>{const Q=Be(G(),{month:y.value(L),year:B.value(L)}),ee=R<0?jt(Q,1):zr(Q,1);u(Ce(ee),Me(ee),R<0,n.preventMinMaxNavigation)&&(w(L,Ce(ee),Me(ee)),e("update-month-year",{instance:L,month:Ce(ee),year:Me(ee)}),c.value.count&&!c.value.solo&&b(L),t())},b=R=>{for(let L=R-1;L>=0;L--){const Q=zr(Be(G(),{month:y.value(L+1),year:B.value(L+1)}),1);w(L,Ce(Q),Me(Q))}for(let L=R+1;L<=c.value.count-1;L++){const Q=jt(Be(G(),{month:y.value(L-1),year:B.value(L-1)}),1);w(L,Ce(Q),Me(Q))}},C=()=>{if(Array.isArray(o.value)&&o.value.length===2){const R=G(G(o.value[1]?o.value[1]:jt(o.value[0],1))),[L,Q]=[Ce(o.value[0]),Me(o.value[0])],[ee,Ne]=[Ce(o.value[1]),Me(o.value[1])];(L!==ee||L===ee&&Q!==Ne)&&c.value.solo&&w(1,Ce(R),Me(R))}else o.value&&!Array.isArray(o.value)&&(w(0,Ce(o.value),Me(o.value)),z(G()))},v=()=>{n.startDate&&(w(0,Ce(G(n.startDate)),Me(G(n.startDate))),c.value.count&&b(0))},A=(R,L)=>{n.monthChangeOnScroll&&H(n.monthChangeOnScroll!=="inverse"?-R.deltaY:R.deltaY,L)},E=(R,L,Q=!1)=>{n.monthChangeOnArrows&&n.vertical===Q&&P(R,L)},P=(R,L)=>{H(R==="right"?-1:1,L)},q=R=>n.markers.find(L=>Ae(xd(R.value),xd(L.date))),D=(R,L)=>{switch(n.sixWeeks===!0?"append":n.sixWeeks){case"prepend":return[!0,!1];case"center":return[R==0,!0];case"fair":return[R==0||L>R,!0];case"append":return[!1,!1];default:return[!1,!1]}},X=(R,L,Q,ee)=>{if(n.sixWeeks&&R.length<6){const Ne=6-R.length,ht=(L.getDay()+7-ee)%7,U=6-(Q.getDay()+7-ee)%7,[ae,fe]=D(ht,U);for(let xe=1;xe<=Ne;xe++)if(fe?!!(xe%2)==ae:ae){const me=R[0].days[0],Qe=ne(Cn(me.value,-7),Ce(L));R.unshift({days:Qe})}else{const me=R[R.length-1],Qe=me.days[me.days.length-1],Dt=ne(Cn(Qe.value,1),Ce(L));R.push({days:Dt})}}return R},ne=(R,L)=>{const Q=G(R),ee=[];for(let Ne=0;Ne<7;Ne++){const ht=Cn(Q,Ne),U=Ce(ht)!==L;ee.push({text:n.hideOffsetDates&&U?"":ht.getDate(),value:ht,current:!U,classData:{}})}return ee},Y=(R,L)=>{const Q=[],ee=G(Rt(new Date(L,R),n.timezone)),Ne=G(Rt(new Date(L,R+1,0),n.timezone)),ht=n.weekStart,U=lr(ee,{weekStartsOn:ht}),ae=fe=>{const xe=ne(fe,R);if(Q.push({days:xe}),!Q[Q.length-1].days.some(me=>Ae(It(me.value),It(Ne)))){const me=Cn(fe,7);ae(me)}};return ae(U),X(Q,ee,Ne,ht)},Z=R=>(o.value=Ao(G(R.value),n.timezone,n.weekStart),e("date-update",R.value),M()),ce=R=>{const L=Vn(G(R.value),s.hours,s.minutes,st());e("date-update",L),n.multiDates?Po(L,o,n.multiDatesLimit):o.value=L,r(),l.nextTick().then(()=>{M()})},j=R=>n.noDisabledRange?Cd(i.value[0],R).some(L=>f(L)):!1,J=()=>{i.value=o.value?o.value.slice():[],i.value.length===2&&!(n.fixedStart||n.fixedEnd)&&(i.value=[])},de=(R,L)=>{const Q=[G(R.value),Cn(G(R.value),+n.autoRange)];p(Q)&&(L&&te(R.value),i.value=Q)},te=R=>{const L=Ce(G(R)),Q=Me(G(R));if(w(0,L,Q),c.value.count>0)for(let ee=1;ee<c.value.count;ee++){const Ne=cv(Be(G(R),{year:y.value(ee-1),month:B.value(ee-1)}));w(ee,Ne.month,Ne.year)}},Ge=R=>Array.isArray(o.value)&&o.value.length===2?n.fixedStart&&(lt(R,o.value[0])||Ae(R,o.value[0]))?[o.value[0],R]:n.fixedEnd&&(nt(R,o.value[1])||Ae(R,o.value[1]))?[R,o.value[1]]:(e("invalid-fixed-range",R),o.value):[],pt=R=>{j(R.value)||!h(R.value,o.value,n.fixedStart?0:1)||(i.value=Ge(G(R.value)))},nn=(R,L)=>{if(J(),n.autoRange)return de(R,L);if(n.fixedStart||n.fixedEnd)return pt(R);i.value[0]?h(G(R.value),o.value)&&!j(R.value)?nt(G(R.value),G(i.value[0]))?(i.value.unshift(G(R.value)),e("range-end",i.value[0])):(i.value[1]=G(R.value),e("range-end",i.value[1])):n.autoApply&&e("auto-apply-invalid",R.value):(i.value[0]=G(R.value),e("range-start",i.value[0]))},st=(R=!0)=>n.enableSeconds?Array.isArray(s.seconds)?R?s.seconds[0]:s.seconds[1]:s.seconds:0,xn=R=>{i.value[R]=Vn(i.value[R],s.hours[R],s.minutes[R],st(R!==1))},Bt=()=>{var R,L;i.value[0]&&i.value[1]&&+((R=i.value)==null?void 0:R[0])>+((L=i.value)==null?void 0:L[1])&&(i.value.reverse(),e("range-start",i.value[0]),e("range-end",i.value[1]))},Ut=()=>{i.value.length&&(i.value[0]&&!i.value[1]?xn(0):(xn(0),xn(1),r()),Bt(),o.value=i.value.slice(),Io(i.value,e,n.autoApply,n.modelAuto))},Nn=(R,L=!1)=>{if(!(f(R.value)||!R.current&&n.hideOffsetDates)){if(n.weekPicker)return Z(R);if(!n.range)return ce(R);Id(s.hours)&&Id(s.minutes)&&!n.multiDates&&(nn(R,L),Ut())}},rn=(R,L)=>{var Q;w(R,L.month,L.year),c.value.count&&!c.value.solo&&b(R),e("update-month-year",{instance:R,month:L.month,year:L.year}),t(c.value.solo?R:void 0);const ee=(Q=n.flow)!=null&&Q.length?n.flow[n.flowStep]:void 0;!L.fromNav&&(ee===cn.month||ee===cn.year)&&r()},_n=(R,L)=>{Array.isArray(R)&&R.length<=2&&n.range?o.value=R.map(Q=>Rt(G(Q),L?void 0:n.timezone)):Array.isArray(R)||(o.value=Rt(G(R),L?void 0:n.timezone)),V(),n.multiCalendars&&l.nextTick().then(()=>_(!0))},or=()=>{n.range?o.value&&Array.isArray(o.value)&&o.value[0]?o.value=nt(G(),o.value[0])?[G(),o.value[0]]:[o.value[0],G()]:o.value=[G()]:o.value=G(),V()},ar=()=>{if(Array.isArray(o.value))if(n.multiDates){const R=sr();o.value[o.value.length-1]=g(R)}else o.value=o.value.map((R,L)=>R&&g(R,L));else o.value=g(o.value);e("time-update")},sr=()=>Array.isArray(o.value)&&o.value.length?o.value[o.value.length-1]:null;return{calendars:a,modelValue:o,month:y,year:B,time:s,disabledTimesConfig:T,validateTime:S,getCalendarDays:Y,getMarker:q,handleScroll:A,handleSwipe:P,handleArrow:E,selectDate:Nn,updateMonthYear:rn,presetDate:_n,selectCurrentDate:or,updateTime:(R,L=!0,Q=!1)=>{m(R,L,Q,ar)}}},Tb={key:0},Sb=l.defineComponent({__name:"DatePicker",props:{...Gt},emits:["tooltip-open","tooltip-close","mount","update:internal-model-value","update-flow-step","reset-flow","auto-apply","focus-menu","select-date","range-start","range-end","invalid-fixed-range","time-update","am-pm-change","time-picker-open","time-picker-close","recalculate-position","update-month-year","auto-apply-invalid","date-update"],setup(n,{expose:e,emit:t}){const r=n,{calendars:i,month:o,year:a,modelValue:s,time:c,disabledTimesConfig:d,validateTime:u,getCalendarDays:f,getMarker:p,handleArrow:h,handleScroll:m,handleSwipe:g,selectDate:k,updateMonthYear:x,presetDate:S,selectCurrentDate:T,updateTime:y}=Mb(r,t,b,C),B=l.useSlots(),{setHoverDate:w,getDayClassData:V,clearHoverDate:$}=Av(s,r),{defaultedMultiCalendars:M}=Ye(r),_=l.ref([]),z=l.ref([]),N=l.ref(null),W=At(B,"calendar"),F=At(B,"monthYear"),O=At(B,"timePicker"),I=A=>{r.shadow||t("mount",A)};l.watch(i,()=>{r.shadow||setTimeout(()=>{t("recalculate-position")},0)},{deep:!0});const H=l.computed(()=>A=>f(o.value(A),a.value(A)).map(E=>({...E,days:E.days.map(P=>(P.marker=p(P),P.classData=V(P),P))})));function b(A){var E;A||A===0?(E=z.value[A])==null||E.triggerTransition(o.value(A),a.value(A)):z.value.forEach((P,q)=>P.triggerTransition(o.value(q),a.value(q)))}function C(){t("update-flow-step")}const v=(A,E=!1)=>{k(A,E),r.spaceConfirm&&t("select-date")};return e({clearHoverDate:$,presetDate:S,selectCurrentDate:T,toggleMonthPicker:(A,E,P=0)=>{var q;(q=_.value[P])==null||q.toggleMonthPicker(A,E)},toggleYearPicker:(A,E,P=0)=>{var q;(q=_.value[P])==null||q.toggleYearPicker(A,E)},toggleTimePicker:(A,E,P)=>{var q;(q=N.value)==null||q.toggleTimePicker(A,E,P)},handleArrow:h,updateMonthYear:x,getSidebarProps:()=>({modelValue:s,month:o,year:a,time:c,updateTime:y,updateMonthYear:x,selectDate:k,presetDate:S})}),(A,E)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createVNode(Bo,{"multi-calendars":l.unref(M).count},{default:l.withCtx(({instance:P,index:q})=>[A.disableMonthYearSelect?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(hb,l.mergeProps({key:0,ref:D=>{D&&(_.value[q]=D)},months:l.unref(hd)(A.formatLocale,A.locale,A.monthNameFormat),years:l.unref(us)(A.yearRange,A.reverseYears),month:l.unref(o)(P),year:l.unref(a)(P),instance:P},A.$props,{onMount:E[0]||(E[0]=D=>I(l.unref(hr).header)),onResetFlow:E[1]||(E[1]=D=>A.$emit("reset-flow")),onUpdateMonthYear:D=>l.unref(x)(P,D),onOverlayClosed:E[2]||(E[2]=D=>A.$emit("focus-menu"))}),l.createSlots({_:2},[l.renderList(l.unref(F),(D,X)=>({name:D,fn:l.withCtx(ne=>[l.renderSlot(A.$slots,D,l.normalizeProps(l.guardReactiveProps(ne)))])}))]),1040,["months","years","month","year","instance","onUpdateMonthYear"])),l.createVNode(Cb,l.mergeProps({ref:D=>{D&&(z.value[q]=D)},"mapped-dates":H.value(P),month:l.unref(o)(P),year:l.unref(a)(P),instance:P},A.$props,{onSelectDate:D=>l.unref(k)(D,P!==1),onHandleSpace:D=>v(D,P!==1),onSetHoverDate:E[3]||(E[3]=D=>l.unref(w)(D)),onHandleScroll:D=>l.unref(m)(D,P),onHandleSwipe:D=>l.unref(g)(D,P),onMount:E[4]||(E[4]=D=>I(l.unref(hr).calendar)),onResetFlow:E[5]||(E[5]=D=>A.$emit("reset-flow")),onTooltipOpen:E[6]||(E[6]=D=>A.$emit("tooltip-open",D)),onTooltipClose:E[7]||(E[7]=D=>A.$emit("tooltip-close",D))}),l.createSlots({_:2},[l.renderList(l.unref(W),(D,X)=>({name:D,fn:l.withCtx(ne=>[l.renderSlot(A.$slots,D,l.normalizeProps(l.guardReactiveProps({...ne})))])}))]),1040,["mapped-dates","month","year","instance","onSelectDate","onHandleSpace","onHandleScroll","onHandleSwipe"])]),_:3},8,["multi-calendars"]),A.enableTimePicker?(l.openBlock(),l.createElementBlock("div",Tb,[A.$slots["time-picker"]?l.renderSlot(A.$slots,"time-picker",l.normalizeProps(l.mergeProps({key:0},{time:l.unref(c),updateTime:l.unref(y)}))):(l.openBlock(),l.createBlock(Bd,l.mergeProps({key:1,ref_key:"timePickerRef",ref:N},A.$props,{hours:l.unref(c).hours,minutes:l.unref(c).minutes,seconds:l.unref(c).seconds,"internal-model-value":A.internalModelValue,"disabled-times-config":l.unref(d),"validate-time":l.unref(u),onMount:E[8]||(E[8]=P=>I(l.unref(hr).timePicker)),"onUpdate:hours":E[9]||(E[9]=P=>l.unref(y)(P)),"onUpdate:minutes":E[10]||(E[10]=P=>l.unref(y)(P,!1)),"onUpdate:seconds":E[11]||(E[11]=P=>l.unref(y)(P,!1,!0)),onResetFlow:E[12]||(E[12]=P=>A.$emit("reset-flow")),onOverlayClosed:E[13]||(E[13]=P=>A.$emit("time-picker-close")),onOverlayOpened:E[14]||(E[14]=P=>A.$emit("time-picker-open",P)),onAmPmChange:E[15]||(E[15]=P=>A.$emit("am-pm-change",P))}),l.createSlots({_:2},[l.renderList(l.unref(O),(P,q)=>({name:P,fn:l.withCtx(D=>[l.renderSlot(A.$slots,P,l.normalizeProps(l.guardReactiveProps(D)))])}))]),1040,["hours","minutes","seconds","internal-model-value","disabled-times-config","validate-time"]))])):l.createCommentVNode("",!0)],64))}}),Db=(n,e)=>{const t=l.ref(),{defaultedMultiCalendars:r,defaultedConfig:i}=Ye(n),{modelValue:o,year:a,month:s,calendars:c}=Ii(n,e),{isDisabled:d}=Wr(n),{selectYear:u,groupedYears:f,showYearPicker:p,isDisabled:h,toggleYearPicker:m,handleYearSelect:g,handleYear:k}=_d({modelValue:o,multiCalendars:r,calendars:c,month:s,year:a,props:n,emit:e}),x=($,M)=>[$,M].map(_=>In(_,"MMMM",{locale:n.formatLocale})).join("-"),S=l.computed(()=>$=>o.value?Array.isArray(o.value)?o.value.some(M=>Gc($,M)):Gc(o.value,$):!1),T=$=>{if(n.range){if(Array.isArray(o.value)){const M=Ae($,o.value[0])||Ae($,o.value[1]);return Do(o.value,t.value,$)&&!M}return!1}return!1},y=l.computed(()=>$=>{const M=Be(new Date,{year:a.value($)});return eg({start:ng(M),end:tg(M)}).map(_=>{const z=Ti(_),N=Ac(_),W=d(_),F=T(z);return{text:x(z,N),value:z,active:S.value(z),disabled:W,isBetween:F}})}),B=$=>{Po($,o,n.multiDatesLimit),e("auto-apply",!0)},w=$=>{const M=ws(o,$,e);Io(M,e,n.autoApply,n.modelAuto)},V=$=>{o.value=$,e("auto-apply")};return{defaultedConfig:i,defaultedMultiCalendars:r,groupedYears:f,year:a,isDisabled:h,quarters:y,showYearPicker:p,modelValue:o,setHoverDate:$=>{t.value=$},selectYear:u,selectQuarter:($,M,_)=>{if(!_)return c.value[M].month=Ce(Ac($)),n.multiDates?B($):n.range?w($):V($)},toggleYearPicker:m,handleYearSelect:g,handleYear:k}},Ab={class:"dp--quarter-items"},Eb=["disabled","onClick","onMouseover"],Ob=l.defineComponent({compatConfig:{MODE:3},__name:"QuarterPicker",props:{...Gt},emits:["update:internal-model-value","reset-flow","overlay-closed","auto-apply","range-start","range-end"],setup(n,{expose:e,emit:t}){const r=n,i=l.useSlots(),o=At(i,"yearMode"),{defaultedMultiCalendars:a,defaultedConfig:s,groupedYears:c,year:d,isDisabled:u,quarters:f,modelValue:p,showYearPicker:h,setHoverDate:m,selectQuarter:g,toggleYearPicker:k,handleYearSelect:x,handleYear:S}=Db(r,t);return e({getSidebarProps:()=>({modelValue:p,year:d,selectQuarter:g,handleYearSelect:x,handleYear:S})}),(T,y)=>(l.openBlock(),l.createBlock(Bo,{"multi-calendars":l.unref(a).count,stretch:""},{default:l.withCtx(({instance:B})=>[l.createElementVNode("div",{class:"dp-quarter-picker-wrap",style:l.normalizeStyle({minHeight:`${l.unref(s).modeHeight}px`})},[l.createElementVNode("div",null,[l.createVNode(Nd,l.mergeProps(T.$props,{items:l.unref(c)(B),instance:B,"show-year-picker":l.unref(h)[B],year:l.unref(d)(B),"is-disabled":w=>l.unref(u)(B,w),onHandleYear:w=>l.unref(S)(B,w),onYearSelect:w=>l.unref(x)(w,B),onToggleYearPicker:w=>l.unref(k)(B,w==null?void 0:w.flow,w==null?void 0:w.show)}),l.createSlots({_:2},[l.renderList(l.unref(o),(w,V)=>({name:w,fn:l.withCtx($=>[l.renderSlot(T.$slots,w,l.normalizeProps(l.guardReactiveProps($)))])}))]),1040,["items","instance","show-year-picker","year","is-disabled","onHandleYear","onYearSelect","onToggleYearPicker"])]),l.createElementVNode("div",Ab,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(f)(B),(w,V)=>(l.openBlock(),l.createElementBlock("div",{key:V},[l.createElementVNode("button",{type:"button",class:l.normalizeClass(["dp--qr-btn",{"dp--qr-btn-active":w.active,"dp--qr-btn-between":w.isBetween,"dp--qr-btn-disabled":w.disabled}]),disabled:w.disabled,onClick:$=>l.unref(g)(w.value,B,w.disabled),onMouseover:$=>l.unref(m)(w.value)},[T.$slots.quarter?l.renderSlot(T.$slots,"quarter",{key:0,value:w.value,text:w.text}):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(w.text),1)],64))],42,Eb)]))),128))])],4)]),_:3},8,["multi-calendars"]))}}),Nb=["id","onKeydown"],_b={key:0,class:"dp__sidebar_left"},Bb={key:1,class:"dp--preset-dates"},Pb=["onClick","onKeydown"],Ib={key:2,class:"dp__sidebar_right"},Rb={key:3,class:"dp__action_extra"},Rd=l.defineComponent({compatConfig:{MODE:3},__name:"DatepickerMenu",props:{..._o,shadow:{type:Boolean,default:!1},openOnTop:{type:Boolean,default:!1},internalModelValue:{type:[Date,Array],default:null},arrMapValues:{type:Object,default:()=>({})},noOverlayFocus:{type:Boolean,default:!1}},emits:["close-picker","select-date","auto-apply","time-update","flow-step","update-month-year","invalid-select","update:internal-model-value","recalculate-position","invalid-fixed-range","tooltip-open","tooltip-close","time-picker-open","time-picker-close","am-pm-change","range-start","range-end","auto-apply-invalid","date-update"],setup(n,{expose:e,emit:t}){const r=n,i=l.computed(()=>{const{openOnTop:j,...J}=r;return{...J,flowStep:V.value,noOverlayFocus:r.noOverlayFocus}}),{setMenuFocused:o,setShiftKey:a,control:s}=Ad(),c=l.useSlots(),{defaultedTextInput:d,defaultedInline:u,defaultedConfig:f}=Ye(r),p=l.ref(null),h=l.ref(0),m=l.ref(null),g=l.ref(null),k=l.ref(!1),x=l.ref(null);l.onMounted(()=>{if(!r.shadow){k.value=!0,S(),window.addEventListener("resize",S);const j=qe(m);if(j&&!d.value.enabled&&!u.value.enabled&&(o(!0),N()),j){const J=de=>{f.value.allowPreventDefault&&de.preventDefault(),Rn(de,f.value,!0)};j.addEventListener("pointerdown",J),j.addEventListener("mousedown",J)}}}),l.onUnmounted(()=>{window.removeEventListener("resize",S)});const S=()=>{const j=qe(g);j&&(h.value=j.getBoundingClientRect().width)},{arrowRight:T,arrowLeft:y,arrowDown:B,arrowUp:w}=$n(),{flowStep:V,updateFlowStep:$,childMount:M,resetFlow:_}=Ev(r,t,x),z=l.computed(()=>r.monthPicker?Wv:r.yearPicker?Kv:r.timePicker?ub:r.quarterPicker?Ob:Sb),N=()=>{const j=qe(m);j&&j.focus({preventScroll:!0})},W=l.computed(()=>{var j;return((j=x.value)==null?void 0:j.getSidebarProps())||{}}),F=()=>{r.openOnTop&&t("recalculate-position")},O=At(c,"action"),I=l.computed(()=>r.monthPicker||r.yearPicker?At(c,"monthYear"):r.timePicker?At(c,"timePicker"):At(c,"shared")),H=l.computed(()=>r.openOnTop?"dp__arrow_bottom":"dp__arrow_top"),b=l.computed(()=>({dp__menu_disabled:r.disabled,dp__menu_readonly:r.readonly})),C=l.computed(()=>({dp__menu:!0,dp__menu_index:!u.value.enabled,dp__relative:u.value.enabled,[r.menuClassName]:!!r.menuClassName})),v=j=>{Rn(j,f.value,!0)},A=()=>{r.escClose&&t("close-picker")},E=j=>{if(r.arrowNavigation){if(j==="up")return w();if(j==="down")return B();if(j==="left")return y();if(j==="right")return T()}else j==="left"||j==="up"?ne("handleArrow","left",0,j==="up"):ne("handleArrow","right",0,j==="down")},P=j=>{a(j.shiftKey),!r.disableMonthYearSelect&&j.code==="Tab"&&j.target.classList.contains("dp__menu")&&s.value.shiftKeyInMenu&&(j.preventDefault(),Rn(j,f.value,!0),t("close-picker"))},q=()=>{N(),t("time-picker-close")},D=j=>{var J,de,te;(J=x.value)==null||J.toggleTimePicker(!1,!1),(de=x.value)==null||de.toggleMonthPicker(!1,!1,j),(te=x.value)==null||te.toggleYearPicker(!1,!1,j)},X=(j,J=0)=>{var de,te,Ge;return j==="month"?(de=x.value)==null?void 0:de.toggleMonthPicker(!1,!0,J):j==="year"?(te=x.value)==null?void 0:te.toggleYearPicker(!1,!0,J):j==="time"?(Ge=x.value)==null?void 0:Ge.toggleTimePicker(!0,!1):D(J)},ne=(j,...J)=>{var de,te;(de=x.value)!=null&&de[j]&&((te=x.value)==null||te[j](...J))},Y=()=>{ne("selectCurrentDate")},Z=(j,J)=>{ne("presetDate",j,J)},ce=()=>{ne("clearHoverDate")};return e({updateMonthYear:(j,J)=>{ne("updateMonthYear",j,J)},switchView:X}),(j,J)=>{var de;return l.openBlock(),l.createElementBlock("div",{id:j.uid?`dp-menu-${j.uid}`:void 0,tabindex:"0",ref_key:"dpMenuRef",ref:m,role:"dialog",class:l.normalizeClass(C.value),onMouseleave:ce,onClick:v,onKeydown:[l.withKeys(A,["esc"]),J[17]||(J[17]=l.withKeys(l.withModifiers(te=>E("left"),["prevent"]),["left"])),J[18]||(J[18]=l.withKeys(l.withModifiers(te=>E("up"),["prevent"]),["up"])),J[19]||(J[19]=l.withKeys(l.withModifiers(te=>E("down"),["prevent"]),["down"])),J[20]||(J[20]=l.withKeys(l.withModifiers(te=>E("right"),["prevent"]),["right"])),P]},[(j.disabled||j.readonly)&&l.unref(u).enabled?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(b.value)},null,2)):l.createCommentVNode("",!0),!l.unref(u).enabled&&!j.teleportCenter?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(H.value)},null,2)):l.createCommentVNode("",!0),l.createElementVNode("div",{ref_key:"innerMenuRef",ref:g,class:l.normalizeClass({dp__menu_content_wrapper:((de=j.presetDates)==null?void 0:de.length)||!!j.$slots["left-sidebar"]||!!j.$slots["right-sidebar"]}),style:l.normalizeStyle({"--dp-menu-width":`${h.value}px`})},[j.$slots["left-sidebar"]?(l.openBlock(),l.createElementBlock("div",_b,[l.renderSlot(j.$slots,"left-sidebar",l.normalizeProps(l.guardReactiveProps(W.value)))])):l.createCommentVNode("",!0),j.presetDates.length?(l.openBlock(),l.createElementBlock("div",Bb,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(j.presetDates,(te,Ge)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:Ge},[te.slot?l.renderSlot(j.$slots,te.slot,{key:0,presetDate:Z,label:te.label,value:te.value}):(l.openBlock(),l.createElementBlock("button",{key:1,type:"button",style:l.normalizeStyle(te.style||{}),class:"dp__btn dp--preset-range",onClick:l.withModifiers(pt=>Z(te.value,te.noTz),["prevent"]),onKeydown:[l.withKeys(l.withModifiers(pt=>Z(te.value,te.noTz),["prevent"]),["enter"]),l.withKeys(l.withModifiers(pt=>Z(te.value,te.noTz),["prevent"]),["space"])]},l.toDisplayString(te.label),45,Pb))],64))),128))])):l.createCommentVNode("",!0),l.createElementVNode("div",{class:"dp__instance_calendar",ref_key:"calendarWrapperRef",ref:p,role:"document"},[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(z.value),l.mergeProps({ref_key:"dynCmpRef",ref:x},i.value,{"flow-step":l.unref(V),onMount:l.unref(M),onUpdateFlowStep:l.unref($),onResetFlow:l.unref(_),onFocusMenu:N,onSelectDate:J[0]||(J[0]=te=>j.$emit("select-date")),onDateUpdate:J[1]||(J[1]=te=>j.$emit("date-update",te)),onTooltipOpen:J[2]||(J[2]=te=>j.$emit("tooltip-open",te)),onTooltipClose:J[3]||(J[3]=te=>j.$emit("tooltip-close",te)),onAutoApply:J[4]||(J[4]=te=>j.$emit("auto-apply",te)),onRangeStart:J[5]||(J[5]=te=>j.$emit("range-start",te)),onRangeEnd:J[6]||(J[6]=te=>j.$emit("range-end",te)),onInvalidFixedRange:J[7]||(J[7]=te=>j.$emit("invalid-fixed-range",te)),onTimeUpdate:J[8]||(J[8]=te=>j.$emit("time-update")),onAmPmChange:J[9]||(J[9]=te=>j.$emit("am-pm-change",te)),onTimePickerOpen:J[10]||(J[10]=te=>j.$emit("time-picker-open",te)),onTimePickerClose:q,onRecalculatePosition:F,onUpdateMonthYear:J[11]||(J[11]=te=>j.$emit("update-month-year",te)),onAutoApplyInvalid:J[12]||(J[12]=te=>j.$emit("auto-apply-invalid",te)),"onUpdate:internalModelValue":J[13]||(J[13]=te=>j.$emit("update:internal-model-value",te))}),l.createSlots({_:2},[l.renderList(I.value,(te,Ge)=>({name:te,fn:l.withCtx(pt=>[l.renderSlot(j.$slots,te,l.normalizeProps(l.guardReactiveProps({...pt})))])}))]),1040,["flow-step","onMount","onUpdateFlowStep","onResetFlow"]))],512),j.$slots["right-sidebar"]?(l.openBlock(),l.createElementBlock("div",Ib,[l.renderSlot(j.$slots,"right-sidebar",l.normalizeProps(l.guardReactiveProps(W.value)))])):l.createCommentVNode("",!0),j.$slots["action-extra"]?(l.openBlock(),l.createElementBlock("div",Rb,[j.$slots["action-extra"]?l.renderSlot(j.$slots,"action-extra",{key:0,selectCurrentDate:Y}):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)],6),!j.autoApply||l.unref(f).keepActionRow?(l.openBlock(),l.createBlock(Vv,l.mergeProps({key:2,"menu-mount":k.value},i.value,{"calendar-width":h.value,onClosePicker:J[14]||(J[14]=te=>j.$emit("close-picker")),onSelectDate:J[15]||(J[15]=te=>j.$emit("select-date")),onInvalidSelect:J[16]||(J[16]=te=>j.$emit("invalid-select")),onSelectNow:Y}),l.createSlots({_:2},[l.renderList(l.unref(O),(te,Ge)=>({name:te,fn:l.withCtx(pt=>[l.renderSlot(j.$slots,te,l.normalizeProps(l.guardReactiveProps({...pt})))])}))]),1040,["menu-mount","calendar-width"])):l.createCommentVNode("",!0)],42,Nb)}}}),Vb=typeof window<"u"?window:void 0,ks=()=>{},Lb=n=>l.getCurrentScope()?(l.onScopeDispose(n),!0):!1,$b=(n,e,t,r)=>{if(!n)return ks;let i=ks;const o=l.watch(()=>l.unref(n),s=>{i(),s&&(s.addEventListener(e,t,r),i=()=>{s.removeEventListener(e,t,r),i=ks})},{immediate:!0,flush:"post"}),a=()=>{o(),i()};return Lb(a),a},Fb=(n,e,t,r={})=>{const{window:i=Vb,event:o="pointerdown"}=r;return i?$b(i,o,a=>{const s=qe(n),c=qe(e);!s||!c||s===a.target||a.composedPath().includes(s)||a.composedPath().includes(c)||t(a)},{passive:!0}):void 0},zb=l.defineComponent({compatConfig:{MODE:3},__name:"VueDatePicker",props:{..._o},emits:["update:model-value","update:model-timezone-value","text-submit","closed","cleared","open","focus","blur","internal-model-change","recalculate-position","flow-step","update-month-year","invalid-select","invalid-fixed-range","tooltip-open","tooltip-close","time-picker-open","time-picker-close","am-pm-change","range-start","range-end","date-update"],setup(n,{expose:e,emit:t}){const r=n,i=l.useSlots(),o=l.ref(!1),a=l.toRef(r,"modelValue"),s=l.toRef(r,"timezone"),c=l.ref(null),d=l.ref(null),u=l.ref(null),f=l.ref(!1),p=l.ref(null),{setMenuFocused:h,setShiftKey:m}=Ad(),{clearArrowNav:g}=$n(),{mapDatesArrToMap:k,validateDate:x,isValidTime:S}=Wr(r),{defaultedTransitions:T,defaultedTextInput:y,defaultedInline:B,defaultedConfig:w}=Ye(r),{menuTransition:V,showTransition:$}=Pi(T);l.onMounted(()=>{v(r.modelValue),l.nextTick().then(()=>{B.value.enabled||(I(p.value).addEventListener("scroll",Y),window.addEventListener("resize",Z))}),B.value.enabled&&(o.value=!0)});const M=l.computed(()=>k());l.onUnmounted(()=>{if(!B.value.enabled){const L=I(p.value);L&&L.removeEventListener("scroll",Y),window.removeEventListener("resize",Z)}});const _=At(i,"all",r.presetDates),z=At(i,"input");l.watch([a,s],()=>{v(a.value)},{deep:!0});const{openOnTop:N,menuStyle:W,xCorrect:F,setMenuPosition:O,getScrollableParent:I,shadowRender:H}=Tv({menuRef:c,menuRefInner:d,inputRef:u,pickerWrapperRef:p,inline:B,emit:t,props:r,slots:i}),{inputValue:b,internalModelValue:C,parseExternalModelValue:v,emitModelValue:A,formatInputValue:E,checkBeforeEmit:P}=Cv(t,r,f),q=l.computed(()=>({dp__main:!0,dp__theme_dark:r.dark,dp__theme_light:!r.dark,dp__flex_display:B.value.enabled,dp__flex_display_with_input:B.value.input})),D=l.computed(()=>r.dark?"dp__theme_dark":"dp__theme_light"),X=l.computed(()=>r.teleport?{to:typeof r.teleport=="boolean"?"body":r.teleport,disabled:B.value.enabled}:{class:"dp__outer_menu_wrap"}),ne=l.computed(()=>B.value.enabled&&(r.timePicker||r.monthPicker||r.yearPicker||r.quarterPicker)),Y=()=>{o.value&&(w.value.closeOnScroll?st():O())},Z=()=>{o.value&&O()},ce=()=>{!r.disabled&&!r.readonly&&(H(Rd,r),O(!1),o.value=!0,o.value&&t("open"),o.value||nn(),v(r.modelValue))},j=()=>{var L;b.value="",nn(),(L=u.value)==null||L.setParsedDate(null),t("update:model-value",null),t("update:model-timezone-value",null),t("cleared"),w.value.closeOnClearValue&&st()},J=()=>{const L=C.value;return!L||!Array.isArray(L)&&x(L)?!0:Array.isArray(L)?L.length===2&&x(L[0])&&x(L[1])?!0:r.partialRange&&!r.timePicker?x(L[0]):!1:!1},de=()=>{P()&&J()?(A(),st()):t("invalid-select",C.value)},te=L=>{Ge(),A(),w.value.closeOnAutoApply&&!L&&st()},Ge=()=>{u.value&&y.value.enabled&&u.value.setParsedDate(C.value)},pt=(L=!1)=>{r.autoApply&&S(C.value)&&J()&&(r.range&&Array.isArray(C.value)?(r.partialRange||C.value.length===2)&&te(L):te(L))},nn=()=>{y.value.enabled||(C.value=null)},st=()=>{B.value.enabled||(o.value&&(o.value=!1,F.value=!1,h(!1),m(!1),g(),t("closed"),b.value&&v(a.value)),nn(),t("blur"))},xn=(L,Q)=>{if(!L){C.value=null;return}const ee=Array.isArray(L)?!L.some(ht=>!x(ht)):x(L),Ne=S(L);ee&&Ne&&(C.value=L,Q&&(de(),t("text-submit")))},Bt=()=>{r.autoApply&&S(C.value)&&A(),Ge()},Ut=()=>o.value?st():ce(),Nn=L=>{C.value=L},rn=()=>{y.value.enabled&&(f.value=!0,E()),t("focus")},_n=()=>{y.value.enabled&&(f.value=!1,v(r.modelValue)),t("blur")},or=L=>{d.value&&d.value.updateMonthYear(0,{month:gd(L.month),year:gd(L.year)})},ar=L=>{v(L??r.modelValue)},sr=(L,Q)=>{var ee;(ee=d.value)==null||ee.switchView(L,Q)},R=L=>w.value.onClickOutside?w.value.onClickOutside(L):st();return Fb(c,u,()=>R(J)),e({closeMenu:st,selectDate:de,clearValue:j,openMenu:ce,onScroll:Y,formatInputValue:E,updateInternalModelValue:Nn,setMonthYear:or,parseModel:ar,switchView:sr}),(L,Q)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(q.value),ref_key:"pickerWrapperRef",ref:p},[l.createVNode(Bv,l.mergeProps({ref_key:"inputRef",ref:u,"is-menu-open":o.value,"input-value":l.unref(b),"onUpdate:inputValue":Q[0]||(Q[0]=ee=>l.isRef(b)?b.value=ee:null)},L.$props,{onClear:j,onOpen:ce,onSetInputDate:xn,onSetEmptyDate:l.unref(A),onSelectDate:de,onToggle:Ut,onClose:st,onFocus:rn,onBlur:_n,onRealBlur:Q[1]||(Q[1]=ee=>f.value=!1)}),l.createSlots({_:2},[l.renderList(l.unref(z),(ee,Ne)=>({name:ee,fn:l.withCtx(ht=>[l.renderSlot(L.$slots,ee,l.normalizeProps(l.guardReactiveProps(ht)))])}))]),1040,["is-menu-open","input-value","onSetEmptyDate"]),l.createVNode(l.Transition,{name:l.unref(V)(l.unref(N)),css:l.unref($)&&!l.unref(B).enabled},{default:l.withCtx(()=>[o.value?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(L.teleport?l.Teleport:"div"),l.mergeProps({key:0,ref_key:"dpWrapMenuRef",ref:c},X.value,{class:{"dp--menu-wrapper":!l.unref(B).enabled},style:l.unref(B).enabled?void 0:l.unref(W)}),{default:l.withCtx(()=>[l.createVNode(Rd,l.mergeProps({ref_key:"dpMenuRef",ref:d,class:{[D.value]:!0,"dp--menu-wrapper":L.teleport},style:L.teleport?l.unref(W):void 0,"open-on-top":l.unref(N),"arr-map-values":M.value,"no-overlay-focus":ne.value},L.$props,{"internal-model-value":l.unref(C),"onUpdate:internalModelValue":Q[2]||(Q[2]=ee=>l.isRef(C)?C.value=ee:null),onClosePicker:st,onSelectDate:de,onAutoApply:pt,onTimeUpdate:Bt,onFlowStep:Q[3]||(Q[3]=ee=>L.$emit("flow-step",ee)),onUpdateMonthYear:Q[4]||(Q[4]=ee=>L.$emit("update-month-year",ee)),onInvalidSelect:Q[5]||(Q[5]=ee=>L.$emit("invalid-select",l.unref(C))),onAutoApplyInvalid:Q[6]||(Q[6]=ee=>L.$emit("invalid-select",ee)),onInvalidFixedRange:Q[7]||(Q[7]=ee=>L.$emit("invalid-fixed-range",ee)),onRecalculatePosition:l.unref(O),onTooltipOpen:Q[8]||(Q[8]=ee=>L.$emit("tooltip-open",ee)),onTooltipClose:Q[9]||(Q[9]=ee=>L.$emit("tooltip-close",ee)),onTimePickerOpen:Q[10]||(Q[10]=ee=>L.$emit("time-picker-open",ee)),onTimePickerClose:Q[11]||(Q[11]=ee=>L.$emit("time-picker-close",ee)),onAmPmChange:Q[12]||(Q[12]=ee=>L.$emit("am-pm-change",ee)),onRangeStart:Q[13]||(Q[13]=ee=>L.$emit("range-start",ee)),onRangeEnd:Q[14]||(Q[14]=ee=>L.$emit("range-end",ee)),onDateUpdate:Q[15]||(Q[15]=ee=>L.$emit("date-update",ee))}),l.createSlots({_:2},[l.renderList(l.unref(_),(ee,Ne)=>({name:ee,fn:l.withCtx(ht=>[l.renderSlot(L.$slots,ee,l.normalizeProps(l.guardReactiveProps({...ht})))])}))]),1040,["class","style","open-on-top","arr-map-values","no-overlay-focus","internal-model-value","onRecalculatePosition"])]),_:3},16,["class","style"])):l.createCommentVNode("",!0)]),_:3},8,["name","css"])],2))}}),xs=(()=>{const n=zb;return n.install=e=>{e.component("Vue3DatePicker",n)},n})();Object.entries(Object.freeze(Object.defineProperty({__proto__:null,default:xs},Symbol.toStringTag,{value:"Module"}))).forEach(([n,e])=>{n!=="default"&&(xs[n]=e)});const yA="",vA="",Hb={components:{VueDatePicker:xs},props:{setDate:{type:[Date,String],default:()=>new Date,required:!0},invalid:{type:Boolean,default:!1}},data(){return{selectedDate:this.setDate?new Date(this.setDate):null,minDate:new Date}},watch:{selectedDate(n){this.$emit("update:selectedDate",n)}}};function Yb(n,e,t,r,i,o){const a=l.resolveComponent("VueDatePicker");return l.openBlock(),l.createElementBlock("div",null,[l.createVNode(a,{modelValue:i.selectedDate,"onUpdate:modelValue":e[0]||(e[0]=s=>i.selectedDate=s),placeholder:"Select Start Date",mode:"date",format:"MM/dd/yyyy","enable-time-picker":!1,"min-date":i.minDate,state:t.invalid},null,8,["modelValue","min-date","state"])])}const Vd=Fe(Hb,[["render",Yb],["__scopeId","data-v-a30d4641"]]),Ub={name:"TournamentCard",components:{TournamentHeader:bc,TournamentDetail:yc},props:{detail:{type:Object,required:!0,default:()=>({artwork:"",tags:[],name:"",description:"",date:"",closes:"",location:""})}}},jb={class:"rounded-xl w-72 shadow"};function Wb(n,e,t,r,i,o){const a=l.resolveComponent("TournamentHeader"),s=l.resolveComponent("TournamentDetail");return l.openBlock(),l.createElementBlock("div",jb,[l.createVNode(a,{artwork:t.detail.artwork,tags:t.detail.tags},null,8,["artwork","tags"]),l.createVNode(s,{detail:t.detail},null,8,["detail"])])}const Ld=Fe(Ub,[["render",Wb]]),qb={name:"GridContainer",components:{FilterAndSortBar:wc,BaseText:Bn,TournamentCard:Ld,FilterUpcomingPast:kc},props:{items:{type:Array,default:()=>[]},component:{type:String,required:!0},label:{type:String},dropdownItems:{type:Array,default:()=>[]},selectedItem:null},data(){return{filterOn:"",sortCriteria:"Date",selectedTimeFrame:"All"}},computed:{filteredItems(){let n=this.items;if(this.filterOn.trim()){const t=this.filterOn.toLowerCase();n=n.filter(r=>Object.values(r).some(i=>typeof i=="string"&&i.toLowerCase().includes(t)))}const e=new Date;switch(e.setHours(0,0,0,0),this.selectedTimeFrame){case"Upcoming":n=n.filter(t=>new Date(t.date)>=e);break;case"Past":n=n.filter(t=>new Date(t.date)<e);break}switch(this.sortCriteria){case"Date":n=[...n].sort((t,r)=>new Date(t.date)-new Date(r.date));break;case"Name":n=[...n].sort((t,r)=>t.name.localeCompare(r.name));break;case"Location":n=[...n].sort((t,r)=>t.location.localeCompare(r.location));break}return n}},methods:{handleFilter(n){this.filterOn=n},handleSort(n){this.sortCriteria=n.text},handleTimeFrameChange(n){this.selectedTimeFrame=n}}},Kb={class:"border border-dropdownSelect rounded-lg p-9 bg-neutral"},Gb={class:"my-4"},Qb={class:"my-4"},Jb={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 3xl:grid-cols-4 gap-6 w-full"};function Xb(n,e,t,r,i,o){const a=l.resolveComponent("FilterUpcomingPast"),s=l.resolveComponent("FilterAndSortBar");return l.openBlock(),l.createElementBlock("div",Kb,[l.createElementVNode("div",Gb,[l.createVNode(a,{selected:i.selectedTimeFrame,onTimeFrame:o.handleTimeFrameChange},null,8,["selected","onTimeFrame"])]),l.createElementVNode("div",Qb,[l.createVNode(s,{items:t.dropdownItems,label:t.label,selectedItem:t.selectedItem,onFilterbar:o.handleFilter,onSort:o.handleSort},null,8,["items","label","selectedItem","onFilterbar","onSort"])]),l.createElementVNode("div",Jb,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.filteredItems,c=>(l.openBlock(),l.createElementBlock("div",{key:c.id},[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(t.component),{detail:c},null,8,["detail"]))]))),128))])])}const Zb=Fe(qb,[["render",Xb]]);function ew(n){if(Array.isArray(n))return n}function tw(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],c=!0,d=!1;try{if(o=(t=t.call(n)).next,e===0){if(Object(t)!==t)return;c=!1}else for(;!(c=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);c=!0);}catch(u){d=!0,i=u}finally{try{if(!c&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(d)throw i}}return s}}function nw(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rw(n,e){return ew(n)||tw(n,e)||zc(n,e)||nw()}function $d(n,e,t,r,i,o,a){try{var s=n[o](a),c=s.value}catch(d){t(d);return}s.done?e(c):Promise.resolve(c).then(r,i)}function iw(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(c){$d(o,r,i,a,s,"next",c)}function s(c){$d(o,r,i,a,s,"throw",c)}a(void 0)})}}function Fd(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var zd={exports:{}},Hd={exports:{}};(function(n){function e(t){"@babel/helpers - typeof";return n.exports=e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},n.exports.__esModule=!0,n.exports.default=n.exports,e(t)}n.exports=e,n.exports.__esModule=!0,n.exports.default=n.exports})(Hd);var ow=Hd.exports;(function(n){var e=ow.default;function t(){n.exports=t=function(){return i},n.exports.__esModule=!0,n.exports.default=n.exports;var r,i={},o=Object.prototype,a=o.hasOwnProperty,s=Object.defineProperty||function(C,v,A){C[v]=A.value},c=typeof Symbol=="function"?Symbol:{},d=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function p(C,v,A){return Object.defineProperty(C,v,{value:A,enumerable:!0,configurable:!0,writable:!0}),C[v]}try{p({},"")}catch{p=function(A,E,P){return A[E]=P}}function h(C,v,A,E){var P=v&&v.prototype instanceof y?v:y,q=Object.create(P.prototype),D=new H(E||[]);return s(q,"_invoke",{value:W(C,A,D)}),q}function m(C,v,A){try{return{type:"normal",arg:C.call(v,A)}}catch(E){return{type:"throw",arg:E}}}i.wrap=h;var g="suspendedStart",k="suspendedYield",x="executing",S="completed",T={};function y(){}function B(){}function w(){}var V={};p(V,d,function(){return this});var $=Object.getPrototypeOf,M=$&&$($(b([])));M&&M!==o&&a.call(M,d)&&(V=M);var _=w.prototype=y.prototype=Object.create(V);function z(C){["next","throw","return"].forEach(function(v){p(C,v,function(A){return this._invoke(v,A)})})}function N(C,v){function A(P,q,D,X){var ne=m(C[P],C,q);if(ne.type!=="throw"){var Y=ne.arg,Z=Y.value;return Z&&e(Z)=="object"&&a.call(Z,"__await")?v.resolve(Z.__await).then(function(ce){A("next",ce,D,X)},function(ce){A("throw",ce,D,X)}):v.resolve(Z).then(function(ce){Y.value=ce,D(Y)},function(ce){return A("throw",ce,D,X)})}X(ne.arg)}var E;s(this,"_invoke",{value:function(q,D){function X(){return new v(function(ne,Y){A(q,D,ne,Y)})}return E=E?E.then(X,X):X()}})}function W(C,v,A){var E=g;return function(P,q){if(E===x)throw new Error("Generator is already running");if(E===S){if(P==="throw")throw q;return{value:r,done:!0}}for(A.method=P,A.arg=q;;){var D=A.delegate;if(D){var X=F(D,A);if(X){if(X===T)continue;return X}}if(A.method==="next")A.sent=A._sent=A.arg;else if(A.method==="throw"){if(E===g)throw E=S,A.arg;A.dispatchException(A.arg)}else A.method==="return"&&A.abrupt("return",A.arg);E=x;var ne=m(C,v,A);if(ne.type==="normal"){if(E=A.done?S:k,ne.arg===T)continue;return{value:ne.arg,done:A.done}}ne.type==="throw"&&(E=S,A.method="throw",A.arg=ne.arg)}}}function F(C,v){var A=v.method,E=C.iterator[A];if(E===r)return v.delegate=null,A==="throw"&&C.iterator.return&&(v.method="return",v.arg=r,F(C,v),v.method==="throw")||A!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+A+"' method")),T;var P=m(E,C.iterator,v.arg);if(P.type==="throw")return v.method="throw",v.arg=P.arg,v.delegate=null,T;var q=P.arg;return q?q.done?(v[C.resultName]=q.value,v.next=C.nextLoc,v.method!=="return"&&(v.method="next",v.arg=r),v.delegate=null,T):q:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,T)}function O(C){var v={tryLoc:C[0]};1 in C&&(v.catchLoc=C[1]),2 in C&&(v.finallyLoc=C[2],v.afterLoc=C[3]),this.tryEntries.push(v)}function I(C){var v=C.completion||{};v.type="normal",delete v.arg,C.completion=v}function H(C){this.tryEntries=[{tryLoc:"root"}],C.forEach(O,this),this.reset(!0)}function b(C){if(C||C===""){var v=C[d];if(v)return v.call(C);if(typeof C.next=="function")return C;if(!isNaN(C.length)){var A=-1,E=function P(){for(;++A<C.length;)if(a.call(C,A))return P.value=C[A],P.done=!1,P;return P.value=r,P.done=!0,P};return E.next=E}}throw new TypeError(e(C)+" is not iterable")}return B.prototype=w,s(_,"constructor",{value:w,configurable:!0}),s(w,"constructor",{value:B,configurable:!0}),B.displayName=p(w,f,"GeneratorFunction"),i.isGeneratorFunction=function(C){var v=typeof C=="function"&&C.constructor;return!!v&&(v===B||(v.displayName||v.name)==="GeneratorFunction")},i.mark=function(C){return Object.setPrototypeOf?Object.setPrototypeOf(C,w):(C.__proto__=w,p(C,f,"GeneratorFunction")),C.prototype=Object.create(_),C},i.awrap=function(C){return{__await:C}},z(N.prototype),p(N.prototype,u,function(){return this}),i.AsyncIterator=N,i.async=function(C,v,A,E,P){P===void 0&&(P=Promise);var q=new N(h(C,v,A,E),P);return i.isGeneratorFunction(v)?q:q.next().then(function(D){return D.done?D.value:q.next()})},z(_),p(_,f,"Generator"),p(_,d,function(){return this}),p(_,"toString",function(){return"[object Generator]"}),i.keys=function(C){var v=Object(C),A=[];for(var E in v)A.push(E);return A.reverse(),function P(){for(;A.length;){var q=A.pop();if(q in v)return P.value=q,P.done=!1,P}return P.done=!0,P}},i.values=b,H.prototype={constructor:H,reset:function(v){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(I),!v)for(var A in this)A.charAt(0)==="t"&&a.call(this,A)&&!isNaN(+A.slice(1))&&(this[A]=r)},stop:function(){this.done=!0;var v=this.tryEntries[0].completion;if(v.type==="throw")throw v.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var A=this;function E(Y,Z){return D.type="throw",D.arg=v,A.next=Y,Z&&(A.method="next",A.arg=r),!!Z}for(var P=this.tryEntries.length-1;P>=0;--P){var q=this.tryEntries[P],D=q.completion;if(q.tryLoc==="root")return E("end");if(q.tryLoc<=this.prev){var X=a.call(q,"catchLoc"),ne=a.call(q,"finallyLoc");if(X&&ne){if(this.prev<q.catchLoc)return E(q.catchLoc,!0);if(this.prev<q.finallyLoc)return E(q.finallyLoc)}else if(X){if(this.prev<q.catchLoc)return E(q.catchLoc,!0)}else{if(!ne)throw new Error("try statement without catch or finally");if(this.prev<q.finallyLoc)return E(q.finallyLoc)}}}},abrupt:function(v,A){for(var E=this.tryEntries.length-1;E>=0;--E){var P=this.tryEntries[E];if(P.tryLoc<=this.prev&&a.call(P,"finallyLoc")&&this.prev<P.finallyLoc){var q=P;break}}q&&(v==="break"||v==="continue")&&q.tryLoc<=A&&A<=q.finallyLoc&&(q=null);var D=q?q.completion:{};return D.type=v,D.arg=A,q?(this.method="next",this.next=q.finallyLoc,T):this.complete(D)},complete:function(v,A){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&A&&(this.next=A),T},finish:function(v){for(var A=this.tryEntries.length-1;A>=0;--A){var E=this.tryEntries[A];if(E.finallyLoc===v)return this.complete(E.completion,E.afterLoc),I(E),T}},catch:function(v){for(var A=this.tryEntries.length-1;A>=0;--A){var E=this.tryEntries[A];if(E.tryLoc===v){var P=E.completion;if(P.type==="throw"){var q=P.arg;I(E)}return q}}throw new Error("illegal catch attempt")},delegateYield:function(v,A,E){return this.delegate={iterator:b(v),resultName:A,nextLoc:E},this.method==="next"&&(this.arg=r),T}},i}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(zd);var aw=zd.exports,Ro=aw(),sw=Ro;try{regeneratorRuntime=Ro}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=Ro:Function("r","regeneratorRuntime = r")(Ro)}const Yd=Fd(sw),bA="";/*!
4
4
  * Cropper.js v1.6.1
5
5
  * https://fengyuanchen.github.io/cropperjs
6
6
  *
@@ -8,8 +8,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
8
8
  * Released under the MIT license
9
9
  *
10
10
  * Date: 2023-09-17T03:44:19.860Z
11
- */function zd(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Hd(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?zd(Object(t),!0).forEach(function(r){Zb(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):zd(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Cs(n){"@babel/helpers - typeof";return Cs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cs(n)}function Jb(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Yd(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,jd(r.key),r)}}function Xb(n,e,t){return e&&Yd(n.prototype,e),t&&Yd(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function Zb(n,e,t){return e=jd(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ud(n){return ew(n)||tw(n)||nw(n)||rw()}function ew(n){if(Array.isArray(n))return Ms(n)}function tw(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function nw(n,e){if(n){if(typeof n=="string")return Ms(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Ms(n,e)}}function Ms(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function rw(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
12
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iw(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function jd(n){var e=iw(n,"string");return typeof e=="symbol"?e:String(e)}var Vo=typeof window<"u"&&typeof window.document<"u",dn=Vo?window:{},Ts=Vo&&dn.document.documentElement?"ontouchstart"in dn.document.documentElement:!1,Ss=Vo?"PointerEvent"in dn:!1,Ie="cropper",Ds="all",Wd="crop",qd="move",Kd="zoom",mr="e",gr="w",qr="s",Fn="n",Li="ne",$i="nw",Fi="se",zi="sw",As="".concat(Ie,"-crop"),Gd="".concat(Ie,"-disabled"),kt="".concat(Ie,"-hidden"),Qd="".concat(Ie,"-hide"),ow="".concat(Ie,"-invisible"),Lo="".concat(Ie,"-modal"),Es="".concat(Ie,"-move"),Hi="".concat(Ie,"Action"),$o="".concat(Ie,"Preview"),Os="crop",Jd="move",Xd="none",Ns="crop",_s="cropend",Bs="cropmove",Ps="cropstart",Zd="dblclick",aw=Ts?"touchstart":"mousedown",sw=Ts?"touchmove":"mousemove",lw=Ts?"touchend touchcancel":"mouseup",eu=Ss?"pointerdown":aw,tu=Ss?"pointermove":sw,nu=Ss?"pointerup pointercancel":lw,ru="ready",iu="resize",ou="wheel",Is="zoom",au="image/jpeg",cw=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,dw=/^data:/,uw=/^data:image\/jpeg;base64,/,fw=/^img|canvas$/i,su=200,lu=100,cu={viewMode:0,dragMode:Os,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:su,minContainerHeight:lu,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},pw='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',hw=Number.isNaN||dn.isNaN;function be(n){return typeof n=="number"&&!hw(n)}var du=function(e){return e>0&&e<1/0};function Rs(n){return typeof n>"u"}function yr(n){return Cs(n)==="object"&&n!==null}var mw=Object.prototype.hasOwnProperty;function Kr(n){if(!yr(n))return!1;try{var e=n.constructor,t=e.prototype;return e&&t&&mw.call(t,"isPrototypeOf")}catch{return!1}}function xt(n){return typeof n=="function"}var gw=Array.prototype.slice;function uu(n){return Array.from?Array.from(n):gw.call(n)}function Ue(n,e){return n&&xt(e)&&(Array.isArray(n)||be(n.length)?uu(n).forEach(function(t,r){e.call(n,t,r,n)}):yr(n)&&Object.keys(n).forEach(function(t){e.call(n,n[t],t,n)})),n}var Re=Object.assign||function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return yr(e)&&r.length>0&&r.forEach(function(o){yr(o)&&Object.keys(o).forEach(function(a){e[a]=o[a]})}),e},yw=/\.\d*(?:0|9){12}\d*$/;function Gr(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return yw.test(n)?Math.round(n*e)/e:n}var vw=/^width|height|left|top|marginLeft|marginTop$/;function zn(n,e){var t=n.style;Ue(e,function(r,i){vw.test(i)&&be(r)&&(r="".concat(r,"px")),t[i]=r})}function bw(n,e){return n.classList?n.classList.contains(e):n.className.indexOf(e)>-1}function Xe(n,e){if(e){if(be(n.length)){Ue(n,function(r){Xe(r,e)});return}if(n.classList){n.classList.add(e);return}var t=n.className.trim();t?t.indexOf(e)<0&&(n.className="".concat(t," ").concat(e)):n.className=e}}function un(n,e){if(e){if(be(n.length)){Ue(n,function(t){un(t,e)});return}if(n.classList){n.classList.remove(e);return}n.className.indexOf(e)>=0&&(n.className=n.className.replace(e,""))}}function Qr(n,e,t){if(e){if(be(n.length)){Ue(n,function(r){Qr(r,e,t)});return}t?Xe(n,e):un(n,e)}}var ww=/([a-z\d])([A-Z])/g;function Vs(n){return n.replace(ww,"$1-$2").toLowerCase()}function Ls(n,e){return yr(n[e])?n[e]:n.dataset?n.dataset[e]:n.getAttribute("data-".concat(Vs(e)))}function Yi(n,e,t){yr(t)?n[e]=t:n.dataset?n.dataset[e]=t:n.setAttribute("data-".concat(Vs(e)),t)}function kw(n,e){if(yr(n[e]))try{delete n[e]}catch{n[e]=void 0}else if(n.dataset)try{delete n.dataset[e]}catch{n.dataset[e]=void 0}else n.removeAttribute("data-".concat(Vs(e)))}var fu=/\s\s*/,pu=function(){var n=!1;if(Vo){var e=!1,t=function(){},r=Object.defineProperty({},"once",{get:function(){return n=!0,e},set:function(o){e=o}});dn.addEventListener("test",t,r),dn.removeEventListener("test",t,r)}return n}();function Qt(n,e,t){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=t;e.trim().split(fu).forEach(function(o){if(!pu){var a=n.listeners;a&&a[o]&&a[o][t]&&(i=a[o][t],delete a[o][t],Object.keys(a[o]).length===0&&delete a[o],Object.keys(a).length===0&&delete n.listeners)}n.removeEventListener(o,i,r)})}function Vt(n,e,t){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=t;e.trim().split(fu).forEach(function(o){if(r.once&&!pu){var a=n.listeners,s=a===void 0?{}:a;i=function(){delete s[o][t],n.removeEventListener(o,i,r);for(var d=arguments.length,u=new Array(d),f=0;f<d;f++)u[f]=arguments[f];t.apply(n,u)},s[o]||(s[o]={}),s[o][t]&&n.removeEventListener(o,s[o][t],r),s[o][t]=i,n.listeners=s}n.addEventListener(o,i,r)})}function Jr(n,e,t){var r;return xt(Event)&&xt(CustomEvent)?r=new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0}):(r=document.createEvent("CustomEvent"),r.initCustomEvent(e,!0,!0,t)),n.dispatchEvent(r)}function hu(n){var e=n.getBoundingClientRect();return{left:e.left+(window.pageXOffset-document.documentElement.clientLeft),top:e.top+(window.pageYOffset-document.documentElement.clientTop)}}var $s=dn.location,xw=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function mu(n){var e=n.match(xw);return e!==null&&(e[1]!==$s.protocol||e[2]!==$s.hostname||e[3]!==$s.port)}function gu(n){var e="timestamp=".concat(new Date().getTime());return n+(n.indexOf("?")===-1?"?":"&")+e}function Ui(n){var e=n.rotate,t=n.scaleX,r=n.scaleY,i=n.translateX,o=n.translateY,a=[];be(i)&&i!==0&&a.push("translateX(".concat(i,"px)")),be(o)&&o!==0&&a.push("translateY(".concat(o,"px)")),be(e)&&e!==0&&a.push("rotate(".concat(e,"deg)")),be(t)&&t!==1&&a.push("scaleX(".concat(t,")")),be(r)&&r!==1&&a.push("scaleY(".concat(r,")"));var s=a.length?a.join(" "):"none";return{WebkitTransform:s,msTransform:s,transform:s}}function Cw(n){var e=Hd({},n),t=0;return Ue(n,function(r,i){delete e[i],Ue(e,function(o){var a=Math.abs(r.startX-o.startX),s=Math.abs(r.startY-o.startY),c=Math.abs(r.endX-o.endX),d=Math.abs(r.endY-o.endY),u=Math.sqrt(a*a+s*s),f=Math.sqrt(c*c+d*d),p=(f-u)/u;Math.abs(p)>Math.abs(t)&&(t=p)})}),t}function Fo(n,e){var t=n.pageX,r=n.pageY,i={endX:t,endY:r};return e?i:Hd({startX:t,startY:r},i)}function Mw(n){var e=0,t=0,r=0;return Ue(n,function(i){var o=i.startX,a=i.startY;e+=o,t+=a,r+=1}),e/=r,t/=r,{pageX:e,pageY:t}}function Hn(n){var e=n.aspectRatio,t=n.height,r=n.width,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",o=du(r),a=du(t);if(o&&a){var s=t*e;i==="contain"&&s>r||i==="cover"&&s<r?t=r/e:r=t*e}else o?t=r/e:a&&(r=t*e);return{width:r,height:t}}function Tw(n){var e=n.width,t=n.height,r=n.degree;if(r=Math.abs(r)%180,r===90)return{width:t,height:e};var i=r%90*Math.PI/180,o=Math.sin(i),a=Math.cos(i),s=e*a+t*o,c=e*o+t*a;return r>90?{width:c,height:s}:{width:s,height:c}}function Sw(n,e,t,r){var i=e.aspectRatio,o=e.naturalWidth,a=e.naturalHeight,s=e.rotate,c=s===void 0?0:s,d=e.scaleX,u=d===void 0?1:d,f=e.scaleY,p=f===void 0?1:f,h=t.aspectRatio,m=t.naturalWidth,g=t.naturalHeight,k=r.fillColor,x=k===void 0?"transparent":k,S=r.imageSmoothingEnabled,T=S===void 0?!0:S,y=r.imageSmoothingQuality,B=y===void 0?"low":y,w=r.maxWidth,V=w===void 0?1/0:w,$=r.maxHeight,M=$===void 0?1/0:$,_=r.minWidth,z=_===void 0?0:_,N=r.minHeight,W=N===void 0?0:N,F=document.createElement("canvas"),O=F.getContext("2d"),I=Hn({aspectRatio:h,width:V,height:M}),H=Hn({aspectRatio:h,width:z,height:W},"cover"),b=Math.min(I.width,Math.max(H.width,m)),C=Math.min(I.height,Math.max(H.height,g)),v=Hn({aspectRatio:i,width:V,height:M}),A=Hn({aspectRatio:i,width:z,height:W},"cover"),E=Math.min(v.width,Math.max(A.width,o)),P=Math.min(v.height,Math.max(A.height,a)),q=[-E/2,-P/2,E,P];return F.width=Gr(b),F.height=Gr(C),O.fillStyle=x,O.fillRect(0,0,b,C),O.save(),O.translate(b/2,C/2),O.rotate(c*Math.PI/180),O.scale(u,p),O.imageSmoothingEnabled=T,O.imageSmoothingQuality=B,O.drawImage.apply(O,[n].concat(Ud(q.map(function(D){return Math.floor(Gr(D))})))),O.restore(),F}var yu=String.fromCharCode;function Dw(n,e,t){var r="";t+=e;for(var i=e;i<t;i+=1)r+=yu(n.getUint8(i));return r}var Aw=/^data:.*,/;function Ew(n){var e=n.replace(Aw,""),t=atob(e),r=new ArrayBuffer(t.length),i=new Uint8Array(r);return Ue(i,function(o,a){i[a]=t.charCodeAt(a)}),r}function Ow(n,e){for(var t=[],r=8192,i=new Uint8Array(n);i.length>0;)t.push(yu.apply(null,uu(i.subarray(0,r)))),i=i.subarray(r);return"data:".concat(e,";base64,").concat(btoa(t.join("")))}function Nw(n){var e=new DataView(n),t;try{var r,i,o;if(e.getUint8(0)===255&&e.getUint8(1)===216)for(var a=e.byteLength,s=2;s+1<a;){if(e.getUint8(s)===255&&e.getUint8(s+1)===225){i=s;break}s+=1}if(i){var c=i+4,d=i+10;if(Dw(e,c,4)==="Exif"){var u=e.getUint16(d);if(r=u===18761,(r||u===19789)&&e.getUint16(d+2,r)===42){var f=e.getUint32(d+4,r);f>=8&&(o=d+f)}}}if(o){var p=e.getUint16(o,r),h,m;for(m=0;m<p;m+=1)if(h=o+m*12+2,e.getUint16(h,r)===274){h+=8,t=e.getUint16(h,r),e.setUint16(h,1,r);break}}}catch{t=1}return t}function _w(n){var e=0,t=1,r=1;switch(n){case 2:t=-1;break;case 3:e=-180;break;case 4:r=-1;break;case 5:e=90,r=-1;break;case 6:e=90;break;case 7:e=90,t=-1;break;case 8:e=-90;break}return{rotate:e,scaleX:t,scaleY:r}}var Bw={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var e=this.element,t=this.options,r=this.container,i=this.cropper,o=Number(t.minContainerWidth),a=Number(t.minContainerHeight);Xe(i,kt),un(e,kt);var s={width:Math.max(r.offsetWidth,o>=0?o:su),height:Math.max(r.offsetHeight,a>=0?a:lu)};this.containerData=s,zn(i,{width:s.width,height:s.height}),Xe(e,kt),un(i,kt)},initCanvas:function(){var e=this.containerData,t=this.imageData,r=this.options.viewMode,i=Math.abs(t.rotate)%180===90,o=i?t.naturalHeight:t.naturalWidth,a=i?t.naturalWidth:t.naturalHeight,s=o/a,c=e.width,d=e.height;e.height*s>e.width?r===3?c=e.height*s:d=e.width/s:r===3?d=e.width/s:c=e.height*s;var u={aspectRatio:s,naturalWidth:o,naturalHeight:a,width:c,height:d};this.canvasData=u,this.limited=r===1||r===2,this.limitCanvas(!0,!0),u.width=Math.min(Math.max(u.width,u.minWidth),u.maxWidth),u.height=Math.min(Math.max(u.height,u.minHeight),u.maxHeight),u.left=(e.width-u.width)/2,u.top=(e.height-u.height)/2,u.oldLeft=u.left,u.oldTop=u.top,this.initialCanvasData=Re({},u)},limitCanvas:function(e,t){var r=this.options,i=this.containerData,o=this.canvasData,a=this.cropBoxData,s=r.viewMode,c=o.aspectRatio,d=this.cropped&&a;if(e){var u=Number(r.minCanvasWidth)||0,f=Number(r.minCanvasHeight)||0;s>1?(u=Math.max(u,i.width),f=Math.max(f,i.height),s===3&&(f*c>u?u=f*c:f=u/c)):s>0&&(u?u=Math.max(u,d?a.width:0):f?f=Math.max(f,d?a.height:0):d&&(u=a.width,f=a.height,f*c>u?u=f*c:f=u/c));var p=Hn({aspectRatio:c,width:u,height:f});u=p.width,f=p.height,o.minWidth=u,o.minHeight=f,o.maxWidth=1/0,o.maxHeight=1/0}if(t)if(s>(d?0:1)){var h=i.width-o.width,m=i.height-o.height;o.minLeft=Math.min(0,h),o.minTop=Math.min(0,m),o.maxLeft=Math.max(0,h),o.maxTop=Math.max(0,m),d&&this.limited&&(o.minLeft=Math.min(a.left,a.left+(a.width-o.width)),o.minTop=Math.min(a.top,a.top+(a.height-o.height)),o.maxLeft=a.left,o.maxTop=a.top,s===2&&(o.width>=i.width&&(o.minLeft=Math.min(0,h),o.maxLeft=Math.max(0,h)),o.height>=i.height&&(o.minTop=Math.min(0,m),o.maxTop=Math.max(0,m))))}else o.minLeft=-o.width,o.minTop=-o.height,o.maxLeft=i.width,o.maxTop=i.height},renderCanvas:function(e,t){var r=this.canvasData,i=this.imageData;if(t){var o=Tw({width:i.naturalWidth*Math.abs(i.scaleX||1),height:i.naturalHeight*Math.abs(i.scaleY||1),degree:i.rotate||0}),a=o.width,s=o.height,c=r.width*(a/r.naturalWidth),d=r.height*(s/r.naturalHeight);r.left-=(c-r.width)/2,r.top-=(d-r.height)/2,r.width=c,r.height=d,r.aspectRatio=a/s,r.naturalWidth=a,r.naturalHeight=s,this.limitCanvas(!0,!1)}(r.width>r.maxWidth||r.width<r.minWidth)&&(r.left=r.oldLeft),(r.height>r.maxHeight||r.height<r.minHeight)&&(r.top=r.oldTop),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),this.limitCanvas(!1,!0),r.left=Math.min(Math.max(r.left,r.minLeft),r.maxLeft),r.top=Math.min(Math.max(r.top,r.minTop),r.maxTop),r.oldLeft=r.left,r.oldTop=r.top,zn(this.canvas,Re({width:r.width,height:r.height},Ui({translateX:r.left,translateY:r.top}))),this.renderImage(e),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(e){var t=this.canvasData,r=this.imageData,i=r.naturalWidth*(t.width/t.naturalWidth),o=r.naturalHeight*(t.height/t.naturalHeight);Re(r,{width:i,height:o,left:(t.width-i)/2,top:(t.height-o)/2}),zn(this.image,Re({width:r.width,height:r.height},Ui(Re({translateX:r.left,translateY:r.top},r)))),e&&this.output()},initCropBox:function(){var e=this.options,t=this.canvasData,r=e.aspectRatio||e.initialAspectRatio,i=Number(e.autoCropArea)||.8,o={width:t.width,height:t.height};r&&(t.height*r>t.width?o.height=o.width/r:o.width=o.height*r),this.cropBoxData=o,this.limitCropBox(!0,!0),o.width=Math.min(Math.max(o.width,o.minWidth),o.maxWidth),o.height=Math.min(Math.max(o.height,o.minHeight),o.maxHeight),o.width=Math.max(o.minWidth,o.width*i),o.height=Math.max(o.minHeight,o.height*i),o.left=t.left+(t.width-o.width)/2,o.top=t.top+(t.height-o.height)/2,o.oldLeft=o.left,o.oldTop=o.top,this.initialCropBoxData=Re({},o)},limitCropBox:function(e,t){var r=this.options,i=this.containerData,o=this.canvasData,a=this.cropBoxData,s=this.limited,c=r.aspectRatio;if(e){var d=Number(r.minCropBoxWidth)||0,u=Number(r.minCropBoxHeight)||0,f=s?Math.min(i.width,o.width,o.width+o.left,i.width-o.left):i.width,p=s?Math.min(i.height,o.height,o.height+o.top,i.height-o.top):i.height;d=Math.min(d,i.width),u=Math.min(u,i.height),c&&(d&&u?u*c>d?u=d/c:d=u*c:d?u=d/c:u&&(d=u*c),p*c>f?p=f/c:f=p*c),a.minWidth=Math.min(d,f),a.minHeight=Math.min(u,p),a.maxWidth=f,a.maxHeight=p}t&&(s?(a.minLeft=Math.max(0,o.left),a.minTop=Math.max(0,o.top),a.maxLeft=Math.min(i.width,o.left+o.width)-a.width,a.maxTop=Math.min(i.height,o.top+o.height)-a.height):(a.minLeft=0,a.minTop=0,a.maxLeft=i.width-a.width,a.maxTop=i.height-a.height))},renderCropBox:function(){var e=this.options,t=this.containerData,r=this.cropBoxData;(r.width>r.maxWidth||r.width<r.minWidth)&&(r.left=r.oldLeft),(r.height>r.maxHeight||r.height<r.minHeight)&&(r.top=r.oldTop),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),this.limitCropBox(!1,!0),r.left=Math.min(Math.max(r.left,r.minLeft),r.maxLeft),r.top=Math.min(Math.max(r.top,r.minTop),r.maxTop),r.oldLeft=r.left,r.oldTop=r.top,e.movable&&e.cropBoxMovable&&Yi(this.face,Hi,r.width>=t.width&&r.height>=t.height?qd:Ds),zn(this.cropBox,Re({width:r.width,height:r.height},Ui({translateX:r.left,translateY:r.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Jr(this.element,Ns,this.getData())}},Pw={initPreview:function(){var e=this.element,t=this.crossOrigin,r=this.options.preview,i=t?this.crossOriginUrl:this.url,o=e.alt||"The image to preview",a=document.createElement("img");if(t&&(a.crossOrigin=t),a.src=i,a.alt=o,this.viewBox.appendChild(a),this.viewBoxImage=a,!!r){var s=r;typeof r=="string"?s=e.ownerDocument.querySelectorAll(r):r.querySelector&&(s=[r]),this.previews=s,Ue(s,function(c){var d=document.createElement("img");Yi(c,$o,{width:c.offsetWidth,height:c.offsetHeight,html:c.innerHTML}),t&&(d.crossOrigin=t),d.src=i,d.alt=o,d.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',c.innerHTML="",c.appendChild(d)})}},resetPreview:function(){Ue(this.previews,function(e){var t=Ls(e,$o);zn(e,{width:t.width,height:t.height}),e.innerHTML=t.html,kw(e,$o)})},preview:function(){var e=this.imageData,t=this.canvasData,r=this.cropBoxData,i=r.width,o=r.height,a=e.width,s=e.height,c=r.left-t.left-e.left,d=r.top-t.top-e.top;!this.cropped||this.disabled||(zn(this.viewBoxImage,Re({width:a,height:s},Ui(Re({translateX:-c,translateY:-d},e)))),Ue(this.previews,function(u){var f=Ls(u,$o),p=f.width,h=f.height,m=p,g=h,k=1;i&&(k=p/i,g=o*k),o&&g>h&&(k=h/o,m=i*k,g=h),zn(u,{width:m,height:g}),zn(u.getElementsByTagName("img")[0],Re({width:a*k,height:s*k},Ui(Re({translateX:-c*k,translateY:-d*k},e))))}))}},Iw={bind:function(){var e=this.element,t=this.options,r=this.cropper;xt(t.cropstart)&&Vt(e,Ps,t.cropstart),xt(t.cropmove)&&Vt(e,Bs,t.cropmove),xt(t.cropend)&&Vt(e,_s,t.cropend),xt(t.crop)&&Vt(e,Ns,t.crop),xt(t.zoom)&&Vt(e,Is,t.zoom),Vt(r,eu,this.onCropStart=this.cropStart.bind(this)),t.zoomable&&t.zoomOnWheel&&Vt(r,ou,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&Vt(r,Zd,this.onDblclick=this.dblclick.bind(this)),Vt(e.ownerDocument,tu,this.onCropMove=this.cropMove.bind(this)),Vt(e.ownerDocument,nu,this.onCropEnd=this.cropEnd.bind(this)),t.responsive&&Vt(window,iu,this.onResize=this.resize.bind(this))},unbind:function(){var e=this.element,t=this.options,r=this.cropper;xt(t.cropstart)&&Qt(e,Ps,t.cropstart),xt(t.cropmove)&&Qt(e,Bs,t.cropmove),xt(t.cropend)&&Qt(e,_s,t.cropend),xt(t.crop)&&Qt(e,Ns,t.crop),xt(t.zoom)&&Qt(e,Is,t.zoom),Qt(r,eu,this.onCropStart),t.zoomable&&t.zoomOnWheel&&Qt(r,ou,this.onWheel,{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&Qt(r,Zd,this.onDblclick),Qt(e.ownerDocument,tu,this.onCropMove),Qt(e.ownerDocument,nu,this.onCropEnd),t.responsive&&Qt(window,iu,this.onResize)}},Rw={resize:function(){if(!this.disabled){var e=this.options,t=this.container,r=this.containerData,i=t.offsetWidth/r.width,o=t.offsetHeight/r.height,a=Math.abs(i-1)>Math.abs(o-1)?i:o;if(a!==1){var s,c;e.restore&&(s=this.getCanvasData(),c=this.getCropBoxData()),this.render(),e.restore&&(this.setCanvasData(Ue(s,function(d,u){s[u]=d*a})),this.setCropBoxData(Ue(c,function(d,u){c[u]=d*a})))}}},dblclick:function(){this.disabled||this.options.dragMode===Xd||this.setDragMode(bw(this.dragBox,As)?Jd:Os)},wheel:function(e){var t=this,r=Number(this.options.wheelZoomRatio)||.1,i=1;this.disabled||(e.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){t.wheeling=!1},50),e.deltaY?i=e.deltaY>0?1:-1:e.wheelDelta?i=-e.wheelDelta/120:e.detail&&(i=e.detail>0?1:-1),this.zoom(-i*r,e)))},cropStart:function(e){var t=e.buttons,r=e.button;if(!(this.disabled||(e.type==="mousedown"||e.type==="pointerdown"&&e.pointerType==="mouse")&&(be(t)&&t!==1||be(r)&&r!==0||e.ctrlKey))){var i=this.options,o=this.pointers,a;e.changedTouches?Ue(e.changedTouches,function(s){o[s.identifier]=Fo(s)}):o[e.pointerId||0]=Fo(e),Object.keys(o).length>1&&i.zoomable&&i.zoomOnTouch?a=Kd:a=Ls(e.target,Hi),cw.test(a)&&Jr(this.element,Ps,{originalEvent:e,action:a})!==!1&&(e.preventDefault(),this.action=a,this.cropping=!1,a===Wd&&(this.cropping=!0,Xe(this.dragBox,Lo)))}},cropMove:function(e){var t=this.action;if(!(this.disabled||!t)){var r=this.pointers;e.preventDefault(),Jr(this.element,Bs,{originalEvent:e,action:t})!==!1&&(e.changedTouches?Ue(e.changedTouches,function(i){Re(r[i.identifier]||{},Fo(i,!0))}):Re(r[e.pointerId||0]||{},Fo(e,!0)),this.change(e))}},cropEnd:function(e){if(!this.disabled){var t=this.action,r=this.pointers;e.changedTouches?Ue(e.changedTouches,function(i){delete r[i.identifier]}):delete r[e.pointerId||0],t&&(e.preventDefault(),Object.keys(r).length||(this.action=""),this.cropping&&(this.cropping=!1,Qr(this.dragBox,Lo,this.cropped&&this.options.modal)),Jr(this.element,_s,{originalEvent:e,action:t}))}}},Vw={change:function(e){var t=this.options,r=this.canvasData,i=this.containerData,o=this.cropBoxData,a=this.pointers,s=this.action,c=t.aspectRatio,d=o.left,u=o.top,f=o.width,p=o.height,h=d+f,m=u+p,g=0,k=0,x=i.width,S=i.height,T=!0,y;!c&&e.shiftKey&&(c=f&&p?f/p:1),this.limited&&(g=o.minLeft,k=o.minTop,x=g+Math.min(i.width,r.width,r.left+r.width),S=k+Math.min(i.height,r.height,r.top+r.height));var B=a[Object.keys(a)[0]],w={x:B.endX-B.startX,y:B.endY-B.startY},V=function(M){switch(M){case mr:h+w.x>x&&(w.x=x-h);break;case gr:d+w.x<g&&(w.x=g-d);break;case Fn:u+w.y<k&&(w.y=k-u);break;case qr:m+w.y>S&&(w.y=S-m);break}};switch(s){case Ds:d+=w.x,u+=w.y;break;case mr:if(w.x>=0&&(h>=x||c&&(u<=k||m>=S))){T=!1;break}V(mr),f+=w.x,f<0&&(s=gr,f=-f,d-=f),c&&(p=f/c,u+=(o.height-p)/2);break;case Fn:if(w.y<=0&&(u<=k||c&&(d<=g||h>=x))){T=!1;break}V(Fn),p-=w.y,u+=w.y,p<0&&(s=qr,p=-p,u-=p),c&&(f=p*c,d+=(o.width-f)/2);break;case gr:if(w.x<=0&&(d<=g||c&&(u<=k||m>=S))){T=!1;break}V(gr),f-=w.x,d+=w.x,f<0&&(s=mr,f=-f,d-=f),c&&(p=f/c,u+=(o.height-p)/2);break;case qr:if(w.y>=0&&(m>=S||c&&(d<=g||h>=x))){T=!1;break}V(qr),p+=w.y,p<0&&(s=Fn,p=-p,u-=p),c&&(f=p*c,d+=(o.width-f)/2);break;case Li:if(c){if(w.y<=0&&(u<=k||h>=x)){T=!1;break}V(Fn),p-=w.y,u+=w.y,f=p*c}else V(Fn),V(mr),w.x>=0?h<x?f+=w.x:w.y<=0&&u<=k&&(T=!1):f+=w.x,w.y<=0?u>k&&(p-=w.y,u+=w.y):(p-=w.y,u+=w.y);f<0&&p<0?(s=zi,p=-p,f=-f,u-=p,d-=f):f<0?(s=$i,f=-f,d-=f):p<0&&(s=Fi,p=-p,u-=p);break;case $i:if(c){if(w.y<=0&&(u<=k||d<=g)){T=!1;break}V(Fn),p-=w.y,u+=w.y,f=p*c,d+=o.width-f}else V(Fn),V(gr),w.x<=0?d>g?(f-=w.x,d+=w.x):w.y<=0&&u<=k&&(T=!1):(f-=w.x,d+=w.x),w.y<=0?u>k&&(p-=w.y,u+=w.y):(p-=w.y,u+=w.y);f<0&&p<0?(s=Fi,p=-p,f=-f,u-=p,d-=f):f<0?(s=Li,f=-f,d-=f):p<0&&(s=zi,p=-p,u-=p);break;case zi:if(c){if(w.x<=0&&(d<=g||m>=S)){T=!1;break}V(gr),f-=w.x,d+=w.x,p=f/c}else V(qr),V(gr),w.x<=0?d>g?(f-=w.x,d+=w.x):w.y>=0&&m>=S&&(T=!1):(f-=w.x,d+=w.x),w.y>=0?m<S&&(p+=w.y):p+=w.y;f<0&&p<0?(s=Li,p=-p,f=-f,u-=p,d-=f):f<0?(s=Fi,f=-f,d-=f):p<0&&(s=$i,p=-p,u-=p);break;case Fi:if(c){if(w.x>=0&&(h>=x||m>=S)){T=!1;break}V(mr),f+=w.x,p=f/c}else V(qr),V(mr),w.x>=0?h<x?f+=w.x:w.y>=0&&m>=S&&(T=!1):f+=w.x,w.y>=0?m<S&&(p+=w.y):p+=w.y;f<0&&p<0?(s=$i,p=-p,f=-f,u-=p,d-=f):f<0?(s=zi,f=-f,d-=f):p<0&&(s=Li,p=-p,u-=p);break;case qd:this.move(w.x,w.y),T=!1;break;case Kd:this.zoom(Cw(a),e),T=!1;break;case Wd:if(!w.x||!w.y){T=!1;break}y=hu(this.cropper),d=B.startX-y.left,u=B.startY-y.top,f=o.minWidth,p=o.minHeight,w.x>0?s=w.y>0?Fi:Li:w.x<0&&(d-=f,s=w.y>0?zi:$i),w.y<0&&(u-=p),this.cropped||(un(this.cropBox,kt),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}T&&(o.width=f,o.height=p,o.left=d,o.top=u,this.action=s,this.renderCropBox()),Ue(a,function($){$.startX=$.endX,$.startY=$.endY})}},Lw={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&Xe(this.dragBox,Lo),un(this.cropBox,kt),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=Re({},this.initialImageData),this.canvasData=Re({},this.initialCanvasData),this.cropBoxData=Re({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(Re(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),un(this.dragBox,Lo),Xe(this.cropBox,kt)),this},replace:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&e&&(this.isImg&&(this.element.src=e),t?(this.url=e,this.image.src=e,this.ready&&(this.viewBoxImage.src=e,Ue(this.previews,function(r){r.getElementsByTagName("img")[0].src=e}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(e))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,un(this.cropper,Gd)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,Xe(this.cropper,Gd)),this},destroy:function(){var e=this.element;return e[Ie]?(e[Ie]=void 0,this.isImg&&this.replaced&&(e.src=this.originalUrl),this.uncreate(),this):this},move:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=this.canvasData,i=r.left,o=r.top;return this.moveTo(Rs(e)?e:i+Number(e),Rs(t)?t:o+Number(t))},moveTo:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=this.canvasData,i=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.movable&&(be(e)&&(r.left=e,i=!0),be(t)&&(r.top=t,i=!0),i&&this.renderCanvas(!0)),this},zoom:function(e,t){var r=this.canvasData;return e=Number(e),e<0?e=1/(1-e):e=1+e,this.zoomTo(r.width*e/r.naturalWidth,null,t)},zoomTo:function(e,t,r){var i=this.options,o=this.canvasData,a=o.width,s=o.height,c=o.naturalWidth,d=o.naturalHeight;if(e=Number(e),e>=0&&this.ready&&!this.disabled&&i.zoomable){var u=c*e,f=d*e;if(Jr(this.element,Is,{ratio:e,oldRatio:a/c,originalEvent:r})===!1)return this;if(r){var p=this.pointers,h=hu(this.cropper),m=p&&Object.keys(p).length?Mw(p):{pageX:r.pageX,pageY:r.pageY};o.left-=(u-a)*((m.pageX-h.left-o.left)/a),o.top-=(f-s)*((m.pageY-h.top-o.top)/s)}else Kr(t)&&be(t.x)&&be(t.y)?(o.left-=(u-a)*((t.x-o.left)/a),o.top-=(f-s)*((t.y-o.top)/s)):(o.left-=(u-a)/2,o.top-=(f-s)/2);o.width=u,o.height=f,this.renderCanvas(!0)}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e))},rotateTo:function(e){return e=Number(e),be(e)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=e%360,this.renderCanvas(!0,!0)),this},scaleX:function(e){var t=this.imageData.scaleY;return this.scale(e,be(t)?t:1)},scaleY:function(e){var t=this.imageData.scaleX;return this.scale(be(t)?t:1,e)},scale:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=this.imageData,i=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.scalable&&(be(e)&&(r.scaleX=e,i=!0),be(t)&&(r.scaleY=t,i=!0),i&&this.renderCanvas(!0,!0)),this},getData:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.options,r=this.imageData,i=this.canvasData,o=this.cropBoxData,a;if(this.ready&&this.cropped){a={x:o.left-i.left,y:o.top-i.top,width:o.width,height:o.height};var s=r.width/r.naturalWidth;if(Ue(a,function(u,f){a[f]=u/s}),e){var c=Math.round(a.y+a.height),d=Math.round(a.x+a.width);a.x=Math.round(a.x),a.y=Math.round(a.y),a.width=d-a.x,a.height=c-a.y}}else a={x:0,y:0,width:0,height:0};return t.rotatable&&(a.rotate=r.rotate||0),t.scalable&&(a.scaleX=r.scaleX||1,a.scaleY=r.scaleY||1),a},setData:function(e){var t=this.options,r=this.imageData,i=this.canvasData,o={};if(this.ready&&!this.disabled&&Kr(e)){var a=!1;t.rotatable&&be(e.rotate)&&e.rotate!==r.rotate&&(r.rotate=e.rotate,a=!0),t.scalable&&(be(e.scaleX)&&e.scaleX!==r.scaleX&&(r.scaleX=e.scaleX,a=!0),be(e.scaleY)&&e.scaleY!==r.scaleY&&(r.scaleY=e.scaleY,a=!0)),a&&this.renderCanvas(!0,!0);var s=r.width/r.naturalWidth;be(e.x)&&(o.left=e.x*s+i.left),be(e.y)&&(o.top=e.y*s+i.top),be(e.width)&&(o.width=e.width*s),be(e.height)&&(o.height=e.height*s),this.setCropBoxData(o)}return this},getContainerData:function(){return this.ready?Re({},this.containerData):{}},getImageData:function(){return this.sized?Re({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,t={};return this.ready&&Ue(["left","top","width","height","naturalWidth","naturalHeight"],function(r){t[r]=e[r]}),t},setCanvasData:function(e){var t=this.canvasData,r=t.aspectRatio;return this.ready&&!this.disabled&&Kr(e)&&(be(e.left)&&(t.left=e.left),be(e.top)&&(t.top=e.top),be(e.width)?(t.width=e.width,t.height=e.width/r):be(e.height)&&(t.height=e.height,t.width=e.height*r),this.renderCanvas(!0)),this},getCropBoxData:function(){var e=this.cropBoxData,t;return this.ready&&this.cropped&&(t={left:e.left,top:e.top,width:e.width,height:e.height}),t||{}},setCropBoxData:function(e){var t=this.cropBoxData,r=this.options.aspectRatio,i,o;return this.ready&&this.cropped&&!this.disabled&&Kr(e)&&(be(e.left)&&(t.left=e.left),be(e.top)&&(t.top=e.top),be(e.width)&&e.width!==t.width&&(i=!0,t.width=e.width),be(e.height)&&e.height!==t.height&&(o=!0,t.height=e.height),r&&(i?t.height=t.width/r:o&&(t.width=t.height*r)),this.renderCropBox()),this},getCroppedCanvas:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var t=this.canvasData,r=Sw(this.image,this.imageData,t,e);if(!this.cropped)return r;var i=this.getData(e.rounded),o=i.x,a=i.y,s=i.width,c=i.height,d=r.width/Math.floor(t.naturalWidth);d!==1&&(o*=d,a*=d,s*=d,c*=d);var u=s/c,f=Hn({aspectRatio:u,width:e.maxWidth||1/0,height:e.maxHeight||1/0}),p=Hn({aspectRatio:u,width:e.minWidth||0,height:e.minHeight||0},"cover"),h=Hn({aspectRatio:u,width:e.width||(d!==1?r.width:s),height:e.height||(d!==1?r.height:c)}),m=h.width,g=h.height;m=Math.min(f.width,Math.max(p.width,m)),g=Math.min(f.height,Math.max(p.height,g));var k=document.createElement("canvas"),x=k.getContext("2d");k.width=Gr(m),k.height=Gr(g),x.fillStyle=e.fillColor||"transparent",x.fillRect(0,0,m,g);var S=e.imageSmoothingEnabled,T=S===void 0?!0:S,y=e.imageSmoothingQuality;x.imageSmoothingEnabled=T,y&&(x.imageSmoothingQuality=y);var B=r.width,w=r.height,V=o,$=a,M,_,z,N,W,F;V<=-s||V>B?(V=0,M=0,z=0,W=0):V<=0?(z=-V,V=0,M=Math.min(B,s+V),W=M):V<=B&&(z=0,M=Math.min(s,B-V),W=M),M<=0||$<=-c||$>w?($=0,_=0,N=0,F=0):$<=0?(N=-$,$=0,_=Math.min(w,c+$),F=_):$<=w&&(N=0,_=Math.min(c,w-$),F=_);var O=[V,$,M,_];if(W>0&&F>0){var I=m/s;O.push(z*I,N*I,W*I,F*I)}return x.drawImage.apply(x,[r].concat(Ud(O.map(function(H){return Math.floor(Gr(H))})))),k},setAspectRatio:function(e){var t=this.options;return!this.disabled&&!Rs(e)&&(t.aspectRatio=Math.max(0,e)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(e){var t=this.options,r=this.dragBox,i=this.face;if(this.ready&&!this.disabled){var o=e===Os,a=t.movable&&e===Jd;e=o||a?e:Xd,t.dragMode=e,Yi(r,Hi,e),Qr(r,As,o),Qr(r,Es,a),t.cropBoxMovable||(Yi(i,Hi,e),Qr(i,As,o),Qr(i,Es,a))}return this}},$w=dn.Cropper,vu=function(){function n(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Jb(this,n),!e||!fw.test(e.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=e,this.options=Re({},cu,Kr(t)&&t),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return Xb(n,[{key:"init",value:function(){var t=this.element,r=t.tagName.toLowerCase(),i;if(!t[Ie]){if(t[Ie]=this,r==="img"){if(this.isImg=!0,i=t.getAttribute("src")||"",this.originalUrl=i,!i)return;i=t.src}else r==="canvas"&&window.HTMLCanvasElement&&(i=t.toDataURL());this.load(i)}}},{key:"load",value:function(t){var r=this;if(t){this.url=t,this.imageData={};var i=this.element,o=this.options;if(!o.rotatable&&!o.scalable&&(o.checkOrientation=!1),!o.checkOrientation||!window.ArrayBuffer){this.clone();return}if(dw.test(t)){uw.test(t)?this.read(Ew(t)):this.clone();return}var a=new XMLHttpRequest,s=this.clone.bind(this);this.reloading=!0,this.xhr=a,a.onabort=s,a.onerror=s,a.ontimeout=s,a.onprogress=function(){a.getResponseHeader("content-type")!==au&&a.abort()},a.onload=function(){r.read(a.response)},a.onloadend=function(){r.reloading=!1,r.xhr=null},o.checkCrossOrigin&&mu(t)&&i.crossOrigin&&(t=gu(t)),a.open("GET",t,!0),a.responseType="arraybuffer",a.withCredentials=i.crossOrigin==="use-credentials",a.send()}}},{key:"read",value:function(t){var r=this.options,i=this.imageData,o=Nw(t),a=0,s=1,c=1;if(o>1){this.url=Ow(t,au);var d=_w(o);a=d.rotate,s=d.scaleX,c=d.scaleY}r.rotatable&&(i.rotate=a),r.scalable&&(i.scaleX=s,i.scaleY=c),this.clone()}},{key:"clone",value:function(){var t=this.element,r=this.url,i=t.crossOrigin,o=r;this.options.checkCrossOrigin&&mu(r)&&(i||(i="anonymous"),o=gu(r)),this.crossOrigin=i,this.crossOriginUrl=o;var a=document.createElement("img");i&&(a.crossOrigin=i),a.src=o||r,a.alt=t.alt||"The image to crop",this.image=a,a.onload=this.start.bind(this),a.onerror=this.stop.bind(this),Xe(a,Qd),t.parentNode.insertBefore(a,t.nextSibling)}},{key:"start",value:function(){var t=this,r=this.image;r.onload=null,r.onerror=null,this.sizing=!0;var i=dn.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(dn.navigator.userAgent),o=function(d,u){Re(t.imageData,{naturalWidth:d,naturalHeight:u,aspectRatio:d/u}),t.initialImageData=Re({},t.imageData),t.sizing=!1,t.sized=!0,t.build()};if(r.naturalWidth&&!i){o(r.naturalWidth,r.naturalHeight);return}var a=document.createElement("img"),s=document.body||document.documentElement;this.sizingImage=a,a.onload=function(){o(a.width,a.height),i||s.removeChild(a)},a.src=r.src,i||(a.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",s.appendChild(a))}},{key:"stop",value:function(){var t=this.image;t.onload=null,t.onerror=null,t.parentNode.removeChild(t),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var t=this.element,r=this.options,i=this.image,o=t.parentNode,a=document.createElement("div");a.innerHTML=pw;var s=a.querySelector(".".concat(Ie,"-container")),c=s.querySelector(".".concat(Ie,"-canvas")),d=s.querySelector(".".concat(Ie,"-drag-box")),u=s.querySelector(".".concat(Ie,"-crop-box")),f=u.querySelector(".".concat(Ie,"-face"));this.container=o,this.cropper=s,this.canvas=c,this.dragBox=d,this.cropBox=u,this.viewBox=s.querySelector(".".concat(Ie,"-view-box")),this.face=f,c.appendChild(i),Xe(t,kt),o.insertBefore(s,t.nextSibling),un(i,Qd),this.initPreview(),this.bind(),r.initialAspectRatio=Math.max(0,r.initialAspectRatio)||NaN,r.aspectRatio=Math.max(0,r.aspectRatio)||NaN,r.viewMode=Math.max(0,Math.min(3,Math.round(r.viewMode)))||0,Xe(u,kt),r.guides||Xe(u.getElementsByClassName("".concat(Ie,"-dashed")),kt),r.center||Xe(u.getElementsByClassName("".concat(Ie,"-center")),kt),r.background&&Xe(s,"".concat(Ie,"-bg")),r.highlight||Xe(f,ow),r.cropBoxMovable&&(Xe(f,Es),Yi(f,Hi,Ds)),r.cropBoxResizable||(Xe(u.getElementsByClassName("".concat(Ie,"-line")),kt),Xe(u.getElementsByClassName("".concat(Ie,"-point")),kt)),this.render(),this.ready=!0,this.setDragMode(r.dragMode),r.autoCrop&&this.crop(),this.setData(r.data),xt(r.ready)&&Vt(t,ru,r.ready,{once:!0}),Jr(t,ru)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var t=this.cropper.parentNode;t&&t.removeChild(this.cropper),un(this.element,kt)}}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=$w,n}},{key:"setDefaults",value:function(t){Re(cu,Kr(t)&&t)}}]),n}();Re(vu.prototype,Bw,Pw,Iw,Rw,Vw,Lw);function zo(){this._types=Object.create(null),this._extensions=Object.create(null);for(let n=0;n<arguments.length;n++)this.define(arguments[n]);this.define=this.define.bind(this),this.getType=this.getType.bind(this),this.getExtension=this.getExtension.bind(this)}zo.prototype.define=function(n,e){for(let t in n){let r=n[t].map(function(i){return i.toLowerCase()});t=t.toLowerCase();for(let i=0;i<r.length;i++){const o=r[i];if(o[0]!=="*"){if(!e&&o in this._types)throw new Error('Attempt to change mapping for "'+o+'" extension from "'+this._types[o]+'" to "'+t+'". Pass `force=true` to allow this, otherwise remove "'+o+'" from the list of extensions for "'+t+'".');this._types[o]=t}}if(e||!this._extensions[t]){const i=r[0];this._extensions[t]=i[0]!=="*"?i:i.substr(1)}}},zo.prototype.getType=function(n){n=String(n);let e=n.replace(/^.*[/\\]/,"").toLowerCase(),t=e.replace(/^.*\./,"").toLowerCase(),r=e.length<n.length;return(t.length<e.length-1||!r)&&this._types[t]||null},zo.prototype.getExtension=function(n){return n=/^\s*([^;\s]*)/.test(n)&&RegExp.$1,n&&this._extensions[n.toLowerCase()]||null};var Fw=zo,zw={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["es","ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avif":["avif"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};let Hw=Fw;var Yw=new Hw(zw);const Uw=Vd(Yw);var Ho=l.defineComponent({name:"AvatarCropper",emits:["update:modelValue","submit","error","cancel","changed","uploading","completed","uploaded"],props:{modelValue:{type:Boolean,default:!1},file:{type:File},uploadHandler:{type:Function},uploadUrl:{type:String},requestOptions:{type:Object,default:function(){return{method:"POST"}}},uploadFileField:{type:String,default:"file"},uploadFileName:{type:[String,Function]},uploadFormData:{type:FormData,default:function(){return new FormData}},cropperOptions:{type:Object,default:function(){return{aspectRatio:1,autoCropArea:1,viewMode:1,movable:!1,zoomable:!1}}},outputOptions:{type:Object},outputMime:{type:String,default:null},outputQuality:{type:Number,default:.9},mimes:{type:String,default:"image/png, image/gif, image/jpeg, image/bmp, image/x-icon"},capture:{type:String},labels:{type:Object,default:function(){return{submit:"Ok",cancel:"Cancel"}}},inline:{type:Boolean,default:!1}},data:function(){return{cropper:void 0,dataUrl:void 0,fileName:void 0,mimeType:void 0}},computed:{cleanedMimes:function(){if(!this.mimes)throw new Error("vue-avatar-cropper: mimes prop cannot be empty");return this.mimes.trim().toLowerCase()}},watch:{modelValue:function(n){n&&(this.file?this.onFileChange(this.file):this.pickImage(),this.$emit("update:modelValue",!1))}},mounted:function(){this.$emit("update:modelValue",!1)},methods:{destroy:function(){this.cropper&&this.cropper.destroy(),this.$refs.input&&(this.$refs.input.value=""),this.dataUrl=void 0},submit:function(){this.$emit("submit"),this.uploadUrl?this.uploadImage():this.uploadHandler?this.uploadHandler(this.cropper):this.$emit("error",{type:"user",message:"No upload handler found"}),this.destroy()},cancel:function(){this.$emit("cancel"),this.destroy()},onImgElementError:function(){this.$emit("error",{type:"load",message:"File loading failed"}),this.destroy()},pickImage:function(){this.$refs.input&&this.$refs.input.click()},onFileChange:function(n){var e=this;if(this.cleanedMimes==="image/*"){if(n.type.split("/")[0]!=="image")return void this.$emit("error",{type:"user",message:"File type not correct"})}else if(this.cleanedMimes){var t=this.cleanedMimes.split(", ").find(function(i){return i===n.type});if(!t)return void this.$emit("error",{type:"user",message:"File type not correct"})}var r=new FileReader;r.onload=function(i){e.dataUrl=i.target.result},r.readAsDataURL(n),this.fileName=n.name||"unknown",this.mimeType=n.type,this.$emit("changed",{file:n,reader:r})},onFileInputChange:function(n){n.target.files&&n.target.files[0]&&this.onFileChange(n.target.files[0])},createCropper:function(){this.cropper=new vu(this.$refs.img,this.cropperOptions)},getFilename:function(n){var e=Uw.getExtension(n.type);if(!this.uploadFileName){var t=this.fileName,r=this.fileName.split(".");return r.length>1&&(t=r.slice(0,-1).join(".")),"".concat(t,".").concat(e)}return typeof this.uploadFileName=="string"?this.uploadFileName:typeof this.uploadFileName=="function"?this.uploadFileName({filename:this.fileName,mime:n.type,extension:e}):"unknown.".concat(e)},uploadImage:function(){var n=this;this.cropper.getCroppedCanvas(this.outputOptions).toBlob(function(){var e=qb(Fd.mark(function t(r){var i,o,a,s,c,d,u,f,p;return Fd.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:for(o in i=new FormData,n.uploadFormData.entries())a=Wb(o,2),s=a[0],c=a[1],i.append(s,c);return i.append(n.uploadFileField,r,n.getFilename(r)),d=Object.assign({body:i},n.requestOptions),u=new Request(n.uploadUrl,d),f=fetch(u),n.$emit("uploading",{form:i,request:u,response:f}),h.next=9,f;case 9:p=h.sent,n.$emit("completed",{form:i,request:u,response:p}),p.ok?n.$emit("uploaded",{form:i,request:u,response:p}):n.$emit("error",{type:"upload",message:"Image upload fail",context:{request:u,response:p}});case 12:case"end":return h.stop()}},t)}));return function(t){return e.apply(this,arguments)}}(),this.outputMime||this.mimeType,this.outputQuality)}}}),jw={class:"avatar-cropper"},Ww={key:0,class:"avatar-cropper-mark"},qw=["title"],Kw={class:"avatar-cropper-container"},Gw={class:"avatar-cropper-image-container"},Qw=["src"],Jw={class:"avatar-cropper-footer"},Xw=["accept","capture"];(function(n,e){e===void 0&&(e={});var t=e.insertAt;if(n&&typeof document<"u"){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",t==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=n:i.appendChild(document.createTextNode(n))}})(`.avatar-cropper .avatar-cropper-overlay {
11
+ */function Ud(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function jd(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ud(Object(t),!0).forEach(function(r){dw(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ud(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Cs(n){"@babel/helpers - typeof";return Cs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cs(n)}function lw(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Wd(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,Kd(r.key),r)}}function cw(n,e,t){return e&&Wd(n.prototype,e),t&&Wd(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function dw(n,e,t){return e=Kd(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function qd(n){return uw(n)||fw(n)||pw(n)||hw()}function uw(n){if(Array.isArray(n))return Ms(n)}function fw(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function pw(n,e){if(n){if(typeof n=="string")return Ms(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Ms(n,e)}}function Ms(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function hw(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
12
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mw(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Kd(n){var e=mw(n,"string");return typeof e=="symbol"?e:String(e)}var Vo=typeof window<"u"&&typeof window.document<"u",dn=Vo?window:{},Ts=Vo&&dn.document.documentElement?"ontouchstart"in dn.document.documentElement:!1,Ss=Vo?"PointerEvent"in dn:!1,Ie="cropper",Ds="all",Gd="crop",Qd="move",Jd="zoom",mr="e",gr="w",qr="s",zn="n",Li="ne",$i="nw",Fi="se",zi="sw",As="".concat(Ie,"-crop"),Xd="".concat(Ie,"-disabled"),kt="".concat(Ie,"-hidden"),Zd="".concat(Ie,"-hide"),gw="".concat(Ie,"-invisible"),Lo="".concat(Ie,"-modal"),Es="".concat(Ie,"-move"),Hi="".concat(Ie,"Action"),$o="".concat(Ie,"Preview"),Os="crop",eu="move",tu="none",Ns="crop",_s="cropend",Bs="cropmove",Ps="cropstart",nu="dblclick",yw=Ts?"touchstart":"mousedown",vw=Ts?"touchmove":"mousemove",bw=Ts?"touchend touchcancel":"mouseup",ru=Ss?"pointerdown":yw,iu=Ss?"pointermove":vw,ou=Ss?"pointerup pointercancel":bw,au="ready",su="resize",lu="wheel",Is="zoom",cu="image/jpeg",ww=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,kw=/^data:/,xw=/^data:image\/jpeg;base64,/,Cw=/^img|canvas$/i,du=200,uu=100,fu={viewMode:0,dragMode:Os,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:du,minContainerHeight:uu,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},Mw='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',Tw=Number.isNaN||dn.isNaN;function be(n){return typeof n=="number"&&!Tw(n)}var pu=function(e){return e>0&&e<1/0};function Rs(n){return typeof n>"u"}function yr(n){return Cs(n)==="object"&&n!==null}var Sw=Object.prototype.hasOwnProperty;function Kr(n){if(!yr(n))return!1;try{var e=n.constructor,t=e.prototype;return e&&t&&Sw.call(t,"isPrototypeOf")}catch{return!1}}function xt(n){return typeof n=="function"}var Dw=Array.prototype.slice;function hu(n){return Array.from?Array.from(n):Dw.call(n)}function Ue(n,e){return n&&xt(e)&&(Array.isArray(n)||be(n.length)?hu(n).forEach(function(t,r){e.call(n,t,r,n)}):yr(n)&&Object.keys(n).forEach(function(t){e.call(n,n[t],t,n)})),n}var Re=Object.assign||function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return yr(e)&&r.length>0&&r.forEach(function(o){yr(o)&&Object.keys(o).forEach(function(a){e[a]=o[a]})}),e},Aw=/\.\d*(?:0|9){12}\d*$/;function Gr(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Aw.test(n)?Math.round(n*e)/e:n}var Ew=/^width|height|left|top|marginLeft|marginTop$/;function Hn(n,e){var t=n.style;Ue(e,function(r,i){Ew.test(i)&&be(r)&&(r="".concat(r,"px")),t[i]=r})}function Ow(n,e){return n.classList?n.classList.contains(e):n.className.indexOf(e)>-1}function Xe(n,e){if(e){if(be(n.length)){Ue(n,function(r){Xe(r,e)});return}if(n.classList){n.classList.add(e);return}var t=n.className.trim();t?t.indexOf(e)<0&&(n.className="".concat(t," ").concat(e)):n.className=e}}function un(n,e){if(e){if(be(n.length)){Ue(n,function(t){un(t,e)});return}if(n.classList){n.classList.remove(e);return}n.className.indexOf(e)>=0&&(n.className=n.className.replace(e,""))}}function Qr(n,e,t){if(e){if(be(n.length)){Ue(n,function(r){Qr(r,e,t)});return}t?Xe(n,e):un(n,e)}}var Nw=/([a-z\d])([A-Z])/g;function Vs(n){return n.replace(Nw,"$1-$2").toLowerCase()}function Ls(n,e){return yr(n[e])?n[e]:n.dataset?n.dataset[e]:n.getAttribute("data-".concat(Vs(e)))}function Yi(n,e,t){yr(t)?n[e]=t:n.dataset?n.dataset[e]=t:n.setAttribute("data-".concat(Vs(e)),t)}function _w(n,e){if(yr(n[e]))try{delete n[e]}catch{n[e]=void 0}else if(n.dataset)try{delete n.dataset[e]}catch{n.dataset[e]=void 0}else n.removeAttribute("data-".concat(Vs(e)))}var mu=/\s\s*/,gu=function(){var n=!1;if(Vo){var e=!1,t=function(){},r=Object.defineProperty({},"once",{get:function(){return n=!0,e},set:function(o){e=o}});dn.addEventListener("test",t,r),dn.removeEventListener("test",t,r)}return n}();function Qt(n,e,t){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=t;e.trim().split(mu).forEach(function(o){if(!gu){var a=n.listeners;a&&a[o]&&a[o][t]&&(i=a[o][t],delete a[o][t],Object.keys(a[o]).length===0&&delete a[o],Object.keys(a).length===0&&delete n.listeners)}n.removeEventListener(o,i,r)})}function Vt(n,e,t){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=t;e.trim().split(mu).forEach(function(o){if(r.once&&!gu){var a=n.listeners,s=a===void 0?{}:a;i=function(){delete s[o][t],n.removeEventListener(o,i,r);for(var d=arguments.length,u=new Array(d),f=0;f<d;f++)u[f]=arguments[f];t.apply(n,u)},s[o]||(s[o]={}),s[o][t]&&n.removeEventListener(o,s[o][t],r),s[o][t]=i,n.listeners=s}n.addEventListener(o,i,r)})}function Jr(n,e,t){var r;return xt(Event)&&xt(CustomEvent)?r=new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0}):(r=document.createEvent("CustomEvent"),r.initCustomEvent(e,!0,!0,t)),n.dispatchEvent(r)}function yu(n){var e=n.getBoundingClientRect();return{left:e.left+(window.pageXOffset-document.documentElement.clientLeft),top:e.top+(window.pageYOffset-document.documentElement.clientTop)}}var $s=dn.location,Bw=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function vu(n){var e=n.match(Bw);return e!==null&&(e[1]!==$s.protocol||e[2]!==$s.hostname||e[3]!==$s.port)}function bu(n){var e="timestamp=".concat(new Date().getTime());return n+(n.indexOf("?")===-1?"?":"&")+e}function Ui(n){var e=n.rotate,t=n.scaleX,r=n.scaleY,i=n.translateX,o=n.translateY,a=[];be(i)&&i!==0&&a.push("translateX(".concat(i,"px)")),be(o)&&o!==0&&a.push("translateY(".concat(o,"px)")),be(e)&&e!==0&&a.push("rotate(".concat(e,"deg)")),be(t)&&t!==1&&a.push("scaleX(".concat(t,")")),be(r)&&r!==1&&a.push("scaleY(".concat(r,")"));var s=a.length?a.join(" "):"none";return{WebkitTransform:s,msTransform:s,transform:s}}function Pw(n){var e=jd({},n),t=0;return Ue(n,function(r,i){delete e[i],Ue(e,function(o){var a=Math.abs(r.startX-o.startX),s=Math.abs(r.startY-o.startY),c=Math.abs(r.endX-o.endX),d=Math.abs(r.endY-o.endY),u=Math.sqrt(a*a+s*s),f=Math.sqrt(c*c+d*d),p=(f-u)/u;Math.abs(p)>Math.abs(t)&&(t=p)})}),t}function Fo(n,e){var t=n.pageX,r=n.pageY,i={endX:t,endY:r};return e?i:jd({startX:t,startY:r},i)}function Iw(n){var e=0,t=0,r=0;return Ue(n,function(i){var o=i.startX,a=i.startY;e+=o,t+=a,r+=1}),e/=r,t/=r,{pageX:e,pageY:t}}function Yn(n){var e=n.aspectRatio,t=n.height,r=n.width,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",o=pu(r),a=pu(t);if(o&&a){var s=t*e;i==="contain"&&s>r||i==="cover"&&s<r?t=r/e:r=t*e}else o?t=r/e:a&&(r=t*e);return{width:r,height:t}}function Rw(n){var e=n.width,t=n.height,r=n.degree;if(r=Math.abs(r)%180,r===90)return{width:t,height:e};var i=r%90*Math.PI/180,o=Math.sin(i),a=Math.cos(i),s=e*a+t*o,c=e*o+t*a;return r>90?{width:c,height:s}:{width:s,height:c}}function Vw(n,e,t,r){var i=e.aspectRatio,o=e.naturalWidth,a=e.naturalHeight,s=e.rotate,c=s===void 0?0:s,d=e.scaleX,u=d===void 0?1:d,f=e.scaleY,p=f===void 0?1:f,h=t.aspectRatio,m=t.naturalWidth,g=t.naturalHeight,k=r.fillColor,x=k===void 0?"transparent":k,S=r.imageSmoothingEnabled,T=S===void 0?!0:S,y=r.imageSmoothingQuality,B=y===void 0?"low":y,w=r.maxWidth,V=w===void 0?1/0:w,$=r.maxHeight,M=$===void 0?1/0:$,_=r.minWidth,z=_===void 0?0:_,N=r.minHeight,W=N===void 0?0:N,F=document.createElement("canvas"),O=F.getContext("2d"),I=Yn({aspectRatio:h,width:V,height:M}),H=Yn({aspectRatio:h,width:z,height:W},"cover"),b=Math.min(I.width,Math.max(H.width,m)),C=Math.min(I.height,Math.max(H.height,g)),v=Yn({aspectRatio:i,width:V,height:M}),A=Yn({aspectRatio:i,width:z,height:W},"cover"),E=Math.min(v.width,Math.max(A.width,o)),P=Math.min(v.height,Math.max(A.height,a)),q=[-E/2,-P/2,E,P];return F.width=Gr(b),F.height=Gr(C),O.fillStyle=x,O.fillRect(0,0,b,C),O.save(),O.translate(b/2,C/2),O.rotate(c*Math.PI/180),O.scale(u,p),O.imageSmoothingEnabled=T,O.imageSmoothingQuality=B,O.drawImage.apply(O,[n].concat(qd(q.map(function(D){return Math.floor(Gr(D))})))),O.restore(),F}var wu=String.fromCharCode;function Lw(n,e,t){var r="";t+=e;for(var i=e;i<t;i+=1)r+=wu(n.getUint8(i));return r}var $w=/^data:.*,/;function Fw(n){var e=n.replace($w,""),t=atob(e),r=new ArrayBuffer(t.length),i=new Uint8Array(r);return Ue(i,function(o,a){i[a]=t.charCodeAt(a)}),r}function zw(n,e){for(var t=[],r=8192,i=new Uint8Array(n);i.length>0;)t.push(wu.apply(null,hu(i.subarray(0,r)))),i=i.subarray(r);return"data:".concat(e,";base64,").concat(btoa(t.join("")))}function Hw(n){var e=new DataView(n),t;try{var r,i,o;if(e.getUint8(0)===255&&e.getUint8(1)===216)for(var a=e.byteLength,s=2;s+1<a;){if(e.getUint8(s)===255&&e.getUint8(s+1)===225){i=s;break}s+=1}if(i){var c=i+4,d=i+10;if(Lw(e,c,4)==="Exif"){var u=e.getUint16(d);if(r=u===18761,(r||u===19789)&&e.getUint16(d+2,r)===42){var f=e.getUint32(d+4,r);f>=8&&(o=d+f)}}}if(o){var p=e.getUint16(o,r),h,m;for(m=0;m<p;m+=1)if(h=o+m*12+2,e.getUint16(h,r)===274){h+=8,t=e.getUint16(h,r),e.setUint16(h,1,r);break}}}catch{t=1}return t}function Yw(n){var e=0,t=1,r=1;switch(n){case 2:t=-1;break;case 3:e=-180;break;case 4:r=-1;break;case 5:e=90,r=-1;break;case 6:e=90;break;case 7:e=90,t=-1;break;case 8:e=-90;break}return{rotate:e,scaleX:t,scaleY:r}}var Uw={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var e=this.element,t=this.options,r=this.container,i=this.cropper,o=Number(t.minContainerWidth),a=Number(t.minContainerHeight);Xe(i,kt),un(e,kt);var s={width:Math.max(r.offsetWidth,o>=0?o:du),height:Math.max(r.offsetHeight,a>=0?a:uu)};this.containerData=s,Hn(i,{width:s.width,height:s.height}),Xe(e,kt),un(i,kt)},initCanvas:function(){var e=this.containerData,t=this.imageData,r=this.options.viewMode,i=Math.abs(t.rotate)%180===90,o=i?t.naturalHeight:t.naturalWidth,a=i?t.naturalWidth:t.naturalHeight,s=o/a,c=e.width,d=e.height;e.height*s>e.width?r===3?c=e.height*s:d=e.width/s:r===3?d=e.width/s:c=e.height*s;var u={aspectRatio:s,naturalWidth:o,naturalHeight:a,width:c,height:d};this.canvasData=u,this.limited=r===1||r===2,this.limitCanvas(!0,!0),u.width=Math.min(Math.max(u.width,u.minWidth),u.maxWidth),u.height=Math.min(Math.max(u.height,u.minHeight),u.maxHeight),u.left=(e.width-u.width)/2,u.top=(e.height-u.height)/2,u.oldLeft=u.left,u.oldTop=u.top,this.initialCanvasData=Re({},u)},limitCanvas:function(e,t){var r=this.options,i=this.containerData,o=this.canvasData,a=this.cropBoxData,s=r.viewMode,c=o.aspectRatio,d=this.cropped&&a;if(e){var u=Number(r.minCanvasWidth)||0,f=Number(r.minCanvasHeight)||0;s>1?(u=Math.max(u,i.width),f=Math.max(f,i.height),s===3&&(f*c>u?u=f*c:f=u/c)):s>0&&(u?u=Math.max(u,d?a.width:0):f?f=Math.max(f,d?a.height:0):d&&(u=a.width,f=a.height,f*c>u?u=f*c:f=u/c));var p=Yn({aspectRatio:c,width:u,height:f});u=p.width,f=p.height,o.minWidth=u,o.minHeight=f,o.maxWidth=1/0,o.maxHeight=1/0}if(t)if(s>(d?0:1)){var h=i.width-o.width,m=i.height-o.height;o.minLeft=Math.min(0,h),o.minTop=Math.min(0,m),o.maxLeft=Math.max(0,h),o.maxTop=Math.max(0,m),d&&this.limited&&(o.minLeft=Math.min(a.left,a.left+(a.width-o.width)),o.minTop=Math.min(a.top,a.top+(a.height-o.height)),o.maxLeft=a.left,o.maxTop=a.top,s===2&&(o.width>=i.width&&(o.minLeft=Math.min(0,h),o.maxLeft=Math.max(0,h)),o.height>=i.height&&(o.minTop=Math.min(0,m),o.maxTop=Math.max(0,m))))}else o.minLeft=-o.width,o.minTop=-o.height,o.maxLeft=i.width,o.maxTop=i.height},renderCanvas:function(e,t){var r=this.canvasData,i=this.imageData;if(t){var o=Rw({width:i.naturalWidth*Math.abs(i.scaleX||1),height:i.naturalHeight*Math.abs(i.scaleY||1),degree:i.rotate||0}),a=o.width,s=o.height,c=r.width*(a/r.naturalWidth),d=r.height*(s/r.naturalHeight);r.left-=(c-r.width)/2,r.top-=(d-r.height)/2,r.width=c,r.height=d,r.aspectRatio=a/s,r.naturalWidth=a,r.naturalHeight=s,this.limitCanvas(!0,!1)}(r.width>r.maxWidth||r.width<r.minWidth)&&(r.left=r.oldLeft),(r.height>r.maxHeight||r.height<r.minHeight)&&(r.top=r.oldTop),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),this.limitCanvas(!1,!0),r.left=Math.min(Math.max(r.left,r.minLeft),r.maxLeft),r.top=Math.min(Math.max(r.top,r.minTop),r.maxTop),r.oldLeft=r.left,r.oldTop=r.top,Hn(this.canvas,Re({width:r.width,height:r.height},Ui({translateX:r.left,translateY:r.top}))),this.renderImage(e),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(e){var t=this.canvasData,r=this.imageData,i=r.naturalWidth*(t.width/t.naturalWidth),o=r.naturalHeight*(t.height/t.naturalHeight);Re(r,{width:i,height:o,left:(t.width-i)/2,top:(t.height-o)/2}),Hn(this.image,Re({width:r.width,height:r.height},Ui(Re({translateX:r.left,translateY:r.top},r)))),e&&this.output()},initCropBox:function(){var e=this.options,t=this.canvasData,r=e.aspectRatio||e.initialAspectRatio,i=Number(e.autoCropArea)||.8,o={width:t.width,height:t.height};r&&(t.height*r>t.width?o.height=o.width/r:o.width=o.height*r),this.cropBoxData=o,this.limitCropBox(!0,!0),o.width=Math.min(Math.max(o.width,o.minWidth),o.maxWidth),o.height=Math.min(Math.max(o.height,o.minHeight),o.maxHeight),o.width=Math.max(o.minWidth,o.width*i),o.height=Math.max(o.minHeight,o.height*i),o.left=t.left+(t.width-o.width)/2,o.top=t.top+(t.height-o.height)/2,o.oldLeft=o.left,o.oldTop=o.top,this.initialCropBoxData=Re({},o)},limitCropBox:function(e,t){var r=this.options,i=this.containerData,o=this.canvasData,a=this.cropBoxData,s=this.limited,c=r.aspectRatio;if(e){var d=Number(r.minCropBoxWidth)||0,u=Number(r.minCropBoxHeight)||0,f=s?Math.min(i.width,o.width,o.width+o.left,i.width-o.left):i.width,p=s?Math.min(i.height,o.height,o.height+o.top,i.height-o.top):i.height;d=Math.min(d,i.width),u=Math.min(u,i.height),c&&(d&&u?u*c>d?u=d/c:d=u*c:d?u=d/c:u&&(d=u*c),p*c>f?p=f/c:f=p*c),a.minWidth=Math.min(d,f),a.minHeight=Math.min(u,p),a.maxWidth=f,a.maxHeight=p}t&&(s?(a.minLeft=Math.max(0,o.left),a.minTop=Math.max(0,o.top),a.maxLeft=Math.min(i.width,o.left+o.width)-a.width,a.maxTop=Math.min(i.height,o.top+o.height)-a.height):(a.minLeft=0,a.minTop=0,a.maxLeft=i.width-a.width,a.maxTop=i.height-a.height))},renderCropBox:function(){var e=this.options,t=this.containerData,r=this.cropBoxData;(r.width>r.maxWidth||r.width<r.minWidth)&&(r.left=r.oldLeft),(r.height>r.maxHeight||r.height<r.minHeight)&&(r.top=r.oldTop),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),this.limitCropBox(!1,!0),r.left=Math.min(Math.max(r.left,r.minLeft),r.maxLeft),r.top=Math.min(Math.max(r.top,r.minTop),r.maxTop),r.oldLeft=r.left,r.oldTop=r.top,e.movable&&e.cropBoxMovable&&Yi(this.face,Hi,r.width>=t.width&&r.height>=t.height?Qd:Ds),Hn(this.cropBox,Re({width:r.width,height:r.height},Ui({translateX:r.left,translateY:r.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Jr(this.element,Ns,this.getData())}},jw={initPreview:function(){var e=this.element,t=this.crossOrigin,r=this.options.preview,i=t?this.crossOriginUrl:this.url,o=e.alt||"The image to preview",a=document.createElement("img");if(t&&(a.crossOrigin=t),a.src=i,a.alt=o,this.viewBox.appendChild(a),this.viewBoxImage=a,!!r){var s=r;typeof r=="string"?s=e.ownerDocument.querySelectorAll(r):r.querySelector&&(s=[r]),this.previews=s,Ue(s,function(c){var d=document.createElement("img");Yi(c,$o,{width:c.offsetWidth,height:c.offsetHeight,html:c.innerHTML}),t&&(d.crossOrigin=t),d.src=i,d.alt=o,d.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',c.innerHTML="",c.appendChild(d)})}},resetPreview:function(){Ue(this.previews,function(e){var t=Ls(e,$o);Hn(e,{width:t.width,height:t.height}),e.innerHTML=t.html,_w(e,$o)})},preview:function(){var e=this.imageData,t=this.canvasData,r=this.cropBoxData,i=r.width,o=r.height,a=e.width,s=e.height,c=r.left-t.left-e.left,d=r.top-t.top-e.top;!this.cropped||this.disabled||(Hn(this.viewBoxImage,Re({width:a,height:s},Ui(Re({translateX:-c,translateY:-d},e)))),Ue(this.previews,function(u){var f=Ls(u,$o),p=f.width,h=f.height,m=p,g=h,k=1;i&&(k=p/i,g=o*k),o&&g>h&&(k=h/o,m=i*k,g=h),Hn(u,{width:m,height:g}),Hn(u.getElementsByTagName("img")[0],Re({width:a*k,height:s*k},Ui(Re({translateX:-c*k,translateY:-d*k},e))))}))}},Ww={bind:function(){var e=this.element,t=this.options,r=this.cropper;xt(t.cropstart)&&Vt(e,Ps,t.cropstart),xt(t.cropmove)&&Vt(e,Bs,t.cropmove),xt(t.cropend)&&Vt(e,_s,t.cropend),xt(t.crop)&&Vt(e,Ns,t.crop),xt(t.zoom)&&Vt(e,Is,t.zoom),Vt(r,ru,this.onCropStart=this.cropStart.bind(this)),t.zoomable&&t.zoomOnWheel&&Vt(r,lu,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&Vt(r,nu,this.onDblclick=this.dblclick.bind(this)),Vt(e.ownerDocument,iu,this.onCropMove=this.cropMove.bind(this)),Vt(e.ownerDocument,ou,this.onCropEnd=this.cropEnd.bind(this)),t.responsive&&Vt(window,su,this.onResize=this.resize.bind(this))},unbind:function(){var e=this.element,t=this.options,r=this.cropper;xt(t.cropstart)&&Qt(e,Ps,t.cropstart),xt(t.cropmove)&&Qt(e,Bs,t.cropmove),xt(t.cropend)&&Qt(e,_s,t.cropend),xt(t.crop)&&Qt(e,Ns,t.crop),xt(t.zoom)&&Qt(e,Is,t.zoom),Qt(r,ru,this.onCropStart),t.zoomable&&t.zoomOnWheel&&Qt(r,lu,this.onWheel,{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&Qt(r,nu,this.onDblclick),Qt(e.ownerDocument,iu,this.onCropMove),Qt(e.ownerDocument,ou,this.onCropEnd),t.responsive&&Qt(window,su,this.onResize)}},qw={resize:function(){if(!this.disabled){var e=this.options,t=this.container,r=this.containerData,i=t.offsetWidth/r.width,o=t.offsetHeight/r.height,a=Math.abs(i-1)>Math.abs(o-1)?i:o;if(a!==1){var s,c;e.restore&&(s=this.getCanvasData(),c=this.getCropBoxData()),this.render(),e.restore&&(this.setCanvasData(Ue(s,function(d,u){s[u]=d*a})),this.setCropBoxData(Ue(c,function(d,u){c[u]=d*a})))}}},dblclick:function(){this.disabled||this.options.dragMode===tu||this.setDragMode(Ow(this.dragBox,As)?eu:Os)},wheel:function(e){var t=this,r=Number(this.options.wheelZoomRatio)||.1,i=1;this.disabled||(e.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){t.wheeling=!1},50),e.deltaY?i=e.deltaY>0?1:-1:e.wheelDelta?i=-e.wheelDelta/120:e.detail&&(i=e.detail>0?1:-1),this.zoom(-i*r,e)))},cropStart:function(e){var t=e.buttons,r=e.button;if(!(this.disabled||(e.type==="mousedown"||e.type==="pointerdown"&&e.pointerType==="mouse")&&(be(t)&&t!==1||be(r)&&r!==0||e.ctrlKey))){var i=this.options,o=this.pointers,a;e.changedTouches?Ue(e.changedTouches,function(s){o[s.identifier]=Fo(s)}):o[e.pointerId||0]=Fo(e),Object.keys(o).length>1&&i.zoomable&&i.zoomOnTouch?a=Jd:a=Ls(e.target,Hi),ww.test(a)&&Jr(this.element,Ps,{originalEvent:e,action:a})!==!1&&(e.preventDefault(),this.action=a,this.cropping=!1,a===Gd&&(this.cropping=!0,Xe(this.dragBox,Lo)))}},cropMove:function(e){var t=this.action;if(!(this.disabled||!t)){var r=this.pointers;e.preventDefault(),Jr(this.element,Bs,{originalEvent:e,action:t})!==!1&&(e.changedTouches?Ue(e.changedTouches,function(i){Re(r[i.identifier]||{},Fo(i,!0))}):Re(r[e.pointerId||0]||{},Fo(e,!0)),this.change(e))}},cropEnd:function(e){if(!this.disabled){var t=this.action,r=this.pointers;e.changedTouches?Ue(e.changedTouches,function(i){delete r[i.identifier]}):delete r[e.pointerId||0],t&&(e.preventDefault(),Object.keys(r).length||(this.action=""),this.cropping&&(this.cropping=!1,Qr(this.dragBox,Lo,this.cropped&&this.options.modal)),Jr(this.element,_s,{originalEvent:e,action:t}))}}},Kw={change:function(e){var t=this.options,r=this.canvasData,i=this.containerData,o=this.cropBoxData,a=this.pointers,s=this.action,c=t.aspectRatio,d=o.left,u=o.top,f=o.width,p=o.height,h=d+f,m=u+p,g=0,k=0,x=i.width,S=i.height,T=!0,y;!c&&e.shiftKey&&(c=f&&p?f/p:1),this.limited&&(g=o.minLeft,k=o.minTop,x=g+Math.min(i.width,r.width,r.left+r.width),S=k+Math.min(i.height,r.height,r.top+r.height));var B=a[Object.keys(a)[0]],w={x:B.endX-B.startX,y:B.endY-B.startY},V=function(M){switch(M){case mr:h+w.x>x&&(w.x=x-h);break;case gr:d+w.x<g&&(w.x=g-d);break;case zn:u+w.y<k&&(w.y=k-u);break;case qr:m+w.y>S&&(w.y=S-m);break}};switch(s){case Ds:d+=w.x,u+=w.y;break;case mr:if(w.x>=0&&(h>=x||c&&(u<=k||m>=S))){T=!1;break}V(mr),f+=w.x,f<0&&(s=gr,f=-f,d-=f),c&&(p=f/c,u+=(o.height-p)/2);break;case zn:if(w.y<=0&&(u<=k||c&&(d<=g||h>=x))){T=!1;break}V(zn),p-=w.y,u+=w.y,p<0&&(s=qr,p=-p,u-=p),c&&(f=p*c,d+=(o.width-f)/2);break;case gr:if(w.x<=0&&(d<=g||c&&(u<=k||m>=S))){T=!1;break}V(gr),f-=w.x,d+=w.x,f<0&&(s=mr,f=-f,d-=f),c&&(p=f/c,u+=(o.height-p)/2);break;case qr:if(w.y>=0&&(m>=S||c&&(d<=g||h>=x))){T=!1;break}V(qr),p+=w.y,p<0&&(s=zn,p=-p,u-=p),c&&(f=p*c,d+=(o.width-f)/2);break;case Li:if(c){if(w.y<=0&&(u<=k||h>=x)){T=!1;break}V(zn),p-=w.y,u+=w.y,f=p*c}else V(zn),V(mr),w.x>=0?h<x?f+=w.x:w.y<=0&&u<=k&&(T=!1):f+=w.x,w.y<=0?u>k&&(p-=w.y,u+=w.y):(p-=w.y,u+=w.y);f<0&&p<0?(s=zi,p=-p,f=-f,u-=p,d-=f):f<0?(s=$i,f=-f,d-=f):p<0&&(s=Fi,p=-p,u-=p);break;case $i:if(c){if(w.y<=0&&(u<=k||d<=g)){T=!1;break}V(zn),p-=w.y,u+=w.y,f=p*c,d+=o.width-f}else V(zn),V(gr),w.x<=0?d>g?(f-=w.x,d+=w.x):w.y<=0&&u<=k&&(T=!1):(f-=w.x,d+=w.x),w.y<=0?u>k&&(p-=w.y,u+=w.y):(p-=w.y,u+=w.y);f<0&&p<0?(s=Fi,p=-p,f=-f,u-=p,d-=f):f<0?(s=Li,f=-f,d-=f):p<0&&(s=zi,p=-p,u-=p);break;case zi:if(c){if(w.x<=0&&(d<=g||m>=S)){T=!1;break}V(gr),f-=w.x,d+=w.x,p=f/c}else V(qr),V(gr),w.x<=0?d>g?(f-=w.x,d+=w.x):w.y>=0&&m>=S&&(T=!1):(f-=w.x,d+=w.x),w.y>=0?m<S&&(p+=w.y):p+=w.y;f<0&&p<0?(s=Li,p=-p,f=-f,u-=p,d-=f):f<0?(s=Fi,f=-f,d-=f):p<0&&(s=$i,p=-p,u-=p);break;case Fi:if(c){if(w.x>=0&&(h>=x||m>=S)){T=!1;break}V(mr),f+=w.x,p=f/c}else V(qr),V(mr),w.x>=0?h<x?f+=w.x:w.y>=0&&m>=S&&(T=!1):f+=w.x,w.y>=0?m<S&&(p+=w.y):p+=w.y;f<0&&p<0?(s=$i,p=-p,f=-f,u-=p,d-=f):f<0?(s=zi,f=-f,d-=f):p<0&&(s=Li,p=-p,u-=p);break;case Qd:this.move(w.x,w.y),T=!1;break;case Jd:this.zoom(Pw(a),e),T=!1;break;case Gd:if(!w.x||!w.y){T=!1;break}y=yu(this.cropper),d=B.startX-y.left,u=B.startY-y.top,f=o.minWidth,p=o.minHeight,w.x>0?s=w.y>0?Fi:Li:w.x<0&&(d-=f,s=w.y>0?zi:$i),w.y<0&&(u-=p),this.cropped||(un(this.cropBox,kt),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}T&&(o.width=f,o.height=p,o.left=d,o.top=u,this.action=s,this.renderCropBox()),Ue(a,function($){$.startX=$.endX,$.startY=$.endY})}},Gw={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&Xe(this.dragBox,Lo),un(this.cropBox,kt),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=Re({},this.initialImageData),this.canvasData=Re({},this.initialCanvasData),this.cropBoxData=Re({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(Re(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),un(this.dragBox,Lo),Xe(this.cropBox,kt)),this},replace:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&e&&(this.isImg&&(this.element.src=e),t?(this.url=e,this.image.src=e,this.ready&&(this.viewBoxImage.src=e,Ue(this.previews,function(r){r.getElementsByTagName("img")[0].src=e}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(e))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,un(this.cropper,Xd)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,Xe(this.cropper,Xd)),this},destroy:function(){var e=this.element;return e[Ie]?(e[Ie]=void 0,this.isImg&&this.replaced&&(e.src=this.originalUrl),this.uncreate(),this):this},move:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=this.canvasData,i=r.left,o=r.top;return this.moveTo(Rs(e)?e:i+Number(e),Rs(t)?t:o+Number(t))},moveTo:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=this.canvasData,i=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.movable&&(be(e)&&(r.left=e,i=!0),be(t)&&(r.top=t,i=!0),i&&this.renderCanvas(!0)),this},zoom:function(e,t){var r=this.canvasData;return e=Number(e),e<0?e=1/(1-e):e=1+e,this.zoomTo(r.width*e/r.naturalWidth,null,t)},zoomTo:function(e,t,r){var i=this.options,o=this.canvasData,a=o.width,s=o.height,c=o.naturalWidth,d=o.naturalHeight;if(e=Number(e),e>=0&&this.ready&&!this.disabled&&i.zoomable){var u=c*e,f=d*e;if(Jr(this.element,Is,{ratio:e,oldRatio:a/c,originalEvent:r})===!1)return this;if(r){var p=this.pointers,h=yu(this.cropper),m=p&&Object.keys(p).length?Iw(p):{pageX:r.pageX,pageY:r.pageY};o.left-=(u-a)*((m.pageX-h.left-o.left)/a),o.top-=(f-s)*((m.pageY-h.top-o.top)/s)}else Kr(t)&&be(t.x)&&be(t.y)?(o.left-=(u-a)*((t.x-o.left)/a),o.top-=(f-s)*((t.y-o.top)/s)):(o.left-=(u-a)/2,o.top-=(f-s)/2);o.width=u,o.height=f,this.renderCanvas(!0)}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e))},rotateTo:function(e){return e=Number(e),be(e)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=e%360,this.renderCanvas(!0,!0)),this},scaleX:function(e){var t=this.imageData.scaleY;return this.scale(e,be(t)?t:1)},scaleY:function(e){var t=this.imageData.scaleX;return this.scale(be(t)?t:1,e)},scale:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=this.imageData,i=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.scalable&&(be(e)&&(r.scaleX=e,i=!0),be(t)&&(r.scaleY=t,i=!0),i&&this.renderCanvas(!0,!0)),this},getData:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.options,r=this.imageData,i=this.canvasData,o=this.cropBoxData,a;if(this.ready&&this.cropped){a={x:o.left-i.left,y:o.top-i.top,width:o.width,height:o.height};var s=r.width/r.naturalWidth;if(Ue(a,function(u,f){a[f]=u/s}),e){var c=Math.round(a.y+a.height),d=Math.round(a.x+a.width);a.x=Math.round(a.x),a.y=Math.round(a.y),a.width=d-a.x,a.height=c-a.y}}else a={x:0,y:0,width:0,height:0};return t.rotatable&&(a.rotate=r.rotate||0),t.scalable&&(a.scaleX=r.scaleX||1,a.scaleY=r.scaleY||1),a},setData:function(e){var t=this.options,r=this.imageData,i=this.canvasData,o={};if(this.ready&&!this.disabled&&Kr(e)){var a=!1;t.rotatable&&be(e.rotate)&&e.rotate!==r.rotate&&(r.rotate=e.rotate,a=!0),t.scalable&&(be(e.scaleX)&&e.scaleX!==r.scaleX&&(r.scaleX=e.scaleX,a=!0),be(e.scaleY)&&e.scaleY!==r.scaleY&&(r.scaleY=e.scaleY,a=!0)),a&&this.renderCanvas(!0,!0);var s=r.width/r.naturalWidth;be(e.x)&&(o.left=e.x*s+i.left),be(e.y)&&(o.top=e.y*s+i.top),be(e.width)&&(o.width=e.width*s),be(e.height)&&(o.height=e.height*s),this.setCropBoxData(o)}return this},getContainerData:function(){return this.ready?Re({},this.containerData):{}},getImageData:function(){return this.sized?Re({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,t={};return this.ready&&Ue(["left","top","width","height","naturalWidth","naturalHeight"],function(r){t[r]=e[r]}),t},setCanvasData:function(e){var t=this.canvasData,r=t.aspectRatio;return this.ready&&!this.disabled&&Kr(e)&&(be(e.left)&&(t.left=e.left),be(e.top)&&(t.top=e.top),be(e.width)?(t.width=e.width,t.height=e.width/r):be(e.height)&&(t.height=e.height,t.width=e.height*r),this.renderCanvas(!0)),this},getCropBoxData:function(){var e=this.cropBoxData,t;return this.ready&&this.cropped&&(t={left:e.left,top:e.top,width:e.width,height:e.height}),t||{}},setCropBoxData:function(e){var t=this.cropBoxData,r=this.options.aspectRatio,i,o;return this.ready&&this.cropped&&!this.disabled&&Kr(e)&&(be(e.left)&&(t.left=e.left),be(e.top)&&(t.top=e.top),be(e.width)&&e.width!==t.width&&(i=!0,t.width=e.width),be(e.height)&&e.height!==t.height&&(o=!0,t.height=e.height),r&&(i?t.height=t.width/r:o&&(t.width=t.height*r)),this.renderCropBox()),this},getCroppedCanvas:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var t=this.canvasData,r=Vw(this.image,this.imageData,t,e);if(!this.cropped)return r;var i=this.getData(e.rounded),o=i.x,a=i.y,s=i.width,c=i.height,d=r.width/Math.floor(t.naturalWidth);d!==1&&(o*=d,a*=d,s*=d,c*=d);var u=s/c,f=Yn({aspectRatio:u,width:e.maxWidth||1/0,height:e.maxHeight||1/0}),p=Yn({aspectRatio:u,width:e.minWidth||0,height:e.minHeight||0},"cover"),h=Yn({aspectRatio:u,width:e.width||(d!==1?r.width:s),height:e.height||(d!==1?r.height:c)}),m=h.width,g=h.height;m=Math.min(f.width,Math.max(p.width,m)),g=Math.min(f.height,Math.max(p.height,g));var k=document.createElement("canvas"),x=k.getContext("2d");k.width=Gr(m),k.height=Gr(g),x.fillStyle=e.fillColor||"transparent",x.fillRect(0,0,m,g);var S=e.imageSmoothingEnabled,T=S===void 0?!0:S,y=e.imageSmoothingQuality;x.imageSmoothingEnabled=T,y&&(x.imageSmoothingQuality=y);var B=r.width,w=r.height,V=o,$=a,M,_,z,N,W,F;V<=-s||V>B?(V=0,M=0,z=0,W=0):V<=0?(z=-V,V=0,M=Math.min(B,s+V),W=M):V<=B&&(z=0,M=Math.min(s,B-V),W=M),M<=0||$<=-c||$>w?($=0,_=0,N=0,F=0):$<=0?(N=-$,$=0,_=Math.min(w,c+$),F=_):$<=w&&(N=0,_=Math.min(c,w-$),F=_);var O=[V,$,M,_];if(W>0&&F>0){var I=m/s;O.push(z*I,N*I,W*I,F*I)}return x.drawImage.apply(x,[r].concat(qd(O.map(function(H){return Math.floor(Gr(H))})))),k},setAspectRatio:function(e){var t=this.options;return!this.disabled&&!Rs(e)&&(t.aspectRatio=Math.max(0,e)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(e){var t=this.options,r=this.dragBox,i=this.face;if(this.ready&&!this.disabled){var o=e===Os,a=t.movable&&e===eu;e=o||a?e:tu,t.dragMode=e,Yi(r,Hi,e),Qr(r,As,o),Qr(r,Es,a),t.cropBoxMovable||(Yi(i,Hi,e),Qr(i,As,o),Qr(i,Es,a))}return this}},Qw=dn.Cropper,ku=function(){function n(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(lw(this,n),!e||!Cw.test(e.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=e,this.options=Re({},fu,Kr(t)&&t),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return cw(n,[{key:"init",value:function(){var t=this.element,r=t.tagName.toLowerCase(),i;if(!t[Ie]){if(t[Ie]=this,r==="img"){if(this.isImg=!0,i=t.getAttribute("src")||"",this.originalUrl=i,!i)return;i=t.src}else r==="canvas"&&window.HTMLCanvasElement&&(i=t.toDataURL());this.load(i)}}},{key:"load",value:function(t){var r=this;if(t){this.url=t,this.imageData={};var i=this.element,o=this.options;if(!o.rotatable&&!o.scalable&&(o.checkOrientation=!1),!o.checkOrientation||!window.ArrayBuffer){this.clone();return}if(kw.test(t)){xw.test(t)?this.read(Fw(t)):this.clone();return}var a=new XMLHttpRequest,s=this.clone.bind(this);this.reloading=!0,this.xhr=a,a.onabort=s,a.onerror=s,a.ontimeout=s,a.onprogress=function(){a.getResponseHeader("content-type")!==cu&&a.abort()},a.onload=function(){r.read(a.response)},a.onloadend=function(){r.reloading=!1,r.xhr=null},o.checkCrossOrigin&&vu(t)&&i.crossOrigin&&(t=bu(t)),a.open("GET",t,!0),a.responseType="arraybuffer",a.withCredentials=i.crossOrigin==="use-credentials",a.send()}}},{key:"read",value:function(t){var r=this.options,i=this.imageData,o=Hw(t),a=0,s=1,c=1;if(o>1){this.url=zw(t,cu);var d=Yw(o);a=d.rotate,s=d.scaleX,c=d.scaleY}r.rotatable&&(i.rotate=a),r.scalable&&(i.scaleX=s,i.scaleY=c),this.clone()}},{key:"clone",value:function(){var t=this.element,r=this.url,i=t.crossOrigin,o=r;this.options.checkCrossOrigin&&vu(r)&&(i||(i="anonymous"),o=bu(r)),this.crossOrigin=i,this.crossOriginUrl=o;var a=document.createElement("img");i&&(a.crossOrigin=i),a.src=o||r,a.alt=t.alt||"The image to crop",this.image=a,a.onload=this.start.bind(this),a.onerror=this.stop.bind(this),Xe(a,Zd),t.parentNode.insertBefore(a,t.nextSibling)}},{key:"start",value:function(){var t=this,r=this.image;r.onload=null,r.onerror=null,this.sizing=!0;var i=dn.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(dn.navigator.userAgent),o=function(d,u){Re(t.imageData,{naturalWidth:d,naturalHeight:u,aspectRatio:d/u}),t.initialImageData=Re({},t.imageData),t.sizing=!1,t.sized=!0,t.build()};if(r.naturalWidth&&!i){o(r.naturalWidth,r.naturalHeight);return}var a=document.createElement("img"),s=document.body||document.documentElement;this.sizingImage=a,a.onload=function(){o(a.width,a.height),i||s.removeChild(a)},a.src=r.src,i||(a.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",s.appendChild(a))}},{key:"stop",value:function(){var t=this.image;t.onload=null,t.onerror=null,t.parentNode.removeChild(t),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var t=this.element,r=this.options,i=this.image,o=t.parentNode,a=document.createElement("div");a.innerHTML=Mw;var s=a.querySelector(".".concat(Ie,"-container")),c=s.querySelector(".".concat(Ie,"-canvas")),d=s.querySelector(".".concat(Ie,"-drag-box")),u=s.querySelector(".".concat(Ie,"-crop-box")),f=u.querySelector(".".concat(Ie,"-face"));this.container=o,this.cropper=s,this.canvas=c,this.dragBox=d,this.cropBox=u,this.viewBox=s.querySelector(".".concat(Ie,"-view-box")),this.face=f,c.appendChild(i),Xe(t,kt),o.insertBefore(s,t.nextSibling),un(i,Zd),this.initPreview(),this.bind(),r.initialAspectRatio=Math.max(0,r.initialAspectRatio)||NaN,r.aspectRatio=Math.max(0,r.aspectRatio)||NaN,r.viewMode=Math.max(0,Math.min(3,Math.round(r.viewMode)))||0,Xe(u,kt),r.guides||Xe(u.getElementsByClassName("".concat(Ie,"-dashed")),kt),r.center||Xe(u.getElementsByClassName("".concat(Ie,"-center")),kt),r.background&&Xe(s,"".concat(Ie,"-bg")),r.highlight||Xe(f,gw),r.cropBoxMovable&&(Xe(f,Es),Yi(f,Hi,Ds)),r.cropBoxResizable||(Xe(u.getElementsByClassName("".concat(Ie,"-line")),kt),Xe(u.getElementsByClassName("".concat(Ie,"-point")),kt)),this.render(),this.ready=!0,this.setDragMode(r.dragMode),r.autoCrop&&this.crop(),this.setData(r.data),xt(r.ready)&&Vt(t,au,r.ready,{once:!0}),Jr(t,au)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var t=this.cropper.parentNode;t&&t.removeChild(this.cropper),un(this.element,kt)}}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=Qw,n}},{key:"setDefaults",value:function(t){Re(fu,Kr(t)&&t)}}]),n}();Re(ku.prototype,Uw,jw,Ww,qw,Kw,Gw);function zo(){this._types=Object.create(null),this._extensions=Object.create(null);for(let n=0;n<arguments.length;n++)this.define(arguments[n]);this.define=this.define.bind(this),this.getType=this.getType.bind(this),this.getExtension=this.getExtension.bind(this)}zo.prototype.define=function(n,e){for(let t in n){let r=n[t].map(function(i){return i.toLowerCase()});t=t.toLowerCase();for(let i=0;i<r.length;i++){const o=r[i];if(o[0]!=="*"){if(!e&&o in this._types)throw new Error('Attempt to change mapping for "'+o+'" extension from "'+this._types[o]+'" to "'+t+'". Pass `force=true` to allow this, otherwise remove "'+o+'" from the list of extensions for "'+t+'".');this._types[o]=t}}if(e||!this._extensions[t]){const i=r[0];this._extensions[t]=i[0]!=="*"?i:i.substr(1)}}},zo.prototype.getType=function(n){n=String(n);let e=n.replace(/^.*[/\\]/,"").toLowerCase(),t=e.replace(/^.*\./,"").toLowerCase(),r=e.length<n.length;return(t.length<e.length-1||!r)&&this._types[t]||null},zo.prototype.getExtension=function(n){return n=/^\s*([^;\s]*)/.test(n)&&RegExp.$1,n&&this._extensions[n.toLowerCase()]||null};var Jw=zo,Xw={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["es","ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avif":["avif"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};let Zw=Jw;var ek=new Zw(Xw);const tk=Fd(ek);var Ho=l.defineComponent({name:"AvatarCropper",emits:["update:modelValue","submit","error","cancel","changed","uploading","completed","uploaded"],props:{modelValue:{type:Boolean,default:!1},file:{type:File},uploadHandler:{type:Function},uploadUrl:{type:String},requestOptions:{type:Object,default:function(){return{method:"POST"}}},uploadFileField:{type:String,default:"file"},uploadFileName:{type:[String,Function]},uploadFormData:{type:FormData,default:function(){return new FormData}},cropperOptions:{type:Object,default:function(){return{aspectRatio:1,autoCropArea:1,viewMode:1,movable:!1,zoomable:!1}}},outputOptions:{type:Object},outputMime:{type:String,default:null},outputQuality:{type:Number,default:.9},mimes:{type:String,default:"image/png, image/gif, image/jpeg, image/bmp, image/x-icon"},capture:{type:String},labels:{type:Object,default:function(){return{submit:"Ok",cancel:"Cancel"}}},inline:{type:Boolean,default:!1}},data:function(){return{cropper:void 0,dataUrl:void 0,fileName:void 0,mimeType:void 0}},computed:{cleanedMimes:function(){if(!this.mimes)throw new Error("vue-avatar-cropper: mimes prop cannot be empty");return this.mimes.trim().toLowerCase()}},watch:{modelValue:function(n){n&&(this.file?this.onFileChange(this.file):this.pickImage(),this.$emit("update:modelValue",!1))}},mounted:function(){this.$emit("update:modelValue",!1)},methods:{destroy:function(){this.cropper&&this.cropper.destroy(),this.$refs.input&&(this.$refs.input.value=""),this.dataUrl=void 0},submit:function(){this.$emit("submit"),this.uploadUrl?this.uploadImage():this.uploadHandler?this.uploadHandler(this.cropper):this.$emit("error",{type:"user",message:"No upload handler found"}),this.destroy()},cancel:function(){this.$emit("cancel"),this.destroy()},onImgElementError:function(){this.$emit("error",{type:"load",message:"File loading failed"}),this.destroy()},pickImage:function(){this.$refs.input&&this.$refs.input.click()},onFileChange:function(n){var e=this;if(this.cleanedMimes==="image/*"){if(n.type.split("/")[0]!=="image")return void this.$emit("error",{type:"user",message:"File type not correct"})}else if(this.cleanedMimes){var t=this.cleanedMimes.split(", ").find(function(i){return i===n.type});if(!t)return void this.$emit("error",{type:"user",message:"File type not correct"})}var r=new FileReader;r.onload=function(i){e.dataUrl=i.target.result},r.readAsDataURL(n),this.fileName=n.name||"unknown",this.mimeType=n.type,this.$emit("changed",{file:n,reader:r})},onFileInputChange:function(n){n.target.files&&n.target.files[0]&&this.onFileChange(n.target.files[0])},createCropper:function(){this.cropper=new ku(this.$refs.img,this.cropperOptions)},getFilename:function(n){var e=tk.getExtension(n.type);if(!this.uploadFileName){var t=this.fileName,r=this.fileName.split(".");return r.length>1&&(t=r.slice(0,-1).join(".")),"".concat(t,".").concat(e)}return typeof this.uploadFileName=="string"?this.uploadFileName:typeof this.uploadFileName=="function"?this.uploadFileName({filename:this.fileName,mime:n.type,extension:e}):"unknown.".concat(e)},uploadImage:function(){var n=this;this.cropper.getCroppedCanvas(this.outputOptions).toBlob(function(){var e=iw(Yd.mark(function t(r){var i,o,a,s,c,d,u,f,p;return Yd.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:for(o in i=new FormData,n.uploadFormData.entries())a=rw(o,2),s=a[0],c=a[1],i.append(s,c);return i.append(n.uploadFileField,r,n.getFilename(r)),d=Object.assign({body:i},n.requestOptions),u=new Request(n.uploadUrl,d),f=fetch(u),n.$emit("uploading",{form:i,request:u,response:f}),h.next=9,f;case 9:p=h.sent,n.$emit("completed",{form:i,request:u,response:p}),p.ok?n.$emit("uploaded",{form:i,request:u,response:p}):n.$emit("error",{type:"upload",message:"Image upload fail",context:{request:u,response:p}});case 12:case"end":return h.stop()}},t)}));return function(t){return e.apply(this,arguments)}}(),this.outputMime||this.mimeType,this.outputQuality)}}}),nk={class:"avatar-cropper"},rk={key:0,class:"avatar-cropper-mark"},ik=["title"],ok={class:"avatar-cropper-container"},ak={class:"avatar-cropper-image-container"},sk=["src"],lk={class:"avatar-cropper-footer"},ck=["accept","capture"];(function(n,e){e===void 0&&(e={});var t=e.insertAt;if(n&&typeof document<"u"){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",t==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=n:i.appendChild(document.createTextNode(n))}})(`.avatar-cropper .avatar-cropper-overlay {
13
13
  text-align: center;
14
14
  display: flex;
15
15
  align-items: center;
@@ -69,18 +69,18 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
69
69
  .avatar-cropper .avatar-cropper-container .avatar-cropper-footer .avatar-cropper-btn:hover {
70
70
  background-color: #2aabd2;
71
71
  color: #fff; }
72
- `),Ho.render=function(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",jw,[n.dataUrl?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["avatar-cropper-overlay",{"avatar-cropper-overlay-inline":n.inline}])},[n.inline?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",Ww,[l.createElementVNode("a",{onClick:e[0]||(e[0]=function(){return n.cancel&&n.cancel.apply(n,arguments)}),class:"avatar-cropper-close",title:n.labels.cancel,href:"javascript:;"}," × ",8,qw)])),l.createElementVNode("div",Kw,[l.createElementVNode("div",Gw,[l.createElementVNode("img",{ref:"img",src:n.dataUrl,alt:"",onLoad:e[1]||(e[1]=l.withModifiers(function(){return n.createCropper&&n.createCropper.apply(n,arguments)},["stop"])),onError:e[2]||(e[2]=function(){return n.onImgElementError&&n.onImgElementError.apply(n,arguments)})},null,40,Qw)]),l.createElementVNode("div",Jw,[l.createElementVNode("button",{onClick:e[3]||(e[3]=l.withModifiers(function(){return n.cancel&&n.cancel.apply(n,arguments)},["stop","prevent"])),class:"avatar-cropper-btn"},l.toDisplayString(n.labels.cancel),1),l.createElementVNode("button",{onClick:e[4]||(e[4]=l.withModifiers(function(){return n.submit&&n.submit.apply(n,arguments)},["stop","prevent"])),class:"avatar-cropper-btn"},l.toDisplayString(n.labels.submit),1)])])],2)):l.createCommentVNode("",!0),n.file?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("input",{key:1,accept:n.cleanedMimes,capture:n.capture,class:"avatar-cropper-img-input",ref:"input",type:"file",onChange:e[5]||(e[5]=function(){return n.onFileInputChange&&n.onFileInputChange.apply(n,arguments)})},null,40,Xw))])},Ho.install=function(n){n.component("avatar-cropper",Ho)};const Zw={name:"GenericImageCropper",props:{personID:{type:Number,default:1}},components:{AvatarCropper:Ho},data(){return{showCropper:!1,userPicUrl:""}},mounted(){this.getImgUrl(this.personID)},watch:{personID:{immediate:!0,handler(n,e){this.getImgUrl(n)}}},methods:{getImgUrl(n){this.userPicUrl="../../../../src/assets/select-tournament.png"},setShowCropper(){this.showCropper=!0},handleUploading(){this.userPicUrl="./uploads/default.jpeg",this.message="uploading..."},handleUploaded(n){n.response.status===200&&this.getImgUrl(this.personID)},handleCompleted(){this.message="upload completed."},handlerError(n,e,t){console.error(`${n} ${e} ${t}`),this.message="Oops! Something went wrong..."}}},ek={class:""},tk=["src","alt"];function nk(n,e,t,r,i,o){const a=l.resolveComponent("avatar-cropper");return l.openBlock(),l.createElementBlock("section",ek,[l.createElementVNode("img",{class:"h-40 w-96 border-2 border-dashed rounded-lg",src:i.userPicUrl,onError:e[0]||(e[0]=()=>{}),alt:t.personID,onClick:e[1]||(e[1]=s=>o.setShowCropper())},null,40,tk),l.createVNode(a,{onUploading:o.handleUploading,onUploaded:o.handleUploaded,onCompleted:o.handleCompleted,onError:o.handlerError,modelValue:i.showCropper,"onUpdate:modelValue":e[2]||(e[2]=s=>i.showCropper=s),"upload-url":`./uploads/${t.personID}`,"cropper-options":{aspectRatio:8/3,autoCropArea:1,viewMode:1,movable:!0,zoomable:!0}},null,8,["onUploading","onUploaded","onCompleted","onError","modelValue","upload-url"])])}const bu=He(Zw,[["render",nk]]);function it(n){this.content=n}it.prototype={constructor:it,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),o=r.content.slice();return i==-1?o.push(t||n,e):(o[i+1]=e,t&&(o[i]=t)),new it(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 it(t)},addToStart:function(n,e){return new it([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new it(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),o=r.find(n);return i.splice(o==-1?i.length:o,0,e,t),new it(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=it.from(n),n.size?new it(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=it.from(n),n.size?new it(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=it.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}},it.from=function(n){if(n instanceof it)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new it(e)};function wu(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i==o){t+=i.nodeSize;continue}if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let a=0;i.text[a]==o.text[a];a++)t++;return t}if(i.content.size||o.content.size){let a=wu(i.content,o.content,t+1);if(a!=null)return a}t+=i.nodeSize}}function ku(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:r};let a=n.child(--i),s=e.child(--o),c=a.nodeSize;if(a==s){t-=c,r-=c;continue}if(!a.sameMarkup(s))return{a:t,b:r};if(a.isText&&a.text!=s.text){let d=0,u=Math.min(a.text.length,s.text.length);for(;d<u&&a.text[a.text.length-d-1]==s.text[s.text.length-d-1];)d++,t--,r--;return{a:t,b:r}}if(a.content.size||s.content.size){let d=ku(a.content,s.content,t-1,r-1);if(d)return d}t-=c,r-=c}}class K{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,o){for(let a=0,s=0;s<t;a++){let c=this.content[a],d=s+c.nodeSize;if(d>e&&r(c,i+s,o||null,a)!==!1&&c.content.size){let u=s+1;c.nodesBetween(Math.max(0,e-u),Math.min(c.content.size,t-u),r,i+u)}s=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",a=!0;return this.nodesBetween(e,t,(s,c)=>{s.isText?(o+=s.text.slice(Math.max(e,c)-c,t-c),a=!r):s.isLeaf?(i?o+=typeof i=="function"?i(s):i:s.type.spec.leafText&&(o+=s.type.spec.leafText(s)),a=!r):!a&&s.isBlock&&(o+=r,a=!0)},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new K(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let o=0,a=0;a<t;o++){let s=this.content[o],c=a+s.nodeSize;c>e&&((a<e||c>t)&&(s.isText?s=s.cut(Math.max(0,e-a),Math.min(s.text.length,t-a)):s=s.cut(Math.max(0,e-a-1),Math.min(s.content.size,t-a-1))),r.push(s),i+=s.nodeSize),a=c}return new K(r,i)}cutByIndex(e,t){return e==t?K.empty:e==0&&t==this.content.length?this:new K(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new K(i,o)}addToStart(e){return new K([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new K(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return wu(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return ku(this,e,t,r)}findIndex(e,t=-1){if(e==0)return Yo(0,e);if(e==this.size)return Yo(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),a=i+o.nodeSize;if(a>=e)return a==e||t>0?Yo(r+1,a):Yo(r,i);i=a}}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 K.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new K(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return K.empty;let t,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(t||(t=e.slice(0,i)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new K(t||e,r)}static from(e){if(!e)return K.empty;if(e instanceof K)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new K([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}K.empty=new K([],0);const Fs={index:0,offset:0};function Yo(n,e){return Fs.index=n,Fs.offset=e,Fs}function Uo(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Uo(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Uo(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let Oe=class uc{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Uo(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);return r.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return uc.none;if(e instanceof uc)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};Oe.none=[];class jo extends Error{}class ie{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=Cu(this.content,e+this.openStart,t);return r&&new ie(r,this.openStart,this.openEnd)}removeBetween(e,t){return new ie(xu(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 ie.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ie(K.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new ie(e,r,i)}}ie.empty=new ie(K.empty,0,0);function xu(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:a,offset:s}=n.findIndex(t);if(i==e||o.isText){if(s!=t&&!n.child(a).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=a)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(xu(o.content,e-i-1,t-i-1)))}function Cu(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),a=n.maybeChild(i);if(o==e||a.isText)return r&&!r.canReplace(i,i,t)?null:n.cut(0,e).append(t).append(n.cut(e));let s=Cu(a.content,e-o-1,t);return s&&n.replaceChild(i,a.copy(s))}function rk(n,e,t){if(t.openStart>n.depth)throw new jo("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new jo("Inconsistent open depths");return Mu(n,e,t,0)}function Mu(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let a=Mu(n,e,t,r+1);return o.copy(o.content.replaceChild(i,a))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let a=n.parent,s=a.content;return br(a,s.cut(0,n.parentOffset).append(t.content).append(s.cut(e.parentOffset)))}else{let{start:a,end:s}=ik(t,n);return br(o,Su(n,a,s,e,r))}else return br(o,Wo(n,e,r))}function Tu(n,e){if(!e.type.compatibleContent(n.type))throw new jo("Cannot join "+e.type.name+" onto "+n.type.name)}function zs(n,e,t){let r=n.node(t);return Tu(r,e.node(t)),r}function vr(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 ji(n,e,t,r){let i=(e||n).node(t),o=0,a=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(vr(n.nodeAfter,r),o++));for(let s=o;s<a;s++)vr(i.child(s),r);e&&e.depth==t&&e.textOffset&&vr(e.nodeBefore,r)}function br(n,e){return n.type.checkContent(e),n.copy(e)}function Su(n,e,t,r,i){let o=n.depth>i&&zs(n,e,i+1),a=r.depth>i&&zs(t,r,i+1),s=[];return ji(null,n,i,s),o&&a&&e.index(i)==t.index(i)?(Tu(o,a),vr(br(o,Su(n,e,t,r,i+1)),s)):(o&&vr(br(o,Wo(n,e,i+1)),s),ji(e,t,i,s),a&&vr(br(a,Wo(t,r,i+1)),s)),ji(r,null,i,s),new K(s)}function Wo(n,e,t){let r=[];if(ji(null,n,t,r),n.depth>t){let i=zs(n,e,t+1);vr(br(i,Wo(n,e,t+1)),r)}return ji(e,null,t,r),new K(r)}function ik(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)i=e.node(o).copy(K.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class Wi{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Oe.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let s=r;r=i,i=s}let o=r.marks;for(var a=0;a<o.length;a++)o[a].type.spec.inclusive===!1&&(!i||!o[a].isInSet(i.marks))&&(o=o[a--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new qo(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,o=t;for(let a=e;;){let{index:s,offset:c}=a.content.findIndex(o),d=o-c;if(r.push(a,s,i+c),!d||(a=a.child(s),a.isText))break;o=d-1,i+=c+1}return new Wi(t,r,o)}static resolveCached(e,t){for(let i=0;i<Hs.length;i++){let o=Hs[i];if(o.pos==t&&o.doc==e)return o}let r=Hs[Ys]=Wi.resolve(e,t);return Ys=(Ys+1)%ok,r}}let Hs=[],Ys=0,ok=12;class qo{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const ak=Object.create(null);let wr=class fc{constructor(e,t,r,i=Oe.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||K.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,i=0){this.content.nodesBetween(e,t,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,i){return this.content.textBetween(e,t,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&Uo(this.attrs,t||e.defaultAttrs||ak)&&Oe.sameSet(this.marks,r||Oe.none)}copy(e=null){return e==this.content?this:new fc(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new fc(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return ie.empty;let i=this.resolve(e),o=this.resolve(t),a=r?0:i.sharedDepth(t),s=i.start(a),d=i.node(a).content.cut(i.pos-s,o.pos-s);return new ie(d,i.depth-a,o.depth-a)}replace(e,t,r){return rk(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return Wi.resolveCached(this,e)}resolveNoCache(e){return Wi.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Du(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=K.empty,i=0,o=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,i,o),s=a&&a.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let c=i;c<o;c++)if(!this.type.allowsMarks(r.child(c).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),a=o&&o.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content);let e=Oe.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!Oe.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=K.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};wr.prototype.text=void 0;class Ko extends wr{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Du(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 Ko(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Ko(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 Du(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class kr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new sk(e,t);if(r.next==null)return kr.empty;let i=Au(r);r.next&&r.err("Unexpected trailing text");let o=hk(pk(i));return mk(o,r),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let i=this;for(let o=t;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];function o(a,s){let c=a.matchFragment(e,r);if(c&&(!t||c.validEnd))return K.from(s.map(d=>d.createAndFill()));for(let d=0;d<a.next.length;d++){let{type:u,next:f}=a.next[d];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let p=o(f,s.concat(u));if(p)return p}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let a=[];for(let s=i;s.type;s=s.via)a.push(s.type);return a.reverse()}for(let a=0;a<o.next.length;a++){let{type:s,next:c}=o.next[a];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in t)&&(!i.type||c.validEnd)&&(r.push({match:s.contentMatch,type:s,via:i}),t[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}return t(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)o+=(a?", ":"")+r.next[a].type.name+"->"+e.indexOf(r.next[a].next);return o}).join(`
73
- `)}}kr.empty=new kr(!0);class sk{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 Au(n){let e=[];do e.push(lk(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function lk(n){let e=[];do e.push(ck(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function ck(n){let e=fk(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=dk(n,e);else break;return e}function Eu(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function dk(n,e){let t=Eu(n),r=t;return n.eat(",")&&(n.next!="}"?r=Eu(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function uk(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let o in t){let a=t[o];a.groups.indexOf(e)>-1&&i.push(a)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function fk(n){if(n.eat("(")){let e=Au(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=uk(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 pk(n){let e=[[]];return i(o(n,0),t()),e;function t(){return e.push([])-1}function r(a,s,c){let d={term:c,to:s};return e[a].push(d),d}function i(a,s){a.forEach(c=>c.to=s)}function o(a,s){if(a.type=="choice")return a.exprs.reduce((c,d)=>c.concat(o(d,s)),[]);if(a.type=="seq")for(let c=0;;c++){let d=o(a.exprs[c],s);if(c==a.exprs.length-1)return d;i(d,s=t())}else if(a.type=="star"){let c=t();return r(s,c),i(o(a.expr,c),c),[r(c)]}else if(a.type=="plus"){let c=t();return i(o(a.expr,s),c),i(o(a.expr,c),c),[r(c)]}else{if(a.type=="opt")return[r(s)].concat(o(a.expr,s));if(a.type=="range"){let c=s;for(let d=0;d<a.min;d++){let u=t();i(o(a.expr,c),u),c=u}if(a.max==-1)i(o(a.expr,c),c);else for(let d=a.min;d<a.max;d++){let u=t();r(c,u),i(o(a.expr,c),u),c=u}return[r(c)]}else{if(a.type=="name")return[r(s,void 0,a.value)];throw new Error("Unknown expr type")}}}}function Ou(n,e){return e-n}function Nu(n,e){let t=[];return r(e),t.sort(Ou);function r(i){let o=n[i];if(o.length==1&&!o[0].term)return r(o[0].to);t.push(i);for(let a=0;a<o.length;a++){let{term:s,to:c}=o[a];!s&&t.indexOf(c)==-1&&r(c)}}}function hk(n){let e=Object.create(null);return t(Nu(n,0));function t(r){let i=[];r.forEach(a=>{n[a].forEach(({term:s,to:c})=>{if(!s)return;let d;for(let u=0;u<i.length;u++)i[u][0]==s&&(d=i[u][1]);Nu(n,c).forEach(u=>{d||i.push([s,d=[]]),d.indexOf(u)==-1&&d.push(u)})})});let o=e[r.join(",")]=new kr(r.indexOf(n.length-1)>-1);for(let a=0;a<i.length;a++){let s=i[a][1].sort(Ou);o.next.push({type:i[a][0],next:e[s.join(",")]||t(s)})}return o}}function mk(n,e){for(let t=0,r=[n];t<r.length;t++){let i=r[t],o=!i.validEnd,a=[];for(let s=0;s<i.next.length;s++){let{type:c,next:d}=i.next[s];a.push(c.name),o&&!(c.isText||c.hasRequiredAttrs())&&(o=!1),r.indexOf(d)==-1&&r.push(d)}o&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function _u(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function Bu(n,e){let t=Object.create(null);for(let r in n){let i=e&&e[r];if(i===void 0){let o=n[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=i}return t}function Pu(n){let e=Object.create(null);if(n)for(let t in n)e[t]=new gk(n[t]);return e}let Iu=class Yh{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Pu(r.attrs),this.defaultAttrs=_u(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==kr.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}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:Bu(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new wr(this,this.computeAttrs(e),K.from(t),Oe.setFrom(r))}createChecked(e=null,t,r){return t=K.from(t),this.checkContent(t),new wr(this,this.computeAttrs(e),t,Oe.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=K.from(t),t.size){let a=this.contentMatch.fillBefore(t);if(!a)return null;t=a.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(K.empty,!0);return o?new wr(this,e,t.append(o),Oe.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:Oe.none:e}static compile(e,t){let r=Object.create(null);e.forEach((o,a)=>r[o]=new Yh(o,t,a));let i=t.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class gk{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Go{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=Pu(i.attrs),this.excluded=null;let o=_u(this.attrs);this.instance=o?new Oe(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Oe(this,Bu(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,a)=>r[o]=new Go(o,i++,t,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}class yk{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=it.from(e.nodes),t.marks=it.from(e.marks||{}),this.nodes=Iu.compile(this.spec.nodes,this),this.marks=Go.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],a=o.spec.content||"",s=o.spec.marks;o.contentMatch=r[a]||(r[a]=kr.parse(a,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=s=="_"?null:s?Ru(this,s.split(" ")):s==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],a=o.spec.excludes;o.excluded=a==null?[o]:a==""?[]:Ru(this,a.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Iu){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,i)}text(e,t){let r=this.nodes.text;return new Ko(r,r.defaultAttrs,e,Oe.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return wr.fromJSON(this,e)}markFromJSON(e){return Oe.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Ru(n,e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],o=n.marks[i],a=o;if(o)t.push(o);else for(let s in n.marks){let c=n.marks[s];(i=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(i)>-1)&&t.push(a=c)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}class Xr{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=e.nodes[r.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let r=new Fu(this,t,!1);return r.addAll(e,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new Fu(this,t,!0);return r.addAll(e,t.from,t.to),ie.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(wk(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||t.matchesContext(o.context))){if(o.getAttrs){let a=o.getAttrs(e);if(a===!1)continue;o.attrs=a||void 0}return o}}}matchStyle(e,t,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let a=this.styles[o],s=a.style;if(!(s.indexOf(e)!=0||a.context&&!r.matchesContext(a.context)||s.length>e.length&&(s.charCodeAt(e.length)!=61||s.slice(e.length+1)!=t))){if(a.getAttrs){let c=a.getAttrs(t);if(c===!1)continue;a.attrs=c||void 0}return a}}}static schemaRules(e){let t=[];function r(i){let o=i.priority==null?50:i.priority,a=0;for(;a<t.length;a++){let s=t[a];if((s.priority==null?50:s.priority)<o)break}t.splice(a,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(a=>{r(a=zu(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(a=>{r(a=zu(a)),a.node||a.ignore||a.mark||(a.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Xr(e,Xr.schemaRules(e)))}}const Vu={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},vk={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Lu={ol:!0,ul:!0},Qo=1,Jo=2,qi=4;function $u(n,e,t){return e!=null?(e?Qo:0)|(e==="full"?Jo:0):n&&n.whitespace=="pre"?Qo|Jo:t&~qi}class Xo{constructor(e,t,r,i,o,a,s){this.type=e,this.attrs=t,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=s,this.content=[],this.activeMarks=Oe.none,this.stashMarks=[],this.match=a||(s&qi?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(K.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Qo)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let t=K.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(K.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,r=this.pendingMarks;t<r.length;t++){let i=r[t];(this.type?this.type.allowsMarkType(i.type):xk(i.type,e))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Vu.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Fu{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0;let i=t.topNode,o,a=$u(null,t.preserveWhitespace,0)|(r?qi:0);i?o=new Xo(i.type,i.attrs,Oe.none,Oe.none,!0,t.topMatch||i.type.contentMatch,a):r?o=new Xo(null,null,Oe.none,Oe.none,!0,null,a):o=new Xo(e.schema.topNodeType,null,Oe.none,Oe.none,!0,null,a),this.nodes=[o],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){e.nodeType==3?this.addTextNode(e):e.nodeType==1&&this.addElement(e)}withStyleRules(e,t){let r=e.getAttribute("style");if(!r)return t();let i=this.readStyles(kk(r));if(!i)return;let[o,a]=i,s=this.top;for(let c=0;c<a.length;c++)this.removePendingMark(a[c],s);for(let c=0;c<o.length;c++)this.addPendingMark(o[c]);t();for(let c=0;c<o.length;c++)this.removePendingMark(o[c],s);for(let c=0;c<a.length;c++)this.addPendingMark(a[c])}addTextNode(e){let t=e.nodeValue,r=this.top;if(r.options&Jo||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(r.options&Qo)r.options&Jo?t=t.replace(/\r\n?/g,`
74
- `):t=t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let i=r.content[r.content.length-1],o=e.previousSibling;(!i||o&&o.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let r=e.nodeName.toLowerCase(),i;Lu.hasOwnProperty(r)&&this.parser.normalizeLists&&bk(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,t));if(o?o.ignore:vk.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);let a,s=this.top,c=this.needsBlock;if(Vu.hasOwnProperty(r))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),a=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e);return}o&&o.skip?this.addAll(e):this.withStyleRules(e,()=>this.addAll(e)),a&&this.sync(s),this.needsBlock=c}else this.withStyleRules(e,()=>{this.addElementByRule(e,o,o.consuming===!1?i:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
75
- `))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=Oe.none,r=Oe.none;for(let i=0;i<e.length;i+=2)for(let o=void 0;;){let a=this.parser.matchStyle(e[i],e[i+1],this,o);if(!a)break;if(a.ignore)return null;if(a.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(s=>{a.clearMark(s)&&(r=s.addToSet(r))}):t=this.parser.schema.marks[a.mark].create(a.attrs).addToSet(t),a.consuming===!1)o=a;else break}return[t,r]}addElementByRule(e,t,r){let i,o,a;t.node?(o=this.parser.schema.nodes[t.node],o.isLeaf?this.insertNode(o.create(t.attrs))||this.leafFallback(e):i=this.enter(o,t.attrs||null,t.preserveWhitespace)):(a=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(a));let s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c));else{let c=e;typeof t.contentElement=="string"?c=e.querySelector(t.contentElement):typeof t.contentElement=="function"?c=t.contentElement(e):t.contentElement&&(c=t.contentElement),this.findAround(e,c,!0),this.addAll(c)}i&&this.sync(s)&&this.open--,a&&this.removePendingMark(a,s)}addAll(e,t,r){let i=t||0;for(let o=t?e.childNodes[t]:e.firstChild,a=r==null?null:e.childNodes[r];o!=a;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let t,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],a=o.findWrapping(e);if(a&&(!t||t.length>a.length)&&(t=a,r=o,!a.length)||o.solid)break}if(!t)return!1;this.sync(r);for(let i=0;i<t.length;i++)this.enterInner(t[i],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let r=t.activeMarks;for(let i=0;i<e.marks.length;i++)(!t.type||t.type.allowsMarkType(e.marks[i].type))&&(r=e.marks[i].addToSet(r));return t.content.push(e.mark(r)),!0}return!1}enter(e,t,r){let i=this.findPlace(e.create(t));return i&&this.enterInner(e,t,!0,r),i}enterInner(e,t=null,r=!1,i){this.closeExtra();let o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);let a=$u(e,i,o.options);o.options&qi&&o.content.length==0&&(a|=qi),this.nodes.push(new Xo(e,t,o.activeMarks,o.pendingMarks,r,null,a)),this.open++}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;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),a=(s,c)=>{for(;s>=0;s--){let d=t[s];if(d==""){if(s==t.length-1||s==0)continue;for(;c>=o;c--)if(a(s-1,c))return!0;return!1}else{let u=c>0||c==0&&i?this.nodes[c].type:r&&c>=o?r.node(c-o).type:null;if(!u||u.name!=d&&u.groups.indexOf(d)==-1)return!1;c--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let t=Ck(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let a=i.popFromStashMark(e);a&&i.type&&i.type.allowsMarkType(a.type)&&(i.activeMarks=a.addToSet(i.activeMarks))}if(i==t)break}}}function bk(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Lu.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function wk(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function kk(n){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,t,r=[];for(;t=e.exec(n);)r.push(t[1],t[2].trim());return r}function zu(n){let e={};for(let t in n)e[t]=n[t];return e}function xk(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],a=s=>{o.push(s);for(let c=0;c<s.edgeCount;c++){let{type:d,next:u}=s.edge(c);if(d==e||o.indexOf(u)<0&&a(u))return!0}};if(a(i.contentMatch))return!0}}function Ck(n,e){for(let t=0;t<e.length;t++)if(n.eq(e[t]))return e[t]}class fn{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Us(t).createDocumentFragment());let i=r,o=[];return e.forEach(a=>{if(o.length||a.marks.length){let s=0,c=0;for(;s<o.length&&c<a.marks.length;){let d=a.marks[c];if(!this.marks[d.type.name]){c++;continue}if(!d.eq(o[s][0])||d.type.spec.spanning===!1)break;s++,c++}for(;s<o.length;)i=o.pop()[1];for(;c<a.marks.length;){let d=a.marks[c++],u=this.serializeMark(d,a.isInline,t);u&&(o.push([d,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(a,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:i}=fn.renderSpec(Us(t),this.nodes[e.type.name](e));if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&fn.renderSpec(Us(r),i(e,t))}static renderSpec(e,t,r=null){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let a,s=r?e.createElementNS(r,i):e.createElement(i),c=t[1],d=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){d=2;for(let u in c)if(c[u]!=null){let f=u.indexOf(" ");f>0?s.setAttributeNS(u.slice(0,f),u.slice(f+1),c[u]):s.setAttribute(u,c[u])}}for(let u=d;u<t.length;u++){let f=t[u];if(f===0){if(u<t.length-1||u>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}else{let{dom:p,contentDOM:h}=fn.renderSpec(e,f,r);if(s.appendChild(p),h){if(a)throw new RangeError("Multiple content holes");a=h}}}return{dom:s,contentDOM:a}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new fn(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Hu(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Hu(e.marks)}}function Hu(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Us(n){return n.document||window.document}const Yu=65535,Uu=Math.pow(2,16);function Mk(n,e){return n+e*Uu}function ju(n){return n&Yu}function Tk(n){return(n-(n&Yu))/Uu}const Wu=1,qu=2,Zo=4,Ku=8;class js{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Ku)>0}get deletedBefore(){return(this.delInfo&(Wu|Zo))>0}get deletedAfter(){return(this.delInfo&(qu|Zo))>0}get deletedAcross(){return(this.delInfo&Zo)>0}}class Et{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Et.empty)return Et.empty}recover(e){let t=0,r=ju(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+t+Tk(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let c=this.ranges[s]-(this.inverted?i:0);if(c>e)break;let d=this.ranges[s+o],u=this.ranges[s+a],f=c+d;if(e<=f){let p=d?e==c?-1:e==f?1:t:t,h=c+i+(p<0?0:u);if(r)return h;let m=e==(t<0?c:f)?null:Mk(s/3,e-c),g=e==c?qu:e==f?Wu:Zo;return(t<0?e!=c:e!=f)&&(g|=Ku),new js(h,g,m)}i+=u-d}return r?e+i:new js(e+i,0,null)}touches(e,t){let r=0,i=ju(t),o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let c=this.ranges[s]-(this.inverted?r:0);if(c>e)break;let d=this.ranges[s+o],u=c+d;if(e<=u&&s==i*3)return!0;r+=this.ranges[s+a]-d}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],s=a-(this.inverted?o:0),c=a+(this.inverted?0:o),d=this.ranges[i+t],u=this.ranges[i+r];e(s,s+d,c,c+u),o+=u-d}}invert(){return new Et(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Et.empty:new Et(e<0?[0,-e,0]:[0,0,e])}}Et.empty=new Et([]);class Zr{constructor(e=[],t,r=0,i=e.length){this.maps=e,this.mirror=t,this.from=r,this.to=i}slice(e=0,t=this.maps.length){return new Zr(this.maps,this.mirror,e,t)}copy(){return new Zr(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),t!=null&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,r=this.maps.length;t<e.maps.length;t++){let i=e.getMirror(t);this.appendMap(e.maps[t],i!=null&&i<t?r+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this.maps.length+e.maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new Zr;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let i=0;for(let o=this.from;o<this.to;o++){let a=this.maps[o],s=a.mapResult(e,t);if(s.recover!=null){let c=this.getMirror(o);if(c!=null&&c>o&&c<this.to){o=c,e=this.maps[c].recover(s.recover);continue}}i|=s.delInfo,e=s.pos}return r?e:new js(e,i,null)}}const Ws=Object.create(null);class ct{getMap(){return Et.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Ws[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Ws)throw new RangeError("Duplicate use of step JSON ID "+e);return Ws[e]=t,t.prototype.jsonID=e,t}}class je{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new je(e,null)}static fail(e){return new je(null,e)}static fromReplace(e,t,r,i){try{return je.ok(e.replace(t,r,i))}catch(o){if(o instanceof jo)return je.fail(o.message);throw o}}}function qs(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(qs(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return K.fromArray(r)}class Yn extends ct{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new ie(qs(t.content,(a,s)=>!a.isAtom||!s.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),t.openStart,t.openEnd);return je.fromReplace(e,this.from,this.to,o)}invert(){return new pn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Yn(t.pos,r.pos,this.mark)}merge(e){return e instanceof Yn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Yn(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 Yn(t.from,t.to,e.markFromJSON(t.mark))}}ct.jsonID("addMark",Yn);class pn extends ct{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new ie(qs(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return je.fromReplace(e,this.from,this.to,r)}invert(){return new Yn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new pn(t.pos,r.pos,this.mark)}merge(e){return e instanceof pn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new pn(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 pn(t.from,t.to,e.markFromJSON(t.mark))}}ct.jsonID("removeMark",pn);class Un extends ct{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return je.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return je.fromReplace(e,this.pos,this.pos+1,new ie(K.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new Un(this.pos,t.marks[i]);return new Un(this.pos,this.mark)}}return new ei(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Un(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 Un(t.pos,e.markFromJSON(t.mark))}}ct.jsonID("addNodeMark",Un);class ei extends ct{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return je.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return je.fromReplace(e,this.pos,this.pos+1,new ie(K.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Un(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ei(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 ei(t.pos,e.markFromJSON(t.mark))}}ct.jsonID("removeNodeMark",ei);class ot extends ct{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&Ks(e,this.from,this.to)?je.fail("Structure replace would overwrite content"):je.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Et([this.from,this.to-this.from,this.slice.size])}invert(e){return new ot(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new ot(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof ot)||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?ie.empty:new ie(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new ot(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?ie.empty:new ie(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new ot(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 ot(t.from,t.to,ie.fromJSON(e,t.slice),!!t.structure)}}ct.jsonID("replace",ot);class Ze extends ct{constructor(e,t,r,i,o,a,s=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=a,this.structure=s}apply(e){if(this.structure&&(Ks(e,this.from,this.gapFrom)||Ks(e,this.gapTo,this.to)))return je.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return je.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?je.fromReplace(e,this.from,this.to,r):je.fail("Content does not fit in gap")}getMap(){return new Et([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 Ze(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=e.map(this.gapFrom,-1),o=e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||o>r.pos?null:new Ze(t.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ze(t.from,t.to,t.gapFrom,t.gapTo,ie.fromJSON(e,t.slice),t.insert,!!t.structure)}}ct.jsonID("replaceAround",Ze);function Ks(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function Sk(n,e,t,r){let i=[],o=[],a,s;n.doc.nodesBetween(e,t,(c,d,u)=>{if(!c.isInline)return;let f=c.marks;if(!r.isInSet(f)&&u.type.allowsMarkType(r.type)){let p=Math.max(d,e),h=Math.min(d+c.nodeSize,t),m=r.addToSet(f);for(let g=0;g<f.length;g++)f[g].isInSet(m)||(a&&a.to==p&&a.mark.eq(f[g])?a.to=h:i.push(a=new pn(p,h,f[g])));s&&s.to==p?s.to=h:o.push(s=new Yn(p,h,r))}}),i.forEach(c=>n.step(c)),o.forEach(c=>n.step(c))}function Dk(n,e,t,r){let i=[],o=0;n.doc.nodesBetween(e,t,(a,s)=>{if(!a.isInline)return;o++;let c=null;if(r instanceof Go){let d=a.marks,u;for(;u=r.isInSet(d);)(c||(c=[])).push(u),d=u.removeFromSet(d)}else r?r.isInSet(a.marks)&&(c=[r]):c=a.marks;if(c&&c.length){let d=Math.min(s+a.nodeSize,t);for(let u=0;u<c.length;u++){let f=c[u],p;for(let h=0;h<i.length;h++){let m=i[h];m.step==o-1&&f.eq(i[h].style)&&(p=m)}p?(p.to=d,p.step=o):i.push({style:f,from:Math.max(s,e),to:d,step:o})}}}),i.forEach(a=>n.step(new pn(a.from,a.to,a.style)))}function Ak(n,e,t,r=t.contentMatch){let i=n.doc.nodeAt(e),o=[],a=e+1;for(let s=0;s<i.childCount;s++){let c=i.child(s),d=a+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new ot(a,d,ie.empty));else{r=u;for(let f=0;f<c.marks.length;f++)t.allowsMarkType(c.marks[f].type)||n.step(new pn(a,d,c.marks[f]));if(c.isText&&!t.spec.code){let f,p=/\r?\n|\r/g,h;for(;f=p.exec(c.text);)h||(h=new ie(K.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),o.push(new ot(a+f.index,a+f.index+f[0].length,h))}}a=d}if(!r.validEnd){let s=r.fillBefore(K.empty,!0);n.replace(a,a,new ie(s,0,0))}for(let s=o.length-1;s>=0;s--)n.step(o[s])}function Ek(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function ti(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let i=n.$from.node(r),o=n.$from.index(r),a=n.$to.indexAfter(r);if(r<n.depth&&i.canReplace(o,a,t))return r;if(r==0||i.type.spec.isolating||!Ek(i,o,a))break}return null}function Ok(n,e,t){let{$from:r,$to:i,depth:o}=e,a=r.before(o+1),s=i.after(o+1),c=a,d=s,u=K.empty,f=0;for(let m=o,g=!1;m>t;m--)g||r.index(m)>0?(g=!0,u=K.from(r.node(m).copy(u)),f++):c--;let p=K.empty,h=0;for(let m=o,g=!1;m>t;m--)g||i.after(m+1)<i.end(m)?(g=!0,p=K.from(i.node(m).copy(p)),h++):d++;n.step(new Ze(c,d,a,s,new ie(u.append(p),f,h),u.size-f,!0))}function Gs(n,e,t=null,r=n){let i=Nk(n,e),o=i&&_k(r,e);return o?i.map(Gu).concat({type:e,attrs:t}).concat(o.map(Gu)):null}function Gu(n){return{type:n,attrs:null}}function Nk(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.contentMatchAt(r).findWrapping(e);if(!o)return null;let a=o.length?o[0]:e;return t.canReplaceWith(r,i,a)?o:null}function _k(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.child(r),a=e.contentMatch.findWrapping(o.type);if(!a)return null;let c=(a.length?a[a.length-1]:e).contentMatch;for(let d=r;c&&d<i;d++)c=c.matchType(t.child(d).type);return!c||!c.validEnd?null:a}function Bk(n,e,t){let r=K.empty;for(let a=t.length-1;a>=0;a--){if(r.size){let s=t[a].type.contentMatch.matchFragment(r);if(!s||!s.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=K.from(t[a].type.create(t[a].attrs,r))}let i=e.start,o=e.end;n.step(new Ze(i,o,i,o,new ie(r,0,0),t.length,!0))}function Pk(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=n.steps.length;n.doc.nodesBetween(e,t,(a,s)=>{if(a.isTextblock&&!a.hasMarkup(r,i)&&Ik(n.doc,n.mapping.slice(o).map(s),r)){n.clearIncompatible(n.mapping.slice(o).map(s,1),r);let c=n.mapping.slice(o),d=c.map(s,1),u=c.map(s+a.nodeSize,1);return n.step(new Ze(d,u,d+1,u-1,new ie(K.from(r.create(i,null,a.marks)),0,0),1,!0)),!1}})}function Ik(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function Rk(n,e,t,r,i){let o=n.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");t||(t=o.type);let a=t.create(r,null,i||o.marks);if(o.isLeaf)return n.replaceWith(e,e+o.nodeSize,a);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new Ze(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new ie(K.from(a),0,0),1,!0))}function ni(n,e,t=1,r){let i=n.resolve(e),o=i.depth-t,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,u=t-2;d>o;d--,u--){let f=i.node(d),p=i.index(d);if(f.type.spec.isolating)return!1;let h=f.content.cutByIndex(p,f.childCount),m=r&&r[u+1];m&&(h=h.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[u]||f;if(!f.canReplace(p+1,f.childCount)||!g.type.validContent(h))return!1}let s=i.indexAfter(o),c=r&&r[0];return i.node(o).canReplaceWith(s,s,c?c.type:i.node(o+1).type)}function Vk(n,e,t=1,r){let i=n.doc.resolve(e),o=K.empty,a=K.empty;for(let s=i.depth,c=i.depth-t,d=t-1;s>c;s--,d--){o=K.from(i.node(s).copy(o));let u=r&&r[d];a=K.from(u?u.type.create(u.attrs,a):i.node(s).copy(a))}n.step(new ot(e,e,new ie(o.append(a),t,t),!0))}function jn(n,e){let t=n.resolve(e),r=t.index();return Qu(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function Qu(n,e){return!!(n&&e&&!n.isLeaf&&n.canAppend(e))}function ea(n,e,t=-1){let r=n.resolve(e);for(let i=r.depth;;i--){let o,a,s=r.index(i);if(i==r.depth?(o=r.nodeBefore,a=r.nodeAfter):t>0?(o=r.node(i+1),s++,a=r.node(i).maybeChild(s)):(o=r.node(i).maybeChild(s-1),a=r.node(i+1)),o&&!o.isTextblock&&Qu(o,a)&&r.node(i).canReplace(s,s+1))return e;if(i==0)break;e=t<0?r.before(i):r.after(i)}}function Lk(n,e,t){let r=new ot(e-t,e+t,ie.empty,!0);n.step(r)}function $k(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,t))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,t))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function Ju(n,e,t){let r=n.resolve(e);if(!t.content.size)return e;let i=t.content;for(let o=0;o<t.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(t.openStart==0&&t.size?2:1);o++)for(let a=r.depth;a>=0;a--){let s=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,c=r.index(a)+(s>0?1:0),d=r.node(a),u=!1;if(o==1)u=d.canReplace(c,c,i);else{let f=d.contentMatchAt(c).findWrapping(i.firstChild.type);u=f&&d.canReplaceWith(c,c,f[0])}if(u)return s==0?r.pos:s<0?r.before(a+1):r.after(a+1)}return null}function Qs(n,e,t=e,r=ie.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),o=n.resolve(t);return Xu(i,o,r)?new ot(e,t,r):new Fk(i,o,r).fit()}function Xu(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class Fk{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=K.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=K.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,a=r.depth,s=i.depth;for(;a&&s&&o.childCount==1;)o=o.firstChild.content,a--,s--;let c=new ie(o,a,s);return e>-1?new Ze(r.pos,e,this.$to.pos,this.$to.end(),c,t):c.size||r.pos!=this.$to.pos?new ot(r.pos,i.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let o=t.firstChild;if(t.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}t=o.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=Js(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let a=i.firstChild;for(let s=this.depth;s>=0;s--){let{type:c,match:d}=this.frontier[s],u,f=null;if(t==1&&(a?d.matchType(a.type)||(f=d.fillBefore(K.from(a),!1)):o&&c.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:s,parent:o,inject:f};if(t==2&&a&&(u=d.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:s,parent:o,wrap:u};if(o&&d.matchType(o.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=Js(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new ie(e,t+1,Math.max(r,i.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=Js(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new ie(Ki(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new ie(Ki(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let g=0;g<o.length;g++)this.openFrontierNode(o[g]);let a=this.unplaced,s=r?r.content:a.content,c=a.openStart-e,d=0,u=[],{match:f,type:p}=this.frontier[t];if(i){for(let g=0;g<i.childCount;g++)u.push(i.child(g));f=f.matchFragment(i)}let h=s.size+e-(a.content.size-a.openEnd);for(;d<s.childCount;){let g=s.child(d),k=f.matchType(g.type);if(!k)break;d++,(d>1||c==0||g.content.size)&&(f=k,u.push(Zu(g.mark(p.allowedMarks(g.marks)),d==1?c:0,d==s.childCount?h:-1)))}let m=d==s.childCount;m||(h=-1),this.placed=Gi(this.placed,t,K.from(u)),this.frontier[t].match=f,m&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,k=s;g<h;g++){let x=k.lastChild;this.frontier.push({type:x.type,match:x.contentMatchAt(x.childCount)}),k=x.content}this.unplaced=m?e==0?ie.empty:new ie(Ki(a.content,e-1,1),e-1,h<0?a.openEnd:e-1):new ie(Ki(a.content,e,d),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!Xs(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:i}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=Xs(e,t,i,r,o);if(a){for(let s=t-1;s>=0;s--){let{match:c,type:d}=this.frontier[s],u=Xs(e,s,d,c,!0);if(!u||u.childCount)continue e}return{depth:t,fit:a,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Gi(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Gi(this.placed,this.depth,K.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(K.empty,!0);t.childCount&&(this.placed=Gi(this.placed,this.frontier.length,t))}}function Ki(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Ki(n.firstChild.content,e-1,t)))}function Gi(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Gi(n.lastChild.content,e-1,t)))}function Js(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function Zu(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,Zu(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(K.empty,!0)))),n.copy(r)}function Xs(n,e,t,r,i){let o=n.node(e),a=i?n.indexAfter(e):n.index(e);if(a==o.childCount&&!t.compatibleContent(o.type))return null;let s=r.fillBefore(o.content,!0,a);return s&&!zk(t,o.content,a)?s:null}function zk(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function Hk(n){return n.spec.defining||n.spec.definingForContent}function Yk(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let i=n.doc.resolve(e),o=n.doc.resolve(t);if(Xu(i,o,r))return n.step(new ot(e,t,r));let a=tf(i,n.doc.resolve(t));a[a.length-1]==0&&a.pop();let s=-(i.depth+1);a.unshift(s);for(let p=i.depth,h=i.pos-1;p>0;p--,h--){let m=i.node(p).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;a.indexOf(p)>-1?s=p:i.before(p)==h&&a.splice(1,0,-p)}let c=a.indexOf(s),d=[],u=r.openStart;for(let p=r.content,h=0;;h++){let m=p.firstChild;if(d.push(m),h==r.openStart)break;p=m.content}for(let p=u-1;p>=0;p--){let h=d[p],m=Hk(h.type);if(m&&!h.sameMarkup(i.node(Math.abs(s)-1)))u=p;else if(m||!h.type.isTextblock)break}for(let p=r.openStart;p>=0;p--){let h=(p+u+1)%(r.openStart+1),m=d[h];if(m)for(let g=0;g<a.length;g++){let k=a[(g+c)%a.length],x=!0;k<0&&(x=!1,k=-k);let S=i.node(k-1),T=i.index(k-1);if(S.canReplaceWith(T,T,m.type,m.marks))return n.replace(i.before(k),x?o.after(k):t,new ie(ef(r.content,0,r.openStart,h),h,r.openEnd))}}let f=n.steps.length;for(let p=a.length-1;p>=0&&(n.replace(e,t,r),!(n.steps.length>f));p--){let h=a[p];h<0||(e=i.before(h),t=o.after(h))}}function ef(n,e,t,r,i){if(e<t){let o=n.firstChild;n=n.replaceChild(0,o.copy(ef(o.content,e+1,t,r,o)))}if(e>r){let o=i.contentMatchAt(0),a=o.fillBefore(n).append(n);n=a.append(o.matchFragment(a).fillBefore(K.empty,!0))}return n}function Uk(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=$k(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new ie(K.from(r),0,0))}function jk(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),o=tf(r,i);for(let a=0;a<o.length;a++){let s=o[a],c=a==o.length-1;if(c&&s==0||r.node(s).type.contentMatch.validEnd)return n.delete(r.start(s),i.end(s));if(s>0&&(c||r.node(s-1).canReplace(r.index(s-1),i.indexAfter(s-1))))return n.delete(r.before(s),i.after(s))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(e-r.start(a)==r.depth-a&&t>r.end(a)&&i.end(a)-t!=i.depth-a)return n.delete(r.before(a),t);n.delete(e,t)}function tf(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let i=r;i>=0;i--){let o=n.start(i);if(o<n.pos-(n.depth-i)||e.end(i)>e.pos+(e.depth-i)||n.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==n.depth&&i==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&t.push(i)}return t}class ri extends ct{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return je.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return je.fromReplace(e,this.pos,this.pos+1,new ie(K.from(i),0,t.isLeaf?0:1))}getMap(){return Et.empty}invert(e){return new ri(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ri(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new ri(t.pos,t.attr,t.value)}}ct.jsonID("attr",ri);class Qi extends ct{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return je.ok(r)}getMap(){return Et.empty}invert(e){return new Qi(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Qi(t.attr,t.value)}}ct.jsonID("docAttr",Qi);let ii=class extends Error{};ii=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},ii.prototype=Object.create(Error.prototype),ii.prototype.constructor=ii,ii.prototype.name="TransformError";class Wk{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Zr}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new ii(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=ie.empty){let i=Qs(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new ie(K.from(r),0,0))}delete(e,t){return this.replace(e,t,ie.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return Yk(this,e,t,r),this}replaceRangeWith(e,t,r){return Uk(this,e,t,r),this}deleteRange(e,t){return jk(this,e,t),this}lift(e,t){return Ok(this,e,t),this}join(e,t=1){return Lk(this,e,t),this}wrap(e,t){return Bk(this,e,t),this}setBlockType(e,t=e,r,i=null){return Pk(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i){return Rk(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new ri(e,t,r)),this}setDocAttribute(e,t){return this.step(new Qi(e,t)),this}addNodeMark(e,t){return this.step(new Un(e,t)),this}removeNodeMark(e,t){if(!(t instanceof Oe)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t=t.isInSet(r.marks),!t)return this}return this.step(new ei(e,t)),this}split(e,t=1,r){return Vk(this,e,t,r),this}addMark(e,t,r){return Sk(this,e,t,r),this}removeMark(e,t,r){return Dk(this,e,t,r),this}clearIncompatible(e,t,r){return Ak(this,e,t,r),this}}const Zs=Object.create(null);class ye{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new qk(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=ie.empty){let r=t.content.lastChild,i=null;for(let s=0;s<t.openEnd;s++)i=r,r=r.lastChild;let o=e.steps.length,a=this.ranges;for(let s=0;s<a.length;s++){let{$from:c,$to:d}=a[s],u=e.mapping.slice(o);e.replaceRange(u.map(c.pos),u.map(d.pos),s?ie.empty:t),s==0&&of(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:a,$to:s}=i[o],c=e.mapping.slice(r),d=c.map(a.pos),u=c.map(s.pos);o?e.deleteRange(d,u):(e.replaceRangeWith(d,u,t),of(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new ge(e):oi(e.node(0),e.parent,e.pos,e.index(),t,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let a=t<0?oi(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):oi(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,r);if(a)return a}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Jt(e.node(0))}static atStart(e){return oi(e,e,0,0,1)||new Jt(e)}static atEnd(e){return oi(e,e,e.content.size,e.childCount,-1)||new Jt(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Zs[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Zs)throw new RangeError("Duplicate use of selection JSON ID "+e);return Zs[e]=t,t.prototype.jsonID=e,t}getBookmark(){return ge.between(this.$anchor,this.$head).getBookmark()}}ye.prototype.visible=!0;class qk{constructor(e,t){this.$from=e,this.$to=t}}let nf=!1;function rf(n){!nf&&!n.parent.inlineContent&&(nf=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class ge extends ye{constructor(e,t=e){rf(e),rf(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return ye.near(r);let i=e.resolve(t.map(this.anchor));return new ge(i.parent.inlineContent?i:r,r)}replace(e,t=ie.empty){if(super.replace(e,t),t==ie.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof ge&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ta(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new ge(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let i=e.resolve(t);return new this(i,r==t?i:e.resolve(r))}static between(e,t,r){let i=e.pos-t.pos;if((!r||i)&&(r=i>=0?1:-1),!t.parent.inlineContent){let o=ye.findFrom(t,r,!0)||ye.findFrom(t,-r,!0);if(o)t=o.$head;else return ye.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(ye.findFrom(e,-r,!0)||ye.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new ge(e,t)}}ye.jsonID("text",ge);class ta{constructor(e,t){this.anchor=e,this.head=t}map(e){return new ta(e.map(this.anchor),e.map(this.head))}resolve(e){return ge.between(e.resolve(this.anchor),e.resolve(this.head))}}class he extends ye{constructor(e){let t=e.nodeAfter,r=e.node(0).resolve(e.pos+t.nodeSize);super(e,r),this.node=t}map(e,t){let{deleted:r,pos:i}=t.mapResult(this.anchor),o=e.resolve(i);return r?ye.near(o):new he(o)}content(){return new ie(K.from(this.node),0,0)}eq(e){return e instanceof he&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new el(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new he(e.resolve(t.anchor))}static create(e,t){return new he(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}he.prototype.visible=!1,ye.jsonID("node",he);class el{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new ta(r,r):new el(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&he.isSelectable(r)?new he(t):ye.near(t)}}class Jt extends ye{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=ie.empty){if(t==ie.empty){e.delete(0,e.doc.content.size);let r=ye.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Jt(e)}map(e){return new Jt(e)}eq(e){return e instanceof Jt}getBookmark(){return Kk}}ye.jsonID("all",Jt);const Kk={map(){return this},resolve(n){return new Jt(n)}};function oi(n,e,t,r,i,o=!1){if(e.inlineContent)return ge.create(n,t);for(let a=r-(i>0?0:1);i>0?a<e.childCount:a>=0;a+=i){let s=e.child(a);if(s.isAtom){if(!o&&he.isSelectable(s))return he.create(n,t-(i<0?s.nodeSize:0))}else{let c=oi(n,s,t+i,i<0?s.childCount:0,i,o);if(c)return c}t+=s.nodeSize*i}return null}function of(n,e,t){let r=n.steps.length-1;if(r<e)return;let i=n.steps[r];if(!(i instanceof ot||i instanceof Ze))return;let o=n.mapping.maps[r],a;o.forEach((s,c,d,u)=>{a==null&&(a=u)}),n.setSelection(ye.near(n.doc.resolve(a),t))}const af=1,na=2,sf=4;class Gk extends Wk{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|af)&~na,this.storedMarks=null,this}get selectionSet(){return(this.updated&af)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=na,this}ensureMarks(e){return Oe.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&na)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~na,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Oe.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let i=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=t),r=r??t,!e)return this.deleteRange(t,r);let o=this.storedMarks;if(!o){let a=this.doc.resolve(t);o=r==t?a.marks():a.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,i.text(e,o)),this.selection.empty||this.setSelection(ye.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=sf,this}get scrolledIntoView(){return(this.updated&sf)>0}}function lf(n,e){return!e||!n?n:n.bind(e)}class Ji{constructor(e,t,r){this.name=e,this.init=lf(t.init,r),this.apply=lf(t.apply,r)}}const Qk=[new Ji("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new Ji("selection",{init(n,e){return n.selection||ye.atStart(e.doc)},apply(n){return n.selection}}),new Ji("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new Ji("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}})];class tl{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Qk.slice(),t&&t.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Ji(r.key,r.spec.state,r))})}}class ai{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=t){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],r=this.applyInner(e),i=null;for(;;){let o=!1;for(let a=0;a<this.config.plugins.length;a++){let s=this.config.plugins[a];if(s.spec.appendTransaction){let c=i?i[a].n:0,d=i?i[a].state:this,u=c<t.length&&s.spec.appendTransaction.call(s,c?t.slice(c):t,d,r);if(u&&r.filterTransaction(u,a)){if(u.setMeta("appendedTransaction",e),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<a?{state:r,n:t.length}:{state:this,n:0})}t.push(u),r=r.applyInner(u),o=!0}i&&(i[a]={state:r,n:t.length})}}if(!o)return{state:r,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new ai(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];t[o.name]=o.apply(e,this[o.name],this,t)}return t}get tr(){return new Gk(this)}static create(e){let t=new tl(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new ai(t);for(let i=0;i<t.fields.length;i++)r[t.fields[i].name]=t.fields[i].init(e,r);return r}reconfigure(e){let t=new tl(this.schema,e.plugins),r=t.fields,i=new ai(t);for(let o=0;o<r.length;o++){let a=r[o].name;i[a]=this.hasOwnProperty(a)?this[a]:r[o].init(e,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(t[r]=o.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new tl(e.schema,e.plugins),o=new ai(i);return i.fields.forEach(a=>{if(a.name=="doc")o.doc=wr.fromJSON(e.schema,t.doc);else if(a.name=="selection")o.selection=ye.fromJSON(o.doc,t.selection);else if(a.name=="storedMarks")t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let s in r){let c=r[s],d=c.spec.state;if(c.key==a.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(t,s)){o[a.name]=d.fromJSON.call(c,e,t[s],o);return}}o[a.name]=a.init(e,o)}}),o}}function cf(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=cf(i,e,{})),t[r]=i}return t}class Ct{constructor(e){this.spec=e,this.props={},e.props&&cf(e.props,this,this.props),this.key=e.key?e.key.key:df("plugin")}getState(e){return e[this.key]}}const nl=Object.create(null);function df(n){return n in nl?n+"$"+ ++nl[n]:(nl[n]=0,n+"$")}class hn{constructor(e="key"){this.key=df(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const yt=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},Xi=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let uf=null;const Tn=function(n,e,t){let r=uf||(uf=document.createRange());return r.setEnd(n,t??n.nodeValue.length),r.setStart(n,e||0),r},xr=function(n,e,t,r){return t&&(ff(n,e,t,r,-1)||ff(n,e,t,r,1))},Jk=/^(img|br|input|textarea|hr)$/i;function ff(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:mn(n))){let o=n.parentNode;if(!o||o.nodeType!=1||rl(n)||Jk.test(n.nodeName)||n.contentEditable=="false")return!1;e=yt(n)+(i<0?0:1),n=o}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.contentEditable=="false")return!1;e=i<0?mn(n):0}else return!1}}function mn(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Xk(n,e,t){for(let r=e==0,i=e==mn(n);r||i;){if(n==t)return!0;let o=yt(n);if(n=n.parentNode,!n)return!1;r=r&&o==0,i=i&&o==mn(n)}}function rl(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const ra=function(n){return n.focusNode&&xr(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function Cr(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}function Zk(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function ex(n,e,t){if(n.caretPositionFromPoint)try{let r=n.caretPositionFromPoint(e,t);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(n.caretRangeFromPoint){let r=n.caretRangeFromPoint(e,t);if(r)return{node:r.startContainer,offset:r.startOffset}}}const gn=typeof navigator<"u"?navigator:null,pf=typeof document<"u"?document:null,Wn=gn&&gn.userAgent||"",il=/Edge\/(\d+)/.exec(Wn),hf=/MSIE \d/.exec(Wn),ol=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Wn),Mt=!!(hf||ol||il),qn=hf?document.documentMode:ol?+ol[1]:il?+il[1]:0,Xt=!Mt&&/gecko\/(\d+)/i.test(Wn);Xt&&+(/Firefox\/(\d+)/.exec(Wn)||[0,0])[1];const al=!Mt&&/Chrome\/(\d+)/.exec(Wn),dt=!!al,tx=al?+al[1]:0,vt=!Mt&&!!gn&&/Apple Computer/.test(gn.vendor),si=vt&&(/Mobile\/\w+/.test(Wn)||!!gn&&gn.maxTouchPoints>2),Lt=si||(gn?/Mac/.test(gn.platform):!1),nx=gn?/Win/.test(gn.platform):!1,Zt=/Android \d/.test(Wn),Zi=!!pf&&"webkitFontSmoothing"in pf.documentElement.style,rx=Zi?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function ix(n){return{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function Sn(n,e){return typeof n=="number"?n:n[e]}function ox(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,r=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*r}}function mf(n,e,t){let r=n.someProp("scrollThreshold")||0,i=n.someProp("scrollMargin")||5,o=n.dom.ownerDocument;for(let a=t||n.dom;a;a=Xi(a)){if(a.nodeType!=1)continue;let s=a,c=s==o.body,d=c?ix(o):ox(s),u=0,f=0;if(e.top<d.top+Sn(r,"top")?f=-(d.top-e.top+Sn(i,"top")):e.bottom>d.bottom-Sn(r,"bottom")&&(f=e.bottom-e.top>d.bottom-d.top?e.top+Sn(i,"top")-d.top:e.bottom-d.bottom+Sn(i,"bottom")),e.left<d.left+Sn(r,"left")?u=-(d.left-e.left+Sn(i,"left")):e.right>d.right-Sn(r,"right")&&(u=e.right-d.right+Sn(i,"right")),u||f)if(c)o.defaultView.scrollBy(u,f);else{let p=s.scrollLeft,h=s.scrollTop;f&&(s.scrollTop+=f),u&&(s.scrollLeft+=u);let m=s.scrollLeft-p,g=s.scrollTop-h;e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g}}if(c||/^(fixed|sticky)$/.test(getComputedStyle(a).position))break}}function ax(n){let e=n.dom.getBoundingClientRect(),t=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,a=t+1;a<Math.min(innerHeight,e.bottom);a+=5){let s=n.root.elementFromPoint(o,a);if(!s||s==n.dom||!n.dom.contains(s))continue;let c=s.getBoundingClientRect();if(c.top>=t-20){r=s,i=c.top;break}}return{refDOM:r,refTop:i,stack:gf(n.dom)}}function gf(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=Xi(r));return e}function sx({refDOM:n,refTop:e,stack:t}){let r=n?n.getBoundingClientRect().top:0;yf(t,r==0?0:r-e)}function yf(n,e){for(let t=0;t<n.length;t++){let{dom:r,top:i,left:o}=n[t];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=o&&(r.scrollLeft=o)}}let li=null;function lx(n){if(n.setActive)return n.setActive();if(li)return n.focus(li);let e=gf(n);n.focus(li==null?{get preventScroll(){return li={preventScroll:!0},!0}}:void 0),li||(li=!1,yf(e,0))}function vf(n,e){let t,r=2e8,i,o=0,a=e.top,s=e.top,c,d;for(let u=n.firstChild,f=0;u;u=u.nextSibling,f++){let p;if(u.nodeType==1)p=u.getClientRects();else if(u.nodeType==3)p=Tn(u).getClientRects();else continue;for(let h=0;h<p.length;h++){let m=p[h];if(m.top<=a&&m.bottom>=s){a=Math.max(m.bottom,a),s=Math.min(m.top,s);let g=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(g<r){t=u,r=g,i=g&&t.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,u.nodeType==1&&g&&(o=f+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!c&&m.left<=e.left&&m.right>=e.left&&(c=u,d={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!t&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(o=f+1)}}return!t&&c&&(t=c,i=d,r=0),t&&t.nodeType==3?cx(t,i):!t||r&&t.nodeType==1?{node:n,offset:o}:vf(t,i)}function cx(n,e){let t=n.nodeValue.length,r=document.createRange();for(let i=0;i<t;i++){r.setEnd(n,i+1),r.setStart(n,i);let o=Kn(r,1);if(o.top!=o.bottom&&sl(e,o))return{node:n,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:n,offset:0}}function sl(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function dx(n,e){let t=n.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left<n.getBoundingClientRect().left?t:n}function ux(n,e,t){let{node:r,offset:i}=vf(e,t),o=-1;if(r.nodeType==1&&!r.firstChild){let a=r.getBoundingClientRect();o=a.left!=a.right&&t.left>(a.left+a.right)/2?1:-1}return n.docView.posFromDOM(r,i,o)}function fx(n,e,t,r){let i=-1;for(let o=e,a=!1;o!=n.dom;){let s=n.docView.nearestDesc(o,!0);if(!s)return null;if(s.dom.nodeType==1&&(s.node.isBlock&&s.parent&&!a||!s.contentDOM)){let c=s.dom.getBoundingClientRect();if(s.node.isBlock&&s.parent&&!a&&(a=!0,c.left>r.left||c.top>r.top?i=s.posBefore:(c.right<r.left||c.bottom<r.top)&&(i=s.posAfter)),!s.contentDOM&&i<0&&!s.node.isText)return(s.node.isBlock?r.top<(c.top+c.bottom)/2:r.left<(c.left+c.right)/2)?s.posBefore:s.posAfter}o=s.dom.parentNode}return i>-1?i:n.docView.posFromDOM(e,t,-1)}function bf(n,e,t){let r=n.childNodes.length;if(r&&t.top<t.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-t.top)/(t.bottom-t.top))-2)),o=i;;){let a=n.childNodes[o];if(a.nodeType==1){let s=a.getClientRects();for(let c=0;c<s.length;c++){let d=s[c];if(sl(e,d))return bf(a,e,d)}}if((o=(o+1)%r)==i)break}return n}function px(n,e){let t=n.dom.ownerDocument,r,i=0,o=ex(t,e.left,e.top);o&&({node:r,offset:i}=o);let a=(n.root.elementFromPoint?n.root:t).elementFromPoint(e.left,e.top),s;if(!a||!n.dom.contains(a.nodeType!=1?a.parentNode:a)){let d=n.dom.getBoundingClientRect();if(!sl(e,d)||(a=bf(n.dom,e,d),!a))return null}if(vt)for(let d=a;r&&d;d=Xi(d))d.draggable&&(r=void 0);if(a=dx(a,e),r){if(Xt&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let u=r.childNodes[i],f;u.nodeName=="IMG"&&(f=u.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&i++}let d;Zi&&i&&r.nodeType==1&&(d=r.childNodes[i-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&i--,r==n.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?s=n.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(s=fx(n,r,i,e))}s==null&&(s=ux(n,a,e));let c=n.docView.nearestDesc(a,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function wf(n){return n.top<n.bottom||n.left<n.right}function Kn(n,e){let t=n.getClientRects();if(t.length){let r=t[e<0?0:t.length-1];if(wf(r))return r}return Array.prototype.find.call(t,wf)||n.getBoundingClientRect()}const hx=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function kf(n,e,t){let{node:r,offset:i,atom:o}=n.docView.domFromPos(e,t<0?-1:1),a=Zi||Xt;if(r.nodeType==3)if(a&&(hx.test(r.nodeValue)||(t<0?!i:i==r.nodeValue.length))){let c=Kn(Tn(r,i,i),t);if(Xt&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let d=Kn(Tn(r,i-1,i-1),-1);if(d.top==c.top){let u=Kn(Tn(r,i,i+1),-1);if(u.top!=c.top)return eo(u,u.left<d.left)}}return c}else{let c=i,d=i,u=t<0?1:-1;return t<0&&!i?(d++,u=-1):t>=0&&i==r.nodeValue.length?(c--,u=1):t<0?c--:d++,eo(Kn(Tn(r,c,d),u),u<0)}if(!n.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(t<0||i==mn(r))){let c=r.childNodes[i-1];if(c.nodeType==1)return ll(c.getBoundingClientRect(),!1)}if(o==null&&i<mn(r)){let c=r.childNodes[i];if(c.nodeType==1)return ll(c.getBoundingClientRect(),!0)}return ll(r.getBoundingClientRect(),t>=0)}if(o==null&&i&&(t<0||i==mn(r))){let c=r.childNodes[i-1],d=c.nodeType==3?Tn(c,mn(c)-(a?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(d)return eo(Kn(d,1),!1)}if(o==null&&i<mn(r)){let c=r.childNodes[i];for(;c.pmViewDesc&&c.pmViewDesc.ignoreForCoords;)c=c.nextSibling;let d=c?c.nodeType==3?Tn(c,0,a?0:1):c.nodeType==1?c:null:null;if(d)return eo(Kn(d,-1),!0)}return eo(Kn(r.nodeType==3?Tn(r):r,-t),t>=0)}function eo(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function ll(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function xf(n,e,t){let r=n.state,i=n.root.activeElement;r!=e&&n.updateState(e),i!=n.dom&&n.focus();try{return t()}finally{r!=e&&n.updateState(r),i!=n.dom&&i&&i.focus()}}function mx(n,e,t){let r=e.selection,i=t=="up"?r.$from:r.$to;return xf(n,e,()=>{let{node:o}=n.docView.domFromPos(i.pos,t=="up"?-1:1);for(;;){let s=n.docView.nearestDesc(o,!0);if(!s)break;if(s.node.isBlock){o=s.contentDOM||s.dom;break}o=s.dom.parentNode}let a=kf(n,i.pos,1);for(let s=o.firstChild;s;s=s.nextSibling){let c;if(s.nodeType==1)c=s.getClientRects();else if(s.nodeType==3)c=Tn(s,0,s.nodeValue.length).getClientRects();else continue;for(let d=0;d<c.length;d++){let u=c[d];if(u.bottom>u.top+1&&(t=="up"?a.top-u.top>(u.bottom-a.top)*2:u.bottom-a.bottom>(a.bottom-u.top)*2))return!1}}return!0})}const gx=/[\u0590-\u08ac]/;function yx(n,e,t){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,a=i==r.parent.content.size,s=n.domSelection();return!gx.test(r.parent.textContent)||!s.modify?t=="left"||t=="backward"?o:a:xf(n,e,()=>{let{focusNode:c,focusOffset:d,anchorNode:u,anchorOffset:f}=n.domSelectionRange(),p=s.caretBidiLevel;s.modify("move",t,"character");let h=r.depth?n.docView.domAfterPos(r.before()):n.dom,{focusNode:m,focusOffset:g}=n.domSelectionRange(),k=m&&!h.contains(m.nodeType==1?m:m.parentNode)||c==m&&d==g;try{s.collapse(u,f),c&&(c!=u||d!=f)&&s.extend&&s.extend(c,d)}catch{}return p!=null&&(s.caretBidiLevel=p),k})}let Cf=null,Mf=null,Tf=!1;function vx(n,e,t){return Cf==e&&Mf==t?Tf:(Cf=e,Mf=t,Tf=t=="up"||t=="down"?mx(n,e,t):yx(n,e,t))}const $t=0,Sf=1,Mr=2,yn=3;class to{constructor(e,t,r,i){this.parent=e,this.children=t,this.dom=r,this.contentDOM=i,this.dirty=$t,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,r=this.posAtStart;;t++){let i=this.children[t];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let o,a;if(e==this.contentDOM)o=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&!((a=o.pmViewDesc)&&a.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(a)+a.size:this.posAtStart}else{let o,a;if(e==this.contentDOM)o=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&!((a=o.pmViewDesc)&&a.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(a):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=t>yt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&t==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),a;if(o&&(!t||o.node))if(r&&(a=o.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))r=!1;else return o}}getDesc(e){let t=e.pmViewDesc;for(let r=t;r;r=r.parent)if(r==this)return t}posFromDOM(e,t,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,t,r)}return-1}descAt(e){for(let t=0,r=0;t<this.children.length;t++){let i=this.children[t],o=r+i.size;if(r==e&&o!=r){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(e<o)return i.descAt(e-r-i.border);r=o}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let a=this.children[r],s=o+a.size;if(s>e||a instanceof Ef){i=e-o;break}o=s}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof Df&&o.side>=0;r--);if(t<=0){let o,a=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,a=!1);return o&&t&&a&&!o.border&&!o.domAtom?o.domFromPos(o.size,t):{node:this.contentDOM,offset:o?yt(o.dom)+1:0}}else{let o,a=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,a=!1);return o&&a&&!o.border&&!o.domAtom?o.domFromPos(0,t):{node:this.contentDOM,offset:o?yt(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let a=r,s=0;;s++){let c=this.children[s],d=a+c.size;if(i==-1&&e<=d){let u=a+c.border;if(e>=u&&t<=d-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(e,t,u);e=a;for(let f=s;f>0;f--){let p=this.children[f-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){i=yt(p.dom)+1;break}e-=p.size}i==-1&&(i=0)}if(i>-1&&(d>t||s==this.children.length-1)){t=d;for(let u=s+1;u<this.children.length;u++){let f=this.children[u];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=yt(f.dom);break}t+=f.size}o==-1&&(o=this.contentDOM.childNodes.length);break}a=d}return{node:this.contentDOM,from:e,to:t,fromOffset:i,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:r}=this.domFromPos(e,0);if(t.nodeType!=1||r==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[r]}setSelection(e,t,r,i=!1){let o=Math.min(e,t),a=Math.max(e,t);for(let p=0,h=0;p<this.children.length;p++){let m=this.children[p],g=h+m.size;if(o>h&&a<g)return m.setSelection(e-h-m.border,t-h-m.border,r,i);h=g}let s=this.domFromPos(e,e?-1:1),c=t==e?s:this.domFromPos(t,t?-1:1),d=r.getSelection(),u=!1;if((Xt||vt)&&e==t){let{node:p,offset:h}=s;if(p.nodeType==3){if(u=!!(h&&p.nodeValue[h-1]==`
76
- `),u&&h==p.nodeValue.length)for(let m=p,g;m;m=m.parentNode){if(g=m.nextSibling){g.nodeName=="BR"&&(s=c={node:g.parentNode,offset:yt(g)+1});break}let k=m.pmViewDesc;if(k&&k.node&&k.node.isBlock)break}}else{let m=p.childNodes[h-1];u=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(Xt&&d.focusNode&&d.focusNode!=c.node&&d.focusNode.nodeType==1){let p=d.focusNode.childNodes[d.focusOffset];p&&p.contentEditable=="false"&&(i=!0)}if(!(i||u&&vt)&&xr(s.node,s.offset,d.anchorNode,d.anchorOffset)&&xr(c.node,c.offset,d.focusNode,d.focusOffset))return;let f=!1;if((d.extend||e==t)&&!u){d.collapse(s.node,s.offset);try{e!=t&&d.extend(c.node,c.offset),f=!0}catch{}}if(!f){if(e>t){let h=s;s=c,c=h}let p=document.createRange();p.setEnd(c.node,c.offset),p.setStart(s.node,s.offset),d.removeAllRanges(),d.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],a=r+o.size;if(r==a?e<=a&&t>=r:e<a&&t>r){let s=r+o.border,c=a-o.border;if(e>=s&&t<=c){this.dirty=e==r||t==a?Mr:Sf,e==s&&t==c&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=yn:o.markDirty(e-s,t-s);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Mr:yn}r=a}this.dirty=Mr}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=e==1?Mr:Sf;t.dirty<r&&(t.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class Df extends to{constructor(e,t,r,i){let o,a=t.type.toDOM;if(typeof a=="function"&&(a=a(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!t.type.spec.raw){if(a.nodeType!=1){let s=document.createElement("span");s.appendChild(a),a=s}a.contentEditable="false",a.classList.add("ProseMirror-widget")}super(e,[],a,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return this.dirty==$t&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class bx extends to{constructor(e,t,r,i){super(e,[],t,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Tr extends to{constructor(e,t,r,i){super(e,[],r,i),this.mark=t}static create(e,t,r,i){let o=i.nodeViews[t.type.name],a=o&&o(t,i,r);return(!a||!a.dom)&&(a=fn.renderSpec(document,t.type.spec.toDOM(t,r))),new Tr(e,t,a.dom,a.contentDOM||a.dom)}parseRule(){return this.dirty&yn||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=yn&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=$t){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=$t}}slice(e,t,r){let i=Tr.create(this.parent,this.mark,!0,r),o=this.children,a=this.size;t<a&&(o=ul(o,t,a,r)),e>0&&(o=ul(o,0,e,r));for(let s=0;s<o.length;s++)o[s].parent=i;return i.children=o,i}}class Gn extends to{constructor(e,t,r,i,o,a,s,c,d){super(e,[],o,a),this.node=t,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=s}static create(e,t,r,i,o,a){let s=o.nodeViews[t.type.name],c,d=s&&s(t,o,()=>{if(!c)return a;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=d&&d.dom,f=d&&d.contentDOM;if(t.isText){if(!u)u=document.createTextNode(t.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:f}=fn.renderSpec(document,t.type.spec.toDOM(t)));!f&&!t.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let p=u;return u=_f(u,r,t),d?c=new wx(e,t,r,i,u,f||null,p,d,o,a+1):t.isText?new ia(e,t,r,i,u,p,o):new Gn(e,t,r,i,u,f||null,p,o,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let r=this.children[t];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>K.empty)}return e}matchesNode(e,t,r){return this.dirty==$t&&e.eq(this.node)&&dl(t,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let r=this.node.inlineContent,i=t,o=e.composing?this.localCompositionInfo(e,t):null,a=o&&o.pos>-1?o:null,s=o&&o.pos<0,c=new xx(this,a&&a.node,e);Tx(this.node,this.innerDeco,(d,u,f)=>{d.spec.marks?c.syncToMarks(d.spec.marks,r,e):d.type.side>=0&&!f&&c.syncToMarks(u==this.node.childCount?Oe.none:this.node.child(u).marks,r,e),c.placeWidget(d,e,i)},(d,u,f,p)=>{c.syncToMarks(d.marks,r,e);let h;c.findNodeMatch(d,u,f,p)||s&&e.state.selection.from>i&&e.state.selection.to<i+d.nodeSize&&(h=c.findIndexWithChild(o.node))>-1&&c.updateNodeAt(d,u,f,h,e)||c.updateNextNode(d,u,f,e,p,i)||c.addNode(d,u,f,e,i),i+=d.nodeSize}),c.syncToMarks([],r,e),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==Mr)&&(a&&this.protectLocalComposition(e,a),Of(this.contentDOM,this.children,e),si&&Sx(this.dom))}localCompositionInfo(e,t){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof ge)||r<t||i>t+this.node.content.size)return null;let o=e.domSelectionRange(),a=Dx(o.focusNode,o.focusOffset);if(!a||!this.dom.contains(a.parentNode))return null;if(this.node.inlineContent){let s=a.nodeValue,c=Ax(this.node.content,s,r-t,i-t);return c<0?null:{node:a,pos:c,text:s}}else return{node:a,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:r,text:i}){if(this.getDesc(t))return;let o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let a=new bx(this,o,t,i);e.input.compositionNodes.push(a),this.children=ul(this.children,r,r+i.length,e,a)}update(e,t,r,i){return this.dirty==yn||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,r,i),!0)}updateInner(e,t,r,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=$t}updateOuterDeco(e){if(dl(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Nf(this.dom,this.nodeDOM,cl(this.outerDeco,this.node,t),cl(e,this.node,t)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function Af(n,e,t,r,i){_f(r,e,n);let o=new Gn(void 0,n,e,t,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class ia extends Gn{constructor(e,t,r,i,o,a,s){super(e,t,r,i,o,null,a,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,r,i){return this.dirty==yn||this.dirty!=$t&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=$t||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=$t,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,r){let i=this.node.cut(e,t),o=document.createTextNode(i.text);return new ia(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=yn)}get domAtom(){return!1}}class Ef extends to{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==$t&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class wx extends Gn{constructor(e,t,r,i,o,a,s,c,d,u){super(e,t,r,i,o,a,s,d,u),this.spec=c}update(e,t,r,i){if(this.dirty==yn)return!1;if(this.spec.update){let o=this.spec.update(e,t,r);return o&&this.updateInner(e,t,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,r,i){this.spec.setSelection?this.spec.setSelection(e,t,r):super.setSelection(e,t,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Of(n,e,t){let r=n.firstChild,i=!1;for(let o=0;o<e.length;o++){let a=e[o],s=a.dom;if(s.parentNode==n){for(;s!=r;)r=Bf(r),i=!0;r=r.nextSibling}else i=!0,n.insertBefore(s,r);if(a instanceof Tr){let c=r?r.previousSibling:n.lastChild;Of(a.contentDOM,a.children,t),r=c?c.nextSibling:n.firstChild}}for(;r;)r=Bf(r),i=!0;i&&t.trackWrites==n&&(t.trackWrites=null)}const no=function(n){n&&(this.nodeName=n)};no.prototype=Object.create(null);const Sr=[new no];function cl(n,e,t){if(n.length==0)return Sr;let r=t?Sr[0]:new no,i=[r];for(let o=0;o<n.length;o++){let a=n[o].type.attrs;if(a){a.nodeName&&i.push(r=new no(a.nodeName));for(let s in a){let c=a[s];c!=null&&(t&&i.length==1&&i.push(r=new no(e.isInline?"span":"div")),s=="class"?r.class=(r.class?r.class+" ":"")+c:s=="style"?r.style=(r.style?r.style+";":"")+c:s!="nodeName"&&(r[s]=c))}}}return i}function Nf(n,e,t,r){if(t==Sr&&r==Sr)return e;let i=e;for(let o=0;o<r.length;o++){let a=r[o],s=t[o];if(o){let c;s&&s.nodeName==a.nodeName&&i!=n&&(c=i.parentNode)&&c.nodeName.toLowerCase()==a.nodeName||(c=document.createElement(a.nodeName),c.pmIsDeco=!0,c.appendChild(i),s=Sr[0]),i=c}kx(i,s||Sr[0],a)}return i}function kx(n,e,t){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in t)&&n.removeAttribute(r);for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&t[r]!=e[r]&&n.setAttribute(r,t[r]);if(e.class!=t.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=t.class?t.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&n.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&n.classList.add(i[o]);n.classList.length==0&&n.removeAttribute("class")}if(e.style!=t.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)n.style.removeProperty(i[1])}t.style&&(n.style.cssText+=t.style)}}function _f(n,e,t){return Nf(n,n,Sr,cl(e,t,n.nodeType!=1))}function dl(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].type.eq(e[t].type))return!1;return!0}function Bf(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class xx{constructor(e,t,r){this.lock=t,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Cx(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let r=e;r<t;r++)this.top.children[r].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,r){let i=0,o=this.stack.length>>1,a=Math.min(o,e.length);for(;i<a&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=$t,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let s=-1;for(let c=this.index;c<Math.min(this.index+3,this.top.children.length);c++){let d=this.top.children[c];if(d.matchesMark(e[o])&&!this.isLocked(d.dom)){s=c;break}}if(s>-1)s>this.index&&(this.changed=!0,this.destroyBetween(this.index,s)),this.top=this.top.children[this.index];else{let c=Tr.create(this.top,e[o],t,r);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,r,i){let o=-1,a;if(i>=this.preMatch.index&&(a=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,r))o=this.top.children.indexOf(a,this.index);else for(let s=this.index,c=Math.min(this.top.children.length,s+5);s<c;s++){let d=this.top.children[s];if(d.matchesNode(e,t,r)&&!this.preMatch.matched.has(d)){o=s;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,t,r,i,o){let a=this.top.children[i];return a.dirty==yn&&a.dom==a.contentDOM&&(a.dirty=Mr),a.update(e,t,r,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=t}}updateNextNode(e,t,r,i,o,a){for(let s=this.index;s<this.top.children.length;s++){let c=this.top.children[s];if(c instanceof Gn){let d=this.preMatch.matched.get(c);if(d!=null&&d!=o)return!1;let u=c.dom,f,p=this.isLocked(u)&&!(e.isText&&c.node&&c.node.isText&&c.nodeDOM.nodeValue==e.text&&c.dirty!=yn&&dl(t,c.outerDeco));if(!p&&c.update(e,t,r,i))return this.destroyBetween(this.index,s),c.dom!=u&&(this.changed=!0),this.index++,!0;if(!p&&(f=this.recreateWrapper(c,e,t,r,i,a)))return this.top.children[this.index]=f,f.contentDOM&&(f.dirty=Mr,f.updateChildren(i,a+1),f.dirty=$t),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,r,i,o,a){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content))return null;let s=Gn.create(this.top,t,r,i,o,a);if(s.contentDOM){s.children=e.children,e.children=[];for(let c of s.children)c.parent=s}return e.destroy(),s}addNode(e,t,r,i,o){let a=Gn.create(this.top,e,t,r,i,o);a.contentDOM&&a.updateChildren(i,o+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,t,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new Df(this.top,e,t,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof Tr;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof ia)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((vt||dt)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new Ef(this.top,[],r,null);t!=this.top?t.children.push(i):t.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function Cx(n,e){let t=e,r=t.children.length,i=n.childCount,o=new Map,a=[];e:for(;i>0;){let s;for(;;)if(r){let d=t.children[r-1];if(d instanceof Tr)t=d,r=d.children.length;else{s=d,r--;break}}else{if(t==e)break e;r=t.parent.children.indexOf(t),t=t.parent}let c=s.node;if(c){if(c!=n.child(i-1))break;--i,o.set(s,i),a.push(s)}}return{index:i,matched:o,matches:a.reverse()}}function Mx(n,e){return n.type.side-e.type.side}function Tx(n,e,t,r){let i=e.locals(n),o=0;if(i.length==0){for(let d=0;d<n.childCount;d++){let u=n.child(d);r(u,i,e.forChild(o,u),d),o+=u.nodeSize}return}let a=0,s=[],c=null;for(let d=0;;){let u,f;for(;a<i.length&&i[a].to==o;){let k=i[a++];k.widget&&(u?(f||(f=[u])).push(k):u=k)}if(u)if(f){f.sort(Mx);for(let k=0;k<f.length;k++)t(f[k],d,!!c)}else t(u,d,!!c);let p,h;if(c)h=-1,p=c,c=null;else if(d<n.childCount)h=d,p=n.child(d++);else break;for(let k=0;k<s.length;k++)s[k].to<=o&&s.splice(k--,1);for(;a<i.length&&i[a].from<=o&&i[a].to>o;)s.push(i[a++]);let m=o+p.nodeSize;if(p.isText){let k=m;a<i.length&&i[a].from<k&&(k=i[a].from);for(let x=0;x<s.length;x++)s[x].to<k&&(k=s[x].to);k<m&&(c=p.cut(k-o),p=p.cut(0,k-o),m=k,h=-1)}let g=p.isInline&&!p.isLeaf?s.filter(k=>!k.inline):s.slice();r(p,g,e.forChild(o,p),h),o=m}}function Sx(n){if(n.nodeName=="UL"||n.nodeName=="OL"){let e=n.style.cssText;n.style.cssText=e+"; list-style: square !important",window.getComputedStyle(n).listStyle,n.style.cssText=e}}function Dx(n,e){for(;;){if(n.nodeType==3)return n;if(n.nodeType==1&&e>0){if(n.childNodes.length>e&&n.childNodes[e].nodeType==3)return n.childNodes[e];n=n.childNodes[e-1],e=mn(n)}else if(n.nodeType==1&&e<n.childNodes.length)n=n.childNodes[e],e=0;else return null}}function Ax(n,e,t,r){for(let i=0,o=0;i<n.childCount&&o<=r;){let a=n.child(i++),s=o;if(o+=a.nodeSize,!a.isText)continue;let c=a.text;for(;i<n.childCount;){let d=n.child(i++);if(o+=d.nodeSize,!d.isText)break;c+=d.text}if(o>=t){if(o>=r&&c.slice(r-e.length-s,r-s)==e)return r-e.length;let d=s<r?c.lastIndexOf(e,r-s-1):-1;if(d>=0&&d+e.length+s>=t)return s+d;if(t==r&&c.length>=r+e.length-s&&c.slice(r-s,r-s+e.length)==e)return r}}return-1}function ul(n,e,t,r,i){let o=[];for(let a=0,s=0;a<n.length;a++){let c=n[a],d=s,u=s+=c.size;d>=t||u<=e?o.push(c):(d<e&&o.push(c.slice(0,e-d,r)),i&&(o.push(i),i=void 0),u>t&&o.push(c.slice(t-d,c.size,r)))}return o}function fl(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),o=i&&i.size==0,a=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(a<0)return null;let s=r.resolve(a),c,d;if(ra(t)){for(c=s;i&&!i.node;)i=i.parent;let u=i.node;if(i&&u.isAtom&&he.isSelectable(u)&&i.parent&&!(u.isInline&&Xk(t.focusNode,t.focusOffset,i.dom))){let f=i.posBefore;d=new he(a==f?s:r.resolve(f))}}else{let u=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(u<0)return null;c=r.resolve(u)}if(!d){let u=e=="pointer"||n.state.selection.head<s.pos&&!o?1:-1;d=hl(n,c,s,u)}return d}function Pf(n){return n.editable?n.hasFocus():zf(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function Dn(n,e=!1){let t=n.state.selection;if(Lf(n,t),!!Pf(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&dt){let r=n.domSelectionRange(),i=n.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&xr(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)Ox(n);else{let{anchor:r,head:i}=t,o,a;If&&!(t instanceof ge)&&(t.$from.parent.inlineContent||(o=Rf(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(a=Rf(n,t.to))),n.docView.setSelection(r,i,n.root,e),If&&(o&&Vf(o),a&&Vf(a)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Ex(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const If=vt||dt&&tx<63;function Rf(n,e){let{node:t,offset:r}=n.docView.domFromPos(e,0),i=r<t.childNodes.length?t.childNodes[r]:null,o=r?t.childNodes[r-1]:null;if(vt&&i&&i.contentEditable=="false")return pl(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return pl(i);if(o)return pl(o)}}function pl(n){return n.contentEditable="true",vt&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function Vf(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function Ex(n){let e=n.dom.ownerDocument;e.removeEventListener("selectionchange",n.input.hideSelectionGuard);let t=n.domSelectionRange(),r=t.anchorNode,i=t.anchorOffset;e.addEventListener("selectionchange",n.input.hideSelectionGuard=()=>{(t.anchorNode!=r||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!Pf(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function Ox(n){let e=n.domSelection(),t=document.createRange(),r=n.cursorWrapper.dom,i=r.nodeName=="IMG";i?t.setEnd(r.parentNode,yt(r)+1):t.setEnd(r,0),t.collapse(!1),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&Mt&&qn<=11&&(r.disabled=!0,r.disabled=!1)}function Lf(n,e){if(e instanceof he){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&($f(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else $f(n)}function $f(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function hl(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||ge.between(e,t,r)}function Ff(n){return n.editable&&!n.hasFocus()?!1:zf(n)}function zf(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function Nx(n){let e=n.docView.domFromPos(n.state.selection.anchor,0),t=n.domSelectionRange();return xr(e.node,e.offset,t.anchorNode,t.anchorOffset)}function ml(n,e){let{$anchor:t,$head:r}=n.selection,i=e>0?t.max(r):t.min(r),o=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return o&&ye.findFrom(o,e)}function Dr(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function Hf(n,e,t){let r=n.state.selection;if(r instanceof ge){if(!r.empty||t.indexOf("s")>-1)return!1;if(n.endOfTextblock(e>0?"forward":"backward")){let i=ml(n.state,e);return i&&i instanceof he?Dr(n,i):!1}else if(!(Lt&&t.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,a;if(!o||o.isText)return!1;let s=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(a=n.docView.descAt(s))&&!a.contentDOM?he.isSelectable(o)?Dr(n,new he(e<0?n.state.doc.resolve(i.pos-o.nodeSize):i)):Zi?Dr(n,new ge(n.state.doc.resolve(e<0?s:s+o.nodeSize))):!1:!1}}else{if(r instanceof he&&r.node.isInline)return Dr(n,new ge(e>0?r.$to:r.$from));{let i=ml(n.state,e);return i?Dr(n,i):!1}}}function oa(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function ro(n,e){if(n.contentEditable=="false")return!0;let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function ci(n,e){return e<0?_x(n):Bx(n)}function _x(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,o,a=!1;for(Xt&&t.nodeType==1&&r<oa(t)&&ro(t.childNodes[r],-1)&&(a=!0);;)if(r>0){if(t.nodeType!=1)break;{let s=t.childNodes[r-1];if(ro(s,-1))i=t,o=--r;else if(s.nodeType==3)t=s,r=t.nodeValue.length;else break}}else{if(Yf(t))break;{let s=t.previousSibling;for(;s&&ro(s,-1);)i=t.parentNode,o=yt(s),s=s.previousSibling;if(s)t=s,r=oa(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}a?gl(n,t,r):i&&gl(n,i,o)}function Bx(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=oa(t),o,a;for(;;)if(r<i){if(t.nodeType!=1)break;let s=t.childNodes[r];if(ro(s,1))o=t,a=++r;else break}else{if(Yf(t))break;{let s=t.nextSibling;for(;s&&ro(s,1);)o=s.parentNode,a=yt(s)+1,s=s.nextSibling;if(s)t=s,r=0,i=oa(t);else{if(t=t.parentNode,t==n.dom)break;r=i=0}}}o&&gl(n,o,a)}function Yf(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function Px(n,e){for(;n&&e==n.childNodes.length&&!rl(n);)e=yt(n)+1,n=n.parentNode;for(;n&&e<n.childNodes.length;){let t=n.childNodes[e];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=0}}function Ix(n,e){for(;n&&!e&&!rl(n);)e=yt(n),n=n.parentNode;for(;n&&e;){let t=n.childNodes[e-1];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=n.childNodes.length}}function gl(n,e,t){if(e.nodeType!=3){let o,a;(a=Px(e,t))?(e=a,t=0):(o=Ix(e,t))&&(e=o,t=o.nodeValue.length)}let r=n.domSelection();if(ra(r)){let o=document.createRange();o.setEnd(e,t),o.setStart(e,t),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,t);n.domObserver.setCurSelection();let{state:i}=n;setTimeout(()=>{n.state==i&&Dn(n)},50)}function Uf(n,e){let t=n.state.doc.resolve(e);if(!(dt||nx)&&t.parent.inlineContent){let i=n.coordsAtPos(e);if(e>t.start()){let o=n.coordsAtPos(e-1),a=(o.top+o.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(e<t.end()){let o=n.coordsAtPos(e+1),a=(o.top+o.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function jf(n,e,t){let r=n.state.selection;if(r instanceof ge&&!r.empty||t.indexOf("s")>-1||Lt&&t.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let a=ml(n.state,e);if(a&&a instanceof he)return Dr(n,a)}if(!i.parent.inlineContent){let a=e<0?i:o,s=r instanceof Jt?ye.near(a,e):ye.findFrom(a,e);return s?Dr(n,s):!1}return!1}function Wf(n,e){if(!(n.state.selection instanceof ge))return!0;let{$head:t,$anchor:r,empty:i}=n.state.selection;if(!t.sameParent(r))return!0;if(!i)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(o&&!o.isText){let a=n.state.tr;return e<0?a.delete(t.pos-o.nodeSize,t.pos):a.delete(t.pos,t.pos+o.nodeSize),n.dispatch(a),!0}return!1}function qf(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function Rx(n){if(!vt||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;qf(n,r,"true"),setTimeout(()=>qf(n,r,"false"),20)}return!1}function Vx(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function Lx(n,e){let t=e.keyCode,r=Vx(e);if(t==8||Lt&&t==72&&r=="c")return Wf(n,-1)||ci(n,-1);if(t==46&&!e.shiftKey||Lt&&t==68&&r=="c")return Wf(n,1)||ci(n,1);if(t==13||t==27)return!0;if(t==37||Lt&&t==66&&r=="c"){let i=t==37?Uf(n,n.state.selection.from)=="ltr"?-1:1:-1;return Hf(n,i,r)||ci(n,i)}else if(t==39||Lt&&t==70&&r=="c"){let i=t==39?Uf(n,n.state.selection.from)=="ltr"?1:-1:1;return Hf(n,i,r)||ci(n,i)}else{if(t==38||Lt&&t==80&&r=="c")return jf(n,-1,r)||ci(n,-1);if(t==40||Lt&&t==78&&r=="c")return Rx(n)||jf(n,1,r)||ci(n,1);if(r==(Lt?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function Kf(n,e){n.someProp("transformCopied",h=>{e=h(e,n)});let t=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let h=r.firstChild;t.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let a=n.someProp("clipboardSerializer")||fn.fromSchema(n.state.schema),s=np(),c=s.createElement("div");c.appendChild(a.serializeFragment(r,{document:s}));let d=c.firstChild,u,f=0;for(;d&&d.nodeType==1&&(u=ep[d.nodeName.toLowerCase()]);){for(let h=u.length-1;h>=0;h--){let m=s.createElement(u[h]);for(;c.firstChild;)m.appendChild(c.firstChild);c.appendChild(m),f++}d=c.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(t)}`);let p=n.someProp("clipboardTextSerializer",h=>h(e,n))||e.content.textBetween(0,e.content.size,`
77
-
78
- `);return{dom:c,text:p}}function Gf(n,e,t,r,i){let o=i.parent.type.spec.code,a,s;if(!t&&!e)return null;let c=e&&(r||o||!t);if(c){if(n.someProp("transformPastedText",p=>{e=p(e,o||r,n)}),o)return e?new ie(K.from(n.state.schema.text(e.replace(/\r\n?/g,`
79
- `))),0,0):ie.empty;let f=n.someProp("clipboardTextParser",p=>p(e,i,r,n));if(f)s=f;else{let p=i.marks(),{schema:h}=n.state,m=fn.fromSchema(h);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let k=a.appendChild(document.createElement("p"));g&&k.appendChild(m.serializeNode(h.text(g,p)))})}}else n.someProp("transformPastedHTML",f=>{t=f(t,n)}),a=zx(t),Zi&&Hx(a);let d=a&&a.querySelector("[data-pm-slice]"),u=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let f=+u[3];f>0;f--){let p=a.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;a=p}if(s||(s=(n.someProp("clipboardParser")||n.someProp("domParser")||Xr.fromSchema(n.state.schema)).parseSlice(a,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!$x.test(p.parentNode.nodeName)?{ignore:!0}:null}})),u)s=Yx(Zf(s,+u[1],+u[2]),u[4]);else if(s=ie.maxOpen(Fx(s.content,i),!0),s.openStart||s.openEnd){let f=0,p=0;for(let h=s.content.firstChild;f<s.openStart&&!h.type.spec.isolating;f++,h=h.firstChild);for(let h=s.content.lastChild;p<s.openEnd&&!h.type.spec.isolating;p++,h=h.lastChild);s=Zf(s,f,p)}return n.someProp("transformPasted",f=>{s=f(s,n)}),s}const $x=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Fx(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),o,a=[];if(n.forEach(s=>{if(!a)return;let c=i.findWrapping(s.type),d;if(!c)return a=null;if(d=a.length&&o.length&&Jf(c,o,s,a[a.length-1],0))a[a.length-1]=d;else{a.length&&(a[a.length-1]=Xf(a[a.length-1],o.length));let u=Qf(s,c);a.push(u),i=i.matchType(u.type),o=c}}),a)return K.from(a)}return n}function Qf(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,K.from(n));return n}function Jf(n,e,t,r,i){if(i<n.length&&i<e.length&&n[i]==e[i]){let o=Jf(n,e,t,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==n.length-1?t.type:n[i+1]))return r.copy(r.content.append(K.from(Qf(t,n,i+1))))}}function Xf(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,Xf(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(K.empty,!0);return n.copy(t.append(r))}function yl(n,e,t,r,i,o){let a=e<0?n.firstChild:n.lastChild,s=a.content;return n.childCount>1&&(o=0),i<r-1&&(s=yl(s,e,t,r,i+1,o)),i>=t&&(s=e<0?a.contentMatchAt(0).fillBefore(s,o<=i).append(s):s.append(a.contentMatchAt(a.childCount).fillBefore(K.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,a.copy(s))}function Zf(n,e,t){return e<n.openStart&&(n=new ie(yl(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new ie(yl(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const ep={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let tp=null;function np(){return tp||(tp=document.implementation.createHTMLDocument("title"))}function zx(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=np().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&ep[r[1].toLowerCase()])&&(n=i.map(o=>"<"+o+">").join("")+n+i.map(o=>"</"+o+">").reverse().join("")),t.innerHTML=n,i)for(let o=0;o<i.length;o++)t=t.querySelector(i[o])||t;return t}function Hx(n){let e=n.querySelectorAll(dt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let r=e[t];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "),r)}}function Yx(n,e){if(!n.size)return n;let t=n.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return n}let{content:i,openStart:o,openEnd:a}=n;for(let s=r.length-2;s>=0;s-=2){let c=t.nodes[r[s]];if(!c||c.hasRequiredAttrs())break;i=K.from(c.create(r[s+1],i)),o++,a++}return new ie(i,o,a)}const bt={},wt={},Ux={touchstart:!0,touchmove:!0};class jx{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Wx(n){for(let e in bt){let t=bt[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=r=>{Kx(n,r)&&!bl(n,r)&&(n.editable||!(r.type in wt))&&t(n,r)},Ux[e]?{passive:!0}:void 0)}vt&&n.dom.addEventListener("input",()=>null),vl(n)}function Qn(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function qx(n){n.domObserver.stop();for(let e in n.input.eventHandlers)n.dom.removeEventListener(e,n.input.eventHandlers[e]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}function vl(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=r=>bl(n,r))})}function bl(n,e){return n.someProp("handleDOMEvents",t=>{let r=t[e.type];return r?r(n,e)||e.defaultPrevented:!1})}function Kx(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function Gx(n,e){!bl(n,e)&&bt[e.type]&&(n.editable||!(e.type in wt))&&bt[e.type](n,e)}wt.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!ip(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(Zt&&dt&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),si&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",i=>i(n,Cr(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||Lx(n,t)?t.preventDefault():Qn(n,"key")},wt.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)},wt.keypress=(n,e)=>{let t=e;if(ip(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||Lt&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof ge)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(t.charCode);!/[\r\n]/.test(i)&&!n.someProp("handleTextInput",o=>o(n,r.$from.pos,r.$to.pos,i))&&n.dispatch(n.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};function aa(n){return{left:n.clientX,top:n.clientY}}function Qx(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function wl(n,e,t,r,i){if(r==-1)return!1;let o=n.state.doc.resolve(r);for(let a=o.depth+1;a>0;a--)if(n.someProp(e,s=>a>o.depth?s(n,t,o.nodeAfter,o.before(a),i,!0):s(n,t,o.node(a),o.before(a),i,!1)))return!0;return!1}function di(n,e,t){n.focused||n.focus();let r=n.state.tr.setSelection(e);t=="pointer"&&r.setMeta("pointer",!0),n.dispatch(r)}function Jx(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&he.isSelectable(r)?(di(n,new he(t),"pointer"),!0):!1}function Xx(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof he&&(r=t.node);let o=n.state.doc.resolve(e);for(let a=o.depth+1;a>0;a--){let s=a>o.depth?o.nodeAfter:o.node(a);if(he.isSelectable(s)){r&&t.$from.depth>0&&a>=t.$from.depth&&o.before(t.$from.depth+1)==t.$from.pos?i=o.before(t.$from.depth):i=o.before(a);break}}return i!=null?(di(n,he.create(n.state.doc,i),"pointer"),!0):!1}function Zx(n,e,t,r,i){return wl(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?Xx(n,t):Jx(n,t))}function e1(n,e,t,r){return wl(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function t1(n,e,t,r){return wl(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||n1(n,t,r)}function n1(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(di(n,ge.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let a=o>i.depth?i.nodeAfter:i.node(o),s=i.before(o);if(a.inlineContent)di(n,ge.create(r,s+1,s+1+a.content.size),"pointer");else if(he.isSelectable(a))di(n,he.create(r,s),"pointer");else continue;return!0}}function kl(n){return sa(n)}const rp=Lt?"metaKey":"ctrlKey";bt.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=kl(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&Qx(t,n.input.lastClick)&&!t[rp]&&(n.input.lastClick.type=="singleClick"?o="doubleClick":n.input.lastClick.type=="doubleClick"&&(o="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:o};let a=n.posAtCoords(aa(t));a&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new r1(n,a,t,!!r)):(o=="doubleClick"?e1:t1)(n,a.pos,a.inside,t)?t.preventDefault():Qn(n,"pointer"))};class r1{constructor(e,t,r,i){this.view=e,this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[rp],this.allowDefault=r.shiftKey;let o,a;if(t.inside>-1)o=e.state.doc.nodeAt(t.inside),a=t.inside;else{let u=e.state.doc.resolve(t.pos);o=u.parent,a=u.depth?u.before():0}const s=i?null:r.target,c=s?e.docView.nearestDesc(s,!0):null;this.target=c?c.dom:null;let{selection:d}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||d instanceof he&&d.from<=a&&d.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Xt&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Qn(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Dn(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(aa(e))),this.updateAllowDefault(e),this.allowDefault||!t?Qn(this.view,"pointer"):Zx(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||vt&&this.mightDrag&&!this.mightDrag.node.isAtom||dt&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(di(this.view,ye.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Qn(this.view,"pointer")}move(e){this.updateAllowDefault(e),Qn(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}bt.touchstart=n=>{n.input.lastTouch=Date.now(),kl(n),Qn(n,"pointer")},bt.touchmove=n=>{n.input.lastTouch=Date.now(),Qn(n,"pointer")},bt.contextmenu=n=>kl(n);function ip(n,e){return n.composing?!0:vt&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const i1=Zt?5e3:-1;wt.compositionstart=wt.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),sa(n,!0),n.markCursor=null;else if(sa(n),Xt&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let a=o<0?i.lastChild:i.childNodes[o-1];if(!a)break;if(a.nodeType==3){n.domSelection().collapse(a,a.nodeValue.length);break}else i=a,o=-1}}n.input.composing=!0}op(n,i1)},wt.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,op(n,20))};function op(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>sa(n),e))}function ap(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=o1());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function o1(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function sa(n,e=!1){if(!(Zt&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),ap(n),e||n.docView&&n.docView.dirty){let t=fl(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):n.updateState(n.state),!0}return!1}}function a1(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const ui=Mt&&qn<15||si&&rx<604;bt.copy=wt.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let o=ui?null:t.clipboardData,a=r.content(),{dom:s,text:c}=Kf(n,a);o?(t.preventDefault(),o.clearData(),o.setData("text/html",s.innerHTML),o.setData("text/plain",c)):a1(n,s),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function s1(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function l1(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?io(n,r.value,null,i,e):io(n,r.textContent,r.innerHTML,i,e)},50)}function io(n,e,t,r,i){let o=Gf(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",c=>c(n,i,o||ie.empty)))return!0;if(!o)return!1;let a=s1(o),s=a?n.state.tr.replaceSelectionWith(a,r):n.state.tr.replaceSelection(o);return n.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}wt.paste=(n,e)=>{let t=e;if(n.composing&&!Zt)return;let r=ui?null:t.clipboardData,i=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&io(n,r.getData("text/plain"),r.getData("text/html"),i,t)?t.preventDefault():l1(n,t)};class c1{constructor(e,t){this.slice=e,this.move=t}}const sp=Lt?"altKey":"ctrlKey";bt.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=n.state.selection,o=i.empty?null:n.posAtCoords(aa(t));if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof he?i.to-1:i.to))){if(r&&r.mightDrag)n.dispatch(n.state.tr.setSelection(he.create(n.state.doc,r.mightDrag.pos)));else if(t.target&&t.target.nodeType==1){let d=n.docView.nearestDesc(t.target,!0);d&&d.node.type.spec.draggable&&d!=n.docView&&n.dispatch(n.state.tr.setSelection(he.create(n.state.doc,d.posBefore)))}}let a=n.state.selection.content(),{dom:s,text:c}=Kf(n,a);t.dataTransfer.clearData(),t.dataTransfer.setData(ui?"Text":"text/html",s.innerHTML),t.dataTransfer.effectAllowed="copyMove",ui||t.dataTransfer.setData("text/plain",c),n.dragging=new c1(a,!t[sp])},bt.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)},wt.dragover=wt.dragenter=(n,e)=>e.preventDefault(),wt.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(aa(t));if(!i)return;let o=n.state.doc.resolve(i.pos),a=r&&r.slice;a?n.someProp("transformPasted",m=>{a=m(a,n)}):a=Gf(n,t.dataTransfer.getData(ui?"Text":"text/plain"),ui?null:t.dataTransfer.getData("text/html"),!1,o);let s=!!(r&&!t[sp]);if(n.someProp("handleDrop",m=>m(n,t,a||ie.empty,s))){t.preventDefault();return}if(!a)return;t.preventDefault();let c=a?Ju(n.state.doc,o.pos,a):o.pos;c==null&&(c=o.pos);let d=n.state.tr;s&&d.deleteSelection();let u=d.mapping.map(c),f=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,p=d.doc;if(f?d.replaceRangeWith(u,u,a.content.firstChild):d.replaceRange(u,u,a),d.doc.eq(p))return;let h=d.doc.resolve(u);if(f&&he.isSelectable(a.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(a.content.firstChild))d.setSelection(new he(h));else{let m=d.mapping.map(c);d.mapping.maps[d.mapping.maps.length-1].forEach((g,k,x,S)=>m=S),d.setSelection(hl(n,h,d.doc.resolve(m)))}n.focus(),n.dispatch(d.setMeta("uiEvent","drop"))},bt.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&Dn(n)},20))},bt.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)},bt.beforeinput=(n,e)=>{if(dt&&Zt&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",o=>o(n,Cr(8,"Backspace")))))return;let{$cursor:i}=n.state.selection;i&&i.pos>0&&n.dispatch(n.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let n in wt)bt[n]=wt[n];function oo(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class la{constructor(e,t){this.toDOM=e,this.spec=t||Ar,this.side=this.spec.side||0}map(e,t,r,i){let{pos:o,deleted:a}=e.mapResult(t.from+i,this.side<0?-1:1);return a?null:new Ft(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof la&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&oo(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Jn{constructor(e,t){this.attrs=e,this.spec=t||Ar}map(e,t,r,i){let o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,a=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=a?null:new Ft(o,a,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof Jn&&oo(this.attrs,e.attrs)&&oo(this.spec,e.spec)}static is(e){return e.type instanceof Jn}destroy(){}}class xl{constructor(e,t){this.attrs=e,this.spec=t||Ar}map(e,t,r,i){let o=e.mapResult(t.from+i,1);if(o.deleted)return null;let a=e.mapResult(t.to+i,-1);return a.deleted||a.pos<=o.pos?null:new Ft(o.pos-r,a.pos-r,this)}valid(e,t){let{index:r,offset:i}=e.content.findIndex(t.from),o;return i==t.from&&!(o=e.child(r)).isText&&i+o.nodeSize==t.to}eq(e){return this==e||e instanceof xl&&oo(this.attrs,e.attrs)&&oo(this.spec,e.spec)}destroy(){}}class Ft{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new Ft(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,r){return this.type.map(e,this,t,r)}static widget(e,t,r){return new Ft(e,e,new la(t,r))}static inline(e,t,r,i){return new Ft(e,t,new Jn(r,i))}static node(e,t,r,i){return new Ft(e,t,new xl(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Jn}get widget(){return this.type instanceof la}}const fi=[],Ar={};class Ke{constructor(e,t){this.local=e.length?e:fi,this.children=t.length?t:fi}static create(e,t){return t.length?ca(t,e,0,Ar):ut}find(e,t,r){let i=[];return this.findInner(e??0,t??1e9,i,0,r),i}findInner(e,t,r,i,o){for(let a=0;a<this.local.length;a++){let s=this.local[a];s.from<=t&&s.to>=e&&(!o||o(s.spec))&&r.push(s.copy(s.from+i,s.to+i))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let s=this.children[a]+1;this.children[a+2].findInner(e-s,t-s,r,i+s,o)}}map(e,t,r){return this==ut||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Ar)}mapInner(e,t,r,i,o){let a;for(let s=0;s<this.local.length;s++){let c=this.local[s].map(e,r,i);c&&c.type.valid(t,c)?(a||(a=[])).push(c):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?d1(this.children,a||[],e,t,r,i,o):a?new Ke(a.sort(Er),fi):ut}add(e,t){return t.length?this==ut?Ke.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let i,o=0;e.forEach((s,c)=>{let d=c+r,u;if(u=cp(t,s,d)){for(i||(i=this.children.slice());o<i.length&&i[o]<c;)o+=3;i[o]==c?i[o+2]=i[o+2].addInner(s,u,d+1):i.splice(o,0,c,c+s.nodeSize,ca(u,s,d+1,Ar)),o+=3}});let a=lp(o?dp(t):t,-r);for(let s=0;s<a.length;s++)a[s].type.valid(e,a[s])||a.splice(s--,1);return new Ke(a.length?this.local.concat(a).sort(Er):this.local,i||this.children)}remove(e){return e.length==0||this==ut?this:this.removeInner(e,0)}removeInner(e,t){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let a,s=r[o]+t,c=r[o+1]+t;for(let u=0,f;u<e.length;u++)(f=e[u])&&f.from>s&&f.to<c&&(e[u]=null,(a||(a=[])).push(f));if(!a)continue;r==this.children&&(r=this.children.slice());let d=r[o+2].removeInner(a,s+1);d!=ut?r[o+2]=d:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,a;o<e.length;o++)if(a=e[o])for(let s=0;s<i.length;s++)i[s].eq(a,t)&&(i==this.local&&(i=this.local.slice()),i.splice(s--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Ke(i,r):ut}forChild(e,t){if(this==ut)return this;if(t.isLeaf)return Ke.empty;let r,i;for(let s=0;s<this.children.length;s+=3)if(this.children[s]>=e){this.children[s]==e&&(r=this.children[s+2]);break}let o=e+1,a=o+t.content.size;for(let s=0;s<this.local.length;s++){let c=this.local[s];if(c.from<a&&c.to>o&&c.type instanceof Jn){let d=Math.max(o,c.from)-o,u=Math.min(a,c.to)-o;d<u&&(i||(i=[])).push(c.copy(d,u))}}if(i){let s=new Ke(i.sort(Er),fi);return r?new Xn([s,r]):s}return r||ut}eq(e){if(this==e)return!0;if(!(e instanceof Ke)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return Cl(this.localsInner(e))}localsInner(e){if(this==ut)return fi;if(e.inlineContent||!this.local.some(Jn.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Jn||t.push(this.local[r]);return t}}Ke.empty=new Ke([],[]),Ke.removeOverlap=Cl;const ut=Ke.empty;class Xn{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,Ar));return Xn.from(r)}forChild(e,t){if(t.isLeaf)return Ke.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,t);o!=ut&&(o instanceof Xn?r=r.concat(o.members):r.push(o))}return Xn.from(r)}eq(e){if(!(e instanceof Xn)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!t)t=o;else{r&&(t=t.slice(),r=!1);for(let a=0;a<o.length;a++)t.push(o[a])}}return t?Cl(r?t:t.sort(Er)):fi}static from(e){switch(e.length){case 0:return ut;case 1:return e[0];default:return new Xn(e.every(t=>t instanceof Ke)?e:e.reduce((t,r)=>t.concat(r instanceof Ke?r:r.members),[]))}}}function d1(n,e,t,r,i,o,a){let s=n.slice();for(let d=0,u=o;d<t.maps.length;d++){let f=0;t.maps[d].forEach((p,h,m,g)=>{let k=g-m-(h-p);for(let x=0;x<s.length;x+=3){let S=s[x+1];if(S<0||p>S+u-f)continue;let T=s[x]+u-f;h>=T?s[x+1]=p<=T?-2:-1:m>=i&&k&&(s[x]+=k,s[x+1]+=k)}f+=k}),u=t.maps[d].map(u,-1)}let c=!1;for(let d=0;d<s.length;d+=3)if(s[d+1]<0){if(s[d+1]==-2){c=!0,s[d+1]=-1;continue}let u=t.map(n[d]+o),f=u-i;if(f<0||f>=r.content.size){c=!0;continue}let p=t.map(n[d+1]+o,-1),h=p-i,{index:m,offset:g}=r.content.findIndex(f),k=r.maybeChild(m);if(k&&g==f&&g+k.nodeSize==h){let x=s[d+2].mapInner(t,k,u+1,n[d]+o+1,a);x!=ut?(s[d]=f,s[d+1]=h,s[d+2]=x):(s[d+1]=-2,c=!0)}else c=!0}if(c){let d=u1(s,n,e,t,i,o,a),u=ca(d,r,0,a);e=u.local;for(let f=0;f<s.length;f+=3)s[f+1]<0&&(s.splice(f,3),f-=3);for(let f=0,p=0;f<u.children.length;f+=3){let h=u.children[f];for(;p<s.length&&s[p]<h;)p+=3;s.splice(p,0,u.children[f],u.children[f+1],u.children[f+2])}}return new Ke(e.sort(Er),s)}function lp(n,e){if(!e||!n.length)return n;let t=[];for(let r=0;r<n.length;r++){let i=n[r];t.push(new Ft(i.from+e,i.to+e,i.type))}return t}function u1(n,e,t,r,i,o,a){function s(c,d){for(let u=0;u<c.local.length;u++){let f=c.local[u].map(r,i,d);f?t.push(f):a.onRemove&&a.onRemove(c.local[u].spec)}for(let u=0;u<c.children.length;u+=3)s(c.children[u+2],c.children[u]+d+1)}for(let c=0;c<n.length;c+=3)n[c+1]==-1&&s(n[c+2],e[c]+o+1);return t}function cp(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,i=null;for(let o=0,a;o<n.length;o++)(a=n[o])&&a.from>t&&a.to<r&&((i||(i=[])).push(a),n[o]=null);return i}function dp(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function ca(n,e,t,r){let i=[],o=!1;e.forEach((s,c)=>{let d=cp(n,s,c+t);if(d){o=!0;let u=ca(d,s,t+c+1,r);u!=ut&&i.push(c,c+s.nodeSize,u)}});let a=lp(o?dp(n):n,-t).sort(Er);for(let s=0;s<a.length;s++)a[s].type.valid(e,a[s])||(r.onRemove&&r.onRemove(a[s].spec),a.splice(s--,1));return a.length||i.length?new Ke(a,i):ut}function Er(n,e){return n.from-e.from||n.to-e.to}function Cl(n){let e=n;for(let t=0;t<e.length-1;t++){let r=e[t];if(r.from!=r.to)for(let i=t+1;i<e.length;i++){let o=e[i];if(o.from==r.from){o.to!=r.to&&(e==n&&(e=n.slice()),e[i]=o.copy(o.from,r.to),up(e,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(e==n&&(e=n.slice()),e[t]=r.copy(r.from,o.from),up(e,i,r.copy(o.from,r.to)));break}}}return e}function up(n,e,t){for(;e<n.length&&Er(t,n[e])>0;)e++;n.splice(e,0,t)}function Ml(n){let e=[];return n.someProp("decorations",t=>{let r=t(n.state);r&&r!=ut&&e.push(r)}),n.cursorWrapper&&e.push(Ke.create(n.state.doc,[n.cursorWrapper.deco])),Xn.from(e)}const f1={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},p1=Mt&&qn<=11;class h1{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class m1{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new h1,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);Mt&&qn<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),p1&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,f1)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Ff(this.view)){if(this.suppressingSelectionUpdates)return Dn(this.view);if(Mt&&qn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&xr(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,r;for(let o=e.focusNode;o;o=Xi(o))t.add(o);for(let o=e.anchorNode;o;o=Xi(o))if(t.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Ff(e)&&!this.ignoreSelectionChange(r),o=-1,a=-1,s=!1,c=[];if(e.editable)for(let u=0;u<t.length;u++){let f=this.registerMutation(t[u],c);f&&(o=o<0?f.from:Math.min(f.from,o),a=a<0?f.to:Math.max(f.to,a),f.typeOver&&(s=!0))}if(Xt&&c.length>1){let u=c.filter(f=>f.nodeName=="BR");if(u.length==2){let f=u[0],p=u[1];f.parentNode&&f.parentNode.parentNode==p.parentNode?p.remove():f.remove()}}let d=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&ra(r)&&(d=fl(e))&&d.eq(ye.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Dn(e),this.currentSelection.set(r),e.scrollToSelection()):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,a),g1(e)),this.handleDOMChange(o,a,s,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Dn(e),this.currentSelection.set(r))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++)t.push(e.addedNodes[u]);if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,o=e.nextSibling;if(Mt&&qn<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:f,nextSibling:p}=e.addedNodes[u];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f),(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(o=p)}let a=i&&i.parentNode==e.target?yt(i)+1:0,s=r.localPosFromDOM(e.target,a,-1),c=o&&o.parentNode==e.target?yt(o):e.target.childNodes.length,d=r.localPosFromDOM(e.target,c,1);return{from:s,to:d}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}let fp=new WeakMap,pp=!1;function g1(n){if(!fp.has(n)&&(fp.set(n,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace)!==-1)){if(n.requiresGeckoHackNode=Xt,pp)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),pp=!0}}function y1(n){let e;function t(c){c.preventDefault(),c.stopImmediatePropagation(),e=c.getTargetRanges()[0]}n.dom.addEventListener("beforeinput",t,!0),document.execCommand("indent"),n.dom.removeEventListener("beforeinput",t,!0);let r=e.startContainer,i=e.startOffset,o=e.endContainer,a=e.endOffset,s=n.domAtPos(n.state.selection.anchor);return xr(s.node,s.offset,o,a)&&([r,i,o,a]=[o,a,r,i]),{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:a}}function v1(n,e,t){let{node:r,fromOffset:i,toOffset:o,from:a,to:s}=n.docView.parseRange(e,t),c=n.domSelectionRange(),d,u=c.anchorNode;if(u&&n.dom.contains(u.nodeType==1?u:u.parentNode)&&(d=[{node:u,offset:c.anchorOffset}],ra(c)||d.push({node:c.focusNode,offset:c.focusOffset})),dt&&n.input.lastKeyCode===8)for(let k=o;k>i;k--){let x=r.childNodes[k-1],S=x.pmViewDesc;if(x.nodeName=="BR"&&!S){o=k;break}if(!S||S.size)break}let f=n.state.doc,p=n.someProp("domParser")||Xr.fromSchema(n.state.schema),h=f.resolve(a),m=null,g=p.parse(r,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:i,to:o,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:b1,context:h});if(d&&d[0].pos!=null){let k=d[0].pos,x=d[1]&&d[1].pos;x==null&&(x=k),m={anchor:k+a,head:x+a}}return{doc:g,sel:m,from:a,to:s}}function b1(n){let e=n.pmViewDesc;if(e)return e.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(vt&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(n.parentNode.lastChild==n||vt&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}else if(n.nodeName=="IMG"&&n.getAttribute("mark-placeholder"))return{ignore:!0};return null}const w1=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function k1(n,e,t,r,i){let o=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let M=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,_=fl(n,M);if(_&&!n.state.selection.eq(_)){if(dt&&Zt&&n.input.lastKeyCode===13&&Date.now()-100<n.input.lastKeyCodeTime&&n.someProp("handleKeyDown",N=>N(n,Cr(13,"Enter"))))return;let z=n.state.tr.setSelection(_);M=="pointer"?z.setMeta("pointer",!0):M=="key"&&z.scrollIntoView(),o&&z.setMeta("composition",o),n.dispatch(z)}return}let a=n.state.doc.resolve(e),s=a.sharedDepth(t);e=a.before(s+1),t=n.state.doc.resolve(t).after(s+1);let c=n.state.selection,d=v1(n,e,t),u=n.state.doc,f=u.slice(d.from,d.to),p,h;n.input.lastKeyCode===8&&Date.now()-100<n.input.lastKeyCodeTime?(p=n.state.selection.to,h="end"):(p=n.state.selection.from,h="start"),n.input.lastKeyCode=null;let m=M1(f.content,d.doc.content,d.from,p,h);if((si&&n.input.lastIOSEnter>Date.now()-225||Zt)&&i.some(M=>M.nodeType==1&&!w1.test(M.nodeName))&&(!m||m.endA>=m.endB)&&n.someProp("handleKeyDown",M=>M(n,Cr(13,"Enter")))){n.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof ge&&!c.empty&&c.$head.sameParent(c.$anchor)&&!n.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(d.sel){let M=hp(n,n.state.doc,d.sel);if(M&&!M.eq(n.state.selection)){let _=n.state.tr.setSelection(M);o&&_.setMeta("composition",o),n.dispatch(_)}}return}if(dt&&n.cursorWrapper&&d.sel&&d.sel.anchor==n.cursorWrapper.deco.from&&d.sel.head==d.sel.anchor){let M=m.endB-m.start;d.sel={anchor:d.sel.anchor+M,head:d.sel.anchor+M}}n.input.domChangeCount++,n.state.selection.from<n.state.selection.to&&m.start==m.endB&&n.state.selection instanceof ge&&(m.start>n.state.selection.from&&m.start<=n.state.selection.from+2&&n.state.selection.from>=d.from?m.start=n.state.selection.from:m.endA<n.state.selection.to&&m.endA>=n.state.selection.to-2&&n.state.selection.to<=d.to&&(m.endB+=n.state.selection.to-m.endA,m.endA=n.state.selection.to)),Mt&&qn<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>d.from&&d.doc.textBetween(m.start-d.from-1,m.start-d.from+1)=="  "&&(m.start--,m.endA--,m.endB--);let g=d.doc.resolveNoCache(m.start-d.from),k=d.doc.resolveNoCache(m.endB-d.from),x=u.resolve(m.start),S=g.sameParent(k)&&g.parent.inlineContent&&x.end()>=m.endA,T;if((si&&n.input.lastIOSEnter>Date.now()-225&&(!S||i.some(M=>M.nodeName=="DIV"||M.nodeName=="P"))||!S&&g.pos<d.doc.content.size&&!g.sameParent(k)&&(T=ye.findFrom(d.doc.resolve(g.pos+1),1,!0))&&T.head==k.pos)&&n.someProp("handleKeyDown",M=>M(n,Cr(13,"Enter")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>m.start&&C1(u,m.start,m.endA,g,k)&&n.someProp("handleKeyDown",M=>M(n,Cr(8,"Backspace")))){Zt&&dt&&n.domObserver.suppressSelectionUpdates();return}dt&&Zt&&m.endB==m.start&&(n.input.lastAndroidDelete=Date.now()),Zt&&!S&&g.start()!=k.start()&&k.parentOffset==0&&g.depth==k.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==m.endA&&(m.endB-=2,k=d.doc.resolveNoCache(m.endB-d.from),setTimeout(()=>{n.someProp("handleKeyDown",function(M){return M(n,Cr(13,"Enter"))})},20));let y=m.start,B=m.endA,w,V,$;if(S){if(g.pos==k.pos)Mt&&qn<=11&&g.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>Dn(n),20)),w=n.state.tr.delete(y,B),V=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&($=x1(g.parent.content.cut(g.parentOffset,k.parentOffset),x.parent.content.cut(x.parentOffset,m.endA-x.start()))))w=n.state.tr,$.type=="add"?w.addMark(y,B,$.mark):w.removeMark(y,B,$.mark);else if(g.parent.child(g.index()).isText&&g.index()==k.index()-(k.textOffset?0:1)){let M=g.parent.textBetween(g.parentOffset,k.parentOffset);if(n.someProp("handleTextInput",_=>_(n,y,B,M)))return;w=n.state.tr.insertText(M,y,B)}}if(w||(w=n.state.tr.replace(y,B,d.doc.slice(m.start-d.from,m.endB-d.from))),d.sel){let M=hp(n,w.doc,d.sel);M&&!(dt&&Zt&&n.composing&&M.empty&&(m.start!=m.endB||n.input.lastAndroidDelete<Date.now()-100)&&(M.head==y||M.head==w.mapping.map(B)-1)||Mt&&M.empty&&M.head==y)&&w.setSelection(M)}V&&w.ensureMarks(V),o&&w.setMeta("composition",o),n.dispatch(w.scrollIntoView())}function hp(n,e,t){return Math.max(t.anchor,t.head)>e.content.size?null:hl(n,e.resolve(t.anchor),e.resolve(t.head))}function x1(n,e){let t=n.firstChild.marks,r=e.firstChild.marks,i=t,o=r,a,s,c;for(let u=0;u<r.length;u++)i=r[u].removeFromSet(i);for(let u=0;u<t.length;u++)o=t[u].removeFromSet(o);if(i.length==1&&o.length==0)s=i[0],a="add",c=u=>u.mark(s.addToSet(u.marks));else if(i.length==0&&o.length==1)s=o[0],a="remove",c=u=>u.mark(s.removeFromSet(u.marks));else return null;let d=[];for(let u=0;u<e.childCount;u++)d.push(c(e.child(u)));if(K.from(d).eq(n))return{mark:s,type:a}}function C1(n,e,t,r,i){if(!r.parent.isTextblock||t-e<=i.pos-r.pos||Tl(r,!0,!1)<i.pos)return!1;let o=n.resolve(e);if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let a=n.resolve(Tl(o,!0,!0));return!a.parent.isTextblock||a.pos>t||Tl(a,!0,!1)<t?!1:r.parent.content.cut(r.parentOffset).eq(a.parent.content)}function Tl(n,e,t){let r=n.depth,i=e?n.end():n.pos;for(;r>0&&(e||n.indexAfter(r)==n.node(r).childCount);)r--,i++,e=!1;if(t){let o=n.node(r).maybeChild(n.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function M1(n,e,t,r,i){let o=n.findDiffStart(e,t);if(o==null)return null;let{a,b:s}=n.findDiffEnd(e,t+n.size,t+e.size);if(i=="end"){let c=Math.max(0,o-Math.min(a,s));r-=a+c-o}if(a<o&&n.size<e.size){let c=r<=o&&r>=a?o-r:0;o-=c,s=o+(s-a),a=o}else if(s<o){let c=r<=o&&r>=s?o-r:0;o-=c,a=o+(a-s),s=o}return{start:o,endA:a,endB:s}}class T1{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new jx,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(bp),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=yp(this),gp(this),this.nodeViews=vp(this),this.docView=Af(this.state.doc,mp(this),Ml(this),this.dom,this),this.domObserver=new m1(this,(r,i,o,a)=>k1(this,r,i,o,a)),this.domObserver.start(),Wx(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&vl(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(bp),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let r in this._props)t[r]=this._props[r];t.state=this.state;for(let r in e)t[r]=e[r];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let r=this.state,i=!1,o=!1;e.storedMarks&&this.composing&&(ap(this),o=!0),this.state=e;let a=r.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let p=vp(this);D1(p,this.nodeViews)&&(this.nodeViews=p,i=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&vl(this),this.editable=yp(this),gp(this);let s=Ml(this),c=mp(this),d=r.plugins!=e.plugins&&!r.doc.eq(e.doc)?"reset":e.scrollToSelection>r.scrollToSelection?"to selection":"preserve",u=i||!this.docView.matchesNode(e.doc,c,s);(u||!e.selection.eq(r.selection))&&(o=!0);let f=d=="preserve"&&o&&this.dom.style.overflowAnchor==null&&ax(this);if(o){this.domObserver.stop();let p=u&&(Mt||dt)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&S1(r.selection,e.selection);if(u){let h=dt?this.trackWrites=this.domSelectionRange().focusNode:null;(i||!this.docView.update(e.doc,c,s,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Af(e.doc,c,s,this.dom,this)),h&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Nx(this))?Dn(this,p):(Lf(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():f&&sx(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof he){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&mf(this,t.getBoundingClientRect(),e)}else mf(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t<this.directPlugins.length;t++){let r=this.directPlugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let r=this.state.plugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let r=this.pluginViews[t];r.update&&r.update(this,e)}}someProp(e,t){let r=this._props&&this._props[e],i;if(r!=null&&(i=t?t(r):r))return i;for(let a=0;a<this.directPlugins.length;a++){let s=this.directPlugins[a].props[e];if(s!=null&&(i=t?t(s):s))return i}let o=this.state.plugins;if(o)for(let a=0;a<o.length;a++){let s=o[a].props[e];if(s!=null&&(i=t?t(s):s))return i}}hasFocus(){if(Mt){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&lx(this.dom),Dn(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let t=this.dom.parentNode;t;t=t.parentNode)if(t.nodeType==9||t.nodeType==11&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return px(this,e)}coordsAtPos(e,t=1){return kf(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,r=-1){let i=this.docView.posFromDOM(e,t,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return vx(this,t||this.state,e)}pasteHTML(e,t){return io(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return io(this,e,null,!0,t||new ClipboardEvent("paste"))}destroy(){this.docView&&(qx(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Ml(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Gx(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return vt&&this.root.nodeType===11&&Zk(this.dom.ownerDocument)==this.dom?y1(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function mp(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(n.state)),t)for(let r in t)r=="class"?e.class+=" "+t[r]:r=="style"?e.style=(e.style?e.style+";":"")+t[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(t[r]))}),e.translate||(e.translate="no"),[Ft.node(0,n.state.doc.content.size,e)]}function gp(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:Ft.widget(n.state.selection.head,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function yp(n){return!n.someProp("editable",e=>e(n.state)===!1)}function S1(n,e){let t=Math.min(n.$anchor.sharedDepth(n.head),e.$anchor.sharedDepth(e.head));return n.$anchor.start(t)!=e.$anchor.start(t)}function vp(n){let e=Object.create(null);function t(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function D1(n,e){let t=0,r=0;for(let i in n){if(n[i]!=e[i])return!0;t++}for(let i in e)r++;return t!=r}function bp(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var Zn={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},da={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},A1=typeof navigator<"u"&&/Mac/.test(navigator.platform),E1=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),at=0;at<10;at++)Zn[48+at]=Zn[96+at]=String(at);for(var at=1;at<=24;at++)Zn[at+111]="F"+at;for(var at=65;at<=90;at++)Zn[at]=String.fromCharCode(at+32),da[at]=String.fromCharCode(at);for(var Sl in Zn)da.hasOwnProperty(Sl)||(da[Sl]=Zn[Sl]);function O1(n){var e=A1&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||E1&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?da:Zn)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const N1=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function _1(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,o,a;for(let s=0;s<e.length-1;s++){let c=e[s];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))N1?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+c)}return r&&(t="Alt-"+t),i&&(t="Ctrl-"+t),a&&(t="Meta-"+t),o&&(t="Shift-"+t),t}function B1(n){let e=Object.create(null);for(let t in n)e[_1(t)]=n[t];return e}function Dl(n,e,t=!0){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t&&e.shiftKey&&(n="Shift-"+n),n}function P1(n){return new Ct({props:{handleKeyDown:wp(n)}})}function wp(n){let e=B1(n);return function(t,r){let i=O1(r),o,a=e[Dl(i,r)];if(a&&a(t.state,t.dispatch,t))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let s=e[Dl(i,r,!1)];if(s&&s(t.state,t.dispatch,t))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=Zn[r.keyCode])&&o!=i){let s=e[Dl(o,r)];if(s&&s(t.state,t.dispatch,t))return!0}}return!1}}const I1=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function R1(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const V1=(n,e,t)=>{let r=R1(n,t);if(!r)return!1;let i=kp(r);if(!i){let a=r.blockRange(),s=a&&ti(a);return s==null?!1:(e&&e(n.tr.lift(a,s).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&Mp(n,i,e))return!0;if(r.parent.content.size==0&&(pi(o,"end")||he.isSelectable(o))){let a=Qs(n.doc,r.before(),r.after(),ie.empty);if(a&&a.slice.size<a.to-a.from){if(e){let s=n.tr.step(a);s.setSelection(pi(o,"end")?ye.findFrom(s.doc.resolve(s.mapping.map(i.pos,-1)),-1):he.create(s.doc,i.pos-o.nodeSize)),e(s.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1};function pi(n,e,t=!1){for(let r=n;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(t&&r.childCount!=1)return!1}return!1}const L1=(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;o=kp(r)}let a=o&&o.nodeBefore;return!a||!he.isSelectable(a)?!1:(e&&e(n.tr.setSelection(he.create(n.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)};function kp(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function $1(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const F1=(n,e,t)=>{let r=$1(n,t);if(!r)return!1;let i=xp(r);if(!i)return!1;let o=i.nodeAfter;if(Mp(n,i,e))return!0;if(r.parent.content.size==0&&(pi(o,"start")||he.isSelectable(o))){let a=Qs(n.doc,r.before(),r.after(),ie.empty);if(a&&a.slice.size<a.to-a.from){if(e){let s=n.tr.step(a);s.setSelection(pi(o,"start")?ye.findFrom(s.doc.resolve(s.mapping.map(i.pos)),1):he.create(s.doc,s.mapping.map(i.pos))),e(s.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},z1=(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset<r.parent.content.size)return!1;o=xp(r)}let a=o&&o.nodeAfter;return!a||!he.isSelectable(a)?!1:(e&&e(n.tr.setSelection(he.create(n.doc,o.pos)).scrollIntoView()),!0)};function xp(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){let t=n.node(e);if(n.index(e)+1<t.childCount)return n.doc.resolve(n.after(e+1));if(t.type.spec.isolating)break}return null}const H1=(n,e)=>{let t=n.selection,r=t instanceof he,i;if(r){if(t.node.isTextblock||!jn(n.doc,t.from))return!1;i=t.from}else if(i=ea(n.doc,t.from,-1),i==null)return!1;if(e){let o=n.tr.join(i);r&&o.setSelection(he.create(o.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},Y1=(n,e)=>{let t=n.selection,r;if(t instanceof he){if(t.node.isTextblock||!jn(n.doc,t.to))return!1;r=t.to}else if(r=ea(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},U1=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),o=i&&ti(i);return o==null?!1:(e&&e(n.tr.lift(i,o).scrollIntoView()),!0)},j1=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(`
80
- `).scrollIntoView()),!0)};function Cp(n){for(let e=0;e<n.edgeCount;e++){let{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const W1=(n,e)=>{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let i=t.node(-1),o=t.indexAfter(-1),a=Cp(i.contentMatchAt(o));if(!a||!i.canReplaceWith(o,o,a))return!1;if(e){let s=t.after(),c=n.tr.replaceWith(s,s,a.createAndFill());c.setSelection(ye.near(c.doc.resolve(s),1)),e(c.scrollIntoView())}return!0},q1=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof Jt||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Cp(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,s=n.tr.insert(a,o.createAndFill());s.setSelection(ge.create(s.doc,a+1)),e(s.scrollIntoView())}return!0},K1=(n,e)=>{let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let o=t.before();if(ni(n.doc,o))return e&&e(n.tr.split(o).scrollIntoView()),!0}let r=t.blockRange(),i=r&&ti(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)},G1=(n,e)=>{let{$from:t,to:r}=n.selection,i,o=t.sharedDepth(r);return o==0?!1:(i=t.before(o),e&&e(n.tr.setSelection(he.create(n.doc,i))),!0)};function Q1(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||jn(n.doc,e.pos))?!1:(t&&t(n.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function Mp(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o,a;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(Q1(n,e,t))return!0;let s=e.parent.canReplace(e.index(),e.index()+1);if(s&&(o=(a=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&a.matchType(o[0]||i.type).validEnd){if(t){let f=e.pos+i.nodeSize,p=K.empty;for(let g=o.length-1;g>=0;g--)p=K.from(o[g].create(null,p));p=K.from(r.copy(p));let h=n.tr.step(new Ze(e.pos-1,f,e.pos,f,new ie(p,1,0),o.length,!0)),m=f+2*o.length;jn(h.doc,m)&&h.join(m),t(h.scrollIntoView())}return!0}let c=ye.findFrom(e,1),d=c&&c.$from.blockRange(c.$to),u=d&&ti(d);if(u!=null&&u>=e.depth)return t&&t(n.tr.lift(d,u).scrollIntoView()),!0;if(s&&pi(i,"start",!0)&&pi(r,"end")){let f=r,p=[];for(;p.push(f),!f.isTextblock;)f=f.lastChild;let h=i,m=1;for(;!h.isTextblock;h=h.firstChild)m++;if(f.canReplace(f.childCount,f.childCount,h.content)){if(t){let g=K.empty;for(let x=p.length-1;x>=0;x--)g=K.from(p[x].copy(g));let k=n.tr.step(new Ze(e.pos-p.length,e.pos+i.nodeSize,e.pos+m,e.pos+i.nodeSize-m,new ie(g,p.length,0),0,!0));t(k.scrollIntoView())}return!0}}return!1}function Tp(n){return function(e,t){let r=e.selection,i=n<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(t&&t(e.tr.setSelection(ge.create(e.doc,n<0?i.start(o):i.end(o)))),!0):!1}}const J1=Tp(-1),X1=Tp(1);function Z1(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,a=i.blockRange(o),s=a&&Gs(a,n,e);return s?(r&&r(t.tr.wrap(a,s).scrollIntoView()),!0):!1}}function Sp(n,e=null){return function(t,r){let i=!1;for(let o=0;o<t.selection.ranges.length&&!i;o++){let{$from:{pos:a},$to:{pos:s}}=t.selection.ranges[o];t.doc.nodesBetween(a,s,(c,d)=>{if(i)return!1;if(!(!c.isTextblock||c.hasMarkup(n,e)))if(c.type==n)i=!0;else{let u=t.doc.resolve(d),f=u.index();i=u.parent.canReplaceWith(f,f+1,n)}})}if(!i)return!1;if(r){let o=t.tr;for(let a=0;a<t.selection.ranges.length;a++){let{$from:{pos:s},$to:{pos:c}}=t.selection.ranges[a];o.setBlockType(s,c,n,e)}r(o.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function eC(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,a=i.blockRange(o),s=!1,c=a;if(!a)return!1;if(a.depth>=2&&i.node(a.depth-1).type.compatibleContent(n)&&a.startIndex==0){if(i.index(a.depth-1)==0)return!1;let u=t.doc.resolve(a.start-2);c=new qo(u,u,a.depth),a.endIndex<a.parent.childCount&&(a=new qo(i,t.doc.resolve(o.end(a.depth)),a.depth)),s=!0}let d=Gs(c,n,e,a);return d?(r&&r(tC(t.tr,a,d,s,n).scrollIntoView()),!0):!1}}function tC(n,e,t,r,i){let o=K.empty;for(let u=t.length-1;u>=0;u--)o=K.from(t[u].type.create(t[u].attrs,o));n.step(new Ze(e.start-(r?2:0),e.end,e.start,e.end,new ie(o,0,0),t.length,!0));let a=0;for(let u=0;u<t.length;u++)t[u].type==i&&(a=u+1);let s=t.length-a,c=e.start+t.length-(r?2:0),d=e.parent;for(let u=e.startIndex,f=e.endIndex,p=!0;u<f;u++,p=!1)!p&&ni(n.doc,c,s)&&(n.split(c,s),c+=2*s),c+=d.child(u).nodeSize;return n}function nC(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,a=>a.childCount>0&&a.firstChild.type==n);return o?t?r.node(o.depth-1).type==n?rC(e,t,n,o):iC(e,t,o):!0:!1}}function rC(n,e,t,r){let i=n.tr,o=r.end,a=r.$to.end(r.depth);o<a&&(i.step(new Ze(o-1,a,o,a,new ie(K.from(t.create(null,r.parent.copy())),1,0),1,!0)),r=new qo(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const s=ti(r);if(s==null)return!1;i.lift(r,s);let c=i.mapping.map(o,-1)-1;return jn(i.doc,c)&&i.join(c),e(i.scrollIntoView()),!0}function iC(n,e,t){let r=n.tr,i=t.parent;for(let h=t.end,m=t.endIndex-1,g=t.startIndex;m>g;m--)h-=i.child(m).nodeSize,r.delete(h-1,h+1);let o=r.doc.resolve(t.start),a=o.nodeAfter;if(r.mapping.map(t.end)!=t.start+o.nodeAfter.nodeSize)return!1;let s=t.startIndex==0,c=t.endIndex==i.childCount,d=o.node(-1),u=o.index(-1);if(!d.canReplace(u+(s?0:1),u+1,a.content.append(c?K.empty:K.from(i))))return!1;let f=o.pos,p=f+a.nodeSize;return r.step(new Ze(f-(s?1:0),p+(c?1:0),f+1,p-1,new ie((s?K.empty:K.from(i.copy(K.empty))).append(c?K.empty:K.from(i.copy(K.empty))),s?0:1,c?0:1),s?0:1)),e(r.scrollIntoView()),!0}function oC(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,d=>d.childCount>0&&d.firstChild.type==n);if(!o)return!1;let a=o.startIndex;if(a==0)return!1;let s=o.parent,c=s.child(a-1);if(c.type!=n)return!1;if(t){let d=c.lastChild&&c.lastChild.type==s.type,u=K.from(d?n.create():null),f=new ie(K.from(n.create(null,K.from(s.type.create(null,u)))),d?3:1,0),p=o.start,h=o.end;t(e.tr.step(new Ze(p-(d?3:1),h,p,h,f,1,!0)).scrollIntoView())}return!0}}function ua(n){const{state:e,transaction:t}=n;let{selection:r}=t,{doc:i}=t,{storedMarks:o}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=t.selection,i=t.doc,o=t.storedMarks,t}}}class fa{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:r}=this,{view:i}=t,{tr:o}=r,a=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([s,c])=>[s,(...u)=>{const f=c(...u)(a);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,s=[],c=!!e,d=e||o.tr,u=()=>(!c&&t&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(d),s.every(p=>p===!0)),f={...Object.fromEntries(Object.entries(r).map(([p,h])=>[p,(...g)=>{const k=this.buildProps(d,t),x=h(...g)(k);return s.push(x),f}])),run:u};return f}createCan(e){const{rawCommands:t,state:r}=this,i=!1,o=e||r.tr,a=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(t).map(([c,d])=>[c,(...u)=>d(...u)({...a,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,s={tr:e,editor:i,view:a,state:ua({state:o,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([c,d])=>[c,(...u)=>d(...u)(s)]))}};return s}}class aC{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,t)),this}off(e,t){const r=this.callbacks[e];return r&&(t?this.callbacks[e]=r.filter(i=>i!==t):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function le(n,e,t){return n.config[e]===void 0&&n.parent?le(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?le(n.parent,e,t):null}):n.config[e]}function pa(n){const e=n.filter(i=>i.type==="extension"),t=n.filter(i=>i.type==="node"),r=n.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:r}}function Dp(n){const e=[],{nodeExtensions:t,markExtensions:r}=pa(n),i=[...t,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return n.forEach(a=>{const s={name:a.name,options:a.options,storage:a.storage},c=le(a,"addGlobalAttributes",s);if(!c)return;c().forEach(u=>{u.types.forEach(f=>{Object.entries(u.attributes).forEach(([p,h])=>{e.push({type:f,name:p,attribute:{...o,...h}})})})})}),i.forEach(a=>{const s={name:a.name,options:a.options,storage:a.storage},c=le(a,"addAttributes",s);if(!c)return;const d=c();Object.entries(d).forEach(([u,f])=>{const p={...o,...f};typeof(p==null?void 0:p.default)=="function"&&(p.default=p.default()),p!=null&&p.isRequired&&(p==null?void 0:p.default)===void 0&&delete p.default,e.push({type:a.name,name:u,attribute:p})})}),e}function et(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}function We(...n){return n.filter(e=>!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const s=o?o.split(" "):[],c=r[i]?r[i].split(" "):[],d=s.filter(u=>!c.includes(u));r[i]=[...c,...d].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function Al(n,e){return e.filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>We(t,r),{})}function Ap(n){return typeof n=="function"}function ve(n,e=void 0,...t){return Ap(n)?e?n.bind(e)(...t):n(...t):n}function sC(n={}){return Object.keys(n).length===0&&n.constructor===Object}function lC(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function Ep(n,e){return n.style?n:{...n,getAttrs:t=>{const r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;const i=e.reduce((o,a)=>{const s=a.attribute.parseHTML?a.attribute.parseHTML(t):lC(t.getAttribute(a.name));return s==null?o:{...o,[a.name]:s}},{});return{...r,...i}}}}function Op(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&sC(t)?!1:t!=null))}function cC(n,e){var t;const r=Dp(n),{nodeExtensions:i,markExtensions:o}=pa(n),a=(t=i.find(d=>le(d,"topNode")))===null||t===void 0?void 0:t.name,s=Object.fromEntries(i.map(d=>{const u=r.filter(x=>x.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:e},p=n.reduce((x,S)=>{const T=le(S,"extendNodeSchema",f);return{...x,...T?T(d):{}}},{}),h=Op({...p,content:ve(le(d,"content",f)),marks:ve(le(d,"marks",f)),group:ve(le(d,"group",f)),inline:ve(le(d,"inline",f)),atom:ve(le(d,"atom",f)),selectable:ve(le(d,"selectable",f)),draggable:ve(le(d,"draggable",f)),code:ve(le(d,"code",f)),defining:ve(le(d,"defining",f)),isolating:ve(le(d,"isolating",f)),attrs:Object.fromEntries(u.map(x=>{var S;return[x.name,{default:(S=x==null?void 0:x.attribute)===null||S===void 0?void 0:S.default}]}))}),m=ve(le(d,"parseHTML",f));m&&(h.parseDOM=m.map(x=>Ep(x,u)));const g=le(d,"renderHTML",f);g&&(h.toDOM=x=>g({node:x,HTMLAttributes:Al(x,u)}));const k=le(d,"renderText",f);return k&&(h.toText=k),[d.name,h]})),c=Object.fromEntries(o.map(d=>{const u=r.filter(k=>k.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:e},p=n.reduce((k,x)=>{const S=le(x,"extendMarkSchema",f);return{...k,...S?S(d):{}}},{}),h=Op({...p,inclusive:ve(le(d,"inclusive",f)),excludes:ve(le(d,"excludes",f)),group:ve(le(d,"group",f)),spanning:ve(le(d,"spanning",f)),code:ve(le(d,"code",f)),attrs:Object.fromEntries(u.map(k=>{var x;return[k.name,{default:(x=k==null?void 0:k.attribute)===null||x===void 0?void 0:x.default}]}))}),m=ve(le(d,"parseHTML",f));m&&(h.parseDOM=m.map(k=>Ep(k,u)));const g=le(d,"renderHTML",f);return g&&(h.toDOM=k=>g({mark:k,HTMLAttributes:Al(k,u)})),[d.name,h]}));return new yk({topNode:a,nodes:s,marks:c})}function El(n,e){return e.nodes[n]||e.marks[n]||null}function Np(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}const dC=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(i,o,a,s)=>{var c,d;const u=((d=(c=i.type.spec).toText)===null||d===void 0?void 0:d.call(c,{node:i,pos:o,parent:a,index:s}))||i.textContent||"%leaf%";t+=u.slice(0,Math.max(0,r-o))}),t};function Ol(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class ha{constructor(e){this.find=e.find,this.handler=e.handler}}const uC=(n,e)=>{if(Ol(e))return e.exec(n);const t=e(n);if(!t)return null;const r=[t.text];return r.index=t.index,r.input=n,r.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(t.replaceWith)),r};function Nl(n){var e;const{editor:t,from:r,to:i,text:o,rules:a,plugin:s}=n,{view:c}=t;if(c.composing)return!1;const d=c.state.doc.resolve(r);if(d.parent.type.spec.code||!((e=d.nodeBefore||d.nodeAfter)===null||e===void 0)&&e.marks.find(p=>p.type.spec.code))return!1;let u=!1;const f=dC(d)+o;return a.forEach(p=>{if(u)return;const h=uC(f,p.find);if(!h)return;const m=c.state.tr,g=ua({state:c.state,transaction:m}),k={from:r-(h[0].length-o.length),to:i},{commands:x,chain:S,can:T}=new fa({editor:t,state:g});p.handler({state:g,range:k,match:h,commands:x,chain:S,can:T})===null||!m.steps.length||(m.setMeta(s,{transform:m,from:r,to:i,text:o}),c.dispatch(m),u=!0)}),u}function fC(n){const{editor:e,rules:t}=n,r=new Ct({state:{init(){return null},apply(i,o){const a=i.getMeta(r);return a||(i.selectionSet||i.docChanged?null:o)}},props:{handleTextInput(i,o,a,s){return Nl({editor:e,from:o,to:a,text:s,rules:t,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Nl({editor:e,from:o.pos,to:o.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:a}=i.state.selection;return a?Nl({editor:e,from:a.pos,to:a.pos,text:`
81
- `,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function pC(n){return typeof n=="number"}class hC{constructor(e){this.find=e.find,this.handler=e.handler}}const mC=(n,e)=>{if(Ol(e))return[...n.matchAll(e)];const t=e(n);return t?t.map(r=>{const i=[r.text];return i.index=r.index,i.input=n,i.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(r.replaceWith)),i}):[]};function gC(n){const{editor:e,state:t,from:r,to:i,rule:o,pasteEvent:a,dropEvent:s}=n,{commands:c,chain:d,can:u}=new fa({editor:e,state:t}),f=[];return t.doc.nodesBetween(r,i,(h,m)=>{if(!h.isTextblock||h.type.spec.code)return;const g=Math.max(r,m),k=Math.min(i,m+h.content.size),x=h.textBetween(g-m,k-m,void 0,"");mC(x,o.find).forEach(T=>{if(T.index===void 0)return;const y=g+T.index+1,B=y+T[0].length,w={from:t.tr.mapping.map(y),to:t.tr.mapping.map(B)},V=o.handler({state:t,range:w,match:T,commands:c,chain:d,can:u,pasteEvent:a,dropEvent:s});f.push(V)})}),f.every(h=>h!==null)}function yC(n){const{editor:e,rules:t}=n;let r=null,i=!1,o=!1,a=new ClipboardEvent("paste"),s=new DragEvent("drop");return t.map(d=>new Ct({view(u){const f=p=>{var h;r=!((h=u.dom.parentElement)===null||h===void 0)&&h.contains(p.target)?u.dom.parentElement:null};return window.addEventListener("dragstart",f),{destroy(){window.removeEventListener("dragstart",f)}}},props:{handleDOMEvents:{drop:(u,f)=>(o=r===u.dom.parentElement,s=f,!1),paste:(u,f)=>{var p;const h=(p=f.clipboardData)===null||p===void 0?void 0:p.getData("text/html");return a=f,i=!!(h!=null&&h.includes("data-pm-slice")),!1}}},appendTransaction:(u,f,p)=>{const h=u[0],m=h.getMeta("uiEvent")==="paste"&&!i,g=h.getMeta("uiEvent")==="drop"&&!o;if(!m&&!g)return;const k=f.doc.content.findDiffStart(p.doc.content),x=f.doc.content.findDiffEnd(p.doc.content);if(!pC(k)||!x||k===x.b)return;const S=p.tr,T=ua({state:p,transaction:S});if(!(!gC({editor:e,state:T,from:Math.max(k-1,0),to:x.b-1,rule:d,pasteEvent:a,dropEvent:s})||!S.steps.length))return s=new DragEvent("drop"),a=new ClipboardEvent("paste"),S}}))}function vC(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return[...new Set(e)]}class hi{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=hi.resolve(e),this.schema=cC(this.extensions,t),this.extensions.forEach(r=>{var i;this.editor.extensionStorage[r.name]=r.storage;const o={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:El(r.name,this.schema)};r.type==="mark"&&(!((i=ve(le(r,"keepOnSplit",o)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(r.name);const a=le(r,"onBeforeCreate",o);a&&this.editor.on("beforeCreate",a);const s=le(r,"onCreate",o);s&&this.editor.on("create",s);const c=le(r,"onUpdate",o);c&&this.editor.on("update",c);const d=le(r,"onSelectionUpdate",o);d&&this.editor.on("selectionUpdate",d);const u=le(r,"onTransaction",o);u&&this.editor.on("transaction",u);const f=le(r,"onFocus",o);f&&this.editor.on("focus",f);const p=le(r,"onBlur",o);p&&this.editor.on("blur",p);const h=le(r,"onDestroy",o);h&&this.editor.on("destroy",h)})}static resolve(e){const t=hi.sort(hi.flatten(e)),r=vC(t.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),t}static flatten(e){return e.map(t=>{const r={name:t.name,options:t.options,storage:t.storage},i=le(t,"addExtensions",r);return i?[t,...this.flatten(i())]:t}).flat(10)}static sort(e){return e.sort((r,i)=>{const o=le(r,"priority")||100,a=le(i,"priority")||100;return o>a?-1:o<a?1:0})}get commands(){return this.extensions.reduce((e,t)=>{const r={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:El(t.name,this.schema)},i=le(t,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,t=hi.sort([...this.extensions].reverse()),r=[],i=[],o=t.map(a=>{const s={name:a.name,options:a.options,storage:a.storage,editor:e,type:El(a.name,this.schema)},c=[],d=le(a,"addKeyboardShortcuts",s);let u={};if(a.type==="mark"&&a.config.exitable&&(u.ArrowRight=()=>en.handleExit({editor:e,mark:a})),d){const g=Object.fromEntries(Object.entries(d()).map(([k,x])=>[k,()=>x({editor:e})]));u={...u,...g}}const f=P1(u);c.push(f);const p=le(a,"addInputRules",s);Np(a,e.options.enableInputRules)&&p&&r.push(...p());const h=le(a,"addPasteRules",s);Np(a,e.options.enablePasteRules)&&h&&i.push(...h());const m=le(a,"addProseMirrorPlugins",s);if(m){const g=m();c.push(...g)}return c}).flat();return[fC({editor:e,rules:r}),...yC({editor:e,rules:i}),...o]}get attributes(){return Dp(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=pa(this.extensions);return Object.fromEntries(t.filter(r=>!!le(r,"addNodeView")).map(r=>{const i=this.attributes.filter(c=>c.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:et(r.name,this.schema)},a=le(r,"addNodeView",o);if(!a)return[];const s=(c,d,u,f)=>{const p=Al(c,i);return a()({editor:e,node:c,getPos:u,decorations:f,HTMLAttributes:p,extension:r})};return[r.name,s]}))}}function bC(n){return Object.prototype.toString.call(n).slice(8,-1)}function _l(n){return bC(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function ma(n,e){const t={...n};return _l(n)&&_l(e)&&Object.keys(e).forEach(r=>{_l(e[r])?r in n?t[r]=ma(n[r],e[r]):Object.assign(t,{[r]:e[r]}):Object.assign(t,{[r]:e[r]})}),t}class ft{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ve(le(this,"addOptions",{name:this.name}))),this.storage=ve(le(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new ft(e)}configure(e={}){const t=this.extend();return t.options=ma(this.options,e),t.storage=ve(le(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new ft(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=ve(le(t,"addOptions",{name:t.name})),t.storage=ve(le(t,"addStorage",{name:t.name,options:t.options})),t}}function _p(n,e,t){const{from:r,to:i}=e,{blockSeparator:o=`
82
-
83
- `,textSerializers:a={}}=t||{};let s="",c=!0;return n.nodesBetween(r,i,(d,u,f,p)=>{var h;const m=a==null?void 0:a[d.type.name];m?(d.isBlock&&!c&&(s+=o,c=!0),f&&(s+=m({node:d,pos:u,parent:f,index:p,range:e}))):d.isText?(s+=(h=d==null?void 0:d.text)===null||h===void 0?void 0:h.slice(Math.max(r,u)-u,i-u),c=!1):d.isBlock&&!c&&(s+=o,c=!0)}),s}function Bp(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}const wC=ft.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Ct({key:new hn("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:i}=e,{ranges:o}=i,a=Math.min(...o.map(u=>u.$from.pos)),s=Math.max(...o.map(u=>u.$to.pos)),c=Bp(t);return _p(r,{from:a,to:s},{textSerializers:c})}}})]}}),kC=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window==null?void 0:window.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),xC=(n=!1)=>({commands:e})=>e.setContent("",n),CC=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:i}=r;return t&&i.forEach(({$from:o,$to:a})=>{n.doc.nodesBetween(o.pos,a.pos,(s,c)=>{if(s.type.isText)return;const{doc:d,mapping:u}=e,f=d.resolve(u.map(c)),p=d.resolve(u.map(c+s.nodeSize)),h=f.blockRange(p);if(!h)return;const m=ti(h);if(s.type.isTextblock){const{defaultType:g}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(h.start,g)}(m||m===0)&&e.lift(h,m)})}),!0},MC=n=>e=>n(e),TC=()=>({state:n,dispatch:e})=>q1(n,e),SC=(n,e)=>({editor:t,tr:r})=>{const{state:i}=t,o=i.doc.slice(n.from,n.to);r.deleteRange(n.from,n.to);const a=r.mapping.map(e);return r.insert(a,o.content),r.setSelection(new ge(r.doc.resolve(a-1))),!0},DC=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,r=t.$anchor.node();if(r.content.size>0)return!1;const i=n.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const s=i.before(o),c=i.after(o);n.delete(s,c).scrollIntoView()}return!0}return!1},AC=n=>({tr:e,state:t,dispatch:r})=>{const i=et(n,t.schema),o=e.selection.$anchor;for(let a=o.depth;a>0;a-=1)if(o.node(a).type===i){if(r){const c=o.before(a),d=o.after(a);e.delete(c,d).scrollIntoView()}return!0}return!1},EC=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},OC=()=>({state:n,dispatch:e})=>I1(n,e),NC=()=>({commands:n})=>n.keyboardShortcut("Enter"),_C=()=>({state:n,dispatch:e})=>W1(n,e);function ga(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:Ol(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function Bl(n,e,t={}){return n.find(r=>r.type===e&&ga(r.attrs,t))}function BC(n,e,t={}){return!!Bl(n,e,t)}function Pl(n,e,t={}){if(!n||!e)return;let r=n.parent.childAfter(n.parentOffset);if(n.parentOffset===r.offset&&r.offset!==0&&(r=n.parent.childBefore(n.parentOffset)),!r.node)return;const i=Bl([...r.node.marks],e,t);if(!i)return;let o=r.index,a=n.start()+r.offset,s=o+1,c=a+r.node.nodeSize;for(Bl([...r.node.marks],e,t);o>0&&i.isInSet(n.parent.child(o-1).marks);)o-=1,a-=n.parent.child(o).nodeSize;for(;s<n.parent.childCount&&BC([...n.parent.child(s).marks],e,t);)c+=n.parent.child(s).nodeSize,s+=1;return{from:a,to:c}}function er(n,e){if(typeof n=="string"){if(!e.marks[n])throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);return e.marks[n]}return n}const PC=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const o=er(n,r.schema),{doc:a,selection:s}=t,{$from:c,from:d,to:u}=s;if(i){const f=Pl(c,o,e);if(f&&f.from<=d&&f.to>=u){const p=ge.create(a,f.from,f.to);t.setSelection(p)}}return!0},IC=n=>e=>{const t=typeof n=="function"?n(e):n;for(let r=0;r<t.length;r+=1)if(t[r](e))return!0;return!1};function Il(n){return n instanceof ge}function An(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function Pp(n,e=null){if(!e)return null;const t=ye.atStart(n),r=ye.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return r;const i=t.from,o=r.to;return e==="all"?ge.create(n,An(0,i,o),An(n.content.size,i,o)):ge.create(n,An(e,i,o),An(e,i,o))}function Rl(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const RC=(n=null,e={})=>({editor:t,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const a=()=>{Rl()&&r.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&t.commands.scrollIntoView())})};if(r.hasFocus()&&n===null||n===!1)return!0;if(o&&n===null&&!Il(t.state.selection))return a(),!0;const s=Pp(i.doc,n)||t.state.selection,c=t.state.selection.eq(s);return o&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},VC=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),LC=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e);function Ip(n){const e=`<body>${n}</body>`;return new window.DOMParser().parseFromString(e,"text/html").body}function ya(n,e,t){if(t={slice:!0,parseOptions:{},...t},typeof n=="object"&&n!==null)try{return Array.isArray(n)&&n.length>0?K.fromArray(n.map(r=>e.nodeFromJSON(r))):e.nodeFromJSON(n)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",r),ya("",e,t)}if(typeof n=="string"){const r=Xr.fromSchema(e);return t.slice?r.parseSlice(Ip(n),t.parseOptions).content:r.parse(Ip(n),t.parseOptions)}return ya("",e,t)}function $C(n,e,t){const r=n.steps.length-1;if(r<e)return;const i=n.steps[r];if(!(i instanceof ot||i instanceof Ze))return;const o=n.mapping.maps[r];let a=0;o.forEach((s,c,d,u)=>{a===0&&(a=u)}),n.setSelection(ye.near(n.doc.resolve(a),t))}const FC=n=>n.toString().startsWith("<"),zC=(n,e,t)=>({tr:r,dispatch:i,editor:o})=>{if(i){t={parseOptions:{},updateSelection:!0,...t};const a=ya(e,o.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions}});if(a.toString()==="<>")return!0;let{from:s,to:c}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},d=!0,u=!0;if((FC(a)?a:[a]).forEach(p=>{p.check(),d=d?p.isText&&p.marks.length===0:!1,u=u?p.isBlock:!1}),s===c&&u){const{parent:p}=r.doc.resolve(s);p.isTextblock&&!p.type.spec.code&&!p.childCount&&(s-=1,c+=1)}d?Array.isArray(e)?r.insertText(e.map(p=>p.text||"").join(""),s,c):typeof e=="object"&&e&&e.text?r.insertText(e.text,s,c):r.insertText(e,s,c):r.replaceWith(s,c,a),t.updateSelection&&$C(r,r.steps.length-1,-1)}return!0},HC=()=>({state:n,dispatch:e})=>H1(n,e),YC=()=>({state:n,dispatch:e})=>Y1(n,e),UC=()=>({state:n,dispatch:e})=>V1(n,e),jC=()=>({state:n,dispatch:e})=>F1(n,e),WC=()=>({tr:n,state:e,dispatch:t})=>{try{const r=ea(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},qC=()=>({state:n,dispatch:e,tr:t})=>{try{const r=ea(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}};function Vl(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function KC(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,i,o,a;for(let s=0;s<e.length-1;s+=1){const c=e[s];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))Rl()||Vl()?a=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return r&&(t=`Alt-${t}`),i&&(t=`Ctrl-${t}`),a&&(t=`Meta-${t}`),o&&(t=`Shift-${t}`),t}const GC=n=>({editor:e,view:t,tr:r,dispatch:i})=>{const o=KC(n).split(/-(?!$)/),a=o.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),s=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{t.someProp("handleKeyDown",d=>d(t,s))});return c==null||c.steps.forEach(d=>{const u=d.map(r.mapping);u&&i&&r.maybeStep(u)}),!0};function ao(n,e,t={}){const{from:r,to:i,empty:o}=n.selection,a=e?et(e,n.schema):null,s=[];n.doc.nodesBetween(r,i,(f,p)=>{if(f.isText)return;const h=Math.max(r,p),m=Math.min(i,p+f.nodeSize);s.push({node:f,from:h,to:m})});const c=i-r,d=s.filter(f=>a?a.name===f.node.type.name:!0).filter(f=>ga(f.node.attrs,t,{strict:!1}));return o?!!d.length:d.reduce((f,p)=>f+p.to-p.from,0)>=c}const QC=(n,e={})=>({state:t,dispatch:r})=>{const i=et(n,t.schema);return ao(t,i,e)?U1(t,r):!1},JC=()=>({state:n,dispatch:e})=>K1(n,e),XC=n=>({state:e,dispatch:t})=>{const r=et(n,e.schema);return nC(r)(e,t)},ZC=()=>({state:n,dispatch:e})=>j1(n,e);function va(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function Rp(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((r,i)=>(t.includes(i)||(r[i]=n[i]),r),{})}const eM=(n,e)=>({tr:t,state:r,dispatch:i})=>{let o=null,a=null;const s=va(typeof n=="string"?n:n.name,r.schema);return s?(s==="node"&&(o=et(n,r.schema)),s==="mark"&&(a=er(n,r.schema)),i&&t.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(d,u)=>{o&&o===d.type&&t.setNodeMarkup(u,void 0,Rp(d.attrs,e)),a&&d.marks.length&&d.marks.forEach(f=>{a===f.type&&t.addMark(u,u+d.nodeSize,a.create(Rp(f.attrs,e)))})})}),!0):!1},tM=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),nM=()=>({tr:n,commands:e})=>e.setTextSelection({from:0,to:n.doc.content.size}),rM=()=>({state:n,dispatch:e})=>L1(n,e),iM=()=>({state:n,dispatch:e})=>z1(n,e),oM=()=>({state:n,dispatch:e})=>G1(n,e),aM=()=>({state:n,dispatch:e})=>X1(n,e),sM=()=>({state:n,dispatch:e})=>J1(n,e);function Vp(n,e,t={}){return ya(n,e,{slice:!1,parseOptions:t})}const lM=(n,e=!1,t={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:a}=r,s=Vp(n,i.schema,t);return o&&r.replaceWith(0,a.content.size,s).setMeta("preventUpdate",!e),!0};function ba(n,e){const t=er(e,n.schema),{from:r,to:i,empty:o}=n.selection,a=[];o?(n.storedMarks&&a.push(...n.storedMarks),a.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,i,c=>{a.push(...c.marks)});const s=a.find(c=>c.type.name===t.name);return s?{...s.attrs}:{}}function cM(n){for(let e=0;e<n.edgeCount;e+=1){const{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}function dM(n,e){for(let t=n.depth;t>0;t-=1){const r=n.node(t);if(e(r))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:r}}}function Ll(n){return e=>dM(e.$from,n)}function uM(n,e){const t=fn.fromSchema(e).serializeFragment(n),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(t),i.innerHTML}function fM(n,e){const t={from:0,to:n.content.size};return _p(n,t,e)}function pM(n,e){const t=et(e,n.schema),{from:r,to:i}=n.selection,o=[];n.doc.nodesBetween(r,i,s=>{o.push(s)});const a=o.reverse().find(s=>s.type.name===t.name);return a?{...a.attrs}:{}}function hM(n,e){const t=va(typeof e=="string"?e:e.name,n.schema);return t==="node"?pM(n,e):t==="mark"?ba(n,e):{}}function Lp(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(i=>{const o=t.resolve(n-1),a=Pl(o,i.type);a&&r.push({mark:i,...a})}):t.nodesBetween(n,e,(i,o)=>{r.push(...i.marks.map(a=>({from:o,to:o+i.nodeSize,mark:a})))}),r}function wa(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{const i=n.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function $l(n,e,t={}){const{empty:r,ranges:i}=n.selection,o=e?er(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>ga(f.attrs,t,{strict:!1}));let a=0;const s=[];if(i.forEach(({$from:f,$to:p})=>{const h=f.pos,m=p.pos;n.doc.nodesBetween(h,m,(g,k)=>{if(!g.isText&&!g.marks.length)return;const x=Math.max(h,k),S=Math.min(m,k+g.nodeSize),T=S-x;a+=T,s.push(...g.marks.map(y=>({mark:y,from:x,to:S})))})}),a===0)return!1;const c=s.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>ga(f.mark.attrs,t,{strict:!1})).reduce((f,p)=>f+p.to-p.from,0),d=s.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,p)=>f+p.to-p.from,0);return(c>0?c+d:c)>=a}function mM(n,e,t={}){if(!e)return ao(n,null,t)||$l(n,null,t);const r=va(e,n.schema);return r==="node"?ao(n,e,t):r==="mark"?$l(n,e,t):!1}function $p(n,e){const{nodeExtensions:t}=pa(e),r=t.find(a=>a.name===n);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=ve(le(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function gM(n){var e;const t=(e=n.type.createAndFill())===null||e===void 0?void 0:e.toJSON(),r=n.toJSON();return JSON.stringify(t)===JSON.stringify(r)}function yM(n){return n instanceof he}function Fp(n,e,t){const i=n.state.doc.content.size,o=An(e,0,i),a=An(t,0,i),s=n.coordsAtPos(o),c=n.coordsAtPos(a,-1),d=Math.min(s.top,c.top),u=Math.max(s.bottom,c.bottom),f=Math.min(s.left,c.left),p=Math.max(s.right,c.right),h=p-f,m=u-d,x={top:d,bottom:u,left:f,right:p,width:h,height:m,x:f,y:d};return{...x,toJSON:()=>x}}function vM(n,e,t){var r;const{selection:i}=e;let o=null;if(Il(i)&&(o=i.$cursor),o){const s=(r=n.storedMarks)!==null&&r!==void 0?r:o.marks();return!!t.isInSet(s)||!s.some(c=>c.type.excludes(t))}const{ranges:a}=i;return a.some(({$from:s,$to:c})=>{let d=s.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(s.pos,c.pos,(u,f,p)=>{if(d)return!1;if(u.isInline){const h=!p||p.type.allowsMarkType(t),m=!!t.isInSet(u.marks)||!u.marks.some(g=>g.type.excludes(t));d=h&&m}return!d}),d})}const bM=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{selection:o}=t,{empty:a,ranges:s}=o,c=er(n,r.schema);if(i)if(a){const d=ba(r,c);t.addStoredMark(c.create({...d,...e}))}else s.forEach(d=>{const u=d.$from.pos,f=d.$to.pos;r.doc.nodesBetween(u,f,(p,h)=>{const m=Math.max(h,u),g=Math.min(h+p.nodeSize,f);p.marks.find(x=>x.type===c)?p.marks.forEach(x=>{c===x.type&&t.addMark(m,g,c.create({...x.attrs,...e}))}):t.addMark(m,g,c.create(e))})});return vM(r,t,c)},wM=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),kM=(n,e={})=>({state:t,dispatch:r,chain:i})=>{const o=et(n,t.schema);return o.isTextblock?i().command(({commands:a})=>Sp(o,e)(t)?!0:a.clearNodes()).command(({state:a})=>Sp(o,e)(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},xM=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,i=An(n,0,r.content.size),o=he.create(r,i);e.setSelection(o)}return!0},CM=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:i,to:o}=typeof n=="number"?{from:n,to:n}:n,a=ge.atStart(r).from,s=ge.atEnd(r).to,c=An(i,a,s),d=An(o,a,s),u=ge.create(r,c,d);e.setSelection(u)}return!0},MM=n=>({state:e,dispatch:t})=>{const r=et(n,e.schema);return oC(r)(e,t)};function zp(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const r=t.filter(i=>e==null?void 0:e.includes(i.type.name));n.tr.ensureMarks(r)}}const TM=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{const{selection:o,doc:a}=e,{$from:s,$to:c}=o,d=i.extensionManager.attributes,u=wa(d,s.node().type.name,s.node().attrs);if(o instanceof he&&o.node.isBlock)return!s.parentOffset||!ni(a,s.pos)?!1:(r&&(n&&zp(t,i.extensionManager.splittableMarks),e.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;if(r){const f=c.parentOffset===c.parent.content.size;o instanceof ge&&e.deleteSelection();const p=s.depth===0?void 0:cM(s.node(-1).contentMatchAt(s.indexAfter(-1)));let h=f&&p?[{type:p,attrs:u}]:void 0,m=ni(e.doc,e.mapping.map(s.pos),1,h);if(!h&&!m&&ni(e.doc,e.mapping.map(s.pos),1,p?[{type:p}]:void 0)&&(m=!0,h=p?[{type:p,attrs:u}]:void 0),m&&(e.split(e.mapping.map(s.pos),1,h),p&&!f&&!s.parentOffset&&s.parent.type!==p)){const g=e.mapping.map(s.before()),k=e.doc.resolve(g);s.node(-1).canReplaceWith(k.index(),k.index()+1,p)&&e.setNodeMarkup(e.mapping.map(s.before()),p)}n&&zp(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},SM=n=>({tr:e,state:t,dispatch:r,editor:i})=>{var o;const a=et(n,t.schema),{$from:s,$to:c}=t.selection,d=t.selection.node;if(d&&d.isBlock||s.depth<2||!s.sameParent(c))return!1;const u=s.node(-1);if(u.type!==a)return!1;const f=i.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==a||s.index(-2)!==s.node(-2).childCount-1)return!1;if(r){let k=K.empty;const x=s.index(-1)?1:s.index(-2)?2:3;for(let V=s.depth-x;V>=s.depth-3;V-=1)k=K.from(s.node(V).copy(k));const S=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,T=wa(f,s.node().type.name,s.node().attrs),y=((o=a.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(T))||void 0;k=k.append(K.from(a.createAndFill(null,y)||void 0));const B=s.before(s.depth-(x-1));e.replace(B,s.after(-S),new ie(k,4-x,0));let w=-1;e.doc.nodesBetween(B,e.doc.content.size,(V,$)=>{if(w>-1)return!1;V.isTextblock&&V.content.size===0&&(w=$+1)}),w>-1&&e.setSelection(ge.near(e.doc.resolve(w))),e.scrollIntoView()}return!0}const p=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,h=wa(f,u.type.name,u.attrs),m=wa(f,s.node().type.name,s.node().attrs);e.delete(s.pos,c.pos);const g=p?[{type:a,attrs:h},{type:p,attrs:m}]:[{type:a,attrs:h}];if(!ni(e.doc,s.pos,2))return!1;if(r){const{selection:k,storedMarks:x}=t,{splittableMarks:S}=i.extensionManager,T=x||k.$to.parentOffset&&k.$from.marks();if(e.split(s.pos,2,g).scrollIntoView(),!T||!r)return!0;const y=T.filter(B=>S.includes(B.type.name));e.ensureMarks(y)}return!0},Fl=(n,e)=>{const t=Ll(a=>a.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===(i==null?void 0:i.type)&&jn(n.doc,t.pos)&&n.join(t.pos),!0},zl=(n,e)=>{const t=Ll(a=>a.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(t.start).after(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===(i==null?void 0:i.type)&&jn(n.doc,r)&&n.join(r),!0};var DM=Object.freeze({__proto__:null,blur:kC,clearContent:xC,clearNodes:CC,command:MC,createParagraphNear:TC,cut:SC,deleteCurrentNode:DC,deleteNode:AC,deleteRange:EC,deleteSelection:OC,enter:NC,exitCode:_C,extendMarkRange:PC,first:IC,focus:RC,forEach:VC,insertContent:LC,insertContentAt:zC,joinUp:HC,joinDown:YC,joinBackward:UC,joinForward:jC,joinItemBackward:WC,joinItemForward:qC,keyboardShortcut:GC,lift:QC,liftEmptyBlock:JC,liftListItem:XC,newlineInCode:ZC,resetAttributes:eM,scrollIntoView:tM,selectAll:nM,selectNodeBackward:rM,selectNodeForward:iM,selectParentNode:oM,selectTextblockEnd:aM,selectTextblockStart:sM,setContent:lM,setMark:bM,setMeta:wM,setNode:kM,setNodeSelection:xM,setTextSelection:CM,sinkListItem:MM,splitBlock:TM,splitListItem:SM,toggleList:(n,e,t,r={})=>({editor:i,tr:o,state:a,dispatch:s,chain:c,commands:d,can:u})=>{const{extensions:f,splittableMarks:p}=i.extensionManager,h=et(n,a.schema),m=et(e,a.schema),{selection:g,storedMarks:k}=a,{$from:x,$to:S}=g,T=x.blockRange(S),y=k||g.$to.parentOffset&&g.$from.marks();if(!T)return!1;const B=Ll(w=>$p(w.type.name,f))(g);if(T.depth>=1&&B&&T.depth-B.depth<=1){if(B.node.type===h)return d.liftListItem(m);if($p(B.node.type.name,f)&&h.validContent(B.node.content)&&s)return c().command(()=>(o.setNodeMarkup(B.pos,h),!0)).command(()=>Fl(o,h)).command(()=>zl(o,h)).run()}return!t||!y||!s?c().command(()=>u().wrapInList(h,r)?!0:d.clearNodes()).wrapInList(h,r).command(()=>Fl(o,h)).command(()=>zl(o,h)).run():c().command(()=>{const w=u().wrapInList(h,r),V=y.filter($=>p.includes($.type.name));return o.ensureMarks(V),w?!0:d.clearNodes()}).wrapInList(h,r).command(()=>Fl(o,h)).command(()=>zl(o,h)).run()},toggleMark:(n,e={},t={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=t,a=er(n,r.schema);return $l(r,a,e)?i.unsetMark(a,{extendEmptyMarkRange:o}):i.setMark(a,e)},toggleNode:(n,e,t={})=>({state:r,commands:i})=>{const o=et(n,r.schema),a=et(e,r.schema);return ao(r,o,t)?i.setNode(a):i.setNode(o,t)},toggleWrap:(n,e={})=>({state:t,commands:r})=>{const i=et(n,t.schema);return ao(t,i,e)?r.lift(i):r.wrapIn(i,e)},undoInputRule:()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let r=0;r<t.length;r+=1){const i=t[r];let o;if(i.spec.isInputRules&&(o=i.getState(n))){if(e){const a=n.tr,s=o.transform;for(let c=s.steps.length-1;c>=0;c-=1)a.step(s.steps[c].invert(s.docs[c]));if(o.text){const c=a.doc.resolve(o.from).marks();a.replaceWith(o.from,o.to,n.schema.text(o.text,c))}else a.delete(o.from,o.to)}return!0}}return!1},unsetAllMarks:()=>({tr:n,dispatch:e})=>{const{selection:t}=n,{empty:r,ranges:i}=t;return r||e&&i.forEach(o=>{n.removeMark(o.$from.pos,o.$to.pos)}),!0},unsetMark:(n,e={})=>({tr:t,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:a=!1}=e,{selection:s}=t,c=er(n,r.schema),{$from:d,empty:u,ranges:f}=s;if(!i)return!0;if(u&&a){let{from:p,to:h}=s;const m=(o=d.marks().find(k=>k.type===c))===null||o===void 0?void 0:o.attrs,g=Pl(d,c,m);g&&(p=g.from,h=g.to),t.removeMark(p,h,c)}else f.forEach(p=>{t.removeMark(p.$from.pos,p.$to.pos,c)});return t.removeStoredMark(c),!0},updateAttributes:(n,e={})=>({tr:t,state:r,dispatch:i})=>{let o=null,a=null;const s=va(typeof n=="string"?n:n.name,r.schema);return s?(s==="node"&&(o=et(n,r.schema)),s==="mark"&&(a=er(n,r.schema)),i&&t.selection.ranges.forEach(c=>{const d=c.$from.pos,u=c.$to.pos;r.doc.nodesBetween(d,u,(f,p)=>{o&&o===f.type&&t.setNodeMarkup(p,void 0,{...f.attrs,...e}),a&&f.marks.length&&f.marks.forEach(h=>{if(a===h.type){const m=Math.max(p,d),g=Math.min(p+f.nodeSize,u);t.addMark(m,g,a.create({...h.attrs,...e}))}})})}),!0):!1},wrapIn:(n,e={})=>({state:t,dispatch:r})=>{const i=et(n,t.schema);return Z1(i,e)(t,r)},wrapInList:(n,e={})=>({state:t,dispatch:r})=>{const i=et(n,t.schema);return eC(i,e)(t,r)}});const AM=ft.create({name:"commands",addCommands(){return{...DM}}}),EM=ft.create({name:"editable",addProseMirrorPlugins(){return[new Ct({key:new hn("editable"),props:{editable:()=>this.editor.options.editable}})]}}),OM=ft.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new Ct({key:new hn("focusEvents"),props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),NM=ft.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:s})=>{const{selection:c,doc:d}=s,{empty:u,$anchor:f}=c,{pos:p,parent:h}=f,m=f.parent.isTextblock?s.doc.resolve(p-1):f,g=m.parent.type.spec.isolating,k=f.pos-f.parentOffset,x=g&&m.parent.childCount===1?k===f.pos:ye.atStart(d).from===p;return!u||!x||!h.type.isTextblock||h.textContent.length?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":n,"Alt-Backspace":n,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Rl()||Vl()?o:i},addProseMirrorPlugins(){return[new Ct({key:new hn("clearDocument"),appendTransaction:(n,e,t)=>{if(!(n.some(m=>m.docChanged)&&!e.doc.eq(t.doc)))return;const{empty:i,from:o,to:a}=e.selection,s=ye.atStart(e.doc).from,c=ye.atEnd(e.doc).to;if(i||!(o===s&&a===c)||!(t.doc.textBetween(0,t.doc.content.size," "," ").length===0))return;const f=t.tr,p=ua({state:t,transaction:f}),{commands:h}=new fa({editor:this.editor,state:p});if(h.clearNodes(),!!f.steps.length)return f}})]}}),_M=ft.create({name:"tabindex",addProseMirrorPlugins(){return[new Ct({key:new hn("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var BM=Object.freeze({__proto__:null,ClipboardTextSerializer:wC,Commands:AM,Editable:EM,FocusEvents:OM,Keymap:NM,Tabindex:_M});const PM=`.ProseMirror {
72
+ `),Ho.render=function(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",nk,[n.dataUrl?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["avatar-cropper-overlay",{"avatar-cropper-overlay-inline":n.inline}])},[n.inline?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",rk,[l.createElementVNode("a",{onClick:e[0]||(e[0]=function(){return n.cancel&&n.cancel.apply(n,arguments)}),class:"avatar-cropper-close",title:n.labels.cancel,href:"javascript:;"}," × ",8,ik)])),l.createElementVNode("div",ok,[l.createElementVNode("div",ak,[l.createElementVNode("img",{ref:"img",src:n.dataUrl,alt:"",onLoad:e[1]||(e[1]=l.withModifiers(function(){return n.createCropper&&n.createCropper.apply(n,arguments)},["stop"])),onError:e[2]||(e[2]=function(){return n.onImgElementError&&n.onImgElementError.apply(n,arguments)})},null,40,sk)]),l.createElementVNode("div",lk,[l.createElementVNode("button",{onClick:e[3]||(e[3]=l.withModifiers(function(){return n.cancel&&n.cancel.apply(n,arguments)},["stop","prevent"])),class:"avatar-cropper-btn"},l.toDisplayString(n.labels.cancel),1),l.createElementVNode("button",{onClick:e[4]||(e[4]=l.withModifiers(function(){return n.submit&&n.submit.apply(n,arguments)},["stop","prevent"])),class:"avatar-cropper-btn"},l.toDisplayString(n.labels.submit),1)])])],2)):l.createCommentVNode("",!0),n.file?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("input",{key:1,accept:n.cleanedMimes,capture:n.capture,class:"avatar-cropper-img-input",ref:"input",type:"file",onChange:e[5]||(e[5]=function(){return n.onFileInputChange&&n.onFileInputChange.apply(n,arguments)})},null,40,ck))])},Ho.install=function(n){n.component("avatar-cropper",Ho)};const dk={name:"GenericImageCropper",props:{personID:{type:Number,default:1}},components:{AvatarCropper:Ho},data(){return{showCropper:!1,userPicUrl:""}},mounted(){this.getImgUrl(this.personID)},watch:{personID:{immediate:!0,handler(n,e){this.getImgUrl(n)}}},methods:{getImgUrl(n){this.userPicUrl="../../../../src/assets/select-tournament.png"},setShowCropper(){this.showCropper=!0},handleUploading(){this.userPicUrl="./uploads/default.jpeg",this.message="uploading..."},handleUploaded(n){n.response.status===200&&this.getImgUrl(this.personID)},handleCompleted(){this.message="upload completed."},handlerError(n,e,t){console.error(`${n} ${e} ${t}`),this.message="Oops! Something went wrong..."}}},uk={class:""},fk=["src","alt"];function pk(n,e,t,r,i,o){const a=l.resolveComponent("avatar-cropper");return l.openBlock(),l.createElementBlock("section",uk,[l.createElementVNode("img",{class:"h-40 w-96 border-2 border-dashed rounded-lg",src:i.userPicUrl,onError:e[0]||(e[0]=()=>{}),alt:t.personID,onClick:e[1]||(e[1]=s=>o.setShowCropper())},null,40,fk),l.createVNode(a,{onUploading:o.handleUploading,onUploaded:o.handleUploaded,onCompleted:o.handleCompleted,onError:o.handlerError,modelValue:i.showCropper,"onUpdate:modelValue":e[2]||(e[2]=s=>i.showCropper=s),"upload-url":`./uploads/${t.personID}`,"cropper-options":{aspectRatio:8/3,autoCropArea:1,viewMode:1,movable:!0,zoomable:!0}},null,8,["onUploading","onUploaded","onCompleted","onError","modelValue","upload-url"])])}const xu=Fe(dk,[["render",pk]]);function it(n){this.content=n}it.prototype={constructor:it,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),o=r.content.slice();return i==-1?o.push(t||n,e):(o[i+1]=e,t&&(o[i]=t)),new it(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 it(t)},addToStart:function(n,e){return new it([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new it(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),o=r.find(n);return i.splice(o==-1?i.length:o,0,e,t),new it(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=it.from(n),n.size?new it(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=it.from(n),n.size?new it(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=it.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}},it.from=function(n){if(n instanceof it)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new it(e)};function Cu(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i==o){t+=i.nodeSize;continue}if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let a=0;i.text[a]==o.text[a];a++)t++;return t}if(i.content.size||o.content.size){let a=Cu(i.content,o.content,t+1);if(a!=null)return a}t+=i.nodeSize}}function Mu(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:r};let a=n.child(--i),s=e.child(--o),c=a.nodeSize;if(a==s){t-=c,r-=c;continue}if(!a.sameMarkup(s))return{a:t,b:r};if(a.isText&&a.text!=s.text){let d=0,u=Math.min(a.text.length,s.text.length);for(;d<u&&a.text[a.text.length-d-1]==s.text[s.text.length-d-1];)d++,t--,r--;return{a:t,b:r}}if(a.content.size||s.content.size){let d=Mu(a.content,s.content,t-1,r-1);if(d)return d}t-=c,r-=c}}class K{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,o){for(let a=0,s=0;s<t;a++){let c=this.content[a],d=s+c.nodeSize;if(d>e&&r(c,i+s,o||null,a)!==!1&&c.content.size){let u=s+1;c.nodesBetween(Math.max(0,e-u),Math.min(c.content.size,t-u),r,i+u)}s=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",a=!0;return this.nodesBetween(e,t,(s,c)=>{s.isText?(o+=s.text.slice(Math.max(e,c)-c,t-c),a=!r):s.isLeaf?(i?o+=typeof i=="function"?i(s):i:s.type.spec.leafText&&(o+=s.type.spec.leafText(s)),a=!r):!a&&s.isBlock&&(o+=r,a=!0)},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new K(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let o=0,a=0;a<t;o++){let s=this.content[o],c=a+s.nodeSize;c>e&&((a<e||c>t)&&(s.isText?s=s.cut(Math.max(0,e-a),Math.min(s.text.length,t-a)):s=s.cut(Math.max(0,e-a-1),Math.min(s.content.size,t-a-1))),r.push(s),i+=s.nodeSize),a=c}return new K(r,i)}cutByIndex(e,t){return e==t?K.empty:e==0&&t==this.content.length?this:new K(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new K(i,o)}addToStart(e){return new K([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new K(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return Cu(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Mu(this,e,t,r)}findIndex(e,t=-1){if(e==0)return Yo(0,e);if(e==this.size)return Yo(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),a=i+o.nodeSize;if(a>=e)return a==e||t>0?Yo(r+1,a):Yo(r,i);i=a}}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 K.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new K(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return K.empty;let t,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(t||(t=e.slice(0,i)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new K(t||e,r)}static from(e){if(!e)return K.empty;if(e instanceof K)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new K([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}K.empty=new K([],0);const Fs={index:0,offset:0};function Yo(n,e){return Fs.index=n,Fs.offset=e,Fs}function Uo(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Uo(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Uo(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let Oe=class uc{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Uo(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);return r.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return uc.none;if(e instanceof uc)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};Oe.none=[];class jo extends Error{}class ie{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=Su(this.content,e+this.openStart,t);return r&&new ie(r,this.openStart,this.openEnd)}removeBetween(e,t){return new ie(Tu(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 ie.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ie(K.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new ie(e,r,i)}}ie.empty=new ie(K.empty,0,0);function Tu(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:a,offset:s}=n.findIndex(t);if(i==e||o.isText){if(s!=t&&!n.child(a).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=a)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(Tu(o.content,e-i-1,t-i-1)))}function Su(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),a=n.maybeChild(i);if(o==e||a.isText)return r&&!r.canReplace(i,i,t)?null:n.cut(0,e).append(t).append(n.cut(e));let s=Su(a.content,e-o-1,t);return s&&n.replaceChild(i,a.copy(s))}function hk(n,e,t){if(t.openStart>n.depth)throw new jo("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new jo("Inconsistent open depths");return Du(n,e,t,0)}function Du(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let a=Du(n,e,t,r+1);return o.copy(o.content.replaceChild(i,a))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let a=n.parent,s=a.content;return br(a,s.cut(0,n.parentOffset).append(t.content).append(s.cut(e.parentOffset)))}else{let{start:a,end:s}=mk(t,n);return br(o,Eu(n,a,s,e,r))}else return br(o,Wo(n,e,r))}function Au(n,e){if(!e.type.compatibleContent(n.type))throw new jo("Cannot join "+e.type.name+" onto "+n.type.name)}function zs(n,e,t){let r=n.node(t);return Au(r,e.node(t)),r}function vr(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 ji(n,e,t,r){let i=(e||n).node(t),o=0,a=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(vr(n.nodeAfter,r),o++));for(let s=o;s<a;s++)vr(i.child(s),r);e&&e.depth==t&&e.textOffset&&vr(e.nodeBefore,r)}function br(n,e){return n.type.checkContent(e),n.copy(e)}function Eu(n,e,t,r,i){let o=n.depth>i&&zs(n,e,i+1),a=r.depth>i&&zs(t,r,i+1),s=[];return ji(null,n,i,s),o&&a&&e.index(i)==t.index(i)?(Au(o,a),vr(br(o,Eu(n,e,t,r,i+1)),s)):(o&&vr(br(o,Wo(n,e,i+1)),s),ji(e,t,i,s),a&&vr(br(a,Wo(t,r,i+1)),s)),ji(r,null,i,s),new K(s)}function Wo(n,e,t){let r=[];if(ji(null,n,t,r),n.depth>t){let i=zs(n,e,t+1);vr(br(i,Wo(n,e,t+1)),r)}return ji(e,null,t,r),new K(r)}function mk(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)i=e.node(o).copy(K.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class Wi{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Oe.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let s=r;r=i,i=s}let o=r.marks;for(var a=0;a<o.length;a++)o[a].type.spec.inclusive===!1&&(!i||!o[a].isInSet(i.marks))&&(o=o[a--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new qo(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,o=t;for(let a=e;;){let{index:s,offset:c}=a.content.findIndex(o),d=o-c;if(r.push(a,s,i+c),!d||(a=a.child(s),a.isText))break;o=d-1,i+=c+1}return new Wi(t,r,o)}static resolveCached(e,t){for(let i=0;i<Hs.length;i++){let o=Hs[i];if(o.pos==t&&o.doc==e)return o}let r=Hs[Ys]=Wi.resolve(e,t);return Ys=(Ys+1)%gk,r}}let Hs=[],Ys=0,gk=12;class qo{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const yk=Object.create(null);let wr=class fc{constructor(e,t,r,i=Oe.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||K.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,i=0){this.content.nodesBetween(e,t,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,i){return this.content.textBetween(e,t,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&Uo(this.attrs,t||e.defaultAttrs||yk)&&Oe.sameSet(this.marks,r||Oe.none)}copy(e=null){return e==this.content?this:new fc(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new fc(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return ie.empty;let i=this.resolve(e),o=this.resolve(t),a=r?0:i.sharedDepth(t),s=i.start(a),d=i.node(a).content.cut(i.pos-s,o.pos-s);return new ie(d,i.depth-a,o.depth-a)}replace(e,t,r){return hk(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return Wi.resolveCached(this,e)}resolveNoCache(e){return Wi.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Ou(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=K.empty,i=0,o=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,i,o),s=a&&a.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let c=i;c<o;c++)if(!this.type.allowsMarks(r.child(c).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),a=o&&o.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content);let e=Oe.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!Oe.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=K.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};wr.prototype.text=void 0;class Ko extends wr{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ou(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 Ko(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Ko(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 Ou(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class kr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new vk(e,t);if(r.next==null)return kr.empty;let i=Nu(r);r.next&&r.err("Unexpected trailing text");let o=Tk(Mk(i));return Sk(o,r),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let i=this;for(let o=t;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];function o(a,s){let c=a.matchFragment(e,r);if(c&&(!t||c.validEnd))return K.from(s.map(d=>d.createAndFill()));for(let d=0;d<a.next.length;d++){let{type:u,next:f}=a.next[d];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let p=o(f,s.concat(u));if(p)return p}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let a=[];for(let s=i;s.type;s=s.via)a.push(s.type);return a.reverse()}for(let a=0;a<o.next.length;a++){let{type:s,next:c}=o.next[a];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in t)&&(!i.type||c.validEnd)&&(r.push({match:s.contentMatch,type:s,via:i}),t[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}return t(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)o+=(a?", ":"")+r.next[a].type.name+"->"+e.indexOf(r.next[a].next);return o}).join(`
73
+ `)}}kr.empty=new kr(!0);class vk{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 Nu(n){let e=[];do e.push(bk(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function bk(n){let e=[];do e.push(wk(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function wk(n){let e=Ck(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=kk(n,e);else break;return e}function _u(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function kk(n,e){let t=_u(n),r=t;return n.eat(",")&&(n.next!="}"?r=_u(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function xk(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let o in t){let a=t[o];a.groups.indexOf(e)>-1&&i.push(a)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function Ck(n){if(n.eat("(")){let e=Nu(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=xk(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 Mk(n){let e=[[]];return i(o(n,0),t()),e;function t(){return e.push([])-1}function r(a,s,c){let d={term:c,to:s};return e[a].push(d),d}function i(a,s){a.forEach(c=>c.to=s)}function o(a,s){if(a.type=="choice")return a.exprs.reduce((c,d)=>c.concat(o(d,s)),[]);if(a.type=="seq")for(let c=0;;c++){let d=o(a.exprs[c],s);if(c==a.exprs.length-1)return d;i(d,s=t())}else if(a.type=="star"){let c=t();return r(s,c),i(o(a.expr,c),c),[r(c)]}else if(a.type=="plus"){let c=t();return i(o(a.expr,s),c),i(o(a.expr,c),c),[r(c)]}else{if(a.type=="opt")return[r(s)].concat(o(a.expr,s));if(a.type=="range"){let c=s;for(let d=0;d<a.min;d++){let u=t();i(o(a.expr,c),u),c=u}if(a.max==-1)i(o(a.expr,c),c);else for(let d=a.min;d<a.max;d++){let u=t();r(c,u),i(o(a.expr,c),u),c=u}return[r(c)]}else{if(a.type=="name")return[r(s,void 0,a.value)];throw new Error("Unknown expr type")}}}}function Bu(n,e){return e-n}function Pu(n,e){let t=[];return r(e),t.sort(Bu);function r(i){let o=n[i];if(o.length==1&&!o[0].term)return r(o[0].to);t.push(i);for(let a=0;a<o.length;a++){let{term:s,to:c}=o[a];!s&&t.indexOf(c)==-1&&r(c)}}}function Tk(n){let e=Object.create(null);return t(Pu(n,0));function t(r){let i=[];r.forEach(a=>{n[a].forEach(({term:s,to:c})=>{if(!s)return;let d;for(let u=0;u<i.length;u++)i[u][0]==s&&(d=i[u][1]);Pu(n,c).forEach(u=>{d||i.push([s,d=[]]),d.indexOf(u)==-1&&d.push(u)})})});let o=e[r.join(",")]=new kr(r.indexOf(n.length-1)>-1);for(let a=0;a<i.length;a++){let s=i[a][1].sort(Bu);o.next.push({type:i[a][0],next:e[s.join(",")]||t(s)})}return o}}function Sk(n,e){for(let t=0,r=[n];t<r.length;t++){let i=r[t],o=!i.validEnd,a=[];for(let s=0;s<i.next.length;s++){let{type:c,next:d}=i.next[s];a.push(c.name),o&&!(c.isText||c.hasRequiredAttrs())&&(o=!1),r.indexOf(d)==-1&&r.push(d)}o&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Iu(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function Ru(n,e){let t=Object.create(null);for(let r in n){let i=e&&e[r];if(i===void 0){let o=n[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=i}return t}function Vu(n){let e=Object.create(null);if(n)for(let t in n)e[t]=new Dk(n[t]);return e}let Lu=class Wh{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Vu(r.attrs),this.defaultAttrs=Iu(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==kr.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}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:Ru(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new wr(this,this.computeAttrs(e),K.from(t),Oe.setFrom(r))}createChecked(e=null,t,r){return t=K.from(t),this.checkContent(t),new wr(this,this.computeAttrs(e),t,Oe.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=K.from(t),t.size){let a=this.contentMatch.fillBefore(t);if(!a)return null;t=a.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(K.empty,!0);return o?new wr(this,e,t.append(o),Oe.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:Oe.none:e}static compile(e,t){let r=Object.create(null);e.forEach((o,a)=>r[o]=new Wh(o,t,a));let i=t.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class Dk{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Go{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=Vu(i.attrs),this.excluded=null;let o=Iu(this.attrs);this.instance=o?new Oe(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Oe(this,Ru(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,a)=>r[o]=new Go(o,i++,t,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}class Ak{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=it.from(e.nodes),t.marks=it.from(e.marks||{}),this.nodes=Lu.compile(this.spec.nodes,this),this.marks=Go.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],a=o.spec.content||"",s=o.spec.marks;o.contentMatch=r[a]||(r[a]=kr.parse(a,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=s=="_"?null:s?$u(this,s.split(" ")):s==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],a=o.spec.excludes;o.excluded=a==null?[o]:a==""?[]:$u(this,a.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Lu){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,i)}text(e,t){let r=this.nodes.text;return new Ko(r,r.defaultAttrs,e,Oe.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return wr.fromJSON(this,e)}markFromJSON(e){return Oe.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function $u(n,e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],o=n.marks[i],a=o;if(o)t.push(o);else for(let s in n.marks){let c=n.marks[s];(i=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(i)>-1)&&t.push(a=c)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}class Xr{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=e.nodes[r.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let r=new Yu(this,t,!1);return r.addAll(e,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new Yu(this,t,!0);return r.addAll(e,t.from,t.to),ie.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(Nk(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||t.matchesContext(o.context))){if(o.getAttrs){let a=o.getAttrs(e);if(a===!1)continue;o.attrs=a||void 0}return o}}}matchStyle(e,t,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let a=this.styles[o],s=a.style;if(!(s.indexOf(e)!=0||a.context&&!r.matchesContext(a.context)||s.length>e.length&&(s.charCodeAt(e.length)!=61||s.slice(e.length+1)!=t))){if(a.getAttrs){let c=a.getAttrs(t);if(c===!1)continue;a.attrs=c||void 0}return a}}}static schemaRules(e){let t=[];function r(i){let o=i.priority==null?50:i.priority,a=0;for(;a<t.length;a++){let s=t[a];if((s.priority==null?50:s.priority)<o)break}t.splice(a,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(a=>{r(a=Uu(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(a=>{r(a=Uu(a)),a.node||a.ignore||a.mark||(a.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Xr(e,Xr.schemaRules(e)))}}const Fu={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},Ek={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},zu={ol:!0,ul:!0},Qo=1,Jo=2,qi=4;function Hu(n,e,t){return e!=null?(e?Qo:0)|(e==="full"?Jo:0):n&&n.whitespace=="pre"?Qo|Jo:t&~qi}class Xo{constructor(e,t,r,i,o,a,s){this.type=e,this.attrs=t,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=s,this.content=[],this.activeMarks=Oe.none,this.stashMarks=[],this.match=a||(s&qi?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(K.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Qo)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let t=K.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(K.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,r=this.pendingMarks;t<r.length;t++){let i=r[t];(this.type?this.type.allowsMarkType(i.type):Bk(i.type,e))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Fu.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Yu{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0;let i=t.topNode,o,a=Hu(null,t.preserveWhitespace,0)|(r?qi:0);i?o=new Xo(i.type,i.attrs,Oe.none,Oe.none,!0,t.topMatch||i.type.contentMatch,a):r?o=new Xo(null,null,Oe.none,Oe.none,!0,null,a):o=new Xo(e.schema.topNodeType,null,Oe.none,Oe.none,!0,null,a),this.nodes=[o],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){e.nodeType==3?this.addTextNode(e):e.nodeType==1&&this.addElement(e)}withStyleRules(e,t){let r=e.getAttribute("style");if(!r)return t();let i=this.readStyles(_k(r));if(!i)return;let[o,a]=i,s=this.top;for(let c=0;c<a.length;c++)this.removePendingMark(a[c],s);for(let c=0;c<o.length;c++)this.addPendingMark(o[c]);t();for(let c=0;c<o.length;c++)this.removePendingMark(o[c],s);for(let c=0;c<a.length;c++)this.addPendingMark(a[c])}addTextNode(e){let t=e.nodeValue,r=this.top;if(r.options&Jo||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(r.options&Qo)r.options&Jo?t=t.replace(/\r\n?/g,`
74
+ `):t=t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let i=r.content[r.content.length-1],o=e.previousSibling;(!i||o&&o.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let r=e.nodeName.toLowerCase(),i;zu.hasOwnProperty(r)&&this.parser.normalizeLists&&Ok(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,t));if(o?o.ignore:Ek.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);let a,s=this.top,c=this.needsBlock;if(Fu.hasOwnProperty(r))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),a=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e);return}o&&o.skip?this.addAll(e):this.withStyleRules(e,()=>this.addAll(e)),a&&this.sync(s),this.needsBlock=c}else this.withStyleRules(e,()=>{this.addElementByRule(e,o,o.consuming===!1?i:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
75
+ `))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=Oe.none,r=Oe.none;for(let i=0;i<e.length;i+=2)for(let o=void 0;;){let a=this.parser.matchStyle(e[i],e[i+1],this,o);if(!a)break;if(a.ignore)return null;if(a.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(s=>{a.clearMark(s)&&(r=s.addToSet(r))}):t=this.parser.schema.marks[a.mark].create(a.attrs).addToSet(t),a.consuming===!1)o=a;else break}return[t,r]}addElementByRule(e,t,r){let i,o,a;t.node?(o=this.parser.schema.nodes[t.node],o.isLeaf?this.insertNode(o.create(t.attrs))||this.leafFallback(e):i=this.enter(o,t.attrs||null,t.preserveWhitespace)):(a=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(a));let s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c));else{let c=e;typeof t.contentElement=="string"?c=e.querySelector(t.contentElement):typeof t.contentElement=="function"?c=t.contentElement(e):t.contentElement&&(c=t.contentElement),this.findAround(e,c,!0),this.addAll(c)}i&&this.sync(s)&&this.open--,a&&this.removePendingMark(a,s)}addAll(e,t,r){let i=t||0;for(let o=t?e.childNodes[t]:e.firstChild,a=r==null?null:e.childNodes[r];o!=a;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let t,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],a=o.findWrapping(e);if(a&&(!t||t.length>a.length)&&(t=a,r=o,!a.length)||o.solid)break}if(!t)return!1;this.sync(r);for(let i=0;i<t.length;i++)this.enterInner(t[i],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let r=t.activeMarks;for(let i=0;i<e.marks.length;i++)(!t.type||t.type.allowsMarkType(e.marks[i].type))&&(r=e.marks[i].addToSet(r));return t.content.push(e.mark(r)),!0}return!1}enter(e,t,r){let i=this.findPlace(e.create(t));return i&&this.enterInner(e,t,!0,r),i}enterInner(e,t=null,r=!1,i){this.closeExtra();let o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);let a=Hu(e,i,o.options);o.options&qi&&o.content.length==0&&(a|=qi),this.nodes.push(new Xo(e,t,o.activeMarks,o.pendingMarks,r,null,a)),this.open++}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;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),a=(s,c)=>{for(;s>=0;s--){let d=t[s];if(d==""){if(s==t.length-1||s==0)continue;for(;c>=o;c--)if(a(s-1,c))return!0;return!1}else{let u=c>0||c==0&&i?this.nodes[c].type:r&&c>=o?r.node(c-o).type:null;if(!u||u.name!=d&&u.groups.indexOf(d)==-1)return!1;c--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let t=Pk(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let a=i.popFromStashMark(e);a&&i.type&&i.type.allowsMarkType(a.type)&&(i.activeMarks=a.addToSet(i.activeMarks))}if(i==t)break}}}function Ok(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&zu.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function Nk(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function _k(n){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,t,r=[];for(;t=e.exec(n);)r.push(t[1],t[2].trim());return r}function Uu(n){let e={};for(let t in n)e[t]=n[t];return e}function Bk(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],a=s=>{o.push(s);for(let c=0;c<s.edgeCount;c++){let{type:d,next:u}=s.edge(c);if(d==e||o.indexOf(u)<0&&a(u))return!0}};if(a(i.contentMatch))return!0}}function Pk(n,e){for(let t=0;t<e.length;t++)if(n.eq(e[t]))return e[t]}class fn{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Us(t).createDocumentFragment());let i=r,o=[];return e.forEach(a=>{if(o.length||a.marks.length){let s=0,c=0;for(;s<o.length&&c<a.marks.length;){let d=a.marks[c];if(!this.marks[d.type.name]){c++;continue}if(!d.eq(o[s][0])||d.type.spec.spanning===!1)break;s++,c++}for(;s<o.length;)i=o.pop()[1];for(;c<a.marks.length;){let d=a.marks[c++],u=this.serializeMark(d,a.isInline,t);u&&(o.push([d,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(a,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:i}=fn.renderSpec(Us(t),this.nodes[e.type.name](e));if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&fn.renderSpec(Us(r),i(e,t))}static renderSpec(e,t,r=null){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let a,s=r?e.createElementNS(r,i):e.createElement(i),c=t[1],d=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){d=2;for(let u in c)if(c[u]!=null){let f=u.indexOf(" ");f>0?s.setAttributeNS(u.slice(0,f),u.slice(f+1),c[u]):s.setAttribute(u,c[u])}}for(let u=d;u<t.length;u++){let f=t[u];if(f===0){if(u<t.length-1||u>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}else{let{dom:p,contentDOM:h}=fn.renderSpec(e,f,r);if(s.appendChild(p),h){if(a)throw new RangeError("Multiple content holes");a=h}}}return{dom:s,contentDOM:a}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new fn(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=ju(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return ju(e.marks)}}function ju(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Us(n){return n.document||window.document}const Wu=65535,qu=Math.pow(2,16);function Ik(n,e){return n+e*qu}function Ku(n){return n&Wu}function Rk(n){return(n-(n&Wu))/qu}const Gu=1,Qu=2,Zo=4,Ju=8;class js{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Ju)>0}get deletedBefore(){return(this.delInfo&(Gu|Zo))>0}get deletedAfter(){return(this.delInfo&(Qu|Zo))>0}get deletedAcross(){return(this.delInfo&Zo)>0}}class Et{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Et.empty)return Et.empty}recover(e){let t=0,r=Ku(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+t+Rk(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let c=this.ranges[s]-(this.inverted?i:0);if(c>e)break;let d=this.ranges[s+o],u=this.ranges[s+a],f=c+d;if(e<=f){let p=d?e==c?-1:e==f?1:t:t,h=c+i+(p<0?0:u);if(r)return h;let m=e==(t<0?c:f)?null:Ik(s/3,e-c),g=e==c?Qu:e==f?Gu:Zo;return(t<0?e!=c:e!=f)&&(g|=Ju),new js(h,g,m)}i+=u-d}return r?e+i:new js(e+i,0,null)}touches(e,t){let r=0,i=Ku(t),o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let c=this.ranges[s]-(this.inverted?r:0);if(c>e)break;let d=this.ranges[s+o],u=c+d;if(e<=u&&s==i*3)return!0;r+=this.ranges[s+a]-d}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],s=a-(this.inverted?o:0),c=a+(this.inverted?0:o),d=this.ranges[i+t],u=this.ranges[i+r];e(s,s+d,c,c+u),o+=u-d}}invert(){return new Et(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Et.empty:new Et(e<0?[0,-e,0]:[0,0,e])}}Et.empty=new Et([]);class Zr{constructor(e=[],t,r=0,i=e.length){this.maps=e,this.mirror=t,this.from=r,this.to=i}slice(e=0,t=this.maps.length){return new Zr(this.maps,this.mirror,e,t)}copy(){return new Zr(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),t!=null&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,r=this.maps.length;t<e.maps.length;t++){let i=e.getMirror(t);this.appendMap(e.maps[t],i!=null&&i<t?r+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this.maps.length+e.maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new Zr;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let i=0;for(let o=this.from;o<this.to;o++){let a=this.maps[o],s=a.mapResult(e,t);if(s.recover!=null){let c=this.getMirror(o);if(c!=null&&c>o&&c<this.to){o=c,e=this.maps[c].recover(s.recover);continue}}i|=s.delInfo,e=s.pos}return r?e:new js(e,i,null)}}const Ws=Object.create(null);class ct{getMap(){return Et.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Ws[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Ws)throw new RangeError("Duplicate use of step JSON ID "+e);return Ws[e]=t,t.prototype.jsonID=e,t}}class je{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new je(e,null)}static fail(e){return new je(null,e)}static fromReplace(e,t,r,i){try{return je.ok(e.replace(t,r,i))}catch(o){if(o instanceof jo)return je.fail(o.message);throw o}}}function qs(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(qs(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return K.fromArray(r)}class Un extends ct{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new ie(qs(t.content,(a,s)=>!a.isAtom||!s.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),t.openStart,t.openEnd);return je.fromReplace(e,this.from,this.to,o)}invert(){return new pn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Un(t.pos,r.pos,this.mark)}merge(e){return e instanceof Un&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Un(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 Un(t.from,t.to,e.markFromJSON(t.mark))}}ct.jsonID("addMark",Un);class pn extends ct{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new ie(qs(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return je.fromReplace(e,this.from,this.to,r)}invert(){return new Un(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new pn(t.pos,r.pos,this.mark)}merge(e){return e instanceof pn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new pn(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 pn(t.from,t.to,e.markFromJSON(t.mark))}}ct.jsonID("removeMark",pn);class jn extends ct{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return je.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return je.fromReplace(e,this.pos,this.pos+1,new ie(K.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new jn(this.pos,t.marks[i]);return new jn(this.pos,this.mark)}}return new ei(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new jn(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 jn(t.pos,e.markFromJSON(t.mark))}}ct.jsonID("addNodeMark",jn);class ei extends ct{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return je.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return je.fromReplace(e,this.pos,this.pos+1,new ie(K.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new jn(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ei(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 ei(t.pos,e.markFromJSON(t.mark))}}ct.jsonID("removeNodeMark",ei);class ot extends ct{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&Ks(e,this.from,this.to)?je.fail("Structure replace would overwrite content"):je.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Et([this.from,this.to-this.from,this.slice.size])}invert(e){return new ot(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new ot(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof ot)||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?ie.empty:new ie(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new ot(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?ie.empty:new ie(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new ot(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 ot(t.from,t.to,ie.fromJSON(e,t.slice),!!t.structure)}}ct.jsonID("replace",ot);class Ze extends ct{constructor(e,t,r,i,o,a,s=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=a,this.structure=s}apply(e){if(this.structure&&(Ks(e,this.from,this.gapFrom)||Ks(e,this.gapTo,this.to)))return je.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return je.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?je.fromReplace(e,this.from,this.to,r):je.fail("Content does not fit in gap")}getMap(){return new Et([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 Ze(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=e.map(this.gapFrom,-1),o=e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||o>r.pos?null:new Ze(t.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ze(t.from,t.to,t.gapFrom,t.gapTo,ie.fromJSON(e,t.slice),t.insert,!!t.structure)}}ct.jsonID("replaceAround",Ze);function Ks(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function Vk(n,e,t,r){let i=[],o=[],a,s;n.doc.nodesBetween(e,t,(c,d,u)=>{if(!c.isInline)return;let f=c.marks;if(!r.isInSet(f)&&u.type.allowsMarkType(r.type)){let p=Math.max(d,e),h=Math.min(d+c.nodeSize,t),m=r.addToSet(f);for(let g=0;g<f.length;g++)f[g].isInSet(m)||(a&&a.to==p&&a.mark.eq(f[g])?a.to=h:i.push(a=new pn(p,h,f[g])));s&&s.to==p?s.to=h:o.push(s=new Un(p,h,r))}}),i.forEach(c=>n.step(c)),o.forEach(c=>n.step(c))}function Lk(n,e,t,r){let i=[],o=0;n.doc.nodesBetween(e,t,(a,s)=>{if(!a.isInline)return;o++;let c=null;if(r instanceof Go){let d=a.marks,u;for(;u=r.isInSet(d);)(c||(c=[])).push(u),d=u.removeFromSet(d)}else r?r.isInSet(a.marks)&&(c=[r]):c=a.marks;if(c&&c.length){let d=Math.min(s+a.nodeSize,t);for(let u=0;u<c.length;u++){let f=c[u],p;for(let h=0;h<i.length;h++){let m=i[h];m.step==o-1&&f.eq(i[h].style)&&(p=m)}p?(p.to=d,p.step=o):i.push({style:f,from:Math.max(s,e),to:d,step:o})}}}),i.forEach(a=>n.step(new pn(a.from,a.to,a.style)))}function $k(n,e,t,r=t.contentMatch){let i=n.doc.nodeAt(e),o=[],a=e+1;for(let s=0;s<i.childCount;s++){let c=i.child(s),d=a+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new ot(a,d,ie.empty));else{r=u;for(let f=0;f<c.marks.length;f++)t.allowsMarkType(c.marks[f].type)||n.step(new pn(a,d,c.marks[f]));if(c.isText&&!t.spec.code){let f,p=/\r?\n|\r/g,h;for(;f=p.exec(c.text);)h||(h=new ie(K.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),o.push(new ot(a+f.index,a+f.index+f[0].length,h))}}a=d}if(!r.validEnd){let s=r.fillBefore(K.empty,!0);n.replace(a,a,new ie(s,0,0))}for(let s=o.length-1;s>=0;s--)n.step(o[s])}function Fk(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function ti(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let i=n.$from.node(r),o=n.$from.index(r),a=n.$to.indexAfter(r);if(r<n.depth&&i.canReplace(o,a,t))return r;if(r==0||i.type.spec.isolating||!Fk(i,o,a))break}return null}function zk(n,e,t){let{$from:r,$to:i,depth:o}=e,a=r.before(o+1),s=i.after(o+1),c=a,d=s,u=K.empty,f=0;for(let m=o,g=!1;m>t;m--)g||r.index(m)>0?(g=!0,u=K.from(r.node(m).copy(u)),f++):c--;let p=K.empty,h=0;for(let m=o,g=!1;m>t;m--)g||i.after(m+1)<i.end(m)?(g=!0,p=K.from(i.node(m).copy(p)),h++):d++;n.step(new Ze(c,d,a,s,new ie(u.append(p),f,h),u.size-f,!0))}function Gs(n,e,t=null,r=n){let i=Hk(n,e),o=i&&Yk(r,e);return o?i.map(Xu).concat({type:e,attrs:t}).concat(o.map(Xu)):null}function Xu(n){return{type:n,attrs:null}}function Hk(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.contentMatchAt(r).findWrapping(e);if(!o)return null;let a=o.length?o[0]:e;return t.canReplaceWith(r,i,a)?o:null}function Yk(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.child(r),a=e.contentMatch.findWrapping(o.type);if(!a)return null;let c=(a.length?a[a.length-1]:e).contentMatch;for(let d=r;c&&d<i;d++)c=c.matchType(t.child(d).type);return!c||!c.validEnd?null:a}function Uk(n,e,t){let r=K.empty;for(let a=t.length-1;a>=0;a--){if(r.size){let s=t[a].type.contentMatch.matchFragment(r);if(!s||!s.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=K.from(t[a].type.create(t[a].attrs,r))}let i=e.start,o=e.end;n.step(new Ze(i,o,i,o,new ie(r,0,0),t.length,!0))}function jk(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=n.steps.length;n.doc.nodesBetween(e,t,(a,s)=>{if(a.isTextblock&&!a.hasMarkup(r,i)&&Wk(n.doc,n.mapping.slice(o).map(s),r)){n.clearIncompatible(n.mapping.slice(o).map(s,1),r);let c=n.mapping.slice(o),d=c.map(s,1),u=c.map(s+a.nodeSize,1);return n.step(new Ze(d,u,d+1,u-1,new ie(K.from(r.create(i,null,a.marks)),0,0),1,!0)),!1}})}function Wk(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function qk(n,e,t,r,i){let o=n.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");t||(t=o.type);let a=t.create(r,null,i||o.marks);if(o.isLeaf)return n.replaceWith(e,e+o.nodeSize,a);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new Ze(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new ie(K.from(a),0,0),1,!0))}function ni(n,e,t=1,r){let i=n.resolve(e),o=i.depth-t,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,u=t-2;d>o;d--,u--){let f=i.node(d),p=i.index(d);if(f.type.spec.isolating)return!1;let h=f.content.cutByIndex(p,f.childCount),m=r&&r[u+1];m&&(h=h.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[u]||f;if(!f.canReplace(p+1,f.childCount)||!g.type.validContent(h))return!1}let s=i.indexAfter(o),c=r&&r[0];return i.node(o).canReplaceWith(s,s,c?c.type:i.node(o+1).type)}function Kk(n,e,t=1,r){let i=n.doc.resolve(e),o=K.empty,a=K.empty;for(let s=i.depth,c=i.depth-t,d=t-1;s>c;s--,d--){o=K.from(i.node(s).copy(o));let u=r&&r[d];a=K.from(u?u.type.create(u.attrs,a):i.node(s).copy(a))}n.step(new ot(e,e,new ie(o.append(a),t,t),!0))}function Wn(n,e){let t=n.resolve(e),r=t.index();return Zu(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function Zu(n,e){return!!(n&&e&&!n.isLeaf&&n.canAppend(e))}function ea(n,e,t=-1){let r=n.resolve(e);for(let i=r.depth;;i--){let o,a,s=r.index(i);if(i==r.depth?(o=r.nodeBefore,a=r.nodeAfter):t>0?(o=r.node(i+1),s++,a=r.node(i).maybeChild(s)):(o=r.node(i).maybeChild(s-1),a=r.node(i+1)),o&&!o.isTextblock&&Zu(o,a)&&r.node(i).canReplace(s,s+1))return e;if(i==0)break;e=t<0?r.before(i):r.after(i)}}function Gk(n,e,t){let r=new ot(e-t,e+t,ie.empty,!0);n.step(r)}function Qk(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,t))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,t))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function ef(n,e,t){let r=n.resolve(e);if(!t.content.size)return e;let i=t.content;for(let o=0;o<t.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(t.openStart==0&&t.size?2:1);o++)for(let a=r.depth;a>=0;a--){let s=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,c=r.index(a)+(s>0?1:0),d=r.node(a),u=!1;if(o==1)u=d.canReplace(c,c,i);else{let f=d.contentMatchAt(c).findWrapping(i.firstChild.type);u=f&&d.canReplaceWith(c,c,f[0])}if(u)return s==0?r.pos:s<0?r.before(a+1):r.after(a+1)}return null}function Qs(n,e,t=e,r=ie.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),o=n.resolve(t);return tf(i,o,r)?new ot(e,t,r):new Jk(i,o,r).fit()}function tf(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class Jk{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=K.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=K.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,a=r.depth,s=i.depth;for(;a&&s&&o.childCount==1;)o=o.firstChild.content,a--,s--;let c=new ie(o,a,s);return e>-1?new Ze(r.pos,e,this.$to.pos,this.$to.end(),c,t):c.size||r.pos!=this.$to.pos?new ot(r.pos,i.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let o=t.firstChild;if(t.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}t=o.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=Js(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let a=i.firstChild;for(let s=this.depth;s>=0;s--){let{type:c,match:d}=this.frontier[s],u,f=null;if(t==1&&(a?d.matchType(a.type)||(f=d.fillBefore(K.from(a),!1)):o&&c.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:s,parent:o,inject:f};if(t==2&&a&&(u=d.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:s,parent:o,wrap:u};if(o&&d.matchType(o.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=Js(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new ie(e,t+1,Math.max(r,i.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=Js(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new ie(Ki(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new ie(Ki(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let g=0;g<o.length;g++)this.openFrontierNode(o[g]);let a=this.unplaced,s=r?r.content:a.content,c=a.openStart-e,d=0,u=[],{match:f,type:p}=this.frontier[t];if(i){for(let g=0;g<i.childCount;g++)u.push(i.child(g));f=f.matchFragment(i)}let h=s.size+e-(a.content.size-a.openEnd);for(;d<s.childCount;){let g=s.child(d),k=f.matchType(g.type);if(!k)break;d++,(d>1||c==0||g.content.size)&&(f=k,u.push(nf(g.mark(p.allowedMarks(g.marks)),d==1?c:0,d==s.childCount?h:-1)))}let m=d==s.childCount;m||(h=-1),this.placed=Gi(this.placed,t,K.from(u)),this.frontier[t].match=f,m&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,k=s;g<h;g++){let x=k.lastChild;this.frontier.push({type:x.type,match:x.contentMatchAt(x.childCount)}),k=x.content}this.unplaced=m?e==0?ie.empty:new ie(Ki(a.content,e-1,1),e-1,h<0?a.openEnd:e-1):new ie(Ki(a.content,e,d),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!Xs(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:i}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=Xs(e,t,i,r,o);if(a){for(let s=t-1;s>=0;s--){let{match:c,type:d}=this.frontier[s],u=Xs(e,s,d,c,!0);if(!u||u.childCount)continue e}return{depth:t,fit:a,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Gi(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Gi(this.placed,this.depth,K.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(K.empty,!0);t.childCount&&(this.placed=Gi(this.placed,this.frontier.length,t))}}function Ki(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Ki(n.firstChild.content,e-1,t)))}function Gi(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Gi(n.lastChild.content,e-1,t)))}function Js(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function nf(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,nf(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(K.empty,!0)))),n.copy(r)}function Xs(n,e,t,r,i){let o=n.node(e),a=i?n.indexAfter(e):n.index(e);if(a==o.childCount&&!t.compatibleContent(o.type))return null;let s=r.fillBefore(o.content,!0,a);return s&&!Xk(t,o.content,a)?s:null}function Xk(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function Zk(n){return n.spec.defining||n.spec.definingForContent}function ex(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let i=n.doc.resolve(e),o=n.doc.resolve(t);if(tf(i,o,r))return n.step(new ot(e,t,r));let a=of(i,n.doc.resolve(t));a[a.length-1]==0&&a.pop();let s=-(i.depth+1);a.unshift(s);for(let p=i.depth,h=i.pos-1;p>0;p--,h--){let m=i.node(p).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;a.indexOf(p)>-1?s=p:i.before(p)==h&&a.splice(1,0,-p)}let c=a.indexOf(s),d=[],u=r.openStart;for(let p=r.content,h=0;;h++){let m=p.firstChild;if(d.push(m),h==r.openStart)break;p=m.content}for(let p=u-1;p>=0;p--){let h=d[p],m=Zk(h.type);if(m&&!h.sameMarkup(i.node(Math.abs(s)-1)))u=p;else if(m||!h.type.isTextblock)break}for(let p=r.openStart;p>=0;p--){let h=(p+u+1)%(r.openStart+1),m=d[h];if(m)for(let g=0;g<a.length;g++){let k=a[(g+c)%a.length],x=!0;k<0&&(x=!1,k=-k);let S=i.node(k-1),T=i.index(k-1);if(S.canReplaceWith(T,T,m.type,m.marks))return n.replace(i.before(k),x?o.after(k):t,new ie(rf(r.content,0,r.openStart,h),h,r.openEnd))}}let f=n.steps.length;for(let p=a.length-1;p>=0&&(n.replace(e,t,r),!(n.steps.length>f));p--){let h=a[p];h<0||(e=i.before(h),t=o.after(h))}}function rf(n,e,t,r,i){if(e<t){let o=n.firstChild;n=n.replaceChild(0,o.copy(rf(o.content,e+1,t,r,o)))}if(e>r){let o=i.contentMatchAt(0),a=o.fillBefore(n).append(n);n=a.append(o.matchFragment(a).fillBefore(K.empty,!0))}return n}function tx(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=Qk(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new ie(K.from(r),0,0))}function nx(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),o=of(r,i);for(let a=0;a<o.length;a++){let s=o[a],c=a==o.length-1;if(c&&s==0||r.node(s).type.contentMatch.validEnd)return n.delete(r.start(s),i.end(s));if(s>0&&(c||r.node(s-1).canReplace(r.index(s-1),i.indexAfter(s-1))))return n.delete(r.before(s),i.after(s))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(e-r.start(a)==r.depth-a&&t>r.end(a)&&i.end(a)-t!=i.depth-a)return n.delete(r.before(a),t);n.delete(e,t)}function of(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let i=r;i>=0;i--){let o=n.start(i);if(o<n.pos-(n.depth-i)||e.end(i)>e.pos+(e.depth-i)||n.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==n.depth&&i==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&t.push(i)}return t}class ri extends ct{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return je.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return je.fromReplace(e,this.pos,this.pos+1,new ie(K.from(i),0,t.isLeaf?0:1))}getMap(){return Et.empty}invert(e){return new ri(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ri(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new ri(t.pos,t.attr,t.value)}}ct.jsonID("attr",ri);class Qi extends ct{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return je.ok(r)}getMap(){return Et.empty}invert(e){return new Qi(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Qi(t.attr,t.value)}}ct.jsonID("docAttr",Qi);let ii=class extends Error{};ii=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},ii.prototype=Object.create(Error.prototype),ii.prototype.constructor=ii,ii.prototype.name="TransformError";class rx{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Zr}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new ii(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=ie.empty){let i=Qs(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new ie(K.from(r),0,0))}delete(e,t){return this.replace(e,t,ie.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return ex(this,e,t,r),this}replaceRangeWith(e,t,r){return tx(this,e,t,r),this}deleteRange(e,t){return nx(this,e,t),this}lift(e,t){return zk(this,e,t),this}join(e,t=1){return Gk(this,e,t),this}wrap(e,t){return Uk(this,e,t),this}setBlockType(e,t=e,r,i=null){return jk(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i){return qk(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new ri(e,t,r)),this}setDocAttribute(e,t){return this.step(new Qi(e,t)),this}addNodeMark(e,t){return this.step(new jn(e,t)),this}removeNodeMark(e,t){if(!(t instanceof Oe)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t=t.isInSet(r.marks),!t)return this}return this.step(new ei(e,t)),this}split(e,t=1,r){return Kk(this,e,t,r),this}addMark(e,t,r){return Vk(this,e,t,r),this}removeMark(e,t,r){return Lk(this,e,t,r),this}clearIncompatible(e,t,r){return $k(this,e,t,r),this}}const Zs=Object.create(null);class ye{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new ix(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=ie.empty){let r=t.content.lastChild,i=null;for(let s=0;s<t.openEnd;s++)i=r,r=r.lastChild;let o=e.steps.length,a=this.ranges;for(let s=0;s<a.length;s++){let{$from:c,$to:d}=a[s],u=e.mapping.slice(o);e.replaceRange(u.map(c.pos),u.map(d.pos),s?ie.empty:t),s==0&&lf(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:a,$to:s}=i[o],c=e.mapping.slice(r),d=c.map(a.pos),u=c.map(s.pos);o?e.deleteRange(d,u):(e.replaceRangeWith(d,u,t),lf(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new ge(e):oi(e.node(0),e.parent,e.pos,e.index(),t,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let a=t<0?oi(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):oi(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,r);if(a)return a}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Jt(e.node(0))}static atStart(e){return oi(e,e,0,0,1)||new Jt(e)}static atEnd(e){return oi(e,e,e.content.size,e.childCount,-1)||new Jt(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Zs[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Zs)throw new RangeError("Duplicate use of selection JSON ID "+e);return Zs[e]=t,t.prototype.jsonID=e,t}getBookmark(){return ge.between(this.$anchor,this.$head).getBookmark()}}ye.prototype.visible=!0;class ix{constructor(e,t){this.$from=e,this.$to=t}}let af=!1;function sf(n){!af&&!n.parent.inlineContent&&(af=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class ge extends ye{constructor(e,t=e){sf(e),sf(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return ye.near(r);let i=e.resolve(t.map(this.anchor));return new ge(i.parent.inlineContent?i:r,r)}replace(e,t=ie.empty){if(super.replace(e,t),t==ie.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof ge&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ta(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new ge(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let i=e.resolve(t);return new this(i,r==t?i:e.resolve(r))}static between(e,t,r){let i=e.pos-t.pos;if((!r||i)&&(r=i>=0?1:-1),!t.parent.inlineContent){let o=ye.findFrom(t,r,!0)||ye.findFrom(t,-r,!0);if(o)t=o.$head;else return ye.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(ye.findFrom(e,-r,!0)||ye.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new ge(e,t)}}ye.jsonID("text",ge);class ta{constructor(e,t){this.anchor=e,this.head=t}map(e){return new ta(e.map(this.anchor),e.map(this.head))}resolve(e){return ge.between(e.resolve(this.anchor),e.resolve(this.head))}}class he extends ye{constructor(e){let t=e.nodeAfter,r=e.node(0).resolve(e.pos+t.nodeSize);super(e,r),this.node=t}map(e,t){let{deleted:r,pos:i}=t.mapResult(this.anchor),o=e.resolve(i);return r?ye.near(o):new he(o)}content(){return new ie(K.from(this.node),0,0)}eq(e){return e instanceof he&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new el(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new he(e.resolve(t.anchor))}static create(e,t){return new he(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}he.prototype.visible=!1,ye.jsonID("node",he);class el{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new ta(r,r):new el(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&he.isSelectable(r)?new he(t):ye.near(t)}}class Jt extends ye{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=ie.empty){if(t==ie.empty){e.delete(0,e.doc.content.size);let r=ye.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Jt(e)}map(e){return new Jt(e)}eq(e){return e instanceof Jt}getBookmark(){return ox}}ye.jsonID("all",Jt);const ox={map(){return this},resolve(n){return new Jt(n)}};function oi(n,e,t,r,i,o=!1){if(e.inlineContent)return ge.create(n,t);for(let a=r-(i>0?0:1);i>0?a<e.childCount:a>=0;a+=i){let s=e.child(a);if(s.isAtom){if(!o&&he.isSelectable(s))return he.create(n,t-(i<0?s.nodeSize:0))}else{let c=oi(n,s,t+i,i<0?s.childCount:0,i,o);if(c)return c}t+=s.nodeSize*i}return null}function lf(n,e,t){let r=n.steps.length-1;if(r<e)return;let i=n.steps[r];if(!(i instanceof ot||i instanceof Ze))return;let o=n.mapping.maps[r],a;o.forEach((s,c,d,u)=>{a==null&&(a=u)}),n.setSelection(ye.near(n.doc.resolve(a),t))}const cf=1,na=2,df=4;class ax extends rx{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|cf)&~na,this.storedMarks=null,this}get selectionSet(){return(this.updated&cf)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=na,this}ensureMarks(e){return Oe.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&na)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~na,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Oe.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let i=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=t),r=r??t,!e)return this.deleteRange(t,r);let o=this.storedMarks;if(!o){let a=this.doc.resolve(t);o=r==t?a.marks():a.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,i.text(e,o)),this.selection.empty||this.setSelection(ye.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=df,this}get scrolledIntoView(){return(this.updated&df)>0}}function uf(n,e){return!e||!n?n:n.bind(e)}class Ji{constructor(e,t,r){this.name=e,this.init=uf(t.init,r),this.apply=uf(t.apply,r)}}const sx=[new Ji("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new Ji("selection",{init(n,e){return n.selection||ye.atStart(e.doc)},apply(n){return n.selection}}),new Ji("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new Ji("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}})];class tl{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=sx.slice(),t&&t.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Ji(r.key,r.spec.state,r))})}}class ai{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=t){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],r=this.applyInner(e),i=null;for(;;){let o=!1;for(let a=0;a<this.config.plugins.length;a++){let s=this.config.plugins[a];if(s.spec.appendTransaction){let c=i?i[a].n:0,d=i?i[a].state:this,u=c<t.length&&s.spec.appendTransaction.call(s,c?t.slice(c):t,d,r);if(u&&r.filterTransaction(u,a)){if(u.setMeta("appendedTransaction",e),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<a?{state:r,n:t.length}:{state:this,n:0})}t.push(u),r=r.applyInner(u),o=!0}i&&(i[a]={state:r,n:t.length})}}if(!o)return{state:r,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new ai(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];t[o.name]=o.apply(e,this[o.name],this,t)}return t}get tr(){return new ax(this)}static create(e){let t=new tl(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new ai(t);for(let i=0;i<t.fields.length;i++)r[t.fields[i].name]=t.fields[i].init(e,r);return r}reconfigure(e){let t=new tl(this.schema,e.plugins),r=t.fields,i=new ai(t);for(let o=0;o<r.length;o++){let a=r[o].name;i[a]=this.hasOwnProperty(a)?this[a]:r[o].init(e,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(t[r]=o.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new tl(e.schema,e.plugins),o=new ai(i);return i.fields.forEach(a=>{if(a.name=="doc")o.doc=wr.fromJSON(e.schema,t.doc);else if(a.name=="selection")o.selection=ye.fromJSON(o.doc,t.selection);else if(a.name=="storedMarks")t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let s in r){let c=r[s],d=c.spec.state;if(c.key==a.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(t,s)){o[a.name]=d.fromJSON.call(c,e,t[s],o);return}}o[a.name]=a.init(e,o)}}),o}}function ff(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=ff(i,e,{})),t[r]=i}return t}class Ct{constructor(e){this.spec=e,this.props={},e.props&&ff(e.props,this,this.props),this.key=e.key?e.key.key:pf("plugin")}getState(e){return e[this.key]}}const nl=Object.create(null);function pf(n){return n in nl?n+"$"+ ++nl[n]:(nl[n]=0,n+"$")}class hn{constructor(e="key"){this.key=pf(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const yt=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},Xi=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let hf=null;const Tn=function(n,e,t){let r=hf||(hf=document.createRange());return r.setEnd(n,t??n.nodeValue.length),r.setStart(n,e||0),r},xr=function(n,e,t,r){return t&&(mf(n,e,t,r,-1)||mf(n,e,t,r,1))},lx=/^(img|br|input|textarea|hr)$/i;function mf(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:mn(n))){let o=n.parentNode;if(!o||o.nodeType!=1||rl(n)||lx.test(n.nodeName)||n.contentEditable=="false")return!1;e=yt(n)+(i<0?0:1),n=o}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.contentEditable=="false")return!1;e=i<0?mn(n):0}else return!1}}function mn(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function cx(n,e,t){for(let r=e==0,i=e==mn(n);r||i;){if(n==t)return!0;let o=yt(n);if(n=n.parentNode,!n)return!1;r=r&&o==0,i=i&&o==mn(n)}}function rl(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const ra=function(n){return n.focusNode&&xr(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function Cr(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}function dx(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function ux(n,e,t){if(n.caretPositionFromPoint)try{let r=n.caretPositionFromPoint(e,t);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(n.caretRangeFromPoint){let r=n.caretRangeFromPoint(e,t);if(r)return{node:r.startContainer,offset:r.startOffset}}}const gn=typeof navigator<"u"?navigator:null,gf=typeof document<"u"?document:null,qn=gn&&gn.userAgent||"",il=/Edge\/(\d+)/.exec(qn),yf=/MSIE \d/.exec(qn),ol=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(qn),Mt=!!(yf||ol||il),Kn=yf?document.documentMode:ol?+ol[1]:il?+il[1]:0,Xt=!Mt&&/gecko\/(\d+)/i.test(qn);Xt&&+(/Firefox\/(\d+)/.exec(qn)||[0,0])[1];const al=!Mt&&/Chrome\/(\d+)/.exec(qn),dt=!!al,fx=al?+al[1]:0,vt=!Mt&&!!gn&&/Apple Computer/.test(gn.vendor),si=vt&&(/Mobile\/\w+/.test(qn)||!!gn&&gn.maxTouchPoints>2),Lt=si||(gn?/Mac/.test(gn.platform):!1),px=gn?/Win/.test(gn.platform):!1,Zt=/Android \d/.test(qn),Zi=!!gf&&"webkitFontSmoothing"in gf.documentElement.style,hx=Zi?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function mx(n){return{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function Sn(n,e){return typeof n=="number"?n:n[e]}function gx(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,r=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*r}}function vf(n,e,t){let r=n.someProp("scrollThreshold")||0,i=n.someProp("scrollMargin")||5,o=n.dom.ownerDocument;for(let a=t||n.dom;a;a=Xi(a)){if(a.nodeType!=1)continue;let s=a,c=s==o.body,d=c?mx(o):gx(s),u=0,f=0;if(e.top<d.top+Sn(r,"top")?f=-(d.top-e.top+Sn(i,"top")):e.bottom>d.bottom-Sn(r,"bottom")&&(f=e.bottom-e.top>d.bottom-d.top?e.top+Sn(i,"top")-d.top:e.bottom-d.bottom+Sn(i,"bottom")),e.left<d.left+Sn(r,"left")?u=-(d.left-e.left+Sn(i,"left")):e.right>d.right-Sn(r,"right")&&(u=e.right-d.right+Sn(i,"right")),u||f)if(c)o.defaultView.scrollBy(u,f);else{let p=s.scrollLeft,h=s.scrollTop;f&&(s.scrollTop+=f),u&&(s.scrollLeft+=u);let m=s.scrollLeft-p,g=s.scrollTop-h;e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g}}if(c||/^(fixed|sticky)$/.test(getComputedStyle(a).position))break}}function yx(n){let e=n.dom.getBoundingClientRect(),t=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,a=t+1;a<Math.min(innerHeight,e.bottom);a+=5){let s=n.root.elementFromPoint(o,a);if(!s||s==n.dom||!n.dom.contains(s))continue;let c=s.getBoundingClientRect();if(c.top>=t-20){r=s,i=c.top;break}}return{refDOM:r,refTop:i,stack:bf(n.dom)}}function bf(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=Xi(r));return e}function vx({refDOM:n,refTop:e,stack:t}){let r=n?n.getBoundingClientRect().top:0;wf(t,r==0?0:r-e)}function wf(n,e){for(let t=0;t<n.length;t++){let{dom:r,top:i,left:o}=n[t];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=o&&(r.scrollLeft=o)}}let li=null;function bx(n){if(n.setActive)return n.setActive();if(li)return n.focus(li);let e=bf(n);n.focus(li==null?{get preventScroll(){return li={preventScroll:!0},!0}}:void 0),li||(li=!1,wf(e,0))}function kf(n,e){let t,r=2e8,i,o=0,a=e.top,s=e.top,c,d;for(let u=n.firstChild,f=0;u;u=u.nextSibling,f++){let p;if(u.nodeType==1)p=u.getClientRects();else if(u.nodeType==3)p=Tn(u).getClientRects();else continue;for(let h=0;h<p.length;h++){let m=p[h];if(m.top<=a&&m.bottom>=s){a=Math.max(m.bottom,a),s=Math.min(m.top,s);let g=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(g<r){t=u,r=g,i=g&&t.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,u.nodeType==1&&g&&(o=f+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!c&&m.left<=e.left&&m.right>=e.left&&(c=u,d={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!t&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(o=f+1)}}return!t&&c&&(t=c,i=d,r=0),t&&t.nodeType==3?wx(t,i):!t||r&&t.nodeType==1?{node:n,offset:o}:kf(t,i)}function wx(n,e){let t=n.nodeValue.length,r=document.createRange();for(let i=0;i<t;i++){r.setEnd(n,i+1),r.setStart(n,i);let o=Gn(r,1);if(o.top!=o.bottom&&sl(e,o))return{node:n,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:n,offset:0}}function sl(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function kx(n,e){let t=n.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left<n.getBoundingClientRect().left?t:n}function xx(n,e,t){let{node:r,offset:i}=kf(e,t),o=-1;if(r.nodeType==1&&!r.firstChild){let a=r.getBoundingClientRect();o=a.left!=a.right&&t.left>(a.left+a.right)/2?1:-1}return n.docView.posFromDOM(r,i,o)}function Cx(n,e,t,r){let i=-1;for(let o=e,a=!1;o!=n.dom;){let s=n.docView.nearestDesc(o,!0);if(!s)return null;if(s.dom.nodeType==1&&(s.node.isBlock&&s.parent&&!a||!s.contentDOM)){let c=s.dom.getBoundingClientRect();if(s.node.isBlock&&s.parent&&!a&&(a=!0,c.left>r.left||c.top>r.top?i=s.posBefore:(c.right<r.left||c.bottom<r.top)&&(i=s.posAfter)),!s.contentDOM&&i<0&&!s.node.isText)return(s.node.isBlock?r.top<(c.top+c.bottom)/2:r.left<(c.left+c.right)/2)?s.posBefore:s.posAfter}o=s.dom.parentNode}return i>-1?i:n.docView.posFromDOM(e,t,-1)}function xf(n,e,t){let r=n.childNodes.length;if(r&&t.top<t.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-t.top)/(t.bottom-t.top))-2)),o=i;;){let a=n.childNodes[o];if(a.nodeType==1){let s=a.getClientRects();for(let c=0;c<s.length;c++){let d=s[c];if(sl(e,d))return xf(a,e,d)}}if((o=(o+1)%r)==i)break}return n}function Mx(n,e){let t=n.dom.ownerDocument,r,i=0,o=ux(t,e.left,e.top);o&&({node:r,offset:i}=o);let a=(n.root.elementFromPoint?n.root:t).elementFromPoint(e.left,e.top),s;if(!a||!n.dom.contains(a.nodeType!=1?a.parentNode:a)){let d=n.dom.getBoundingClientRect();if(!sl(e,d)||(a=xf(n.dom,e,d),!a))return null}if(vt)for(let d=a;r&&d;d=Xi(d))d.draggable&&(r=void 0);if(a=kx(a,e),r){if(Xt&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let u=r.childNodes[i],f;u.nodeName=="IMG"&&(f=u.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&i++}let d;Zi&&i&&r.nodeType==1&&(d=r.childNodes[i-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&i--,r==n.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?s=n.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(s=Cx(n,r,i,e))}s==null&&(s=xx(n,a,e));let c=n.docView.nearestDesc(a,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function Cf(n){return n.top<n.bottom||n.left<n.right}function Gn(n,e){let t=n.getClientRects();if(t.length){let r=t[e<0?0:t.length-1];if(Cf(r))return r}return Array.prototype.find.call(t,Cf)||n.getBoundingClientRect()}const Tx=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Mf(n,e,t){let{node:r,offset:i,atom:o}=n.docView.domFromPos(e,t<0?-1:1),a=Zi||Xt;if(r.nodeType==3)if(a&&(Tx.test(r.nodeValue)||(t<0?!i:i==r.nodeValue.length))){let c=Gn(Tn(r,i,i),t);if(Xt&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let d=Gn(Tn(r,i-1,i-1),-1);if(d.top==c.top){let u=Gn(Tn(r,i,i+1),-1);if(u.top!=c.top)return eo(u,u.left<d.left)}}return c}else{let c=i,d=i,u=t<0?1:-1;return t<0&&!i?(d++,u=-1):t>=0&&i==r.nodeValue.length?(c--,u=1):t<0?c--:d++,eo(Gn(Tn(r,c,d),u),u<0)}if(!n.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(t<0||i==mn(r))){let c=r.childNodes[i-1];if(c.nodeType==1)return ll(c.getBoundingClientRect(),!1)}if(o==null&&i<mn(r)){let c=r.childNodes[i];if(c.nodeType==1)return ll(c.getBoundingClientRect(),!0)}return ll(r.getBoundingClientRect(),t>=0)}if(o==null&&i&&(t<0||i==mn(r))){let c=r.childNodes[i-1],d=c.nodeType==3?Tn(c,mn(c)-(a?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(d)return eo(Gn(d,1),!1)}if(o==null&&i<mn(r)){let c=r.childNodes[i];for(;c.pmViewDesc&&c.pmViewDesc.ignoreForCoords;)c=c.nextSibling;let d=c?c.nodeType==3?Tn(c,0,a?0:1):c.nodeType==1?c:null:null;if(d)return eo(Gn(d,-1),!0)}return eo(Gn(r.nodeType==3?Tn(r):r,-t),t>=0)}function eo(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function ll(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function Tf(n,e,t){let r=n.state,i=n.root.activeElement;r!=e&&n.updateState(e),i!=n.dom&&n.focus();try{return t()}finally{r!=e&&n.updateState(r),i!=n.dom&&i&&i.focus()}}function Sx(n,e,t){let r=e.selection,i=t=="up"?r.$from:r.$to;return Tf(n,e,()=>{let{node:o}=n.docView.domFromPos(i.pos,t=="up"?-1:1);for(;;){let s=n.docView.nearestDesc(o,!0);if(!s)break;if(s.node.isBlock){o=s.contentDOM||s.dom;break}o=s.dom.parentNode}let a=Mf(n,i.pos,1);for(let s=o.firstChild;s;s=s.nextSibling){let c;if(s.nodeType==1)c=s.getClientRects();else if(s.nodeType==3)c=Tn(s,0,s.nodeValue.length).getClientRects();else continue;for(let d=0;d<c.length;d++){let u=c[d];if(u.bottom>u.top+1&&(t=="up"?a.top-u.top>(u.bottom-a.top)*2:u.bottom-a.bottom>(a.bottom-u.top)*2))return!1}}return!0})}const Dx=/[\u0590-\u08ac]/;function Ax(n,e,t){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,a=i==r.parent.content.size,s=n.domSelection();return!Dx.test(r.parent.textContent)||!s.modify?t=="left"||t=="backward"?o:a:Tf(n,e,()=>{let{focusNode:c,focusOffset:d,anchorNode:u,anchorOffset:f}=n.domSelectionRange(),p=s.caretBidiLevel;s.modify("move",t,"character");let h=r.depth?n.docView.domAfterPos(r.before()):n.dom,{focusNode:m,focusOffset:g}=n.domSelectionRange(),k=m&&!h.contains(m.nodeType==1?m:m.parentNode)||c==m&&d==g;try{s.collapse(u,f),c&&(c!=u||d!=f)&&s.extend&&s.extend(c,d)}catch{}return p!=null&&(s.caretBidiLevel=p),k})}let Sf=null,Df=null,Af=!1;function Ex(n,e,t){return Sf==e&&Df==t?Af:(Sf=e,Df=t,Af=t=="up"||t=="down"?Sx(n,e,t):Ax(n,e,t))}const $t=0,Ef=1,Mr=2,yn=3;class to{constructor(e,t,r,i){this.parent=e,this.children=t,this.dom=r,this.contentDOM=i,this.dirty=$t,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,r=this.posAtStart;;t++){let i=this.children[t];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let o,a;if(e==this.contentDOM)o=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&!((a=o.pmViewDesc)&&a.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(a)+a.size:this.posAtStart}else{let o,a;if(e==this.contentDOM)o=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&!((a=o.pmViewDesc)&&a.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(a):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=t>yt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&t==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),a;if(o&&(!t||o.node))if(r&&(a=o.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))r=!1;else return o}}getDesc(e){let t=e.pmViewDesc;for(let r=t;r;r=r.parent)if(r==this)return t}posFromDOM(e,t,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,t,r)}return-1}descAt(e){for(let t=0,r=0;t<this.children.length;t++){let i=this.children[t],o=r+i.size;if(r==e&&o!=r){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(e<o)return i.descAt(e-r-i.border);r=o}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let a=this.children[r],s=o+a.size;if(s>e||a instanceof _f){i=e-o;break}o=s}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof Of&&o.side>=0;r--);if(t<=0){let o,a=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,a=!1);return o&&t&&a&&!o.border&&!o.domAtom?o.domFromPos(o.size,t):{node:this.contentDOM,offset:o?yt(o.dom)+1:0}}else{let o,a=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,a=!1);return o&&a&&!o.border&&!o.domAtom?o.domFromPos(0,t):{node:this.contentDOM,offset:o?yt(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let a=r,s=0;;s++){let c=this.children[s],d=a+c.size;if(i==-1&&e<=d){let u=a+c.border;if(e>=u&&t<=d-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(e,t,u);e=a;for(let f=s;f>0;f--){let p=this.children[f-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){i=yt(p.dom)+1;break}e-=p.size}i==-1&&(i=0)}if(i>-1&&(d>t||s==this.children.length-1)){t=d;for(let u=s+1;u<this.children.length;u++){let f=this.children[u];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=yt(f.dom);break}t+=f.size}o==-1&&(o=this.contentDOM.childNodes.length);break}a=d}return{node:this.contentDOM,from:e,to:t,fromOffset:i,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:r}=this.domFromPos(e,0);if(t.nodeType!=1||r==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[r]}setSelection(e,t,r,i=!1){let o=Math.min(e,t),a=Math.max(e,t);for(let p=0,h=0;p<this.children.length;p++){let m=this.children[p],g=h+m.size;if(o>h&&a<g)return m.setSelection(e-h-m.border,t-h-m.border,r,i);h=g}let s=this.domFromPos(e,e?-1:1),c=t==e?s:this.domFromPos(t,t?-1:1),d=r.getSelection(),u=!1;if((Xt||vt)&&e==t){let{node:p,offset:h}=s;if(p.nodeType==3){if(u=!!(h&&p.nodeValue[h-1]==`
76
+ `),u&&h==p.nodeValue.length)for(let m=p,g;m;m=m.parentNode){if(g=m.nextSibling){g.nodeName=="BR"&&(s=c={node:g.parentNode,offset:yt(g)+1});break}let k=m.pmViewDesc;if(k&&k.node&&k.node.isBlock)break}}else{let m=p.childNodes[h-1];u=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(Xt&&d.focusNode&&d.focusNode!=c.node&&d.focusNode.nodeType==1){let p=d.focusNode.childNodes[d.focusOffset];p&&p.contentEditable=="false"&&(i=!0)}if(!(i||u&&vt)&&xr(s.node,s.offset,d.anchorNode,d.anchorOffset)&&xr(c.node,c.offset,d.focusNode,d.focusOffset))return;let f=!1;if((d.extend||e==t)&&!u){d.collapse(s.node,s.offset);try{e!=t&&d.extend(c.node,c.offset),f=!0}catch{}}if(!f){if(e>t){let h=s;s=c,c=h}let p=document.createRange();p.setEnd(c.node,c.offset),p.setStart(s.node,s.offset),d.removeAllRanges(),d.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],a=r+o.size;if(r==a?e<=a&&t>=r:e<a&&t>r){let s=r+o.border,c=a-o.border;if(e>=s&&t<=c){this.dirty=e==r||t==a?Mr:Ef,e==s&&t==c&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=yn:o.markDirty(e-s,t-s);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Mr:yn}r=a}this.dirty=Mr}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=e==1?Mr:Ef;t.dirty<r&&(t.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class Of extends to{constructor(e,t,r,i){let o,a=t.type.toDOM;if(typeof a=="function"&&(a=a(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!t.type.spec.raw){if(a.nodeType!=1){let s=document.createElement("span");s.appendChild(a),a=s}a.contentEditable="false",a.classList.add("ProseMirror-widget")}super(e,[],a,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return this.dirty==$t&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class Ox extends to{constructor(e,t,r,i){super(e,[],t,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Tr extends to{constructor(e,t,r,i){super(e,[],r,i),this.mark=t}static create(e,t,r,i){let o=i.nodeViews[t.type.name],a=o&&o(t,i,r);return(!a||!a.dom)&&(a=fn.renderSpec(document,t.type.spec.toDOM(t,r))),new Tr(e,t,a.dom,a.contentDOM||a.dom)}parseRule(){return this.dirty&yn||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=yn&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=$t){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=$t}}slice(e,t,r){let i=Tr.create(this.parent,this.mark,!0,r),o=this.children,a=this.size;t<a&&(o=ul(o,t,a,r)),e>0&&(o=ul(o,0,e,r));for(let s=0;s<o.length;s++)o[s].parent=i;return i.children=o,i}}class Qn extends to{constructor(e,t,r,i,o,a,s,c,d){super(e,[],o,a),this.node=t,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=s}static create(e,t,r,i,o,a){let s=o.nodeViews[t.type.name],c,d=s&&s(t,o,()=>{if(!c)return a;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=d&&d.dom,f=d&&d.contentDOM;if(t.isText){if(!u)u=document.createTextNode(t.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:f}=fn.renderSpec(document,t.type.spec.toDOM(t)));!f&&!t.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let p=u;return u=If(u,r,t),d?c=new Nx(e,t,r,i,u,f||null,p,d,o,a+1):t.isText?new ia(e,t,r,i,u,p,o):new Qn(e,t,r,i,u,f||null,p,o,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let r=this.children[t];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>K.empty)}return e}matchesNode(e,t,r){return this.dirty==$t&&e.eq(this.node)&&dl(t,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let r=this.node.inlineContent,i=t,o=e.composing?this.localCompositionInfo(e,t):null,a=o&&o.pos>-1?o:null,s=o&&o.pos<0,c=new Bx(this,a&&a.node,e);Rx(this.node,this.innerDeco,(d,u,f)=>{d.spec.marks?c.syncToMarks(d.spec.marks,r,e):d.type.side>=0&&!f&&c.syncToMarks(u==this.node.childCount?Oe.none:this.node.child(u).marks,r,e),c.placeWidget(d,e,i)},(d,u,f,p)=>{c.syncToMarks(d.marks,r,e);let h;c.findNodeMatch(d,u,f,p)||s&&e.state.selection.from>i&&e.state.selection.to<i+d.nodeSize&&(h=c.findIndexWithChild(o.node))>-1&&c.updateNodeAt(d,u,f,h,e)||c.updateNextNode(d,u,f,e,p,i)||c.addNode(d,u,f,e,i),i+=d.nodeSize}),c.syncToMarks([],r,e),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==Mr)&&(a&&this.protectLocalComposition(e,a),Bf(this.contentDOM,this.children,e),si&&Vx(this.dom))}localCompositionInfo(e,t){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof ge)||r<t||i>t+this.node.content.size)return null;let o=e.domSelectionRange(),a=Lx(o.focusNode,o.focusOffset);if(!a||!this.dom.contains(a.parentNode))return null;if(this.node.inlineContent){let s=a.nodeValue,c=$x(this.node.content,s,r-t,i-t);return c<0?null:{node:a,pos:c,text:s}}else return{node:a,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:r,text:i}){if(this.getDesc(t))return;let o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let a=new Ox(this,o,t,i);e.input.compositionNodes.push(a),this.children=ul(this.children,r,r+i.length,e,a)}update(e,t,r,i){return this.dirty==yn||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,r,i),!0)}updateInner(e,t,r,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=$t}updateOuterDeco(e){if(dl(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Pf(this.dom,this.nodeDOM,cl(this.outerDeco,this.node,t),cl(e,this.node,t)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function Nf(n,e,t,r,i){If(r,e,n);let o=new Qn(void 0,n,e,t,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class ia extends Qn{constructor(e,t,r,i,o,a,s){super(e,t,r,i,o,null,a,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,r,i){return this.dirty==yn||this.dirty!=$t&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=$t||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=$t,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,r){let i=this.node.cut(e,t),o=document.createTextNode(i.text);return new ia(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=yn)}get domAtom(){return!1}}class _f extends to{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==$t&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Nx extends Qn{constructor(e,t,r,i,o,a,s,c,d,u){super(e,t,r,i,o,a,s,d,u),this.spec=c}update(e,t,r,i){if(this.dirty==yn)return!1;if(this.spec.update){let o=this.spec.update(e,t,r);return o&&this.updateInner(e,t,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,r,i){this.spec.setSelection?this.spec.setSelection(e,t,r):super.setSelection(e,t,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Bf(n,e,t){let r=n.firstChild,i=!1;for(let o=0;o<e.length;o++){let a=e[o],s=a.dom;if(s.parentNode==n){for(;s!=r;)r=Rf(r),i=!0;r=r.nextSibling}else i=!0,n.insertBefore(s,r);if(a instanceof Tr){let c=r?r.previousSibling:n.lastChild;Bf(a.contentDOM,a.children,t),r=c?c.nextSibling:n.firstChild}}for(;r;)r=Rf(r),i=!0;i&&t.trackWrites==n&&(t.trackWrites=null)}const no=function(n){n&&(this.nodeName=n)};no.prototype=Object.create(null);const Sr=[new no];function cl(n,e,t){if(n.length==0)return Sr;let r=t?Sr[0]:new no,i=[r];for(let o=0;o<n.length;o++){let a=n[o].type.attrs;if(a){a.nodeName&&i.push(r=new no(a.nodeName));for(let s in a){let c=a[s];c!=null&&(t&&i.length==1&&i.push(r=new no(e.isInline?"span":"div")),s=="class"?r.class=(r.class?r.class+" ":"")+c:s=="style"?r.style=(r.style?r.style+";":"")+c:s!="nodeName"&&(r[s]=c))}}}return i}function Pf(n,e,t,r){if(t==Sr&&r==Sr)return e;let i=e;for(let o=0;o<r.length;o++){let a=r[o],s=t[o];if(o){let c;s&&s.nodeName==a.nodeName&&i!=n&&(c=i.parentNode)&&c.nodeName.toLowerCase()==a.nodeName||(c=document.createElement(a.nodeName),c.pmIsDeco=!0,c.appendChild(i),s=Sr[0]),i=c}_x(i,s||Sr[0],a)}return i}function _x(n,e,t){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in t)&&n.removeAttribute(r);for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&t[r]!=e[r]&&n.setAttribute(r,t[r]);if(e.class!=t.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=t.class?t.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&n.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&n.classList.add(i[o]);n.classList.length==0&&n.removeAttribute("class")}if(e.style!=t.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)n.style.removeProperty(i[1])}t.style&&(n.style.cssText+=t.style)}}function If(n,e,t){return Pf(n,n,Sr,cl(e,t,n.nodeType!=1))}function dl(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].type.eq(e[t].type))return!1;return!0}function Rf(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class Bx{constructor(e,t,r){this.lock=t,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Px(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let r=e;r<t;r++)this.top.children[r].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,r){let i=0,o=this.stack.length>>1,a=Math.min(o,e.length);for(;i<a&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=$t,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let s=-1;for(let c=this.index;c<Math.min(this.index+3,this.top.children.length);c++){let d=this.top.children[c];if(d.matchesMark(e[o])&&!this.isLocked(d.dom)){s=c;break}}if(s>-1)s>this.index&&(this.changed=!0,this.destroyBetween(this.index,s)),this.top=this.top.children[this.index];else{let c=Tr.create(this.top,e[o],t,r);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,r,i){let o=-1,a;if(i>=this.preMatch.index&&(a=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,r))o=this.top.children.indexOf(a,this.index);else for(let s=this.index,c=Math.min(this.top.children.length,s+5);s<c;s++){let d=this.top.children[s];if(d.matchesNode(e,t,r)&&!this.preMatch.matched.has(d)){o=s;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,t,r,i,o){let a=this.top.children[i];return a.dirty==yn&&a.dom==a.contentDOM&&(a.dirty=Mr),a.update(e,t,r,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=t}}updateNextNode(e,t,r,i,o,a){for(let s=this.index;s<this.top.children.length;s++){let c=this.top.children[s];if(c instanceof Qn){let d=this.preMatch.matched.get(c);if(d!=null&&d!=o)return!1;let u=c.dom,f,p=this.isLocked(u)&&!(e.isText&&c.node&&c.node.isText&&c.nodeDOM.nodeValue==e.text&&c.dirty!=yn&&dl(t,c.outerDeco));if(!p&&c.update(e,t,r,i))return this.destroyBetween(this.index,s),c.dom!=u&&(this.changed=!0),this.index++,!0;if(!p&&(f=this.recreateWrapper(c,e,t,r,i,a)))return this.top.children[this.index]=f,f.contentDOM&&(f.dirty=Mr,f.updateChildren(i,a+1),f.dirty=$t),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,r,i,o,a){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content))return null;let s=Qn.create(this.top,t,r,i,o,a);if(s.contentDOM){s.children=e.children,e.children=[];for(let c of s.children)c.parent=s}return e.destroy(),s}addNode(e,t,r,i,o){let a=Qn.create(this.top,e,t,r,i,o);a.contentDOM&&a.updateChildren(i,o+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,t,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new Of(this.top,e,t,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof Tr;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof ia)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((vt||dt)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new _f(this.top,[],r,null);t!=this.top?t.children.push(i):t.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function Px(n,e){let t=e,r=t.children.length,i=n.childCount,o=new Map,a=[];e:for(;i>0;){let s;for(;;)if(r){let d=t.children[r-1];if(d instanceof Tr)t=d,r=d.children.length;else{s=d,r--;break}}else{if(t==e)break e;r=t.parent.children.indexOf(t),t=t.parent}let c=s.node;if(c){if(c!=n.child(i-1))break;--i,o.set(s,i),a.push(s)}}return{index:i,matched:o,matches:a.reverse()}}function Ix(n,e){return n.type.side-e.type.side}function Rx(n,e,t,r){let i=e.locals(n),o=0;if(i.length==0){for(let d=0;d<n.childCount;d++){let u=n.child(d);r(u,i,e.forChild(o,u),d),o+=u.nodeSize}return}let a=0,s=[],c=null;for(let d=0;;){let u,f;for(;a<i.length&&i[a].to==o;){let k=i[a++];k.widget&&(u?(f||(f=[u])).push(k):u=k)}if(u)if(f){f.sort(Ix);for(let k=0;k<f.length;k++)t(f[k],d,!!c)}else t(u,d,!!c);let p,h;if(c)h=-1,p=c,c=null;else if(d<n.childCount)h=d,p=n.child(d++);else break;for(let k=0;k<s.length;k++)s[k].to<=o&&s.splice(k--,1);for(;a<i.length&&i[a].from<=o&&i[a].to>o;)s.push(i[a++]);let m=o+p.nodeSize;if(p.isText){let k=m;a<i.length&&i[a].from<k&&(k=i[a].from);for(let x=0;x<s.length;x++)s[x].to<k&&(k=s[x].to);k<m&&(c=p.cut(k-o),p=p.cut(0,k-o),m=k,h=-1)}let g=p.isInline&&!p.isLeaf?s.filter(k=>!k.inline):s.slice();r(p,g,e.forChild(o,p),h),o=m}}function Vx(n){if(n.nodeName=="UL"||n.nodeName=="OL"){let e=n.style.cssText;n.style.cssText=e+"; list-style: square !important",window.getComputedStyle(n).listStyle,n.style.cssText=e}}function Lx(n,e){for(;;){if(n.nodeType==3)return n;if(n.nodeType==1&&e>0){if(n.childNodes.length>e&&n.childNodes[e].nodeType==3)return n.childNodes[e];n=n.childNodes[e-1],e=mn(n)}else if(n.nodeType==1&&e<n.childNodes.length)n=n.childNodes[e],e=0;else return null}}function $x(n,e,t,r){for(let i=0,o=0;i<n.childCount&&o<=r;){let a=n.child(i++),s=o;if(o+=a.nodeSize,!a.isText)continue;let c=a.text;for(;i<n.childCount;){let d=n.child(i++);if(o+=d.nodeSize,!d.isText)break;c+=d.text}if(o>=t){if(o>=r&&c.slice(r-e.length-s,r-s)==e)return r-e.length;let d=s<r?c.lastIndexOf(e,r-s-1):-1;if(d>=0&&d+e.length+s>=t)return s+d;if(t==r&&c.length>=r+e.length-s&&c.slice(r-s,r-s+e.length)==e)return r}}return-1}function ul(n,e,t,r,i){let o=[];for(let a=0,s=0;a<n.length;a++){let c=n[a],d=s,u=s+=c.size;d>=t||u<=e?o.push(c):(d<e&&o.push(c.slice(0,e-d,r)),i&&(o.push(i),i=void 0),u>t&&o.push(c.slice(t-d,c.size,r)))}return o}function fl(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),o=i&&i.size==0,a=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(a<0)return null;let s=r.resolve(a),c,d;if(ra(t)){for(c=s;i&&!i.node;)i=i.parent;let u=i.node;if(i&&u.isAtom&&he.isSelectable(u)&&i.parent&&!(u.isInline&&cx(t.focusNode,t.focusOffset,i.dom))){let f=i.posBefore;d=new he(a==f?s:r.resolve(f))}}else{let u=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(u<0)return null;c=r.resolve(u)}if(!d){let u=e=="pointer"||n.state.selection.head<s.pos&&!o?1:-1;d=hl(n,c,s,u)}return d}function Vf(n){return n.editable?n.hasFocus():Uf(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function Dn(n,e=!1){let t=n.state.selection;if(zf(n,t),!!Vf(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&dt){let r=n.domSelectionRange(),i=n.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&xr(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)zx(n);else{let{anchor:r,head:i}=t,o,a;Lf&&!(t instanceof ge)&&(t.$from.parent.inlineContent||(o=$f(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(a=$f(n,t.to))),n.docView.setSelection(r,i,n.root,e),Lf&&(o&&Ff(o),a&&Ff(a)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Fx(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const Lf=vt||dt&&fx<63;function $f(n,e){let{node:t,offset:r}=n.docView.domFromPos(e,0),i=r<t.childNodes.length?t.childNodes[r]:null,o=r?t.childNodes[r-1]:null;if(vt&&i&&i.contentEditable=="false")return pl(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return pl(i);if(o)return pl(o)}}function pl(n){return n.contentEditable="true",vt&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function Ff(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function Fx(n){let e=n.dom.ownerDocument;e.removeEventListener("selectionchange",n.input.hideSelectionGuard);let t=n.domSelectionRange(),r=t.anchorNode,i=t.anchorOffset;e.addEventListener("selectionchange",n.input.hideSelectionGuard=()=>{(t.anchorNode!=r||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!Vf(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function zx(n){let e=n.domSelection(),t=document.createRange(),r=n.cursorWrapper.dom,i=r.nodeName=="IMG";i?t.setEnd(r.parentNode,yt(r)+1):t.setEnd(r,0),t.collapse(!1),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&Mt&&Kn<=11&&(r.disabled=!0,r.disabled=!1)}function zf(n,e){if(e instanceof he){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(Hf(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else Hf(n)}function Hf(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function hl(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||ge.between(e,t,r)}function Yf(n){return n.editable&&!n.hasFocus()?!1:Uf(n)}function Uf(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function Hx(n){let e=n.docView.domFromPos(n.state.selection.anchor,0),t=n.domSelectionRange();return xr(e.node,e.offset,t.anchorNode,t.anchorOffset)}function ml(n,e){let{$anchor:t,$head:r}=n.selection,i=e>0?t.max(r):t.min(r),o=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return o&&ye.findFrom(o,e)}function Dr(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function jf(n,e,t){let r=n.state.selection;if(r instanceof ge){if(!r.empty||t.indexOf("s")>-1)return!1;if(n.endOfTextblock(e>0?"forward":"backward")){let i=ml(n.state,e);return i&&i instanceof he?Dr(n,i):!1}else if(!(Lt&&t.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,a;if(!o||o.isText)return!1;let s=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(a=n.docView.descAt(s))&&!a.contentDOM?he.isSelectable(o)?Dr(n,new he(e<0?n.state.doc.resolve(i.pos-o.nodeSize):i)):Zi?Dr(n,new ge(n.state.doc.resolve(e<0?s:s+o.nodeSize))):!1:!1}}else{if(r instanceof he&&r.node.isInline)return Dr(n,new ge(e>0?r.$to:r.$from));{let i=ml(n.state,e);return i?Dr(n,i):!1}}}function oa(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function ro(n,e){if(n.contentEditable=="false")return!0;let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function ci(n,e){return e<0?Yx(n):Ux(n)}function Yx(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,o,a=!1;for(Xt&&t.nodeType==1&&r<oa(t)&&ro(t.childNodes[r],-1)&&(a=!0);;)if(r>0){if(t.nodeType!=1)break;{let s=t.childNodes[r-1];if(ro(s,-1))i=t,o=--r;else if(s.nodeType==3)t=s,r=t.nodeValue.length;else break}}else{if(Wf(t))break;{let s=t.previousSibling;for(;s&&ro(s,-1);)i=t.parentNode,o=yt(s),s=s.previousSibling;if(s)t=s,r=oa(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}a?gl(n,t,r):i&&gl(n,i,o)}function Ux(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=oa(t),o,a;for(;;)if(r<i){if(t.nodeType!=1)break;let s=t.childNodes[r];if(ro(s,1))o=t,a=++r;else break}else{if(Wf(t))break;{let s=t.nextSibling;for(;s&&ro(s,1);)o=s.parentNode,a=yt(s)+1,s=s.nextSibling;if(s)t=s,r=0,i=oa(t);else{if(t=t.parentNode,t==n.dom)break;r=i=0}}}o&&gl(n,o,a)}function Wf(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function jx(n,e){for(;n&&e==n.childNodes.length&&!rl(n);)e=yt(n)+1,n=n.parentNode;for(;n&&e<n.childNodes.length;){let t=n.childNodes[e];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=0}}function Wx(n,e){for(;n&&!e&&!rl(n);)e=yt(n),n=n.parentNode;for(;n&&e;){let t=n.childNodes[e-1];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=n.childNodes.length}}function gl(n,e,t){if(e.nodeType!=3){let o,a;(a=jx(e,t))?(e=a,t=0):(o=Wx(e,t))&&(e=o,t=o.nodeValue.length)}let r=n.domSelection();if(ra(r)){let o=document.createRange();o.setEnd(e,t),o.setStart(e,t),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,t);n.domObserver.setCurSelection();let{state:i}=n;setTimeout(()=>{n.state==i&&Dn(n)},50)}function qf(n,e){let t=n.state.doc.resolve(e);if(!(dt||px)&&t.parent.inlineContent){let i=n.coordsAtPos(e);if(e>t.start()){let o=n.coordsAtPos(e-1),a=(o.top+o.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(e<t.end()){let o=n.coordsAtPos(e+1),a=(o.top+o.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function Kf(n,e,t){let r=n.state.selection;if(r instanceof ge&&!r.empty||t.indexOf("s")>-1||Lt&&t.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let a=ml(n.state,e);if(a&&a instanceof he)return Dr(n,a)}if(!i.parent.inlineContent){let a=e<0?i:o,s=r instanceof Jt?ye.near(a,e):ye.findFrom(a,e);return s?Dr(n,s):!1}return!1}function Gf(n,e){if(!(n.state.selection instanceof ge))return!0;let{$head:t,$anchor:r,empty:i}=n.state.selection;if(!t.sameParent(r))return!0;if(!i)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(o&&!o.isText){let a=n.state.tr;return e<0?a.delete(t.pos-o.nodeSize,t.pos):a.delete(t.pos,t.pos+o.nodeSize),n.dispatch(a),!0}return!1}function Qf(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function qx(n){if(!vt||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Qf(n,r,"true"),setTimeout(()=>Qf(n,r,"false"),20)}return!1}function Kx(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function Gx(n,e){let t=e.keyCode,r=Kx(e);if(t==8||Lt&&t==72&&r=="c")return Gf(n,-1)||ci(n,-1);if(t==46&&!e.shiftKey||Lt&&t==68&&r=="c")return Gf(n,1)||ci(n,1);if(t==13||t==27)return!0;if(t==37||Lt&&t==66&&r=="c"){let i=t==37?qf(n,n.state.selection.from)=="ltr"?-1:1:-1;return jf(n,i,r)||ci(n,i)}else if(t==39||Lt&&t==70&&r=="c"){let i=t==39?qf(n,n.state.selection.from)=="ltr"?1:-1:1;return jf(n,i,r)||ci(n,i)}else{if(t==38||Lt&&t==80&&r=="c")return Kf(n,-1,r)||ci(n,-1);if(t==40||Lt&&t==78&&r=="c")return qx(n)||Kf(n,1,r)||ci(n,1);if(r==(Lt?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function Jf(n,e){n.someProp("transformCopied",h=>{e=h(e,n)});let t=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let h=r.firstChild;t.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let a=n.someProp("clipboardSerializer")||fn.fromSchema(n.state.schema),s=op(),c=s.createElement("div");c.appendChild(a.serializeFragment(r,{document:s}));let d=c.firstChild,u,f=0;for(;d&&d.nodeType==1&&(u=rp[d.nodeName.toLowerCase()]);){for(let h=u.length-1;h>=0;h--){let m=s.createElement(u[h]);for(;c.firstChild;)m.appendChild(c.firstChild);c.appendChild(m),f++}d=c.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(t)}`);let p=n.someProp("clipboardTextSerializer",h=>h(e,n))||e.content.textBetween(0,e.content.size,`
77
+
78
+ `);return{dom:c,text:p}}function Xf(n,e,t,r,i){let o=i.parent.type.spec.code,a,s;if(!t&&!e)return null;let c=e&&(r||o||!t);if(c){if(n.someProp("transformPastedText",p=>{e=p(e,o||r,n)}),o)return e?new ie(K.from(n.state.schema.text(e.replace(/\r\n?/g,`
79
+ `))),0,0):ie.empty;let f=n.someProp("clipboardTextParser",p=>p(e,i,r,n));if(f)s=f;else{let p=i.marks(),{schema:h}=n.state,m=fn.fromSchema(h);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let k=a.appendChild(document.createElement("p"));g&&k.appendChild(m.serializeNode(h.text(g,p)))})}}else n.someProp("transformPastedHTML",f=>{t=f(t,n)}),a=Xx(t),Zi&&Zx(a);let d=a&&a.querySelector("[data-pm-slice]"),u=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let f=+u[3];f>0;f--){let p=a.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;a=p}if(s||(s=(n.someProp("clipboardParser")||n.someProp("domParser")||Xr.fromSchema(n.state.schema)).parseSlice(a,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!Qx.test(p.parentNode.nodeName)?{ignore:!0}:null}})),u)s=e1(np(s,+u[1],+u[2]),u[4]);else if(s=ie.maxOpen(Jx(s.content,i),!0),s.openStart||s.openEnd){let f=0,p=0;for(let h=s.content.firstChild;f<s.openStart&&!h.type.spec.isolating;f++,h=h.firstChild);for(let h=s.content.lastChild;p<s.openEnd&&!h.type.spec.isolating;p++,h=h.lastChild);s=np(s,f,p)}return n.someProp("transformPasted",f=>{s=f(s,n)}),s}const Qx=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Jx(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),o,a=[];if(n.forEach(s=>{if(!a)return;let c=i.findWrapping(s.type),d;if(!c)return a=null;if(d=a.length&&o.length&&ep(c,o,s,a[a.length-1],0))a[a.length-1]=d;else{a.length&&(a[a.length-1]=tp(a[a.length-1],o.length));let u=Zf(s,c);a.push(u),i=i.matchType(u.type),o=c}}),a)return K.from(a)}return n}function Zf(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,K.from(n));return n}function ep(n,e,t,r,i){if(i<n.length&&i<e.length&&n[i]==e[i]){let o=ep(n,e,t,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==n.length-1?t.type:n[i+1]))return r.copy(r.content.append(K.from(Zf(t,n,i+1))))}}function tp(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,tp(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(K.empty,!0);return n.copy(t.append(r))}function yl(n,e,t,r,i,o){let a=e<0?n.firstChild:n.lastChild,s=a.content;return n.childCount>1&&(o=0),i<r-1&&(s=yl(s,e,t,r,i+1,o)),i>=t&&(s=e<0?a.contentMatchAt(0).fillBefore(s,o<=i).append(s):s.append(a.contentMatchAt(a.childCount).fillBefore(K.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,a.copy(s))}function np(n,e,t){return e<n.openStart&&(n=new ie(yl(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new ie(yl(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const rp={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let ip=null;function op(){return ip||(ip=document.implementation.createHTMLDocument("title"))}function Xx(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=op().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&rp[r[1].toLowerCase()])&&(n=i.map(o=>"<"+o+">").join("")+n+i.map(o=>"</"+o+">").reverse().join("")),t.innerHTML=n,i)for(let o=0;o<i.length;o++)t=t.querySelector(i[o])||t;return t}function Zx(n){let e=n.querySelectorAll(dt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let r=e[t];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "),r)}}function e1(n,e){if(!n.size)return n;let t=n.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return n}let{content:i,openStart:o,openEnd:a}=n;for(let s=r.length-2;s>=0;s-=2){let c=t.nodes[r[s]];if(!c||c.hasRequiredAttrs())break;i=K.from(c.create(r[s+1],i)),o++,a++}return new ie(i,o,a)}const bt={},wt={},t1={touchstart:!0,touchmove:!0};class n1{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function r1(n){for(let e in bt){let t=bt[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=r=>{o1(n,r)&&!bl(n,r)&&(n.editable||!(r.type in wt))&&t(n,r)},t1[e]?{passive:!0}:void 0)}vt&&n.dom.addEventListener("input",()=>null),vl(n)}function Jn(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function i1(n){n.domObserver.stop();for(let e in n.input.eventHandlers)n.dom.removeEventListener(e,n.input.eventHandlers[e]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}function vl(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=r=>bl(n,r))})}function bl(n,e){return n.someProp("handleDOMEvents",t=>{let r=t[e.type];return r?r(n,e)||e.defaultPrevented:!1})}function o1(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function a1(n,e){!bl(n,e)&&bt[e.type]&&(n.editable||!(e.type in wt))&&bt[e.type](n,e)}wt.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!sp(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(Zt&&dt&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),si&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",i=>i(n,Cr(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||Gx(n,t)?t.preventDefault():Jn(n,"key")},wt.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)},wt.keypress=(n,e)=>{let t=e;if(sp(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||Lt&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof ge)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(t.charCode);!/[\r\n]/.test(i)&&!n.someProp("handleTextInput",o=>o(n,r.$from.pos,r.$to.pos,i))&&n.dispatch(n.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};function aa(n){return{left:n.clientX,top:n.clientY}}function s1(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function wl(n,e,t,r,i){if(r==-1)return!1;let o=n.state.doc.resolve(r);for(let a=o.depth+1;a>0;a--)if(n.someProp(e,s=>a>o.depth?s(n,t,o.nodeAfter,o.before(a),i,!0):s(n,t,o.node(a),o.before(a),i,!1)))return!0;return!1}function di(n,e,t){n.focused||n.focus();let r=n.state.tr.setSelection(e);t=="pointer"&&r.setMeta("pointer",!0),n.dispatch(r)}function l1(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&he.isSelectable(r)?(di(n,new he(t),"pointer"),!0):!1}function c1(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof he&&(r=t.node);let o=n.state.doc.resolve(e);for(let a=o.depth+1;a>0;a--){let s=a>o.depth?o.nodeAfter:o.node(a);if(he.isSelectable(s)){r&&t.$from.depth>0&&a>=t.$from.depth&&o.before(t.$from.depth+1)==t.$from.pos?i=o.before(t.$from.depth):i=o.before(a);break}}return i!=null?(di(n,he.create(n.state.doc,i),"pointer"),!0):!1}function d1(n,e,t,r,i){return wl(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?c1(n,t):l1(n,t))}function u1(n,e,t,r){return wl(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function f1(n,e,t,r){return wl(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||p1(n,t,r)}function p1(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(di(n,ge.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let a=o>i.depth?i.nodeAfter:i.node(o),s=i.before(o);if(a.inlineContent)di(n,ge.create(r,s+1,s+1+a.content.size),"pointer");else if(he.isSelectable(a))di(n,he.create(r,s),"pointer");else continue;return!0}}function kl(n){return sa(n)}const ap=Lt?"metaKey":"ctrlKey";bt.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=kl(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&s1(t,n.input.lastClick)&&!t[ap]&&(n.input.lastClick.type=="singleClick"?o="doubleClick":n.input.lastClick.type=="doubleClick"&&(o="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:o};let a=n.posAtCoords(aa(t));a&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new h1(n,a,t,!!r)):(o=="doubleClick"?u1:f1)(n,a.pos,a.inside,t)?t.preventDefault():Jn(n,"pointer"))};class h1{constructor(e,t,r,i){this.view=e,this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[ap],this.allowDefault=r.shiftKey;let o,a;if(t.inside>-1)o=e.state.doc.nodeAt(t.inside),a=t.inside;else{let u=e.state.doc.resolve(t.pos);o=u.parent,a=u.depth?u.before():0}const s=i?null:r.target,c=s?e.docView.nearestDesc(s,!0):null;this.target=c?c.dom:null;let{selection:d}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||d instanceof he&&d.from<=a&&d.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Xt&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Jn(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Dn(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(aa(e))),this.updateAllowDefault(e),this.allowDefault||!t?Jn(this.view,"pointer"):d1(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||vt&&this.mightDrag&&!this.mightDrag.node.isAtom||dt&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(di(this.view,ye.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Jn(this.view,"pointer")}move(e){this.updateAllowDefault(e),Jn(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}bt.touchstart=n=>{n.input.lastTouch=Date.now(),kl(n),Jn(n,"pointer")},bt.touchmove=n=>{n.input.lastTouch=Date.now(),Jn(n,"pointer")},bt.contextmenu=n=>kl(n);function sp(n,e){return n.composing?!0:vt&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const m1=Zt?5e3:-1;wt.compositionstart=wt.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),sa(n,!0),n.markCursor=null;else if(sa(n),Xt&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let a=o<0?i.lastChild:i.childNodes[o-1];if(!a)break;if(a.nodeType==3){n.domSelection().collapse(a,a.nodeValue.length);break}else i=a,o=-1}}n.input.composing=!0}lp(n,m1)},wt.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,lp(n,20))};function lp(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>sa(n),e))}function cp(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=g1());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function g1(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function sa(n,e=!1){if(!(Zt&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),cp(n),e||n.docView&&n.docView.dirty){let t=fl(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):n.updateState(n.state),!0}return!1}}function y1(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const ui=Mt&&Kn<15||si&&hx<604;bt.copy=wt.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let o=ui?null:t.clipboardData,a=r.content(),{dom:s,text:c}=Jf(n,a);o?(t.preventDefault(),o.clearData(),o.setData("text/html",s.innerHTML),o.setData("text/plain",c)):y1(n,s),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function v1(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function b1(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?io(n,r.value,null,i,e):io(n,r.textContent,r.innerHTML,i,e)},50)}function io(n,e,t,r,i){let o=Xf(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",c=>c(n,i,o||ie.empty)))return!0;if(!o)return!1;let a=v1(o),s=a?n.state.tr.replaceSelectionWith(a,r):n.state.tr.replaceSelection(o);return n.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}wt.paste=(n,e)=>{let t=e;if(n.composing&&!Zt)return;let r=ui?null:t.clipboardData,i=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&io(n,r.getData("text/plain"),r.getData("text/html"),i,t)?t.preventDefault():b1(n,t)};class w1{constructor(e,t){this.slice=e,this.move=t}}const dp=Lt?"altKey":"ctrlKey";bt.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=n.state.selection,o=i.empty?null:n.posAtCoords(aa(t));if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof he?i.to-1:i.to))){if(r&&r.mightDrag)n.dispatch(n.state.tr.setSelection(he.create(n.state.doc,r.mightDrag.pos)));else if(t.target&&t.target.nodeType==1){let d=n.docView.nearestDesc(t.target,!0);d&&d.node.type.spec.draggable&&d!=n.docView&&n.dispatch(n.state.tr.setSelection(he.create(n.state.doc,d.posBefore)))}}let a=n.state.selection.content(),{dom:s,text:c}=Jf(n,a);t.dataTransfer.clearData(),t.dataTransfer.setData(ui?"Text":"text/html",s.innerHTML),t.dataTransfer.effectAllowed="copyMove",ui||t.dataTransfer.setData("text/plain",c),n.dragging=new w1(a,!t[dp])},bt.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)},wt.dragover=wt.dragenter=(n,e)=>e.preventDefault(),wt.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(aa(t));if(!i)return;let o=n.state.doc.resolve(i.pos),a=r&&r.slice;a?n.someProp("transformPasted",m=>{a=m(a,n)}):a=Xf(n,t.dataTransfer.getData(ui?"Text":"text/plain"),ui?null:t.dataTransfer.getData("text/html"),!1,o);let s=!!(r&&!t[dp]);if(n.someProp("handleDrop",m=>m(n,t,a||ie.empty,s))){t.preventDefault();return}if(!a)return;t.preventDefault();let c=a?ef(n.state.doc,o.pos,a):o.pos;c==null&&(c=o.pos);let d=n.state.tr;s&&d.deleteSelection();let u=d.mapping.map(c),f=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,p=d.doc;if(f?d.replaceRangeWith(u,u,a.content.firstChild):d.replaceRange(u,u,a),d.doc.eq(p))return;let h=d.doc.resolve(u);if(f&&he.isSelectable(a.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(a.content.firstChild))d.setSelection(new he(h));else{let m=d.mapping.map(c);d.mapping.maps[d.mapping.maps.length-1].forEach((g,k,x,S)=>m=S),d.setSelection(hl(n,h,d.doc.resolve(m)))}n.focus(),n.dispatch(d.setMeta("uiEvent","drop"))},bt.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&Dn(n)},20))},bt.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)},bt.beforeinput=(n,e)=>{if(dt&&Zt&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",o=>o(n,Cr(8,"Backspace")))))return;let{$cursor:i}=n.state.selection;i&&i.pos>0&&n.dispatch(n.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let n in wt)bt[n]=wt[n];function oo(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class la{constructor(e,t){this.toDOM=e,this.spec=t||Ar,this.side=this.spec.side||0}map(e,t,r,i){let{pos:o,deleted:a}=e.mapResult(t.from+i,this.side<0?-1:1);return a?null:new Ft(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof la&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&oo(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Xn{constructor(e,t){this.attrs=e,this.spec=t||Ar}map(e,t,r,i){let o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,a=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=a?null:new Ft(o,a,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof Xn&&oo(this.attrs,e.attrs)&&oo(this.spec,e.spec)}static is(e){return e.type instanceof Xn}destroy(){}}class xl{constructor(e,t){this.attrs=e,this.spec=t||Ar}map(e,t,r,i){let o=e.mapResult(t.from+i,1);if(o.deleted)return null;let a=e.mapResult(t.to+i,-1);return a.deleted||a.pos<=o.pos?null:new Ft(o.pos-r,a.pos-r,this)}valid(e,t){let{index:r,offset:i}=e.content.findIndex(t.from),o;return i==t.from&&!(o=e.child(r)).isText&&i+o.nodeSize==t.to}eq(e){return this==e||e instanceof xl&&oo(this.attrs,e.attrs)&&oo(this.spec,e.spec)}destroy(){}}class Ft{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new Ft(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,r){return this.type.map(e,this,t,r)}static widget(e,t,r){return new Ft(e,e,new la(t,r))}static inline(e,t,r,i){return new Ft(e,t,new Xn(r,i))}static node(e,t,r,i){return new Ft(e,t,new xl(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Xn}get widget(){return this.type instanceof la}}const fi=[],Ar={};class Ke{constructor(e,t){this.local=e.length?e:fi,this.children=t.length?t:fi}static create(e,t){return t.length?ca(t,e,0,Ar):ut}find(e,t,r){let i=[];return this.findInner(e??0,t??1e9,i,0,r),i}findInner(e,t,r,i,o){for(let a=0;a<this.local.length;a++){let s=this.local[a];s.from<=t&&s.to>=e&&(!o||o(s.spec))&&r.push(s.copy(s.from+i,s.to+i))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let s=this.children[a]+1;this.children[a+2].findInner(e-s,t-s,r,i+s,o)}}map(e,t,r){return this==ut||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Ar)}mapInner(e,t,r,i,o){let a;for(let s=0;s<this.local.length;s++){let c=this.local[s].map(e,r,i);c&&c.type.valid(t,c)?(a||(a=[])).push(c):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?k1(this.children,a||[],e,t,r,i,o):a?new Ke(a.sort(Er),fi):ut}add(e,t){return t.length?this==ut?Ke.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let i,o=0;e.forEach((s,c)=>{let d=c+r,u;if(u=fp(t,s,d)){for(i||(i=this.children.slice());o<i.length&&i[o]<c;)o+=3;i[o]==c?i[o+2]=i[o+2].addInner(s,u,d+1):i.splice(o,0,c,c+s.nodeSize,ca(u,s,d+1,Ar)),o+=3}});let a=up(o?pp(t):t,-r);for(let s=0;s<a.length;s++)a[s].type.valid(e,a[s])||a.splice(s--,1);return new Ke(a.length?this.local.concat(a).sort(Er):this.local,i||this.children)}remove(e){return e.length==0||this==ut?this:this.removeInner(e,0)}removeInner(e,t){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let a,s=r[o]+t,c=r[o+1]+t;for(let u=0,f;u<e.length;u++)(f=e[u])&&f.from>s&&f.to<c&&(e[u]=null,(a||(a=[])).push(f));if(!a)continue;r==this.children&&(r=this.children.slice());let d=r[o+2].removeInner(a,s+1);d!=ut?r[o+2]=d:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,a;o<e.length;o++)if(a=e[o])for(let s=0;s<i.length;s++)i[s].eq(a,t)&&(i==this.local&&(i=this.local.slice()),i.splice(s--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Ke(i,r):ut}forChild(e,t){if(this==ut)return this;if(t.isLeaf)return Ke.empty;let r,i;for(let s=0;s<this.children.length;s+=3)if(this.children[s]>=e){this.children[s]==e&&(r=this.children[s+2]);break}let o=e+1,a=o+t.content.size;for(let s=0;s<this.local.length;s++){let c=this.local[s];if(c.from<a&&c.to>o&&c.type instanceof Xn){let d=Math.max(o,c.from)-o,u=Math.min(a,c.to)-o;d<u&&(i||(i=[])).push(c.copy(d,u))}}if(i){let s=new Ke(i.sort(Er),fi);return r?new Zn([s,r]):s}return r||ut}eq(e){if(this==e)return!0;if(!(e instanceof Ke)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return Cl(this.localsInner(e))}localsInner(e){if(this==ut)return fi;if(e.inlineContent||!this.local.some(Xn.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Xn||t.push(this.local[r]);return t}}Ke.empty=new Ke([],[]),Ke.removeOverlap=Cl;const ut=Ke.empty;class Zn{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,Ar));return Zn.from(r)}forChild(e,t){if(t.isLeaf)return Ke.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,t);o!=ut&&(o instanceof Zn?r=r.concat(o.members):r.push(o))}return Zn.from(r)}eq(e){if(!(e instanceof Zn)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!t)t=o;else{r&&(t=t.slice(),r=!1);for(let a=0;a<o.length;a++)t.push(o[a])}}return t?Cl(r?t:t.sort(Er)):fi}static from(e){switch(e.length){case 0:return ut;case 1:return e[0];default:return new Zn(e.every(t=>t instanceof Ke)?e:e.reduce((t,r)=>t.concat(r instanceof Ke?r:r.members),[]))}}}function k1(n,e,t,r,i,o,a){let s=n.slice();for(let d=0,u=o;d<t.maps.length;d++){let f=0;t.maps[d].forEach((p,h,m,g)=>{let k=g-m-(h-p);for(let x=0;x<s.length;x+=3){let S=s[x+1];if(S<0||p>S+u-f)continue;let T=s[x]+u-f;h>=T?s[x+1]=p<=T?-2:-1:m>=i&&k&&(s[x]+=k,s[x+1]+=k)}f+=k}),u=t.maps[d].map(u,-1)}let c=!1;for(let d=0;d<s.length;d+=3)if(s[d+1]<0){if(s[d+1]==-2){c=!0,s[d+1]=-1;continue}let u=t.map(n[d]+o),f=u-i;if(f<0||f>=r.content.size){c=!0;continue}let p=t.map(n[d+1]+o,-1),h=p-i,{index:m,offset:g}=r.content.findIndex(f),k=r.maybeChild(m);if(k&&g==f&&g+k.nodeSize==h){let x=s[d+2].mapInner(t,k,u+1,n[d]+o+1,a);x!=ut?(s[d]=f,s[d+1]=h,s[d+2]=x):(s[d+1]=-2,c=!0)}else c=!0}if(c){let d=x1(s,n,e,t,i,o,a),u=ca(d,r,0,a);e=u.local;for(let f=0;f<s.length;f+=3)s[f+1]<0&&(s.splice(f,3),f-=3);for(let f=0,p=0;f<u.children.length;f+=3){let h=u.children[f];for(;p<s.length&&s[p]<h;)p+=3;s.splice(p,0,u.children[f],u.children[f+1],u.children[f+2])}}return new Ke(e.sort(Er),s)}function up(n,e){if(!e||!n.length)return n;let t=[];for(let r=0;r<n.length;r++){let i=n[r];t.push(new Ft(i.from+e,i.to+e,i.type))}return t}function x1(n,e,t,r,i,o,a){function s(c,d){for(let u=0;u<c.local.length;u++){let f=c.local[u].map(r,i,d);f?t.push(f):a.onRemove&&a.onRemove(c.local[u].spec)}for(let u=0;u<c.children.length;u+=3)s(c.children[u+2],c.children[u]+d+1)}for(let c=0;c<n.length;c+=3)n[c+1]==-1&&s(n[c+2],e[c]+o+1);return t}function fp(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,i=null;for(let o=0,a;o<n.length;o++)(a=n[o])&&a.from>t&&a.to<r&&((i||(i=[])).push(a),n[o]=null);return i}function pp(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function ca(n,e,t,r){let i=[],o=!1;e.forEach((s,c)=>{let d=fp(n,s,c+t);if(d){o=!0;let u=ca(d,s,t+c+1,r);u!=ut&&i.push(c,c+s.nodeSize,u)}});let a=up(o?pp(n):n,-t).sort(Er);for(let s=0;s<a.length;s++)a[s].type.valid(e,a[s])||(r.onRemove&&r.onRemove(a[s].spec),a.splice(s--,1));return a.length||i.length?new Ke(a,i):ut}function Er(n,e){return n.from-e.from||n.to-e.to}function Cl(n){let e=n;for(let t=0;t<e.length-1;t++){let r=e[t];if(r.from!=r.to)for(let i=t+1;i<e.length;i++){let o=e[i];if(o.from==r.from){o.to!=r.to&&(e==n&&(e=n.slice()),e[i]=o.copy(o.from,r.to),hp(e,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(e==n&&(e=n.slice()),e[t]=r.copy(r.from,o.from),hp(e,i,r.copy(o.from,r.to)));break}}}return e}function hp(n,e,t){for(;e<n.length&&Er(t,n[e])>0;)e++;n.splice(e,0,t)}function Ml(n){let e=[];return n.someProp("decorations",t=>{let r=t(n.state);r&&r!=ut&&e.push(r)}),n.cursorWrapper&&e.push(Ke.create(n.state.doc,[n.cursorWrapper.deco])),Zn.from(e)}const C1={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},M1=Mt&&Kn<=11;class T1{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class S1{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new T1,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);Mt&&Kn<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),M1&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,C1)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Yf(this.view)){if(this.suppressingSelectionUpdates)return Dn(this.view);if(Mt&&Kn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&xr(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,r;for(let o=e.focusNode;o;o=Xi(o))t.add(o);for(let o=e.anchorNode;o;o=Xi(o))if(t.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Yf(e)&&!this.ignoreSelectionChange(r),o=-1,a=-1,s=!1,c=[];if(e.editable)for(let u=0;u<t.length;u++){let f=this.registerMutation(t[u],c);f&&(o=o<0?f.from:Math.min(f.from,o),a=a<0?f.to:Math.max(f.to,a),f.typeOver&&(s=!0))}if(Xt&&c.length>1){let u=c.filter(f=>f.nodeName=="BR");if(u.length==2){let f=u[0],p=u[1];f.parentNode&&f.parentNode.parentNode==p.parentNode?p.remove():f.remove()}}let d=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&ra(r)&&(d=fl(e))&&d.eq(ye.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Dn(e),this.currentSelection.set(r),e.scrollToSelection()):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,a),D1(e)),this.handleDOMChange(o,a,s,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Dn(e),this.currentSelection.set(r))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++)t.push(e.addedNodes[u]);if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,o=e.nextSibling;if(Mt&&Kn<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:f,nextSibling:p}=e.addedNodes[u];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f),(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(o=p)}let a=i&&i.parentNode==e.target?yt(i)+1:0,s=r.localPosFromDOM(e.target,a,-1),c=o&&o.parentNode==e.target?yt(o):e.target.childNodes.length,d=r.localPosFromDOM(e.target,c,1);return{from:s,to:d}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}let mp=new WeakMap,gp=!1;function D1(n){if(!mp.has(n)&&(mp.set(n,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace)!==-1)){if(n.requiresGeckoHackNode=Xt,gp)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),gp=!0}}function A1(n){let e;function t(c){c.preventDefault(),c.stopImmediatePropagation(),e=c.getTargetRanges()[0]}n.dom.addEventListener("beforeinput",t,!0),document.execCommand("indent"),n.dom.removeEventListener("beforeinput",t,!0);let r=e.startContainer,i=e.startOffset,o=e.endContainer,a=e.endOffset,s=n.domAtPos(n.state.selection.anchor);return xr(s.node,s.offset,o,a)&&([r,i,o,a]=[o,a,r,i]),{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:a}}function E1(n,e,t){let{node:r,fromOffset:i,toOffset:o,from:a,to:s}=n.docView.parseRange(e,t),c=n.domSelectionRange(),d,u=c.anchorNode;if(u&&n.dom.contains(u.nodeType==1?u:u.parentNode)&&(d=[{node:u,offset:c.anchorOffset}],ra(c)||d.push({node:c.focusNode,offset:c.focusOffset})),dt&&n.input.lastKeyCode===8)for(let k=o;k>i;k--){let x=r.childNodes[k-1],S=x.pmViewDesc;if(x.nodeName=="BR"&&!S){o=k;break}if(!S||S.size)break}let f=n.state.doc,p=n.someProp("domParser")||Xr.fromSchema(n.state.schema),h=f.resolve(a),m=null,g=p.parse(r,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:i,to:o,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:O1,context:h});if(d&&d[0].pos!=null){let k=d[0].pos,x=d[1]&&d[1].pos;x==null&&(x=k),m={anchor:k+a,head:x+a}}return{doc:g,sel:m,from:a,to:s}}function O1(n){let e=n.pmViewDesc;if(e)return e.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(vt&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(n.parentNode.lastChild==n||vt&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}else if(n.nodeName=="IMG"&&n.getAttribute("mark-placeholder"))return{ignore:!0};return null}const N1=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function _1(n,e,t,r,i){let o=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let M=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,_=fl(n,M);if(_&&!n.state.selection.eq(_)){if(dt&&Zt&&n.input.lastKeyCode===13&&Date.now()-100<n.input.lastKeyCodeTime&&n.someProp("handleKeyDown",N=>N(n,Cr(13,"Enter"))))return;let z=n.state.tr.setSelection(_);M=="pointer"?z.setMeta("pointer",!0):M=="key"&&z.scrollIntoView(),o&&z.setMeta("composition",o),n.dispatch(z)}return}let a=n.state.doc.resolve(e),s=a.sharedDepth(t);e=a.before(s+1),t=n.state.doc.resolve(t).after(s+1);let c=n.state.selection,d=E1(n,e,t),u=n.state.doc,f=u.slice(d.from,d.to),p,h;n.input.lastKeyCode===8&&Date.now()-100<n.input.lastKeyCodeTime?(p=n.state.selection.to,h="end"):(p=n.state.selection.from,h="start"),n.input.lastKeyCode=null;let m=I1(f.content,d.doc.content,d.from,p,h);if((si&&n.input.lastIOSEnter>Date.now()-225||Zt)&&i.some(M=>M.nodeType==1&&!N1.test(M.nodeName))&&(!m||m.endA>=m.endB)&&n.someProp("handleKeyDown",M=>M(n,Cr(13,"Enter")))){n.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof ge&&!c.empty&&c.$head.sameParent(c.$anchor)&&!n.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(d.sel){let M=yp(n,n.state.doc,d.sel);if(M&&!M.eq(n.state.selection)){let _=n.state.tr.setSelection(M);o&&_.setMeta("composition",o),n.dispatch(_)}}return}if(dt&&n.cursorWrapper&&d.sel&&d.sel.anchor==n.cursorWrapper.deco.from&&d.sel.head==d.sel.anchor){let M=m.endB-m.start;d.sel={anchor:d.sel.anchor+M,head:d.sel.anchor+M}}n.input.domChangeCount++,n.state.selection.from<n.state.selection.to&&m.start==m.endB&&n.state.selection instanceof ge&&(m.start>n.state.selection.from&&m.start<=n.state.selection.from+2&&n.state.selection.from>=d.from?m.start=n.state.selection.from:m.endA<n.state.selection.to&&m.endA>=n.state.selection.to-2&&n.state.selection.to<=d.to&&(m.endB+=n.state.selection.to-m.endA,m.endA=n.state.selection.to)),Mt&&Kn<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>d.from&&d.doc.textBetween(m.start-d.from-1,m.start-d.from+1)=="  "&&(m.start--,m.endA--,m.endB--);let g=d.doc.resolveNoCache(m.start-d.from),k=d.doc.resolveNoCache(m.endB-d.from),x=u.resolve(m.start),S=g.sameParent(k)&&g.parent.inlineContent&&x.end()>=m.endA,T;if((si&&n.input.lastIOSEnter>Date.now()-225&&(!S||i.some(M=>M.nodeName=="DIV"||M.nodeName=="P"))||!S&&g.pos<d.doc.content.size&&!g.sameParent(k)&&(T=ye.findFrom(d.doc.resolve(g.pos+1),1,!0))&&T.head==k.pos)&&n.someProp("handleKeyDown",M=>M(n,Cr(13,"Enter")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>m.start&&P1(u,m.start,m.endA,g,k)&&n.someProp("handleKeyDown",M=>M(n,Cr(8,"Backspace")))){Zt&&dt&&n.domObserver.suppressSelectionUpdates();return}dt&&Zt&&m.endB==m.start&&(n.input.lastAndroidDelete=Date.now()),Zt&&!S&&g.start()!=k.start()&&k.parentOffset==0&&g.depth==k.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==m.endA&&(m.endB-=2,k=d.doc.resolveNoCache(m.endB-d.from),setTimeout(()=>{n.someProp("handleKeyDown",function(M){return M(n,Cr(13,"Enter"))})},20));let y=m.start,B=m.endA,w,V,$;if(S){if(g.pos==k.pos)Mt&&Kn<=11&&g.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>Dn(n),20)),w=n.state.tr.delete(y,B),V=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&($=B1(g.parent.content.cut(g.parentOffset,k.parentOffset),x.parent.content.cut(x.parentOffset,m.endA-x.start()))))w=n.state.tr,$.type=="add"?w.addMark(y,B,$.mark):w.removeMark(y,B,$.mark);else if(g.parent.child(g.index()).isText&&g.index()==k.index()-(k.textOffset?0:1)){let M=g.parent.textBetween(g.parentOffset,k.parentOffset);if(n.someProp("handleTextInput",_=>_(n,y,B,M)))return;w=n.state.tr.insertText(M,y,B)}}if(w||(w=n.state.tr.replace(y,B,d.doc.slice(m.start-d.from,m.endB-d.from))),d.sel){let M=yp(n,w.doc,d.sel);M&&!(dt&&Zt&&n.composing&&M.empty&&(m.start!=m.endB||n.input.lastAndroidDelete<Date.now()-100)&&(M.head==y||M.head==w.mapping.map(B)-1)||Mt&&M.empty&&M.head==y)&&w.setSelection(M)}V&&w.ensureMarks(V),o&&w.setMeta("composition",o),n.dispatch(w.scrollIntoView())}function yp(n,e,t){return Math.max(t.anchor,t.head)>e.content.size?null:hl(n,e.resolve(t.anchor),e.resolve(t.head))}function B1(n,e){let t=n.firstChild.marks,r=e.firstChild.marks,i=t,o=r,a,s,c;for(let u=0;u<r.length;u++)i=r[u].removeFromSet(i);for(let u=0;u<t.length;u++)o=t[u].removeFromSet(o);if(i.length==1&&o.length==0)s=i[0],a="add",c=u=>u.mark(s.addToSet(u.marks));else if(i.length==0&&o.length==1)s=o[0],a="remove",c=u=>u.mark(s.removeFromSet(u.marks));else return null;let d=[];for(let u=0;u<e.childCount;u++)d.push(c(e.child(u)));if(K.from(d).eq(n))return{mark:s,type:a}}function P1(n,e,t,r,i){if(!r.parent.isTextblock||t-e<=i.pos-r.pos||Tl(r,!0,!1)<i.pos)return!1;let o=n.resolve(e);if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let a=n.resolve(Tl(o,!0,!0));return!a.parent.isTextblock||a.pos>t||Tl(a,!0,!1)<t?!1:r.parent.content.cut(r.parentOffset).eq(a.parent.content)}function Tl(n,e,t){let r=n.depth,i=e?n.end():n.pos;for(;r>0&&(e||n.indexAfter(r)==n.node(r).childCount);)r--,i++,e=!1;if(t){let o=n.node(r).maybeChild(n.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function I1(n,e,t,r,i){let o=n.findDiffStart(e,t);if(o==null)return null;let{a,b:s}=n.findDiffEnd(e,t+n.size,t+e.size);if(i=="end"){let c=Math.max(0,o-Math.min(a,s));r-=a+c-o}if(a<o&&n.size<e.size){let c=r<=o&&r>=a?o-r:0;o-=c,s=o+(s-a),a=o}else if(s<o){let c=r<=o&&r>=s?o-r:0;o-=c,a=o+(a-s),s=o}return{start:o,endA:a,endB:s}}class R1{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new n1,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(xp),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=wp(this),bp(this),this.nodeViews=kp(this),this.docView=Nf(this.state.doc,vp(this),Ml(this),this.dom,this),this.domObserver=new S1(this,(r,i,o,a)=>_1(this,r,i,o,a)),this.domObserver.start(),r1(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&vl(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(xp),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let r in this._props)t[r]=this._props[r];t.state=this.state;for(let r in e)t[r]=e[r];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let r=this.state,i=!1,o=!1;e.storedMarks&&this.composing&&(cp(this),o=!0),this.state=e;let a=r.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let p=kp(this);L1(p,this.nodeViews)&&(this.nodeViews=p,i=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&vl(this),this.editable=wp(this),bp(this);let s=Ml(this),c=vp(this),d=r.plugins!=e.plugins&&!r.doc.eq(e.doc)?"reset":e.scrollToSelection>r.scrollToSelection?"to selection":"preserve",u=i||!this.docView.matchesNode(e.doc,c,s);(u||!e.selection.eq(r.selection))&&(o=!0);let f=d=="preserve"&&o&&this.dom.style.overflowAnchor==null&&yx(this);if(o){this.domObserver.stop();let p=u&&(Mt||dt)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&V1(r.selection,e.selection);if(u){let h=dt?this.trackWrites=this.domSelectionRange().focusNode:null;(i||!this.docView.update(e.doc,c,s,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Nf(e.doc,c,s,this.dom,this)),h&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Hx(this))?Dn(this,p):(zf(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():f&&vx(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof he){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&vf(this,t.getBoundingClientRect(),e)}else vf(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t<this.directPlugins.length;t++){let r=this.directPlugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let r=this.state.plugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let r=this.pluginViews[t];r.update&&r.update(this,e)}}someProp(e,t){let r=this._props&&this._props[e],i;if(r!=null&&(i=t?t(r):r))return i;for(let a=0;a<this.directPlugins.length;a++){let s=this.directPlugins[a].props[e];if(s!=null&&(i=t?t(s):s))return i}let o=this.state.plugins;if(o)for(let a=0;a<o.length;a++){let s=o[a].props[e];if(s!=null&&(i=t?t(s):s))return i}}hasFocus(){if(Mt){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&bx(this.dom),Dn(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let t=this.dom.parentNode;t;t=t.parentNode)if(t.nodeType==9||t.nodeType==11&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Mx(this,e)}coordsAtPos(e,t=1){return Mf(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,r=-1){let i=this.docView.posFromDOM(e,t,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return Ex(this,t||this.state,e)}pasteHTML(e,t){return io(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return io(this,e,null,!0,t||new ClipboardEvent("paste"))}destroy(){this.docView&&(i1(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Ml(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return a1(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return vt&&this.root.nodeType===11&&dx(this.dom.ownerDocument)==this.dom?A1(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function vp(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(n.state)),t)for(let r in t)r=="class"?e.class+=" "+t[r]:r=="style"?e.style=(e.style?e.style+";":"")+t[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(t[r]))}),e.translate||(e.translate="no"),[Ft.node(0,n.state.doc.content.size,e)]}function bp(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:Ft.widget(n.state.selection.head,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function wp(n){return!n.someProp("editable",e=>e(n.state)===!1)}function V1(n,e){let t=Math.min(n.$anchor.sharedDepth(n.head),e.$anchor.sharedDepth(e.head));return n.$anchor.start(t)!=e.$anchor.start(t)}function kp(n){let e=Object.create(null);function t(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function L1(n,e){let t=0,r=0;for(let i in n){if(n[i]!=e[i])return!0;t++}for(let i in e)r++;return t!=r}function xp(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var er={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},da={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},$1=typeof navigator<"u"&&/Mac/.test(navigator.platform),F1=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),at=0;at<10;at++)er[48+at]=er[96+at]=String(at);for(var at=1;at<=24;at++)er[at+111]="F"+at;for(var at=65;at<=90;at++)er[at]=String.fromCharCode(at+32),da[at]=String.fromCharCode(at);for(var Sl in er)da.hasOwnProperty(Sl)||(da[Sl]=er[Sl]);function z1(n){var e=$1&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||F1&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?da:er)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const H1=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function Y1(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,o,a;for(let s=0;s<e.length-1;s++){let c=e[s];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))H1?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+c)}return r&&(t="Alt-"+t),i&&(t="Ctrl-"+t),a&&(t="Meta-"+t),o&&(t="Shift-"+t),t}function U1(n){let e=Object.create(null);for(let t in n)e[Y1(t)]=n[t];return e}function Dl(n,e,t=!0){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t&&e.shiftKey&&(n="Shift-"+n),n}function j1(n){return new Ct({props:{handleKeyDown:Cp(n)}})}function Cp(n){let e=U1(n);return function(t,r){let i=z1(r),o,a=e[Dl(i,r)];if(a&&a(t.state,t.dispatch,t))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let s=e[Dl(i,r,!1)];if(s&&s(t.state,t.dispatch,t))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=er[r.keyCode])&&o!=i){let s=e[Dl(o,r)];if(s&&s(t.state,t.dispatch,t))return!0}}return!1}}const W1=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function q1(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const K1=(n,e,t)=>{let r=q1(n,t);if(!r)return!1;let i=Mp(r);if(!i){let a=r.blockRange(),s=a&&ti(a);return s==null?!1:(e&&e(n.tr.lift(a,s).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&Dp(n,i,e))return!0;if(r.parent.content.size==0&&(pi(o,"end")||he.isSelectable(o))){let a=Qs(n.doc,r.before(),r.after(),ie.empty);if(a&&a.slice.size<a.to-a.from){if(e){let s=n.tr.step(a);s.setSelection(pi(o,"end")?ye.findFrom(s.doc.resolve(s.mapping.map(i.pos,-1)),-1):he.create(s.doc,i.pos-o.nodeSize)),e(s.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1};function pi(n,e,t=!1){for(let r=n;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(t&&r.childCount!=1)return!1}return!1}const G1=(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;o=Mp(r)}let a=o&&o.nodeBefore;return!a||!he.isSelectable(a)?!1:(e&&e(n.tr.setSelection(he.create(n.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)};function Mp(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function Q1(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const J1=(n,e,t)=>{let r=Q1(n,t);if(!r)return!1;let i=Tp(r);if(!i)return!1;let o=i.nodeAfter;if(Dp(n,i,e))return!0;if(r.parent.content.size==0&&(pi(o,"start")||he.isSelectable(o))){let a=Qs(n.doc,r.before(),r.after(),ie.empty);if(a&&a.slice.size<a.to-a.from){if(e){let s=n.tr.step(a);s.setSelection(pi(o,"start")?ye.findFrom(s.doc.resolve(s.mapping.map(i.pos)),1):he.create(s.doc,s.mapping.map(i.pos))),e(s.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},X1=(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset<r.parent.content.size)return!1;o=Tp(r)}let a=o&&o.nodeAfter;return!a||!he.isSelectable(a)?!1:(e&&e(n.tr.setSelection(he.create(n.doc,o.pos)).scrollIntoView()),!0)};function Tp(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){let t=n.node(e);if(n.index(e)+1<t.childCount)return n.doc.resolve(n.after(e+1));if(t.type.spec.isolating)break}return null}const Z1=(n,e)=>{let t=n.selection,r=t instanceof he,i;if(r){if(t.node.isTextblock||!Wn(n.doc,t.from))return!1;i=t.from}else if(i=ea(n.doc,t.from,-1),i==null)return!1;if(e){let o=n.tr.join(i);r&&o.setSelection(he.create(o.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},eC=(n,e)=>{let t=n.selection,r;if(t instanceof he){if(t.node.isTextblock||!Wn(n.doc,t.to))return!1;r=t.to}else if(r=ea(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},tC=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),o=i&&ti(i);return o==null?!1:(e&&e(n.tr.lift(i,o).scrollIntoView()),!0)},nC=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(`
80
+ `).scrollIntoView()),!0)};function Sp(n){for(let e=0;e<n.edgeCount;e++){let{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const rC=(n,e)=>{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let i=t.node(-1),o=t.indexAfter(-1),a=Sp(i.contentMatchAt(o));if(!a||!i.canReplaceWith(o,o,a))return!1;if(e){let s=t.after(),c=n.tr.replaceWith(s,s,a.createAndFill());c.setSelection(ye.near(c.doc.resolve(s),1)),e(c.scrollIntoView())}return!0},iC=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof Jt||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Sp(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,s=n.tr.insert(a,o.createAndFill());s.setSelection(ge.create(s.doc,a+1)),e(s.scrollIntoView())}return!0},oC=(n,e)=>{let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let o=t.before();if(ni(n.doc,o))return e&&e(n.tr.split(o).scrollIntoView()),!0}let r=t.blockRange(),i=r&&ti(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)},aC=(n,e)=>{let{$from:t,to:r}=n.selection,i,o=t.sharedDepth(r);return o==0?!1:(i=t.before(o),e&&e(n.tr.setSelection(he.create(n.doc,i))),!0)};function sC(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||Wn(n.doc,e.pos))?!1:(t&&t(n.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function Dp(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o,a;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(sC(n,e,t))return!0;let s=e.parent.canReplace(e.index(),e.index()+1);if(s&&(o=(a=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&a.matchType(o[0]||i.type).validEnd){if(t){let f=e.pos+i.nodeSize,p=K.empty;for(let g=o.length-1;g>=0;g--)p=K.from(o[g].create(null,p));p=K.from(r.copy(p));let h=n.tr.step(new Ze(e.pos-1,f,e.pos,f,new ie(p,1,0),o.length,!0)),m=f+2*o.length;Wn(h.doc,m)&&h.join(m),t(h.scrollIntoView())}return!0}let c=ye.findFrom(e,1),d=c&&c.$from.blockRange(c.$to),u=d&&ti(d);if(u!=null&&u>=e.depth)return t&&t(n.tr.lift(d,u).scrollIntoView()),!0;if(s&&pi(i,"start",!0)&&pi(r,"end")){let f=r,p=[];for(;p.push(f),!f.isTextblock;)f=f.lastChild;let h=i,m=1;for(;!h.isTextblock;h=h.firstChild)m++;if(f.canReplace(f.childCount,f.childCount,h.content)){if(t){let g=K.empty;for(let x=p.length-1;x>=0;x--)g=K.from(p[x].copy(g));let k=n.tr.step(new Ze(e.pos-p.length,e.pos+i.nodeSize,e.pos+m,e.pos+i.nodeSize-m,new ie(g,p.length,0),0,!0));t(k.scrollIntoView())}return!0}}return!1}function Ap(n){return function(e,t){let r=e.selection,i=n<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(t&&t(e.tr.setSelection(ge.create(e.doc,n<0?i.start(o):i.end(o)))),!0):!1}}const lC=Ap(-1),cC=Ap(1);function dC(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,a=i.blockRange(o),s=a&&Gs(a,n,e);return s?(r&&r(t.tr.wrap(a,s).scrollIntoView()),!0):!1}}function Ep(n,e=null){return function(t,r){let i=!1;for(let o=0;o<t.selection.ranges.length&&!i;o++){let{$from:{pos:a},$to:{pos:s}}=t.selection.ranges[o];t.doc.nodesBetween(a,s,(c,d)=>{if(i)return!1;if(!(!c.isTextblock||c.hasMarkup(n,e)))if(c.type==n)i=!0;else{let u=t.doc.resolve(d),f=u.index();i=u.parent.canReplaceWith(f,f+1,n)}})}if(!i)return!1;if(r){let o=t.tr;for(let a=0;a<t.selection.ranges.length;a++){let{$from:{pos:s},$to:{pos:c}}=t.selection.ranges[a];o.setBlockType(s,c,n,e)}r(o.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function uC(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,a=i.blockRange(o),s=!1,c=a;if(!a)return!1;if(a.depth>=2&&i.node(a.depth-1).type.compatibleContent(n)&&a.startIndex==0){if(i.index(a.depth-1)==0)return!1;let u=t.doc.resolve(a.start-2);c=new qo(u,u,a.depth),a.endIndex<a.parent.childCount&&(a=new qo(i,t.doc.resolve(o.end(a.depth)),a.depth)),s=!0}let d=Gs(c,n,e,a);return d?(r&&r(fC(t.tr,a,d,s,n).scrollIntoView()),!0):!1}}function fC(n,e,t,r,i){let o=K.empty;for(let u=t.length-1;u>=0;u--)o=K.from(t[u].type.create(t[u].attrs,o));n.step(new Ze(e.start-(r?2:0),e.end,e.start,e.end,new ie(o,0,0),t.length,!0));let a=0;for(let u=0;u<t.length;u++)t[u].type==i&&(a=u+1);let s=t.length-a,c=e.start+t.length-(r?2:0),d=e.parent;for(let u=e.startIndex,f=e.endIndex,p=!0;u<f;u++,p=!1)!p&&ni(n.doc,c,s)&&(n.split(c,s),c+=2*s),c+=d.child(u).nodeSize;return n}function pC(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,a=>a.childCount>0&&a.firstChild.type==n);return o?t?r.node(o.depth-1).type==n?hC(e,t,n,o):mC(e,t,o):!0:!1}}function hC(n,e,t,r){let i=n.tr,o=r.end,a=r.$to.end(r.depth);o<a&&(i.step(new Ze(o-1,a,o,a,new ie(K.from(t.create(null,r.parent.copy())),1,0),1,!0)),r=new qo(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const s=ti(r);if(s==null)return!1;i.lift(r,s);let c=i.mapping.map(o,-1)-1;return Wn(i.doc,c)&&i.join(c),e(i.scrollIntoView()),!0}function mC(n,e,t){let r=n.tr,i=t.parent;for(let h=t.end,m=t.endIndex-1,g=t.startIndex;m>g;m--)h-=i.child(m).nodeSize,r.delete(h-1,h+1);let o=r.doc.resolve(t.start),a=o.nodeAfter;if(r.mapping.map(t.end)!=t.start+o.nodeAfter.nodeSize)return!1;let s=t.startIndex==0,c=t.endIndex==i.childCount,d=o.node(-1),u=o.index(-1);if(!d.canReplace(u+(s?0:1),u+1,a.content.append(c?K.empty:K.from(i))))return!1;let f=o.pos,p=f+a.nodeSize;return r.step(new Ze(f-(s?1:0),p+(c?1:0),f+1,p-1,new ie((s?K.empty:K.from(i.copy(K.empty))).append(c?K.empty:K.from(i.copy(K.empty))),s?0:1,c?0:1),s?0:1)),e(r.scrollIntoView()),!0}function gC(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,d=>d.childCount>0&&d.firstChild.type==n);if(!o)return!1;let a=o.startIndex;if(a==0)return!1;let s=o.parent,c=s.child(a-1);if(c.type!=n)return!1;if(t){let d=c.lastChild&&c.lastChild.type==s.type,u=K.from(d?n.create():null),f=new ie(K.from(n.create(null,K.from(s.type.create(null,u)))),d?3:1,0),p=o.start,h=o.end;t(e.tr.step(new Ze(p-(d?3:1),h,p,h,f,1,!0)).scrollIntoView())}return!0}}function ua(n){const{state:e,transaction:t}=n;let{selection:r}=t,{doc:i}=t,{storedMarks:o}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=t.selection,i=t.doc,o=t.storedMarks,t}}}class fa{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:r}=this,{view:i}=t,{tr:o}=r,a=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([s,c])=>[s,(...u)=>{const f=c(...u)(a);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,s=[],c=!!e,d=e||o.tr,u=()=>(!c&&t&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(d),s.every(p=>p===!0)),f={...Object.fromEntries(Object.entries(r).map(([p,h])=>[p,(...g)=>{const k=this.buildProps(d,t),x=h(...g)(k);return s.push(x),f}])),run:u};return f}createCan(e){const{rawCommands:t,state:r}=this,i=!1,o=e||r.tr,a=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(t).map(([c,d])=>[c,(...u)=>d(...u)({...a,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,s={tr:e,editor:i,view:a,state:ua({state:o,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([c,d])=>[c,(...u)=>d(...u)(s)]))}};return s}}class yC{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,t)),this}off(e,t){const r=this.callbacks[e];return r&&(t?this.callbacks[e]=r.filter(i=>i!==t):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function le(n,e,t){return n.config[e]===void 0&&n.parent?le(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?le(n.parent,e,t):null}):n.config[e]}function pa(n){const e=n.filter(i=>i.type==="extension"),t=n.filter(i=>i.type==="node"),r=n.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:r}}function Op(n){const e=[],{nodeExtensions:t,markExtensions:r}=pa(n),i=[...t,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return n.forEach(a=>{const s={name:a.name,options:a.options,storage:a.storage},c=le(a,"addGlobalAttributes",s);if(!c)return;c().forEach(u=>{u.types.forEach(f=>{Object.entries(u.attributes).forEach(([p,h])=>{e.push({type:f,name:p,attribute:{...o,...h}})})})})}),i.forEach(a=>{const s={name:a.name,options:a.options,storage:a.storage},c=le(a,"addAttributes",s);if(!c)return;const d=c();Object.entries(d).forEach(([u,f])=>{const p={...o,...f};typeof(p==null?void 0:p.default)=="function"&&(p.default=p.default()),p!=null&&p.isRequired&&(p==null?void 0:p.default)===void 0&&delete p.default,e.push({type:a.name,name:u,attribute:p})})}),e}function et(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}function We(...n){return n.filter(e=>!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const s=o?o.split(" "):[],c=r[i]?r[i].split(" "):[],d=s.filter(u=>!c.includes(u));r[i]=[...c,...d].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function Al(n,e){return e.filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>We(t,r),{})}function Np(n){return typeof n=="function"}function ve(n,e=void 0,...t){return Np(n)?e?n.bind(e)(...t):n(...t):n}function vC(n={}){return Object.keys(n).length===0&&n.constructor===Object}function bC(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function _p(n,e){return n.style?n:{...n,getAttrs:t=>{const r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;const i=e.reduce((o,a)=>{const s=a.attribute.parseHTML?a.attribute.parseHTML(t):bC(t.getAttribute(a.name));return s==null?o:{...o,[a.name]:s}},{});return{...r,...i}}}}function Bp(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&vC(t)?!1:t!=null))}function wC(n,e){var t;const r=Op(n),{nodeExtensions:i,markExtensions:o}=pa(n),a=(t=i.find(d=>le(d,"topNode")))===null||t===void 0?void 0:t.name,s=Object.fromEntries(i.map(d=>{const u=r.filter(x=>x.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:e},p=n.reduce((x,S)=>{const T=le(S,"extendNodeSchema",f);return{...x,...T?T(d):{}}},{}),h=Bp({...p,content:ve(le(d,"content",f)),marks:ve(le(d,"marks",f)),group:ve(le(d,"group",f)),inline:ve(le(d,"inline",f)),atom:ve(le(d,"atom",f)),selectable:ve(le(d,"selectable",f)),draggable:ve(le(d,"draggable",f)),code:ve(le(d,"code",f)),defining:ve(le(d,"defining",f)),isolating:ve(le(d,"isolating",f)),attrs:Object.fromEntries(u.map(x=>{var S;return[x.name,{default:(S=x==null?void 0:x.attribute)===null||S===void 0?void 0:S.default}]}))}),m=ve(le(d,"parseHTML",f));m&&(h.parseDOM=m.map(x=>_p(x,u)));const g=le(d,"renderHTML",f);g&&(h.toDOM=x=>g({node:x,HTMLAttributes:Al(x,u)}));const k=le(d,"renderText",f);return k&&(h.toText=k),[d.name,h]})),c=Object.fromEntries(o.map(d=>{const u=r.filter(k=>k.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:e},p=n.reduce((k,x)=>{const S=le(x,"extendMarkSchema",f);return{...k,...S?S(d):{}}},{}),h=Bp({...p,inclusive:ve(le(d,"inclusive",f)),excludes:ve(le(d,"excludes",f)),group:ve(le(d,"group",f)),spanning:ve(le(d,"spanning",f)),code:ve(le(d,"code",f)),attrs:Object.fromEntries(u.map(k=>{var x;return[k.name,{default:(x=k==null?void 0:k.attribute)===null||x===void 0?void 0:x.default}]}))}),m=ve(le(d,"parseHTML",f));m&&(h.parseDOM=m.map(k=>_p(k,u)));const g=le(d,"renderHTML",f);return g&&(h.toDOM=k=>g({mark:k,HTMLAttributes:Al(k,u)})),[d.name,h]}));return new Ak({topNode:a,nodes:s,marks:c})}function El(n,e){return e.nodes[n]||e.marks[n]||null}function Pp(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}const kC=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(i,o,a,s)=>{var c,d;const u=((d=(c=i.type.spec).toText)===null||d===void 0?void 0:d.call(c,{node:i,pos:o,parent:a,index:s}))||i.textContent||"%leaf%";t+=u.slice(0,Math.max(0,r-o))}),t};function Ol(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class ha{constructor(e){this.find=e.find,this.handler=e.handler}}const xC=(n,e)=>{if(Ol(e))return e.exec(n);const t=e(n);if(!t)return null;const r=[t.text];return r.index=t.index,r.input=n,r.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(t.replaceWith)),r};function Nl(n){var e;const{editor:t,from:r,to:i,text:o,rules:a,plugin:s}=n,{view:c}=t;if(c.composing)return!1;const d=c.state.doc.resolve(r);if(d.parent.type.spec.code||!((e=d.nodeBefore||d.nodeAfter)===null||e===void 0)&&e.marks.find(p=>p.type.spec.code))return!1;let u=!1;const f=kC(d)+o;return a.forEach(p=>{if(u)return;const h=xC(f,p.find);if(!h)return;const m=c.state.tr,g=ua({state:c.state,transaction:m}),k={from:r-(h[0].length-o.length),to:i},{commands:x,chain:S,can:T}=new fa({editor:t,state:g});p.handler({state:g,range:k,match:h,commands:x,chain:S,can:T})===null||!m.steps.length||(m.setMeta(s,{transform:m,from:r,to:i,text:o}),c.dispatch(m),u=!0)}),u}function CC(n){const{editor:e,rules:t}=n,r=new Ct({state:{init(){return null},apply(i,o){const a=i.getMeta(r);return a||(i.selectionSet||i.docChanged?null:o)}},props:{handleTextInput(i,o,a,s){return Nl({editor:e,from:o,to:a,text:s,rules:t,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Nl({editor:e,from:o.pos,to:o.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:a}=i.state.selection;return a?Nl({editor:e,from:a.pos,to:a.pos,text:`
81
+ `,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function MC(n){return typeof n=="number"}class TC{constructor(e){this.find=e.find,this.handler=e.handler}}const SC=(n,e)=>{if(Ol(e))return[...n.matchAll(e)];const t=e(n);return t?t.map(r=>{const i=[r.text];return i.index=r.index,i.input=n,i.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(r.replaceWith)),i}):[]};function DC(n){const{editor:e,state:t,from:r,to:i,rule:o,pasteEvent:a,dropEvent:s}=n,{commands:c,chain:d,can:u}=new fa({editor:e,state:t}),f=[];return t.doc.nodesBetween(r,i,(h,m)=>{if(!h.isTextblock||h.type.spec.code)return;const g=Math.max(r,m),k=Math.min(i,m+h.content.size),x=h.textBetween(g-m,k-m,void 0,"");SC(x,o.find).forEach(T=>{if(T.index===void 0)return;const y=g+T.index+1,B=y+T[0].length,w={from:t.tr.mapping.map(y),to:t.tr.mapping.map(B)},V=o.handler({state:t,range:w,match:T,commands:c,chain:d,can:u,pasteEvent:a,dropEvent:s});f.push(V)})}),f.every(h=>h!==null)}function AC(n){const{editor:e,rules:t}=n;let r=null,i=!1,o=!1,a=new ClipboardEvent("paste"),s=new DragEvent("drop");return t.map(d=>new Ct({view(u){const f=p=>{var h;r=!((h=u.dom.parentElement)===null||h===void 0)&&h.contains(p.target)?u.dom.parentElement:null};return window.addEventListener("dragstart",f),{destroy(){window.removeEventListener("dragstart",f)}}},props:{handleDOMEvents:{drop:(u,f)=>(o=r===u.dom.parentElement,s=f,!1),paste:(u,f)=>{var p;const h=(p=f.clipboardData)===null||p===void 0?void 0:p.getData("text/html");return a=f,i=!!(h!=null&&h.includes("data-pm-slice")),!1}}},appendTransaction:(u,f,p)=>{const h=u[0],m=h.getMeta("uiEvent")==="paste"&&!i,g=h.getMeta("uiEvent")==="drop"&&!o;if(!m&&!g)return;const k=f.doc.content.findDiffStart(p.doc.content),x=f.doc.content.findDiffEnd(p.doc.content);if(!MC(k)||!x||k===x.b)return;const S=p.tr,T=ua({state:p,transaction:S});if(!(!DC({editor:e,state:T,from:Math.max(k-1,0),to:x.b-1,rule:d,pasteEvent:a,dropEvent:s})||!S.steps.length))return s=new DragEvent("drop"),a=new ClipboardEvent("paste"),S}}))}function EC(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return[...new Set(e)]}class hi{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=hi.resolve(e),this.schema=wC(this.extensions,t),this.extensions.forEach(r=>{var i;this.editor.extensionStorage[r.name]=r.storage;const o={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:El(r.name,this.schema)};r.type==="mark"&&(!((i=ve(le(r,"keepOnSplit",o)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(r.name);const a=le(r,"onBeforeCreate",o);a&&this.editor.on("beforeCreate",a);const s=le(r,"onCreate",o);s&&this.editor.on("create",s);const c=le(r,"onUpdate",o);c&&this.editor.on("update",c);const d=le(r,"onSelectionUpdate",o);d&&this.editor.on("selectionUpdate",d);const u=le(r,"onTransaction",o);u&&this.editor.on("transaction",u);const f=le(r,"onFocus",o);f&&this.editor.on("focus",f);const p=le(r,"onBlur",o);p&&this.editor.on("blur",p);const h=le(r,"onDestroy",o);h&&this.editor.on("destroy",h)})}static resolve(e){const t=hi.sort(hi.flatten(e)),r=EC(t.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),t}static flatten(e){return e.map(t=>{const r={name:t.name,options:t.options,storage:t.storage},i=le(t,"addExtensions",r);return i?[t,...this.flatten(i())]:t}).flat(10)}static sort(e){return e.sort((r,i)=>{const o=le(r,"priority")||100,a=le(i,"priority")||100;return o>a?-1:o<a?1:0})}get commands(){return this.extensions.reduce((e,t)=>{const r={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:El(t.name,this.schema)},i=le(t,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,t=hi.sort([...this.extensions].reverse()),r=[],i=[],o=t.map(a=>{const s={name:a.name,options:a.options,storage:a.storage,editor:e,type:El(a.name,this.schema)},c=[],d=le(a,"addKeyboardShortcuts",s);let u={};if(a.type==="mark"&&a.config.exitable&&(u.ArrowRight=()=>en.handleExit({editor:e,mark:a})),d){const g=Object.fromEntries(Object.entries(d()).map(([k,x])=>[k,()=>x({editor:e})]));u={...u,...g}}const f=j1(u);c.push(f);const p=le(a,"addInputRules",s);Pp(a,e.options.enableInputRules)&&p&&r.push(...p());const h=le(a,"addPasteRules",s);Pp(a,e.options.enablePasteRules)&&h&&i.push(...h());const m=le(a,"addProseMirrorPlugins",s);if(m){const g=m();c.push(...g)}return c}).flat();return[CC({editor:e,rules:r}),...AC({editor:e,rules:i}),...o]}get attributes(){return Op(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=pa(this.extensions);return Object.fromEntries(t.filter(r=>!!le(r,"addNodeView")).map(r=>{const i=this.attributes.filter(c=>c.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:et(r.name,this.schema)},a=le(r,"addNodeView",o);if(!a)return[];const s=(c,d,u,f)=>{const p=Al(c,i);return a()({editor:e,node:c,getPos:u,decorations:f,HTMLAttributes:p,extension:r})};return[r.name,s]}))}}function OC(n){return Object.prototype.toString.call(n).slice(8,-1)}function _l(n){return OC(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function ma(n,e){const t={...n};return _l(n)&&_l(e)&&Object.keys(e).forEach(r=>{_l(e[r])?r in n?t[r]=ma(n[r],e[r]):Object.assign(t,{[r]:e[r]}):Object.assign(t,{[r]:e[r]})}),t}class ft{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ve(le(this,"addOptions",{name:this.name}))),this.storage=ve(le(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new ft(e)}configure(e={}){const t=this.extend();return t.options=ma(this.options,e),t.storage=ve(le(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new ft(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=ve(le(t,"addOptions",{name:t.name})),t.storage=ve(le(t,"addStorage",{name:t.name,options:t.options})),t}}function Ip(n,e,t){const{from:r,to:i}=e,{blockSeparator:o=`
82
+
83
+ `,textSerializers:a={}}=t||{};let s="",c=!0;return n.nodesBetween(r,i,(d,u,f,p)=>{var h;const m=a==null?void 0:a[d.type.name];m?(d.isBlock&&!c&&(s+=o,c=!0),f&&(s+=m({node:d,pos:u,parent:f,index:p,range:e}))):d.isText?(s+=(h=d==null?void 0:d.text)===null||h===void 0?void 0:h.slice(Math.max(r,u)-u,i-u),c=!1):d.isBlock&&!c&&(s+=o,c=!0)}),s}function Rp(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}const NC=ft.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Ct({key:new hn("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:i}=e,{ranges:o}=i,a=Math.min(...o.map(u=>u.$from.pos)),s=Math.max(...o.map(u=>u.$to.pos)),c=Rp(t);return Ip(r,{from:a,to:s},{textSerializers:c})}}})]}}),_C=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window==null?void 0:window.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),BC=(n=!1)=>({commands:e})=>e.setContent("",n),PC=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:i}=r;return t&&i.forEach(({$from:o,$to:a})=>{n.doc.nodesBetween(o.pos,a.pos,(s,c)=>{if(s.type.isText)return;const{doc:d,mapping:u}=e,f=d.resolve(u.map(c)),p=d.resolve(u.map(c+s.nodeSize)),h=f.blockRange(p);if(!h)return;const m=ti(h);if(s.type.isTextblock){const{defaultType:g}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(h.start,g)}(m||m===0)&&e.lift(h,m)})}),!0},IC=n=>e=>n(e),RC=()=>({state:n,dispatch:e})=>iC(n,e),VC=(n,e)=>({editor:t,tr:r})=>{const{state:i}=t,o=i.doc.slice(n.from,n.to);r.deleteRange(n.from,n.to);const a=r.mapping.map(e);return r.insert(a,o.content),r.setSelection(new ge(r.doc.resolve(a-1))),!0},LC=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,r=t.$anchor.node();if(r.content.size>0)return!1;const i=n.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const s=i.before(o),c=i.after(o);n.delete(s,c).scrollIntoView()}return!0}return!1},$C=n=>({tr:e,state:t,dispatch:r})=>{const i=et(n,t.schema),o=e.selection.$anchor;for(let a=o.depth;a>0;a-=1)if(o.node(a).type===i){if(r){const c=o.before(a),d=o.after(a);e.delete(c,d).scrollIntoView()}return!0}return!1},FC=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},zC=()=>({state:n,dispatch:e})=>W1(n,e),HC=()=>({commands:n})=>n.keyboardShortcut("Enter"),YC=()=>({state:n,dispatch:e})=>rC(n,e);function ga(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:Ol(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function Bl(n,e,t={}){return n.find(r=>r.type===e&&ga(r.attrs,t))}function UC(n,e,t={}){return!!Bl(n,e,t)}function Pl(n,e,t={}){if(!n||!e)return;let r=n.parent.childAfter(n.parentOffset);if(n.parentOffset===r.offset&&r.offset!==0&&(r=n.parent.childBefore(n.parentOffset)),!r.node)return;const i=Bl([...r.node.marks],e,t);if(!i)return;let o=r.index,a=n.start()+r.offset,s=o+1,c=a+r.node.nodeSize;for(Bl([...r.node.marks],e,t);o>0&&i.isInSet(n.parent.child(o-1).marks);)o-=1,a-=n.parent.child(o).nodeSize;for(;s<n.parent.childCount&&UC([...n.parent.child(s).marks],e,t);)c+=n.parent.child(s).nodeSize,s+=1;return{from:a,to:c}}function tr(n,e){if(typeof n=="string"){if(!e.marks[n])throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);return e.marks[n]}return n}const jC=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const o=tr(n,r.schema),{doc:a,selection:s}=t,{$from:c,from:d,to:u}=s;if(i){const f=Pl(c,o,e);if(f&&f.from<=d&&f.to>=u){const p=ge.create(a,f.from,f.to);t.setSelection(p)}}return!0},WC=n=>e=>{const t=typeof n=="function"?n(e):n;for(let r=0;r<t.length;r+=1)if(t[r](e))return!0;return!1};function Il(n){return n instanceof ge}function An(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function Vp(n,e=null){if(!e)return null;const t=ye.atStart(n),r=ye.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return r;const i=t.from,o=r.to;return e==="all"?ge.create(n,An(0,i,o),An(n.content.size,i,o)):ge.create(n,An(e,i,o),An(e,i,o))}function Rl(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const qC=(n=null,e={})=>({editor:t,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const a=()=>{Rl()&&r.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&t.commands.scrollIntoView())})};if(r.hasFocus()&&n===null||n===!1)return!0;if(o&&n===null&&!Il(t.state.selection))return a(),!0;const s=Vp(i.doc,n)||t.state.selection,c=t.state.selection.eq(s);return o&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},KC=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),GC=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e);function Lp(n){const e=`<body>${n}</body>`;return new window.DOMParser().parseFromString(e,"text/html").body}function ya(n,e,t){if(t={slice:!0,parseOptions:{},...t},typeof n=="object"&&n!==null)try{return Array.isArray(n)&&n.length>0?K.fromArray(n.map(r=>e.nodeFromJSON(r))):e.nodeFromJSON(n)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",r),ya("",e,t)}if(typeof n=="string"){const r=Xr.fromSchema(e);return t.slice?r.parseSlice(Lp(n),t.parseOptions).content:r.parse(Lp(n),t.parseOptions)}return ya("",e,t)}function QC(n,e,t){const r=n.steps.length-1;if(r<e)return;const i=n.steps[r];if(!(i instanceof ot||i instanceof Ze))return;const o=n.mapping.maps[r];let a=0;o.forEach((s,c,d,u)=>{a===0&&(a=u)}),n.setSelection(ye.near(n.doc.resolve(a),t))}const JC=n=>n.toString().startsWith("<"),XC=(n,e,t)=>({tr:r,dispatch:i,editor:o})=>{if(i){t={parseOptions:{},updateSelection:!0,...t};const a=ya(e,o.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions}});if(a.toString()==="<>")return!0;let{from:s,to:c}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},d=!0,u=!0;if((JC(a)?a:[a]).forEach(p=>{p.check(),d=d?p.isText&&p.marks.length===0:!1,u=u?p.isBlock:!1}),s===c&&u){const{parent:p}=r.doc.resolve(s);p.isTextblock&&!p.type.spec.code&&!p.childCount&&(s-=1,c+=1)}d?Array.isArray(e)?r.insertText(e.map(p=>p.text||"").join(""),s,c):typeof e=="object"&&e&&e.text?r.insertText(e.text,s,c):r.insertText(e,s,c):r.replaceWith(s,c,a),t.updateSelection&&QC(r,r.steps.length-1,-1)}return!0},ZC=()=>({state:n,dispatch:e})=>Z1(n,e),eM=()=>({state:n,dispatch:e})=>eC(n,e),tM=()=>({state:n,dispatch:e})=>K1(n,e),nM=()=>({state:n,dispatch:e})=>J1(n,e),rM=()=>({tr:n,state:e,dispatch:t})=>{try{const r=ea(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},iM=()=>({state:n,dispatch:e,tr:t})=>{try{const r=ea(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}};function Vl(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function oM(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,i,o,a;for(let s=0;s<e.length-1;s+=1){const c=e[s];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))Rl()||Vl()?a=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return r&&(t=`Alt-${t}`),i&&(t=`Ctrl-${t}`),a&&(t=`Meta-${t}`),o&&(t=`Shift-${t}`),t}const aM=n=>({editor:e,view:t,tr:r,dispatch:i})=>{const o=oM(n).split(/-(?!$)/),a=o.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),s=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{t.someProp("handleKeyDown",d=>d(t,s))});return c==null||c.steps.forEach(d=>{const u=d.map(r.mapping);u&&i&&r.maybeStep(u)}),!0};function ao(n,e,t={}){const{from:r,to:i,empty:o}=n.selection,a=e?et(e,n.schema):null,s=[];n.doc.nodesBetween(r,i,(f,p)=>{if(f.isText)return;const h=Math.max(r,p),m=Math.min(i,p+f.nodeSize);s.push({node:f,from:h,to:m})});const c=i-r,d=s.filter(f=>a?a.name===f.node.type.name:!0).filter(f=>ga(f.node.attrs,t,{strict:!1}));return o?!!d.length:d.reduce((f,p)=>f+p.to-p.from,0)>=c}const sM=(n,e={})=>({state:t,dispatch:r})=>{const i=et(n,t.schema);return ao(t,i,e)?tC(t,r):!1},lM=()=>({state:n,dispatch:e})=>oC(n,e),cM=n=>({state:e,dispatch:t})=>{const r=et(n,e.schema);return pC(r)(e,t)},dM=()=>({state:n,dispatch:e})=>nC(n,e);function va(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function $p(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((r,i)=>(t.includes(i)||(r[i]=n[i]),r),{})}const uM=(n,e)=>({tr:t,state:r,dispatch:i})=>{let o=null,a=null;const s=va(typeof n=="string"?n:n.name,r.schema);return s?(s==="node"&&(o=et(n,r.schema)),s==="mark"&&(a=tr(n,r.schema)),i&&t.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(d,u)=>{o&&o===d.type&&t.setNodeMarkup(u,void 0,$p(d.attrs,e)),a&&d.marks.length&&d.marks.forEach(f=>{a===f.type&&t.addMark(u,u+d.nodeSize,a.create($p(f.attrs,e)))})})}),!0):!1},fM=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),pM=()=>({tr:n,commands:e})=>e.setTextSelection({from:0,to:n.doc.content.size}),hM=()=>({state:n,dispatch:e})=>G1(n,e),mM=()=>({state:n,dispatch:e})=>X1(n,e),gM=()=>({state:n,dispatch:e})=>aC(n,e),yM=()=>({state:n,dispatch:e})=>cC(n,e),vM=()=>({state:n,dispatch:e})=>lC(n,e);function Fp(n,e,t={}){return ya(n,e,{slice:!1,parseOptions:t})}const bM=(n,e=!1,t={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:a}=r,s=Fp(n,i.schema,t);return o&&r.replaceWith(0,a.content.size,s).setMeta("preventUpdate",!e),!0};function ba(n,e){const t=tr(e,n.schema),{from:r,to:i,empty:o}=n.selection,a=[];o?(n.storedMarks&&a.push(...n.storedMarks),a.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,i,c=>{a.push(...c.marks)});const s=a.find(c=>c.type.name===t.name);return s?{...s.attrs}:{}}function wM(n){for(let e=0;e<n.edgeCount;e+=1){const{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}function kM(n,e){for(let t=n.depth;t>0;t-=1){const r=n.node(t);if(e(r))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:r}}}function Ll(n){return e=>kM(e.$from,n)}function xM(n,e){const t=fn.fromSchema(e).serializeFragment(n),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(t),i.innerHTML}function CM(n,e){const t={from:0,to:n.content.size};return Ip(n,t,e)}function MM(n,e){const t=et(e,n.schema),{from:r,to:i}=n.selection,o=[];n.doc.nodesBetween(r,i,s=>{o.push(s)});const a=o.reverse().find(s=>s.type.name===t.name);return a?{...a.attrs}:{}}function TM(n,e){const t=va(typeof e=="string"?e:e.name,n.schema);return t==="node"?MM(n,e):t==="mark"?ba(n,e):{}}function zp(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(i=>{const o=t.resolve(n-1),a=Pl(o,i.type);a&&r.push({mark:i,...a})}):t.nodesBetween(n,e,(i,o)=>{r.push(...i.marks.map(a=>({from:o,to:o+i.nodeSize,mark:a})))}),r}function wa(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{const i=n.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function $l(n,e,t={}){const{empty:r,ranges:i}=n.selection,o=e?tr(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>ga(f.attrs,t,{strict:!1}));let a=0;const s=[];if(i.forEach(({$from:f,$to:p})=>{const h=f.pos,m=p.pos;n.doc.nodesBetween(h,m,(g,k)=>{if(!g.isText&&!g.marks.length)return;const x=Math.max(h,k),S=Math.min(m,k+g.nodeSize),T=S-x;a+=T,s.push(...g.marks.map(y=>({mark:y,from:x,to:S})))})}),a===0)return!1;const c=s.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>ga(f.mark.attrs,t,{strict:!1})).reduce((f,p)=>f+p.to-p.from,0),d=s.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,p)=>f+p.to-p.from,0);return(c>0?c+d:c)>=a}function SM(n,e,t={}){if(!e)return ao(n,null,t)||$l(n,null,t);const r=va(e,n.schema);return r==="node"?ao(n,e,t):r==="mark"?$l(n,e,t):!1}function Hp(n,e){const{nodeExtensions:t}=pa(e),r=t.find(a=>a.name===n);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=ve(le(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function DM(n){var e;const t=(e=n.type.createAndFill())===null||e===void 0?void 0:e.toJSON(),r=n.toJSON();return JSON.stringify(t)===JSON.stringify(r)}function AM(n){return n instanceof he}function Yp(n,e,t){const i=n.state.doc.content.size,o=An(e,0,i),a=An(t,0,i),s=n.coordsAtPos(o),c=n.coordsAtPos(a,-1),d=Math.min(s.top,c.top),u=Math.max(s.bottom,c.bottom),f=Math.min(s.left,c.left),p=Math.max(s.right,c.right),h=p-f,m=u-d,x={top:d,bottom:u,left:f,right:p,width:h,height:m,x:f,y:d};return{...x,toJSON:()=>x}}function EM(n,e,t){var r;const{selection:i}=e;let o=null;if(Il(i)&&(o=i.$cursor),o){const s=(r=n.storedMarks)!==null&&r!==void 0?r:o.marks();return!!t.isInSet(s)||!s.some(c=>c.type.excludes(t))}const{ranges:a}=i;return a.some(({$from:s,$to:c})=>{let d=s.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(s.pos,c.pos,(u,f,p)=>{if(d)return!1;if(u.isInline){const h=!p||p.type.allowsMarkType(t),m=!!t.isInSet(u.marks)||!u.marks.some(g=>g.type.excludes(t));d=h&&m}return!d}),d})}const OM=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{selection:o}=t,{empty:a,ranges:s}=o,c=tr(n,r.schema);if(i)if(a){const d=ba(r,c);t.addStoredMark(c.create({...d,...e}))}else s.forEach(d=>{const u=d.$from.pos,f=d.$to.pos;r.doc.nodesBetween(u,f,(p,h)=>{const m=Math.max(h,u),g=Math.min(h+p.nodeSize,f);p.marks.find(x=>x.type===c)?p.marks.forEach(x=>{c===x.type&&t.addMark(m,g,c.create({...x.attrs,...e}))}):t.addMark(m,g,c.create(e))})});return EM(r,t,c)},NM=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),_M=(n,e={})=>({state:t,dispatch:r,chain:i})=>{const o=et(n,t.schema);return o.isTextblock?i().command(({commands:a})=>Ep(o,e)(t)?!0:a.clearNodes()).command(({state:a})=>Ep(o,e)(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},BM=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,i=An(n,0,r.content.size),o=he.create(r,i);e.setSelection(o)}return!0},PM=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:i,to:o}=typeof n=="number"?{from:n,to:n}:n,a=ge.atStart(r).from,s=ge.atEnd(r).to,c=An(i,a,s),d=An(o,a,s),u=ge.create(r,c,d);e.setSelection(u)}return!0},IM=n=>({state:e,dispatch:t})=>{const r=et(n,e.schema);return gC(r)(e,t)};function Up(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const r=t.filter(i=>e==null?void 0:e.includes(i.type.name));n.tr.ensureMarks(r)}}const RM=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{const{selection:o,doc:a}=e,{$from:s,$to:c}=o,d=i.extensionManager.attributes,u=wa(d,s.node().type.name,s.node().attrs);if(o instanceof he&&o.node.isBlock)return!s.parentOffset||!ni(a,s.pos)?!1:(r&&(n&&Up(t,i.extensionManager.splittableMarks),e.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;if(r){const f=c.parentOffset===c.parent.content.size;o instanceof ge&&e.deleteSelection();const p=s.depth===0?void 0:wM(s.node(-1).contentMatchAt(s.indexAfter(-1)));let h=f&&p?[{type:p,attrs:u}]:void 0,m=ni(e.doc,e.mapping.map(s.pos),1,h);if(!h&&!m&&ni(e.doc,e.mapping.map(s.pos),1,p?[{type:p}]:void 0)&&(m=!0,h=p?[{type:p,attrs:u}]:void 0),m&&(e.split(e.mapping.map(s.pos),1,h),p&&!f&&!s.parentOffset&&s.parent.type!==p)){const g=e.mapping.map(s.before()),k=e.doc.resolve(g);s.node(-1).canReplaceWith(k.index(),k.index()+1,p)&&e.setNodeMarkup(e.mapping.map(s.before()),p)}n&&Up(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},VM=n=>({tr:e,state:t,dispatch:r,editor:i})=>{var o;const a=et(n,t.schema),{$from:s,$to:c}=t.selection,d=t.selection.node;if(d&&d.isBlock||s.depth<2||!s.sameParent(c))return!1;const u=s.node(-1);if(u.type!==a)return!1;const f=i.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==a||s.index(-2)!==s.node(-2).childCount-1)return!1;if(r){let k=K.empty;const x=s.index(-1)?1:s.index(-2)?2:3;for(let V=s.depth-x;V>=s.depth-3;V-=1)k=K.from(s.node(V).copy(k));const S=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,T=wa(f,s.node().type.name,s.node().attrs),y=((o=a.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(T))||void 0;k=k.append(K.from(a.createAndFill(null,y)||void 0));const B=s.before(s.depth-(x-1));e.replace(B,s.after(-S),new ie(k,4-x,0));let w=-1;e.doc.nodesBetween(B,e.doc.content.size,(V,$)=>{if(w>-1)return!1;V.isTextblock&&V.content.size===0&&(w=$+1)}),w>-1&&e.setSelection(ge.near(e.doc.resolve(w))),e.scrollIntoView()}return!0}const p=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,h=wa(f,u.type.name,u.attrs),m=wa(f,s.node().type.name,s.node().attrs);e.delete(s.pos,c.pos);const g=p?[{type:a,attrs:h},{type:p,attrs:m}]:[{type:a,attrs:h}];if(!ni(e.doc,s.pos,2))return!1;if(r){const{selection:k,storedMarks:x}=t,{splittableMarks:S}=i.extensionManager,T=x||k.$to.parentOffset&&k.$from.marks();if(e.split(s.pos,2,g).scrollIntoView(),!T||!r)return!0;const y=T.filter(B=>S.includes(B.type.name));e.ensureMarks(y)}return!0},Fl=(n,e)=>{const t=Ll(a=>a.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===(i==null?void 0:i.type)&&Wn(n.doc,t.pos)&&n.join(t.pos),!0},zl=(n,e)=>{const t=Ll(a=>a.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(t.start).after(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===(i==null?void 0:i.type)&&Wn(n.doc,r)&&n.join(r),!0};var LM=Object.freeze({__proto__:null,blur:_C,clearContent:BC,clearNodes:PC,command:IC,createParagraphNear:RC,cut:VC,deleteCurrentNode:LC,deleteNode:$C,deleteRange:FC,deleteSelection:zC,enter:HC,exitCode:YC,extendMarkRange:jC,first:WC,focus:qC,forEach:KC,insertContent:GC,insertContentAt:XC,joinUp:ZC,joinDown:eM,joinBackward:tM,joinForward:nM,joinItemBackward:rM,joinItemForward:iM,keyboardShortcut:aM,lift:sM,liftEmptyBlock:lM,liftListItem:cM,newlineInCode:dM,resetAttributes:uM,scrollIntoView:fM,selectAll:pM,selectNodeBackward:hM,selectNodeForward:mM,selectParentNode:gM,selectTextblockEnd:yM,selectTextblockStart:vM,setContent:bM,setMark:OM,setMeta:NM,setNode:_M,setNodeSelection:BM,setTextSelection:PM,sinkListItem:IM,splitBlock:RM,splitListItem:VM,toggleList:(n,e,t,r={})=>({editor:i,tr:o,state:a,dispatch:s,chain:c,commands:d,can:u})=>{const{extensions:f,splittableMarks:p}=i.extensionManager,h=et(n,a.schema),m=et(e,a.schema),{selection:g,storedMarks:k}=a,{$from:x,$to:S}=g,T=x.blockRange(S),y=k||g.$to.parentOffset&&g.$from.marks();if(!T)return!1;const B=Ll(w=>Hp(w.type.name,f))(g);if(T.depth>=1&&B&&T.depth-B.depth<=1){if(B.node.type===h)return d.liftListItem(m);if(Hp(B.node.type.name,f)&&h.validContent(B.node.content)&&s)return c().command(()=>(o.setNodeMarkup(B.pos,h),!0)).command(()=>Fl(o,h)).command(()=>zl(o,h)).run()}return!t||!y||!s?c().command(()=>u().wrapInList(h,r)?!0:d.clearNodes()).wrapInList(h,r).command(()=>Fl(o,h)).command(()=>zl(o,h)).run():c().command(()=>{const w=u().wrapInList(h,r),V=y.filter($=>p.includes($.type.name));return o.ensureMarks(V),w?!0:d.clearNodes()}).wrapInList(h,r).command(()=>Fl(o,h)).command(()=>zl(o,h)).run()},toggleMark:(n,e={},t={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=t,a=tr(n,r.schema);return $l(r,a,e)?i.unsetMark(a,{extendEmptyMarkRange:o}):i.setMark(a,e)},toggleNode:(n,e,t={})=>({state:r,commands:i})=>{const o=et(n,r.schema),a=et(e,r.schema);return ao(r,o,t)?i.setNode(a):i.setNode(o,t)},toggleWrap:(n,e={})=>({state:t,commands:r})=>{const i=et(n,t.schema);return ao(t,i,e)?r.lift(i):r.wrapIn(i,e)},undoInputRule:()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let r=0;r<t.length;r+=1){const i=t[r];let o;if(i.spec.isInputRules&&(o=i.getState(n))){if(e){const a=n.tr,s=o.transform;for(let c=s.steps.length-1;c>=0;c-=1)a.step(s.steps[c].invert(s.docs[c]));if(o.text){const c=a.doc.resolve(o.from).marks();a.replaceWith(o.from,o.to,n.schema.text(o.text,c))}else a.delete(o.from,o.to)}return!0}}return!1},unsetAllMarks:()=>({tr:n,dispatch:e})=>{const{selection:t}=n,{empty:r,ranges:i}=t;return r||e&&i.forEach(o=>{n.removeMark(o.$from.pos,o.$to.pos)}),!0},unsetMark:(n,e={})=>({tr:t,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:a=!1}=e,{selection:s}=t,c=tr(n,r.schema),{$from:d,empty:u,ranges:f}=s;if(!i)return!0;if(u&&a){let{from:p,to:h}=s;const m=(o=d.marks().find(k=>k.type===c))===null||o===void 0?void 0:o.attrs,g=Pl(d,c,m);g&&(p=g.from,h=g.to),t.removeMark(p,h,c)}else f.forEach(p=>{t.removeMark(p.$from.pos,p.$to.pos,c)});return t.removeStoredMark(c),!0},updateAttributes:(n,e={})=>({tr:t,state:r,dispatch:i})=>{let o=null,a=null;const s=va(typeof n=="string"?n:n.name,r.schema);return s?(s==="node"&&(o=et(n,r.schema)),s==="mark"&&(a=tr(n,r.schema)),i&&t.selection.ranges.forEach(c=>{const d=c.$from.pos,u=c.$to.pos;r.doc.nodesBetween(d,u,(f,p)=>{o&&o===f.type&&t.setNodeMarkup(p,void 0,{...f.attrs,...e}),a&&f.marks.length&&f.marks.forEach(h=>{if(a===h.type){const m=Math.max(p,d),g=Math.min(p+f.nodeSize,u);t.addMark(m,g,a.create({...h.attrs,...e}))}})})}),!0):!1},wrapIn:(n,e={})=>({state:t,dispatch:r})=>{const i=et(n,t.schema);return dC(i,e)(t,r)},wrapInList:(n,e={})=>({state:t,dispatch:r})=>{const i=et(n,t.schema);return uC(i,e)(t,r)}});const $M=ft.create({name:"commands",addCommands(){return{...LM}}}),FM=ft.create({name:"editable",addProseMirrorPlugins(){return[new Ct({key:new hn("editable"),props:{editable:()=>this.editor.options.editable}})]}}),zM=ft.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new Ct({key:new hn("focusEvents"),props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),HM=ft.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:s})=>{const{selection:c,doc:d}=s,{empty:u,$anchor:f}=c,{pos:p,parent:h}=f,m=f.parent.isTextblock?s.doc.resolve(p-1):f,g=m.parent.type.spec.isolating,k=f.pos-f.parentOffset,x=g&&m.parent.childCount===1?k===f.pos:ye.atStart(d).from===p;return!u||!x||!h.type.isTextblock||h.textContent.length?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":n,"Alt-Backspace":n,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Rl()||Vl()?o:i},addProseMirrorPlugins(){return[new Ct({key:new hn("clearDocument"),appendTransaction:(n,e,t)=>{if(!(n.some(m=>m.docChanged)&&!e.doc.eq(t.doc)))return;const{empty:i,from:o,to:a}=e.selection,s=ye.atStart(e.doc).from,c=ye.atEnd(e.doc).to;if(i||!(o===s&&a===c)||!(t.doc.textBetween(0,t.doc.content.size," "," ").length===0))return;const f=t.tr,p=ua({state:t,transaction:f}),{commands:h}=new fa({editor:this.editor,state:p});if(h.clearNodes(),!!f.steps.length)return f}})]}}),YM=ft.create({name:"tabindex",addProseMirrorPlugins(){return[new Ct({key:new hn("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var UM=Object.freeze({__proto__:null,ClipboardTextSerializer:NC,Commands:$M,Editable:FM,FocusEvents:zM,Keymap:HM,Tabindex:YM});const jM=`.ProseMirror {
84
84
  position: relative;
85
85
  }
86
86
 
@@ -154,30 +154,30 @@ img.ProseMirror-separator {
154
154
 
155
155
  .tippy-box[data-animation=fade][data-state=hidden] {
156
156
  opacity: 0
157
- }`;function IM(n,e,t){const r=document.querySelector(`style[data-tiptap-style${t?`-${t}`:""}]`);if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute(`data-tiptap-style${t?`-${t}`:""}`,""),i.innerHTML=n,document.getElementsByTagName("head")[0].appendChild(i),i}let RM=class extends aC{constructor(e={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=IM(PM,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,t){const r=Ap(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});this.view.updateState(i)}unregisterPlugin(e){if(this.isDestroyed)return;const t=typeof e=="string"?`${e}$`:e.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(i=>!i.key.startsWith(t))});this.view.updateState(r)}createExtensionManager(){const t=[...this.options.enableCoreExtensions?Object.values(BM):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r==null?void 0:r.type));this.extensionManager=new hi(t,this)}createCommandManager(){this.commandManager=new fa({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const e=Vp(this.options.content,this.schema,this.options.parseOptions),t=Pp(e,this.options.autofocus);this.view=new T1(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:ai.create({doc:e,selection:t||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews(),this.prependClass();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(a=>{var s;return(s=this.capturedTransaction)===null||s===void 0?void 0:s.step(a)});return}const t=this.state.apply(e),r=!this.state.selection.eq(t.selection);this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),o=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),o&&this.emit("blur",{editor:this,event:o.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return hM(this.state,e)}isActive(e,t){const r=typeof e=="string"?e:null,i=typeof e=="string"?t:e;return mM(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return uM(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=`
157
+ }`;function WM(n,e,t){const r=document.querySelector(`style[data-tiptap-style${t?`-${t}`:""}]`);if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute(`data-tiptap-style${t?`-${t}`:""}`,""),i.innerHTML=n,document.getElementsByTagName("head")[0].appendChild(i),i}let qM=class extends yC{constructor(e={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=WM(jM,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,t){const r=Np(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});this.view.updateState(i)}unregisterPlugin(e){if(this.isDestroyed)return;const t=typeof e=="string"?`${e}$`:e.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(i=>!i.key.startsWith(t))});this.view.updateState(r)}createExtensionManager(){const t=[...this.options.enableCoreExtensions?Object.values(UM):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r==null?void 0:r.type));this.extensionManager=new hi(t,this)}createCommandManager(){this.commandManager=new fa({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const e=Fp(this.options.content,this.schema,this.options.parseOptions),t=Vp(e,this.options.autofocus);this.view=new R1(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:ai.create({doc:e,selection:t||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews(),this.prependClass();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(a=>{var s;return(s=this.capturedTransaction)===null||s===void 0?void 0:s.step(a)});return}const t=this.state.apply(e),r=!this.state.selection.eq(t.selection);this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),o=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),o&&this.emit("blur",{editor:this,event:o.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return TM(this.state,e)}isActive(e,t){const r=typeof e=="string"?e:null,i=typeof e=="string"?t:e;return SM(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return xM(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=`
158
158
 
159
- `,textSerializers:r={}}=e||{};return fM(this.state.doc,{blockSeparator:t,textSerializers:{...Bp(this.schema),...r}})}get isEmpty(){return gM(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}};function Or(n){return new ha({find:n.find,handler:({state:e,range:t,match:r})=>{const i=ve(n.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=e,a=r[r.length-1],s=r[0];if(a){const c=s.search(/\S/),d=t.from+s.indexOf(a),u=d+a.length;if(Lp(t.from,t.to,e.doc).filter(h=>h.mark.type.excluded.find(g=>g===n.type&&g!==h.mark.type)).filter(h=>h.to>d).length)return null;u<t.to&&o.delete(u,t.to),d>t.from&&o.delete(t.from+c,d);const p=t.from+c+a.length;o.addMark(t.from+c,p,n.type.create(i||{})),o.removeStoredMark(n.type)}}})}function VM(n){return new ha({find:n.find,handler:({state:e,range:t,match:r})=>{const i=ve(n.getAttributes,void 0,r)||{},{tr:o}=e,a=t.from;let s=t.to;const c=n.type.create(i);if(r[1]){const d=r[0].lastIndexOf(r[1]);let u=a+d;u>s?u=s:s=u+r[1].length;const f=r[0][r[0].length-1];o.insertText(f,a+r[0].length-1),o.replaceWith(u,s,c)}else r[0]&&o.insert(a-1,n.type.create(i)).delete(o.mapping.map(a),o.mapping.map(s));o.scrollIntoView()}})}function Hl(n){return new ha({find:n.find,handler:({state:e,range:t,match:r})=>{const i=e.doc.resolve(t.from),o=ve(n.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,o)}})}function so(n){return new ha({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{const o=ve(n.getAttributes,void 0,r)||{},a=e.tr.delete(t.from,t.to),c=a.doc.resolve(t.from).blockRange(),d=c&&Gs(c,n.type,o);if(!d)return null;if(a.wrap(c,d),n.keepMarks&&n.editor){const{selection:f,storedMarks:p}=e,{splittableMarks:h}=n.editor.extensionManager,m=p||f.$to.parentOffset&&f.$from.marks();if(m){const g=m.filter(k=>h.includes(k.type.name));a.ensureMarks(g)}}if(n.keepAttributes){const f=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,o).run()}const u=a.doc.resolve(t.from-1).nodeBefore;u&&u.type===n.type&&jn(a.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,u))&&a.join(t.from-1)}})}class en{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ve(le(this,"addOptions",{name:this.name}))),this.storage=ve(le(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new en(e)}configure(e={}){const t=this.extend();return t.options=ma(this.options,e),t.storage=ve(le(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new en(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=ve(le(t,"addOptions",{name:t.name})),t.storage=ve(le(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const a=i.marks();if(!!!a.find(d=>(d==null?void 0:d.type.name)===t.name))return!1;const c=a.find(d=>(d==null?void 0:d.type.name)===t.name);return c&&r.removeStoredMark(c),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}let Ot=class pc{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ve(le(this,"addOptions",{name:this.name}))),this.storage=ve(le(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new pc(e)}configure(e={}){const t=this.extend();return t.options=ma(this.options,e),t.storage=ve(le(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new pc(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=ve(le(t,"addOptions",{name:t.name})),t.storage=ve(le(t,"addStorage",{name:t.name,options:t.options})),t}};function Nr(n){return new hC({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{const o=ve(n.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:a}=e,s=r[r.length-1],c=r[0];let d=t.to;if(s){const u=c.search(/\S/),f=t.from+c.indexOf(s),p=f+s.length;if(Lp(t.from,t.to,e.doc).filter(m=>m.mark.type.excluded.find(k=>k===n.type&&k!==m.mark.type)).filter(m=>m.to>f).length)return null;p<t.to&&a.delete(p,t.to),f>t.from&&a.delete(t.from+u,f),d=t.from+u+s.length,a.addMark(t.from+u,d,n.type.create(o||{})),a.removeStoredMark(n.type)}}})}var Tt="top",zt="bottom",Ht="right",St="left",Yl="auto",lo=[Tt,zt,Ht,St],mi="start",co="end",LM="clippingParents",Hp="viewport",uo="popper",$M="reference",Yp=lo.reduce(function(n,e){return n.concat([e+"-"+mi,e+"-"+co])},[]),Up=[].concat(lo,[Yl]).reduce(function(n,e){return n.concat([e,e+"-"+mi,e+"-"+co])},[]),FM="beforeRead",zM="read",HM="afterRead",YM="beforeMain",UM="main",jM="afterMain",WM="beforeWrite",qM="write",KM="afterWrite",GM=[FM,zM,HM,YM,UM,jM,WM,qM,KM];function vn(n){return n?(n.nodeName||"").toLowerCase():null}function Nt(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function _r(n){var e=Nt(n).Element;return n instanceof e||n instanceof Element}function Yt(n){var e=Nt(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function Ul(n){if(typeof ShadowRoot>"u")return!1;var e=Nt(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function QM(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},i=e.attributes[t]||{},o=e.elements[t];!Yt(o)||!vn(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function JM(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},a=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:t[r]),s=a.reduce(function(c,d){return c[d]="",c},{});!Yt(i)||!vn(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(c){i.removeAttribute(c)}))})}}const jp={name:"applyStyles",enabled:!0,phase:"write",fn:QM,effect:JM,requires:["computeStyles"]};function bn(n){return n.split("-")[0]}var Br=Math.max,ka=Math.min,gi=Math.round;function jl(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Wp(){return!/^((?!chrome|android).)*safari/i.test(jl())}function yi(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var r=n.getBoundingClientRect(),i=1,o=1;e&&Yt(n)&&(i=n.offsetWidth>0&&gi(r.width)/n.offsetWidth||1,o=n.offsetHeight>0&&gi(r.height)/n.offsetHeight||1);var a=_r(n)?Nt(n):window,s=a.visualViewport,c=!Wp()&&t,d=(r.left+(c&&s?s.offsetLeft:0))/i,u=(r.top+(c&&s?s.offsetTop:0))/o,f=r.width/i,p=r.height/o;return{width:f,height:p,top:u,right:d+f,bottom:u+p,left:d,x:d,y:u}}function Wl(n){var e=yi(n),t=n.offsetWidth,r=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:r}}function qp(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&Ul(t)){var r=e;do{if(r&&n.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function En(n){return Nt(n).getComputedStyle(n)}function XM(n){return["table","td","th"].indexOf(vn(n))>=0}function tr(n){return((_r(n)?n.ownerDocument:n.document)||window.document).documentElement}function xa(n){return vn(n)==="html"?n:n.assignedSlot||n.parentNode||(Ul(n)?n.host:null)||tr(n)}function Kp(n){return!Yt(n)||En(n).position==="fixed"?null:n.offsetParent}function ZM(n){var e=/firefox/i.test(jl()),t=/Trident/i.test(jl());if(t&&Yt(n)){var r=En(n);if(r.position==="fixed")return null}var i=xa(n);for(Ul(i)&&(i=i.host);Yt(i)&&["html","body"].indexOf(vn(i))<0;){var o=En(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function fo(n){for(var e=Nt(n),t=Kp(n);t&&XM(t)&&En(t).position==="static";)t=Kp(t);return t&&(vn(t)==="html"||vn(t)==="body"&&En(t).position==="static")?e:t||ZM(n)||e}function ql(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function po(n,e,t){return Br(n,ka(e,t))}function eT(n,e,t){var r=po(n,e,t);return r>t?t:r}function Gp(){return{top:0,right:0,bottom:0,left:0}}function Qp(n){return Object.assign({},Gp(),n)}function Jp(n,e){return e.reduce(function(t,r){return t[r]=n,t},{})}var tT=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,Qp(typeof e!="number"?e:Jp(e,lo))};function nT(n){var e,t=n.state,r=n.name,i=n.options,o=t.elements.arrow,a=t.modifiersData.popperOffsets,s=bn(t.placement),c=ql(s),d=[St,Ht].indexOf(s)>=0,u=d?"height":"width";if(!(!o||!a)){var f=tT(i.padding,t),p=Wl(o),h=c==="y"?Tt:St,m=c==="y"?zt:Ht,g=t.rects.reference[u]+t.rects.reference[c]-a[c]-t.rects.popper[u],k=a[c]-t.rects.reference[c],x=fo(o),S=x?c==="y"?x.clientHeight||0:x.clientWidth||0:0,T=g/2-k/2,y=f[h],B=S-p[u]-f[m],w=S/2-p[u]/2+T,V=po(y,w,B),$=c;t.modifiersData[r]=(e={},e[$]=V,e.centerOffset=V-w,e)}}function rT(n){var e=n.state,t=n.options,r=t.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||qp(e.elements.popper,i)&&(e.elements.arrow=i))}const iT={name:"arrow",enabled:!0,phase:"main",fn:nT,effect:rT,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function vi(n){return n.split("-")[1]}var oT={top:"auto",right:"auto",bottom:"auto",left:"auto"};function aT(n,e){var t=n.x,r=n.y,i=e.devicePixelRatio||1;return{x:gi(t*i)/i||0,y:gi(r*i)/i||0}}function Xp(n){var e,t=n.popper,r=n.popperRect,i=n.placement,o=n.variation,a=n.offsets,s=n.position,c=n.gpuAcceleration,d=n.adaptive,u=n.roundOffsets,f=n.isFixed,p=a.x,h=p===void 0?0:p,m=a.y,g=m===void 0?0:m,k=typeof u=="function"?u({x:h,y:g}):{x:h,y:g};h=k.x,g=k.y;var x=a.hasOwnProperty("x"),S=a.hasOwnProperty("y"),T=St,y=Tt,B=window;if(d){var w=fo(t),V="clientHeight",$="clientWidth";if(w===Nt(t)&&(w=tr(t),En(w).position!=="static"&&s==="absolute"&&(V="scrollHeight",$="scrollWidth")),w=w,i===Tt||(i===St||i===Ht)&&o===co){y=zt;var M=f&&w===B&&B.visualViewport?B.visualViewport.height:w[V];g-=M-r.height,g*=c?1:-1}if(i===St||(i===Tt||i===zt)&&o===co){T=Ht;var _=f&&w===B&&B.visualViewport?B.visualViewport.width:w[$];h-=_-r.width,h*=c?1:-1}}var z=Object.assign({position:s},d&&oT),N=u===!0?aT({x:h,y:g},Nt(t)):{x:h,y:g};if(h=N.x,g=N.y,c){var W;return Object.assign({},z,(W={},W[y]=S?"0":"",W[T]=x?"0":"",W.transform=(B.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",W))}return Object.assign({},z,(e={},e[y]=S?g+"px":"",e[T]=x?h+"px":"",e.transform="",e))}function sT(n){var e=n.state,t=n.options,r=t.gpuAcceleration,i=r===void 0?!0:r,o=t.adaptive,a=o===void 0?!0:o,s=t.roundOffsets,c=s===void 0?!0:s,d={placement:bn(e.placement),variation:vi(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Xp(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Xp(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const lT={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:sT,data:{}};var Ca={passive:!0};function cT(n){var e=n.state,t=n.instance,r=n.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,c=Nt(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&d.forEach(function(u){u.addEventListener("scroll",t.update,Ca)}),s&&c.addEventListener("resize",t.update,Ca),function(){o&&d.forEach(function(u){u.removeEventListener("scroll",t.update,Ca)}),s&&c.removeEventListener("resize",t.update,Ca)}}const dT={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:cT,data:{}};var uT={left:"right",right:"left",bottom:"top",top:"bottom"};function Ma(n){return n.replace(/left|right|bottom|top/g,function(e){return uT[e]})}var fT={start:"end",end:"start"};function Zp(n){return n.replace(/start|end/g,function(e){return fT[e]})}function Kl(n){var e=Nt(n),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function Gl(n){return yi(tr(n)).left+Kl(n).scrollLeft}function pT(n,e){var t=Nt(n),r=tr(n),i=t.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,c=0;if(i){o=i.width,a=i.height;var d=Wp();(d||!d&&e==="fixed")&&(s=i.offsetLeft,c=i.offsetTop)}return{width:o,height:a,x:s+Gl(n),y:c}}function hT(n){var e,t=tr(n),r=Kl(n),i=(e=n.ownerDocument)==null?void 0:e.body,o=Br(t.scrollWidth,t.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=Br(t.scrollHeight,t.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+Gl(n),c=-r.scrollTop;return En(i||t).direction==="rtl"&&(s+=Br(t.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:c}}function Ql(n){var e=En(n),t=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+i+r)}function eh(n){return["html","body","#document"].indexOf(vn(n))>=0?n.ownerDocument.body:Yt(n)&&Ql(n)?n:eh(xa(n))}function ho(n,e){var t;e===void 0&&(e=[]);var r=eh(n),i=r===((t=n.ownerDocument)==null?void 0:t.body),o=Nt(r),a=i?[o].concat(o.visualViewport||[],Ql(r)?r:[]):r,s=e.concat(a);return i?s:s.concat(ho(xa(a)))}function Jl(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function mT(n,e){var t=yi(n,!1,e==="fixed");return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function th(n,e,t){return e===Hp?Jl(pT(n,t)):_r(e)?mT(e,t):Jl(hT(tr(n)))}function gT(n){var e=ho(xa(n)),t=["absolute","fixed"].indexOf(En(n).position)>=0,r=t&&Yt(n)?fo(n):n;return _r(r)?e.filter(function(i){return _r(i)&&qp(i,r)&&vn(i)!=="body"}):[]}function yT(n,e,t,r){var i=e==="clippingParents"?gT(n):[].concat(e),o=[].concat(i,[t]),a=o[0],s=o.reduce(function(c,d){var u=th(n,d,r);return c.top=Br(u.top,c.top),c.right=ka(u.right,c.right),c.bottom=ka(u.bottom,c.bottom),c.left=Br(u.left,c.left),c},th(n,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function nh(n){var e=n.reference,t=n.element,r=n.placement,i=r?bn(r):null,o=r?vi(r):null,a=e.x+e.width/2-t.width/2,s=e.y+e.height/2-t.height/2,c;switch(i){case Tt:c={x:a,y:e.y-t.height};break;case zt:c={x:a,y:e.y+e.height};break;case Ht:c={x:e.x+e.width,y:s};break;case St:c={x:e.x-t.width,y:s};break;default:c={x:e.x,y:e.y}}var d=i?ql(i):null;if(d!=null){var u=d==="y"?"height":"width";switch(o){case mi:c[d]=c[d]-(e[u]/2-t[u]/2);break;case co:c[d]=c[d]+(e[u]/2-t[u]/2);break}}return c}function mo(n,e){e===void 0&&(e={});var t=e,r=t.placement,i=r===void 0?n.placement:r,o=t.strategy,a=o===void 0?n.strategy:o,s=t.boundary,c=s===void 0?LM:s,d=t.rootBoundary,u=d===void 0?Hp:d,f=t.elementContext,p=f===void 0?uo:f,h=t.altBoundary,m=h===void 0?!1:h,g=t.padding,k=g===void 0?0:g,x=Qp(typeof k!="number"?k:Jp(k,lo)),S=p===uo?$M:uo,T=n.rects.popper,y=n.elements[m?S:p],B=yT(_r(y)?y:y.contextElement||tr(n.elements.popper),c,u,a),w=yi(n.elements.reference),V=nh({reference:w,element:T,strategy:"absolute",placement:i}),$=Jl(Object.assign({},T,V)),M=p===uo?$:w,_={top:B.top-M.top+x.top,bottom:M.bottom-B.bottom+x.bottom,left:B.left-M.left+x.left,right:M.right-B.right+x.right},z=n.modifiersData.offset;if(p===uo&&z){var N=z[i];Object.keys(_).forEach(function(W){var F=[Ht,zt].indexOf(W)>=0?1:-1,O=[Tt,zt].indexOf(W)>=0?"y":"x";_[W]+=N[O]*F})}return _}function vT(n,e){e===void 0&&(e={});var t=e,r=t.placement,i=t.boundary,o=t.rootBoundary,a=t.padding,s=t.flipVariations,c=t.allowedAutoPlacements,d=c===void 0?Up:c,u=vi(r),f=u?s?Yp:Yp.filter(function(m){return vi(m)===u}):lo,p=f.filter(function(m){return d.indexOf(m)>=0});p.length===0&&(p=f);var h=p.reduce(function(m,g){return m[g]=mo(n,{placement:g,boundary:i,rootBoundary:o,padding:a})[bn(g)],m},{});return Object.keys(h).sort(function(m,g){return h[m]-h[g]})}function bT(n){if(bn(n)===Yl)return[];var e=Ma(n);return[Zp(n),e,Zp(e)]}function wT(n){var e=n.state,t=n.options,r=n.name;if(!e.modifiersData[r]._skip){for(var i=t.mainAxis,o=i===void 0?!0:i,a=t.altAxis,s=a===void 0?!0:a,c=t.fallbackPlacements,d=t.padding,u=t.boundary,f=t.rootBoundary,p=t.altBoundary,h=t.flipVariations,m=h===void 0?!0:h,g=t.allowedAutoPlacements,k=e.options.placement,x=bn(k),S=x===k,T=c||(S||!m?[Ma(k)]:bT(k)),y=[k].concat(T).reduce(function(q,D){return q.concat(bn(D)===Yl?vT(e,{placement:D,boundary:u,rootBoundary:f,padding:d,flipVariations:m,allowedAutoPlacements:g}):D)},[]),B=e.rects.reference,w=e.rects.popper,V=new Map,$=!0,M=y[0],_=0;_<y.length;_++){var z=y[_],N=bn(z),W=vi(z)===mi,F=[Tt,zt].indexOf(N)>=0,O=F?"width":"height",I=mo(e,{placement:z,boundary:u,rootBoundary:f,altBoundary:p,padding:d}),H=F?W?Ht:St:W?zt:Tt;B[O]>w[O]&&(H=Ma(H));var b=Ma(H),C=[];if(o&&C.push(I[N]<=0),s&&C.push(I[H]<=0,I[b]<=0),C.every(function(q){return q})){M=z,$=!1;break}V.set(z,C)}if($)for(var v=m?3:1,A=function(D){var X=y.find(function(ne){var Y=V.get(ne);if(Y)return Y.slice(0,D).every(function(Z){return Z})});if(X)return M=X,"break"},E=v;E>0;E--){var P=A(E);if(P==="break")break}e.placement!==M&&(e.modifiersData[r]._skip=!0,e.placement=M,e.reset=!0)}}const kT={name:"flip",enabled:!0,phase:"main",fn:wT,requiresIfExists:["offset"],data:{_skip:!1}};function rh(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function ih(n){return[Tt,Ht,zt,St].some(function(e){return n[e]>=0})}function xT(n){var e=n.state,t=n.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,a=mo(e,{elementContext:"reference"}),s=mo(e,{altBoundary:!0}),c=rh(a,r),d=rh(s,i,o),u=ih(c),f=ih(d);e.modifiersData[t]={referenceClippingOffsets:c,popperEscapeOffsets:d,isReferenceHidden:u,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const CT={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:xT};function MT(n,e,t){var r=bn(n),i=[St,Tt].indexOf(r)>=0?-1:1,o=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[St,Ht].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function TT(n){var e=n.state,t=n.options,r=n.name,i=t.offset,o=i===void 0?[0,0]:i,a=Up.reduce(function(u,f){return u[f]=MT(f,e.rects,o),u},{}),s=a[e.placement],c=s.x,d=s.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=d),e.modifiersData[r]=a}const ST={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:TT};function DT(n){var e=n.state,t=n.name;e.modifiersData[t]=nh({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const AT={name:"popperOffsets",enabled:!0,phase:"read",fn:DT,data:{}};function ET(n){return n==="x"?"y":"x"}function OT(n){var e=n.state,t=n.options,r=n.name,i=t.mainAxis,o=i===void 0?!0:i,a=t.altAxis,s=a===void 0?!1:a,c=t.boundary,d=t.rootBoundary,u=t.altBoundary,f=t.padding,p=t.tether,h=p===void 0?!0:p,m=t.tetherOffset,g=m===void 0?0:m,k=mo(e,{boundary:c,rootBoundary:d,padding:f,altBoundary:u}),x=bn(e.placement),S=vi(e.placement),T=!S,y=ql(x),B=ET(y),w=e.modifiersData.popperOffsets,V=e.rects.reference,$=e.rects.popper,M=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,_=typeof M=="number"?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),z=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,N={x:0,y:0};if(w){if(o){var W,F=y==="y"?Tt:St,O=y==="y"?zt:Ht,I=y==="y"?"height":"width",H=w[y],b=H+k[F],C=H-k[O],v=h?-$[I]/2:0,A=S===mi?V[I]:$[I],E=S===mi?-$[I]:-V[I],P=e.elements.arrow,q=h&&P?Wl(P):{width:0,height:0},D=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Gp(),X=D[F],ne=D[O],Y=po(0,V[I],q[I]),Z=T?V[I]/2-v-Y-X-_.mainAxis:A-Y-X-_.mainAxis,ce=T?-V[I]/2+v+Y+ne+_.mainAxis:E+Y+ne+_.mainAxis,j=e.elements.arrow&&fo(e.elements.arrow),J=j?y==="y"?j.clientTop||0:j.clientLeft||0:0,de=(W=z==null?void 0:z[y])!=null?W:0,te=H+Z-de-J,Ge=H+ce-de,pt=po(h?ka(b,te):b,H,h?Br(C,Ge):C);w[y]=pt,N[y]=pt-H}if(s){var nn,st=y==="x"?Tt:St,xn=y==="x"?zt:Ht,Bt=w[B],Ut=B==="y"?"height":"width",Nn=Bt+k[st],rn=Bt-k[xn],_n=[Tt,St].indexOf(x)!==-1,ir=(nn=z==null?void 0:z[B])!=null?nn:0,or=_n?Nn:Bt-V[Ut]-$[Ut]-ir+_.altAxis,ar=_n?Bt+V[Ut]+$[Ut]-ir-_.altAxis:rn,R=h&&_n?eT(or,Bt,ar):po(h?or:Nn,Bt,h?ar:rn);w[B]=R,N[B]=R-Bt}e.modifiersData[r]=N}}const NT={name:"preventOverflow",enabled:!0,phase:"main",fn:OT,requiresIfExists:["offset"]};function _T(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function BT(n){return n===Nt(n)||!Yt(n)?Kl(n):_T(n)}function PT(n){var e=n.getBoundingClientRect(),t=gi(e.width)/n.offsetWidth||1,r=gi(e.height)/n.offsetHeight||1;return t!==1||r!==1}function IT(n,e,t){t===void 0&&(t=!1);var r=Yt(e),i=Yt(e)&&PT(e),o=tr(e),a=yi(n,i,t),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!t)&&((vn(e)!=="body"||Ql(o))&&(s=BT(e)),Yt(e)?(c=yi(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):o&&(c.x=Gl(o))),{x:a.left+s.scrollLeft-c.x,y:a.top+s.scrollTop-c.y,width:a.width,height:a.height}}function RT(n){var e=new Map,t=new Set,r=[];n.forEach(function(o){e.set(o.name,o)});function i(o){t.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!t.has(s)){var c=e.get(s);c&&i(c)}}),r.push(o)}return n.forEach(function(o){t.has(o.name)||i(o)}),r}function VT(n){var e=RT(n);return GM.reduce(function(t,r){return t.concat(e.filter(function(i){return i.phase===r}))},[])}function LT(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function $T(n){var e=n.reduce(function(t,r){var i=t[r.name];return t[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,t},{});return Object.keys(e).map(function(t){return e[t]})}var oh={placement:"bottom",modifiers:[],strategy:"absolute"};function ah(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function FT(n){n===void 0&&(n={});var e=n,t=e.defaultModifiers,r=t===void 0?[]:t,i=e.defaultOptions,o=i===void 0?oh:i;return function(s,c,d){d===void 0&&(d=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},oh,o),modifiersData:{},elements:{reference:s,popper:c},attributes:{},styles:{}},f=[],p=!1,h={state:u,setOptions:function(x){var S=typeof x=="function"?x(u.options):x;g(),u.options=Object.assign({},o,u.options,S),u.scrollParents={reference:_r(s)?ho(s):s.contextElement?ho(s.contextElement):[],popper:ho(c)};var T=VT($T([].concat(r,u.options.modifiers)));return u.orderedModifiers=T.filter(function(y){return y.enabled}),m(),h.update()},forceUpdate:function(){if(!p){var x=u.elements,S=x.reference,T=x.popper;if(ah(S,T)){u.rects={reference:IT(S,fo(T),u.options.strategy==="fixed"),popper:Wl(T)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(_){return u.modifiersData[_.name]=Object.assign({},_.data)});for(var y=0;y<u.orderedModifiers.length;y++){if(u.reset===!0){u.reset=!1,y=-1;continue}var B=u.orderedModifiers[y],w=B.fn,V=B.options,$=V===void 0?{}:V,M=B.name;typeof w=="function"&&(u=w({state:u,options:$,name:M,instance:h})||u)}}}},update:LT(function(){return new Promise(function(k){h.forceUpdate(),k(u)})}),destroy:function(){g(),p=!0}};if(!ah(s,c))return h;h.setOptions(d).then(function(k){!p&&d.onFirstUpdate&&d.onFirstUpdate(k)});function m(){u.orderedModifiers.forEach(function(k){var x=k.name,S=k.options,T=S===void 0?{}:S,y=k.effect;if(typeof y=="function"){var B=y({state:u,name:x,instance:h,options:T}),w=function(){};f.push(B||w)}})}function g(){f.forEach(function(k){return k()}),f=[]}return h}}var zT=[dT,AT,lT,jp,ST,kT,NT,iT,CT],HT=FT({defaultModifiers:zT}),YT="tippy-box",sh="tippy-content",UT="tippy-backdrop",lh="tippy-arrow",ch="tippy-svg-arrow",Pr={passive:!0,capture:!0},dh=function(){return document.body};function jT(n,e){return{}.hasOwnProperty.call(n,e)}function Xl(n,e,t){if(Array.isArray(n)){var r=n[e];return r??(Array.isArray(t)?t[e]:t)}return n}function Zl(n,e){var t={}.toString.call(n);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function uh(n,e){return typeof n=="function"?n.apply(void 0,e):n}function fh(n,e){if(e===0)return n;var t;return function(r){clearTimeout(t),t=setTimeout(function(){n(r)},e)}}function WT(n,e){var t=Object.assign({},n);return e.forEach(function(r){delete t[r]}),t}function qT(n){return n.split(/\s+/).filter(Boolean)}function bi(n){return[].concat(n)}function ph(n,e){n.indexOf(e)===-1&&n.push(e)}function KT(n){return n.filter(function(e,t){return n.indexOf(e)===t})}function GT(n){return n.split("-")[0]}function Ta(n){return[].slice.call(n)}function hh(n){return Object.keys(n).reduce(function(e,t){return n[t]!==void 0&&(e[t]=n[t]),e},{})}function go(){return document.createElement("div")}function yo(n){return["Element","Fragment"].some(function(e){return Zl(n,e)})}function QT(n){return Zl(n,"NodeList")}function JT(n){return Zl(n,"MouseEvent")}function XT(n){return!!(n&&n._tippy&&n._tippy.reference===n)}function ZT(n){return yo(n)?[n]:QT(n)?Ta(n):Array.isArray(n)?n:Ta(document.querySelectorAll(n))}function ec(n,e){n.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function mh(n,e){n.forEach(function(t){t&&t.setAttribute("data-state",e)})}function eS(n){var e,t=bi(n),r=t[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function tS(n,e){var t=e.clientX,r=e.clientY;return n.every(function(i){var o=i.popperRect,a=i.popperState,s=i.props,c=s.interactiveBorder,d=GT(a.placement),u=a.modifiersData.offset;if(!u)return!0;var f=d==="bottom"?u.top.y:0,p=d==="top"?u.bottom.y:0,h=d==="right"?u.left.x:0,m=d==="left"?u.right.x:0,g=o.top-r+f>c,k=r-o.bottom-p>c,x=o.left-t+h>c,S=t-o.right-m>c;return g||k||x||S})}function tc(n,e,t){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){n[r](i,t)})}function gh(n,e){for(var t=e;t;){var r;if(n.contains(t))return!0;t=t.getRootNode==null||(r=t.getRootNode())==null?void 0:r.host}return!1}var wn={isTouch:!1},yh=0;function nS(){wn.isTouch||(wn.isTouch=!0,window.performance&&document.addEventListener("mousemove",vh))}function vh(){var n=performance.now();n-yh<20&&(wn.isTouch=!1,document.removeEventListener("mousemove",vh)),yh=n}function rS(){var n=document.activeElement;if(XT(n)){var e=n._tippy;n.blur&&!e.state.isVisible&&n.blur()}}function iS(){document.addEventListener("touchstart",nS,Pr),window.addEventListener("blur",rS)}var oS=typeof window<"u"&&typeof document<"u",aS=oS?!!window.msCrypto:!1;function wi(n){var e=n==="destroy"?"n already-":" ";return[n+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function bh(n){var e=/[ \t]{2,}/g,t=/^[ \t]*/gm;return n.replace(e," ").replace(t,"").trim()}function sS(n){return bh(`
159
+ `,textSerializers:r={}}=e||{};return CM(this.state.doc,{blockSeparator:t,textSerializers:{...Rp(this.schema),...r}})}get isEmpty(){return DM(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}};function Or(n){return new ha({find:n.find,handler:({state:e,range:t,match:r})=>{const i=ve(n.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=e,a=r[r.length-1],s=r[0];if(a){const c=s.search(/\S/),d=t.from+s.indexOf(a),u=d+a.length;if(zp(t.from,t.to,e.doc).filter(h=>h.mark.type.excluded.find(g=>g===n.type&&g!==h.mark.type)).filter(h=>h.to>d).length)return null;u<t.to&&o.delete(u,t.to),d>t.from&&o.delete(t.from+c,d);const p=t.from+c+a.length;o.addMark(t.from+c,p,n.type.create(i||{})),o.removeStoredMark(n.type)}}})}function KM(n){return new ha({find:n.find,handler:({state:e,range:t,match:r})=>{const i=ve(n.getAttributes,void 0,r)||{},{tr:o}=e,a=t.from;let s=t.to;const c=n.type.create(i);if(r[1]){const d=r[0].lastIndexOf(r[1]);let u=a+d;u>s?u=s:s=u+r[1].length;const f=r[0][r[0].length-1];o.insertText(f,a+r[0].length-1),o.replaceWith(u,s,c)}else r[0]&&o.insert(a-1,n.type.create(i)).delete(o.mapping.map(a),o.mapping.map(s));o.scrollIntoView()}})}function Hl(n){return new ha({find:n.find,handler:({state:e,range:t,match:r})=>{const i=e.doc.resolve(t.from),o=ve(n.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,o)}})}function so(n){return new ha({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{const o=ve(n.getAttributes,void 0,r)||{},a=e.tr.delete(t.from,t.to),c=a.doc.resolve(t.from).blockRange(),d=c&&Gs(c,n.type,o);if(!d)return null;if(a.wrap(c,d),n.keepMarks&&n.editor){const{selection:f,storedMarks:p}=e,{splittableMarks:h}=n.editor.extensionManager,m=p||f.$to.parentOffset&&f.$from.marks();if(m){const g=m.filter(k=>h.includes(k.type.name));a.ensureMarks(g)}}if(n.keepAttributes){const f=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,o).run()}const u=a.doc.resolve(t.from-1).nodeBefore;u&&u.type===n.type&&Wn(a.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,u))&&a.join(t.from-1)}})}class en{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ve(le(this,"addOptions",{name:this.name}))),this.storage=ve(le(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new en(e)}configure(e={}){const t=this.extend();return t.options=ma(this.options,e),t.storage=ve(le(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new en(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=ve(le(t,"addOptions",{name:t.name})),t.storage=ve(le(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const a=i.marks();if(!!!a.find(d=>(d==null?void 0:d.type.name)===t.name))return!1;const c=a.find(d=>(d==null?void 0:d.type.name)===t.name);return c&&r.removeStoredMark(c),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}let Ot=class pc{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ve(le(this,"addOptions",{name:this.name}))),this.storage=ve(le(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new pc(e)}configure(e={}){const t=this.extend();return t.options=ma(this.options,e),t.storage=ve(le(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new pc(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=ve(le(t,"addOptions",{name:t.name})),t.storage=ve(le(t,"addStorage",{name:t.name,options:t.options})),t}};function Nr(n){return new TC({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{const o=ve(n.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:a}=e,s=r[r.length-1],c=r[0];let d=t.to;if(s){const u=c.search(/\S/),f=t.from+c.indexOf(s),p=f+s.length;if(zp(t.from,t.to,e.doc).filter(m=>m.mark.type.excluded.find(k=>k===n.type&&k!==m.mark.type)).filter(m=>m.to>f).length)return null;p<t.to&&a.delete(p,t.to),f>t.from&&a.delete(t.from+u,f),d=t.from+u+s.length,a.addMark(t.from+u,d,n.type.create(o||{})),a.removeStoredMark(n.type)}}})}var Tt="top",zt="bottom",Ht="right",St="left",Yl="auto",lo=[Tt,zt,Ht,St],mi="start",co="end",GM="clippingParents",jp="viewport",uo="popper",QM="reference",Wp=lo.reduce(function(n,e){return n.concat([e+"-"+mi,e+"-"+co])},[]),qp=[].concat(lo,[Yl]).reduce(function(n,e){return n.concat([e,e+"-"+mi,e+"-"+co])},[]),JM="beforeRead",XM="read",ZM="afterRead",eT="beforeMain",tT="main",nT="afterMain",rT="beforeWrite",iT="write",oT="afterWrite",aT=[JM,XM,ZM,eT,tT,nT,rT,iT,oT];function vn(n){return n?(n.nodeName||"").toLowerCase():null}function Nt(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function _r(n){var e=Nt(n).Element;return n instanceof e||n instanceof Element}function Yt(n){var e=Nt(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function Ul(n){if(typeof ShadowRoot>"u")return!1;var e=Nt(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function sT(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},i=e.attributes[t]||{},o=e.elements[t];!Yt(o)||!vn(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function lT(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},a=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:t[r]),s=a.reduce(function(c,d){return c[d]="",c},{});!Yt(i)||!vn(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(c){i.removeAttribute(c)}))})}}const Kp={name:"applyStyles",enabled:!0,phase:"write",fn:sT,effect:lT,requires:["computeStyles"]};function bn(n){return n.split("-")[0]}var Br=Math.max,ka=Math.min,gi=Math.round;function jl(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Gp(){return!/^((?!chrome|android).)*safari/i.test(jl())}function yi(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var r=n.getBoundingClientRect(),i=1,o=1;e&&Yt(n)&&(i=n.offsetWidth>0&&gi(r.width)/n.offsetWidth||1,o=n.offsetHeight>0&&gi(r.height)/n.offsetHeight||1);var a=_r(n)?Nt(n):window,s=a.visualViewport,c=!Gp()&&t,d=(r.left+(c&&s?s.offsetLeft:0))/i,u=(r.top+(c&&s?s.offsetTop:0))/o,f=r.width/i,p=r.height/o;return{width:f,height:p,top:u,right:d+f,bottom:u+p,left:d,x:d,y:u}}function Wl(n){var e=yi(n),t=n.offsetWidth,r=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:r}}function Qp(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&Ul(t)){var r=e;do{if(r&&n.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function En(n){return Nt(n).getComputedStyle(n)}function cT(n){return["table","td","th"].indexOf(vn(n))>=0}function nr(n){return((_r(n)?n.ownerDocument:n.document)||window.document).documentElement}function xa(n){return vn(n)==="html"?n:n.assignedSlot||n.parentNode||(Ul(n)?n.host:null)||nr(n)}function Jp(n){return!Yt(n)||En(n).position==="fixed"?null:n.offsetParent}function dT(n){var e=/firefox/i.test(jl()),t=/Trident/i.test(jl());if(t&&Yt(n)){var r=En(n);if(r.position==="fixed")return null}var i=xa(n);for(Ul(i)&&(i=i.host);Yt(i)&&["html","body"].indexOf(vn(i))<0;){var o=En(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function fo(n){for(var e=Nt(n),t=Jp(n);t&&cT(t)&&En(t).position==="static";)t=Jp(t);return t&&(vn(t)==="html"||vn(t)==="body"&&En(t).position==="static")?e:t||dT(n)||e}function ql(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function po(n,e,t){return Br(n,ka(e,t))}function uT(n,e,t){var r=po(n,e,t);return r>t?t:r}function Xp(){return{top:0,right:0,bottom:0,left:0}}function Zp(n){return Object.assign({},Xp(),n)}function eh(n,e){return e.reduce(function(t,r){return t[r]=n,t},{})}var fT=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,Zp(typeof e!="number"?e:eh(e,lo))};function pT(n){var e,t=n.state,r=n.name,i=n.options,o=t.elements.arrow,a=t.modifiersData.popperOffsets,s=bn(t.placement),c=ql(s),d=[St,Ht].indexOf(s)>=0,u=d?"height":"width";if(!(!o||!a)){var f=fT(i.padding,t),p=Wl(o),h=c==="y"?Tt:St,m=c==="y"?zt:Ht,g=t.rects.reference[u]+t.rects.reference[c]-a[c]-t.rects.popper[u],k=a[c]-t.rects.reference[c],x=fo(o),S=x?c==="y"?x.clientHeight||0:x.clientWidth||0:0,T=g/2-k/2,y=f[h],B=S-p[u]-f[m],w=S/2-p[u]/2+T,V=po(y,w,B),$=c;t.modifiersData[r]=(e={},e[$]=V,e.centerOffset=V-w,e)}}function hT(n){var e=n.state,t=n.options,r=t.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||Qp(e.elements.popper,i)&&(e.elements.arrow=i))}const mT={name:"arrow",enabled:!0,phase:"main",fn:pT,effect:hT,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function vi(n){return n.split("-")[1]}var gT={top:"auto",right:"auto",bottom:"auto",left:"auto"};function yT(n,e){var t=n.x,r=n.y,i=e.devicePixelRatio||1;return{x:gi(t*i)/i||0,y:gi(r*i)/i||0}}function th(n){var e,t=n.popper,r=n.popperRect,i=n.placement,o=n.variation,a=n.offsets,s=n.position,c=n.gpuAcceleration,d=n.adaptive,u=n.roundOffsets,f=n.isFixed,p=a.x,h=p===void 0?0:p,m=a.y,g=m===void 0?0:m,k=typeof u=="function"?u({x:h,y:g}):{x:h,y:g};h=k.x,g=k.y;var x=a.hasOwnProperty("x"),S=a.hasOwnProperty("y"),T=St,y=Tt,B=window;if(d){var w=fo(t),V="clientHeight",$="clientWidth";if(w===Nt(t)&&(w=nr(t),En(w).position!=="static"&&s==="absolute"&&(V="scrollHeight",$="scrollWidth")),w=w,i===Tt||(i===St||i===Ht)&&o===co){y=zt;var M=f&&w===B&&B.visualViewport?B.visualViewport.height:w[V];g-=M-r.height,g*=c?1:-1}if(i===St||(i===Tt||i===zt)&&o===co){T=Ht;var _=f&&w===B&&B.visualViewport?B.visualViewport.width:w[$];h-=_-r.width,h*=c?1:-1}}var z=Object.assign({position:s},d&&gT),N=u===!0?yT({x:h,y:g},Nt(t)):{x:h,y:g};if(h=N.x,g=N.y,c){var W;return Object.assign({},z,(W={},W[y]=S?"0":"",W[T]=x?"0":"",W.transform=(B.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",W))}return Object.assign({},z,(e={},e[y]=S?g+"px":"",e[T]=x?h+"px":"",e.transform="",e))}function vT(n){var e=n.state,t=n.options,r=t.gpuAcceleration,i=r===void 0?!0:r,o=t.adaptive,a=o===void 0?!0:o,s=t.roundOffsets,c=s===void 0?!0:s,d={placement:bn(e.placement),variation:vi(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,th(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,th(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const bT={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:vT,data:{}};var Ca={passive:!0};function wT(n){var e=n.state,t=n.instance,r=n.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,c=Nt(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&d.forEach(function(u){u.addEventListener("scroll",t.update,Ca)}),s&&c.addEventListener("resize",t.update,Ca),function(){o&&d.forEach(function(u){u.removeEventListener("scroll",t.update,Ca)}),s&&c.removeEventListener("resize",t.update,Ca)}}const kT={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:wT,data:{}};var xT={left:"right",right:"left",bottom:"top",top:"bottom"};function Ma(n){return n.replace(/left|right|bottom|top/g,function(e){return xT[e]})}var CT={start:"end",end:"start"};function nh(n){return n.replace(/start|end/g,function(e){return CT[e]})}function Kl(n){var e=Nt(n),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function Gl(n){return yi(nr(n)).left+Kl(n).scrollLeft}function MT(n,e){var t=Nt(n),r=nr(n),i=t.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,c=0;if(i){o=i.width,a=i.height;var d=Gp();(d||!d&&e==="fixed")&&(s=i.offsetLeft,c=i.offsetTop)}return{width:o,height:a,x:s+Gl(n),y:c}}function TT(n){var e,t=nr(n),r=Kl(n),i=(e=n.ownerDocument)==null?void 0:e.body,o=Br(t.scrollWidth,t.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=Br(t.scrollHeight,t.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+Gl(n),c=-r.scrollTop;return En(i||t).direction==="rtl"&&(s+=Br(t.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:c}}function Ql(n){var e=En(n),t=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+i+r)}function rh(n){return["html","body","#document"].indexOf(vn(n))>=0?n.ownerDocument.body:Yt(n)&&Ql(n)?n:rh(xa(n))}function ho(n,e){var t;e===void 0&&(e=[]);var r=rh(n),i=r===((t=n.ownerDocument)==null?void 0:t.body),o=Nt(r),a=i?[o].concat(o.visualViewport||[],Ql(r)?r:[]):r,s=e.concat(a);return i?s:s.concat(ho(xa(a)))}function Jl(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function ST(n,e){var t=yi(n,!1,e==="fixed");return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function ih(n,e,t){return e===jp?Jl(MT(n,t)):_r(e)?ST(e,t):Jl(TT(nr(n)))}function DT(n){var e=ho(xa(n)),t=["absolute","fixed"].indexOf(En(n).position)>=0,r=t&&Yt(n)?fo(n):n;return _r(r)?e.filter(function(i){return _r(i)&&Qp(i,r)&&vn(i)!=="body"}):[]}function AT(n,e,t,r){var i=e==="clippingParents"?DT(n):[].concat(e),o=[].concat(i,[t]),a=o[0],s=o.reduce(function(c,d){var u=ih(n,d,r);return c.top=Br(u.top,c.top),c.right=ka(u.right,c.right),c.bottom=ka(u.bottom,c.bottom),c.left=Br(u.left,c.left),c},ih(n,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function oh(n){var e=n.reference,t=n.element,r=n.placement,i=r?bn(r):null,o=r?vi(r):null,a=e.x+e.width/2-t.width/2,s=e.y+e.height/2-t.height/2,c;switch(i){case Tt:c={x:a,y:e.y-t.height};break;case zt:c={x:a,y:e.y+e.height};break;case Ht:c={x:e.x+e.width,y:s};break;case St:c={x:e.x-t.width,y:s};break;default:c={x:e.x,y:e.y}}var d=i?ql(i):null;if(d!=null){var u=d==="y"?"height":"width";switch(o){case mi:c[d]=c[d]-(e[u]/2-t[u]/2);break;case co:c[d]=c[d]+(e[u]/2-t[u]/2);break}}return c}function mo(n,e){e===void 0&&(e={});var t=e,r=t.placement,i=r===void 0?n.placement:r,o=t.strategy,a=o===void 0?n.strategy:o,s=t.boundary,c=s===void 0?GM:s,d=t.rootBoundary,u=d===void 0?jp:d,f=t.elementContext,p=f===void 0?uo:f,h=t.altBoundary,m=h===void 0?!1:h,g=t.padding,k=g===void 0?0:g,x=Zp(typeof k!="number"?k:eh(k,lo)),S=p===uo?QM:uo,T=n.rects.popper,y=n.elements[m?S:p],B=AT(_r(y)?y:y.contextElement||nr(n.elements.popper),c,u,a),w=yi(n.elements.reference),V=oh({reference:w,element:T,strategy:"absolute",placement:i}),$=Jl(Object.assign({},T,V)),M=p===uo?$:w,_={top:B.top-M.top+x.top,bottom:M.bottom-B.bottom+x.bottom,left:B.left-M.left+x.left,right:M.right-B.right+x.right},z=n.modifiersData.offset;if(p===uo&&z){var N=z[i];Object.keys(_).forEach(function(W){var F=[Ht,zt].indexOf(W)>=0?1:-1,O=[Tt,zt].indexOf(W)>=0?"y":"x";_[W]+=N[O]*F})}return _}function ET(n,e){e===void 0&&(e={});var t=e,r=t.placement,i=t.boundary,o=t.rootBoundary,a=t.padding,s=t.flipVariations,c=t.allowedAutoPlacements,d=c===void 0?qp:c,u=vi(r),f=u?s?Wp:Wp.filter(function(m){return vi(m)===u}):lo,p=f.filter(function(m){return d.indexOf(m)>=0});p.length===0&&(p=f);var h=p.reduce(function(m,g){return m[g]=mo(n,{placement:g,boundary:i,rootBoundary:o,padding:a})[bn(g)],m},{});return Object.keys(h).sort(function(m,g){return h[m]-h[g]})}function OT(n){if(bn(n)===Yl)return[];var e=Ma(n);return[nh(n),e,nh(e)]}function NT(n){var e=n.state,t=n.options,r=n.name;if(!e.modifiersData[r]._skip){for(var i=t.mainAxis,o=i===void 0?!0:i,a=t.altAxis,s=a===void 0?!0:a,c=t.fallbackPlacements,d=t.padding,u=t.boundary,f=t.rootBoundary,p=t.altBoundary,h=t.flipVariations,m=h===void 0?!0:h,g=t.allowedAutoPlacements,k=e.options.placement,x=bn(k),S=x===k,T=c||(S||!m?[Ma(k)]:OT(k)),y=[k].concat(T).reduce(function(q,D){return q.concat(bn(D)===Yl?ET(e,{placement:D,boundary:u,rootBoundary:f,padding:d,flipVariations:m,allowedAutoPlacements:g}):D)},[]),B=e.rects.reference,w=e.rects.popper,V=new Map,$=!0,M=y[0],_=0;_<y.length;_++){var z=y[_],N=bn(z),W=vi(z)===mi,F=[Tt,zt].indexOf(N)>=0,O=F?"width":"height",I=mo(e,{placement:z,boundary:u,rootBoundary:f,altBoundary:p,padding:d}),H=F?W?Ht:St:W?zt:Tt;B[O]>w[O]&&(H=Ma(H));var b=Ma(H),C=[];if(o&&C.push(I[N]<=0),s&&C.push(I[H]<=0,I[b]<=0),C.every(function(q){return q})){M=z,$=!1;break}V.set(z,C)}if($)for(var v=m?3:1,A=function(D){var X=y.find(function(ne){var Y=V.get(ne);if(Y)return Y.slice(0,D).every(function(Z){return Z})});if(X)return M=X,"break"},E=v;E>0;E--){var P=A(E);if(P==="break")break}e.placement!==M&&(e.modifiersData[r]._skip=!0,e.placement=M,e.reset=!0)}}const _T={name:"flip",enabled:!0,phase:"main",fn:NT,requiresIfExists:["offset"],data:{_skip:!1}};function ah(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function sh(n){return[Tt,Ht,zt,St].some(function(e){return n[e]>=0})}function BT(n){var e=n.state,t=n.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,a=mo(e,{elementContext:"reference"}),s=mo(e,{altBoundary:!0}),c=ah(a,r),d=ah(s,i,o),u=sh(c),f=sh(d);e.modifiersData[t]={referenceClippingOffsets:c,popperEscapeOffsets:d,isReferenceHidden:u,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const PT={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:BT};function IT(n,e,t){var r=bn(n),i=[St,Tt].indexOf(r)>=0?-1:1,o=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[St,Ht].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function RT(n){var e=n.state,t=n.options,r=n.name,i=t.offset,o=i===void 0?[0,0]:i,a=qp.reduce(function(u,f){return u[f]=IT(f,e.rects,o),u},{}),s=a[e.placement],c=s.x,d=s.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=d),e.modifiersData[r]=a}const VT={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:RT};function LT(n){var e=n.state,t=n.name;e.modifiersData[t]=oh({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const $T={name:"popperOffsets",enabled:!0,phase:"read",fn:LT,data:{}};function FT(n){return n==="x"?"y":"x"}function zT(n){var e=n.state,t=n.options,r=n.name,i=t.mainAxis,o=i===void 0?!0:i,a=t.altAxis,s=a===void 0?!1:a,c=t.boundary,d=t.rootBoundary,u=t.altBoundary,f=t.padding,p=t.tether,h=p===void 0?!0:p,m=t.tetherOffset,g=m===void 0?0:m,k=mo(e,{boundary:c,rootBoundary:d,padding:f,altBoundary:u}),x=bn(e.placement),S=vi(e.placement),T=!S,y=ql(x),B=FT(y),w=e.modifiersData.popperOffsets,V=e.rects.reference,$=e.rects.popper,M=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,_=typeof M=="number"?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),z=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,N={x:0,y:0};if(w){if(o){var W,F=y==="y"?Tt:St,O=y==="y"?zt:Ht,I=y==="y"?"height":"width",H=w[y],b=H+k[F],C=H-k[O],v=h?-$[I]/2:0,A=S===mi?V[I]:$[I],E=S===mi?-$[I]:-V[I],P=e.elements.arrow,q=h&&P?Wl(P):{width:0,height:0},D=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Xp(),X=D[F],ne=D[O],Y=po(0,V[I],q[I]),Z=T?V[I]/2-v-Y-X-_.mainAxis:A-Y-X-_.mainAxis,ce=T?-V[I]/2+v+Y+ne+_.mainAxis:E+Y+ne+_.mainAxis,j=e.elements.arrow&&fo(e.elements.arrow),J=j?y==="y"?j.clientTop||0:j.clientLeft||0:0,de=(W=z==null?void 0:z[y])!=null?W:0,te=H+Z-de-J,Ge=H+ce-de,pt=po(h?ka(b,te):b,H,h?Br(C,Ge):C);w[y]=pt,N[y]=pt-H}if(s){var nn,st=y==="x"?Tt:St,xn=y==="x"?zt:Ht,Bt=w[B],Ut=B==="y"?"height":"width",Nn=Bt+k[st],rn=Bt-k[xn],_n=[Tt,St].indexOf(x)!==-1,or=(nn=z==null?void 0:z[B])!=null?nn:0,ar=_n?Nn:Bt-V[Ut]-$[Ut]-or+_.altAxis,sr=_n?Bt+V[Ut]+$[Ut]-or-_.altAxis:rn,R=h&&_n?uT(ar,Bt,sr):po(h?ar:Nn,Bt,h?sr:rn);w[B]=R,N[B]=R-Bt}e.modifiersData[r]=N}}const HT={name:"preventOverflow",enabled:!0,phase:"main",fn:zT,requiresIfExists:["offset"]};function YT(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function UT(n){return n===Nt(n)||!Yt(n)?Kl(n):YT(n)}function jT(n){var e=n.getBoundingClientRect(),t=gi(e.width)/n.offsetWidth||1,r=gi(e.height)/n.offsetHeight||1;return t!==1||r!==1}function WT(n,e,t){t===void 0&&(t=!1);var r=Yt(e),i=Yt(e)&&jT(e),o=nr(e),a=yi(n,i,t),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!t)&&((vn(e)!=="body"||Ql(o))&&(s=UT(e)),Yt(e)?(c=yi(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):o&&(c.x=Gl(o))),{x:a.left+s.scrollLeft-c.x,y:a.top+s.scrollTop-c.y,width:a.width,height:a.height}}function qT(n){var e=new Map,t=new Set,r=[];n.forEach(function(o){e.set(o.name,o)});function i(o){t.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!t.has(s)){var c=e.get(s);c&&i(c)}}),r.push(o)}return n.forEach(function(o){t.has(o.name)||i(o)}),r}function KT(n){var e=qT(n);return aT.reduce(function(t,r){return t.concat(e.filter(function(i){return i.phase===r}))},[])}function GT(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function QT(n){var e=n.reduce(function(t,r){var i=t[r.name];return t[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,t},{});return Object.keys(e).map(function(t){return e[t]})}var lh={placement:"bottom",modifiers:[],strategy:"absolute"};function ch(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function JT(n){n===void 0&&(n={});var e=n,t=e.defaultModifiers,r=t===void 0?[]:t,i=e.defaultOptions,o=i===void 0?lh:i;return function(s,c,d){d===void 0&&(d=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},lh,o),modifiersData:{},elements:{reference:s,popper:c},attributes:{},styles:{}},f=[],p=!1,h={state:u,setOptions:function(x){var S=typeof x=="function"?x(u.options):x;g(),u.options=Object.assign({},o,u.options,S),u.scrollParents={reference:_r(s)?ho(s):s.contextElement?ho(s.contextElement):[],popper:ho(c)};var T=KT(QT([].concat(r,u.options.modifiers)));return u.orderedModifiers=T.filter(function(y){return y.enabled}),m(),h.update()},forceUpdate:function(){if(!p){var x=u.elements,S=x.reference,T=x.popper;if(ch(S,T)){u.rects={reference:WT(S,fo(T),u.options.strategy==="fixed"),popper:Wl(T)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(_){return u.modifiersData[_.name]=Object.assign({},_.data)});for(var y=0;y<u.orderedModifiers.length;y++){if(u.reset===!0){u.reset=!1,y=-1;continue}var B=u.orderedModifiers[y],w=B.fn,V=B.options,$=V===void 0?{}:V,M=B.name;typeof w=="function"&&(u=w({state:u,options:$,name:M,instance:h})||u)}}}},update:GT(function(){return new Promise(function(k){h.forceUpdate(),k(u)})}),destroy:function(){g(),p=!0}};if(!ch(s,c))return h;h.setOptions(d).then(function(k){!p&&d.onFirstUpdate&&d.onFirstUpdate(k)});function m(){u.orderedModifiers.forEach(function(k){var x=k.name,S=k.options,T=S===void 0?{}:S,y=k.effect;if(typeof y=="function"){var B=y({state:u,name:x,instance:h,options:T}),w=function(){};f.push(B||w)}})}function g(){f.forEach(function(k){return k()}),f=[]}return h}}var XT=[kT,$T,bT,Kp,VT,_T,HT,mT,PT],ZT=JT({defaultModifiers:XT}),eS="tippy-box",dh="tippy-content",tS="tippy-backdrop",uh="tippy-arrow",fh="tippy-svg-arrow",Pr={passive:!0,capture:!0},ph=function(){return document.body};function nS(n,e){return{}.hasOwnProperty.call(n,e)}function Xl(n,e,t){if(Array.isArray(n)){var r=n[e];return r??(Array.isArray(t)?t[e]:t)}return n}function Zl(n,e){var t={}.toString.call(n);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function hh(n,e){return typeof n=="function"?n.apply(void 0,e):n}function mh(n,e){if(e===0)return n;var t;return function(r){clearTimeout(t),t=setTimeout(function(){n(r)},e)}}function rS(n,e){var t=Object.assign({},n);return e.forEach(function(r){delete t[r]}),t}function iS(n){return n.split(/\s+/).filter(Boolean)}function bi(n){return[].concat(n)}function gh(n,e){n.indexOf(e)===-1&&n.push(e)}function oS(n){return n.filter(function(e,t){return n.indexOf(e)===t})}function aS(n){return n.split("-")[0]}function Ta(n){return[].slice.call(n)}function yh(n){return Object.keys(n).reduce(function(e,t){return n[t]!==void 0&&(e[t]=n[t]),e},{})}function go(){return document.createElement("div")}function yo(n){return["Element","Fragment"].some(function(e){return Zl(n,e)})}function sS(n){return Zl(n,"NodeList")}function lS(n){return Zl(n,"MouseEvent")}function cS(n){return!!(n&&n._tippy&&n._tippy.reference===n)}function dS(n){return yo(n)?[n]:sS(n)?Ta(n):Array.isArray(n)?n:Ta(document.querySelectorAll(n))}function ec(n,e){n.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function vh(n,e){n.forEach(function(t){t&&t.setAttribute("data-state",e)})}function uS(n){var e,t=bi(n),r=t[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function fS(n,e){var t=e.clientX,r=e.clientY;return n.every(function(i){var o=i.popperRect,a=i.popperState,s=i.props,c=s.interactiveBorder,d=aS(a.placement),u=a.modifiersData.offset;if(!u)return!0;var f=d==="bottom"?u.top.y:0,p=d==="top"?u.bottom.y:0,h=d==="right"?u.left.x:0,m=d==="left"?u.right.x:0,g=o.top-r+f>c,k=r-o.bottom-p>c,x=o.left-t+h>c,S=t-o.right-m>c;return g||k||x||S})}function tc(n,e,t){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){n[r](i,t)})}function bh(n,e){for(var t=e;t;){var r;if(n.contains(t))return!0;t=t.getRootNode==null||(r=t.getRootNode())==null?void 0:r.host}return!1}var wn={isTouch:!1},wh=0;function pS(){wn.isTouch||(wn.isTouch=!0,window.performance&&document.addEventListener("mousemove",kh))}function kh(){var n=performance.now();n-wh<20&&(wn.isTouch=!1,document.removeEventListener("mousemove",kh)),wh=n}function hS(){var n=document.activeElement;if(cS(n)){var e=n._tippy;n.blur&&!e.state.isVisible&&n.blur()}}function mS(){document.addEventListener("touchstart",pS,Pr),window.addEventListener("blur",hS)}var gS=typeof window<"u"&&typeof document<"u",yS=gS?!!window.msCrypto:!1;function wi(n){var e=n==="destroy"?"n already-":" ";return[n+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function xh(n){var e=/[ \t]{2,}/g,t=/^[ \t]*/gm;return n.replace(e," ").replace(t,"").trim()}function vS(n){return xh(`
160
160
  %ctippy.js
161
161
 
162
- %c`+bh(n)+`
162
+ %c`+xh(n)+`
163
163
 
164
164
  %c👷‍ This is a development-only message. It will be removed in production.
165
- `)}function wh(n){return[sS(n),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var vo;process.env.NODE_ENV!=="production"&&lS();function lS(){vo=new Set}function On(n,e){if(n&&!vo.has(e)){var t;vo.add(e),(t=console).warn.apply(t,wh(e))}}function nc(n,e){if(n&&!vo.has(e)){var t;vo.add(e),(t=console).error.apply(t,wh(e))}}function cS(n){var e=!n,t=Object.prototype.toString.call(n)==="[object Object]"&&!n.addEventListener;nc(e,["tippy() was passed","`"+String(n)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),nc(t,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var kh={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},dS={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},_t=Object.assign({appendTo:dh,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},kh,dS),uS=Object.keys(_t),fS=function(e){process.env.NODE_ENV!=="production"&&Mh(e,[]);var t=Object.keys(e);t.forEach(function(r){_t[r]=e[r]})};function xh(n){var e=n.plugins||[],t=e.reduce(function(r,i){var o=i.name,a=i.defaultValue;if(o){var s;r[o]=n[o]!==void 0?n[o]:(s=_t[o])!=null?s:a}return r},{});return Object.assign({},n,t)}function pS(n,e){var t=e?Object.keys(xh(Object.assign({},_t,{plugins:e}))):uS,r=t.reduce(function(i,o){var a=(n.getAttribute("data-tippy-"+o)||"").trim();if(!a)return i;if(o==="content")i[o]=a;else try{i[o]=JSON.parse(a)}catch{i[o]=a}return i},{});return r}function Ch(n,e){var t=Object.assign({},e,{content:uh(e.content,[n])},e.ignoreAttributes?{}:pS(n,e.plugins));return t.aria=Object.assign({},_t.aria,t.aria),t.aria={expanded:t.aria.expanded==="auto"?e.interactive:t.aria.expanded,content:t.aria.content==="auto"?e.interactive?null:"describedby":t.aria.content},t}function Mh(n,e){n===void 0&&(n={}),e===void 0&&(e=[]);var t=Object.keys(n);t.forEach(function(r){var i=WT(_t,Object.keys(kh)),o=!jT(i,r);o&&(o=e.filter(function(a){return a.name===r}).length===0),On(o,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
165
+ `)}function Ch(n){return[vS(n),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var vo;process.env.NODE_ENV!=="production"&&bS();function bS(){vo=new Set}function On(n,e){if(n&&!vo.has(e)){var t;vo.add(e),(t=console).warn.apply(t,Ch(e))}}function nc(n,e){if(n&&!vo.has(e)){var t;vo.add(e),(t=console).error.apply(t,Ch(e))}}function wS(n){var e=!n,t=Object.prototype.toString.call(n)==="[object Object]"&&!n.addEventListener;nc(e,["tippy() was passed","`"+String(n)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),nc(t,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var Mh={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},kS={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},_t=Object.assign({appendTo:ph,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Mh,kS),xS=Object.keys(_t),CS=function(e){process.env.NODE_ENV!=="production"&&Dh(e,[]);var t=Object.keys(e);t.forEach(function(r){_t[r]=e[r]})};function Th(n){var e=n.plugins||[],t=e.reduce(function(r,i){var o=i.name,a=i.defaultValue;if(o){var s;r[o]=n[o]!==void 0?n[o]:(s=_t[o])!=null?s:a}return r},{});return Object.assign({},n,t)}function MS(n,e){var t=e?Object.keys(Th(Object.assign({},_t,{plugins:e}))):xS,r=t.reduce(function(i,o){var a=(n.getAttribute("data-tippy-"+o)||"").trim();if(!a)return i;if(o==="content")i[o]=a;else try{i[o]=JSON.parse(a)}catch{i[o]=a}return i},{});return r}function Sh(n,e){var t=Object.assign({},e,{content:hh(e.content,[n])},e.ignoreAttributes?{}:MS(n,e.plugins));return t.aria=Object.assign({},_t.aria,t.aria),t.aria={expanded:t.aria.expanded==="auto"?e.interactive:t.aria.expanded,content:t.aria.content==="auto"?e.interactive?null:"describedby":t.aria.content},t}function Dh(n,e){n===void 0&&(n={}),e===void 0&&(e=[]);var t=Object.keys(n);t.forEach(function(r){var i=rS(_t,Object.keys(Mh)),o=!nS(i,r);o&&(o=e.filter(function(a){return a.name===r}).length===0),On(o,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
166
166
 
167
167
  `,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
168
- `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var hS=function(){return"innerHTML"};function rc(n,e){n[hS()]=e}function Th(n){var e=go();return n===!0?e.className=lh:(e.className=ch,yo(n)?e.appendChild(n):rc(e,n)),e}function Sh(n,e){yo(e.content)?(rc(n,""),n.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?rc(n,e.content):n.textContent=e.content)}function ic(n){var e=n.firstElementChild,t=Ta(e.children);return{box:e,content:t.find(function(r){return r.classList.contains(sh)}),arrow:t.find(function(r){return r.classList.contains(lh)||r.classList.contains(ch)}),backdrop:t.find(function(r){return r.classList.contains(UT)})}}function Dh(n){var e=go(),t=go();t.className=YT,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var r=go();r.className=sh,r.setAttribute("data-state","hidden"),Sh(r,n.props),e.appendChild(t),t.appendChild(r),i(n.props,n.props);function i(o,a){var s=ic(e),c=s.box,d=s.content,u=s.arrow;a.theme?c.setAttribute("data-theme",a.theme):c.removeAttribute("data-theme"),typeof a.animation=="string"?c.setAttribute("data-animation",a.animation):c.removeAttribute("data-animation"),a.inertia?c.setAttribute("data-inertia",""):c.removeAttribute("data-inertia"),c.style.maxWidth=typeof a.maxWidth=="number"?a.maxWidth+"px":a.maxWidth,a.role?c.setAttribute("role",a.role):c.removeAttribute("role"),(o.content!==a.content||o.allowHTML!==a.allowHTML)&&Sh(d,n.props),a.arrow?u?o.arrow!==a.arrow&&(c.removeChild(u),c.appendChild(Th(a.arrow))):c.appendChild(Th(a.arrow)):u&&c.removeChild(u)}return{popper:e,onUpdate:i}}Dh.$$tippy=!0;var mS=1,Sa=[],oc=[];function gS(n,e){var t=Ch(n,Object.assign({},_t,xh(hh(e)))),r,i,o,a=!1,s=!1,c=!1,d=!1,u,f,p,h=[],m=fh(te,t.interactiveDebounce),g,k=mS++,x=null,S=KT(t.plugins),T={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},y={id:k,reference:n,popper:go(),popperInstance:x,props:t,state:T,plugins:S,clearDelayTimeouts:or,setProps:ar,setContent:R,show:L,hide:Q,hideWithInteractivity:ee,enable:_n,disable:ir,unmount:Ne,destroy:ht};if(!t.render)return process.env.NODE_ENV!=="production"&&nc(!0,"render() function has not been supplied."),y;var B=t.render(y),w=B.popper,V=B.onUpdate;w.setAttribute("data-tippy-root",""),w.id="tippy-"+y.id,y.popper=w,n._tippy=y,w._tippy=y;var $=S.map(function(U){return U.fn(y)}),M=n.hasAttribute("aria-expanded");return j(),v(),H(),b("onCreate",[y]),t.showOnCreate&&Nn(),w.addEventListener("mouseenter",function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()}),w.addEventListener("mouseleave",function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&F().addEventListener("mousemove",m)}),y;function _(){var U=y.props.touch;return Array.isArray(U)?U:[U,0]}function z(){return _()[0]==="hold"}function N(){var U;return!!((U=y.props.render)!=null&&U.$$tippy)}function W(){return g||n}function F(){var U=W().parentNode;return U?eS(U):document}function O(){return ic(w)}function I(U){return y.state.isMounted&&!y.state.isVisible||wn.isTouch||u&&u.type==="focus"?0:Xl(y.props.delay,U?0:1,_t.delay)}function H(U){U===void 0&&(U=!1),w.style.pointerEvents=y.props.interactive&&!U?"":"none",w.style.zIndex=""+y.props.zIndex}function b(U,ae,fe){if(fe===void 0&&(fe=!0),$.forEach(function(me){me[U]&&me[U].apply(me,ae)}),fe){var xe;(xe=y.props)[U].apply(xe,ae)}}function C(){var U=y.props.aria;if(U.content){var ae="aria-"+U.content,fe=w.id,xe=bi(y.props.triggerTarget||n);xe.forEach(function(me){var Qe=me.getAttribute(ae);if(y.state.isVisible)me.setAttribute(ae,Qe?Qe+" "+fe:fe);else{var Dt=Qe&&Qe.replace(fe,"").trim();Dt?me.setAttribute(ae,Dt):me.removeAttribute(ae)}})}}function v(){if(!(M||!y.props.aria.expanded)){var U=bi(y.props.triggerTarget||n);U.forEach(function(ae){y.props.interactive?ae.setAttribute("aria-expanded",y.state.isVisible&&ae===W()?"true":"false"):ae.removeAttribute("aria-expanded")})}}function A(){F().removeEventListener("mousemove",m),Sa=Sa.filter(function(U){return U!==m})}function E(U){if(!(wn.isTouch&&(c||U.type==="mousedown"))){var ae=U.composedPath&&U.composedPath()[0]||U.target;if(!(y.props.interactive&&gh(w,ae))){if(bi(y.props.triggerTarget||n).some(function(fe){return gh(fe,ae)})){if(wn.isTouch||y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else b("onClickOutside",[y,U]);y.props.hideOnClick===!0&&(y.clearDelayTimeouts(),y.hide(),s=!0,setTimeout(function(){s=!1}),y.state.isMounted||X())}}}function P(){c=!0}function q(){c=!1}function D(){var U=F();U.addEventListener("mousedown",E,!0),U.addEventListener("touchend",E,Pr),U.addEventListener("touchstart",q,Pr),U.addEventListener("touchmove",P,Pr)}function X(){var U=F();U.removeEventListener("mousedown",E,!0),U.removeEventListener("touchend",E,Pr),U.removeEventListener("touchstart",q,Pr),U.removeEventListener("touchmove",P,Pr)}function ne(U,ae){Z(U,function(){!y.state.isVisible&&w.parentNode&&w.parentNode.contains(w)&&ae()})}function Y(U,ae){Z(U,ae)}function Z(U,ae){var fe=O().box;function xe(me){me.target===fe&&(tc(fe,"remove",xe),ae())}if(U===0)return ae();tc(fe,"remove",f),tc(fe,"add",xe),f=xe}function ce(U,ae,fe){fe===void 0&&(fe=!1);var xe=bi(y.props.triggerTarget||n);xe.forEach(function(me){me.addEventListener(U,ae,fe),h.push({node:me,eventType:U,handler:ae,options:fe})})}function j(){z()&&(ce("touchstart",de,{passive:!0}),ce("touchend",Ge,{passive:!0})),qT(y.props.trigger).forEach(function(U){if(U!=="manual")switch(ce(U,de),U){case"mouseenter":ce("mouseleave",Ge);break;case"focus":ce(aS?"focusout":"blur",pt);break;case"focusin":ce("focusout",pt);break}})}function J(){h.forEach(function(U){var ae=U.node,fe=U.eventType,xe=U.handler,me=U.options;ae.removeEventListener(fe,xe,me)}),h=[]}function de(U){var ae,fe=!1;if(!(!y.state.isEnabled||nn(U)||s)){var xe=((ae=u)==null?void 0:ae.type)==="focus";u=U,g=U.currentTarget,v(),!y.state.isVisible&&JT(U)&&Sa.forEach(function(me){return me(U)}),U.type==="click"&&(y.props.trigger.indexOf("mouseenter")<0||a)&&y.props.hideOnClick!==!1&&y.state.isVisible?fe=!0:Nn(U),U.type==="click"&&(a=!fe),fe&&!xe&&rn(U)}}function te(U){var ae=U.target,fe=W().contains(ae)||w.contains(ae);if(!(U.type==="mousemove"&&fe)){var xe=Ut().concat(w).map(function(me){var Qe,Dt=me._tippy,xi=(Qe=Dt.popperInstance)==null?void 0:Qe.state;return xi?{popperRect:me.getBoundingClientRect(),popperState:xi,props:t}:null}).filter(Boolean);tS(xe,U)&&(A(),rn(U))}}function Ge(U){var ae=nn(U)||y.props.trigger.indexOf("click")>=0&&a;if(!ae){if(y.props.interactive){y.hideWithInteractivity(U);return}rn(U)}}function pt(U){y.props.trigger.indexOf("focusin")<0&&U.target!==W()||y.props.interactive&&U.relatedTarget&&w.contains(U.relatedTarget)||rn(U)}function nn(U){return wn.isTouch?z()!==U.type.indexOf("touch")>=0:!1}function st(){xn();var U=y.props,ae=U.popperOptions,fe=U.placement,xe=U.offset,me=U.getReferenceClientRect,Qe=U.moveTransition,Dt=N()?ic(w).arrow:null,xi=me?{getBoundingClientRect:me,contextElement:me.contextElement||W()}:n,Hh={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Oa){var Ci=Oa.state;if(N()){var aA=O(),dc=aA.box;["placement","reference-hidden","escaped"].forEach(function(Na){Na==="placement"?dc.setAttribute("data-placement",Ci.placement):Ci.attributes.popper["data-popper-"+Na]?dc.setAttribute("data-"+Na,""):dc.removeAttribute("data-"+Na)}),Ci.attributes.popper={}}}},Ir=[{name:"offset",options:{offset:xe}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Qe}},Hh];N()&&Dt&&Ir.push({name:"arrow",options:{element:Dt,padding:3}}),Ir.push.apply(Ir,(ae==null?void 0:ae.modifiers)||[]),y.popperInstance=HT(xi,w,Object.assign({},ae,{placement:fe,onFirstUpdate:p,modifiers:Ir}))}function xn(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function Bt(){var U=y.props.appendTo,ae,fe=W();y.props.interactive&&U===dh||U==="parent"?ae=fe.parentNode:ae=uh(U,[fe]),ae.contains(w)||ae.appendChild(w),y.state.isMounted=!0,st(),process.env.NODE_ENV!=="production"&&On(y.props.interactive&&U===_t.appendTo&&fe.nextElementSibling!==w,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
168
+ `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var TS=function(){return"innerHTML"};function rc(n,e){n[TS()]=e}function Ah(n){var e=go();return n===!0?e.className=uh:(e.className=fh,yo(n)?e.appendChild(n):rc(e,n)),e}function Eh(n,e){yo(e.content)?(rc(n,""),n.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?rc(n,e.content):n.textContent=e.content)}function ic(n){var e=n.firstElementChild,t=Ta(e.children);return{box:e,content:t.find(function(r){return r.classList.contains(dh)}),arrow:t.find(function(r){return r.classList.contains(uh)||r.classList.contains(fh)}),backdrop:t.find(function(r){return r.classList.contains(tS)})}}function Oh(n){var e=go(),t=go();t.className=eS,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var r=go();r.className=dh,r.setAttribute("data-state","hidden"),Eh(r,n.props),e.appendChild(t),t.appendChild(r),i(n.props,n.props);function i(o,a){var s=ic(e),c=s.box,d=s.content,u=s.arrow;a.theme?c.setAttribute("data-theme",a.theme):c.removeAttribute("data-theme"),typeof a.animation=="string"?c.setAttribute("data-animation",a.animation):c.removeAttribute("data-animation"),a.inertia?c.setAttribute("data-inertia",""):c.removeAttribute("data-inertia"),c.style.maxWidth=typeof a.maxWidth=="number"?a.maxWidth+"px":a.maxWidth,a.role?c.setAttribute("role",a.role):c.removeAttribute("role"),(o.content!==a.content||o.allowHTML!==a.allowHTML)&&Eh(d,n.props),a.arrow?u?o.arrow!==a.arrow&&(c.removeChild(u),c.appendChild(Ah(a.arrow))):c.appendChild(Ah(a.arrow)):u&&c.removeChild(u)}return{popper:e,onUpdate:i}}Oh.$$tippy=!0;var SS=1,Sa=[],oc=[];function DS(n,e){var t=Sh(n,Object.assign({},_t,Th(yh(e)))),r,i,o,a=!1,s=!1,c=!1,d=!1,u,f,p,h=[],m=mh(te,t.interactiveDebounce),g,k=SS++,x=null,S=oS(t.plugins),T={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},y={id:k,reference:n,popper:go(),popperInstance:x,props:t,state:T,plugins:S,clearDelayTimeouts:ar,setProps:sr,setContent:R,show:L,hide:Q,hideWithInteractivity:ee,enable:_n,disable:or,unmount:Ne,destroy:ht};if(!t.render)return process.env.NODE_ENV!=="production"&&nc(!0,"render() function has not been supplied."),y;var B=t.render(y),w=B.popper,V=B.onUpdate;w.setAttribute("data-tippy-root",""),w.id="tippy-"+y.id,y.popper=w,n._tippy=y,w._tippy=y;var $=S.map(function(U){return U.fn(y)}),M=n.hasAttribute("aria-expanded");return j(),v(),H(),b("onCreate",[y]),t.showOnCreate&&Nn(),w.addEventListener("mouseenter",function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()}),w.addEventListener("mouseleave",function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&F().addEventListener("mousemove",m)}),y;function _(){var U=y.props.touch;return Array.isArray(U)?U:[U,0]}function z(){return _()[0]==="hold"}function N(){var U;return!!((U=y.props.render)!=null&&U.$$tippy)}function W(){return g||n}function F(){var U=W().parentNode;return U?uS(U):document}function O(){return ic(w)}function I(U){return y.state.isMounted&&!y.state.isVisible||wn.isTouch||u&&u.type==="focus"?0:Xl(y.props.delay,U?0:1,_t.delay)}function H(U){U===void 0&&(U=!1),w.style.pointerEvents=y.props.interactive&&!U?"":"none",w.style.zIndex=""+y.props.zIndex}function b(U,ae,fe){if(fe===void 0&&(fe=!0),$.forEach(function(me){me[U]&&me[U].apply(me,ae)}),fe){var xe;(xe=y.props)[U].apply(xe,ae)}}function C(){var U=y.props.aria;if(U.content){var ae="aria-"+U.content,fe=w.id,xe=bi(y.props.triggerTarget||n);xe.forEach(function(me){var Qe=me.getAttribute(ae);if(y.state.isVisible)me.setAttribute(ae,Qe?Qe+" "+fe:fe);else{var Dt=Qe&&Qe.replace(fe,"").trim();Dt?me.setAttribute(ae,Dt):me.removeAttribute(ae)}})}}function v(){if(!(M||!y.props.aria.expanded)){var U=bi(y.props.triggerTarget||n);U.forEach(function(ae){y.props.interactive?ae.setAttribute("aria-expanded",y.state.isVisible&&ae===W()?"true":"false"):ae.removeAttribute("aria-expanded")})}}function A(){F().removeEventListener("mousemove",m),Sa=Sa.filter(function(U){return U!==m})}function E(U){if(!(wn.isTouch&&(c||U.type==="mousedown"))){var ae=U.composedPath&&U.composedPath()[0]||U.target;if(!(y.props.interactive&&bh(w,ae))){if(bi(y.props.triggerTarget||n).some(function(fe){return bh(fe,ae)})){if(wn.isTouch||y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else b("onClickOutside",[y,U]);y.props.hideOnClick===!0&&(y.clearDelayTimeouts(),y.hide(),s=!0,setTimeout(function(){s=!1}),y.state.isMounted||X())}}}function P(){c=!0}function q(){c=!1}function D(){var U=F();U.addEventListener("mousedown",E,!0),U.addEventListener("touchend",E,Pr),U.addEventListener("touchstart",q,Pr),U.addEventListener("touchmove",P,Pr)}function X(){var U=F();U.removeEventListener("mousedown",E,!0),U.removeEventListener("touchend",E,Pr),U.removeEventListener("touchstart",q,Pr),U.removeEventListener("touchmove",P,Pr)}function ne(U,ae){Z(U,function(){!y.state.isVisible&&w.parentNode&&w.parentNode.contains(w)&&ae()})}function Y(U,ae){Z(U,ae)}function Z(U,ae){var fe=O().box;function xe(me){me.target===fe&&(tc(fe,"remove",xe),ae())}if(U===0)return ae();tc(fe,"remove",f),tc(fe,"add",xe),f=xe}function ce(U,ae,fe){fe===void 0&&(fe=!1);var xe=bi(y.props.triggerTarget||n);xe.forEach(function(me){me.addEventListener(U,ae,fe),h.push({node:me,eventType:U,handler:ae,options:fe})})}function j(){z()&&(ce("touchstart",de,{passive:!0}),ce("touchend",Ge,{passive:!0})),iS(y.props.trigger).forEach(function(U){if(U!=="manual")switch(ce(U,de),U){case"mouseenter":ce("mouseleave",Ge);break;case"focus":ce(yS?"focusout":"blur",pt);break;case"focusin":ce("focusout",pt);break}})}function J(){h.forEach(function(U){var ae=U.node,fe=U.eventType,xe=U.handler,me=U.options;ae.removeEventListener(fe,xe,me)}),h=[]}function de(U){var ae,fe=!1;if(!(!y.state.isEnabled||nn(U)||s)){var xe=((ae=u)==null?void 0:ae.type)==="focus";u=U,g=U.currentTarget,v(),!y.state.isVisible&&lS(U)&&Sa.forEach(function(me){return me(U)}),U.type==="click"&&(y.props.trigger.indexOf("mouseenter")<0||a)&&y.props.hideOnClick!==!1&&y.state.isVisible?fe=!0:Nn(U),U.type==="click"&&(a=!fe),fe&&!xe&&rn(U)}}function te(U){var ae=U.target,fe=W().contains(ae)||w.contains(ae);if(!(U.type==="mousemove"&&fe)){var xe=Ut().concat(w).map(function(me){var Qe,Dt=me._tippy,xi=(Qe=Dt.popperInstance)==null?void 0:Qe.state;return xi?{popperRect:me.getBoundingClientRect(),popperState:xi,props:t}:null}).filter(Boolean);fS(xe,U)&&(A(),rn(U))}}function Ge(U){var ae=nn(U)||y.props.trigger.indexOf("click")>=0&&a;if(!ae){if(y.props.interactive){y.hideWithInteractivity(U);return}rn(U)}}function pt(U){y.props.trigger.indexOf("focusin")<0&&U.target!==W()||y.props.interactive&&U.relatedTarget&&w.contains(U.relatedTarget)||rn(U)}function nn(U){return wn.isTouch?z()!==U.type.indexOf("touch")>=0:!1}function st(){xn();var U=y.props,ae=U.popperOptions,fe=U.placement,xe=U.offset,me=U.getReferenceClientRect,Qe=U.moveTransition,Dt=N()?ic(w).arrow:null,xi=me?{getBoundingClientRect:me,contextElement:me.contextElement||W()}:n,jh={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Oa){var Ci=Oa.state;if(N()){var pA=O(),dc=pA.box;["placement","reference-hidden","escaped"].forEach(function(Na){Na==="placement"?dc.setAttribute("data-placement",Ci.placement):Ci.attributes.popper["data-popper-"+Na]?dc.setAttribute("data-"+Na,""):dc.removeAttribute("data-"+Na)}),Ci.attributes.popper={}}}},Ir=[{name:"offset",options:{offset:xe}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Qe}},jh];N()&&Dt&&Ir.push({name:"arrow",options:{element:Dt,padding:3}}),Ir.push.apply(Ir,(ae==null?void 0:ae.modifiers)||[]),y.popperInstance=ZT(xi,w,Object.assign({},ae,{placement:fe,onFirstUpdate:p,modifiers:Ir}))}function xn(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function Bt(){var U=y.props.appendTo,ae,fe=W();y.props.interactive&&U===ph||U==="parent"?ae=fe.parentNode:ae=hh(U,[fe]),ae.contains(w)||ae.appendChild(w),y.state.isMounted=!0,st(),process.env.NODE_ENV!=="production"&&On(y.props.interactive&&U===_t.appendTo&&fe.nextElementSibling!==w,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
169
169
 
170
170
  `,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
171
171
 
172
172
  `,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
173
173
 
174
- `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function Ut(){return Ta(w.querySelectorAll("[data-tippy-root]"))}function Nn(U){y.clearDelayTimeouts(),U&&b("onTrigger",[y,U]),D();var ae=I(!0),fe=_(),xe=fe[0],me=fe[1];wn.isTouch&&xe==="hold"&&me&&(ae=me),ae?r=setTimeout(function(){y.show()},ae):y.show()}function rn(U){if(y.clearDelayTimeouts(),b("onUntrigger",[y,U]),!y.state.isVisible){X();return}if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(U.type)>=0&&a)){var ae=I(!1);ae?i=setTimeout(function(){y.state.isVisible&&y.hide()},ae):o=requestAnimationFrame(function(){y.hide()})}}function _n(){y.state.isEnabled=!0}function ir(){y.hide(),y.state.isEnabled=!1}function or(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function ar(U){if(process.env.NODE_ENV!=="production"&&On(y.state.isDestroyed,wi("setProps")),!y.state.isDestroyed){b("onBeforeUpdate",[y,U]),J();var ae=y.props,fe=Ch(n,Object.assign({},ae,hh(U),{ignoreAttributes:!0}));y.props=fe,j(),ae.interactiveDebounce!==fe.interactiveDebounce&&(A(),m=fh(te,fe.interactiveDebounce)),ae.triggerTarget&&!fe.triggerTarget?bi(ae.triggerTarget).forEach(function(xe){xe.removeAttribute("aria-expanded")}):fe.triggerTarget&&n.removeAttribute("aria-expanded"),v(),H(),V&&V(ae,fe),y.popperInstance&&(st(),Ut().forEach(function(xe){requestAnimationFrame(xe._tippy.popperInstance.forceUpdate)})),b("onAfterUpdate",[y,U])}}function R(U){y.setProps({content:U})}function L(){process.env.NODE_ENV!=="production"&&On(y.state.isDestroyed,wi("show"));var U=y.state.isVisible,ae=y.state.isDestroyed,fe=!y.state.isEnabled,xe=wn.isTouch&&!y.props.touch,me=Xl(y.props.duration,0,_t.duration);if(!(U||ae||fe||xe)&&!W().hasAttribute("disabled")&&(b("onShow",[y],!1),y.props.onShow(y)!==!1)){if(y.state.isVisible=!0,N()&&(w.style.visibility="visible"),H(),D(),y.state.isMounted||(w.style.transition="none"),N()){var Qe=O(),Dt=Qe.box,xi=Qe.content;ec([Dt,xi],0)}p=function(){var Ir;if(!(!y.state.isVisible||d)){if(d=!0,w.offsetHeight,w.style.transition=y.props.moveTransition,N()&&y.props.animation){var cc=O(),Oa=cc.box,Ci=cc.content;ec([Oa,Ci],me),mh([Oa,Ci],"visible")}C(),v(),ph(oc,y),(Ir=y.popperInstance)==null||Ir.forceUpdate(),b("onMount",[y]),y.props.animation&&N()&&Y(me,function(){y.state.isShown=!0,b("onShown",[y])})}},Bt()}}function Q(){process.env.NODE_ENV!=="production"&&On(y.state.isDestroyed,wi("hide"));var U=!y.state.isVisible,ae=y.state.isDestroyed,fe=!y.state.isEnabled,xe=Xl(y.props.duration,1,_t.duration);if(!(U||ae||fe)&&(b("onHide",[y],!1),y.props.onHide(y)!==!1)){if(y.state.isVisible=!1,y.state.isShown=!1,d=!1,a=!1,N()&&(w.style.visibility="hidden"),A(),X(),H(!0),N()){var me=O(),Qe=me.box,Dt=me.content;y.props.animation&&(ec([Qe,Dt],xe),mh([Qe,Dt],"hidden"))}C(),v(),y.props.animation?N()&&ne(xe,y.unmount):y.unmount()}}function ee(U){process.env.NODE_ENV!=="production"&&On(y.state.isDestroyed,wi("hideWithInteractivity")),F().addEventListener("mousemove",m),ph(Sa,m),m(U)}function Ne(){process.env.NODE_ENV!=="production"&&On(y.state.isDestroyed,wi("unmount")),y.state.isVisible&&y.hide(),y.state.isMounted&&(xn(),Ut().forEach(function(U){U._tippy.unmount()}),w.parentNode&&w.parentNode.removeChild(w),oc=oc.filter(function(U){return U!==y}),y.state.isMounted=!1,b("onHidden",[y]))}function ht(){process.env.NODE_ENV!=="production"&&On(y.state.isDestroyed,wi("destroy")),!y.state.isDestroyed&&(y.clearDelayTimeouts(),y.unmount(),J(),delete n._tippy,y.state.isDestroyed=!0,b("onDestroy",[y]))}}function ki(n,e){e===void 0&&(e={});var t=_t.plugins.concat(e.plugins||[]);process.env.NODE_ENV!=="production"&&(cS(n),Mh(e,t)),iS();var r=Object.assign({},e,{plugins:t}),i=ZT(n);if(process.env.NODE_ENV!=="production"){var o=yo(r.content),a=i.length>1;On(o&&a,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
174
+ `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function Ut(){return Ta(w.querySelectorAll("[data-tippy-root]"))}function Nn(U){y.clearDelayTimeouts(),U&&b("onTrigger",[y,U]),D();var ae=I(!0),fe=_(),xe=fe[0],me=fe[1];wn.isTouch&&xe==="hold"&&me&&(ae=me),ae?r=setTimeout(function(){y.show()},ae):y.show()}function rn(U){if(y.clearDelayTimeouts(),b("onUntrigger",[y,U]),!y.state.isVisible){X();return}if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(U.type)>=0&&a)){var ae=I(!1);ae?i=setTimeout(function(){y.state.isVisible&&y.hide()},ae):o=requestAnimationFrame(function(){y.hide()})}}function _n(){y.state.isEnabled=!0}function or(){y.hide(),y.state.isEnabled=!1}function ar(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function sr(U){if(process.env.NODE_ENV!=="production"&&On(y.state.isDestroyed,wi("setProps")),!y.state.isDestroyed){b("onBeforeUpdate",[y,U]),J();var ae=y.props,fe=Sh(n,Object.assign({},ae,yh(U),{ignoreAttributes:!0}));y.props=fe,j(),ae.interactiveDebounce!==fe.interactiveDebounce&&(A(),m=mh(te,fe.interactiveDebounce)),ae.triggerTarget&&!fe.triggerTarget?bi(ae.triggerTarget).forEach(function(xe){xe.removeAttribute("aria-expanded")}):fe.triggerTarget&&n.removeAttribute("aria-expanded"),v(),H(),V&&V(ae,fe),y.popperInstance&&(st(),Ut().forEach(function(xe){requestAnimationFrame(xe._tippy.popperInstance.forceUpdate)})),b("onAfterUpdate",[y,U])}}function R(U){y.setProps({content:U})}function L(){process.env.NODE_ENV!=="production"&&On(y.state.isDestroyed,wi("show"));var U=y.state.isVisible,ae=y.state.isDestroyed,fe=!y.state.isEnabled,xe=wn.isTouch&&!y.props.touch,me=Xl(y.props.duration,0,_t.duration);if(!(U||ae||fe||xe)&&!W().hasAttribute("disabled")&&(b("onShow",[y],!1),y.props.onShow(y)!==!1)){if(y.state.isVisible=!0,N()&&(w.style.visibility="visible"),H(),D(),y.state.isMounted||(w.style.transition="none"),N()){var Qe=O(),Dt=Qe.box,xi=Qe.content;ec([Dt,xi],0)}p=function(){var Ir;if(!(!y.state.isVisible||d)){if(d=!0,w.offsetHeight,w.style.transition=y.props.moveTransition,N()&&y.props.animation){var cc=O(),Oa=cc.box,Ci=cc.content;ec([Oa,Ci],me),vh([Oa,Ci],"visible")}C(),v(),gh(oc,y),(Ir=y.popperInstance)==null||Ir.forceUpdate(),b("onMount",[y]),y.props.animation&&N()&&Y(me,function(){y.state.isShown=!0,b("onShown",[y])})}},Bt()}}function Q(){process.env.NODE_ENV!=="production"&&On(y.state.isDestroyed,wi("hide"));var U=!y.state.isVisible,ae=y.state.isDestroyed,fe=!y.state.isEnabled,xe=Xl(y.props.duration,1,_t.duration);if(!(U||ae||fe)&&(b("onHide",[y],!1),y.props.onHide(y)!==!1)){if(y.state.isVisible=!1,y.state.isShown=!1,d=!1,a=!1,N()&&(w.style.visibility="hidden"),A(),X(),H(!0),N()){var me=O(),Qe=me.box,Dt=me.content;y.props.animation&&(ec([Qe,Dt],xe),vh([Qe,Dt],"hidden"))}C(),v(),y.props.animation?N()&&ne(xe,y.unmount):y.unmount()}}function ee(U){process.env.NODE_ENV!=="production"&&On(y.state.isDestroyed,wi("hideWithInteractivity")),F().addEventListener("mousemove",m),gh(Sa,m),m(U)}function Ne(){process.env.NODE_ENV!=="production"&&On(y.state.isDestroyed,wi("unmount")),y.state.isVisible&&y.hide(),y.state.isMounted&&(xn(),Ut().forEach(function(U){U._tippy.unmount()}),w.parentNode&&w.parentNode.removeChild(w),oc=oc.filter(function(U){return U!==y}),y.state.isMounted=!1,b("onHidden",[y]))}function ht(){process.env.NODE_ENV!=="production"&&On(y.state.isDestroyed,wi("destroy")),!y.state.isDestroyed&&(y.clearDelayTimeouts(),y.unmount(),J(),delete n._tippy,y.state.isDestroyed=!0,b("onDestroy",[y]))}}function ki(n,e){e===void 0&&(e={});var t=_t.plugins.concat(e.plugins||[]);process.env.NODE_ENV!=="production"&&(wS(n),Dh(e,t)),mS();var r=Object.assign({},e,{plugins:t}),i=dS(n);if(process.env.NODE_ENV!=="production"){var o=yo(r.content),a=i.length>1;On(o&&a,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
175
175
 
176
176
  `,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
177
177
 
178
178
  `,`1) content: element.innerHTML
179
- `,"2) content: () => element.cloneNode(true)"].join(" "))}var s=i.reduce(function(c,d){var u=d&&gS(d,r);return u&&c.push(u),c},[]);return yo(n)?s[0]:s}ki.defaultProps=_t,ki.setDefaultProps=fS,ki.currentInput=wn,Object.assign({},jp,{effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow)}}),ki.setDefaultProps({render:Dh});class yS{constructor({editor:e,element:t,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:a}){this.preventHide=!1,this.shouldShow=({view:s,state:c,from:d,to:u})=>{const{doc:f,selection:p}=c,{empty:h}=p,m=!f.textBetween(d,u).length&&Il(c.selection),g=this.element.contains(document.activeElement);return!(!(s.hasFocus()||g)||h||m||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var c;if(this.preventHide){this.preventHide=!1;return}s!=null&&s.relatedTarget&&(!((c=this.element.parentNode)===null||c===void 0)&&c.contains(s.relatedTarget))||this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.handleDebouncedUpdate=(s,c)=>{const d=!(c!=null&&c.selection.eq(s.state.selection)),u=!(c!=null&&c.doc.eq(s.state.doc));!d&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(s,d,u,c)},this.updateDelay))},this.updateHandler=(s,c,d,u)=>{var f,p,h;const{state:m,composing:g}=s,{selection:k}=m;if(g||!c&&!d)return;this.createTooltip();const{ranges:S}=k,T=Math.min(...S.map(w=>w.$from.pos)),y=Math.max(...S.map(w=>w.$to.pos));if(!((f=this.shouldShow)===null||f===void 0?void 0:f.call(this,{editor:this.editor,view:s,state:m,oldState:u,from:T,to:y}))){this.hide();return}(p=this.tippy)===null||p===void 0||p.setProps({getReferenceClientRect:((h=this.tippyOptions)===null||h===void 0?void 0:h.getReferenceClientRect)||(()=>{if(yM(m.selection)){let w=s.nodeDOM(T);const V=w.dataset.nodeViewWrapper?w:w.querySelector("[data-node-view-wrapper]");if(V&&(w=V.firstChild),w)return w.getBoundingClientRect()}return Fp(s,T,y)})}),this.show()},this.editor=e,this.element=t,this.view=r,this.updateDelay=o,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;this.tippy||!t||(this.tippy=ki(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,t){const{state:r}=e,i=r.selection.$from.pos!==r.selection.$to.pos;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,t);return}const o=!(t!=null&&t.selection.eq(e.state.selection)),a=!(t!=null&&t.doc.eq(e.state.doc));this.updateHandler(e,o,a,t)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,t;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(t=this.tippy)===null||t===void 0||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Ah=n=>new Ct({key:typeof n.pluginKey=="string"?new hn(n.pluginKey):n.pluginKey,view:e=>new yS({view:e,...n})});ft.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Ah({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class vS{constructor({editor:e,element:t,view:r,tippyOptions:i={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:a,state:s})=>{const{selection:c}=s,{$anchor:d,empty:u}=c,f=d.depth===1,p=d.parent.isTextblock&&!d.parent.type.spec.code&&!d.parent.textContent;return!(!a.hasFocus()||!u||!f||!p||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var s;if(this.preventHide){this.preventHide=!1;return}a!=null&&a.relatedTarget&&(!((s=this.element.parentNode)===null||s===void 0)&&s.contains(a.relatedTarget))||this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.editor=e,this.element=t,this.view=r,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;this.tippy||!t||(this.tippy=ki(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,t){var r,i,o;const{state:a}=e,{doc:s,selection:c}=a,{from:d,to:u}=c;if(t&&t.doc.eq(s)&&t.selection.eq(c))return;if(this.createTooltip(),!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:e,state:a,oldState:t}))){this.hide();return}(i=this.tippy)===null||i===void 0||i.setProps({getReferenceClientRect:((o=this.tippyOptions)===null||o===void 0?void 0:o.getReferenceClientRect)||(()=>Fp(e,d,u))}),this.show()}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,t;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(t=this.tippy)===null||t===void 0||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Eh=n=>new Ct({key:typeof n.pluginKey=="string"?new hn(n.pluginKey):n.pluginKey,view:e=>new vS({view:e,...n})});ft.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Eh({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}}),l.defineComponent({name:"BubbleMenu",props:{pluginKey:{type:[String,Object],default:"bubbleMenu"},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(n,{slots:e}){const t=l.ref(null);return l.onMounted(()=>{const{updateDelay:r,editor:i,pluginKey:o,shouldShow:a,tippyOptions:s}=n;i.registerPlugin(Ah({updateDelay:r,editor:i,element:t.value,pluginKey:o,shouldShow:a,tippyOptions:s}))}),l.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=n;i.unregisterPlugin(r)}),()=>{var r;return l.h("div",{ref:t},(r=e.default)===null||r===void 0?void 0:r.call(e))}}});function Oh(n){return l.customRef((e,t)=>({get(){return e(),n},set(r){n=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{t()})})}}))}class bS extends RM{constructor(e={}){return super(e),this.vueRenderers=l.reactive(new Map),this.contentComponent=null,this.reactiveState=Oh(this.view.state),this.reactiveExtensionStorage=Oh(this.extensionStorage),this.on("transaction",()=>{this.reactiveState.value=this.view.state,this.reactiveExtensionStorage.value=this.extensionStorage}),l.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,t){super.registerPlugin(e,t),this.reactiveState.value=this.view.state}unregisterPlugin(e){super.unregisterPlugin(e),this.reactiveState.value=this.view.state}}const wS=l.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(n){const e=l.ref(),t=l.getCurrentInstance();return l.watchEffect(()=>{const r=n.editor;r&&r.options.element&&e.value&&l.nextTick(()=>{if(!e.value||!r.options.element.firstChild)return;const i=l.unref(e.value);e.value.append(...r.options.element.childNodes),r.contentComponent=t.ctx._,r.setOptions({element:i}),r.createNodeViews()})}),l.onBeforeUnmount(()=>{const r=n.editor;if(!r||(r.isDestroyed||r.view.setProps({nodeViews:{}}),r.contentComponent=null,!r.options.element.firstChild))return;const i=document.createElement("div");i.append(...r.options.element.childNodes),r.setOptions({element:i})}),{rootEl:e}},render(){const n=[];return this.editor&&this.editor.vueRenderers.forEach(e=>{const t=l.h(l.Teleport,{to:e.teleportElement,key:e.id},l.h(e.component,{ref:e.id,...e.props}));n.push(t)}),l.h("div",{ref:e=>{this.rootEl=e}},...n)}});l.defineComponent({name:"FloatingMenu",props:{pluginKey:{type:null,default:"floatingMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(n,{slots:e}){const t=l.ref(null);return l.onMounted(()=>{const{pluginKey:r,editor:i,tippyOptions:o,shouldShow:a}=n;i.registerPlugin(Eh({pluginKey:r,editor:i,element:t.value,tippyOptions:o,shouldShow:a}))}),l.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=n;i.unregisterPlugin(r)}),()=>{var r;return l.h("div",{ref:t},(r=e.default)===null||r===void 0?void 0:r.call(e))}}}),l.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return l.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),l.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var n,e;return l.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(n=this.$slots).default)===null||e===void 0?void 0:e.call(n))}});const kS=(n={})=>{const e=l.shallowRef();return l.onMounted(()=>{e.value=new bS(n)}),l.onBeforeUnmount(()=>{var t;(t=e.value)===null||t===void 0||t.destroy()}),e},xS=/^\s*>\s$/,CS=Ot.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return["blockquote",We(this.options.HTMLAttributes,n),0]},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn(this.name),toggleBlockquote:()=>({commands:n})=>n.toggleWrap(this.name),unsetBlockquote:()=>({commands:n})=>n.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[so({find:xS,type:this.type})]}}),MS=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,TS=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,SS=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,DS=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,AS=en.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:n=>n.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:n=>/^(bold(er)?|[5-9]\d{2,})$/.test(n)&&null}]},renderHTML({HTMLAttributes:n}){return["strong",We(this.options.HTMLAttributes,n),0]},addCommands(){return{setBold:()=>({commands:n})=>n.setMark(this.name),toggleBold:()=>({commands:n})=>n.toggleMark(this.name),unsetBold:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Or({find:MS,type:this.type}),Or({find:SS,type:this.type})]},addPasteRules(){return[Nr({find:TS,type:this.type}),Nr({find:DS,type:this.type})]}}),ES=Ot.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",We(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Nh=en.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:n=>n.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["span",We(this.options.HTMLAttributes,n),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:n,commands:e})=>{const t=ba(n,this.type);return Object.entries(t).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),_h=/^\s*([-+*])\s$/,OS=Ot.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:n}){return["ul",We(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleBulletList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ES.name,this.editor.getAttributes(Nh.name)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let n=so({find:_h,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(n=so({find:_h,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Nh.name),editor:this.editor})),[n]}}),NS=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,_S=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,BS=en.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:n}){return["code",We(this.options.HTMLAttributes,n),0]},addCommands(){return{setCode:()=>({commands:n})=>n.setMark(this.name),toggleCode:()=>({commands:n})=>n.toggleMark(this.name),unsetCode:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Or({find:NS,type:this.type})]},addPasteRules(){return[Nr({find:_S,type:this.type})]}}),PS=/^```([a-z]+)?[\s\n]$/,IS=/^~~~([a-z]+)?[\s\n]$/,RS=Ot.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:n=>{var e;const{languageClassPrefix:t}=this.options,o=[...((e=n.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(a=>a.startsWith(t)).map(a=>a.replace(t,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:n,HTMLAttributes:e}){return["pre",We(this.options.HTMLAttributes,e),["code",{class:n.attrs.language?this.options.languageClassPrefix+n.attrs.language:null},0]]},addCommands(){return{setCodeBlock:n=>({commands:e})=>e.setNode(this.name,n),toggleCodeBlock:n=>({commands:e})=>e.toggleNode(this.name,"paragraph",n)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:n,$anchor:e}=this.editor.state.selection,t=e.pos===1;return!n||e.parent.type.name!==this.name?!1:t||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:n})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=n,{selection:t}=e,{$from:r,empty:i}=t;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,a=r.parent.textContent.endsWith(`
179
+ `,"2) content: () => element.cloneNode(true)"].join(" "))}var s=i.reduce(function(c,d){var u=d&&DS(d,r);return u&&c.push(u),c},[]);return yo(n)?s[0]:s}ki.defaultProps=_t,ki.setDefaultProps=CS,ki.currentInput=wn,Object.assign({},Kp,{effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow)}}),ki.setDefaultProps({render:Oh});class AS{constructor({editor:e,element:t,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:a}){this.preventHide=!1,this.shouldShow=({view:s,state:c,from:d,to:u})=>{const{doc:f,selection:p}=c,{empty:h}=p,m=!f.textBetween(d,u).length&&Il(c.selection),g=this.element.contains(document.activeElement);return!(!(s.hasFocus()||g)||h||m||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var c;if(this.preventHide){this.preventHide=!1;return}s!=null&&s.relatedTarget&&(!((c=this.element.parentNode)===null||c===void 0)&&c.contains(s.relatedTarget))||this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.handleDebouncedUpdate=(s,c)=>{const d=!(c!=null&&c.selection.eq(s.state.selection)),u=!(c!=null&&c.doc.eq(s.state.doc));!d&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(s,d,u,c)},this.updateDelay))},this.updateHandler=(s,c,d,u)=>{var f,p,h;const{state:m,composing:g}=s,{selection:k}=m;if(g||!c&&!d)return;this.createTooltip();const{ranges:S}=k,T=Math.min(...S.map(w=>w.$from.pos)),y=Math.max(...S.map(w=>w.$to.pos));if(!((f=this.shouldShow)===null||f===void 0?void 0:f.call(this,{editor:this.editor,view:s,state:m,oldState:u,from:T,to:y}))){this.hide();return}(p=this.tippy)===null||p===void 0||p.setProps({getReferenceClientRect:((h=this.tippyOptions)===null||h===void 0?void 0:h.getReferenceClientRect)||(()=>{if(AM(m.selection)){let w=s.nodeDOM(T);const V=w.dataset.nodeViewWrapper?w:w.querySelector("[data-node-view-wrapper]");if(V&&(w=V.firstChild),w)return w.getBoundingClientRect()}return Yp(s,T,y)})}),this.show()},this.editor=e,this.element=t,this.view=r,this.updateDelay=o,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;this.tippy||!t||(this.tippy=ki(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,t){const{state:r}=e,i=r.selection.$from.pos!==r.selection.$to.pos;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,t);return}const o=!(t!=null&&t.selection.eq(e.state.selection)),a=!(t!=null&&t.doc.eq(e.state.doc));this.updateHandler(e,o,a,t)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,t;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(t=this.tippy)===null||t===void 0||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Nh=n=>new Ct({key:typeof n.pluginKey=="string"?new hn(n.pluginKey):n.pluginKey,view:e=>new AS({view:e,...n})});ft.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Nh({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class ES{constructor({editor:e,element:t,view:r,tippyOptions:i={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:a,state:s})=>{const{selection:c}=s,{$anchor:d,empty:u}=c,f=d.depth===1,p=d.parent.isTextblock&&!d.parent.type.spec.code&&!d.parent.textContent;return!(!a.hasFocus()||!u||!f||!p||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var s;if(this.preventHide){this.preventHide=!1;return}a!=null&&a.relatedTarget&&(!((s=this.element.parentNode)===null||s===void 0)&&s.contains(a.relatedTarget))||this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.editor=e,this.element=t,this.view=r,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;this.tippy||!t||(this.tippy=ki(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,t){var r,i,o;const{state:a}=e,{doc:s,selection:c}=a,{from:d,to:u}=c;if(t&&t.doc.eq(s)&&t.selection.eq(c))return;if(this.createTooltip(),!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:e,state:a,oldState:t}))){this.hide();return}(i=this.tippy)===null||i===void 0||i.setProps({getReferenceClientRect:((o=this.tippyOptions)===null||o===void 0?void 0:o.getReferenceClientRect)||(()=>Yp(e,d,u))}),this.show()}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,t;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(t=this.tippy)===null||t===void 0||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const _h=n=>new Ct({key:typeof n.pluginKey=="string"?new hn(n.pluginKey):n.pluginKey,view:e=>new ES({view:e,...n})});ft.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[_h({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}}),l.defineComponent({name:"BubbleMenu",props:{pluginKey:{type:[String,Object],default:"bubbleMenu"},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(n,{slots:e}){const t=l.ref(null);return l.onMounted(()=>{const{updateDelay:r,editor:i,pluginKey:o,shouldShow:a,tippyOptions:s}=n;i.registerPlugin(Nh({updateDelay:r,editor:i,element:t.value,pluginKey:o,shouldShow:a,tippyOptions:s}))}),l.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=n;i.unregisterPlugin(r)}),()=>{var r;return l.h("div",{ref:t},(r=e.default)===null||r===void 0?void 0:r.call(e))}}});function Bh(n){return l.customRef((e,t)=>({get(){return e(),n},set(r){n=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{t()})})}}))}class OS extends qM{constructor(e={}){return super(e),this.vueRenderers=l.reactive(new Map),this.contentComponent=null,this.reactiveState=Bh(this.view.state),this.reactiveExtensionStorage=Bh(this.extensionStorage),this.on("transaction",()=>{this.reactiveState.value=this.view.state,this.reactiveExtensionStorage.value=this.extensionStorage}),l.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,t){super.registerPlugin(e,t),this.reactiveState.value=this.view.state}unregisterPlugin(e){super.unregisterPlugin(e),this.reactiveState.value=this.view.state}}const NS=l.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(n){const e=l.ref(),t=l.getCurrentInstance();return l.watchEffect(()=>{const r=n.editor;r&&r.options.element&&e.value&&l.nextTick(()=>{if(!e.value||!r.options.element.firstChild)return;const i=l.unref(e.value);e.value.append(...r.options.element.childNodes),r.contentComponent=t.ctx._,r.setOptions({element:i}),r.createNodeViews()})}),l.onBeforeUnmount(()=>{const r=n.editor;if(!r||(r.isDestroyed||r.view.setProps({nodeViews:{}}),r.contentComponent=null,!r.options.element.firstChild))return;const i=document.createElement("div");i.append(...r.options.element.childNodes),r.setOptions({element:i})}),{rootEl:e}},render(){const n=[];return this.editor&&this.editor.vueRenderers.forEach(e=>{const t=l.h(l.Teleport,{to:e.teleportElement,key:e.id},l.h(e.component,{ref:e.id,...e.props}));n.push(t)}),l.h("div",{ref:e=>{this.rootEl=e}},...n)}});l.defineComponent({name:"FloatingMenu",props:{pluginKey:{type:null,default:"floatingMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(n,{slots:e}){const t=l.ref(null);return l.onMounted(()=>{const{pluginKey:r,editor:i,tippyOptions:o,shouldShow:a}=n;i.registerPlugin(_h({pluginKey:r,editor:i,element:t.value,tippyOptions:o,shouldShow:a}))}),l.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=n;i.unregisterPlugin(r)}),()=>{var r;return l.h("div",{ref:t},(r=e.default)===null||r===void 0?void 0:r.call(e))}}}),l.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return l.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),l.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var n,e;return l.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(n=this.$slots).default)===null||e===void 0?void 0:e.call(n))}});const _S=(n={})=>{const e=l.shallowRef();return l.onMounted(()=>{e.value=new OS(n)}),l.onBeforeUnmount(()=>{var t;(t=e.value)===null||t===void 0||t.destroy()}),e},BS=/^\s*>\s$/,PS=Ot.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return["blockquote",We(this.options.HTMLAttributes,n),0]},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn(this.name),toggleBlockquote:()=>({commands:n})=>n.toggleWrap(this.name),unsetBlockquote:()=>({commands:n})=>n.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[so({find:BS,type:this.type})]}}),IS=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,RS=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,VS=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,LS=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,$S=en.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:n=>n.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:n=>/^(bold(er)?|[5-9]\d{2,})$/.test(n)&&null}]},renderHTML({HTMLAttributes:n}){return["strong",We(this.options.HTMLAttributes,n),0]},addCommands(){return{setBold:()=>({commands:n})=>n.setMark(this.name),toggleBold:()=>({commands:n})=>n.toggleMark(this.name),unsetBold:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Or({find:IS,type:this.type}),Or({find:VS,type:this.type})]},addPasteRules(){return[Nr({find:RS,type:this.type}),Nr({find:LS,type:this.type})]}}),FS=Ot.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",We(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Ph=en.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:n=>n.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["span",We(this.options.HTMLAttributes,n),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:n,commands:e})=>{const t=ba(n,this.type);return Object.entries(t).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Ih=/^\s*([-+*])\s$/,zS=Ot.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:n}){return["ul",We(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleBulletList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(FS.name,this.editor.getAttributes(Ph.name)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let n=so({find:Ih,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(n=so({find:Ih,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Ph.name),editor:this.editor})),[n]}}),HS=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,YS=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,US=en.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:n}){return["code",We(this.options.HTMLAttributes,n),0]},addCommands(){return{setCode:()=>({commands:n})=>n.setMark(this.name),toggleCode:()=>({commands:n})=>n.toggleMark(this.name),unsetCode:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Or({find:HS,type:this.type})]},addPasteRules(){return[Nr({find:YS,type:this.type})]}}),jS=/^```([a-z]+)?[\s\n]$/,WS=/^~~~([a-z]+)?[\s\n]$/,qS=Ot.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:n=>{var e;const{languageClassPrefix:t}=this.options,o=[...((e=n.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(a=>a.startsWith(t)).map(a=>a.replace(t,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:n,HTMLAttributes:e}){return["pre",We(this.options.HTMLAttributes,e),["code",{class:n.attrs.language?this.options.languageClassPrefix+n.attrs.language:null},0]]},addCommands(){return{setCodeBlock:n=>({commands:e})=>e.setNode(this.name,n),toggleCodeBlock:n=>({commands:e})=>e.toggleNode(this.name,"paragraph",n)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:n,$anchor:e}=this.editor.state.selection,t=e.pos===1;return!n||e.parent.type.name!==this.name?!1:t||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:n})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=n,{selection:t}=e,{$from:r,empty:i}=t;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,a=r.parent.textContent.endsWith(`
180
180
 
181
- `);return!o||!a?!1:n.chain().command(({tr:s})=>(s.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:n})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=n,{selection:t,doc:r}=e,{$from:i,empty:o}=t;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const s=i.after();return s===void 0||r.nodeAt(s)?!1:n.commands.exitCode()}}},addInputRules(){return[Hl({find:PS,type:this.type,getAttributes:n=>({language:n[1]})}),Hl({find:IS,type:this.type,getAttributes:n=>({language:n[1]})})]},addProseMirrorPlugins(){return[new Ct({key:new hn("codeBlockVSCodeHandler"),props:{handlePaste:(n,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const t=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!t||!o)return!1;const{tr:a}=n.state;return a.replaceSelectionWith(this.type.create({language:o})),a.setSelection(ge.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.insertText(t.replace(/\r\n?/g,`
182
- `)),a.setMeta("paste",!0),n.dispatch(a),!0}}})]}}),VS=Ot.create({name:"doc",topNode:!0,content:"block+"});function LS(n={}){return new Ct({view(e){return new $S(e,n)}})}class $S{constructor(e,t){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=t.width)!==null&&r!==void 0?r:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=a=>{this[i](a)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,r;if(t){let s=e.nodeBefore,c=e.nodeAfter;if(s||c){let d=this.editorView.nodeDOM(this.cursorPos-(s?s.nodeSize:0));if(d){let u=d.getBoundingClientRect(),f=s?u.bottom:u.top;s&&c&&(f=(f+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:u.left,right:u.right,top:f-this.width/2,bottom:f+this.width/2}}}}if(!r){let s=this.editorView.coordsAtPos(this.cursorPos);r={left:s.left-this.width/2,right:s.left+this.width/2,top:s.top,bottom:s.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let o,a;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,a=-pageYOffset;else{let s=i.getBoundingClientRect();o=s.left-i.scrollLeft,a=s.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-a+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,t,e):i;if(t&&!o){let a=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let s=Ju(this.editorView.state.doc,a,this.editorView.dragging.slice);s!=null&&(a=s)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const FS=ft.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[LS(this.options)]}});class $e extends ye{constructor(e){super(e,e)}map(e,t){let r=e.resolve(t.map(this.head));return $e.valid(r)?new $e(r):ye.near(r)}content(){return ie.empty}eq(e){return e instanceof $e&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new $e(e.resolve(t.pos))}getBookmark(){return new ac(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!zS(e)||!HS(e))return!1;let r=t.type.spec.allowGapCursor;if(r!=null)return r;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,r=!1){e:for(;;){if(!r&&$e.valid(e))return e;let i=e.pos,o=null;for(let a=e.depth;;a--){let s=e.node(a);if(t>0?e.indexAfter(a)<s.childCount:e.index(a)>0){o=s.child(t>0?e.indexAfter(a):e.index(a)-1);break}else if(a==0)return null;i+=t;let c=e.doc.resolve(i);if($e.valid(c))return c}for(;;){let a=t>0?o.firstChild:o.lastChild;if(!a){if(o.isAtom&&!o.isText&&!he.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*t),r=!1;continue e}break}o=a,i+=t;let s=e.doc.resolve(i);if($e.valid(s))return s}return null}}}$e.prototype.visible=!1,$e.findFrom=$e.findGapCursorFrom,ye.jsonID("gapcursor",$e);class ac{constructor(e){this.pos=e}map(e){return new ac(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return $e.valid(t)?new $e(t):ye.near(t)}}function zS(n){for(let e=n.depth;e>=0;e--){let t=n.index(e),r=n.node(e);if(t==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function HS(n){for(let e=n.depth;e>=0;e--){let t=n.indexAfter(e),r=n.node(e);if(t==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function YS(){return new Ct({props:{decorations:qS,createSelectionBetween(n,e,t){return e.pos==t.pos&&$e.valid(t)?new $e(t):null},handleClick:jS,handleKeyDown:US,handleDOMEvents:{beforeinput:WS}}})}const US=wp({ArrowLeft:Da("horiz",-1),ArrowRight:Da("horiz",1),ArrowUp:Da("vert",-1),ArrowDown:Da("vert",1)});function Da(n,e){const t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let a=r.selection,s=e>0?a.$to:a.$from,c=a.empty;if(a instanceof ge){if(!o.endOfTextblock(t)||s.depth==0)return!1;c=!1,s=r.doc.resolve(e>0?s.after():s.before())}let d=$e.findGapCursorFrom(s,e,c);return d?(i&&i(r.tr.setSelection(new $e(d))),!0):!1}}function jS(n,e,t){if(!n||!n.editable)return!1;let r=n.state.doc.resolve(e);if(!$e.valid(r))return!1;let i=n.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&he.isSelectable(n.state.doc.nodeAt(i.inside))?!1:(n.dispatch(n.state.tr.setSelection(new $e(r))),!0)}function WS(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof $e))return!1;let{$from:t}=n.state.selection,r=t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);if(!r)return!1;let i=K.empty;for(let a=r.length-1;a>=0;a--)i=K.from(r[a].createAndFill(null,i));let o=n.state.tr.replace(t.pos,t.pos,new ie(i,0,0));return o.setSelection(ge.near(o.doc.resolve(t.pos+1))),n.dispatch(o),!1}function qS(n){if(!(n.selection instanceof $e))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Ke.create(n.doc,[Ft.widget(n.selection.head,e,{key:"gapcursor"})])}const KS=ft.create({name:"gapCursor",addProseMirrorPlugins(){return[YS()]},extendNodeSchema(n){var e;const t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=ve(le(n,"allowGapCursor",t)))!==null&&e!==void 0?e:null}}}),GS=Ot.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:n}){return["br",We(this.options.HTMLAttributes,n)]},renderText(){return`
183
- `},addCommands(){return{setHardBreak:()=>({commands:n,chain:e,state:t,editor:r})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:i,storedMarks:o}=t;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:s}=r.extensionManager,c=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:u})=>{if(u&&c&&a){const f=c.filter(p=>s.includes(p.type.name));d.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),QS=Ot.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,We(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>Hl({find:new RegExp(`^(#{1,${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}});var Aa=200,tt=function(){};tt.prototype.append=function(e){return e.length?(e=tt.from(e),!this.length&&e||e.length<Aa&&this.leafAppend(e)||this.length<Aa&&e.leafPrepend(this)||this.appendInner(e)):this},tt.prototype.prepend=function(e){return e.length?tt.from(e).append(this):this},tt.prototype.appendInner=function(e){return new JS(this,e)},tt.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?tt.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},tt.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},tt.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)},tt.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,a){return i.push(e(o,a))},t,r),i},tt.from=function(e){return e instanceof tt?e:e&&e.length?new Bh(e):tt.empty};var Bh=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,a,s){for(var c=o;c<a;c++)if(i(this.values[c],s+c)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,a,s){for(var c=o-1;c>=a;c--)if(i(this.values[c],s+c)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Aa)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Aa)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(tt);tt.empty=new Bh([]);var JS=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,a){var s=this.left.length;if(i<s&&this.left.forEachInner(r,i,Math.min(o,s),a)===!1||o>s&&this.right.forEachInner(r,Math.max(i-s,0),Math.min(this.length,o)-s,a+s)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,a){var s=this.left.length;if(i>s&&this.right.forEachInvertedInner(r,i-s,Math.max(o,s)-s,a+s)===!1||o<s&&this.left.forEachInvertedInner(r,Math.min(i,s),o,a)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(tt);const XS=500;class tn{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;t&&(i=this.remapping(r,this.items.length),o=i.maps.length);let a=e.tr,s,c,d=[],u=[];return this.items.forEach((f,p)=>{if(!f.step){i||(i=this.remapping(r,p+1),o=i.maps.length),o--,u.push(f);return}if(i){u.push(new kn(f.map));let h=f.step.map(i.slice(o)),m;h&&a.maybeStep(h).doc&&(m=a.mapping.maps[a.mapping.maps.length-1],d.push(new kn(m,void 0,void 0,d.length+u.length))),o--,m&&i.appendMap(m,o)}else a.maybeStep(f.step);if(f.selection)return s=i?f.selection.map(i.slice(o)):f.selection,c=new tn(this.items.slice(0,r).append(u.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:a,selection:s}}addTransform(e,t,r,i){let o=[],a=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let u=0;u<e.steps.length;u++){let f=e.steps[u].invert(e.docs[u]),p=new kn(e.mapping.maps[u],f,t),h;(h=c&&c.merge(p))&&(p=h,u?o.pop():s=s.slice(0,s.length-1)),o.push(p),t&&(a++,t=void 0),i||(c=p)}let d=a-r.depth;return d>eD&&(s=ZS(s,d),a-=d),new tn(s.append(o),a)}remapping(e,t){let r=new Zr;return this.items.forEach((i,o)=>{let a=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},e,t),r}addMaps(e){return this.eventCount==0?this:new tn(this.items.append(e.map(t=>new kn(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,a=e.steps.length,s=this.eventCount;this.items.forEach(p=>{p.selection&&s--},i);let c=t;this.items.forEach(p=>{let h=o.getMirror(--c);if(h==null)return;a=Math.min(a,h);let m=o.maps[h];if(p.step){let g=e.steps[h].invert(e.docs[h]),k=p.selection&&p.selection.map(o.slice(c+1,h));k&&s++,r.push(new kn(m,g,k))}else r.push(new kn(m))},i);let d=[];for(let p=t;p<a;p++)d.push(new kn(o.maps[p]));let u=this.items.slice(0,i).append(d).append(r),f=new tn(u,s);return f.emptyItemCount()>XS&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],o=0;return this.items.forEach((a,s)=>{if(s>=e)i.push(a),a.selection&&o++;else if(a.step){let c=a.step.map(t.slice(r)),d=c&&c.getMap();if(r--,d&&t.appendMap(d,r),c){let u=a.selection&&a.selection.map(t.slice(r));u&&o++;let f=new kn(d.invert(),c,u),p,h=i.length-1;(p=i.length&&i[h].merge(f))?i[h]=p:i.push(f)}}else a.map&&r--},this.items.length,0),new tn(tt.from(i.reverse()),o)}}tn.empty=new tn(tt.empty,0);function ZS(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class kn{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new kn(t.getMap().invert(),t,this.selection)}}}class nr{constructor(e,t,r,i,o){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const eD=20;function tD(n,e,t,r){let i=t.getMeta(rr),o;if(i)return i.historyState;t.getMeta(rD)&&(n=new nr(n.done,n.undone,null,0,-1));let a=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(a&&a.getMeta(rr))return a.getMeta(rr).redo?new nr(n.done.addTransform(t,void 0,r,Ea(e)),n.undone,Ph(t.mapping.maps[t.steps.length-1]),n.prevTime,n.prevComposition):new nr(n.done,n.undone.addTransform(t,void 0,r,Ea(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let s=t.getMeta("composition"),c=n.prevTime==0||!a&&n.prevComposition!=s&&(n.prevTime<(t.time||0)-r.newGroupDelay||!nD(t,n.prevRanges)),d=a?sc(n.prevRanges,t.mapping):Ph(t.mapping.maps[t.steps.length-1]);return new nr(n.done.addTransform(t,c?e.selection.getBookmark():void 0,r,Ea(e)),tn.empty,d,t.time,s??n.prevComposition)}else return(o=t.getMeta("rebased"))?new nr(n.done.rebased(t,o),n.undone.rebased(t,o),sc(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new nr(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),sc(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function nD(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(t=!0)}),t}function Ph(n){let e=[];return n.forEach((t,r,i,o)=>e.push(i,o)),e}function sc(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let i=e.map(n[r],1),o=e.map(n[r+1],-1);i<=o&&t.push(i,o)}return t}function Ih(n,e,t,r){let i=Ea(e),o=rr.get(e).spec.config,a=(r?n.undone:n.done).popEvent(e,i);if(!a)return;let s=a.selection.resolve(a.transform.doc),c=(r?n.done:n.undone).addTransform(a.transform,e.selection.getBookmark(),o,i),d=new nr(r?c:a.remaining,r?a.remaining:c,null,0,-1);t(a.transform.setSelection(s).setMeta(rr,{redo:r,historyState:d}).scrollIntoView())}let lc=!1,Rh=null;function Ea(n){let e=n.plugins;if(Rh!=e){lc=!1,Rh=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){lc=!0;break}}return lc}const rr=new hn("history"),rD=new hn("closeHistory");function iD(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new Ct({key:rr,state:{init(){return new nr(tn.empty,tn.empty,null,0,-1)},apply(e,t,r){return tD(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?Vh:r=="historyRedo"?Lh:null;return i?(t.preventDefault(),i(e.state,e.dispatch)):!1}}}})}const Vh=(n,e)=>{let t=rr.getState(n);return!t||t.done.eventCount==0?!1:(e&&Ih(t,n,e,!1),!0)},Lh=(n,e)=>{let t=rr.getState(n);return!t||t.undone.eventCount==0?!1:(e&&Ih(t,n,e,!0),!0)},oD=ft.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>Vh(n,e),redo:()=>({state:n,dispatch:e})=>Lh(n,e)}},addProseMirrorPlugins(){return[iD(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-Z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Shift-Mod-Z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),aD=Ot.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",We(this.options.HTMLAttributes,n)]},addCommands(){return{setHorizontalRule:()=>({chain:n,state:e})=>{const{$to:t}=e.selection,r=n();return t.parentOffset===0?r.insertContentAt(Math.max(t.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:i,dispatch:o})=>{var a;if(o){const{$to:s}=i.selection,c=s.end();if(s.nodeAfter)s.nodeAfter.isTextblock?i.setSelection(ge.create(i.doc,s.pos+1)):s.nodeAfter.isBlock?i.setSelection(he.create(i.doc,s.pos)):i.setSelection(ge.create(i.doc,s.pos));else{const d=(a=s.parent.type.contentMatch.defaultType)===null||a===void 0?void 0:a.create();d&&(i.insert(c,d),i.setSelection(ge.create(i.doc,c+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[VM({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),sD=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,lD=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,cD=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,dD=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,uD=en.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",We(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Or({find:sD,type:this.type}),Or({find:cD,type:this.type})]},addPasteRules(){return[Nr({find:lD,type:this.type}),Nr({find:dD,type:this.type})]}}),fD=Ot.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",We(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),pD=Ot.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",We(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),$h=en.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:n=>n.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["span",We(this.options.HTMLAttributes,n),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:n,commands:e})=>{const t=ba(n,this.type);return Object.entries(t).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Fh=/^(\d+)\.\s$/,hD=Ot.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:e,...t}=n;return e===1?["ol",We(this.options.HTMLAttributes,t),0]:["ol",We(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(pD.name,this.editor.getAttributes($h.name)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=so({find:Fh,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=so({find:Fh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes($h.name)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[n]}}),mD=Ot.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",We(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),gD=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,yD=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,vD=en.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",We(this.options.HTMLAttributes,n),0]},addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){const n={};return Vl()?n["Mod-Shift-s"]=()=>this.editor.commands.toggleStrike():n["Ctrl-Shift-s"]=()=>this.editor.commands.toggleStrike(),n},addInputRules(){return[Or({find:gD,type:this.type})]},addPasteRules(){return[Nr({find:yD,type:this.type})]}}),bD=Ot.create({name:"text",group:"inline"}),wD=ft.create({name:"starterKit",addExtensions(){var n,e,t,r,i,o,a,s,c,d,u,f,p,h,m,g,k,x;const S=[];return this.options.blockquote!==!1&&S.push(CS.configure((n=this.options)===null||n===void 0?void 0:n.blockquote)),this.options.bold!==!1&&S.push(AS.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&S.push(OS.configure((t=this.options)===null||t===void 0?void 0:t.bulletList)),this.options.code!==!1&&S.push(BS.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&S.push(RS.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&S.push(VS.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&S.push(FS.configure((a=this.options)===null||a===void 0?void 0:a.dropcursor)),this.options.gapcursor!==!1&&S.push(KS.configure((s=this.options)===null||s===void 0?void 0:s.gapcursor)),this.options.hardBreak!==!1&&S.push(GS.configure((c=this.options)===null||c===void 0?void 0:c.hardBreak)),this.options.heading!==!1&&S.push(QS.configure((d=this.options)===null||d===void 0?void 0:d.heading)),this.options.history!==!1&&S.push(oD.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&S.push(aD.configure((f=this.options)===null||f===void 0?void 0:f.horizontalRule)),this.options.italic!==!1&&S.push(uD.configure((p=this.options)===null||p===void 0?void 0:p.italic)),this.options.listItem!==!1&&S.push(fD.configure((h=this.options)===null||h===void 0?void 0:h.listItem)),this.options.orderedList!==!1&&S.push(hD.configure((m=this.options)===null||m===void 0?void 0:m.orderedList)),this.options.paragraph!==!1&&S.push(mD.configure((g=this.options)===null||g===void 0?void 0:g.paragraph)),this.options.strike!==!1&&S.push(vD.configure((k=this.options)===null||k===void 0?void 0:k.strike)),this.options.text!==!1&&S.push(bD.configure((x=this.options)===null||x===void 0?void 0:x.text)),S}}),kD=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))$/,xD=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))/g,CD=en.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:n=>n.getAttribute("data-color")||n.style.backgroundColor,renderHTML:n=>n.color?{"data-color":n.color,style:`background-color: ${n.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:n}){return["mark",We(this.options.HTMLAttributes,n),0]},addCommands(){return{setHighlight:n=>({commands:e})=>e.setMark(this.name,n),toggleHighlight:n=>({commands:e})=>e.toggleMark(this.name,n),unsetHighlight:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Or({find:kD,type:this.type})]},addPasteRules(){return[Nr({find:xD,type:this.type})]}}),MD=ft.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:n=>n.style.textAlign||this.options.defaultAlignment,renderHTML:n=>n.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${n.textAlign}`}}}}]},addCommands(){return{setTextAlign:n=>({commands:e})=>this.options.alignments.includes(n)?this.options.types.every(t=>e.updateAttributes(t,{textAlign:n})):!1,unsetTextAlign:()=>({commands:n})=>this.options.types.every(e=>n.resetAttributes(e,"textAlign"))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),TD={components:{EditorContent:wS,BaseButton:Rr},props:{invalid:{type:Boolean,default:!1}},data(){return{}},setup(n,{emit:e}){const t=l.ref("");return{editor:kS({content:"",extensions:[wD,CD,MD.configure({types:["heading","paragraph"]})],editorProps:{attributes:{class:"focus:outline-none"}},onUpdate({editor:i}){t.value=i.getHTML(),e("update:editorContent",t.value)}}),editorContent:t}},methods:{}},SD={"data-testid":"editor-buttons",class:"w-full flex flex-row pl-2"},DD={class:"w-1/3 border-r border-dropdownSelect flex flex-row justify-between pr-2"},AD={class:"w-1/3 border-r border-dropdownSelect flex flex-row justify-around"},ED={class:"w-1/3 flex flex-row justify-between pl-2"},OD={class:"my-4 my-2 p-4 rounded-xl h-40 bg-tertiary overflow-auto"};function ND(n,e,t,r,i,o){const a=l.resolveComponent("BaseButton"),s=l.resolveComponent("editor-content");return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["border rounded-lg text-secondary text-sm p-4 w-full",t.invalid?"border-alarm":"border-dropdownSelect"])},[l.createElementVNode("div",SD,[l.createElementVNode("div",DD,[l.createVNode(a,{iconName:"fa-h1",label:"",type:"editor",selected:r.editor&&r.editor.isActive("heading",{level:1}),onClick:e[0]||(e[0]=c=>r.editor.chain().toggleHeading({level:1}).run())},null,8,["selected"]),l.createVNode(a,{iconName:"fa-h2",label:"",type:"editor",selected:r.editor&&r.editor.isActive("heading",{level:2}),onClick:e[1]||(e[1]=c=>r.editor.chain().toggleHeading({level:2}).run())},null,8,["selected"]),l.createVNode(a,{iconName:"fa-h3",label:"",type:"editor",selected:r.editor&&r.editor.isActive("heading",{level:3}),onClick:e[2]||(e[2]=c=>r.editor.chain().toggleHeading({level:3}).run())},null,8,["selected"]),l.createVNode(a,{iconName:"fa-paragraph",label:"",type:"editor",selected:r.editor&&r.editor.isActive("paragraph"),onClick:e[3]||(e[3]=c=>r.editor.chain().setParagraph().run())},null,8,["selected"])]),l.createElementVNode("div",AD,[l.createVNode(a,{selected:r.editor&&r.editor.isActive("bold"),iconName:"fa-bold",label:"",type:"editor",onClick:e[4]||(e[4]=c=>r.editor&&r.editor.chain().toggleBold().run())},null,8,["selected"]),l.createVNode(a,{selected:r.editor&&r.editor.isActive("italic"),iconName:"fa-italic",label:"",type:"editor",onClick:e[5]||(e[5]=c=>r.editor&&r.editor.chain().toggleItalic().run())},null,8,["selected"]),l.createVNode(a,{selected:r.editor&&r.editor.isActive("strike"),iconName:"fa-strikethrough",label:"",type:"editor",onClick:e[6]||(e[6]=c=>r.editor&&r.editor.chain().toggleStrike().run())},null,8,["selected"])]),l.createElementVNode("div",ED,[l.createVNode(a,{selected:r.editor&&r.editor.isActive({textAlign:"left"}),iconName:"fa-align-left",label:"",type:"editor",onClick:e[7]||(e[7]=c=>r.editor.chain().setTextAlign("left").run())},null,8,["selected"]),l.createVNode(a,{selected:r.editor&&r.editor.isActive({textAlign:"center"}),iconName:"fa-align-center",label:"",type:"editor",onClick:e[8]||(e[8]=c=>r.editor&&r.editor.chain().setTextAlign("center").run())},null,8,["selected"]),l.createVNode(a,{selected:r.editor&&r.editor.isActive({textAlign:"right"}),iconName:"fa-align-right",label:"",type:"editor",onClick:e[9]||(e[9]=c=>r.editor&&r.editor.chain().setTextAlign("right").run())},null,8,["selected"]),l.createVNode(a,{selected:r.editor&&r.editor.isActive({textAlign:"justify"}),iconName:"fa-align-justify",label:"",type:"editor",onClick:e[10]||(e[10]=c=>r.editor&&r.editor.chain().setTextAlign("justify").run())},null,8,["selected"])])]),l.createElementVNode("p",OD,[l.createVNode(s,{editor:r.editor,class:"focus:shadow-none focus:outline-none"},null,8,["editor"])])],2)}const zh=He(TD,[["render",ND]]),_D={name:"TournamentCard",components:{TournamentHeader:bc,TournamentDetail:yc},props:{detail:{type:Object,required:!0,default:()=>({artwork:"",tags:[],name:"",description:"",date:"",closes:"",location:""})}}},BD={class:"rounded-xl w-72 shadow"};function PD(n,e,t,r,i,o){const a=l.resolveComponent("TournamentHeader"),s=l.resolveComponent("TournamentDetail");return l.openBlock(),l.createElementBlock("div",BD,[l.createVNode(a,{artwork:t.detail.artwork,tags:t.detail.tags},null,8,["artwork","tags"]),l.createVNode(s,{detail:t.detail},null,8,["detail"])])}const ID=He(_D,[["render",PD]]),RD={name:"AddTournamentPageOne",components:{BaseText:sr,BaseInput:bo,ImageCropper:bu,AddressAutocomplete:kc,DatePicker:Id,TextBoxEditor:zh,BaseRadioGroup:mc,BaseButton:Rr},props:{},data(){return{tournament:{name:"",imageLink:"",address:"",coordinates:"",startDate:"",totalDays:1,description:"",visibility:""},validation:{name:!1,imageLink:!1,address:!1,coordinates:!1,startDate:!1,totalDays:!1,description:!1,visibility:!1},visibilityItems:[{label:"Open",value:"open",description:"Viewable To Everyone"},{label:"Club",value:"club",description:"Viewable Only to Members of Your Club"},{label:"Private",value:"private",description:"Only Viewable by you"}]}},methods:{handleSubmit(){console.log("submitting form"),this.setAllValidationStates(!1),console.log(this.tournament),this.tournament.name===""&&(this.validation.name=!0),this.tournament.coordinates===""&&(this.validation.address=!0),this.tournament.startDate===""&&(this.validation.startDate=!0),this.tournament.totalDays===""&&(this.validation.totalDays=!0),this.tournament.description===""&&(this.validation.description=!0),this.tournament.visibility===""&&(this.validation.visibility=!0)},setAllValidationStates(n){Object.keys(this.validation).forEach(e=>{this.validation[e]=n})},handleAddressUpdate(n){this.tournament.address=n.address,this.tournament.coordinates=n.coordinates},handleDateUpdate(n){this.tournament.startDate=n},handleEditorUpdate(n){this.tournament.description=n}},computed:{isFormValid(){return Object.values(this.validation).every(n=>n)}}},VD={class:"border border-dropdownSelect rounded-lg p-9 bg-neutral"},LD={class:"w-full flex flex-row justify-center"},$D={class:"w-full flex flex-row justify-center my-4"},FD={class:"w-full flex flex-row justify-center my-4"},zD={class:"w-full flex flex-row justify-center"},HD={class:"w-96"},YD={class:"flex flex-col mb-3"},UD={class:"flex flex-col mb-3"},jD={class:"flex flex-row mb-3"},WD={class:"w-3/4 mr-1"},qD={class:"w-1/4 ml-1"},KD={class:"flex flex-col mb-3"},GD={class:"flex flex-col pb-4"};function QD(n,e,t,r,i,o){const a=l.resolveComponent("BaseText"),s=l.resolveComponent("ImageCropper"),c=l.resolveComponent("BaseInput"),d=l.resolveComponent("AddressAutocomplete"),u=l.resolveComponent("DatePicker"),f=l.resolveComponent("TextBoxEditor"),p=l.resolveComponent("BaseRadioGroup"),h=l.resolveComponent("BaseButton");return l.openBlock(),l.createElementBlock("div",VD,[l.createElementVNode("div",LD,[l.createVNode(a,{"data-testid":"text-step",color:"quaternary",size:"sm",text:"Step 1 out of 2",weight:"normal"})]),l.createElementVNode("div",$D,[l.createVNode(a,{"data-testid":"text-add-tournamnet",color:"primaryHighlight",size:"2xl",text:"Add Tournament",weight:"normal"})]),l.createElementVNode("div",FD,[l.createVNode(s,{personID:1})]),l.createElementVNode("div",zD,[l.createElementVNode("section",HD,[l.createElementVNode("div",YD,[l.createVNode(a,{"data-testid":"text-tournament-name",color:"primary",size:"sm",text:"Tournament Name",weight:"normal",class:"mb-1",invalid:i.validation.name},null,8,["invalid"]),l.createVNode(c,{placeholder:"Enter Tournemnt Name",type:"formInput",value:i.tournament.name,invalid:i.validation.name,"onUpdate:value":e[0]||(e[0]=m=>i.tournament.name=m)},null,8,["value","invalid"])]),l.createElementVNode("div",UD,[l.createVNode(a,{"data-testid":"text-address",color:"primaryHighlight",size:"sm",text:"Address",weight:"normal",class:"mb-1",invalid:i.validation.address},null,8,["invalid"]),l.createVNode(d,{address:i.tournament.address,invalid:i.validation.address,"onUpdate:address":o.handleAddressUpdate},null,8,["address","invalid","onUpdate:address"])]),l.createElementVNode("div",jD,[l.createElementVNode("div",WD,[l.createVNode(a,{"data-testid":"text-start-date",color:"primaryHighlight",size:"sm",text:"Start Date",weight:"normal",class:"mb-1",invalid:i.validation.startDate},null,8,["invalid"]),l.createVNode(u,{setDate:i.tournament.startDate,"onUpdate:selectedDate":o.handleDateUpdate,invalid:i.validation.startDate},null,8,["setDate","onUpdate:selectedDate","invalid"])]),l.createElementVNode("div",qD,[l.createVNode(a,{"data-testid":"text-total-days",color:"primaryHighlight",size:"sm",text:"Total Days",weight:"normal",class:"mb-1",invalid:i.validation.totalDays},null,8,["invalid"]),l.createVNode(c,{placeholder:"1",type:"formInput",value:`${i.tournament.totalDays}`,invalid:i.validation.totalDays},null,8,["value","invalid"])])]),l.createElementVNode("div",KD,[l.createVNode(a,{"data-testid":"text-description",color:"primaryHighlight",size:"sm",text:"Description",weight:"normal",class:"mb-1",invalid:i.validation.description},null,8,["invalid"]),l.createVNode(f,{invalid:i.validation.description,"onUpdate:editorContent":o.handleEditorUpdate},null,8,["invalid","onUpdate:editorContent"])]),l.createElementVNode("div",GD,[l.createVNode(a,{"data-testid":"text-visibility",color:"primaryHighlight",size:"sm",text:"Tournament Visibility",weight:"normal",class:"mb-2",invalid:i.validation.visibility},null,8,["invalid"]),l.createVNode(p,{items:i.visibilityItems,invalid:i.validation.visibility,"onUpdate:value":e[1]||(e[1]=m=>i.tournament.visibility=m)},null,8,["items","invalid"])]),l.createElementVNode("div",null,[l.createVNode(h,{label:"Continue",type:"continue",color:"neutral",size:"sm",onClick:e[2]||(e[2]=m=>o.handleSubmit()),class:"w-full"})])])])])}const JD=He(RD,[["render",QD]]),XD={name:"AdminLeftMenu",components:{BaseButton:Rr},props:{buttons:{type:Array,default:()=>[]}},methods:{handleButtonClick(n){this.$emit("button-click",n)}}},ZD={class:"bg-secondary w-64 h-screen flex flex-col justify-between"},eA=l.createElementVNode("section",{class:"h-28 border-b border-neutral"},[l.createElementVNode("div",{class:"flex flex-col justify-center h-28"},[l.createElementVNode("div",{class:"ml-8"},[l.createElementVNode("img",{class:"w-32",src:"https://ferrotas.com/assets/ferrotas-white-small-720502db.png",alt:"logo"})])])],-1),tA={class:"flex flex-col p-2 h-full"},nA={class:"flex flex-col justify-end p-2 flex-grow"},rA={class:"border-t border-neutral pt-2"};function iA(n,e,t,r,i,o){const a=l.resolveComponent("BaseButton");return l.openBlock(),l.createElementBlock("div",ZD,[eA,l.createElementVNode("section",tA,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.buttons,s=>(l.openBlock(),l.createBlock(a,{label:s.label,iconClass:"fa-solid fa-trophy text-white",type:"admin",hover:"admin",onClick:c=>o.handleButtonClick(s)},null,8,["label","onClick"]))),256))]),l.createElementVNode("section",nA,[l.createElementVNode("div",rA,[l.createVNode(a,{iconClass:"fa-solid fa-circle-user text-textSecondary",label:"Account",type:"adminSecondary",onClick:e[0]||(e[0]=s=>o.handleButtonClick(n.button))}),l.createVNode(a,{iconClass:"fa-solid fa-right-to-bracket fa-rotate-180 text-textSecondary",label:"Log Out",type:"adminSecondary",onClick:e[1]||(e[1]=s=>o.handleButtonClick(n.button))})])])])}const oA=He(XD,[["render",iA]]);_e.AddTournamentPageOne=JD,_e.AddressAutocomplete=kc,_e.AdminLeftMenu=oA,_e.BaseButton=Rr,_e.BaseIcon=hc,_e.BaseInput=bo,_e.BaseRaioGroup=mc,_e.BaseTag=gc,_e.BaseText=sr,_e.Breadcrumb=sm,_e.DatePicker=Id,_e.DropDown=_a,_e.FilterAndSortBar=Om,_e.FilterUpcomingPast=Rm,_e.ImageCropper=bu,_e.TextBoxEditor=zh,_e.TournamentCard=ID,_e.TournamentCardDetails=yc,_e.TournamentCardHeader=bc,Object.defineProperty(_e,Symbol.toStringTag,{value:"Module"})});
181
+ `);return!o||!a?!1:n.chain().command(({tr:s})=>(s.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:n})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=n,{selection:t,doc:r}=e,{$from:i,empty:o}=t;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const s=i.after();return s===void 0||r.nodeAt(s)?!1:n.commands.exitCode()}}},addInputRules(){return[Hl({find:jS,type:this.type,getAttributes:n=>({language:n[1]})}),Hl({find:WS,type:this.type,getAttributes:n=>({language:n[1]})})]},addProseMirrorPlugins(){return[new Ct({key:new hn("codeBlockVSCodeHandler"),props:{handlePaste:(n,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const t=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!t||!o)return!1;const{tr:a}=n.state;return a.replaceSelectionWith(this.type.create({language:o})),a.setSelection(ge.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.insertText(t.replace(/\r\n?/g,`
182
+ `)),a.setMeta("paste",!0),n.dispatch(a),!0}}})]}}),KS=Ot.create({name:"doc",topNode:!0,content:"block+"});function GS(n={}){return new Ct({view(e){return new QS(e,n)}})}class QS{constructor(e,t){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=t.width)!==null&&r!==void 0?r:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=a=>{this[i](a)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,r;if(t){let s=e.nodeBefore,c=e.nodeAfter;if(s||c){let d=this.editorView.nodeDOM(this.cursorPos-(s?s.nodeSize:0));if(d){let u=d.getBoundingClientRect(),f=s?u.bottom:u.top;s&&c&&(f=(f+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:u.left,right:u.right,top:f-this.width/2,bottom:f+this.width/2}}}}if(!r){let s=this.editorView.coordsAtPos(this.cursorPos);r={left:s.left-this.width/2,right:s.left+this.width/2,top:s.top,bottom:s.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let o,a;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,a=-pageYOffset;else{let s=i.getBoundingClientRect();o=s.left-i.scrollLeft,a=s.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-a+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,t,e):i;if(t&&!o){let a=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let s=ef(this.editorView.state.doc,a,this.editorView.dragging.slice);s!=null&&(a=s)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const JS=ft.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[GS(this.options)]}});class $e extends ye{constructor(e){super(e,e)}map(e,t){let r=e.resolve(t.map(this.head));return $e.valid(r)?new $e(r):ye.near(r)}content(){return ie.empty}eq(e){return e instanceof $e&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new $e(e.resolve(t.pos))}getBookmark(){return new ac(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!XS(e)||!ZS(e))return!1;let r=t.type.spec.allowGapCursor;if(r!=null)return r;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,r=!1){e:for(;;){if(!r&&$e.valid(e))return e;let i=e.pos,o=null;for(let a=e.depth;;a--){let s=e.node(a);if(t>0?e.indexAfter(a)<s.childCount:e.index(a)>0){o=s.child(t>0?e.indexAfter(a):e.index(a)-1);break}else if(a==0)return null;i+=t;let c=e.doc.resolve(i);if($e.valid(c))return c}for(;;){let a=t>0?o.firstChild:o.lastChild;if(!a){if(o.isAtom&&!o.isText&&!he.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*t),r=!1;continue e}break}o=a,i+=t;let s=e.doc.resolve(i);if($e.valid(s))return s}return null}}}$e.prototype.visible=!1,$e.findFrom=$e.findGapCursorFrom,ye.jsonID("gapcursor",$e);class ac{constructor(e){this.pos=e}map(e){return new ac(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return $e.valid(t)?new $e(t):ye.near(t)}}function XS(n){for(let e=n.depth;e>=0;e--){let t=n.index(e),r=n.node(e);if(t==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function ZS(n){for(let e=n.depth;e>=0;e--){let t=n.indexAfter(e),r=n.node(e);if(t==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function eD(){return new Ct({props:{decorations:iD,createSelectionBetween(n,e,t){return e.pos==t.pos&&$e.valid(t)?new $e(t):null},handleClick:nD,handleKeyDown:tD,handleDOMEvents:{beforeinput:rD}}})}const tD=Cp({ArrowLeft:Da("horiz",-1),ArrowRight:Da("horiz",1),ArrowUp:Da("vert",-1),ArrowDown:Da("vert",1)});function Da(n,e){const t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let a=r.selection,s=e>0?a.$to:a.$from,c=a.empty;if(a instanceof ge){if(!o.endOfTextblock(t)||s.depth==0)return!1;c=!1,s=r.doc.resolve(e>0?s.after():s.before())}let d=$e.findGapCursorFrom(s,e,c);return d?(i&&i(r.tr.setSelection(new $e(d))),!0):!1}}function nD(n,e,t){if(!n||!n.editable)return!1;let r=n.state.doc.resolve(e);if(!$e.valid(r))return!1;let i=n.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&he.isSelectable(n.state.doc.nodeAt(i.inside))?!1:(n.dispatch(n.state.tr.setSelection(new $e(r))),!0)}function rD(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof $e))return!1;let{$from:t}=n.state.selection,r=t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);if(!r)return!1;let i=K.empty;for(let a=r.length-1;a>=0;a--)i=K.from(r[a].createAndFill(null,i));let o=n.state.tr.replace(t.pos,t.pos,new ie(i,0,0));return o.setSelection(ge.near(o.doc.resolve(t.pos+1))),n.dispatch(o),!1}function iD(n){if(!(n.selection instanceof $e))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Ke.create(n.doc,[Ft.widget(n.selection.head,e,{key:"gapcursor"})])}const oD=ft.create({name:"gapCursor",addProseMirrorPlugins(){return[eD()]},extendNodeSchema(n){var e;const t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=ve(le(n,"allowGapCursor",t)))!==null&&e!==void 0?e:null}}}),aD=Ot.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:n}){return["br",We(this.options.HTMLAttributes,n)]},renderText(){return`
183
+ `},addCommands(){return{setHardBreak:()=>({commands:n,chain:e,state:t,editor:r})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:i,storedMarks:o}=t;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:s}=r.extensionManager,c=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:u})=>{if(u&&c&&a){const f=c.filter(p=>s.includes(p.type.name));d.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),sD=Ot.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,We(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>Hl({find:new RegExp(`^(#{1,${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}});var Aa=200,tt=function(){};tt.prototype.append=function(e){return e.length?(e=tt.from(e),!this.length&&e||e.length<Aa&&this.leafAppend(e)||this.length<Aa&&e.leafPrepend(this)||this.appendInner(e)):this},tt.prototype.prepend=function(e){return e.length?tt.from(e).append(this):this},tt.prototype.appendInner=function(e){return new lD(this,e)},tt.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?tt.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},tt.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},tt.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)},tt.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,a){return i.push(e(o,a))},t,r),i},tt.from=function(e){return e instanceof tt?e:e&&e.length?new Rh(e):tt.empty};var Rh=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,a,s){for(var c=o;c<a;c++)if(i(this.values[c],s+c)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,a,s){for(var c=o-1;c>=a;c--)if(i(this.values[c],s+c)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Aa)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Aa)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(tt);tt.empty=new Rh([]);var lD=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,a){var s=this.left.length;if(i<s&&this.left.forEachInner(r,i,Math.min(o,s),a)===!1||o>s&&this.right.forEachInner(r,Math.max(i-s,0),Math.min(this.length,o)-s,a+s)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,a){var s=this.left.length;if(i>s&&this.right.forEachInvertedInner(r,i-s,Math.max(o,s)-s,a+s)===!1||o<s&&this.left.forEachInvertedInner(r,Math.min(i,s),o,a)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(tt);const cD=500;class tn{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;t&&(i=this.remapping(r,this.items.length),o=i.maps.length);let a=e.tr,s,c,d=[],u=[];return this.items.forEach((f,p)=>{if(!f.step){i||(i=this.remapping(r,p+1),o=i.maps.length),o--,u.push(f);return}if(i){u.push(new kn(f.map));let h=f.step.map(i.slice(o)),m;h&&a.maybeStep(h).doc&&(m=a.mapping.maps[a.mapping.maps.length-1],d.push(new kn(m,void 0,void 0,d.length+u.length))),o--,m&&i.appendMap(m,o)}else a.maybeStep(f.step);if(f.selection)return s=i?f.selection.map(i.slice(o)):f.selection,c=new tn(this.items.slice(0,r).append(u.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:a,selection:s}}addTransform(e,t,r,i){let o=[],a=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let u=0;u<e.steps.length;u++){let f=e.steps[u].invert(e.docs[u]),p=new kn(e.mapping.maps[u],f,t),h;(h=c&&c.merge(p))&&(p=h,u?o.pop():s=s.slice(0,s.length-1)),o.push(p),t&&(a++,t=void 0),i||(c=p)}let d=a-r.depth;return d>uD&&(s=dD(s,d),a-=d),new tn(s.append(o),a)}remapping(e,t){let r=new Zr;return this.items.forEach((i,o)=>{let a=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},e,t),r}addMaps(e){return this.eventCount==0?this:new tn(this.items.append(e.map(t=>new kn(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,a=e.steps.length,s=this.eventCount;this.items.forEach(p=>{p.selection&&s--},i);let c=t;this.items.forEach(p=>{let h=o.getMirror(--c);if(h==null)return;a=Math.min(a,h);let m=o.maps[h];if(p.step){let g=e.steps[h].invert(e.docs[h]),k=p.selection&&p.selection.map(o.slice(c+1,h));k&&s++,r.push(new kn(m,g,k))}else r.push(new kn(m))},i);let d=[];for(let p=t;p<a;p++)d.push(new kn(o.maps[p]));let u=this.items.slice(0,i).append(d).append(r),f=new tn(u,s);return f.emptyItemCount()>cD&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],o=0;return this.items.forEach((a,s)=>{if(s>=e)i.push(a),a.selection&&o++;else if(a.step){let c=a.step.map(t.slice(r)),d=c&&c.getMap();if(r--,d&&t.appendMap(d,r),c){let u=a.selection&&a.selection.map(t.slice(r));u&&o++;let f=new kn(d.invert(),c,u),p,h=i.length-1;(p=i.length&&i[h].merge(f))?i[h]=p:i.push(f)}}else a.map&&r--},this.items.length,0),new tn(tt.from(i.reverse()),o)}}tn.empty=new tn(tt.empty,0);function dD(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class kn{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new kn(t.getMap().invert(),t,this.selection)}}}class rr{constructor(e,t,r,i,o){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const uD=20;function fD(n,e,t,r){let i=t.getMeta(ir),o;if(i)return i.historyState;t.getMeta(hD)&&(n=new rr(n.done,n.undone,null,0,-1));let a=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(a&&a.getMeta(ir))return a.getMeta(ir).redo?new rr(n.done.addTransform(t,void 0,r,Ea(e)),n.undone,Vh(t.mapping.maps[t.steps.length-1]),n.prevTime,n.prevComposition):new rr(n.done,n.undone.addTransform(t,void 0,r,Ea(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let s=t.getMeta("composition"),c=n.prevTime==0||!a&&n.prevComposition!=s&&(n.prevTime<(t.time||0)-r.newGroupDelay||!pD(t,n.prevRanges)),d=a?sc(n.prevRanges,t.mapping):Vh(t.mapping.maps[t.steps.length-1]);return new rr(n.done.addTransform(t,c?e.selection.getBookmark():void 0,r,Ea(e)),tn.empty,d,t.time,s??n.prevComposition)}else return(o=t.getMeta("rebased"))?new rr(n.done.rebased(t,o),n.undone.rebased(t,o),sc(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new rr(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),sc(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function pD(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(t=!0)}),t}function Vh(n){let e=[];return n.forEach((t,r,i,o)=>e.push(i,o)),e}function sc(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let i=e.map(n[r],1),o=e.map(n[r+1],-1);i<=o&&t.push(i,o)}return t}function Lh(n,e,t,r){let i=Ea(e),o=ir.get(e).spec.config,a=(r?n.undone:n.done).popEvent(e,i);if(!a)return;let s=a.selection.resolve(a.transform.doc),c=(r?n.done:n.undone).addTransform(a.transform,e.selection.getBookmark(),o,i),d=new rr(r?c:a.remaining,r?a.remaining:c,null,0,-1);t(a.transform.setSelection(s).setMeta(ir,{redo:r,historyState:d}).scrollIntoView())}let lc=!1,$h=null;function Ea(n){let e=n.plugins;if($h!=e){lc=!1,$h=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){lc=!0;break}}return lc}const ir=new hn("history"),hD=new hn("closeHistory");function mD(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new Ct({key:ir,state:{init(){return new rr(tn.empty,tn.empty,null,0,-1)},apply(e,t,r){return fD(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?Fh:r=="historyRedo"?zh:null;return i?(t.preventDefault(),i(e.state,e.dispatch)):!1}}}})}const Fh=(n,e)=>{let t=ir.getState(n);return!t||t.done.eventCount==0?!1:(e&&Lh(t,n,e,!1),!0)},zh=(n,e)=>{let t=ir.getState(n);return!t||t.undone.eventCount==0?!1:(e&&Lh(t,n,e,!0),!0)},gD=ft.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>Fh(n,e),redo:()=>({state:n,dispatch:e})=>zh(n,e)}},addProseMirrorPlugins(){return[mD(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-Z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Shift-Mod-Z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),yD=Ot.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",We(this.options.HTMLAttributes,n)]},addCommands(){return{setHorizontalRule:()=>({chain:n,state:e})=>{const{$to:t}=e.selection,r=n();return t.parentOffset===0?r.insertContentAt(Math.max(t.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:i,dispatch:o})=>{var a;if(o){const{$to:s}=i.selection,c=s.end();if(s.nodeAfter)s.nodeAfter.isTextblock?i.setSelection(ge.create(i.doc,s.pos+1)):s.nodeAfter.isBlock?i.setSelection(he.create(i.doc,s.pos)):i.setSelection(ge.create(i.doc,s.pos));else{const d=(a=s.parent.type.contentMatch.defaultType)===null||a===void 0?void 0:a.create();d&&(i.insert(c,d),i.setSelection(ge.create(i.doc,c+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[KM({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),vD=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,bD=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,wD=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,kD=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,xD=en.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",We(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Or({find:vD,type:this.type}),Or({find:wD,type:this.type})]},addPasteRules(){return[Nr({find:bD,type:this.type}),Nr({find:kD,type:this.type})]}}),CD=Ot.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",We(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),MD=Ot.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",We(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Hh=en.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:n=>n.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["span",We(this.options.HTMLAttributes,n),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:n,commands:e})=>{const t=ba(n,this.type);return Object.entries(t).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Yh=/^(\d+)\.\s$/,TD=Ot.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:e,...t}=n;return e===1?["ol",We(this.options.HTMLAttributes,t),0]:["ol",We(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(MD.name,this.editor.getAttributes(Hh.name)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=so({find:Yh,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=so({find:Yh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Hh.name)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[n]}}),SD=Ot.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",We(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),DD=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,AD=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,ED=en.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",We(this.options.HTMLAttributes,n),0]},addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){const n={};return Vl()?n["Mod-Shift-s"]=()=>this.editor.commands.toggleStrike():n["Ctrl-Shift-s"]=()=>this.editor.commands.toggleStrike(),n},addInputRules(){return[Or({find:DD,type:this.type})]},addPasteRules(){return[Nr({find:AD,type:this.type})]}}),OD=Ot.create({name:"text",group:"inline"}),ND=ft.create({name:"starterKit",addExtensions(){var n,e,t,r,i,o,a,s,c,d,u,f,p,h,m,g,k,x;const S=[];return this.options.blockquote!==!1&&S.push(PS.configure((n=this.options)===null||n===void 0?void 0:n.blockquote)),this.options.bold!==!1&&S.push($S.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&S.push(zS.configure((t=this.options)===null||t===void 0?void 0:t.bulletList)),this.options.code!==!1&&S.push(US.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&S.push(qS.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&S.push(KS.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&S.push(JS.configure((a=this.options)===null||a===void 0?void 0:a.dropcursor)),this.options.gapcursor!==!1&&S.push(oD.configure((s=this.options)===null||s===void 0?void 0:s.gapcursor)),this.options.hardBreak!==!1&&S.push(aD.configure((c=this.options)===null||c===void 0?void 0:c.hardBreak)),this.options.heading!==!1&&S.push(sD.configure((d=this.options)===null||d===void 0?void 0:d.heading)),this.options.history!==!1&&S.push(gD.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&S.push(yD.configure((f=this.options)===null||f===void 0?void 0:f.horizontalRule)),this.options.italic!==!1&&S.push(xD.configure((p=this.options)===null||p===void 0?void 0:p.italic)),this.options.listItem!==!1&&S.push(CD.configure((h=this.options)===null||h===void 0?void 0:h.listItem)),this.options.orderedList!==!1&&S.push(TD.configure((m=this.options)===null||m===void 0?void 0:m.orderedList)),this.options.paragraph!==!1&&S.push(SD.configure((g=this.options)===null||g===void 0?void 0:g.paragraph)),this.options.strike!==!1&&S.push(ED.configure((k=this.options)===null||k===void 0?void 0:k.strike)),this.options.text!==!1&&S.push(OD.configure((x=this.options)===null||x===void 0?void 0:x.text)),S}}),_D=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))$/,BD=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))/g,PD=en.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:n=>n.getAttribute("data-color")||n.style.backgroundColor,renderHTML:n=>n.color?{"data-color":n.color,style:`background-color: ${n.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:n}){return["mark",We(this.options.HTMLAttributes,n),0]},addCommands(){return{setHighlight:n=>({commands:e})=>e.setMark(this.name,n),toggleHighlight:n=>({commands:e})=>e.toggleMark(this.name,n),unsetHighlight:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Or({find:_D,type:this.type})]},addPasteRules(){return[Nr({find:BD,type:this.type})]}}),ID=ft.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:n=>n.style.textAlign||this.options.defaultAlignment,renderHTML:n=>n.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${n.textAlign}`}}}}]},addCommands(){return{setTextAlign:n=>({commands:e})=>this.options.alignments.includes(n)?this.options.types.every(t=>e.updateAttributes(t,{textAlign:n})):!1,unsetTextAlign:()=>({commands:n})=>this.options.types.every(e=>n.resetAttributes(e,"textAlign"))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),RD={components:{EditorContent:NS,BaseButton:Rr},props:{invalid:{type:Boolean,default:!1}},data(){return{}},setup(n,{emit:e}){const t=l.ref("");return{editor:_S({content:"",extensions:[ND,PD,ID.configure({types:["heading","paragraph"]})],editorProps:{attributes:{class:"focus:outline-none"}},onUpdate({editor:i}){t.value=i.getHTML(),e("update:editorContent",t.value)}}),editorContent:t}},methods:{}},VD={"data-testid":"editor-buttons",class:"w-full flex flex-row pl-2"},LD={class:"w-1/3 border-r border-dropdownSelect flex flex-row justify-between pr-2"},$D={class:"w-1/3 border-r border-dropdownSelect flex flex-row justify-around"},FD={class:"w-1/3 flex flex-row justify-between pl-2"},zD={class:"my-4 my-2 p-4 rounded-xl h-40 bg-tertiary overflow-auto"};function HD(n,e,t,r,i,o){const a=l.resolveComponent("BaseButton"),s=l.resolveComponent("editor-content");return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["border rounded-lg text-secondary text-sm p-4 w-full",t.invalid?"border-alarm":"border-dropdownSelect"])},[l.createElementVNode("div",VD,[l.createElementVNode("div",LD,[l.createVNode(a,{iconName:"fa-h1",label:"",type:"editor",selected:r.editor&&r.editor.isActive("heading",{level:1}),onClick:e[0]||(e[0]=c=>r.editor.chain().toggleHeading({level:1}).run())},null,8,["selected"]),l.createVNode(a,{iconName:"fa-h2",label:"",type:"editor",selected:r.editor&&r.editor.isActive("heading",{level:2}),onClick:e[1]||(e[1]=c=>r.editor.chain().toggleHeading({level:2}).run())},null,8,["selected"]),l.createVNode(a,{iconName:"fa-h3",label:"",type:"editor",selected:r.editor&&r.editor.isActive("heading",{level:3}),onClick:e[2]||(e[2]=c=>r.editor.chain().toggleHeading({level:3}).run())},null,8,["selected"]),l.createVNode(a,{iconName:"fa-paragraph",label:"",type:"editor",selected:r.editor&&r.editor.isActive("paragraph"),onClick:e[3]||(e[3]=c=>r.editor.chain().setParagraph().run())},null,8,["selected"])]),l.createElementVNode("div",$D,[l.createVNode(a,{selected:r.editor&&r.editor.isActive("bold"),iconName:"fa-bold",label:"",type:"editor",onClick:e[4]||(e[4]=c=>r.editor&&r.editor.chain().toggleBold().run())},null,8,["selected"]),l.createVNode(a,{selected:r.editor&&r.editor.isActive("italic"),iconName:"fa-italic",label:"",type:"editor",onClick:e[5]||(e[5]=c=>r.editor&&r.editor.chain().toggleItalic().run())},null,8,["selected"]),l.createVNode(a,{selected:r.editor&&r.editor.isActive("strike"),iconName:"fa-strikethrough",label:"",type:"editor",onClick:e[6]||(e[6]=c=>r.editor&&r.editor.chain().toggleStrike().run())},null,8,["selected"])]),l.createElementVNode("div",FD,[l.createVNode(a,{selected:r.editor&&r.editor.isActive({textAlign:"left"}),iconName:"fa-align-left",label:"",type:"editor",onClick:e[7]||(e[7]=c=>r.editor.chain().setTextAlign("left").run())},null,8,["selected"]),l.createVNode(a,{selected:r.editor&&r.editor.isActive({textAlign:"center"}),iconName:"fa-align-center",label:"",type:"editor",onClick:e[8]||(e[8]=c=>r.editor&&r.editor.chain().setTextAlign("center").run())},null,8,["selected"]),l.createVNode(a,{selected:r.editor&&r.editor.isActive({textAlign:"right"}),iconName:"fa-align-right",label:"",type:"editor",onClick:e[9]||(e[9]=c=>r.editor&&r.editor.chain().setTextAlign("right").run())},null,8,["selected"]),l.createVNode(a,{selected:r.editor&&r.editor.isActive({textAlign:"justify"}),iconName:"fa-align-justify",label:"",type:"editor",onClick:e[10]||(e[10]=c=>r.editor&&r.editor.chain().setTextAlign("justify").run())},null,8,["selected"])])]),l.createElementVNode("p",zD,[l.createVNode(s,{editor:r.editor,class:"focus:shadow-none focus:outline-none"},null,8,["editor"])])],2)}const Uh=Fe(RD,[["render",HD]]),YD={name:"AddTournamentPageOne",components:{BaseText:Bn,BaseInput:bo,ImageCropper:xu,AddressAutocomplete:Cc,DatePicker:Vd,TextBoxEditor:Uh,BaseRadioGroup:mc,BaseButton:Rr},props:{},data(){return{tournament:{name:"",imageLink:"",address:"",coordinates:"",startDate:"",totalDays:1,description:"",visibility:""},validation:{name:!1,imageLink:!1,address:!1,coordinates:!1,startDate:!1,totalDays:!1,description:!1,visibility:!1},visibilityItems:[{label:"Open",value:"open",description:"Viewable To Everyone"},{label:"Club",value:"club",description:"Viewable Only to Members of Your Club"},{label:"Private",value:"private",description:"Only Viewable by you"}]}},methods:{handleSubmit(){console.log("submitting form"),this.setAllValidationStates(!1),console.log(this.tournament),this.tournament.name===""&&(this.validation.name=!0),this.tournament.coordinates===""&&(this.validation.address=!0),this.tournament.startDate===""&&(this.validation.startDate=!0),this.tournament.totalDays===""&&(this.validation.totalDays=!0),this.tournament.description===""&&(this.validation.description=!0),this.tournament.visibility===""&&(this.validation.visibility=!0)},setAllValidationStates(n){Object.keys(this.validation).forEach(e=>{this.validation[e]=n})},handleAddressUpdate(n){this.tournament.address=n.address,this.tournament.coordinates=n.coordinates},handleDateUpdate(n){this.tournament.startDate=n},handleEditorUpdate(n){this.tournament.description=n}},computed:{isFormValid(){return Object.values(this.validation).every(n=>n)}}},UD={class:"border border-dropdownSelect rounded-lg p-9 bg-neutral"},jD={class:"w-full flex flex-row justify-center"},WD={class:"w-full flex flex-row justify-center my-4"},qD={class:"w-full flex flex-row justify-center my-4"},KD={class:"w-full flex flex-row justify-center"},GD={class:"w-96"},QD={class:"flex flex-col mb-3"},JD={class:"flex flex-col mb-3"},XD={class:"flex flex-row mb-3"},ZD={class:"w-3/4 mr-1"},eA={class:"w-1/4 ml-1"},tA={class:"flex flex-col mb-3"},nA={class:"flex flex-col pb-4"};function rA(n,e,t,r,i,o){const a=l.resolveComponent("BaseText"),s=l.resolveComponent("ImageCropper"),c=l.resolveComponent("BaseInput"),d=l.resolveComponent("AddressAutocomplete"),u=l.resolveComponent("DatePicker"),f=l.resolveComponent("TextBoxEditor"),p=l.resolveComponent("BaseRadioGroup"),h=l.resolveComponent("BaseButton");return l.openBlock(),l.createElementBlock("div",UD,[l.createElementVNode("div",jD,[l.createVNode(a,{"data-testid":"text-step",color:"quaternary",size:"sm",text:"Step 1 out of 2",weight:"normal"})]),l.createElementVNode("div",WD,[l.createVNode(a,{"data-testid":"text-add-tournamnet",color:"primaryHighlight",size:"2xl",text:"Add Tournament",weight:"normal"})]),l.createElementVNode("div",qD,[l.createVNode(s,{personID:1})]),l.createElementVNode("div",KD,[l.createElementVNode("section",GD,[l.createElementVNode("div",QD,[l.createVNode(a,{"data-testid":"text-tournament-name",color:"primary",size:"sm",text:"Tournament Name",weight:"normal",class:"mb-1",invalid:i.validation.name},null,8,["invalid"]),l.createVNode(c,{placeholder:"Enter Tournemnt Name",type:"formInput",value:i.tournament.name,invalid:i.validation.name,"onUpdate:value":e[0]||(e[0]=m=>i.tournament.name=m)},null,8,["value","invalid"])]),l.createElementVNode("div",JD,[l.createVNode(a,{"data-testid":"text-address",color:"primaryHighlight",size:"sm",text:"Address",weight:"normal",class:"mb-1",invalid:i.validation.address},null,8,["invalid"]),l.createVNode(d,{address:i.tournament.address,invalid:i.validation.address,"onUpdate:address":o.handleAddressUpdate},null,8,["address","invalid","onUpdate:address"])]),l.createElementVNode("div",XD,[l.createElementVNode("div",ZD,[l.createVNode(a,{"data-testid":"text-start-date",color:"primaryHighlight",size:"sm",text:"Start Date",weight:"normal",class:"mb-1",invalid:i.validation.startDate},null,8,["invalid"]),l.createVNode(u,{setDate:i.tournament.startDate,"onUpdate:selectedDate":o.handleDateUpdate,invalid:i.validation.startDate},null,8,["setDate","onUpdate:selectedDate","invalid"])]),l.createElementVNode("div",eA,[l.createVNode(a,{"data-testid":"text-total-days",color:"primaryHighlight",size:"sm",text:"Total Days",weight:"normal",class:"mb-1",invalid:i.validation.totalDays},null,8,["invalid"]),l.createVNode(c,{placeholder:"1",type:"formInput",value:`${i.tournament.totalDays}`,invalid:i.validation.totalDays},null,8,["value","invalid"])])]),l.createElementVNode("div",tA,[l.createVNode(a,{"data-testid":"text-description",color:"primaryHighlight",size:"sm",text:"Description",weight:"normal",class:"mb-1",invalid:i.validation.description},null,8,["invalid"]),l.createVNode(f,{invalid:i.validation.description,"onUpdate:editorContent":o.handleEditorUpdate},null,8,["invalid","onUpdate:editorContent"])]),l.createElementVNode("div",nA,[l.createVNode(a,{"data-testid":"text-visibility",color:"primaryHighlight",size:"sm",text:"Tournament Visibility",weight:"normal",class:"mb-2",invalid:i.validation.visibility},null,8,["invalid"]),l.createVNode(p,{items:i.visibilityItems,invalid:i.validation.visibility,"onUpdate:value":e[1]||(e[1]=m=>i.tournament.visibility=m)},null,8,["items","invalid"])]),l.createElementVNode("div",null,[l.createVNode(h,{label:"Continue",type:"continue",color:"neutral",size:"sm",onClick:e[2]||(e[2]=m=>o.handleSubmit()),class:"w-full"})])])])])}const iA=Fe(YD,[["render",rA]]),oA={name:"AdminLeftMenu",components:{BaseButton:Rr},props:{buttons:{type:Array,default:()=>[]}},methods:{handleButtonClick(n){this.$emit("button-click",n)}}},aA={class:"bg-secondary w-64 h-screen flex flex-col justify-between"},sA=l.createElementVNode("section",{class:"h-28 border-b border-neutral"},[l.createElementVNode("div",{class:"flex flex-col justify-center h-28"},[l.createElementVNode("div",{class:"ml-8"},[l.createElementVNode("img",{class:"w-32",src:"https://ferrotas.com/assets/ferrotas-white-small-720502db.png",alt:"logo"})])])],-1),lA={class:"flex flex-col p-2 h-full"},cA={class:"flex flex-col justify-end p-2 flex-grow"},dA={class:"border-t border-neutral pt-2"};function uA(n,e,t,r,i,o){const a=l.resolveComponent("BaseButton");return l.openBlock(),l.createElementBlock("div",aA,[sA,l.createElementVNode("section",lA,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.buttons,s=>(l.openBlock(),l.createBlock(a,{label:s.label,iconClass:"fa-solid fa-trophy text-white",type:"admin",hover:"admin",onClick:c=>o.handleButtonClick(s)},null,8,["label","onClick"]))),256))]),l.createElementVNode("section",cA,[l.createElementVNode("div",dA,[l.createVNode(a,{iconClass:"fa-solid fa-circle-user text-textSecondary",label:"Account",type:"adminSecondary",onClick:e[0]||(e[0]=s=>o.handleButtonClick(n.button))}),l.createVNode(a,{iconClass:"fa-solid fa-right-to-bracket fa-rotate-180 text-textSecondary",label:"Log Out",type:"adminSecondary",onClick:e[1]||(e[1]=s=>o.handleButtonClick(n.button))})])])])}const fA=Fe(oA,[["render",uA]]);_e.AddTournamentPageOne=iA,_e.AddressAutocomplete=Cc,_e.AdminLeftMenu=fA,_e.BaseButton=Rr,_e.BaseIcon=hc,_e.BaseInput=bo,_e.BaseRaioGroup=mc,_e.BaseTag=gc,_e.BaseText=Bn,_e.Breadcrumb=dm,_e.DatePicker=Vd,_e.DropDown=_a,_e.FilterAndSortBar=wc,_e.FilterUpcomingPast=kc,_e.GridContainer=Zb,_e.ImageCropper=xu,_e.TextBoxEditor=Uh,_e.TournamentCard=Ld,_e.TournamentCardDetails=yc,_e.TournamentCardHeader=bc,Object.defineProperty(_e,Symbol.toStringTag,{value:"Module"})});