m(n)-1&&(i.value=m(n)-1)},onBlur:()=>{s=!1,i.value=-1},onMousedown:()=>{s=!0},tabindex:0}}},S9=(t,e)=>{if(e==="single")return t;if(e==="range")return{start:t,end:null};if(e==="multiple")return[t];if(e==="auto")return t;throw new Error("Unknown mode")},hc=(t,e)=>{throw Error(`Incorrect modelValue for mode ${e}. Got ${JSON.stringify(t)}`)},C9=t=>of(t)?"single":Xs(t)?"range":sf(t)?"multiple":hc(t,"auto"),Zb=t=>t.start&&t.end&&t.start>t.end?{start:t.end,end:t.start}:t,w9=(t,e,n)=>({updateModelValue:o=>{if(!t.modelValue){e("update:modelValue",S9(o,t.mode));return}const i=t.mode==="auto"?C9(t.modelValue):t.mode;if(i==="single"){if(!of(t.modelValue))return hc(t.modelValue,i);e("update:modelValue",o)}else if(i==="range"){if(!Xs(t.modelValue))return hc(t.modelValue,i);if(t.modelValue.end&&n(t.modelValue.end,o))return e("update:modelValue",{start:t.modelValue.start,end:null});if(t.modelValue.start&&n(t.modelValue.start,o))return e("update:modelValue",{start:null,end:t.modelValue.end});if(t.modelValue.end===null)return e("update:modelValue",Zb({start:t.modelValue.start,end:o}));if(t.modelValue.start===null)return e("update:modelValue",Zb({end:t.modelValue.end,start:o}));e("update:modelValue",{start:o,end:null})}else if(i==="multiple"){if(!sf(t.modelValue))return hc(t.modelValue,i);!!t.modelValue.find(l=>n(l,o))?e("update:modelValue",t.modelValue.filter(l=>!n(l,o))):e("update:modelValue",[...t.modelValue,o].sort((l,a)=>l.getTime()-a.getTime()))}}}),k9=t=>({month:p9,day:h9,year:_x})[t],Sg=(t,e,n,r)=>{const o=k9(t),i=n.allowedDays||n.allowedMonths||n.allowedYears,s=p=>i===void 0?!1:!i(p),l=W(-1),a=g(()=>e.value[l.value]),{updateModelValue:u}=w9(n,r,o),c=p=>{n.readonly||s(p)||(u(p),r(`click:${t}`,p))},d=p=>o(new Date,p),f=p=>n.modelValue?of(n.modelValue)?o(n.modelValue,p):sf(n.modelValue)?!!n.modelValue.find(v=>o(v,p)):Xs(n.modelValue)?o(n.modelValue.start,p)||o(n.modelValue.end,p):!1:!1,h=p=>{if(!n.modelValue||!Xs(n.modelValue))return!1;if(n.modelValue.start&&n.modelValue.end)return n.modelValue.startp;const v=n.modelValue.start||n.modelValue.end;return v&&a.value?v
=p:a.value<=p:!1};return fe(a,p=>{r(`hover:${t}`,p)}),{hoveredIndex:l,hoveredValue:a,onClick:c,isToday:d,isSelected:f,isInRange:h}},Xf=(t,e)=>new Date(t,e+1,0).getDate(),x9=(t,e)=>new Date(t,e,1).getDay(),Jf=t=>Array.from(Array(t).keys()).map(e=>e+1),$9=(t,e)=>{const r=c=>{var d;return!e||!((d=e.firstWeekday)!=null&&d.value)?c:e.firstWeekday.value.toLowerCase()==="monday"?c===0?6:c-1:c},o=g(()=>r(x9(t.value.year,t.value.month))),i=()=>{if(o.value===0)return[];const c=Xf(t.value.year,t.value.month-1);return Jf(c).slice(-o.value).map(f=>new Date(t.value.year,t.value.month-1,f))},s=()=>Jf(Xf(t.value.year,t.value.month)).map(d=>new Date(t.value.year,t.value.month,d)),l=g(()=>[...i(),...s()]),a=g(()=>l.value.length);return{calendarDates:g(()=>{const c=l.value,d=7*6-c.length,f=Xf(t.value.year,t.value.month+1),h=Jf(f);return[...c,...h.slice(0,d).map(p=>new Date(t.value.year,t.value.month+1,p))]}),currentMonthStartIndex:o,currentMonthEndIndex:a}},A9=["onMouseenter"],T9={class:"va-date-picker-cell__day"},Pu=ie({name:"VaDayPicker",__name:"VaDayPicker",props:{monthNames:{type:Array,required:!0},weekdayNames:{type:Array,required:!0},firstWeekday:{type:String,default:"Sunday"},hideWeekDays:{type:Boolean,default:!1},view:{type:Object,default:()=>({type:"day"})},modelValue:{type:[Date,Array,Object]},mode:{type:String,default:"auto"},showOtherMonths:{type:Boolean,default:!1},allowedDays:{type:Function},weekends:{type:Function},highlightWeekend:{type:Boolean,default:!1},highlightToday:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},color:{type:String,default:"primary"}},emits:["update:modelValue","hover:day","click:day"],setup(t,{emit:e}){const n=t,r=e,{firstWeekday:o,weekdayNames:i,view:s}=Or(n),{calendarDates:l,currentMonthStartIndex:a,currentMonthEndIndex:u}=$9(s,{firstWeekday:o}),c=g(()=>o.value.toLowerCase()==="sunday"?i.value:[...i.value.slice(1),i.value[0]]),{hoveredIndex:d,onClick:f,isToday:h,isSelected:p,isInRange:v}=Sg("day",l,n,r),y=g(()=>n.showOtherMonths?0:a.value),b=g(()=>n.showOtherMonths?l.value.length:u.value),{focusedCellIndex:S,containerAttributes:w}=bg({rowSize:7,start:y,end:b,onSelected:C=>f(l.value[C])});fe(S,C=>{d.value=C}),fe(d,C=>{S.value=C});const x=C=>n.view.month!==C.getMonth(),k=C=>n.allowedDays===void 0?!1:!n.allowedDays(C),$=C=>n.weekends===void 0?C.getDay()===6||C.getDay()===0:n.weekends(C);return(C,T)=>(A(),I("div",ee({class:"va-day-picker"},m(w)),[t.hideWeekDays?z("",!0):(A(!0),I(_e,{key:0},Ge(c.value,_=>(A(),I("div",{key:_,class:"va-day-picker__weekday"},[D(C.$slots,"weekday",{},()=>[Ue(Be(_),1)])]))),128)),(A(!0),I(_e,null,Ge(m(l),(_,M)=>(A(),I("div",{class:"va-day-picker__calendar__day-wrapper",key:M,onMouseenter:F=>d.value=M,onMouseleave:T[0]||(T[0]=F=>d.value=-1)},[he(yg,{hidden:x(_)&&!t.showOtherMonths,today:m(h)(_),selected:m(p)(_),"in-range":m(v)(_),"other-month":x(_),weekend:$(_),disabled:k(_),focused:m(d)===M,"highlight-today":t.highlightToday,"highlight-weekend":t.highlightWeekend,readonly:C.$props.readonly,color:t.color,onClick:F=>{m(f)(_),S.value=M}},{default:J(()=>[q("span",T9,[D(C.$slots,"day",de(we({date:_})),()=>[Ue(Be(_.getDate()),1)])])]),_:2},1032,["hidden","today","selected","in-range","other-month","weekend","disabled","focused","highlight-today","highlight-weekend","readonly","color","onClick"])],40,A9))),128))],16))}}),_9={key:0,class:"va-date-picker-header va-date-picker__header"},O9={class:"va-date-picker__header__text"},P9={class:"va-date-picker__header__month"},Bu=ie({name:"VaDatePickerHeader",__name:"VaDatePickerHeader",props:{monthNames:{type:Array,required:!0},view:{type:Object},color:{type:String},disabled:{type:Boolean,default:!1},ariaNextPeriodLabel:{type:String,default:"$t:nextPeriod"},ariaPreviousPeriodLabel:{type:String,default:"$t:previousPeriod"},ariaSwitchViewLabel:{type:String,default:"$t:switchView"}},emits:["update:view"],setup(t,{emit:e}){const n=t,r=e,{syncView:o,prev:i,next:s}=Bx(n,r),l=()=>{o.value.type==="day"?o.value={...o.value,type:"month"}:o.value.type==="month"&&(o.value={...o.value,type:"year"})},a=d=>{o.value=d},u=Ek(Vk(ng())),{tp:c}=yt();return(d,f)=>m(o).type!=="year"?(A(),I("div",_9,[D(d.$slots,"buttonPrev",de(we({onClick:m(i)})),()=>[he(m(et),{"va-child":"prevButton",disabled:d.$props.disabled,icon:"va-arrow-left",preset:"plain",size:"small",color:t.color,textColor:m(u),"aria-label":m(c)(d.$props.ariaPreviousPeriodLabel),round:"",onClick:m(i)},null,8,["disabled","color","textColor","aria-label","onClick"])]),q("div",O9,[D(d.$slots,"header",de(we({year:m(o).year,month:m(o).month,monthNames:t.monthNames,view:m(o),changeView:a,switchView:l})),()=>[he(m(et),{"va-child":"middleButton",disabled:d.$props.disabled,preset:"plain",size:"small",color:t.color,textColor:m(u),"aria-label":m(c)(d.$props.ariaSwitchViewLabel),onClick:l},{default:J(()=>[D(d.$slots,"year",de(we({year:m(o).year})),()=>[Ue(Be(m(o).year),1)]),m(o).type==="day"?D(d.$slots,"month",de(ee({key:0},{month:m(o).month})),()=>[q("span",P9,Be(t.monthNames[m(o).month]),1)]):z("",!0)]),_:3},8,["disabled","color","textColor","aria-label"])])]),D(d.$slots,"buttonNext",de(we({onClick:m(s)})),()=>[he(m(et),{"va-child":"nextButton",disabled:d.$props.disabled,icon:"va-arrow-right",preset:"plain",size:"small",color:t.color,textColor:m(u),"aria-label":m(c)(d.$props.ariaNextPeriodLabel),onClick:m(s),round:""},null,8,["disabled","color","textColor","aria-label","onClick"])])])):z("",!0)}}),B9=["onMouseenter"],Mu=ie({name:"VaMonthPicker",__name:"VaMonthPicker",props:{modelValue:{type:[Date,Array,Object]},monthNames:{type:Array,required:!0},view:{type:Object,default:()=>({type:"month"})},allowedMonths:{type:Function,default:void 0},highlightToday:{type:Boolean,default:!0},mode:{type:String,default:"auto"},readonly:{type:Boolean,default:!1},color:{type:String,default:"primary"}},emits:["update:modelValue","hover:month","click:month"],setup(t,{emit:e}){const n=t,r=e,{view:o}=Or(n),i=g(()=>Array.from(Array(12).keys()).map(p=>new Date(o.value.year,p))),{hoveredIndex:s,onClick:l,isToday:a,isSelected:u,isInRange:c}=Sg("month",i,n,r),d=p=>n.allowedMonths===void 0?!1:!n.allowedMonths(p),{focusedCellIndex:f,containerAttributes:h}=bg({rowSize:3,start:0,end:i.value.length,onSelected:p=>l(i.value[p])});return fe(f,p=>{s.value=p}),fe(s,p=>{f.value=p}),(p,v)=>(A(),I("div",ee({class:"va-month-picker"},m(h)),[(A(!0),I(_e,null,Ge(i.value,(y,b)=>(A(),I("div",{key:b,class:"va-month-picker__month-wrapper",onMouseenter:S=>s.value=b,onMouseleave:v[0]||(v[0]=S=>s.value=-1)},[he(yg,{"in-range":!!m(c)(y),selected:!!m(u)(y),disabled:!!d(y),today:!!m(a)(y),focused:m(s)===b,"highlight-today":t.highlightToday,readonly:p.$props.readonly,color:t.color,onClick:S=>{m(l)(y),f.value=b}},{default:J(()=>[D(p.$slots,"month",de(we({monthIndex:b,month:t.monthNames[b]})),()=>[Ue(Be(t.monthNames[b]),1)])]),_:2},1032,["in-range","selected","disabled","today","focused","highlight-today","readonly","color","onClick"])],40,B9))),128))],16))}}),Iu=ie({name:"VaYearPicker",__name:"VaYearPicker",props:{modelValue:{type:[Date,Array,Object]},allowedYears:{type:Function,default:void 0},highlightToday:{type:Boolean,default:!0},startYear:{type:[Number,String],default:1970},mode:{type:String,default:"auto"},view:{type:Object,default:()=>({type:"year"})},endYear:{type:[Number,String],default:()=>new Date().getFullYear()+50},readonly:{type:Boolean,default:!1},color:{type:String,default:"primary"}},emits:["update:modelValue","hover:year","click:year"],setup(t,{emit:e}){const n=t,r=e,o=Ne(),{view:i}=Or(n),s=(x,k)=>{const $=k-x+1;return Array.from(Array($).keys()).map(C=>m9(x+C))},l=Ye("startYear"),a=Ye("endYear"),u=g(()=>s(l.value,a.value)),c=x=>{if(!o.value)return;const k=o.value.scrollHeight,$=o.value.offsetHeight,C=k/u.value.length*x,T=k/u.value.length,_=C-o.value.scrollTop;_<0?o.value.scrollTo({top:C}):_>$&&o.value.scrollTo({top:C-$+T})},d=x=>{if(!o.value)return;const k=o.value.scrollHeight,$=o.value.offsetHeight,C=k/u.value.length*x;o.value.scrollTo({top:C-$/2})};dt(()=>{const x=u.value.findIndex(k=>k.getFullYear()===i.value.year);d(x)});const{hoveredIndex:f,onClick:h,isToday:p,isSelected:v,isInRange:y}=Sg("year",u,n,r),b=x=>n.allowedYears===void 0?!1:!n.allowedYears(x),{focusedCellIndex:S,containerAttributes:w}=bg({rowSize:1,start:0,end:u.value.length,onFocusIndex:g(()=>u.value.findIndex(x=>x.getFullYear()===i.value.year)),onSelected:x=>h(u.value[x])});return fe(S,x=>x!==-1&&c(x)),fe(S,x=>{f.value=x}),fe(f,x=>{S.value=x}),(x,k)=>(A(),I("div",ee({ref_key:"rootNode",ref:o,class:"va-year-picker"},m(w),{onKeydown:k[1]||(k[1]=Ce(be(()=>{},["prevent"]),["space"]))}),[(A(!0),I(_e,null,Ge(u.value,($,C)=>(A(),te(yg,{key:$.toString(),"in-range":m(y)($),selected:m(v)($),disabled:b($),today:m(p)($),focused:m(S)===C,"highlight-today":t.highlightToday,readonly:x.$props.readonly,color:t.color,onClick:T=>{m(h)($),S.value=C},onMouseenter:T=>f.value=C,onMouseleave:k[0]||(k[0]=T=>f.value=-1)},{default:J(()=>[Ue(Be($.getFullYear()),1)]),_:2},1032,["in-range","selected","disabled","today","focused","highlight-today","readonly","color","onClick","onMouseenter"]))),128))],16))}}),M9={class:"va-date-picker__picker-wrapper"},I9=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],D9=["SU","MO","TU","WE","TH","FR","SA"],qc=ie({name:"VaDatePicker",__name:"VaDatePicker",props:{...jw({prevButton:et,nextButton:et,middleButton:et}),...Kt,...Me,...nt(Bu),...nt(Pu),...nt(Mu),...nt(Iu),modelValue:{type:[Date,Array,Object]},monthNames:{type:Array,default:I9},weekdayNames:{type:Array,default:D9},view:{type:Object},type:{type:String,default:"day"},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},color:{type:String,default:void 0},weekendsColor:{type:String,default:void 0}},emits:[...un,...Li(Bu),...Li(Iu),...Li(Pu),...Li(Mu)],setup(t,{expose:e,emit:n}){const r=t;Ww(r);const o=n,i=W(),{valueComputed:s}=xt(r,o),{syncView:l}=Bx(r,o,{type:r.type}),a=g(()=>({"va-date-picker_without-week-days":r.hideWeekDays,"va-date-picker_disabled":r.disabled})),u=$=>{r.readonly||r.type==="day"&&(s.value=$)},c=$=>{o("click:month",$);const C=$.getFullYear(),T=$.getMonth();r.type!=="month"&&(l.value={type:"day",year:C,month:T})},d=$=>{r.type==="month"&&(s.value=$)},f=$=>{o("click:year",$);const C=$.getFullYear();r.type!=="year"&&(l.value={type:"month",year:C,month:l.value.month})},h=$=>{r.type==="year"&&(s.value=$)},{colorsToCSSVariable:p}=He(),v=g(()=>({...p({color:r.color,"weekends-color":r.weekendsColor},"va-date-picker")})),y=()=>{var $;return($=i.value)==null?void 0:$.$el.focus()};fe(l,($,C)=>{$.type!==C.type&&Ot(y)});const b=$=>r.readonly&&r.type===$,S=gt(nt(Pu)),w=gt(nt(Bu)),x=gt(nt(Mu)),k=gt(nt(Iu));return e({focus:y,focusCurrentPicker:y}),($,C)=>(A(),I("div",{class:Ae(["va-date-picker",a.value]),style:se(v.value)},[he(Bu,ee(m(w),{view:m(l),"onUpdate:view":C[0]||(C[0]=T=>Tt(l)?l.value=T:null)}),vn({_:2},[Ge($.$slots,(T,_)=>({name:_,fn:J(M=>[D($.$slots,_,de(we(M)))])}))]),1040,["view"]),q("div",M9,[m(l).type==="day"?(A(),te(Pu,ee({key:0,ref_key:"currentPicker",ref:i},m(S),{"model-value":m(s),view:m(l),readonly:$.$props.disabled||b("day"),"onUpdate:modelValue":u,"onHover:day":C[1]||(C[1]=T=>$.$emit("hover:day",T)),"onClick:day":C[2]||(C[2]=T=>$.$emit("click:day",T))}),vn({_:2},[Ge($.$slots,(T,_)=>({name:_,fn:J(M=>[D($.$slots,_,de(we(M)))])}))]),1040,["model-value","view","readonly"])):z("",!0),m(l).type==="month"?(A(),te(Mu,ee({key:1,ref_key:"currentPicker",ref:i},m(x),{view:m(l),"model-value":m(s),readonly:$.$props.disabled||b("month"),"onUpdate:modelValue":d,"onHover:month":C[3]||(C[3]=T=>$.$emit("hover:month",T)),"onClick:month":c}),vn({_:2},[Ge($.$slots,(T,_)=>({name:_,fn:J(M=>[D($.$slots,_,de(we(M)))])}))]),1040,["view","model-value","readonly"])):z("",!0),m(l).type==="year"?(A(),te(Iu,ee({key:2,ref_key:"currentPicker",ref:i},m(k),{view:m(l),"model-value":m(s),readonly:$.$props.disabled||b("year"),"onHover:year":C[4]||(C[4]=T=>$.$emit("hover:year",T)),"onUpdate:modelValue":h,"onClick:year":f}),vn({_:2},[Ge($.$slots,(T,_)=>({name:_,fn:J(M=>[D($.$slots,_,de(we(M)))])}))]),1040,["view","model-value","readonly"])):z("",!0)])],6))}}),Mx=nt(er,["innerAnchorSelector","stateful","keyboardNavigation","modelValue"]),Cr={...Mx,modelValue:{},closeOnChange:{type:Boolean,default:null},isOpen:{type:Boolean,default:void 0}},Cg=["update:isOpen"],wg=function(t,e,n={}){const[r]=qi("isOpen",t,e,!1),o=g(()=>t.closeOnChange!==null?t.closeOnChange:m(n.defaultCloseOnValueUpdate||!1));return fe(()=>t.modelValue,()=>{o.value&&(r.value=!1)}),{dropdownProps:gt(Mx),isOpenSync:r}},e0=nt(Wn,["focused","maxLength","counterValue"]),t0=nt(qc),E9=ie({name:"VaDateInput",inheritAttrs:!1,__name:"VaDateInput",props:{...Cr,...ru,...e0,...t0,...Co,...Me,clearValue:{type:Date,default:void 0},modelValue:{type:[Date,Array,Object,String,Number]},resetOnClose:{type:Boolean,default:!0},closeOnContentClick:{type:Boolean,default:!1},offset:{...Cr.offset,default:()=>[2,0]},format:{type:Function},formatDate:{type:Function,default:t=>t.toLocaleDateString()},formatValue:{type:Function},parse:{type:Function},parseDate:{type:Function},delimiter:{type:String,default:", "},rangeDelimiter:{type:String,default:" ~ "},manualInput:{type:Boolean,default:!1},color:{type:String,default:"primary"},leftIcon:{type:Boolean,default:!1},icon:{type:String,default:"va-calendar"},ariaToggleDropdownLabel:{type:String,default:"$t:toggleDropdown"},ariaResetLabel:{type:String,default:"$t:resetDate"},ariaSelectedDateLabel:{type:String,default:"$t:selectedDate"}},emits:[...Xd,...Li(qc),...tf,...mi,...un,...Cg,"update:text"],setup(t,{expose:e,emit:n}){const r=t,o=n,i=Ne(),s=W(),{resetOnClose:l}=Or(r),{trapFocusIn:a,freeFocus:u}=Tk(),c=()=>{const pe=Rt(s.value);if(!pe){u();return}a(pe)};fe([s],()=>{c()});const{valueComputed:d}=xt(r,o),{isOpenSync:f,dropdownProps:h}=wg(r,o,{defaultCloseOnValueUpdate:g(()=>!(Array.isArray(v.value)||Xs(v.value)&&v.value.end===null))}),p=g(()=>!l.value),{valueComputed:v,reset:y}=s9(d,p);fe(f,pe=>{!pe&&!p.value&&y()});const{isFocused:b,focus:S,blur:w,onFocus:x,onBlur:k}=ko(i),$=mg(s),C=pe=>pe?r.formatDate(pe):"...",{parseDateInputValue:T,isValid:_}=l9(r);fe(v,()=>{_.value=!0});const M=pe=>{if(r.format)return r.format(v.value);if(sf(pe))return pe.map(ze=>r.formatDate(ze)).join(r.delimiter);if(of(pe))return r.formatDate(pe);if(Xs(pe))return C(pe.start)+r.rangeDelimiter+C(pe.end);if(pe==null)return"";throw new Error("VaDatePicker: Invalid model value. Value should be Date, Date[] or { start: Date, end: Date | null }, got "+typeof pe)},{text:F,normalized:L}=f9(v,$n(r,"mode"),T,M,r.formatValue),H=g(()=>_.value?v.value?F.value:r.clearValue?M(r.clearValue):"":""),E=({target:pe})=>{if(r.disabled)return;const ze=T(pe.value);_.value&&(v.value=ze)},P=()=>Ve(()=>{d.value=r.clearValue,o("clear"),Pe()}),V=()=>{f.value=!1,S()},O=()=>{Ot(()=>{var pe;return(pe=s.value)==null?void 0:pe.focusCurrentPicker()})},N=()=>{f.value?O():S()},re=pe=>f.value?!1:r.disabled||r.readonly?!0:pe===void 0?!1:r.manualInput&&(pe==null?void 0:pe.code)!=="Space",X=pe=>{re(pe instanceof KeyboardEvent?pe:void 0)||(f.value=!f.value,Ot(N))},ke=()=>{r.disabled||r.readonly||(f.value=!0,Ot(O))},{isDirty:$e,isTouched:ye,computedError:j,computedErrorMessages:ce,listeners:Se,validationAriaAttributes:ne,validate:Z,withoutValidation:Ve,resetValidation:Pe}=wo(r,o,{reset:P,focus:S,value:v});fe(f,pe=>{pe||(ye.value=!0)});const qe=g(()=>!_.value&&v.value!==r.clearValue||j.value),bt=Ln(),B=g(()=>{const pe=[r.leftIcon&&"prependInner",(!r.leftIcon||r.clearable)&&"icon"];return Object.keys(bt).filter(ze=>!pe.includes(ze))}),{canBeCleared:R,clearIconProps:Q,onFocus:K,onBlur:U}=nf(r,v),Y=g(()=>r.disabled?{}:r.manualInput?{cursor:"text"}:{cursor:"pointer"}),oe=g(()=>r.manualInput?r.disabled||r.readonly?-1:0:-1),ae=g(()=>({role:oe.value===0?"button":"none",ariaHidden:oe.value===-1,name:r.icon,color:"secondary",tabindex:oe.value})),ve=gt(e0),ue=g(()=>({...ve.value,focused:b.value||$.value,error:qe.value,errorMessages:ce.value,readonly:r.readonly||!r.manualInput})),Oe=g(()=>({focus:()=>{r.disabled||(x(),!r.readonly&&K())},blur:()=>{r.disabled||(k(),!r.readonly&&(U(),Se.onBlur()))}})),{tp:Re}=yt(),Le=os(),Ke=g(()=>({readonly:r.readonly||!r.manualInput,disabled:r.disabled,tabindex:r.disabled?-1:0,placeholder:r.placeholder,value:H.value,ariaLabel:r.label||Re(r.ariaSelectedDateLabel),ariaRequired:r.requiredMark,ariaDisabled:r.disabled,ariaReadOnly:r.readonly,...ne.value,...vo(Le,["class","style"])})),Qe=g(()=>({...h.value,stateful:!1,innerAnchorSelector:".va-input-wrapper__field",trigger:["click","right-click","enter","space"]})),ft=ue,G=Oe,Fe=gt(t0);return e({valueText:H,valueWithoutText:L,valueDate:L,focus:S,blur:w,reset:P,validate:Z,showDropdown:ke,hideAndFocus:V,toggleDropdown:X,focusDatePicker:O,isDirty:$e,isTouched:ye}),(pe,ze)=>(A(),te(m(er),ee({modelValue:m(f),"onUpdate:modelValue":ze[9]||(ze[9]=Xe=>Tt(f)?f.value=Xe:null),class:["va-date-input",pe.$attrs.class],style:pe.$attrs.style},Qe.value,{onOpen:O,role:"none"}),{anchor:J(()=>[D(pe.$slots,"input",de(we({valueText:H.value,inputAttributes:Ke.value,inputWrapperProps:m(ft),inputListeners:m(G)})),()=>[he(m(Wn),ee({class:"va-date-input__anchor",style:Y.value},m(ft),ur(m(G)),{"model-value":H.value,onChange:E}),vn({icon:J(()=>[m(R)?(A(),te(m(Ze),ee({key:0,"aria-label":m(Re)(pe.$props.ariaResetLabel)},{...ae.value,...m(Q)},{onClick:be(P,["stop"]),onKeydown:[Ce(be(P,["stop"]),["enter"]),Ce(be(P,["stop"]),["space"])]}),null,16,["aria-label","onKeydown"])):z("",!0),!pe.$props.leftIcon&&pe.$props.icon?(A(),te(m(Ze),ee({key:1,"aria-label":m(Re)(pe.$props.ariaToggleDropdownLabel)},ae.value),null,16,["aria-label"])):z("",!0)]),_:2},[Ge(B.value,Xe=>({name:Xe,fn:J(Yt=>[D(pe.$slots,Xe,de(we(Yt)))])})),pe.$slots.prependInner||pe.$props.leftIcon?{name:"prependInner",fn:J(Xe=>[D(pe.$slots,"prependInner",de(we(Xe))),pe.$props.leftIcon?(A(),te(m(Ze),ee({key:0,"aria-label":m(Re)(pe.$props.ariaToggleDropdownLabel)},ae.value),null,16,["aria-label"])):z("",!0)]),key:"0"}:void 0]),1040,["style","model-value"])])]),default:J(()=>[he(m(Xi),{class:"va-date-input__dropdown-content",onKeydown:ze[8]||(ze[8]=Ce(Xe=>m(S)(),["esc"])),role:"dialog"},{default:J(()=>[he(qc,ee({ref_key:"datePicker",ref:s},m(Fe),{modelValue:m(L),"onUpdate:modelValue":ze[0]||(ze[0]=Xe=>Tt(L)?L.value=Xe:null),"onClick:day":ze[1]||(ze[1]=Xe=>pe.$emit("click:day",Xe)),"onClick:month":ze[2]||(ze[2]=Xe=>pe.$emit("click:month",Xe)),"onClick:year":ze[3]||(ze[3]=Xe=>pe.$emit("click:year",Xe)),"onHover:day":ze[4]||(ze[4]=Xe=>pe.$emit("hover:day",Xe)),"onHover:month":ze[5]||(ze[5]=Xe=>pe.$emit("hover:month",Xe)),"onHover:year":ze[6]||(ze[6]=Xe=>pe.$emit("hover:year",Xe)),"onUpdate:view":ze[7]||(ze[7]=Xe=>{pe.$nextTick(()=>c()),pe.$emit("update:view",Xe)})}),vn({_:2},[Ge(pe.$slots,(Xe,Yt)=>({name:Yt,fn:J(rr=>[D(pe.$slots,Yt,de(we(rr)))])}))]),1040,["modelValue"])]),_:3})]),_:3},16,["modelValue","class","style"]))}}),L9=me(E9),V9=me(qc),R9=["aria-orientation"],F9={key:0,class:"va-divider__text"},Du="va-divider",N9=ie({name:"VaDivider",__name:"VaDivider",props:{...Me,vertical:{type:Boolean,default:!1},dashed:{type:Boolean,default:!1},inset:{type:Boolean,default:!1},orientation:{type:String,default:"center",validator:t=>["left","right","center"].includes(t)},color:{type:String,default:"backgroundBorder"}},setup(t){const e=t,{getColor:n}=He(),r=g(()=>n(e.color)),o=Ln(),i=g(()=>!!o.default),s=g(()=>({[`${Du}--vertical`]:e.vertical,[`${Du}--inset`]:e.inset,[`${Du}--${e.orientation}`]:e.orientation&&!e.vertical,[`${Du}--dashed`]:e.dashed}));return(l,a)=>(A(),I("div",{role:"separator",class:Ae(["va-divider",s.value]),"aria-orientation":t.vertical?"vertical":"horizontal","aria-hidden":!0,style:se(`--va-color-computed: ${String(r.value)}`)},[i.value&&!t.vertical?(A(),I("div",F9,[D(l.$slots,"default")])):z("",!0)],14,R9))}}),Ix=me(N9),ou=Symbol("VaFileUpload"),H9=ie({name:"VaList",__name:"VaList",props:{...Me,fit:{type:Boolean,default:!1}},setup(t){const e=t,n=g(()=>({"va-list--fit":e.fit}));return(r,o)=>(A(),I("div",{class:Ae(["va-list",n.value]),role:"list"},[D(r.$slots,"default")],2))}}),z9=ie({name:"VaListItem",__name:"VaListItem",props:{...cs,...Me,tag:{type:String,default:"div"},disabled:{type:Boolean,default:!1}},emits:["focus","click"],setup(t,{emit:e}){const n=t,r=g(()=>n.disabled?-1:0),o=ct("va-list-item",()=>({...Bt(n,["disabled"])})),{tagComputed:i,hrefComputed:s}=gi(n);return(l,a)=>(A(),te(zn(m(i)),{class:Ae(["va-list-item",m(o)]),role:"listitem",href:m(s),target:l.target,to:l.to,replace:l.replace,exact:l.exact,"active-class":l.activeClass,"exact-active-class":l.exactActiveClass,tabindex:r.value},{default:J(()=>[q("div",{class:"va-list-item__inner",onClick:a[0]||(a[0]=u=>l.$emit("click")),onFocus:a[1]||(a[1]=u=>l.$emit("focus"))},[D(l.$slots,"default")],32)]),_:3},8,["href","target","to","replace","exact","active-class","exact-active-class","class","tabindex"]))}}),j9=ie({name:"VaListLabel",__name:"VaListLabel",props:{...Me,color:{type:String,default:"primary"}},setup(t){const e=t,{getColor:n}=He(),r=g(()=>({color:n(e.color)}));return(o,i)=>(A(),I("div",{class:"va-list-label",style:se(r.value)},[D(o.$slots,"default")],4))}}),W9=ie({name:"VaListItemLabel",__name:"VaListItemLabel",props:{...Me,caption:{type:Boolean,default:!1},lines:{type:[Number,String],default:1}},setup(t){const e=t,n=Ye("lines"),r=g(()=>({"va-list-item-label--caption":e.caption})),o=g(()=>({"-webkit-line-clamp":n.value}));return(i,s)=>(A(),I("div",{class:Ae(["va-list-item-label",r.value]),style:se(o.value)},[D(i.$slots,"default")],6))}}),U9=ie({name:"VaListItemSection",__name:"VaListItemSection",props:{...Me,icon:{type:Boolean,default:!1},avatar:{type:Boolean,default:!1}},setup(t){const e=t,n=g(()=>({"va-list-item-section--main":!e.icon&&!e.avatar,"va-list-item-section--icon":e.icon,"va-list-item-section--avatar":e.avatar}));return(r,o)=>(A(),I("div",{class:Ae(["va-list-item-section",n.value])},[D(r.$slots,"default")],2))}}),K9=ie({name:"VaListSeparator",__name:"VaListSeparator",props:{...Me,fit:{type:Boolean,default:!1},spaced:{type:Boolean,default:!1}},setup(t){const e=t,n=g(()=>({"va-list-separator--offset":!e.fit,"va-list-separator--spaced":e.spaced}));return(r,o)=>(A(),I("div",{"aria-hidden":"true",class:Ae(["va-list-separator",n.value])},null,2))}}),lf=me(z9),G9=me(j9),q9=me(W9),Js=me(U9),Y9=me(K9),Dx=me(H9),X9={key:0,class:"va-progress-bar__info"},J9=ie({name:"VaProgressBar",__name:"VaProgressBar",props:{...Me,modelValue:{type:[Number,String],default:0},indeterminate:{type:Boolean,default:!1},color:{type:String,default:"primary"},size:{type:[Number,String],default:"medium"},buffer:{type:[Number,String],default:100},rounded:{type:Boolean,default:!0},reverse:{type:Boolean,default:!1},contentInside:{type:Boolean,default:!1},showPercent:{type:Boolean,default:!1},max:{type:[Number,String],default:100},ariaLabel:{type:String,default:"$t:progressState"}},setup(t){const e=t,{getColor:n,getHoverColor:r}=He(),o=g(()=>n(e.color)),{textColorComputed:i}=qt(o),s=g(()=>typeof e.size=="string"&&["small","medium","large"].includes(e.size)),l=()=>{if(typeof e.size=="number")return`${e.size}px`;if(!s.value)return e.size},{tp:a}=yt(),u=g(()=>100/Number(e.max)*Number(e.modelValue)),c=g(()=>({"va-progress-bar--square":!e.rounded,[`va-progress-bar--${e.size}`]:s.value})),d=g(()=>({"--va-progress-bar-color":o.value,"--va-progress-bar-background-color":r(o.value)})),f=g(()=>({height:l()})),h=g(()=>({width:`${e.indeterminate?100:Ki(Number(e.buffer),0,100)}%`,color:i.value,[e.reverse?"right":"left"]:0})),p=g(()=>({marginLeft:e.reverse?"auto":void 0,width:`${Ki(u.value,0,100)}%`})),v=g(()=>({animationDirection:e.reverse?"reverse":"normal"})),y=g(()=>({role:"progressbar","aria-label":a(e.ariaLabel),"aria-valuenow":e.indeterminate?void 0:e.modelValue}));return(b,S)=>(A(),I("div",ee({class:["va-progress-bar",c.value],style:d.value},y.value),[b.$props.contentInside?z("",!0):(A(),I("div",X9,[D(b.$slots,"default",de(we({value:b.$props.modelValue})),()=>[b.$props.showPercent?(A(),I(_e,{key:0},[Ue(Be(b.$props.modelValue)+"% ",1)],64)):z("",!0)])])),q("div",{class:"va-progress-bar__wrapper",style:se(f.value)},[q("div",{class:"va-progress-bar__buffer",style:se(h.value)},[b.$props.contentInside?D(b.$slots,"default",de(ee({key:0},{value:b.$props.modelValue})),()=>[b.$props.showPercent?(A(),I(_e,{key:0},[Ue(Be(b.$props.modelValue)+"% ",1)],64)):z("",!0)]):z("",!0)],4),t.indeterminate?(A(),I(_e,{key:0},[q("div",{class:"va-progress-bar__progress--indeterminate-start",style:se(v.value)},null,4),q("div",{class:"va-progress-bar__progress--indeterminate-end",style:se(v.value)},null,4)],64)):(A(),I("div",{key:1,class:"va-progress-bar__progress",style:se(p.value)},null,4))],4)],16))}}),Ex=me(J9),iu=(t,e)=>{const n=Mn(t);if(!n)throw new Error(e);return n},Q9={class:"va-file-upload-undo__text"},Z9="The VaFileUploadUndo component should be used in the context of VaFileUpload component",eq=ie({name:"VaFileUploadUndo",__name:"VaFileUploadUndo",props:{vertical:{type:Boolean,default:!1}},emits:["recover"],setup(t,{emit:e}){const n=t,r=W(100),{undoDuration:o,undoButtonText:i,deletedFileMessage:s}=iu(ou,Z9),l=ct("va-file-upload-undo",()=>({vertical:n.vertical})),a=g(()=>`${o.value??0}ms`);return dt(()=>{const u=setTimeout(()=>{r.value=0,clearTimeout(u)},0)}),(u,c)=>(A(),I(_e,null,[he(m(Ex),{"model-value":r.value,rounded:!1,class:"va-file-upload-undo-progress-bar",style:se(`--va-undo-duration-style: ${String(a.value)}`)},null,8,["model-value","style"]),q("div",{class:Ae(["va-file-upload-undo",m(l)]),style:se(`--va-undo-duration-style: ${String(a.value)}`)},[q("span",Q9,Be(m(s)),1),he(m(et),{class:"va-file-upload-undo__button","aria-label":m(i),size:"small",outline:"",onClick:c[0]||(c[0]=d=>u.$emit("recover"))},{default:J(()=>[Ue(Be(m(i)),1)]),_:1},8,["aria-label"])],6)],64))}}),Lx=me(eq),tq={class:"va-file-upload-list-item__content"},nq={key:0,class:"va-file-upload-list-item__name"},rq={class:"va-file-upload-list-item__size"},oq="The VaFileUploadListItem component should be used in the context of VaFileUpload component",iq=ie({name:"VaFileUploadListItem",__name:"VaFileUploadListItem",props:{file:{type:Object,default:null},color:{type:String,default:"success"},ariaRemoveFileLabel:{type:String,default:"$t:removeFile"}},emits:["remove"],setup(t,{emit:e}){const{tp:n}=yt(),r=e,{undo:o,disabled:i,undoDuration:s}=iu(ou,oq),{onFocus:l,onBlur:a}=ko(),u=W(!1),c=()=>{o.value?(u.value=!0,setTimeout(()=>{u.value&&(r("remove"),u.value=!1)},s.value??0)):(r("remove"),u.value=!1)},d=()=>{u.value=!1},f=ct("va-file-upload-list-item",()=>({undo:u.value}));return(h,p)=>(A(),te(m(lf),{class:Ae(["va-file-upload-list-item",m(f)]),tabindex:"-1",disabled:m(i),"aria-disabled":m(i)},{default:J(()=>[u.value&&m(o)?(A(),te(m(Js),{key:0},{default:J(()=>[he(m(Lx),{onRecover:d})]),_:1})):(A(),te(m(Js),{key:1},{default:J(()=>[q("div",tq,[t.file&&t.file.name?(A(),I("div",nq,Be(t.file&&t.file.name),1)):z("",!0),q("div",rq,Be(t.file&&t.file.size),1),m(i)?z("",!0):(A(),te(m(et),{key:1,flat:"",color:"danger",icon:"clear",class:"va-file-upload-list-item__delete","aria-label":m(n)(h.$props.ariaRemoveFileLabel),onClick:be(c,["stop"]),onKeydown:[Ce(be(c,["stop"]),["enter"]),Ce(be(c,["stop"]),["space"])],onFocus:m(l),onBlur:m(a)},null,8,["aria-label","onKeydown","onFocus","onBlur"]))])]),_:1}))]),_:1},8,["class","disabled","aria-disabled"]))}}),Vx=me(iq),sq=["src","alt"],lq={class:"va-file-upload-gallery-item__overlay"},aq=["title"],uq="The VaFileUploadGalleryItem component should be used in the context of VaFileUpload component",cq=ie({name:"VaFileUploadGalleryItem",__name:"VaFileUploadGalleryItem",props:{file:{type:Object,default:null},color:{type:String,default:"success"},ariaRemoveFileLabel:{type:String,default:"$t:removeFile"}},emits:["remove"],setup(t,{emit:e}){const n=t,r=e,{undo:o,disabled:i,undoDuration:s}=iu(ou,uq),{isFocused:l,onFocus:a,onBlur:u}=ko(),c=W(""),d=W(!1),f=g(()=>({backgroundColor:qm(n.color,.7)})),h=ct("va-file-upload-gallery-item",()=>({notImage:!c.value,focused:l.value,undo:d.value})),p=()=>{o.value?(d.value=!0,setTimeout(()=>{d.value&&(r("remove"),d.value=!1)},s.value??0)):(r("remove"),d.value=!1)},v=()=>{d.value=!1},y=()=>{if(!(!n.file.name||!n.file.image)){if(n.file.image.url)c.value=n.file.image.url;else if(n.file.image instanceof File){const x=new FileReader;x.readAsDataURL(n.file.image),x.onload=k=>{var $,C;(($=k.target)==null?void 0:$.result).includes("image")&&(c.value=(C=k.target)==null?void 0:C.result)}}}};dt(y),fe(()=>n.file,y);const{t:b,tp:S}=yt(),{textColorComputed:w}=qt($n(n,"color"));return(x,k)=>(A(),te(m(lf),{class:Ae(["va-file-upload-gallery-item",m(h)]),tabindex:"-1",disabled:m(i),"aria-disabled":m(i),onFocus:m(a),onBlur:m(u)},{default:J(()=>[d.value&&m(o)?(A(),te(m(Js),{key:0},{default:J(()=>[he(m(Lx),{vertical:"",onRecover:v})]),_:1})):(A(),te(m(Js),{key:1},{default:J(()=>[c.value?(A(),I("img",{key:0,src:c.value,alt:t.file.name||"",class:"va-file-upload-gallery-item__image"},null,8,sq)):z("",!0),q("div",lq,[q("div",{class:"va-file-upload-gallery-item__overlay-background",style:se(f.value)},null,4),t.file&&t.file.name?(A(),I("div",{key:0,class:"va-file-upload-gallery-item__name",title:t.file.name,style:se({color:m(w)})},Be(t.file.name),13,aq)):z("",!0),m(i)?z("",!0):(A(),te(m(et),{key:1,flat:"",color:"danger",icon:"va-delete",class:"va-file-upload-gallery-item__delete","aria-label":m(S)(x.$props.ariaRemoveFileLabel),onClick:p,onFocus:m(a),onBlur:m(u)},null,8,["aria-label","onFocus","onBlur"]))])]),_:1}))]),_:1},8,["class","disabled","aria-disabled","onFocus","onBlur"]))}}),Rx=me(cq),dq={class:"va-file-upload-single-item__name"},fq="The VaFileUploadSingleItem component should be used in the context of VaFileUpload component",hq=ie({name:"VaFileUploadSingleItem",__name:"VaFileUploadSingleItem",props:{file:{type:Object,default:null},ariaRemoveFileLabel:{type:String,default:"$t:removeFile"}},emits:["remove"],setup(t,{emit:e}){const{t:n,tp:r}=yt(),{disabled:o}=iu(ou,fq);return(i,s)=>(A(),te(m(lf),{disabled:m(o),"aria-disabled":m(o),class:"va-file-upload-single-item",tabindex:"-1"},{default:J(()=>[he(m(Js),{class:"va-file-upload-single-item__content"},{default:J(()=>[q("div",dq,Be(t.file&&t.file.name),1),m(o)?z("",!0):(A(),te(m(et),{key:0,class:"va-file-upload-single-item__button","aria-label":m(r)(i.$props.ariaRemoveFileLabel),size:"small",color:"danger",preset:"secondary",onClick:s[0]||(s[0]=l=>i.$emit("remove"))},{default:J(()=>[Ue(" Delete ")]),_:1},8,["aria-label"]))]),_:1})]),_:1},8,["disabled","aria-disabled"]))}}),Fx=me(hq),n0=nt(Rx),r0=nt(Vx),o0=nt(Fx),pq=ie({name:"VaFileUploadList",__name:"VaFileUploadList",props:{type:{type:String,default:""},files:{type:Array,default:null},...n0,...r0,...o0},emits:["remove","removeSingle"],setup(t,{emit:e}){const n=t,r=g(()=>n.files.map(o)),o=c=>({name:c.name||c.url||"",size:i(c.size),date:s(new Date),image:c}),i=c=>{if(c===0)return"0 Bytes";if(!c)return"";const d=1024,f=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],h=Math.floor(Math.log(c)/Math.log(d));return parseFloat((c/Math.pow(d,h)).toFixed(2))+" "+f[h]},s=(c=new Date)=>c.toLocaleDateString("en-US",{hour:"2-digit",minute:"2-digit",month:"short",day:"numeric",year:"numeric"}),l=gt(n0),a=gt(r0),u=gt(o0);return(c,d)=>(A(),te(m(Dx),{class:Ae(["va-file-upload-list",`va-file-upload-list--${t.type}`]),role:t.type!=="single"?"list":void 0},{default:J(()=>[t.type==="list"?(A(!0),I(_e,{key:0},Ge(r.value,(f,h)=>(A(),te(m(Vx),ee({key:f.name},m(a),{file:f,role:"listitem",onRemove:p=>c.$emit("remove",h)}),null,16,["file","onRemove"]))),128)):z("",!0),t.type==="gallery"?(A(!0),I(_e,{key:1},Ge(r.value,(f,h)=>(A(),te(m(Rx),ee(m(l),{key:f.name,file:f,role:"listitem",onRemove:p=>c.$emit("remove",h)}),null,16,["file","onRemove"]))),128)):z("",!0),t.type==="single"&&r.value.length?(A(),te(m(Fx),ee({key:2},m(u),{file:r.value[r.value.length-1],onRemove:d[0]||(d[0]=f=>c.$emit("removeSingle"))}),null,16,["file"])):z("",!0)]),_:1},8,["role","class"]))}}),Nx=me(pq),mq={class:"va-file-upload__field"},gq={key:0,class:"va-file-upload__field__text"},vq=["accept","multiple","disabled"],i0=nt(Nx),yq=ie({name:"VaFileUpload",__name:"VaFileUpload",props:{...Me,...i0,fileTypes:{type:String,default:""},dropzone:{type:Boolean,default:!1},hideFileList:{type:Boolean,default:!1},color:{type:String,default:"primary"},disabled:{type:Boolean,default:!1},undo:{type:Boolean,default:!1},undoDuration:{type:[Number,String],default:3e3},undoButtonText:{type:String,default:"$t:undo"},dropZoneText:{type:String,default:"$t:dropzone"},uploadButtonText:{type:String,default:"$t:uploadFile"},deletedFileMessage:{type:String,default:"$t:fileDeleted"},modelValue:{type:[Object,Array],default:()=>[]},type:{type:String,default:"list",validator:t=>["list","gallery","single"].includes(t)}},emits:["update:modelValue","file-removed","file-added"],setup(t,{emit:e}){const n=t,r=e,o=Ne(),i=W(!1),s=W(!1),{getColor:l,shiftHSLAColor:a}=He(),u=g(()=>l(n.color)),c=g(()=>({backgroundColor:n.dropzone?a(u.value,{a:s.value?-.82:-.92}):"transparent"})),d=ct("va-file-upload",()=>({dropzone:n.dropzone,disabled:n.disabled})),f=g({get(){return Array.isArray(n.modelValue)?n.modelValue:[n.modelValue]},set(k){n.type==="single"?r("update:modelValue",k[0]):r("update:modelValue",k)}}),h=k=>k.filter($=>{const C=$.name||$.url;if(!C)return!1;if($.url||["audio/*","video/*","image/*"].find(L=>n.fileTypes.includes(L)))return!0;const M=C.substring(C.lastIndexOf(".")+1).toLowerCase(),F=n.fileTypes.includes(M);return F||(i.value=!0),F}),p=k=>{var $,C;const T=(($=k.target)==null?void 0:$.files)||((C=k.dataTransfer)==null?void 0:C.files);if(!T)return;const _=n.fileTypes?h(Array.from(T)):T;f.value=n.type==="single"?_:[...f.value,..._],r("file-added",_)},v=k=>{p(k),o.value&&(o.value.value="")},y=k=>{if(k in f.value){const $=f.value[k];f.value=f.value.filter((C,T)=>T!==k),r("file-removed",$)}},b=()=>{if(f.value.length>0){const k=f.value[0];f.value=[],r("file-removed",k)}},S=()=>{o.value&&o.value.click()};dt(()=>{if(Array.isArray(f.value)){const k=h(f.value);k.length!==f.value.length&&(f.value=k)}});const{tp:w}=yt();Pr(ou,{undo:$n(n,"undo"),disabled:$n(n,"disabled"),undoDuration:Ye("undoDuration"),undoButtonText:g(()=>w(n.undoButtonText)),deletedFileMessage:g(()=>w(n.deletedFileMessage))});const x=gt(i0);return(k,$)=>(A(),I("div",{class:Ae(["va-file-upload",m(d)]),style:se(c.value)},[D(k.$slots,"default",{},()=>[q("div",mq,[t.dropzone?(A(),I("div",gq,Be(m(w)(t.dropZoneText)),1)):z("",!0),he(m(et),{class:"va-file-upload__field__button",disabled:t.disabled,"aria-disabled":t.disabled,color:u.value,style:se({"pointer-events":s.value?"none":void 0}),onChange:v,onClick:S},{default:J(()=>[Ue(Be(m(w)(t.uploadButtonText)),1)]),_:1},8,["disabled","aria-disabled","color","style"])])]),q("input",{ref_key:"fileInputRef",ref:o,type:"file",class:"va-file-upload__field__input",tabindex:-1,"aria-hidden":"true",accept:t.fileTypes,multiple:t.type!=="single",disabled:t.disabled,onChange:v,onDragenter:$[0]||($[0]=C=>s.value=!0),onDragleave:$[1]||($[1]=C=>s.value=!1)},null,40,vq),f.value.length&&!k.$props.hideFileList?(A(),te(m(Nx),ee({key:0},m(x),{type:t.type,files:f.value,color:u.value,onRemove:y,onRemoveSingle:b}),null,16,["type","files","color"])):z("",!0),he(m(tg),{modelValue:i.value,"onUpdate:modelValue":$[2]||($[2]=C=>i.value=C),"hide-default-actions":"",title:"File validation",message:"File type is incorrect!"},null,8,["modelValue"])],6))}}),bq=me(yq),Sq=t=>{const e=W(new Map);return{immediate:g(()=>t.immediate),fields:g(()=>[...e.value.values()]),forceHideErrors:g(()=>t.hideErrors),forceHideErrorMessages:g(()=>t.hideErrorMessages),forceHideLoading:g(()=>t.hideLoading),forceDirty:W(!1),registerField:(n,r)=>{e.value.set(n,r)},unregisterField:n=>{e.value.delete(n)}}},Cq=t=>{const e=Sq(t);Pr(hk,e);const{fields:n,forceDirty:r}=e,o=g(()=>n.value.map(w=>m(w.name)).filter(Boolean)),i=g(()=>n.value.reduce((w,x)=>(m(x.name)&&(w[m(x.name)]=x),w),{})),s=g(()=>n.value.reduce((w,x)=>(m(x.name)&&(w[m(x.name)]=x.value),w),{})),l=g(()=>n.value.every(w=>m(w.isValid))),a=g(()=>n.value.some(w=>m(w.isLoading))),u=g(()=>n.value.map(w=>m(w.errorMessages)).flat()),c=g(()=>n.value.reduce((w,x)=>(m(x.name)&&(w[m(x.name)]=m(x.errorMessages)),w),{})),d=g({get(){return n.value.some(w=>m(w.isDirty))||r.value},set(w){r.value=w,n.value.forEach(x=>{x.isDirty=w})}}),f=g({get(){return console.log(n.value),n.value.some(w=>w.isTouched)},set(w){n.value.forEach(x=>{x.isTouched=w})}}),h=()=>(d.value=!0,n.value.reduce((w,x)=>x.validate()&&w,!0)),p=()=>(d.value=!0,Promise.all(n.value.map(w=>w.validateAsync())).then(w=>w.every(Boolean))),v=()=>{d.value=!1,n.value.forEach(w=>w.reset())},y=()=>{d.value=!1,n.value.forEach(w=>w.resetValidation())},b=()=>{var w;(w=n.value[0])==null||w.focus()},S=()=>{const w=n.value.find(x=>!x.isValid);w==null||w.focus()};return pk({name:$n(t,"name"),isValid:l,isLoading:a,isDirty:d,isTouched:f,validate:h,validateAsync:p,reset:v,resetValidation:y,focus:b,errorMessages:u}),{immediate:g(()=>t.immediate),isDirty:d,isTouched:f,formData:s,fields:n,fieldsNamed:i,fieldNames:o,isValid:l,isLoading:a,errorMessages:u,errorMessagesNamed:c,validate:h,validateAsync:p,reset:v,resetValidation:y,focus:b,focusInvalidField:S}},Un={stateful:!0},wq={VaInput:Un,VaSelect:Un,VaCheckbox:Un,VaRadio:Un,VaDatePicker:Un,VaTimePicker:Un,VaColorPicker:Un,VaSlider:Un,VaSwitch:Un,VaFileUpload:Un,VaRating:Un,VaDateInput:Un,VaTimeInput:Un},kq=ie({name:"VaForm",__name:"VaForm",props:{...Me,autofocus:{type:Boolean,default:!1},immediate:{type:Boolean,default:!1},tag:{type:String,default:"form"},trigger:{type:String,default:"blur"},modelValue:{type:Boolean,default:!0},hideErrors:{type:Boolean,default:!1},hideErrorMessages:{type:Boolean,default:!1},hideLoading:{type:Boolean,default:!1},stateful:{type:Boolean,default:!1},name:{type:String,default:void 0}},emits:["update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,o=n,i=Cq(r);fe(i.isValid,C=>{o("update:modelValue",C)}),fe(()=>r.autofocus,C=>{C&&i.focus()}),dt(()=>{r.autofocus&&i.focus()}),fe(i.fields,C=>{C.length&&r.immediate&&i.validate()},{immediate:!0}),P8(g(()=>r.stateful?wq:{}));const{immediate:s,isDirty:l,isTouched:a,formData:u,fields:c,fieldsNamed:d,fieldNames:f,isValid:h,isLoading:p,errorMessages:v,errorMessagesNamed:y,validate:b,validateAsync:S,reset:w,resetValidation:x,focus:k,focusInvalidField:$}=i;return e({immediate:s,isDirty:l,formData:u,fields:c,fieldsNamed:d,fieldNames:f,isValid:h,isTouched:a,isLoading:p,errorMessages:v,errorMessagesNamed:y,validate:b,validateAsync:S,reset:w,resetValidation:x,focus:k,focusInvalidField:$}),(C,T)=>(A(),te(zn(t.tag),ee({class:"va-form",onSubmit:T[0]||(T[0]=_=>C.$attrs.action===void 0&&_.preventDefault())},C.$attrs),{default:J(()=>[D(C.$slots,"default",de(we({isValid:m(h),validate:m(b)})))]),_:3},16))}}),xq=me(kq),$q=(t=0)=>new Promise(e=>setTimeout(e,t)),Aq=(t,e,n)=>{const r=()=>{var i;(i=e.value)==null||i.addEventListener("scroll",n.value,{passive:!0})},o=()=>{var i;(i=e.value)==null||i.removeEventListener("scroll",n.value)};return dt(()=>{e.value&&(e.value.style.overflowY="scroll",t.reverse&&(e.value.scrollTop=e.value.scrollHeight),r())}),jt(o),{addScrollListener:r,removeScrollListener:o}},Tq={class:"va-infinite-scroll__spinner__default"},_q=ie({name:"VaInfiniteScroll",__name:"VaInfiniteScroll",props:{...Me,load:{type:Function,required:!0},offset:{type:[Number,String],default:500},reverse:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},scrollTarget:{type:[String,Object],default:null},debounce:{type:[Number,String],default:100},tag:{type:String,default:"div"}},emits:["onload","onerror"],setup(t,{emit:e}){const n=t,r=e,o=Ne(),i=Ne(),s=W(!1),l=W(!1),a=W(!1),u=W(),c=W(0),d=W(0),f=g(()=>{var H;let E;return typeof n.scrollTarget=="string"?E=document.querySelector(n.scrollTarget):E=n.scrollTarget||((H=o.value)==null?void 0:H.parentElement),E||document.body}),{addScrollListener:h,removeScrollListener:p}=Aq(n,f,u),v=Ye("offset"),y=Ye("debounce"),{getColor:b}=He(),S=g(()=>l.value?b("danger"):b("primary")),w=g(()=>{var H;return((H=i.value)==null?void 0:H.offsetHeight)||0}),x=g(()=>v.value+w.value),k=()=>{n.disabled||(s.value=!1,p())},$=()=>{n.disabled||h()},C=()=>{const{scrollTop:H,scrollHeight:E,clientHeight:P}=f.value;c.value=E-H;const V=H-d.value;if(d.value=H,n.disabled||l.value||s.value)return;if(a.value){a.value=!1;return}n.reverse&&V>0||!n.reverse&&V<0||(n.reverse?H:E-H-P)>x.value||(s.value=!0,n.load().then(M).catch(L))},T=H=>{a.value=!0,f.value.scrollTop=H},_=()=>{const{scrollTop:H,scrollHeight:E,clientHeight:P}=f.value;if(n.reverse){const V=E-H=w.value;if(V&&O)return;E-c.value>w.value?T(E-c.value):T(w.value)}n.reverse||!(E-H-P>=w.value)&&T(E-P-w.value)},M=()=>{_(),s.value=!1,r("onload")},F=()=>{_(),a.value=!1,l.value=!1,s.value=!1,r("onerror")},L=()=>{k(),l.value=!0,$q(1200).then(F).then($)};return fe(()=>y.value,H=>{u.value=zm(C,H)},{immediate:!0}),fe(()=>n.disabled,H=>{H?k():$()}),(H,E)=>(A(),te(zn(H.$props.tag),{ref_key:"element",ref:o,role:"feed",class:Ae(["va-infinite-scroll",{"va-infinite-scroll--reversed":H.$props.reverse}]),"aria-busy":s.value},{default:J(()=>[D(H.$slots,"default"),q("div",{ref_key:"spinnerSlotContainer",ref:i,class:Ae(["va-infinite-scroll__spinner",{"va-infinite-scroll__spinner--invisible":!s.value}])},[H.$props.disabled?z("",!0):D(H.$slots,"loading",{key:0},()=>[q("div",Tq,[he(m(bl),{size:"small",thickness:.15,color:S.value,indeterminate:""},null,8,["color"])])])],2)]),_:3},8,["class","aria-busy"]))}}),Oq=me(_q),Pq={top:[0,1,2],left:[0,3,6],right:[2,5,8],bottom:[6,7,8]},Bq=["left","right","top","bottom"],Mq=t=>{const e=()=>[...Bq].sort((r,o)=>(t[r].order??0)-(t[o].order??0)),n=(r,o,i)=>{o.forEach(s=>{r[s]=i})};return g(()=>{const r=e(),o=[".",".",".",".",".",".",".",".","."].map(()=>"content");return r.forEach(i=>{n(o,Pq[i],i)}),['"'+o.slice(0,3).join(" ")+'"','"'+o.slice(3,6).join(" ")+'"','"'+o.slice(6,9).join(" ")+'"'].join(" ")})},Iq={top:{type:Object,default:()=>({order:2})},right:{type:Object,default:()=>({order:1})},left:{type:Object,default:()=>({order:1})},bottom:{type:Object,default:()=>({order:2})}},Hx="VaLayout",Dq=t=>{const e=W({top:null,right:null,bottom:null,left:null}),n=g(()=>{const{top:o,right:i,bottom:s,left:l}=e.value,{top:a,right:u,bottom:c,left:d}=t;return{top:o&&!a.absolute?o.sizes.height:0,right:i&&!u.absolute?i.sizes.width:0,bottom:s&&!c.absolute?s.sizes.height:0,left:l&&!d.absolute?l.sizes.width:0}}),r=g(()=>({top:t.top.order||0,right:t.right.order||0,bottom:t.bottom.order||0,left:t.left.order||0}));return Pr(Hx,{items:e,paddings:n,orders:r}),{paddings:n,orders:r,items:e}},Eq=(t,e)=>{const n=Mn(Hx,null);if(!n)throw new Error("VaLayoutChild must be used inside VaLayout");return tr(()=>{e.value?n.items.value[t]={sizes:e.value}:n.items.value[t]=null}),jt(()=>{n.items.value[t]=null}),{paddings:g(()=>Object.keys(n.paddings.value).reduce((r,o)=>(n.orders.value[o]>n.orders.value[t]&&(r[o]=n.paddings.value[o]),r),{}))}},Lq={},Vq={class:"va-layout__absolute-area-wrapper"};function Rq(t,e){return A(),I("div",Vq,[D(t.$slots,"default")])}const Fq=hs(Lq,[["render",Rq]]),Nq=ie({name:"VaLayoutSizeKeeper",__name:"VaResizeObserver",emits:{resize:t=>!0},setup(t,{emit:e}){const n=e,r=W();let o=null;return fe(r,i=>{o&&o.disconnect(),o=new ResizeObserver(([s])=>{n("resize",s.contentRect)}),o.observe(i)}),(i,s)=>(A(),I("div",{class:"va-resize-observer",ref_key:"el",ref:r},[D(i.$slots,"default")],512))}}),s0=ie({name:"VaLayoutFixedWrapper",__name:"VaLayoutFixedWrapper",props:{area:{type:String,required:!0}},setup(t){const e=t,n=W(null),r=g(()=>e.area==="top"||e.area==="bottom"?"vertical":"horizontal"),o=l=>l?l+"px":"0px",i=g(()=>r.value==="vertical"?{width:`calc(100% - ${o(s.value.left)} - ${o(s.value.right)})`,[e.area]:0}:{height:`calc(100% - ${o(s.value.top)} - ${o(s.value.bottom)})`,[e.area]:0}),{paddings:s}=Eq(e.area,n);return g(()=>Object.keys(s.value).reduce((l,a)=>a===e.area?l:{...l,[a]:`${s.value[a]}px`},{})),(l,a)=>(A(),I("div",{class:"va-layout-fixed-wrapper",style:se([[{height:n.value&&r.value==="vertical"?n.value.height+"px":"auto",width:n.value&&r.value==="horizontal"?n.value.width+"px":"auto"}],`--va-styles-width: ${String(i.value.width)};--va-styles-height: ${String(i.value.height)}`])},[he(Nq,{class:Ae(["va-layout-fixed-wrapper__content",`va-layout-fixed-wrapper__content--${t.area}`]),style:se(n.value?{}:{position:"relative"}),onResize:a[0]||(a[0]=u=>n.value=u)},{default:J(()=>[D(l.$slots,"default")]),_:3},8,["class","style"])],4))}}),Hq=ie({name:"VaLayoutArea",__name:"VaLayoutArea",props:{area:{type:String,required:!0},config:{type:Object,required:!0}},emits:["overlay-click"],setup(t,{emit:e}){const n=t,r=g(()=>n.config.absolute||!1),o=g(()=>n.config.fixed||!1),i=g(()=>n.config.overlay||!1),s=g(()=>(n.config.order||0)+1);return(l,a)=>(A(),I(_e,null,[r.value?(A(),te(Fq,{key:0,style:se(`--va-props-area: ${String(l.$props.area)};--va-z-index: ${String(s.value)};--va-z-index-1: ${String(s.value-1)}`)},{default:J(()=>[q("div",{class:Ae(`va-layout-area va-layout__area va-layout__area--${t.area}`)},[o.value?(A(),te(s0,{key:0,area:t.area},{default:J(()=>[D(l.$slots,"default")]),_:3},8,["area"])):D(l.$slots,"default",{key:1})],2)]),_:3},8,["style"])):(A(),I("div",{key:1,class:Ae(`va-layout-area va-layout__area va-layout__area--${t.area}`),style:se(`--va-props-area: ${String(l.$props.area)};--va-z-index: ${String(s.value)};--va-z-index-1: ${String(s.value-1)}`)},[o.value?(A(),te(s0,{key:0,area:t.area},{default:J(()=>[D(l.$slots,"default")]),_:3},8,["area"])):D(l.$slots,"default",{key:1})],6)),he(ul,{style:se(`--va-props-area: ${String(l.$props.area)};--va-z-index: ${String(s.value)};--va-z-index-1: ${String(s.value-1)}`)},{default:J(()=>[i.value?(A(),I("div",{key:0,class:Ae(["va-layout-area__overlay",{"va-layout-area__overlay--fixed":o.value}]),onClick:a[0]||(a[0]=u=>l.$emit("overlay-click"))},null,2)):z("",!0)]),_:1},8,["style"])],64))}}),zq={class:"va-layout__area va-layout__area--content"},l0=["top","left","right","bottom"],jq=ie({name:"VaLayout",__name:"VaLayout",props:{...Iq,allowBodyScrollOnOverlay:{type:Boolean,default:!1}},emits:["top-overlay-click","left-overlay-click","right-overlay-click","bottom-overlay-click"],setup(t,{emit:e}){const n=t,{paddings:r}=Dq(n),o=g(()=>!n.allowBodyScrollOnOverlay&&l0.some(c=>{var d;return(d=n[c])==null?void 0:d.overlay})),i=us();tr(()=>{var c;const d=(c=i.value)==null?void 0:c.body;d&&(o.value?d.style.overflow="hidden":d.style.overflow="")});const s=Mq(n),l=Ln(),a=g(()=>[l.top?"min-content":"0fr","1fr",l.bottom?"min-content":"0fr"].filter(Boolean).join(" ")),u=g(()=>[l.left?"min-content":"0fr","1fr",l.right?"min-content":"0fr"].filter(Boolean).join(" "));return(c,d)=>(A(),I("div",{class:"va-layout",style:se(`--va-horizontal-template: ${String(u.value)};--va-vertical-template: ${String(a.value)};--va-template-area: ${String(m(s))};--va-paddings-top-px: ${m(r).top+"px"};--va-paddings-bottom-px: ${m(r).bottom+"px"};--va-paddings-left-px: ${m(r).left+"px"};--va-paddings-right-px: ${m(r).right+"px"}`)},[(A(),I(_e,null,Ge(l0,f=>he(Hq,{key:f,area:f,config:c.$props[f]||{},onOverlayClick:h=>c.$emit(`${f}-overlay-click`)},{default:J(()=>[D(c.$slots,f)]),_:2},1032,["area","config","onOverlayClick"])),64)),q("div",zq,[D(c.$slots,"default",{},()=>[D(c.$slots,"content")])])],4))}}),Wq=bo(jq),Uq={class:"va-navbar__left"},Kq={class:"va-navbar__center"},Gq={class:"va-navbar__right"},qq=ie({name:"VaNavbar",__name:"VaNavbar",props:{...Rk,...Me,color:{type:String,default:"background-secondary"},textColor:{type:String},shape:{type:Boolean,default:!1},shadowed:{type:Boolean,default:!1},bordered:{type:Boolean,default:!1}},setup(t){const e=t,{scrollRoot:n,isScrolledDown:r}=Nk(e.fixed),{fixedBarStyleComputed:o}=Fk(e,r),{getColor:i,shiftHSLAColor:s}=He(),l=g(()=>i(e.color)),{textColorComputed:a}=qt(l),u=g(()=>({borderTopColor:s(l.value,{h:-1,s:-11,l:10})})),c=g(()=>({...o.value,backgroundColor:l.value,color:a.value,fill:a.value})),d=ct("va-navbar",()=>({shadowed:e.shadowed,bordered:e.bordered}));return(f,h)=>(A(),I("header",{ref_key:"scrollRoot",ref:n,class:Ae(["va-navbar",m(d)]),style:se(c.value)},[D(f.$slots,"default",{},()=>[q("div",Uq,[D(f.$slots,"left")]),q("div",Kq,[D(f.$slots,"center")]),q("div",Gq,[D(f.$slots,"right")])]),t.shape?(A(),I("div",{key:0,class:"va-navbar__background-shape",style:se(u.value)},null,4)):z("",!0)],6))}}),Yq=ie({name:"VaNavbarItem",props:{}}),Xq={class:"va-navbar__item"};function Jq(t,e,n,r,o,i){return A(),I("div",Xq,[D(t.$slots,"default")])}const Qq=hs(Yq,[["render",Jq]]),Zq=me(qq),e7=me(Qq),t7=["role"],n7=["value","checked","aria-checked","onChange"],r7=q("span",{"aria-hidden":"true",class:"va-radio__icon"},[q("span",{class:"va-radio__icon__background"}),q("span",{class:"va-radio__icon__dot"})],-1),o7=ie({name:"VaRadio",__name:"VaRadio",props:{...fg,...Me,...Cl,modelValue:{type:[Boolean,Array,String,Object,Number],default:null},options:{type:Array,default:()=>[]},name:{type:String,default:""},label:{type:String,default:void 0},leftLabel:{type:Boolean,default:!1},color:{type:String,default:"primary"},option:{type:[Object,String,Number],default:void 0},vertical:{type:Boolean,default:!1}},emits:ef,setup(t,{emit:e}){const n=t,r=e,{getColor:o}=He(),i={container:Ne(),input:Ne(),label:Ne()},{computedError:s,computedErrorMessages:l,validationAriaAttributes:a,onBlur:u,onFocus:c}=hg(n,r,i),{getText:d,getDisabled:f,getValue:h}=wl(n),p=E=>n.options.length>0?d(E):n.label??d(E),v=E=>f(E)||n.disabled,y=g(()=>n.options.length===0&&!n.option),b=E=>y.value?n.modelValue:n.modelValue===h(E),S=g(()=>y.value?[{}]:n.option?[n.option]:n.options),w=E=>({"va-radio--left-label":n.leftLabel,"va-radio--selected":b(E),"va-radio--readonly":n.readonly,"va-radio--disabled":n.disabled,"va-radio--indeterminate":n.indeterminate,"va-radio--error":s.value,"va-radio--single-option":y.value}),x=(E,P)=>{var V;if(y.value){r("update:modelValue",((V=P==null?void 0:P.target)==null?void 0:V.checked)||!1);return}r("update:modelValue",E)},k=g(()=>({color:s.value?o("danger"):""}));g(()=>{const E={background:o(n.color),borderColor:o(n.color)};return s.value&&(E.borderColor=o("danger")),E});const $=g(()=>({backgroundColor:o(n.color)})),C=g(()=>({borderColor:s.value?o("danger"):o(n.color),backgroundColor:o(n.color)})),T=g(()=>({borderColor:s.value?o("danger"):o(n.color)})),_=Qr(),M=g(()=>n.name||_),F=E=>{const P=v(E);return{name:M.value,disabled:P,readonly:n.readonly,tabindex:P?-1:0}},L=g(()=>n.vertical?"column":"row"),H=g(()=>{var E;return((E=n.options)==null?void 0:E.length)>0?"radiogroup":""});return(E,P)=>(A(),te(m(Kd),{disabled:E.disabled,success:E.success,messages:E.messages,error:m(s),"error-messages":m(l),"error-count":E.errorCount,onBlur:m(u),style:se(`--va-flex-direction: ${String(L.value)};--va-label-style-color: ${String(k.value.color)};--va-icon-computed-styles-border-color: ${String(T.value.borderColor)};--va-icon-dot-computed-styles-border-color: ${String(C.value.borderColor)};--va-icon-dot-computed-styles-background-color: ${String(C.value.backgroundColor)};--va-icon-background-computed-styles-background-color: ${String($.value.backgroundColor)}`)},{default:J(({ariaAttributes:V})=>[q("div",ee({ref:"container",class:"va-radio",role:H.value},V),[(A(!0),I(_e,null,Ge(S.value,(O,N)=>(A(),I("label",{key:N,class:Ae([w(O),"va-radio__square"])},[q("input",ee({ref_for:!0,ref:"input",class:"va-radio__input",type:"radio",role:"radio",value:b(O),checked:b(O),"aria-checked":b(O)},{...F(O),...V},{onChange:re=>x(m(h)(O),re),onFocus:P[0]||(P[0]=(...re)=>m(c)&&m(c)(...re)),onBlur:P[1]||(P[1]=(...re)=>m(u)&&m(u)(...re))}),null,16,n7),D(E.$slots,"icon",de(we({value:b(O),text:p(O),disabled:v(O),index:N})),()=>[r7]),p(O)||E.$slots.default?(A(),I("div",{key:0,ref_for:!0,ref:"label",class:"va-radio__text"},[D(E.$slots,"default",de(we({value:b(O),text:p(O),disabled:v(O),index:N})),()=>[Ue(Be(p(O)),1)])],512)):z("",!0)],2))),128))],16,t7)]),_:3},8,["disabled","success","messages","error","error-messages","error-count","onBlur","style"]))}}),zx=me(o7),i7={class:"va-switch__inner"},s7={class:"va-switch__checker-wrapper"},l7={class:"va-switch__checker"},a7={class:"va-switch__checker-circle"},u7=["id"],c7=ie({name:"VaSwitch",__name:"VaSwitch",props:{...fg,...Me,id:{type:String,default:""},name:{type:String,default:""},modelValue:{type:[Number,Boolean,Array,String,Object],default:!1},trueLabel:{type:String,default:null},falseLabel:{type:String,default:null},trueInnerLabel:{type:String,default:null},falseInnerLabel:{type:String,default:null},ariaLabel:{type:String,default:"$t:switch"},color:{type:String,default:"primary"},offColor:{type:String,default:"background-element"},size:{type:String,default:"medium",validator:t=>["medium","small","large"].includes(t)}},emits:[...ef,"focus","blur","update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,o=n,i={container:Ne(),input:Ne(),label:Ne()},{getColor:s}=He(),{hasKeyboardFocus:l,keyboardFocusListeners:a}=kl(),{isChecked:u,computedError:c,isIndeterminate:d,computedErrorMessages:f,validationAriaAttributes:h,toggleSelection:p,onBlur:v,onFocus:y,reset:b,focus:S,isDirty:w,isTouched:x,isLoading:k,isError:$}=hg(r,o,i),C=g(()=>s(u.value?r.color:r.offColor)),{textColorComputed:T}=qt(C),_=g(()=>r.trueInnerLabel&&u.value?r.trueInnerLabel:r.falseInnerLabel&&!u.value?r.falseInnerLabel:""),M=g(()=>r.trueLabel&&u.value?r.trueLabel:r.falseLabel&&!u.value?r.falseLabel:r.label),F=ct("va-switch",()=>({...Bt(r,["readonly","disabled","leftLabel"]),checked:u.value,indeterminate:d.value,small:r.size==="small",large:r.size==="large",error:c.value,keyboardFocus:l.value})),L=g(()=>({lineHeight:f.value.length?1:0})),H=g(()=>({small:"15px",medium:"20px",large:"25px"})[r.size]),E=g(()=>({borderColor:c.value?s("danger"):"",backgroundColor:C.value})),P=g(()=>({color:c.value?s("danger"):""})),V=g(()=>({color:T.value,"text-align":u.value?"left":"right"})),O=Ln(),N=Qr(),re=g(()=>`aria-label-id-${N}`),X=g(()=>({id:r.id||void 0,name:r.name||void 0,disabled:r.disabled,readonly:r.readonly,"aria-disabled":r.disabled,"aria-readonly":r.readonly,"aria-checked":!!r.modelValue,"aria-label":O.default?void 0:r.ariaLabel,"aria-labelledby":M.value||O.default?re.value:void 0,tabindex:r.disabled?-1:0,checked:u.value,...h.value})),ke=()=>{var ye;(ye=i.input.value)==null||ye.click()},$e=i.input;return e({focus:S,reset:b,isDirty:w,isTouched:x,isLoading:k,isError:$}),(ye,j)=>(A(),te(m(Kd),{class:Ae(["va-switch",m(F)]),style:se(L.value),disabled:ye.$props.disabled,success:ye.$props.success,messages:ye.$props.messages,error:m(c),"error-messages":m(f),"error-count":ye.$props.errorCount},{default:J(()=>[q("div",{ref:"container",class:"va-switch__container",tabindex:"-1",onBlur:j[5]||(j[5]=(...ce)=>m(v)&&m(v)(...ce)),onClick:j[6]||(j[6]=(...ce)=>m(p)&&m(p)(...ce))},[q("div",i7,[q("input",ee({ref_key:"input",ref:$e,type:"checkbox",class:"va-switch__input",role:"switch"},X.value,ur(m(a),!0),{onFocus:j[0]||(j[0]=(...ce)=>m(y)&&m(y)(...ce)),onBlur:j[1]||(j[1]=(...ce)=>m(v)&&m(v)(...ce)),onKeypress:Ce(ke,["enter"])}),null,16),q("div",{class:"va-switch__track","aria-hidden":"true",style:se(E.value)},[_.value||ye.$slots.innerLabel?(A(),I("div",{key:0,class:"va-switch__track-label",style:se(V.value)},[D(ye.$slots,"innerLabel",{},()=>[Ue(Be(_.value),1)])],4)):z("",!0),q("div",s7,[q("div",l7,[D(ye.$slots,"checker",de(we({value:m(u)})),()=>[q("div",a7,[ye.$props.loading?(A(),te(m(bl),{key:0,indeterminate:"",size:H.value,color:E.value.backgroundColor},null,8,["size","color"])):z("",!0)])])])])],4)]),M.value||ye.$slots.default?(A(),I("div",{key:0,ref:"label",class:"va-switch__label",style:se(P.value),id:re.value,onBlur:j[2]||(j[2]=(...ce)=>m(v)&&m(v)(...ce)),onClick:j[3]||(j[3]=(...ce)=>m(p)&&m(p)(...ce)),onKeydown:j[4]||(j[4]=Ce(be((...ce)=>m(p)&&m(p)(...ce),["stop"]),["enter"]))},[D(ye.$slots,"default",{},()=>[Ue(Be(M.value),1)])],44,u7)):z("",!0)],544)]),_:3},8,["class","style","disabled","success","messages","error","error-messages","error-count"]))}}),jx=me(c7),af=()=>{const t=Ne([]),e=r=>{r&&t.value.push(r)},n=r=>o=>{o&&(t.value[r]=o)};return km(()=>{t.value=[]}),{itemRefs:t,setItemRef:e,setItemRefByIndex:n}},d7={class:"va-option-list__list"},f7=ie({name:"VaOptionList",__name:"VaOptionList",props:{...Me,...Cl,...Co,...Kt,type:{type:String,default:"checkbox",validator:t=>["radio","checkbox","switch"].includes(t)},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},defaultValue:{type:[String,Number,Boolean,Object,Array]},name:{type:String,default:""},color:{type:String,default:"primary"},leftLabel:{type:Boolean,default:!1},modelValue:{type:[String,Number,Boolean,Object,Array]}},emits:[...un,...mi,"clear"],setup(t,{expose:e,emit:n}){const r=t,o=n,{valueComputed:i}=xt(r,o,"modelValue",{defaultValue:r.defaultValue}),{getValue:s,getText:l,getTrackBy:a,getDisabled:u}=wl(r),{itemRefs:c,setItemRef:d}=af(),f=g(()=>r.type==="radio"),h=g({get(){const $=f.value?null:[];return i.value||$},set($){r.readonly||(f.value&&!Array.isArray($)?i.value=$&&s($):i.value=Array.isArray($)?$.map(s):[$&&s($)])}}),p=$=>r.disabled||u($),v=()=>w(()=>{i.value=null,o("clear"),x()}),y=()=>{const $=Array.isArray(c.value)&&c.value.find(C=>!C.disabled);$&&typeof $.focus=="function"&&$.focus()},{computedError:b,computedErrorMessages:S,withoutValidation:w,resetValidation:x}=wo(r,o,{reset:v,focus:y,value:i}),k=g(()=>Bt(r,["name","color","readonly","leftLabel"]));return dt(()=>{vl&&r.type!=="radio"&&!Array.isArray(r.modelValue)&&console.warn(`Prop 'modelValue = ${r.modelValue}' has not a proper type!
+ For component property 'type = ${r.type}' it must be of type 'array'.`)}),e({focus:y,reset:v}),($,C)=>(A(),te(m(Kd),{error:m(b),"error-messages":m(S),"error-count":$.$props.errorCount},{default:J(()=>[q("ul",d7,[(A(!0),I(_e,null,Ge($.$props.options,T=>(A(),I("li",{key:m(a)(T)},[D($.$slots,"default",de(we({option:T,selectedValue:h.value,isDisabled:p,getText:m(l),getValue:m(s)})),()=>[$.$props.type==="radio"?(A(),te(m(zx),ee({key:0,ref_for:!0,ref:m(d),modelValue:h.value,"onUpdate:modelValue":C[0]||(C[0]=_=>h.value=_),label:m(l)(T),disabled:p(T),option:m(s)(T)},k.value),null,16,["modelValue","label","disabled","option"])):$.$props.type==="checkbox"?(A(),te(m(nu),ee({key:1,ref_for:!0,ref:m(d),modelValue:h.value,"onUpdate:modelValue":C[1]||(C[1]=_=>h.value=_),label:m(l)(T),disabled:p(T),"array-value":m(s)(T)},k.value),null,16,["modelValue","label","disabled","array-value"])):(A(),te(m(jx),ee({key:2,ref_for:!0,ref:m(d),modelValue:h.value,"onUpdate:modelValue":C[2]||(C[2]=_=>h.value=_),label:m(l)(T),disabled:p(T),"array-value":m(s)(T)},k.value),null,16,["modelValue","label","disabled","array-value"]))])]))),128))])]),_:3},8,["error","error-messages","error-count"]))}}),h7=me(f7),p7=(t=1,e,n,r=!1)=>{let o=0;if(n===0&&(n=1),e>n&&(e=n),e===0)o=1,e=n>10?10:n;else{const s=e/2;t-s<=0||t>n?o=1:o=t+s>n?n-e+1:Math.ceil(t-s)}const i=[];for(let s=0;s=7&&pt("[va-pagination] To work in a proper way, the `boundaryNumbers` prop needs at least 7 visible pages to be set via the `visiblePages` prop (first, last, 2 boundaries, current, previous, next)."):r&&(o!==1&&i.splice(0,2,1,"..."),i[i.length-1]!==n&&i.splice(-2,2,"...",n)),i},m7=["aria-label","onKeydown"],g7=["aria-label"],v7=ie({name:"VaPagination",__name:"VaPagination",props:{...Kt,...Me,modelValue:{type:Number,default:1},visiblePages:{type:[Number,String],default:0},pages:{type:[Number,String],default:0},disabled:{type:Boolean,default:!1},color:{type:String,default:"primary"},size:{type:String,default:"medium",validator:t=>["small","medium","large"].includes(t)},boundaryLinks:{type:Boolean,default:!0},boundaryNumbers:{type:Boolean,default:!1},directionLinks:{type:Boolean,default:!0},input:{type:Boolean,default:!1},hideOnSinglePage:{type:Boolean,default:!1},total:{type:[Number,String],default:null},pageSize:{type:[Number,String],default:null},boundaryIconLeft:{type:String,default:"va-arrow-first"},boundaryIconRight:{type:String,default:"va-arrow-last"},directionIconLeft:{type:String,default:"va-arrow-left"},directionIconRight:{type:String,default:"va-arrow-right"},gapped:{type:Boolean,default:!1},borderColor:{type:String,default:""},rounded:{type:Boolean,default:!1},activePageColor:{type:String,default:""},activeButtonProps:{type:Object,default:()=>({})},buttonProps:{type:Object,default:()=>({})},buttonsPreset:{type:String,default:"primary"},ariaLabel:{type:String,default:"$t:pagination"},ariaGoToTheFirstPageLabel:{type:String,default:"$t:goToTheFirstPage"},ariaGoToPreviousPageLabel:{type:String,default:"$t:goToPreviousPage"},ariaGoToSpecificPageLabel:{type:String,default:"$t:goToSpecificPage"},ariaGoToSpecificPageInputLabel:{type:String,default:"$t:goToSpecificPageInput"},ariaGoToNextPageLabel:{type:String,default:"$t:goNextPage"},ariaGoToLastPageLabel:{type:String,default:"$t:goLastPage"}},emits:[...un],setup(t,{expose:e,emit:n}){const r=t,o=n,i=Ne(),s=W(""),l=g(()=>!!((f.value||f.value===0)&&h.value)),{valueComputed:a}=xt(r,o),u=g({get:()=>l.value?Math.ceil(a.value/h.value)||1:a.value,set:j=>{a.value=j}}),c=Ye("visiblePages"),d=Ye("pages"),f=Ye("total"),h=Ye("pageSize"),p=g(()=>{const{boundaryNumbers:j}=r,ce=u.value||1,Se=l.value?Math.ceil(f.value/h.value):d.value;return p7(ce,c.value,Se,j)}),v=g(()=>l.value?Math.ceil(f.value/h.value)||1:+d.value),y=g(()=>!!c.value&&v.value>c.value||r.input),b=g(()=>{const{boundaryLinks:j,boundaryNumbers:ce}=r;return y.value&&j&&!ce}),S=g(()=>y.value&&r.directionLinks),w=g(()=>v.value>1||!r.hideOnSinglePage&&v.value<=1),x=()=>{s.value=String(u.value),Ot(()=>{var j;return(j=i.value)==null?void 0:j.setSelectionRange(0,i.value.value.length)})},{setItemRefByIndex:k,itemRefs:$}=af(),C=j=>{var ce;if(j==="..."||j===u.value)return;const Se=Ki(j,1,v.value);u.value=l.value?(Se-1)*h.value+1:Se,(ce=$.value[j-1])==null||ce.focus()},T=()=>{var j;s.value="",(j=i.value)==null||j.blur()},_=()=>{if(+s.value===u.value&&T(),!s.value.length)return;let j=Number.parseInt(s.value);switch(!0){case j<1:j=1;break;case j>v.value:j=v.value;break;case isNaN(j):j=u.value;break}C(j),T()},{getColor:M,colorToRgba:F}=He(),L=g(()=>{const{color:j,buttonsPreset:ce}=Or(r);if(!j.value)return"transparent";switch(ce.value){case"default":return M(j.value);case void 0:case"primary":return F(M(j.value),.1);default:return"transparent"}}),H=g(()=>({cursor:"default",color:M(r.color),opacity:r.disabled?.4:1,borderColor:L.value}));fe([l,()=>d.value],()=>{if(vl&&l.value&&d.value)throw new Error("Please, use either `total` and `page-size` props, or `pages`.")});const E=g(()=>({disabled:r.disabled,placeholder:`${u.value}/${v.value}`})),P=g(()=>({size:r.size,preset:r.buttonsPreset,color:r.color,borderColor:r.borderColor,round:r.rounded,...r.buttonProps})),V=g(()=>({preset:r.buttonsPreset==="default"?"primary":"default",color:r.activePageColor||r.color,...r.activeButtonProps})),O=j=>!isNaN(+j)&&j===u.value?Object.assign({},P.value,V.value):P.value,N=g(()=>r.input&&!r.boundaryLinks&&!r.directionLinks),re=ct("va-pagination__input",()=>({sm:r.size==="small"&&N.value,md:r.size==="medium"&&N.value,lg:r.size==="large"&&N.value,auto:!N.value})),X=ct("va-pagination",()=>({...Bt(r,["gapped","rounded","disabled"]),bordered:!!r.borderColor})),ke=()=>C(u.value+1),$e=()=>C(u.value-1),{tp:ye}=yt();return e({goNextPage:ke,goPrevPage:$e}),(j,ce)=>w.value?(A(),I("nav",{key:0,class:Ae(["va-pagination",m(X)]),"aria-label":m(ye)(j.$props.ariaLabel),onKeydown:[Ce(be($e,["stop"]),["left"]),Ce(be(ke,["stop"]),["right"]),Ce(be($e,["stop"]),["up"]),Ce(be(ke,["stop"]),["down"])]},[b.value?D(j.$slots,"firstPageLink",de(ee({key:0},{onClick:()=>C(1),disabled:j.$props.disabled||u.value===1})),()=>[b.value?(A(),te(m(et),ee({key:0,"aria-label":m(ye)(j.$props.ariaGoToTheFirstPageLabel),disabled:j.$props.disabled||u.value===1,icon:j.$props.boundaryIconLeft},P.value,{onClick:ce[0]||(ce[0]=Se=>C(1))}),null,16,["aria-label","disabled","icon"])):z("",!0)]):z("",!0),S.value?D(j.$slots,"prevPageLink",de(ee({key:1},{onClick:$e,disabled:j.$props.disabled||u.value===1})),()=>[S.value?(A(),te(m(et),ee({key:0,"aria-label":m(ye)(j.$props.ariaGoToPreviousPageLabel),disabled:j.$props.disabled||u.value===1,icon:j.$props.directionIconLeft},P.value,{onClick:$e}),null,16,["aria-label","disabled","icon"])):z("",!0)]):z("",!0),j.$props.input?xr((A(),I("input",ee({key:3,"onUpdate:modelValue":ce[1]||(ce[1]=Se=>s.value=Se),ref_key:"htmlInput",ref:i,class:["va-pagination__input va-button",m(re)],"aria-label":m(ye)(j.$props.ariaGoToSpecificPageInputLabel),style:H.value},E.value,{onKeydown:Ce(_,["enter"]),onFocus:x,onBlur:_}),null,16,g7)),[[_m,s.value]]):D(j.$slots,"default",{key:2},()=>[(A(!0),I(_e,null,Ge(p.value,(Se,ne)=>(A(),te(m(et),ee({key:ne,ref_for:!0,ref:m(k)(ne),class:{"va-button--ellipsis":Se==="...","va-button--current":Se===u.value},"aria-label":m(ye)(j.$props.ariaGoToSpecificPageLabel,{page:Se}),"aria-current":Se===u.value,disabled:j.$props.disabled||Se==="..."},O(Se),{onClick:Z=>C(Se)}),{default:J(()=>[Ue(Be(Se),1)]),_:2},1040,["class","aria-label","aria-current","disabled","onClick"]))),128))]),S.value?D(j.$slots,"nextPageLink",de(ee({key:4},{onClick:ke,disabled:j.$props.disabled||u.value===v.value})),()=>[S.value?(A(),te(m(et),ee({key:0,"aria-label":m(ye)(j.$props.ariaGoToNextPageLabel),disabled:j.$props.disabled||u.value===v.value,icon:j.$props.directionIconRight},P.value,{onClick:ke}),null,16,["aria-label","disabled","icon"])):z("",!0)]):z("",!0),b.value?D(j.$slots,"lastPageLink",de(ee({key:5},{onClick:()=>C(v.value),disabled:j.$props.disabled||u.value===v.value})),()=>[b.value?(A(),te(m(et),ee({key:0,"aria-label":m(ye)(j.$props.ariaGoToLastPageLabel),disabled:j.$props.disabled||u.value===v.value,icon:j.$props.boundaryIconRight},P.value,{onClick:ce[2]||(ce[2]=Se=>C(v.value))}),null,16,["aria-label","disabled","icon"])):z("",!0)]):z("",!0)],42,m7)):z("",!0)}}),y7=me(v7),b7=()=>{const t=qd(),e=new Proxy(t.value||{},{get:(r,o,i)=>{var s,l;if(o==="scrollTop")return(s=t.value)==null?void 0:s.scrollY;if(o==="scrollLeft")return(l=t.value)==null?void 0:l.scrollX;const a=Reflect.get(r,o,i);return typeof a=="function"?a.bind(r):a}}),n=r=>r?r.scrollHeight>r.clientHeight?r:n(r.parentElement):e;return{getScrollableParent:n}},S7={class:"va-parallax__image-container"},C7=["src","alt"],w7={class:"va-parallax__item-container"},k7=ie({name:"VaParallax",__name:"VaParallax",props:{...Me,target:{type:[Object,String]},src:{type:String,default:"",required:!0},alt:{type:String,default:"parallax"},height:{type:[Number,String],default:400},reversed:{type:Boolean,default:!1},speed:{type:[Number,String],default:.5,validator:t=>{const e=Number(t);return e>=0&&e<=1}}},setup(t){const e=t,n=Ne(),r=Ne(),o=W(0),i=W(0),s=W(0),l=W(0),a=W(0),u=W(0),c=W(0),d=W(!1),f=g(()=>({height:b.value+"px"})),h=g(()=>({display:"block",transform:`translate(-50%, ${i.value}px)`,opacity:d.value?1:0,top:e.reversed?0:"auto"})),{getScrollableParent:p}=b7(),v=g(()=>{var T;if(!e.target)return p((T=n.value)==null?void 0:T.parentElement);if(e.target instanceof HTMLElement)return e.target;const _=document.querySelector(e.target);return _||(pt("VaParallax target prop got wrong selector. Target is null"),null)}),y=g(()=>{var T;return((T=r.value)==null?void 0:T.naturalHeight)||0}),b=Ye("height"),S=Ye("speed"),w=()=>{var T,_;const M=((T=n.value)==null?void 0:T.getBoundingClientRect())||{top:0};a.value=((_=v.value)==null?void 0:_.scrollTop)||0,s.value=y.value-b.value,o.value=M.top+a.value,u.value=window.innerHeight,c.value=a.value+u.value},x=()=>{w(),l.value=(c.value-o.value)/(b.value+u.value),i.value=Math.round(s.value*l.value)*S.value,e.reversed&&(i.value=-i.value)},k=()=>{var T,_;(T=v.value)==null||T.addEventListener("scroll",x),(_=v.value)==null||_.addEventListener("resize",x)},$=()=>{var T,_;(T=v.value)==null||T.removeEventListener("scroll",x),(_=v.value)==null||_.removeEventListener("resize",x)};return dt(()=>{var T,_;(T=r.value)!=null&&T.complete?(x(),k()):(_=r.value)==null||_.addEventListener("load",()=>{x(),k()},!1),d.value=!0}),jt($),(T,_)=>(A(),I("div",{ref_key:"rootElement",ref:n,class:"va-parallax",style:se(f.value)},[q("div",S7,[q("img",{ref_key:"img",ref:r,class:"va-parallax__image",src:T.$props.src,alt:T.$props.alt,style:se(h.value)},null,12,C7)]),q("div",w7,[D(T.$slots,"default")])],4))}}),x7=me(k7),$7={key:0,"aria-hidden":"true",class:"va-popover__icon"},A7={key:1},T7={key:0,class:"va-popover__title"},_7={key:1,class:"va-popover__body"},Qf=nt(er,["closeOnClickOutside"]),O7=ie({name:"VaPopover",__name:"VaPopover",props:{...Qf,...Me,trigger:{...Qf.trigger,default:["hover","enter","space","arrow-down","arrow-up"]},color:{type:String,default:"#1b1a1f"},textColor:{type:String},icon:{type:String,default:""},title:{type:String,default:""},message:{type:String,default:""},autoHide:{type:Boolean,default:!0},offset:{type:[Array,Number],default:4},contentClass:{type:String,default:""}},setup(t){const e=t,n=gt(Qf),{getColor:r,getBoxShadowColor:o}=He(),i=Ln(),{textColorComputed:s}=qt(g(()=>r(e.color))),l=g(()=>e.icon||i.icon),a=g(()=>e.title||i.title),u=g(()=>e.message||i.body),c=g(()=>a.value||u.value),d=g(()=>({boxShadow:`var(--va-popover-content-box-shadow) ${o(r(e.color))}`,backgroundColor:r(e.color),color:s.value}));return(f,h)=>(A(),te(m(er),ee(m(n),{"model-value":f.modelValue,"close-on-click-outside":t.autoHide,offset:f.$props.offset,"content-class":f.$props.contentClass,class:"va-popover"}),{default:J(()=>[q("div",{style:se(d.value),class:"va-popover__content",role:"tooltip"},[l.value?(A(),I("div",$7,[D(f.$slots,"icon",{},()=>[he(m(Ze),{name:f.$props.icon,color:m(s)},null,8,["name","color"])])])):z("",!0),c.value?(A(),I("div",A7,[a.value?(A(),I("div",T7,[D(f.$slots,"title",{},()=>[Ue(Be(f.$props.title),1)])])):z("",!0),u.value?(A(),I("div",_7,[D(f.$slots,"body",{},()=>[Ue(Be(f.$props.message),1)])])):z("",!0)])):z("",!0)],4)]),anchor:J(()=>[D(f.$slots,"default")]),_:3},16,["model-value","close-on-click-outside","offset","content-class"]))}}),P7=me(O7);var tn=(t=>(t[t.EMPTY=0]="EMPTY",t[t.HALF=.5]="HALF",t[t.FULL=1]="FULL",t))(tn||{});const B7=()=>{const t=_t();if(!t)throw new Error("useRating hooks must be used on top of setup function");return{props:t.props,emit:t.emit}},M7={...Kt,modelValue:{type:Number,default:0},clearable:{type:Boolean,default:!1},hover:{type:Boolean,default:!1}},I7=t=>{const{emit:e}=B7(),{isHovered:n,onMouseEnter:r,onMouseLeave:o}=Ja(),{valueComputed:i}=xt(t,e),s=W(0),l=g(()=>!t.disabled&&!t.readonly&&t.hover&&n.value?s.value:i.value);return{visibleValue:l,modelValue:i,hoveredValue:s,isHovered:n,onMouseEnter:r,onMouseLeave:o,onItemValueUpdate:(d,f)=>{const h=d+f;if(t.clearable&&i.value===h){i.value=0;return}i.value=h},onItemHoveredValueUpdate:(d,f)=>{t.hover&&(s.value=d+f)},getItemValue:d=>{const f=l.value-d;return Ki(f,tn.EMPTY,tn.FULL)}}},Wx={unselectedColor:{type:String},color:{type:String,default:"primary"},modelValue:{type:Number}},Ux=t=>{const{getColor:e,getFocusColor:n,getTextColor:r}=He(),o=g(()=>e(t.color)),i=g(()=>t.unselectedColor?e(t.unselectedColor):n(e(t.color))),s=g(()=>t.modelValue===tn.HALF?`linear-gradient(90deg, ${o.value} 50%, ${i.value} 50%`:t.modelValue===tn.EMPTY?i.value:o.value),l=g(()=>t.modelValue===tn.FULL?e(r(o.value)):e(r(i.value)));return{computedColor:o,backgroundComputed:s,textColorComputed:l}},D7=["tabindex","onKeydown"],Kx=ie({name:"VaRatingItem",__name:"VaRatingItem",props:{modelValue:{type:Number,default:0},icon:{type:String,default:"star"},halfIcon:{type:String,default:"star_half"},emptyIcon:{type:String,default:"star_outline"},halves:{type:Boolean,default:!1},hover:{type:Boolean,default:!1},tabindex:{type:[String,Number],default:0},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},size:{type:[String,Number],default:"medium"},unselectedColor:{type:String},color:{type:String,default:"primary"}},emits:["update:modelValue","click","hover"],setup(t,{emit:e}){const n=t,r=e,o=Ne(),[i]=qi("modelValue",n,r,tn.EMPTY),s=W(null),l=g(()=>n.hover&&!n.disabled&&!n.readonly&&s.value||i.value),{getColor:a}=He(),u=g(()=>a(n.unselectedColor&&l.value===tn.EMPTY?n.unselectedColor:n.color)),c=v=>{if(!o.value)return;const{offsetX:y}=v,b=o.value.clientWidth;n.halves?s.value=y/b<=tn.HALF?tn.HALF:tn.FULL:s.value=tn.FULL},d=()=>{s.value=null},f=()=>{i.value=s.value||tn.FULL,r("click",s.value||tn.FULL)};fe(s,()=>r("hover",s.value||tn.EMPTY));const h=g(()=>n.halves&&l.value===tn.HALF?n.halfIcon:l.value===tn.EMPTY?n.emptyIcon:n.icon),p=g(()=>n.disabled?-1:n.tabindex);return(v,y)=>(A(),I("div",{ref_key:"rootEl",ref:o,role:"button",class:"va-rating-item",tabindex:p.value,onKeydown:[Ce(f,["enter"]),Ce(be(f,["prevent"]),["space"])],onMousemove:c,onMouseleave:d,onClick:f},[D(v.$slots,"default",de(we({value:l.value,onClick:f})),()=>[he(m(Ze),{class:"va-rating-item__wrapper",tabindex:"-1",tag:"button",name:h.value,size:v.$props.size,color:u.value},null,8,["name","size","color"])])],40,D7))}}),Gx=ie({name:"VaRatingItemNumberButton",__name:"VaRatingItemNumberButton",props:{...Wx,...ss,itemNumber:{type:Number,required:!0},modelValue:{type:Number,required:!0}},setup(t){const e=t,{textColorComputed:n,backgroundComputed:r}=Ux(e),{sizeComputed:o,fontSizeComputed:i,fontSizeInRem:s}=ls(e,"VaRating");return(l,a)=>(A(),I("button",{class:"va-rating__number-item",tabindex:"-1","aria-hidden":"true",style:se({background:m(r),color:m(n),width:m(o),height:m(o),fontSize:m(i),borderRadius:`${parseInt(m(i))*.125}rem`})},Be(t.itemNumber),5))}}),E7=["aria-label"],a0=nt(Kx,["modelValue","itemNumber"]),u0=nt(Gx,["modelValue","itemNumber"]),L7=ie({name:"VaRating",__name:"VaRating",props:{...u0,...M7,...Wx,...vi,...a0,...Me,modelValue:{type:Number,default:0},numbers:{type:Boolean,default:!1},halves:{type:Boolean,default:!1},max:{type:[Number,String],default:5},texts:{type:Array,default:()=>[]},ariaLabel:{type:String,default:"$t:currentRating"},ariaItemLabel:{type:String,default:"$t:voteRating"}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,{computedClasses:r}=mx("va-rating",n),{visibleValue:o,modelValue:i,hoveredValue:s,isHovered:l,onMouseEnter:a,onMouseLeave:u,onItemValueUpdate:c,onItemHoveredValueUpdate:d,getItemValue:f}=I7(n),h=g(()=>!n.disabled&&!n.readonly),p=C=>{const T=Number(n.max),_=n.halves?tn.HALF:tn.FULL,M=o.value+_*C,F=n.clearable?0:_;M>=F&&M<=T?c(o.value,_*C):Mh.value?0:void 0),k=gt(a0),$=gt(u0);return(C,T)=>(A(),I("div",{class:Ae(["va-rating",m(r)]),"aria-label":m(v)(C.$props.ariaLabel,{max:C.$props.max,value:C.$props.modelValue})},[q("div",{class:"va-rating__item-wrapper",onKeyup:[T[0]||(T[0]=Ce(_=>p(-1),["left"])),T[1]||(T[1]=Ce(_=>p(1),["right"]))],onMouseenter:T[2]||(T[2]=(..._)=>m(a)&&m(a)(..._)),onMouseleave:T[3]||(T[3]=(..._)=>m(u)&&m(u)(..._))},[(A(!0),I(_e,null,Ge(Number(C.$props.max),_=>(A(),te(Kx,ee({key:_,class:"va-rating__item"},m(k),{"aria-label":m(v)(C.$props.ariaItemLabel,{max:C.$props.max,value:_}),"model-value":m(f)(_-1),tabindex:x.value,disabled:C.$props.disabled,readonly:C.$props.readonly,onHover:M=>h.value&&m(d)(_-1,M),"onUpdate:modelValue":M=>h.value&&m(c)(_-1,M)}),{default:J(({value:M,onClick:F})=>[D(C.$slots,"item",de(we({value:M,onClick:F,index:_})),()=>[C.$props.numbers?(A(),te(Gx,ee({key:0},m($),{"model-value":M,"item-number":_}),null,16,["model-value","item-number"])):z("",!0)])]),_:2},1040,["aria-label","model-value","tabindex","disabled","readonly","onHover","onUpdate:modelValue"]))),128))],32),C.$props.texts&&C.$props.texts.length===C.$props.max?(A(),I("span",{key:0,class:"va-rating__text-wrapper",style:se({color:m(b)})},Be(C.$props.texts[Math.round(m(o))-1]),5)):z("",!0)],10,E7))}}),V7=me(L7),R7=t=>t.offsetTop,F7=t=>t.offsetTop+t.offsetHeight,N7=t=>t.offsetTop+t.offsetHeight/2,H7=(t,e,n)=>{const r=e.offsetHeight,o=e.scrollTop,i=R7(t)-e.offsetTop,s=N7(t)-e.offsetTop,l=F7(t)-e.offsetTop;if(n==="start")return i;if(n==="end")return l-r;if(n==="center")return s-r/2;if(n==="any"){if(i-o<0)return i;if(l-o>r)return l-r}},z7=(t,e={scrollTarget:t.parentElement,verticalAlignment:"any",smooth:!1})=>{const n=e.scrollTarget||t.parentElement,r=H7(t,n,e.verticalAlignment);r!==void 0&&n.scroll({top:r,behavior:e.smooth?"smooth":"auto"})},j7=["aria-selected"],W7={key:1,class:"va-select-option__highlighted"},U7=ie({name:"VaSelectOption",__name:"VaSelectOption",props:{...Xm,disabled:{type:Boolean,default:!1},option:{type:[Number,String,Boolean,Object],default:()=>({})},getText:{type:Function,required:!0},getTrackBy:{type:Function,required:!0},currentOption:{type:[String,Number,Boolean,Object],default:null},getSelectedState:{type:Function,required:!0},search:{type:String,default:""},highlightMatchedText:{type:Boolean,default:!0},inputFocused:{type:Boolean,default:!1},minSearchChars:{type:[Number,String],default:0}},setup(t,{expose:e}){const n=t,{getColor:r,getHoverColor:o}=He(),i=Ye("minSearchChars"),s=g(()=>aa(n.option)?n.option.icon:void 0),l=g(()=>r(n.color)),a=g(()=>n.getText(n.option)),u=g(()=>{const p={start:a.value,searchedSubString:"",end:""};if(!a.value||!n.search||!n.highlightMatchedText||n.search.lengthn.getSelectedState(n.option)),d=g(()=>typeof n.option=="string"?n.option===n.currentOption:n.getTrackBy(n.currentOption)===n.getTrackBy(n.option)),f=ct("va-select-option",()=>({selected:c.value})),h=g(()=>({color:c.value?r(n.color):"inherit",backgroundColor:d.value?o(r(n.color)):"transparent",cursor:n.disabled?"default":void 0,opacity:n.disabled?"var(--va-select-option-list-option-disabled-opacity)":void 0}));return e({isFocused:d,isSelected:c}),(p,v)=>(A(),I("div",{role:"option",class:Ae(["va-select-option",m(f)]),style:se(h.value),"aria-selected":c.value},[D(p.$slots,"option-content",{},()=>[s.value?(A(),te(m(Ze),{key:0,size:"small",class:"va-select-option__icon",name:s.value},null,8,["name"])):z("",!0),Ue(" "+Be(u.value.start)+" ",1),u.value.searchedSubString?(A(),I("span",W7,Be(u.value.searchedSubString),1)):z("",!0),Ue(" "+Be(u.value.end),1)]),xr(he(m(Ze),{class:"va-select-option__selected-icon",size:"small",name:"va-check",color:l.value},null,8,["color"]),[[zs,c.value]])],14,j7))}}),c0=me(U7),K7=()=>{const t=Ne({}),e=n=>r=>{if(r)return t.value[n]=r,String(n)};return km(()=>{t.value={}}),{itemRefs:t,setItemRef:e}},G7=["tabindex","onKeydown","aria-multiselectable"],q7={key:0,class:"va-select-option-list__group-name",role:"presentation"},Y7={key:0,class:"va-select-option-list--empty"},X7=ie({name:"VaSelectOptionList",__name:"VaSelectOptionList",props:{...Xm,...Me,...Cl,...xl,noOptionsText:{type:String,default:"Items not found"},getSelectedState:{type:Function,required:!0},multiple:{type:Boolean,default:!1},search:{type:String,default:""},tabindex:{type:[String,Number],default:0},hoveredOption:{type:[String,Number,Boolean,Object],default:null},virtualScroller:{type:Boolean,default:!0},highlightMatchedText:{type:Boolean,default:!0},minSearchChars:{type:[Number,String],default:0},autoSelectFirstOption:{type:Boolean,default:!1},selectedTopShown:{type:Boolean,default:!1},doShowAllOptions:{type:Boolean,default:!1}},emits:["select-option","update:hoveredOption","no-previous-option-to-hover","scroll-bottom"],setup(t,{expose:e,emit:n}){const r=t,o=n,i=Ne(),s=()=>{var ne;(ne=i.value)==null||ne.focus({preventScroll:!0})},l=g(()=>{var ne;return((ne=i.value)==null?void 0:ne.clientHeight)??200}),a=()=>o("scroll-bottom"),u=ne=>{const Z=ne.target;Z&&Z.scrollTop+Z.clientHeight===Z.scrollHeight&&a()},c=W(""),d=g(()=>r.hoveredOption??null),f=(ne,Z)=>{o("update:hoveredOption",ne),c.value=Z},{getText:h,getGroupBy:p,getTrackBy:v,getDisabled:y}=wl(r),b=Ye("minSearchChars"),S=g(()=>{var ne;const Z=r.getSelectedState,Ve=(ne=r.options)==null?void 0:ne.find(Pe=>Z(Pe));return Ve?h(Ve):""}),w=g(()=>{var ne;return S.value.toLowerCase()===((ne=r.search)==null?void 0:ne.toLowerCase())}),x=g(()=>{if(r.doShowAllOptions&&w.value||!r.search||r.search.lengthh(Z).toUpperCase().includes(ne))}),k=g(()=>r.groupBy?x.value.reduce((ne,Z)=>{const Ve=p(Z);return Ve?(ne[Ve]||(ne[Ve]=[]),ne[Ve].push(Z)):ne._noGroup.push(Z),ne},{_noGroup:[]}):{_noGroup:x.value}),$=vg(k,r),C=ne=>!Ta(ne),T=ne=>{ne===d.value||C(ne)&&y(ne)||f(ne??null,"mouse")},_=ne=>{f(ne??null,"keyboard")},M=()=>{const ne=V.value&&typeof V.value=="object"?{...V.value}:V.value;o("select-option"),r.selectedTopShown&&T(ne)},F=g(()=>Object.values($.value).flat()),L=g(()=>x.value.some(ne=>p(ne))?F.value:x.value),H=g(()=>L.value.findIndex(ne=>C(d.value)&&v(ne)===v(d.value))),E=g(()=>({...Bt(r,["getSelectedState","color","search","highlightMatchedText"]),minSearchChars:b.value,getText:h,getTrackBy:v})),P=(ne,Z=!1)=>{const Ve=[...L.value||[]],Pe=Z?Ve.reverse():Ve,qe=Z?ne*-1-1:ne;return Pe.slice(qe).find(bt=>!y(bt))},V=g(()=>{const ne=H.value-1,Z=L.value[ne];if(C(Z)&&!(ne===0&&y(Z)))return P(H.value-1,!0)}),O=ne=>{T(ne),o("select-option")},N=ne=>{r.selectedTopShown||T(ne)},re=ne=>{r.selectedTopShown&&T(ne)},X=()=>{if(!C(d.value)){_(P(0,!0));return}C(V.value)?_(V.value):o("no-previous-option-to-hover")},ke=()=>{if(!C(d.value)){$e();return}const ne=H.value+1,Z=L.value[ne];C(Z)&&!(ne===L.value.length-1&&y(Z))&&_(P(H.value+1))},$e=()=>_(P(0)),{itemRefs:ye,setItemRef:j}=K7(),ce=Ne(),Se=ne=>{var Z;if(!C(ne))return;const Ve=Rt(ye.value[v(ne)]);Ve&&z7(Ve);const Pe=(Z=ce.value)==null?void 0:Z[0];r.virtualScroller&&Pe.virtualScrollTo(H.value)};return fe(()=>r.hoveredOption,ne=>{(!c.value||c.value==="keyboard")&&C(ne)&&Se(ne)}),fe(x,()=>{r.autoSelectFirstOption&&$e()},{immediate:!0}),e({focusPreviousOption:X,focusNextOption:ke,focusFirstOption:$e,scrollToOption:Se,focus:s}),(ne,Z)=>(A(),I("div",{ref_key:"root",ref:i,class:"va-select-option-list",tabindex:t.tabindex,onKeydown:[Ce(be(X,["stop","prevent"]),["up"]),Ce(be(X,["stop","prevent"]),["left"]),Ce(be(ke,["stop","prevent"]),["down"]),Ce(be(ke,["stop","prevent"]),["right"]),Ce(be(M,["stop","prevent"]),["enter"]),Ce(be(M,["stop","prevent"]),["space"])],onScrollPassive:u,role:"listbox","aria-multiselectable":ne.$props.multiple},[(A(!0),I(_e,null,Ge(m($),(Ve,Pe)=>(A(),I(_e,{key:Pe},[Pe!=="_noGroup"?(A(),I("span",q7,Be(Pe),1)):z("",!0),ne.$props.virtualScroller?(A(),te(m(rf),{key:1,ref_for:!0,ref_key:"virtualScrollerRef",ref:ce,items:Ve,"track-by":m(v),"wrapper-size":l.value,"onScroll:bottom":a},{default:J(({item:qe,index:bt})=>[D(ne.$slots,"default",de(we({option:qe,index:bt,selectOption:(B=qe)=>O(B)})),()=>[he(m(c0),ee({option:qe,"current-option":d.value,disabled:m(y)(qe)},E.value,{onClick:be(M,["stop"]),onMouseenter:B=>re(qe),onMousemove:B=>N(qe)}),null,16,["option","current-option","disabled","onMouseenter","onMousemove"])])]),_:2},1032,["items","track-by","wrapper-size"])):(A(!0),I(_e,{key:2},Ge(Ve,(qe,bt)=>D(ne.$slots,"default",de(ee({key:m(v)(qe)},{option:qe,index:bt,selectOption:O})),()=>[he(m(c0),ee({ref_for:!0,ref:m(j)(m(v)(qe)),"current-option":d.value,option:qe,disabled:m(y)(qe)},E.value,{onClick:be(M,["stop"]),onMouseenter:B=>re(qe),onMousemove:B=>N(qe)}),{"option-content":J(()=>[D(ne.$slots,"option-content",de(we({option:qe,index:bt})))]),_:2},1040,["current-option","option","disabled","onMouseenter","onMousemove"])])),128))],64))),128)),x.value.length?z("",!0):(A(),I("div",Y7,Be(t.noOptionsText),1))],40,G7))}}),J7=me(X7),Q7={key:0,class:"va-select-content__placeholder"},Z7=["placeholder"],eY={key:0,class:"va-select-content__option"},tY={key:1,class:"va-select-content__separator"},nY=["placeholder","disabled","readonly"],rY=ie({name:"VaSelectContent",__name:"VaSelectContent",props:{...vi,ariaAttributes:{type:Object},value:{type:Array,required:!0},valueString:{type:String},separator:{type:String,default:", "},placeholder:{type:String,default:""},tabindex:{type:[String,Number],default:0},hiddenSelectedOptionsAmount:{type:[Number,String],default:0},isAllOptionsShown:{type:Boolean,default:!1},autocomplete:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},getText:{type:Function,required:!0},autocompleteInputValue:{type:String,default:""}},emits:["toggle-hidden","autocomplete-input","focus-prev","focus-next","select-option","delete-last-selected"],setup(t,{emit:e}){const n=t,r=e,o=W(),i=g(()=>n.placeholder&&!n.valueString),s=()=>r("toggle-hidden"),{value:l,focused:a}=Or(n),u=g({get:()=>n.autocompleteInputValue,set:v=>r("autocomplete-input",v)}),c=Ye("hiddenSelectedOptionsAmount");dt(()=>{n.multiple||n.autocomplete&&(u.value=n.valueString)}),fe(a,v=>{var y,b;!n.autocomplete||!v||(u.value?(y=o.value)==null||y.setSelectionRange(0,u.value.length):(b=o.value)==null||b.focus())});const d=v=>{n.multiple&&l.value.length&&v.key==="Backspace"&&!u.value&&r("delete-last-selected")},f=v=>{var y;n.autocomplete&&((y=o.value)==null||y.focus(),v.stopPropagation())},h=v=>aa(v)?v.icon:void 0,p=g(()=>n.multiple?l.value:l.value[0]);return(v,y)=>(A(),I("div",{class:"va-select-content",onClick:f},[i.value&&!v.$props.autocomplete?(A(),I("span",Q7,[q("input",ee(t.ariaAttributes,{placeholder:v.$props.placeholder,readonly:""}),null,16,Z7)])):n.autocomplete&&!n.multiple?z("",!0):D(v.$slots,"content",de(ee({key:1},{value:p.value,valueString:v.$props.valueString,valueArray:v.$props.value,tabindex:v.$props.tabindex,ariaAttributes:t.ariaAttributes})),()=>[(A(!0),I(_e,null,Ge(v.$props.value,(b,S)=>(A(),I(_e,{key:S},[b!==""?(A(),I("span",eY,[D(v.$slots,"option-content",de(we({option:b,index:S,selectOption:()=>{}})),()=>[h(b)?(A(),te(m(Ze),{key:0,size:"small",class:"va-select-option__icon",name:h(b)},null,8,["name"])):z("",!0),Ue(" "+Be(t.getText(b)),1)])])):z("",!0),Su.value=b),class:"va-select-content__autocomplete",ref_key:"autocompleteInput",ref:o,autocomplete:"off","aria-autocomplete":"list",placeholder:v.$props.placeholder,disabled:v.$props.disabled,readonly:v.$props.readonly,onKeydown:[y[1]||(y[1]=Ce(be(b=>v.$emit("focus-prev"),["stop","prevent"]),["up"])),y[2]||(y[2]=Ce(be(b=>v.$emit("focus-next"),["stop","prevent"]),["down"])),y[3]||(y[3]=Ce(be(b=>v.$emit("select-option"),["stop","prevent"]),["enter"])),d]}),null,16,nY)),[[_m,u.value]]):z("",!0),D(v.$slots,"hiddenOptionsBadge",de(we({amount:t.hiddenSelectedOptionsAmount,isShown:v.$props.isAllOptionsShown,toggle:s})),()=>[m(c)&&!v.$props.isAllOptionsShown?(A(),te(m(Yk),{key:0,class:"va-select-content__state-icon",color:"info",text:`+${m(c)}`,tabindex:v.$props.tabindex,onClick:be(s,["stop"])},null,8,["text","tabindex"])):z("",!0)]),D(v.$slots,"hideOptionsButton",de(we({isShown:v.$props.isAllOptionsShown,toggle:s})),()=>[v.$props.isAllOptionsShown?(A(),te(m(Ze),{key:0,role:"button",class:"va-select-content__state-icon",size:"small",name:"reply",tabindex:v.$props.tabindex,onClick:be(s,["stop"])},null,8,["tabindex"])):z("",!0)])]))}}),oY=me(rY),iY={maxVisibleOptions:{type:Number||String,default:0}},sY=(t,e)=>{const n=$n(t,"modelValue"),r=W(!1),o=W([]),i=W([]),s=g(()=>i.value.length),l=g(()=>[...o.value,...i.value]),a=g(()=>!t.maxVisibleOptions||r.value?l.value:o.value);return fe(n,()=>{if(!Array.isArray(n.value)){o.value=[e(n.value)],i.value=[];return}const c=n.value.filter(d=>!Ta(d)).map(e);t.maxVisibleOptions?(o.value=c.slice(0,t.maxVisibleOptions),i.value=c.slice(t.maxVisibleOptions)):(o.value=[...c],i.value=[])},{immediate:!0}),{toggleHiddenOptionsState:()=>r.value=!r.value,isAllOptionsShown:r,visibleSelectedOptions:a,hiddenSelectedOptionsAmount:s,allSelectedOptions:l}},lY={dropdownIcon:{type:[String,Object],default:()=>({open:"va-arrow-down",close:"va-arrow-up"}),validator:t=>typeof t=="string"?!0:Object.entries(t).every(([e,n])=>["open","close"].includes(e)&&typeof n=="string")}},aY=(t,e)=>{const n=g(()=>t.dropdownIcon?typeof t.dropdownIcon=="string"?t.dropdownIcon:e.value?t.dropdownIcon.close:t.dropdownIcon.open:""),{getHoverColor:r,getColor:o}=He(),i=g(()=>o("secondary")),s=g(()=>t.readonly?r(i.value):i.value);return{toggleIcon:n,toggleIconColor:s}},uY={separator:{type:String,default:", "}},cY=(t,e,n)=>g(()=>{var r;return(r=e.value)!=null&&r.length&&e.value.map(n).join(t.separator)||t.clearValue}),dY={autocomplete:{type:Boolean,default:!1}},fY=(t,e,n,r,o)=>{const i=l=>l!=null&&l.length?o(l.at(-1)):"";e.autocomplete&&!e.multiple&&(t.value=i(n.value)),fe(n,(l,a)=>{if(!e.autocomplete)return;const u=i(l),c=i(a);u!==c&&(t.value=e.multiple?"":u,e.multiple||(r.value=!1))}),fe(t,l=>{e.autocomplete&&l&&l!==i(n.value)&&(r.value=!0)});const s=()=>{t.value=e.multiple?"":i(n.value)};return fe(r,(l,a)=>{e.autocomplete&&(!l||a)&&s()}),t},hY=()=>({popupId:`combobox-controls-${Qr()}`}),pY={maxSelections:{type:[Number,String],default:void 0}};function mY(t,e){return{exceedsMaxSelections:()=>e.value===void 0||isNaN(+e.value)?!1:t.value.length>=Number(e.value),addOption:o=>[...t.value,o]}}const d0=nt(Wn),gY=ie({name:"VaSelect",__name:"VaSelect",props:{...d0,...Me,...Cl,...Co,...Xa,...pY,...ru,...vi,...iY,...lY,...xl,...uY,...dY,...Cr,modelValue:{type:[String,Number,Array,Object,Boolean],default:void 0},placement:{...Cr.placement,default:"bottom"},keepAnchorWidth:{...Cr.keepAnchorWidth,default:!0},offset:{...Cr.offset,default:[1,0]},closeOnContentClick:{...Cr.closeOnContentClick,default:!1},trigger:{...Cr.trigger,default:()=>["click","right-click","space","enter"]},allowCreate:{type:[Boolean,String],default:!1,validator:t=>[!0,!1,"unique"].includes(t)},color:{type:String,default:"primary"},multiple:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},width:{type:String,default:"100%"},maxHeight:{type:String,default:"256px"},noOptionsText:{type:String,default:"$t:noOptions"},hideSelected:{type:Boolean,default:!1},tabindex:{type:[String,Number],default:0},virtualScroller:{type:Boolean,default:!1},selectedTopShown:{type:Boolean,default:!1},highlightMatchedText:{type:Boolean,default:!0},minSearchChars:{type:[Number,String],default:0},autoSelectFirstOption:{type:Boolean,default:!1},placeholder:{type:String,default:""},searchPlaceholderText:{type:String,default:"$t:search"},ariaLabel:{type:String,default:"$t:select"},ariaSearchLabel:{type:String,default:"$t:optionsFilter"},ariaClearLabel:{type:String,default:"$t:reset"},search:{type:String,default:void 0}},emits:["update:modelValue","update-search","create-new","scroll-bottom","update:search",...Cg,...mi,...tf],setup(t,{expose:e,emit:n}){const r=t,o=n,{tp:i,t:s}=yt(),l=Ne(),a=Ne(),u=Ne(),c=mg(a),{getValue:d,getText:f,getTrackBy:h,tryResolveByValue:p}=wl(r),v=ge=>f(p(ge)),y=()=>o("scroll-bottom"),[b]=qi("search",r,o,""),S=g(()=>r.searchable||r.allowCreate&&!r.autocomplete);fe(b,ge=>{o("update-search",ge),r.autocomplete||(ye.value=null)});const w=ge=>{if(Ta(ge)||typeof ge=="object")return ge;const wt=r.options.find(mt=>ge===d(mt));return wt===void 0?(pt(`[VaSelect]: can not find option in options list (${JSON.stringify(r.options)}) by provided value (${JSON.stringify(ge)})!`),ge):wt},{toggleHiddenOptionsState:x,isAllOptionsShown:k,visibleSelectedOptions:$,hiddenSelectedOptionsAmount:C,allSelectedOptions:T}=sY(r,w),_=g({get(){if(r.multiple)return T.value;const ge=w(r.modelValue);return Array.isArray(ge)&&(pt("Model value should be a string, number, boolean or an object for a single Select."),ge.length)?ge.at(-1):ge},set(ge){Array.isArray(ge)?o("update:modelValue",ge.map(d)):o("update:modelValue",d(ge))}}),M=cY(r,$,v),{canBeCleared:F,clearIconProps:L,onFocus:H,onBlur:E}=nf(r,_),P=g(()=>F.value?r.multiple&&Array.isArray(_.value)?!!_.value.length:!0:!1),V=g(()=>r.options?r.selectedTopShown?r.options.slice().sort((ge,wt)=>{const mt=N(ge),Wt=N(wt);return mt&&Wt?0:mt&&!Wt?-1:1}):r.hideSelected?r.options.filter(ge=>!N(ge)):r.options:[]),O=g(()=>Array.isArray(_.value)?_.value.map(ge=>p(ge)):p(_.value)),N=ge=>Array.isArray(O.value)?!Ta(O.value.find(wt=>re(wt,ge))):re(O.value,ge),re=(ge,wt)=>{const mt=d(ge),Wt=d(wt);return mt===Wt?!0:typeof mt=="string"&&typeof Wt=="string"?mt===Wt:mt===null||Wt===null?!1:typeof mt=="object"&&typeof Wt=="object"?h(mt)===h(Wt):!1},X=ge=>Array.isArray(ge.value),ke=ge=>{if(ye.value===null){R();return}if(S.value&&(b.value=""),r.multiple&&X(_)){const{exceedsMaxSelections:wt,addOption:mt}=mY(_,W(r.maxSelections));if(N(ge))_.value=_.value.filter(_o=>!re(ge,_o));else{if(wt())return;_.value=mt(ge)}}else _.value=ge,R();cn()},$e=()=>{var ge;const wt=(ge=r.options)==null?void 0:ge.some(Wt=>[b.value,Mt.value].includes(f(Wt)));!((r.allowCreate==="unique"||r.autocomplete)&&wt)&&(o("create-new",b.value||Mt.value),b.value="",Mt.value="")},ye=W(null),j=()=>{if(!Z.value){bt();return}ke(ye.value)},ce=()=>{const ge=!!r.allowCreate&&(b.value||Mt.value);ye.value!==null?j():ge&&$e()},Se=()=>{var ge;return(ge=l.value)==null?void 0:ge.focusPreviousOption()},ne=()=>{var ge;return(ge=l.value)==null?void 0:ge.focusNextOption()},{isOpenSync:Z,dropdownProps:Ve}=wg(r,o,{defaultCloseOnValueUpdate:g(()=>!r.multiple)}),Pe=g(()=>({...Ve.value,stateful:!1,innerAnchorSelector:".va-input-wrapper__field"})),qe=g({get:()=>Z.value,set:ge=>{ge?bt():B()}}),bt=()=>{r.disabled||r.readonly||(Z.value=!0,ve(),U())},B=()=>{Z.value=!1,r.autocomplete||(b.value=""),Ot(()=>{rv(),c.focusIfNothingIfFocused()})},R=()=>{B(),c.value=!0},Q=()=>{var ge;(ge=u.value)==null||ge.focus()},K=()=>{var ge,wt;(ge=l.value)==null||ge.focus(),!r.modelValue&&((wt=l.value)==null||wt.focusFirstOption())},U=async()=>{await Ot(),S.value?Q():K()},Y=()=>{qe.value||(E(),m_.onBlur(),c.value?c.value=!1:rv())},oe=g(()=>r.disabled?-1:r.tabindex),ae=g(()=>r.disabled||r.autocomplete?-1:0),ve=()=>{const ge=_.value;if(typeof ge!="object"&&Array.isArray(ge)&&!ge.length)return;const mt=Array.isArray(ge)?ge[ge.length-1]:ge;ye.value=mt,Ot(()=>{var Wt;return(Wt=l.value)==null?void 0:Wt.scrollToOption(mt)})};let ue="",Oe;const Re=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Enter"," "],Le=ge=>{if(Re.some(Wt=>Wt===ge.key))return;const wt=ge.key.length===1,mt=ge.key==="Backspace"||ge.key==="Delete";if(clearTimeout(Oe),mt?ue=ue?ue.slice(0,-1):"":wt&&(ue+=ge.key),S.value){b.value=ue;return}if(ue){const Wt=r.options.find(_o=>f(_o).toLowerCase().startsWith(ue.toLowerCase()));Wt&&(ye.value=Wt)}Oe=setTimeout(()=>{ue=""},1e3)},Ke=Ye("minSearchChars"),Qe=g(()=>({...Bt(r,["textBy","trackBy","groupBy","valueBy","disabledBy","color","virtualScroller","highlightMatchedText","delay","selectedTopShown"]),autoSelectFirstOption:r.autoSelectFirstOption||r.autocomplete,search:b.value||Mt.value,tabindex:oe.value,selectedValue:_.value,options:V.value,getSelectedState:N,noOptionsText:i(r.noOptionsText),doShowAllOptions:To.value,minSearchChars:Ke.value})),{toggleIcon:ft,toggleIconColor:G}=aY(r,Z),Fe=g(()=>c.value||Z.value),pe=Ln(),ze=ct("va-select-anchor",()=>({nowrap:!!(r.maxVisibleOptions&&!pe.content)})),Xe=gt(d0),Yt=g(()=>({...Xe.value,error:d_.value,errorMessages:f_.value,focused:Fe.value,"aria-label":r.ariaLabel||(r.modelValue?`${s("selectedOption")}: ${r.modelValue}`:s("noSelectedOption"))})),rr=g(()=>({...Bt(r,["placeholder","autocomplete","multiple","disabled","readonly"]),tabindex:oe.value,value:$.value,valueString:M.value,hiddenSelectedOptionsAmount:C.value,isAllOptionsShown:k.value,focused:c.value,autocompleteInputValue:Mt.value,getText:v})),Mt=fY(b,r,$,Z,f),Zt=ge=>Mt.value=ge,To=W(!0);fe(qe,()=>{To.value=!0}),fe(b,()=>{To.value=!1});const _l=()=>{r.disabled||Kr(Rt(a.value))},hu=()=>{qe.value&&(qe.value=!1),Ot(()=>{r.disabled||Yd(Rt(a.value))})},bi=()=>h_(()=>{r.multiple?_.value=Array.isArray(r.clearValue)?r.clearValue:[]:_.value=r.clearValue,b.value="",o("clear"),p_(),Ot(()=>{c.value=!0})}),cn=ge=>{r.autocomplete&&!r.disabled&&!r.readonly&&(c.value=!0,Z.value=!0)},u_=ge=>{if(r.disabled||r.readonly)return;const wt=ge.target&&"tagName"in ge.target&&ge.target.tagName==="INPUT";ge.code==="Space"&&wt||(ge.preventDefault(),qe.value=!qe.value)},c_=()=>{Array.isArray(_.value)&&(_.value=_.value.slice(0,-1))},{validate:rv,computedError:d_,computedErrorMessages:f_,withoutValidation:h_,resetValidation:p_,validationAriaAttributes:Tie,listeners:m_,isTouched:g_}=wo(r,o,{reset:bi,focus:_l,value:_});fe(Z,ge=>{ge||(g_.value=!0)});const{popupId:Af}=hY(),Tf=b,v_=H;return e({focus:_l,blur:hu,reset:bi}),(ge,wt)=>(A(),te(m(er),ee({ref:"dropdown",modelValue:qe.value,"onUpdate:modelValue":wt[4]||(wt[4]=mt=>qe.value=mt),class:"va-select va-select__dropdown va-select-dropdown"},Pe.value,{role:"combobox","inner-anchor-selector":".va-input-wrapper__field","keyboard-navigation":!1}),{anchor:J(()=>[he(m(Wn),ee(Yt.value,{ref_key:"input",ref:a,class:["va-select__anchor va-select-anchor__input",m(ze)],"aria-haspopup":"listbox","model-value":m(M),readonly:!0,"aria-label":ge.$props.ariaLabel,"aria-controls":m(Af),"aria-owns":m(Af),onFocus:m(v_),onBlur:Y}),vn({icon:J(()=>[P.value?(A(),te(m(Ze),ee({key:0,role:"button","aria-label":m(i)(ge.$props.ariaClearLabel)},m(L),{onClick:be(bi,["stop"]),onKeydown:[Ce(be(bi,["stop"]),["enter"]),Ce(be(bi,["stop"]),["space"])]}),null,16,["aria-label","onKeydown"])):z("",!0)]),appendInner:J(()=>[he(m(Ze),{color:m(G),name:m(ft),class:"va-select__toggle-icon",role:"button",tabindex:ae.value,"aria-expanded":qe.value,onKeydown:Ce(u_,["enter"])},null,8,["color","name","tabindex","aria-expanded"])]),default:J(({ariaAttributes:mt})=>[he(m(oY),ee(rr.value,{ariaAttributes:mt,separator:ge.$props.separator,onToggleHidden:m(x),onAutocompleteInput:Zt,onFocusPrev:Se,onFocusNext:ne,onSelectOption:ce,onDeleteLastSelected:c_}),vn({_:2},[Ge(ge.$slots,(Wt,_o)=>({name:_o,fn:J(y_=>[D(ge.$slots,_o,de(we(y_)))])}))]),1040,["ariaAttributes","separator","onToggleHidden"])]),_:2},[Ge(ge.$slots,(mt,Wt)=>({name:Wt,fn:J(_o=>[D(ge.$slots,Wt,de(we(_o)))])}))]),1040,["class","model-value","aria-label","aria-controls","aria-owns","onFocus"])]),default:J(()=>[he(m(Xi),{class:"va-select-dropdown__content",style:se({width:ge.$props.width}),onKeydown:Ce(R,["esc"]),role:"dialog"},{default:J(()=>[S.value?(A(),te(m(Wn),{key:0,ref_key:"searchBar",ref:u,class:"va-select-dropdown__content-search-input",modelValue:m(Tf),"onUpdate:modelValue":wt[0]||(wt[0]=mt=>Tt(Tf)?Tf.value=mt:null),"aria-label":m(i)(ge.$props.ariaSearchLabel),tabindex:oe.value,placeholder:m(i)(ge.$props.searchPlaceholderText),preset:"bordered",onKeydown:[Ce(be(Se,["stop","prevent"]),["up"]),Ce(be(Se,["stop","prevent"]),["left"]),Ce(be(ne,["stop","prevent"]),["down"]),Ce(be(ne,["stop","prevent"]),["right"]),Ce(be(ce,["prevent"]),["enter"])],onFocus:wt[1]||(wt[1]=mt=>ye.value=null)},null,8,["modelValue","aria-label","tabindex","placeholder","onKeydown"])):z("",!0),he(m(J7),ee({ref_key:"optionList",ref:l,class:"va-select-dropdown__options-wrapper",hoveredOption:ye.value,"onUpdate:hoveredOption":wt[2]||(wt[2]=mt=>ye.value=mt),style:{maxHeight:ge.$props.maxHeight},id:m(Af)},Qe.value,{onSelectOption:j,onNoPreviousOptionToHover:Q,onKeydown:[wt[3]||(wt[3]=Ce(be(mt=>u.value&&u.value.focus(),["stop","prevent"]),["tab"])),Le],onScrollBottom:y}),{default:J(mt=>[D(ge.$slots,"option",de(we(mt)))]),"option-content":J(mt=>[D(ge.$slots,"option-content",de(we(mt)))]),_:3},16,["hoveredOption","style","id"])]),_:3},8,["style"])]),_:3},16,["modelValue"]))}}),vY=me(gY),yY={key:0,class:"va-skeleton__wave"},bY=ie({name:"VaSkeleton",__name:"VaSkeleton",props:{color:{type:String,default:"backgroundElement"},delay:{type:[Number,String],default:100},tag:{type:String,default:"div"},animation:{type:String,default:"pulse"},lines:{type:[String,Number],default:1},height:{type:[String],default:"5em"},width:{type:[String],default:"100%"},lineGap:{type:String,default:"8px"},lastLineWidth:{type:[String],default:"75%"},variant:{type:String,default:"squared"},ariaLabel:{type:String,default:"$t:loading"}},setup(t){const e=t,n=W(!1),r=Ye("delay");let o;dt(()=>{clearTimeout(o),setTimeout(()=>{n.value=!0},r.value)}),jt(()=>{clearTimeout(o)});const i=g(()=>e.variant==="text"?`${e.lines}em`:e.height),s=g(()=>e.variant==="circle"?i.value:e.width),{getColor:l}=He(),a=g(()=>l(e.color));g(()=>`-${e.lineGap}`);const u=ct("va-skeleton",()=>({lines:Number(e.lines)>1,text:e.variant==="text",circle:e.variant==="circle",hidden:!n.value,pulse:e.animation==="pulse",wave:e.animation==="wave"})),c=g(()=>e.variant==="circle"?"50%":e.variant==="rounded"?`var(--va-skeleton-border-radius, calc(${i.value} / 5))`:"0px"),{tp:d}=yt(),f=os(),h=g(()=>[...Object.keys(u),f.class]);return(p,v)=>(A(),te(zn(t.tag),{class:Ae(["va-skeleton",h.value]),role:"status","aria-live":"polite","aria-label":m(d)(p.$props.ariaLabel),"aria-atomic":"true",style:se(`--va-color-computed: ${String(a.value)};--va-height-computed: ${String(i.value)};--va-width-computed: ${String(s.value)};--va-border-radius: ${String(c.value)};--va-line-gap: ${String(t.lineGap)};--va-last-line-width: ${String(t.lastLineWidth)}`)},{default:J(()=>[D(p.$slots,"default"),t.animation==="wave"?(A(),I("div",yY)):z("",!0)]),_:3},8,["aria-label","class","style"]))}}),SY=ie({name:"VaSkeletonGroup",__name:"VaSkeletonGroup",props:{color:{type:String,default:"backgroundElement"},delay:{type:[Number,String],default:100},animation:{type:String,default:"pulse"},lines:{type:[Number,String],default:1},lineGap:{type:String,default:"8px"},lastLineWidth:{type:[String],default:"75%"}},setup(t){const e=t,n=W(!1),r=Ye("delay");let o;dt(()=>{o=setTimeout(()=>{n.value=!0},r.value)}),wm(()=>{clearTimeout(o)});const i=ct("va-skeleton-group",()=>({hidden:n.value===!1})),s=g(()=>({...e,delay:0}));return(l,a)=>(A(),te(m(Ya),{components:{VaSkeleton:s.value}},{default:J(()=>[q("div",ee({class:["va-skeleton-group",m(i)]},l.$attrs),[D(l.$slots,"default",{},void 0,!0)],16)]),_:3},8,["components"]))}}),CY=hs(SY,[["__scopeId","data-v-597bab9a"]]),wY=me(bY),kY=me(CY),qx=Symbol("VaSidebar"),xY=t=>{Pr(qx,t)},$Y=()=>Mn(qx,{color:"background-element"}),AY=t=>{const e=W(null);return Ys([t],()=>{var n;e.value=((n=t.value)==null?void 0:n.clientWidth)??null}),tr(()=>{var n;e.value=((n=t.value)==null?void 0:n.clientWidth)??null}),e},TY=ie({name:"VaSidebar",__name:"VaSidebar",props:{...Me,activeColor:{type:String,default:"primary"},hoverColor:{type:String,default:void 0},hoverOpacity:{type:[Number,String],default:.2,validator:t=>Number(t)>=0&&Number(t)<=1},borderColor:{type:String,default:void 0},color:{type:String,default:"background-element"},textColor:{type:String},gradient:{type:Boolean,default:!1},minimized:{type:Boolean,default:!1},hoverable:{type:Boolean,default:!1},width:{type:String,default:"16rem"},minimizedWidth:{type:String,default:"4rem"},modelValue:{type:Boolean,default:!0},animated:{type:[Boolean,String],default:!0},closeOnClickOutside:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,o=n,{getColor:i}=He();xY(r);const s=W(!1),l=g(()=>r.minimized||r.hoverable&&!s.value),a=W(),u=AY(a),c=g(()=>r.modelValue===!0||u.value===null?!0:u.value>0),d=W(),f=()=>r.modelValue?l.value?r.minimizedWidth:r.width:0,h=g(()=>l.value?r.minimizedWidth:r.width);tr(()=>{const k=f();setTimeout(()=>{d.value=k})});const p=g(()=>i(r.color)),{textColorComputed:v}=qt(p),y=g(()=>{const k=i(p.value);return{color:v.value,backgroundColor:k,backgroundImage:r.gradient?Ym(k):void 0,overflowX:u.value===d.value?void 0:"hidden",width:d.value,minWidth:d.value}}),b=ct("va-sidebar",()=>({minimized:l.value,animated:!!r.animated,"animated-right":r.animated==="right","animated-left":r.animated==="left"||r.animated===!0})),S=k=>{s.value=r.hoverable&&k},w=Ne();Jd([w],()=>{r.closeOnClickOutside&&r.modelValue&&setTimeout(()=>{o("update:modelValue",!1)},0)});const x=g(()=>({textColor:r.textColor,activeColor:r.activeColor,hoverColor:r.hoverColor,borderColor:r.borderColor,hoverOpacity:r.hoverOpacity}));return e({isMinimized:l,isHovered:s,updateHoverState:S,rootElement:w,menu:a,doShowMenu:c,menuWidth:h,sidebarWidth:d}),(k,$)=>(A(),I("aside",{ref_key:"rootElement",ref:w,class:Ae(["va-sidebar",m(b)]),style:se(y.value),onMouseenter:$[0]||($[0]=C=>S(!0)),onMouseleave:$[1]||($[1]=C=>S(!1))},[xr(q("div",{class:"va-sidebar__menu",ref_key:"menu",ref:a,style:se({width:h.value,minWidth:h.value})},[he(m(Ya),{components:{VaSidebarItem:x.value}},{default:J(()=>[D(k.$slots,"default")]),_:3},8,["components"])],4),[[zs,c.value]])],38))}}),_Y=me(TY),OY=ie({name:"VaSidebarItem",__name:"VaSidebarItem",props:{...cs,...Me,active:{type:Boolean,default:!1},textColor:{type:String,default:void 0},activeColor:{type:String,default:"primary"},hoverColor:{type:String,default:void 0},hoverOpacity:{type:[Number,String],default:.2},borderColor:{type:String,default:void 0},disabled:{type:Boolean,default:!1}},setup(t){const e=t,n=fc(),r=$Y(),{isHovered:o}=Ja(n,$n(e,"disabled")),{getColor:i,getHoverColor:s,getFocusColor:l}=He(),{hasKeyboardFocus:a,keyboardFocusListeners:u}=kl(),c=g(()=>e.active&&!o.value&&!a.value?i(e.activeColor):a.value?l(i(e.hoverColor||e.activeColor)):"#ffffff00"),d=g(()=>I6(i(r==null?void 0:r.color),c.value)),{textColorComputed:f}=qt(d),h=g(()=>{const y={color:f.value};if(e.disabled)return y;if((o.value||e.active||a.value)&&(y.backgroundColor=c.value),e.active){const b={...r,...e};y.borderColor=i(b.borderColor||b.activeColor)}return a.value&&(y.backgroundColor=l(i(e.hoverColor||e.activeColor))),o.value&&(y.backgroundColor=s(i(e.hoverColor||e.activeColor),Number(e.hoverOpacity))),y}),{tagComputed:p,linkAttributesComputed:v}=gi(e);return(y,b)=>(A(),te(zn(m(p)),ee({ref_key:"rootElement",ref:n,class:["va-sidebar__item va-sidebar-item",{"va-sidebar-item--active":y.$props.active,"va-sidebar-item--disabled":y.$props.disabled}],tabindex:y.$props.disabled?-1:0,style:h.value},m(v),ur(m(u))),{default:J(()=>[D(y.$slots,"default")]),_:3},16,["tabindex","class","style"]))}}),PY={class:"va-sidebar__item__content va-sidebar-item-content"},BY=ie({name:"VaSidebarItemContent",__name:"VaSidebarItemContent",setup(t){return(e,n)=>(A(),I("div",PY,[D(e.$slots,"default")]))}}),MY={class:"va-sidebar__title va-sidebar-item-title"},IY=ie({name:"VaSidebarItemTitle",__name:"VaSidebarItemTitle",setup(t){return(e,n)=>(A(),I("div",MY,[D(e.$slots,"default")]))}}),DY=me(BY),EY=me(IY),LY=me(OY),f0=(t,e,n,r,o)=>{(Array.isArray(t)&&!o||!Array.isArray(t)&&o)&&pt(`The type "${Array.isArray(t)?"array":typeof t}" of prop "model-value" does not match prop "range = ${o}".`),r{sr&&pt(`The value of the slider is ${s}, the maximum value is ${r}, the value of this slider can not be greater than the maximum value`)};return Array.isArray(t)?t.map(i):i(t),!0},VY={key:0,class:"va-slider__input-wrapper","aria-hidden":"true"},RY=["id"],FY={key:2,class:"va-input__label","aria-hidden":"true"},NY=["tabindex","onFocus"],HY=["tabindex"],zY={key:3,class:"va-input__label--inverse","aria-hidden":"true"},jY=["id"],WY={key:5,class:"va-slider__input-wrapper"},UY=ie({name:"VaSlider",__name:"VaSlider",props:{...Kt,...Me,range:{type:Boolean,default:!1},modelValue:{type:[Number,Array],default:0},trackLabel:{type:[Function,String]},color:{type:String,default:"primary"},trackColor:{type:String,default:""},labelColor:{type:String,default:""},trackLabelVisible:{type:Boolean,default:!1},min:{type:[Number,String],default:0},max:{type:[Number,String],default:100},step:{type:[Number,String],default:1},label:{type:String,default:""},invertLabel:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},pins:{type:Boolean,default:!1},iconPrepend:{type:String,default:""},iconAppend:{type:String,default:""},vertical:{type:Boolean,default:!1},showTrack:{type:Boolean,default:!0},ariaLabel:{type:String,default:"$t:sliderValue"}},emits:["drag-start","drag-end","change","update:modelValue"],setup(t,{emit:e}){const n=t,r=e,{getColor:o,getHoverColor:i}=He(),s=Ne(),l=Ne(),{setItemRefByIndex:a,itemRefs:u}=af(),c=W(!1),d=W(!1),f=W(0),h=W(0),p=n.range?[0,100]:0,{valueComputed:v}=xt(n,r,"modelValue",{defaultValue:p}),y=W(0),b=W(!1),S=Ye("min"),w=Ye("max"),x=Ye("step"),k=g(()=>n.vertical?[1,0]:[0,1]),$=g(()=>n.vertical?"bottom":"left"),C=g(()=>n.vertical?"height":"width"),T=g(()=>Array.isArray(O.value)&&O.value[1]-x.valueArray.isArray(O.value)&&O.value[0]+x.value>O.value[1]),M=ct("va-slider",()=>({...Bt(n,["disabled","readonly","vertical"]),active:c.value,horizontal:!n.vertical,grabbing:b.value})),F=ct("va-slider__handler",()=>({onFocus:!n.range&&(d.value||c.value),inactive:!c.value})),L=g(()=>({color:n.labelColor?o(n.labelColor):o(n.color)})),H=g(()=>({backgroundColor:n.trackColor?o(n.trackColor):i(o(n.color))})),E=g(()=>{if(Array.isArray(O.value)){const G=(O.value[0]-S.value)/(w.value-S.value)*100,Fe=(O.value[1]-S.value)/(w.value-S.value)*100;return{[$.value]:`${G}%`,[C.value]:`${Fe-G}%`,backgroundColor:o(n.color),visibility:n.showTrack?"visible":"hidden"}}else{const G=(O.value-S.value)/(w.value-S.value)*100;return{[C.value]:`${G}%`,backgroundColor:o(n.color),visibility:n.showTrack?"visible":"hidden"}}}),P=g(()=>{if(Array.isArray(O.value)){const G=(O.value[0]-S.value)/(w.value-S.value)*100,Fe=(O.value[1]-S.value)/(w.value-S.value)*100;return[{[$.value]:`${G}%`,backgroundColor:ce(0)?o(n.color):"#ffffff",borderColor:o(n.color)},{[$.value]:`${Fe}%`,backgroundColor:ce(1)?o(n.color):"#ffffff",borderColor:o(n.color)}]}else{const G=(O.value-S.value)/(w.value-S.value)*100;return{[$.value]:`${G}%`,backgroundColor:ce(0)?o(n.color):"#ffffff",borderColor:o(n.color)}}}),V=G=>n.range?P.value[G]:P.value,O=g({get:()=>v.value,set:G=>{d.value||r("change",G),v.value=G}}),N=G=>n.range&&G!==void 0?O.value[G]:O.value,re=g(()=>{const G=(w.value-S.value)/x.value;return h.value/G}),X=g(()=>{const G=`${x.value}`.split(".")[1];return G?Math.pow(10,G.length):1}),ke=g(()=>(w.value-S.value)/x.value-1),$e=g(()=>Array.isArray(O.value)?[(O.value[0]-S.value)/x.value*re.value,(O.value[1]-S.value)/x.value*re.value]:(O.value-S.value)/x.value*re.value),ye=g(()=>[0,h.value]),j=g(()=>[S.value,w.value]),ce=G=>!c.value&&!d.value||n.disabled||n.readonly?!1:n.range?y.value===G:y.value===0,Se=(G,Fe=y.value)=>{var pe,ze;if(G.preventDefault(),!Fe){if(!n.range)Fe=0;else if(Array.isArray($e.value)){const Xe="touches"in G?G.touches[0]:G;Fe=R(Xe)>($e.value[1]-$e.value[0])/2+$e.value[0]?1:0}}Array.isArray(O.value)&&(y.value=Fe),Array.isArray(O.value)?(pe=u.value[Fe])==null||pe.focus():(ze=l.value)==null||ze.focus(),d.value=!0,r("drag-start")},ne=G=>{!b.value||!d.value||n.disabled||n.readonly||(G.preventDefault(),"touches"in G?oe(R(G.touches[0])):oe(R(G)))},Z=()=>{!n.disabled&&!n.readonly&&(d.value&&(r("drag-end"),r("change",O.value)),d.value=!1,b.value=!1)},Ve=(G,Fe,pe)=>Math.max(Math.min(Fe,pe),G),Pe=G=>{var Fe,pe;if(![u.value[0],u.value[1],l.value].includes(document.activeElement)||n.disabled||n.readonly)return;const ze=(Yt,rr)=>{if(Array.isArray(O.value)){const Mt=O.value[rr]+(Yt?x.value:-x.value),Zt=Ve(S.value,Mt,w.value);O.value=[rr===0?Zt:O.value[0],rr===1?Zt:O.value[1]]}else{const Mt=O.value+(Yt?x.value:-x.value),Zt=Ve(S.value,Mt,w.value);O.value=Zt}};["ArrowLeft","ArrowUp","ArrowRight","ArrowDown"].includes(G.key)&&G.preventDefault();const Xe=Yt=>Yt===document.activeElement;if(n.range&&Array.isArray(O.value)){const Yt=cn=>n.vertical&&Xe(u.value[0])&&cn.key==="ArrowUp",rr=cn=>n.vertical&&Xe(u.value[0])&&cn.key==="ArrowDown",Mt=cn=>n.vertical&&Xe(u.value[1])&&cn.key==="ArrowUp",Zt=cn=>n.vertical&&Xe(u.value[1])&&cn.key==="ArrowDown",To=cn=>!n.vertical&&Xe(u.value[0])&&cn.key==="ArrowLeft",_l=cn=>!n.vertical&&Xe(u.value[0])&&cn.key==="ArrowRight",hu=cn=>!n.vertical&&Xe(u.value[1])&&cn.key==="ArrowLeft",bi=cn=>!n.vertical&&Xe(u.value[1])&&cn.key==="ArrowRight";switch(!0){case((Zt(G)||hu(G))&&T.value&&O.value[0]!==S.value):(Fe=u.value[0])==null||Fe.focus(),ze(0,0);break;case((Yt(G)||_l(G))&&_.value&&O.value[1]!==w.value):(pe=u.value[1])==null||pe.focus(),ze(1,1);break;case((rr(G)||To(G))&&O.value[0]!==S.value):ze(0,0);break;case((Mt(G)||bi(G))&&O.value[1]!==w.value):ze(1,1);break;case((Zt(G)||hu(G))&&O.value[1]!==S.value):ze(0,1);break;case((Yt(G)||_l(G))&&O.value[0]!==w.value):ze(1,0);break}}else n.vertical?(G.key==="ArrowDown"&&ze(0,0),G.key==="ArrowUp"&&ze(1,0)):(G.key==="ArrowLeft"&&ze(0,0),G.key==="ArrowRight"&&ze(1,0))},qe=G=>Array.isArray(O.value)?G*x.value>O.value[0]&&G*x.valuex.value/(w.value-S.value)*100),B=G=>({backgroundColor:qe(G)?o(n.color):i(o(n.color)),[$.value]:`${G*bt.value}%`,transition:b.value?"none":"var(--va-slider-pin-transition)"}),R=G=>(Q(),n.vertical?f.value-G.clientY:G.clientX-f.value),Q=()=>{s.value&&(h.value=s.value[n.vertical?"offsetHeight":"offsetWidth"],f.value=s.value.getBoundingClientRect()[$.value])},K=G=>(x.value*X.value*G+S.value*X.value)/X.value,U=(G,Fe)=>n.trackLabel?typeof n.trackLabel=="function"?n.trackLabel(G,Fe):n.trackLabel:G,Y=G=>{const Fe=y.value;Array.isArray(O.value)?ae(O.value[Fe],G)&&(Fe===0?O.value=[G,O.value[1]]:O.value=[O.value[0],G]):Gw.value?O.value=w.value:ae(O.value,G)&&(O.value=G)},oe=G=>{const Fe=ye.value,pe=j.value,ze=Array.isArray(O.value)?u.value[y.value]:l.value;if(ze==null||ze.focus(),G>=Fe[0]&&G<=Fe[1]){const Xe=K(Math.round(G/re.value));y.value?Array.isArray($e.value)&&Array.isArray(O.value)&&G<=$e.value[0]?(O.value=[Xe,O.value[0]],y.value=0):Y(Xe):Array.isArray($e.value)&&Array.isArray(O.value)&&G>=$e.value[1]?(O.value=[O.value[1],Xe],y.value=1):Y(Xe)}else GJSON.stringify(G)!==JSON.stringify(Fe),ve=G=>{if(n.disabled||n.readonly)return;const Fe="touches"in G?R(G.touches[0]):R(G);Array.isArray($e.value)&&(y.value=Fe>($e.value[1]-$e.value[0])/2+$e.value[0]?1:0),b.value=!0,oe(Fe),Se(G,y.value)},ue=()=>{document.addEventListener("mousemove",ne),document.addEventListener("touchmove",ne,{passive:!1}),document.addEventListener("mouseup",Z),document.addEventListener("mouseleave",Z),document.addEventListener("touchcancel",Z),document.addEventListener("touchend",Z),document.addEventListener("keydown",Pe)},Oe=()=>{document.removeEventListener("mousemove",ne),document.removeEventListener("touchmove",ne),document.removeEventListener("mouseup",Z),document.removeEventListener("mouseleave",Z),document.removeEventListener("touchcancel",Z),document.removeEventListener("touchend",Z),document.removeEventListener("keydown",Pe)},Re=Qr(),Le=g(()=>`aria-label-id-${Re}`),{tp:Ke}=yt(),Qe=Ln(),ft=g(()=>({role:"slider","aria-valuemin":S.value,"aria-valuemax":w.value,"aria-label":!Qe.label&&!n.label?Ke(n.ariaLabel,{value:String(O.value)}):void 0,"aria-labelledby":Qe.label||n.label?Le.value:void 0,"aria-orientation":n.vertical?"vertical":"horizontal","aria-disabled":n.disabled,"aria-readonly":n.readonly,"aria-valuenow":Array.isArray(O.value)?void 0:O.value,"aria-valuetext":Array.isArray(O.value)?String(O.value):void 0}));return dt(()=>{f0(O.value,x.value,S.value,w.value,n.range)&&(Q(),ue())}),jt(Oe),fe([O,()=>x.value,()=>S.value,()=>w.value,()=>n.range],([G,Fe,pe,ze,Xe])=>{f0(G,Fe,pe,ze,Xe)}),fe(b,G=>{document.documentElement.style.cursor=G?"grabbing":""}),(G,Fe)=>(A(),I("div",ee({class:["va-slider",m(M)]},ft.value),[(t.vertical?G.$slots.append:G.$slots.prepend)?(A(),I("div",VY,[D(G.$slots,t.vertical?"append":"prepend")])):z("",!0),(G.$slots.label||t.label)&&!t.invertLabel?(A(),I("span",{key:1,class:"va-input__label",id:Le.value,style:se(L.value)},[D(G.$slots,"label",{},()=>[Ue(Be(t.label),1)])],12,RY)):z("",!0),(t.vertical?t.iconAppend:t.iconPrepend)?(A(),I("span",FY,[he(m(Ze),{name:t.vertical?t.iconAppend:t.iconPrepend,color:m(o)(G.$props.color),size:16},null,8,["name","color"])])):z("",!0),q("div",{ref_key:"sliderContainer",ref:s,class:"va-slider__container",onMousedown:ve,onTouchstart:ve},[q("div",{class:"va-slider__track","aria-hidden":"true",style:se(H.value)},null,4),t.pins?(A(!0),I(_e,{key:0},Ge(ke.value,(pe,ze)=>(A(),I("div",{key:ze,class:Ae(["va-slider__mark",{"va-slider__mark--active":qe(pe)}]),style:se(B(pe))},null,6))),128)):z("",!0),G.$props.range?(A(),I(_e,{key:1},[q("div",{ref:"process",class:Ae(["va-slider__track va-slider__track--selected",{"va-slider__track--active":c.value}]),"aria-hidden":"true",style:se(E.value)},null,6),(A(!0),I(_e,null,Ge(k.value,pe=>(A(),I("div",{key:"dot"+pe,ref_for:!0,ref:m(a)(pe),class:Ae(["va-slider__handler",m(F)]),style:se(V(pe)),tabindex:t.disabled||t.readonly?void 0:0,onFocus:ze=>(c.value=!0,y.value=pe),onBlur:Fe[0]||(Fe[0]=ze=>c.value=!1)},[ce(pe)?(A(),I("div",{key:0,style:se({backgroundColor:m(o)(G.$props.color)}),class:"va-slider__handler__dot--focus"},null,4)):z("",!0),t.trackLabelVisible?(A(),I("div",{key:1,style:se(L.value),class:"va-slider__handler__dot--value"},[D(G.$slots,"trackLabel",de(we({value:N(pe),order:pe})),()=>[Ue(Be(U(N(pe),pe)),1)])],4)):z("",!0)],46,NY))),128))],64)):(A(),I(_e,{key:2},[q("div",{ref:"process","aria-hidden":"true",class:Ae(["va-slider__track va-slider__track--selected",{"va-slider__track--active":c.value}]),style:se(E.value)},null,6),q("div",{ref_key:"dot",ref:l,class:Ae(["va-slider__handler",m(F)]),style:se(P.value),tabindex:G.$props.disabled||G.$props.readonly?void 0:0,onFocus:Fe[1]||(Fe[1]=pe=>c.value=!0),onBlur:Fe[2]||(Fe[2]=pe=>c.value=!1)},[ce(0)?(A(),I("div",{key:0,class:"va-slider__handler__dot--focus",style:se({backgroundColor:m(o)(G.$props.color)})},null,4)):z("",!0),t.trackLabelVisible?(A(),I("div",{key:1,class:"va-slider__handler__dot--value",style:se(L.value)},[D(G.$slots,"trackLabel",de(we({value:N()})),()=>[Ue(Be(U(N())),1)])],4)):z("",!0)],46,HY)],64))],544),(t.vertical?t.iconPrepend:t.iconAppend)?(A(),I("span",zY,[he(m(Ze),{name:t.vertical?t.iconPrepend:t.iconAppend,color:m(o)(G.$props.color),size:16},null,8,["name","color"])])):z("",!0),(G.$slots.label||t.label)&&t.invertLabel?(A(),I("span",{key:4,class:"va-input__label va-input__label--inverse",style:se(L.value),id:Le.value},[D(G.$slots,"label",{},()=>[Ue(Be(t.label),1)])],12,jY)):z("",!0),(t.vertical?G.$slots.prepend:G.$slots.append)?(A(),I("div",WY,[D(G.$slots,t.vertical?"prepend":"append")])):z("",!0)],16))}}),KY=me(UY),GY={vertical:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},qY=(t,e,n)=>{const r=W(!1),o=W(0),i=W(0),s=W(0),l=(d,f)=>{const h=d.type===f?d:d.changedTouches[0];return n.vertical?h.pageY:h.pageX},a=d=>{n.disabled||!t.value||(r.value=!0,o.value=l(d,"mousedown"),i.value=e.value)},u=d=>{if(!r.value)return;const h=l(d,"mousemove")-o.value;s.value=i.value+Math.floor(h/t.value*100)},c=()=>{r.value=!1};return At(["mousemove","touchmove"],u),At(["mouseup","touchcancel"],c),{isDragging:r,startDragging:a,currentSplitterPosition:s}},YY=["aria-label"],XY={class:"va-split__dragger"},JY=ie({name:"VaSplit",__name:"VaSplit",props:{...Me,...GY,...Kt,modelValue:{type:Number,default:50,validator:t=>t<=100},maximization:{type:Boolean,default:!1},maximizeStart:{type:Boolean,default:!1},limits:{type:Array,default:()=>[0,0]},snapping:{type:Array,default:void 0},snappingRange:{type:[Number,String],default:4},ariaLabel:{type:String,default:"$t:splitPanels"}},emits:[...un],setup(t,{emit:e}){const n=t,r=e,o=Ne(),{valueComputed:i}=xt(n,r),s=W(),l=W(16),a=()=>{var E;const{width:P,height:V}=((E=o.value)==null?void 0:E.getBoundingClientRect())||{width:0,height:0};s.value=n.vertical?V:P,l.value=parseFloat(getComputedStyle(document.documentElement).fontSize)};dt(a),Ys([o],a);const u=(E,P)=>{let V="",O="";if(jy(E))return E;switch(E.split("").filter(N=>N&&N!==" ").forEach(N=>{isNaN(+N)?O+=N:V+=N}),O){case"%":return+V;case"px":return+V/s.value*100;case"rem":return+V*l.value/s.value*100;case"any":return["min","snapping"].includes(P)?0:100;case"":return 100;default:return pt("Invalid limits measure!"),0}},c=E=>{if(E==="undefined"||!s.value)return;let P=0,V=100;return(Vc(E)||jy(E))&&(P=u(E,"min")),Array.isArray(E)&&(P=u(E[0],"min"),V=u(E[1],"max")),P>V&&(pt(`Min panels size can not be larger than max one! Passed limit: ${E}.`),V=P),{min:P??0,max:V??100}},d=g(()=>c(n.limits[0])??{min:0,max:100}),f=g(()=>c(n.limits[1])??{min:0,max:100}),h=g(()=>{const E=!(d.value.min+f.value.min>100);return E||pt("The sum of different panels min sizes should be lesser or equal to 100% of the container size!"),E?f.value.min:100-d.value.min}),p=g(()=>(Math.ceil(f.value.max+d.value.max)<100&&pt("The sum of different panels max sizes should be equal to 100% of the container size!"),{start:{min:d.value.min,max:Math.min(d.value.max,100-h.value)},end:{min:h.value,max:Math.min(f.value.max,100-d.value.min)}})),v=E=>E>=p.value.start.min&&E>=p.value.end.min&&E<=p.value.start.max&&E<=p.value.end.max,y=g(()=>{if(!Array.isArray(n.snapping)||!s.value)return;let E=n.snapping.map(V=>u(V,"snapping"));if(!E.every(v)){const V=E.filter(v);pt(`Some of the snapping marks (${E}) are not in allowed range (${Object.values(p.value.start).join("-")} / ${Object.values(p.value.end).join("-")}) and will be removed (${V})!`),E=V}return E.every((V,O,N)=>N[O+1]?Math.abs(V-N[O+1])>Number(n.snappingRange):!0)||pt("Distance between some snapping marks is lesser than snapping range!"),E}),b=g(()=>u(n.snappingRange,"snapping")),S=W(i.value),w=g(()=>{if(y.value){const E=y.value.find(P=>S.value+b.value>P&&S.value-b.value{!n.maximization||n.disabled||(S.value=n.maximizeStart?p.value.start.max:100-p.value.end.max)};fe(i,E=>{(E
100-p.value.end.min)&&pt("Incorrect `modelValue`. Check current `limits` prop value."),S.value=E},{immediate:!0}),fe($,E=>{S.value=E}),fe(x,E=>{E||(i.value=w.value),document.documentElement.style.cursor=E?"var(--va-split-dragging-cursor)":""});const T=g(()=>n.vertical?"height":"width"),_=E=>{let P=E==="start"?w.value:100-w.value;return P<0&&(P=0),P>100&&(P=100),{[T.value]:`${P}%`}},M=g(()=>n.disabled?{}:x.value?{cursor:"var(--va-split-dragging-cursor)"}:{cursor:n.vertical?"var(--va-split-vertical-dragger-cursor)":"var(--va-split-horizontal-dragger-cursor)"}),F=ct("va-split",()=>({horizontal:!n.vertical,vertical:n.vertical,dragging:x.value})),{t:L,tp:H}=yt();return(E,P)=>(A(),I("section",{ref_key:"splitPanelsContainer",ref:o,class:Ae(["va-split",m(F)]),"aria-label":m(H)(E.$props.ariaLabel)},[q("div",{class:"va-split__panel",style:se(_("start"))},[D(E.$slots,"start",de(we({containerSize:s.value})))],4),q("div",XY,[q("div",{class:"va-split__dragger__overlay",style:se(M.value),onMousedown:P[0]||(P[0]=be((...V)=>m(k)&&m(k)(...V),["prevent"])),onTouchstart:P[1]||(P[1]=be((...V)=>m(k)&&m(k)(...V),["prevent"])),onDblclick:be(C,["prevent"]),onContextmenu:P[2]||(P[2]=be(()=>{},["prevent"])),onDragstart:P[3]||(P[3]=be(()=>{},["prevent"]))},[D(E.$slots,"grabber",{},()=>[he(m(Ix),{class:"va-split__dragger__default",vertical:!E.$props.vertical},null,8,["vertical"])])],36)]),q("div",{class:"va-split__panel",style:se(_("end"))},[D(E.$slots,"end",de(we({containerSize:s.value})))],4)],10,YY))}}),QY=me(JY),Yx=Symbol("TabsView"),ZY=["aria-disabled"],eX=q("div",{class:"va-tabs__slider"},null,-1),tX=[eX],nX={class:"va-tabs__tabs-items"},rX={class:"va-tabs__content"},Mo=t=>(t==null?void 0:t.clientWidth)||0,oX=ie({name:"VaTabs",__name:"VaTabs",props:{...Kt,...Me,modelValue:{type:[String,Number],default:null},left:{type:Boolean,default:!0},right:{type:Boolean,default:!1},center:{type:Boolean,default:!1},grow:{type:Boolean,default:!1},hidePagination:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},hideSlider:{type:Boolean,default:!1},vertical:{type:Boolean,default:!1},color:{type:String,default:"primary"},prevIcon:{type:String,default:"va-arrow-left"},nextIcon:{type:String,default:"va-arrow-right"},ariaMoveRightLabel:{type:String,default:"$t:movePaginationLeft"},ariaMoveLeftLabel:{type:String,default:"$t:movePaginationRight"}},emits:["update:modelValue","click:next","click:prev"],setup(t,{expose:e,emit:n}){const{tp:r}=yt(),o=t,i=n,s=Ne(),l=Ne(),a=Ne(),u=W([]),c=W(null),d=W(null),f=W(0),h=W(0),p=W(!1),v=W(0),y=W(0),b=W(!1),{valueComputed:S}=xt(o,i),w=ar({VaTab:{color:o.color}}),x=g(()=>{const{left:j,right:ce,center:Se,grow:ne,disabled:Z}=o;return{"va-tabs__container--left":j&&!ce&&!Se&&!ne,"va-tabs__container--right":ce,"va-tabs__container--center":Se,"va-tabs__container--grow":ne,"va-tabs__container--disabled":Z}}),k=g(()=>({"va-tabs--vertical":o.vertical})),{getColor:$}=He(),C=g(()=>$(o.color)),T=g(()=>o.hideSlider?{display:"none"}:{backgroundColor:C.value,height:o.vertical?`${c.value}px`:"",width:o.vertical?"":`${d.value}px`,transform:`translateY(-${h.value}px) translateX(${f.value}px)`,transition:b.value?"var(--va-tabs-slider-wrapper-transition)":""}),_=g(()=>o.vertical?{transform:"translateX(0px)"}:{transform:`translateX(${y.value-v.value}px)`,transition:b.value?"var(--va-tabs-slider-transition)":"",position:o.hidePagination?"unset":"absolute"}),M=g(()=>v.value===0),F=g(()=>{const j=u.value[u.value.length-1],ce=m(j.leftSidePosition),Se=m(j.rightSidePosition),ne=Mo(l.value);return Se<=v.value+ne||ce<=v.value}),L=()=>{d.value=0,c.value=0},H=j=>{const ce=Mo(l.value),Se=m(j.leftSidePosition),ne=m(j.rightSidePosition);if(!p.value){v.value=0;return}if(!(Se-v.value>=0&&ne-v.value<=ce)){if(Se-v.value<0){v.value=Se;return}if(ne-v.value>ce){v.value=ne-ce;return}v.value=0}},E=()=>{if(y.value=0,!p.value)return;const j=Mo(l.value),ce=Mo(a.value);o.right?y.value=ce-j:o.center&&(y.value=Math.floor((ce-j)/2))},P=()=>{L(),u.value.forEach(j=>{var ce;j.updateSidePositions();const Se=(((ce=j.name)==null?void 0:ce.value)||j.id)===S.value;j.isActive=j.isActiveRouterLink||Se,j.isActive&&(H(j),re(j))}),E()},V=()=>{const j=Mo(a.value),ce=Mo(s.value);requestAnimationFrame(()=>{p.value=!!(a.value&&s.value&&j>ce)})},O=()=>{var j,ce;const Se=Mo(l.value);let ne=v.value-Se;for(let Z=0;Zne&&Ve=v.value){ne=Ve;break}}v.value=Math.max(0,ne),i("click:prev")},N=()=>{var j;const ce=Mo(l.value),Se=v.value+ce;let ne=Se;for(let Pe=0;PeSe&&(ne=m(u.value[Pe].leftSidePosition),v.value{var ce;const Se=m(j.tabElement),ne=(Se==null?void 0:Se.offsetTop)||0,Z=(Se==null?void 0:Se.offsetLeft)||0,Ve=(Se==null?void 0:Se.clientHeight)||0,Pe=(Se==null?void 0:Se.clientWidth)||0;if(o.vertical){const bt=(((ce=l.value)==null?void 0:ce.clientHeight)||0)-ne-Ve;h.value=Math.max(bt,0),c.value=Ve,f.value=0,d.value=0}else f.value=Z,d.value=Pe,h.value=0,c.value=0},X=()=>{b.value||requestAnimationFrame(()=>{b.value=!0})},ke=j=>{var ce;j&&(S.value=((ce=j.name)==null?void 0:ce.value)||j.id,o.stateful&&P())},$e=j=>{var ce;const Se=u.value.push(j)-1;j.id=((ce=j.name)==null?void 0:ce.value)||Se},ye=j=>{u.value=u.value.filter(ce=>ce.id!==j.id),u.value.forEach((ce,Se)=>{var ne;ce.id=((ne=ce.name)==null?void 0:ne.value)||Se})};return Pr(Yx,{parentDisabled:o.disabled,selectTab:ke,moveToTab:H,registerTab:$e,unregisterTab:ye}),fe(()=>o.modelValue,P),Ys([s],V),Ys([l],P),dt(()=>{requestAnimationFrame(()=>{X()})}),e({selectTab:ke,moveToTab:H,movePaginationLeft:O,movePaginationRight:N}),(j,ce)=>(A(),I("div",{class:Ae(["va-tabs",k.value])},[q("div",{ref_key:"wrapper",ref:s,class:"va-tabs__wrapper",role:"tablist","aria-disabled":j.$props.disabled},[p.value&&!j.$props.hidePagination?(A(),te(m(et),{key:0,class:"va-tabs__pagination","aria-label":m(r)(j.$props.ariaMoveLeftLabel),size:"medium",disabled:M.value,color:t.color,preset:"secondary",icon:j.$props.prevIcon,onClick:O},null,8,["aria-label","disabled","color","icon"])):z("",!0),q("div",{ref_key:"container",ref:l,class:Ae(["va-tabs__container",x.value])},[q("div",{ref_key:"tabs",ref:a,class:"va-tabs__tabs",style:se(_.value)},[q("div",{class:"va-tabs__slider-wrapper","aria-hidden":"true",style:se(T.value)},tX,4),he(m(Ya),{components:w},{default:J(()=>[q("div",nX,[D(j.$slots,"tabs")])]),_:3},8,["components"])],4)],2),p.value&&!j.$props.hidePagination?(A(),te(m(et),{key:1,class:"va-tabs__pagination","aria-label":m(r)(j.$props.ariaMoveRightLabel),size:"medium",color:t.color,disabled:F.value,preset:"secondary",icon:j.$props.nextIcon,onClick:N},null,8,["aria-label","color","disabled","icon"])):z("",!0)],8,ZY),q("div",rX,[D(j.$slots,"default")])],2))}}),iX=me(oX),sX=["tabindex"],lX=["textContent"],aX=ie({name:"VaTab",__name:"VaTab",props:{...cs,...Me,selected:{type:Boolean,default:!1},color:{type:String,default:""},icon:{type:String,default:""},label:{type:String,default:""},disabled:{type:Boolean},name:{type:[String,Number]},tag:{type:String,default:"div"}},emits:["click","keydown-enter","focus"],setup(t,{emit:e}){const n=t,r=e,o=Ne(),i=g(()=>Rt(o.value)),s=W(!1),l=W(!1),a=W(0),u=W(0),{keyboardFocusListeners:c,hasKeyboardFocus:d}=kl(),{tagComputed:f,hrefComputed:h,isActiveRouterLink:p}=gi(n),v=g(()=>({"va-tab--disabled":n.disabled})),{parentDisabled:y,selectTab:b,moveToTab:S,registerTab:w,unregisterTab:x}=Mn(Yx,{parentDisabled:!1,tabsList:[],selectTab:P=>P,moveToTab:P=>P,registerTab:P=>P,unregisterTab:P=>P}),k=g(()=>n.disabled||y?-1:0),{getColor:$}=He(),C=g(()=>$(n.color)),T=g(()=>({color:l.value||s.value?C.value:"inherit"})),_=P=>{l.value=P},M=()=>{var P,V;const O=((P=i.value)==null?void 0:P.offsetLeft)||0,N=((V=i.value)==null?void 0:V.offsetWidth)||0;a.value=O+N,u.value=O},F=()=>{b(E),r("click")},L=()=>{b(E),r("keydown-enter")},H=()=>{d.value&&S(E),r("focus")},E={name:g(()=>n.name),id:null,tabElement:i,isActive:s,tabIndexComputed:k,isActiveRouterLink:p,rightSidePosition:a,leftSidePosition:u,onTabClick:F,onTabKeydown:L,onFocus:H,updateSidePositions:M};return dt(()=>{w(E)}),jt(()=>{x(E)}),(P,V)=>(A(),te(zn(m(f)),{ref_key:"rootElement",ref:o,class:Ae(["va-tab",v.value]),role:"tab","aria-selected":s.value,"aria-disabled":P.$props.disabled||m(y),href:m(h),target:P.target,to:P.to,replace:P.replace,exact:P.exact,"active-class":P.activeClass,"exact-active-class":P.exactActiveClass,style:se(T.value),onMouseenter:V[0]||(V[0]=O=>_(!0)),onMouseleave:V[1]||(V[1]=O=>_(!1))},{default:J(()=>[q("div",ee({class:"va-tab__content",tabindex:k.value,onFocus:H,onClick:F,onKeydown:Ce(L,["enter"])},ur(m(c),!0)),[D(P.$slots,"default",{},()=>[t.icon?(A(),te(m(Ze),{key:0,class:"va-tab__icon",size:"small",name:t.icon},null,8,["name"])):z("",!0),q("span",{class:"va-tab__label",textContent:Be(t.label)},null,8,lX)])],16,sX)]),_:3},40,["aria-selected","aria-disabled","href","target","to","replace","exact","active-class","exact-active-class","class","style"]))}}),uX=me(aX),kg=(t,...e)=>typeof t=="function"?t(...e):t,cX={class:"va-stepper__default-controls"},dX=ie({name:"VaStepperControls",__name:"VaStepperControls",props:{modelValue:{type:[Number,String],required:!0},steps:{type:Array,required:!0},nextDisabled:{type:Boolean,required:!0},stepControls:{type:Object,required:!0},finishButtonHidden:{type:Boolean,default:!1}},setup(t){const e=t,{t:n}=yt(),r=g(()=>{const i=e.steps[Number(e.modelValue)];return kg(i.isLoading)||!1}),o=g(()=>{const i=e.steps.length-1;return Number(e.modelValue)>=i});return(i,s)=>(A(),I("div",cX,[he(m(et),{preset:"primary",disabled:Number(i.$props.modelValue)<=0,loading:r.value,onClick:s[0]||(s[0]=l=>i.$props.stepControls.prevStep())},{default:J(()=>[Ue(Be(m(n)("back")),1)]),_:1},8,["disabled","loading"]),o.value?i.$props.finishButtonHidden?z("",!0):(A(),te(m(et),{key:1,onClick:s[2]||(s[2]=l=>i.$props.stepControls.finish()),loading:r.value},{default:J(()=>[Ue(Be(m(n)("finish")),1)]),_:1},8,["loading"])):(A(),te(m(et),{key:0,onClick:s[1]||(s[1]=l=>i.$props.stepControls.nextStep()),disabled:i.$props.nextDisabled,loading:r.value},{default:J(()=>[Ue(Be(m(n)("next")),1)]),_:1},8,["disabled","loading"]))]))}}),Cs=t=>kg(t.hasError,t)||!1,fX={class:"va-stepper__step-button__icon"},hX=ie({name:"VaStepperStepButton",__name:"VaStepperStepButton",props:{modelValue:{type:Number,required:!0},step:{type:Object,required:!0},color:{type:String,required:!0},stepIndex:{type:[Number,String],required:!0},navigationDisabled:{type:Boolean,required:!0},nextDisabled:{type:Boolean,required:!0},focus:{type:Object,required:!0},stepControls:{type:Object,required:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=Ne(),o=g(()=>Cs(n.step)),i=Ye("stepIndex"),s=g(()=>o.value&&n.modelValue===i.value),l=g(()=>kg(n.step.isLoading)||!1),{getColor:a}=He(),u=g(()=>a(o.value?"danger":n.color)),c=p=>n.nextDisabled&&p>n.modelValue,{t:d}=yt(),f=ct("va-stepper__step-button",()=>({active:n.modelValue>=i.value,disabled:n.step.disabled||c(i.value),"navigation-disabled":n.navigationDisabled,error:s.value}));fe(()=>n.focus,()=>{n.focus.trigger&&Ot(()=>{var p;return(p=r.value)==null?void 0:p.focus()})},{deep:!0});const h=g(()=>({tabindex:n.focus.stepIndex===i.value&&!n.navigationDisabled?0:void 0,"aria-disabled":n.step.disabled||c(i.value)?!0:void 0,"aria-current":n.modelValue===n.stepIndex?d("step"):void 0}));return(p,v)=>(A(),I("li",ee({ref_key:"stepElement",ref:r,class:["va-stepper__step-button",m(f)],onClick:v[0]||(v[0]=y=>!p.$props.navigationDisabled&&p.$props.stepControls.setStep(m(i))),onKeyup:[v[1]||(v[1]=Ce(y=>!p.$props.navigationDisabled&&p.$props.stepControls.setStep(m(i)),["enter"])),v[2]||(v[2]=Ce(y=>!p.$props.navigationDisabled&&p.$props.stepControls.setStep(m(i)),["space"]))]},h.value,{style:`--va-stepper-color: ${String(u.value)}`}),[q("div",fX,[l.value?(A(),te(m(bl),{key:0,color:"currentColor",indeterminate:"",size:"small"})):t.step.icon?(A(),te(m(Ze),{key:1,name:t.step.icon,size:"1.3rem"},null,8,["name"])):(A(),I(_e,{key:2},[Ue(Be(m(i)+1),1)],64))]),Ue(" "+Be(t.step.label),1)],16))}}),pX={class:"va-stepper__step-content"},mX={class:"va-stepper__controls"},gX=ie({name:"VaStepper",__name:"VaStepper",props:{...Kt,modelValue:{type:Number,default:0},steps:{type:Array,default:()=>[],required:!0},color:{type:String,default:"primary"},vertical:{type:Boolean,default:!1},navigationDisabled:{type:Boolean,default:!1},controlsHidden:{type:Boolean,default:!1},nextDisabled:{type:Boolean,default:!1},nextDisabledOnError:{type:Boolean,default:!1},finishButtonHidden:{type:Boolean,default:!1},ariaLabel:{type:String,default:"$t:progress"},linear:{type:Boolean,default:!1},finishStep:{type:Object}},emits:["update:modelValue","finish","update:steps"],setup(t,{expose:e,emit:n}){const r=t,o=n,i=Ne(),{valueComputed:s}=xt(r,o,"modelValue"),l=g(()=>r.finishStep?[...r.steps,r.finishStep]:r.steps),a=P=>r.finishStep?P===l.value.length-1:!1,u=W({trigger:!1,stepIndex:r.navigationDisabled?-1:r.modelValue}),{getColor:c}=He(),d=P=>r.nextDisabledOnError&&Cs(l.value[P])?!0:r.nextDisabled,f=(P,V)=>{for(;P>=0&&P{for(;P>=0&&P{var V;const O=l.value[P],N=l.value[s.value],re=f(P,-1);if(O.disabled)return!1;if(r.linear&&P{await p(P)&&(s.value=P)},y=P=>{r.navigationDisabled||(P==="next"?b(1):S(1))},b=(P=1)=>{const V=u.value.stepIndex+P;if(!d(V)){if(V{const V=u.value.stepIndex-P;if(V>=0){if(l.value[V].disabled){S(P+1);return}u.value.stepIndex=V,u.value.trigger=!0}else for(let O=l.value.length-1;O>=0;O--)if(!l.value[O].disabled&&!d(O)){u.value.stepIndex=O,u.value.trigger=!0;break}},w=()=>{requestAnimationFrame(()=>{var P;(P=i.value)!=null&&P.contains(document.activeElement)||(u.value.stepIndex=r.modelValue,u.value.trigger=!1)})};fe(()=>r.modelValue,()=>{u.value.stepIndex=r.modelValue,u.value.trigger=!1});const x=(P=0)=>{const V=s.value+1+P;l.value[V]&&(l.value[V].disabled&&x(P+1),v(V))},k=(P=0)=>{const V=s.value-1-P;l.value[V]&&(l.value[V].disabled&&k(P+1),v(V))},C={setStep:v,nextStep:x,prevStep:k,finish:async()=>{await p(r.steps.length-1)&&o("finish")}},T=(P,V)=>({...C,focus:u,isActive:r.modelValue===V,isCompleted:r.modelValue>V,isLastStep:l.value.length-1===V,isNextStepDisabled:d(V),isPrevStepDisabled:V===0,index:V,step:P,hasError:Cs(P)}),{tp:_}=yt(),M=()=>{u.value.stepIndex=r.modelValue,u.value.trigger=!0},F=g(()=>({role:"group","aria-label":_(r.ariaLabel),"aria-orientation":r.vertical?"vertical":"horizontal"}));function L(P){return Cs(l.value[P])?"danger":c(r.color)}return e({modelValue:s,focusedStep:u,getIterableSlotData:T,stepControls:C,nextStep:x,prevStep:k,setStep:v,setFocus:y,completeStep:P=>{const V={...l.value};P===!0&&(V[r.modelValue].hasError=!1),V[r.modelValue].completed=P??!0,o("update:steps",V)},setError:P=>{const V={...l.value};V[r.modelValue].hasError=P??!0,V[r.modelValue].completed=!P,o("update:steps",V)}}),(P,V)=>(A(),I("div",ee({class:["va-stepper",{"va-stepper--vertical":P.$props.vertical}]},F.value),[q("ol",{class:Ae(["va-stepper__navigation",{"va-stepper__navigation--vertical":P.$props.vertical}]),ref_key:"stepperNavigation",ref:i,onClick:M,onKeyup:[Ce(M,["enter"]),Ce(M,["space"]),V[0]||(V[0]=Ce(O=>y("prev"),["left"])),V[1]||(V[1]=Ce(O=>y("next"),["right"]))],onFocusout:w},[(A(!0),I(_e,null,Ge(l.value,(O,N)=>(A(),I(_e,{key:N+O.label},[a(N)?z("",!0):(A(),I(_e,{key:0},[N>0?D(P.$slots,"divider",de(ee({key:0},T(O,N))),()=>[q("span",{class:Ae(["va-stepper__divider",{"va-stepper__divider--vertical":P.$props.vertical}]),"aria-hidden":"true"},null,2)]):z("",!0),D(P.$slots,`step-button-${N}`,de(we(T(O,N))),()=>[he(hX,{stepIndex:N,color:L(N),modelValue:m(s),nextDisabled:t.nextDisabled,step:O,stepControls:C,navigationDisabled:t.navigationDisabled,focus:u.value},null,8,["stepIndex","color","modelValue","nextDisabled","step","navigationDisabled","focus"])])],64))],64))),128))],34),q("div",{class:Ae(["va-stepper__step-content-wrapper",{"va-stepper__step-content-wrapper--vertical":P.$props.vertical}])},[q("div",pX,[D(P.$slots,`step-content-${a(m(s))?"finish":m(s)}`,de(we(T(l.value[m(s)],m(s)))))]),q("div",mX,[D(P.$slots,"controls",de(we(T(l.value[m(s)],m(s)))),()=>[t.controlsHidden?z("",!0):(A(),te(dX,{key:0,modelValue:m(s),nextDisabled:d(m(s)),steps:l.value,stepControls:C,finishButtonHidden:t.finishButtonHidden},null,8,["modelValue","nextDisabled","steps","finishButtonHidden"]))])])],2)],16))}}),vX=me(gX),yX=t=>{const e=t.match(/[0-9]{1,2}/g);return e?e.map(n=>Number(n)):[]},bX=t=>{const e=t.match(/pm|am/i);return e?+(e[0].toLowerCase()==="pm"):null},SX=t=>{const e=new Date,[n,r,o]=yX(t),i=bX(t);if(!n)return null;const s=i!==null&&n<=12,l=s&&!!i,a=s&&n===12?0:n;return e.setHours(Math.min(a||0,s?12:24)+(l?12:0)),e.setMinutes(Math.min(r||0,60)),e.setSeconds(Math.min(o||0,60)),e},CX=t=>{const e=()=>t.parse||SX,n=W(!0),r=i=>{const l=e()(i);return l||(n.value=!1),l};return{parse:i=>(n.value=!0,r(i)),isValid:n}},wX=t=>{const e=o=>o?t.ampm?o.toLocaleTimeString("en-US"):o.toLocaleTimeString("en-GB"):"",n=(o,i,s)=>o.split(":").slice(i,s).join(":"),r=o=>{if(t.view==="seconds")return e(o);const[i,s]=e(o).split(" ");return t.view==="minutes"?s?[n(i,0,2),s].join(" "):n(i,0,2):t.view==="hours"?s?[n(i,0,1),s].join(" "):n(i,0,1):""};return{format:o=>t.format?t.format(o):r(o)}},Qs=t=>t.value?t.value:new Date(new Date().setHours(0,0,0,0)),xg=t=>Array.from(Array(t).keys()),h0=t=>(t===0?12:t)-+(t>12)*12,kX=(t,e=!1)=>(t===12?0:t)+Number(e)*12,xX=(t,e,n)=>{const r=g(()=>t.ampm?12:24),o=g(()=>{let s=xg(r.value);return t.hoursFilter&&(s=s.filter(l=>t.hoursFilter(t.ampm?l+12*Number(n.value):l))),s.map(l=>t.ampm?h0(l):l)}),i=g({get:()=>{if(!e.value)return-1;if(t.ampm){const l=h0(e.value.getHours()-12*Number(n.value));return o.value.findIndex(a=>a===l)}const s=e.value.getHours();return o.value.findIndex(l=>l===s)},set:s=>{if(t.readonly)return;const l=t.ampm?kX(o.value[s],n.value):o.value[s];e.value=new Date(Qs(e).setHours(l))}});return g(()=>({items:o.value,activeItem:i}))},$X=(t,e)=>{const n=g(()=>{const o=xg(60);return t.minutesFilter?o.filter(t.minutesFilter):o}),r=g({get:()=>{if(!e.value)return-1;const o=e.value.getMinutes();return n.value.findIndex(i=>i===o)},set:o=>{if(t.readonly)return;const i=n.value[o];e.value=new Date(Qs(e).setMinutes(i))}});return g(()=>({items:n.value,activeItem:r}))},AX=(t,e)=>{const n=g(()=>{const o=xg(60);return t.secondsFilter?o.filter(t.secondsFilter):o}),r=g({get:()=>{if(!e.value)return-1;const o=e.value.getSeconds();return n.value.findIndex(i=>i===o)},set:o=>{if(t.readonly)return;const i=n.value[o];e.value=new Date(Qs(e).setSeconds(i))}});return g(()=>({items:n.value,activeItem:r}))},TX=(t,e,n)=>g(()=>({items:["AM","PM"],activeItem:g({get:()=>e.value?Number(n.value):-1,set:r=>{n.value=!!r;const o=Qs(e).getHours();let i=n.value?o+12:o;n.value&&o<=12&&(i=o+12),!n.value&&o>=12&&(i=o-12);const s=!t.hoursFilter||t.hoursFilter(i);t.periodUpdatesModelValue&&s&&(e.value=new Date(Qs(e).setHours(i)))}})})),_X=(t,e)=>{const{view:n}=Or(t),r=W(!1);fe(e,()=>{r.value=Qs(e).getHours()>=12},{immediate:!0});const o=xX(t,e,r),i=$X(t,e),s=AX(t,e),l=TX(t,e,r);return{columns:g(()=>{const u=[];return n.value==="hours"?u.push(o.value):n.value==="minutes"?u.push(o.value,i.value):n.value==="seconds"&&u.push(o.value,i.value,s.value),t.ampm&&!t.hidePeriodSwitch&&u.push(l.value),u}),isPM:r}},OX=ie({name:"VaTimePickerColumnCell",__name:"VaTimePickerColumnCell",setup(t){const{isHovered:e,onMouseEnter:n,onMouseLeave:r}=Ja(),{getTextColor:o,getColor:i}=He(),s=g(()=>e.value?{color:i(o(i("background-secondary"))),background:i("background-secondary")}:void 0);return(l,a)=>(A(),I("div",{onMouseenter:a[0]||(a[0]=(...u)=>m(n)&&m(n)(...u)),onMouseleave:a[1]||(a[1]=(...u)=>m(r)&&m(r)(...u)),style:se(s.value)},[D(l.$slots,"default")],36))}}),PX=["onClick"],BX=ie({name:"VaTimePickerColumn",__name:"VaTimePickerColumn",props:{items:{type:Array,default:()=>[]},activeItemIndex:{type:Number,default:0},cellHeight:{type:[Number,String],default:30}},emits:["item-selected","update:activeItemIndex",...Xd],setup(t,{expose:e,emit:n}){const r=t,o=n,i=Ne(),{focus:s,blur:l}=ko(i,o),[a]=qi("activeItemIndex",r,o),u=Ye("cellHeight");fe(a,b=>{c(b)}),dt(()=>c(a.value,!1));const c=(b,S=!0)=>{Ot(()=>{var w,x;(x=(w=i.value)==null?void 0:w.scrollTo)==null||x.call(w,{behavior:S?"smooth":"auto",top:b*u.value})})},d=b=>{a.value=(a.value+(b||1))%r.items.length,Ot(()=>c(a.value))},f=b=>{a.value=(a.value-1+r.items.length)%r.items.length,Ot(()=>c(a.value))},h=b=>{a.value=b},p=b=>Number.isInteger(b)?Number(b)<10?`0${b}`:`${b}`:b,v=()=>{const b=i.value.scrollTop,S=Math.max((b-b%u.value)/u.value,b/u.value);return S>=r.items.length?r.items.length-1:S<0?0:a.value*u.valueb?Math.floor(S):Math.round(S)},y=zm(()=>{i.value&&a.value!==-1&&(a.value=v())},200);return e({focus:s,blur:l}),(b,S)=>(A(),I("div",{ref_key:"rootElement",ref:i,tabindex:"0",class:"va-time-picker-column",onKeydown:[S[0]||(S[0]=Ce(be(w=>d(),["stop","prevent"]),["down"])),S[1]||(S[1]=Ce(be(w=>d(5),["stop","prevent"]),["space"])),S[2]||(S[2]=Ce(be(w=>f(),["stop","prevent"]),["up"]))]},[(A(!0),I(_e,null,Ge(t.items,(w,x)=>(A(),te(OX,{key:w,onScrollPassive:m(y),onTouchmovePassive:m(y),onMousewheelPassive:m(y)},{default:J(()=>[q("div",{class:Ae(["va-time-picker-cell",{"va-time-picker-cell--active":x===b.$props.activeItemIndex}]),onClick:k=>h(x)},[D(b.$slots,"cell",de(we({item:w,index:x,activeItemIndex:t.activeItemIndex,items:t.items,formattedItem:p(w)})),()=>[Ue(Be(p(w)),1)])],10,PX)]),_:2},1032,["onScrollPassive","onTouchmovePassive","onMousewheelPassive"]))),128))],544))}}),MX=me(BX),IX=(t,e)=>g(()=>Object.entries(e()).reduce((n,[r,o])=>(n[`--${t}-${ka(r)}`]=o,n),{})),pc=ie({name:"VaTimePicker",__name:"VaTimePicker",props:{...Kt,...vi,...Me,modelValue:{type:Date,required:!1},ampm:{type:Boolean,default:!1},hidePeriodSwitch:{type:Boolean,default:!1},periodUpdatesModelValue:{type:Boolean,default:!0},view:{type:String,default:"minutes"},hoursFilter:{type:Function},minutesFilter:{type:Function},secondsFilter:{type:Function},framed:{type:Boolean,default:!1},cellHeight:{type:[Number,String],default:30},visibleCellsCount:{type:[Number,String],default:7}},emits:[...un],setup(t,{expose:e,emit:n}){const r=t,o=n,{valueComputed:i}=xt(r,o),{columns:s,isPM:l}=_X(r,i),a=Ye("cellHeight"),u=Ye("visibleCellsCount"),{setItemRef:c,itemRefs:d}=af(),f=W(),h=(x=0)=>{var k;(k=d.value[x])==null||k.focus()},p=x=>{var k;x?(k=d.value[x])==null||k.blur():d.value.forEach($=>$==null?void 0:$.blur())},{computedClasses:v}=mx("va-time-picker",r),y=()=>{const x=((f==null?void 0:f.value)||0)+1;f.value=x%s.value.length,h(f.value)},b=()=>{const x=((f==null?void 0:f.value)||0)-1+s.value.length;f.value=x%s.value.length,h(f.value)},S=g(()=>({...v,"va-time-picker--framed":r.framed})),w=IX("va-time-picker",()=>{const x=(u.value-1)/2*a.value;return{height:`${a.value*u.value}px`,"cell-height":`${a.value}px`,"column-gap-height":`${x}px`}});return e({focus:h,blur:p,focusNext:y,focusPrev:b}),(x,k)=>(A(),I("div",{class:Ae(["va-time-picker",S.value]),style:se(m(w))},[(A(!0),I(_e,null,Ge(m(s),($,C)=>(A(),te(m(MX),{key:C,ref_for:!0,ref:m(c),items:$.items,tabindex:x.disabled?-1:0,"cell-height":m(a),activeItemIndex:$.activeItem.value,"onUpdate:activeItemIndex":T=>$.activeItem.value=T,onKeydown:[k[0]||(k[0]=Ce(be(T=>y(),["stop","prevent"]),["right"])),k[1]||(k[1]=Ce(be(T=>y(),["exact","stop","prevent"]),["tab"])),k[2]||(k[2]=Ce(be(T=>b(),["stop","prevent"]),["left"])),k[3]||(k[3]=Ce(be(T=>b(),["shift","stop","prevent"]),["tab"]))],onFocus:T=>f.value=C},null,8,["items","tabindex","cell-height","activeItemIndex","onUpdate:activeItemIndex","onFocus"]))),128))],6))}});function DX(t,e){let n=-1,r=-1;const o=l=>{var a;(a=e.onStart)==null||a.call(e,l),clearTimeout(n),n=setTimeout(()=>{r=setInterval(()=>{var u;return(u=e.onUpdate)==null?void 0:u.call(e,l)},e.interval||100)},m(e.delay)||500)},i=l=>{var a;clearTimeout(n),clearInterval(r),(a=e.onEnd)==null||a.call(e,l)},s=Sl(t);At(["keydown"],o,s),At(["keyup","blur"],i,!0)}const p0=nt(Wn,["focused","maxLength","counterValue"]),EX=ie({name:"VaTimeInput",inheritAttrs:!1,__name:"VaTimeInput",props:{...p0,...Cr,...Me,...ru,...nt(pc),...Co,...Kt,closeOnContentClick:{type:Boolean,default:!1},offset:{...Cr.offset,default:()=>[2,0]},placement:{...Cr.placement,default:"bottom-end"},modelValue:{type:Date,default:void 0},clearValue:{type:Date,default:null},format:{type:Function},parse:{type:Function},manualInput:{type:Boolean,default:!1},leftIcon:{type:Boolean,default:!1},icon:{type:String,default:"schedule"},ariaLabel:{type:String,default:"$t:selectedTime"},ariaResetLabel:{type:String,default:"$t:resetTime"},ariaToggleDropdownLabel:{type:String,default:"$t:toggleDropdown"}},emits:[...Xd,...mi,...tf,...un,...Cg,"update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,o=n,i=Ne(),s=Ne(),{isOpenSync:l,dropdownProps:a}=wg(r,o,{defaultCloseOnValueUpdate:g(()=>Array.isArray(r.view)&&r.view.length===1)}),{valueComputed:u}=xt(r,o),{parse:c,isValid:d}=CX(r),{format:f}=wX(r),h=g(()=>f(u.value||r.clearValue)),p=g({get(){return r.disabled||r.readonly?!1:l.value},set(K){l.value=K,Ot(K?()=>{var U;return(U=s.value)==null?void 0:U.focus()}:()=>{var U;return(U=i.value)==null?void 0:U.focus()})}}),{isFocused:v,focus:y,blur:b,onFocus:S,onBlur:w}=ko(i),x=K=>{var U;if(r.disabled)return;const Y=(U=K.target)==null?void 0:U.value;if(!Y)return k();const oe=c(Y);d.value&&oe?u.value=oe:(u.value=void 0,d.value=!0)},k=()=>M(()=>{o("update:modelValue",r.clearValue),o("clear"),F(),Se()}),{computedError:$,computedErrorMessages:C,listeners:T,validationAriaAttributes:_,withoutValidation:M,resetValidation:F,isDirty:L,isTouched:H}=wo(r,o,{reset:k,focus:y,value:u});fe(p,K=>{K||(H.value=!0)});const{canBeCleared:E,clearIconProps:P,onFocus:V,onBlur:O}=nf(r,h),N=g(()=>E.value&&h.value!==f(r.clearValue)),re=gt(p0),X=g(()=>({...re.value,focused:v.value,error:$.value,errorMessages:C.value,readonly:r.readonly||!r.manualInput,modelValue:h.value})),ke={seconds:1e3,minutes:1e3*60,hours:1e3*60*60},$e=K=>{"key"in K&&(K.key==="ArrowDown"&&(u.value=new Date(Number(u.value)-ke[r.view]),K.preventDefault()),K.key==="ArrowUp"&&(u.value=new Date(Number(u.value)+ke[r.view]),K.preventDefault()))};DX(i,{onStart:$e,onUpdate:$e});const ye={onFocus:()=>{r.disabled||(S(),!r.readonly&&V())},onBlur:()=>{r.disabled||(w(),!r.readonly&&(O(),T.onBlur()))}},j=Ln(),ce=g(()=>{const K=[r.leftIcon&&"prependInner",(!r.leftIcon||r.clearable)&&"icon"];return Object.keys(j).filter(U=>!K.includes(U))}),Se=()=>{p.value=!1},ne=(K,U,Y)=>{p.value=!0},Z=K=>l.value?!1:r.disabled||r.readonly?!0:K===void 0?!1:r.manualInput&&(K==null?void 0:K.code)!=="Space",Ve=K=>{Z(K instanceof KeyboardEvent?K:void 0)||(p.value=!p.value)},Pe=g(()=>r.disabled?{}:r.manualInput?{cursor:"text"}:{cursor:"pointer"}),qe=g(()=>r.manualInput?r.disabled||r.readonly?-1:0:-1),bt=g(()=>({role:"button","aria-hidden":!1,name:r.icon,color:"secondary",tabindex:qe.value})),{tp:B}=yt();os();const R=g(()=>({...a.value,innerAnchorSelector:".va-input-wrapper__field",trigger:["click","right-click","space","enter"]})),Q=gt(nt(pc));return e({isFocused:v,isValid:d,value:u,isDirty:L,isTouched:H,focus:y,blur:b,reset:k,withoutValidation:M,resetValidation:F,toggleDropdown:Ve,showDropdown:ne,hideDropdown:Se}),(K,U)=>(A(),te(m(er),ee({modelValue:p.value,"onUpdate:modelValue":U[1]||(U[1]=Y=>p.value=Y),class:["va-time-input",K.$attrs.class],style:K.$attrs.style},R.value),{anchor:J(()=>[he(m(Wn),ee({class:"va-time-input__anchor",ref_key:"input",ref:i,style:Pe.value},{...X.value,...m(_),...ye},{onChange:x}),vn({icon:J(()=>[N.value?(A(),te(m(Ze),ee({key:0,class:"va-time-input__clear-button"},{...bt.value,...m(P)},{"aria-label":m(B)(K.$props.ariaResetLabel),onClick:be(k,["stop"]),onKeydown:[Ce(be(k,["stop"]),["enter"]),Ce(be(k,["stop"]),["space"])]}),null,16,["aria-label","onKeydown"])):z("",!0),!K.$props.leftIcon&&K.$props.icon?(A(),te(m(Ze),ee({key:1,class:"va-time-input__right-button va-time-input__side-button","aria-label":m(B)(K.$props.ariaToggleDropdownLabel)},bt.value),null,16,["aria-label"])):z("",!0)]),_:2},[Ge(ce.value,Y=>({name:Y,fn:J(oe=>[D(K.$slots,Y,de(we({...oe,toggleDropdown:Ve,showDropdown:ne,hideDropdown:Se,isOpen:m(l),focus:m(y)})))])})),K.$slots.prependInner||K.$props.leftIcon?{name:"prependInner",fn:J(Y=>[D(K.$slots,"prependInner",de(we({...Y,toggleDropdown:Ve,showDropdown:ne,hideDropdown:Se,isOpen:m(l),focus:m(y)}))),K.$props.leftIcon?(A(),te(m(Ze),ee({key:0,class:"va-time-input__left-button va-time-input__side-button","aria-label":m(B)(K.$props.ariaToggleDropdownLabel)},bt.value),null,16,["aria-label"])):z("",!0)]),key:"0"}:void 0]),1040,["style"])]),default:J(()=>[he(m(Xi),{"no-padding":"",onKeydown:[Ce(be(Se,["prevent"]),["esc"]),Ce(be(Se,["prevent"]),["enter"])]},{default:J(()=>[he(pc,ee({ref_key:"timePicker",ref:s},m(Q),{modelValue:m(u),"onUpdate:modelValue":U[0]||(U[0]=Y=>Tt(u)?u.value=Y:null)}),null,16,["modelValue"])]),_:1},8,["onKeydown"])]),_:3},16,["modelValue","class","style"]))}}),LX=me(EX),m0=t=>t==null?void 0:t.props,g0=t=>{var e;return!!((e=t==null?void 0:t.props)!=null&&e.active)||!1},VX=t=>t.type===_e,RX=t=>t&&t.length===0;function FX(t){var e;const n=(e=t.default)==null?void 0:e.call(t);return!n||RX(n)?[]:VX(n[0])?n[0].children:n}const NX=t=>{const e=FX(t.slots);return e.forEach((n,r)=>{m0(n)||(n.props={});const o=m0(n);o.vertical=t.props.vertical,t.props.centered&&(o.inverted=!!(r%2)),r===0&&(o.isFirst=!0),r===e.length-1&&(o.isLast=!0);const i=o.active;if(!i)return;r===0&&(o.activePrevious=i),r===e.length-1&&(o.activeNext=i),g0(e[r-1])&&(o.activePrevious=!0),g0(e[r+1])&&(o.activeNext=!0)}),e},Eu="va-timeline",HX={name:Eu,props:{...Me,vertical:{type:Boolean},centered:{type:Boolean},alignTop:{type:Boolean}},setup(t,{slots:e}){return()=>ut("div",{class:{[Eu]:!0,[`${Eu}--vertical`]:t.vertical,[`${Eu}--align-top`]:t.alignTop}},NX({props:t,slots:e}))}},zX=me(HX),ro="va-timeline-separator",jX=ie({name:ro,props:{...Me,color:{type:String,default:"primary"},vertical:{type:Boolean},active:{type:Boolean},activePrevious:{type:Boolean},activeNext:{type:Boolean}},setup(t){const{getColor:e}=He();return()=>ut("div",{class:{[ro]:!0,[`${ro}--vertical`]:t.vertical}},[ut("div",{class:{[`${ro}__line`]:!0,[`${ro}__line--active`]:t.activePrevious},style:{backgroundColor:e(t.activePrevious?t.color:"divider")}}),ut("div",{class:{[`${ro}__center`]:!0,[`${ro}__center--active`]:t.active},style:{backgroundColor:e(t.active?t.color:"divider")}}),ut("div",{class:{[`${ro}__line`]:!0,[`${ro}__line--active`]:t.activeNext},style:{backgroundColor:e(t.activeNext?t.color:"divider")}})])}}),Xx=me(jX),$i="va-timeline-item",v0=nt(Xx),WX=ie({name:$i,props:{...Me,...v0,color:{type:String,default:"primary"},isFirst:{type:Boolean},isLast:{type:Boolean},inverted:{type:Boolean}},setup(t,{slots:e}){const n=[ut(Xx,{...gt(v0).value})],r=t.inverted?e.after:e.before;r&&n.unshift(ut("div",{class:`${$i}__before`},r()));const o=t.inverted?e.before:e.after;return o&&n.push(ut("div",{class:`${$i}__after`},o())),()=>ut("div",{class:[{[$i]:!0},{[`${$i}--vertical`]:t.vertical},{[`${$i}--is-first`]:t.isFirst},{[`${$i}--is-last`]:t.isLast}]},n)}}),UX=me(WX),KX=me(pc),GX={nodes:{type:Array,default:[]},stateful:{type:Boolean,default:!0},selectable:{type:Boolean,default:!1},selectionType:{type:String,default:"leaf",validator:t=>["leaf","independent"].includes(t)},valueBy:{type:[String,Function],default:"id"},textBy:{type:[String,Function],default:"label"},trackBy:{type:[String,Function],default:"id"},iconBy:{type:[String,Function],default:"icon"},disabledBy:{type:[String,Function],default:"disabled"},expandedBy:{type:[String,Function],default:"expanded"},checkedBy:{type:[String,Function],default:"checked"},childrenBy:{type:[String,Function],default:"children"},expandAll:{type:Boolean,default:!1},expanded:{type:Array,default:[]},expandNodeBy:{type:String,default:"leaf"},filter:{type:String,default:""},filterMethod:{type:Function,default:void 0},checked:{type:Array,default:[]},color:{type:String,default:"primary"}},qX=["update:modelValue","update:checked","update:expanded","update:selected"],YX=t=>{const e=f=>{const h=typeof f;return h==="string"||h==="number"},n=(f,h)=>!h||e(f)?f:ux(f,h),r=f=>n(f,t.valueBy),o=f=>t.valueBy&&t.nodes.find(h=>f===r(h))||f,i=f=>n(f,t.textBy),s=f=>n(f,t.checkedBy),l=f=>n(f,t.disabledBy),a=f=>n(f,t.expandedBy),u=f=>n(f,t.trackBy),c=f=>n(f,t.childrenBy)??[],d=(f,h)=>{f.forEach(p=>{const v=p.children||[];v.length&&d(v,h),h(p)})};return{getText:i,getValue:r,getChecked:s,getTrackBy:u,getChildren:c,getDisabled:l,getExpanded:a,iterateNodes:d,getNodeByValue:o,getNodeProperty:n}},Jx=Symbol("TreeView"),XX=(t,e)=>{const{emit:n,toggleNode:r,toggleCheckbox:o}=e,i=y=>(y==null?void 0:y.getAttribute("aria-expanded"))==="true",s=y=>{var b;return((b=y==null?void 0:y.parentElement)==null?void 0:b.closest(".va-tree-node"))||null},l=y=>y==null?void 0:y.previousElementSibling,a=y=>{if(!y)return null;let b=l(y),S=i(b)&&f(b);if(S)do if(i(S)){if(S=f(S),S)continue;break}else{b=S;break}while(!0);return b||s(y)},u=y=>y==null?void 0:y.nextElementSibling,c=y=>{if(!y)return null;let b=u(y);const S=i(y);if(!b){let w=s(y);do if(u(w)){b=u(w);break}else{if(w=s(w),w)continue;break}while(!0)}return S?d(y):b},d=y=>{var b;return((b=y==null?void 0:y.querySelector(".va-tree-node-children"))==null?void 0:b.firstElementChild)||null},f=y=>{var b;return((b=y==null?void 0:y.querySelector(".va-tree-node-children"))==null?void 0:b.lastElementChild)||null},h=(y,b,S)=>{var w,x;const k=i(y);b==="left"?k?r(S):(w=s(y))==null||w.focus():k?(x=d(y))==null||x.focus():r(S)},p=(y,b)=>{var S,w;b==="up"?(S=a(y))==null||S.focus():(w=c(y))==null||w.focus()};return{handleKeyboardNavigation:(y,b)=>{const S=y.target;switch(y.code){case"ArrowUp":p(S,"up");break;case"ArrowRight":h(S,"right",b);break;case"ArrowDown":p(S,"down");break;case"ArrowLeft":h(S,"left",b);break;case"Space":if(t.selectable){const w=typeof b.checked<"u"?!b.checked:null;o(b,w)}else n("update:selected",b);break;case"Escape":t.selectable||n("update:selected",null),S.blur();break;default:S.blur()}}}},JX=XX,QX=(t,e)=>{const{getColor:n}=He(),r=g(()=>n(t.color)),o=g(()=>t.selectionType==="leaf"),{getText:i,getValue:s,getChecked:l,getTrackBy:a,getChildren:u,getDisabled:c,getExpanded:d,iterateNodes:f,getNodeProperty:h}=YX(t),{nodes:p,expandAll:v,filter:y,filterMethod:b,textBy:S}=Or(t),{valueComputed:w}=xt(t,e,"expanded"),{valueComputed:x}=xt(t,e,"checked"),k=W(),$=g({get:()=>k.value,set:O=>{const N=s(O);k.value!==N&&(k.value=N,e("update:selected",O))}}),C=(O,N,re)=>{re?O.value=O.value.concat(N).filter((X,ke,$e)=>$e.indexOf(X)===ke):O.value=O.value.filter(X=>!N.includes(X))},T=(O,N)=>{let re=N===null?!0:N;N&&O.indeterminate&&(re=!1);const X=[s(O)];if(o.value&&O.hasChildren){const ke=$e=>{$e.forEach(ye=>{if(ye.disabled)return;const j=u(ye);j.length&&ke(j),X.push(s(ye))})};ke(u(O))}C(x,X,re)},_=O=>{O.hasChildren&&C(w,[s(O)],!O.expanded)},M=({node:O,level:N,children:re=[],computedFilterMethod:X})=>{var ke;const $e=s(O);let ye=!0;const j=!!re.length,ce=c(O)||!1;let Se=!1,ne=x.value.includes($e)||!1;if(o.value&&j){const Z=re.every(Ve=>Ve.checked);ne=Z,Se=!Z&&re.some(Ve=>Ve.indeterminate||Ve.checked),Se&&(ne=null)}return y.value&&(ye=(re==null?void 0:re.some(Z=>Z.matchesFilter))||((ke=X.value)==null?void 0:ke.call(X,O,y.value,S.value))),{...O,level:N,checked:ne,children:re,disabled:ce,expanded:w.value.includes($e)||!1,hasChildren:j,matchesFilter:ye,indeterminate:Se}},F=g(()=>b!=null&&b.value?b.value:(O,N)=>i(O).toLowerCase().includes(N.toLowerCase())),L=(O,N=0)=>O.map(re=>{const X=u(re);if(X.length){const ke=L(X,N+1);return M({node:re,level:N,children:ke,computedFilterMethod:F})}return M({node:re,level:N,computedFilterMethod:F})}),H=O=>O.filter(N=>(N.children&&(N.children=H(N.children)),N.children.length===0&&(N.hasChildren=!1),N.matchesFilter)),{handleKeyboardNavigation:E}=JX(t,{emit:e,toggleCheckbox:T,toggleNode:_});Pr(Jx,{selectedNodeComputed:$,colorComputed:r,iconBy:t.iconBy,selectable:t.selectable,expandNodeBy:t.expandNodeBy,getText:i,getValue:s,getTrackBy:a,toggleNode:_,toggleCheckbox:T,getNodeProperty:h,handleKeyboardNavigation:E});const P=g(()=>L(p.value));return(()=>{const O=[],N=[];f(p.value,re=>{(v.value||d(re))&&O.push(s(re)),l(re)&&N.push(s(re))}),O.length&&C(w,O,!0),N.length&&C(x,N,!0)})(),{treeItems:g(()=>H(P.value)),getText:i,getTrackBy:a,toggleCheckbox:T}},ZX=QX,eJ=["role","aria-expanded","aria-disabled","aria-checked","tabindex"],tJ={class:"va-tree-node-root"},nJ={key:2,class:"va-tree-node-content__item"},rJ=["aria-hidden"],oJ="The VaTreeNode component should be used in the context of VaTreeView component",iJ=ie({name:"VaTreeNode",__name:"VaTreeNode",props:{node:{type:Object,required:!0}},setup(t){const e=t,{iconBy:n,selectable:r,expandNodeBy:o,colorComputed:i,selectedNodeComputed:s,getText:l,getTrackBy:a,toggleNode:u,toggleCheckbox:c,getNodeProperty:d,handleKeyboardNavigation:f}=iu(Jx,oJ),h=g(()=>l(e.node)||""),p=g(()=>e.node.hasChildren?!!e.node.expanded:void 0),v=g(()=>d(e.node,n)),y=g(()=>e.node.hasChildren?"group":"treeitem"),b=ct("va-tree-node",()=>({disabled:!!e.node.disabled,checked:!!e.node.checked,hasChildren:!!e.node.hasChildren,[`level-${e.node.level}`]:!0,[`expand-by-${o}`]:!0})),S=ct("va-tree-node-children",()=>({expanded:!!p.value})),w=ct("va-tree-node-content",()=>({indent:e.node.hasChildren===!1})),x=ct("va-tree-node-content",()=>({clickable:e.node.hasChildren===!0&&o==="node"})),k=g(()=>e.node.disabled?-1:0),$=C=>{o===(o==="node"&&C==="leaf"?"node":C)&&u(e.node),s.value=e.node};return(C,T)=>{const _=so("va-tree-node",!0);return A(),I("div",{class:Ae(["va-tree-node",m(b)]),role:y.value,"aria-expanded":p.value,"aria-disabled":C.$props.node.disabled,"aria-checked":!!C.$props.node.checked,tabindex:k.value,onKeydown:[T[4]||(T[4]=Ce(be(M=>m(f)(M,C.$props.node),["stop","prevent"]),["up"])),T[5]||(T[5]=Ce(be(M=>m(f)(M,C.$props.node),["stop","prevent"]),["right"])),T[6]||(T[6]=Ce(be(M=>m(f)(M,C.$props.node),["stop","prevent"]),["down"])),T[7]||(T[7]=Ce(be(M=>m(f)(M,C.$props.node),["stop","prevent"]),["left"])),T[8]||(T[8]=Ce(be(M=>m(f)(M,C.$props.node),["stop","prevent"]),["space"])),T[9]||(T[9]=Ce(be(M=>m(f)(M,C.$props.node),["stop","prevent"]),["esc"]))]},[q("div",tJ,[q("div",{class:Ae(["va-tree-node-content",m(w)]),onClick:T[3]||(T[3]=M=>$("node"))},[C.$props.node.hasChildren?(A(),I("div",{key:0,class:"va-tree-node-content__item va-tree-node-content__item--leaf",onClick:T[0]||(T[0]=be(M=>$("leaf"),["stop"]))},[D(C.$slots,"icon-toggle",de(we(C.$props.node)),()=>[he(m(Ze),{name:p.value?"keyboard_arrow_down":"keyboard_arrow_right",size:"20px"},null,8,["name"])])])):z("",!0),m(r)?(A(),I("div",{key:1,class:"va-tree-node-content__item",onClick:T[2]||(T[2]=be(()=>{},["stop"]))},[D(C.$slots,"checkbox",de(we(C.$props.node)),()=>[he(m(nu),{"model-value":C.$props.node.checked,color:m(i),indeterminate:"","onUpdate:modelValue":T[1]||(T[1]=M=>m(c)(C.$props.node,M)),class:"va-tree-node__checkbox"},null,8,["model-value","color"])])])):z("",!0),v.value?(A(),I("div",nJ,[D(C.$slots,"icon",de(we(C.$props.node)),()=>[he(m(Ze),{name:v.value,size:"small"},null,8,["name"])])])):z("",!0),q("div",{class:Ae(["va-tree-node-content__body",m(x)])},[D(C.$slots,"content",de(we(C.$props.node)),()=>[Ue(Be(h.value),1)])],2)],2)]),xr(q("div",{"aria-hidden":!C.$props.node.expanded,class:Ae(["va-tree-node-children",m(S)])},[(A(!0),I(_e,null,Ge(C.$props.node.children,M=>(A(),te(_,{key:m(a)(M),node:M},vn({_:2},[Ge(C.$slots,(F,L)=>({name:L,fn:J(H=>[D(C.$slots,L,de(we(H)))])}))]),1032,["node"]))),128))],10,rJ),[[zs,C.$props.node.hasChildren]])],42,eJ)}}}),sJ=me(iJ),lJ={class:"va-tree-view",role:"tree"},aJ=ie({name:"VaTreeView",__name:"VaTreeView",props:{...GX},emits:[...qX],setup(t,{emit:e}){const n=t,r=e,{treeItems:o,getTrackBy:i}=ZX(n,r);return(s,l)=>(A(),I("div",lJ,[s.$props.filter&&!m(o).length?D(s.$slots,"not-found",{key:0},()=>[Ue("No matching nodes found")]):(A(!0),I(_e,{key:1},Ge(m(o),a=>(A(),te(m(sJ),{key:m(i)(a),node:a},vn({_:2},[Ge(s.$slots,(u,c)=>({name:c,fn:J(d=>[D(s.$slots,c,de(we(d)))])}))]),1032,["node"]))),128))]))}}),uJ=me(aJ),cJ={class:"va-scroll-container__content"},dJ=ie({name:"VaScrollContainer",__name:"VaScrollContainer",props:{...ss,vertical:{type:Boolean,default:!1},horizontal:{type:Boolean,default:!1},color:{type:String,default:"secondary"},rtl:{type:Boolean,default:!1},gradient:{type:Boolean,default:!1},sizesConfig:{type:Object,default:()=>({defaultSize:4,sizes:{small:4,medium:6,large:8}})},size:{type:String,default:"small",validator:t=>["small","medium","large"].includes(t)}},setup(t){const e=t,{getColor:n}=He(),{sizeComputed:r}=ls(e),o=g(()=>e.horizontal?"auto":"hidden"),i=g(()=>e.vertical?"auto":"hidden"),s=g(()=>{const u=n(e.color);return e.gradient?`linear-gradient(0deg, var(--va-scroll-container-scrollbar-gradient-to) 0%, ${u} 100%)`:u}),l=g(()=>r.value),a=g(()=>e.rtl?"rtl":"ltr");return(u,c)=>(A(),I("div",{class:"va-scroll-container",style:se(`--va-scroll-color: ${String(s.value)};--va-scrollbar-size: ${String(l.value)};--va-overflow-x: ${String(o.value)};--va-overflow-y: ${String(i.value)};--va-scrollbar-position: ${String(a.value)}`)},[q("div",cJ,[D(u.$slots,"default")])],4))}}),fJ=me(dJ),hJ={class:"va-viewer-content"},pJ=ie({name:"VaViewer",inheritAttrs:!1,__name:"VaViewer",setup(t,{expose:e}){const n=W(),r=W(),o=Gd(),i=W(!0),s=g(()=>o.value&&!i.value),l=()=>i.value=!1,a=()=>i.value=!0,u=Ln(),c=()=>{u.anchor||l()};Jd([n,r],a);const d=us(),f=g(()=>{var h;return(h=d.value)==null?void 0:h.body});return e({openViewer:l,closeViewer:a}),(h,p)=>(A(),I(_e,null,[q("div",ee({class:"va-viewer"},h.$attrs,{onClick:c}),[D(h.$slots,"anchor",de(we({openViewer:l}))),h.$slots.anchor?z("",!0):D(h.$slots,"default",{key:0})],16),s.value?(A(),te(Ca,{key:0,to:f.value},[q("div",hJ,[q("div",{ref_key:"content",ref:n,class:"va-viewer-content__main-area"},[h.$slots.image?z("",!0):D(h.$slots,"default",{key:0}),D(h.$slots,"image")],512),q("div",{ref_key:"controls",ref:r,class:"va-viewer-content__controls-panel"},[D(h.$slots,"controls"),D(h.$slots,"close",de(we({close:a})),()=>[q("button",{class:"va-viewer-content__close-button",onClick:a},[he(m(Ze),{name:"close",color:"backgroundPrimary"})])])],512)])],8,["to"])):z("",!0)],64))}}),mJ=me(pJ),gJ=ie({name:"VaValue",props:{defaultValue:{type:null,required:!1,default:!1}},setup(t,{slots:e}){const n=W(t.defaultValue),r=new Proxy(n,{get(o,i){return i==="value"?o.value:o[i]},set(o,i,s){return i==="value"&&(o.value=s),!0}});return()=>ut(_e,[mk(e.default,r)])}}),vJ=me(gJ),yJ=t=>{const e=document.createElement("div");e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="auto";const{font:n}=window.getComputedStyle(t);return e.style.font=n,e.textContent="Vuestic",e.style.zIndex="-1",e.style.pointerEvents="none",e.style.opacity="0",e.ariaHidden="true",e.innerText=t.value,e},bJ=(t,e)=>{const n=W(),r=W();return fe(t,o=>{var i,s;o&&(n.value=yJ(o),(s=(i=t.value)==null?void 0:i.parentElement)==null||s.appendChild(n.value))}),Ys(n,o=>{!o||!t.value||(r.value=o[0].contentRect.height)}),fe(e,o=>{n.value&&(n.value.innerText=String(o),n.value.innerHTML+=" ;")}),r},SJ=["rows","loading","ariaLabel"],y0=t=>{if(t>0)return!0;throw new Error(`\`minRows|maxRows\` must be a positive integer greater than 0, but ${t} is provided`)},{createEmits:CJ,createListeners:wJ}=fs(["input","change","click","update:modelValue"]),b0=nt(Wn),kJ=ie({name:"VaTextarea",__name:"VaTextarea",props:{...vi,...b0,...Kt,...Co,modelValue:{type:[String,Number],default:""},placeholder:{type:String},autosize:{type:Boolean,default:!1},minRows:{type:[Number,String],default:1,validator:y0},maxRows:{type:[Number,String],validator:y0},resize:{type:Boolean,default:!0},clearValue:{type:[String],default:""}},emits:[...CJ(),...mi],setup(t,{expose:e,emit:n}){const r=t,o=n,i=Ne(),{valueComputed:s}=xt(r,o,"modelValue",{defaultValue:""}),l=()=>{Kr(i.value)},a=()=>{Yd(i.value)},u=()=>S(()=>{o("update:modelValue",r.clearValue),o("clear"),b()}),{isDirty:c,isTouched:d,computedError:f,computedErrorMessages:h,listeners:p,validationAriaAttributes:v,isLoading:y,resetValidation:b,withoutValidation:S}=wo(r,o,{value:s,focus:l,reset:u}),w=g(()=>r.resize&&!r.autosize),x=W(r.minRows),k=bJ(i,s);function $(){let F=parseFloat(String(r.minRows)),L=parseFloat(String(r.maxRows));if(F=isNaN(F)?1:F,L=isNaN(L)?1/0:L,!r.autosize){x.value=Math.max(L,Math.min(F,L??0));return}if(!k.value||!i.value)return;const H=getComputedStyle(i.value),E=k.value,P=parseFloat(H.lineHeight),V=Math.max(F*P,F+Math.round(P)),O=L*P||1/0,N=Math.max(V,Math.min(O,E??0));x.value=Math.round(N/P),i.value.style.height=`${N+1}px`}tr(()=>{$()});const C=g(()=>({resize:w.value?void 0:"none"})),T=g(()=>({...Bt(r,["disabled","readonly","placeholder","ariaLabel"])})),_=gt(b0),M=wJ(o);return e({isDirty:c,isTouched:d,isLoading:y,computedError:f,computedErrorMessages:h,reset:u,focus:l,blur:a,value:s,withoutValidation:S,resetValidation:b}),(F,L)=>(A(),te(m(Wn),ee({class:"va-textarea"},m(_),{error:m(f),"error-messages":m(h)}),{default:J(()=>[q("div",{class:Ae(["va-textarea__resize-wrapper",{"va-textarea__resize-wrapper--resizable":w.value}])},[xr(q("textarea",ee({"onUpdate:modelValue":L[0]||(L[0]=H=>Tt(s)?s.value=H:null)},{...T.value,...m(M),...m(v),...m(p)},{class:["va-textarea__textarea",{"va-textarea__textarea--autosize":t.autosize}],ref_key:"textarea",ref:i,rows:x.value,style:C.value,loading:m(y),ariaLabel:F.$props.label}),null,16,SJ),[[Ic,m(s)]])],2)]),_:1},16,["error","error-messages"]))}}),xJ=bo(kJ),S0='[role="menuitem"]:not([aria-disabled="true"])',$J='[role="menuitem"]:focus',AJ=t=>({role:"menuitem",tabindex:-1,"aria-disabled":!!t.disabled}),TJ=()=>({role:"menu",tabindex:0}),_J=t=>{At("keydown",({key:e})=>{if(!t.value)return;const n=t.value.querySelectorAll(S0),r=t.value.querySelector($J);if(n.length){if(!r){const o=t.value.querySelector(S0);o&&Kr(o);return}if(e==="ArrowDown"||e==="ArrowRight"){const o=Array.from(n).indexOf(r);Kr(n[o+1])}if(e==="ArrowUp"||e==="ArrowLeft"){const o=Array.from(n).indexOf(r);Kr(n[o-1])}}},t)},OJ={class:"va-menu-item__cell va-menu-item__cell--left"},PJ={class:"va-menu-item__cell va-menu-item__cell--center"},BJ={class:"va-menu-item__content"},MJ={class:"va-menu-item__cell va-menu-item__cell--right"},Qx=ie({name:"VaMenuItem",__name:"VaMenuItem",props:{name:{type:String,default:""},icon:{type:String,defatult:""},rightIcon:{type:String,defatult:""},disabled:{type:Boolean,default:!1}},emits:["selected"],setup(t,{emit:e}){const{hasKeyboardFocus:n,keyboardFocusListeners:r}=XU();return(o,i)=>(A(),I("tr",ee({class:"va-menu-item"},m(AJ)({disabled:t.disabled}),ur(m(r),!0),{class:{"va-menu-item--disabled":t.disabled,"va-menu-item--keyboard-focus":m(n)},onClick:i[0]||(i[0]=s=>o.$emit("selected")),onKeydown:i[1]||(i[1]=Ce(s=>o.$emit("selected"),["enter","space"]))}),[q("td",OJ,[D(o.$slots,"left-icon",{},()=>[t.icon?(A(),te(m(Ze),{key:0,class:"va-menu-item__icon--left",name:t.icon},null,8,["name"])):z("",!0)])]),q("td",PJ,[D(o.$slots,"default",{},()=>[q("a",BJ,Be(t.name),1)])]),q("td",MJ,[D(o.$slots,"right-icon",{},()=>[t.rightIcon?(A(),te(m(Ze),{key:0,class:"va-menu-item__icon--right",name:t.rightIcon},null,8,["name"])):z("",!0)])])],16))}}),IJ={class:"va-menu-list__group-name"},DJ=ie({name:"VaMenuGroup",__name:"VaMenuGroup",props:{groupName:{type:String,required:!0},color:{type:String,default:"secondary"}},setup(t){const e=t,{getColor:n}=He(),r=g(()=>n(e.color));return(o,i)=>(A(),I(_e,null,[q("div",{class:"va-menu-list__group-name-wrapper",colspan:"99999",style:se(`--va-color-computed: ${String(r.value)}`)},[q("span",IJ,Be(t.groupName),1)],4),D(o.$slots,"default",{style:se(`--va-color-computed: ${String(r.value)}`)},void 0,!0)],64))}}),Zx=hs(DJ,[["__scopeId","data-v-4dd1ae9a"]]),EJ={colspan:"9999"},LJ=ie({name:"VaMenuList",__name:"VaMenuList",props:{...Cl,options:{type:Array,default:()=>[]}},emits:["selected"],setup(t,{emit:e}){const n=t,r=W();_J(r);const{getText:o,getValue:i,getDisabled:s,getGroupBy:l,getTrackBy:a}=wl(n),u=g(()=>n.options.reduce((h,p)=>{const v=l(p);return v?(h[v]||(h[v]=[]),h[v].push(p)):h._noGroup.push(p),h},{_noGroup:[]})),c=h=>Array.isArray(h)&&h[0].type===_e?h[0].children:h,d=h=>typeof h.type=="object"&&"name"in h.type&&typeof h.type.name=="string"?h.type.name:"",f=h=>typeof h.type=="string"?h.type:typeof h.type=="object"&&"name"in h.type&&typeof h.type.name=="string"?h.type.name:String(h.key);return(h,p)=>(A(),I("table",ee({class:"va-menu-list",ref_key:"container",ref:r},m(TJ)()),[q("tbody",null,[h.$slots.default?(A(!0),I(_e,{key:0},Ge(c(h.$slots.default()),v=>(A(),I(_e,null,[d(v)==="VaMenuItem"?(A(),te(zn(v),{key:f(v)+"menuitem"})):d(v)==="VaDropdown"?(A(),te(zn(v),{key:f(v)+"menu-dropdown"})):(A(),I("td",{colspan:"999",key:f(v),class:"va-menu-list__virtual-td"},[(A(),te(zn(v)))]))],64))),256)):D(h.$slots,"default",{key:1},()=>[(A(!0),I(_e,null,Ge(u.value,(v,y)=>(A(),I(_e,{key:y},[y!=="_noGroup"?D(h.$slots,"group",{key:0},()=>[q("tr",null,[q("td",EJ,[he(Zx,{"group-name":y},null,8,["group-name"])])])]):z("",!0),(A(!0),I(_e,null,Ge(v,b=>(A(),te(Qx,{key:m(a)(b),name:m(o)(b),icon:b.icon,"right-icon":b.rightIcon,disabled:m(s)(b),onSelected:S=>h.$emit("selected",m(i)(b),b)},{"left-icon":J(S=>[D(h.$slots,"left-icon",de(we(S)))]),"right-icon":J(S=>[D(h.$slots,"right-icon",de(we(S)))]),_:2},1032,["name","icon","right-icon","disabled","onSelected"]))),128))],64))),128))])])],16))}}),uf=bo(LJ),VJ=bo(Qx),RJ=bo(Zx),FJ=t=>{tr(()=>{t.value&&Ot(()=>{Kr(Rt(t.value))})})},C0=nt(uf),NJ=Li(uf),w0=nt(er),HJ=Li(er),zJ=ie({name:"VaMenu",__name:"VaMenu",props:{...Me,...C0,...w0,stickToEdges:{type:Boolean,default:!0}},emits:[...HJ,...NJ],setup(t,{expose:e,emit:n}){const r=W(),o=W();FJ(r);const i=()=>{var u;(u=o.value)==null||u.hide(),Ot(()=>{var c;const d=Rt((c=o.value)==null?void 0:c.anchorRef);d&&op(d)})},s=u=>{u.key==="Escape"&&i(),(u.key==="ArrowDown"||u.key==="ArrowUp")&&u.preventDefault()},l=gt(C0),a=gt(w0);return e({close:i}),(u,c)=>(A(),te(m(er),ee(m(a),{ref_key:"dropdown",ref:o}),{anchor:J(()=>[D(u.$slots,"anchor")]),default:J(()=>[he(m(Xi),{onKeydown:s},{default:J(()=>[he(m(uf),ee({onKeydown:c[0]||(c[0]=Ce(be(()=>{},["prevent","stop"]),["enter","space"]))},m(l),{ref_key:"menuList",ref:r,onSelected:c[1]||(c[1]=d=>{u.$emit("selected",d),i()})}),vn({_:2},[u.$slots.default?{name:"default",fn:J(()=>[D(u.$slots,"default")]),key:"0"}:void 0]),1040)]),_:3})]),_:3},16))}}),jJ=bo(zJ),WJ={rules:()=>[],dirty:!1,errorCount:1,success:!1,messages:()=>[],immediateValidation:!1},UJ={stateful:!1},KJ=ie({__name:"VaFormField",props:zO({stateful:{type:Boolean},modelValue:{},name:{},rules:{},dirty:{type:Boolean},error:{type:Boolean},errorMessages:{},errorCount:{},success:{type:Boolean},messages:{},immediateValidation:{type:Boolean},clearValue:{}},{...UJ,...WJ}),emits:["update:error","update:errorMessages","update:dirty","update:modelValue"],setup(t,{emit:e}){const n=t,r=e,{valueComputed:o}=xt(n,r,"modelValue"),i=()=>{o.value=n.clearValue},s=()=>{},{computedError:l,computedErrorMessages:a,validate:u,isDirty:c,isLoading:d,isValid:f,resetValidation:h,validationAriaAttributes:p,listeners:v}=wo(n,r,{reset:i,focus:s,value:o}),y=g(()=>l.value?a.value:n.messages),b=g(()=>f.value?n.success?"success":"":"danger"),S=W(o.value);tr(()=>{S.value=o.value});const w=()=>new Proxy(S,{get(x,k){return k==="ref"?S.value:Reflect.get(x,k)},set(x,k,$){return k==="ref"?(S.value=$,o.value=$,!0):Reflect.set(o,k,$)}});return(x,k)=>(A(),te(m(Ud),{"model-value":y.value,"has-error":!m(f),color:b.value},vn({default:J(({ariaAttributes:$,attrs:C})=>[D(x.$slots,"default",de(we({error:m(l),errorMessages:y.value,messages:y.value,validate:m(u),isDirty:m(c),isLoading:m(d),isValid:m(f),resetValidation:m(h),validationAriaAttributes:m(p),...m(v),value:w(),modelValue:w(),ariaAttributes:$,bind:{...C,...$,...m(v)}})))]),_:2},[Ge(["message","messages"],$=>({name:$,fn:J(C=>[D(x.$slots,$,de(we(C)))])}))]),1032,["model-value","has-error","color"]))}}),GJ=bo(KJ),qJ=Object.freeze(Object.defineProperty({__proto__:null,VaAccordion:d5,VaAffix:g5,VaAlert:$5,VaAppBar:_5,VaAspectRatio:Hk,VaAvatar:Wc,VaAvatarGroup:V5,VaBacktop:N5,VaBadge:Yk,VaBreadcrumbs:sW,VaBreadcrumbsItem:iW,VaButton:et,VaButtonDropdown:uU,VaButtonGroup:Qd,VaButtonToggle:dU,VaCard:kU,VaCardActions:CU,VaCardBlock:wU,VaCardContent:bU,VaCardTitle:SU,VaCarousel:qU,VaCheckbox:nu,VaChip:nK,VaCollapse:lK,VaColorIndicator:pg,VaColorInput:UK,VaColorPalette:qK,VaConfig:Ya,VaContent:ZK,VaCounter:aG,VaDataTable:i9,VaDateInput:L9,VaDatePicker:V9,VaDivider:Ix,VaDropdown:er,VaDropdownContent:Xi,VaFallback:Gs,VaFileUpload:bq,VaForm:xq,VaFormField:GJ,VaHover:dc,VaIcon:Ze,VaImage:cg,VaInfiniteScroll:Oq,VaInnerLoading:Tx,VaInput:gg,VaInputWrapper:Wn,VaLayout:Wq,VaList:Dx,VaListItem:lf,VaListItemLabel:q9,VaListItemSection:Js,VaListLabel:G9,VaListSeparator:Y9,VaMenu:jJ,VaMenuGroup:RJ,VaMenuItem:VJ,VaMenuList:uf,VaMessageList:Ud,VaModal:tg,VaNavbar:Zq,VaNavbarItem:e7,VaOptionList:h7,VaPagination:y7,VaParallax:x7,VaPopover:P7,VaProgressBar:Ex,VaProgressCircle:bl,VaRadio:zx,VaRating:V7,VaScrollContainer:fJ,VaSelect:vY,VaSeparator:q6,VaSidebar:_Y,VaSidebarItem:LY,VaSidebarItemContent:DY,VaSidebarItemTitle:EY,VaSkeleton:wY,VaSkeletonGroup:kY,VaSlider:KY,VaSpacer:X6,VaSplit:QY,VaStepper:vX,VaSwitch:jx,VaTab:uX,VaTabs:iX,VaTextarea:xJ,VaTimeInput:LX,VaTimePicker:KX,VaTimeline:zX,VaTimelineItem:UX,VaToast:bk,VaTreeView:uJ,VaValue:vJ,VaViewer:mJ,VaVirtualScroller:rf},Symbol.toStringTag,{value:"Module"})),YJ=t=>typeof t=="function",Io=(t,e,...n)=>{YJ(e)?t.use(e(...n)):t.use(e)},XJ=So((t={})=>({install(e){const{config:n}=t;Wy(e),Object.entries(qJ).forEach(([r,o])=>{e.component(r,o)}),Io(e,Q6(n)),Io(e,p6),Io(e,nj(n)),Io(e,s5),Io(e,ij),Io(e,Aj),Io(e,$j),Io(e,o5),Wy(null)}})),e$=1024;let JJ=0,Zf=class{constructor(e,n){this.from=e,this.to=n}};class it{constructor(e={}){this.id=JJ++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=En.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}it.closedBy=new it({deserialize:t=>t.split(" ")});it.openedBy=new it({deserialize:t=>t.split(" ")});it.group=new it({deserialize:t=>t.split(" ")});it.isolate=new it({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});it.contextHash=new it({perNode:!0});it.lookAhead=new it({perNode:!0});it.mounted=new it({perNode:!0});class Yc{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}static get(e){return e&&e.props&&e.props[it.mounted.id]}}const QJ=Object.create(null);class En{constructor(e,n,r,o=0){this.name=e,this.props=n,this.id=r,this.flags=o}static define(e){let n=e.props&&e.props.length?Object.create(null):QJ,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),o=new En(e.name||"",n,e.id,r);if(e.props){for(let i of e.props)if(Array.isArray(i)||(i=i(o)),i){if(i[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[i[0].id]=i[1]}}return o}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(it.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let o of r.split(" "))n[o]=e[r];return r=>{for(let o=r.prop(it.group),i=-1;i<(o?o.length:0);i++){let s=n[i<0?r.name:o[i]];if(s)return s}}}}En.none=new En("",Object.create(null),0,8);class cf{constructor(e){this.types=e;for(let n=0;n0;for(let a=this.cursor(s|ln.IncludeAnonymous);;){let u=!1;if(a.from<=i&&a.to>=o&&(!l&&a.type.isAnonymous||n(a)!==!1)){if(a.firstChild())continue;u=!0}for(;u&&r&&(l||!a.type.isAnonymous)&&r(a),!a.nextSibling();){if(!a.parent())return;u=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:Tg(En.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,o)=>new Et(this.type,n,r,o,this.propValues),e.makeTree||((n,r,o)=>new Et(En.none,n,r,o)))}static build(e){return nQ(e)}}Et.empty=new Et(En.none,[],[],0);class $g{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new $g(this.buffer,this.index)}}class li{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return En.none}toString(){let e=[];for(let n=0;n0));a=s[a+3]);return l}slice(e,n,r){let o=this.buffer,i=new Uint16Array(n-e),s=0;for(let l=e,a=0;l=e&≠case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function _a(t,e,n,r){for(var o;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to0?l.length:-1;e!=u;e+=n){let c=l[e],d=a[e]+s.from;if(t$(o,r,d,d+c.length)){if(c instanceof li){if(i&ln.ExcludeBuffers)continue;let f=c.findChild(0,c.buffer.length,n,r-d,o);if(f>-1)return new Uo(new ZJ(s,c,e,d),null,f)}else if(i&ln.IncludeAnonymous||!c.type.isAnonymous||Ag(c)){let f;if(!(i&ln.IgnoreMounts)&&(f=Yc.get(c))&&!f.overlay)return new mr(f.tree,d,e,s);let h=new mr(c,d,e,s);return i&ln.IncludeAnonymous||!h.type.isAnonymous?h:h.nextChild(n<0?c.children.length-1:0,n,r,o)}}}if(i&ln.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?e=s.index+n:e=n<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,n,r=0){let o;if(!(r&ln.IgnoreOverlays)&&(o=Yc.get(this._tree))&&o.overlay){let i=e-this.from;for(let{from:s,to:l}of o.overlay)if((n>0?s<=i:s=i:l>i))return new mr(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function x0(t,e,n,r){let o=t.cursor(),i=[];if(!o.firstChild())return i;if(n!=null){for(let s=!1;!s;)if(s=o.type.is(n),!o.nextSibling())return i}for(;;){if(r!=null&&o.type.is(r))return i;if(o.type.is(e)&&i.push(o.node),!o.nextSibling())return r==null?i:[]}}function dp(t,e,n=e.length-1){for(let r=t.parent;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class ZJ{constructor(e,n,r,o){this.parent=e,this.buffer=n,this.index=r,this.start=o}}class Uo extends n${get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:o}=this.context,i=o.findChild(this.index+4,o.buffer[this.index+3],e,n-this.context.start,r);return i<0?null:new Uo(this.context,this,i)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,n,r=0){if(r&ln.ExcludeBuffers)return null;let{buffer:o}=this.context,i=o.findChild(this.index+4,o.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return i<0?null:new Uo(this.context,this,i)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Uo(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new Uo(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,o=this.index+4,i=r.buffer[this.index+3];if(i>o){let s=r.buffer[this.index+1];e.push(r.slice(o,i,s)),n.push(0)}return new Et(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function r$(t){if(!t.length)return null;let e=0,n=t[0];for(let i=1;in.from||s.to=e){let l=new mr(s.tree,s.overlay[0].from+i.from,-1,i);(o||(o=[r])).push(_a(l,e,n,!1))}}return o?r$(o):r}class fp{get name(){return this.type.name}constructor(e,n=0){if(this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof mr)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:o}=this.buffer;return this.type=n||o.set.types[o.buffer[e]],this.from=r+o.buffer[e+1],this.to=r+o.buffer[e+2],!0}yield(e){return e?e instanceof mr?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:o}=this.buffer,i=o.findChild(this.index+4,o.buffer[this.index+3],e,n-this.buffer.start,r);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&ln.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&ln.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&ln.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let o=r<0?0:this.stack[r]+4;if(this.index!=o)return this.yieldBuf(n.findChild(o,this.index,-1,0,4))}else{let o=n.buffer[this.index+3];if(o<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(o)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:o}=this;if(o){if(e>0){if(this.index-1)for(let i=n+e,s=e<0?-1:r._tree.children.length;i!=s;i+=e){let l=r._tree.children[i];if(this.mode&ln.IncludeAnonymous||l instanceof li||!l.type.isAnonymous||Ag(l))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to=0;){for(let s=e;s;s=s._parent)if(s.index==o){if(o==this.index)return s;n=s,r=i+1;break e}o=this.stack[--i]}for(let o=r;o=0;i--){if(i<0)return dp(this.node,e,o);let s=r[n.buffer[this.stack[i]]];if(!s.isAnonymous){if(e[o]&&e[o]!=s.name)return!1;o--}}return!0}}function Ag(t){return t.children.some(e=>e instanceof li||!e.type.isAnonymous||Ag(e))}function nQ(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:o=e$,reused:i=[],minRepeatType:s=r.types.length}=t,l=Array.isArray(n)?new $g(n,n.length):n,a=r.types,u=0,c=0;function d(k,$,C,T,_,M){let{id:F,start:L,end:H,size:E}=l,P=c;for(;E<0;)if(l.next(),E==-1){let X=i[F];C.push(X),T.push(L-k);return}else if(E==-3){u=F;return}else if(E==-4){c=F;return}else throw new RangeError(`Unrecognized record size: ${E}`);let V=a[F],O,N,re=L-k;if(H-L<=o&&(N=y(l.pos-$,_))){let X=new Uint16Array(N.size-N.skip),ke=l.pos-N.size,$e=X.length;for(;l.pos>ke;)$e=b(N.start,X,$e);O=new li(X,H-N.start,r),re=N.start-k}else{let X=l.pos-E;l.next();let ke=[],$e=[],ye=F>=s?F:-1,j=0,ce=H;for(;l.pos>X;)ye>=0&&l.id==ye&&l.size>=0?(l.end<=ce-o&&(p(ke,$e,L,j,l.end,ce,ye,P),j=ke.length,ce=l.end),l.next()):M>2500?f(L,X,ke,$e):d(L,X,ke,$e,ye,M+1);if(ye>=0&&j>0&&j-1&&j>0){let Se=h(V);O=Tg(V,ke,$e,0,ke.length,0,H-L,Se,Se)}else O=v(V,ke,$e,H-L,P-H)}C.push(O),T.push(re)}function f(k,$,C,T){let _=[],M=0,F=-1;for(;l.pos>$;){let{id:L,start:H,end:E,size:P}=l;if(P>4)l.next();else{if(F>-1&&H=0;E-=3)L[P++]=_[E],L[P++]=_[E+1]-H,L[P++]=_[E+2]-H,L[P++]=P;C.push(new li(L,_[2]-H,r)),T.push(H-k)}}function h(k){return($,C,T)=>{let _=0,M=$.length-1,F,L;if(M>=0&&(F=$[M])instanceof Et){if(!M&&F.type==k&&F.length==T)return F;(L=F.prop(it.lookAhead))&&(_=C[M]+F.length+L)}return v(k,$,C,T,_)}}function p(k,$,C,T,_,M,F,L){let H=[],E=[];for(;k.length>T;)H.push(k.pop()),E.push($.pop()+C-_);k.push(v(r.types[F],H,E,M-_,L-M)),$.push(_-C)}function v(k,$,C,T,_=0,M){if(u){let F=[it.contextHash,u];M=M?[F].concat(M):[F]}if(_>25){let F=[it.lookAhead,_];M=M?[F].concat(M):[F]}return new Et(k,$,C,T,M)}function y(k,$){let C=l.fork(),T=0,_=0,M=0,F=C.end-o,L={size:0,start:0,skip:0};e:for(let H=C.pos-k;C.pos>H;){let E=C.size;if(C.id==$&&E>=0){L.size=T,L.start=_,L.skip=M,M+=4,T+=4,C.next();continue}let P=C.pos-E;if(E<0||P=s?4:0,O=C.start;for(C.next();C.pos>P;){if(C.size<0)if(C.size==-3)V+=4;else break e;else C.id>=s&&(V+=4);C.next()}_=O,T+=E,M+=V}return($<0||T==k)&&(L.size=T,L.start=_,L.skip=M),L.size>4?L:void 0}function b(k,$,C){let{id:T,start:_,end:M,size:F}=l;if(l.next(),F>=0&&T4){let H=l.pos-(F-4);for(;l.pos>H;)C=b(k,$,C)}$[--C]=L,$[--C]=M-k,$[--C]=_-k,$[--C]=T}else F==-3?u=T:F==-4&&(c=T);return C}let S=[],w=[];for(;l.pos>0;)d(t.start||0,t.bufferStart||0,S,w,-1,0);let x=(e=t.length)!==null&&e!==void 0?e:S.length?w[0]+S[0].length:0;return new Et(a[t.topID],S.reverse(),w.reverse(),x)}const $0=new WeakMap;function mc(t,e){if(!t.isAnonymous||e instanceof li||e.type!=t)return 1;let n=$0.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof Et)){n=1;break}n+=mc(t,r)}$0.set(e,n)}return n}function Tg(t,e,n,r,o,i,s,l,a){let u=0;for(let p=r;p=c)break;$+=C}if(w==x+1){if($>c){let C=p[x];h(C.children,C.positions,0,C.children.length,v[x]+S);continue}d.push(p[x])}else{let C=v[w-1]+p[w-1].length-k;d.push(Tg(t,p,v,x,w,k,C,null,a))}f.push(k+S-i)}}return h(e,n,r,o,0),(l||a)(d,f,s)}class ji{constructor(e,n,r,o,i=!1,s=!1){this.from=e,this.to=n,this.tree=r,this.offset=o,this.open=(i?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let o=[new ji(0,e.length,e,0,!1,r)];for(let i of n)i.to>e.length&&o.push(i);return o}static applyChanges(e,n,r=128){if(!n.length)return e;let o=[],i=1,s=e.length?e[0]:null;for(let l=0,a=0,u=0;;l++){let c=l=r)for(;s&&s.from=f.from||d<=f.to||u){let h=Math.max(f.from,a)-u,p=Math.min(f.to,d)-u;f=h>=p?null:new ji(h,p,f.tree,f.offset+u,l>0,!!c)}if(f&&o.push(f),s.to>d)break;s=inew Zf(o.from,o.to)):[new Zf(0,0)]:[new Zf(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let o=this.startParse(e,n,r);for(;;){let i=o.advance();if(i)return i}}}class rQ{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}new it({perNode:!0});var A0={};class Xc{constructor(e,n,r,o,i,s,l,a,u,c=0,d){this.p=e,this.stack=n,this.state=r,this.reducePos=o,this.pos=i,this.score=s,this.buffer=l,this.bufferBase=a,this.curContext=u,this.lookAhead=c,this.parent=d}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let o=e.parser.context;return new Xc(e,[],n,r,r,0,[],0,o?new T0(o,o.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,o=e&65535,{parser:i}=this.p,s=i.dynamicPrecedence(o);if(s&&(this.score+=s),r==0){this.pushState(i.getGoto(this.state,o,!0),this.reducePos),o=2e3&&!(!((n=this.p.parser.nodeSet.types[o])===null||n===void 0)&&n.isAnonymous)&&(a==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(o,a)}storeNode(e,n,r,o=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&s.buffer[l-4]==0&&s.buffer[l-1]>-1){if(n==r)return;if(s.buffer[l-2]>=n){s.buffer[l-2]=r;return}}}if(!i||this.pos==r)this.buffer.push(e,n,r,o);else{let s=this.buffer.length;if(s>0&&this.buffer[s-4]!=0)for(;s>0&&this.buffer[s-2]>r;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,o>4&&(o-=4);this.buffer[s]=e,this.buffer[s+1]=n,this.buffer[s+2]=r,this.buffer[s+3]=o}}shift(e,n,r,o){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=o,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,o,4);else{let i=e,{parser:s}=this.p;(o>this.pos||n<=s.maxNode)&&(this.pos=o,s.stateFlag(i,1)||(this.reducePos=o)),this.pushState(i,r),this.shiftContext(n,r),n<=s.maxNode&&this.buffer.push(n,r,o,4)}}apply(e,n,r,o){e&65536?this.reduce(e):this.shift(e,n,r,o)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let o=this.pos;this.reducePos=this.pos=o+e.length,this.pushState(n,o),this.buffer.push(r,o,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),o=e.bufferBase+n;for(;e&&o==e.bufferBase;)e=e.parent;return new Xc(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,o,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new oQ(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if(!(r&65536))return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let o=[];for(let i=0,s;ia&1&&l==s)||o.push(n[i],s)}n=o}let r=[];for(let o=0;o>19,o=n&65535,i=this.stack.length-r*3;if(i<0||e.getGoto(this.stack[i],o,!1)<0){let s=this.findForcedReduction();if(s==null)return!1;n=s}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=(o,i)=>{if(!n.includes(o))return n.push(o),e.allActions(o,s=>{if(!(s&393216))if(s&65536){let l=(s>>19)-i;if(l>1){let a=s&65535,u=this.stack.length-l*3;if(u>=0&&e.getGoto(this.stack[u],a,!1)>=0)return l<<19|65536|a}}else{let l=r(s,i+1);if(l!=null)return l}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;nthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class T0{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class oQ{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let o=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=o}}class Jc{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new Jc(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Jc(this.stack,this.pos,this.index)}}function Vu(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,o=0;r=92&&s--,s>=34&&s--;let a=s-32;if(a>=46&&(a-=46,l=!0),i+=a,l)break;i*=46}n?n[o++]=i:n=new e(i)}return n}class gc{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const _0=new gc;class iQ{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=_0,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,o=this.rangeIndex,i=this.pos+e;for(;ir.to:i>=r.to;){if(o==this.ranges.length-1)return null;let s=this.ranges[++o];i+=s.from-r.to,r=s}return i}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,o;if(n>=0&&n=this.chunk2Pos&&rl.to&&(this.chunk2=this.chunk2.slice(0,l.to-r)),o=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),o}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=_0,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let o of this.ranges){if(o.from>=n)break;o.to>e&&(r+=this.input.read(Math.max(o.from,e),Math.min(o.to,n)))}return r}}class Is{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;sQ(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}Is.prototype.contextual=Is.prototype.fallback=Is.prototype.extend=!1;Is.prototype.fallback=Is.prototype.extend=!1;function sQ(t,e,n,r,o,i){let s=0,l=1<0){let p=t[h];if(a.allows(p)&&(e.token.value==-1||e.token.value==p||lQ(p,e.token.value,o,i))){e.acceptToken(p);break}}let c=e.next,d=0,f=t[s+2];if(e.next<0&&f>d&&t[u+f*3-3]==65535){s=t[u+f*3-1];continue e}for(;d>1,p=u+h+(h<<1),v=t[p],y=t[p+1]||65536;if(c=y)d=h+1;else{s=t[p+2],e.advance();continue e}}break}}function O0(t,e,n){for(let r=e,o;(o=t[r])!=65535;r++)if(o==n)return r-e;return-1}function lQ(t,e,n,r){let o=O0(n,r,e);return o<0||O0(n,r,t)e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}class aQ{constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?P0(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?P0(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=s,null;if(i instanceof Et){if(s==e){if(s=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(s),this.index.push(0))}else this.index[n]++,this.nextStart=s+i.length}}}class uQ{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new gc)}getActions(e){let n=0,r=null,{parser:o}=e.p,{tokenizers:i}=o,s=o.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let u=0;ud.end+25&&(a=Math.max(d.lookAhead,a)),d.value!=0)){let f=n;if(d.extended>-1&&(n=this.addActions(e,d.extended,d.end,n)),n=this.addActions(e,d.value,d.end,n),!c.extend&&(r=d,n>f))break}}for(;this.actions.length>n;)this.actions.pop();return a&&e.setLookAhead(a),!r&&e.pos==this.stream.end&&(r=new gc,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new gc,{pos:r,p:o}=e;return n.start=r,n.end=Math.min(r+1,o.stream.end),n.value=r==o.stream.end?o.parser.eofTerm:0,n}updateCachedToken(e,n,r){let o=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(o,e),r),e.value>-1){let{parser:i}=r.p;for(let s=0;s=0&&r.p.parser.dialect.allows(l>>1)){l&1?e.extended=l>>1:e.value=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(o+1)}putAction(e,n,r,o){for(let i=0;ie.bufferLength*4?new aQ(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],o,i;if(this.bigReductionCount>300&&e.length==1){let[s]=e;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;sn)r.push(l);else{if(this.advanceStack(l,r,e))continue;{o||(o=[],i=[]),o.push(l);let a=this.tokens.getMainToken(l);i.push(a.value,a.end)}}break}}if(!r.length){let s=o&&fQ(o);if(s)return Kn&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw Kn&&o&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&o){let s=this.stoppedAt!=null&&o[0].pos>this.stoppedAt?o[0]:this.runRecovery(o,i,r);if(s)return Kn&&console.log("Force-finish "+this.stackID(s)),this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(r.length>s)for(r.sort((l,a)=>a.score-l.score);r.length>s;)r.pop();r.some(l=>l.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let s=0;s500&&u.buffer.length>500)if((l.score-u.score||l.buffer.length-u.buffer.length)>0)r.splice(a--,1);else{r.splice(s--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let s=1;s ":"";if(this.stoppedAt!=null&&o>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let u=e.curContext&&e.curContext.tracker.strict,c=u?e.curContext.hash:0;for(let d=this.fragments.nodeAt(o);d;){let f=this.parser.nodeSet.types[d.type.id]==d.type?i.getGoto(e.state,d.type.id):-1;if(f>-1&&d.length&&(!u||(d.prop(it.contextHash)||0)==c))return e.useNode(d,f),Kn&&console.log(s+this.stackID(e)+` (via reuse of ${i.getName(d.type.id)})`),!0;if(!(d instanceof Et)||d.children.length==0||d.positions[0]>0)break;let h=d.children[0];if(h instanceof Et&&d.positions[0]==0)d=h;else break}}let l=i.stateSlot(e.state,4);if(l>0)return e.reduce(l),Kn&&console.log(s+this.stackID(e)+` (via always-reduce ${i.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let u=0;uo?n.push(p):r.push(p)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return B0(e,n),!0}}runRecovery(e,n,r){let o=null,i=!1;for(let s=0;s ":"";if(l.deadEnd&&(i||(i=!0,l.restart(),Kn&&console.log(c+this.stackID(l)+" (restarted)"),this.advanceFully(l,r))))continue;let d=l.split(),f=c;for(let h=0;d.forceReduce()&&h<10&&(Kn&&console.log(f+this.stackID(d)+" (via force-reduce)"),!this.advanceFully(d,r));h++)Kn&&(f=this.stackID(d)+" -> ");for(let h of l.recoverByInsert(a))Kn&&console.log(c+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,r);this.stream.end>l.pos?(u==l.pos&&(u++,a=0),l.recoverByDelete(a,u),Kn&&console.log(c+this.stackID(l)+` (via recover-delete ${this.parser.getName(a)})`),B0(l,r)):(!o||o.scoree.topRules[l][1]),o=[];for(let l=0;l=0)i(c,a,l[u++]);else{let d=l[u+-c];for(let f=-c;f>0;f--)i(l[u++],a,d);u++}}}this.nodeSet=new cf(n.map((l,a)=>En.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:o[a],top:r.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=e$;let s=Vu(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new Is(s,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,r){let o=new cQ(this,e,n,r);for(let i of this.wrappers)o=i(o,e,n,r);return o}getGoto(e,n,r=!1){let o=this.goto;if(n>=o[0])return-1;for(let i=o[n+1];;){let s=o[i++],l=s&1,a=o[i++];if(l&&r)return a;for(let u=i+(s>>1);i0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),o=r?n(r):void 0;for(let i=this.stateSlot(e,1);o==null;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=io(this.data,i+2);else break;o=n(io(this.data,i+1))}return o}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=io(this.data,r+2);else break;if(!(this.data[r+2]&1)){let o=this.data[r+1];n.some((i,s)=>s&1&&i==o)||n.push(this.data[r],o)}}return n}configure(e){let n=Object.assign(Object.create(Qc.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let o=e.tokenizers.find(i=>i.from==r);return o?o.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,o)=>{let i=e.specializers.find(l=>l.from==r.external);if(!i)return r;let s=Object.assign(Object.assign({},r),{external:i.to});return n.specializers[o]=M0(s),s})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let i of e.split(" ")){let s=n.indexOf(i);s>=0&&(r[s]=!0)}let o=null;for(let i=0;ir)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.scoret.external(n,r)<<1|e}return t.get}let hQ=0;class Fr{constructor(e,n,r){this.set=e,this.base=n,this.modified=r,this.id=hQ++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let n=new Fr([],null,[]);if(n.set.push(n),e)for(let r of e.set)n.set.push(r);return n}static defineModifier(){let e=new Zc;return n=>n.modified.indexOf(e)>-1?n:Zc.get(n.base||n,n.modified.concat(e).sort((r,o)=>r.id-o.id))}}let pQ=0;class Zc{constructor(){this.instances=[],this.id=pQ++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(l=>l.base==e&&mQ(n,l.modified));if(r)return r;let o=[],i=new Fr(o,e,n);for(let l of n)l.instances.push(i);let s=gQ(n);for(let l of e.set)if(!l.modified.length)for(let a of s)o.push(Zc.get(l,a));return i}}function mQ(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function gQ(t){let e=[[]];for(let n=0;nr.length-n.length)}function o$(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let o of n.split(" "))if(o){let i=[],s=2,l=o;for(let d=0;;){if(l=="..."&&d>0&&d+3==o.length){s=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!f)throw new RangeError("Invalid path: "+o);if(i.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),d+=f[0].length,d==o.length)break;let h=o[d++];if(d==o.length&&h=="!"){s=0;break}if(h!="/")throw new RangeError("Invalid path: "+o);l=o.slice(d)}let a=i.length-1,u=i[a];if(!u)throw new RangeError("Invalid path: "+o);let c=new ed(r,s,a>0?i.slice(0,a):null);e[u]=c.sort(e[u])}}return i$.add(e)}const i$=new it;let ed=class{constructor(e,n,r,o){this.tags=e,this.mode=n,this.context=r,this.next=o}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let s=o;for(let l of i)for(let a of l.set){let u=n[a.id];if(u){s=s?s+" "+u:u;break}}return s},scope:r}}function vQ(t,e){let n=null;for(let r of t){let o=r.style(e);o&&(n=n?n+" "+o:o)}return n}function yQ(t,e,n,r=0,o=t.length){let i=new bQ(r,Array.isArray(e)?e:[e],n);i.highlightRange(t.cursor(),r,o,"",i.highlighters),i.flush(o)}class bQ{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,o,i){let{type:s,from:l,to:a}=e;if(l>=r||a<=n)return;s.isTop&&(i=this.highlighters.filter(h=>!h.scope||h.scope(s)));let u=o,c=SQ(e)||ed.empty,d=vQ(i,c.tags);if(d&&(u&&(u+=" "),u+=d,c.mode==1&&(o+=(o?" ":"")+d)),this.startSpan(Math.max(n,l),u),c.opaque)return;let f=e.tree&&e.tree.prop(it.mounted);if(f&&f.overlay){let h=e.node.enter(f.overlay[0].from+l,1),p=this.highlighters.filter(y=>!y.scope||y.scope(f.tree.type)),v=e.firstChild();for(let y=0,b=l;;y++){let S=y=w||!e.nextSibling())););if(!S||w>r)break;b=S.to+l,b>n&&(this.highlightRange(h.cursor(),Math.max(n,S.from+l),Math.min(r,b),"",p),this.startSpan(Math.min(r,b),u))}v&&e.parent()}else if(e.firstChild()){f&&(o="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,o,i),this.startSpan(Math.min(r,e.to),u)}while(e.nextSibling());e.parent()}}}function SQ(t){let e=t.type.prop(i$);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const Te=Fr.define,Ru=Te(),No=Te(),I0=Te(No),D0=Te(No),Ho=Te(),Fu=Te(Ho),th=Te(Ho),Rr=Te(),Ai=Te(Rr),Er=Te(),Lr=Te(),hp=Te(),Fl=Te(hp),Nu=Te(),xe={comment:Ru,lineComment:Te(Ru),blockComment:Te(Ru),docComment:Te(Ru),name:No,variableName:Te(No),typeName:I0,tagName:Te(I0),propertyName:D0,attributeName:Te(D0),className:Te(No),labelName:Te(No),namespace:Te(No),macroName:Te(No),literal:Ho,string:Fu,docString:Te(Fu),character:Te(Fu),attributeValue:Te(Fu),number:th,integer:Te(th),float:Te(th),bool:Te(Ho),regexp:Te(Ho),escape:Te(Ho),color:Te(Ho),url:Te(Ho),keyword:Er,self:Te(Er),null:Te(Er),atom:Te(Er),unit:Te(Er),modifier:Te(Er),operatorKeyword:Te(Er),controlKeyword:Te(Er),definitionKeyword:Te(Er),moduleKeyword:Te(Er),operator:Lr,derefOperator:Te(Lr),arithmeticOperator:Te(Lr),logicOperator:Te(Lr),bitwiseOperator:Te(Lr),compareOperator:Te(Lr),updateOperator:Te(Lr),definitionOperator:Te(Lr),typeOperator:Te(Lr),controlOperator:Te(Lr),punctuation:hp,separator:Te(hp),bracket:Fl,angleBracket:Te(Fl),squareBracket:Te(Fl),paren:Te(Fl),brace:Te(Fl),content:Rr,heading:Ai,heading1:Te(Ai),heading2:Te(Ai),heading3:Te(Ai),heading4:Te(Ai),heading5:Te(Ai),heading6:Te(Ai),contentSeparator:Te(Rr),list:Te(Rr),quote:Te(Rr),emphasis:Te(Rr),strong:Te(Rr),link:Te(Rr),monospace:Te(Rr),strikethrough:Te(Rr),inserted:Te(),deleted:Te(),changed:Te(),invalid:Te(),meta:Nu,documentMeta:Te(Nu),annotation:Te(Nu),processingInstruction:Te(Nu),definition:Fr.defineModifier(),constant:Fr.defineModifier(),function:Fr.defineModifier(),standard:Fr.defineModifier(),local:Fr.defineModifier(),special:Fr.defineModifier()};s$([{tag:xe.link,class:"tok-link"},{tag:xe.heading,class:"tok-heading"},{tag:xe.emphasis,class:"tok-emphasis"},{tag:xe.strong,class:"tok-strong"},{tag:xe.keyword,class:"tok-keyword"},{tag:xe.atom,class:"tok-atom"},{tag:xe.bool,class:"tok-bool"},{tag:xe.url,class:"tok-url"},{tag:xe.labelName,class:"tok-labelName"},{tag:xe.inserted,class:"tok-inserted"},{tag:xe.deleted,class:"tok-deleted"},{tag:xe.literal,class:"tok-literal"},{tag:xe.string,class:"tok-string"},{tag:xe.number,class:"tok-number"},{tag:[xe.regexp,xe.escape,xe.special(xe.string)],class:"tok-string2"},{tag:xe.variableName,class:"tok-variableName"},{tag:xe.local(xe.variableName),class:"tok-variableName tok-local"},{tag:xe.definition(xe.variableName),class:"tok-variableName tok-definition"},{tag:xe.special(xe.variableName),class:"tok-variableName2"},{tag:xe.definition(xe.propertyName),class:"tok-propertyName tok-definition"},{tag:xe.typeName,class:"tok-typeName"},{tag:xe.namespace,class:"tok-namespace"},{tag:xe.className,class:"tok-className"},{tag:xe.macroName,class:"tok-macroName"},{tag:xe.propertyName,class:"tok-propertyName"},{tag:xe.operator,class:"tok-operator"},{tag:xe.comment,class:"tok-comment"},{tag:xe.meta,class:"tok-meta"},{tag:xe.invalid,class:"tok-invalid"},{tag:xe.punctuation,class:"tok-punctuation"}]);const CQ=o$({String:xe.string,Number:xe.number,"True False":xe.bool,PropertyName:xe.propertyName,Null:xe.null,",":xe.separator,"[ ]":xe.squareBracket,"{ }":xe.brace}),wQ=Qc.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[CQ],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0});class kt{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=Zs(this,e,n);let o=[];return this.decompose(0,e,o,2),r.length&&r.decompose(0,r.length,o,3),this.decompose(n,this.length,o,1),zr.from(o,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Zs(this,e,n);let r=[];return this.decompose(e,n,r,0),zr.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),o=new ua(this),i=new ua(e);for(let s=n,l=n;;){if(o.next(s),i.next(s),s=0,o.lineBreak!=i.lineBreak||o.done!=i.done||o.value!=i.value)return!1;if(l+=o.value.length,o.done||l>=r)return!0}}iter(e=1){return new ua(this,e)}iterRange(e,n=this.length){return new l$(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let o=this.line(e).from;r=this.iterRange(o,Math.max(o,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new a$(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?kt.empty:e.length<=32?new Xt(e):zr.from(Xt.split(e,[]))}}class Xt extends kt{constructor(e,n=kQ(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,o){for(let i=0;;i++){let s=this.text[i],l=o+s.length;if((n?r:l)>=e)return new xQ(o,l,r,s);o=l+1,r++}}decompose(e,n,r,o){let i=e<=0&&n>=this.length?this:new Xt(E0(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(o&1){let s=r.pop(),l=vc(i.text,s.text.slice(),0,i.length);if(l.length<=32)r.push(new Xt(l,s.length+i.length));else{let a=l.length>>1;r.push(new Xt(l.slice(0,a)),new Xt(l.slice(a)))}}else r.push(i)}replace(e,n,r){if(!(r instanceof Xt))return super.replace(e,n,r);[e,n]=Zs(this,e,n);let o=vc(this.text,vc(r.text,E0(this.text,0,e)),n),i=this.length+r.length-(n-e);return o.length<=32?new Xt(o,i):zr.from(Xt.split(o,[]),i)}sliceString(e,n=this.length,r=`
+`){[e,n]=Zs(this,e,n);let o="";for(let i=0,s=0;i<=n&&se&&s&&(o+=r),ei&&(o+=l.slice(Math.max(0,e-i),n-i)),i=a+1}return o}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],o=-1;for(let i of e)r.push(i),o+=i.length+1,r.length==32&&(n.push(new Xt(r,o)),r=[],o=-1);return o>-1&&n.push(new Xt(r,o)),n}}class zr extends kt{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,o){for(let i=0;;i++){let s=this.children[i],l=o+s.length,a=r+s.lines-1;if((n?a:l)>=e)return s.lineInner(e,n,r,o);o=l+1,r=a+1}}decompose(e,n,r,o){for(let i=0,s=0;s<=n&&i=s){let u=o&((s<=e?1:0)|(a>=n?2:0));s>=e&&a<=n&&!u?r.push(l):l.decompose(e-s,n-s,r,u)}s=a+1}}replace(e,n,r){if([e,n]=Zs(this,e,n),r.lines=i&&n<=l){let a=s.replace(e-i,n-i,r),u=this.lines-s.lines+a.lines;if(a.lines>4&&a.lines>u>>6){let c=this.children.slice();return c[o]=a,new zr(c,this.length-(n-e)+r.length)}return super.replace(i,l,a)}i=l+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=`
+`){[e,n]=Zs(this,e,n);let o="";for(let i=0,s=0;ie&&i&&(o+=r),es&&(o+=l.sliceString(e-s,n-s,r)),s=a+1}return o}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof zr))return 0;let r=0,[o,i,s,l]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;o+=n,i+=n){if(o==s||i==l)return r;let a=this.children[o],u=e.children[i];if(a!=u)return r+a.scanIdentical(u,n);r+=a.length+1}}static from(e,n=e.reduce((r,o)=>r+o.length+1,-1)){let r=0;for(let h of e)r+=h.lines;if(r<32){let h=[];for(let p of e)p.flatten(h);return new Xt(h,n)}let o=Math.max(32,r>>5),i=o<<1,s=o>>1,l=[],a=0,u=-1,c=[];function d(h){let p;if(h.lines>i&&h instanceof zr)for(let v of h.children)d(v);else h.lines>s&&(a>s||!a)?(f(),l.push(h)):h instanceof Xt&&a&&(p=c[c.length-1])instanceof Xt&&h.lines+p.lines<=32?(a+=h.lines,u+=h.length+1,c[c.length-1]=new Xt(p.text.concat(h.text),p.length+1+h.length)):(a+h.lines>o&&f(),a+=h.lines,u+=h.length+1,c.push(h))}function f(){a!=0&&(l.push(c.length==1?c[0]:zr.from(c,u)),u=-1,a=c.length=0)}for(let h of e)d(h);return f(),l.length==1?l[0]:new zr(l,n)}}kt.empty=new Xt([""],0);function kQ(t){let e=-1;for(let n of t)e+=n.length+1;return e}function vc(t,e,n=0,r=1e9){for(let o=0,i=0,s=!0;i=n&&(a>r&&(l=l.slice(0,r-o)),o0?1:(e instanceof Xt?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,o=this.nodes[r],i=this.offsets[r],s=i>>1,l=o instanceof Xt?o.text.length:o.children.length;if(s==(n>0?l:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=`
+`,this;e--}else if(o instanceof Xt){let a=o.text[s+(n<0?-1:0)];if(this.offsets[r]+=n,a.length>Math.max(0,e))return this.value=e==0?a:n>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=o.children[s+(n<0?-1:0)];e>a.length?(e-=a.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(a),this.offsets.push(n>0?1:(a instanceof Xt?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class l${constructor(e,n,r){this.value="",this.done=!1,this.cursor=new ua(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:o}=this.cursor.next(e);return this.pos+=(o.length+e)*n,this.value=o.length<=r?o:n<0?o.slice(o.length-r):o.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class a${constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:o}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=o,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(kt.prototype[Symbol.iterator]=function(){return this.iter()},ua.prototype[Symbol.iterator]=l$.prototype[Symbol.iterator]=a$.prototype[Symbol.iterator]=function(){return this});class xQ{constructor(e,n,r,o){this.from=e,this.to=n,this.number=r,this.text=o}get length(){return this.to-this.from}}function Zs(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}let Ds="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let t=1;tt)return Ds[e-1]<=t;return!1}function L0(t){return t>=127462&&t<=127487}const V0=8205;function bn(t,e,n=!0,r=!0){return(n?u$:AQ)(t,e,r)}function u$(t,e,n){if(e==t.length)return e;e&&c$(t.charCodeAt(e))&&d$(t.charCodeAt(e-1))&&e--;let r=hn(t,e);for(e+=sr(r);e=0&&L0(hn(t,s));)i++,s-=2;if(i%2==0)break;e+=2}else break}return e}function AQ(t,e,n){for(;e>0;){let r=u$(t,e-2,n);if(r=56320&&t<57344}function d$(t){return t>=55296&&t<56320}function hn(t,e){let n=t.charCodeAt(e);if(!d$(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return c$(r)?(n-55296<<10)+(r-56320)+65536:n}function Og(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function sr(t){return t<65536?1:2}const pp=/\r\n?|\n/;var Bn=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(Bn||(Bn={}));class Gr{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;ne)return i+(e-o);i+=l}else{if(r!=Bn.Simple&&u>=e&&(r==Bn.TrackDel&&oe||r==Bn.TrackBefore&&oe))return null;if(u>e||u==e&&n<0&&!l)return e==o||n<0?i:i+a;i+=a}o=u}if(e>o)throw new RangeError(`Position ${e} is out of range for changeset of length ${o}`);return i}touchesRange(e,n=e){for(let r=0,o=0;r=0&&o<=n&&l>=e)return on?"cover":!0;o=l}return!1}toString(){let e="";for(let n=0;n=0?":"+o:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Gr(e)}static create(e){return new Gr(e)}}class rn extends Gr{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return mp(this,(n,r,o,i,s)=>e=e.replace(o,o+(r-n),s),!1),e}mapDesc(e,n=!1){return gp(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let o=0,i=0;o=0){n[o]=l,n[o+1]=s;let a=o>>1;for(;r.length0&&Ko(r,n,i.text),i.forward(c),l+=c}let u=e[s++];for(;l>1].toJSON()))}return e}static of(e,n,r){let o=[],i=[],s=0,l=null;function a(c=!1){if(!c&&!o.length)return;sf||d<0||f>n)throw new RangeError(`Invalid change range ${d} to ${f} (in doc of length ${n})`);let p=h?typeof h=="string"?kt.of(h.split(r||pp)):h:kt.empty,v=p.length;if(d==f&&v==0)return;ds&&wn(o,d-s,-1),wn(o,f-d,v),Ko(i,o,p),s=f}}return u(e),a(!l),l}static empty(e){return new rn(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let o=0;ol&&typeof s!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(i.length==1)n.push(i[0],0);else{for(;r.length=0&&n<=0&&n==t[o+1]?t[o]+=e:e==0&&t[o]==0?t[o+1]+=n:r?(t[o]+=e,t[o+1]+=n):t.push(e,n)}function Ko(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r>1])),!(n||s==t.sections.length||t.sections[s+1]<0);)l=t.sections[s++],a=t.sections[s++];e(o,u,i,c,d),o=u,i=c}}}function gp(t,e,n,r=!1){let o=[],i=r?[]:null,s=new Oa(t),l=new Oa(e);for(let a=-1;;)if(s.ins==-1&&l.ins==-1){let u=Math.min(s.len,l.len);wn(o,u,-1),s.forward(u),l.forward(u)}else if(l.ins>=0&&(s.ins<0||a==s.i||s.off==0&&(l.len=0&&a=0){let u=0,c=s.len;for(;c;)if(l.ins==-1){let d=Math.min(c,l.len);u+=d,c-=d,l.forward(d)}else if(l.ins==0&&l.lena||s.ins>=0&&s.len>a)&&(l||r.length>u),i.forward2(a),s.forward(a)}}}}class Oa{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return n>=e.length?kt.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?kt.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Ri{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,o;return this.empty?r=o=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),o=e.mapPos(this.to,-1)),r==this.from&&o==this.to?this:new Ri(r,o,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return le.range(e,n);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return le.range(this.anchor,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return le.range(e.anchor,e.head)}static create(e,n,r){return new Ri(e,n,r)}}class le{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:le.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;re.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new le(e.ranges.map(n=>Ri.fromJSON(n)),e.main)}static single(e,n=e){return new le([le.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,o=0;oe?8:0)|i)}static normalized(e,n=0){let r=e[n];e.sort((o,i)=>o.from-i.from),n=e.indexOf(r);for(let o=1;oi.head?le.range(a,l):le.range(l,a))}}return new le(e,n)}}function h$(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let Pg=0;class Ee{constructor(e,n,r,o,i){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=o,this.id=Pg++,this.default=e([]),this.extensions=typeof i=="function"?i(this):i}get reader(){return this}static define(e={}){return new Ee(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:Bg),!!e.static,e.enables)}of(e){return new yc([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new yc(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new yc(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function Bg(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class yc{constructor(e,n,r,o){this.dependencies=e,this.facet=n,this.type=r,this.value=o,this.id=Pg++}dynamicSlot(e){var n;let r=this.value,o=this.facet.compareInput,i=this.id,s=e[i]>>1,l=this.type==2,a=!1,u=!1,c=[];for(let d of this.dependencies)d=="doc"?a=!0:d=="selection"?u=!0:((n=e[d.id])!==null&&n!==void 0?n:1)&1||c.push(e[d.id]);return{create(d){return d.values[s]=r(d),1},update(d,f){if(a&&f.docChanged||u&&(f.docChanged||f.selection)||vp(d,c)){let h=r(d);if(l?!R0(h,d.values[s],o):!o(h,d.values[s]))return d.values[s]=h,1}return 0},reconfigure:(d,f)=>{let h,p=f.config.address[i];if(p!=null){let v=nd(f,p);if(this.dependencies.every(y=>y instanceof Ee?f.facet(y)===d.facet(y):y instanceof Cn?f.field(y,!1)==d.field(y,!1):!0)||(l?R0(h=r(d),v,o):o(h=r(d),v)))return d.values[s]=v,0}else h=r(d);return d.values[s]=h,1}}}}function R0(t,e,n){if(t.length!=e.length)return!1;for(let r=0;rt[a.id]),o=n.map(a=>a.type),i=r.filter(a=>!(a&1)),s=t[e.id]>>1;function l(a){let u=[];for(let c=0;cr===o),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(F0).find(r=>r.field==this);return((n==null?void 0:n.create)||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,o)=>{let i=r.values[n],s=this.updateF(i,o);return this.compareF(i,s)?0:(r.values[n]=s,1)},reconfigure:(r,o)=>o.config.address[this.id]!=null?(r.values[n]=o.field(this),0):(r.values[n]=this.create(r),1)}}init(e){return[this,F0.of({field:this,create:e})]}get extension(){return this}}const Bi={lowest:4,low:3,default:2,high:1,highest:0};function Nl(t){return e=>new p$(e,t)}const ps={highest:Nl(Bi.highest),high:Nl(Bi.high),default:Nl(Bi.default),low:Nl(Bi.low),lowest:Nl(Bi.lowest)};class p${constructor(e,n){this.inner=e,this.prec=n}}class su{of(e){return new yp(this,e)}reconfigure(e){return su.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class yp{constructor(e,n){this.compartment=e,this.inner=n}}class td{constructor(e,n,r,o,i,s){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=o,this.staticValues=i,this.facets=s,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,n,r){let o=[],i=Object.create(null),s=new Map;for(let f of _Q(e,n,s))f instanceof Cn?o.push(f):(i[f.facet.id]||(i[f.facet.id]=[])).push(f);let l=Object.create(null),a=[],u=[];for(let f of o)l[f.id]=u.length<<1,u.push(h=>f.slot(h));let c=r==null?void 0:r.config.facets;for(let f in i){let h=i[f],p=h[0].facet,v=c&&c[f]||[];if(h.every(y=>y.type==0))if(l[p.id]=a.length<<1|1,Bg(v,h))a.push(r.facet(p));else{let y=p.combine(h.map(b=>b.value));a.push(r&&p.compare(y,r.facet(p))?r.facet(p):y)}else{for(let y of h)y.type==0?(l[y.id]=a.length<<1|1,a.push(y.value)):(l[y.id]=u.length<<1,u.push(b=>y.dynamicSlot(b)));l[p.id]=u.length<<1,u.push(y=>TQ(y,p,h))}}let d=u.map(f=>f(l));return new td(e,s,d,l,a,i)}}function _Q(t,e,n){let r=[[],[],[],[],[]],o=new Map;function i(s,l){let a=o.get(s);if(a!=null){if(a<=l)return;let u=r[a].indexOf(s);u>-1&&r[a].splice(u,1),s instanceof yp&&n.delete(s.compartment)}if(o.set(s,l),Array.isArray(s))for(let u of s)i(u,l);else if(s instanceof yp){if(n.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=e.get(s.compartment)||s.inner;n.set(s.compartment,u),i(u,l)}else if(s instanceof p$)i(s.inner,s.prec);else if(s instanceof Cn)r[l].push(s),s.provides&&i(s.provides,l);else if(s instanceof yc)r[l].push(s),s.facet.extensions&&i(s.facet.extensions,Bi.default);else{let u=s.extension;if(!u)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);i(u,l)}}return i(t,Bi.default),r.reduce((s,l)=>s.concat(l))}function ca(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let o=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|o}function nd(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const m$=Ee.define(),bp=Ee.define({combine:t=>t.some(e=>e),static:!0}),g$=Ee.define({combine:t=>t.length?t[0]:void 0,static:!0}),v$=Ee.define(),y$=Ee.define(),b$=Ee.define(),S$=Ee.define({combine:t=>t.length?t[0]:!1});class $o{constructor(e,n){this.type=e,this.value=n}static define(){return new OQ}}class OQ{of(e){return new $o(this,e)}}class PQ{constructor(e){this.map=e}of(e){return new ot(this,e)}}class ot{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new ot(this.type,n)}is(e){return this.type==e}static define(e={}){return new PQ(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let o of e){let i=o.map(n);i&&r.push(i)}return r}}ot.reconfigure=ot.define();ot.appendConfig=ot.define();class sn{constructor(e,n,r,o,i,s){this.startState=e,this.changes=n,this.selection=r,this.effects=o,this.annotations=i,this.scrollIntoView=s,this._doc=null,this._state=null,r&&h$(r,n.newLength),i.some(l=>l.type==sn.time)||(this.annotations=i.concat(sn.time.of(Date.now())))}static create(e,n,r,o,i,s){return new sn(e,n,r,o,i,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(sn.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}sn.time=$o.define();sn.userEvent=$o.define();sn.addToHistory=$o.define();sn.remote=$o.define();function BQ(t,e){let n=[];for(let r=0,o=0;;){let i,s;if(r=t[r]))i=t[r++],s=t[r++];else if(o=0;o--){let i=r[o](t);i instanceof sn?t=i:Array.isArray(i)&&i.length==1&&i[0]instanceof sn?t=i[0]:t=w$(e,Es(i),!1)}return t}function IQ(t){let e=t.startState,n=e.facet(b$),r=t;for(let o=n.length-1;o>=0;o--){let i=n[o](t);i&&Object.keys(i).length&&(r=C$(r,Sp(e,i,t.changes.newLength),!0))}return r==t?t:sn.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const DQ=[];function Es(t){return t==null?DQ:Array.isArray(t)?t:[t]}var Ut=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(Ut||(Ut={}));const EQ=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Cp;try{Cp=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function LQ(t){if(Cp)return Cp.test(t);for(let e=0;e""&&(n.toUpperCase()!=n.toLowerCase()||EQ.test(n)))return!0}return!1}function VQ(t){return e=>{if(!/\S/.test(e))return Ut.Space;if(LQ(e))return Ut.Word;for(let n=0;n-1)return Ut.Word;return Ut.Other}}class at{constructor(e,n,r,o,i,s){this.config=e,this.doc=n,this.selection=r,this.values=o,this.status=e.statusTemplate.slice(),this.computeSlot=i,s&&(s._state=this);for(let l=0;lo.set(u,a)),n=null),o.set(l.value.compartment,l.value.extension)):l.is(ot.reconfigure)?(n=null,r=l.value):l.is(ot.appendConfig)&&(n=null,r=Es(r).concat(l.value));let i;n?i=e.startState.values.slice():(n=td.resolve(r,o,this),i=new at(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(a,u)=>u.reconfigure(a,this),null).values);let s=e.startState.facet(bp)?e.newSelection:e.newSelection.asSingle();new at(n,e.newDoc,s,i,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:le.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),o=this.changes(r.changes),i=[r.range],s=Es(r.effects);for(let l=1;ls.spec.fromJSON(l,a)))}}return at.create({doc:e.doc,selection:le.fromJSON(e.selection),extensions:n.extensions?o.concat([n.extensions]):o})}static create(e={}){let n=td.resolve(e.extensions||[],new Map),r=e.doc instanceof kt?e.doc:kt.of((e.doc||"").split(n.staticFacet(at.lineSeparator)||pp)),o=e.selection?e.selection instanceof le?e.selection:le.single(e.selection.anchor,e.selection.head):le.single(0);return h$(o,r.length),n.staticFacet(bp)||(o=o.asSingle()),new at(n,r,o,n.dynamicSlots.map(()=>null),(i,s)=>s.create(i),null)}get tabSize(){return this.facet(at.tabSize)}get lineBreak(){return this.facet(at.lineSeparator)||`
+`}get readOnly(){return this.facet(S$)}phrase(e,...n){for(let r of this.facet(at.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,o)=>{if(o=="$")return"$";let i=+(o||1);return!i||i>n.length?r:n[i-1]})),e}languageDataAt(e,n,r=-1){let o=[];for(let i of this.facet(m$))for(let s of i(this,n,r))Object.prototype.hasOwnProperty.call(s,e)&&o.push(s[e]);return o}charCategorizer(e){return VQ(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:n,from:r,length:o}=this.doc.lineAt(e),i=this.charCategorizer(e),s=e-r,l=e-r;for(;s>0;){let a=bn(n,s,!1);if(i(n.slice(a,s))!=Ut.Word)break;s=a}for(;lt.length?t[0]:4});at.lineSeparator=g$;at.readOnly=S$;at.phrases=Ee.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(o=>t[o]==e[o])}});at.languageData=m$;at.changeFilter=v$;at.transactionFilter=y$;at.transactionExtender=b$;su.reconfigure=ot.define();function Zr(t,e,n={}){let r={};for(let o of t)for(let i of Object.keys(o)){let s=o[i],l=r[i];if(l===void 0)r[i]=s;else if(!(l===s||s===void 0))if(Object.hasOwnProperty.call(n,i))r[i]=n[i](l,s);else throw new Error("Config merge conflict for field "+i)}for(let o in e)r[o]===void 0&&(r[o]=e[o]);return r}class Ji{eq(e){return this==e}range(e,n=e){return Pa.create(e,n,this)}}Ji.prototype.startSide=Ji.prototype.endSide=0;Ji.prototype.point=!1;Ji.prototype.mapMode=Bn.TrackDel;class Pa{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new Pa(e,n,r)}}function wp(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class Mg{constructor(e,n,r,o){this.from=e,this.to=n,this.value=r,this.maxPoint=o}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,o=0){let i=r?this.to:this.from;for(let s=o,l=i.length;;){if(s==l)return s;let a=s+l>>1,u=i[a]-e||(r?this.value[a].endSide:this.value[a].startSide)-n;if(a==s)return u>=0?s:l;u>=0?l=a:s=a+1}}between(e,n,r,o){for(let i=this.findIndex(n,-1e9,!0),s=this.findIndex(r,1e9,!1,i);ih||f==h&&u.startSide>0&&u.endSide<=0)continue;(h-f||u.endSide-u.startSide)<0||(s<0&&(s=f),u.point&&(l=Math.max(l,h-f)),r.push(u),o.push(f-s),i.push(h-s))}return{mapped:r.length?new Mg(o,i,r,l):null,pos:s}}}class Ct{constructor(e,n,r,o){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=o}static create(e,n,r,o){return new Ct(e,n,r,o)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:o=0,filterTo:i=this.length}=e,s=e.filter;if(n.length==0&&!s)return this;if(r&&(n=n.slice().sort(wp)),this.isEmpty)return n.length?Ct.of(n):this;let l=new k$(this,null,-1).goto(0),a=0,u=[],c=new ai;for(;l.value||a=0){let d=n[a++];c.addInner(d.from,d.to,d.value)||u.push(d)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||il.to||i=i&&e<=i+s.length&&s.between(i,e-i,n-i,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return Ba.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return Ba.from(e).goto(n)}static compare(e,n,r,o,i=-1){let s=e.filter(d=>d.maxPoint>0||!d.isEmpty&&d.maxPoint>=i),l=n.filter(d=>d.maxPoint>0||!d.isEmpty&&d.maxPoint>=i),a=N0(s,l,r),u=new Hl(s,a,i),c=new Hl(l,a,i);r.iterGaps((d,f,h)=>H0(u,d,c,f,h,o)),r.empty&&r.length==0&&H0(u,0,c,0,0,o)}static eq(e,n,r=0,o){o==null&&(o=999999999);let i=e.filter(c=>!c.isEmpty&&n.indexOf(c)<0),s=n.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(i.length!=s.length)return!1;if(!i.length)return!0;let l=N0(i,s),a=new Hl(i,l,0).goto(r),u=new Hl(s,l,0).goto(r);for(;;){if(a.to!=u.to||!kp(a.active,u.active)||a.point&&(!u.point||!a.point.eq(u.point)))return!1;if(a.to>o)return!0;a.next(),u.next()}}static spans(e,n,r,o,i=-1){let s=new Hl(e,null,i).goto(n),l=n,a=s.openStart;for(;;){let u=Math.min(s.to,r);if(s.point){let c=s.activeForPoint(s.to),d=s.pointFroml&&(o.span(l,u,s.active,a),a=s.openEnd(u));if(s.to>r)return a+(s.point&&s.to>r?1:0);l=s.to,s.next()}}static of(e,n=!1){let r=new ai;for(let o of e instanceof Pa?[e]:n?RQ(e):e)r.add(o.from,o.to,o.value);return r.finish()}static join(e){if(!e.length)return Ct.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let o=e[r];o!=Ct.empty;o=o.nextLayer)n=new Ct(o.chunkPos,o.chunk,n,Math.max(o.maxPoint,n.maxPoint));return n}}Ct.empty=new Ct([],[],null,-1);function RQ(t){if(t.length>1)for(let e=t[0],n=1;n0)return t.slice().sort(wp);e=r}return t}Ct.empty.nextLayer=Ct.empty;class ai{finishChunk(e){this.chunks.push(new Mg(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new ai)).add(e,n,r)}addInner(e,n,r){let o=e-this.lastTo||r.startSide-this.last.endSide;if(o<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return o<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(Ct.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=Ct.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function N0(t,e,n){let r=new Map;for(let i of t)for(let s=0;s=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=r&&o.push(new k$(s,n,r,i));return o.length==1?o[0]:new Ba(o)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)nh(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)nh(this.heap,r);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),nh(this.heap,0)}}}function nh(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let o=t[r];if(r+1=0&&(o=t[r+1],r++),n.compare(o)<0)break;t[r]=n,t[e]=o,e=r}}class Hl{constructor(e,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Ba.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){Hu(this.active,e),Hu(this.activeTo,e),Hu(this.activeRank,e),this.minActive=z0(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:o,rank:i}=this.cursor;for(;n0;)n++;zu(this.active,n,r),zu(this.activeTo,n,o),zu(this.activeRank,n,i),e&&zu(e,n,this.cursor.from),this.minActive=z0(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let o=this.minActive;if(o>-1&&(this.activeTo[o]-this.cursor.from||this.active[o].endSide-this.cursor.startSide)<0){if(this.activeTo[o]>e){this.to=this.activeTo[o],this.endSide=this.active[o].endSide;break}this.removeActive(o),r&&Hu(r,o)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let i=this.cursor.value;if(!i.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from=0&&r[o]=0&&!(this.activeRank[r]e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function H0(t,e,n,r,o,i){t.goto(e),n.goto(r);let s=r+o,l=r,a=r-e;for(;;){let u=t.to+a-n.to||t.endSide-n.endSide,c=u<0?t.to+a:n.to,d=Math.min(c,s);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))&&kp(t.activeForPoint(t.to),n.activeForPoint(n.to))||i.comparePoint(l,d,t.point,n.point):d>l&&!kp(t.active,n.active)&&i.compareRange(l,d,t.active,n.active),c>s)break;l=c,u<=0&&t.next(),u>=0&&n.next()}}function kp(t,e){if(t.length!=e.length)return!1;for(let n=0;n=e;r--)t[r+1]=t[r];t[e]=n}function z0(t,e){let n=-1,r=1e9;for(let o=0;o=e)return o;if(o==t.length)break;i+=t.charCodeAt(o)==9?n-i%n:1,o=bn(t,o)}return r===!0?-1:t.length}const $p="ͼ",j0=typeof Symbol>"u"?"__"+$p:Symbol.for($p),Ap=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),W0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class ui{constructor(e,n){this.rules=[];let{finish:r}=n||{};function o(s){return/^@/.test(s)?[s]:s.split(/,\s*/)}function i(s,l,a,u){let c=[],d=/^@(\w+)\b/.exec(s[0]),f=d&&d[1]=="keyframes";if(d&&l==null)return a.push(s[0]+";");for(let h in l){let p=l[h];if(/&/.test(h))i(h.split(/,\s*/).map(v=>s.map(y=>v.replace(/&/,y))).reduce((v,y)=>v.concat(y)),p,a);else if(p&&typeof p=="object"){if(!d)throw new RangeError("The value of a property ("+h+") should be a primitive value.");i(o(h),p,c,f)}else p!=null&&c.push(h.replace(/_.*/,"").replace(/[A-Z]/g,v=>"-"+v.toLowerCase())+": "+p+";")}(c.length||f)&&a.push((r&&!d&&!u?s.map(r):s).join(", ")+" {"+c.join(" ")+"}")}for(let s in e)i(o(s),e[s],this.rules)}getRules(){return this.rules.join(`
+`)}static newName(){let e=W0[j0]||1;return W0[j0]=e+1,$p+e.toString(36)}static mount(e,n,r){let o=e[Ap],i=r&&r.nonce;o?i&&o.setNonce(i):o=new FQ(e,i),o.mount(Array.isArray(n)?n:[n],e)}}let U0=new Map;class FQ{constructor(e,n){let r=e.ownerDocument||e,o=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&o.CSSStyleSheet){let i=U0.get(r);if(i)return e[Ap]=i;this.sheet=new o.CSSStyleSheet,U0.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[Ap]=this}mount(e,n){let r=this.sheet,o=0,i=0;for(let s=0;s-1&&(this.modules.splice(a,1),i--,a=-1),a==-1){if(this.modules.splice(i++,0,l),r)for(let u=0;u",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},NQ=typeof navigator<"u"&&/Mac/.test(navigator.platform),HQ=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var pn=0;pn<10;pn++)ci[48+pn]=ci[96+pn]=String(pn);for(var pn=1;pn<=24;pn++)ci[pn+111]="F"+pn;for(var pn=65;pn<=90;pn++)ci[pn]=String.fromCharCode(pn+32),Ma[pn]=String.fromCharCode(pn);for(var rh in ci)Ma.hasOwnProperty(rh)||(Ma[rh]=ci[rh]);function zQ(t){var e=NQ&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||HQ&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Ma:ci)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}function rd(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function Tp(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function jQ(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function bc(t,e){if(!e.anchorNode)return!1;try{return Tp(t,e.anchorNode)}catch{return!1}}function el(t){return t.nodeType==3?Zi(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function da(t,e,n,r){return n?K0(t,e,n,r,-1)||K0(t,e,n,r,1):!1}function Qi(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function od(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function K0(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:fo(t))){if(t.nodeName=="DIV")return!1;let i=t.parentNode;if(!i||i.nodeType!=1)return!1;e=Qi(t)+(o<0?0:1),t=i}else if(t.nodeType==1){if(t=t.childNodes[e+(o<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=o<0?fo(t):0}else return!1}}function fo(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function df(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function WQ(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function x$(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function UQ(t,e,n,r,o,i,s,l){let a=t.ownerDocument,u=a.defaultView||window;for(let c=t,d=!1;c&&!d;)if(c.nodeType==1){let f,h=c==a.body,p=1,v=1;if(h)f=WQ(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(d=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let S=c.getBoundingClientRect();({scaleX:p,scaleY:v}=x$(c,S)),f={left:S.left,right:S.left+c.clientWidth*p,top:S.top,bottom:S.top+c.clientHeight*v}}let y=0,b=0;if(o=="nearest")e.top0&&e.bottom>f.bottom+b&&(b=e.bottom-f.bottom+b+s)):e.bottom>f.bottom&&(b=e.bottom-f.bottom+s,n<0&&e.top-b0&&e.right>f.right+y&&(y=e.right-f.right+y+i)):e.right>f.right&&(y=e.right-f.right+i,n<0&&e.leftn.clientHeight||n.scrollWidth>n.clientWidth)return n;n=n.assignedSlot||n.parentNode}else if(n.nodeType==11)n=n.host;else break;return null}class GQ{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?fo(n):0),r,Math.min(e.focusOffset,r?fo(r):0))}set(e,n,r,o){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=o}}let bs=null;function $$(t){if(t.setActive)return t.setActive();if(bs)return t.focus(bs);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(bs==null?{get preventScroll(){return bs={preventScroll:!0},!0}}:void 0),!bs){bs=!1;for(let n=0;nMath.max(1,t.scrollHeight-t.clientHeight-4)}function _$(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=fo(n)}else if(n.parentNode&&!od(n))r=Qi(n),n=n.parentNode;else return null}}function O$(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&rn)return d.domBoundsAround(e,n,u);if(f>=e&&o==-1&&(o=a,i=u),u>n&&d.dom.parentNode==this.dom){s=a,l=c;break}c=f,u=f+d.breakAfter}return{from:i,to:l<0?r+this.length:l,startDOM:(o?this.children[o-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:s=0?this.children[s].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let n=this.parent;n;n=n.parent){if(e&&(n.flags|=2),n.flags&1)return;n.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let n=e.parent;if(!n)return e;e=n}}replaceChildren(e,n,r=Ig){this.markDirty();for(let o=e;othis.pos||e==this.pos&&(n>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let r=this.children[--this.i];this.pos-=r.length+r.breakAfter}}}function B$(t,e,n,r,o,i,s,l,a){let{children:u}=t,c=u.length?u[e]:null,d=i.length?i[i.length-1]:null,f=d?d.breakAfter:s;if(!(e==r&&c&&!s&&!f&&i.length<2&&c.merge(n,o,i.length?d:null,n==0,l,a))){if(r0&&(!s&&i.length&&c.merge(n,c.length,i[0],!1,l,0)?c.breakAfter=i.shift().breakAfter:(n2);var De={mac:J0||/Mac/.test(Jn.platform),windows:/Win/.test(Jn.platform),linux:/Linux|X11/.test(Jn.platform),ie:ff,ie_version:I$?_p.documentMode||6:Pp?+Pp[1]:Op?+Op[1]:0,gecko:Y0,gecko_version:Y0?+(/Firefox\/(\d+)/.exec(Jn.userAgent)||[0,0])[1]:0,chrome:!!oh,chrome_version:oh?+oh[1]:0,ios:J0,android:/Android\b/.test(Jn.userAgent),webkit:X0,safari:D$,webkit_version:X0?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:_p.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const XQ=256;class Tr extends Dt{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,n){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(n&&n.node==this.dom&&(n.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,n,r){return this.flags&8||r&&(!(r instanceof Tr)||this.length-(n-e)+r.length>XQ||r.flags&8)?!1:(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(n),this.markDirty(),!0)}split(e){let n=new Tr(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),n.flags|=this.flags&8,n}localPosFromDOM(e,n){return e==this.dom?n:n?this.text.length:0}domAtPos(e){return new xn(this.dom,e)}domBoundsAround(e,n,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,n){return JQ(this.dom,e,n)}}class ho extends Dt{constructor(e,n=[],r=0){super(),this.mark=e,this.children=n,this.length=r;for(let o of n)o.setParent(this)}setAttrs(e){if(A$(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let n in this.mark.attrs)e.setAttribute(n,this.mark.attrs[n]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,n){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,n)}merge(e,n,r,o,i,s){return r&&(!(r instanceof ho&&r.mark.eq(this.mark))||e&&i<=0||ne&&n.push(r=e&&(o=i),r=a,i++}let s=this.length-e;return this.length=e,o>-1&&(this.children.length=o,this.markDirty()),new ho(this.mark,n,s)}domAtPos(e){return E$(this,e)}coordsAt(e,n){return V$(this,e,n)}}function JQ(t,e,n){let r=t.nodeValue.length;e>r&&(e=r);let o=e,i=e,s=0;e==0&&n<0||e==r&&n>=0?De.chrome||De.gecko||(e?(o--,s=1):i=0)?0:l.length-1];return De.safari&&!s&&a.width==0&&(a=Array.prototype.find.call(l,u=>u.width)||a),s?df(a,s<0):a||null}class Go extends Dt{static create(e,n,r){return new Go(e,n,r)}constructor(e,n,r){super(),this.widget=e,this.length=n,this.side=r,this.prevWidget=null}split(e){let n=Go.create(this.widget,this.length-e,this.side);return this.length-=e,n}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,n,r,o,i,s){return r&&(!(r instanceof Go)||!this.widget.compare(r.widget)||e>0&&i<=0||n0)?xn.before(this.dom):xn.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,n){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;let o=this.dom.getClientRects(),i=null;if(!o.length)return null;let s=this.side?this.side<0:e>0;for(let l=s?o.length-1:0;i=o[l],!(e>0?l==0:l==o.length-1||i.top0?xn.before(this.dom):xn.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return kt.empty}get isHidden(){return!0}}Tr.prototype.children=Go.prototype.children=tl.prototype.children=Ig;function E$(t,e){let n=t.dom,{children:r}=t,o=0;for(let i=0;oi&&e0;i--){let s=r[i-1];if(s.dom.parentNode==n)return s.domAtPos(s.length)}for(let i=o;i0&&e instanceof ho&&o.length&&(r=o[o.length-1])instanceof ho&&r.mark.eq(e.mark)?L$(r,e.children[0],n-1):(o.push(e),e.setParent(t)),t.length+=e.length}function V$(t,e,n){let r=null,o=-1,i=null,s=-1;function l(u,c){for(let d=0,f=0;d=c&&(h.children.length?l(h,c-f):(!i||i.isHidden&&n>0)&&(p>c||f==p&&h.getSide()>0)?(i=h,s=c-f):(f-1?1:0)!=o.length-(n&&o.indexOf(n)>-1?1:0))return!1;for(let i of r)if(i!=n&&(o.indexOf(i)==-1||t[i]!==e[i]))return!1;return!0}function Mp(t,e,n){let r=!1;if(e)for(let o in e)n&&o in n||(r=!0,o=="style"?t.style.cssText="":t.removeAttribute(o));if(n)for(let o in n)e&&e[o]==n[o]||(r=!0,o=="style"?t.style.cssText=n[o]:t.setAttribute(o,n[o]));return r}function ZQ(t){let e=Object.create(null);for(let n=0;n0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=e,n}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){Dg(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,n){L$(this,e,n)}addLineDeco(e){let n=e.spec.attributes,r=e.spec.class;n&&(this.attrs=Bp(n,this.attrs||{})),r&&(this.attrs=Bp({class:r},this.attrs||{}))}domAtPos(e){return E$(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,n){var r;this.dom?this.flags&4&&(A$(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(Mp(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,n);let o=this.dom.lastChild;for(;o&&Dt.get(o)instanceof ho;)o=o.lastChild;if(!o||!this.length||o.nodeName!="BR"&&((r=Dt.get(o))===null||r===void 0?void 0:r.isEditable)==!1&&(!De.ios||!this.children.some(i=>i instanceof Tr))){let i=document.createElement("BR");i.cmIgnore=!0,this.dom.appendChild(i)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,n;for(let r of this.children){if(!(r instanceof Tr)||/[^ -~]/.test(r.text))return null;let o=el(r.dom);if(o.length!=1)return null;e+=o[0].width,n=o[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:n}:null}coordsAt(e,n){let r=V$(this,e,n);if(!this.children.length&&r&&this.parent){let{heightOracle:o}=this.parent.view.viewState,i=r.bottom-r.top;if(Math.abs(i-o.lineHeight)<2&&o.textHeight=n){if(i instanceof nn)return i;if(s>n)break}o=s+i.breakAfter}return null}}class Jo extends Dt{constructor(e,n,r){super(),this.widget=e,this.length=n,this.deco=r,this.breakAfter=0,this.prevWidget=null}merge(e,n,r,o,i,s){return r&&(!(r instanceof Jo)||!this.widget.compare(r.widget)||e>0&&i<=0||n0}}class Ao{eq(e){return!1}updateDOM(e,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var In=function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t}(In||(In={}));class We extends Ji{constructor(e,n,r,o){super(),this.startSide=e,this.endSide=n,this.widget=r,this.spec=o}get heightRelevant(){return!1}static mark(e){return new lu(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return n+=r&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new di(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,o;if(e.isBlockGap)r=-5e8,o=4e8;else{let{start:i,end:s}=R$(e,n);r=(i?n?-3e8:-1:5e8)-1,o=(s?n?2e8:1:-6e8)+1}return new di(e,r,o,n,e.widget||null,!0)}static line(e){return new au(e)}static set(e,n=!1){return Ct.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}We.none=Ct.empty;class lu extends We{constructor(e){let{start:n,end:r}=R$(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var n,r;return this==e||e instanceof lu&&this.tagName==e.tagName&&(this.class||((n=this.attrs)===null||n===void 0?void 0:n.class))==(e.class||((r=e.attrs)===null||r===void 0?void 0:r.class))&&Dg(this.attrs,e.attrs,"class")}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}lu.prototype.point=!1;class au extends We{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof au&&this.spec.class==e.spec.class&&Dg(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}au.prototype.mapMode=Bn.TrackBefore;au.prototype.point=!0;class di extends We{constructor(e,n,r,o,i,s){super(n,r,i,e),this.block=o,this.isReplace=s,this.mapMode=o?n<=0?Bn.TrackBefore:Bn.TrackAfter:Bn.TrackDel}get type(){return this.startSide!=this.endSide?In.WidgetRange:this.startSide<=0?In.WidgetBefore:In.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof di&&eZ(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}di.prototype.point=!0;function R$(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function eZ(t,e){return t==e||!!(t&&e&&t.compare(e))}function Ip(t,e,n,r=0){let o=n.length-1;o>=0&&n[o]+r>=t?n[o]=Math.max(n[o],e):n.push(t,e)}class fa{constructor(e,n,r,o){this.doc=e,this.pos=n,this.end=r,this.disallowBlockEffectsFor=o,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=n}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof Jo&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new nn),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(ju(new tl(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof Jo)&&this.getLine()}buildText(e,n,r){for(;e>0;){if(this.textOff==this.text.length){let{value:i,lineBreak:s,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(s){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=i,this.textOff=0}let o=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(n.slice(n.length-r)),this.getLine().append(ju(new Tr(this.text.slice(this.textOff,this.textOff+o)),n),r),this.atCursorPos=!0,this.textOff+=o,e-=o,r=0}}span(e,n,r,o){this.buildText(n-e,r,o),this.pos=n,this.openStart<0&&(this.openStart=o)}point(e,n,r,o,i,s){if(this.disallowBlockEffectsFor[s]&&r instanceof di){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(n>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=n-e;if(r instanceof di)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Jo(r.widget||nl.block,l,r));else{let a=Go.create(r.widget||nl.inline,l,l?0:r.startSide),u=this.atCursorPos&&!a.isEditable&&i<=o.length&&(e0),c=!a.isEditable&&(eo.length||r.startSide<=0),d=this.getLine();this.pendingBuffer==2&&!u&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(o),u&&(d.append(ju(new tl(1),o),i),i=o.length+Math.max(0,i-o.length)),d.append(ju(a,o),i),this.atCursorPos=c,this.pendingBuffer=c?eo.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=o.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=n),this.openStart<0&&(this.openStart=i)}static build(e,n,r,o,i){let s=new fa(e,n,r,i);return s.openEnd=Ct.spans(o,n,r,s),s.openStart<0&&(s.openStart=s.openEnd),s.finish(s.openEnd),s}}function ju(t,e){for(let n of e)t=new ho(n,[t],t.length);return t}class nl extends Ao{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}nl.inline=new nl("span");nl.block=new nl("div");var zt=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t}(zt||(zt={}));const es=zt.LTR,Eg=zt.RTL;function F$(t){let e=[];for(let n=0;n=n){if(l.level==r)return s;(i<0||(o!=0?o<0?l.fromn:e[i].level>l.level))&&(i=s)}}if(i<0)throw new RangeError("Index out of range");return i}}function H$(t,e){if(t.length!=e.length)return!1;for(let n=0;n=0;v-=3)if(Vr[v+1]==-h){let y=Vr[v+2],b=y&2?o:y&4?y&1?i:o:0;b&&(It[d]=It[Vr[v]]=b),l=v;break}}else{if(Vr.length==189)break;Vr[l++]=d,Vr[l++]=f,Vr[l++]=a}else if((p=It[d])==2||p==1){let v=p==o;a=v?0:1;for(let y=l-3;y>=0;y-=3){let b=Vr[y+2];if(b&2)break;if(v)Vr[y+2]|=2;else{if(b&4)break;Vr[y+2]|=4}}}}}function sZ(t,e,n,r){for(let o=0,i=r;o<=n.length;o++){let s=o?n[o-1].to:t,l=oa;)p==y&&(p=n[--v].from,y=v?n[v-1].to:t),It[--p]=h;a=c}else i=u,a++}}}function Ep(t,e,n,r,o,i,s){let l=r%2?2:1;if(r%2==o%2)for(let a=e,u=0;aa&&s.push(new qo(a,v.from,h));let y=v.direction==es!=!(h%2);Lp(t,y?r+1:r,o,v.inner,v.from,v.to,s),a=v.to}p=v.to}else{if(p==n||(c?It[p]!=l:It[p]==l))break;p++}f?Ep(t,a,p,r+1,o,f,s):ae;){let c=!0,d=!1;if(!u||a>i[u-1].to){let v=It[a-1];v!=l&&(c=!1,d=v==16)}let f=!c&&l==1?[]:null,h=c?r:r+1,p=a;e:for(;;)if(u&&p==i[u-1].to){if(d)break e;let v=i[--u];if(!c)for(let y=v.from,b=u;;){if(y==e)break e;if(b&&i[b-1].to==y)y=i[--b].from;else{if(It[y-1]==l)break e;break}}if(f)f.push(v);else{v.toIt.length;)It[It.length]=256;let r=[],o=e==es?0:1;return Lp(t,o,o,n,0,t.length,r),r}function z$(t){return[new qo(0,t,0)]}let j$="";function aZ(t,e,n,r,o){var i;let s=r.head-t.from,l=qo.find(e,s,(i=r.bidiLevel)!==null&&i!==void 0?i:-1,r.assoc),a=e[l],u=a.side(o,n);if(s==u){let f=l+=o?1:-1;if(f<0||f>=e.length)return null;a=e[l=f],s=a.side(!o,n),u=a.side(o,n)}let c=bn(t.text,s,a.forward(o,n));(ca.to)&&(c=u),j$=t.text.slice(Math.min(s,c),Math.max(s,c));let d=l==(o?e.length-1:0)?null:e[l+(o?1:-1)];return d&&c==u&&d.level+(o?0:1)t.some(e=>e)}),J$=Ee.define({combine:t=>t.some(e=>e)}),Q$=Ee.define();class Vs{constructor(e,n="nearest",r="nearest",o=5,i=5,s=!1){this.range=e,this.y=n,this.x=r,this.yMargin=o,this.xMargin=i,this.isSnapshot=s}map(e){return e.empty?this:new Vs(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Vs(le.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Wu=ot.define({map:(t,e)=>t.map(e)});function Nn(t,e,n){let r=t.facet(G$);r.length?r[0](e):window.onerror?window.onerror(String(e),n,void 0,void 0,e):n?console.error(n+":",e):console.error(e)}const hf=Ee.define({combine:t=>t.length?t[0]:!0});let cZ=0;const Gl=Ee.define();class Qt{constructor(e,n,r,o,i){this.id=e,this.create=n,this.domEventHandlers=r,this.domEventObservers=o,this.extension=i(this)}static define(e,n){const{eventHandlers:r,eventObservers:o,provide:i,decorations:s}=n||{};return new Qt(cZ++,e,r,o,l=>{let a=[Gl.of(l)];return s&&a.push(Ia.of(u=>{let c=u.plugin(l);return c?s(c):We.none})),i&&a.push(i(l)),a})}static fromClass(e,n){return Qt.define(r=>new e(r),n)}}class ih{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(Nn(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(n){Nn(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){Nn(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Z$=Ee.define(),Lg=Ee.define(),Ia=Ee.define(),eA=Ee.define(),Vg=Ee.define(),tA=Ee.define();function Z0(t,e){let n=t.state.facet(tA);if(!n.length)return n;let r=n.map(i=>i instanceof Function?i(t):i),o=[];return Ct.spans(r,e.from,e.to,{point(){},span(i,s,l,a){let u=i-e.from,c=s-e.from,d=o;for(let f=l.length-1;f>=0;f--,a--){let h=l[f].spec.bidiIsolate,p;if(h==null&&(h=uZ(e.text,u,c)),a>0&&d.length&&(p=d[d.length-1]).to==u&&p.direction==h)p.to=c,d=p.inner;else{let v={from:u,to:c,direction:h,inner:[]};d.push(v),d=v.inner}}}}),o}const nA=Ee.define();function rA(t){let e=0,n=0,r=0,o=0;for(let i of t.state.facet(nA)){let s=i(t);s&&(s.left!=null&&(e=Math.max(e,s.left)),s.right!=null&&(n=Math.max(n,s.right)),s.top!=null&&(r=Math.max(r,s.top)),s.bottom!=null&&(o=Math.max(o,s.bottom)))}return{left:e,right:n,top:r,bottom:o}}const ql=Ee.define();class gr{constructor(e,n,r,o){this.fromA=e,this.toA=n,this.fromB=r,this.toB=o}join(e){return new gr(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,r=this;for(;n>0;n--){let o=e[n-1];if(!(o.fromA>r.toA)){if(o.toAc)break;i+=2}if(!a)return r;new gr(a.fromA,a.toA,a.fromB,a.toB).addToSet(r),s=a.toA,l=a.toB}}}class id{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=rn.empty(this.startState.doc.length);for(let i of r)this.changes=this.changes.compose(i.changes);let o=[];this.changes.iterChangedRanges((i,s,l,a)=>o.push(new gr(i,s,l,a))),this.changedRanges=o}static create(e,n,r){return new id(e,n,r)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class e1 extends Dt{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new nn],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new gr(0,0,0,e.state.doc.length)],0,null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:u,toA:c})=>cthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0);let o=-1;this.view.inputState.composing>=0&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?o=this.domChanged.newSel.head:!vZ(e.changes,this.hasComposition)&&!e.selectionSet&&(o=e.state.selection.main.head));let i=o>-1?fZ(this.view,e.changes,o):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:u,to:c}=this.hasComposition;r=new gr(u,c,e.changes.mapPos(u,-1),e.changes.mapPos(c,1)).addToSet(r.slice())}this.hasComposition=i?{from:i.range.fromB,to:i.range.toB}:null,(De.ie||De.chrome)&&!i&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let s=this.decorations,l=this.updateDeco(),a=mZ(s,l,e.changes);return r=gr.extendWithRanges(r,a),!(this.flags&7)&&r.length==0?!1:(this.updateInner(r,e.startState.doc.length,i),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n,r){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,n,r);let{observer:o}=this.view;o.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=De.chrome||De.ios?{node:o.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,s),this.flags&=-8,s&&(s.written||o.selectionRange.focusNode!=s.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(s=>s.flags&=-9);let i=[];if(this.view.viewport.from||this.view.viewport.to=0?o[s]:null;if(!l)break;let{fromA:a,toA:u,fromB:c,toB:d}=l,f,h,p,v;if(r&&r.range.fromBc){let x=fa.build(this.view.state.doc,c,r.range.fromB,this.decorations,this.dynamicDecorationMap),k=fa.build(this.view.state.doc,r.range.toB,d,this.decorations,this.dynamicDecorationMap);h=x.breakAtStart,p=x.openStart,v=k.openEnd;let $=this.compositionView(r);k.breakAtStart?$.breakAfter=1:k.content.length&&$.merge($.length,$.length,k.content[0],!1,k.openStart,0)&&($.breakAfter=k.content[0].breakAfter,k.content.shift()),x.content.length&&$.merge(0,0,x.content[x.content.length-1],!0,0,x.openEnd)&&x.content.pop(),f=x.content.concat($).concat(k.content)}else({content:f,breakAtStart:h,openStart:p,openEnd:v}=fa.build(this.view.state.doc,c,d,this.decorations,this.dynamicDecorationMap));let{i:y,off:b}=i.findPos(u,1),{i:S,off:w}=i.findPos(a,-1);B$(this,S,w,y,b,f,h,p,v)}r&&this.fixCompositionDOM(r)}compositionView(e){let n=new Tr(e.text.nodeValue);n.flags|=8;for(let{deco:o}of e.marks)n=new ho(o,[n],n.length);let r=new nn;return r.append(n,0),r}fixCompositionDOM(e){let n=(i,s)=>{s.flags|=8|(s.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(s);let l=Dt.get(i);l&&l!=s&&(l.dom=null),s.setDOM(i)},r=this.childPos(e.range.fromB,1),o=this.children[r.i];n(e.line,o);for(let i=e.marks.length-1;i>=-1;i--)r=o.childPos(r.off,1),o=o.children[r.i],n(i>=0?e.marks[i].node:e.text,o)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let r=this.view.root.activeElement,o=r==this.dom,i=!o&&bc(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(o||n||i))return;let s=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),u=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(De.gecko&&l.empty&&!this.hasComposition&&dZ(a)){let d=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(d,a.node.childNodes[a.offset]||null)),a=u=new xn(d,0),s=!0}let c=this.view.observer.selectionRange;(s||!c.focusNode||(!da(a.node,a.offset,c.anchorNode,c.anchorOffset)||!da(u.node,u.offset,c.focusNode,c.focusOffset))&&!this.suppressWidgetCursorChange(c,l))&&(this.view.observer.ignore(()=>{De.android&&De.chrome&&this.dom.contains(c.focusNode)&&gZ(c.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let d=rd(this.view.root);if(d)if(l.empty){if(De.gecko){let f=hZ(a.node,a.offset);if(f&&f!=3){let h=(f==1?_$:O$)(a.node,a.offset);h&&(a=new xn(h.node,h.offset))}}d.collapse(a.node,a.offset),l.bidiLevel!=null&&d.caretBidiLevel!==void 0&&(d.caretBidiLevel=l.bidiLevel)}else if(d.extend){d.collapse(a.node,a.offset);try{d.extend(u.node,u.offset)}catch{}}else{let f=document.createRange();l.anchor>l.head&&([a,u]=[u,a]),f.setEnd(u.node,u.offset),f.setStart(a.node,a.offset),d.removeAllRanges(),d.addRange(f)}i&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(a,u)),this.impreciseAnchor=a.precise?null:new xn(c.anchorNode,c.anchorOffset),this.impreciseHead=u.precise?null:new xn(c.focusNode,c.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&da(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=rd(e.root),{anchorNode:o,anchorOffset:i}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let s=nn.find(this,n.head);if(!s)return;let l=s.posAtStart;if(n.head==l||n.head==l+s.length)return;let a=this.coordsAt(n.head,-1),u=this.coordsAt(n.head,1);if(!a||!u||a.bottom>u.top)return;let c=this.domAtPos(n.head+n.assoc);r.collapse(c.node,c.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let d=e.observer.selectionRange;e.docView.posFromDOM(d.anchorNode,d.anchorOffset)!=n.from&&r.collapse(o,i)}moveToLine(e){let n=this.dom,r;if(e.node!=n)return e;for(let o=e.offset;!r&&o=0;o--){let i=Dt.get(n.childNodes[o]);i instanceof nn&&(r=i.domAtPos(i.length))}return r?new xn(r.node,r.offset,!0):e}nearest(e){for(let n=e;n;){let r=Dt.get(n);if(r&&r.rootView==this)return r;n=n.parentNode}return null}posFromDOM(e,n){let r=this.nearest(e);if(!r)throw new RangeError("Trying to find position for a DOM position outside of the document");return r.localPosFromDOM(e,n)+r.posAtStart}domAtPos(e){let{i:n,off:r}=this.childCursor().findPos(e,-1);for(;n=0;s--){let l=this.children[s],a=i-l.breakAfter,u=a-l.length;if(ae||l.covers(1))&&(!r||l instanceof nn&&!(r instanceof nn&&n>=0))&&(r=l,o=u),i=u}return r?r.coordsAt(e-o,n):null}coordsForChar(e){let{i:n,off:r}=this.childPos(e,1),o=this.children[n];if(!(o instanceof nn))return null;for(;o.children.length;){let{i:l,off:a}=o.childPos(r,1);for(;;l++){if(l==o.children.length)return null;if((o=o.children[l]).length)break}r=a}if(!(o instanceof Tr))return null;let i=bn(o.text,r);if(i==r)return null;let s=Zi(o.dom,r,i).getClientRects();for(let l=0;lMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==zt.LTR;for(let u=0,c=0;co)break;if(u>=r){let h=d.dom.getBoundingClientRect();if(n.push(h.height),s){let p=d.dom.lastChild,v=p?el(p):[];if(v.length){let y=v[v.length-1],b=a?y.right-h.left:h.right-y.left;b>l&&(l=b,this.minWidth=i,this.minWidthFrom=u,this.minWidthTo=f)}}}u=f+d.breakAfter}return n}textDirectionAt(e){let{i:n}=this.childPos(e,1);return getComputedStyle(this.children[n].dom).direction=="rtl"?zt.RTL:zt.LTR}measureTextSize(){for(let i of this.children)if(i instanceof nn){let s=i.measureTextSize();if(s)return s}let e=document.createElement("div"),n,r,o;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let i=el(e.firstChild)[0];n=e.getBoundingClientRect().height,r=i?i.width/27:7,o=i?i.height:n,e.remove()}),{lineHeight:n,charWidth:r,textHeight:o}}childCursor(e=this.length){let n=this.children.length;return n&&(e-=this.children[--n].length),new P$(this.children,e,n)}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,o=0;;o++){let i=o==n.viewports.length?null:n.viewports[o],s=i?i.from-1:this.length;if(s>r){let l=(n.lineBlockAt(s).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(We.replace({widget:new t1(l),block:!0,inclusive:!0,isBlockGap:!0}).range(r,s))}if(!i)break;r=i.to+1}return We.set(e)}updateDeco(){let e=0,n=this.view.state.facet(Ia).map(i=>(this.dynamicDecorationMap[e++]=typeof i=="function")?i(this.view):i),r=!1,o=this.view.state.facet(eA).map((i,s)=>{let l=typeof i=="function";return l&&(r=!0),l?i(this.view):i});for(o.length&&(this.dynamicDecorationMap[e++]=r,n.push(Ct.join(o))),this.decorations=[...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];en.anchor?-1:1),o;if(!r)return;!n.empty&&(o=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,o.left),top:Math.min(r.top,o.top),right:Math.max(r.right,o.right),bottom:Math.max(r.bottom,o.bottom)});let i=rA(this.view),s={left:r.left-i.left,top:r.top-i.top,right:r.right+i.right,bottom:r.bottom+i.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;UQ(this.view.scrollDOM,s,n.head{re.from&&(n=!0)}),n}function yZ(t,e,n=1){let r=t.charCategorizer(e),o=t.doc.lineAt(e),i=e-o.from;if(o.length==0)return le.cursor(e);i==0?n=1:i==o.length&&(n=-1);let s=i,l=i;n<0?s=bn(o.text,i,!1):l=bn(o.text,i);let a=r(o.text.slice(s,l));for(;s>0;){let u=bn(o.text,s,!1);if(r(o.text.slice(u,s))!=a)break;s=u}for(;lt?e.left-t:Math.max(0,t-e.right)}function SZ(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function sh(t,e){return t.tope.top+1}function n1(t,e){return et.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function Rp(t,e,n){let r,o,i,s,l=!1,a,u,c,d;for(let p=t.firstChild;p;p=p.nextSibling){let v=el(p);for(let y=0;yw||s==w&&i>S){r=p,o=b,i=S,s=w;let x=w?n0?y0)}S==0?n>b.bottom&&(!c||c.bottomb.top)&&(u=p,d=b):c&&sh(c,b)?c=r1(c,b.bottom):d&&sh(d,b)&&(d=n1(d,b.top))}}if(c&&c.bottom>=n?(r=a,o=c):d&&d.top<=n&&(r=u,o=d),!r)return{node:t,offset:0};let f=Math.max(o.left,Math.min(o.right,e));if(r.nodeType==3)return o1(r,f,n);if(l&&r.contentEditable!="false")return Rp(r,f,n);let h=Array.prototype.indexOf.call(t.childNodes,r)+(e>=(o.left+o.right)/2?1:0);return{node:t,offset:h}}function o1(t,e,n){let r=t.nodeValue.length,o=-1,i=1e9,s=0;for(let l=0;ln?c.top-n:n-c.bottom)-1;if(c.left-1<=e&&c.right+1>=e&&d=(c.left+c.right)/2,h=f;if((De.chrome||De.gecko)&&Zi(t,l).getBoundingClientRect().left==c.right&&(h=!f),d<=0)return{node:t,offset:l+(h?1:0)};o=l+(h?1:0),i=d}}}return{node:t,offset:o>-1?o:s>0?t.nodeValue.length:0}}function iA(t,e,n,r=-1){var o,i;let s=t.contentDOM.getBoundingClientRect(),l=s.top+t.viewState.paddingTop,a,{docHeight:u}=t.viewState,{x:c,y:d}=e,f=d-l;if(f<0)return 0;if(f>u)return t.state.doc.length;for(let x=t.viewState.heightOracle.textHeight/2,k=!1;a=t.elementAtHeight(f),a.type!=In.Text;)for(;f=r>0?a.bottom+x:a.top-x,!(f>=0&&f<=u);){if(k)return n?null:0;k=!0,r=-r}d=l+f;let h=a.from;if(ht.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:n?null:i1(t,s,a,c,d);let p=t.dom.ownerDocument,v=t.root.elementFromPoint?t.root:p,y=v.elementFromPoint(c,d);y&&!t.contentDOM.contains(y)&&(y=null),y||(c=Math.max(s.left+1,Math.min(s.right-1,c)),y=v.elementFromPoint(c,d),y&&!t.contentDOM.contains(y)&&(y=null));let b,S=-1;if(y&&((o=t.docView.nearest(y))===null||o===void 0?void 0:o.isEditable)!=!1){if(p.caretPositionFromPoint){let x=p.caretPositionFromPoint(c,d);x&&({offsetNode:b,offset:S}=x)}else if(p.caretRangeFromPoint){let x=p.caretRangeFromPoint(c,d);x&&({startContainer:b,startOffset:S}=x,(!t.contentDOM.contains(b)||De.safari&&CZ(b,S,c)||De.chrome&&wZ(b,S,c))&&(b=void 0))}}if(!b||!t.docView.dom.contains(b)){let x=nn.find(t.docView,h);if(!x)return f>a.top+a.height/2?a.to:a.from;({node:b,offset:S}=Rp(x.dom,c,d))}let w=t.docView.nearest(b);if(!w)return null;if(w.isWidget&&((i=w.dom)===null||i===void 0?void 0:i.nodeType)==1){let x=w.dom.getBoundingClientRect();return e.yt.defaultLineHeight*1.5){let l=t.viewState.heightOracle.textHeight,a=Math.floor((o-n.top-(t.defaultLineHeight-l)*.5)/l);i+=a*t.viewState.heightOracle.lineLength}let s=t.state.sliceDoc(n.from,n.to);return n.from+xp(s,i,t.state.tabSize)}function CZ(t,e,n){let r;if(t.nodeType!=3||e!=(r=t.nodeValue.length))return!1;for(let o=t.nextSibling;o;o=o.nextSibling)if(o.nodeType!=1||o.nodeName!="BR")return!1;return Zi(t,r-1,r).getBoundingClientRect().left>n}function wZ(t,e,n){if(e!=0)return!1;for(let o=t;;){let i=o.parentNode;if(!i||i.nodeType!=1||i.firstChild!=o)return!1;if(i.classList.contains("cm-line"))break;o=i}let r=t.nodeType==1?t.getBoundingClientRect():Zi(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return n-r.left>5}function Fp(t,e){let n=t.lineBlockAt(e);if(Array.isArray(n.type)){for(let r of n.type)if(r.to>e||r.to==e&&(r.to==n.to||r.type==In.Text))return r}return n}function kZ(t,e,n,r){let o=Fp(t,e.head),i=!r||o.type!=In.Text||!(t.lineWrapping||o.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>o.from?e.head-1:e.head);if(i){let s=t.dom.getBoundingClientRect(),l=t.textDirectionAt(o.from),a=t.posAtCoords({x:n==(l==zt.LTR)?s.right-1:s.left+1,y:(i.top+i.bottom)/2});if(a!=null)return le.cursor(a,n?-1:1)}return le.cursor(n?o.to:o.from,n?-1:1)}function s1(t,e,n,r){let o=t.state.doc.lineAt(e.head),i=t.bidiSpans(o),s=t.textDirectionAt(o.from);for(let l=e,a=null;;){let u=aZ(o,i,s,l,n),c=j$;if(!u){if(o.number==(n?t.state.doc.lines:1))return l;c=`
+`,o=t.state.doc.line(o.number+(n?1:-1)),i=t.bidiSpans(o),u=t.visualLineSide(o,!n)}if(a){if(!a(c))return l}else{if(!r)return u;a=r(c)}l=u}}function xZ(t,e,n){let r=t.state.charCategorizer(e),o=r(n);return i=>{let s=r(i);return o==Ut.Space&&(o=s),o==s}}function $Z(t,e,n,r){let o=e.head,i=n?1:-1;if(o==(n?t.state.doc.length:0))return le.cursor(o,e.assoc);let s=e.goalColumn,l,a=t.contentDOM.getBoundingClientRect(),u=t.coordsAtPos(o,e.assoc||-1),c=t.documentTop;if(u)s==null&&(s=u.left-a.left),l=i<0?u.top:u.bottom;else{let h=t.viewState.lineBlockAt(o);s==null&&(s=Math.min(a.right-a.left,t.defaultCharacterWidth*(o-h.from))),l=(i<0?h.top:h.bottom)+c}let d=a.left+s,f=r??t.viewState.heightOracle.textHeight>>1;for(let h=0;;h+=10){let p=l+(f+h)*i,v=iA(t,{x:d,y:p},!1,i);if(pa.bottom||(i<0?vo)){let y=t.docView.coordsForChar(v),b=!y||p{if(e>i&&eo(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:le.cursor(r,rnull),De.gecko&&zZ(e.contentDOM.ownerDocument)}handleEvent(e){!DZ(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,n){let r=this.handlers[e];if(r){for(let o of r.observers)o(this.view,n);for(let o of r.handlers){if(n.defaultPrevented)break;if(o(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=TZ(e),r=this.handlers,o=this.view.contentDOM;for(let i in n)if(i!="scroll"){let s=!n[i].handlers.length,l=r[i];l&&s!=!l.handlers.length&&(o.removeEventListener(i,this.handleEvent),l=null),l||o.addEventListener(i,this.handleEvent,{passive:s})}for(let i in r)i!="scroll"&&!n[i]&&o.removeEventListener(i,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&Date.now()r.keyCode==e.keyCode))&&!e.ctrlKey||_Z.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from0?!0:De.safari&&!De.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function l1(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(o){Nn(n.state,o)}}}function TZ(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let o=r.spec;if(o&&o.domEventHandlers)for(let i in o.domEventHandlers){let s=o.domEventHandlers[i];s&&n(i).handlers.push(l1(r.value,s))}if(o&&o.domEventObservers)for(let i in o.domEventObservers){let s=o.domEventObservers[i];s&&n(i).observers.push(l1(r.value,s))}}for(let r in _r)n(r).handlers.push(_r[r]);for(let r in vr)n(r).observers.push(vr[r]);return e}const sA=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],_Z="dthko",lA=[16,17,18,20,91,92,224,225],Uu=6;function Ku(t){return Math.max(0,t)*.7+8}function OZ(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class PZ{constructor(e,n,r,o){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=o,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParent=KQ(e.contentDOM),this.atoms=e.state.facet(Vg).map(s=>s(e));let i=e.contentDOM.ownerDocument;i.addEventListener("mousemove",this.move=this.move.bind(this)),i.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(at.allowMultipleSelections)&&BZ(e,n),this.dragging=IZ(e,n)&&dA(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){var n;if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&OZ(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let r=0,o=0,i=((n=this.scrollParent)===null||n===void 0?void 0:n.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},s=rA(this.view);e.clientX-s.left<=i.left+Uu?r=-Ku(i.left-e.clientX):e.clientX+s.right>=i.right-Uu&&(r=Ku(e.clientX-i.right)),e.clientY-s.top<=i.top+Uu?o=-Ku(i.top-e.clientY):e.clientY+s.bottom>=i.bottom-Uu&&(o=Ku(e.clientY-i.bottom)),this.setScrollSpeed(r,o)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let n=null;for(let r=0;rthis.select(this.lastEvent),20)}}function BZ(t,e){let n=t.state.facet(W$);return n.length?n[0](e):De.mac?e.metaKey:e.ctrlKey}function MZ(t,e){let n=t.state.facet(U$);return n.length?n[0](e):De.mac?!e.altKey:!e.ctrlKey}function IZ(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=rd(t.root);if(!r||r.rangeCount==0)return!0;let o=r.getRangeAt(0).getClientRects();for(let i=0;i=e.clientX&&s.top<=e.clientY&&s.bottom>=e.clientY)return!0}return!1}function DZ(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=Dt.get(n))&&r.ignoreEvent(e))return!1;return!0}const _r=Object.create(null),vr=Object.create(null),aA=De.ie&&De.ie_version<15||De.ios&&De.webkit_version<604;function EZ(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),uA(t,n.value)},50)}function uA(t,e){let{state:n}=t,r,o=1,i=n.toText(e),s=i.lines==n.selection.ranges.length;if(Np!=null&&n.selection.ranges.every(a=>a.empty)&&Np==i.toString()){let a=-1;r=n.changeByRange(u=>{let c=n.doc.lineAt(u.from);if(c.from==a)return{range:u};a=c.from;let d=n.toText((s?i.line(o++).text:e)+n.lineBreak);return{changes:{from:c.from,insert:d},range:le.cursor(u.from+d.length)}})}else s?r=n.changeByRange(a=>{let u=i.line(o++);return{changes:{from:a.from,to:a.to,insert:u.text},range:le.cursor(a.from+u.length)}}):r=n.replaceSelection(i);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}vr.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};_r.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&(t.inputState.lastEscPress=Date.now()),!1);vr.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};vr.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};_r.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(K$))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=RZ(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new PZ(t,e,n,r)),r&&t.observer.ignore(()=>$$(t.contentDOM));let o=t.inputState.mouseSelection;if(o)return o.start(e),o.dragging===!1}return!1};function a1(t,e,n,r){if(r==1)return le.cursor(e,n);if(r==2)return yZ(t.state,e,n);{let o=nn.find(t.docView,e),i=t.state.doc.lineAt(o?o.posAtEnd:e),s=o?o.posAtStart:i.from,l=o?o.posAtEnd:i.to;return lt>=e.top&&t<=e.bottom,u1=(t,e,n)=>cA(e,n)&&t>=n.left&&t<=n.right;function LZ(t,e,n,r){let o=nn.find(t.docView,e);if(!o)return 1;let i=e-o.posAtStart;if(i==0)return 1;if(i==o.length)return-1;let s=o.coordsAt(i,-1);if(s&&u1(n,r,s))return-1;let l=o.coordsAt(i,1);return l&&u1(n,r,l)?1:s&&cA(r,s)?-1:1}function c1(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:n,bias:LZ(t,n,e.clientX,e.clientY)}}const VZ=De.ie&&De.ie_version<=11;let d1=null,f1=0,h1=0;function dA(t){if(!VZ)return t.detail;let e=d1,n=h1;return d1=t,h1=Date.now(),f1=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(f1+1)%3:1}function RZ(t,e){let n=c1(t,e),r=dA(e),o=t.state.selection;return{update(i){i.docChanged&&(n.pos=i.changes.mapPos(n.pos),o=o.map(i.changes))},get(i,s,l){let a=c1(t,i),u,c=a1(t,a.pos,a.bias,r);if(n.pos!=a.pos&&!s){let d=a1(t,n.pos,n.bias,r),f=Math.min(d.from,c.from),h=Math.max(d.to,c.to);c=f1&&(u=FZ(o,a.pos))?u:l?o.addRange(c):le.create([c])}}}function FZ(t,e){for(let n=0;n=e)return le.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}_r.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let o=t.docView.nearest(e.target);if(o&&o.isWidget){let i=o.posAtStart,s=i+o.length;(i>=n.to||s<=n.from)&&(n=le.range(i,s))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",t.state.sliceDoc(n.from,n.to)),e.dataTransfer.effectAllowed="copyMove"),!1};_r.dragend=t=>(t.inputState.draggedContent=null,!1);function p1(t,e,n,r){if(!n)return;let o=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:i}=t.inputState,s=r&&i&&MZ(t,e)?{from:i.from,to:i.to}:null,l={from:o,insert:n},a=t.state.changes(s?[s,l]:l);t.focus(),t.dispatch({changes:a,selection:{anchor:a.mapPos(o,-1),head:a.mapPos(o,1)},userEvent:s?"move.drop":"input.drop"}),t.inputState.draggedContent=null}_r.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),o=0,i=()=>{++o==n.length&&p1(t,e,r.filter(s=>s!=null).join(t.state.lineBreak),!1)};for(let s=0;s{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(r[s]=l.result),i()},l.readAsText(n[s])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return p1(t,e,r,!0),!0}return!1};_r.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=aA?null:e.clipboardData;return n?(uA(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(EZ(t),!1)};function NZ(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function HZ(t){let e=[],n=[],r=!1;for(let o of t.selection.ranges)o.empty||(e.push(t.sliceDoc(o.from,o.to)),n.push(o));if(!e.length){let o=-1;for(let{from:i}of t.selection.ranges){let s=t.doc.lineAt(i);s.number>o&&(e.push(s.text),n.push({from:s.from,to:Math.min(t.doc.length,s.to+1)})),o=s.number}r=!0}return{text:e.join(t.lineBreak),ranges:n,linewise:r}}let Np=null;_r.copy=_r.cut=(t,e)=>{let{text:n,ranges:r,linewise:o}=HZ(t.state);if(!n&&!o)return!1;Np=o?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let i=aA?null:e.clipboardData;return i?(i.clearData(),i.setData("text/plain",n),!0):(NZ(t,n),!1)};const fA=$o.define();function hA(t,e){let n=[];for(let r of t.facet(Y$)){let o=r(t,e);o&&n.push(o)}return n?t.update({effects:n,annotations:fA.of(!0)}):null}function pA(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=hA(t.state,e);n?t.dispatch(n):t.update([])}},10)}vr.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),pA(t)};vr.blur=t=>{t.observer.clearSelectionRange(),pA(t)};vr.compositionstart=vr.compositionupdate=t=>{t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0)};vr.compositionend=t=>{t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,De.chrome&&De.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50)};vr.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};_r.beforeinput=(t,e)=>{var n;let r;if(De.chrome&&De.android&&(r=sA.find(o=>o.inputType==e.inputType))&&(t.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let o=((n=window.visualViewport)===null||n===void 0?void 0:n.height)||0;setTimeout(()=>{var i;(((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0)>o+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return De.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),De.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>vr.compositionend(t,e),20),!1};const m1=new Set;function zZ(t){m1.has(t)||(m1.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const g1=["pre-wrap","normal","pre-line","break-spaces"];class jZ{constructor(e){this.lineWrapping=e,this.doc=kt.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return g1.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r-1,a=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=n,this.charWidth=r,this.textHeight=o,this.lineLength=i,a){this.heightSamples={};for(let u=0;u0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,n){this.height!=n&&(Math.abs(this.height-n)>Cc&&(e.heightChanged=!0),this.height=n)}replace(e,n,r){return Dn.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,o){let i=this,s=r.doc;for(let l=o.length-1;l>=0;l--){let{fromA:a,toA:u,fromB:c,toB:d}=o[l],f=i.lineAt(a,Nt.ByPosNoHeight,r.setDoc(n),0,0),h=f.to>=u?f:i.lineAt(u,Nt.ByPosNoHeight,r,0,0);for(d+=h.to-u,u=h.to;l>0&&f.from<=o[l-1].toA;)a=o[l-1].fromA,c=o[l-1].fromB,l--,ai*2){let l=e[n-1];l.break?e.splice(--n,1,l.left,null,l.right):e.splice(--n,1,l.left,l.right),r+=1+l.break,o-=l.size}else if(i>o*2){let l=e[r];l.break?e.splice(r,1,l.left,null,l.right):e.splice(r,1,l.left,l.right),r+=2+l.break,i-=l.size}else break;else if(o=i&&s(this.blockAt(0,r,o,i))}updateHeight(e,n=0,r=!1,o){return o&&o.from<=n&&o.more&&this.setHeight(e,o.heights[o.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Yn extends mA{constructor(e,n){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,n,r,o){return new jr(o,this.length,r,this.height,this.breaks)}replace(e,n,r){let o=r[0];return r.length==1&&(o instanceof Yn||o instanceof fn&&o.flags&4)&&Math.abs(this.length-o.length)<10?(o instanceof fn?o=new Yn(o.length,this.height):o.height=this.height,this.outdated||(o.outdated=!1),o):Dn.of(r)}updateHeight(e,n=0,r=!1,o){return o&&o.from<=n&&o.more?this.setHeight(e,o.heights[o.index++]):(r||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class fn extends Dn{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,o=e.doc.lineAt(n+this.length).number,i=o-r+1,s,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*i);s=a/i,this.length>i+1&&(l=(this.height-a)/(this.length-i-1))}else s=this.height/i;return{firstLine:r,lastLine:o,perLine:s,perChar:l}}blockAt(e,n,r,o){let{firstLine:i,lastLine:s,perLine:l,perChar:a}=this.heightMetrics(n,o);if(n.lineWrapping){let u=o+(e0){let i=r[r.length-1];i instanceof fn?r[r.length-1]=new fn(i.length+o):r.push(null,new fn(o-1))}if(e>0){let i=r[0];i instanceof fn?r[0]=new fn(e+i.length):r.unshift(new fn(e-1),null)}return Dn.of(r)}decomposeLeft(e,n){n.push(new fn(e-1),null)}decomposeRight(e,n){n.push(null,new fn(this.length-e-1))}updateHeight(e,n=0,r=!1,o){let i=n+this.length;if(o&&o.from<=n+this.length&&o.more){let s=[],l=Math.max(n,o.from),a=-1;for(o.from>n&&s.push(new fn(o.from-n-1).updateHeight(e,n));l<=i&&o.more;){let c=e.doc.lineAt(l).length;s.length&&s.push(null);let d=o.heights[o.index++];a==-1?a=d:Math.abs(d-a)>=Cc&&(a=-2);let f=new Yn(c,d);f.outdated=!1,s.push(f),l+=c+1}l<=i&&s.push(null,new fn(i-l).updateHeight(e,l));let u=Dn.of(s);return(a<0||Math.abs(u.height-this.height)>=Cc||Math.abs(a-this.heightMetrics(e,n).perLine)>=Cc)&&(e.heightChanged=!0),u}else(r||this.outdated)&&(this.setHeight(e,e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class UZ extends Dn{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,o){let i=r+this.left.height;return el))return u;let c=n==Nt.ByPosNoHeight?Nt.ByPosNoHeight:Nt.ByPos;return a?u.join(this.right.lineAt(l,c,r,s,l)):this.left.lineAt(l,c,r,o,i).join(u)}forEachLine(e,n,r,o,i,s){let l=o+this.left.height,a=i+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,n,r,l,a,s);else{let u=this.lineAt(a,Nt.ByPos,r,o,i);e=e&&u.from<=n&&s(u),n>u.to&&this.right.forEachLine(u.to+1,n,r,l,a,s)}}replace(e,n,r){let o=this.left.length+this.break;if(nthis.left.length)return this.balanced(this.left,this.right.replace(e-o,n-o,r));let i=[];e>0&&this.decomposeLeft(e,i);let s=i.length;for(let l of r)i.push(l);if(e>0&&v1(i,s-1),n=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,o=r+this.break;if(e>=o)return this.right.decomposeRight(e-o,n);e2*n.size||n.size>2*e.size?Dn.of(this.break?[e,null,n]:[e,n]):(this.left=e,this.right=n,this.height=e.height+n.height,this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,o){let{left:i,right:s}=this,l=n+i.length+this.break,a=null;return o&&o.from<=n+i.length&&o.more?a=i=i.updateHeight(e,n,r,o):i.updateHeight(e,n,r),o&&o.from<=l+s.length&&o.more?a=s=s.updateHeight(e,l,r,o):s.updateHeight(e,l,r),a?this.balanced(i,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function v1(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof fn&&(r=t[e+1])instanceof fn&&t.splice(e-1,3,new fn(n.length+1+r.length))}const KZ=5;class Rg{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),o=this.nodes[this.nodes.length-1];o instanceof Yn?o.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Yn(r-this.pos,-1)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e=KZ)&&this.addLineDeco(o,i,s)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenTo