dsp-semactic 0.7.5 → 0.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dsp-semactic.css +1 -1
- package/dist/index.cjs.js +35 -35
- package/dist/index.es.js +6582 -6601
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ro=require("vue-i18n"),ss={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},rs=["value"],is=["placeholder","value","disabled"],cs=["placeholder","value"],us=["placeholder","value"],ds=["aria-selected","onClick"],ms={class:"dss-datepicker__list-item-label"},ps={key:0,class:"dss-datepicker__list-item-check",width:"16",height:"16",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},fs={key:1,class:"dss-datepicker__list-empty"},vs={key:1,class:"dss-datepicker__double-wrap"},hs={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},gs=["disabled","onClick"],ys={class:"dss-datepicker__double-calendars"},ks={class:"dss-datepicker__double-calendar"},Cs={class:"dss-datepicker__calendar-header"},bs=["aria-label"],xs={class:"dss-datepicker__month-year-row"},ws=["aria-label"],Es={class:"dss-datepicker__weekdays"},Ss={class:"dss-datepicker__grid"},Vs=["disabled","onClick","onMouseenter"],Ns={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Bs={class:"dss-datepicker__double-calendar"},Ms={class:"dss-datepicker__calendar-header"},_s=["aria-label"],$s={class:"dss-datepicker__month-year-row"},Ls=["aria-label"],As={class:"dss-datepicker__weekdays"},Ts={class:"dss-datepicker__grid"},Ds=["disabled","onClick","onMouseenter"],Hs={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Rs={class:"dss-datepicker__calendar-header"},Fs=["aria-label"],Is={class:"dss-datepicker__month-year-row"},zs=["aria-label"],Ps={class:"dss-datepicker__weekdays"},Os={class:"dss-datepicker__grid"},Ws=["disabled","onClick","onMouseenter"],qs={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Zs={class:"dss-datepicker__calendar-header"},Us={class:"dss-datepicker__month-year-row"},Xs={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},Ys={class:"dss-datepicker__months-grid"},js=["onClick"],Ks={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},Gs={class:"dss-datepicker__month-year"},Qs={class:"dss-datepicker__years-grid"},Js=["data-year","onClick"],Na=27,zn=8,pa={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:E=>["single","range","singleFromAvailable","rangeFromAvailable","listFromAvailable","readonly"].includes(E)},modelValue:{type:[Date,Object],default:null},availableDates:{type:Array,default:()=>[]},minDate:{type:Date,default:null},maxDate:{type:Date,default:null},exceptDates:{type:Array,default:()=>[]},doubleCalendar:{type:Boolean,default:!1},quickSelect:{type:Boolean,default:!0},placeholder:{type:String,default:""}},emits:["update:modelValue"],setup(E,{emit:te}){const $=E,V=te,{t:ce,locale:O}=ro.useI18n(),L=e.ref(!1),fe=e.ref("days"),rt=new Date,ee=e.computed(()=>$.minDate instanceof Date?$.minDate:rt),v=e.ref(ee.value.getMonth()),be=e.ref(ee.value.getFullYear()),ke=e.ref(ee.value.getMonth()),J=e.ref(ee.value.getFullYear()),Y=e.ref(ee.value.getMonth()),me=e.ref(ee.value.getFullYear()),F=e.ref("start"),ue=e.ref(null),$e=e.ref(null);function tt(){const T=ee.value,z=T.getMonth(),_=T.getFullYear(),le=z===11?0:z+1,Te=z===11?_+1:_;return{left:{month:z,year:_},right:{month:le,year:Te}}}const mt=e.ref(null),U=e.ref(null),ze=e.ref(null),qe=e.ref(null),Ve=e.ref(null),Le=e.ref(null),je=e.ref(null),re=e.ref(null),Qe=new Date().getFullYear(),Ce=e.computed(()=>["single","singleFromAvailable"].includes($.mode)),Je=e.computed(()=>["range","rangeFromAvailable"].includes($.mode)),ut=e.computed(()=>$.mode==="listFromAvailable"),ht=e.computed(()=>{if(!["single","singleFromAvailable","listFromAvailable"].includes($.mode))return null;const T=$.modelValue;return T instanceof Date?T:null}),dt=e.computed(()=>{if(!Je.value)return{start:null,end:null};const T=$.modelValue;return!T||typeof T!="object"?{start:null,end:null}:{start:T.start instanceof Date?T.start:null,end:T.end instanceof Date?T.end:null}});function Wt(T){if(!T||!(T instanceof Date))return"";const z=T.getDate(),_=T.getMonth()+1,le=T.getFullYear(),Te=pt=>String(pt).padStart(2,"0");return`${Te(z)}/${Te(_)}/${le}`}const qt=e.computed(()=>Wt(ht.value)),Ct=e.computed(()=>{const{start:T,end:z}=dt.value;if(!T&&!z)return"";const _=!z||T&&T<=z?T:z,le=!T||z&&z>=T?z:T;return jt(_,le)?Wt(_):`${Wt(_)} - ${Wt(le)}`}),wt=e.computed(()=>{if($.mode!=="readonly")return"—";const T=$.modelValue;if(T instanceof Date)return Wt(T)||"—";if(T&&typeof T=="object"&&("start"in T||"end"in T)){const z=T.start instanceof Date?T.start:null,_=T.end instanceof Date?T.end:null;if(!z&&!_)return"—";const le=!_||z&&z<=_?z:_,Te=!z||_&&_>=z?_:z;return jt(le,Te)?Wt(le):`${Wt(le)} - ${Wt(Te)}`}return"—"});e.computed(()=>{const T=new Date(be.value,v.value,1);return new Intl.DateTimeFormat(O.value,{month:"long",year:"numeric"}).format(T)});const Yt=e.computed(()=>$e.value==="left"?ke.value:$e.value==="right"?Y.value:v.value),it=e.computed(()=>$e.value==="left"?J.value:$e.value==="right"?me.value:be.value),Kt=e.computed(()=>{const T=new Date(be.value,v.value,1);return new Intl.DateTimeFormat(O.value,{month:"long"}).format(T)}),yt=e.computed(()=>{const T=new Date(it.value,Yt.value,1);return new Intl.DateTimeFormat(O.value,{month:"long"}).format(T)}),el=e.computed(()=>{const T=new Intl.DateTimeFormat(O.value,{month:"short"});return Array.from({length:12},(z,_)=>T.format(new Date(2024,_,1)))}),X=e.computed(()=>{const z=($e.value?it.value:be.value)-Math.floor(Na/2);return Array.from({length:Na},(_,le)=>z+le)}),ge=e.computed(()=>{const T=X.value;return T.length?`${T[0]} – ${T[T.length-1]}`:""});function W(T){return T===7?0:T}function G(T){try{const z=new Intl.Locale(T);if(z.weekInfo?.firstDay!=null)return W(z.weekInfo.firstDay)}catch{}return 1}function Ne(T){const z=new Date(2024,0,1),_=(z.getDay()-T+7)%7,le=new Date(z);return le.setDate(z.getDate()-_),le}const Pe=e.computed(()=>G(O.value)),Xe=e.computed(()=>{const T=new Intl.DateTimeFormat(O.value,{weekday:"short"}),z=Ne(Pe.value),_=[];for(let le=0;le<7;le++){const Te=new Date(z);Te.setDate(z.getDate()+le),_.push(T.format(Te).slice(0,2))}return _});function Et(T,z,_){const le=new Date(T,z,1),Te=new Date(T,z+1,0),pt=(le.getDay()-_+7)%7,ct=Te.getDate(),lt=[];for(let st=0;st<pt;st++)lt.push(null);for(let st=1;st<=ct;st++)lt.push(new Date(T,z,st));return lt}const Ge=e.computed(()=>Et(be.value,v.value,Pe.value)),Zt=e.computed(()=>Et(J.value,ke.value,Pe.value)),Ue=e.computed(()=>Et(me.value,Y.value,Pe.value));e.computed(()=>{const T=new Date(J.value,ke.value,1);return new Intl.DateTimeFormat(O.value,{month:"long",year:"numeric"}).format(T)}),e.computed(()=>{const T=new Date(me.value,Y.value,1);return new Intl.DateTimeFormat(O.value,{month:"long",year:"numeric"}).format(T)});const We=e.computed(()=>{const T=new Date(J.value,ke.value,1);return new Intl.DateTimeFormat(O.value,{month:"long"}).format(T)}),Dt=e.computed(()=>{const T=new Date(me.value,Y.value,1);return new Intl.DateTimeFormat(O.value,{month:"long"}).format(T)}),Lt=e.computed(()=>$.availableDates&&$.availableDates.length>0),ne=e.computed(()=>Lt.value?[{id:"all",labelKey:"datepicker.quickSelect.allDates"},{id:"last2",labelKey:"datepicker.quickSelect.last2Dates"},{id:"last3",labelKey:"datepicker.quickSelect.last3Dates"},{id:"last4",labelKey:"datepicker.quickSelect.last4Dates"},{id:"last5",labelKey:"datepicker.quickSelect.last5Dates"}]:[{id:"today",labelKey:"datepicker.quickSelect.today"},{id:"lastWeek",labelKey:"datepicker.quickSelect.lastWeek"},{id:"last15Days",labelKey:"datepicker.quickSelect.last15Days"},{id:"last30Days",labelKey:"datepicker.quickSelect.last30Days"},{id:"thisMonth",labelKey:"datepicker.quickSelect.thisMonth"},{id:"last3Months",labelKey:"datepicker.quickSelect.last3Months"},{id:"last6Months",labelKey:"datepicker.quickSelect.last6Months"},{id:"last12Months",labelKey:"datepicker.quickSelect.last12Months"},{id:"lastYear",labelKey:"datepicker.quickSelect.lastYear"}]),j=e.ref({top:0,left:0}),K=e.ref("left");let de=null;function xe(){L.value&&e.nextTick(()=>{L.value&&(de!==null&&window.cancelAnimationFrame(de),de=window.requestAnimationFrame(()=>{de=null,Ke()}))})}function Ke(){if(!Ve.value||!L.value)return;const T=Ve.value.getBoundingClientRect(),z=window.innerWidth||document.documentElement.clientWidth,_=window.innerHeight||document.documentElement.clientHeight;let le=T.left,Te=T.bottom+4;const pt=Le.value;if(pt){const ct=pt.offsetWidth,lt=pt.offsetHeight;K.value==="right"||le+ct>z-zn?(K.value="right",le=T.right-ct):K.value="left";const il=Math.max(zn,z-ct-zn);if(le=Math.min(Math.max(le,zn),il),Te+lt>_-zn){const kl=T.top-4-lt;kl>=zn?Te=kl:Te=Math.max(zn,_-lt-zn)}}j.value={top:Te,left:le}}const Ht=e.computed(()=>!Ve.value||!L.value?{}:{position:"fixed",left:`${j.value.left}px`,top:`${j.value.top}px`,zIndex:1002});function jt(T,z){return!T||!z?!1:T.getFullYear()===z.getFullYear()&&T.getMonth()===z.getMonth()&&T.getDate()===z.getDate()}function et(T){return new Date(T.getFullYear(),T.getMonth(),T.getDate()).getTime()}function vl(T){return!$.availableDates||!$.availableDates.length?!0:$.availableDates.some(z=>z instanceof Date&&jt(z,T))}function M(T){const z=et(T);return!($.minDate instanceof Date&&z<et($.minDate)||$.maxDate instanceof Date&&z>et($.maxDate))}function x(T){const z=new Date(T);return new Date(z.getFullYear(),z.getMonth(),z.getDate())}function A(T){return T.filter(z=>M(z))}function ae(T,z){if(!(T instanceof Date)||!(z instanceof Date))return null;let _=et(T),le=et(z);if(_>le&&([_,le]=[le,_]),$.minDate instanceof Date){const Te=et($.minDate);_=Math.max(_,Te),le=Math.max(le,Te)}if($.maxDate instanceof Date){const Te=et($.maxDate);_=Math.min(_,Te),le=Math.min(le,Te)}return _>le?null:{start:x(_),end:x(le)}}function oe(T){return!$.exceptDates||!$.exceptDates.length?!1:$.exceptDates.some(z=>z instanceof Date&&jt(z,T))}function Fe(T){return oe(T)?!1:["singleFromAvailable","rangeFromAvailable"].includes($.mode)?vl(T):M(T)}function bt(T){const z=ht.value,_=dt.value,le=et(T),Te=Je.value&&_.start&&_.end&&le>et(_.start)&&le<et(_.end),pt=Je.value&&_.start&&jt(T,_.start),ct=Je.value&&_.end&&jt(T,_.end),lt=pt&&ct,st=Ce.value&&z&&jt(T,z)||pt||ct;let il=!1;if(Je.value&&_.start&&!_.end&&ue.value){const kl=et(_.start),Gt=et(ue.value),wl=Math.min(kl,Gt),Rt=Math.max(kl,Gt);il=le>wl&&le<Rt}return{"dss-datepicker__day--selected":st&&!lt,"dss-datepicker__day--range-start":pt&&!lt,"dss-datepicker__day--range-end":ct&&!lt,"dss-datepicker__day--range-single":lt,"dss-datepicker__day--in-range":Te&&!pt&&!ct,"dss-datepicker__day--in-range-preview":il&&!pt&&!ct&&!Te,"dss-datepicker__day--disabled":!Fe(T)}}function ot(T){if(!Je.value)return;const z=dt.value;if(!z.start||z.end){ue.value=null;return}if(!Fe(T)){ue.value=null;return}ue.value=new Date(T.getFullYear(),T.getMonth(),T.getDate())}function Ie(){ue.value=null}function xt(){if(!$.doubleCalendar||!Je.value)return;const T=dt.value,{start:z,end:_}=T;if(z&&_){const pt=z<=_?z:_,ct=z<=_?_:z,lt=pt.getMonth(),st=pt.getFullYear(),il=ct.getMonth(),kl=ct.getFullYear();if(lt!==il||st!==kl){const Gt=ke.value===lt&&J.value===st,wl=Y.value===il&&me.value===kl;if(Gt&&wl)return;ke.value=lt,J.value=st,Y.value=il,me.value=kl}else{const Gt=lt===0?11:lt-1,wl=lt===0?st-1:st;ke.value===Gt&&J.value===wl&&Y.value===lt&&me.value===st||(ke.value=lt,J.value=st,lt===11?(Y.value=0,me.value=st+1):(Y.value=lt+1,me.value=st))}return}const le=z||_;if(le){const pt=le.getMonth(),ct=le.getFullYear(),lt=ke.value===pt&&J.value===ct,st=Y.value===pt&&me.value===ct;if(lt||st)return;ke.value=pt,J.value=ct,pt===11?(Y.value=0,me.value=ct+1):(Y.value=pt+1,me.value=ct);return}const Te=tt();ke.value=Te.left.month,J.value=Te.left.year,Y.value=Te.right.month,me.value=Te.right.year}const Mt=e.computed(()=>new Intl.DateTimeFormat(O.value,{day:"2-digit",month:"long",year:"numeric"})),St=e.computed(()=>{if(!ut.value)return[];const T=($.availableDates||[]).filter(_=>_ instanceof Date&&!Number.isNaN(_.getTime())).filter(_=>!oe(_)&&M(_)).map(_=>new Date(_.getFullYear(),_.getMonth(),_.getDate()));T.sort((_,le)=>le.getTime()-_.getTime());const z=ht.value;return T.map(_=>({date:_,ts:_.getTime(),label:Mt.value.format(_),selected:!!(z&&jt(_,z))}))});function At(){if(L.value){yl();return}Ve.value=qe.value?.closest(".dss-datepicker__input-wrap"),K.value="left",L.value=!0,xe(),e.nextTick(()=>{re.value?.querySelector(".dss-datepicker__list-item--selected")?.scrollIntoView({block:"nearest",behavior:"auto"})})}function It(T){if(!(T instanceof Date))return;const z=new Date(T.getFullYear(),T.getMonth(),T.getDate());V("update:modelValue",z),yl()}function Nt(T="start"){if($.mode==="readonly")return;F.value=T;const z=ht.value,_=dt.value;if(Ce.value&&z)v.value=z.getMonth(),be.value=z.getFullYear();else if(Je.value)if($.doubleCalendar)xt();else{const le=T==="start"&&_.start?_.start:_.end||_.start;le&&(v.value=le.getMonth(),be.value=le.getFullYear())}Ve.value=Ce.value?mt.value?.closest(".dss-datepicker__input-wrap"):U.value,fe.value="days",$e.value=null,K.value="left",L.value=!0,xe()}function yl(){fe.value="days",$e.value=null,ue.value=null,L.value=!1}function nn(T,z){$e.value=T,fe.value=z}function Vl(){fe.value="days",$e.value=null}function Nl(T){const z=new Date,_=z.getFullYear(),le=z.getMonth(),Te=z.getDate();let pt,ct;if(Lt.value){const lt=A([...$.availableDates].filter(st=>st instanceof Date).map(st=>new Date(st.getFullYear(),st.getMonth(),st.getDate()))).sort((st,il)=>st.getTime()-il.getTime());if(lt.length===0)return null;if(T==="all")pt=lt[0],ct=lt[lt.length-1];else{const st=parseInt(T.replace("last",""),10);if(st<2||st>5)return null;const il=lt.slice(-st);if(il.length===0)return null;pt=il[0],ct=il[il.length-1]}}else{const lt=new Date(_,le,Te);switch(T){case"today":pt=lt,ct=lt;break;case"lastWeek":pt=new Date(_,le,Te-6),ct=lt;break;case"last15Days":pt=new Date(_,le,Te-14),ct=lt;break;case"last30Days":pt=new Date(_,le,Te-29),ct=lt;break;case"thisMonth":pt=new Date(_,le,1),ct=lt;break;case"last3Months":pt=new Date(_,le-3,1),ct=new Date(_,le,0);break;case"last6Months":pt=new Date(_,le-6,1),ct=new Date(_,le,0);break;case"last12Months":pt=new Date(_,le-12,1),ct=new Date(_,le,0);break;case"lastYear":pt=new Date(_-1,0,1),ct=new Date(_-1,11,31);break;default:return null}}return{start:pt,end:ct}}function tl(T){const z=Nl(T);return z?ae(z.start,z.end):null}function jl(T){return tl(T)!==null}function on(T){const z=tl(T);z&&(V("update:modelValue",z),xt())}function xl(T){$e.value==="left"?ke.value=T:$e.value==="right"?Y.value=T:v.value=T,Vl()}function Fl(T){$e.value==="left"?J.value=T:$e.value==="right"?me.value=T:be.value=T,Vl()}function dn(){v.value===0?(v.value=11,be.value--):v.value--}function Hl(){v.value===11?(v.value=0,be.value++):v.value++}function Pn(){ke.value===0?(ke.value=11,J.value--):ke.value--}function mn(){ke.value===11?(ke.value=0,J.value++):ke.value++}function pn(){Y.value===0?(Y.value=11,me.value--):Y.value--}function wn(){Y.value===11?(Y.value=0,me.value++):Y.value++}function ql(T){if(!Fe(T))return;const z=new Date(T.getFullYear(),T.getMonth(),T.getDate());if(Ce.value){V("update:modelValue",z),yl();return}const _=dt.value;if(!_.start&&!_.end){V("update:modelValue",{start:z,end:null}),F.value="end";return}if(_.start&&_.end){V("update:modelValue",{start:z,end:null}),F.value="end";return}if(F.value==="start"){let le=z,Te=_.end;le&&Te&&le>Te&&([le,Te]=[Te,le]),V("update:modelValue",{start:le||Te,end:Te||le}),F.value="end"}else{let le=_.start,Te=z;le&&Te&&Te<le&&([le,Te]=[Te,le]),V("update:modelValue",{start:le||Te,end:Te||le}),F.value="start"}}e.watch(dt,()=>{$.doubleCalendar&&Je.value&&L.value&&xt()},{deep:!0});let rl=null,Il=null,Kl=null;function sn(){rl&&(document.removeEventListener("keydown",rl),rl=null),Il&&(window.removeEventListener("resize",Il),Il=null),Kl&&(window.removeEventListener("scroll",Kl,!0),Kl=null)}return e.watch(fe,T=>{T==="years"&&e.nextTick(()=>{je.value?.querySelector(`[data-year="${it.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(()=>[L.value,fe.value,v.value,be.value,ke.value,J.value,Y.value,me.value,$e.value,$.doubleCalendar,$.quickSelect],()=>{xe()}),e.watch(L,T=>{sn(),T&&(rl=z=>{z.key==="Escape"&&(fe.value==="years"||fe.value==="months"?Vl():yl())},Il=()=>{Ke()},Kl=()=>{Ke()},document.addEventListener("keydown",rl),window.addEventListener("resize",Il),window.addEventListener("scroll",Kl,!0))}),e.onBeforeUnmount(()=>{de!==null&&(window.cancelAnimationFrame(de),de=null),sn()}),(T,z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":E.mode==="readonly"}])},[E.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",ss,[z[10]||(z[10]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{type:"text",class:"dss-datepicker__input",value:wt.value,readonly:"",disabled:"",tabindex:"-1"},null,8,rs)])):Ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:z[0]||(z[0]=_=>Nt("start"))},[z[11]||(z[11]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputSingleRef",ref:mt,type:"text",class:"dss-datepicker__input",placeholder:$.placeholder||e.unref(ce)("datepicker.selectDate"),value:qt.value,readonly:"",disabled:E.mode==="readonly"},null,8,is)])):ut.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["dss-datepicker__input-wrap dss-datepicker__input-wrap--list",{"dss-datepicker__input-wrap--open":L.value}]),onClick:At},[z[13]||(z[13]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputListRef",ref:qe,type:"text",class:"dss-datepicker__input",placeholder:$.placeholder||e.unref(ce)("datepicker.selectFromList"),value:qt.value,readonly:""},null,8,cs),e.createElementVNode("span",{class:e.normalizeClass(["dss-datepicker__chevron",{"dss-datepicker__chevron--open":L.value}]),"aria-hidden":"true"},[...z[12]||(z[12]=[e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"})],-1)])],2)],2)):Je.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:U,onClick:z[1]||(z[1]=_=>Nt("start"))},[z[14]||(z[14]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputRangeRef",ref:ze,type:"text",class:"dss-datepicker__input",placeholder:$.placeholder||e.unref(ce)("datepicker.selectRange"),value:Ct.value,readonly:""},null,8,us)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[L.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(yl,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Le,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":E.doubleCalendar&&Je.value&&fe.value==="days","dss-datepicker__dropdown--quick-select":E.doubleCalendar&&Je.value&&fe.value==="days"&&E.quickSelect,"dss-datepicker__dropdown--list":ut.value}]),onClick:z[9]||(z[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(Ht.value)},[ut.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[St.value.length?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"dss-datepicker__list",role:"listbox",ref_key:"listRef",ref:re},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(St.value,_=>(e.openBlock(),e.createElementBlock("li",{key:_.ts,role:"option","aria-selected":_.selected,class:e.normalizeClass(["dss-datepicker__list-item",{"dss-datepicker__list-item--selected":_.selected}]),onClick:le=>It(_.date)},[e.createElementVNode("span",ms,e.toDisplayString(_.label),1),_.selected?(e.openBlock(),e.createElementBlock("svg",ps,[...z[15]||(z[15]=[e.createElementVNode("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"},null,-1)])])):e.createCommentVNode("",!0)],10,ds))),128))],512)):(e.openBlock(),e.createElementBlock("div",fs,e.toDisplayString(e.unref(ce)("datepicker.noAvailableDates")),1))],64)):fe.value==="days"&&E.doubleCalendar&&Je.value?(e.openBlock(),e.createElementBlock("div",vs,[E.quickSelect?(e.openBlock(),e.createElementBlock("nav",hs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ne.value,_=>(e.openBlock(),e.createElementBlock("button",{key:_.id,type:"button",class:"dss-datepicker__quick-select-btn",disabled:!jl(_.id),onClick:le=>on(_.id)},e.toDisplayString(e.unref(ce)(_.labelKey)),9,gs))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",ys,[e.createElementVNode("div",ks,[e.createElementVNode("div",Cs,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.prevMonth"),onClick:Pn}," ‹ ",8,bs),e.createElementVNode("div",xs,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[2]||(z[2]=_=>nn("left","months"))},e.toDisplayString(We.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[3]||(z[3]=_=>nn("left","years"))},e.toDisplayString(J.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.nextMonth"),onClick:mn}," › ",8,ws)]),e.createElementVNode("div",Es,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.value,_=>(e.openBlock(),e.createElementBlock("span",{key:_,class:"dss-datepicker__weekday"},e.toDisplayString(_),1))),128))]),e.createElementVNode("div",Ss,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zt.value,(_,le)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+le},[_?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",bt(_)]),disabled:!Fe(_),onClick:Te=>ql(_),onMouseenter:Te=>ot(_),onMouseleave:Ie},e.toDisplayString(_.getDate()),43,Vs)):(e.openBlock(),e.createElementBlock("span",Ns))],64))),128))])]),e.createElementVNode("div",Bs,[e.createElementVNode("div",Ms,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.prevMonth"),onClick:pn}," ‹ ",8,_s),e.createElementVNode("div",$s,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[4]||(z[4]=_=>nn("right","months"))},e.toDisplayString(Dt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[5]||(z[5]=_=>nn("right","years"))},e.toDisplayString(me.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.nextMonth"),onClick:wn}," › ",8,Ls)]),e.createElementVNode("div",As,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.value,_=>(e.openBlock(),e.createElementBlock("span",{key:_,class:"dss-datepicker__weekday"},e.toDisplayString(_),1))),128))]),e.createElementVNode("div",Ts,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,(_,le)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+le},[_?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",bt(_)]),disabled:!Fe(_),onClick:Te=>ql(_),onMouseenter:Te=>ot(_),onMouseleave:Ie},e.toDisplayString(_.getDate()),43,Ds)):(e.openBlock(),e.createElementBlock("span",Hs))],64))),128))])])])])):fe.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",Rs,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.prevMonth"),onClick:dn}," ‹ ",8,Fs),e.createElementVNode("div",Is,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[6]||(z[6]=_=>fe.value="months")},e.toDisplayString(Kt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[7]||(z[7]=_=>fe.value="years")},e.toDisplayString(be.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.nextMonth"),onClick:Hl}," › ",8,zs)]),e.createElementVNode("div",Ps,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.value,_=>(e.openBlock(),e.createElementBlock("span",{key:_,class:"dss-datepicker__weekday"},e.toDisplayString(_),1))),128))]),e.createElementVNode("div",Os,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ge.value,(_,le)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:le},[_?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",bt(_)]),disabled:!Fe(_),onClick:Te=>ql(_),onMouseenter:Te=>ot(_),onMouseleave:Ie},e.toDisplayString(_.getDate()),43,Ws)):(e.openBlock(),e.createElementBlock("span",qs))],64))),128))])],64)):fe.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",Zs,[e.createElementVNode("div",Us,[e.createElementVNode("span",Xs,e.toDisplayString(yt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[8]||(z[8]=_=>fe.value="years")},e.toDisplayString(it.value),1)])]),e.createElementVNode("div",Ys,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(el.value,(_,le)=>(e.openBlock(),e.createElementBlock("button",{key:le,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":le===Yt.value}]),onClick:Te=>xl(le)},e.toDisplayString(_),11,js))),128))])],64)):fe.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",Ks,[e.createElementVNode("span",Gs,e.toDisplayString(ge.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:je},[e.createElementVNode("div",Qs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.value,_=>(e.openBlock(),e.createElementBlock("button",{key:_,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":_===it.value,"dss-datepicker__year-cell--current":_===e.unref(Qe)}]),"data-year":_,onClick:le=>Fl(_)},e.toDisplayString(_),11,Js))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},er=["data-chart-type"],tr={class:"dss-chart-header-titles"},lr={key:0,class:"dss-chart-title"},nr={key:1,class:"dss-chart-subtitle"},or=["onClick","onMouseenter"],ar={class:"dss-legend-text"},sr=["onClick","onMouseenter"],rr={class:"dss-legend-text"},ir=["title"],cr=["src"],ur={class:"dss-chart-area-wrapper"},dr={key:0,class:"dss-chart-z-axis-label"},mr=["width","height","data-smooth","data-animated"],pr=["id"],fr=["y","width","height"],vr=["id"],hr=["d"],gr=["id"],yr=["d"],kr={key:0},Cr=["clip-path"],br=["x1","x2","y1","y2"],xr=["clip-path"],wr=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray","opacity"],Er=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray","opacity"],Sr={class:"dss-axes"},Vr=["x1","x2","y1","y2"],Nr=["x1","x2","y1","y2"],Br=["x1","x2","y1","y2"],Mr={class:"dss-axis-labels"},_r=["x","y"],$r=["x","y"],Lr=["x","y"],Ar=["x","y"],Tr=["y","transform"],Dr=["x","y","transform"],Hr={key:2,class:"dss-flag-markers"},Rr=["clip-path"],Fr=["x1","x2","y1","y2","onMouseover"],Ir=["x1","x2","y1","y2","onMouseover"],zr=["x1","x2","y1","y2","onMouseover"],Pr=["cx","cy","onMouseover"],Or=["cx","cy","fill","onMouseover"],Wr=["x","y"],qr=["clip-path"],Zr={key:0},Ur=["d","onMouseover"],Xr=["x","y","width","height","fill","onMouseover"],Yr={class:"dss-line-chart"},jr=["d","stroke","stroke-width","stroke-dasharray"],Kr=["d","stroke","stroke-width","opacity"],Gr=["cx","cy","r","fill","onMouseover"],Qr={key:1},Jr=["d","stroke","stroke-width","stroke-dasharray"],ei=["d","stroke","stroke-width","stroke-dasharray"],ti=["d","stroke","stroke-width","opacity"],li=["cx","cy","r","fill","onMouseover"],ni={key:2},oi=["id"],ai=["x","y","width","height"],si=["d","fill","fill-opacity","mask"],ri=["d","stroke","stroke-width"],ii={key:3,class:"dss-stepbar-chart"},ci=["x","y","width","height","rx","ry","fill","onMouseover"],ui=["transform"],di=["r","fill","stroke","stroke-width"],mi=["font-size","fill"],pi=["d","fill","onMouseover"],fi=["x","y","width","height","onMouseover"],vi=["clip-path"],hi=["x1","x2","y1","y2","stroke"],gi=["cx","cy","r","fill"],yi={key:1,class:"dss-bubble-chart"},ki={key:0,class:"dss-bubble-group"},Ci=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],bi=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],xi=["transform"],wi=["cx","cy","r"],Ei=["data-chart-type","clip-path"],Si=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],Vi={key:1,class:"dss-radial-segment-data-labels"},Ni=["x","y"],Bi=["x","y","font-size","fill"],Mi=["x1","y1","x2","y2","stroke"],_i=["x1","y1","x2","y2","stroke"],$i=["x","y","text-anchor","font-size"],Li=["transform"],Ai={key:0,class:"dss-spider-grid"},Ti=["cx","cy","r"],Di={class:"dss-spider-grid-labels"},Hi=["x","y"],Ri=["x","y"],Fi=["x1","x2","y1","y2"],Ii={class:"dss-spider-labels"},zi=["x","y","text-anchor","dominant-baseline"],Pi=["points","fill","fill-opacity","stroke","stroke-width","stroke-dasharray"],Oi=["cx","cy","r","fill","stroke","stroke-width","onMouseover"],Wi={class:"dss-chart-logos"},qi=["cx","cy","r","fill"],Zi=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Ui=["onClick","onMouseenter"],Xi=["src"],Yi={class:"dss-marker-tooltip-category"},ji={key:0,class:"dss-marker-tooltip-description"},Ki={key:0,class:"dss-tooltip-section dss-spider-tooltip-section"},Gi={class:"dss-tooltip-title dss-spider-tooltip-area-title"},Qi={class:"dss-tooltip-series-name"},Ji={class:"dss-tooltip-series-value"},ec={key:1,class:"dss-tooltip-section"},tc={key:0,class:"dss-tooltip-title"},lc={class:"dss-bubble-tooltip-data"},nc={key:2,class:"dss-tooltip-section"},oc={class:"dss-tooltip-title"},ac={class:"dss-tooltip-value"},sc={key:0,class:"dss-tooltip-section"},rc={class:"dss-tooltip-section-title"},ic={class:"dss-tooltip-group-header"},cc={class:"dss-tooltip-item-content"},uc={class:"dss-tooltip-item-text"},dc={key:1,class:"dss-tooltip-section"},mc={class:"dss-tooltip-section-title"},pc={class:"dss-tooltip-item-content"},fc={class:"dss-tooltip-item-title"},vc={key:0,class:"dss-tooltip-item-description"},hc={class:"dss-tooltip-section"},gc={class:"dss-tooltip-title"},yc={key:0,class:"dss-bubble-tooltip-data"},kc={class:"dss-tooltip-series-name"},Cc={class:"dss-tooltip-series-value"},bc={key:0,class:"dss-tooltip-section"},xc={class:"dss-tooltip-section-title"},wc={class:"dss-tooltip-group-header"},Ec={class:"dss-tooltip-item-content"},Sc={class:"dss-tooltip-item-text"},Vc={key:1,class:"dss-tooltip-section"},Nc={class:"dss-tooltip-section-title"},Bc={class:"dss-tooltip-item-content"},Mc={class:"dss-tooltip-item-title"},_c={key:0,class:"dss-tooltip-item-description"},$c=["onClick","onMouseenter"],Lc={class:"dss-legend-text"},Ac={key:1,class:"dss-context-menu-separator"},Tc={key:0,class:"dss-context-menu-separator"},Dc={key:0,class:"dss-context-menu-separator"},Hc=["onClick"],Rc=["innerHTML"],Fc={key:0,class:"dss-context-menu-icon"},Ic={class:"dss-marker-modal-header"},zc={class:"dss-marker-modal-body"},Pc={class:"dss-form-group"},Oc={class:"dss-form-group"},Wc={for:"dss-marker-description"},qc={key:0,class:"dss-form-text-display"},Zc=["placeholder"],Uc={class:"dss-marker-modal-footer"},Xc={class:"modal-footer-left"},Yc={class:"dss-modal-footer-right"},jc=["disabled"],Kc={name:"DSSChart"},Gc=Object.assign(Kc,{props:{series:{type:Array,required:!0,default:()=>[]},categories:{type:Array,default:()=>[]},flags:{type:Array,default:()=>[]},markers:{type:Array,default:()=>[]},showAddMarkerButton:{type:Boolean,default:!0},chartId:{type:String,default:()=>"chart-"+Math.random().toString(36).substring(2,9)},i18n:{type:Object,default:null},locale:{type:String,default:null},options:{type:Object,default:()=>({}),validator:E=>typeof E=="object"&&E!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(E,{emit:te}){const{t:$,locale:V}=ro.useI18n(),ce=te,O=e.ref(null),L=e.ref(null),fe=e.ref(null),rt=e.ref(0),ee=e.ref(0);let v=null,be=null;const ke=20,J=e.computed(()=>{if(ee.value,rt.value,!O.value||!L.value)return 0;try{const t=O.value.getBoundingClientRect();return L.value.getBoundingClientRect().top-t.top}catch{return 0}}),Y=e.computed(()=>`chart-clip-${F.chartId}`),me=e.computed(()=>`url(#${Y.value})`),F=E,ue={chart:{type:"line",width:800,height:400,orientation:"vertical"},title:{text:"",style:{}},subtitle:{text:"",style:{}},zAxis:"",xAxis:{title:{text:""},type:"category"},yAxis:{min:"auto",max:"auto",title:{text:""}},legend:{show:!0,position:"top",orientation:"horizontal"},radialLabels:{show:!1,pointerLength:25,horizontalLength:35,fontSize:14,color:"#000",textOffset:8},radialBar:{dataLabels:{show:!1,minAngleDegrees:20},dataCenter:{show:!1,fontSize:16}},miniRadial:{minVisiblePercent:1,trackColor:"#E5E7EB",thresholds:{low:33,medium:66},colors:{low:"#E53E3E",medium:"#ED8936",high:"#38A169"}},grid:{show:!0,style:{}},watermark:{enabled:!0,opacity:.05,size:35,position:"bottom-right"},colors:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"],logos:[],stroke:{width:2,curve:"smooth"},bubbles:{size:4},stepbar:{totalValue:100,segmentOrder:"input",showRemainder:!0,remainderLabel:"Remaining",remainderColor:"#E5E7EB",barWidth:42,minBarWidth:12,maxBarWidth:58,barRadius:6,axisBars:{show:!0,showVertical:!1,color:"#d6d6d6",opacity:.75,width:1,dashArray:"3,4"},maxSegment:{marker:{enabled:!1,icon:"",radius:8,backgroundColor:null,borderColor:"#fafafa",borderWidth:2,color:"#fafafa",fontSize:10}}},markers:{show:!0,icon:null,iconSize:25,customIcons:{}},fill:{area:{opacity:.3},spider:{opacity:.15}},crosshair:{show:!1,color:"#666"},bubbles:{size:4,tooltip:{fields:["x","y","size"],labels:{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},formatters:{}}},spider:{gridLabels:null,gridSteps:5,comparison:{fillOpacity:0,strokeDasharray:"6,4",usePrimaryColor:!0,bubbleSize:0}},zoom:{enabled:!1,minScale:1,maxScale:2.5},smoothing:{enabled:!1,factor:.3,barRadius:4},animations:{enabled:!0,type:"draw",duration:2500,delay:0,staggerDelay:200,easing:"ease-out",onDataChange:!0,respectReducedMotion:!0},valueFormat:{extension:""},contextMenu:{enabled:!0,items:{addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0},customItems:[]}};function $e(t,o){const l=Object.assign({},t);return mt(t)&&mt(o)&&Object.keys(o).forEach(r=>{mt(o[r])?r in t?l[r]=$e(t[r],o[r]):Object.assign(l,{[r]:o[r]}):Object.assign(l,{[r]:o[r]})}),l}const tt=()=>{let t=20,o=0,l=0;if(ut.value&&(t+=30),ht.value&&(t+=25),W.value&&F.series.length>0){const r=F.series.filter((m,f)=>!zt.value.has(f)).length;if(G.value==="top"||G.value==="bottom"){if(Ne.value==="horizontal"){const f=Math.floor(Ve.value/100);o=Math.ceil(r/f)*25+10}else o=r*25+10;t+=o}else l=150}return{height:t,legendHeight:o,legendWidth:l}};function mt(t){return t&&typeof t=="object"&&!Array.isArray(t)}const U=e.computed(()=>$e(ue,F.options)),ze=e.computed(()=>{const t=U.value;return t&&t.chart&&t.chart.width==="auto"}),qe=e.computed(()=>{const t=U.value;return t&&t.chart&&t.chart.height==="auto"}),Ve=e.computed(()=>{const t=U.value;return ze.value?rt.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),Le=e.ref(ke),je=e.computed(()=>{if(qe.value){const t=je.value;return t??Math.max(0,(ee.value||400)-Le.value*5)}}),re=e.computed(()=>{const t=U.value;if(Ce.value==="mini-radial")return Ve.value;if(qe.value){const o=je.value;return o??Math.max(0,(ee.value||400)-Le.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),Qe=e.computed(()=>{if(qe.value&&Ce.value==="semi-radial"&&je.value!=null)return Le.value+re.value+"px";if(qe.value)return"100%";if(al.value)return Le.value+re.value+"px";if(W.value&&G.value==="bottom"){const t=tt();return re.value+(t.legendHeight||35)+"px"}return re.value+(W.value?20:0)+"px"}),Ce=e.computed(()=>{const t=U.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),Je=e.computed(()=>{const t=F.series.map(o=>o.type||Ce.value);return new Set(t).size>1}),ut=e.computed(()=>{const t=U.value;return t&&t.title&&t.title.text?t.title.text:""}),ht=e.computed(()=>{const t=U.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),dt=e.computed(()=>{const t=U.value;if(!t||!t.zAxis)return"";const o=t.zAxis;return typeof o=="string"?o:o&&typeof o.label=="string"?o.label:""}),Wt=e.computed(()=>{const t=U.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),qt=e.computed(()=>{const t=U.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),Ct=e.computed(()=>{const t=U.value;return t&&t.yAxis&&t.yAxis.secondary&&typeof t.yAxis.secondary=="object"?t.yAxis.secondary:null}),wt=e.computed(()=>{const t=Ct.value;return t&&t.title&&t.title.text?t.title.text:""}),Yt=e.computed(()=>{const t=U.value;if(!t||!t.yAxis)return Be;const o=t.yAxis.min;return typeof o=="number"||o===Be?o:Be}),it=e.computed(()=>{const t=U.value;if(!t||!t.yAxis)return Be;const o=t.yAxis.max;return typeof o=="number"||o===Be?o:Be}),Kt=e.computed(()=>{const t=Ct.value;if(!t)return Be;const o=t.min;return typeof o=="number"||o===Be?o:Be}),yt=e.computed(()=>{const t=Ct.value;if(!t)return Be;const o=t.max;return typeof o=="number"||o===Be?o:Be}),el=e.computed(()=>{const t=U.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),X=e.computed(()=>{const t=U.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),ge=e.computed(()=>{const t=U.value;return t&&t.grid&&t.grid.show!==!1}),W=e.computed(()=>{const t=U.value;return t&&t.legend&&t.legend.show!==!1}),G=e.computed(()=>{const t=U.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Ne=e.computed(()=>{const t=U.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Pe=e.computed(()=>{const t=U.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),Xe=e.computed(()=>{const t=U.value;if(!t||!t.crosshair)return!1;const o=t.crosshair.show;return o===!0||o==="true"}),Et=e.computed(()=>{const t=U.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Ge=e.computed(()=>{const t=U.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),Zt=e.computed(()=>{const t=U.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),Ue=e.computed(()=>{const t=U.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),We=e.computed(()=>{const t=U.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),Dt=e.computed(()=>{if(!al.value)return 0;const t=U.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),Lt=e.computed(()=>{const t=U.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),ne=e.computed(()=>{const{maxX:t}=He.value;return t===0}),j=(t,o)=>ne.value&&o===0?5:o,K=t=>{const o=Number(t);return!Number.isFinite(o)||o<=0?0:o},de=e.computed(()=>{const t=U.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),xe=e.computed(()=>{const t=U.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),Ke=e.computed(()=>{const t=U.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),Ht=e.computed(()=>{const t=U.value;return xe.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),jt=e.computed(()=>{const t=U.value,o=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return o.length>0?o:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),et=e.computed(()=>U.value?.stepbar||{}),vl=e.computed(()=>{const t=et.value?.segmentOrder;return["asc","desc","input"].includes(t)?t:"input"}),M=e.computed(()=>{const t=Number(et.value?.totalValue);return Number.isFinite(t)&&t>0?t:100}),x=e.computed(()=>et.value?.showRemainder!==!1),A=e.computed(()=>et.value?.remainderLabel||"Remaining"),ae=e.computed(()=>et.value?.remainderColor||"#E5E7EB"),oe=e.computed(()=>{const t=Number(et.value?.barWidth);return Number.isFinite(t)&&t>0?t:42}),Fe=e.computed(()=>{const t=Number(et.value?.minBarWidth);return Number.isFinite(t)&&t>0?t:12}),bt=e.computed(()=>{const t=Number(et.value?.maxBarWidth);return Number.isFinite(t)&&t>0?t:58}),ot=e.computed(()=>{const t=Number(et.value?.barRadius);return Number.isFinite(t)&&t>=0?t:6}),Ie=e.computed(()=>et.value?.axisBars||{}),xt=e.computed(()=>Ie.value?.show!==!1),Mt=e.computed(()=>Ie.value?.showVertical===!0),St=e.computed(()=>Ie.value?.color||"#d6d6d6"),At=e.computed(()=>{const t=Number(Ie.value?.opacity);return Number.isFinite(t)?Math.min(Math.max(t,0),1):.75}),It=e.computed(()=>{const t=Number(Ie.value?.width);return Number.isFinite(t)&&t>0?t:1}),Nt=e.computed(()=>Ie.value?.dashArray||"3,4"),yl=e.computed(()=>et.value?.maxSegment?.marker||{}),nn=e.computed(()=>yl.value?.enabled===!0),Vl=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.enabled!==!1}),Nl=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),tl=e.computed(()=>{const t=U.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),jl=e.computed(()=>{const t=U.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),on=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),xl=e.computed(()=>{const t=U.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),Fl=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.onDataChange!==!1}),dn=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),Hl=e.computed(()=>{const t=U.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),Pn=e.computed(()=>U.value?.spider?.gridSteps||5),mn=e.computed(()=>{const t=[],o=Pn.value;for(let l=1;l<=o;l++)t.push(gt.value/o*l);return t}),pn=t=>{const o=wn.value;if(o&&Array.isArray(o)&&o[t]!==void 0)return o[t].toString();const l=mn.value[t];return Math.round(l/gt.value*100)+"%"},wn=e.computed(()=>U.value?.spider?.gridLabels||null),ql=e.computed(()=>{const t=U.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),rl=e.computed(()=>{const t=U.value,o={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...o,...t.contextMenu.items}:o}),Il=e.computed(()=>{const t=U.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Kl=e.computed(()=>{const t=U.value;return t&&t.markers&&t.markers.icon?t.markers.icon:Ll.value}),sn=e.computed(()=>{const t=U.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),T=e.computed(()=>{const t=U.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),z=e.computed(()=>{const o=U.value?.valueFormat?.extension;return typeof o=="string"?o:""}),_=t=>{const o=z.value;if(t==null)return"";const l=String(t);return o?l+o:l},le=e.computed(()=>!ie.value.isZooming);e.computed(()=>Tt.value.map(t=>{if(t.categoryIndex!==void 0&&(ol.value||ul.value)){const o=vt(t.categoryIndex),l=J.value+R.value.bottom-T.value/2;return{...t,x:o,y:l}}return t}));function Te(t,o){let l;if(t instanceof Date)l=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[f,C,b]=t.split("-"),P=Number(b?.length===2?`20${b}`:b);l=new Date(P,Number(C)-1,Number(f))}else return 0;let r=0,m=1/0;return o.forEach((f,C)=>{const[b,P,B]=f.split("-"),H=Number(B?.length===2?`20${B}`:B),S=new Date(H,Number(P)-1,Number(b)),q=Math.abs(S-l);q<m&&(m=q,r=C)}),r}const pt=e.computed(()=>{const t=F.markers.map(l=>{const r=Te(l.marker_date,F.categories),m=vt(r),f=J.value+R.value.bottom-T.value/2;return{...l,x:m,y:f,categoryIndex:r,source:"props"}}),o=Tt.value.map(l=>{if(l.categoryIndex!==void 0&&(ol.value||ul.value)){const r=vt(l.categoryIndex),m=J.value+R.value.bottom-T.value/2;return{...l,x:r,y:m,source:"internal"}}return{...l,source:"internal"}});return[...t,...o]}),ct=e.computed(()=>{const t=U.value;return t&&t.watermark&&t.watermark.enabled===!0}),lt=e.computed(()=>{const t=U.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),st=e.computed(()=>{const t=U.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),il=e.computed(()=>{const t=U.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),kl=e.computed(()=>{const t={left:R.value.left,top:R.value.top,width:R.value.width,height:R.value.height};let o,l;const r=String(st.value);if(r.includes("%")){const m=parseFloat(r)/100;o=t.width*m,l=o*(96/499)}else{const m=parseFloat(r)||25;o=Math.min(t.width*.25,200)*(m/25),l=o*(96/499)}return{width:o,height:l,area:t}}),Gt=e.computed(()=>{const{width:t,height:o}=kl.value,l=il.value;let r,m;const f=R.value.left,C=R.value.right,b=R.value.top,P=R.value.bottom,B=R.value.width,H=R.value.height;switch(l){case"center":r=f+(B-t)/2,m=b+(H-o)/2;break;case"top-left":r=f+15,m=b+5;break;case"top-right":r=C-t-15,m=b+5;break;case"bottom-left":r=f+15,m=P-o-5;break;case"bottom-right":default:r=C-t-15,m=P-o-5;break}return{backgroundPositionX:r+"px",backgroundPositionY:m+"px",backgroundSize:`${t}px ${o}px`}}),wl=t=>!F.flags||!F.flags.length?[]:F.flags.filter(o=>o.categoryIndex===t),Rt=t=>{const o=wl(t),l=Xo(t),r=o.filter(C=>C.manual),m=o.filter(C=>!C.manual),f=[];return r.length>0&&f.push({type:$("chart.tooltip.manualFlags"),color:"#698dbe",flags:r.map(C=>({text:C.text,color:"#698dbe"}))}),m.length>0&&f.push({type:$("chart.tooltip.autoFlags"),color:"#a1d499",flags:m.map(C=>({text:C.text,color:"#a1d499"}))}),{flagGroups:f,markers:l.map(C=>({title:C.title,description:C.description,type:$("chart.tooltip.markers"),color:C.color||"#9784ba"}))}},Ll=e.computed(()=>{const t=F.old?`<svg width="55" height="56" viewBox="0 0 55 56" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),so=require("vue-i18n"),os={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},as=["value"],ss=["placeholder","value","disabled"],rs=["placeholder","value"],is=["placeholder","value"],cs=["aria-selected","onClick"],us={class:"dss-datepicker__list-item-label"},ds={key:0,class:"dss-datepicker__list-item-check",width:"16",height:"16",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},ms={key:1,class:"dss-datepicker__list-empty"},ps={key:1,class:"dss-datepicker__double-wrap"},vs={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},fs=["disabled","onClick"],hs={class:"dss-datepicker__double-calendars"},gs={class:"dss-datepicker__double-calendar"},ys={class:"dss-datepicker__calendar-header"},ks=["aria-label"],Cs={class:"dss-datepicker__month-year-row"},bs=["aria-label"],ws={class:"dss-datepicker__weekdays"},xs={class:"dss-datepicker__grid"},Es=["disabled","onClick","onMouseenter"],Ss={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Vs={class:"dss-datepicker__double-calendar"},Ns={class:"dss-datepicker__calendar-header"},Bs=["aria-label"],Ms={class:"dss-datepicker__month-year-row"},_s=["aria-label"],$s={class:"dss-datepicker__weekdays"},Ls={class:"dss-datepicker__grid"},Ts=["disabled","onClick","onMouseenter"],As={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Ds={class:"dss-datepicker__calendar-header"},Hs=["aria-label"],Rs={class:"dss-datepicker__month-year-row"},Fs=["aria-label"],Is={class:"dss-datepicker__weekdays"},zs={class:"dss-datepicker__grid"},Ps=["disabled","onClick","onMouseenter"],Os={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Ws={class:"dss-datepicker__calendar-header"},qs={class:"dss-datepicker__month-year-row"},Zs={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},Us={class:"dss-datepicker__months-grid"},Xs=["onClick"],Ys={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},js={class:"dss-datepicker__month-year"},Ks={class:"dss-datepicker__years-grid"},Gs=["data-year","onClick"],Ea=27,In=8,ca={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:E=>["single","range","singleFromAvailable","rangeFromAvailable","listFromAvailable","readonly"].includes(E)},modelValue:{type:[Date,Object],default:null},availableDates:{type:Array,default:()=>[]},minDate:{type:Date,default:null},maxDate:{type:Date,default:null},exceptDates:{type:Array,default:()=>[]},doubleCalendar:{type:Boolean,default:!1},quickSelect:{type:Boolean,default:!0},placeholder:{type:String,default:""}},emits:["update:modelValue"],setup(E,{emit:le}){const _=E,B=le,{t:de,locale:P}=so.useI18n(),T=e.ref(!1),he=e.ref("days"),st=new Date,te=e.computed(()=>_.minDate instanceof Date?_.minDate:st),f=e.ref(te.value.getMonth()),we=e.ref(te.value.getFullYear()),Ce=e.ref(te.value.getMonth()),J=e.ref(te.value.getFullYear()),X=e.ref(te.value.getMonth()),fe=e.ref(te.value.getFullYear()),R=e.ref("start"),me=e.ref(null),_e=e.ref(null);function Je(){const $=te.value,O=$.getMonth(),D=$.getFullYear(),ne=O===11?0:O+1,Ae=O===11?D+1:D;return{left:{month:O,year:D},right:{month:ne,year:Ae}}}const pt=e.ref(null),Z=e.ref(null),Fe=e.ref(null),We=e.ref(null),Se=e.ref(null),Le=e.ref(null),Ye=e.ref(null),ie=e.ref(null),Ge=new Date().getFullYear(),be=e.computed(()=>["single","singleFromAvailable"].includes(_.mode)),Qe=e.computed(()=>["range","rangeFromAvailable"].includes(_.mode)),ct=e.computed(()=>_.mode==="listFromAvailable"),gt=e.computed(()=>{if(!["single","singleFromAvailable","listFromAvailable"].includes(_.mode))return null;const $=_.modelValue;return $ instanceof Date?$:null}),ut=e.computed(()=>{if(!Qe.value)return{start:null,end:null};const $=_.modelValue;return!$||typeof $!="object"?{start:null,end:null}:{start:$.start instanceof Date?$.start:null,end:$.end instanceof Date?$.end:null}});function qt($){if(!$||!($ instanceof Date))return"";const O=$.getDate(),D=$.getMonth()+1,ne=$.getFullYear(),Ae=it=>String(it).padStart(2,"0");return`${Ae(O)}/${Ae(D)}/${ne}`}const Zt=e.computed(()=>qt(gt.value)),kt=e.computed(()=>{const{start:$,end:O}=ut.value;if(!$&&!O)return"";const D=!O||$&&$<=O?$:O,ne=!$||O&&O>=$?O:$;return jt(D,ne)?qt(D):`${qt(D)} - ${qt(ne)}`}),xt=e.computed(()=>{if(_.mode!=="readonly")return"—";const $=_.modelValue;if($ instanceof Date)return qt($)||"—";if($&&typeof $=="object"&&("start"in $||"end"in $)){const O=$.start instanceof Date?$.start:null,D=$.end instanceof Date?$.end:null;if(!O&&!D)return"—";const ne=!D||O&&O<=D?O:D,Ae=!O||D&&D>=O?D:O;return jt(ne,Ae)?qt(ne):`${qt(ne)} - ${qt(Ae)}`}return"—"});e.computed(()=>{const $=new Date(we.value,f.value,1);return new Intl.DateTimeFormat(P.value,{month:"long",year:"numeric"}).format($)});const Yt=e.computed(()=>_e.value==="left"?Ce.value:_e.value==="right"?X.value:f.value),rt=e.computed(()=>_e.value==="left"?J.value:_e.value==="right"?fe.value:we.value),Jt=e.computed(()=>{const $=new Date(we.value,f.value,1);return new Intl.DateTimeFormat(P.value,{month:"long"}).format($)}),yt=e.computed(()=>{const $=new Date(rt.value,Yt.value,1);return new Intl.DateTimeFormat(P.value,{month:"long"}).format($)}),ol=e.computed(()=>{const $=new Intl.DateTimeFormat(P.value,{month:"short"});return Array.from({length:12},(O,D)=>$.format(new Date(2024,D,1)))}),U=e.computed(()=>{const O=(_e.value?rt.value:we.value)-Math.floor(Ea/2);return Array.from({length:Ea},(D,ne)=>O+ne)}),ke=e.computed(()=>{const $=U.value;return $.length?`${$[0]} – ${$[$.length-1]}`:""});function W($){return $===7?0:$}function G($){try{const O=new Intl.Locale($);if(O.weekInfo?.firstDay!=null)return W(O.weekInfo.firstDay)}catch{}return 1}function Ne($){const O=new Date(2024,0,1),D=(O.getDay()-$+7)%7,ne=new Date(O);return ne.setDate(O.getDate()-D),ne}const Ie=e.computed(()=>G(P.value)),Ue=e.computed(()=>{const $=new Intl.DateTimeFormat(P.value,{weekday:"short"}),O=Ne(Ie.value),D=[];for(let ne=0;ne<7;ne++){const Ae=new Date(O);Ae.setDate(O.getDate()+ne),D.push($.format(Ae).slice(0,2))}return D});function Et($,O,D){const ne=new Date($,O,1),Ae=new Date($,O+1,0),it=(ne.getDay()-D+7)%7,vt=Ae.getDate(),tt=[];for(let lt=0;lt<it;lt++)tt.push(null);for(let lt=1;lt<=vt;lt++)tt.push(new Date($,O,lt));return tt}const Ke=e.computed(()=>Et(we.value,f.value,Ie.value)),Ut=e.computed(()=>Et(J.value,Ce.value,Ie.value)),qe=e.computed(()=>Et(fe.value,X.value,Ie.value));e.computed(()=>{const $=new Date(J.value,Ce.value,1);return new Intl.DateTimeFormat(P.value,{month:"long",year:"numeric"}).format($)}),e.computed(()=>{const $=new Date(fe.value,X.value,1);return new Intl.DateTimeFormat(P.value,{month:"long",year:"numeric"}).format($)});const Pe=e.computed(()=>{const $=new Date(J.value,Ce.value,1);return new Intl.DateTimeFormat(P.value,{month:"long"}).format($)}),Ht=e.computed(()=>{const $=new Date(fe.value,X.value,1);return new Intl.DateTimeFormat(P.value,{month:"long"}).format($)}),$t=e.computed(()=>_.availableDates&&_.availableDates.length>0),oe=e.computed(()=>$t.value?[{id:"all",labelKey:"datepicker.quickSelect.allDates"},{id:"last2",labelKey:"datepicker.quickSelect.last2Dates"},{id:"last3",labelKey:"datepicker.quickSelect.last3Dates"},{id:"last4",labelKey:"datepicker.quickSelect.last4Dates"},{id:"last5",labelKey:"datepicker.quickSelect.last5Dates"}]:[{id:"today",labelKey:"datepicker.quickSelect.today"},{id:"lastWeek",labelKey:"datepicker.quickSelect.lastWeek"},{id:"last15Days",labelKey:"datepicker.quickSelect.last15Days"},{id:"last30Days",labelKey:"datepicker.quickSelect.last30Days"},{id:"thisMonth",labelKey:"datepicker.quickSelect.thisMonth"},{id:"last3Months",labelKey:"datepicker.quickSelect.last3Months"},{id:"last6Months",labelKey:"datepicker.quickSelect.last6Months"},{id:"last12Months",labelKey:"datepicker.quickSelect.last12Months"},{id:"lastYear",labelKey:"datepicker.quickSelect.lastYear"}]),Y=e.ref({top:0,left:0}),j=e.ref("left");let pe=null;function xe(){T.value&&e.nextTick(()=>{T.value&&(pe!==null&&window.cancelAnimationFrame(pe),pe=window.requestAnimationFrame(()=>{pe=null,je()}))})}function je(){if(!Se.value||!T.value)return;const $=Se.value.getBoundingClientRect(),O=window.innerWidth||document.documentElement.clientWidth,D=window.innerHeight||document.documentElement.clientHeight;let ne=$.left,Ae=$.bottom+4;const it=Le.value;if(it){const vt=it.offsetWidth,tt=it.offsetHeight;j.value==="right"||ne+vt>O-In?(j.value="right",ne=$.right-vt):j.value="left";const kl=Math.max(In,O-vt-In);if(ne=Math.min(Math.max(ne,In),kl),Ae+tt>D-In){const Sl=$.top-4-tt;Sl>=In?Ae=Sl:Ae=Math.max(In,D-tt-In)}}Y.value={top:Ae,left:ne}}const Rt=e.computed(()=>!Se.value||!T.value?{}:{position:"fixed",left:`${Y.value.left}px`,top:`${Y.value.top}px`,zIndex:1002});function jt($,O){return!$||!O?!1:$.getFullYear()===O.getFullYear()&&$.getMonth()===O.getMonth()&&$.getDate()===O.getDate()}function et($){return new Date($.getFullYear(),$.getMonth(),$.getDate()).getTime()}function pl($){return!_.availableDates||!_.availableDates.length?!0:_.availableDates.some(O=>O instanceof Date&&jt(O,$))}function M($){const O=et($);return!(_.minDate instanceof Date&&O<et(_.minDate)||_.maxDate instanceof Date&&O>et(_.maxDate))}function w($){const O=new Date($);return new Date(O.getFullYear(),O.getMonth(),O.getDate())}function A($){return $.filter(O=>M(O))}function se($,O){if(!($ instanceof Date)||!(O instanceof Date))return null;let D=et($),ne=et(O);if(D>ne&&([D,ne]=[ne,D]),_.minDate instanceof Date){const Ae=et(_.minDate);D=Math.max(D,Ae),ne=Math.max(ne,Ae)}if(_.maxDate instanceof Date){const Ae=et(_.maxDate);D=Math.min(D,Ae),ne=Math.min(ne,Ae)}return D>ne?null:{start:w(D),end:w(ne)}}function ae($){return!_.exceptDates||!_.exceptDates.length?!1:_.exceptDates.some(O=>O instanceof Date&&jt(O,$))}function He($){return ae($)?!1:["singleFromAvailable","rangeFromAvailable"].includes(_.mode)?pl($):M($)}function Ct($){const O=gt.value,D=ut.value,ne=et($),Ae=Qe.value&&D.start&&D.end&&ne>et(D.start)&&ne<et(D.end),it=Qe.value&&D.start&&jt($,D.start),vt=Qe.value&&D.end&&jt($,D.end),tt=it&&vt,lt=be.value&&O&&jt($,O)||it||vt;let kl=!1;if(Qe.value&&D.start&&!D.end&&me.value){const Sl=et(D.start),Tt=et(me.value),wl=Math.min(Sl,Tt),el=Math.max(Sl,Tt);kl=ne>wl&&ne<el}return{"dss-datepicker__day--selected":lt&&!tt,"dss-datepicker__day--range-start":it&&!tt,"dss-datepicker__day--range-end":vt&&!tt,"dss-datepicker__day--range-single":tt,"dss-datepicker__day--in-range":Ae&&!it&&!vt,"dss-datepicker__day--in-range-preview":kl&&!it&&!vt&&!Ae,"dss-datepicker__day--disabled":!He($)}}function nt($){if(!Qe.value)return;const O=ut.value;if(!O.start||O.end){me.value=null;return}if(!He($)){me.value=null;return}me.value=new Date($.getFullYear(),$.getMonth(),$.getDate())}function Re(){me.value=null}function bt(){if(!_.doubleCalendar||!Qe.value)return;const $=ut.value,{start:O,end:D}=$;if(O&&D){const it=O<=D?O:D,vt=O<=D?D:O,tt=it.getMonth(),lt=it.getFullYear(),kl=vt.getMonth(),Sl=vt.getFullYear();if(tt!==kl||lt!==Sl){const Tt=Ce.value===tt&&J.value===lt,wl=X.value===kl&&fe.value===Sl;if(Tt&&wl)return;Ce.value=tt,J.value=lt,X.value=kl,fe.value=Sl}else{const Tt=tt===0?11:tt-1,wl=tt===0?lt-1:lt;Ce.value===Tt&&J.value===wl&&X.value===tt&&fe.value===lt||(Ce.value=tt,J.value=lt,tt===11?(X.value=0,fe.value=lt+1):(X.value=tt+1,fe.value=lt))}return}const ne=O||D;if(ne){const it=ne.getMonth(),vt=ne.getFullYear(),tt=Ce.value===it&&J.value===vt,lt=X.value===it&&fe.value===vt;if(tt||lt)return;Ce.value=it,J.value=vt,it===11?(X.value=0,fe.value=vt+1):(X.value=it+1,fe.value=vt);return}const Ae=Je();Ce.value=Ae.left.month,J.value=Ae.left.year,X.value=Ae.right.month,fe.value=Ae.right.year}const _t=e.computed(()=>new Intl.DateTimeFormat(P.value,{day:"2-digit",month:"long",year:"numeric"})),St=e.computed(()=>{if(!ct.value)return[];const $=(_.availableDates||[]).filter(D=>D instanceof Date&&!Number.isNaN(D.getTime())).filter(D=>!ae(D)&&M(D)).map(D=>new Date(D.getFullYear(),D.getMonth(),D.getDate()));$.sort((D,ne)=>ne.getTime()-D.getTime());const O=gt.value;return $.map(D=>({date:D,ts:D.getTime(),label:_t.value.format(D),selected:!!(O&&jt(D,O))}))});function Lt(){if(T.value){Kt();return}Se.value=We.value?.closest(".dss-datepicker__input-wrap"),j.value="left",T.value=!0,xe(),e.nextTick(()=>{ie.value?.querySelector(".dss-datepicker__list-item--selected")?.scrollIntoView({block:"nearest",behavior:"auto"})})}function zt($){if(!($ instanceof Date))return;const O=new Date($.getFullYear(),$.getMonth(),$.getDate());B("update:modelValue",O),Kt()}function Bt($="start"){if(_.mode==="readonly")return;R.value=$;const O=gt.value,D=ut.value;if(be.value&&O)f.value=O.getMonth(),we.value=O.getFullYear();else if(Qe.value)if(_.doubleCalendar)bt();else{const ne=$==="start"&&D.start?D.start:D.end||D.start;ne&&(f.value=ne.getMonth(),we.value=ne.getFullYear())}Se.value=be.value?pt.value?.closest(".dss-datepicker__input-wrap"):Z.value,he.value="days",_e.value=null,j.value="left",T.value=!0,xe()}function Kt(){he.value="days",_e.value=null,me.value=null,T.value=!1}function ql($,O){_e.value=$,he.value=O}function jl(){he.value="days",_e.value=null}function El($){const O=new Date,D=O.getFullYear(),ne=O.getMonth(),Ae=O.getDate();let it,vt;if($t.value){const tt=A([..._.availableDates].filter(lt=>lt instanceof Date).map(lt=>new Date(lt.getFullYear(),lt.getMonth(),lt.getDate()))).sort((lt,kl)=>lt.getTime()-kl.getTime());if(tt.length===0)return null;if($==="all")it=tt[0],vt=tt[tt.length-1];else{const lt=parseInt($.replace("last",""),10);if(lt<2||lt>5)return null;const kl=tt.slice(-lt);if(kl.length===0)return null;it=kl[0],vt=kl[kl.length-1]}}else{const tt=new Date(D,ne,Ae);switch($){case"today":it=tt,vt=tt;break;case"lastWeek":it=new Date(D,ne,Ae-6),vt=tt;break;case"last15Days":it=new Date(D,ne,Ae-14),vt=tt;break;case"last30Days":it=new Date(D,ne,Ae-29),vt=tt;break;case"thisMonth":it=new Date(D,ne,1),vt=tt;break;case"last3Months":it=new Date(D,ne-3,1),vt=new Date(D,ne,0);break;case"last6Months":it=new Date(D,ne-6,1),vt=new Date(D,ne,0);break;case"last12Months":it=new Date(D,ne-12,1),vt=new Date(D,ne,0);break;case"lastYear":it=new Date(D-1,0,1),vt=new Date(D-1,11,31);break;default:return null}}return{start:it,end:vt}}function il($){const O=El($);return O?se(O.start,O.end):null}function vl($){return il($)!==null}function dn($){const O=il($);O&&(B("update:modelValue",O),bt())}function wn($){_e.value==="left"?Ce.value=$:_e.value==="right"?X.value=$:f.value=$,jl()}function Dl($){_e.value==="left"?J.value=$:_e.value==="right"?fe.value=$:we.value=$,jl()}function mn(){f.value===0?(f.value=11,we.value--):f.value--}function $l(){f.value===11?(f.value=0,we.value++):f.value++}function zn(){Ce.value===0?(Ce.value=11,J.value--):Ce.value--}function Dn(){Ce.value===11?(Ce.value=0,J.value++):Ce.value++}function on(){X.value===0?(X.value=11,fe.value--):X.value--}function bl(){X.value===11?(X.value=0,fe.value++):X.value++}function Fl($){if(!He($))return;const O=new Date($.getFullYear(),$.getMonth(),$.getDate());if(be.value){B("update:modelValue",O),Kt();return}const D=ut.value;if(!D.start&&!D.end){B("update:modelValue",{start:O,end:null}),R.value="end";return}if(D.start&&D.end){B("update:modelValue",{start:O,end:null}),R.value="end";return}if(R.value==="start"){let ne=O,Ae=D.end;ne&&Ae&&ne>Ae&&([ne,Ae]=[Ae,ne]),B("update:modelValue",{start:ne||Ae,end:Ae||ne}),R.value="end"}else{let ne=D.start,Ae=O;ne&&Ae&&Ae<ne&&([ne,Ae]=[Ae,ne]),B("update:modelValue",{start:ne||Ae,end:Ae||ne}),R.value="start"}}e.watch(ut,()=>{_.doubleCalendar&&Qe.value&&T.value&&bt()},{deep:!0});let Kl=null,Hl=null,Ml=null;function pn(){Kl&&(document.removeEventListener("keydown",Kl),Kl=null),Hl&&(window.removeEventListener("resize",Hl),Hl=null),Ml&&(window.removeEventListener("scroll",Ml,!0),Ml=null)}return e.watch(he,$=>{$==="years"&&e.nextTick(()=>{Ye.value?.querySelector(`[data-year="${rt.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(()=>[T.value,he.value,f.value,we.value,Ce.value,J.value,X.value,fe.value,_e.value,_.doubleCalendar,_.quickSelect],()=>{xe()}),e.watch(T,$=>{pn(),$&&(Kl=O=>{O.key==="Escape"&&(he.value==="years"||he.value==="months"?jl():Kt())},Hl=()=>{je()},Ml=()=>{je()},document.addEventListener("keydown",Kl),window.addEventListener("resize",Hl),window.addEventListener("scroll",Ml,!0))}),e.onBeforeUnmount(()=>{pe!==null&&(window.cancelAnimationFrame(pe),pe=null),pn()}),($,O)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":E.mode==="readonly"}])},[E.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",os,[O[10]||(O[10]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{type:"text",class:"dss-datepicker__input",value:xt.value,readonly:"",disabled:"",tabindex:"-1"},null,8,as)])):be.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:O[0]||(O[0]=D=>Bt("start"))},[O[11]||(O[11]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputSingleRef",ref:pt,type:"text",class:"dss-datepicker__input",placeholder:_.placeholder||e.unref(de)("datepicker.selectDate"),value:Zt.value,readonly:"",disabled:E.mode==="readonly"},null,8,ss)])):ct.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["dss-datepicker__input-wrap dss-datepicker__input-wrap--list",{"dss-datepicker__input-wrap--open":T.value}]),onClick:Lt},[O[13]||(O[13]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputListRef",ref:We,type:"text",class:"dss-datepicker__input",placeholder:_.placeholder||e.unref(de)("datepicker.selectFromList"),value:Zt.value,readonly:""},null,8,rs),e.createElementVNode("span",{class:e.normalizeClass(["dss-datepicker__chevron",{"dss-datepicker__chevron--open":T.value}]),"aria-hidden":"true"},[...O[12]||(O[12]=[e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"})],-1)])],2)],2)):Qe.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:Z,onClick:O[1]||(O[1]=D=>Bt("start"))},[O[14]||(O[14]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputRangeRef",ref:Fe,type:"text",class:"dss-datepicker__input",placeholder:_.placeholder||e.unref(de)("datepicker.selectRange"),value:kt.value,readonly:""},null,8,is)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[T.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(Kt,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Le,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":E.doubleCalendar&&Qe.value&&he.value==="days","dss-datepicker__dropdown--quick-select":E.doubleCalendar&&Qe.value&&he.value==="days"&&E.quickSelect,"dss-datepicker__dropdown--list":ct.value}]),onClick:O[9]||(O[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(Rt.value)},[ct.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[St.value.length?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"dss-datepicker__list",role:"listbox",ref_key:"listRef",ref:ie},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(St.value,D=>(e.openBlock(),e.createElementBlock("li",{key:D.ts,role:"option","aria-selected":D.selected,class:e.normalizeClass(["dss-datepicker__list-item",{"dss-datepicker__list-item--selected":D.selected}]),onClick:ne=>zt(D.date)},[e.createElementVNode("span",us,e.toDisplayString(D.label),1),D.selected?(e.openBlock(),e.createElementBlock("svg",ds,[...O[15]||(O[15]=[e.createElementVNode("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"},null,-1)])])):e.createCommentVNode("",!0)],10,cs))),128))],512)):(e.openBlock(),e.createElementBlock("div",ms,e.toDisplayString(e.unref(de)("datepicker.noAvailableDates")),1))],64)):he.value==="days"&&E.doubleCalendar&&Qe.value?(e.openBlock(),e.createElementBlock("div",ps,[E.quickSelect?(e.openBlock(),e.createElementBlock("nav",vs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oe.value,D=>(e.openBlock(),e.createElementBlock("button",{key:D.id,type:"button",class:"dss-datepicker__quick-select-btn",disabled:!vl(D.id),onClick:ne=>dn(D.id)},e.toDisplayString(e.unref(de)(D.labelKey)),9,fs))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",hs,[e.createElementVNode("div",gs,[e.createElementVNode("div",ys,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.prevMonth"),onClick:zn}," ‹ ",8,ks),e.createElementVNode("div",Cs,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[2]||(O[2]=D=>ql("left","months"))},e.toDisplayString(Pe.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[3]||(O[3]=D=>ql("left","years"))},e.toDisplayString(J.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.nextMonth"),onClick:Dn}," › ",8,bs)]),e.createElementVNode("div",ws,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,D=>(e.openBlock(),e.createElementBlock("span",{key:D,class:"dss-datepicker__weekday"},e.toDisplayString(D),1))),128))]),e.createElementVNode("div",xs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ut.value,(D,ne)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+ne},[D?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Ct(D)]),disabled:!He(D),onClick:Ae=>Fl(D),onMouseenter:Ae=>nt(D),onMouseleave:Re},e.toDisplayString(D.getDate()),43,Es)):(e.openBlock(),e.createElementBlock("span",Ss))],64))),128))])]),e.createElementVNode("div",Vs,[e.createElementVNode("div",Ns,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.prevMonth"),onClick:on}," ‹ ",8,Bs),e.createElementVNode("div",Ms,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[4]||(O[4]=D=>ql("right","months"))},e.toDisplayString(Ht.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[5]||(O[5]=D=>ql("right","years"))},e.toDisplayString(fe.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.nextMonth"),onClick:bl}," › ",8,_s)]),e.createElementVNode("div",$s,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,D=>(e.openBlock(),e.createElementBlock("span",{key:D,class:"dss-datepicker__weekday"},e.toDisplayString(D),1))),128))]),e.createElementVNode("div",Ls,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qe.value,(D,ne)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+ne},[D?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Ct(D)]),disabled:!He(D),onClick:Ae=>Fl(D),onMouseenter:Ae=>nt(D),onMouseleave:Re},e.toDisplayString(D.getDate()),43,Ts)):(e.openBlock(),e.createElementBlock("span",As))],64))),128))])])])])):he.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",Ds,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.prevMonth"),onClick:mn}," ‹ ",8,Hs),e.createElementVNode("div",Rs,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[6]||(O[6]=D=>he.value="months")},e.toDisplayString(Jt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[7]||(O[7]=D=>he.value="years")},e.toDisplayString(we.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.nextMonth"),onClick:$l}," › ",8,Fs)]),e.createElementVNode("div",Is,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,D=>(e.openBlock(),e.createElementBlock("span",{key:D,class:"dss-datepicker__weekday"},e.toDisplayString(D),1))),128))]),e.createElementVNode("div",zs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke.value,(D,ne)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ne},[D?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Ct(D)]),disabled:!He(D),onClick:Ae=>Fl(D),onMouseenter:Ae=>nt(D),onMouseleave:Re},e.toDisplayString(D.getDate()),43,Ps)):(e.openBlock(),e.createElementBlock("span",Os))],64))),128))])],64)):he.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",Ws,[e.createElementVNode("div",qs,[e.createElementVNode("span",Zs,e.toDisplayString(yt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[8]||(O[8]=D=>he.value="years")},e.toDisplayString(rt.value),1)])]),e.createElementVNode("div",Us,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ol.value,(D,ne)=>(e.openBlock(),e.createElementBlock("button",{key:ne,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":ne===Yt.value}]),onClick:Ae=>wn(ne)},e.toDisplayString(D),11,Xs))),128))])],64)):he.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",Ys,[e.createElementVNode("span",js,e.toDisplayString(ke.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:Ye},[e.createElementVNode("div",Ks,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,D=>(e.openBlock(),e.createElementBlock("button",{key:D,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":D===rt.value,"dss-datepicker__year-cell--current":D===e.unref(Ge)}]),"data-year":D,onClick:ne=>Dl(D)},e.toDisplayString(D),11,Gs))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},Qs=["data-chart-type"],Js={class:"dss-chart-header-titles"},er={key:0,class:"dss-chart-title"},tr={key:1,class:"dss-chart-subtitle"},lr=["onClick","onMouseenter"],nr={class:"dss-legend-text"},or=["onClick","onMouseenter"],ar={class:"dss-legend-text"},sr=["title"],rr=["src"],ir={class:"dss-chart-area-wrapper"},cr={key:0,class:"dss-chart-z-axis-label"},ur=["width","height","data-smooth","data-animated"],dr=["id"],mr=["y","width","height"],pr=["id"],vr=["d"],fr=["id"],hr=["d"],gr={key:0},yr=["clip-path"],kr=["x1","x2","y1","y2"],Cr=["clip-path"],br=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray","opacity"],wr=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray","opacity"],xr={class:"dss-axes"},Er=["x1","x2","y1","y2"],Sr=["x1","x2","y1","y2"],Vr=["x1","x2","y1","y2"],Nr={class:"dss-axis-labels"},Br=["x","y"],Mr=["x","y"],_r=["x","y"],$r=["x","y"],Lr=["y","transform"],Tr=["x","y","transform"],Ar={key:2,class:"dss-flag-markers"},Dr=["clip-path"],Hr=["x1","x2","y1","y2","onMouseover"],Rr=["x1","x2","y1","y2","onMouseover"],Fr=["x1","x2","y1","y2","onMouseover"],Ir=["cx","cy","onMouseover"],zr=["cx","cy","fill","onMouseover"],Pr=["x","y"],Or=["clip-path"],Wr={key:0},qr=["d","onMouseover"],Zr=["x","y","width","height","fill","onMouseover"],Ur={class:"dss-line-chart"},Xr=["d","stroke","stroke-width","stroke-dasharray"],Yr=["d","stroke","stroke-width","opacity"],jr=["cx","cy","r","fill","onMouseover"],Kr={key:1},Gr=["d","stroke","stroke-width","stroke-dasharray"],Qr=["d","stroke","stroke-width","stroke-dasharray"],Jr=["d","stroke","stroke-width","opacity"],ei=["cx","cy","r","fill","onMouseover"],ti={key:2},li=["id"],ni=["x","y","width","height"],oi=["d","fill","fill-opacity","mask"],ai=["d","stroke","stroke-width"],si={key:3,class:"dss-stepbar-chart"},ri=["id"],ii=["d"],ci=["clip-path"],ui=["x","y","width","height","fill","onMouseover"],di=["d","fill","onMouseover"],mi=["x","y","width","height","onMouseover"],pi=["clip-path"],vi=["x1","x2","y1","y2","stroke"],fi=["cx","cy","r","fill"],hi={key:1,class:"dss-bubble-chart"},gi={key:0,class:"dss-bubble-group"},yi=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],ki=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],Ci=["transform"],bi=["cx","cy","r"],wi=["data-chart-type","clip-path"],xi=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],Ei={key:1,class:"dss-radial-segment-data-labels"},Si=["x","y"],Vi=["x","y","font-size","fill"],Ni=["x1","y1","x2","y2","stroke"],Bi=["x1","y1","x2","y2","stroke"],Mi=["x","y","text-anchor","font-size"],_i=["transform"],$i={key:0,class:"dss-spider-grid"},Li=["cx","cy","r"],Ti={class:"dss-spider-grid-labels"},Ai=["x","y"],Di=["x","y"],Hi=["x1","x2","y1","y2"],Ri={class:"dss-spider-labels"},Fi=["x","y","text-anchor","dominant-baseline"],Ii=["points","fill","fill-opacity","stroke","stroke-width","stroke-dasharray"],zi=["cx","cy","r","fill","stroke","stroke-width","onMouseover"],Pi={class:"dss-chart-logos"},Oi=["cx","cy","r","fill"],Wi=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],qi=["onClick","onMouseenter"],Zi=["src"],Ui={class:"dss-marker-tooltip-category"},Xi={key:0,class:"dss-marker-tooltip-description"},Yi={key:0,class:"dss-tooltip-section dss-spider-tooltip-section"},ji={class:"dss-tooltip-title dss-spider-tooltip-area-title"},Ki={class:"dss-tooltip-series-name"},Gi={class:"dss-tooltip-series-value"},Qi={key:1,class:"dss-tooltip-section"},Ji={key:0,class:"dss-tooltip-title"},ec={class:"dss-bubble-tooltip-data"},tc={key:2,class:"dss-tooltip-section"},lc={class:"dss-tooltip-title"},nc={class:"dss-tooltip-value"},oc={key:0,class:"dss-tooltip-section"},ac={class:"dss-tooltip-section-title"},sc={class:"dss-tooltip-group-header"},rc={class:"dss-tooltip-item-content"},ic={class:"dss-tooltip-item-text"},cc={key:1,class:"dss-tooltip-section"},uc={class:"dss-tooltip-section-title"},dc={class:"dss-tooltip-item-content"},mc={class:"dss-tooltip-item-title"},pc={key:0,class:"dss-tooltip-item-description"},vc={class:"dss-tooltip-section"},fc={class:"dss-tooltip-title"},hc={key:0,class:"dss-bubble-tooltip-data"},gc={class:"dss-tooltip-series-name"},yc={class:"dss-tooltip-series-value"},kc={key:0,class:"dss-tooltip-section"},Cc={class:"dss-tooltip-section-title"},bc={class:"dss-tooltip-group-header"},wc={class:"dss-tooltip-item-content"},xc={class:"dss-tooltip-item-text"},Ec={key:1,class:"dss-tooltip-section"},Sc={class:"dss-tooltip-section-title"},Vc={class:"dss-tooltip-item-content"},Nc={class:"dss-tooltip-item-title"},Bc={key:0,class:"dss-tooltip-item-description"},Mc=["onClick","onMouseenter"],_c={class:"dss-legend-text"},$c={key:1,class:"dss-context-menu-separator"},Lc={key:0,class:"dss-context-menu-separator"},Tc={key:0,class:"dss-context-menu-separator"},Ac=["onClick"],Dc=["innerHTML"],Hc={key:0,class:"dss-context-menu-icon"},Rc={class:"dss-marker-modal-header"},Fc={class:"dss-marker-modal-body"},Ic={class:"dss-form-group"},zc={class:"dss-form-group"},Pc={for:"dss-marker-description"},Oc={key:0,class:"dss-form-text-display"},Wc=["placeholder"],qc={class:"dss-marker-modal-footer"},Zc={class:"modal-footer-left"},Uc={class:"dss-modal-footer-right"},Xc=["disabled"],Yc={name:"DSSChart"},jc=Object.assign(Yc,{props:{series:{type:Array,required:!0,default:()=>[]},categories:{type:Array,default:()=>[]},flags:{type:Array,default:()=>[]},markers:{type:Array,default:()=>[]},showAddMarkerButton:{type:Boolean,default:!0},chartId:{type:String,default:()=>"chart-"+Math.random().toString(36).substring(2,9)},i18n:{type:Object,default:null},locale:{type:String,default:null},options:{type:Object,default:()=>({}),validator:E=>typeof E=="object"&&E!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(E,{emit:le}){const{t:_,locale:B}=so.useI18n(),de=le,P=e.ref(null),T=e.ref(null),he=e.ref(null),st=e.ref(0),te=e.ref(0);let f=null,we=null;const Ce=20,J=e.computed(()=>{if(te.value,st.value,!P.value||!T.value)return 0;try{const t=P.value.getBoundingClientRect();return T.value.getBoundingClientRect().top-t.top}catch{return 0}}),X=e.computed(()=>`chart-clip-${R.chartId}`),fe=e.computed(()=>`url(#${X.value})`),R=E,me={chart:{type:"line",width:800,height:400,orientation:"vertical"},title:{text:"",style:{}},subtitle:{text:"",style:{}},zAxis:"",xAxis:{title:{text:""},type:"category"},yAxis:{min:"auto",max:"auto",title:{text:""}},legend:{show:!0,position:"top",orientation:"horizontal"},radialLabels:{show:!1,pointerLength:25,horizontalLength:35,fontSize:14,color:"#000",textOffset:8},radialBar:{dataLabels:{show:!1,minAngleDegrees:20},dataCenter:{show:!1,fontSize:16}},miniRadial:{minVisiblePercent:1,trackColor:"#E5E7EB",thresholds:{low:33,medium:66},colors:{low:"#E53E3E",medium:"#ED8936",high:"#38A169"}},grid:{show:!0,style:{}},watermark:{enabled:!0,opacity:.05,size:35,position:"bottom-right"},colors:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"],logos:[],stroke:{width:2,curve:"smooth"},bubbles:{size:4},stepbar:{totalValue:100,segmentOrder:"input",showRemainder:!0,remainderLabel:"Remaining",remainderColor:"#E5E7EB",barWidth:42,minBarWidth:12,maxBarWidth:58,barRadius:6,axisBars:{show:!0,showVertical:!1,color:"#d6d6d6",opacity:.75,width:1,dashArray:"3,4"},maxSegment:{marker:{enabled:!1,icon:"",radius:8,backgroundColor:null,borderColor:"#fafafa",borderWidth:2,color:"#fafafa",fontSize:10}}},markers:{show:!0,icon:null,iconSize:25,customIcons:{}},fill:{area:{opacity:.3},spider:{opacity:.15}},crosshair:{show:!1,color:"#666"},bubbles:{size:4,tooltip:{fields:["x","y","size"],labels:{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},formatters:{}}},spider:{gridLabels:null,gridSteps:5,comparison:{fillOpacity:0,strokeDasharray:"6,4",usePrimaryColor:!0,bubbleSize:0}},zoom:{enabled:!1,minScale:1,maxScale:2.5},smoothing:{enabled:!1,factor:.3,barRadius:4},animations:{enabled:!0,type:"draw",duration:2500,delay:0,staggerDelay:200,easing:"ease-out",onDataChange:!0,respectReducedMotion:!0},valueFormat:{extension:""},contextMenu:{enabled:!0,items:{addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0},customItems:[]}};function _e(t,o){const l=Object.assign({},t);return pt(t)&&pt(o)&&Object.keys(o).forEach(r=>{pt(o[r])?r in t?l[r]=_e(t[r],o[r]):Object.assign(l,{[r]:o[r]}):Object.assign(l,{[r]:o[r]})}),l}const Je=()=>{let t=20,o=0,l=0;if(ct.value&&(t+=30),gt.value&&(t+=25),W.value&&R.series.length>0){const r=R.series.filter((m,v)=>!wt.value.has(v)).length;if(G.value==="top"||G.value==="bottom"){if(Ne.value==="horizontal"){const v=Math.floor(Se.value/100);o=Math.ceil(r/v)*25+10}else o=r*25+10;t+=o}else l=150}return{height:t,legendHeight:o,legendWidth:l}};function pt(t){return t&&typeof t=="object"&&!Array.isArray(t)}const Z=e.computed(()=>_e(me,R.options)),Fe=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.width==="auto"}),We=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.height==="auto"}),Se=e.computed(()=>{const t=Z.value;return Fe.value?st.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),Le=e.ref(Ce),Ye=e.computed(()=>{if(We.value){const t=Ye.value;return t??Math.max(0,(te.value||400)-Le.value*5)}}),ie=e.computed(()=>{const t=Z.value;if(be.value==="mini-radial")return Se.value;if(We.value){const o=Ye.value;return o??Math.max(0,(te.value||400)-Le.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),Ge=e.computed(()=>{if(We.value&&be.value==="semi-radial"&&Ye.value!=null)return Le.value+ie.value+"px";if(We.value)return"100%";if(cl.value)return Le.value+ie.value+"px";if(W.value&&G.value==="bottom"){const t=Je();return ie.value+(t.legendHeight||35)+"px"}return ie.value+(W.value?20:0)+"px"}),be=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),Qe=e.computed(()=>{const t=R.series.map(o=>o.type||be.value);return new Set(t).size>1}),ct=e.computed(()=>{const t=Z.value;return t&&t.title&&t.title.text?t.title.text:""}),gt=e.computed(()=>{const t=Z.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),ut=e.computed(()=>{const t=Z.value;if(!t||!t.zAxis)return"";const o=t.zAxis;return typeof o=="string"?o:o&&typeof o.label=="string"?o.label:""}),qt=e.computed(()=>{const t=Z.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),Zt=e.computed(()=>{const t=Z.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),kt=e.computed(()=>{const t=Z.value;return t&&t.yAxis&&t.yAxis.secondary&&typeof t.yAxis.secondary=="object"?t.yAxis.secondary:null}),xt=e.computed(()=>{const t=kt.value;return t&&t.title&&t.title.text?t.title.text:""}),Yt=e.computed(()=>{const t=Z.value;if(!t||!t.yAxis)return Q;const o=t.yAxis.min;return typeof o=="number"||o===Q?o:Q}),rt=e.computed(()=>{const t=Z.value;if(!t||!t.yAxis)return Q;const o=t.yAxis.max;return typeof o=="number"||o===Q?o:Q}),Jt=e.computed(()=>{const t=kt.value;if(!t)return Q;const o=t.min;return typeof o=="number"||o===Q?o:Q}),yt=e.computed(()=>{const t=kt.value;if(!t)return Q;const o=t.max;return typeof o=="number"||o===Q?o:Q}),ol=e.computed(()=>{const t=Z.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),U=e.computed(()=>{const t=Z.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),ke=e.computed(()=>{const t=Z.value;return t&&t.grid&&t.grid.show!==!1}),W=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.show!==!1}),G=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Ne=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Ie=e.computed(()=>{const t=Z.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),Ue=e.computed(()=>{const t=Z.value;if(!t||!t.crosshair)return!1;const o=t.crosshair.show;return o===!0||o==="true"}),Et=e.computed(()=>{const t=Z.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Ke=e.computed(()=>{const t=Z.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),Ut=e.computed(()=>{const t=Z.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),qe=e.computed(()=>{const t=Z.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),Pe=e.computed(()=>{const t=Z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),Ht=e.computed(()=>{if(!cl.value)return 0;const t=Z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),$t=e.computed(()=>{const t=Z.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),oe=e.computed(()=>{const{maxX:t}=ge.value;return t===0}),Y=(t,o)=>oe.value&&o===0?5:o,j=t=>{const o=Number(t);return!Number.isFinite(o)||o<=0?0:o},pe=e.computed(()=>{const t=Z.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),xe=e.computed(()=>{const t=Z.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),je=e.computed(()=>{const t=Z.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),Rt=e.computed(()=>{const t=Z.value;return xe.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),jt=e.computed(()=>{const t=Z.value,o=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return o.length>0?o:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),et=e.computed(()=>Z.value?.stepbar||{}),pl=e.computed(()=>{const t=et.value?.segmentOrder;return["asc","desc","input"].includes(t)?t:"input"}),M=e.computed(()=>{const t=Number(et.value?.totalValue);return Number.isFinite(t)&&t>0?t:100}),w=e.computed(()=>et.value?.showRemainder!==!1),A=e.computed(()=>et.value?.remainderLabel||"Remaining"),se=e.computed(()=>et.value?.remainderColor||"#E5E7EB"),ae=e.computed(()=>{const t=Number(et.value?.barWidth);return Number.isFinite(t)&&t>0?t:42}),He=e.computed(()=>{const t=Number(et.value?.minBarWidth);return Number.isFinite(t)&&t>0?t:12}),Ct=e.computed(()=>{const t=Number(et.value?.maxBarWidth);return Number.isFinite(t)&&t>0?t:58}),nt=e.computed(()=>{const t=Number(et.value?.barRadius);return Number.isFinite(t)&&t>=0?t:6}),Re=e.computed(()=>et.value?.axisBars||{}),bt=e.computed(()=>Re.value?.show!==!1),_t=e.computed(()=>Re.value?.showVertical===!0),St=e.computed(()=>Re.value?.color||"#d6d6d6"),Lt=e.computed(()=>{const t=Number(Re.value?.opacity);return Number.isFinite(t)?Math.min(Math.max(t,0),1):.75}),zt=e.computed(()=>{const t=Number(Re.value?.width);return Number.isFinite(t)&&t>0?t:1}),Bt=e.computed(()=>Re.value?.dashArray||"3,4"),Kt=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.enabled!==!1}),ql=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),jl=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),El=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),il=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),vl=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),dn=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.onDataChange!==!1}),wn=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),Dl=e.computed(()=>{const t=Z.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),mn=e.computed(()=>Z.value?.spider?.gridSteps||5),$l=e.computed(()=>{const t=[],o=mn.value;for(let l=1;l<=o;l++)t.push(Vt.value/o*l);return t}),zn=t=>{const o=Dn.value;if(o&&Array.isArray(o)&&o[t]!==void 0)return o[t].toString();const l=$l.value[t];return Math.round(l/Vt.value*100)+"%"},Dn=e.computed(()=>Z.value?.spider?.gridLabels||null),on=e.computed(()=>{const t=Z.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),bl=e.computed(()=>{const t=Z.value,o={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...o,...t.contextMenu.items}:o}),Fl=e.computed(()=>{const t=Z.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Kl=e.computed(()=>{const t=Z.value;return t&&t.markers&&t.markers.icon?t.markers.icon:wl.value}),Hl=e.computed(()=>{const t=Z.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Ml=e.computed(()=>{const t=Z.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),pn=e.computed(()=>{const o=Z.value?.valueFormat?.extension;return typeof o=="string"?o:""}),$=t=>{const o=pn.value;if(t==null)return"";const l=String(t);return o?l+o:l},O=e.computed(()=>!ce.value.isZooming);e.computed(()=>tl.value.map(t=>{if(t.categoryIndex!==void 0&&(Nl.value||Gt.value)){const o=ht(t.categoryIndex),l=J.value+I.value.bottom-Ml.value/2;return{...t,x:o,y:l}}return t}));function D(t,o){let l;if(t instanceof Date)l=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[v,C,b]=t.split("-"),F=Number(b?.length===2?`20${b}`:b);l=new Date(F,Number(C)-1,Number(v))}else return 0;let r=0,m=1/0;return o.forEach((v,C)=>{const[b,F,N]=v.split("-"),L=Number(N?.length===2?`20${N}`:N),S=new Date(L,Number(F)-1,Number(b)),K=Math.abs(S-l);K<m&&(m=K,r=C)}),r}const ne=e.computed(()=>{const t=R.markers.map(l=>{const r=D(l.marker_date,R.categories),m=ht(r),v=J.value+I.value.bottom-Ml.value/2;return{...l,x:m,y:v,categoryIndex:r,source:"props"}}),o=tl.value.map(l=>{if(l.categoryIndex!==void 0&&(Nl.value||Gt.value)){const r=ht(l.categoryIndex),m=J.value+I.value.bottom-Ml.value/2;return{...l,x:r,y:m,source:"internal"}}return{...l,source:"internal"}});return[...t,...o]}),Ae=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.enabled===!0}),it=e.computed(()=>{const t=Z.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),vt=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),tt=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),lt=e.computed(()=>{const t={left:I.value.left,top:I.value.top,width:I.value.width,height:I.value.height};let o,l;const r=String(vt.value);if(r.includes("%")){const m=parseFloat(r)/100;o=t.width*m,l=o*(96/499)}else{const m=parseFloat(r)||25;o=Math.min(t.width*.25,200)*(m/25),l=o*(96/499)}return{width:o,height:l,area:t}}),kl=e.computed(()=>{const{width:t,height:o}=lt.value,l=tt.value;let r,m;const v=I.value.left,C=I.value.right,b=I.value.top,F=I.value.bottom,N=I.value.width,L=I.value.height;switch(l){case"center":r=v+(N-t)/2,m=b+(L-o)/2;break;case"top-left":r=v+15,m=b+5;break;case"top-right":r=C-t-15,m=b+5;break;case"bottom-left":r=v+15,m=F-o-5;break;case"bottom-right":default:r=C-t-15,m=F-o-5;break}return{backgroundPositionX:r+"px",backgroundPositionY:m+"px",backgroundSize:`${t}px ${o}px`}}),Sl=t=>!R.flags||!R.flags.length?[]:R.flags.filter(o=>o.categoryIndex===t),Tt=t=>{const o=Sl(t),l=hn(t),r=o.filter(C=>C.manual),m=o.filter(C=>!C.manual),v=[];return r.length>0&&v.push({type:_("chart.tooltip.manualFlags"),color:"#698dbe",flags:r.map(C=>({text:C.text,color:"#698dbe"}))}),m.length>0&&v.push({type:_("chart.tooltip.autoFlags"),color:"#a1d499",flags:m.map(C=>({text:C.text,color:"#a1d499"}))}),{flagGroups:v,markers:l.map(C=>({title:C.title,description:C.description,type:_("chart.tooltip.markers"),color:C.color||"#9784ba"}))}},wl=e.computed(()=>{const t=R.old?`<svg width="55" height="56" viewBox="0 0 55 56" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
2
|
<path d="M55 51.841V4.14647C55 1.86149 53.1797 0.00915527 50.9343 0.00915527L4.06568 0.00915527C1.82027 0.00915527 0 1.86149 0 4.14647V51.841C0 54.126 1.82027 55.9783 4.06568 55.9783H50.9343C53.1797 55.9783 55 54.126 55 51.841Z" fill="#020203"/>
|
|
3
3
|
<path d="M27.7145 10.8883H16.9591C12.7639 10.8883 9.3623 14.3498 9.3623 18.619C9.3623 22.8882 12.7639 26.3497 16.9591 26.3497H27.8036C28.3624 26.3497 28.816 25.8881 28.816 25.3112L28.7188 11.9103C28.7188 11.3416 28.2653 10.8883 27.7064 10.8883H27.7145Z" fill="#FFC230"/>
|
|
4
4
|
<path d="M38.6799 25.649C42.5176 25.649 45.6288 22.483 45.6288 18.5776C45.6288 14.6722 42.5176 11.5063 38.6799 11.5063C34.8421 11.5063 31.731 14.6722 31.731 18.5776C31.731 22.483 34.8421 25.649 38.6799 25.649Z" fill="white"/>
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<rect width="57" height="57" fill="white"/>
|
|
16
16
|
</clipPath>
|
|
17
17
|
</defs>
|
|
18
|
-
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),
|
|
18
|
+
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),el=e.computed(()=>{const t=R.old?`<svg width="499" height="96" viewBox="0 0 499 96" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
19
19
|
<path d="M171.52 37.8399H160.38C160.26 36.4799 160.02 35.0599 159.68 33.5699C159.34 32.0799 158.77 30.7399 157.96 29.5299C157.16 28.3199 156 27.3199 154.48 26.5099C152.96 25.7099 150.94 25.2999 148.4 25.2999C144.69 25.2999 141.93 26.1299 140.14 27.8099C138.34 29.4799 137.45 31.5499 137.45 34.0299C137.45 37.7999 139.29 40.0799 142.97 40.8499C146.65 41.6299 150.67 42.3799 155.03 43.1199C159.39 43.8599 163.41 45.3899 167.09 47.7099C170.77 50.0299 172.61 54.6199 172.61 61.4899C172.61 64.6499 172.02 67.5099 170.85 70.0699C169.67 72.6399 168.02 74.7899 165.89 76.5199C163.76 78.2499 161.19 79.5799 158.19 80.5099C155.19 81.4399 151.93 81.8999 148.4 81.8999C143.95 81.8999 140.12 81.2699 136.94 79.9999C133.75 78.7299 131.19 77.0799 129.24 75.0399C127.29 72.9999 125.93 70.6899 125.16 68.1299C124.39 65.5599 124.19 62.9499 124.56 60.2899H136.25C136.37 62.0799 136.58 63.7899 136.85 65.3899C137.13 66.9999 137.68 68.4099 138.52 69.6099C139.35 70.8199 140.58 71.7799 142.19 72.4899C143.8 73.1999 145.99 73.5599 148.78 73.5599C153.3 73.5599 156.47 72.6199 158.29 70.7299C160.11 68.8399 161.03 66.6899 161.03 64.2799C161.03 60.2599 159.19 57.7799 155.51 56.8599C151.83 55.9299 147.79 55.0499 143.4 54.2099C139.01 53.3799 134.97 51.7699 131.29 49.3799C127.61 46.9999 125.77 42.3699 125.77 35.5099C125.77 32.8499 126.3 30.3899 127.35 28.1299C128.4 25.8699 129.9 23.9199 131.85 22.2799C133.8 20.6399 136.16 19.3399 138.95 18.3799C141.73 17.4199 144.8 16.9399 148.14 16.9399C152.41 16.9399 156.07 17.4699 159.14 18.5199C162.2 19.5699 164.69 21.0299 166.61 22.8799C168.53 24.7399 169.89 26.9499 170.69 29.5199C171.49 32.0899 171.77 34.8599 171.52 37.8199V37.8399Z" fill="#020203"/>
|
|
20
20
|
<path d="M179.04 58.1699C179.04 55.0799 179.55 52.0499 180.57 49.0699C181.59 46.0999 183.04 43.4899 184.93 41.2299C186.82 38.9699 189.09 37.1499 191.75 35.7499C194.41 34.3599 197.35 33.6599 200.57 33.6599C207 33.6599 212.15 35.9299 216.02 40.4799C219.89 45.0299 221.97 51.5999 222.28 60.1999H189.34C189.77 64.2199 191.09 67.1499 193.28 68.9699C195.48 70.7999 198.12 71.7099 201.21 71.7099C203 71.7099 204.5 71.4599 205.71 70.9699C206.92 70.4799 207.91 69.8899 208.68 69.2099C209.45 68.5299 210.06 67.8199 210.49 67.0799C210.92 66.3399 211.26 65.7199 211.51 65.2199H221.72C221.6 66.7699 221.1 68.5099 220.24 70.4599C219.37 72.4099 218.14 74.2299 216.53 75.9399C214.92 77.6399 212.85 79.0599 210.31 80.2099C207.77 81.3499 204.77 81.9299 201.31 81.9299C197.85 81.9299 194.91 81.2799 192.12 79.9799C189.34 78.6799 186.98 76.9499 185.07 74.7799C183.15 72.6099 181.67 70.0899 180.61 67.2199C179.56 64.3399 179.03 61.3299 179.03 58.1699H179.04ZM200.94 42.0199C198.47 42.0199 196.24 42.7299 194.26 44.1499C192.28 45.5699 190.89 47.8299 190.08 50.9199H211.33C211.02 48.0799 209.95 45.8799 208.13 44.3299C206.3 42.7899 203.91 42.0099 200.94 42.0099V42.0199Z" fill="#020203"/>
|
|
21
21
|
<path d="M268.59 80.9999H258.01V50.3799C258.01 48.2099 257.3 46.5099 255.88 45.2799C254.46 44.0399 252.6 43.4199 250.31 43.4199C248.45 43.4199 246.94 43.8399 245.76 44.6699C244.58 45.4999 243.67 46.5399 243.02 47.7799C242.37 49.0199 241.94 50.3799 241.72 51.8599C241.5 53.3399 241.4 54.7099 241.4 55.9399V80.9999H230.82V34.5999H241.03V38.3099C241.83 37.6899 243.27 36.7599 245.34 35.5199C247.41 34.2799 250.3 33.6599 254.02 33.6599C256.68 33.6599 259.12 34.1599 261.35 35.1399C263.58 36.1299 265.31 37.6799 266.55 39.7799C267.04 39.2899 267.71 38.6799 268.55 37.9699C269.38 37.2599 270.41 36.5799 271.61 35.9299C272.82 35.2799 274.22 34.7399 275.83 34.3099C277.44 33.8799 279.23 33.6599 281.21 33.6599C285.23 33.6599 288.67 34.8099 291.51 37.0899C294.36 39.3799 295.78 43.0599 295.78 48.1299V80.9799H285.2V50.3599C285.2 48.1899 284.49 46.4899 283.07 45.2599C281.65 44.0199 279.79 43.3999 277.5 43.3999C275.64 43.3999 274.13 43.8199 272.95 44.6499C271.77 45.4799 270.86 46.5199 270.21 47.7599C269.56 48.9999 269.13 50.3599 268.91 51.8399C268.69 53.3199 268.59 54.6899 268.59 55.9199V80.9799V80.9999Z" fill="#020203"/>
|
|
@@ -41,23 +41,23 @@
|
|
|
41
41
|
<rect width="45" height="45" fill="white" transform="translate(0 1)"/>
|
|
42
42
|
</clipPath>
|
|
43
43
|
</defs>
|
|
44
|
-
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),
|
|
45
|
-
`)}})}),Dn=e.ref({show:!1,x:0,y:0,content:"",count:0}),nl=e.computed(()=>U.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),zl=e.computed(()=>{const t=U.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),On=e.computed(()=>U.value?.bubbles?.tooltip?.formatters||{}),zt=e.ref(new Set),Me=e.ref(null),El=e.ref(!1),kt=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),Ml=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),nt=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),ft=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),ie=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),Tt=e.ref([]),De=e.ref({show:!1,title:"",description:"",color:"#FF6B6B",type:"default",editingMarkerId:null,readonly:!1,categoryIndex:null,fromButton:!1,date:null});e.computed(()=>{const t=["default"];return sn.value&&t.push(...Object.keys(sn.value)),t}),e.computed(()=>{if(!F.categories||F.categories.length===0){const{maxX:t}=He.value;return Array.from({length:t+1},(o,l)=>$("chart.fallback.item",{number:l+1}))}return F.categories});const Jl=e.computed(()=>{if(!F.categories||F.categories.length===0)return null;const t=F.categories[0],[o,l,r]=String(t).split("-"),m=Number(r?.length===2?`20${r}`:r),f=Number(o),C=Number(l)-1;return!f||!l||!m?null:new Date(m,C,f)}),Cl=e.computed(()=>{if(!F.categories||F.categories.length===0)return null;const t=F.categories[F.categories.length-1],[o,l,r]=String(t).split("-"),m=Number(r?.length===2?`20${r}`:r),f=Number(o),C=Number(l)-1;return!f||!l||!m?null:new Date(m,C,f)}),Al=e.computed(()=>De.value.editingMarkerId!==null),y=e.computed(()=>De.value.readonly),g=t=>{zt.value.has(t)||(ia.value=!0,Me.value=t)},w=()=>{ia.value=!1,Me.value=null},Z=t=>{if(go.value||Io.value){nt.value.show=!1;return}const l=t.currentTarget.getBoundingClientRect(),r=t.clientX-l.left,m=t.clientY-l.top,f=ul.value?r>=R.value.left-50&&r<=R.value.right+50&&m>=R.value.top-50&&m<=R.value.bottom+100:r>=R.value.left&&r<=R.value.right&&m>=R.value.top&&m<=R.value.bottom;if(El.value=f,ul.value){if(!Xe.value||!f||ie.value.isDragging||ie.value.isZooming){nt.value.show=!1;return}if(Ro.value.find(pe=>!pe||pe.isHidden?!1:Math.sqrt(Math.pow(pe.x-r,2)+Math.pow(pe.y-m,2))<=pe.radius+3))nt.value.show=!1;else{const pe=Ro.value.filter(ye=>!ye||ye.isHidden?!1:Math.sqrt(Math.pow(ye.x-r,2)+Math.pow(ye.y-m,2))<=250);if(pe.length>0){let ye=pe[0],Se=Math.sqrt(Math.pow(ye.x-r,2)+Math.pow(ye.y-m,2));pe.forEach(Oe=>{const Ae=Math.sqrt(Math.pow(Oe.x-r,2)+Math.pow(Oe.y-m,2));Ae<Se&&(Se=Ae,ye=Oe)});const ve=30,Ye=Ro.value.filter(Oe=>!Oe||Oe.isHidden?!1:Math.abs(Oe.x-ye.x)<=ve).sort((Oe,Ae)=>Oe.y-Ae.y);nt.value={show:!0,x:ye.x,categoryIndex:Math.round(ye.originalX),data:(()=>{const Oe=nl.value,Ae=zl.value,Ee=[];return Ye.forEach(Re=>{Oe.forEach(Vt=>{const Ft=Ae[Vt]||Vt,Dl=ka(Vt,Re);Dl&&Ee.push({seriesName:Re.seriesName,label:Re.label,value:`${Ft}: ${Dl}`,color:Re.color,y:Re.y})})}),Ee})()}}else nt.value.show=!1}return}if(ie.value.isDragging&&ie.value.scale>1&&ol.value&&Ge.value){nt.value.show=!1;const Ze=t.clientX-ie.value.lastMouseX,{minX:pe,maxX:ye}=He.value,Se=ye-pe||1,Ye=Ze*.8;ie.value.offsetX+=Ye;const Oe=Se/ie.value.scale,Ae=Se-Oe,Ee=0,Re=-Ae/Se*R.value.width,Vt=Ee;ie.value.offsetX=Math.max(Re,Math.min(Vt,ie.value.offsetX)),ie.value.lastMouseX=t.clientX,ie.value.lastMouseY=t.clientY;return}if(!Xe.value||!ol.value||ie.value.isDragging||ie.value.isZooming||!f){nt.value.show=!1;return}const{minX:C,maxX:b}=He.value,P=b-C||1,B=P/ie.value.scale,H=C-ie.value.offsetX/R.value.width*P,S=(r-R.value.left)/R.value.width,q=H+S*B,we=Math.round(q);if(we>=0&&we<=b){const Ze=vt(we),pe=a.value.map((ye,Se)=>{const ve=F.series.findIndex(Oe=>Oe===ye),Ye=ye.data[we];return{seriesName:ye.name,value:Ye!==void 0?Ye:null,color:$t(ve),y:Ye!==void 0?gl(ye,Ye):null}}).filter(ye=>ye.value!==null);nt.value={show:!0,x:Ze,categoryIndex:we,data:pe}}},he=()=>{nt.value.show=!1,El.value=!1,Io.value=!1,go.value||(Dn.value.show=!1),ie.value.isDragging&&(ie.value.isDragging=!1),ie.value.zoomTimeout&&(clearTimeout(ie.value.zoomTimeout),ie.value.zoomTimeout=null),ie.value.isZooming=!1,setTimeout(()=>{Me.value=null,kt.value.show=!1},150)},at=t=>{if(t.preventDefault(),t.stopPropagation(),!ql.value)return;const o=t.currentTarget.getBoundingClientRect(),l=t.clientX-o.left,r=t.clientY-o.top;if(al.value){ft.value.show=!1,e.nextTick(()=>{ft.value.show=!0,ft.value.x=t.clientX,ft.value.y=t.clientY,ft.value.categoryIndex=null});return}const m=Math.max(0,R.value.left-20),f=R.value.right,C=R.value.top,b=R.value.bottom+80;l>=m&&l<=f&&r>=C&&r<=b&&(ft.value.show=!1,e.nextTick(()=>{ft.value.show=!0,ft.value.x=t.clientX,ft.value.y=t.clientY,ft.value.categoryIndex=null;const P=Math.max(R.value.left,Math.min(l,R.value.right))-R.value.left,H=R.value.width/To.value.length,S=Math.floor(P/H);S>=0&&S<To.value.length&&(ft.value.categoryIndex=S)}))},Bt=t=>{if(!(t&&t.button===2)){if(ft.value.show&&t&&t.type==="click"){const o=document.querySelector(".dss-context-menu");if(o&&o.contains(t.target))return}ft.value.show=!1}},bl=t=>{if(typeof t.template=="function"){const o={series:F.series,categories:F.categories,markers:Tt.value},l={chartX:ft.value.chartX,chartY:ft.value.chartY,dataX:ft.value.mouseDataX,dataY:ft.value.mouseDataY,categoryIndex:ft.value.categoryIndex};return t.template(o,l)}return t.template||t.label||""},Pl=t=>{const o=["dss-context-menu-item"];return t.cssClass&&o.push(t.cssClass),o},Ul=t=>t.style||{},gn=t=>t.type&&sn.value[t.type]?sn.value[t.type]:t.customIcon?t.customIcon:Kl.value,mo=t=>t==null?"":F.categories&&F.categories[t]?F.categories[t]:"",Xo=t=>Tt.value.length?Tt.value.filter(o=>o.categoryIndex===t):[],Co=t=>{if(!ol.value&&!ul.value)return{x:0,y:0};const o=vt(t),l=J.value+R.value.bottom-T.value/2;return{x:o,y:l}},bo=()=>{Tt.value.forEach(t=>{if(t.categoryIndex!==void 0&&(ol.value||ul.value)){const o=Co(t.categoryIndex);t.x=o.x,t.y=o.y}})},Yo=()=>{if(De.value.description&&De.value.description.length&&De.value.date){if(Al.value){const t=Tt.value.findIndex(o=>o.id===De.value.editingMarkerId);t!==-1?(Tt.value[t].description=De.value.description||"",Tt.value[t].color=De.value.color||"",Tt.value[t].type=De.value.type||"default",ce("update-marker",Tt.value[t])):ce("update-marker",{id:De.value.editingMarkerId,description:De.value.description||"",color:De.value.color||"",type:De.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let o=Te(De.value.date,F.categories||[]);if(ul.value){const{maxX:C}=He.value;o=Math.max(0,Math.min(o,Math.floor(C)))}else ol.value&&(o=Math.max(0,Math.min(o,He.value.maxX)));const l=vt(o),r=J.value+R.value.bottom-T.value/2,m=Array.isArray(F.categories)?F.categories[o]:null,f={id:t,title:"",description:De.value.description||"",color:De.value.color||"",type:De.value.type||"default",categoryIndex:o,x:l,y:r,marker_date:m||null};De.value.categoryIndex=o,Tt.value.push(f),ce("add-marker",f)}Sn(),wo()}},Sn=()=>{De.value.show=!1,De.value.title="",De.value.description="",De.value.color="#FF6B6B",De.value.type="default",De.value.editingMarkerId=null,De.value.readonly=!1,De.value.categoryIndex=null,De.value.fromButton=!1,De.value.date=null},po=()=>{Al.value&&(xo(De.value.editingMarkerId),Sn())},xo=t=>{const o=Tt.value.findIndex(l=>l.id===t);o!==-1&&(Tt.value.splice(o,1),wo()),ce("delete-marker",t)},jo=t=>{if(De.value.show=!0,De.value.title=t?.title??t?.comment??"",De.value.description=t?.description??t?.comment??"",De.value.color=t?.color??"",De.value.type=t?.type??"default",De.value.editingMarkerId=t?.id??t?.marker_id??null,De.value.readonly=t?.readonly??!1,De.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[o,l,r]=String(t.marker_date).split("-"),m=Number(r?.length===2?`20${r}`:r),f=Number(o),C=Number(l)-1;f&&l&&m?De.value.date=new Date(m,C,f):De.value.date=null}else De.value.date=null},wo=()=>{try{const t=`dss-chart-markers-${F.chartId}`;localStorage.setItem(t,JSON.stringify(Tt.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},Eo=()=>{try{const t=`dss-chart-markers-${F.chartId}`,o=localStorage.getItem(t);if(o){const l=JSON.parse(o);Array.isArray(l)&&(Tt.value=l.map(r=>({...r,originalYOffset:r.originalYOffset!==void 0?r.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),Tt.value=[]}},Hn=t=>{const o=ut.value||"Chart",l=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${o.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${l}.${t}`},fo=()=>{const t=nt.value.show,o=kt.value.show;return nt.value.show=!1,kt.value.show=!1,{originalCrosshair:t,originalTooltip:o}},Vn=t=>{nt.value.show=t.originalCrosshair,kt.value.show=t.originalTooltip},Ko=async(t,o=32,l=32)=>new Promise((r,m)=>{if(t.startsWith("data:")){r(t);return}const f=new Image;f.crossOrigin="anonymous";const C=setTimeout(()=>{console.warn("Image conversion timeout for:",t),r(t)},5e3);f.onload=()=>{clearTimeout(C);try{const b=document.createElement("canvas"),P=b.getContext("2d");b.width=o,b.height=l,P.fillStyle="#fafafa",P.fillRect(0,0,o,l),P.drawImage(f,0,0,o,l);const B=b.toDataURL("image/png");r(B)}catch(b){console.warn("Canvas conversion failed:",b),r(t)}},f.onerror=b=>{clearTimeout(C),console.warn("Failed to load image:",t,b),r(t)},f.src=t}),Go=async()=>{try{const t=fo();setTimeout(async()=>{try{const o=L.value;if(!o){console.error("Chart SVG element not found"),Vn(t);return}const l=tt(),r=Ve.value,m=re.value+l.height,f=o.cloneNode(!0);f.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(ve=>ve.remove());const b=f.querySelectorAll("image"),P=Array.from(b).map(async ve=>{const Ye=ve.getAttribute("xlink:href")||ve.getAttribute("href");if(Ye&&!Ye.startsWith("data:"))try{const Oe=await Ko(Ye,32,32);ve.setAttribute("xlink:href",Oe),ve.setAttribute("href",Oe)}catch(Oe){console.warn("Failed to convert logo to base64:",Oe)}});await Promise.all(P);const H=new XMLSerializer().serializeToString(f).replace(/<svg[^>]*>/,"").replace("</svg>","");let S="",q=30;if(ut.value&&(S+=`
|
|
46
|
-
<text x="24" y="${
|
|
44
|
+
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),Vl=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),an=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const al=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),At=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),Pn=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),xn=e.computed(()=>{const o=Z.value?.radialBar?.dataLabels;return o&&(o.show===!0||o.enabled===!0)}),Zl=e.computed(()=>{const o=Z.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof o=="number"&&o>=0?o:20}),vn=e.computed(()=>{const o=Z.value?.radialBar?.dataCenter;return Gl.value?!0:Cn.value&&o&&(o.show===!0||o.enabled===!0)}),fn=e.computed(()=>{if(!vn.value||!Ln.value.length)return"";if(Gl.value){const r=Ln.value[1]??Ln.value[0];return $(r?.value??0)}const l=Z.value?.radialBar?.dataCenter?.showValueOnly===!0?Ln.value[0]?.value??0:Ln.value.reduce((r,m)=>r+(m.value??0),0);return $(l)}),Hn=e.computed(()=>{const o=Z.value?.radialBar?.dataCenter?.fontSize;return typeof o=="number"&&o>0?o:24}),En=e.computed(()=>({x:Dt.value,y:Gl.value?Pt.value:Pt.value-Hn.value/2})),en=e.computed(()=>{const o=Z.value?.radialBar?.dataCenter?.color;return typeof o=="string"&&o?o:"#333"}),ul=e.computed(()=>{if(!xn.value||!cl.value||!Ln.value.length)return[];const t=Zl.value*Math.PI/180,o=(hl.value+Vt.value)/2;return Ln.value.map(l=>{const m=l.endAngle-l.startAngle>=t&&!l.isHidden,v=Dt.value+Math.cos(l.midAngle)*o,C=Pt.value+Math.sin(l.midAngle)*o;return{value:$(l.value),x:v,y:C,show:m,color:l.color,contrastColor:cn(l.color)}})}),On=e.computed(()=>{if(!R.flags||!R.flags.length)return[];const t=new Map;return R.flags.forEach(o=>{const l=o.categoryIndex;t.has(l)||t.set(l,[]),t.get(l).push(o)}),Array.from(t.entries()).map(([o,l])=>{const r=ht(o),m=l.filter(C=>C.manual),v=l.filter(C=>!C.manual);return{categoryIndex:parseInt(o),x:r,flags:l,manualCount:m.length,autoCount:v.length,totalCount:l.length,hasManual:m.length>0,hasAuto:v.length>0,texts:l.map(C=>C.text).join(`
|
|
45
|
+
`)}})}),Il=e.ref({show:!1,x:0,y:0,content:"",count:0}),ll=e.computed(()=>Z.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),Wn=e.computed(()=>{const t=Z.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),dl=e.computed(()=>Z.value?.bubbles?.tooltip?.formatters||{}),wt=e.ref(new Set),$e=e.ref(null),Sn=e.ref(!1),dt=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),sl=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),ot=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),mt=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),ce=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),tl=e.ref([]),Oe=e.ref({show:!1,title:"",description:"",color:"#FF6B6B",type:"default",editingMarkerId:null,readonly:!1,categoryIndex:null,fromButton:!1,date:null});e.computed(()=>{const t=["default"];return Hl.value&&t.push(...Object.keys(Hl.value)),t}),e.computed(()=>{if(!R.categories||R.categories.length===0){const{maxX:t}=ge.value;return Array.from({length:t+1},(o,l)=>_("chart.fallback.item",{number:l+1}))}return R.categories});const Ll=e.computed(()=>{if(!R.categories||R.categories.length===0)return null;const t=R.categories[0],[o,l,r]=String(t).split("-"),m=Number(r?.length===2?`20${r}`:r),v=Number(o),C=Number(l)-1;return!v||!l||!m?null:new Date(m,C,v)}),sn=e.computed(()=>{if(!R.categories||R.categories.length===0)return null;const t=R.categories[R.categories.length-1],[o,l,r]=String(t).split("-"),m=Number(r?.length===2?`20${r}`:r),v=Number(o),C=Number(l)-1;return!v||!l||!m?null:new Date(m,C,v)}),Tl=e.computed(()=>Oe.value.editingMarkerId!==null),nl=e.computed(()=>Oe.value.readonly),zl=t=>{wt.value.has(t)||(oa.value=!0,$e.value=t)},y=()=>{oa.value=!1,$e.value=null},g=t=>{if(wo.value||zo.value){ot.value.show=!1;return}const l=t.currentTarget.getBoundingClientRect(),r=t.clientX-l.left,m=t.clientY-l.top,v=Gt.value?r>=I.value.left-50&&r<=I.value.right+50&&m>=I.value.top-50&&m<=I.value.bottom+100:r>=I.value.left&&r<=I.value.right&&m>=I.value.top&&m<=I.value.bottom;if(Sn.value=v,Gt.value){if(!Ue.value||!v||ce.value.isDragging||ce.value.isZooming){ot.value.show=!1;return}if(Fo.value.find(re=>!re||re.isHidden?!1:Math.sqrt(Math.pow(re.x-r,2)+Math.pow(re.y-m,2))<=re.radius+3))ot.value.show=!1;else{const re=Fo.value.filter(ye=>!ye||ye.isHidden?!1:Math.sqrt(Math.pow(ye.x-r,2)+Math.pow(ye.y-m,2))<=250);if(re.length>0){let ye=re[0],Ee=Math.sqrt(Math.pow(ye.x-r,2)+Math.pow(ye.y-m,2));re.forEach(ze=>{const Te=Math.sqrt(Math.pow(ze.x-r,2)+Math.pow(ze.y-m,2));Te<Ee&&(Ee=Te,ye=ze)});const ve=30,Xe=Fo.value.filter(ze=>!ze||ze.isHidden?!1:Math.abs(ze.x-ye.x)<=ve).sort((ze,Te)=>ze.y-Te.y);ot.value={show:!0,x:ye.x,categoryIndex:Math.round(ye.originalX),data:(()=>{const ze=ll.value,Te=Wn.value,Ve=[];return Xe.forEach(De=>{ze.forEach(Nt=>{const It=Te[Nt]||Nt,Rl=ha(Nt,De);Rl&&Ve.push({seriesName:De.seriesName,label:De.label,value:`${It}: ${Rl}`,color:De.color,y:De.y})})}),Ve})()}}else ot.value.show=!1}return}if(ce.value.isDragging&&ce.value.scale>1&&Nl.value&&Ke.value){ot.value.show=!1;const Ze=t.clientX-ce.value.lastMouseX,{minX:re,maxX:ye}=ge.value,Ee=ye-re||1,Xe=Ze*.8;ce.value.offsetX+=Xe;const ze=Ee/ce.value.scale,Te=Ee-ze,Ve=0,De=-Te/Ee*I.value.width,Nt=Ve;ce.value.offsetX=Math.max(De,Math.min(Nt,ce.value.offsetX)),ce.value.lastMouseX=t.clientX,ce.value.lastMouseY=t.clientY;return}if(!Ue.value||!Nl.value||ce.value.isDragging||ce.value.isZooming||!v){ot.value.show=!1;return}const{minX:C,maxX:b}=ge.value,F=b-C||1,N=F/ce.value.scale,L=C-ce.value.offsetX/I.value.width*F,S=(r-I.value.left)/I.value.width,K=L+S*N,Be=Math.round(K);if(Be>=0&&Be<=b){const Ze=ht(Be),re=Ql.value.map((ye,Ee)=>{const ve=R.series.findIndex(ze=>ze===ye),Xe=ye.data[Be];return{seriesName:ye.name,value:Xe!==void 0?Xe:null,color:Qt(ve),y:Xe!==void 0?Ot(ye,Xe):null}}).filter(ye=>ye.value!==null);ot.value={show:!0,x:Ze,categoryIndex:Be,data:re}}},x=()=>{ot.value.show=!1,Sn.value=!1,zo.value=!1,wo.value||(Il.value.show=!1),ce.value.isDragging&&(ce.value.isDragging=!1),ce.value.zoomTimeout&&(clearTimeout(ce.value.zoomTimeout),ce.value.zoomTimeout=null),ce.value.isZooming=!1,setTimeout(()=>{$e.value=null,dt.value.show=!1},150)},q=t=>{if(t.preventDefault(),t.stopPropagation(),!on.value)return;const o=t.currentTarget.getBoundingClientRect(),l=t.clientX-o.left,r=t.clientY-o.top;if(cl.value){mt.value.show=!1,e.nextTick(()=>{mt.value.show=!0,mt.value.x=t.clientX,mt.value.y=t.clientY,mt.value.categoryIndex=null});return}const m=Math.max(0,I.value.left-20),v=I.value.right,C=I.value.top,b=I.value.bottom+80;l>=m&&l<=v&&r>=C&&r<=b&&(mt.value.show=!1,e.nextTick(()=>{mt.value.show=!0,mt.value.x=t.clientX,mt.value.y=t.clientY,mt.value.categoryIndex=null;const F=Math.max(I.value.left,Math.min(l,I.value.right))-I.value.left,L=I.value.width/bo.value.length,S=Math.floor(F/L);S>=0&&S<bo.value.length&&(mt.value.categoryIndex=S)}))},ue=t=>{if(!(t&&t.button===2)){if(mt.value.show&&t&&t.type==="click"){const o=document.querySelector(".dss-context-menu");if(o&&o.contains(t.target))return}mt.value.show=!1}},at=t=>{if(typeof t.template=="function"){const o={series:R.series,categories:R.categories,markers:tl.value},l={chartX:mt.value.chartX,chartY:mt.value.chartY,dataX:mt.value.mouseDataX,dataY:mt.value.mouseDataY,categoryIndex:mt.value.categoryIndex};return t.template(o,l)}return t.template||t.label||""},Xt=t=>{const o=["dss-context-menu-item"];return t.cssClass&&o.push(t.cssClass),o},Cl=t=>t.style||{},Pl=t=>t.type&&Hl.value[t.type]?Hl.value[t.type]:t.customIcon?t.customIcon:Kl.value,Ul=t=>t==null?"":R.categories&&R.categories[t]?R.categories[t]:"",hn=t=>tl.value.length?tl.value.filter(o=>o.categoryIndex===t):[],uo=t=>{if(!Nl.value&&!Gt.value)return{x:0,y:0};const o=ht(t),l=J.value+I.value.bottom-Ml.value/2;return{x:o,y:l}},So=()=>{tl.value.forEach(t=>{if(t.categoryIndex!==void 0&&(Nl.value||Gt.value)){const o=uo(t.categoryIndex);t.x=o.x,t.y=o.y}})},Vo=()=>{if(Oe.value.description&&Oe.value.description.length&&Oe.value.date){if(Tl.value){const t=tl.value.findIndex(o=>o.id===Oe.value.editingMarkerId);t!==-1?(tl.value[t].description=Oe.value.description||"",tl.value[t].color=Oe.value.color||"",tl.value[t].type=Oe.value.type||"default",de("update-marker",tl.value[t])):de("update-marker",{id:Oe.value.editingMarkerId,description:Oe.value.description||"",color:Oe.value.color||"",type:Oe.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let o=D(Oe.value.date,R.categories||[]);if(Gt.value){const{maxX:C}=ge.value;o=Math.max(0,Math.min(o,Math.floor(C)))}else Nl.value&&(o=Math.max(0,Math.min(o,ge.value.maxX)));const l=ht(o),r=J.value+I.value.bottom-Ml.value/2,m=Array.isArray(R.categories)?R.categories[o]:null,v={id:t,title:"",description:Oe.value.description||"",color:Oe.value.color||"",type:Oe.value.type||"default",categoryIndex:o,x:l,y:r,marker_date:m||null};Oe.value.categoryIndex=o,tl.value.push(v),de("add-marker",v)}Vn(),po()}},Vn=()=>{Oe.value.show=!1,Oe.value.title="",Oe.value.description="",Oe.value.color="#FF6B6B",Oe.value.type="default",Oe.value.editingMarkerId=null,Oe.value.readonly=!1,Oe.value.categoryIndex=null,Oe.value.fromButton=!1,Oe.value.date=null},Xo=()=>{Tl.value&&(Yo(Oe.value.editingMarkerId),Vn())},Yo=t=>{const o=tl.value.findIndex(l=>l.id===t);o!==-1&&(tl.value.splice(o,1),po()),de("delete-marker",t)},mo=t=>{if(Oe.value.show=!0,Oe.value.title=t?.title??t?.comment??"",Oe.value.description=t?.description??t?.comment??"",Oe.value.color=t?.color??"",Oe.value.type=t?.type??"default",Oe.value.editingMarkerId=t?.id??t?.marker_id??null,Oe.value.readonly=t?.readonly??!1,Oe.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[o,l,r]=String(t.marker_date).split("-"),m=Number(r?.length===2?`20${r}`:r),v=Number(o),C=Number(l)-1;v&&l&&m?Oe.value.date=new Date(m,C,v):Oe.value.date=null}else Oe.value.date=null},po=()=>{try{const t=`dss-chart-markers-${R.chartId}`;localStorage.setItem(t,JSON.stringify(tl.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},jo=()=>{try{const t=`dss-chart-markers-${R.chartId}`,o=localStorage.getItem(t);if(o){const l=JSON.parse(o);Array.isArray(l)&&(tl.value=l.map(r=>({...r,originalYOffset:r.originalYOffset!==void 0?r.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),tl.value=[]}},qn=t=>{const o=ct.value||"Chart",l=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${o.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${l}.${t}`},vo=()=>{const t=ot.value.show,o=dt.value.show;return ot.value.show=!1,dt.value.show=!1,{originalCrosshair:t,originalTooltip:o}},gn=t=>{ot.value.show=t.originalCrosshair,dt.value.show=t.originalTooltip},No=async(t,o=32,l=32)=>new Promise((r,m)=>{if(t.startsWith("data:")){r(t);return}const v=new Image;v.crossOrigin="anonymous";const C=setTimeout(()=>{console.warn("Image conversion timeout for:",t),r(t)},5e3);v.onload=()=>{clearTimeout(C);try{const b=document.createElement("canvas"),F=b.getContext("2d");b.width=o,b.height=l,F.fillStyle="#fafafa",F.fillRect(0,0,o,l),F.drawImage(v,0,0,o,l);const N=b.toDataURL("image/png");r(N)}catch(b){console.warn("Canvas conversion failed:",b),r(t)}},v.onerror=b=>{clearTimeout(C),console.warn("Failed to load image:",t,b),r(t)},v.src=t}),Ko=async()=>{try{const t=vo();setTimeout(async()=>{try{const o=T.value;if(!o){console.error("Chart SVG element not found"),gn(t);return}const l=Je(),r=Se.value,m=ie.value+l.height,v=o.cloneNode(!0);v.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(ve=>ve.remove());const b=v.querySelectorAll("image"),F=Array.from(b).map(async ve=>{const Xe=ve.getAttribute("xlink:href")||ve.getAttribute("href");if(Xe&&!Xe.startsWith("data:"))try{const ze=await No(Xe,32,32);ve.setAttribute("xlink:href",ze),ve.setAttribute("href",ze)}catch(ze){console.warn("Failed to convert logo to base64:",ze)}});await Promise.all(F);const L=new XMLSerializer().serializeToString(v).replace(/<svg[^>]*>/,"").replace("</svg>","");let S="",K=30;if(ct.value&&(S+=`
|
|
46
|
+
<text x="24" y="${K}"
|
|
47
47
|
font-family="Arial, sans-serif"
|
|
48
48
|
font-size="18"
|
|
49
49
|
font-weight="bold"
|
|
50
50
|
fill="#333">
|
|
51
|
-
${
|
|
52
|
-
</text>`,
|
|
53
|
-
<text x="24" y="${
|
|
51
|
+
${ct.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}
|
|
52
|
+
</text>`,K+=30),gt.value&&(S+=`
|
|
53
|
+
<text x="24" y="${K}"
|
|
54
54
|
font-family="Arial, sans-serif"
|
|
55
55
|
font-size="14"
|
|
56
56
|
fill="#666">
|
|
57
|
-
${
|
|
58
|
-
</text>`,
|
|
59
|
-
<g opacity="${
|
|
60
|
-
<g transform="translate(${
|
|
57
|
+
${gt.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}
|
|
58
|
+
</text>`,K+=25),W.value&&R.series.length>0){let ve=r-200,Xe=ct.value||gt.value?35:25;const ze=Math.floor((r-250)/120);let Te=0;R.series.forEach((Ve,De)=>{if(!wt.value.has(De)){const Nt=Qt(De),It=Ve.name.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");S+=`<circle cx="${ve+6}" cy="${Xe-4}" r="6" fill="${Nt}"/>`,S+=`<text x="${ve+18}" y="${Xe}" font-family="Arial, sans-serif" font-size="12" fill="#333">${It}</text>`,Te++,Te%ze===0?(ve=r-200,Xe+=20):ve+=Math.min(120,It.length*8+35)}})}let Be="";if(Ae.value)try{const{width:ve,height:Xe}=lt.value,ze=tt.value,Te=I.value.left,Ve=I.value.right,De=I.value.top,Nt=I.value.bottom,It=I.value.width,Rl=I.value.height;let ml,Wl;switch(ze){case"center":ml=Te+(It-ve)/2,Wl=De+(Rl-Xe)/2;break;case"top-left":ml=Te+15,Wl=De+5;break;case"top-right":ml=Ve-ve-5,Wl=De+5;break;case"bottom-left":ml=Te+15,Wl=Nt-Xe-5;break;case"bottom-right":default:ml=Ve-ve-5,Wl=Nt-Xe-5;break}Be=`
|
|
59
|
+
<g opacity="${it.value}">
|
|
60
|
+
<g transform="translate(${ml}, ${Wl}) scale(${ve/499})">
|
|
61
61
|
<path d="M171.52 37.8399H160.38C160.26 36.4799 160.02 35.0599 159.68 33.5699C159.34 32.0799 158.77 30.7399 157.96 29.5299C157.16 28.3199 156 27.3199 154.48 26.5099C152.96 25.7099 150.94 25.2999 148.4 25.2999C144.69 25.2999 141.93 26.1299 140.14 27.8099C138.34 29.4799 137.45 31.5499 137.45 34.0299C137.45 37.7999 139.29 40.0799 142.97 40.8499C146.65 41.6299 150.67 42.3799 155.03 43.1199C159.39 43.8599 163.41 45.3899 167.09 47.7099C170.77 50.0299 172.61 54.6199 172.61 61.4899C172.61 64.6499 172.02 67.5099 170.85 70.0699C169.67 72.6399 168.02 74.7899 165.89 76.5199C163.76 78.2499 161.19 79.5799 158.19 80.5099C155.19 81.4399 151.93 81.8999 148.4 81.8999C143.95 81.8999 140.12 81.2699 136.94 79.9999C133.75 78.7299 131.19 77.0799 129.24 75.0399C127.29 72.9999 125.93 70.6899 125.16 68.1299C124.39 65.5599 124.19 62.9499 124.56 60.2899H136.25C136.37 62.0799 136.58 63.7899 136.85 65.3899C137.13 66.9999 137.68 68.4099 138.52 69.6099C139.35 70.8199 140.58 71.7799 142.19 72.4899C143.8 73.1999 145.99 73.5599 148.78 73.5599C153.3 73.5599 156.47 72.6199 158.29 70.7299C160.11 68.8399 161.03 66.6899 161.03 64.2799C161.03 60.2599 159.19 57.7799 155.51 56.8599C151.83 55.9299 147.79 55.0499 143.4 54.2099C139.01 53.3799 134.97 51.7699 131.29 49.3799C127.61 46.9999 125.77 42.3699 125.77 35.5099C125.77 32.8499 126.3 30.3899 127.35 28.1299C128.4 25.8699 129.9 23.9199 131.85 22.2799C133.8 20.6399 136.16 19.3399 138.95 18.3799C141.73 17.4199 144.8 16.9399 148.14 16.9399C152.41 16.9399 156.07 17.4699 159.14 18.5199C162.2 19.5699 164.69 21.0299 166.61 22.8799C168.53 24.7399 169.89 26.9499 170.69 29.5199C171.49 32.0899 171.77 34.8599 171.52 37.8199V37.8399Z" fill="#020203"/>
|
|
62
62
|
<path d="M179.04 58.1699C179.04 55.0799 179.55 52.0499 180.57 49.0699C181.59 46.0999 183.04 43.4899 184.93 41.2299C186.82 38.9699 189.09 37.1499 191.75 35.7499C194.41 34.3599 197.35 33.6599 200.57 33.6599C207 33.6599 212.15 35.9299 216.02 40.4799C219.89 45.0299 221.97 51.5999 222.28 60.1999H189.34C189.77 64.2199 191.09 67.1499 193.28 68.9699C195.48 70.7999 198.12 71.7099 201.21 71.7099C203 71.7099 204.5 71.4599 205.71 70.9699C206.92 70.4799 207.91 69.8899 208.68 69.2099C209.45 68.5299 210.06 67.8199 210.49 67.0799C210.92 66.3399 211.26 65.7199 211.51 65.2199H221.72C221.6 66.7699 221.1 68.5099 220.24 70.4599C219.37 72.4099 218.14 74.2299 216.53 75.9399C214.92 77.6399 212.85 79.0599 210.31 80.2099C207.77 81.3499 204.77 81.9299 201.31 81.9299C197.85 81.9299 194.91 81.2799 192.12 79.9799C189.34 78.6799 186.98 76.9499 185.07 74.7799C183.15 72.6099 181.67 70.0899 180.61 67.2199C179.56 64.3399 179.03 61.3299 179.03 58.1699H179.04ZM200.94 42.0199C198.47 42.0199 196.24 42.7299 194.26 44.1499C192.28 45.5699 190.89 47.8299 190.08 50.9199H211.33C211.02 48.0799 209.95 45.8799 208.13 44.3299C206.3 42.7899 203.91 42.0099 200.94 42.0099V42.0199Z" fill="#020203"/>
|
|
63
63
|
<path d="M268.59 80.9999H258.01V50.3799C258.01 48.2099 257.3 46.5099 255.88 45.2799C254.46 44.0399 252.6 43.4199 250.31 43.4199C248.45 43.4199 246.94 43.8399 245.76 44.6699C244.58 45.4999 243.67 46.5399 243.02 47.7799C242.37 49.0199 241.94 50.3799 241.72 51.8599C241.5 53.3399 241.4 54.7099 241.4 55.9399V80.9999H230.82V34.5999H241.03V38.3099C241.83 37.6899 243.27 36.7599 245.34 35.5199C247.41 34.2799 250.3 33.6599 254.02 33.6599C256.68 33.6599 259.12 34.1599 261.35 35.1399C263.58 36.1299 265.31 37.6799 266.55 39.7799C267.04 39.2899 267.71 38.6799 268.55 37.9699C269.38 37.2599 270.41 36.5799 271.61 35.9299C272.82 35.2799 274.22 34.7399 275.83 34.3099C277.44 33.8799 279.23 33.6599 281.21 33.6599C285.23 33.6599 288.67 34.8099 291.51 37.0899C294.36 39.3799 295.78 43.0599 295.78 48.1299V80.9799H285.2V50.3599C285.2 48.1899 284.49 46.4899 283.07 45.2599C281.65 44.0199 279.79 43.3999 277.5 43.3999C275.64 43.3999 274.13 43.8199 272.95 44.6499C271.77 45.4799 270.86 46.5199 270.21 47.7599C269.56 48.9999 269.13 50.3599 268.91 51.8399C268.69 53.3199 268.59 54.6899 268.59 55.9199V80.9799V80.9999Z" fill="#020203"/>
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
<path d="M47.5201 77.18H66.2501C73.5601 77.18 79.4801 71.26 79.4801 63.95C79.4801 56.64 73.5601 50.72 66.2501 50.72H47.3601C46.3801 50.72 45.5901 51.52 45.6001 52.5L45.7601 75.44C45.7601 76.41 46.5501 77.19 47.5201 77.19V77.18Z" fill="#07ACDD"/>
|
|
73
73
|
<path d="M28.4201 76.12C35.1082 76.12 40.5301 70.6982 40.5301 64.01C40.5301 57.3218 35.1082 51.9 28.4201 51.9C21.7319 51.9 16.3101 57.3218 16.3101 64.01C16.3101 70.6982 21.7319 76.12 28.4201 76.12Z" fill="#fafafa"/>
|
|
74
74
|
</g>
|
|
75
|
-
</g>`}catch(ve){console.warn("Watermark processing failed, skipping watermark in SVG:",ve),
|
|
75
|
+
</g>`}catch(ve){console.warn("Watermark processing failed, skipping watermark in SVG:",ve),Be=""}const Ze=`<?xml version="1.0" encoding="UTF-8"?>
|
|
76
76
|
<svg width="${r}" height="${m}"
|
|
77
77
|
xmlns="http://www.w3.org/2000/svg"
|
|
78
78
|
xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
@@ -86,35 +86,35 @@
|
|
|
86
86
|
<rect width="100%" height="100%" fill="#fafafa"/>
|
|
87
87
|
${S}
|
|
88
88
|
<g transform="translate(0, ${l.height})">
|
|
89
|
-
${
|
|
90
|
-
${
|
|
89
|
+
${L}
|
|
90
|
+
${Be}
|
|
91
91
|
</g>
|
|
92
|
-
</svg>`,
|
|
93
|
-
`),
|
|
94
|
-
`),t+=`# ${
|
|
92
|
+
</svg>`,re=new Blob([Ze],{type:"image/svg+xml;charset=utf-8"}),ye=URL.createObjectURL(re),Ee=document.createElement("a");Ee.href=ye,Ee.download=qn("svg"),document.body.appendChild(Ee),Ee.click(),document.body.removeChild(Ee),URL.revokeObjectURL(ye),gn(t),ue()}catch(o){console.error("Error downloading SVG:",o),gn(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},Go=async()=>{try{const t=vo();P.value&&P.value.offsetHeight,await new Promise(ve=>setTimeout(ve,300));const o=Je(),l=Se.value,r=ie.value+o.height,m=document.createElement("canvas"),v=m.getContext("2d"),C=2;m.width=l*C,m.height=r*C,m.style.width=l+"px",m.style.height=r+"px",v.scale(C,C),v.fillStyle="#fafafa",v.fillRect(0,0,l,r);let b=30;if(ct.value&&(v.fillStyle="#333",v.font="bold 18px Arial, sans-serif",v.fillText(ct.value,24,b),b+=30),gt.value&&(v.fillStyle="#666",v.font="14px Arial, sans-serif",v.fillText(gt.value,24,b),b+=25),W.value&&R.series.length>0){let ve=l-200,Xe=ct.value||gt.value?35:25;const ze=Math.floor((l-250)/120);let Te=0;v.font="12px Arial, sans-serif",R.series.forEach((Ve,De)=>{if(!wt.value.has(De)){const Nt=Qt(De);v.beginPath(),v.arc(ve+6,Xe-4,6,0,2*Math.PI),v.fillStyle=Nt,v.fill(),v.fillStyle="#333",v.fillText(Ve.name,ve+18,Xe),Te++,Te%ze===0?(ve=l-200,Xe+=20):ve+=Math.min(120,Ve.name.length*8+35)}})}const N=T.value.cloneNode(!0),L=N.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),S=N.querySelectorAll(".dss-crosshair"),K=N.querySelectorAll('[class*="tooltip"]');L.forEach(ve=>ve.remove()),S.forEach(ve=>ve.remove()),K.forEach(ve=>ve.remove()),N.querySelectorAll("image").forEach((ve,Xe)=>{const ze=ve.getAttribute("xlink:href")||ve.getAttribute("href");if(ze&&!ze.startsWith("data:")){const Te=Io.value[Xe],Ve=Te?Qt(Te.seriesIndex):"#3B82F6",De=ve.getAttribute("x")||0,Nt=ve.getAttribute("y")||0,It=ve.getAttribute("width")||32,Rl=ve.getAttribute("height")||32,ml=document.createElementNS("http://www.w3.org/2000/svg","circle");ml.setAttribute("cx",parseFloat(De)+parseFloat(It)/2),ml.setAttribute("cy",parseFloat(Nt)+parseFloat(Rl)/2),ml.setAttribute("r",Math.min(parseFloat(It),parseFloat(Rl))/2-1),ml.setAttribute("fill",Ve),ml.setAttribute("stroke","#fafafa"),ml.setAttribute("stroke-width","2"),ve.parentNode.replaceChild(ml,ve)}});const Ze=new XMLSerializer().serializeToString(N),re=new Blob([Ze],{type:"image/svg+xml;charset=utf-8"}),ye=URL.createObjectURL(re),Ee=new Image;return new Promise((ve,Xe)=>{Ee.onload=async()=>{try{if(v.drawImage(Ee,0,o.height),Io.value.forEach(ze=>{const Te=ze.x,Ve=ze.y+o.height,De=(ze.width||32)/2,Nt=Qt(ze.seriesIndex);v.save(),v.beginPath(),v.arc(Te,Ve,De-1,0,2*Math.PI),v.fillStyle=Nt,v.fill(),v.strokeStyle="#fafafa",v.lineWidth=2,v.stroke(),v.restore()}),Ae.value){const ze=new Image,Te=()=>{const{width:De,height:Nt}=lt.value,It=tt.value,Rl=I.value.left,ml=I.value.right,Wl=I.value.top,jn=I.value.bottom,ra=I.value.width,ns=I.value.height;let oo,ao;switch(It){case"center":oo=Rl+(ra-De)/2,ao=Wl+o.height+(ns-Nt)/2;break;case"top-left":oo=Rl+15,ao=Wl+o.height+10;break;case"top-right":oo=ml-De-5,ao=Wl+o.height+10;break;case"bottom-left":oo=Rl+15,ao=jn+o.height-Nt-5;break;case"bottom-right":default:oo=ml-De-5,ao=jn+o.height-Nt-5;break}v.globalAlpha=it.value,v.drawImage(ze,oo,ao,De,Nt),v.globalAlpha=1,Ve()},Ve=()=>{m.toBlob(De=>{const Nt=URL.createObjectURL(De),It=document.createElement("a");It.href=Nt,It.download=qn("png"),document.body.appendChild(It),It.click(),document.body.removeChild(It),URL.revokeObjectURL(Nt),URL.revokeObjectURL(ye),gn(t),ue(),ve()},"image/png")};ze.onload=Te,ze.onerror=Ve,ze.src=el.value}else m.toBlob(ze=>{const Te=URL.createObjectURL(ze),Ve=document.createElement("a");Ve.href=Te,Ve.download=qn("png"),document.body.appendChild(Ve),Ve.click(),document.body.removeChild(Ve),URL.revokeObjectURL(Te),URL.revokeObjectURL(ye),gn(t),ue(),ve()},"image/png")}catch(ze){URL.revokeObjectURL(ye),gn(t),Xe(ze)}},Ee.onerror=()=>{URL.revokeObjectURL(ye),gn(t),Xe(new Error("Failed to load SVG image"))},Ee.src=ye})}catch(t){console.error("Error downloading PNG:",t)}},Qo=()=>{try{let t="";if(ct.value&&(t+=`# ${_("chart.csv.chartTitle")}: ${ct.value}
|
|
93
|
+
`),gt.value&&(t+=`# ${_("chart.csv.chartSubtitle")}: ${gt.value}
|
|
94
|
+
`),t+=`# ${_("chart.csv.generated")}: ${new Date().toLocaleString()}
|
|
95
95
|
|
|
96
|
-
`,
|
|
97
|
-
`,
|
|
98
|
-
`})});const
|
|
99
|
-
`;const o=Math.max(...
|
|
100
|
-
`}const l=new Blob([t],{type:"text/csv;charset=utf-8;"}),r=URL.createObjectURL(l),m=document.createElement("a");m.href=r,m.download=Hn("csv"),document.body.appendChild(m),m.click(),document.body.removeChild(m),URL.revokeObjectURL(r),Bt()}catch(t){console.error("Error downloading CSV:",t)}},Yn=t=>{if(typeof t.action=="function"){const o={series:F.series,categories:F.categories,markers:Tt.value},l={chartX:ft.value.chartX,chartY:ft.value.chartY,dataX:ft.value.mouseDataX,dataY:ft.value.mouseDataY,categoryIndex:clampedCategoryIndex||ft.value.categoryIndex};t.action(o,l)}Bt()},jn=()=>{Sn(),De.value.show=!0,De.value.categoryIndex=ft.value.categoryIndex,De.value.fromButton=!1,Bt()},Qo=()=>{Sn(),De.value.show=!0,De.value.categoryIndex=0,De.value.fromButton=!0},Vo=t=>{if(ft.value.show){const o=document.querySelector(".dss-context-menu");o&&!o.contains(t.target)&&(ft.value.show=!1)}},Kn=t=>{ft.value.show&&!t.target.closest(".context-menu")&&(ft.value.show=!1)},rn=t=>{if(!ol.value||!Ge.value)return;t.preventDefault(),t.stopPropagation(),ie.value.isZooming=!0,nt.value.show=!1,ie.value.zoomTimeout&&clearTimeout(ie.value.zoomTimeout);const l=t.currentTarget.getBoundingClientRect(),r=t.clientX-l.left,m=t.clientY-l.top;if(r<R.value.left-50||r>R.value.right+50||m<R.value.top-50||m>R.value.bottom+100){ie.value.isZooming=!1;return}const f=t.deltaY>0?.9:1.1,C=Math.max(ie.value.minScale,Math.min(ie.value.maxScale,ie.value.scale*f));if(C!==ie.value.scale){const{minX:b,maxX:P}=He.value,B=P-b||1,H=B/ie.value.scale,S=b-ie.value.offsetX/R.value.width*B,q=(r-R.value.left)/R.value.width,we=S+q*H;ie.value.scale=C;const Ze=B/ie.value.scale,pe=we-q*Ze;ie.value.offsetX=-(pe-b)/B*R.value.width,ie.value.scale<=1.01&&(ie.value.scale=1,ie.value.offsetX=0)}ie.value.zoomTimeout=setTimeout(()=>{ie.value.isZooming=!1,ie.value.zoomTimeout=null},300)},yn=t=>{if(!ol.value||!Ge.value||ie.value.scale<=1)return;nt.value.show=!1;const l=t.currentTarget.getBoundingClientRect();t.clientX-l.left,t.clientY-l.top,ie.value.isDragging=!0,ie.value.lastMouseX=t.clientX,ie.value.lastMouseY=t.clientY,t.preventDefault()},Nn=()=>{ie.value.isDragging=!1},Bn=()=>{!ol.value||!Ge.value||(ie.value.scale=1,ie.value.offsetX=0,ie.value.isDragging=!1,ie.value.zoomTimeout&&(clearTimeout(ie.value.zoomTimeout),ie.value.zoomTimeout=null),ie.value.isZooming=!1)},cl=()=>!ol.value||!El.value||!Ge.value?"default":ie.value.isDragging?"grabbing":ie.value.scale>1?"grab":"dss-crosshair",Gn=t=>{if(t.length<2)return"";if(t.length===2)return`M ${t[0].x} ${t[0].y} L ${t[1].x} ${t[1].y}`;let o=`M ${t[0].x} ${t[0].y}`;for(let l=0;l<t.length-1;l++){const r=t[Math.max(l-1,0)],m=t[l],f=t[l+1],C=t[Math.min(l+2,t.length-1)],b=m.x+(f.x-r.x)/6*Ke.value,P=m.y+(f.y-r.y)/6*Ke.value,B=f.x-(C.x-m.x)/6*Ke.value,H=f.y-(C.y-m.y)/6*Ke.value;o+=` C ${b} ${P} ${B} ${H} ${f.x} ${f.y}`}return o},Tl=e.computed(()=>{const o=U.value?.chart?.padding,l=typeof o=="number"?o:null,r=o&&typeof o=="object"?o:null,m=50;let f=m+(Wt.value?30:0)+60;if(Bl.value){const S={left:m+40,top:m+40,right:m+40,bottom:m+40};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??S.left,top:r.top??S.top,right:r.right??S.right,bottom:r.bottom??S.bottom}:S}if(al.value){const S=!W.value,q=Qt.value,we=q?Ln.value+En.value+Math.max(24,_t.value+16):0,Ze=S?12:m;let pe=0;ut.value&&(pe+=S?8:15),ht.value&&(pe+=S?6:10);const ye=tt();let Se=Ze+(S?4:16)+(q?we:0),ve=Ze+(q?we:0);W.value&&G.value==="left"?Se+=ye.legendWidth||150:W.value&&G.value==="right"&&(ve+=ye.legendWidth||150);const Oe=Ce.value==="semi-radial"?q?we:8:q?we:S?8:m+80,Ae=q?14:0,Ee=Ze+pe+Ae,Re={left:Se,top:Ee,right:ve,bottom:Oe};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??Re.left,top:r.top??Re.top,right:r.right??Re.right,bottom:r.bottom??Re.bottom}:Re}let C=0;ut.value&&(C+=15),ht.value&&(C+=10);const b=tt();let P=m+16+(qt.value?30:0),B=m+(wt.value?30:0);W.value&&G.value==="left"?P+=b.legendWidth||150:W.value&&G.value==="right"&&(B+=b.legendWidth||150),D.value&&(B+=44);const H={left:P,top:m+C,right:B,bottom:f};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??H.left,top:r.top??H.top,right:r.right??H.right,bottom:r.bottom??H.bottom}:H}),R=e.computed(()=>({left:Tl.value.left,top:Tl.value.top,right:Ve.value-Tl.value.right,bottom:re.value-Tl.value.bottom,width:Ve.value-(Tl.value.left+Tl.value.right),height:re.value-(Tl.value.top+Tl.value.bottom)})),ol=e.computed(()=>["line","area","bar","stepbar"].includes(Ce.value)||Je.value),_l=e.computed(()=>Je.value),en=e.computed(()=>Ce.value==="mini-radial"),al=e.computed(()=>["radial","semi-radial","mini-radial"].includes(Ce.value)),Bl=e.computed(()=>Ce.value==="spider"),ul=e.computed(()=>Ce.value==="bubble"),Ol=e.computed(()=>Ce.value==="stepbar"),dl=e.computed(()=>U.value?.chart?.orientation==="horizontal"&&(Ce.value==="bar"||_l.value)),Xl=t=>{const{minY:o,maxY:l}=He.value,r=l-o||1;return R.value.left+(t-o)/r*R.value.width},kn=t=>{const{maxX:o}=He.value,l=o+1,m=R.value.height/l;return R.value.top+(t+.5)*m},Ut=e.computed(()=>al.value?Tl.value.left+(Ve.value-Tl.value.left-Tl.value.right)/2:Ve.value/2),Pt=e.computed(()=>Bl.value?re.value/2-40:al.value?Tl.value.top+(re.value-Tl.value.top-Tl.value.bottom)/2:re.value/2),gt=e.computed(()=>{if(Bl.value){const t=R.value.width-80,o=R.value.height-80;return Math.min(t,o)/2}return Math.min(R.value.width,R.value.height)/2}),sl=e.computed(()=>{const t=U.value,o=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,l=typeof o=="number"&&o>=0&&o<=1?o:.45;return gt.value*l}),vo=e.computed(()=>{const t=U.value,o=typeof F.innerSize=="number"?F.innerSize:t?.innerSize;return typeof o!="number"||o<=-100||!(al.value||Bl.value)?1:1+o/100}),No=e.computed(()=>{const t=vo.value;if(t===1||t<=0)return;const o=Ut.value,l=Pt.value;return`translate(${o}, ${l}) scale(${t}) translate(${-o}, ${-l})`}),Fn=e.ref(0),Wn=e.computed(()=>`semi-radial-fill-clip-${F.chartId}`),Cn=e.computed(()=>Ce.value==="semi-radial"),ho=e.computed(()=>Cn.value&&Vl.value&&!$n.value),qn=e.computed(()=>Cn.value&&Vl.value&&!$n.value&&Nl.value==="fill"),Bo=e.computed(()=>{const t=ho.value?Fn.value:1,o=Ut.value,l=Pt.value,r=sl.value,m=gt.value,f=Math.PI,C=Math.PI+t*Math.PI;if(t<=0)return`M ${o} ${l} L ${o} ${l} Z`;const b=o+m*Math.cos(f),P=l+m*Math.sin(f),B=o+m*Math.cos(C),H=l+m*Math.sin(C),S=o+r*Math.cos(C),q=l+r*Math.sin(C),we=o+r*Math.cos(f),Ze=l+r*Math.sin(f),pe=t>.5?1:0;return`M ${o} ${l} L ${b} ${P} A ${m} ${m} 0 ${pe} 1 ${B} ${H} L ${S} ${q} A ${r} ${r} 0 ${pe} 1 ${we} ${Ze} Z`}),Mo=e.computed(()=>{if(!(!Cn.value||!ho.value)&&!qn.value)return`url(#${Wn.value})`}),Zn=t=>{if(!(!qn.value||t!==0))return`url(#${Wn.value})`},Rl=e.ref(0),Qn=e.computed(()=>`radial-reveal-clip-${F.chartId}`),an=e.computed(()=>Ce.value==="radial"),Jo=e.computed(()=>{const t=an.value?Rl.value:1,o=Ut.value,l=Pt.value,r=Math.max(gt.value*1.5,Ve.value,re.value);if(t<=0)return`M ${o} ${l} L ${o} ${l} Z`;if(t>=1){const S=o-r,q=o+r;return`M ${S} ${l} A ${r} ${r} 0 0 1 ${q} ${l} A ${r} ${r} 0 0 1 ${S} ${l} Z`}const m=-Math.PI/2,f=m+t*Math.PI*2,C=o+r*Math.cos(m),b=l+r*Math.sin(m),P=o+r*Math.cos(f),B=l+r*Math.sin(f),H=t>=.5?1:0;return`M ${o} ${l} L ${C} ${b} A ${r} ${r} 0 ${H} 1 ${P} ${B} Z`}),ea=e.computed(()=>{if(Mo.value)return Mo.value;if(an.value)return`url(#${Qn.value})`});let Un=null;const Jn=()=>{if(!ho.value)return;Fn.value=0;const t=tl.value,o=performance.now(),l=r=>{const m=r-o,f=Math.min(1,m/t);Fn.value=ca(on.value,f),f<1&&(Un=requestAnimationFrame(l))};Un=requestAnimationFrame(l)},Yl=e.computed(()=>U.value?.bubbles?.minSize||8),ta=e.computed(()=>U.value?.bubbles?.maxSize||50),bn=e.computed(()=>U.value?.bubbles?.opacity||.7),eo=(t,o)=>{const l=[15,20,25,18,22],r=l[t%l.length]||20,m=1+Math.sin(o*.5)*.2;return Math.max(5,r*m)},la=t=>{const o=document.querySelector(`.dss-bubble-image-${t}`);o&&(o.style.opacity="1")},_o=t=>{const o=document.querySelector(`.dss-bubble-image-${t}`);o&&(o.style.display="none")},tn=e.computed(()=>F.series),a=e.computed(()=>F.series.filter((t,o)=>!zt.value.has(o))),n=t=>{if(!t)return"primary";const o=t.yAxis??t.axis??t.yAxisId;return o==="secondary"||o==="right"||o===1?"secondary":"primary"},s=t=>t?typeof t.strokeDasharray=="string"?t.strokeDasharray:Array.isArray(t.strokeDasharray)?t.strokeDasharray.join(","):t.dotted===!0?"4,4":null:null,i=t=>t?t.old===!0||t.comparison===!0||t.dotted===!0:!1,c=e.computed(()=>{const o=U.value?.spider?.comparison||{};return{fillOpacity:typeof o.fillOpacity=="number"?o.fillOpacity:0,strokeDasharray:o.strokeDasharray||"6,4",usePrimaryColor:o.usePrimaryColor!==!1,bubbleSize:typeof o.bubbleSize=="number"?o.bubbleSize:0}}),d=(t,o)=>typeof t?.bubbles?.size=="number"?t.bubbles.size:typeof t?.bubbleSize=="number"?t.bubbleSize:o?c.value.bubbleSize:Lt.value,u=(t,o)=>i(t)&&c.value.usePrimaryColor?$t(0):$t(o),p=(t,o)=>Bl.value&&i(t)?u(t,o):$t(o),h=e.computed(()=>a.value.filter(t=>n(t)==="primary")),k=e.computed(()=>a.value.filter(t=>n(t)==="secondary")),D=e.computed(()=>!dl.value&&!!Ct.value&&k.value.length>0),I=(t,o=0)=>{const l=Number(t);return Number.isFinite(l)?l:o},N=(t,o,l)=>{if(!Array.isArray(t))return[];const r=t.map((m,f)=>{const C=m&&typeof m=="object"&&!Array.isArray(m),b=I(C?m.value:m,0);return b<=0?null:{key:`${l}-${f}-${C&&m.label||f}`,label:C?m.label||o?.name||`Segment ${f+1}`:o?.name||`Segment ${f+1}`,value:b,color:C?m.color||$t(f):$t(l),marker:C?m.marker:null,isRemainder:!1}}).filter(Boolean);return vl.value==="asc"?r.sort((m,f)=>m.value-f.value):vl.value==="desc"?r.sort((m,f)=>f.value-m.value):r},se=(t,o,l,r)=>{const m=t&&typeof t=="object"&&!Array.isArray(t),f=m?t.segments:Array.isArray(t)?t:[{label:l?.name,value:t,color:$t(r)}],C=N(f,l,r),b=C.reduce((S,q)=>S+q.value,0),P=I(m?t.totalValue??t.total??l?.totalValue??l?.total:l?.totalValue??l?.total,M.value),B=Math.max(P,b,1);x.value&&B>b&&C.push({key:`${r}-${o}-remainder`,label:A.value,value:B-b,color:ae.value,marker:null,isRemainder:!0});const H=C.filter(S=>!S.isRemainder).reduce((S,q)=>!S||q.value>S.value?q:S,null);return{key:`${r}-${o}`,label:m?t.label||t.name||F.categories?.[o]||$("chart.fallback.item",{number:o+1}):F.categories?.[o]||$("chart.fallback.item",{number:o+1}),axisLabel:m?t.xLabel??t.label??t.name??F.categories?.[o]??$("chart.fallback.item",{number:o+1}):F.categories?.[o]||$("chart.fallback.item",{number:o+1}),yLabel:m?t.yLabel??null:null,totalValue:B,usedValue:b,segments:C,maxSegmentKey:H?.key||null,seriesName:l?.name||"",seriesIndex:r}},Q=e.computed(()=>{if(!Ol.value)return[];const t=[];return tn.value.forEach((o,l)=>{zt.value.has(l)||!Array.isArray(o?.data)||o.data.forEach(r=>{const m=se(r,t.length,o,l);m.segments.length>0&&t.push(m)})}),t}),Be="auto",_e=(t,o,l,r=0,m=100)=>{let f=1/0,C=-1/0;if(t.forEach(B=>{B?.data?.length&&B.data.forEach(H=>{typeof H=="number"&&Number.isFinite(H)&&(f=Math.min(f,H),C=Math.max(C,H))})}),f===1/0)return{minY:r,maxY:m};let b;if(o===Be){const B=C-f,H=B>0?B*.1:1;b=Math.max(0,f-H)}else if(typeof o=="number")b=o;else{const B=C-f,H=B>0?B*.1:1;b=Math.max(0,f-H)}let P;if(l===Be){const B=C-f,H=B>0?B*.1:2;P=C+H}else if(typeof l=="number")P=l;else{const B=C-f,H=B>0?B*.1:2;P=C+H}return{minY:b,maxY:P}},He=e.computed(()=>{if(ul.value)return ml();if(Ol.value)return Sl();if(!a.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=0;a.value.forEach(l=>{l.data&&l.data.length&&(t=Math.max(t,l.data.length-1))}),F.categories.length>0&&(t=Math.max(t,F.categories.length-1));const o=_e(h.value.length?h.value:a.value,Yt.value,it.value);return{minX:0,maxX:t,minY:o.minY,maxY:o.maxY}}),Sl=()=>{const t=Q.value,o=t.reduce((f,C)=>Math.max(f,C.totalValue),M.value),l=typeof Yt.value=="number"?Yt.value:0,r=typeof it.value=="number"?it.value:o,m=Math.max(r,l+1);return{minX:0,maxX:Math.max(t.length-1,0),minY:l,maxY:m}},hl=e.computed(()=>D.value?_e(k.value,Kt.value,yt.value,He.value.minY,He.value.maxY):{minY:He.value.minY,maxY:He.value.maxY}),ml=()=>{if(!a.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,o=-1/0,l=1/0,r=-1/0,m=1/0,f=-1/0,C=!1;if(a.value.forEach((we,Ze)=>{we?.data?.length&&we.data.forEach((pe,ye)=>{let Se,ve,Ye;if(typeof pe=="object"&&pe!==null&&!Array.isArray(pe))Se=typeof pe.x=="number"?pe.x:ye,ve=typeof pe.y=="number"?pe.y:0,Ye=typeof pe.size=="number"?pe.size:20;else if(Array.isArray(pe)&&pe.length>=3)Se=typeof pe[0]=="number"?pe[0]:ye,ve=typeof pe[1]=="number"?pe[1]:0,Ye=typeof pe[2]=="number"?pe[2]:20;else if(typeof pe=="number")Se=ye,ve=pe,Ye=eo(Ze,ye);else return;isFinite(Se)&&isFinite(ve)&&isFinite(Ye)&&(t=Math.min(t,Se),o=Math.max(o,Se),l=Math.min(l,ve),r=Math.max(r,ve),m=Math.min(m,Ye),f=Math.max(f,Ye),C=!0)})}),!C)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===o&&(t=Math.min(t,0),o=Math.max(o,F.categories?.length-1||8)),l===r&&(l=Math.max(0,l-10),r=l+20);const b=o-t,P=r-l;let B,H,S,q;return el.value!==null?B=el.value:B=t-b*.1,X.value!==null?H=X.value:H=o+b*.1,Yt.value!==null&&typeof Yt.value=="number"?S=Yt.value:S=Math.max(0,l-P*.1),it.value!==null&&typeof it.value=="number"?q=it.value:q=r+P*.1,{minX:B,maxX:H,minY:S,maxY:q,minSize:m,maxSize:f}},vt=t=>{if(ul.value){const{minX:b,maxX:P}=He.value,B=P-b||1;return R.value.left+(t-b)/B*R.value.width}const{minX:o,maxX:l}=He.value,r=l-o;if(l===0||r===0)return R.value.left+R.value.width/2;const m=r/ie.value.scale,f=o-ie.value.offsetX/R.value.width*r,C=(t-f)/m;return R.value.left+C*R.value.width},Xt=t=>{const{minY:o,maxY:l}=He.value,r=l-o||1;return R.value.bottom-(t-o)/r*R.value.height},pl=t=>{const{minY:o,maxY:l}=hl.value,r=l-o||1;return R.value.bottom-(t-o)/r*R.value.height},gl=(t,o)=>D.value&&n(t)==="secondary"?pl(o):Xt(o),xn=t=>{if(!ul.value)return Lt.value||4;const{maxSize:o}=He.value,l=Math.max(1,o),r=Math.min(1,Math.max(0,t/l));return Yl.value+r*(ta.value-Yl.value)},Wl=(t,o=12,l="Arial, sans-serif")=>{if(typeof t!="string"||!t)return 0;if(typeof document>"u")return t.length*(o*.62);Wl.canvas||(Wl.canvas=document.createElement("canvas"));const r=Wl.canvas.getContext("2d");return r?(r.font=`${o}px ${l}`,r.measureText(t).width):t.length*(o*.62)},to=(t,o,l=12)=>{if(typeof t!="string"||typeof o!="number"||o<=0||Wl(t,l)<=o)return t;const r="..";if(Wl(r,l)>=o)return r;let f=t.length;for(;f>0;){const C=`${t.slice(0,f)}${r}`;if(Wl(C,l)<=o)return C;f-=1}return r},$o=e.computed(()=>no.value.map(t=>({y:t.y}))),Lo=e.computed(()=>!Ol.value||!xt.value?[]:no.value.map(t=>({y:t.y}))),Ao=e.computed(()=>!Ol.value||!xt.value||!Mt.value?[]:sa.value.map(t=>({x:t.centerX}))),To=e.computed(()=>{if(ul.value)return Do();if(Ol.value)return lo();if(Ce.value==="bar"){if(dl.value){const Ee=[],{minY:Re,maxY:Vt}=He.value,Ft=5,Dl=Vt-Re||1;for(let fl=0;fl<=Ft;fl++){const $l=Re+Dl*(fl/Ft),ao=Xl($l);Ee.push({x:ao,y:R.value.bottom+20,text:_(Math.round($l))})}return Ee}const ye=[],{maxX:Se}=He.value,ve=Se+1,Ye=5,Ae=(R.value.width-Ye*2)/ve;for(let Ee=0;Ee<=Se;Ee++){const Re=R.value.left+Ye+(Ee+.5)*Ae;ye.push({x:Re,y:R.value.bottom+20,text:to(F.categories[Ee]||$("chart.fallback.item",{number:Ee+1}),Math.max(Ae-8,24))})}return ye}const t=[],{minX:o,maxX:l}=He.value,r=el.value!==null?el.value:o,m=X.value!==null?X.value:l,f=m-r||1,C=f/ie.value.scale,b=r-ie.value.offsetX/R.value.width*f,P=b+C,B=Math.max(0,Math.floor(b-2)),H=Math.min(m,Math.ceil(P+2)),S=H-B,q=R.value.width,Ze=Math.floor(q/60);let pe=1;S>Ze&&(pe=Math.ceil(S/Ze));for(let ye=B;ye<=H;ye+=pe)if(ye>=0&&ye<=m){const Se=vt(ye);Se>=R.value.left-100&&Se<=R.value.right+100&&t.push({x:Se,y:R.value.bottom+20,text:F.categories[ye]||`Item ${ye+1}`})}return t}),Do=()=>{const t=[],{minX:o,maxX:l}=He.value,r=l-o||1,m=Math.min(8,Math.max(4,Math.floor(R.value.width/80)));for(let f=0;f<=m;f++){const C=o+r*f/m,b=vt(C);if(b>=R.value.left-10&&b<=R.value.right+10){const P=Math.round(C),B=F.categories?.[P];t.push({x:b,y:R.value.bottom+20,text:B||(Number.isInteger(C)?C.toString():C.toFixed(1))})}}return t},lo=()=>sa.value.map(o=>({x:o.centerX,y:R.value.bottom+20,text:to(o.axisLabel||o.label,Math.max(o.categoryWidth-8,24))})),no=e.computed(()=>{if(dl.value){const m=[],{maxX:f}=He.value;for(let C=0;C<=f;C++)m.push({x:R.value.left-10,y:kn(C),text:to(F.categories[C]||`Item ${C+1}`,Math.max(R.value.left-28,40))});return m}const t=[],{minY:o,maxY:l}=He.value,r=5;for(let m=0;m<=r;m++){const f=o+(l-o)*(m/r),C=Math.round(f);t.push({x:R.value.left-10,y:Xt(f),text:_(C)})}return t}),cn=e.computed(()=>{if(!D.value||dl.value)return[];const t=[],{minY:o,maxY:l}=hl.value,r=5;for(let m=0;m<=r;m++){const f=o+(l-o)*(m/r),C=Math.round(f);t.push({x:R.value.right+10,y:pl(f),text:_(C)})}return t}),$t=t=>{const o=jt.value;if(!o||o.length===0){const l=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return l[t%l.length]}return o[t%o.length]},ln=t=>{if(!t||typeof t!="string")return"#3a3a3a";const o=t.trim();let l=0,r=0,m=0;const f=o.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(f)l=Number(f[1])/255,r=Number(f[2])/255,m=Number(f[3])/255;else{const b=o.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(b)l=Number(b[1])/255,r=Number(b[2])/255,m=Number(b[3])/255;else{const P=o.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(P){let B=P[1];B.length===3&&(B=B[0]+B[0]+B[1]+B[1]+B[2]+B[2]),l=parseInt(B.slice(0,2),16)/255,r=parseInt(B.slice(2,4),16)/255,m=parseInt(B.slice(4,6),16)/255}else if(typeof document<"u"){const B=document.createElement("span");B.style.color=o,B.style.display="none",document.body.appendChild(B);const H=getComputedStyle(B).color;document.body.removeChild(B);const S=H.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(S)l=Number(S[1])/255,r=Number(S[2])/255,m=Number(S[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*l+.7152*r+.0722*m>.5?"#3a3a3a":"#fafafa"},Ho=t=>{if(!t||typeof t!="string")return t;const o=t.trim(),l=o.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(l){const f=Math.max(0,Math.floor(Number(l[1])*.65)),C=Math.max(0,Math.floor(Number(l[2])*.65)),b=Math.max(0,Math.floor(Number(l[3])*.65));return`rgb(${f}, ${C}, ${b})`}const r=o.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(r){const f=Math.max(0,Math.floor(Number(r[1])*.65)),C=Math.max(0,Math.floor(Number(r[2])*.65)),b=Math.max(0,Math.floor(Number(r[3])*.65));return`rgba(${f}, ${C}, ${b}, ${r[4]})`}const m=o.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(m){let f=m[1];f.length===3&&(f=f[0]+f[0]+f[1]+f[1]+f[2]+f[2]);const C=Math.max(0,Math.min(255,Math.floor(parseInt(f.slice(0,2),16)*.65))),b=Math.max(0,Math.min(255,Math.floor(parseInt(f.slice(2,4),16)*.65))),P=Math.max(0,Math.min(255,Math.floor(parseInt(f.slice(4,6),16)*.65)));return`#${[C,b,P].map(B=>B.toString(16).padStart(2,"0")).join("")}`}return o},na=(t,o)=>{const r=U.value?.stroke?.color;return r==null?Ho(o):typeof r=="string"?r:Array.isArray(r)&&r.length?r[t%r.length]??Ho(o):Ho(o)},oa=t=>{let o=0;for(let l=1;l<t.length;l++){const r=t[l].x-t[l-1].x,m=t[l].y-t[l-1].y;o+=Math.sqrt(r*r+m*m)}return o},fa=e.computed(()=>Ce.value==="line"||_l.value?(_l.value?F.series.filter(o=>(o.type||Ce.value)==="line"):tn.value).map((o,l)=>{const r=F.series.findIndex(S=>S===o),m=[];let f=[];o.data.forEach((S,q)=>{S==null?f.length>0&&(m.push([...f]),f=[]):f.push({x:dl.value?Xl(S):vt(q),y:dl.value?kn(q):gl(o,S),index:q})}),f.length>0&&m.push(f);let C="";m.forEach(S=>{if(S.length>0){let q="";xe.value?q=Gn(S):q=`M ${S[0].x} ${S[0].y}`+S.slice(1).map(we=>` L ${we.x} ${we.y}`).join(""),C+=(C?" ":"")+q}});const b=m.reduce((S,q)=>S+oa(q),0),P=zt.value.has(r),B=Me.value===r,H=Me.value!==null&&Me.value!==r;return{path:C,color:$t(r),strokeDasharray:s(o),pathLength:b,seriesIndex:r,animationDelay:l*xl.value,isHighlighted:B,isDimmed:H,isHidden:P}}):[]),va=e.computed(()=>{if(!(Ce.value==="line"||_l.value))return[];const t=_l.value?F.series.filter(l=>(l.type||Ce.value)==="line"):tn.value,o=[];return t.forEach((l,r)=>{const m=F.series.findIndex(f=>f===l);for(let f=0;f<l.data.length-1;f++){const C=l.data[f];if(C!=null){let b=-1,P=0;for(let B=f+1;B<l.data.length;B++){const H=l.data[B];if(H==null)P++;else{b=B;break}}if(P>0&&b!==-1){const B=l.data[b],H=dl.value?Xl(C):vt(f),S=dl.value?kn(f):gl(l,C),q=dl.value?Xl(B):vt(b),we=dl.value?kn(b):gl(l,B),Ze=zt.value.has(m),pe=Me.value===m,ye=Me.value!==null&&Me.value!==m;o.push({path:`M ${H} ${S} L ${q} ${we}`,color:$t(m),seriesIndex:m,animationDelay:r*xl.value,isHighlighted:pe,isDimmed:ye,isHidden:Ze,gapSize:P}),f=b-1}}}}),o}),Ta=e.computed(()=>Ce.value==="line"||_l.value?!Vl.value||$n.value||Ot.value.hasAnimated?[]:(_l.value?F.series.filter(o=>(o.type||Ce.value)==="line"):tn.value).map((o,l)=>{const r=F.series.findIndex(P=>P===o);let m="",f=null;o.data.forEach((P,B)=>{if(P!=null){const H={x:dl.value?Xl(P):vt(B),y:dl.value?kn(B):gl(o,P)};f===null?m+=`M ${H.x} ${H.y}`:m+=` L ${H.x} ${H.y}`,f=H}else if(f!==null){const H=o.data.findIndex((S,q)=>q>B&&S!==null&&S!==void 0);if(H!==-1){const S={x:dl.value?Xl(o.data[H]):vt(H),y:dl.value?kn(H):gl(o,o.data[H])};m+=` L ${S.x} ${S.y}`,f=S}}});const C=o.data.map((P,B)=>P==null?null:{x:dl.value?Xl(P):vt(B),y:dl.value?kn(B):gl(o,P)}).filter(P=>P!==null),b=oa(C);return{path:m,pathLength:b,color:$t(r),strokeDasharray:s(o),animationDelay:l*xl.value,seriesIndex:r}}):[]),Da=e.computed(()=>{if(Ce.value!=="line")return[];const t=[];return tn.value.forEach((o,l)=>{const r=Me.value===l,m=Me.value!==null&&Me.value!==l,f=zt.value.has(l);o.data.forEach((C,b)=>{C!=null&&t.push({x:vt(b),y:gl(o,C),color:$t(l),value:C,label:F.categories[b]||b.toString(),seriesName:o.name,categoryIndex:b,dataIndex:b,animationDelay:(l*o.data.length+b)*(xl.value/8),isHighlighted:r,isDimmed:m,isHidden:f})})}),t}),Ha=e.computed(()=>{if(!_l.value)return[];const t=[];return F.series.filter(l=>(l.type||Ce.value)==="line").forEach((l,r)=>{const m=F.series.findIndex(P=>P===l),f=Me.value===m,C=Me.value!==null&&Me.value!==m,b=zt.value.has(m);l.data.forEach((P,B)=>{P!=null&&t.push({x:vt(B),y:gl(l,P),color:$t(m),value:P,label:F.categories[B]||B.toString(),seriesName:l.name,categoryIndex:B,dataIndex:B,animationDelay:(r*l.data.length+B)*(xl.value/8),isHighlighted:f,isDimmed:C,isHidden:b})})}),t}),Ro=e.computed(()=>{if(!ul.value)return[];const t=[];return tn.value.forEach((o,l)=>{if(!o?.data?.length)return;const r=Me.value,m=r!==null&&r===l,f=r!==null&&r!==l,C=zt.value.has(l);o.data.forEach((b,P)=>{let B,H,S,q,we;if(typeof b=="object"&&b!==null&&!Array.isArray(b))B=typeof b.x=="number"?b.x:P,H=typeof b.y=="number"?b.y:0,S=typeof b.size=="number"?b.size:20,q=b.label||F.categories?.[P]||`Point ${P+1}`,we=b.image||b.imageUrl;else if(Array.isArray(b)&&b.length>=3)B=typeof b[0]=="number"?b[0]:P,H=typeof b[1]=="number"?b[1]:0,S=typeof b[2]=="number"?b[2]:20,q=b[3]||F.categories?.[P]||`Point ${P+1}`,we=b[4];else if(typeof b=="number")B=P,H=b,S=eo(l,P),q=F.categories?.[P]||`Point ${P+1}`;else return;!isFinite(B)||!isFinite(H)||!isFinite(S)||t.push({x:vt(B),y:Xt(H),radius:xn(S),originalX:B,originalY:H,originalSize:S,color:$t(l),seriesName:o.name||`Series ${l+1}`,label:q,imageUrl:we,seriesIndex:l,dataIndex:P,categoryIndex:Math.round(B),isHighlighted:m,isDimmed:f,isHidden:C,opacity:bn.value})})}),t}),aa=e.computed(()=>Ce.value!=="area"?[]:tn.value.map((t,o)=>{const l=[];let r=[];if(t.data.forEach((S,q)=>{S==null?r.length>0&&(l.push([...r]),r=[]):r.push({x:vt(q),y:gl(t,S),index:q})}),r.length>0&&l.push(r),l.length===0)return{linePath:"",areaPath:"",color:$t(o),isHidden:zt.value.has(o)};const m=R.value.bottom+1;let f="",C="";l.forEach((S,q)=>{if(S.length===0)return;let we=`M ${S[0].x} ${S[0].y}`;xe.value&&S.length>1?we=Gn(S):S.slice(1).forEach(pe=>{we+=` L ${pe.x} ${pe.y}`}),f+=(f?" ":"")+we;let Ze=`M ${S[0].x} ${m}`;if(Ze+=` L ${S[0].x} ${S[0].y}`,xe.value&&S.length>1){const pe=Gn(S),ye=pe.substring(pe.indexOf("C")||pe.indexOf("Q")||pe.indexOf("L"));ye?Ze+=" "+ye:S.slice(1).forEach(Se=>{Ze+=` L ${Se.x} ${Se.y}`})}else S.slice(1).forEach(pe=>{Ze+=` L ${pe.x} ${pe.y}`});Ze+=` L ${S[S.length-1].x} ${m} Z`,C+=(C?" ":"")+Ze});const b=Me.value===o,P=Me.value!==null&&Me.value!==o,B=zt.value.has(o),H=l.reduce((S,q)=>S+oa(q),0);return{linePath:f,areaPath:C,color:$t(o),pathLength:H,isHighlighted:b,isDimmed:P,isHidden:B}})),sa=e.computed(()=>{if(!Ol.value)return[];const t=Q.value,o=t.length;if(!o)return[];const l=Math.max(R.value.width,0),r=o>0?l/o:l,m=Math.max(Fe.value,bt.value),f=Math.min(oe.value,m),C=Math.max(4,Math.min(m,Math.max(Fe.value,f),Math.max(4,r*.62))),b=yl.value,P=Number.isFinite(Number(b.radius))?Math.max(Number(b.radius),0):8,B=Number.isFinite(Number(b.borderWidth))?Math.max(Number(b.borderWidth),0):2,H=Number.isFinite(Number(b.fontSize))?Math.max(Number(b.fontSize),1):10,S=typeof b.icon=="string"?b.icon:"";return t.map((q,we)=>{const Ze=R.value.left+(we+.5)*r,pe=Ze-C/2;let ye=0,Se=null;const ve=Me.value===q.seriesIndex,Ye=Me.value!==null&&Me.value!==q.seriesIndex,Oe=zt.value.has(q.seriesIndex),Ae=q.segments.map((Ee,Re)=>{const Vt=ye,Ft=ye+Ee.value;ye=Ft;const Dl=Xt(Ft),fl=Xt(Vt),$l=Math.max(0,fl-Dl),ao=Math.min(ot.value,C/2,$l/2),Po=(we*q.segments.length+Re)*(xl.value/5),da={key:`${q.key}-${Ee.key}`,x:pe,y:Dl,width:C,height:$l,radius:ao,color:Ee.color,value:Ee.value,label:q.label,axisLabel:q.axisLabel,yLabel:q.yLabel,segmentLabel:Ee.label,seriesName:Ee.label,tooltipTitle:`${Ee.label} - ${q.label}`,categoryIndex:we,dataIndex:we,animationDelay:Po,isHighlighted:ve,isDimmed:Ye,isHidden:Oe,isRemainder:Ee.isRemainder};if(nn.value&&Ee.key===q.maxSegmentKey&&$l>0){const In=b.backgroundColor&&b.backgroundColor!=="inherit"?b.backgroundColor:Ee.color;Se={x:Ze,y:Dl+$l/2,radius:P,backgroundColor:In,borderColor:b.borderColor||"#fafafa",borderWidth:B,color:b.color||"#fafafa",fontSize:H,icon:S,animationDelay:Po}}return da});return{key:q.key,label:q.label,axisLabel:q.axisLabel,centerX:Ze,categoryWidth:r,segments:Ae,maxMarker:Se}})}),ha=e.computed(()=>{if(!(["bar"].includes(Ce.value)||_l.value))return[];const t=[],{maxX:o}=He.value,l=_l.value?F.series.filter(m=>(m.type||Ce.value)==="bar"):tn.value,r=l.length;if(dl.value){const m=o+1,C=R.value.height/m,b=C*(2/3),P=Math.min(4,b/r*.15),B=b-(r-1)*P,H=Math.max(4,B/r);l.forEach((S,q)=>{const we=F.series.findIndex(Se=>Se===S),Ze=Me.value===we,pe=Me.value!==null&&Me.value!==we,ye=zt.value.has(we);S.data.forEach((Se,ve)=>{if(Se==null||typeof Se!="number"||!isFinite(Se))return;const Ae=R.value.top+(ve+.5)*C-b/2+q*(H+P),Ee=R.value.left,Re=Math.abs(Xl(Se)-R.value.left);let Vt="";if(xe.value&&Re>0){const Ft=Math.min(Ht.value,H/2,Re/2);Vt=[`M ${Ee} ${Ae}`,`L ${Ee+Re-Ft} ${Ae}`,`Q ${Ee+Re} ${Ae} ${Ee+Re} ${Ae+Ft}`,`L ${Ee+Re} ${Ae+H-Ft}`,`Q ${Ee+Re} ${Ae+H} ${Ee+Re-Ft} ${Ae+H}`,`L ${Ee} ${Ae+H}`,"Z"].join(" ")}t.push({x:Ee,y:Ae,width:Re,height:H,color:$t(r===1?ve:we),value:Se,label:F.categories[ve]||ve.toString(),seriesName:S.name,animationDelay:(q*l.length+ve)*(xl.value/4),isHighlighted:Ze,isDimmed:pe,isHidden:ye,barPath:Vt,isSmooth:xe.value&&Re>0})})})}else{const m=o+1,C=R.value.width/m,b=C*.8,P=b/r,B=P*.05,H=P-B;l.forEach((S,q)=>{const we=F.series.findIndex(Se=>Se===S),Ze=Me.value===we,pe=Me.value!==null&&Me.value!==we,ye=zt.value.has(we);S.data.forEach((Se,ve)=>{if(Se==null||typeof Se!="number"||!isFinite(Se))return;const Ae=R.value.left+(ve+.5)*C-b/2+q*P+B/2,Ee=Xt(Math.max(0,Se)),Re=Math.abs(Xt(0)-Xt(Se));let Vt="";if(xe.value&&Re>0){const Ft=Math.min(Ht.value,H/2,Re/2);Vt=[`M ${Ae} ${Ee+Re}`,`L ${Ae} ${Ee+Ft}`,`Q ${Ae} ${Ee} ${Ae+Ft} ${Ee}`,`L ${Ae+H-Ft} ${Ee}`,`Q ${Ae+H} ${Ee} ${Ae+H} ${Ee+Ft}`,`L ${Ae+H} ${Ee+Re}`,"Z"].join(" ")}t.push({x:Ae,y:Ee,width:H,height:Re,color:$t(r===1?ve:we),value:Se,label:F.categories[ve]||ve.toString(),seriesName:S.name,animationDelay:(q*l.length+ve)*(xl.value/4),isHighlighted:Ze,isDimmed:pe,isHidden:ye,barPath:Vt,isSmooth:xe.value&&Re>0})})})}return t}),Mn=e.computed(()=>{if(!al.value)return[];const t=tn.value.map((C,b)=>({series:C,originalIndex:b})).filter(({originalIndex:C})=>!zt.value.has(C));if(t.length===0)return[];let o=Ce.value==="semi-radial"?Math.PI:-Math.PI/2;const l=Ce.value==="semi-radial"?Math.PI:Math.PI*2,r=[],m=(C,b,P,B,H,S)=>{const q=C+(b-C)/2,we=b-C,Ze=Ut.value+Math.cos(C)*sl.value,pe=Pt.value+Math.sin(C)*sl.value,ye=Ut.value+Math.cos(b)*sl.value,Se=Pt.value+Math.sin(b)*sl.value,ve=Ut.value+Math.cos(b)*gt.value,Ye=Pt.value+Math.sin(b)*gt.value,Oe=Ut.value+Math.cos(C)*gt.value,Ae=Pt.value+Math.sin(C)*gt.value,Ee=we>Math.PI?1:0,Re=[`M ${Ze} ${pe}`,`A ${sl.value} ${sl.value} 0 ${Ee} 1 ${ye} ${Se}`,`L ${ve} ${Ye}`,`A ${gt.value} ${gt.value} 0 ${Ee} 0 ${Oe} ${Ae}`,"Z"].join(" "),Vt=S||$t(P);return{path:Re,color:Vt,strokeWidth:Dt.value,strokeColor:na(r.length,Vt),value:H,seriesName:B,opacity:.8,isHighlighted:Me.value===P,isDimmed:Me.value!==null&&Me.value!==P,isHidden:!1,startAngle:C,endAngle:b,midAngle:q}};if(en.value){const{series:C,originalIndex:b}=t[0],P=Number(C?.data?.[0]??0),B=Number.isFinite(P)?Math.min(Math.max(P,0),100):0,H=U.value,S=Math.min(Math.max(Number(H?.miniRadial?.minVisiblePercent??1),0),100),we=(B<=0?S:B)/100*l,Ze=Number(H?.miniRadial?.thresholds?.low??33),pe=Number(H?.miniRadial?.thresholds?.medium??66),ye=H?.miniRadial?.colors?.low||"#E53E3E",Se=H?.miniRadial?.colors?.medium||"#ED8936",ve=H?.miniRadial?.colors?.high||"#38A169",Ye=B<=Ze?ye:B<=pe?Se:ve,Oe=H?.miniRadial?.trackColor||"#E5E7EB",Ae=C?.name||"Score";return r.push(m(o,o+l-.001,b+1,"Track",100,Oe)),r.push(m(o,o+we,b,Ae,B,Ye)),r}if(t.length===1){const{series:C,originalIndex:b}=t[0],P=C.data[0]||0,B=o,H=o+l-.001,S=B+l/2,q=Ut.value+Math.cos(B)*sl.value,we=Pt.value+Math.sin(B)*sl.value,Ze=Ut.value+Math.cos(H)*sl.value,pe=Pt.value+Math.sin(H)*sl.value,ye=Ut.value+Math.cos(H)*gt.value,Se=Pt.value+Math.sin(H)*gt.value,ve=Ut.value+Math.cos(B)*gt.value,Ye=Pt.value+Math.sin(B)*gt.value,Oe=1,Ae=[`M ${q} ${we}`,`A ${sl.value} ${sl.value} 0 ${Oe} 1 ${Ze} ${pe}`,`L ${ye} ${Se}`,`A ${gt.value} ${gt.value} 0 ${Oe} 0 ${ve} ${Ye}`,"Z"].join(" "),Ee=$t(b);return r.push({path:Ae,color:Ee,strokeWidth:Dt.value,strokeColor:na(0,Ee),value:P,seriesName:C.name,opacity:.8,isHighlighted:Me.value===b,isDimmed:!1,isHidden:!1,startAngle:B,endAngle:H,midAngle:S}),r}if(qn.value&&t.length===2){const C=t[0],b=t[1],P=Math.min(100,Math.max(0,C.series.data[0]||0)),B=P/100*l;return r.push(m(o,o+B,C.originalIndex,C.series.name,P)),r.push(m(o,o+l,b.originalIndex,b.series.name,100)),r}const f=t.reduce((C,{series:b})=>C+(b.data[0]||0),0);return f===0?[]:(t.forEach(({series:C,originalIndex:b})=>{const P=C.data[0]||0,B=P/f*l,H=o,S=o+B,q=H+B/2,we=Ut.value+Math.cos(H)*sl.value,Ze=Pt.value+Math.sin(H)*sl.value,pe=Ut.value+Math.cos(S)*sl.value,ye=Pt.value+Math.sin(S)*sl.value,Se=Ut.value+Math.cos(S)*gt.value,ve=Pt.value+Math.sin(S)*gt.value,Ye=Ut.value+Math.cos(H)*gt.value,Oe=Pt.value+Math.sin(H)*gt.value,Ae=B>Math.PI?1:0,Ee=[`M ${we} ${Ze}`,`A ${sl.value} ${sl.value} 0 ${Ae} 1 ${pe} ${ye}`,`L ${Se} ${ve}`,`A ${gt.value} ${gt.value} 0 ${Ae} 0 ${Ye} ${Oe}`,"Z"].join(" "),Re=$t(b);r.push({path:Ee,color:Re,strokeWidth:Dt.value,strokeColor:na(r.length,Re),value:P,seriesName:C.name,opacity:.8,isHighlighted:Me.value===b,isDimmed:Me.value!==null&&Me.value!==b,isHidden:!1,startAngle:H,endAngle:S,midAngle:q}),o=S}),r)}),Ra=e.computed(()=>{const t=Mn.value;return qn.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((o,l)=>({segment:o,originalIndex:l}))}),Fa=e.computed(()=>{if(!Qt.value||!al.value)return[];const t=_t.value,o=Ln.value,l=En.value,r=Zl.value,m=15,f=t*1.3,C=.55,b=(S,q)=>{const we=Ut.value+Math.cos(S.midAngle)*gt.value,Ze=Pt.value+Math.sin(S.midAngle)*gt.value,pe=Ut.value+Math.cos(S.midAngle)*(gt.value+o),ye=Pt.value+Math.sin(S.midAngle)*(gt.value+o),ve=pe+l*(q?1:-1),Ye=q?pe+m:pe-m,Oe=ye-r,Ae=`${S.seriesName}: ${_(S.value)}`,Ee=Ae.length*t*C;return{pointerStartX:we,pointerStartY:Ze,pointerEndX:pe,pointerEndY:ye,horizontalEndX:ve,horizontalEndY:ye,textX:Ye,textY:Oe,text:Ae,textWidth:Ee,textAnchor:q?"start":"end",isRightSide:q,pointerLineLength:Math.hypot(pe-we,ye-Ze),horizontalLineLength:Math.hypot(ve-pe,0)}},P=(S,q)=>{const we=Math.abs(S.textY-q.textY)<f,Ze=S.isRightSide?S.textX:S.textX-S.textWidth,pe=S.isRightSide?S.textX+S.textWidth:S.textX,ye=q.isRightSide?q.textX:q.textX-q.textWidth,Se=q.isRightSide?q.textX+q.textWidth:q.textX,ve=Ze<Se&&ye<pe;return we&&ve},B=Mn.value.filter(S=>!S.isHidden),H=[];for(let S=0;S<B.length;S++){const q=B[S];let we=Math.cos(q.midAngle)>=0;if(S>0){const pe=H[S-1],ye=b(q,we);P(pe,ye)&&(we=!we)}const Ze=b(q,we);H.push({...Ze,color:q.color,isHighlighted:q.isHighlighted,isDimmed:q.isDimmed})}return H}),Ia=t=>{if(!t||t.isHidden)return 0;const o=t.opacity||bn.value||.7;return Me.value===null||Me.value===void 0?o:Me.value!==null?t.seriesIndex===Me.value?Math.min(1,o+.1):Math.max(.5,o*.8):o},za=t=>{if(!t||t.isHidden)return 0;const o=t.radius>20?.9:.8;return Me.value!==null?t.seriesIndex===Me.value?Math.min(1,o+.1):o*.7:o},ga=(t,o)=>{if(t)try{if(Me.value===t.seriesIndex?Me.value=null:Me.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const l=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:o,chartId:F.chartId}});window.dispatchEvent(l)}}catch(l){console.error("Error in onBubbleClick:",l)}},Pa=(t,o)=>{const l=[`dss-bubble-fallback-${o}`];return t.isHighlighted&&l.push("dss-bubble-highlighted"),t.isDimmed&&l.push("dss-bubble-dimmed"),t.isHidden&&l.push("dss-bubble-hidden"),l.push(`dss-bubble-series-${t.seriesIndex}`),l.join(" ")},ya=(t,o)=>{if(!t||(o.stopPropagation(),Io.value=!0,Me.value=t.seriesIndex,nt.value.show=!1,!Pe.value))return;const l=o.target.closest(".dss-custom-chart-container");if(!l)return;const r=l.getBoundingClientRect();let m=o.clientX-r.left+10,f=o.clientY-r.top-10;const C=200,b=120;m+C>Ve.value&&(m=o.clientX-r.left-C-10),f+b>r.height&&(f=o.clientY-r.top-b-10),m<0&&(m=10),f<0&&(f=10);const P=nl.value,B=zl.value,H=P.map(S=>{const q=B[S]||S,we=ka(S,t);return we?{seriesName:t.seriesName,label:t.label,value:`${q}: ${we}`,color:t.color}:null}).filter(Boolean);kt.value={show:!0,x:m,y:f,title:t.label||t.seriesName||"",value:"",bubbleData:H,categoryIndex:void 0,spiderAreas:[]}},ka=(t,o)=>{let l;switch(t){case"x":l=o.originalX;break;case"y":l=o.originalY;break;case"size":l=o.originalSize;break;case"label":l=o.label;break;case"seriesName":l=o.seriesName;break;default:l=o[t]||""}const r=On.value[t];if(typeof r=="function")return r(l,o);if(typeof l=="number"){const m=l.toFixed(1);return z.value?m+z.value:m}return l?.toString()||""},Oa=()=>{if(!ul.value||!nt.value.data||nt.value.data.length===0)return"Bubbles";const t=[],o=new Set;return nt.value.data.forEach(l=>{if(l.seriesName&&l.label){const r=`${l.seriesName} - ${l.label}`;o.has(r)||(t.push(r),o.add(r))}else l.seriesName&&(o.has(l.seriesName)||(t.push(l.seriesName),o.add(l.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},Ca=(t,o)=>{t&&(Io.value=!1,Me.value=null,kt.value.show=!1,kt.value.bubbleData=[])},Wa=(t,o)=>{const l=o.target.closest(".dss-custom-chart-container");if(!l)return;const r=l.getBoundingClientRect(),m=mo(t.categoryIndex),f=t.description||t.comment||"";let C=o.clientX-r.left+15,b=o.clientY-r.top-10;const P=200,B=f?80:50;C+P>Ve.value&&(C=o.clientX-r.left-P-15),b+B>re.value&&(b=o.clientY-r.top-B-10),C<0&&(C=10),b<0&&(b=10),Ml.value={show:!0,x:C,y:b,categoryValue:m,description:f}},qa=()=>{Ml.value.show=!1},oo=e.computed(()=>F.categories.length||Math.max(...a.value.map(t=>t.data.length))),Za=e.computed(()=>{let t=0;return a.value.forEach(o=>{o.data.forEach(l=>{typeof l=="number"&&(t=Math.max(t,l))})}),t||100}),ba=e.computed(()=>{const t=[],o=oo.value;for(let l=0;l<o;l++){const r=l*2*Math.PI/o-Math.PI/2,m=Ut.value+Math.cos(r)*gt.value,f=Pt.value+Math.sin(r)*gt.value;t.push({x:m,y:f,angle:r,index:l})}return t}),Ua=e.computed(()=>{const t=[],o=oo.value;return ba.value.forEach((l,r)=>{const m=gt.value+15,f=r*2*Math.PI/o-Math.PI/2,C=Ut.value+Math.cos(f)*m,b=Pt.value+Math.sin(f)*m+5;let P="middle",B="middle";Math.abs(Math.cos(f))>.5&&(P=Math.cos(f)>0?"start":"end"),Math.abs(Math.sin(f))>.5&&(B=Math.sin(f)>0?"hanging":"auto"),t.push({x:C,y:b,text:F.categories[r]||`Axis ${r+1}`,anchor:P,baseline:B})}),t}),Xa=e.ref(new Set),Ya=(t,o,l)=>{const r=`current-${l}`,m=Xa.value.has(r),f=o.fillOpacity??Hl.value;return!m&&Me.value===null?f:o.isHighlighted||m?o.isComparison?f:f+.15:o.isDimmed?f*.3:f},xa=e.computed(()=>{if(!Bl.value)return[];const t=[],o=oo.value;return tn.value.map((r,m)=>({series:r,seriesIndex:m})).sort((r,m)=>{const f=i(r.series)?0:1,C=i(m.series)?0:1;return f-C}).forEach(({series:r,seriesIndex:m})=>{const f=i(r),C=[],b=[],P=[],B=Me.value===m,H=Me.value!==null&&Me.value!==m,S=zt.value.has(m);for(let q=0;q<o;q++){const we=r.data[q]||0,pe=we/Za.value*gt.value,ye=q*2*Math.PI/o-Math.PI/2,Se=Ut.value+Math.cos(ye)*pe,ve=Pt.value+Math.sin(ye)*pe;C.push(`${Se},${ve}`),b.push({x:Se,y:ve}),P.push({x:Se,y:ve,value:we,label:F.categories[q]||`Axis ${q+1}`,seriesName:r.name})}t.push({points:C.join(" "),polygonPoints:b,dataPoints:P,color:u(r,m),fillOpacity:f?c.value.fillOpacity:Hl.value,strokeDasharray:f?s(r)||c.value.strokeDasharray:null,pointRadius:d(r,f),seriesName:r.name,value:`${r.name}: ${r.data.join(", ")}`,isHighlighted:B,isDimmed:H,isHidden:S,isComparison:f,seriesIndex:m})}),t}),ja=(t,o)=>{if(!o||o.length<3)return!1;let l=!1;for(let r=0,m=o.length-1;r<o.length;m=r++){const f=o[r].x,C=o[r].y,b=o[m].x,P=o[m].y;C>t.y!=P>t.y&&t.x<(b-f)*(t.y-C)/(P-C)+f&&(l=!l)}return l},Ka=t=>{if(!Bl.value)return;const o=t.currentTarget.closest(".dss-custom-chart-container");if(!o)return;const l=o.getBoundingClientRect(),r=L.value?.getBoundingClientRect();if(!r)return;const m=t.clientX-r.left,f=t.clientY-r.top,C=xa.value.filter(b=>b.isHidden?!1:ja({x:m,y:f},b.polygonPoints));if(C.length>0){C.length,Me.value=C[0].seriesIndex;const b=t.clientX-l.left+10,P=t.clientY-l.top-10,B=C.length>1?460:260,H=70+oo.value*20;let S=b,q=P;S+B>Ve.value&&(S=t.clientX-l.left-B-10),q+H>re.value&&(q=t.clientY-l.top-H-10),S<0&&(S=10),q<0&&(q=10);const we=C.map(Ze=>({seriesName:Ze.seriesName,color:Ze.color,points:Ze.dataPoints.map(pe=>({label:pe.label,value:_(pe.value)}))}));kt.value={show:!0,x:S,y:q,title:"",value:"",bubbleData:[],spiderAreas:we}}else un()},Fo=e.computed(()=>{const t=U.value;return t.logos.map((o,l)=>{const r=F.series[o.seriesIndex];if(!r||!r.data||r.data.length===0||zt.value.has(o.seriesIndex))return null;let m,f;if(ol.value){let b=-1,P=null;for(let H=r.data.length-1;H>=0;H--)if(r.data[H]!==null&&r.data[H]!==void 0){b=H,P=r.data[H];break}if(b===-1||P===null)return null;const B=r.data.map((H,S)=>H==null?null:{x:vt(S),y:gl(r,H),index:S}).filter(H=>H!==null);if(t.animations.enabled&&!$n.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(Ot.value.isAnimating||!Ot.value.hasAnimated))if(Ot.value.isAnimating){const H=Ot.value.currentFrame/Ot.value.totalFrames,S=ca(t.animations.easing,Math.min(H,1)),q=as(B,S);m=q.x+(o.offsetX||0),f=q.y+(o.offsetY||0)}else m=B[0].x+(o.offsetX||0),f=B[0].y+(o.offsetY||0);else m=vt(b)+(o.offsetX||0),f=Xt(P)+(o.offsetY||0)}else if(al.value||Bl.value){const b=Math.PI*2/t.logos.length*l;m=Ut.value+Math.cos(b)*(gt.value+30)+(o.offsetX||0),f=Pt.value+Math.sin(b)*(gt.value+30)+(o.offsetY||0)}return{...o,x:m,y:f,seriesIndex:o.seriesIndex}}).filter(Boolean)}),Ga=t=>{const o=document.querySelector(`.dss-logo-fallback-${t}`),l=document.querySelector(`.dss-logo-image-${t}`);o&&(o.style.opacity="0"),l&&(l.style.opacity="1")},Qa=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const o=document.querySelector(`.dss-logo-image-${t}`);o&&(o.style.display="none")},ra=t=>{zt.value.has(t)?zt.value.delete(t):zt.value.add(t)},Ja=e.computed(()=>{if(!kt.value.show&&!(Xe.value&&nt.value.show&&!ie.value.isZooming))return{display:"none"};let t,o;if(Xe.value&&nt.value.show&&!ie.value.isZooming){t=nt.value.x+15,o=R.value.top;const l=ul.value?200:150;t+l>Ve.value&&(t=nt.value.x-l-15),t<0&&(t=10),o<10&&(o=10)}else t=kt.value.x,o=kt.value.y;return{left:t+"px",top:o+"px"}}),_n=(t,o)=>{if(!Pe.value||go.value)return;const r=o.target.closest(".dss-custom-chart-container").getBoundingClientRect();let m=o.clientX-r.left+10,f=o.clientY-r.top-10;const C=200,b=120,P=Ve.value,B=re.value;m+C>P&&(m=o.clientX-r.left-C-10),f+b>B&&(f=o.clientY-r.top-b-10),m<0&&(m=10),f<0&&(f=10);let H;typeof t.categoryIndex=="number"?H=t.categoryIndex:typeof t.dataIndex=="number"?H=t.dataIndex:t.label&&F.categories.includes(t.label)&&(H=F.categories.indexOf(t.label));let S=t.seriesName||t.label||"";(dl.value||Ce.value==="bar")&&t.label&&(S=t.label),t.tooltipTitle&&(S=t.tooltipTitle),kt.value={show:!0,x:m,y:f,title:S,value:_(t.value)||"",categoryIndex:H,spiderAreas:[]}},ia=e.ref(!1),Io=e.ref(!1),un=()=>{kt.value.show=!1,kt.value.spiderAreas=[],kt.value.bubbleData=[],nt.value.show=!1,ia.value||(Me.value=null)},go=e.ref(!1),yo=(t,o)=>{go.value=!0,kt.value.show=!1,nt.value.show=!1;const r=o.target.closest(".dss-custom-chart-container").getBoundingClientRect();let m=o.clientX-r.left+15,f=o.clientY-r.top-10;const C=250;m+C>Ve.value&&(m=o.clientX-r.left-C-15),m<0&&(m=10),f<0&&(f=10),Dn.value={show:!0,x:m,y:f,content:t.texts,count:t.totalCount}},ko=()=>{go.value=!1,Dn.value.show=!1},Ot=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),ca=(t,o)=>{switch(t){case"linear":return o;case"ease":return o<.5?2*o*o:-1+(4-2*o)*o;case"ease-in":return o*o;case"ease-out":return o*(2-o);case"ease-in-out":return o<.5?2*o*o:-1+(4-2*o)*o;default:return o}},$n=e.computed(()=>dn.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),wa=()=>{if(!Vl.value||$n.value){Ot.value.hasAnimated=!0,an.value&&(Rl.value=1);return}an.value&&(Rl.value=0),Ot.value.isAnimating=!0,Ot.value.currentFrame=0,Ot.value.totalFrames=Math.ceil(tl.value/16.67);const t=()=>{const o=Ot.value.currentFrame/Ot.value.totalFrames,l=ca(on.value,Math.min(o,1));es(l),an.value&&(Rl.value=l),o<1?(Ot.value.currentFrame++,Ot.value.animationId=requestAnimationFrame(t)):ts()};Ot.value.animationId=requestAnimationFrame(t)},es=t=>{const o=O.value;o&&o.style.setProperty("--dss-animation-progress",t)},ts=()=>{Ot.value.isAnimating=!1,Ot.value.hasAnimated=!0,an.value&&(Rl.value=1),Ot.value.animationId&&(cancelAnimationFrame(Ot.value.animationId),Ot.value.animationId=null)},ua=e.computed(()=>!al.value||Ot.value.hasAnimated?!0:an.value?Rl.value>=1:Cn.value?Fn.value>=1:!0),Ea=e.computed(()=>Qt.value&&ua.value),zo=e.ref(!1);e.watch(Ea,t=>{t?(zo.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{zo.value=!0})})):zo.value=!1},{immediate:!0});const ls=e.computed(()=>{if(!Vl.value||$n.value||Ot.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${tl.value}ms`,t["--dss-animation-easing"]=ns(on.value),t["--dss-stagger-delay"]=`${xl.value}ms`,t}),ns=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",os=()=>{if(!Vl.value||$n.value)return"";const t=["dss-chart-animated"];return Ot.value.hasAnimated||t.push(`dss-animate-${Nl.value}`),Ot.value.hasAnimated||(al.value&&Ce.value!=="semi-radial"?t.push("dss-animate-fill"):al.value||t.push(`dss-animate-${Nl.value}`)),Ot.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>F.series,(t,o)=>{Fl.value&&o&&Ot.value.hasAnimated&&(Ot.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>wa(),jl.value)}))},{deep:!0}),e.watch(()=>ie.value.isZooming,(t,o)=>{o&&!t&&setTimeout(()=>{bo()},50)}),e.watch(()=>[ie.value.scale,ie.value.offsetX],()=>{!ie.value.isZooming&&!ie.value.isDragging&&bo()},{flush:"post"}),e.watch([Zt,Ue],([t,o])=>{ie.value.minScale=t,ie.value.maxScale=o,(ie.value.scale<t||ie.value.scale>o)&&Bn()},{immediate:!0}),e.watch(()=>F.locale,t=>{t&&t!==V.value&&(V.value=t)},{immediate:!0}),e.watch(()=>ft.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",Kn)}):document.removeEventListener("click",Kn)}),e.onMounted(()=>{Me.value=null,an.value&&(!Vl.value||$n.value)&&(Rl.value=1),Eo(),O.value&&typeof ResizeObserver<"u"&&(v=new ResizeObserver(t=>{const o=t[0];!o||!o.contentRect||(be&&cancelAnimationFrame(be),be=requestAnimationFrame(()=>{be=null;const{width:l,height:r}=o.contentRect;rt.value=Math.round(l),ee.value=Math.round(r),fe.value&&(Le.value=fe.value.offsetHeight||ke)}))}),v.observe(O.value)),Vl.value&&!$n.value?Ce.value==="semi-radial"?setTimeout(()=>Jn(),jl.value):setTimeout(()=>wa(),jl.value):(Ot.value.hasAnimated=!0,Ce.value==="semi-radial"&&(Fn.value=1)),document.addEventListener("mousemove",Sa),document.addEventListener("mouseup",Va),document.addEventListener("click",Vo)}),e.onUnmounted(()=>{be&&cancelAnimationFrame(be),v&&O.value&&(v.unobserve(O.value),v.disconnect(),v=null),Ot.value.animationId&&cancelAnimationFrame(Ot.value.animationId),Un&&(cancelAnimationFrame(Un),Un=null),ie.value.zoomTimeout&&clearTimeout(ie.value.zoomTimeout),document.removeEventListener("mousemove",Sa),document.removeEventListener("mouseup",Va),document.removeEventListener("click",Vo),document.removeEventListener("click",Kn)});const Sa=t=>{if(ie.value.isDragging&&ie.value.scale>1&&ol.value){nt.value.show=!1;const o=t.clientX-ie.value.lastMouseX,{minX:l,maxX:r}=He.value,m=r-l||1,C=o*.8;ie.value.offsetX+=C;const b=m/ie.value.scale,P=m-b,B=0,H=-P/m*R.value.width,S=B;ie.value.offsetX=Math.max(H,Math.min(S,ie.value.offsetX)),ie.value.lastMouseX=t.clientX,ie.value.lastMouseY=t.clientY}},Va=()=>{ie.value.isDragging&&(ie.value.isDragging=!1,setTimeout(()=>{!ie.value.isDragging&&ie.value.isZooming},100))},as=(t,o)=>{const l=t.filter(b=>b!=null);if(!l||l.length===0)return{x:0,y:0};if(l.length===1||o<=0)return l[0];if(o>=1)return l[l.length-1];let r=0;const m=[];for(let b=1;b<l.length;b++){const P=l[b].x-l[b-1].x,B=l[b].y-l[b-1].y,H=Math.sqrt(P*P+B*B);m.push(H),r+=H}const f=r*o;let C=0;for(let b=0;b<m.length;b++){const P=C+m[b];if(f<=P){const B=(f-C)/m[b],H=l[b],S=l[b+1];return{x:H.x+(S.x-H.x)*B,y:H.y+(S.y-H.y)*B}}C=P}return l[l.length-1]};return(t,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[os(),{"dss-chart-fill-width":ze.value,"dss-chart-fill-height":qe.value,"dss-chart-compact":al.value&&!W.value}]]),style:e.normalizeStyle({width:ze.value?"100%":Ve.value+"px",height:Qe.value,...ze.value||qe.value?{overflow:al.value?"visible":"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...ls.value,cursor:cl()}),"data-chart-type":Ce.value,ref_key:"containerEl",ref:O,onWheel:rn,onMousedown:yn,onMousemove:Z,onMouseup:Nn,onMouseleave:he,onDblclick:Bn,onContextmenu:e.withModifiers(at,["prevent"]),onClick:e.withModifiers(Bt,["left"]),onWheelCapture:rn},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:fe},[e.createElementVNode("div",tr,[ut.value?(e.openBlock(),e.createElementBlock("div",lr,e.toDisplayString(ut.value),1)):e.createCommentVNode("",!0),ht.value?(e.openBlock(),e.createElementBlock("div",nr,e.toDisplayString(ht.value),1)):e.createCommentVNode("",!0)]),W.value&&G.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Ne.value==="horizontal","dss-legend-vertical":Ne.value==="vertical","dss-legend-top":G.value==="top","dss-legend-bottom":G.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":zt.value.has(r),"dss-legend-hovered":Me.value===r,"dss-legend-dimmed":Me.value!==null&&Me.value!==r}]),onClick:m=>ra(r),onMouseenter:m=>g(r),onMouseleave:w,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":Bl.value&&i(l)}]),style:e.normalizeStyle({backgroundColor:Bl.value&&i(l)?"transparent":p(l,r),borderColor:p(l,r)})},null,6),e.createElementVNode("span",ar,e.toDisplayString(l.name),1)],46,or))),128))],2)):e.createCommentVNode("",!0),W.value&&(G.value==="left"||G.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":G.value==="left","dss-legend-right":G.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":zt.value.has(r),"dss-legend-hovered":Me.value===r,"dss-legend-dimmed":Me.value!==null&&Me.value!==r}]),onClick:m=>ra(r),onMouseenter:m=>g(r),onMouseleave:w,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":Bl.value&&i(l)}]),style:e.normalizeStyle({backgroundColor:Bl.value&&i(l)?"transparent":p(l,r),borderColor:p(l,r)})},null,6),e.createElementVNode("span",rr,e.toDisplayString(l.name),1)],46,sr))),128))],2)):e.createCommentVNode("",!0)],512),E.showAddMarkerButton&&ql.value&&rl.value.addMarker&&(ol.value||ul.value)&&!Ol.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Qo,title:e.unref($)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Kl.value,class:"dss-add-marker-button-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,cr),o[4]||(o[4]=e.createElementVNode("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 4V16M4 10H16",stroke:"hsl(60, 2%, 47%)","stroke-width":"2","stroke-linecap":"round"})],-1))],8,ir)):e.createCommentVNode("",!0),e.createElementVNode("div",ur,[ul.value&&dt.value?(e.openBlock(),e.createElementBlock("div",dr,"Bubble size: "+e.toDisplayString(dt.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Ve.value,height:re.value,class:"dss-chart-svg","data-smooth":xe.value,"data-animated":Vl.value,ref_key:"svgEl",ref:L},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:Y.value},[e.createElementVNode("rect",{x:0,y:R.value.top,width:Ve.value,height:R.value.height*4},null,8,fr)],8,pr),Cn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:Wn.value},[e.createElementVNode("path",{d:Bo.value},null,8,hr)],8,vr)):e.createCommentVNode("",!0),an.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:Qn.value},[e.createElementVNode("path",{d:Jo.value},null,8,yr)],8,gr)):e.createCommentVNode("",!0)]),ol.value||ul.value?(e.openBlock(),e.createElementBlock("g",kr,[ge.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":me.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($o.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${r}`,x1:R.value.left,x2:R.value.right,y1:l.y,y2:l.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${r*50}ms`})},null,12,br))),128))],8,Cr)):e.createCommentVNode("",!0),Ol.value&&Lo.value.length?(e.openBlock(),e.createElementBlock("g",{key:1,class:"dss-stepbar-axis-bars","clip-path":me.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Lo.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`stepbar-axis-bar-${r}`,x1:R.value.left,x2:R.value.right,y1:l.y,y2:l.y,stroke:St.value,"stroke-width":It.value,"stroke-dasharray":Nt.value,opacity:At.value},null,8,wr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ao.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`stepbar-vertical-axis-bar-${r}`,x1:l.x,x2:l.x,y1:R.value.top,y2:R.value.bottom,stroke:St.value,"stroke-width":It.value,"stroke-dasharray":Nt.value,opacity:At.value*.7},null,8,Er))),128))],8,xr)):e.createCommentVNode("",!0),e.createElementVNode("g",Sr,[e.createElementVNode("line",{x1:R.value.left,x2:R.value.right,y1:R.value.bottom,y2:R.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Vr),e.createElementVNode("line",{x1:R.value.left,x2:R.value.left,y1:R.value.top,y2:R.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Nr),D.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:R.value.right,x2:R.value.right,y1:R.value.top,y2:R.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Br)):e.createCommentVNode("",!0)]),e.createElementVNode("g",Mr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(To.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${r}`,x:l.x,y:l.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${r*100}ms`})},e.toDisplayString(l.text),13,_r))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(no.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${r}`,x:l.x,y:l.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${r*80}ms`})},e.toDisplayString(l.text),13,$r))),128)),D.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(cn.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{key:`y-secondary-${r}`,x:l.x,y:l.y,"text-anchor":"start","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${r*80}ms`})},e.toDisplayString(l.text),13,Lr))),128)):e.createCommentVNode("",!0),Wt.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:R.value.left+R.value.width/2,y:R.value.bottom+45,"text-anchor":"middle","font-size":"14",fill:"#666"},e.toDisplayString(Wt.value),9,Ar)):e.createCommentVNode("",!0),qt.value?(e.openBlock(),e.createElementBlock("text",{key:2,x:15,y:R.value.top+12+R.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(-90, 15, ${R.value.top+R.value.height/2})`},e.toDisplayString(qt.value),9,Tr)):e.createCommentVNode("",!0),D.value&&wt.value?(e.openBlock(),e.createElementBlock("text",{key:3,x:Ve.value-15,y:R.value.top+12+R.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(90, ${Ve.value-15}, ${R.value.top+R.value.height/2})`},e.toDisplayString(wt.value),9,Dr)):e.createCommentVNode("",!0)]),Jt.value.length>0?(e.openBlock(),e.createElementBlock("g",Hr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Jt.value,l=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${l.categoryIndex}`},[e.createElementVNode("g",{"clip-path":me.value},[l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:l.x,x2:l.x,y1:R.value.bottom,y2:R.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>yo(l,r),onMouseleave:ko},null,40,Fr)):e.createCommentVNode("",!0),l.hasAuto&&!l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:l.x,x2:l.x,y1:R.value.bottom,y2:R.value.top,stroke:"#a1d499","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>yo(l,r),onMouseleave:ko},null,40,Ir)):e.createCommentVNode("",!0),l.hasAuto&&l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:l.x,x2:l.x,y1:R.value.bottom,y2:R.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>yo(l,r),onMouseleave:ko},null,40,zr)):e.createCommentVNode("",!0)],8,Rr),l.hasManual&&l.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x+8,cy:Math.max(15,R.value.top-10),r:"14",fill:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:r=>yo(l,r),onMouseleave:ko},null,40,Pr)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:l.x,cy:Math.max(15,R.value.top-10),r:"14",fill:l.hasManual&&l.hasAuto||l.hasManual?"#698dbe":"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:r=>yo(l,r),onMouseleave:ko},null,40,Or),e.createElementVNode("text",{x:l.x,y:Math.max(15,R.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(l.totalCount),9,Wr)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":me.value},[_l.value?(e.openBlock(),e.createElementBlock("g",Zr,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":dl.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ha.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${r}`},[l.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:l.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({fill:l.color,fillOpacity:l.isDimmed?.4:1,animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>_n(l,m),onMouseleave:un},null,46,Ur)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x,y:l.y,width:l.width,height:l.height,fill:l.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>_n(l,m),onMouseleave:un},null,46,Xr))],64))),128))],2),e.createElementVNode("g",Yr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fa.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?We.value+2:We.value,"stroke-dasharray":l.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,jr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(va.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?We.value+2:We.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:l.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Kr))),128)),Lt.value>0||ne.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Ha.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${r}`,cx:l.x,cy:l.y,r:K(l.isHighlighted?j(l,Lt.value)+2:j(l,Lt.value)),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>_n(l,m),onMouseleave:un},null,46,Gr))),128)):e.createCommentVNode("",!0)])])):Ce.value==="line"?(e.openBlock(),e.createElementBlock("g",Qr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ta.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${r}`,d:l.path,stroke:l.color,"stroke-width":We.value,"stroke-dasharray":l.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":Ot.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,Jr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fa.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?We.value+2:We.value,"stroke-dasharray":l.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,ei))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(va.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?We.value+2:We.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:l.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,ti))),128)),Lt.value>0||ne.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Da.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${r}`,cx:l.x,cy:l.y,r:K(l.isHighlighted?j(l,Lt.value)+2:j(l,Lt.value)),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>_n(l,m),onMouseleave:un},null,46,li))),128)):e.createCommentVNode("",!0)])):Ce.value==="area"?(e.openBlock(),e.createElementBlock("g",ni,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(aa.value,(l,r)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${r}`,id:`area-mask-${r}-${E.chartId}`},[e.createElementVNode("rect",{x:R.value.left-10,y:R.value.top-10,width:R.value.width+20,height:R.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${R.value.width+20}px`})},null,12,ai)],8,oi))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(aa.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${r}`,d:l.areaPath,fill:l.color,"fill-opacity":l.isHighlighted?de.value+.2:de.value,mask:`url(#area-mask-${r}-${E.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden})},null,10,si))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(aa.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${r}`,d:l.linePath,stroke:l.color,"stroke-width":l.isHighlighted?We.value+1:We.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${r*xl.value}ms`})},null,14,ri))),128))])):Ce.value==="stepbar"?(e.openBlock(),e.createElementBlock("g",ii,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(sa.value,l=>(e.openBlock(),e.createElementBlock("g",{key:l.key,class:"dss-stepbar-column"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.segments,r=>(e.openBlock(),e.createElementBlock("rect",{key:r.key,x:r.x,y:r.y,width:r.width,height:r.height,rx:r.radius,ry:r.radius,fill:r.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":r.isHighlighted,"dss-bar-dimmed":r.isDimmed,"dss-bar-hidden":r.isHidden}),style:e.normalizeStyle({fillOpacity:r.isDimmed?.4:1,animationDelay:`${r.animationDelay}ms`}),onMouseover:m=>_n(r,m),onMouseleave:un},null,46,ci))),128)),l.maxMarker?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-stepbar-marker",transform:`translate(${l.maxMarker.x}, ${l.maxMarker.y})`,style:e.normalizeStyle({animationDelay:`${l.maxMarker.animationDelay}ms`})},[e.createElementVNode("circle",{r:l.maxMarker.radius,fill:l.maxMarker.backgroundColor,stroke:l.maxMarker.borderColor,"stroke-width":l.maxMarker.borderWidth},null,8,di),l.maxMarker.icon?(e.openBlock(),e.createElementBlock("text",{key:0,x:"0",y:"0","text-anchor":"middle","dominant-baseline":"central","font-size":l.maxMarker.fontSize,"font-weight":"700",fill:l.maxMarker.color},e.toDisplayString(l.maxMarker.icon),9,mi)):e.createCommentVNode("",!0)],12,ui)):e.createCommentVNode("",!0)]))),128))])):Ce.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:4,class:e.normalizeClass({"dss-horizontal-bars":dl.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ha.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${r}`},[l.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:l.barPath,fill:l.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>_n(l,m),onMouseleave:un},null,46,pi)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x,y:l.y,width:l.width,height:l.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({fill:l.color,fillOpacity:l.isDimmed?.4:1,animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>_n(l,m),onMouseleave:un},null,46,fi))],64))),128))],2)):e.createCommentVNode("",!0)],8,qr),Xe.value&&nt.value.show&&!ie.value.isZooming?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-crosshair","clip-path":me.value},[e.createElementVNode("line",{x1:nt.value.x,x2:nt.value.x,y1:R.value.top,y2:R.value.bottom,stroke:Et.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,hi),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(nt.value.data,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${r}`,cx:nt.value.x,cy:l.y,r:K(Lt.value+2),fill:l.color,stroke:"none",opacity:"0.9"},null,8,gi))),128))],8,vi)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),ul.value?(e.openBlock(),e.createElementBlock("g",yi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ro.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${r}`},[l?(e.openBlock(),e.createElementBlock("g",ki,[e.createElementVNode("circle",{cx:l.x,cy:l.y,r:K(l.radius),fill:l.color,"fill-opacity":Ia(l),stroke:l.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(Pa(l,r)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:m=>ya(l,m),onMouseleave:m=>Ca(l),onClick:m=>ga(l,m)},null,42,Ci),l.imageUrl?(e.openBlock(),e.createElementBlock("image",{key:0,x:l.x-l.radius*.65,y:l.y-l.radius*.65,width:l.radius*1.3,height:l.radius*1.3,"xlink:href":l.imageUrl,class:e.normalizeClass(`dss-bubble-image-${r} ${l.isHighlighted?"dss-bubble-highlighted":""} ${l.isDimmed?"dss-bubble-dimmed":""} ${l.isHidden?"dss-bubble-hidden":""}`),"clip-path":`circle(${l.radius*.65}px at ${l.radius*.65}px ${l.radius*.65}px)`,style:e.normalizeStyle({cursor:"pointer",transition:"all 0.3s ease",opacity:za(l)}),onLoad:m=>la(r),onError:m=>_o(r),onMouseenter:m=>ya(l,m),onMouseleave:m=>Ca(l),onClick:m=>ga(l,m)},null,46,bi)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),al.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:No.value},[Ce.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Ut.value,cy:Pt.value,r:gt.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,wi)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":Ce.value,"clip-path":ea.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ra.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${l.originalIndex}-${r}`,d:l.segment.path,fill:l.segment.color,"fill-opacity":l.segment.isHighlighted?(l.segment.opacity||.8)+.2:l.segment.opacity||.8,stroke:l.segment.strokeWidth?l.segment.strokeColor||l.segment.color:"none","stroke-width":l.segment.strokeWidth||0,"clip-path":Zn(l.originalIndex),class:e.normalizeClass({"dss-series-highlighted":l.segment.isHighlighted,"dss-series-dimmed":l.segment.isDimmed,"dss-series-hidden":l.segment.isHidden}),onMouseover:m=>_n(l.segment,m),onMouseleave:un},null,42,Si))),128))],8,Ei),vn.value&&ua.value?(e.openBlock(),e.createElementBlock("g",Vi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ql.value,(l,r)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${r}`,x:l.x,y:l.y,"text-anchor":"middle","dominant-baseline":"middle",class:"dss-radial-segment-data-label",style:e.normalizeStyle({fill:l.contrastColor})},e.toDisplayString(l.value),13,Ni)),[[e.vShow,l.show]])),128))])):e.createCommentVNode("",!0),An.value&&(ua.value||Cn.value||en.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:ll.value.x,y:ll.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":Gl.value,fill:Xn.value,class:"dss-radial-data-center"},e.toDisplayString(Tn.value),9,Bi)):e.createCommentVNode("",!0),Ea.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":zo.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fa.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${r}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":l.isHighlighted,"dss-label-dimmed":l.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${r*.08}s`})},[e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-pointer",x1:l.pointerStartX,y1:l.pointerStartY,x2:l.pointerEndX,y2:l.pointerEndY,stroke:l.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":l.pointerLineLength})},null,12,Mi),e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-horizontal",x1:l.pointerEndX,y1:l.pointerEndY,x2:l.horizontalEndX,y2:l.horizontalEndY,stroke:l.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":l.horizontalLineLength})},null,12,_i),e.createElementVNode("text",{class:"dss-radial-label-text",x:l.textX,y:l.textY,"text-anchor":l.textAnchor,"font-size":_t.value,"dominant-baseline":"middle"},e.toDisplayString(l.text),9,$i)],6))),128))],2)):e.createCommentVNode("",!0)],8,xi)):e.createCommentVNode("",!0),Bl.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:No.value},[ge.value?(e.openBlock(),e.createElementBlock("g",Ai,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mn.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${r}`,cx:Ut.value,cy:Pt.value,r:K(l),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*150}ms`})},null,12,Ti))),128)),e.createElementVNode("g",Di,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mn.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${r}`},[e.createElementVNode("rect",{x:Ut.value-16,y:Pt.value-l-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,Hi),e.createElementVNode("text",{x:Ut.value,y:Pt.value-l+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(pn(r)),9,Ri)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ba.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${r}`,x1:Ut.value,x2:l.x,y1:Pt.value,y2:l.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*100}ms`})},null,12,Fi))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Ii,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ua.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${r}`,x:l.x+Math.cos(r*2*Math.PI/oo.value-Math.PI/2)*16,y:l.y+Math.sin(r*2*Math.PI/oo.value-Math.PI/2)*16,"text-anchor":l.anchor,"dominant-baseline":l.baseline,"font-size":"14px",fill:"#666","font-weight":"500",style:e.normalizeStyle({animationDelay:`${r*120}ms`})},e.toDisplayString(l.text.charAt(0).toUpperCase()+l.text.slice(1)),13,zi))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:Ka,onMouseleave:un},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xa.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${r}`},[e.createElementVNode("polygon",{points:l.points,fill:l.color,"fill-opacity":Ya("current",l,r),stroke:l.color,"stroke-width":l.isHighlighted?We.value+1:We.value,"stroke-dasharray":l.strokeDasharray||void 0,"stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${r*xl.value}ms`,transition:"all 0.2s ease"})},null,14,Pi),l.pointRadius>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(l.dataPoints,(m,f)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${r}-${f}`,cx:m.x,cy:m.y,r:K(l.isHighlighted?l.pointRadius+1:l.pointRadius),fill:l.isComparison?"none":l.color,stroke:l.isComparison?l.color:"none","stroke-width":l.isComparison?2:0,class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${r*xl.value+f*50}ms`,transition:"all 0.2s ease"}),onMouseover:C=>_n(m,C),onMouseleave:un},null,46,Oi))),128)):e.createCommentVNode("",!0)]))),128))],32)],8,Li)):e.createCommentVNode("",!0),e.createElementVNode("g",Wi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fo.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${r}`,cx:l.x,cy:l.y,r:K(l.width/2),fill:$t(l.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${r}`),style:e.normalizeStyle({animationDelay:`${r*200}ms`})},null,14,qi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fo.value,(l,r)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${r}`,x:l.x-l.width/2,y:l.y-l.height/2,width:l.width,height:l.height,"xlink:href":l.url,onLoad:m=>Ga(r),onError:m=>Qa(r),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${r}`),"clip-path":`circle(${l.width/2}px at ${l.width/2}px ${l.height/2}px)`,style:e.normalizeStyle({animationDelay:`${r*200}ms`})},null,46,Zi))),128))])],8,mr))]),ct.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:Ve.value+"px",height:re.value+"px",backgroundImage:`url('${fn.value}')`,backgroundRepeat:"no-repeat",...Gt.value,opacity:lt.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pt.value,(l,r)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:"marker-"+l.id,class:"dss-chart-marker",style:e.normalizeStyle({position:"absolute",left:l.x+"px",top:l.y+"px",width:T.value+"px",height:T.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(m=>jo(l),["stop"]),onMouseenter:m=>Wa(l,m),onMouseleave:qa},[e.createElementVNode("img",{src:gn(l),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Xi)],44,Ui)),[[e.vShow,le.value]])),128)),Ml.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:Ml.value.x+"px",top:Ml.value.y+"px"})},[e.createElementVNode("div",Yi,e.toDisplayString(Ml.value.categoryValue),1),Ml.value.description?(e.openBlock(),e.createElementBlock("div",ji,e.toDisplayString(Ml.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Pe.value&&(kt.value.show||Xe.value&&nt.value.show&&!ie.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":Xe.value&&nt.value.show&&!ie.value.isZooming,"dss-spider-tooltip":Bl.value&&kt.value.spiderAreas&&kt.value.spiderAreas.length>0}]),style:e.normalizeStyle(Ja.value)},[!Xe.value||!nt.value.show||ie.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Bl.value&&kt.value.spiderAreas&&kt.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",Ki,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kt.value.spiderAreas,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-area-${r}`,class:"dss-spider-tooltip-area"},[e.createElementVNode("div",Gi,[e.createElementVNode("span",{class:"dss-spider-tooltip-area-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createTextVNode(" "+e.toDisplayString(l.seriesName),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.points,(m,f)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-point-${r}-${f}`,class:"dss-tooltip-series"},[e.createElementVNode("span",Qi,e.toDisplayString(m.label),1),e.createElementVNode("span",Ji,e.toDisplayString(m.value),1)]))),128))]))),128))])):ul.value&&kt.value.bubbleData&&kt.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",ec,[kt.value.title?(e.openBlock(),e.createElementBlock("div",tc,e.toDisplayString(kt.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",lc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kt.value.bubbleData,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${r}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(l.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",nc,[e.createElementVNode("div",oc,e.toDisplayString(kt.value.title),1),e.createElementVNode("div",ac,e.toDisplayString(kt.value.value),1)])),kt.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[Rt(kt.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",sc,[o[5]||(o[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",rc,e.toDisplayString(e.unref($)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rt(kt.value.categoryIndex).flagGroups,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${r}`},[e.createElementVNode("div",ic,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(l.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.flags,(m,f)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${r}-${f}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",cc,[e.createElementVNode("div",uc,e.toDisplayString(m.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Rt(kt.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",dc,[o[6]||(o[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",mc,e.toDisplayString(e.unref($)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rt(kt.value.categoryIndex).markers,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${r}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("div",pc,[e.createElementVNode("div",fc,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",vc,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",hc,[e.createElementVNode("div",gc,e.toDisplayString(ul.value?Oa():E.categories[nt.value.categoryIndex]||`Category ${nt.value.categoryIndex+1}`),1),ul.value?(e.openBlock(),e.createElementBlock("div",yc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(nt.value.data,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${r}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(l.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(nt.value.data,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${r}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",kc,e.toDisplayString(l.seriesName)+":",1),e.createElementVNode("span",Cc,e.toDisplayString(_(l.value)),1)]))),128))]),Rt(nt.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",bc,[o[7]||(o[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",xc,e.toDisplayString(e.unref($)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rt(nt.value.categoryIndex).flagGroups,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${r}`},[e.createElementVNode("div",wc,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(l.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.flags,(m,f)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${r}-${f}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Ec,[e.createElementVNode("div",Sc,e.toDisplayString(m.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Rt(nt.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Vc,[o[8]||(o[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Nc,e.toDisplayString(e.unref($)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rt(nt.value.categoryIndex).markers,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${r}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("div",Bc,[e.createElementVNode("div",Mc,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",_c,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),ol.value&&Ge.value&&ie.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Bn},[o[9]||(o[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(ie.value.scale*100))+"% "+e.toDisplayString(e.unref($)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,er),W.value&&G.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Ne.value==="horizontal","dss-legend-vertical":Ne.value==="vertical","dss-legend-bottom":!0}]),style:{display:"flex","flex-wrap":"wrap","justify-content":"center",padding:"6px 8px 0"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":zt.value.has(r),"dss-legend-hovered":Me.value===r,"dss-legend-dimmed":Me.value!==null&&Me.value!==r}]),onClick:m=>ra(r),onMouseenter:m=>g(r),onMouseleave:w,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":Bl.value&&i(l)}]),style:e.normalizeStyle({backgroundColor:Bl.value&&i(l)?"transparent":p(l,r),borderColor:p(l,r)})},null,6),e.createElementVNode("span",Lc,e.toDisplayString(l.name),1)],46,$c))),128))],2)):e.createCommentVNode("",!0),ft.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:ft.value.x+"px",top:ft.value.y+"px"}),onClick:o[0]||(o[0]=e.withModifiers(()=>{},["stop"]))},[rl.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:jn},e.toDisplayString(e.unref($)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),rl.value.addMarker&&(rl.value.downloadSvg||rl.value.downloadPng||rl.value.downloadCsv||Il.value.length>0)?(e.openBlock(),e.createElementBlock("div",Ac)):e.createCommentVNode("",!0),rl.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:Go},e.toDisplayString(e.unref($)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),rl.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:So},e.toDisplayString(e.unref($)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),rl.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:Rn},e.toDisplayString(e.unref($)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Il.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[rl.value.downloadSvg||rl.value.downloadPng||rl.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",Tc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Il.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+r},[l.separator?(e.openBlock(),e.createElementBlock("div",Dc)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Pl(l)),style:e.normalizeStyle(Ul(l)),onClick:m=>Yn(l)},[l.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:bl(l),class:"dss-custom-menu-content"},null,8,Rc)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.icon?(e.openBlock(),e.createElementBlock("span",Fc,e.toDisplayString(l.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)],64))],14,Hc)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),De.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:Sn},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:o[3]||(o[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Ic,[e.createElementVNode("h3",null,e.toDisplayString(y.value?e.unref($)("chart.modalMarker.viewMarker"):Al.value?e.unref($)("chart.modalMarker.editMarker"):e.unref($)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:Sn},"×")]),e.createElementVNode("div",zc,[e.createElementVNode("div",Pc,[e.createVNode(pa,{id:"dss-marker-date",mode:"single",modelValue:De.value.date,"onUpdate:modelValue":o[1]||(o[1]=l=>De.value.date=l),"min-date":Jl.value,"max-date":Cl.value,disabled:y.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",Oc,[e.createElementVNode("label",Wc,e.toDisplayString(e.unref($)("chart.modalMarker.description")),1),y.value?(e.openBlock(),e.createElementBlock("div",qc,e.toDisplayString(De.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":o[2]||(o[2]=l=>De.value.description=l),placeholder:e.unref($)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,Zc)),[[e.vModelText,De.value.description]])])]),e.createElementVNode("div",Uc,[e.createElementVNode("div",Xc,[Al.value&&!y.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:po},e.toDisplayString(e.unref($)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Yc,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:Sn},e.toDisplayString(y.value?e.unref($)("chart.modalMarker.close"):e.unref($)("chart.modalMarker.cancel")),1),y.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:Yo,disabled:!(De.value.description&&De.value.description.length)},e.toDisplayString(Al.value?e.unref($)("chart.modalMarker.save"):e.unref($)("chart.contextMenu.addMarker")),9,jc))])])])])):e.createCommentVNode("",!0)],64))}}),Qc={class:"dss-modal-title"},Jc={class:"dss-modal-actions"},ma={__name:"DSSModal",props:{showModal:{type:Boolean,required:!0},backDrop:{type:Boolean,default:!0},width:{type:String,default:"800px"},height:{type:String,default:"auto"},showCloseBtn:{type:Boolean,default:!0},headerType:{type:String,default:"space-between"},titleSize:{type:String,default:"24px"}},emits:["close-modal"],setup(E,{emit:te}){const $=E,V=te,ce=e.ref(null),O=e.ref(null),L=e.computed(()=>{const Y={"max-width":$.width};return $.height!=="auto"&&(Y.height=$.height,Y["min-height"]="0"),Y}),fe=e.computed(()=>({}));function rt(){V("close-modal")}function ee(){$.backDrop&&!ce.value&&V("close-modal")}function v(Y){Y.target.tagName==="INPUT"&&(ce.value=Y.target.tagName)}function be(){setTimeout(()=>{ce.value=null},300)}function ke(){const Y=document.body,me=document.documentElement;O.value={bodyOverflow:Y.style.overflow,bodyPosition:Y.style.position,bodyTop:Y.style.top,bodyWidth:Y.style.width,htmlOverflow:me.style.overflow,scrollY:window.scrollY},Y.style.overflow="hidden",Y.style.position="fixed",Y.style.top=`-${O.value.scrollY}px`,Y.style.width="100%",Y.style.left="0",me.style.overflow="hidden"}function J(){if(!O.value)return;const Y=document.body,me=document.documentElement,{bodyOverflow:F,bodyPosition:ue,bodyTop:$e,bodyWidth:tt,htmlOverflow:mt,scrollY:U}=O.value;Y.style.overflow=F||"",Y.style.position=ue||"",Y.style.top=$e||"",Y.style.width=tt||"",Y.style.left="",me.style.overflow=mt||"",window.scrollTo(0,U||0)}return e.watch(()=>$.showModal,Y=>{if(Y)ke(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const me=document.getElementById("dss-modal-backdrop");me&&(me.addEventListener("focusin",v),me.addEventListener("focusout",be))},100);else{J(),document.body.classList.remove("dss-modal-open");const me=document.getElementById("dss-modal-backdrop");me&&(me.removeEventListener("focusin",v),me.removeEventListener("focusout",be))}},{immediate:!0}),e.onUnmounted(()=>{$.showModal&&J()}),(Y,me)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[E.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:ee},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(L.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:me[0]||(me[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":E.headerType,"font-size":E.titleSize})},[e.createElementVNode("h1",Qc,[e.renderSlot(Y.$slots,"title",{},()=>[me[1]||(me[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(Y.$slots,"title-data"),E.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:rt,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(fe.value)},[e.renderSlot(Y.$slots,"content",{},()=>[me[2]||(me[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Jc,[e.renderSlot(Y.$slots,"actions")])])],4),[[e.vShow,E.showModal]])])):e.createCommentVNode("",!0)]))}},eu={key:0,class:"dss-table-toolbar"},tu={class:"dss-table-toolbar-left"},lu=["aria-expanded"],nu={class:"dss-pagination-select-dropdown",role:"listbox"},ou={class:"dss-table-column-visibility-label"},au={class:"dss-table-checkbox-wrapper"},su=["checked","onChange"],ru={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},iu={class:"dss-table-column-visibility-text"},cu={class:"dss-table-toolbar-right"},uu=["placeholder","aria-label"],du=["aria-label"],mu=["aria-label","aria-expanded"],pu={key:1,class:"dss-table-toolbar-extra"},fu={class:"dss-table-thead"},vu={key:0,class:"dss-table-th dss-table-selection-column"},hu={key:0,class:"dss-table-checkbox-wrapper"},gu=["checked","indeterminate"],yu={key:0,class:"dss-table-checkbox__indeterminate"},ku={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},Cu=["aria-label"],bu=["onClick"],xu={class:"dss-table-th-content"},wu={class:"dss-table-th-text"},Eu={key:0},Su={key:1},Vu={key:2},Nu=["data-filter-column-key","aria-expanded","aria-label","onClick"],Bu={class:"dss-table-tbody"},Mu=["onClick"],_u={class:"dss-table-checkbox-wrapper"},$u=["type","name","checked","disabled","onChange"],Lu={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Au={key:1,class:"dss-table-checkbox__dot"},Tu=["onClick"],Du=["aria-expanded","aria-label"],Hu={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},Ru={key:0,class:"dss-table-expansion-row"},Fu=["colspan"],Iu=["colspan"],zu={key:1,class:"dss-table-pagination"},Pu={class:"dss-table-pagination-left"},Ou={key:0},Wu={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},qu={class:"dss-table-pagination-center"},Zu={key:0,class:"dss-pagination-controls"},Uu=["disabled","title"],Xu=["disabled","title"],Yu=["aria-label","onKeydown"],ju={class:"dss-pagination-of"},Ku=["disabled","title"],Gu=["disabled","title"],Qu={class:"dss-table-pagination-right"},Ju={class:"dss-pagination-rows-label"},ed=["aria-expanded"],td=["aria-selected","onClick"],ld={key:0,class:"dss-table-filter-row"},nd=["value","placeholder"],od=["min","max","value"],ad=["min","max","value"],sd={class:"dss-table-filter-double-range-values"},rd={key:2,class:"dss-table-filter-daterange"},id={class:"dss-table-filter-daterange-row"},cd={class:"dss-table-filter-daterange-label"},ud=["value"],dd={class:"dss-table-filter-daterange-row"},md={class:"dss-table-filter-daterange-label"},pd=["value"],fd=["value","placeholder"],vd={class:"dss-table-filter-list"},hd=["checked","onChange"],gd={class:"dss-table-filter-actions"},yd={name:"DSSTable"},kd=Object.assign(yd,{props:{data:{type:Array,required:!0,default:()=>[]},columns:{type:Array,required:!0,default:()=>[]},tableId:{type:String,default:()=>"table-"+Math.random().toString(36).substring(2,9)},locale:{type:String,default:null},options:{type:Object,default:()=>({}),validator:E=>typeof E=="object"&&E!==null},columnVisibility:{type:Array,default:null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search","update:columnVisibility"],setup(E,{emit:te}){const{t:$,locale:V}=ro.useI18n(),ce=E,O=te,L={table:{width:"auto",height:null,rowHeight:"auto",truncated:!1,expandable:!1,expandableRowData:null,expandableRowCondition:null,striped:!1,bordered:!1,hoverable:!0,size:"default",align:"left"},title:{text:""},subtitle:{text:""},selection:{enabled:!1,mode:"single",rowCondition:null},sorting:{enabled:!0,mode:"single"},pagination:{enabled:!1,rows:10,rowsPerPageOptions:[5,10,25,50,100],showCounter:!0,showControlsGroup:!0,showControls:!0,showRowsPerPage:!0},toolbar:{downloads:{pdf:!0,excel:!0},columnVisibility:!0,search:!0},scrollable:!1,emptyMessage:null};function fe(y,g){const w=Object.assign({},y);return rt(y)&&rt(g)&&Object.keys(g).forEach(Z=>{rt(g[Z])?Z in y?w[Z]=fe(y[Z],g[Z]):Object.assign(w,{[Z]:g[Z]}):Object.assign(w,{[Z]:g[Z]})}),w}function rt(y){return y&&typeof y=="object"&&!Array.isArray(y)}const ee=e.computed(()=>fe(L,ce.options)),v=e.computed(()=>{const y=ee.value.table.width;return y==="auto"?null:typeof y=="number"?y:null}),be=e.computed(()=>ee.value.table.height),ke=e.computed(()=>ee.value.table.rowHeight??"auto"),J=e.computed(()=>({height:ke.value})),Y=e.computed(()=>ee.value.table.expandable===!0),me=e.computed(()=>ee.value.table.expandableRowData??null),F=e.computed(()=>ee.value.table.expandableRowCondition??null),ue=e.computed(()=>ee.value.table.truncated===!0),$e=e.computed(()=>ee.value.table.striped),tt=e.computed(()=>ee.value.table.bordered),mt=e.computed(()=>ee.value.table.hoverable),U=e.computed(()=>ee.value.table.size),ze=e.computed(()=>ee.value.table.align||"left");e.computed(()=>ee.value.title.text),e.computed(()=>ee.value.subtitle.text);const qe=e.computed(()=>ee.value.selection.enabled),Ve=e.computed(()=>ee.value.selection.mode),Le=e.computed(()=>ee.value.selection.rowCondition??null),je=e.computed(()=>ee.value.sorting.enabled),re=e.computed(()=>ee.value.sorting.mode),Qe=e.computed(()=>ee.value.pagination.enabled),Ce=e.computed(()=>ee.value.pagination.rows),Je=e.computed(()=>ee.value.pagination.rowsPerPageOptions),ut=e.computed(()=>ee.value.pagination.showCounter!==!1),ht=e.computed(()=>ee.value.pagination.showControlsGroup),dt=e.computed(()=>ht.value===!1?!1:ee.value.pagination.showControls!==!1),Wt=e.computed(()=>ht.value===!1?!1:ee.value.pagination.showRowsPerPage!==!1),qt=e.computed(()=>Qe.value&&(ut.value||dt.value||Wt.value)),Ct=e.computed(()=>ee.value.scrollable),wt=e.computed(()=>ee.value.emptyMessage||$("table.emptyMessage")),Yt=e.computed(()=>ee.value.toolbar?.downloads?.pdf!==!1),it=e.computed(()=>ee.value.toolbar?.downloads?.excel!==!1),Kt=e.computed(()=>ee.value.toolbar?.search!==!1),yt=e.computed(()=>Yt.value||it.value||Kt.value||el.value),el=e.computed(()=>ee.value.toolbar?.columnVisibility!==!1),X=e.ref(""),ge=e.ref(!1),W=e.ref(null);let G=null;function Ne(){ge.value?(G&&(clearTimeout(G),G=null),ge.value=!1,X.value="",O("search",""),W.value?.blur()):(ge.value=!0,G=setTimeout(()=>{G=null,W.value?.focus()},80))}function Pe(){X.value||(ge.value=!1)}function Xe(){X.value="",O("search",""),W.value?.focus()}const Et=e.computed(()=>({"dss-table-striped":$e.value,"dss-table-bordered":tt.value,"dss-table-hoverable":mt.value,[`dss-table-${U.value}`]:U.value!=="default","dss-table-truncated":ue.value})),Ge=(y,g)=>y?.field??y?.key??g,Zt=e.ref(new Set);function Ue(){const y=new Set;return ce.columns.forEach((g,w)=>{g?.hidden!==!0&&y.add(Ge(g,w))}),y}function We(){const y=new Set;return ce.columns.forEach((g,w)=>{y.add(Ge(g,w))}),y}function Dt(y){if(!Array.isArray(y))return null;const g=We(),w=[];return y.forEach(Z=>{g.has(Z)&&w.push(Z)}),w}function Lt(){Zt.value=Ue()}const ne=e.computed(()=>{const y=Dt(ce.columnVisibility);return y===null?null:new Set(y)}),j=e.computed(()=>ne.value??Zt.value),K=e.computed(()=>ce.columns.filter((y,g)=>j.value.has(Ge(y,g)))),de=y=>{const g=ce.columns.findIndex(w=>w===y);return Ge(y,g>=0?g:0)},xe=(y,g)=>j.value.has(Ge(y,g));function Ke(y){O("update:columnVisibility",Array.from(y))}function Ht(y,g){const w=Ge(y,g),Z=new Set(j.value);Z.has(w)?Z.delete(w):Z.add(w),ne.value===null&&(Zt.value=Z),Ke(Z)}const jt=e.ref(null),et=e.ref(!1);function vl(y){jt.value&&!jt.value.contains(y.target)&&(et.value=!1)}const M=e.computed(()=>K.value.length+(qe.value?1:0)+(Y.value?1:0)),x=(y,g)=>y?.id??y?.key??g,A=e.ref(new Set),ae=e.ref(null),oe=(y,g)=>A.value.has(x(y,g)),Fe=(y,g)=>{if(!Y.value)return!1;if(typeof F.value=="function")return!!F.value(y,g);if(typeof me.value=="string"&&me.value.trim()){const w=Jl(y,me.value.trim());return Array.isArray(w)?w.length>0:w&&typeof w=="object"?Object.keys(w).length>0:w!=null&&w!==""}return!0},bt=(y,g,w)=>{if(w&&w.stopPropagation(),!Fe(y,g))return;const Z=x(y,g),he=new Set(A.value);he.has(Z)?(he.delete(Z),O("row-collapse",{data:y,index:g})):(he.add(Z),O("row-expand",{data:y,index:g})),A.value=he},ot=(y,g)=>{if(!ue.value)return;const w=x(y,g);ae.value!==w&&(ae.value=w)},Ie=e.ref(null),xt=e.ref(0),Mt=e.ref([]),St=y=>{if(re.value==="single")return Ie.value===y.field?xt.value:0;{const g=Mt.value.find(w=>w.field===y.field);return g?g.order:0}},At=y=>{const g=St(y);return{"dss-sort-active":g!==0,"dss-sort-asc":g===1,"dss-sort-desc":g===-1}},It=e.ref({}),Nt=e.ref(null),yl=e.ref(null),nn=220,Vl=e.ref(null),Nl=e.computed(()=>K.value.find(y=>de(y)===Nt.value)??null),tl=e.computed(()=>{if(!Nl.value||Nl.value.filter!=="range")return null;const y=Nl.value,g=Nt.value,{min:w,max:Z}=sn(y),he=y.filterMin??w,at=y.filterMax??Z,Bt=Fl(g),bl=Bt.min??he,Pl=Bt.max??at,Ul=at-he,gn=Ul===0?0:(bl-he)/Ul*100,mo=Ul===0?100:(Pl-he)/Ul*100;return{rangeMin:he,rangeMax:at,currentMin:bl,currentMax:Pl,minPct:gn,maxPct:mo}}),jl=e.ref(null),on=e.ref("max");function xl(y){const g=jl.value,w=tl.value;if(!g||!w)return;const Z=g.getBoundingClientRect(),at=(y.clientX-Z.left)/Z.width*100,Bt=(w.minPct+w.maxPct)/2;on.value=at<Bt?"min":"max"}function Fl(y){return It.value[y]??{}}function dn(y,g){It.value={...It.value,[y]:g}}function Hl(y){const g=It.value[y];return g?g.type==="string"?!!g.value?.trim():g.type==="range"?g.min!=null||g.max!=null:g.type==="dateRange"?!!(g.from||g.to):g.type==="list"?g.selected?.length>0:!1:!1}function Pn(y){const g={...It.value};delete g[y],It.value=g,Nt.value=null,yl.value=null}function mn(){if(!Nt.value){yl.value=null;return}const y=Vl.value;if(!y)return;const g=y.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${Nt.value}"]`);if(!g)return;const w=g.getBoundingClientRect();yl.value={top:w.bottom+6,left:Math.max(8,w.right-nn)}}const pn=e.computed(()=>{const y=String(X.value??"").trim().toLowerCase();return y?ce.data.filter(g=>K.value.some(w=>ql(De(g,w)).some(he=>String(he).toLowerCase().includes(y)))):ce.data}),wn=e.computed(()=>{let y=[...pn.value];const g=(X.value??"").trim().toLowerCase();return g&&(y=y.filter(w=>ce.columns.some(Z=>{if(!Z||!Z.field)return!1;const he=De(w,Z);return String(he??"").toLowerCase().includes(g)}))),K.value.forEach(w=>{const Z=de(w),he=It.value[Z];if(!he)return;const at=w.field;if(at){if(he.type==="string"&&he.value?.trim()){const Bt=he.value.trim().toLowerCase();y=y.filter(bl=>{const Pl=De(bl,w);return String(Pl??"").toLowerCase().includes(Bt)})}else if(he.type==="range")y=y.filter(Bt=>{const bl=Jl(Bt,at),Pl=Number(bl);return!(Number.isNaN(Pl)||he.min!=null&&Pl<he.min||he.max!=null&&Pl>he.max)});else if(he.type==="dateRange"){const Bt=he.from?new Date(he.from).getTime():null,bl=he.to?new Date(he.to).getTime():null;y=y.filter(Pl=>{const Ul=Jl(Pl,at),gn=Ul?new Date(Ul).getTime():NaN;return!(Number.isNaN(gn)||Bt!=null&&gn<Bt||bl!=null&&gn>bl)})}else if(he.type==="list"&&he.selected?.length){const Bt=new Set(he.selected);y=y.filter(bl=>ql(De(bl,w)).some(Ul=>Bt.has(Ul)))}}}),y});function ql(y){if(y==null)return[""];if(Array.isArray(y))return y.flatMap(ql);if(typeof y=="object"){const g=y?.label??y?.name??y?.value??y?.title;return[g!=null?String(g):String(y)]}return[String(y)]}function rl(y){const g=new Set;return ce.data.forEach(w=>{ql(De(w,y)).forEach(he=>g.add(he))}),Array.from(g).sort((w,Z)=>String(w).localeCompare(String(Z)))}function Il(y,g){if(Nt.value===y){Nt.value=null,yl.value=null;return}if(Nt.value=y,g?.currentTarget){const w=g.currentTarget.getBoundingClientRect();yl.value={top:w.bottom+6,left:Math.max(8,w.right-nn)}}else mn()}function Kl(y,g){dn(y,{type:"string",value:g})}function sn(y){const g=y.field;if(!g)return{min:0,max:100};let w=1/0,Z=-1/0;return ce.data.forEach(he=>{const at=Jl(he,g),Bt=Number(at);Number.isNaN(Bt)||(w=Math.min(w,Bt),Z=Math.max(Z,Bt))}),{min:w===1/0?0:w,max:Z===-1/0?100:Z}}function T(y,g,w){const Z={...Fl(y),type:"range"},he=w===""?null:Number(w),at=he===null||Number.isNaN(he)?null:he;Z[g]=at,at!=null&&(g==="min"&&Z.max!=null&&at>Z.max&&(Z.max=at),g==="max"&&Z.min!=null&&at<Z.min&&(Z.min=at)),dn(y,Z)}function z(y,g,w){const Z={...Fl(y),type:"dateRange"};Z[g]=w||"",dn(y,Z)}const _=e.reactive({});function le(y,g){_[y]=g}function Te(y){const g=de(y),w=(_[g]??"").trim().toLowerCase(),Z=rl(y);return w?Z.filter(he=>String(he).toLowerCase().includes(w)):Z}function pt(y,g){return(Fl(y).selected??[]).includes(g!=null?String(g):"")}function ct(y,g){const Z=[...Fl(y).selected??[]],he=g!=null?String(g):"",at=Z.indexOf(he);at>=0?Z.splice(at,1):Z.push(he),dn(y,{type:"list",selected:Z})}function lt(y){Nt.value&&!y.target.closest(".dss-table-filter-wrap")&&!y.target.closest(".dss-table-filter-dropdown")&&(Nt.value=null,yl.value=null)}function st(){mn(),Rt.value&&Zl()}const il=y=>{if(!(y.sortable===!1||!je.value))if(re.value==="single")Ie.value===y.field?xt.value=xt.value===1?-1:xt.value===-1?0:1:(Ie.value=y.field,xt.value=1),xt.value===0&&(Ie.value=null),O("sort",{field:Ie.value,order:xt.value});else{const g=Mt.value.findIndex(w=>w.field===y.field);g>=0?Mt.value[g].order===1?Mt.value[g].order=-1:Mt.value.splice(g,1):Mt.value.push({field:y.field,order:1}),O("sort",{multiSortMeta:Mt.value})}},kl=e.computed(()=>{if(!je.value)return wn.value;let y=[...wn.value];return re.value==="single"&&Ie.value&&xt.value!==0?y.sort((g,w)=>{const Z=Jl(g,Ie.value),he=Jl(w,Ie.value);return Z===he?0:Z==null?1:he==null?-1:(Z<he?-1:Z>he?1:0)*xt.value}):re.value==="multiple"&&Mt.value.length>0&&y.sort((g,w)=>{for(const Z of Mt.value){const he=Jl(g,Z.field),at=Jl(w,Z.field);if(he===at)continue;if(he==null)return 1;if(at==null)return-1;const Bt=he<at?-1:he>at?1:0;if(Bt!==0)return Bt*Z.order}return 0}),y}),Gt=e.ref(0),wl=e.ref(Ce.value),Rt=e.ref(!1),Ll=e.ref(null),fn=e.ref(null),Qt=e.ref("bottom"),_t=e.ref(null),Ln=y=>{wl.value=y,Rt.value=!1,Gt.value=0,O("page",{page:0,rows:wl.value})};function En(y){Ll.value&&!Ll.value.contains(y.target)&&(Rt.value=!1)}function Zl(){const y=Ll.value,g=fn.value;if(!y||!g)return;const w=y.querySelector(".dss-pagination-select-dropdown");if(!w)return;const Z=g.getBoundingClientRect(),he=w.offsetHeight||0,Bt=(window.innerHeight||document.documentElement.clientHeight)-Z.bottom,bl=Z.top;Qt.value=Bt<he+8&&bl>Bt?"top":"bottom",_t.value={width:`${Math.ceil(Z.width)}px`,left:`${Math.max(0,Math.round(g.offsetLeft))}px`}}const vn=e.computed(()=>kl.value.length),hn=e.computed(()=>Math.ceil(vn.value/wl.value)),An=e.computed(()=>Math.max(hn.value,1)),Tn=e.computed(()=>vn.value===0?0:ll.value+1),Gl=e.computed(()=>Xn.value),ll=e.computed(()=>Qe.value?Gt.value*wl.value:0),Xn=e.computed(()=>Qe.value?Math.min((Gt.value+1)*wl.value,vn.value):vn.value),Ql=e.computed(()=>{if(!Qe.value)return kl.value;const y=ll.value,g=Xn.value;return kl.value.slice(y,g)}),Jt=e.ref(new Set),Dn=e.computed(()=>kl.value.filter((y,g)=>Jt.value.has(x(y,g)))),nl=(y,g)=>{const w=Le.value;return typeof w!="function"?!0:!!w(y,g)},zl=e.computed(()=>kl.value.map((y,g)=>({row:y,index:g})).filter(({row:y,index:g})=>nl(y,g))),On=e.computed(()=>{const y=zl.value;return y.length===0?!1:y.every(({row:g,index:w})=>Jt.value.has(x(g,w)))}),zt=e.computed(()=>{const y=zl.value;if(y.length===0)return!1;const g=y.filter(({row:w,index:Z})=>Jt.value.has(x(w,Z))).length;return g>0&&g<y.length}),Me=(y,g)=>Jt.value.has(x(y,g)),El=()=>{if(On.value)Jt.value=new Set,O("unselect-all");else{const y=new Set;zl.value.forEach(({row:g,index:w})=>y.add(x(g,w))),Jt.value=y,O("select-all",Dn.value)}},kt=(y,g)=>{if(!nl(y,g))return;const w=x(y,g),Z=new Set(Jt.value),he=Z.has(w);Ve.value==="single"?he?(Z.delete(w),O("row-unselect",y)):(Z.clear(),Z.add(w),O("row-select",y)):he?(Z.delete(w),O("row-unselect",y)):(Z.add(w),O("row-select",y)),Jt.value=Z},Ml=e.ref("1"),nt=()=>{const y=Number.parseInt(String(Ml.value),10);if(!Number.isFinite(y)){Ml.value=String(Gt.value+1);return}const g=Math.min(An.value,Math.max(1,y));g!==Gt.value+1?ft(g-1):Ml.value=String(g)},ft=y=>{y<0||y>=hn.value||(Gt.value=y,O("page",{page:y,rows:wl.value}))},ie=(y,g,w)=>{O("row-click",{data:y,index:g,originalEvent:w}),ot(y,ll.value+g)},Tt=(y,g)=>{const w=ll.value+g;return{"dss-table-row-selected":Me(y,w),"dss-table-row-even":g%2===0,"dss-table-row-odd":g%2!==0,"dss-table-row-truncated-clickable":ue.value,"dss-table-row-truncated-expanded":ae.value===x(y,w)}},De=(y,g)=>g.field?Jl(y,g.field):"",Jl=(y,g)=>g.split(".").reduce((w,Z)=>w&&w[Z],y),Cl=y=>{const g=y.align??ze.value;return{"dss-table-sortable":y.sortable!==!1&&je.value,"dss-table-align-left":g==="left","dss-table-align-center":g==="center","dss-table-align-right":g==="right",[y.className]:y.className}},Al=y=>{const g={};return y.width&&(g.width=typeof y.width=="number"?`${y.width}px`:y.width),y.minWidth&&(g.minWidth=typeof y.minWidth=="number"?`${y.minWidth}px`:y.minWidth),y.maxWidth&&(g.maxWidth=typeof y.maxWidth=="number"?`${y.maxWidth}px`:y.maxWidth),g};return e.watch(()=>ce.locale,y=>{y&&y!==V.value&&(V.value=y)},{immediate:!0}),e.watch(Ce,y=>{wl.value=y,Gt.value=0}),e.watch(Rt,async y=>{y&&(await e.nextTick(),Zl())}),e.watch(Gt,y=>{Ml.value=String(y+1)},{immediate:!0}),e.watch(X,y=>{O("search",y??"")}),e.watch(()=>ce.columns,()=>{if(ne.value===null){Lt();return}const y=Dt(ce.columnVisibility)??[];y.length!==ce.columnVisibility.length&&O("update:columnVisibility",y)},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",En),document.addEventListener("click",vl),document.addEventListener("click",lt),window.addEventListener("resize",st),window.addEventListener("scroll",st,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",En),document.removeEventListener("click",vl),document.removeEventListener("click",lt),window.removeEventListener("resize",st),window.removeEventListener("scroll",st,!0)}),(y,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:Vl,style:e.normalizeStyle({width:v.value+"px",height:be.value?be.value+"px":"auto"})},[yt.value?(e.openBlock(),e.createElementBlock("div",eu,[e.createElementVNode("div",tu,[Yt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:g[0]||(g[0]=w=>O("download-pdf"))},[g[22]||(g[22]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref($)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),it.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:g[1]||(g[1]=w=>O("download-excel"))},[g[23]||(g[23]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download_excel)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download_excel"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref($)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),el.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:jt},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":et.value}]),onClick:g[2]||(g[2]=w=>et.value=!et.value),"aria-expanded":et.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref($)("table.columnVisibility"))+" ",1),g[24]||(g[24]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,lu),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",nu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.columns,(w,Z)=>(e.openBlock(),e.createElementBlock("li",{key:Ge(w,Z),role:"option",class:"dss-table-column-visibility-option",onClick:g[3]||(g[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",ou,[e.createElementVNode("span",au,[e.createElementVNode("input",{type:"checkbox",checked:xe(w,Z),onChange:he=>Ht(w,Z),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,su),xe(w,Z)?(e.openBlock(),e.createElementBlock("span",ru,[...g[25]||(g[25]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("span",iu,e.toDisplayString(w.header),1)])]))),128))],512),[[e.vShow,et.value]])]),_:1})],512)):e.createCommentVNode("",!0),e.renderSlot(y.$slots,"header")]),e.createElementVNode("div",cu,[Kt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":ge.value||X.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:W,"onUpdate:modelValue":g[4]||(g[4]=w=>X.value=w),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref($)("table.searchPlaceholder"),"aria-label":e.unref($)("table.searchTableAriaLabel"),onFocus:g[5]||(g[5]=w=>ge.value=!0),onBlur:Pe},null,40,uu),[[e.vModelText,X.value]]),X.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":e.unref($)("table.clearSearchAriaLabel"),onClick:Xe},[...g[26]||(g[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,du)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref($)("table.searchAriaLabel"),"aria-expanded":ge.value||!!X.value,onMousedown:e.withModifiers(Ne,["prevent"])},[...g[27]||(g[27]=[e.createElementVNode("span",{class:"dss-table-toolbar-search-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.81738 0C7.47741 0.000327759 9.63379 2.09488 9.63379 4.67773C9.63366 5.68756 9.30172 6.62133 8.74121 7.38574L11.2324 9.80469C11.653 10.213 11.6528 10.8885 11.2324 11.2969C10.829 11.6886 10.1866 11.6886 9.7832 11.2969L7.16895 8.75781C6.47333 9.13671 5.67174 9.35439 4.81738 9.35449C2.15724 9.35449 -0.000652839 7.26049 -0.000976562 4.67773C-0.000976562 2.09468 2.15704 0 4.81738 0ZM4.81738 1.41895C2.96425 1.41895 1.46213 2.87754 1.46191 4.67676C1.46202 6.47611 2.96418 7.93555 4.81738 7.93555C6.67025 7.93519 8.17275 6.47589 8.17285 4.67676C8.17263 2.87776 6.67018 1.4193 4.81738 1.41895Z",fill:"currentColor"})])],-1)])],40,mu)],2)):e.createCommentVNode("",!0),y.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",pu,[e.renderSlot(y.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":Ct.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",Et.value])},[e.createElementVNode("thead",fu,[e.createElementVNode("tr",null,[qe.value?(e.openBlock(),e.createElementBlock("th",vu,[Ve.value==="multiple"?(e.openBlock(),e.createElementBlock("span",hu,[e.createElementVNode("input",{type:"checkbox",checked:On.value,indeterminate:zt.value,onChange:El,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,gu),zt.value?(e.openBlock(),e.createElementBlock("span",yu)):On.value?(e.openBlock(),e.createElementBlock("span",ku,[...g[28]||(g[28]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Y.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:"dss-table-th dss-table-expansion-column","aria-label":e.unref($)("table.expandRowAriaLabel")},null,8,Cu)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value,(w,Z)=>(e.openBlock(),e.createElementBlock("th",{key:de(w),class:e.normalizeClass(["dss-table-th",Cl(w)]),style:e.normalizeStyle(Al(w)),onClick:he=>il(w)},[e.createElementVNode("div",xu,[e.createElementVNode("span",wu,e.toDisplayString(w.header),1),w.sortable!==!1&&je.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",At(w)])},[St(w)===0?(e.openBlock(),e.createElementBlock("span",Eu,[...g[29]||(g[29]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"#3a3a3a"})],-1)])])):St(w)===1?(e.openBlock(),e.createElementBlock("span",Su,[...g[30]||(g[30]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"#7fa2cc"})],-1)])])):St(w)===-1?(e.openBlock(),e.createElementBlock("span",Vu,[...g[31]||(g[31]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"#7fa2cc"})],-1)])])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),w.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":Nt.value===de(w)}]),onClick:g[6]||(g[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":Hl(de(w))}]),"data-filter-column-key":de(w),"aria-expanded":Nt.value===de(w),"aria-label":e.unref($)("table.filterColumnAriaLabel"),onClick:he=>Il(de(w),he)},[...g[32]||(g[32]=[e.createElementVNode("span",{class:"dss-table-filter-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 1.54409L11.7537 1.54928L7.84558 5.72226V8.92411C7.84581 9.07639 7.80836 9.22636 7.73658 9.36067C7.6648 9.49497 7.56091 9.60943 7.43417 9.69385L5.58772 10.9252C5.44858 11.0179 5.28688 11.071 5.11988 11.079C4.95288 11.087 4.78685 11.0494 4.63952 10.9704C4.49219 10.8914 4.36908 10.7738 4.28334 10.6303C4.1976 10.4868 4.15244 10.3226 4.15269 10.1555V5.72226L0.244567 1.54928L0.239951 1.54409C0.119785 1.41185 0.0405781 1.24758 0.0119374 1.0712C-0.0167033 0.894829 0.00645342 0.713935 0.0785984 0.550463C0.150743 0.386991 0.268776 0.247968 0.418378 0.150258C0.56798 0.0525488 0.742722 0.000352071 0.921405 0H11.0769C11.2557 1.73676e-05 11.4307 0.051972 11.5805 0.149551C11.7304 0.247131 11.8487 0.386134 11.9211 0.549673C11.9934 0.713211 12.0167 0.894244 11.9881 1.07078C11.9596 1.24731 11.8803 1.41174 11.7601 1.54409H11.7583Z",fill:"currentColor"})])],-1)])],10,Nu)],2)):e.createCommentVNode("",!0)])],14,bu))),128))])]),e.createElementVNode("tbody",Bu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ql.value,(w,Z)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:x(w,ll.value+Z)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Tt(w,Z)]),style:e.normalizeStyle(J.value),onClick:he=>ie(w,Z,he)},[qe.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:g[7]||(g[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",_u,[e.createElementVNode("input",{type:Ve.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${E.tableId}`,checked:Me(w,ll.value+Z),disabled:!nl(w,ll.value+Z),onChange:he=>kt(w,ll.value+Z),class:e.normalizeClass(["dss-table-checkbox",Ve.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio",{"dss-table-checkbox--disabled":!nl(w,ll.value+Z)}])},null,42,$u),Ve.value==="multiple"&&Me(w,ll.value+Z)?(e.openBlock(),e.createElementBlock("span",Lu,[...g[33]||(g[33]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):Ve.value==="single"&&Me(w,ll.value+Z)?(e.openBlock(),e.createElementBlock("span",Au)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),Y.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(he=>bt(w,ll.value+Z,he),["stop"])},[Fe(w,ll.value+Z)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":oe(w,ll.value+Z),"aria-label":oe(w,ll.value+Z)?e.unref($)("table.collapseRowAriaLabel"):e.unref($)("table.expandRowAriaLabel")},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":oe(w,ll.value+Z)}]),"aria-hidden":"true"},[...g[34]||(g[34]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10.1611 2.81093L5.99463 6.93546L1.82819 2.81093C1.4094 2.39636 0.732886 2.39636 0.314094 2.81093C-0.104698 3.22551 -0.104698 3.89522 0.314094 4.30979L5.24295 9.18907C5.66175 9.60364 6.33826 9.60364 6.75705 9.18907L11.6859 4.30979C12.1047 3.89522 12.1047 3.22551 11.6859 2.81093C11.2671 2.40699 10.5799 2.39636 10.1611 2.81093Z",fill:"#3a3a3a"})],-1)])],2)],8,Du)):(e.openBlock(),e.createElementBlock("span",Hu))],8,Tu)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value,(he,at)=>(e.openBlock(),e.createElementBlock("td",{key:de(he),class:e.normalizeClass(["dss-table-td",Cl(he)]),style:e.normalizeStyle(Al(he))},[e.renderSlot(y.$slots,`cell-${he.field}`,{data:w,column:he,rowIndex:Z,isExpanded:ae.value===x(w,ll.value+Z)},()=>[e.createTextVNode(e.toDisplayString(De(w,he)),1)])],6))),128))],14,Mu),Y.value&&Fe(w,ll.value+Z)&&oe(w,ll.value+Z)?(e.openBlock(),e.createElementBlock("tr",Ru,[e.createElementVNode("td",{colspan:M.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(y.$slots,"expansion",{data:w,rowIndex:Z})],8,Fu)])):e.createCommentVNode("",!0)],64))),128)),Ql.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(J.value)},[e.createElementVNode("td",{colspan:M.value,class:"dss-table-empty-cell"},[e.renderSlot(y.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(wt.value),1)])],8,Iu)],4))])],2)],2),qt.value?(e.openBlock(),e.createElementBlock("div",zu,[e.createElementVNode("div",Pu,[ut.value?(e.openBlock(),e.createElementBlock("span",Ou,e.toDisplayString(e.unref($)("table.showingRange",{start:Tn.value,end:Gl.value,total:vn.value})),1)):(e.openBlock(),e.createElementBlock("span",Wu," "))]),e.createElementVNode("div",qu,[dt.value?(e.openBlock(),e.createElementBlock("div",Zu,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Gt.value===0,onClick:g[8]||(g[8]=w=>ft(0)),title:e.unref($)("table.firstPage")},[...g[35]||(g[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,Uu),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Gt.value===0,onClick:g[9]||(g[9]=w=>ft(Gt.value-1)),title:e.unref($)("table.previousPage")}," ‹ ",8,Xu),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":g[10]||(g[10]=w=>Ml.value=w),type:"text",class:"dss-pagination-page-input","aria-label":e.unref($)("table.currentPageAriaLabel"),onBlur:nt,onKeydown:e.withKeys(e.withModifiers(nt,["prevent"]),["enter"])},null,40,Yu),[[e.vModelText,Ml.value]]),e.createElementVNode("span",ju,e.toDisplayString(e.unref($)("table.ofPages",{total:An.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Gt.value>=hn.value-1,onClick:g[11]||(g[11]=w=>ft(Gt.value+1)),title:e.unref($)("table.nextPage")}," › ",8,Ku),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Gt.value>=hn.value-1,onClick:g[12]||(g[12]=w=>ft(hn.value-1)),title:e.unref($)("table.lastPage")},[...g[36]||(g[36]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,Gu)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Qu,[Wt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:Ll},[e.createElementVNode("span",Ju,e.toDisplayString(e.unref($)("table.rowsPerPage"))+":",1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Rt.value}]),onClick:g[13]||(g[13]=w=>Rt.value=!Rt.value),"aria-expanded":Rt.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:fn},[e.createTextVNode(e.toDisplayString(wl.value)+" ",1),g[37]||(g[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,ed),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",{class:e.normalizeClass(["dss-pagination-select-dropdown",{"dss-pagination-select-dropdown--top":Qt.value==="top"}]),style:e.normalizeStyle(_t.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Je.value,w=>(e.openBlock(),e.createElementBlock("li",{key:w,role:"option","aria-selected":w===wl.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":w===wl.value}]),onClick:Z=>Ln(w)},e.toDisplayString(w),11,td))),128))],6),[[e.vShow,Rt.value]])]),_:1})],512)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],4),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:"dss-table-filter-dropdown dss-table-filter-dropdown--teleport",style:e.normalizeStyle(yl.value?{top:yl.value.top+"px",left:yl.value.left+"px",width:nn+"px"}:void 0),onClick:g[21]||(g[21]=e.withModifiers(()=>{},["stop"]))},[Nl.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Nl.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",ld,[e.createElementVNode("input",{type:"text",value:Fl(Nt.value).value??"",onInput:g[14]||(g[14]=w=>Kl(Nt.value,w.target.value)),class:"dss-table-filter-input",placeholder:e.unref($)("table.search")},null,40,nd)])):Nl.value.filter==="range"&&tl.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":tl.value.minPct+"%","--range-max-pct":tl.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:jl,class:"dss-table-filter-double-range-track",onMousemove:xl,onMouseenter:xl},[e.createElementVNode("input",{type:"range",min:tl.value.rangeMin,max:tl.value.rangeMax,value:tl.value.currentMin,onInput:g[15]||(g[15]=w=>T(Nt.value,"min",w.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:on.value==="min"?2:1})},null,44,od),e.createElementVNode("input",{type:"range",min:tl.value.rangeMin,max:tl.value.rangeMax,value:tl.value.currentMax,onInput:g[16]||(g[16]=w=>T(Nt.value,"max",w.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:on.value==="max"?2:1})},null,44,ad)],544),e.createElementVNode("div",sd,e.toDisplayString(tl.value.currentMin)+" – "+e.toDisplayString(tl.value.currentMax),1)],4)):Nl.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",rd,[e.createElementVNode("div",id,[e.createElementVNode("label",cd,e.toDisplayString(e.unref($)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:Fl(Nt.value).from??"",onInput:g[17]||(g[17]=w=>z(Nt.value,"from",w.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,ud)]),e.createElementVNode("div",dd,[e.createElementVNode("label",md,e.toDisplayString(e.unref($)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:Fl(Nt.value).to??"",onInput:g[18]||(g[18]=w=>z(Nt.value,"to",w.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,pd)])])):Nl.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:_[Nt.value]??"",onInput:g[19]||(g[19]=w=>le(Nt.value,w.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref($)("table.search")},null,40,fd),e.createElementVNode("div",vd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Te(Nl.value),w=>(e.openBlock(),e.createElementBlock("label",{key:w,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:pt(Nt.value,w),onChange:Z=>ct(Nt.value,w)},null,40,hd),e.createElementVNode("span",null,e.toDisplayString(w),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",gd,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:g[20]||(g[20]=w=>Pn(Nt.value))},e.toDisplayString(e.unref($)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,Nt.value&&Nl.value&&yl.value]])]),_:1})]))],64))}}),Cd="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M6.008%2014V12.68H8.288V6.572L5.996%208.276V6.692L8.012%205.24H9.788V12.68H11.624V14H6.008Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",bd="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M5.948%2014V12.548L8.684%209.8C9.068%209.408%209.352%209.056%209.536%208.744C9.72%208.424%209.812%208.096%209.812%207.76C9.812%207.352%209.7%207.036%209.476%206.812C9.252%206.58%208.948%206.464%208.564%206.464C8.14%206.464%207.808%206.588%207.568%206.836C7.328%207.076%207.208%207.412%207.208%207.844H5.708C5.716%207.284%205.836%206.804%206.068%206.404C6.308%205.996%206.644%205.68%207.076%205.456C7.508%205.232%208.012%205.12%208.588%205.12C9.14%205.12%209.62%205.224%2010.028%205.432C10.436%205.64%2010.752%205.932%2010.976%206.308C11.2%206.684%2011.312%207.132%2011.312%207.652C11.312%208.188%2011.172%208.712%2010.892%209.224C10.62%209.728%2010.18%2010.272%209.572%2010.856L7.748%2012.644H11.42V14H5.948Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",xd="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.516%2014.12C7.948%2014.12%207.452%2014.016%207.028%2013.808C6.612%2013.6%206.288%2013.308%206.056%2012.932C5.824%2012.556%205.708%2012.112%205.708%2011.6H7.22C7.22%2011.992%207.332%2012.3%207.556%2012.524C7.788%2012.74%208.112%2012.848%208.528%2012.848C8.944%2012.848%209.264%2012.736%209.488%2012.512C9.712%2012.288%209.824%2011.984%209.824%2011.6V10.916C9.824%2010.524%209.712%2010.22%209.488%2010.004C9.264%209.78%208.944%209.668%208.528%209.668H7.544V8.312L9.476%206.524H6.104V5.24H11V6.596L8.528%208.864V8.384C9.392%208.384%2010.076%208.612%2010.58%209.068C11.084%209.524%2011.336%2010.14%2011.336%2010.916V11.6C11.336%2012.112%2011.22%2012.556%2010.988%2012.932C10.756%2013.308%2010.428%2013.6%2010.004%2013.808C9.58%2014.016%209.084%2014.12%208.516%2014.12Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",wd="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M9.68%2014V12.26H5.78V10.088L9.152%205.24H10.832L7.22%2010.484V10.94H9.68V8.96H11.18V14H9.68Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Ed="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.588%2014.12C7.78%2014.12%207.132%2013.92%206.644%2013.52C6.156%2013.112%205.888%2012.56%205.84%2011.864H7.34C7.372%2012.168%207.492%2012.404%207.7%2012.572C7.916%2012.732%208.212%2012.812%208.588%2012.812C9.004%2012.812%209.32%2012.704%209.536%2012.488C9.752%2012.264%209.86%2011.956%209.86%2011.564V10.712C9.86%2010.312%209.752%2010.008%209.536%209.8C9.32%209.584%209.004%209.476%208.588%209.476C8.332%209.476%208.112%209.528%207.928%209.632C7.744%209.736%207.604%209.88%207.508%2010.064H6.044L6.104%205.24H11.036V6.596H7.52L7.496%209.14H7.844L7.484%209.44C7.484%209.072%207.628%208.784%207.916%208.576C8.212%208.36%208.608%208.252%209.104%208.252C9.816%208.244%2010.368%208.46%2010.76%208.9C11.16%209.332%2011.36%209.936%2011.36%2010.712V11.564C11.36%2012.356%2011.112%2012.98%2010.616%2013.436C10.128%2013.892%209.452%2014.12%208.588%2014.12Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Sd="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.6%2014.12C8.016%2014.12%207.5%2014%207.052%2013.76C6.612%2013.512%206.268%2013.168%206.02%2012.728C5.78%2012.28%205.66%2011.764%205.66%2011.18C5.66%2010.764%205.728%2010.328%205.864%209.872C6.008%209.416%206.204%208.988%206.452%208.588L8.516%205.24H10.184L7.592%209.32L7.664%209.368C7.824%209.12%208.04%208.932%208.312%208.804C8.584%208.676%208.888%208.612%209.224%208.612C9.696%208.612%2010.104%208.724%2010.448%208.948C10.792%209.172%2011.06%209.484%2011.252%209.884C11.444%2010.284%2011.54%2010.752%2011.54%2011.288C11.54%2011.856%2011.416%2012.352%2011.168%2012.776C10.928%2013.2%2010.588%2013.532%2010.148%2013.772C9.716%2014.004%209.2%2014.12%208.6%2014.12ZM8.6%2012.848C9.04%2012.848%209.396%2012.708%209.668%2012.428C9.94%2012.14%2010.076%2011.768%2010.076%2011.312C10.076%2010.84%209.94%2010.464%209.668%2010.184C9.396%209.896%209.04%209.752%208.6%209.752C8.16%209.752%207.804%209.896%207.532%2010.184C7.26%2010.464%207.124%2010.84%207.124%2011.312C7.124%2011.768%207.26%2012.14%207.532%2012.428C7.804%2012.708%208.16%2012.848%208.6%2012.848Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Vd={class:"dss-toolbar-left"},Nd=["title"],Bd=["title"],Md={class:"dss-toolbar-dropdown-wrapper"},_d=["title"],$d=["src"],Ld=["src"],Ad=["src"],Td=["src"],Dd=["src"],Hd=["src"],Rd={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Fd=["src"],Id=["src"],zd=["src"],Pd=["src"],Od=["src"],Wd=["src"],qd=["title"],Zd=["title"],Ud=["title"],Xd=["title"],Yd=["title"],jd=["title"],Kd=["title"],Gd=["title"],Qd=["title"],Jd={key:2,class:"dss-toolbar-separator"},e1=["title"],t1={key:4,class:"dss-toolbar-separator"},l1={key:5,class:"dss-toolbar-dropdown-wrapper"},n1=["title"],o1={class:"dss-toolbar-dropdown-ai"},a1={class:"dss-toolbar-right"},s1={key:0,class:"dss-toolbar-custom-group"},r1={key:1,class:"dss-toolbar-separator"},i1={class:"dss-link-modal-content"},c1={class:"dss-link-modal-field"},u1={class:"dss-link-modal-label"},d1=["placeholder"],m1={class:"dss-link-modal-field"},p1={class:"dss-link-modal-label"},f1=["placeholder"],v1={class:"dss-image-modal-tabs"},h1={key:0,class:"dss-image-tab-content"},g1={class:"dss-link-modal-content"},y1={class:"dss-link-modal-field"},k1={key:0,class:"dss-link-modal-label"},C1=["src"],b1={class:"dss-link-modal-field"},x1={class:"dss-link-modal-label"},w1=["placeholder"],E1={class:"dss-link-modal-field"},S1={class:"dss-link-modal-label"},V1=["placeholder"],N1={class:"dss-link-modal-field"},B1={class:"dss-link-modal-label"},M1=["placeholder"],_1={key:1,class:"dss-image-tab-content"},$1={class:"dss-link-modal-content"},L1={class:"dss-link-modal-field"},A1={class:"dss-link-modal-label"},T1=["placeholder"],D1={class:"dss-link-modal-field"},H1={class:"dss-link-modal-label"},R1=["placeholder"],F1={class:"dss-link-modal-field"},I1={class:"dss-link-modal-label"},z1=["placeholder"],P1={class:"dss-link-modal-field"},O1={class:"dss-link-modal-label"},W1=["placeholder"],q1={class:"dss-text-editor-title-input-container"},Z1={key:0,class:"dss-text-editor-title-preview"},U1={key:0},X1={key:1,class:"dss-text-editor-preview-placeholder"},Y1=["value","placeholder","disabled"],j1={key:3,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},K1={class:"dss-text-editor-description-input-container"},G1={key:0,class:"dss-text-editor-description-preview"},Q1={key:0},J1={key:1,class:"dss-text-editor-preview-placeholder"},em=["value","placeholder","disabled"],tm={key:5,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},lm=["data-comment-id","onMouseenter"],nm=["onClick"],om=["src","alt"],am={key:1},sm=["onClick"],rm=["src","alt"],im={key:1},cm=["data-has-second-user","onClick"],um={class:"editor-comment-marker-count"},dm={key:7,class:"dss-text-editor-textarea-wrapper"},mm=["value","placeholder","rows","disabled"],pm={class:"dss-text-editor-footer"},fm={class:"dss-text-editor-footer-content"},vm={class:"dss-text-editor-footer-stat"},hm={class:"dss-text-editor-footer-stat"},gm={key:8,class:"dss-text-editor-content-wrapper"},ym={key:0,class:"dss-comment-overlay-body"},km={class:"dss-comment-selection-wrapper"},Cm=["innerHTML"],bm={class:"dss-comment-messages-wrapper"},xm={key:0,class:"dss-comment-avatar-wrapper"},wm={class:"dss-comment-avatar"},Em=["src","alt"],Sm={key:1},Vm={class:"dss-comment-header"},Nm={class:"dss-comment-header-text"},Bm={class:"dss-comment-author"},Mm={key:0,class:"dss-comment-date"},_m=["onClick","title"],$m={class:"dss-comment-overlay-inner"},Lm=["placeholder","onKeydown"],Am={class:"dss-text-editor-footer"},Tm={class:"dss-text-editor-footer-content"},Dm={class:"dss-text-editor-footer-stat"},Hm={class:"dss-text-editor-footer-stat"},Rm=["title"],Fm=["title"],Im={xmlns:"http://www.w3.org/2000/svg",version:"1.1","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"512",height:"512",x:"0",y:"0",viewBox:"0 0 32 32",style:{"enable-background":"new 0 0 512 512"},"xml:space":"preserve",class:""},zm={class:"dss-image-popup-content"},Pm={key:0,class:"dss-image-popup-no-alt-icon"},Om=["title"],Wm=["title"],qm={xmlns:"http://www.w3.org/2000/svg",version:"1.1","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"512",height:"512",x:"0",y:"0",viewBox:"0 0 32 32",style:{"enable-background":"new 0 0 512 512"},"xml:space":"preserve",class:""},Zm={class:"dss-toolbar-left"},Um=["title"],Xm=["title"],Ym={class:"dss-toolbar-dropdown-wrapper"},jm=["title"],Km=["src"],Gm=["src"],Qm=["src"],Jm=["src"],e2=["src"],t2=["src"],l2={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},n2=["title"],o2=["title"],a2=["title"],s2=["title"],r2=["title"],i2=["title"],c2=["title"],u2=["title"],d2=["title"],m2={key:2,class:"dss-toolbar-separator"},p2=["title"],f2={key:4,class:"dss-toolbar-separator"},v2={key:5,class:"dss-toolbar-dropdown-wrapper"},h2=["title"],g2={class:"dss-toolbar-dropdown-ai"},y2={key:0,class:"dss-toolbar-right"},k2={key:0,class:"dss-toolbar-separator"},C2={key:0,class:"dss-toolbar-custom-group"},b2={key:1,class:"dss-toolbar-separator"},x2={name:"DSSTextEditor"},w2=Object.assign(x2,{props:{modelValue:{type:String,default:""},title:{type:String,default:""},description:{type:String,default:""},titlePlaceholder:{type:String,default:null},descriptionPlaceholder:{type:String,default:null},placeholder:{type:String,default:null},rows:{type:Number,default:10},fullHeight:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},richText:{type:Boolean,default:!1},border:{type:Boolean,default:!0},rounded:{type:Boolean,default:!1},fixedHeight:{type:Boolean,default:!1},options:{type:Object,default:()=>({}),validator:E=>typeof E=="object"&&E!==null},floatingToolbar:{type:Boolean,default:!1},askAi:{type:Boolean,default:!1},showTitle:{type:Boolean,default:!0},showDescription:{type:Boolean,default:!0},commentUser:{type:Object,default:null},customToolbarSlots:{type:Array,default:()=>["custom-tool-1","custom-tool-2","custom-tool-3"]},customToolbarFloatingMap:{type:Object,default:()=>({}),validator:E=>typeof E=="object"&&E!==null},locale:{type:String,default:null},comments:{type:Array,default:()=>[]}},emits:["update:modelValue","update:title","update:description","update:comments","change","blur","title-change","description-change","comment-submitted","comment-marker-clicked","comment-deleted"],setup(E,{expose:te,emit:$}){const{t:V,locale:ce}=ro.useI18n(),O={h1:Cd,h2:bd,h3:xd,h4:wd,h5:Ed,h6:Sd},L=E,fe=$,rt=e.useSlots(),ee=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
96
|
+
`,rn.value){t+=`Category,Segment,Value
|
|
97
|
+
`,V.value.forEach(F=>{F.segments.forEach(N=>{const L=String(F.label||"").replace(/"/g,'""'),S=String(N.label||"").replace(/"/g,'""');t+=`"${L}","${S}",${N.value}
|
|
98
|
+
`})});const v=new Blob([t],{type:"text/csv;charset=utf-8;"}),C=URL.createObjectURL(v),b=document.createElement("a");b.href=C,b.download=qn("csv"),document.body.appendChild(b),b.click(),document.body.removeChild(b),URL.revokeObjectURL(C),ue();return}t+="Category",R.series.forEach(v=>{const C=v.name.replace(/"/g,'""');t+=',"'+C+'"'}),t+=`
|
|
99
|
+
`;const o=Math.max(...R.series.map(v=>v.data?.length||0));for(let v=0;v<o;v++){let F='"'+(R.categories[v]||_("chart.fallback.item",{number:v+1})).toString().replace(/"/g,'""')+'"';R.series.forEach(N=>{const L=N.data&&N.data[v]!==void 0?N.data[v]:"";F+=","+L}),t+=F+`
|
|
100
|
+
`}const l=new Blob([t],{type:"text/csv;charset=utf-8;"}),r=URL.createObjectURL(l),m=document.createElement("a");m.href=r,m.download=qn("csv"),document.body.appendChild(m),m.click(),document.body.removeChild(m),URL.revokeObjectURL(r),ue()}catch(t){console.error("Error downloading CSV:",t)}},Bo=t=>{if(typeof t.action=="function"){const o={series:R.series,categories:R.categories,markers:tl.value},l={chartX:mt.value.chartX,chartY:mt.value.chartY,dataX:mt.value.mouseDataX,dataY:mt.value.mouseDataY,categoryIndex:clampedCategoryIndex||mt.value.categoryIndex};t.action(o,l)}ue()},Rn=()=>{Vn(),Oe.value.show=!0,Oe.value.categoryIndex=mt.value.categoryIndex,Oe.value.fromButton=!1,ue()},Kn=()=>{Vn(),Oe.value.show=!0,Oe.value.categoryIndex=0,Oe.value.fromButton=!0},Zn=t=>{if(mt.value.show){const o=document.querySelector(".dss-context-menu");o&&!o.contains(t.target)&&(mt.value.show=!1)}},fo=t=>{mt.value.show&&!t.target.closest(".context-menu")&&(mt.value.show=!1)},Mo=t=>{if(!Nl.value||!Ke.value)return;t.preventDefault(),t.stopPropagation(),ce.value.isZooming=!0,ot.value.show=!1,ce.value.zoomTimeout&&clearTimeout(ce.value.zoomTimeout);const l=t.currentTarget.getBoundingClientRect(),r=t.clientX-l.left,m=t.clientY-l.top;if(r<I.value.left-50||r>I.value.right+50||m<I.value.top-50||m>I.value.bottom+100){ce.value.isZooming=!1;return}const v=t.deltaY>0?.9:1.1,C=Math.max(ce.value.minScale,Math.min(ce.value.maxScale,ce.value.scale*v));if(C!==ce.value.scale){const{minX:b,maxX:F}=ge.value,N=F-b||1,L=N/ce.value.scale,S=b-ce.value.offsetX/I.value.width*N,K=(r-I.value.left)/I.value.width,Be=S+K*L;ce.value.scale=C;const Ze=N/ce.value.scale,re=Be-K*Ze;ce.value.offsetX=-(re-b)/N*I.value.width,ce.value.scale<=1.01&&(ce.value.scale=1,ce.value.offsetX=0)}ce.value.zoomTimeout=setTimeout(()=>{ce.value.isZooming=!1,ce.value.zoomTimeout=null},300)},_o=t=>{if(!Nl.value||!Ke.value||ce.value.scale<=1)return;ot.value.show=!1;const l=t.currentTarget.getBoundingClientRect();t.clientX-l.left,t.clientY-l.top,ce.value.isDragging=!0,ce.value.lastMouseX=t.clientX,ce.value.lastMouseY=t.clientY,t.preventDefault()},yn=()=>{ce.value.isDragging=!1},tn=()=>{!Nl.value||!Ke.value||(ce.value.scale=1,ce.value.offsetX=0,ce.value.isDragging=!1,ce.value.zoomTimeout&&(clearTimeout(ce.value.zoomTimeout),ce.value.zoomTimeout=null),ce.value.isZooming=!1)},Nn=()=>!Nl.value||!Sn.value||!Ke.value?"default":ce.value.isDragging?"grabbing":ce.value.scale>1?"grab":"dss-crosshair",Bn=t=>{if(t.length<2)return"";if(t.length===2)return`M ${t[0].x} ${t[0].y} L ${t[1].x} ${t[1].y}`;let o=`M ${t[0].x} ${t[0].y}`;for(let l=0;l<t.length-1;l++){const r=t[Math.max(l-1,0)],m=t[l],v=t[l+1],C=t[Math.min(l+2,t.length-1)],b=m.x+(v.x-r.x)/6*je.value,F=m.y+(v.y-r.y)/6*je.value,N=v.x-(C.x-m.x)/6*je.value,L=v.y-(C.y-m.y)/6*je.value;o+=` C ${b} ${F} ${N} ${L} ${v.x} ${v.y}`}return o},Mt=e.computed(()=>{const o=Z.value?.chart?.padding,l=typeof o=="number"?o:null,r=o&&typeof o=="object"?o:null,m=50;let v=m+(qt.value?30:0)+60;if(rl.value){const S={left:m+40,top:m+40,right:m+40,bottom:m+40};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??S.left,top:r.top??S.top,right:r.right??S.right,bottom:r.bottom??S.bottom}:S}if(cl.value){const S=!W.value,K=Vl.value,Be=K?al.value+At.value+Math.max(24,an.value+16):0,Ze=S?12:m;let re=0;ct.value&&(re+=S?8:15),gt.value&&(re+=S?6:10);const ye=Je();let Ee=Ze+(S?4:16)+(K?Be:0),ve=Ze+(K?Be:0);W.value&&G.value==="left"?Ee+=ye.legendWidth||150:W.value&&G.value==="right"&&(ve+=ye.legendWidth||150);const ze=be.value==="semi-radial"?K?Be:8:K?Be:S?8:m+80,Te=K?14:0,Ve=Ze+re+Te,De={left:Ee,top:Ve,right:ve,bottom:ze};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??De.left,top:r.top??De.top,right:r.right??De.right,bottom:r.bottom??De.bottom}:De}let C=0;ct.value&&(C+=15),gt.value&&(C+=10);const b=Je();let F=m+16+(Zt.value?30:0),N=m+(xt.value?30:0);W.value&&G.value==="left"?F+=b.legendWidth||150:W.value&&G.value==="right"&&(N+=b.legendWidth||150),h.value&&(N+=44);const L={left:F,top:m+C,right:N,bottom:v};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??L.left,top:r.top??L.top,right:r.right??L.right,bottom:r.bottom??L.bottom}:L}),I=e.computed(()=>({left:Mt.value.left,top:Mt.value.top,right:Se.value-Mt.value.right,bottom:ie.value-Mt.value.bottom,width:Se.value-(Mt.value.left+Mt.value.right),height:ie.value-(Mt.value.top+Mt.value.bottom)})),Nl=e.computed(()=>["line","area","bar","stepbar"].includes(be.value)||Qe.value),Bl=e.computed(()=>Qe.value),Gl=e.computed(()=>be.value==="mini-radial"),cl=e.computed(()=>["radial","semi-radial","mini-radial"].includes(be.value)),rl=e.computed(()=>be.value==="spider"),Gt=e.computed(()=>be.value==="bubble"),rn=e.computed(()=>be.value==="stepbar"),fl=e.computed(()=>Z.value?.chart?.orientation==="horizontal"&&(be.value==="bar"||Bl.value)),Xl=t=>{const{minY:o,maxY:l}=ge.value,r=l-o||1;return I.value.left+(t-o)/r*I.value.width},kn=t=>{const{maxX:o}=ge.value,l=o+1,m=I.value.height/l;return I.value.top+(t+.5)*m},Dt=e.computed(()=>cl.value?Mt.value.left+(Se.value-Mt.value.left-Mt.value.right)/2:Se.value/2),Pt=e.computed(()=>rl.value?ie.value/2-40:cl.value?Mt.value.top+(ie.value-Mt.value.top-Mt.value.bottom)/2:ie.value/2),Vt=e.computed(()=>{if(rl.value){const t=I.value.width-80,o=I.value.height-80;return Math.min(t,o)/2}return Math.min(I.value.width,I.value.height)/2}),hl=e.computed(()=>{const t=Z.value,o=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,l=typeof o=="number"&&o>=0&&o<=1?o:.45;return Vt.value*l}),Gn=e.computed(()=>{const t=Z.value,o=typeof R.innerSize=="number"?R.innerSize:t?.innerSize;return typeof o!="number"||o<=-100||!(cl.value||rl.value)?1:1+o/100}),Qn=e.computed(()=>{const t=Gn.value;if(t===1||t<=0)return;const o=Dt.value,l=Pt.value;return`translate(${o}, ${l}) scale(${t}) translate(${-o}, ${-l})`}),Mn=e.ref(0),ho=e.computed(()=>`semi-radial-fill-clip-${R.chartId}`),Cn=e.computed(()=>be.value==="semi-radial"),Un=e.computed(()=>Cn.value&&Kt.value&&!An.value),Xn=e.computed(()=>Cn.value&&Kt.value&&!An.value&&ql.value==="fill"),Jo=e.computed(()=>{const t=Un.value?Mn.value:1,o=Dt.value,l=Pt.value,r=hl.value,m=Vt.value,v=Math.PI,C=Math.PI+t*Math.PI;if(t<=0)return`M ${o} ${l} L ${o} ${l} Z`;const b=o+m*Math.cos(v),F=l+m*Math.sin(v),N=o+m*Math.cos(C),L=l+m*Math.sin(C),S=o+r*Math.cos(C),K=l+r*Math.sin(C),Be=o+r*Math.cos(v),Ze=l+r*Math.sin(v),re=t>.5?1:0;return`M ${o} ${l} L ${b} ${F} A ${m} ${m} 0 ${re} 1 ${N} ${L} L ${S} ${K} A ${r} ${r} 0 ${re} 1 ${Be} ${Ze} Z`}),go=e.computed(()=>{if(!(!Cn.value||!Un.value)&&!Xn.value)return`url(#${ho.value})`}),$o=t=>{if(!(!Xn.value||t!==0))return`url(#${ho.value})`},_n=e.ref(0),Fn=e.computed(()=>`radial-reveal-clip-${R.chartId}`),_l=e.computed(()=>be.value==="radial"),yo=e.computed(()=>{const t=_l.value?_n.value:1,o=Dt.value,l=Pt.value,r=Math.max(Vt.value*1.5,Se.value,ie.value);if(t<=0)return`M ${o} ${l} L ${o} ${l} Z`;if(t>=1){const S=o-r,K=o+r;return`M ${S} ${l} A ${r} ${r} 0 0 1 ${K} ${l} A ${r} ${r} 0 0 1 ${S} ${l} Z`}const m=-Math.PI/2,v=m+t*Math.PI*2,C=o+r*Math.cos(m),b=l+r*Math.sin(m),F=o+r*Math.cos(v),N=l+r*Math.sin(v),L=t>=.5?1:0;return`M ${o} ${l} L ${C} ${b} A ${r} ${r} 0 ${L} 1 ${F} ${N} Z`}),Lo=e.computed(()=>{if(go.value)return go.value;if(_l.value)return`url(#${Fn.value})`});let Yn=null;const ea=()=>{if(!Un.value)return;Mn.value=0;const t=jl.value,o=performance.now(),l=r=>{const m=r-o,v=Math.min(1,m/t);Mn.value=aa(il.value,v),v<1&&(Yn=requestAnimationFrame(l))};Yn=requestAnimationFrame(l)},To=e.computed(()=>Z.value?.bubbles?.minSize||8),Jn=e.computed(()=>Z.value?.bubbles?.maxSize||50),Yl=e.computed(()=>Z.value?.bubbles?.opacity||.7),Ao=(t,o)=>{const l=[15,20,25,18,22],r=l[t%l.length]||20,m=1+Math.sin(o*.5)*.2;return Math.max(5,r*m)},$n=t=>{const o=document.querySelector(`.dss-bubble-image-${t}`);o&&(o.style.opacity="1")},ko=t=>{const o=document.querySelector(`.dss-bubble-image-${t}`);o&&(o.style.display="none")},ln=e.computed(()=>R.series),Ql=e.computed(()=>R.series.filter((t,o)=>!wt.value.has(o))),eo=t=>{if(!t)return"primary";const o=t.yAxis??t.axis??t.yAxisId;return o==="secondary"||o==="right"||o===1?"secondary":"primary"},a=t=>t?typeof t.strokeDasharray=="string"?t.strokeDasharray:Array.isArray(t.strokeDasharray)?t.strokeDasharray.join(","):t.dotted===!0?"4,4":null:null,n=t=>t?t.old===!0||t.comparison===!0||t.dotted===!0:!1,s=e.computed(()=>{const o=Z.value?.spider?.comparison||{};return{fillOpacity:typeof o.fillOpacity=="number"?o.fillOpacity:0,strokeDasharray:o.strokeDasharray||"6,4",usePrimaryColor:o.usePrimaryColor!==!1,bubbleSize:typeof o.bubbleSize=="number"?o.bubbleSize:0}}),i=(t,o)=>typeof t?.bubbles?.size=="number"?t.bubbles.size:typeof t?.bubbleSize=="number"?t.bubbleSize:o?s.value.bubbleSize:$t.value,c=(t,o)=>n(t)&&s.value.usePrimaryColor?Qt(0):Qt(o),d=(t,o)=>rl.value&&n(t)?c(t,o):Qt(o),u=e.computed(()=>Ql.value.filter(t=>eo(t)==="primary")),p=e.computed(()=>Ql.value.filter(t=>eo(t)==="secondary")),h=e.computed(()=>!fl.value&&!!kt.value&&p.value.length>0),k=(t,o=0)=>{const l=Number(t);return Number.isFinite(l)?l:o},H=(t,o,l)=>{if(!Array.isArray(t))return[];const r=t.map((m,v)=>{const C=m&&typeof m=="object"&&!Array.isArray(m),b=k(C?m.value:m,0);return b<=0?null:{key:`${l}-${v}-${C&&m.label||v}`,label:C?m.label||o?.name||`Segment ${v+1}`:o?.name||`Segment ${v+1}`,value:b,color:C?m.color||Qt(v):Qt(l),marker:C?m.marker:null,isRemainder:!1}}).filter(Boolean);return pl.value==="asc"?r.sort((m,v)=>m.value-v.value):pl.value==="desc"?r.sort((m,v)=>v.value-m.value):r},z=(t,o,l,r)=>{const m=t&&typeof t=="object"&&!Array.isArray(t),v=m?t.segments:Array.isArray(t)?t:[{label:l?.name,value:t,color:Qt(r)}],C=H(v,l,r),b=C.reduce((S,K)=>S+K.value,0),F=k(m?t.totalValue??t.total??l?.totalValue??l?.total:l?.totalValue??l?.total,M.value),N=Math.max(F,b,1);w.value&&N>b&&C.push({key:`${r}-${o}-remainder`,label:A.value,value:N-b,color:se.value,marker:null,isRemainder:!0});const L=C.filter(S=>!S.isRemainder).reduce((S,K)=>!S||K.value>S.value?K:S,null);return{key:`${r}-${o}`,label:m?t.label||t.name||R.categories?.[o]||_("chart.fallback.item",{number:o+1}):R.categories?.[o]||_("chart.fallback.item",{number:o+1}),axisLabel:m?t.xLabel??t.label??t.name??R.categories?.[o]??_("chart.fallback.item",{number:o+1}):R.categories?.[o]||_("chart.fallback.item",{number:o+1}),yLabel:m?t.yLabel??null:null,totalValue:N,usedValue:b,segments:C,maxSegmentKey:L?.key||null,seriesName:l?.name||"",seriesIndex:r}},V=e.computed(()=>{if(!rn.value)return[];const t=[];return ln.value.forEach((o,l)=>{wt.value.has(l)||!Array.isArray(o?.data)||o.data.forEach(r=>{const m=z(r,t.length,o,l);m.segments.length>0&&t.push(m)})}),t}),Q="auto",ee=(t,o,l,r=0,m=100)=>{let v=1/0,C=-1/0;if(t.forEach(N=>{N?.data?.length&&N.data.forEach(L=>{typeof L=="number"&&Number.isFinite(L)&&(v=Math.min(v,L),C=Math.max(C,L))})}),v===1/0)return{minY:r,maxY:m};let b;if(o===Q){const N=C-v,L=N>0?N*.1:1;b=Math.max(0,v-L)}else if(typeof o=="number")b=o;else{const N=C-v,L=N>0?N*.1:1;b=Math.max(0,v-L)}let F;if(l===Q){const N=C-v,L=N>0?N*.1:2;F=C+L}else if(typeof l=="number")F=l;else{const N=C-v,L=N>0?N*.1:2;F=C+L}return{minY:b,maxY:F}},ge=e.computed(()=>{if(Gt.value)return xl();if(rn.value)return Me();if(!Ql.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=0;Ql.value.forEach(l=>{l.data&&l.data.length&&(t=Math.max(t,l.data.length-1))}),R.categories.length>0&&(t=Math.max(t,R.categories.length-1));const o=ee(u.value.length?u.value:Ql.value,Yt.value,rt.value);return{minX:0,maxX:t,minY:o.minY,maxY:o.maxY}}),Me=()=>{const t=V.value,o=t.reduce((v,C)=>Math.max(v,C.totalValue),M.value),l=typeof Yt.value=="number"?Yt.value:0,r=typeof rt.value=="number"?rt.value:o,m=Math.max(r,l+1);return{minX:0,maxX:Math.max(t.length-1,0),minY:l,maxY:m}},ft=e.computed(()=>h.value?ee(p.value,Jt.value,yt.value,ge.value.minY,ge.value.maxY):{minY:ge.value.minY,maxY:ge.value.maxY}),xl=()=>{if(!Ql.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,o=-1/0,l=1/0,r=-1/0,m=1/0,v=-1/0,C=!1;if(Ql.value.forEach((Be,Ze)=>{Be?.data?.length&&Be.data.forEach((re,ye)=>{let Ee,ve,Xe;if(typeof re=="object"&&re!==null&&!Array.isArray(re))Ee=typeof re.x=="number"?re.x:ye,ve=typeof re.y=="number"?re.y:0,Xe=typeof re.size=="number"?re.size:20;else if(Array.isArray(re)&&re.length>=3)Ee=typeof re[0]=="number"?re[0]:ye,ve=typeof re[1]=="number"?re[1]:0,Xe=typeof re[2]=="number"?re[2]:20;else if(typeof re=="number")Ee=ye,ve=re,Xe=Ao(Ze,ye);else return;isFinite(Ee)&&isFinite(ve)&&isFinite(Xe)&&(t=Math.min(t,Ee),o=Math.max(o,Ee),l=Math.min(l,ve),r=Math.max(r,ve),m=Math.min(m,Xe),v=Math.max(v,Xe),C=!0)})}),!C)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===o&&(t=Math.min(t,0),o=Math.max(o,R.categories?.length-1||8)),l===r&&(l=Math.max(0,l-10),r=l+20);const b=o-t,F=r-l;let N,L,S,K;return ol.value!==null?N=ol.value:N=t-b*.1,U.value!==null?L=U.value:L=o+b*.1,Yt.value!==null&&typeof Yt.value=="number"?S=Yt.value:S=Math.max(0,l-F*.1),rt.value!==null&&typeof rt.value=="number"?K=rt.value:K=r+F*.1,{minX:N,maxX:L,minY:S,maxY:K,minSize:m,maxSize:v}},ht=t=>{if(Gt.value){const{minX:b,maxX:F}=ge.value,N=F-b||1;return I.value.left+(t-b)/N*I.value.width}const{minX:o,maxX:l}=ge.value,r=l-o;if(l===0||r===0)return I.value.left+I.value.width/2;const m=r/ce.value.scale,v=o-ce.value.offsetX/I.value.width*r,C=(t-v)/m;return I.value.left+C*I.value.width},Ft=t=>{const{minY:o,maxY:l}=ge.value,r=l-o||1;return I.value.bottom-(t-o)/r*I.value.height},gl=t=>{const{minY:o,maxY:l}=ft.value,r=l-o||1;return I.value.bottom-(t-o)/r*I.value.height},Ot=(t,o)=>h.value&&eo(t)==="secondary"?gl(o):Ft(o),yl=t=>{if(!Gt.value)return $t.value||4;const{maxSize:o}=ge.value,l=Math.max(1,o),r=Math.min(1,Math.max(0,t/l));return To.value+r*(Jn.value-To.value)},Al=(t,o=12,l="Arial, sans-serif")=>{if(typeof t!="string"||!t)return 0;if(typeof document>"u")return t.length*(o*.62);Al.canvas||(Al.canvas=document.createElement("canvas"));const r=Al.canvas.getContext("2d");return r?(r.font=`${o}px ${l}`,r.measureText(t).width):t.length*(o*.62)},nn=(t,o,l=12)=>{if(typeof t!="string"||typeof o!="number"||o<=0||Al(t,l)<=o)return t;const r="..";if(Al(r,l)>=o)return r;let v=t.length;for(;v>0;){const C=`${t.slice(0,v)}${r}`;if(Al(C,l)<=o)return C;v-=1}return r},bn=e.computed(()=>to.value.map(t=>({y:t.y}))),Co=e.computed(()=>!rn.value||!bt.value?[]:to.value.map(t=>({y:t.y}))),Do=e.computed(()=>!rn.value||!bt.value||!_t.value?[]:la.value.map(t=>({x:t.centerX}))),bo=e.computed(()=>{if(Gt.value)return Ho();if(rn.value)return ua();if(be.value==="bar"){if(fl.value){const Ve=[],{minY:De,maxY:Nt}=ge.value,It=5,Rl=Nt-De||1;for(let ml=0;ml<=It;ml++){const Wl=De+Rl*(ml/It),jn=Xl(Wl);Ve.push({x:jn,y:I.value.bottom+20,text:$(Math.round(Wl))})}return Ve}const ye=[],{maxX:Ee}=ge.value,ve=Ee+1,Xe=5,Te=(I.value.width-Xe*2)/ve;for(let Ve=0;Ve<=Ee;Ve++){const De=I.value.left+Xe+(Ve+.5)*Te;ye.push({x:De,y:I.value.bottom+20,text:nn(R.categories[Ve]||_("chart.fallback.item",{number:Ve+1}),Math.max(Te-8,24))})}return ye}const t=[],{minX:o,maxX:l}=ge.value,r=ol.value!==null?ol.value:o,m=U.value!==null?U.value:l,v=m-r||1,C=v/ce.value.scale,b=r-ce.value.offsetX/I.value.width*v,F=b+C,N=Math.max(0,Math.floor(b-2)),L=Math.min(m,Math.ceil(F+2)),S=L-N,K=I.value.width,Ze=Math.floor(K/60);let re=1;S>Ze&&(re=Math.ceil(S/Ze));for(let ye=N;ye<=L;ye+=re)if(ye>=0&&ye<=m){const Ee=ht(ye);Ee>=I.value.left-100&&Ee<=I.value.right+100&&t.push({x:Ee,y:I.value.bottom+20,text:R.categories[ye]||`Item ${ye+1}`})}return t}),Ho=()=>{const t=[],{minX:o,maxX:l}=ge.value,r=l-o||1,m=Math.min(8,Math.max(4,Math.floor(I.value.width/80)));for(let v=0;v<=m;v++){const C=o+r*v/m,b=ht(C);if(b>=I.value.left-10&&b<=I.value.right+10){const F=Math.round(C),N=R.categories?.[F];t.push({x:b,y:I.value.bottom+20,text:N||(Number.isInteger(C)?C.toString():C.toFixed(1))})}}return t},ua=()=>la.value.map(o=>({x:o.centerX,y:I.value.bottom+20,text:nn(o.axisLabel||o.label,Math.max(o.categoryWidth-8,24))})),to=e.computed(()=>{if(fl.value){const m=[],{maxX:v}=ge.value;for(let C=0;C<=v;C++)m.push({x:I.value.left-10,y:kn(C),text:nn(R.categories[C]||`Item ${C+1}`,Math.max(I.value.left-28,40))});return m}const t=[],{minY:o,maxY:l}=ge.value,r=5;for(let m=0;m<=r;m++){const v=o+(l-o)*(m/r),C=Math.round(v);t.push({x:I.value.left-10,y:Ft(v),text:$(C)})}return t}),lo=e.computed(()=>{if(!h.value||fl.value)return[];const t=[],{minY:o,maxY:l}=ft.value,r=5;for(let m=0;m<=r;m++){const v=o+(l-o)*(m/r),C=Math.round(v);t.push({x:I.value.right+10,y:gl(v),text:$(C)})}return t}),Qt=t=>{const o=jt.value;if(!o||o.length===0){const l=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return l[t%l.length]}return o[t%o.length]},cn=t=>{if(!t||typeof t!="string")return"#3a3a3a";const o=t.trim();let l=0,r=0,m=0;const v=o.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(v)l=Number(v[1])/255,r=Number(v[2])/255,m=Number(v[3])/255;else{const b=o.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(b)l=Number(b[1])/255,r=Number(b[2])/255,m=Number(b[3])/255;else{const F=o.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(F){let N=F[1];N.length===3&&(N=N[0]+N[0]+N[1]+N[1]+N[2]+N[2]),l=parseInt(N.slice(0,2),16)/255,r=parseInt(N.slice(2,4),16)/255,m=parseInt(N.slice(4,6),16)/255}else if(typeof document<"u"){const N=document.createElement("span");N.style.color=o,N.style.display="none",document.body.appendChild(N);const L=getComputedStyle(N).color;document.body.removeChild(N);const S=L.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(S)l=Number(S[1])/255,r=Number(S[2])/255,m=Number(S[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*l+.7152*r+.0722*m>.5?"#3a3a3a":"#fafafa"},Jl=t=>{if(!t||typeof t!="string")return t;const o=t.trim(),l=o.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(l){const v=Math.max(0,Math.floor(Number(l[1])*.65)),C=Math.max(0,Math.floor(Number(l[2])*.65)),b=Math.max(0,Math.floor(Number(l[3])*.65));return`rgb(${v}, ${C}, ${b})`}const r=o.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(r){const v=Math.max(0,Math.floor(Number(r[1])*.65)),C=Math.max(0,Math.floor(Number(r[2])*.65)),b=Math.max(0,Math.floor(Number(r[3])*.65));return`rgba(${v}, ${C}, ${b}, ${r[4]})`}const m=o.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(m){let v=m[1];v.length===3&&(v=v[0]+v[0]+v[1]+v[1]+v[2]+v[2]);const C=Math.max(0,Math.min(255,Math.floor(parseInt(v.slice(0,2),16)*.65))),b=Math.max(0,Math.min(255,Math.floor(parseInt(v.slice(2,4),16)*.65))),F=Math.max(0,Math.min(255,Math.floor(parseInt(v.slice(4,6),16)*.65)));return`#${[C,b,F].map(N=>N.toString(16).padStart(2,"0")).join("")}`}return o},Ol=(t,o)=>{const r=Z.value?.stroke?.color;return r==null?Jl(o):typeof r=="string"?r:Array.isArray(r)&&r.length?r[t%r.length]??Jl(o):Jl(o)},Ro=t=>{let o=0;for(let l=1;l<t.length;l++){const r=t[l].x-t[l-1].x,m=t[l].y-t[l-1].y;o+=Math.sqrt(r*r+m*m)}return o},da=e.computed(()=>be.value==="line"||Bl.value?(Bl.value?R.series.filter(o=>(o.type||be.value)==="line"):ln.value).map((o,l)=>{const r=R.series.findIndex(S=>S===o),m=[];let v=[];o.data.forEach((S,K)=>{S==null?v.length>0&&(m.push([...v]),v=[]):v.push({x:fl.value?Xl(S):ht(K),y:fl.value?kn(K):Ot(o,S),index:K})}),v.length>0&&m.push(v);let C="";m.forEach(S=>{if(S.length>0){let K="";xe.value?K=Bn(S):K=`M ${S[0].x} ${S[0].y}`+S.slice(1).map(Be=>` L ${Be.x} ${Be.y}`).join(""),C+=(C?" ":"")+K}});const b=m.reduce((S,K)=>S+Ro(K),0),F=wt.value.has(r),N=$e.value===r,L=$e.value!==null&&$e.value!==r;return{path:C,color:Qt(r),strokeDasharray:a(o),pathLength:b,seriesIndex:r,animationDelay:l*vl.value,isHighlighted:N,isDimmed:L,isHidden:F}}):[]),ma=e.computed(()=>{if(!(be.value==="line"||Bl.value))return[];const t=Bl.value?R.series.filter(l=>(l.type||be.value)==="line"):ln.value,o=[];return t.forEach((l,r)=>{const m=R.series.findIndex(v=>v===l);for(let v=0;v<l.data.length-1;v++){const C=l.data[v];if(C!=null){let b=-1,F=0;for(let N=v+1;N<l.data.length;N++){const L=l.data[N];if(L==null)F++;else{b=N;break}}if(F>0&&b!==-1){const N=l.data[b],L=fl.value?Xl(C):ht(v),S=fl.value?kn(v):Ot(l,C),K=fl.value?Xl(N):ht(b),Be=fl.value?kn(b):Ot(l,N),Ze=wt.value.has(m),re=$e.value===m,ye=$e.value!==null&&$e.value!==m;o.push({path:`M ${L} ${S} L ${K} ${Be}`,color:Qt(m),seriesIndex:m,animationDelay:r*vl.value,isHighlighted:re,isDimmed:ye,isHidden:Ze,gapSize:F}),v=b-1}}}}),o}),$a=e.computed(()=>be.value==="line"||Bl.value?!Kt.value||An.value||Wt.value.hasAnimated?[]:(Bl.value?R.series.filter(o=>(o.type||be.value)==="line"):ln.value).map((o,l)=>{const r=R.series.findIndex(F=>F===o);let m="",v=null;o.data.forEach((F,N)=>{if(F!=null){const L={x:fl.value?Xl(F):ht(N),y:fl.value?kn(N):Ot(o,F)};v===null?m+=`M ${L.x} ${L.y}`:m+=` L ${L.x} ${L.y}`,v=L}else if(v!==null){const L=o.data.findIndex((S,K)=>K>N&&S!==null&&S!==void 0);if(L!==-1){const S={x:fl.value?Xl(o.data[L]):ht(L),y:fl.value?kn(L):Ot(o,o.data[L])};m+=` L ${S.x} ${S.y}`,v=S}}});const C=o.data.map((F,N)=>F==null?null:{x:fl.value?Xl(F):ht(N),y:fl.value?kn(N):Ot(o,F)}).filter(F=>F!==null),b=Ro(C);return{path:m,pathLength:b,color:Qt(r),strokeDasharray:a(o),animationDelay:l*vl.value,seriesIndex:r}}):[]),La=e.computed(()=>{if(be.value!=="line")return[];const t=[];return ln.value.forEach((o,l)=>{const r=$e.value===l,m=$e.value!==null&&$e.value!==l,v=wt.value.has(l);o.data.forEach((C,b)=>{C!=null&&t.push({x:ht(b),y:Ot(o,C),color:Qt(l),value:C,label:R.categories[b]||b.toString(),seriesName:o.name,categoryIndex:b,dataIndex:b,animationDelay:(l*o.data.length+b)*(vl.value/8),isHighlighted:r,isDimmed:m,isHidden:v})})}),t}),Ta=e.computed(()=>{if(!Bl.value)return[];const t=[];return R.series.filter(l=>(l.type||be.value)==="line").forEach((l,r)=>{const m=R.series.findIndex(F=>F===l),v=$e.value===m,C=$e.value!==null&&$e.value!==m,b=wt.value.has(m);l.data.forEach((F,N)=>{F!=null&&t.push({x:ht(N),y:Ot(l,F),color:Qt(m),value:F,label:R.categories[N]||N.toString(),seriesName:l.name,categoryIndex:N,dataIndex:N,animationDelay:(r*l.data.length+N)*(vl.value/8),isHighlighted:v,isDimmed:C,isHidden:b})})}),t}),Fo=e.computed(()=>{if(!Gt.value)return[];const t=[];return ln.value.forEach((o,l)=>{if(!o?.data?.length)return;const r=$e.value,m=r!==null&&r===l,v=r!==null&&r!==l,C=wt.value.has(l);o.data.forEach((b,F)=>{let N,L,S,K,Be;if(typeof b=="object"&&b!==null&&!Array.isArray(b))N=typeof b.x=="number"?b.x:F,L=typeof b.y=="number"?b.y:0,S=typeof b.size=="number"?b.size:20,K=b.label||R.categories?.[F]||`Point ${F+1}`,Be=b.image||b.imageUrl;else if(Array.isArray(b)&&b.length>=3)N=typeof b[0]=="number"?b[0]:F,L=typeof b[1]=="number"?b[1]:0,S=typeof b[2]=="number"?b[2]:20,K=b[3]||R.categories?.[F]||`Point ${F+1}`,Be=b[4];else if(typeof b=="number")N=F,L=b,S=Ao(l,F),K=R.categories?.[F]||`Point ${F+1}`;else return;!isFinite(N)||!isFinite(L)||!isFinite(S)||t.push({x:ht(N),y:Ft(L),radius:yl(S),originalX:N,originalY:L,originalSize:S,color:Qt(l),seriesName:o.name||`Series ${l+1}`,label:K,imageUrl:Be,seriesIndex:l,dataIndex:F,categoryIndex:Math.round(N),isHighlighted:m,isDimmed:v,isHidden:C,opacity:Yl.value})})}),t}),ta=e.computed(()=>be.value!=="area"?[]:ln.value.map((t,o)=>{const l=[];let r=[];if(t.data.forEach((S,K)=>{S==null?r.length>0&&(l.push([...r]),r=[]):r.push({x:ht(K),y:Ot(t,S),index:K})}),r.length>0&&l.push(r),l.length===0)return{linePath:"",areaPath:"",color:Qt(o),isHidden:wt.value.has(o)};const m=I.value.bottom+1;let v="",C="";l.forEach((S,K)=>{if(S.length===0)return;let Be=`M ${S[0].x} ${S[0].y}`;xe.value&&S.length>1?Be=Bn(S):S.slice(1).forEach(re=>{Be+=` L ${re.x} ${re.y}`}),v+=(v?" ":"")+Be;let Ze=`M ${S[0].x} ${m}`;if(Ze+=` L ${S[0].x} ${S[0].y}`,xe.value&&S.length>1){const re=Bn(S),ye=re.substring(re.indexOf("C")||re.indexOf("Q")||re.indexOf("L"));ye?Ze+=" "+ye:S.slice(1).forEach(Ee=>{Ze+=` L ${Ee.x} ${Ee.y}`})}else S.slice(1).forEach(re=>{Ze+=` L ${re.x} ${re.y}`});Ze+=` L ${S[S.length-1].x} ${m} Z`,C+=(C?" ":"")+Ze});const b=$e.value===o,F=$e.value!==null&&$e.value!==o,N=wt.value.has(o),L=l.reduce((S,K)=>S+Ro(K),0);return{linePath:v,areaPath:C,color:Qt(o),pathLength:L,isHighlighted:b,isDimmed:F,isHidden:N}})),la=e.computed(()=>{if(!rn.value)return[];const t=V.value,o=t.length;if(!o)return[];const l=Math.max(I.value.width,0),r=o>0?l/o:l,m=Math.max(He.value,Ct.value),v=Math.min(ae.value,m),C=Math.max(4,Math.min(m,Math.max(He.value,v),Math.max(4,r*.62)));return t.map((b,F)=>{const N=I.value.left+(F+.5)*r,L=N-C/2;let S=0;const K=$e.value===b.seriesIndex,Be=$e.value!==null&&$e.value!==b.seriesIndex,Ze=wt.value.has(b.seriesIndex),re=Ft(b.totalValue),ye=Ft(0),Ee=Math.max(0,ye-re),ve=Math.min(nt.value,C/2,Ee/2),Xe=`stepbar-column-clip-${R.chartId}-${b.key}`,ze=ve>0&&Ee>0?[`M ${L} ${re+ve}`,`Q ${L} ${re} ${L+ve} ${re}`,`L ${L+C-ve} ${re}`,`Q ${L+C} ${re} ${L+C} ${re+ve}`,`L ${L+C} ${ye}`,`L ${L} ${ye}`,"Z"].join(" "):`M ${L} ${re} H ${L+C} V ${ye} H ${L} Z`,Te=b.segments.map((Ve,De)=>{const Nt=S,It=S+Ve.value;S=It;const Rl=Ft(It),ml=Ft(Nt),Wl=Math.max(0,ml-Rl),jn=De>0?1:0,ra=(F*b.segments.length+De)*(vl.value/5);return{key:`${b.key}-${Ve.key}`,x:L,y:Rl-jn,width:C,height:Wl+jn,color:Ve.color,value:Ve.value,label:b.label,axisLabel:b.axisLabel,yLabel:b.yLabel,segmentLabel:Ve.label,seriesName:Ve.label,tooltipTitle:`${Ve.label} - ${b.label}`,categoryIndex:F,dataIndex:F,animationDelay:ra,isHighlighted:K,isDimmed:Be,isHidden:Ze,isRemainder:Ve.isRemainder}});return{key:b.key,label:b.label,axisLabel:b.axisLabel,centerX:N,categoryWidth:r,clipPathId:Xe,clipPathRef:`url(#${Xe})`,clipPath:ze,segments:Te}})}),pa=e.computed(()=>{if(!(["bar"].includes(be.value)||Bl.value))return[];const t=[],{maxX:o}=ge.value,l=Bl.value?R.series.filter(m=>(m.type||be.value)==="bar"):ln.value,r=l.length;if(fl.value){const m=o+1,C=I.value.height/m,b=C*(2/3),F=Math.min(4,b/r*.15),N=b-(r-1)*F,L=Math.max(4,N/r);l.forEach((S,K)=>{const Be=R.series.findIndex(Ee=>Ee===S),Ze=$e.value===Be,re=$e.value!==null&&$e.value!==Be,ye=wt.value.has(Be);S.data.forEach((Ee,ve)=>{if(Ee==null||typeof Ee!="number"||!isFinite(Ee))return;const Te=I.value.top+(ve+.5)*C-b/2+K*(L+F),Ve=I.value.left,De=Math.abs(Xl(Ee)-I.value.left);let Nt="";if(xe.value&&De>0){const It=Math.min(Rt.value,L/2,De/2);Nt=[`M ${Ve} ${Te}`,`L ${Ve+De-It} ${Te}`,`Q ${Ve+De} ${Te} ${Ve+De} ${Te+It}`,`L ${Ve+De} ${Te+L-It}`,`Q ${Ve+De} ${Te+L} ${Ve+De-It} ${Te+L}`,`L ${Ve} ${Te+L}`,"Z"].join(" ")}t.push({x:Ve,y:Te,width:De,height:L,color:Qt(r===1?ve:Be),value:Ee,label:R.categories[ve]||ve.toString(),seriesName:S.name,animationDelay:(K*l.length+ve)*(vl.value/4),isHighlighted:Ze,isDimmed:re,isHidden:ye,barPath:Nt,isSmooth:xe.value&&De>0})})})}else{const m=o+1,C=I.value.width/m,b=C*.8,F=b/r,N=F*.05,L=F-N;l.forEach((S,K)=>{const Be=R.series.findIndex(Ee=>Ee===S),Ze=$e.value===Be,re=$e.value!==null&&$e.value!==Be,ye=wt.value.has(Be);S.data.forEach((Ee,ve)=>{if(Ee==null||typeof Ee!="number"||!isFinite(Ee))return;const Te=I.value.left+(ve+.5)*C-b/2+K*F+N/2,Ve=Ft(Math.max(0,Ee)),De=Math.abs(Ft(0)-Ft(Ee));let Nt="";if(xe.value&&De>0){const It=Math.min(Rt.value,L/2,De/2);Nt=[`M ${Te} ${Ve+De}`,`L ${Te} ${Ve+It}`,`Q ${Te} ${Ve} ${Te+It} ${Ve}`,`L ${Te+L-It} ${Ve}`,`Q ${Te+L} ${Ve} ${Te+L} ${Ve+It}`,`L ${Te+L} ${Ve+De}`,"Z"].join(" ")}t.push({x:Te,y:Ve,width:L,height:De,color:Qt(r===1?ve:Be),value:Ee,label:R.categories[ve]||ve.toString(),seriesName:S.name,animationDelay:(K*l.length+ve)*(vl.value/4),isHighlighted:Ze,isDimmed:re,isHidden:ye,barPath:Nt,isSmooth:xe.value&&De>0})})})}return t}),Ln=e.computed(()=>{if(!cl.value)return[];const t=ln.value.map((C,b)=>({series:C,originalIndex:b})).filter(({originalIndex:C})=>!wt.value.has(C));if(t.length===0)return[];let o=be.value==="semi-radial"?Math.PI:-Math.PI/2;const l=be.value==="semi-radial"?Math.PI:Math.PI*2,r=[],m=(C,b,F,N,L,S)=>{const K=C+(b-C)/2,Be=b-C,Ze=Dt.value+Math.cos(C)*hl.value,re=Pt.value+Math.sin(C)*hl.value,ye=Dt.value+Math.cos(b)*hl.value,Ee=Pt.value+Math.sin(b)*hl.value,ve=Dt.value+Math.cos(b)*Vt.value,Xe=Pt.value+Math.sin(b)*Vt.value,ze=Dt.value+Math.cos(C)*Vt.value,Te=Pt.value+Math.sin(C)*Vt.value,Ve=Be>Math.PI?1:0,De=[`M ${Ze} ${re}`,`A ${hl.value} ${hl.value} 0 ${Ve} 1 ${ye} ${Ee}`,`L ${ve} ${Xe}`,`A ${Vt.value} ${Vt.value} 0 ${Ve} 0 ${ze} ${Te}`,"Z"].join(" "),Nt=S||Qt(F);return{path:De,color:Nt,strokeWidth:Ht.value,strokeColor:Ol(r.length,Nt),value:L,seriesName:N,opacity:.8,isHighlighted:$e.value===F,isDimmed:$e.value!==null&&$e.value!==F,isHidden:!1,startAngle:C,endAngle:b,midAngle:K}};if(Gl.value){const{series:C,originalIndex:b}=t[0],F=Number(C?.data?.[0]??0),N=Number.isFinite(F)?Math.min(Math.max(F,0),100):0,L=Z.value,S=Math.min(Math.max(Number(L?.miniRadial?.minVisiblePercent??1),0),100),Be=(N<=0?S:N)/100*l,Ze=Number(L?.miniRadial?.thresholds?.low??33),re=Number(L?.miniRadial?.thresholds?.medium??66),ye=L?.miniRadial?.colors?.low||"#E53E3E",Ee=L?.miniRadial?.colors?.medium||"#ED8936",ve=L?.miniRadial?.colors?.high||"#38A169",Xe=N<=Ze?ye:N<=re?Ee:ve,ze=L?.miniRadial?.trackColor||"#E5E7EB",Te=C?.name||"Score";return r.push(m(o,o+l-.001,b+1,"Track",100,ze)),r.push(m(o,o+Be,b,Te,N,Xe)),r}if(t.length===1){const{series:C,originalIndex:b}=t[0],F=C.data[0]||0,N=o,L=o+l-.001,S=N+l/2,K=Dt.value+Math.cos(N)*hl.value,Be=Pt.value+Math.sin(N)*hl.value,Ze=Dt.value+Math.cos(L)*hl.value,re=Pt.value+Math.sin(L)*hl.value,ye=Dt.value+Math.cos(L)*Vt.value,Ee=Pt.value+Math.sin(L)*Vt.value,ve=Dt.value+Math.cos(N)*Vt.value,Xe=Pt.value+Math.sin(N)*Vt.value,ze=1,Te=[`M ${K} ${Be}`,`A ${hl.value} ${hl.value} 0 ${ze} 1 ${Ze} ${re}`,`L ${ye} ${Ee}`,`A ${Vt.value} ${Vt.value} 0 ${ze} 0 ${ve} ${Xe}`,"Z"].join(" "),Ve=Qt(b);return r.push({path:Te,color:Ve,strokeWidth:Ht.value,strokeColor:Ol(0,Ve),value:F,seriesName:C.name,opacity:.8,isHighlighted:$e.value===b,isDimmed:!1,isHidden:!1,startAngle:N,endAngle:L,midAngle:S}),r}if(Xn.value&&t.length===2){const C=t[0],b=t[1],F=Math.min(100,Math.max(0,C.series.data[0]||0)),N=F/100*l;return r.push(m(o,o+N,C.originalIndex,C.series.name,F)),r.push(m(o,o+l,b.originalIndex,b.series.name,100)),r}const v=t.reduce((C,{series:b})=>C+(b.data[0]||0),0);return v===0?[]:(t.forEach(({series:C,originalIndex:b})=>{const F=C.data[0]||0,N=F/v*l,L=o,S=o+N,K=L+N/2,Be=Dt.value+Math.cos(L)*hl.value,Ze=Pt.value+Math.sin(L)*hl.value,re=Dt.value+Math.cos(S)*hl.value,ye=Pt.value+Math.sin(S)*hl.value,Ee=Dt.value+Math.cos(S)*Vt.value,ve=Pt.value+Math.sin(S)*Vt.value,Xe=Dt.value+Math.cos(L)*Vt.value,ze=Pt.value+Math.sin(L)*Vt.value,Te=N>Math.PI?1:0,Ve=[`M ${Be} ${Ze}`,`A ${hl.value} ${hl.value} 0 ${Te} 1 ${re} ${ye}`,`L ${Ee} ${ve}`,`A ${Vt.value} ${Vt.value} 0 ${Te} 0 ${Xe} ${ze}`,"Z"].join(" "),De=Qt(b);r.push({path:Ve,color:De,strokeWidth:Ht.value,strokeColor:Ol(r.length,De),value:F,seriesName:C.name,opacity:.8,isHighlighted:$e.value===b,isDimmed:$e.value!==null&&$e.value!==b,isHidden:!1,startAngle:L,endAngle:S,midAngle:K}),o=S}),r)}),Aa=e.computed(()=>{const t=Ln.value;return Xn.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((o,l)=>({segment:o,originalIndex:l}))}),Da=e.computed(()=>{if(!Vl.value||!cl.value)return[];const t=an.value,o=al.value,l=At.value,r=Pn.value,m=15,v=t*1.3,C=.55,b=(S,K)=>{const Be=Dt.value+Math.cos(S.midAngle)*Vt.value,Ze=Pt.value+Math.sin(S.midAngle)*Vt.value,re=Dt.value+Math.cos(S.midAngle)*(Vt.value+o),ye=Pt.value+Math.sin(S.midAngle)*(Vt.value+o),ve=re+l*(K?1:-1),Xe=K?re+m:re-m,ze=ye-r,Te=`${S.seriesName}: ${$(S.value)}`,Ve=Te.length*t*C;return{pointerStartX:Be,pointerStartY:Ze,pointerEndX:re,pointerEndY:ye,horizontalEndX:ve,horizontalEndY:ye,textX:Xe,textY:ze,text:Te,textWidth:Ve,textAnchor:K?"start":"end",isRightSide:K,pointerLineLength:Math.hypot(re-Be,ye-Ze),horizontalLineLength:Math.hypot(ve-re,0)}},F=(S,K)=>{const Be=Math.abs(S.textY-K.textY)<v,Ze=S.isRightSide?S.textX:S.textX-S.textWidth,re=S.isRightSide?S.textX+S.textWidth:S.textX,ye=K.isRightSide?K.textX:K.textX-K.textWidth,Ee=K.isRightSide?K.textX+K.textWidth:K.textX,ve=Ze<Ee&&ye<re;return Be&&ve},N=Ln.value.filter(S=>!S.isHidden),L=[];for(let S=0;S<N.length;S++){const K=N[S];let Be=Math.cos(K.midAngle)>=0;if(S>0){const re=L[S-1],ye=b(K,Be);F(re,ye)&&(Be=!Be)}const Ze=b(K,Be);L.push({...Ze,color:K.color,isHighlighted:K.isHighlighted,isDimmed:K.isDimmed})}return L}),Ha=t=>{if(!t||t.isHidden)return 0;const o=t.opacity||Yl.value||.7;return $e.value===null||$e.value===void 0?o:$e.value!==null?t.seriesIndex===$e.value?Math.min(1,o+.1):Math.max(.5,o*.8):o},Ra=t=>{if(!t||t.isHidden)return 0;const o=t.radius>20?.9:.8;return $e.value!==null?t.seriesIndex===$e.value?Math.min(1,o+.1):o*.7:o},va=(t,o)=>{if(t)try{if($e.value===t.seriesIndex?$e.value=null:$e.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const l=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:o,chartId:R.chartId}});window.dispatchEvent(l)}}catch(l){console.error("Error in onBubbleClick:",l)}},Fa=(t,o)=>{const l=[`dss-bubble-fallback-${o}`];return t.isHighlighted&&l.push("dss-bubble-highlighted"),t.isDimmed&&l.push("dss-bubble-dimmed"),t.isHidden&&l.push("dss-bubble-hidden"),l.push(`dss-bubble-series-${t.seriesIndex}`),l.join(" ")},fa=(t,o)=>{if(!t||(o.stopPropagation(),zo.value=!0,$e.value=t.seriesIndex,ot.value.show=!1,!Ie.value))return;const l=o.target.closest(".dss-custom-chart-container");if(!l)return;const r=l.getBoundingClientRect();let m=o.clientX-r.left+10,v=o.clientY-r.top-10;const C=200,b=120;m+C>Se.value&&(m=o.clientX-r.left-C-10),v+b>r.height&&(v=o.clientY-r.top-b-10),m<0&&(m=10),v<0&&(v=10);const F=ll.value,N=Wn.value,L=F.map(S=>{const K=N[S]||S,Be=ha(S,t);return Be?{seriesName:t.seriesName,label:t.label,value:`${K}: ${Be}`,color:t.color}:null}).filter(Boolean);dt.value={show:!0,x:m,y:v,title:t.label||t.seriesName||"",value:"",bubbleData:L,categoryIndex:void 0,spiderAreas:[]}},ha=(t,o)=>{let l;switch(t){case"x":l=o.originalX;break;case"y":l=o.originalY;break;case"size":l=o.originalSize;break;case"label":l=o.label;break;case"seriesName":l=o.seriesName;break;default:l=o[t]||""}const r=dl.value[t];if(typeof r=="function")return r(l,o);if(typeof l=="number"){const m=l.toFixed(1);return pn.value?m+pn.value:m}return l?.toString()||""},Ia=()=>{if(!Gt.value||!ot.value.data||ot.value.data.length===0)return"Bubbles";const t=[],o=new Set;return ot.value.data.forEach(l=>{if(l.seriesName&&l.label){const r=`${l.seriesName} - ${l.label}`;o.has(r)||(t.push(r),o.add(r))}else l.seriesName&&(o.has(l.seriesName)||(t.push(l.seriesName),o.add(l.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},ga=(t,o)=>{t&&(zo.value=!1,$e.value=null,dt.value.show=!1,dt.value.bubbleData=[])},za=(t,o)=>{const l=o.target.closest(".dss-custom-chart-container");if(!l)return;const r=l.getBoundingClientRect(),m=Ul(t.categoryIndex),v=t.description||t.comment||"";let C=o.clientX-r.left+15,b=o.clientY-r.top-10;const F=200,N=v?80:50;C+F>Se.value&&(C=o.clientX-r.left-F-15),b+N>ie.value&&(b=o.clientY-r.top-N-10),C<0&&(C=10),b<0&&(b=10),sl.value={show:!0,x:C,y:b,categoryValue:m,description:v}},Pa=()=>{sl.value.show=!1},no=e.computed(()=>R.categories.length||Math.max(...Ql.value.map(t=>t.data.length))),Oa=e.computed(()=>{let t=0;return Ql.value.forEach(o=>{o.data.forEach(l=>{typeof l=="number"&&(t=Math.max(t,l))})}),t||100}),ya=e.computed(()=>{const t=[],o=no.value;for(let l=0;l<o;l++){const r=l*2*Math.PI/o-Math.PI/2,m=Dt.value+Math.cos(r)*Vt.value,v=Pt.value+Math.sin(r)*Vt.value;t.push({x:m,y:v,angle:r,index:l})}return t}),Wa=e.computed(()=>{const t=[],o=no.value;return ya.value.forEach((l,r)=>{const m=Vt.value+15,v=r*2*Math.PI/o-Math.PI/2,C=Dt.value+Math.cos(v)*m,b=Pt.value+Math.sin(v)*m+5;let F="middle",N="middle";Math.abs(Math.cos(v))>.5&&(F=Math.cos(v)>0?"start":"end"),Math.abs(Math.sin(v))>.5&&(N=Math.sin(v)>0?"hanging":"auto"),t.push({x:C,y:b,text:R.categories[r]||`Axis ${r+1}`,anchor:F,baseline:N})}),t}),qa=e.ref(new Set),Za=(t,o,l)=>{const r=`current-${l}`,m=qa.value.has(r),v=o.fillOpacity??Dl.value;return!m&&$e.value===null?v:o.isHighlighted||m?o.isComparison?v:v+.15:o.isDimmed?v*.3:v},ka=e.computed(()=>{if(!rl.value)return[];const t=[],o=no.value;return ln.value.map((r,m)=>({series:r,seriesIndex:m})).sort((r,m)=>{const v=n(r.series)?0:1,C=n(m.series)?0:1;return v-C}).forEach(({series:r,seriesIndex:m})=>{const v=n(r),C=[],b=[],F=[],N=$e.value===m,L=$e.value!==null&&$e.value!==m,S=wt.value.has(m);for(let K=0;K<o;K++){const Be=r.data[K]||0,re=Be/Oa.value*Vt.value,ye=K*2*Math.PI/o-Math.PI/2,Ee=Dt.value+Math.cos(ye)*re,ve=Pt.value+Math.sin(ye)*re;C.push(`${Ee},${ve}`),b.push({x:Ee,y:ve}),F.push({x:Ee,y:ve,value:Be,label:R.categories[K]||`Axis ${K+1}`,seriesName:r.name})}t.push({points:C.join(" "),polygonPoints:b,dataPoints:F,color:c(r,m),fillOpacity:v?s.value.fillOpacity:Dl.value,strokeDasharray:v?a(r)||s.value.strokeDasharray:null,pointRadius:i(r,v),seriesName:r.name,value:`${r.name}: ${r.data.join(", ")}`,isHighlighted:N,isDimmed:L,isHidden:S,isComparison:v,seriesIndex:m})}),t}),Ua=(t,o)=>{if(!o||o.length<3)return!1;let l=!1;for(let r=0,m=o.length-1;r<o.length;m=r++){const v=o[r].x,C=o[r].y,b=o[m].x,F=o[m].y;C>t.y!=F>t.y&&t.x<(b-v)*(t.y-C)/(F-C)+v&&(l=!l)}return l},Xa=t=>{if(!rl.value)return;const o=t.currentTarget.closest(".dss-custom-chart-container");if(!o)return;const l=o.getBoundingClientRect(),r=T.value?.getBoundingClientRect();if(!r)return;const m=t.clientX-r.left,v=t.clientY-r.top,C=ka.value.filter(b=>b.isHidden?!1:Ua({x:m,y:v},b.polygonPoints));if(C.length>0){C.length,$e.value=C[0].seriesIndex;const b=t.clientX-l.left+10,F=t.clientY-l.top-10,N=C.length>1?460:260,L=70+no.value*20;let S=b,K=F;S+N>Se.value&&(S=t.clientX-l.left-N-10),K+L>ie.value&&(K=t.clientY-l.top-L-10),S<0&&(S=10),K<0&&(K=10);const Be=C.map(Ze=>({seriesName:Ze.seriesName,color:Ze.color,points:Ze.dataPoints.map(re=>({label:re.label,value:$(re.value)}))}));dt.value={show:!0,x:S,y:K,title:"",value:"",bubbleData:[],spiderAreas:Be}}else un()},Io=e.computed(()=>{const t=Z.value;return t.logos.map((o,l)=>{const r=R.series[o.seriesIndex];if(!r||!r.data||r.data.length===0||wt.value.has(o.seriesIndex))return null;let m,v;if(Nl.value){let b=-1,F=null;for(let L=r.data.length-1;L>=0;L--)if(r.data[L]!==null&&r.data[L]!==void 0){b=L,F=r.data[L];break}if(b===-1||F===null)return null;const N=r.data.map((L,S)=>L==null?null:{x:ht(S),y:Ot(r,L),index:S}).filter(L=>L!==null);if(t.animations.enabled&&!An.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(Wt.value.isAnimating||!Wt.value.hasAnimated))if(Wt.value.isAnimating){const L=Wt.value.currentFrame/Wt.value.totalFrames,S=aa(t.animations.easing,Math.min(L,1)),K=ls(N,S);m=K.x+(o.offsetX||0),v=K.y+(o.offsetY||0)}else m=N[0].x+(o.offsetX||0),v=N[0].y+(o.offsetY||0);else m=ht(b)+(o.offsetX||0),v=Ft(F)+(o.offsetY||0)}else if(cl.value||rl.value){const b=Math.PI*2/t.logos.length*l;m=Dt.value+Math.cos(b)*(Vt.value+30)+(o.offsetX||0),v=Pt.value+Math.sin(b)*(Vt.value+30)+(o.offsetY||0)}return{...o,x:m,y:v,seriesIndex:o.seriesIndex}}).filter(Boolean)}),Ya=t=>{const o=document.querySelector(`.dss-logo-fallback-${t}`),l=document.querySelector(`.dss-logo-image-${t}`);o&&(o.style.opacity="0"),l&&(l.style.opacity="1")},ja=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const o=document.querySelector(`.dss-logo-image-${t}`);o&&(o.style.display="none")},na=t=>{wt.value.has(t)?wt.value.delete(t):wt.value.add(t)},Ka=e.computed(()=>{if(!dt.value.show&&!(Ue.value&&ot.value.show&&!ce.value.isZooming))return{display:"none"};let t,o;if(Ue.value&&ot.value.show&&!ce.value.isZooming){t=ot.value.x+15,o=I.value.top;const l=Gt.value?200:150;t+l>Se.value&&(t=ot.value.x-l-15),t<0&&(t=10),o<10&&(o=10)}else t=dt.value.x,o=dt.value.y;return{left:t+"px",top:o+"px"}}),Tn=(t,o)=>{if(!Ie.value||wo.value)return;const r=o.target.closest(".dss-custom-chart-container").getBoundingClientRect();let m=o.clientX-r.left+10,v=o.clientY-r.top-10;const C=200,b=120,F=Se.value,N=ie.value;m+C>F&&(m=o.clientX-r.left-C-10),v+b>N&&(v=o.clientY-r.top-b-10),m<0&&(m=10),v<0&&(v=10);let L;typeof t.categoryIndex=="number"?L=t.categoryIndex:typeof t.dataIndex=="number"?L=t.dataIndex:t.label&&R.categories.includes(t.label)&&(L=R.categories.indexOf(t.label));let S=t.seriesName||t.label||"";(fl.value||be.value==="bar")&&t.label&&(S=t.label),t.tooltipTitle&&(S=t.tooltipTitle),dt.value={show:!0,x:m,y:v,title:S,value:$(t.value)||"",categoryIndex:L,spiderAreas:[]}},oa=e.ref(!1),zo=e.ref(!1),un=()=>{dt.value.show=!1,dt.value.spiderAreas=[],dt.value.bubbleData=[],ot.value.show=!1,oa.value||($e.value=null)},wo=e.ref(!1),xo=(t,o)=>{wo.value=!0,dt.value.show=!1,ot.value.show=!1;const r=o.target.closest(".dss-custom-chart-container").getBoundingClientRect();let m=o.clientX-r.left+15,v=o.clientY-r.top-10;const C=250;m+C>Se.value&&(m=o.clientX-r.left-C-15),m<0&&(m=10),v<0&&(v=10),Il.value={show:!0,x:m,y:v,content:t.texts,count:t.totalCount}},Eo=()=>{wo.value=!1,Il.value.show=!1},Wt=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),aa=(t,o)=>{switch(t){case"linear":return o;case"ease":return o<.5?2*o*o:-1+(4-2*o)*o;case"ease-in":return o*o;case"ease-out":return o*(2-o);case"ease-in-out":return o<.5?2*o*o:-1+(4-2*o)*o;default:return o}},An=e.computed(()=>wn.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Ca=()=>{if(!Kt.value||An.value){Wt.value.hasAnimated=!0,_l.value&&(_n.value=1);return}_l.value&&(_n.value=0),Wt.value.isAnimating=!0,Wt.value.currentFrame=0,Wt.value.totalFrames=Math.ceil(jl.value/16.67);const t=()=>{const o=Wt.value.currentFrame/Wt.value.totalFrames,l=aa(il.value,Math.min(o,1));Ga(l),_l.value&&(_n.value=l),o<1?(Wt.value.currentFrame++,Wt.value.animationId=requestAnimationFrame(t)):Qa()};Wt.value.animationId=requestAnimationFrame(t)},Ga=t=>{const o=P.value;o&&o.style.setProperty("--dss-animation-progress",t)},Qa=()=>{Wt.value.isAnimating=!1,Wt.value.hasAnimated=!0,_l.value&&(_n.value=1),Wt.value.animationId&&(cancelAnimationFrame(Wt.value.animationId),Wt.value.animationId=null)},sa=e.computed(()=>!cl.value||Wt.value.hasAnimated?!0:_l.value?_n.value>=1:Cn.value?Mn.value>=1:!0),ba=e.computed(()=>Vl.value&&sa.value),Po=e.ref(!1);e.watch(ba,t=>{t?(Po.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Po.value=!0})})):Po.value=!1},{immediate:!0});const Ja=e.computed(()=>{if(!Kt.value||An.value||Wt.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${jl.value}ms`,t["--dss-animation-easing"]=es(il.value),t["--dss-stagger-delay"]=`${vl.value}ms`,t}),es=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",ts=()=>{if(!Kt.value||An.value)return"";const t=["dss-chart-animated"];return Wt.value.hasAnimated||t.push(`dss-animate-${ql.value}`),Wt.value.hasAnimated||(cl.value&&be.value!=="semi-radial"?t.push("dss-animate-fill"):cl.value||t.push(`dss-animate-${ql.value}`)),Wt.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>R.series,(t,o)=>{dn.value&&o&&Wt.value.hasAnimated&&(Wt.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Ca(),El.value)}))},{deep:!0}),e.watch(()=>ce.value.isZooming,(t,o)=>{o&&!t&&setTimeout(()=>{So()},50)}),e.watch(()=>[ce.value.scale,ce.value.offsetX],()=>{!ce.value.isZooming&&!ce.value.isDragging&&So()},{flush:"post"}),e.watch([Ut,qe],([t,o])=>{ce.value.minScale=t,ce.value.maxScale=o,(ce.value.scale<t||ce.value.scale>o)&&tn()},{immediate:!0}),e.watch(()=>R.locale,t=>{t&&t!==B.value&&(B.value=t)},{immediate:!0}),e.watch(()=>mt.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",fo)}):document.removeEventListener("click",fo)}),e.onMounted(()=>{$e.value=null,_l.value&&(!Kt.value||An.value)&&(_n.value=1),jo(),P.value&&typeof ResizeObserver<"u"&&(f=new ResizeObserver(t=>{const o=t[0];!o||!o.contentRect||(we&&cancelAnimationFrame(we),we=requestAnimationFrame(()=>{we=null;const{width:l,height:r}=o.contentRect;st.value=Math.round(l),te.value=Math.round(r),he.value&&(Le.value=he.value.offsetHeight||Ce)}))}),f.observe(P.value)),Kt.value&&!An.value?be.value==="semi-radial"?setTimeout(()=>ea(),El.value):setTimeout(()=>Ca(),El.value):(Wt.value.hasAnimated=!0,be.value==="semi-radial"&&(Mn.value=1)),document.addEventListener("mousemove",wa),document.addEventListener("mouseup",xa),document.addEventListener("click",Zn)}),e.onUnmounted(()=>{we&&cancelAnimationFrame(we),f&&P.value&&(f.unobserve(P.value),f.disconnect(),f=null),Wt.value.animationId&&cancelAnimationFrame(Wt.value.animationId),Yn&&(cancelAnimationFrame(Yn),Yn=null),ce.value.zoomTimeout&&clearTimeout(ce.value.zoomTimeout),document.removeEventListener("mousemove",wa),document.removeEventListener("mouseup",xa),document.removeEventListener("click",Zn),document.removeEventListener("click",fo)});const wa=t=>{if(ce.value.isDragging&&ce.value.scale>1&&Nl.value){ot.value.show=!1;const o=t.clientX-ce.value.lastMouseX,{minX:l,maxX:r}=ge.value,m=r-l||1,C=o*.8;ce.value.offsetX+=C;const b=m/ce.value.scale,F=m-b,N=0,L=-F/m*I.value.width,S=N;ce.value.offsetX=Math.max(L,Math.min(S,ce.value.offsetX)),ce.value.lastMouseX=t.clientX,ce.value.lastMouseY=t.clientY}},xa=()=>{ce.value.isDragging&&(ce.value.isDragging=!1,setTimeout(()=>{!ce.value.isDragging&&ce.value.isZooming},100))},ls=(t,o)=>{const l=t.filter(b=>b!=null);if(!l||l.length===0)return{x:0,y:0};if(l.length===1||o<=0)return l[0];if(o>=1)return l[l.length-1];let r=0;const m=[];for(let b=1;b<l.length;b++){const F=l[b].x-l[b-1].x,N=l[b].y-l[b-1].y,L=Math.sqrt(F*F+N*N);m.push(L),r+=L}const v=r*o;let C=0;for(let b=0;b<m.length;b++){const F=C+m[b];if(v<=F){const N=(v-C)/m[b],L=l[b],S=l[b+1];return{x:L.x+(S.x-L.x)*N,y:L.y+(S.y-L.y)*N}}C=F}return l[l.length-1]};return(t,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[ts(),{"dss-chart-fill-width":Fe.value,"dss-chart-fill-height":We.value,"dss-chart-compact":cl.value&&!W.value}]]),style:e.normalizeStyle({width:Fe.value?"100%":Se.value+"px",height:Ge.value,...Fe.value||We.value?{overflow:cl.value?"visible":"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...Ja.value,cursor:Nn()}),"data-chart-type":be.value,ref_key:"containerEl",ref:P,onWheel:Mo,onMousedown:_o,onMousemove:g,onMouseup:yn,onMouseleave:x,onDblclick:tn,onContextmenu:e.withModifiers(q,["prevent"]),onClick:e.withModifiers(ue,["left"]),onWheelCapture:Mo},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:he},[e.createElementVNode("div",Js,[ct.value?(e.openBlock(),e.createElementBlock("div",er,e.toDisplayString(ct.value),1)):e.createCommentVNode("",!0),gt.value?(e.openBlock(),e.createElementBlock("div",tr,e.toDisplayString(gt.value),1)):e.createCommentVNode("",!0)]),W.value&&G.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Ne.value==="horizontal","dss-legend-vertical":Ne.value==="vertical","dss-legend-top":G.value==="top","dss-legend-bottom":G.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":wt.value.has(r),"dss-legend-hovered":$e.value===r,"dss-legend-dimmed":$e.value!==null&&$e.value!==r}]),onClick:m=>na(r),onMouseenter:m=>zl(r),onMouseleave:y,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":rl.value&&n(l)}]),style:e.normalizeStyle({backgroundColor:rl.value&&n(l)?"transparent":d(l,r),borderColor:d(l,r)})},null,6),e.createElementVNode("span",nr,e.toDisplayString(l.name),1)],46,lr))),128))],2)):e.createCommentVNode("",!0),W.value&&(G.value==="left"||G.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":G.value==="left","dss-legend-right":G.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":wt.value.has(r),"dss-legend-hovered":$e.value===r,"dss-legend-dimmed":$e.value!==null&&$e.value!==r}]),onClick:m=>na(r),onMouseenter:m=>zl(r),onMouseleave:y,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":rl.value&&n(l)}]),style:e.normalizeStyle({backgroundColor:rl.value&&n(l)?"transparent":d(l,r),borderColor:d(l,r)})},null,6),e.createElementVNode("span",ar,e.toDisplayString(l.name),1)],46,or))),128))],2)):e.createCommentVNode("",!0)],512),E.showAddMarkerButton&&on.value&&bl.value.addMarker&&(Nl.value||Gt.value)&&!rn.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Kn,title:e.unref(_)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Kl.value,class:"dss-add-marker-button-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,rr),o[4]||(o[4]=e.createElementVNode("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 4V16M4 10H16",stroke:"hsl(60, 2%, 47%)","stroke-width":"2","stroke-linecap":"round"})],-1))],8,sr)):e.createCommentVNode("",!0),e.createElementVNode("div",ir,[Gt.value&&ut.value?(e.openBlock(),e.createElementBlock("div",cr,"Bubble size: "+e.toDisplayString(ut.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Se.value,height:ie.value,class:"dss-chart-svg","data-smooth":xe.value,"data-animated":Kt.value,ref_key:"svgEl",ref:T},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:X.value},[e.createElementVNode("rect",{x:0,y:I.value.top,width:Se.value,height:I.value.height*4},null,8,mr)],8,dr),Cn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:ho.value},[e.createElementVNode("path",{d:Jo.value},null,8,vr)],8,pr)):e.createCommentVNode("",!0),_l.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:Fn.value},[e.createElementVNode("path",{d:yo.value},null,8,hr)],8,fr)):e.createCommentVNode("",!0)]),Nl.value||Gt.value?(e.openBlock(),e.createElementBlock("g",gr,[ke.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":fe.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bn.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${r}`,x1:I.value.left,x2:I.value.right,y1:l.y,y2:l.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${r*50}ms`})},null,12,kr))),128))],8,yr)):e.createCommentVNode("",!0),rn.value&&Co.value.length?(e.openBlock(),e.createElementBlock("g",{key:1,class:"dss-stepbar-axis-bars","clip-path":fe.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Co.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`stepbar-axis-bar-${r}`,x1:I.value.left,x2:I.value.right,y1:l.y,y2:l.y,stroke:St.value,"stroke-width":zt.value,"stroke-dasharray":Bt.value,opacity:Lt.value},null,8,br))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Do.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`stepbar-vertical-axis-bar-${r}`,x1:l.x,x2:l.x,y1:I.value.top,y2:I.value.bottom,stroke:St.value,"stroke-width":zt.value,"stroke-dasharray":Bt.value,opacity:Lt.value*.7},null,8,wr))),128))],8,Cr)):e.createCommentVNode("",!0),e.createElementVNode("g",xr,[e.createElementVNode("line",{x1:I.value.left,x2:I.value.right,y1:I.value.bottom,y2:I.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Er),e.createElementVNode("line",{x1:I.value.left,x2:I.value.left,y1:I.value.top,y2:I.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Sr),h.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:I.value.right,x2:I.value.right,y1:I.value.top,y2:I.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Vr)):e.createCommentVNode("",!0)]),e.createElementVNode("g",Nr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bo.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${r}`,x:l.x,y:l.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${r*100}ms`})},e.toDisplayString(l.text),13,Br))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(to.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${r}`,x:l.x,y:l.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${r*80}ms`})},e.toDisplayString(l.text),13,Mr))),128)),h.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(lo.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{key:`y-secondary-${r}`,x:l.x,y:l.y,"text-anchor":"start","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${r*80}ms`})},e.toDisplayString(l.text),13,_r))),128)):e.createCommentVNode("",!0),qt.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:I.value.left+I.value.width/2,y:I.value.bottom+45,"text-anchor":"middle","font-size":"14",fill:"#666"},e.toDisplayString(qt.value),9,$r)):e.createCommentVNode("",!0),Zt.value?(e.openBlock(),e.createElementBlock("text",{key:2,x:15,y:I.value.top+12+I.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(-90, 15, ${I.value.top+I.value.height/2})`},e.toDisplayString(Zt.value),9,Lr)):e.createCommentVNode("",!0),h.value&&xt.value?(e.openBlock(),e.createElementBlock("text",{key:3,x:Se.value-15,y:I.value.top+12+I.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(90, ${Se.value-15}, ${I.value.top+I.value.height/2})`},e.toDisplayString(xt.value),9,Tr)):e.createCommentVNode("",!0)]),On.value.length>0?(e.openBlock(),e.createElementBlock("g",Ar,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(On.value,l=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${l.categoryIndex}`},[e.createElementVNode("g",{"clip-path":fe.value},[l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:l.x,x2:l.x,y1:I.value.bottom,y2:I.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>xo(l,r),onMouseleave:Eo},null,40,Hr)):e.createCommentVNode("",!0),l.hasAuto&&!l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:l.x,x2:l.x,y1:I.value.bottom,y2:I.value.top,stroke:"#a1d499","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>xo(l,r),onMouseleave:Eo},null,40,Rr)):e.createCommentVNode("",!0),l.hasAuto&&l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:l.x,x2:l.x,y1:I.value.bottom,y2:I.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>xo(l,r),onMouseleave:Eo},null,40,Fr)):e.createCommentVNode("",!0)],8,Dr),l.hasManual&&l.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x+8,cy:Math.max(15,I.value.top-10),r:"14",fill:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:r=>xo(l,r),onMouseleave:Eo},null,40,Ir)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:l.x,cy:Math.max(15,I.value.top-10),r:"14",fill:l.hasManual&&l.hasAuto||l.hasManual?"#698dbe":"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:r=>xo(l,r),onMouseleave:Eo},null,40,zr),e.createElementVNode("text",{x:l.x,y:Math.max(15,I.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(l.totalCount),9,Pr)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":fe.value},[Bl.value?(e.openBlock(),e.createElementBlock("g",Wr,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":fl.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pa.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${r}`},[l.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:l.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({fill:l.color,fillOpacity:l.isDimmed?.4:1,animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>Tn(l,m),onMouseleave:un},null,46,qr)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x,y:l.y,width:l.width,height:l.height,fill:l.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>Tn(l,m),onMouseleave:un},null,46,Zr))],64))),128))],2),e.createElementVNode("g",Ur,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(da.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Pe.value+2:Pe.value,"stroke-dasharray":l.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,Xr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ma.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Pe.value+2:Pe.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:l.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Yr))),128)),$t.value>0||oe.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Ta.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${r}`,cx:l.x,cy:l.y,r:j(l.isHighlighted?Y(l,$t.value)+2:Y(l,$t.value)),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>Tn(l,m),onMouseleave:un},null,46,jr))),128)):e.createCommentVNode("",!0)])])):be.value==="line"?(e.openBlock(),e.createElementBlock("g",Kr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($a.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${r}`,d:l.path,stroke:l.color,"stroke-width":Pe.value,"stroke-dasharray":l.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":Wt.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,Gr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(da.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Pe.value+2:Pe.value,"stroke-dasharray":l.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,Qr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ma.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Pe.value+2:Pe.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:l.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Jr))),128)),$t.value>0||oe.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(La.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${r}`,cx:l.x,cy:l.y,r:j(l.isHighlighted?Y(l,$t.value)+2:Y(l,$t.value)),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>Tn(l,m),onMouseleave:un},null,46,ei))),128)):e.createCommentVNode("",!0)])):be.value==="area"?(e.openBlock(),e.createElementBlock("g",ti,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ta.value,(l,r)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${r}`,id:`area-mask-${r}-${E.chartId}`},[e.createElementVNode("rect",{x:I.value.left-10,y:I.value.top-10,width:I.value.width+20,height:I.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${I.value.width+20}px`})},null,12,ni)],8,li))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ta.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${r}`,d:l.areaPath,fill:l.color,"fill-opacity":l.isHighlighted?pe.value+.2:pe.value,mask:`url(#area-mask-${r}-${E.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden})},null,10,oi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ta.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${r}`,d:l.linePath,stroke:l.color,"stroke-width":l.isHighlighted?Pe.value+1:Pe.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${r*vl.value}ms`})},null,14,ai))),128))])):be.value==="stepbar"?(e.openBlock(),e.createElementBlock("g",si,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(la.value,l=>(e.openBlock(),e.createElementBlock("g",{key:l.key,class:"dss-stepbar-column"},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:l.clipPathId},[e.createElementVNode("path",{d:l.clipPath},null,8,ii)],8,ri)]),e.createElementVNode("g",{"clip-path":l.clipPathRef},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.segments,r=>(e.openBlock(),e.createElementBlock("rect",{key:r.key,x:r.x,y:r.y,width:r.width,height:r.height,fill:r.color,stroke:"none",class:e.normalizeClass({"dss-bar-highlighted":r.isHighlighted,"dss-bar-dimmed":r.isDimmed,"dss-bar-hidden":r.isHidden}),style:e.normalizeStyle({fillOpacity:r.isDimmed?.4:1,animationDelay:`${r.animationDelay}ms`}),onMouseover:m=>Tn(r,m),onMouseleave:un},null,46,ui))),128))],8,ci)]))),128))])):be.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:4,class:e.normalizeClass({"dss-horizontal-bars":fl.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pa.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${r}`},[l.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:l.barPath,fill:l.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>Tn(l,m),onMouseleave:un},null,46,di)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x,y:l.y,width:l.width,height:l.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({fill:l.color,fillOpacity:l.isDimmed?.4:1,animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>Tn(l,m),onMouseleave:un},null,46,mi))],64))),128))],2)):e.createCommentVNode("",!0)],8,Or),Ue.value&&ot.value.show&&!ce.value.isZooming?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-crosshair","clip-path":fe.value},[e.createElementVNode("line",{x1:ot.value.x,x2:ot.value.x,y1:I.value.top,y2:I.value.bottom,stroke:Et.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,vi),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ot.value.data,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${r}`,cx:ot.value.x,cy:l.y,r:j($t.value+2),fill:l.color,stroke:"none",opacity:"0.9"},null,8,fi))),128))],8,pi)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Gt.value?(e.openBlock(),e.createElementBlock("g",hi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fo.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${r}`},[l?(e.openBlock(),e.createElementBlock("g",gi,[e.createElementVNode("circle",{cx:l.x,cy:l.y,r:j(l.radius),fill:l.color,"fill-opacity":Ha(l),stroke:l.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(Fa(l,r)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:m=>fa(l,m),onMouseleave:m=>ga(l),onClick:m=>va(l,m)},null,42,yi),l.imageUrl?(e.openBlock(),e.createElementBlock("image",{key:0,x:l.x-l.radius*.65,y:l.y-l.radius*.65,width:l.radius*1.3,height:l.radius*1.3,"xlink:href":l.imageUrl,class:e.normalizeClass(`dss-bubble-image-${r} ${l.isHighlighted?"dss-bubble-highlighted":""} ${l.isDimmed?"dss-bubble-dimmed":""} ${l.isHidden?"dss-bubble-hidden":""}`),"clip-path":`circle(${l.radius*.65}px at ${l.radius*.65}px ${l.radius*.65}px)`,style:e.normalizeStyle({cursor:"pointer",transition:"all 0.3s ease",opacity:Ra(l)}),onLoad:m=>$n(r),onError:m=>ko(r),onMouseenter:m=>fa(l,m),onMouseleave:m=>ga(l),onClick:m=>va(l,m)},null,46,ki)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),cl.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:Qn.value},[be.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Dt.value,cy:Pt.value,r:Vt.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,bi)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":be.value,"clip-path":Lo.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Aa.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${l.originalIndex}-${r}`,d:l.segment.path,fill:l.segment.color,"fill-opacity":l.segment.isHighlighted?(l.segment.opacity||.8)+.2:l.segment.opacity||.8,stroke:l.segment.strokeWidth?l.segment.strokeColor||l.segment.color:"none","stroke-width":l.segment.strokeWidth||0,"clip-path":$o(l.originalIndex),class:e.normalizeClass({"dss-series-highlighted":l.segment.isHighlighted,"dss-series-dimmed":l.segment.isDimmed,"dss-series-hidden":l.segment.isHidden}),onMouseover:m=>Tn(l.segment,m),onMouseleave:un},null,42,xi))),128))],8,wi),xn.value&&sa.value?(e.openBlock(),e.createElementBlock("g",Ei,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ul.value,(l,r)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${r}`,x:l.x,y:l.y,"text-anchor":"middle","dominant-baseline":"middle",class:"dss-radial-segment-data-label",style:e.normalizeStyle({fill:l.contrastColor})},e.toDisplayString(l.value),13,Si)),[[e.vShow,l.show]])),128))])):e.createCommentVNode("",!0),vn.value&&(sa.value||Cn.value||Gl.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:En.value.x,y:En.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":Hn.value,fill:en.value,class:"dss-radial-data-center"},e.toDisplayString(fn.value),9,Vi)):e.createCommentVNode("",!0),ba.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Po.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Da.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${r}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":l.isHighlighted,"dss-label-dimmed":l.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${r*.08}s`})},[e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-pointer",x1:l.pointerStartX,y1:l.pointerStartY,x2:l.pointerEndX,y2:l.pointerEndY,stroke:l.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":l.pointerLineLength})},null,12,Ni),e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-horizontal",x1:l.pointerEndX,y1:l.pointerEndY,x2:l.horizontalEndX,y2:l.horizontalEndY,stroke:l.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":l.horizontalLineLength})},null,12,Bi),e.createElementVNode("text",{class:"dss-radial-label-text",x:l.textX,y:l.textY,"text-anchor":l.textAnchor,"font-size":an.value,"dominant-baseline":"middle"},e.toDisplayString(l.text),9,Mi)],6))),128))],2)):e.createCommentVNode("",!0)],8,Ci)):e.createCommentVNode("",!0),rl.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:Qn.value},[ke.value?(e.openBlock(),e.createElementBlock("g",$i,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($l.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${r}`,cx:Dt.value,cy:Pt.value,r:j(l),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*150}ms`})},null,12,Li))),128)),e.createElementVNode("g",Ti,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($l.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${r}`},[e.createElementVNode("rect",{x:Dt.value-16,y:Pt.value-l-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,Ai),e.createElementVNode("text",{x:Dt.value,y:Pt.value-l+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(zn(r)),9,Di)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ya.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${r}`,x1:Dt.value,x2:l.x,y1:Pt.value,y2:l.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*100}ms`})},null,12,Hi))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Ri,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Wa.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${r}`,x:l.x+Math.cos(r*2*Math.PI/no.value-Math.PI/2)*16,y:l.y+Math.sin(r*2*Math.PI/no.value-Math.PI/2)*16,"text-anchor":l.anchor,"dominant-baseline":l.baseline,"font-size":"14px",fill:"#666","font-weight":"500",style:e.normalizeStyle({animationDelay:`${r*120}ms`})},e.toDisplayString(l.text.charAt(0).toUpperCase()+l.text.slice(1)),13,Fi))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:Xa,onMouseleave:un},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ka.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${r}`},[e.createElementVNode("polygon",{points:l.points,fill:l.color,"fill-opacity":Za("current",l,r),stroke:l.color,"stroke-width":l.isHighlighted?Pe.value+1:Pe.value,"stroke-dasharray":l.strokeDasharray||void 0,"stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${r*vl.value}ms`,transition:"all 0.2s ease"})},null,14,Ii),l.pointRadius>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(l.dataPoints,(m,v)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${r}-${v}`,cx:m.x,cy:m.y,r:j(l.isHighlighted?l.pointRadius+1:l.pointRadius),fill:l.isComparison?"none":l.color,stroke:l.isComparison?l.color:"none","stroke-width":l.isComparison?2:0,class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${r*vl.value+v*50}ms`,transition:"all 0.2s ease"}),onMouseover:C=>Tn(m,C),onMouseleave:un},null,46,zi))),128)):e.createCommentVNode("",!0)]))),128))],32)],8,_i)):e.createCommentVNode("",!0),e.createElementVNode("g",Pi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Io.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${r}`,cx:l.x,cy:l.y,r:j(l.width/2),fill:Qt(l.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${r}`),style:e.normalizeStyle({animationDelay:`${r*200}ms`})},null,14,Oi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Io.value,(l,r)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${r}`,x:l.x-l.width/2,y:l.y-l.height/2,width:l.width,height:l.height,"xlink:href":l.url,onLoad:m=>Ya(r),onError:m=>ja(r),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${r}`),"clip-path":`circle(${l.width/2}px at ${l.width/2}px ${l.height/2}px)`,style:e.normalizeStyle({animationDelay:`${r*200}ms`})},null,46,Wi))),128))])],8,ur))]),Ae.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:Se.value+"px",height:ie.value+"px",backgroundImage:`url('${el.value}')`,backgroundRepeat:"no-repeat",...kl.value,opacity:it.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ne.value,(l,r)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:"marker-"+l.id,class:"dss-chart-marker",style:e.normalizeStyle({position:"absolute",left:l.x+"px",top:l.y+"px",width:Ml.value+"px",height:Ml.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(m=>mo(l),["stop"]),onMouseenter:m=>za(l,m),onMouseleave:Pa},[e.createElementVNode("img",{src:Pl(l),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Zi)],44,qi)),[[e.vShow,O.value]])),128)),sl.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:sl.value.x+"px",top:sl.value.y+"px"})},[e.createElementVNode("div",Ui,e.toDisplayString(sl.value.categoryValue),1),sl.value.description?(e.openBlock(),e.createElementBlock("div",Xi,e.toDisplayString(sl.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Ie.value&&(dt.value.show||Ue.value&&ot.value.show&&!ce.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":Ue.value&&ot.value.show&&!ce.value.isZooming,"dss-spider-tooltip":rl.value&&dt.value.spiderAreas&&dt.value.spiderAreas.length>0}]),style:e.normalizeStyle(Ka.value)},[!Ue.value||!ot.value.show||ce.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[rl.value&&dt.value.spiderAreas&&dt.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",Yi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(dt.value.spiderAreas,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-area-${r}`,class:"dss-spider-tooltip-area"},[e.createElementVNode("div",ji,[e.createElementVNode("span",{class:"dss-spider-tooltip-area-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createTextVNode(" "+e.toDisplayString(l.seriesName),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.points,(m,v)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-point-${r}-${v}`,class:"dss-tooltip-series"},[e.createElementVNode("span",Ki,e.toDisplayString(m.label),1),e.createElementVNode("span",Gi,e.toDisplayString(m.value),1)]))),128))]))),128))])):Gt.value&&dt.value.bubbleData&&dt.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",Qi,[dt.value.title?(e.openBlock(),e.createElementBlock("div",Ji,e.toDisplayString(dt.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",ec,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(dt.value.bubbleData,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${r}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(l.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",tc,[e.createElementVNode("div",lc,e.toDisplayString(dt.value.title),1),e.createElementVNode("div",nc,e.toDisplayString(dt.value.value),1)])),dt.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[Tt(dt.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",oc,[o[5]||(o[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ac,e.toDisplayString(e.unref(_)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tt(dt.value.categoryIndex).flagGroups,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${r}`},[e.createElementVNode("div",sc,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(l.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.flags,(m,v)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${r}-${v}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",rc,[e.createElementVNode("div",ic,e.toDisplayString(m.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Tt(dt.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",cc,[o[6]||(o[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",uc,e.toDisplayString(e.unref(_)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tt(dt.value.categoryIndex).markers,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${r}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("div",dc,[e.createElementVNode("div",mc,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",pc,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",vc,[e.createElementVNode("div",fc,e.toDisplayString(Gt.value?Ia():E.categories[ot.value.categoryIndex]||`Category ${ot.value.categoryIndex+1}`),1),Gt.value?(e.openBlock(),e.createElementBlock("div",hc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ot.value.data,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${r}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(l.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ot.value.data,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${r}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",gc,e.toDisplayString(l.seriesName)+":",1),e.createElementVNode("span",yc,e.toDisplayString($(l.value)),1)]))),128))]),Tt(ot.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",kc,[o[7]||(o[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Cc,e.toDisplayString(e.unref(_)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tt(ot.value.categoryIndex).flagGroups,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${r}`},[e.createElementVNode("div",bc,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(l.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.flags,(m,v)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${r}-${v}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",wc,[e.createElementVNode("div",xc,e.toDisplayString(m.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Tt(ot.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Ec,[o[8]||(o[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Sc,e.toDisplayString(e.unref(_)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tt(ot.value.categoryIndex).markers,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${r}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("div",Vc,[e.createElementVNode("div",Nc,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",Bc,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),Nl.value&&Ke.value&&ce.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:tn},[o[9]||(o[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(ce.value.scale*100))+"% "+e.toDisplayString(e.unref(_)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Qs),W.value&&G.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Ne.value==="horizontal","dss-legend-vertical":Ne.value==="vertical","dss-legend-bottom":!0}]),style:{display:"flex","flex-wrap":"wrap","justify-content":"center",padding:"6px 8px 0"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":wt.value.has(r),"dss-legend-hovered":$e.value===r,"dss-legend-dimmed":$e.value!==null&&$e.value!==r}]),onClick:m=>na(r),onMouseenter:m=>zl(r),onMouseleave:y,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":rl.value&&n(l)}]),style:e.normalizeStyle({backgroundColor:rl.value&&n(l)?"transparent":d(l,r),borderColor:d(l,r)})},null,6),e.createElementVNode("span",_c,e.toDisplayString(l.name),1)],46,Mc))),128))],2)):e.createCommentVNode("",!0),mt.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:mt.value.x+"px",top:mt.value.y+"px"}),onClick:o[0]||(o[0]=e.withModifiers(()=>{},["stop"]))},[bl.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:Rn},e.toDisplayString(e.unref(_)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),bl.value.addMarker&&(bl.value.downloadSvg||bl.value.downloadPng||bl.value.downloadCsv||Fl.value.length>0)?(e.openBlock(),e.createElementBlock("div",$c)):e.createCommentVNode("",!0),bl.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:Ko},e.toDisplayString(e.unref(_)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),bl.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:Go},e.toDisplayString(e.unref(_)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),bl.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:Qo},e.toDisplayString(e.unref(_)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Fl.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[bl.value.downloadSvg||bl.value.downloadPng||bl.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",Lc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fl.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+r},[l.separator?(e.openBlock(),e.createElementBlock("div",Tc)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Xt(l)),style:e.normalizeStyle(Cl(l)),onClick:m=>Bo(l)},[l.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:at(l),class:"dss-custom-menu-content"},null,8,Dc)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.icon?(e.openBlock(),e.createElementBlock("span",Hc,e.toDisplayString(l.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)],64))],14,Ac)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Oe.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:Vn},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:o[3]||(o[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Rc,[e.createElementVNode("h3",null,e.toDisplayString(nl.value?e.unref(_)("chart.modalMarker.viewMarker"):Tl.value?e.unref(_)("chart.modalMarker.editMarker"):e.unref(_)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:Vn},"×")]),e.createElementVNode("div",Fc,[e.createElementVNode("div",Ic,[e.createVNode(ca,{id:"dss-marker-date",mode:"single",modelValue:Oe.value.date,"onUpdate:modelValue":o[1]||(o[1]=l=>Oe.value.date=l),"min-date":Ll.value,"max-date":sn.value,disabled:nl.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",zc,[e.createElementVNode("label",Pc,e.toDisplayString(e.unref(_)("chart.modalMarker.description")),1),nl.value?(e.openBlock(),e.createElementBlock("div",Oc,e.toDisplayString(Oe.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":o[2]||(o[2]=l=>Oe.value.description=l),placeholder:e.unref(_)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,Wc)),[[e.vModelText,Oe.value.description]])])]),e.createElementVNode("div",qc,[e.createElementVNode("div",Zc,[Tl.value&&!nl.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:Xo},e.toDisplayString(e.unref(_)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Uc,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:Vn},e.toDisplayString(nl.value?e.unref(_)("chart.modalMarker.close"):e.unref(_)("chart.modalMarker.cancel")),1),nl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:Vo,disabled:!(Oe.value.description&&Oe.value.description.length)},e.toDisplayString(Tl.value?e.unref(_)("chart.modalMarker.save"):e.unref(_)("chart.contextMenu.addMarker")),9,Xc))])])])])):e.createCommentVNode("",!0)],64))}}),Kc={class:"dss-modal-title"},Gc={class:"dss-modal-actions"},ia={__name:"DSSModal",props:{showModal:{type:Boolean,required:!0},backDrop:{type:Boolean,default:!0},width:{type:String,default:"800px"},height:{type:String,default:"auto"},showCloseBtn:{type:Boolean,default:!0},headerType:{type:String,default:"space-between"},titleSize:{type:String,default:"24px"}},emits:["close-modal"],setup(E,{emit:le}){const _=E,B=le,de=e.ref(null),P=e.ref(null),T=e.computed(()=>{const X={"max-width":_.width};return _.height!=="auto"&&(X.height=_.height,X["min-height"]="0"),X}),he=e.computed(()=>({}));function st(){B("close-modal")}function te(){_.backDrop&&!de.value&&B("close-modal")}function f(X){X.target.tagName==="INPUT"&&(de.value=X.target.tagName)}function we(){setTimeout(()=>{de.value=null},300)}function Ce(){const X=document.body,fe=document.documentElement;P.value={bodyOverflow:X.style.overflow,bodyPosition:X.style.position,bodyTop:X.style.top,bodyWidth:X.style.width,htmlOverflow:fe.style.overflow,scrollY:window.scrollY},X.style.overflow="hidden",X.style.position="fixed",X.style.top=`-${P.value.scrollY}px`,X.style.width="100%",X.style.left="0",fe.style.overflow="hidden"}function J(){if(!P.value)return;const X=document.body,fe=document.documentElement,{bodyOverflow:R,bodyPosition:me,bodyTop:_e,bodyWidth:Je,htmlOverflow:pt,scrollY:Z}=P.value;X.style.overflow=R||"",X.style.position=me||"",X.style.top=_e||"",X.style.width=Je||"",X.style.left="",fe.style.overflow=pt||"",window.scrollTo(0,Z||0)}return e.watch(()=>_.showModal,X=>{if(X)Ce(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const fe=document.getElementById("dss-modal-backdrop");fe&&(fe.addEventListener("focusin",f),fe.addEventListener("focusout",we))},100);else{J(),document.body.classList.remove("dss-modal-open");const fe=document.getElementById("dss-modal-backdrop");fe&&(fe.removeEventListener("focusin",f),fe.removeEventListener("focusout",we))}},{immediate:!0}),e.onUnmounted(()=>{_.showModal&&J()}),(X,fe)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[E.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:te},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(T.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:fe[0]||(fe[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":E.headerType,"font-size":E.titleSize})},[e.createElementVNode("h1",Kc,[e.renderSlot(X.$slots,"title",{},()=>[fe[1]||(fe[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(X.$slots,"title-data"),E.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:st,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(he.value)},[e.renderSlot(X.$slots,"content",{},()=>[fe[2]||(fe[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Gc,[e.renderSlot(X.$slots,"actions")])])],4),[[e.vShow,E.showModal]])])):e.createCommentVNode("",!0)]))}},Qc={key:0,class:"dss-table-toolbar"},Jc={class:"dss-table-toolbar-left"},eu=["aria-expanded"],tu={class:"dss-pagination-select-dropdown",role:"listbox"},lu={class:"dss-table-column-visibility-label"},nu={class:"dss-table-checkbox-wrapper"},ou=["checked","onChange"],au={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},su={class:"dss-table-column-visibility-text"},ru={class:"dss-table-toolbar-right"},iu=["placeholder","aria-label"],cu=["aria-label"],uu=["aria-label","aria-expanded"],du={key:1,class:"dss-table-toolbar-extra"},mu={class:"dss-table-thead"},pu={key:0,class:"dss-table-th dss-table-selection-column"},vu={key:0,class:"dss-table-checkbox-wrapper"},fu=["checked","indeterminate"],hu={key:0,class:"dss-table-checkbox__indeterminate"},gu={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},yu=["aria-label"],ku=["onClick"],Cu={class:"dss-table-th-content"},bu={class:"dss-table-th-text"},wu={key:0},xu={key:1},Eu={key:2},Su=["data-filter-column-key","aria-expanded","aria-label","onClick"],Vu={class:"dss-table-tbody"},Nu=["onClick"],Bu={class:"dss-table-checkbox-wrapper"},Mu=["type","name","checked","disabled","onChange"],_u={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},$u={key:1,class:"dss-table-checkbox__dot"},Lu=["onClick"],Tu=["aria-expanded","aria-label"],Au={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},Du={key:0,class:"dss-table-expansion-row"},Hu=["colspan"],Ru=["colspan"],Fu={key:1,class:"dss-table-pagination"},Iu={class:"dss-table-pagination-left"},zu={key:0},Pu={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},Ou={class:"dss-table-pagination-center"},Wu={key:0,class:"dss-pagination-controls"},qu=["disabled","title"],Zu=["disabled","title"],Uu=["aria-label","onKeydown"],Xu={class:"dss-pagination-of"},Yu=["disabled","title"],ju=["disabled","title"],Ku={class:"dss-table-pagination-right"},Gu={class:"dss-pagination-rows-label"},Qu=["aria-expanded"],Ju=["aria-selected","onClick"],ed={key:0,class:"dss-table-filter-row"},td=["value","placeholder"],ld=["min","max","value"],nd=["min","max","value"],od={class:"dss-table-filter-double-range-values"},ad={key:2,class:"dss-table-filter-daterange"},sd={class:"dss-table-filter-daterange-row"},rd={class:"dss-table-filter-daterange-label"},id=["value"],cd={class:"dss-table-filter-daterange-row"},ud={class:"dss-table-filter-daterange-label"},dd=["value"],md=["value","placeholder"],pd={class:"dss-table-filter-list"},vd=["checked","onChange"],fd={class:"dss-table-filter-actions"},hd={name:"DSSTable"},gd=Object.assign(hd,{props:{data:{type:Array,required:!0,default:()=>[]},columns:{type:Array,required:!0,default:()=>[]},tableId:{type:String,default:()=>"table-"+Math.random().toString(36).substring(2,9)},locale:{type:String,default:null},options:{type:Object,default:()=>({}),validator:E=>typeof E=="object"&&E!==null},columnVisibility:{type:Array,default:null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search","update:columnVisibility"],setup(E,{emit:le}){const{t:_,locale:B}=so.useI18n(),de=E,P=le,T={table:{width:"auto",height:null,rowHeight:"auto",truncated:!1,expandable:!1,expandableRowData:null,expandableRowCondition:null,striped:!1,bordered:!1,hoverable:!0,size:"default",align:"left"},title:{text:""},subtitle:{text:""},selection:{enabled:!1,mode:"single",rowCondition:null},sorting:{enabled:!0,mode:"single"},pagination:{enabled:!1,rows:10,rowsPerPageOptions:[5,10,25,50,100],showCounter:!0,showControlsGroup:!0,showControls:!0,showRowsPerPage:!0},toolbar:{downloads:{pdf:!0,excel:!0},columnVisibility:!0,search:!0},scrollable:!1,emptyMessage:null};function he(y,g){const x=Object.assign({},y);return st(y)&&st(g)&&Object.keys(g).forEach(q=>{st(g[q])?q in y?x[q]=he(y[q],g[q]):Object.assign(x,{[q]:g[q]}):Object.assign(x,{[q]:g[q]})}),x}function st(y){return y&&typeof y=="object"&&!Array.isArray(y)}const te=e.computed(()=>he(T,de.options)),f=e.computed(()=>{const y=te.value.table.width;return y==="auto"?null:typeof y=="number"?y:null}),we=e.computed(()=>te.value.table.height),Ce=e.computed(()=>te.value.table.rowHeight??"auto"),J=e.computed(()=>({height:Ce.value})),X=e.computed(()=>te.value.table.expandable===!0),fe=e.computed(()=>te.value.table.expandableRowData??null),R=e.computed(()=>te.value.table.expandableRowCondition??null),me=e.computed(()=>te.value.table.truncated===!0),_e=e.computed(()=>te.value.table.striped),Je=e.computed(()=>te.value.table.bordered),pt=e.computed(()=>te.value.table.hoverable),Z=e.computed(()=>te.value.table.size),Fe=e.computed(()=>te.value.table.align||"left");e.computed(()=>te.value.title.text),e.computed(()=>te.value.subtitle.text);const We=e.computed(()=>te.value.selection.enabled),Se=e.computed(()=>te.value.selection.mode),Le=e.computed(()=>te.value.selection.rowCondition??null),Ye=e.computed(()=>te.value.sorting.enabled),ie=e.computed(()=>te.value.sorting.mode),Ge=e.computed(()=>te.value.pagination.enabled),be=e.computed(()=>te.value.pagination.rows),Qe=e.computed(()=>te.value.pagination.rowsPerPageOptions),ct=e.computed(()=>te.value.pagination.showCounter!==!1),gt=e.computed(()=>te.value.pagination.showControlsGroup),ut=e.computed(()=>gt.value===!1?!1:te.value.pagination.showControls!==!1),qt=e.computed(()=>gt.value===!1?!1:te.value.pagination.showRowsPerPage!==!1),Zt=e.computed(()=>Ge.value&&(ct.value||ut.value||qt.value)),kt=e.computed(()=>te.value.scrollable),xt=e.computed(()=>te.value.emptyMessage||_("table.emptyMessage")),Yt=e.computed(()=>te.value.toolbar?.downloads?.pdf!==!1),rt=e.computed(()=>te.value.toolbar?.downloads?.excel!==!1),Jt=e.computed(()=>te.value.toolbar?.search!==!1),yt=e.computed(()=>Yt.value||rt.value||Jt.value||ol.value),ol=e.computed(()=>te.value.toolbar?.columnVisibility!==!1),U=e.ref(""),ke=e.ref(!1),W=e.ref(null);let G=null;function Ne(){ke.value?(G&&(clearTimeout(G),G=null),ke.value=!1,U.value="",P("search",""),W.value?.blur()):(ke.value=!0,G=setTimeout(()=>{G=null,W.value?.focus()},80))}function Ie(){U.value||(ke.value=!1)}function Ue(){U.value="",P("search",""),W.value?.focus()}const Et=e.computed(()=>({"dss-table-striped":_e.value,"dss-table-bordered":Je.value,"dss-table-hoverable":pt.value,[`dss-table-${Z.value}`]:Z.value!=="default","dss-table-truncated":me.value})),Ke=(y,g)=>y?.field??y?.key??g,Ut=e.ref(new Set);function qe(){const y=new Set;return de.columns.forEach((g,x)=>{g?.hidden!==!0&&y.add(Ke(g,x))}),y}function Pe(){const y=new Set;return de.columns.forEach((g,x)=>{y.add(Ke(g,x))}),y}function Ht(y){if(!Array.isArray(y))return null;const g=Pe(),x=[];return y.forEach(q=>{g.has(q)&&x.push(q)}),x}function $t(){Ut.value=qe()}const oe=e.computed(()=>{const y=Ht(de.columnVisibility);return y===null?null:new Set(y)}),Y=e.computed(()=>oe.value??Ut.value),j=e.computed(()=>de.columns.filter((y,g)=>Y.value.has(Ke(y,g)))),pe=y=>{const g=de.columns.findIndex(x=>x===y);return Ke(y,g>=0?g:0)},xe=(y,g)=>Y.value.has(Ke(y,g));function je(y){P("update:columnVisibility",Array.from(y))}function Rt(y,g){const x=Ke(y,g),q=new Set(Y.value);q.has(x)?q.delete(x):q.add(x),oe.value===null&&(Ut.value=q),je(q)}const jt=e.ref(null),et=e.ref(!1);function pl(y){jt.value&&!jt.value.contains(y.target)&&(et.value=!1)}const M=e.computed(()=>j.value.length+(We.value?1:0)+(X.value?1:0)),w=(y,g)=>y?.id??y?.key??g,A=e.ref(new Set),se=e.ref(null),ae=(y,g)=>A.value.has(w(y,g)),He=(y,g)=>{if(!X.value)return!1;if(typeof R.value=="function")return!!R.value(y,g);if(typeof fe.value=="string"&&fe.value.trim()){const x=Tl(y,fe.value.trim());return Array.isArray(x)?x.length>0:x&&typeof x=="object"?Object.keys(x).length>0:x!=null&&x!==""}return!0},Ct=(y,g,x)=>{if(x&&x.stopPropagation(),!He(y,g))return;const q=w(y,g),ue=new Set(A.value);ue.has(q)?(ue.delete(q),P("row-collapse",{data:y,index:g})):(ue.add(q),P("row-expand",{data:y,index:g})),A.value=ue},nt=(y,g)=>{if(!me.value)return;const x=w(y,g);se.value!==x&&(se.value=x)},Re=e.ref(null),bt=e.ref(0),_t=e.ref([]),St=y=>{if(ie.value==="single")return Re.value===y.field?bt.value:0;{const g=_t.value.find(x=>x.field===y.field);return g?g.order:0}},Lt=y=>{const g=St(y);return{"dss-sort-active":g!==0,"dss-sort-asc":g===1,"dss-sort-desc":g===-1}},zt=e.ref({}),Bt=e.ref(null),Kt=e.ref(null),ql=220,jl=e.ref(null),El=e.computed(()=>j.value.find(y=>pe(y)===Bt.value)??null),il=e.computed(()=>{if(!El.value||El.value.filter!=="range")return null;const y=El.value,g=Bt.value,{min:x,max:q}=pn(y),ue=y.filterMin??x,at=y.filterMax??q,Xt=Dl(g),Cl=Xt.min??ue,Pl=Xt.max??at,Ul=at-ue,hn=Ul===0?0:(Cl-ue)/Ul*100,uo=Ul===0?100:(Pl-ue)/Ul*100;return{rangeMin:ue,rangeMax:at,currentMin:Cl,currentMax:Pl,minPct:hn,maxPct:uo}}),vl=e.ref(null),dn=e.ref("max");function wn(y){const g=vl.value,x=il.value;if(!g||!x)return;const q=g.getBoundingClientRect(),at=(y.clientX-q.left)/q.width*100,Xt=(x.minPct+x.maxPct)/2;dn.value=at<Xt?"min":"max"}function Dl(y){return zt.value[y]??{}}function mn(y,g){zt.value={...zt.value,[y]:g}}function $l(y){const g=zt.value[y];return g?g.type==="string"?!!g.value?.trim():g.type==="range"?g.min!=null||g.max!=null:g.type==="dateRange"?!!(g.from||g.to):g.type==="list"?g.selected?.length>0:!1:!1}function zn(y){const g={...zt.value};delete g[y],zt.value=g,Bt.value=null,Kt.value=null}function Dn(){if(!Bt.value){Kt.value=null;return}const y=jl.value;if(!y)return;const g=y.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${Bt.value}"]`);if(!g)return;const x=g.getBoundingClientRect();Kt.value={top:x.bottom+6,left:Math.max(8,x.right-ql)}}const on=e.computed(()=>{const y=String(U.value??"").trim().toLowerCase();return y?de.data.filter(g=>j.value.some(x=>Fl(sn(g,x)).some(ue=>String(ue).toLowerCase().includes(y)))):de.data}),bl=e.computed(()=>{let y=[...on.value];const g=(U.value??"").trim().toLowerCase();return g&&(y=y.filter(x=>de.columns.some(q=>{if(!q||!q.field)return!1;const ue=sn(x,q);return String(ue??"").toLowerCase().includes(g)}))),j.value.forEach(x=>{const q=pe(x),ue=zt.value[q];if(!ue)return;const at=x.field;if(at){if(ue.type==="string"&&ue.value?.trim()){const Xt=ue.value.trim().toLowerCase();y=y.filter(Cl=>{const Pl=sn(Cl,x);return String(Pl??"").toLowerCase().includes(Xt)})}else if(ue.type==="range")y=y.filter(Xt=>{const Cl=Tl(Xt,at),Pl=Number(Cl);return!(Number.isNaN(Pl)||ue.min!=null&&Pl<ue.min||ue.max!=null&&Pl>ue.max)});else if(ue.type==="dateRange"){const Xt=ue.from?new Date(ue.from).getTime():null,Cl=ue.to?new Date(ue.to).getTime():null;y=y.filter(Pl=>{const Ul=Tl(Pl,at),hn=Ul?new Date(Ul).getTime():NaN;return!(Number.isNaN(hn)||Xt!=null&&hn<Xt||Cl!=null&&hn>Cl)})}else if(ue.type==="list"&&ue.selected?.length){const Xt=new Set(ue.selected);y=y.filter(Cl=>Fl(sn(Cl,x)).some(Ul=>Xt.has(Ul)))}}}),y});function Fl(y){if(y==null)return[""];if(Array.isArray(y))return y.flatMap(Fl);if(typeof y=="object"){const g=y?.label??y?.name??y?.value??y?.title;return[g!=null?String(g):String(y)]}return[String(y)]}function Kl(y){const g=new Set;return de.data.forEach(x=>{Fl(sn(x,y)).forEach(ue=>g.add(ue))}),Array.from(g).sort((x,q)=>String(x).localeCompare(String(q)))}function Hl(y,g){if(Bt.value===y){Bt.value=null,Kt.value=null;return}if(Bt.value=y,g?.currentTarget){const x=g.currentTarget.getBoundingClientRect();Kt.value={top:x.bottom+6,left:Math.max(8,x.right-ql)}}else Dn()}function Ml(y,g){mn(y,{type:"string",value:g})}function pn(y){const g=y.field;if(!g)return{min:0,max:100};let x=1/0,q=-1/0;return de.data.forEach(ue=>{const at=Tl(ue,g),Xt=Number(at);Number.isNaN(Xt)||(x=Math.min(x,Xt),q=Math.max(q,Xt))}),{min:x===1/0?0:x,max:q===-1/0?100:q}}function $(y,g,x){const q={...Dl(y),type:"range"},ue=x===""?null:Number(x),at=ue===null||Number.isNaN(ue)?null:ue;q[g]=at,at!=null&&(g==="min"&&q.max!=null&&at>q.max&&(q.max=at),g==="max"&&q.min!=null&&at<q.min&&(q.min=at)),mn(y,q)}function O(y,g,x){const q={...Dl(y),type:"dateRange"};q[g]=x||"",mn(y,q)}const D=e.reactive({});function ne(y,g){D[y]=g}function Ae(y){const g=pe(y),x=(D[g]??"").trim().toLowerCase(),q=Kl(y);return x?q.filter(ue=>String(ue).toLowerCase().includes(x)):q}function it(y,g){return(Dl(y).selected??[]).includes(g!=null?String(g):"")}function vt(y,g){const q=[...Dl(y).selected??[]],ue=g!=null?String(g):"",at=q.indexOf(ue);at>=0?q.splice(at,1):q.push(ue),mn(y,{type:"list",selected:q})}function tt(y){Bt.value&&!y.target.closest(".dss-table-filter-wrap")&&!y.target.closest(".dss-table-filter-dropdown")&&(Bt.value=null,Kt.value=null)}function lt(){Dn(),el.value&&Zl()}const kl=y=>{if(!(y.sortable===!1||!Ye.value))if(ie.value==="single")Re.value===y.field?bt.value=bt.value===1?-1:bt.value===-1?0:1:(Re.value=y.field,bt.value=1),bt.value===0&&(Re.value=null),P("sort",{field:Re.value,order:bt.value});else{const g=_t.value.findIndex(x=>x.field===y.field);g>=0?_t.value[g].order===1?_t.value[g].order=-1:_t.value.splice(g,1):_t.value.push({field:y.field,order:1}),P("sort",{multiSortMeta:_t.value})}},Sl=e.computed(()=>{if(!Ye.value)return bl.value;let y=[...bl.value];return ie.value==="single"&&Re.value&&bt.value!==0?y.sort((g,x)=>{const q=Tl(g,Re.value),ue=Tl(x,Re.value);return q===ue?0:q==null?1:ue==null?-1:(q<ue?-1:q>ue?1:0)*bt.value}):ie.value==="multiple"&&_t.value.length>0&&y.sort((g,x)=>{for(const q of _t.value){const ue=Tl(g,q.field),at=Tl(x,q.field);if(ue===at)continue;if(ue==null)return 1;if(at==null)return-1;const Xt=ue<at?-1:ue>at?1:0;if(Xt!==0)return Xt*q.order}return 0}),y}),Tt=e.ref(0),wl=e.ref(be.value),el=e.ref(!1),Vl=e.ref(null),an=e.ref(null),al=e.ref("bottom"),At=e.ref(null),Pn=y=>{wl.value=y,el.value=!1,Tt.value=0,P("page",{page:0,rows:wl.value})};function xn(y){Vl.value&&!Vl.value.contains(y.target)&&(el.value=!1)}function Zl(){const y=Vl.value,g=an.value;if(!y||!g)return;const x=y.querySelector(".dss-pagination-select-dropdown");if(!x)return;const q=g.getBoundingClientRect(),ue=x.offsetHeight||0,Xt=(window.innerHeight||document.documentElement.clientHeight)-q.bottom,Cl=q.top;al.value=Xt<ue+8&&Cl>Xt?"top":"bottom",At.value={width:`${Math.ceil(q.width)}px`,left:`${Math.max(0,Math.round(g.offsetLeft))}px`}}const vn=e.computed(()=>Sl.value.length),fn=e.computed(()=>Math.ceil(vn.value/wl.value)),Hn=e.computed(()=>Math.max(fn.value,1)),En=e.computed(()=>vn.value===0?0:ul.value+1),en=e.computed(()=>On.value),ul=e.computed(()=>Ge.value?Tt.value*wl.value:0),On=e.computed(()=>Ge.value?Math.min((Tt.value+1)*wl.value,vn.value):vn.value),Il=e.computed(()=>{if(!Ge.value)return Sl.value;const y=ul.value,g=On.value;return Sl.value.slice(y,g)}),ll=e.ref(new Set),Wn=e.computed(()=>Sl.value.filter((y,g)=>ll.value.has(w(y,g)))),dl=(y,g)=>{const x=Le.value;return typeof x!="function"?!0:!!x(y,g)},wt=e.computed(()=>Sl.value.map((y,g)=>({row:y,index:g})).filter(({row:y,index:g})=>dl(y,g))),$e=e.computed(()=>{const y=wt.value;return y.length===0?!1:y.every(({row:g,index:x})=>ll.value.has(w(g,x)))}),Sn=e.computed(()=>{const y=wt.value;if(y.length===0)return!1;const g=y.filter(({row:x,index:q})=>ll.value.has(w(x,q))).length;return g>0&&g<y.length}),dt=(y,g)=>ll.value.has(w(y,g)),sl=()=>{if($e.value)ll.value=new Set,P("unselect-all");else{const y=new Set;wt.value.forEach(({row:g,index:x})=>y.add(w(g,x))),ll.value=y,P("select-all",Wn.value)}},ot=(y,g)=>{if(!dl(y,g))return;const x=w(y,g),q=new Set(ll.value),ue=q.has(x);Se.value==="single"?ue?(q.delete(x),P("row-unselect",y)):(q.clear(),q.add(x),P("row-select",y)):ue?(q.delete(x),P("row-unselect",y)):(q.add(x),P("row-select",y)),ll.value=q},mt=e.ref("1"),ce=()=>{const y=Number.parseInt(String(mt.value),10);if(!Number.isFinite(y)){mt.value=String(Tt.value+1);return}const g=Math.min(Hn.value,Math.max(1,y));g!==Tt.value+1?tl(g-1):mt.value=String(g)},tl=y=>{y<0||y>=fn.value||(Tt.value=y,P("page",{page:y,rows:wl.value}))},Oe=(y,g,x)=>{P("row-click",{data:y,index:g,originalEvent:x}),nt(y,ul.value+g)},Ll=(y,g)=>{const x=ul.value+g;return{"dss-table-row-selected":dt(y,x),"dss-table-row-even":g%2===0,"dss-table-row-odd":g%2!==0,"dss-table-row-truncated-clickable":me.value,"dss-table-row-truncated-expanded":se.value===w(y,x)}},sn=(y,g)=>g.field?Tl(y,g.field):"",Tl=(y,g)=>g.split(".").reduce((x,q)=>x&&x[q],y),nl=y=>{const g=y.align??Fe.value;return{"dss-table-sortable":y.sortable!==!1&&Ye.value,"dss-table-align-left":g==="left","dss-table-align-center":g==="center","dss-table-align-right":g==="right",[y.className]:y.className}},zl=y=>{const g={};return y.width&&(g.width=typeof y.width=="number"?`${y.width}px`:y.width),y.minWidth&&(g.minWidth=typeof y.minWidth=="number"?`${y.minWidth}px`:y.minWidth),y.maxWidth&&(g.maxWidth=typeof y.maxWidth=="number"?`${y.maxWidth}px`:y.maxWidth),g};return e.watch(()=>de.locale,y=>{y&&y!==B.value&&(B.value=y)},{immediate:!0}),e.watch(be,y=>{wl.value=y,Tt.value=0}),e.watch(el,async y=>{y&&(await e.nextTick(),Zl())}),e.watch(Tt,y=>{mt.value=String(y+1)},{immediate:!0}),e.watch(U,y=>{P("search",y??"")}),e.watch(()=>de.columns,()=>{if(oe.value===null){$t();return}const y=Ht(de.columnVisibility)??[];y.length!==de.columnVisibility.length&&P("update:columnVisibility",y)},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",xn),document.addEventListener("click",pl),document.addEventListener("click",tt),window.addEventListener("resize",lt),window.addEventListener("scroll",lt,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",xn),document.removeEventListener("click",pl),document.removeEventListener("click",tt),window.removeEventListener("resize",lt),window.removeEventListener("scroll",lt,!0)}),(y,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:jl,style:e.normalizeStyle({width:f.value+"px",height:we.value?we.value+"px":"auto"})},[yt.value?(e.openBlock(),e.createElementBlock("div",Qc,[e.createElementVNode("div",Jc,[Yt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:g[0]||(g[0]=x=>P("download-pdf"))},[g[22]||(g[22]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(_)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),rt.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:g[1]||(g[1]=x=>P("download-excel"))},[g[23]||(g[23]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download_excel)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download_excel"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(_)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),ol.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:jt},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":et.value}]),onClick:g[2]||(g[2]=x=>et.value=!et.value),"aria-expanded":et.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(_)("table.columnVisibility"))+" ",1),g[24]||(g[24]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,eu),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",tu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.columns,(x,q)=>(e.openBlock(),e.createElementBlock("li",{key:Ke(x,q),role:"option",class:"dss-table-column-visibility-option",onClick:g[3]||(g[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",lu,[e.createElementVNode("span",nu,[e.createElementVNode("input",{type:"checkbox",checked:xe(x,q),onChange:ue=>Rt(x,q),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,ou),xe(x,q)?(e.openBlock(),e.createElementBlock("span",au,[...g[25]||(g[25]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("span",su,e.toDisplayString(x.header),1)])]))),128))],512),[[e.vShow,et.value]])]),_:1})],512)):e.createCommentVNode("",!0),e.renderSlot(y.$slots,"header")]),e.createElementVNode("div",ru,[Jt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":ke.value||U.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:W,"onUpdate:modelValue":g[4]||(g[4]=x=>U.value=x),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(_)("table.searchPlaceholder"),"aria-label":e.unref(_)("table.searchTableAriaLabel"),onFocus:g[5]||(g[5]=x=>ke.value=!0),onBlur:Ie},null,40,iu),[[e.vModelText,U.value]]),U.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":e.unref(_)("table.clearSearchAriaLabel"),onClick:Ue},[...g[26]||(g[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,cu)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref(_)("table.searchAriaLabel"),"aria-expanded":ke.value||!!U.value,onMousedown:e.withModifiers(Ne,["prevent"])},[...g[27]||(g[27]=[e.createElementVNode("span",{class:"dss-table-toolbar-search-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.81738 0C7.47741 0.000327759 9.63379 2.09488 9.63379 4.67773C9.63366 5.68756 9.30172 6.62133 8.74121 7.38574L11.2324 9.80469C11.653 10.213 11.6528 10.8885 11.2324 11.2969C10.829 11.6886 10.1866 11.6886 9.7832 11.2969L7.16895 8.75781C6.47333 9.13671 5.67174 9.35439 4.81738 9.35449C2.15724 9.35449 -0.000652839 7.26049 -0.000976562 4.67773C-0.000976562 2.09468 2.15704 0 4.81738 0ZM4.81738 1.41895C2.96425 1.41895 1.46213 2.87754 1.46191 4.67676C1.46202 6.47611 2.96418 7.93555 4.81738 7.93555C6.67025 7.93519 8.17275 6.47589 8.17285 4.67676C8.17263 2.87776 6.67018 1.4193 4.81738 1.41895Z",fill:"currentColor"})])],-1)])],40,uu)],2)):e.createCommentVNode("",!0),y.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",du,[e.renderSlot(y.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":kt.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",Et.value])},[e.createElementVNode("thead",mu,[e.createElementVNode("tr",null,[We.value?(e.openBlock(),e.createElementBlock("th",pu,[Se.value==="multiple"?(e.openBlock(),e.createElementBlock("span",vu,[e.createElementVNode("input",{type:"checkbox",checked:$e.value,indeterminate:Sn.value,onChange:sl,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,fu),Sn.value?(e.openBlock(),e.createElementBlock("span",hu)):$e.value?(e.openBlock(),e.createElementBlock("span",gu,[...g[28]||(g[28]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),X.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:"dss-table-th dss-table-expansion-column","aria-label":e.unref(_)("table.expandRowAriaLabel")},null,8,yu)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,(x,q)=>(e.openBlock(),e.createElementBlock("th",{key:pe(x),class:e.normalizeClass(["dss-table-th",nl(x)]),style:e.normalizeStyle(zl(x)),onClick:ue=>kl(x)},[e.createElementVNode("div",Cu,[e.createElementVNode("span",bu,e.toDisplayString(x.header),1),x.sortable!==!1&&Ye.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",Lt(x)])},[St(x)===0?(e.openBlock(),e.createElementBlock("span",wu,[...g[29]||(g[29]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"#3a3a3a"})],-1)])])):St(x)===1?(e.openBlock(),e.createElementBlock("span",xu,[...g[30]||(g[30]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"#7fa2cc"})],-1)])])):St(x)===-1?(e.openBlock(),e.createElementBlock("span",Eu,[...g[31]||(g[31]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"#7fa2cc"})],-1)])])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),x.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":Bt.value===pe(x)}]),onClick:g[6]||(g[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":$l(pe(x))}]),"data-filter-column-key":pe(x),"aria-expanded":Bt.value===pe(x),"aria-label":e.unref(_)("table.filterColumnAriaLabel"),onClick:ue=>Hl(pe(x),ue)},[...g[32]||(g[32]=[e.createElementVNode("span",{class:"dss-table-filter-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 1.54409L11.7537 1.54928L7.84558 5.72226V8.92411C7.84581 9.07639 7.80836 9.22636 7.73658 9.36067C7.6648 9.49497 7.56091 9.60943 7.43417 9.69385L5.58772 10.9252C5.44858 11.0179 5.28688 11.071 5.11988 11.079C4.95288 11.087 4.78685 11.0494 4.63952 10.9704C4.49219 10.8914 4.36908 10.7738 4.28334 10.6303C4.1976 10.4868 4.15244 10.3226 4.15269 10.1555V5.72226L0.244567 1.54928L0.239951 1.54409C0.119785 1.41185 0.0405781 1.24758 0.0119374 1.0712C-0.0167033 0.894829 0.00645342 0.713935 0.0785984 0.550463C0.150743 0.386991 0.268776 0.247968 0.418378 0.150258C0.56798 0.0525488 0.742722 0.000352071 0.921405 0H11.0769C11.2557 1.73676e-05 11.4307 0.051972 11.5805 0.149551C11.7304 0.247131 11.8487 0.386134 11.9211 0.549673C11.9934 0.713211 12.0167 0.894244 11.9881 1.07078C11.9596 1.24731 11.8803 1.41174 11.7601 1.54409H11.7583Z",fill:"currentColor"})])],-1)])],10,Su)],2)):e.createCommentVNode("",!0)])],14,ku))),128))])]),e.createElementVNode("tbody",Vu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Il.value,(x,q)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:w(x,ul.value+q)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Ll(x,q)]),style:e.normalizeStyle(J.value),onClick:ue=>Oe(x,q,ue)},[We.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:g[7]||(g[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",Bu,[e.createElementVNode("input",{type:Se.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${E.tableId}`,checked:dt(x,ul.value+q),disabled:!dl(x,ul.value+q),onChange:ue=>ot(x,ul.value+q),class:e.normalizeClass(["dss-table-checkbox",Se.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio",{"dss-table-checkbox--disabled":!dl(x,ul.value+q)}])},null,42,Mu),Se.value==="multiple"&&dt(x,ul.value+q)?(e.openBlock(),e.createElementBlock("span",_u,[...g[33]||(g[33]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):Se.value==="single"&&dt(x,ul.value+q)?(e.openBlock(),e.createElementBlock("span",$u)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),X.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(ue=>Ct(x,ul.value+q,ue),["stop"])},[He(x,ul.value+q)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":ae(x,ul.value+q),"aria-label":ae(x,ul.value+q)?e.unref(_)("table.collapseRowAriaLabel"):e.unref(_)("table.expandRowAriaLabel")},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":ae(x,ul.value+q)}]),"aria-hidden":"true"},[...g[34]||(g[34]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10.1611 2.81093L5.99463 6.93546L1.82819 2.81093C1.4094 2.39636 0.732886 2.39636 0.314094 2.81093C-0.104698 3.22551 -0.104698 3.89522 0.314094 4.30979L5.24295 9.18907C5.66175 9.60364 6.33826 9.60364 6.75705 9.18907L11.6859 4.30979C12.1047 3.89522 12.1047 3.22551 11.6859 2.81093C11.2671 2.40699 10.5799 2.39636 10.1611 2.81093Z",fill:"#3a3a3a"})],-1)])],2)],8,Tu)):(e.openBlock(),e.createElementBlock("span",Au))],8,Lu)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,(ue,at)=>(e.openBlock(),e.createElementBlock("td",{key:pe(ue),class:e.normalizeClass(["dss-table-td",nl(ue)]),style:e.normalizeStyle(zl(ue))},[e.renderSlot(y.$slots,`cell-${ue.field}`,{data:x,column:ue,rowIndex:q,isExpanded:se.value===w(x,ul.value+q)},()=>[e.createTextVNode(e.toDisplayString(sn(x,ue)),1)])],6))),128))],14,Nu),X.value&&He(x,ul.value+q)&&ae(x,ul.value+q)?(e.openBlock(),e.createElementBlock("tr",Du,[e.createElementVNode("td",{colspan:M.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(y.$slots,"expansion",{data:x,rowIndex:q})],8,Hu)])):e.createCommentVNode("",!0)],64))),128)),Il.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(J.value)},[e.createElementVNode("td",{colspan:M.value,class:"dss-table-empty-cell"},[e.renderSlot(y.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(xt.value),1)])],8,Ru)],4))])],2)],2),Zt.value?(e.openBlock(),e.createElementBlock("div",Fu,[e.createElementVNode("div",Iu,[ct.value?(e.openBlock(),e.createElementBlock("span",zu,e.toDisplayString(e.unref(_)("table.showingRange",{start:En.value,end:en.value,total:vn.value})),1)):(e.openBlock(),e.createElementBlock("span",Pu," "))]),e.createElementVNode("div",Ou,[ut.value?(e.openBlock(),e.createElementBlock("div",Wu,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Tt.value===0,onClick:g[8]||(g[8]=x=>tl(0)),title:e.unref(_)("table.firstPage")},[...g[35]||(g[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,qu),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Tt.value===0,onClick:g[9]||(g[9]=x=>tl(Tt.value-1)),title:e.unref(_)("table.previousPage")}," ‹ ",8,Zu),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":g[10]||(g[10]=x=>mt.value=x),type:"text",class:"dss-pagination-page-input","aria-label":e.unref(_)("table.currentPageAriaLabel"),onBlur:ce,onKeydown:e.withKeys(e.withModifiers(ce,["prevent"]),["enter"])},null,40,Uu),[[e.vModelText,mt.value]]),e.createElementVNode("span",Xu,e.toDisplayString(e.unref(_)("table.ofPages",{total:Hn.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Tt.value>=fn.value-1,onClick:g[11]||(g[11]=x=>tl(Tt.value+1)),title:e.unref(_)("table.nextPage")}," › ",8,Yu),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Tt.value>=fn.value-1,onClick:g[12]||(g[12]=x=>tl(fn.value-1)),title:e.unref(_)("table.lastPage")},[...g[36]||(g[36]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,ju)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ku,[qt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:Vl},[e.createElementVNode("span",Gu,e.toDisplayString(e.unref(_)("table.rowsPerPage"))+":",1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":el.value}]),onClick:g[13]||(g[13]=x=>el.value=!el.value),"aria-expanded":el.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:an},[e.createTextVNode(e.toDisplayString(wl.value)+" ",1),g[37]||(g[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Qu),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",{class:e.normalizeClass(["dss-pagination-select-dropdown",{"dss-pagination-select-dropdown--top":al.value==="top"}]),style:e.normalizeStyle(At.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qe.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x,role:"option","aria-selected":x===wl.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":x===wl.value}]),onClick:q=>Pn(x)},e.toDisplayString(x),11,Ju))),128))],6),[[e.vShow,el.value]])]),_:1})],512)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],4),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:"dss-table-filter-dropdown dss-table-filter-dropdown--teleport",style:e.normalizeStyle(Kt.value?{top:Kt.value.top+"px",left:Kt.value.left+"px",width:ql+"px"}:void 0),onClick:g[21]||(g[21]=e.withModifiers(()=>{},["stop"]))},[El.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[El.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",ed,[e.createElementVNode("input",{type:"text",value:Dl(Bt.value).value??"",onInput:g[14]||(g[14]=x=>Ml(Bt.value,x.target.value)),class:"dss-table-filter-input",placeholder:e.unref(_)("table.search")},null,40,td)])):El.value.filter==="range"&&il.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":il.value.minPct+"%","--range-max-pct":il.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:vl,class:"dss-table-filter-double-range-track",onMousemove:wn,onMouseenter:wn},[e.createElementVNode("input",{type:"range",min:il.value.rangeMin,max:il.value.rangeMax,value:il.value.currentMin,onInput:g[15]||(g[15]=x=>$(Bt.value,"min",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:dn.value==="min"?2:1})},null,44,ld),e.createElementVNode("input",{type:"range",min:il.value.rangeMin,max:il.value.rangeMax,value:il.value.currentMax,onInput:g[16]||(g[16]=x=>$(Bt.value,"max",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:dn.value==="max"?2:1})},null,44,nd)],544),e.createElementVNode("div",od,e.toDisplayString(il.value.currentMin)+" – "+e.toDisplayString(il.value.currentMax),1)],4)):El.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",ad,[e.createElementVNode("div",sd,[e.createElementVNode("label",rd,e.toDisplayString(e.unref(_)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:Dl(Bt.value).from??"",onInput:g[17]||(g[17]=x=>O(Bt.value,"from",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,id)]),e.createElementVNode("div",cd,[e.createElementVNode("label",ud,e.toDisplayString(e.unref(_)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:Dl(Bt.value).to??"",onInput:g[18]||(g[18]=x=>O(Bt.value,"to",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,dd)])])):El.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:D[Bt.value]??"",onInput:g[19]||(g[19]=x=>ne(Bt.value,x.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(_)("table.search")},null,40,md),e.createElementVNode("div",pd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ae(El.value),x=>(e.openBlock(),e.createElementBlock("label",{key:x,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:it(Bt.value,x),onChange:q=>vt(Bt.value,x)},null,40,vd),e.createElementVNode("span",null,e.toDisplayString(x),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",fd,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:g[20]||(g[20]=x=>zn(Bt.value))},e.toDisplayString(e.unref(_)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,Bt.value&&El.value&&Kt.value]])]),_:1})]))],64))}}),yd="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M6.008%2014V12.68H8.288V6.572L5.996%208.276V6.692L8.012%205.24H9.788V12.68H11.624V14H6.008Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",kd="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M5.948%2014V12.548L8.684%209.8C9.068%209.408%209.352%209.056%209.536%208.744C9.72%208.424%209.812%208.096%209.812%207.76C9.812%207.352%209.7%207.036%209.476%206.812C9.252%206.58%208.948%206.464%208.564%206.464C8.14%206.464%207.808%206.588%207.568%206.836C7.328%207.076%207.208%207.412%207.208%207.844H5.708C5.716%207.284%205.836%206.804%206.068%206.404C6.308%205.996%206.644%205.68%207.076%205.456C7.508%205.232%208.012%205.12%208.588%205.12C9.14%205.12%209.62%205.224%2010.028%205.432C10.436%205.64%2010.752%205.932%2010.976%206.308C11.2%206.684%2011.312%207.132%2011.312%207.652C11.312%208.188%2011.172%208.712%2010.892%209.224C10.62%209.728%2010.18%2010.272%209.572%2010.856L7.748%2012.644H11.42V14H5.948Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Cd="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.516%2014.12C7.948%2014.12%207.452%2014.016%207.028%2013.808C6.612%2013.6%206.288%2013.308%206.056%2012.932C5.824%2012.556%205.708%2012.112%205.708%2011.6H7.22C7.22%2011.992%207.332%2012.3%207.556%2012.524C7.788%2012.74%208.112%2012.848%208.528%2012.848C8.944%2012.848%209.264%2012.736%209.488%2012.512C9.712%2012.288%209.824%2011.984%209.824%2011.6V10.916C9.824%2010.524%209.712%2010.22%209.488%2010.004C9.264%209.78%208.944%209.668%208.528%209.668H7.544V8.312L9.476%206.524H6.104V5.24H11V6.596L8.528%208.864V8.384C9.392%208.384%2010.076%208.612%2010.58%209.068C11.084%209.524%2011.336%2010.14%2011.336%2010.916V11.6C11.336%2012.112%2011.22%2012.556%2010.988%2012.932C10.756%2013.308%2010.428%2013.6%2010.004%2013.808C9.58%2014.016%209.084%2014.12%208.516%2014.12Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",bd="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M9.68%2014V12.26H5.78V10.088L9.152%205.24H10.832L7.22%2010.484V10.94H9.68V8.96H11.18V14H9.68Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",wd="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.588%2014.12C7.78%2014.12%207.132%2013.92%206.644%2013.52C6.156%2013.112%205.888%2012.56%205.84%2011.864H7.34C7.372%2012.168%207.492%2012.404%207.7%2012.572C7.916%2012.732%208.212%2012.812%208.588%2012.812C9.004%2012.812%209.32%2012.704%209.536%2012.488C9.752%2012.264%209.86%2011.956%209.86%2011.564V10.712C9.86%2010.312%209.752%2010.008%209.536%209.8C9.32%209.584%209.004%209.476%208.588%209.476C8.332%209.476%208.112%209.528%207.928%209.632C7.744%209.736%207.604%209.88%207.508%2010.064H6.044L6.104%205.24H11.036V6.596H7.52L7.496%209.14H7.844L7.484%209.44C7.484%209.072%207.628%208.784%207.916%208.576C8.212%208.36%208.608%208.252%209.104%208.252C9.816%208.244%2010.368%208.46%2010.76%208.9C11.16%209.332%2011.36%209.936%2011.36%2010.712V11.564C11.36%2012.356%2011.112%2012.98%2010.616%2013.436C10.128%2013.892%209.452%2014.12%208.588%2014.12Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",xd="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.6%2014.12C8.016%2014.12%207.5%2014%207.052%2013.76C6.612%2013.512%206.268%2013.168%206.02%2012.728C5.78%2012.28%205.66%2011.764%205.66%2011.18C5.66%2010.764%205.728%2010.328%205.864%209.872C6.008%209.416%206.204%208.988%206.452%208.588L8.516%205.24H10.184L7.592%209.32L7.664%209.368C7.824%209.12%208.04%208.932%208.312%208.804C8.584%208.676%208.888%208.612%209.224%208.612C9.696%208.612%2010.104%208.724%2010.448%208.948C10.792%209.172%2011.06%209.484%2011.252%209.884C11.444%2010.284%2011.54%2010.752%2011.54%2011.288C11.54%2011.856%2011.416%2012.352%2011.168%2012.776C10.928%2013.2%2010.588%2013.532%2010.148%2013.772C9.716%2014.004%209.2%2014.12%208.6%2014.12ZM8.6%2012.848C9.04%2012.848%209.396%2012.708%209.668%2012.428C9.94%2012.14%2010.076%2011.768%2010.076%2011.312C10.076%2010.84%209.94%2010.464%209.668%2010.184C9.396%209.896%209.04%209.752%208.6%209.752C8.16%209.752%207.804%209.896%207.532%2010.184C7.26%2010.464%207.124%2010.84%207.124%2011.312C7.124%2011.768%207.26%2012.14%207.532%2012.428C7.804%2012.708%208.16%2012.848%208.6%2012.848Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Ed={class:"dss-toolbar-left"},Sd=["title"],Vd=["title"],Nd={class:"dss-toolbar-dropdown-wrapper"},Bd=["title"],Md=["src"],_d=["src"],$d=["src"],Ld=["src"],Td=["src"],Ad=["src"],Dd={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Hd=["src"],Rd=["src"],Fd=["src"],Id=["src"],zd=["src"],Pd=["src"],Od=["title"],Wd=["title"],qd=["title"],Zd=["title"],Ud=["title"],Xd=["title"],Yd=["title"],jd=["title"],Kd=["title"],Gd={key:2,class:"dss-toolbar-separator"},Qd=["title"],Jd={key:4,class:"dss-toolbar-separator"},e1={key:5,class:"dss-toolbar-dropdown-wrapper"},t1=["title"],l1={class:"dss-toolbar-dropdown-ai"},n1={class:"dss-toolbar-right"},o1={key:0,class:"dss-toolbar-custom-group"},a1={key:1,class:"dss-toolbar-separator"},s1={class:"dss-link-modal-content"},r1={class:"dss-link-modal-field"},i1={class:"dss-link-modal-label"},c1=["placeholder"],u1={class:"dss-link-modal-field"},d1={class:"dss-link-modal-label"},m1=["placeholder"],p1={class:"dss-image-modal-tabs"},v1={key:0,class:"dss-image-tab-content"},f1={class:"dss-link-modal-content"},h1={class:"dss-link-modal-field"},g1={key:0,class:"dss-link-modal-label"},y1=["src"],k1={class:"dss-link-modal-field"},C1={class:"dss-link-modal-label"},b1=["placeholder"],w1={class:"dss-link-modal-field"},x1={class:"dss-link-modal-label"},E1=["placeholder"],S1={class:"dss-link-modal-field"},V1={class:"dss-link-modal-label"},N1=["placeholder"],B1={key:1,class:"dss-image-tab-content"},M1={class:"dss-link-modal-content"},_1={class:"dss-link-modal-field"},$1={class:"dss-link-modal-label"},L1=["placeholder"],T1={class:"dss-link-modal-field"},A1={class:"dss-link-modal-label"},D1=["placeholder"],H1={class:"dss-link-modal-field"},R1={class:"dss-link-modal-label"},F1=["placeholder"],I1={class:"dss-link-modal-field"},z1={class:"dss-link-modal-label"},P1=["placeholder"],O1={class:"dss-text-editor-title-input-container"},W1={key:0,class:"dss-text-editor-title-preview"},q1={key:0},Z1={key:1,class:"dss-text-editor-preview-placeholder"},U1=["value","placeholder","disabled"],X1={key:3,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},Y1={class:"dss-text-editor-description-input-container"},j1={key:0,class:"dss-text-editor-description-preview"},K1={key:0},G1={key:1,class:"dss-text-editor-preview-placeholder"},Q1=["value","placeholder","disabled"],J1={key:5,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},em=["data-comment-id","onMouseenter"],tm=["onClick"],lm=["src","alt"],nm={key:1},om=["onClick"],am=["src","alt"],sm={key:1},rm=["data-has-second-user","onClick"],im={class:"editor-comment-marker-count"},cm={key:7,class:"dss-text-editor-textarea-wrapper"},um=["value","placeholder","rows","disabled"],dm={class:"dss-text-editor-footer"},mm={class:"dss-text-editor-footer-content"},pm={class:"dss-text-editor-footer-stat"},vm={class:"dss-text-editor-footer-stat"},fm={key:8,class:"dss-text-editor-content-wrapper"},hm={key:0,class:"dss-comment-overlay-body"},gm={class:"dss-comment-selection-wrapper"},ym=["innerHTML"],km={class:"dss-comment-messages-wrapper"},Cm={key:0,class:"dss-comment-avatar-wrapper"},bm={class:"dss-comment-avatar"},wm=["src","alt"],xm={key:1},Em={class:"dss-comment-header"},Sm={class:"dss-comment-header-text"},Vm={class:"dss-comment-author"},Nm={key:0,class:"dss-comment-date"},Bm=["onClick","title"],Mm={class:"dss-comment-overlay-inner"},_m=["placeholder","onKeydown"],$m={class:"dss-text-editor-footer"},Lm={class:"dss-text-editor-footer-content"},Tm={class:"dss-text-editor-footer-stat"},Am={class:"dss-text-editor-footer-stat"},Dm=["title"],Hm=["title"],Rm={xmlns:"http://www.w3.org/2000/svg",version:"1.1","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"512",height:"512",x:"0",y:"0",viewBox:"0 0 32 32",style:{"enable-background":"new 0 0 512 512"},"xml:space":"preserve",class:""},Fm={class:"dss-image-popup-content"},Im={key:0,class:"dss-image-popup-no-alt-icon"},zm=["title"],Pm=["title"],Om={xmlns:"http://www.w3.org/2000/svg",version:"1.1","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"512",height:"512",x:"0",y:"0",viewBox:"0 0 32 32",style:{"enable-background":"new 0 0 512 512"},"xml:space":"preserve",class:""},Wm={class:"dss-toolbar-left"},qm=["title"],Zm=["title"],Um={class:"dss-toolbar-dropdown-wrapper"},Xm=["title"],Ym=["src"],jm=["src"],Km=["src"],Gm=["src"],Qm=["src"],Jm=["src"],e2={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},t2=["title"],l2=["title"],n2=["title"],o2=["title"],a2=["title"],s2=["title"],r2=["title"],i2=["title"],c2=["title"],u2={key:2,class:"dss-toolbar-separator"},d2=["title"],m2={key:4,class:"dss-toolbar-separator"},p2={key:5,class:"dss-toolbar-dropdown-wrapper"},v2=["title"],f2={class:"dss-toolbar-dropdown-ai"},h2={key:0,class:"dss-toolbar-right"},g2={key:0,class:"dss-toolbar-separator"},y2={key:0,class:"dss-toolbar-custom-group"},k2={key:1,class:"dss-toolbar-separator"},C2={name:"DSSTextEditor"},b2=Object.assign(C2,{props:{modelValue:{type:String,default:""},title:{type:String,default:""},description:{type:String,default:""},titlePlaceholder:{type:String,default:null},descriptionPlaceholder:{type:String,default:null},placeholder:{type:String,default:null},rows:{type:Number,default:10},fullHeight:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},richText:{type:Boolean,default:!1},border:{type:Boolean,default:!0},rounded:{type:Boolean,default:!1},fixedHeight:{type:Boolean,default:!1},options:{type:Object,default:()=>({}),validator:E=>typeof E=="object"&&E!==null},floatingToolbar:{type:Boolean,default:!1},askAi:{type:Boolean,default:!1},showTitle:{type:Boolean,default:!0},showDescription:{type:Boolean,default:!0},commentUser:{type:Object,default:null},customToolbarSlots:{type:Array,default:()=>["custom-tool-1","custom-tool-2","custom-tool-3"]},customToolbarFloatingMap:{type:Object,default:()=>({}),validator:E=>typeof E=="object"&&E!==null},locale:{type:String,default:null},comments:{type:Array,default:()=>[]}},emits:["update:modelValue","update:title","update:description","update:comments","change","blur","title-change","description-change","comment-submitted","comment-marker-clicked","comment-deleted"],setup(E,{expose:le,emit:_}){const{t:B,locale:de}=so.useI18n(),P={h1:yd,h2:kd,h3:Cd,h4:bd,h5:wd,h6:xd},T=E,he=_,st=e.useSlots(),te=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
101
101
|
<path d="M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z" fill="#c13340"/>
|
|
102
|
-
</svg>`,v=e.ref(null),be=e.ref(null),ke=e.ref(!1),J=e.ref(!1),Y=e.ref(!1),me=e.ref(""),F=e.ref({}),ue=e.ref(!1),$e=e.ref(!1),tt=e.ref(""),mt=e.ref(""),U=e.ref(null),ze=e.ref(null),qe=e.ref(null),Ve=e.ref(null),Le=e.ref(""),je=e.ref(!1),re=e.ref({}),Qe=e.ref(!1),Ce=e.ref({}),Je=e.ref(null),ut=e.ref(null),ht=e.ref(!1),dt=e.ref(""),Wt=e.ref(null),qt=e.ref(""),Ct=e.ref(""),wt=e.ref(""),Yt=e.ref(null),it=e.ref(null),Kt=e.ref(null),yt=e.ref(null),el=e.ref(null),X=e.ref(!1),ge=e.ref(""),W=e.ref({}),G=e.ref(!1),Ne=e.ref("upload"),Pe=e.ref(""),Xe=e.ref(null),Et=e.ref(null),Ge=e.ref([]),Zt=e.ref([]),Ue=e.ref(null),We=e.ref(!1),Dt=e.ref(""),Lt=e.ref(""),ne=e.ref(""),j=e.ref(""),K=e.ref(""),de=e.ref(""),xe=e.ref(null),Ke=e.ref(null),Ht=e.ref(null),jt=e.ref(!1),et=e.ref(null),vl=e.ref(!1),M=e.ref(!1),x=e.ref(null),A=e.ref("p"),ae=e.ref(!1),oe=e.ref([]),Fe=e.ref(null),bt=e.ref(null),ot=e.ref(null),Ie=e.ref(!1),xt=e.ref(0),Mt=100,St=e.ref(null),At=e.computed(()=>!!L.commentUser),It=e.computed(()=>({"dss-text-editor-no-border":!L.border,"dss-text-editor-rounded":L.rounded,"dss-text-editor-full-height":L.fullHeight,"dss-comment-overlay-open":At.value&&Cl.value!==null})),Nt=e.computed(()=>({})),yl=e.computed(()=>!L.fixedHeight||L.fullHeight?{}:{height:`${1.6*14*L.rows+24+2}px`,resize:"none",overflowY:"auto"}),nn=e.computed(()=>!L.fixedHeight||L.fullHeight?{}:{height:`${1.6*14*L.rows+32}px`,overflowY:"auto"}),Vl=e.computed(()=>L.richText&&Zt.value.length>0),Nl=e.computed(()=>{if(!L.modelValue)return"";if(L.richText){let a=L.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return a=a.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),a=a.replace(/<[^>]+>/g,""),a=a.replace(/ /g," "),a=a.replace(/&/g,"&"),a=a.replace(/</g,"<"),a=a.replace(/>/g,">"),a=a.replace(/"/g,'"'),a=a.replace(/'/g,"'"),a=a.replace(/\s+/g," ").trim(),a}return L.modelValue}),tl=e.computed(()=>{const a=Nl.value.trim();return a?a.split(/\s+/).filter(n=>n.length>0).length:0}),jl=e.computed(()=>Nl.value.length),on=e.computed(()=>yt.value!==null&&Ne.value==="upload"&&qt.value&&qt.value.startsWith("data:")),xl=e.computed(()=>L.titlePlaceholder||V("textEditor.placeholders.title")),Fl=e.computed(()=>L.descriptionPlaceholder||V("textEditor.placeholders.description")),dn=e.computed(()=>L.placeholder||V("textEditor.placeholders.startTyping")),Hl=a=>rt&&rt[a]!==void 0,Pn=a=>{for(let n=a+1;n<L.customToolbarSlots.length;n++)if(Hl(L.customToolbarSlots[n]))return!0;return!1},mn=a=>{for(let n=a+1;n<L.customToolbarSlots.length;n++){const s=L.customToolbarSlots[n];if(Hl(s)&&pn(s))return!0}return!1},pn=a=>L.customToolbarFloatingMap.hasOwnProperty(a)?L.customToolbarFloatingMap[a]===!0:!0,wn=e.computed(()=>L.customToolbarSlots.some(a=>Hl(a)&&pn(a))),ql=e.computed(()=>Hl("title-slot")),rl=e.computed(()=>Hl("description-slot")),Il=a=>{if(!a||a.trim()==="")return"<html></html>";const n=a.trim();return n.startsWith("<html>")&&n.endsWith("</html>")?a:`<html>${a}</html>`},Kl=a=>{if(!a||a.trim()==="")return"";const n=a.replace(/<!--[\s\S]*?-->/g,""),s=n.trim();return s.startsWith("<html>")&&s.endsWith("</html>")?s.slice(6,-7).trim():n},sn=a=>{if(!a)return;const n=document.createTreeWalker(a,NodeFilter.SHOW_COMMENT,null,!1),s=[];let i=n.nextNode();for(;i;)s.push(i),i=n.nextNode();s.forEach(c=>c.remove())},T=a=>{try{const n=String(a.getDate()).padStart(2,"0"),i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][a.getMonth()],c=a.getFullYear();return`${n} ${i} ${c}`}catch{return""}},z=a=>{if(!a||typeof a!="string")return!1;const n=a.trim();if(!n)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(n))return!0;try{const c=V("textEditor.started_conversation");if(c&&n===c)return!0}catch{}const i=n.toLowerCase();return i.includes("started conversation")||i.includes("démarré la conversation")||i==="started conversation"||i==="a démarré la conversation"},_=a=>{const n=a.target.value;fe("update:modelValue",n),fe("change",n)},le=()=>{if(!xe.value)return;const a=xe.value;if(a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important"),a.value.trim()===""){const i=a.value;a.value="M";const c=a.scrollHeight;a.value=i,a.style.setProperty("height",`${c}px`,"important"),a.style.setProperty("overflow-y","hidden","important");return}a.offsetHeight;const s=a.scrollHeight;a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important")},Te=()=>{vl.value=!0,le()},pt=()=>{vl.value=!1,ct()},ct=()=>{if(!xe.value)return;const a=xe.value;a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important");const n=a.value;a.value="M";const s=a.scrollHeight;a.value=n,a.offsetHeight,a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important"),a.style.setProperty("overflow-x","hidden","important"),a.style.setProperty("text-overflow","ellipsis","important"),a.style.setProperty("white-space","nowrap","important")},lt=a=>{const s=a.target.value;vl.value&&le(),fe("update:title",s),fe("title-change",s),Ht.value="title",L.richText&&(We.value||(Lt.value=Dt.value,K.value=ne.value,de.value=j.value),Ue.value&&clearTimeout(Ue.value),We.value=!0,Ue.value=setTimeout(()=>{We.value=!1,Qt()},500))},st=()=>{if(!Ke.value)return;const a=Ke.value;if(a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important"),a.value.trim()===""){const i=a.value;a.value="M";const c=a.scrollHeight;a.value=i,a.style.setProperty("height",`${c}px`,"important"),a.style.setProperty("overflow-y","hidden","important");return}a.offsetHeight;const s=a.scrollHeight;a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important")},il=()=>{M.value=!0,st()},kl=()=>{M.value=!1,Gt()},Gt=()=>{if(!Ke.value)return;const a=Ke.value;a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important");const n=a.value;a.value="M";const s=a.scrollHeight;a.value=n,a.offsetHeight,a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important"),a.style.setProperty("overflow-x","hidden","important"),a.style.setProperty("text-overflow","ellipsis","important"),a.style.setProperty("white-space","nowrap","important")},wl=a=>{const s=a.target.value;M.value&&st(),fe("update:description",s),fe("description-change",s),Ht.value="description",L.richText&&(We.value||(Lt.value=Dt.value,K.value=ne.value,de.value=j.value),Ue.value&&clearTimeout(Ue.value),We.value=!0,Ue.value=setTimeout(()=>{We.value=!1,Qt()},500))},Rt=()=>{const a=window.getSelection();if(a.rangeCount===0)return null;const n=a.getRangeAt(0);if(n.startContainer.nodeType===1)return{type:"element",element:n.startContainer,offset:n.startOffset};const s=n.cloneRange();return s.selectNodeContents(v.value),s.setEnd(n.startContainer,n.startOffset),{type:"text",start:s.toString().length,end:s.toString().length+n.toString().length}},Ll=a=>{if(!(!a||!v.value))try{const n=window.getSelection(),s=document.createRange();if(a.type==="element"&&a.element)if(v.value.contains(a.element)){s.setStart(a.element,a.offset),s.collapse(!0),n.removeAllRanges(),n.addRange(s);return}else{v.value.focus();return}let i=0;const c=[v.value];let d=null,u=!1,p=!1;for(;!p&&(d=c.pop());)if(d.nodeType===3){const h=i+d.length;!u&&a.start>=i&&a.start<=h&&(s.setStart(d,a.start-i),u=!0),u&&a.end>=i&&a.end<=h&&(s.setEnd(d,a.end-i),p=!0),i=h}else{let h=d.childNodes.length;for(;h--;)c.push(d.childNodes[h])}n.removeAllRanges(),n.addRange(s)}catch{v.value.focus()}},fn=()=>{if(!v.value)return;v.value.focus();const a=window.getSelection(),n=document.createRange(),s=c=>{if(c.nodeType===3||c.childNodes.length===0)return c;for(let d=c.childNodes.length-1;d>=0;d--){const u=c.childNodes[d],p=s(u);if(p)return p}return c},i=s(v.value);if(i.nodeType===3)n.setStart(i,i.length),n.setEnd(i,i.length);else if(i.childNodes.length>0){const c=s(i);c&&c.nodeType===3?(n.setStart(c,c.length),n.setEnd(c,c.length)):(n.selectNodeContents(i),n.collapse(!1))}else n.setStart(i,0),n.setEnd(i,0);a.removeAllRanges(),a.addRange(n)},Qt=(a=!1)=>{if(!v.value)return;const n=v.value.innerHTML,s=L.title||"",i=L.description||"";if(!a&&n===Dt.value&&s===ne.value&&i===j.value)return;const c={content:Lt.value||Dt.value,title:K.value!==void 0?K.value:ne.value,description:de.value!==void 0?de.value:j.value},d=Ge.value.length>0?Ge.value[Ge.value.length-1]:null;let u=!0;d&&(typeof d=="string"?u=c.content!==d:u=c.content!==d.content||c.title!==d.title||c.description!==d.description),u&&(Ge.value.push(c),Ge.value.length>50&&Ge.value.shift(),Zt.value=[]),Dt.value=n,ne.value=s,j.value=i,Lt.value=n,K.value=s,de.value=i},_t=a=>{if(!v.value)return;Ln(),v.value&&sn(v.value);let n=null;v.value&&(v.value.querySelector("p")||(n=Rt(),En()));const s=a&&a.inputType&&(a.inputType==="insertText"||a.inputType==="insertCompositionText"||a.inputType==="deleteContentBackward"||a.inputType==="deleteContentForward");s&&x.value&&(x.value=null),J.value=!0;const i=v.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/ |\u00A0/g," "),c=Il(i);fe("update:modelValue",c),fe("change",c),Ht.value="editor",We.value||(Lt.value=Dt.value,K.value=ne.value,de.value=j.value),Ue.value&&clearTimeout(Ue.value),We.value=!0,Ue.value=setTimeout(()=>{We.value=!1,Qt(),vo(),Fn()},500),e.nextTick(()=>{n&&Ll(n),Ln();const d=["bold","italic","underline"],u=window.getSelection(),p=u.rangeCount>0?u.getRangeAt(0):null,h=p&&p.collapsed;if(d.forEach(k=>{try{if(h&&x.value?.command===k){re.value[k]=x.value.state;return}if(k==="bold")if(p){const D=p.commonAncestorContainer,I=D.nodeType===3?D.parentElement:D;let N=!1;if(I&&((I.tagName==="STRONG"||I.tagName==="B"||I.closest&&I.closest("strong, b"))&&(N=!0),!N&&I.style&&parseInt(I.style.fontWeight)>=600&&(N=!0),!N))try{const se=window.getComputedStyle(I);parseInt(se.fontWeight)>=600&&(N=!0)}catch{}re.value[k]=N}else re.value.hasOwnProperty(k)||(re.value[k]=!1);else if(k==="italic")if(p){const D=p.commonAncestorContainer,I=D.nodeType===3?D.parentElement:D,N=I&&(I.tagName==="EM"||I.tagName==="I"||I.closest&&I.closest("em, i"));re.value[k]=!!N}else{const D=document.queryCommandState(k);re.value[k]=D}else{const D=document.queryCommandState(k);re.value[k]=D}}catch{}}),Tt(),Zl(),Gl(),cl(),rn(),Yl("handleRichTextInput"),s&&(a.inputType==="insertText"||a.inputType==="insertCompositionText")){const k=a.data||"";k&&k.length===1&&setTimeout(()=>Fn(k),0),(k===" "||k===`
|
|
103
|
-
`||/[.,;:!?]/.test(k))&&setTimeout(()=>{vo()},100)}J.value=!1})},Ln=()=>{if(!v.value)return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const n=a.getRangeAt(0),s=n.commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(!i)return;const c=i.closest(".dss-image-wrapper");if(c){const d=c.querySelector("img");if(i!==d&&!d?.contains(i)){const u=n.startContainer.nodeType===3?n.startContainer.parentElement:n.startContainer,p=n.endContainer.nodeType===3?n.endContainer.parentElement:n.endContainer;if(c.contains(u)&&u!==d||c.contains(p)&&p!==d){const h=document.createRange();h.setStartAfter(c),h.collapse(!0),a.removeAllRanges(),a.addRange(h)}}}},En=()=>{if(!v.value)return;const a=v.value;if(a.querySelector&&a.querySelector("p"))return;const n=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),s=Array.from(a.childNodes);let i=null;s.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===a&&a.removeChild(c);return}i||(i=document.createElement("p"),a.insertBefore(i,c)),i.appendChild(c);return}if(c.nodeType===Node.ELEMENT_NODE){const d=c,u=d.tagName;if(u==="BR"){i=null;return}if(n.has(u)){i=null;return}i||(i=document.createElement("p"),a.insertBefore(i,d)),i.appendChild(d)}})},Zl=()=>{if(v.value&&!jt.value){jt.value=!0;try{v.value.querySelectorAll(".dss-image-wrapper").forEach(i=>{i.querySelector("img")||i.remove()}),v.value.querySelectorAll(".dss-image-no-alt-icon").forEach(i=>{const c=i.parentElement;!c||!c.classList.contains("dss-image-wrapper")?i.remove():c.querySelector("img")||i.remove()}),v.value.querySelectorAll("img").forEach(i=>{let c=i.getAttribute("alt");c===null&&(c=i.alt||"");const d=i.getAttribute("src")||i.src||"";if(c){const k=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),D=c===d||c===k;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||D||D)&&(c="")}i.setAttribute("alt",c),i.setAttribute("data-alt",c);const u=!c||c.trim()==="";let p=i.parentElement;const h=p&&p.classList.contains("dss-image-wrapper");if(h){const k=p.querySelector(".dss-image-no-alt-icon");k&&k.remove()}else{const k=i.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?i.nextElementSibling:null;k&&k.remove()}if(u){h?p.setAttribute("contenteditable","false"):(p=document.createElement("span"),p.className="dss-image-wrapper",p.setAttribute("contenteditable","false"),i.parentNode.insertBefore(p,i),p.appendChild(i));const k=document.createElement("div");k.className="dss-image-no-alt-icon",k.setAttribute("contenteditable","false"),k.innerHTML=ee,p.appendChild(k)}else if(h&&p.children.length===1){const k=p.parentNode;k.insertBefore(i,p),k.removeChild(p)}})}finally{jt.value=!1}}},vn=a=>{vo(),fe("blur",a),Bn()},hn=()=>{if(L.disabled||!L.richText||!v.value)return;nl(),Ue.value&&(clearTimeout(Ue.value),Ue.value=null),We.value&&(Qt(),We.value=!1);const a=Ht.value==="title",n=Ht.value==="description",s=Ht.value==="editor";if(Ge.value.length===0){a&&xe.value?xe.value.focus():n&&Ke.value?Ke.value.focus():v.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{_t()});return}const i={content:v.value.innerHTML,title:L.title||"",description:L.description||""};Zt.value.push(i);const c=Ge.value.pop();if(c!==void 0){J.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",p=typeof c=="object"&&c.description||"";v.value.innerHTML=d,Dt.value=d,ne.value=u,j.value=p,Lt.value=d,K.value=u,de.value=p,e.nextTick(()=>{Tt(),El(),yn(),cl();const h=Il(d);fe("update:modelValue",h),fe("update:title",u),fe("update:description",p),fe("change",h),fe("title-change",u),fe("description-change",p),J.value=!1,e.nextTick(()=>{setTimeout(()=>{if(a){if(xe.value){xe.value.focus();const k=u.length;xe.value.setSelectionRange&&xe.value.setSelectionRange(k,k),le()}}else if(n){if(Ke.value){Ke.value.focus();const k=p.length;Ke.value.setSelectionRange(k,k)}}else if(s)fn();else if(xe.value&&document.activeElement===xe.value){const k=u.length;xe.value.setSelectionRange&&xe.value.setSelectionRange(k,k),le()}else if(Ke.value&&document.activeElement===Ke.value){const k=p.length;Ke.value.setSelectionRange(k,k)}else v.value&&fn()},10)})})}},An=()=>{if(L.disabled||!L.richText||!v.value)return;nl();const a=Ht.value==="title",n=Ht.value==="description",s=Ht.value==="editor";if(Zt.value.length===0){a&&xe.value?xe.value.focus():n&&Ke.value?Ke.value.focus():v.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{_t()});return}const i={content:v.value.innerHTML,title:L.title||"",description:L.description||""};Ge.value.push(i);const c=Zt.value.pop();if(c!==void 0){J.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",p=typeof c=="object"&&c.description||"";v.value.innerHTML=d,Dt.value=d,ne.value=u,j.value=p,Lt.value=d,K.value=u,de.value=p,e.nextTick(()=>{Tt(),El(),yn(),cl();const h=Il(d);fe("update:modelValue",h),fe("update:title",u),fe("update:description",p),fe("change",h),fe("title-change",u),fe("description-change",p),J.value=!1,e.nextTick(()=>{setTimeout(()=>{if(a){if(xe.value){xe.value.focus();const k=u.length;xe.value.setSelectionRange&&xe.value.setSelectionRange(k,k),le()}}else if(n){if(Ke.value){Ke.value.focus();const k=p.length;Ke.value.setSelectionRange(k,k)}}else if(s)fn();else if(xe.value&&document.activeElement===xe.value){const k=u.length;xe.value.setSelectionRange&&xe.value.setSelectionRange(k,k),le()}else if(Ke.value&&document.activeElement===Ke.value){const k=p.length;Ke.value.setSelectionRange(k,k)}else v.value&&fn()},10)})})}},Tn=()=>{if(!v.value)return;v.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{const c=i.style.fontWeight;if(c==="normal"||c==="400"){const d=document.createDocumentFragment();for(;i.firstChild;)d.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(d,i)}}),v.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{if(parseInt(i.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";i.firstChild;)d.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(d,i)}}),v.value.querySelectorAll("b, strong").forEach(i=>{i.style.fontWeight="600"})},Gl=()=>{if(!v.value)return;v.value.querySelectorAll("i, em").forEach(n=>{n.style.fontStyle="italic"})},ll=()=>{const a=window.getSelection();if(!a||a.rangeCount===0)return!1;const n=a.getRangeAt(0);let s=!1;if(n.collapsed){const i=n.startContainer;let c=i.nodeType===3?i.parentElement:i;for(;c&&c!==v.value;){if(c.tagName==="EM"||c.tagName==="I"){s=!0;break}if(c.style&&c.style.fontStyle==="italic"){s=!0;break}c=c.parentElement}}else{const i=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(i){const c=document.createTreeWalker(i,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==v.value;){if(u.tagName==="EM"||u.tagName==="I"){s=!0;break}if(u.style&&u.style.fontStyle==="italic"){s=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="EM"||u.tagName==="I"){s=!0;break}if(u.style&&u.style.fontStyle==="italic"){s=!0;break}}if(s)break}}}if(s)return document.execCommand("italic",!1),e.nextTick(()=>{Gl()}),!1;if(n.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{Gl()});else try{const i=n.extractContents(),c=document.createElement("em");c.style.fontStyle="italic",c.appendChild(i),n.insertNode(c),n.setStartAfter(c),n.collapse(!0),a.removeAllRanges(),a.addRange(n),e.nextTick(()=>{Gl()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{Gl()})}return!0},Xn=()=>{const a=window.getSelection();if(!a||a.rangeCount===0)return!1;const n=a.getRangeAt(0);let s=!1;if(n.collapsed){const i=n.startContainer;let c=i.nodeType===3?i.parentElement:i;for(;c&&c!==v.value;){if(c.tagName==="STRONG"||c.tagName==="B"){s=!0;break}if(c.style&&parseInt(c.style.fontWeight)>=600){s=!0;break}c=c.parentElement}}else{const i=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(i){const c=document.createTreeWalker(i,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==v.value;){if(u.tagName==="STRONG"||u.tagName==="B"){s=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){s=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="STRONG"||u.tagName==="B"){s=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){s=!0;break}}if(s)break}}}if(s)return document.execCommand("bold",!1),e.nextTick(()=>{Tn()}),!1;if(n.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0),d=c.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==v.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const p=u.style.fontWeight;if(p==="normal"||p==="400"){const h=document.createElement("b");h.style.fontWeight="600";const k=document.createDocumentFragment();for(;u.firstChild;)k.appendChild(u.firstChild);h.appendChild(k),u.parentNode&&u.parentNode.replaceChild(h,u),c.setStart(h,0),c.collapse(!0),i.removeAllRanges(),i.addRange(c);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===v.value){const p=document.createElement("b");p.style.fontWeight="600",p.innerHTML="<br>",c.insertNode(p),c.setStart(p,0),c.collapse(!0),i.removeAllRanges(),i.addRange(c)}}Tn()});else try{const i=n.extractContents(),c=document.createElement("b");c.style.fontWeight="600",c.appendChild(i),n.insertNode(c),n.setStartAfter(c),n.collapse(!0),a.removeAllRanges(),a.addRange(n),e.nextTick(()=>{Tn()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Tn()})}return!0},Ql=(a,n=null)=>{if(L.disabled||!L.richText||!v.value)return;We.value?(Ue.value&&(clearTimeout(Ue.value),Ue.value=null),Qt(),We.value=!1):Qt(),nl(),v.value.focus();const s=window.getSelection();let i=null;if(s&&s.rangeCount>0){const d=s.getRangeAt(0);!d.collapsed&&Nn(d)&&(i=Rt())}if(a==="createLink"&&n){const d=window.getSelection();if(d.rangeCount>0){const u=d.getRangeAt(0);if(u.collapsed)try{u.expand("word")}catch{const h=document.createTextNode(n);u.insertNode(h),u.selectNodeContents(h)}}}if(a==="bold"){const d=Xn();re.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(x.value={command:"bold",state:d}),e.nextTick(()=>{i&&(Ll(i),e.nextTick(()=>{const p=Jt("bold");re.value.bold=p})),_t(),El(),cl()});return}if(a==="italic"){const d=ll();re.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(x.value={command:"italic",state:d}),e.nextTick(()=>{i&&(Ll(i),e.nextTick(()=>{const p=Jt("italic");re.value.italic=p})),_t(),Gl(),El(),cl()});return}let c=!1;try{c=document.execCommand(a,!1,n)}catch{}e.nextTick(()=>{if(i&&Ll(i),["bold","italic","underline"].includes(a))try{if(a==="bold")i&&e.nextTick(()=>{const u=Jt("bold");re.value.bold=u});else if(a==="italic")if(i)e.nextTick(()=>{const u=Jt("italic");re.value.italic=u});else{const u=document.queryCommandState(a);re.value[a]=u}else{const u=document.queryCommandState(a);re.value[a]=u}}catch{re.value.hasOwnProperty(a)?re.value[a]=!re.value[a]:re.value[a]=!0}if(a==="createLink"&&n){const u=window.getSelection();if(u.rangeCount>0){const h=u.getRangeAt(0),k=h.commonAncestorContainer.nodeType===1?h.commonAncestorContainer.closest("a"):h.commonAncestorContainer.parentElement?.closest("a");k&&(!k.getAttribute("href")||k.getAttribute("href")==="")&&k.setAttribute("href",n)}v.value.querySelectorAll("a").forEach(h=>{const k=h.getAttribute("href");(!k||k===""||k==="#")&&h.setAttribute("href",n)})}_t(),El(),cl()})},Jt=(a,n=null)=>{if(L.disabled||!v.value)return!1;try{if(a==="formatBlock"&&n){const i=document.queryCommandValue("formatBlock");if(n==="<blockquote>"){const c=i.toLowerCase();if(c==="blockquote"||c==="<blockquote>")return!0;const d=window.getSelection();if(d.rangeCount>0){const p=d.getRangeAt(0).commonAncestorContainer;return!!(p.nodeType===1?p.tagName==="BLOCKQUOTE"?p:p.closest("blockquote"):p.parentElement?.closest("blockquote"))}}return i===n||i.toLowerCase()===n.toLowerCase()}if(["bold","italic","underline"].includes(a))try{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0);if(a==="bold"){let u=!1;if(c.collapsed){const p=c.commonAncestorContainer,h=p.nodeType===3?p.parentElement:p;if(h&&((h.tagName==="STRONG"||h.tagName==="B"||h.closest&&h.closest("strong, b"))&&(u=!0),!u&&h.style&&parseInt(h.style.fontWeight)>=600&&(u=!0),!u))try{const k=window.getComputedStyle(h);parseInt(k.fontWeight)>=600&&(u=!0)}catch{}return re.value.hasOwnProperty(a)?re.value[a]:(re.value[a]=u,u)}else{const p=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let h=!1;if(p){const k=document.createTreeWalker(p,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let D;for(;D=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(D))){if(D.nodeType===3){if(!(D.textContent||"").trim())continue;h=!0;let N=D.parentElement;for(;N&&N!==v.value;){if(N.tagName==="STRONG"||N.tagName==="B"){u=!0;break}if(N.style&&parseInt(N.style.fontWeight)>=600){u=!0;break}N=N.parentElement}}else if(D.nodeType===1){const I=D;if(I.tagName==="STRONG"||I.tagName==="B"){u=!0;break}if(I.style&&parseInt(I.style.fontWeight)>=600){u=!0;break}}if(u)break}}return re.value[a]=u&&h,u&&h}}if(a==="italic"){let u=!1;if(c.collapsed){const p=c.commonAncestorContainer,h=p.nodeType===3?p.parentElement:p;if(h&&((h.tagName==="EM"||h.tagName==="I"||h.closest&&h.closest("em, i"))&&(u=!0),!u&&h.style&&h.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(h).fontStyle==="italic"&&(u=!0)}catch{}return re.value.hasOwnProperty(a)?re.value[a]:(re.value[a]=u,u)}else{const p=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let h=!1;if(p){const k=document.createTreeWalker(p,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let D;for(;D=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(D))){if(D.nodeType===3){if(!(D.textContent||"").trim())continue;h=!0;let N=D.parentElement;for(;N&&N!==v.value;){if(N.tagName==="EM"||N.tagName==="I"){u=!0;break}if(N.style&&N.style.fontStyle==="italic"){u=!0;break}N=N.parentElement}}else if(D.nodeType===1){const I=D;if(I.tagName==="EM"||I.tagName==="I"){u=!0;break}if(I.style&&I.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return re.value[a]=u&&h,u&&h}}const d=document.queryCommandState(a);return c.collapsed&&re.value.hasOwnProperty(a)?re.value[a]:(re.value[a]=d,d)}return re.value.hasOwnProperty(a)?re.value[a]:!1}catch{return re.value.hasOwnProperty(a)?re.value[a]:!1}try{return document.queryCommandState(a)}catch{return!1}}catch{return!1}},Dn=a=>{L.disabled||!L.richText||(be.value=be.value===a?null:a,a==="askAi"&&(ut.value=null))},nl=()=>{be.value=null,Xe.value=null},zl=a=>{Ql("formatBlock",a),nl()},On=a=>{if(!a||!v.value)return a;const n=Be=>{let _e=Be.nodeType===Node.TEXT_NODE?Be.parentElement:Be;for(;_e&&_e!==v.value;){const He=_e.tagName;if(He==="P"){const Sl=_e.parentElement;if(Sl===v.value||Sl.tagName==="BLOCKQUOTE")return _e}if(He==="BLOCKQUOTE")break;_e=_e.parentElement}return null},s=n(a.startContainer),i=n(a.endContainer);if(!s||!i)return a;const c=[],d=document.createTreeWalker(v.value,NodeFilter.SHOW_ELEMENT,{acceptNode:Be=>{const _e=Be.tagName;if(_e==="P"){const He=Be.parentElement;if(He===v.value||He.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return _e==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const p=c.indexOf(s),h=c.indexOf(i);if(p===-1||h===-1)return a;const k=Math.min(p,h),D=Math.max(p,h),I=c.slice(k,D+1);if(I.length===0)return a;const N=I[0],se=I[I.length-1],Q=document.createRange();return Q.setStartBefore(N),Q.setEndAfter(se),Q},zt=()=>{if(L.disabled||!L.richText||!v.value)return;We.value?(Ue.value&&(clearTimeout(Ue.value),Ue.value=null),Qt(),We.value=!1):Qt(),nl(),v.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;let n=a.getRangeAt(0);!n.collapsed&&Nn(n)&&(n=On(n),a.removeAllRanges(),a.addRange(n));let s=null;!n.collapsed&&Nn(n)&&(s=Rt());const i=n.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&v.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(h=>{if(h.nodeType===Node.ELEMENT_NODE)if(h.tagName==="P"||h.tagName==="DIV")u.insertBefore(h,c);else{const k=document.createElement("p");k.appendChild(h.cloneNode(!0)),u.insertBefore(k,c)}else if(h.nodeType===Node.TEXT_NODE&&h.textContent.trim()){const k=document.createElement("p");k.appendChild(h.cloneNode(!0)),u.insertBefore(k,c)}}),c.remove()}}else if(n.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),p=n.extractContents();u.appendChild(p),n.insertNode(u);const h=[],k=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:N=>N.parentNode===u&&N.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let D;for(;D=k.nextNode();)h.push(D);if(h.forEach(N=>{const se=document.createElement("p");N.parentNode.insertBefore(se,N),se.appendChild(N)}),u.querySelectorAll("p, div").forEach(N=>{N.textContent.trim()===""&&!N.querySelector("img")&&(N.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const N=document.createElement("p");N.innerHTML="<br>",u.appendChild(N)}}e.nextTick(()=>{s&&Ll(s),yn(),_t(),cl()})},Me=()=>{if(!v.value)return;const a=window.getSelection();if(a.rangeCount===0)return;const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!i||!v.value.contains(i))return;const c=D=>{if(!D)return!1;const I=D.textContent||"",se=(D.innerHTML||"").trim();return I.trim()===""||se===""||se==="<br>"||se==="<br/>"||se==="<p></p>"||se==="<p><br></p>"||se==="<p><br/></p>"||se==="<p> </p>"||se==="<p><br> </p>"||se==="<div></div>"||se==="<div><br></div>"||se==="<div><br/></div>"};let d=null;for(s.nodeType===3?d=s.parentElement:s.tagName==="P"||s.tagName==="DIV"?d=s:d=s.closest("p, div"),d&&i.contains(d)&&c(d)&&d.remove();i.lastChild;){const D=i.lastChild;if(D.nodeType===1&&D.tagName==="BR")D.remove();else if(D.nodeType===3)if((D.textContent||"").trim()==="")D.remove();else break;else break}if(i.children.length>0)for(let D=i.children.length-1;D>=0;D--){const I=i.children[D];if((I.tagName==="P"||I.tagName==="DIV")&&c(I))I.remove();else break}let u=i.innerHTML;const p=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==p&&(i.innerHTML=u);const h=document.createElement("p");h.innerHTML="<br>",i.parentNode?i.nextSibling?i.parentNode.insertBefore(h,i.nextSibling):i.parentNode.appendChild(h):v.value&&v.value.appendChild(h);const k=document.createRange();k.selectNodeContents(h),k.collapse(!0),a.removeAllRanges(),a.addRange(k),e.nextTick(()=>{yn(),_t()})},El=()=>{if(!v.value){ke.value=!1;return}try{const a=window.getSelection();if(a.rangeCount>0){const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");ke.value=!!i}else ke.value=!1}catch{ke.value=!1}},kt=()=>{if(!v.value)return;const a=window.getSelection();a&&a.rangeCount>0&&a.getRangeAt(0),Ve.value=Rt();const n=window.getSelection();let s="";n.rangeCount>0&&(s=n.getRangeAt(0).toString()),tt.value="",mt.value=s,Le.value="",qe.value=null,$e.value=!0,nl(),e.nextTick(()=>{U.value&&U.value.focus()})},Ml=()=>{if(!v.value)return;We.value?(Ue.value&&(clearTimeout(Ue.value),Ue.value=null),Qt(),We.value=!1):Qt();const a=window.getSelection();let n=null;if(a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer;n=i.nodeType===1?i.closest("a"):i.parentElement?.closest("a")}if(!n&&qe.value&&(n=qe.value),n&&n.parentNode){const s=document.createDocumentFragment();for(;n.firstChild;)s.appendChild(n.firstChild);if(n.parentNode.replaceChild(s,n),s.firstChild){const i=document.createRange();i.setStartBefore(s.firstChild),i.setEndAfter(s.lastChild||s.firstChild),a.removeAllRanges(),a.addRange(i),document.execCommand("removeFormat",!1),i.collapse(!1),a.removeAllRanges(),a.addRange(i)}qe.value=null}else Ql("unlink");ke.value=!1,nl(),e.nextTick(()=>{_t(),El()})},nt=()=>{L.disabled||!L.richText||v.value&&(We.value?(Ue.value&&(clearTimeout(Ue.value),Ue.value=null),Qt(),We.value=!1):Qt(),nl(),v.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Tt(),_t(),cl()}))},ft=()=>{L.disabled||!L.richText||v.value&&(We.value?(Ue.value&&(clearTimeout(Ue.value),Ue.value=null),Qt(),We.value=!1):Qt(),nl(),v.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Tt(),_t(),cl()}))},ie=a=>{const n=a.parentElement;if(!n||n.tagName!=="OL")return null;let s=0,i=a.previousElementSibling;for(;i;)i.tagName==="LI"&&s++,i=i.previousElementSibling;return s+1},Tt=()=>{if(!v.value)return;v.value.querySelectorAll("li > ol").forEach(n=>{const s=n.parentElement;if(s&&s.tagName==="LI"){const i=ie(s);i!==null&&Array.from(n.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(i))})}})},De=()=>{if(L.disabled||!L.richText||!v.value)return;nl(),v.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;const n=a.getRangeAt(0),s=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("indent",!1),e.nextTick(()=>{Tt(),_t()});return}const i=s.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const c=s.previousElementSibling;if(c&&c.tagName==="LI"){const d=i.tagName.toLowerCase();let u=c.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),c.appendChild(u));const p=ie(c);u.appendChild(s),p!==null&&i.tagName==="OL"&&s.setAttribute("data-parent-num",String(p)),Tt();const h=document.createRange();h.selectNodeContents(s),h.collapse(!1),a.removeAllRanges(),a.addRange(h),e.nextTick(()=>{_t(),cl()})}else document.execCommand("indent",!1),e.nextTick(()=>{Tt(),_t(),cl()})},Jl=()=>{if(L.disabled||!L.richText||!v.value)return;nl(),v.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;const n=a.getRangeAt(0),s=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("outdent",!1),e.nextTick(()=>{Tt(),_t()});return}const i=s.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const c=i.parentElement;if(c&&c.tagName==="LI"){const d=c.parentElement;if(d&&(d.tagName==="OL"||d.tagName==="UL")){i.tagName==="OL"&&s.removeAttribute("data-parent-num"),d.insertBefore(s,c.nextSibling),i.children.length===0&&i.remove(),Tt();const u=document.createRange();u.selectNodeContents(s),u.collapse(!1),a.removeAllRanges(),a.addRange(u),e.nextTick(()=>{_t(),cl()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Tt(),_t(),cl()})},Cl=e.ref(null),Al=e.ref(null),y=e.ref({}),g=e.ref(""),w=e.ref(null),Z=e.ref("");e.ref("");const he=e.ref(null);e.ref("");const at=e.ref([]),Bt=e.ref(!1),bl=e.ref(!1),Pl=a=>{if(!a)return"";const n=a.cloneRange(),s=document.createElement("div");return s.appendChild(n.cloneContents()),s.innerHTML},Ul=()=>{if(!L.commentUser||L.disabled||!L.richText||!v.value)return;if(Cl.value!==null){Cl.value=null,g.value="",Z.value="",he.value=null,at.value=[],bn(!0);return}nl(),v.value.focus();const a=window.getSelection();if(!a||a.rangeCount===0)return;const n=a.getRangeAt(0);if(n.collapsed||!Nn(n))return;Z.value=Pl(n)||"",he.value=Rt();const s=n.getBoundingClientRect(),i=v.value.parentElement;if(!i)return;const c=i.getBoundingClientRect(),d=s.bottom-c.top,p=Math.max(d+8,0);y.value={top:`${p}px`,bottom:"auto"},Cl.value=Date.now(),e.nextTick(()=>{if(g.value="",w.value){const k=w.value;k.style.height="auto",k.style.height=`${k.scrollHeight}px`,k.focus()}const h=i.querySelector(".dss-comment-overlay");if(h&&i){const k=i.querySelector(".dss-text-editor-footer");if(k){const D=i.getBoundingClientRect(),I=h.getBoundingClientRect(),N=k.getBoundingClientRect(),se=I.bottom-D.top,Q=N.top-D.top,Be=8;if(se>Q-Be){const _e=N.height;y.value={bottom:`${_e+Be}px`,top:"auto"}}else y.value={top:`${p}px`,bottom:"auto"}}}})},gn=()=>{if(!g.value.trim())return;const a=g.value.trim(),n=new Date,s={text:a,selectionText:Z.value,selectionRange:he.value,commentId:Cl.value,user:L.commentUser||null,createdAt:n.toISOString()};at.value=[...at.value,s],fe("comment-submitted",s),Yo(s),he.value&&!Xo(he.value)&&bo(Cl.value,he.value),g.value="",e.nextTick(()=>{if(w.value){const i=w.value;i.style.height="auto",i.style.height=`${i.scrollHeight}px`,i.focus()}Yl("sendComment")})},mo=(a,n)=>{if(!(!L.commentUser||!a.user||a.user.id!==L.commentUser.id)){if(at.value=at.value.filter((s,i)=>i!==n),Cl.value!==null&&v.value){const s=String(Cl.value),i=v.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`);if(i&&at.value.length>0){const c=[],d=new Set;at.value.forEach(u=>{u.user&&u.user.id&&!d.has(u.user.id)&&(d.add(u.user.id),c.push(u.user))}),c.length>0?i.setAttribute("data-comment-user",JSON.stringify(c[0])):i.removeAttribute("data-comment-user"),c.length>1?i.setAttribute("data-comment-user-2",JSON.stringify(c[1])):i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count",String(at.value.length))}else i&&at.value.length===0&&(i.removeAttribute("data-comment-user"),i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count","0"))}if(fe("comment-deleted",{comment:a,index:n,commentId:Cl.value}),L.comments&&Array.isArray(L.comments)){const s=L.comments.filter(i=>!(i.commentId===a.commentId&&i.text===a.text&&i.user?.id===a.user?.id));fe("update:comments",s)}e.nextTick(()=>{Yl("deleteComment")})}},Xo=a=>{if(!a||!v.value)return!1;try{const n=Co(a);if(!n)return!1;const s=n.commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(i)return!!i.closest("[data-comment], [data-fake-comment]")}catch{}return!1},Co=a=>{if(!a||!v.value)return null;try{const n=document.createRange();if(a.type==="element"&&a.element)return v.value.contains(a.element)?(n.setStart(a.element,a.offset),n.collapse(!0),n):null;let s=0;const i=[v.value];let c=null,d=!1,u=!1;for(;!u&&(c=i.pop());)if(c.nodeType===3){const p=s+c.length;!d&&a.start>=s&&a.start<=p&&(n.setStart(c,a.start-s),d=!0),d&&a.end>=s&&a.end<=p&&(n.setEnd(c,a.end-s),u=!0),s=p}else{let p=c.childNodes.length;for(;p--;)i.push(c.childNodes[p])}return d?n:null}catch{return null}},bo=(a,n)=>{if(!(!a||!n||!v.value))try{const s=Co(n);if(!s||s.collapsed)return;const i=s.commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c){const p=c.closest("[data-comment], [data-fake-comment]");if(p){p.getAttribute("data-comment")!==String(a)&&p.getAttribute("data-fake-comment")!==String(a)&&p.setAttribute("data-comment",String(a));return}}const d=document.createElement("span");d.setAttribute("data-comment",String(a));try{const p=s.startContainer,h=s.endContainer,k=s.startOffset,D=s.endOffset,I=p.nodeType===3?p.parentNode:p,N=h.nodeType===3?h.parentNode:h;if(I===N&&k===0&&D===(h.nodeType===3?h.length:N.childNodes.length)&&(I.tagName==="P"||I.tagName==="DIV"||I.tagName==="H1"||I.tagName==="H2"||I.tagName==="H3"||I.tagName==="H4"||I.tagName==="H5"||I.tagName==="H6")){const Q=s.extractContents();d.appendChild(Q),s.insertNode(d)}else s.surroundContents(d)}catch{const h=s.extractContents();d.appendChild(h),s.insertNode(d)}const u=v.value.querySelector(`[data-comment="${String(a)}"]`);e.nextTick(()=>{Yl("wrapSelectionWithCommentMarker"),_t()})}catch{}},Yo=a=>{if(!a||!a.commentId)return;const n=Array.isArray(L.comments)?[...L.comments]:[],s=typeof a.commentId=="string"&&a.commentId.startsWith("comment-")?Date.now():Number(a.commentId)||a.commentId;let i=n.findIndex(d=>typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)===Number(s)||d.conversation_id===s);const c={text:a.text,user:a.user,createdAt:a.createdAt,created_at:a.createdAt,updated_at:a.createdAt};if(i>=0){const d=n[i];if(d.conversation||(d.conversation=[]),d.conversation.push(c),d.updated_at=a.createdAt,!d.article_id&&n.length>0){const u=n.find(p=>p.article_id);u&&(d.article_id=u.article_id)}}else{const d=a.selectionRange,u=n.length>0&&n.find(h=>h.article_id)?.article_id||null,p={conversation_id:s,article_id:u,selection_range:d?{start:d.start||0,end:d.end||0,type:d.type||"text"}:null,selection_text:a.selectionText||"",conversation:[c],created_by_user:a.user,created_at:a.createdAt,updated_at:a.createdAt,status:"active"};n.push(p)}Bt.value=!0,fe("update:comments",n)},Sn=(a,n=[])=>{if(!L.commentUser||L.disabled||!L.richText||!v.value)return;const s=v.value;let i=null;try{i=s.querySelector(a)}catch{return}if(!i)return;nl(),s.focus();const c=document.createRange();c.selectNodeContents(i);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),Z.value=i.innerHTML||"",he.value=Rt();const u=c.getBoundingClientRect(),p=s.parentElement;if(p){const D=p.getBoundingClientRect(),I=u.bottom-D.top,se=Math.max(I+8,0);y.value={top:`${se}px`,bottom:"auto"}}const h=i.getAttribute("data-comment")||i.getAttribute("data-fake-comment");let k=[];if(h&&L.comments&&Array.isArray(L.comments)){const D=L.comments.find(I=>String(I.conversation_id)===String(h));if(D&&D.conversation&&Array.isArray(D.conversation)){const I=D.conversation.map(N=>({id:N.id||N.commentary_id,commentary_id:N.id||N.commentary_id,conversation_id:D.id||D.conversation_id,text:N.text,user:N.user,createdAt:N.created_at||N.createdAt,updated_at:N.updated_at||N.updatedAt}));k.push(...I)}}k.length===0&&Array.isArray(n)&&n.length>0&&(k=n.slice()),k.sort((D,I)=>{const N=Be=>{if(!Be)return 0;const _e=new Date(Be).getTime();return isNaN(_e)?0:_e},se=N(D.createdAt),Q=N(I.createdAt);return se===Q?0:se-Q}),at.value=k,bn(!0),Cl.value=h||null,i&&(Al.value=i,i.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(g.value="",w.value){const D=w.value;D.style.height="auto",D.style.height=`${D.scrollHeight}px`,D.focus()}if(p){const D=p.querySelector(".dss-comment-overlay");if(D){const I=p.querySelector(".dss-text-editor-footer");if(I){const N=p.getBoundingClientRect(),se=D.getBoundingClientRect(),Q=I.getBoundingClientRect(),Be=se.bottom-N.top,_e=Q.top-N.top,He=8;if(Be>_e-He){const Sl=Q.height;y.value={bottom:`${Sl+He}px`,top:"auto"}}}}}Yl("openCommentOverlayForSelector")})},po=e.ref(null),xo=e.ref(0),jo=a=>{if(!(L.disabled||!L.richText)){if(a.key==="Escape"){const n=window.getSelection();if(n.rangeCount>0){const i=n.getRangeAt(0).commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&v.value&&v.value.contains(c))){a.preventDefault();let u=null;i.nodeType===3?u=i.parentElement:i.tagName==="P"||i.tagName==="DIV"?u=i:u=i.closest("p, div");const p=document.createElement("p");p.innerHTML="<br>",u&&c.contains(u)&&u.nextSibling?c.insertBefore(p,u.nextSibling):c.appendChild(p),setTimeout(()=>{Me()},50);return}}}if(a.key.length===1||a.key==="Enter"){const n=window.getSelection();if(n&&n.rangeCount>0){const s=n.getRangeAt(0),i=s.commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c){const d=c.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(c!==u&&!u?.contains(c)){const p=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,h=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.contains(p)&&p!==u||d.contains(h)&&h!==u){a.preventDefault();const k=document.createRange();k.setStartAfter(d),k.collapse(!0),n.removeAllRanges(),n.addRange(k);return}}}}}}if(a.key==="Backspace"||a.key==="Delete"){const n=window.getSelection();if(n.rangeCount>0){const s=n.getRangeAt(0);let i=null,c=null;if(s.collapsed)if(a.key==="Backspace"){const d=s.startContainer;let u=d;d.nodeType===3&&(s.startOffset===0?u=d.previousSibling||d.parentNode:u=d.parentNode);const p=u.previousSibling;p&&(p.classList&&p.classList.contains("dss-image-wrapper")?c=p:p.tagName==="IMG"&&(i=p,c=i.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(i=c.querySelector("img")))}else{const d=s.startContainer;let u=d;d.nodeType===3&&(s.startOffset===d.length?u=d.nextSibling||d.parentNode:u=d.parentNode);const p=u.nextSibling;p&&(p.classList&&p.classList.contains("dss-image-wrapper")?c=p:p.tagName==="IMG"&&(i=p,c=i.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(i=c.querySelector("img")))}else{const d=s.commonAncestorContainer,u=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,p=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.nodeType===1&&d.tagName==="IMG"?(i=d,c=i.closest(".dss-image-wrapper")):(i=d.querySelector("img"),i&&(c=i.closest(".dss-image-wrapper"))),c){const h=c.contains(u)||u===c,k=c.contains(p)||p===c,I=s.cloneContents().textContent?.trim()||"",N=c.textContent?.trim()||"";(!h||!k||I.length>N.length)&&(c=null,i=null)}}if(c){a.preventDefault(),a.stopPropagation();const d=c.parentNode;if(d){const u=document.createTextNode("");d.insertBefore(u,c),c.remove();const p=document.createRange();p.setStartAfter(u),p.collapse(!0),n.removeAllRanges(),n.addRange(p),e.nextTick(()=>{_t()});return}}}}if(a.key==="Tab"){a.preventDefault(),a.shiftKey?Jl():De();return}if(a.key==="Enter"){const n=window.getSelection();if(n.rangeCount>0){const s=n.getRangeAt(0);if(s.collapsed){const u=s.startContainer,p=h=>{if(!h)return!1;let k=h.previousSibling;for(;k;){if(k.classList&&k.classList.contains("dss-image-wrapper")||k.tagName==="IMG"||k.querySelector&&k.querySelector(".dss-image-wrapper")||k.querySelector&&k.querySelector("img"))return!0;k=k.previousSibling}const D=h.parentElement;return D&&D!==v.value?p(D):!1};if(u.nodeType===3){const h=u.parentElement;if(h&&(p(h)||p(u))){const k=h.closest("p, div");if(k&&k!==v.value){a.preventDefault(),a.stopPropagation();let D=null;const I=s.startOffset;I<u.length&&(D=u.splitText(I));const N=document.createElement("p");if(D?N.appendChild(D):N.innerHTML="<br>",u.length===0){const Q=u.parentElement;Q&&(Q.removeChild(u),Q.childNodes.length===0&&Q.appendChild(document.createElement("br")))}k.nextSibling?k.parentNode.insertBefore(N,k.nextSibling):k.parentNode.appendChild(N);const se=document.createRange();D?se.setStart(D,0):se.setStart(N,0),se.collapse(!0),n.removeAllRanges(),n.addRange(se),e.nextTick(()=>{_t()});return}}}}const i=s.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&v.value&&v.value.contains(c))){let u=null;i.nodeType===3?u=i.parentElement:i.tagName==="P"||i.tagName==="DIV"?u=i:u=i.closest("p, div");const p=Q=>{if(!Q)return!1;const Be=Q.textContent||"",He=(Q.innerHTML||"").trim(),Sl=He.replace(/<br\s*\/?>/gi,"").trim();return Be.trim()===""||He===""||Sl===""||He==="<br>"||He==="<br/>"||He==="<p></p>"||He==="<p><br></p>"||He==="<p><br/></p>"||He==="<p> </p>"||He==="<p><br> </p>"||He==="<div></div>"||He==="<div><br></div>"||He==="<div><br/></div>"},h=c.lastChild,k=h&&h.nodeType===1&&h.tagName==="BR",D=s.startContainer,I=D.nodeType===3?D.parentElement:D,N=I===c||I&&I.parentElement===c;if(u&&p(u)||k&&N){a.preventDefault(),setTimeout(()=>{Me()},50);return}}}}if(a.key===" "){const n=Date.now(),s=n-xo.value;if(po.value===" "&&s<300){const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0),d=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer.closest("li"):c.commonAncestorContainer.parentElement?.closest("li");if(d){const u=c.startContainer.textContent?.substring(0,c.startOffset)||"";if((d.textContent||"").indexOf(u.trim())<=10||u.trim().length<=2){a.preventDefault(),De();return}}}}po.value=" ",xo.value=n}else po.value=a.key}},wo=a=>{if(L.disabled||!L.richText)return;a.preventDefault();let n=a.clipboardData.getData("text/html"),s=a.clipboardData.getData("text/plain");n&&(n=n.replace(/<!--[\s\S]*?-->/g,"")),s&&(s=s.replace(/<!--[\s\S]*?-->/g,"")),Qt();const i=window.getSelection();let c=null;if(i&&i.rangeCount>0){let p=i.getRangeAt(0).commonAncestorContainer;p.nodeType===3&&(p=p.parentNode),c=p.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const d=u=>{const h=new DOMParser().parseFromString(u,"text/html");let k=v.value.querySelector("h1")?1:0;if(h.querySelectorAll("h1").forEach(I=>{if(k>0){const N=h.createElement("p");N.innerHTML=I.innerHTML,I.parentNode.replaceChild(N,I)}else k++}),c){const I=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],N=Array.from(h.body.children).filter(se=>I.includes(se.tagName));if(N.length===1){const se=N[0].tagName,Q=c.tagName,Be=c.textContent.trim()===""&&!c.querySelector("img");let _e=!1;if(["H1","H2","H3","H4","H5","H6"].includes(Q)?_e=!0:Be||(se===Q||se==="P")&&(_e=!0),_e)return N[0].innerHTML.trim()}}return h.body.innerHTML.trim()};if(n){const u=d(n);document.execCommand("insertHTML",!1,u)}else if(s)if(/<[a-z][\s\S]*>/i.test(s)){const p=d(s);document.execCommand("insertHTML",!1,p)}else document.execCommand("insertText",!1,s);_t()},Eo=a=>{if(be.value){const s=a.target;!s.closest(".dss-toolbar-dropdown")&&!s.closest(".dss-toolbar-dropdown-toggle")&&nl()}if(Qe.value){const s=a.target,i=s.closest(".dss-floating-toolbar"),c=v.value&&s.closest(".dss-text-editor-content");!i&&!c&&Bn()}if(ut.value){const s=a.target,i=s.closest(".dss-floating-toolbar"),c=s.closest(".dss-toolbar-dropdown");!i&&!c&&Tl()}const n=a.target;if(!n.closest(".dss-toolbar-dropdown")&&!n.closest(".dss-toolbar-dropdown-submenu")&&(Xe.value=null),!v.value||!n.closest(".dss-text-editor-content")){const s=window.getSelection();if(s&&s.rangeCount>0){const i=s.getRangeAt(0);ae.value=!i.collapsed&&Nn(i)}else ae.value=!1}if(Cl.value!==null){const s=document.querySelector(".dss-comment-overlay");let i=!1;if(s){const u=s.getBoundingClientRect(),p=a.clientX,h=a.clientY;i=p>=u.left&&p<=u.right&&h>=u.top&&h<=u.bottom}const c=n.closest(".dss-toolbar-button"),d=c&&c.getAttribute("title")==="Comment";!i&&!d&&(Cl.value=null,g.value="",Z.value="",he.value=null,at.value=[],bn(!0))}},Hn=(a,n)=>{a&&a.stopPropagation&&a.stopPropagation(),Et.value&&(clearTimeout(Et.value),Et.value=null),Xe.value=n},fo=a=>{const n=a.relatedTarget;if(n){const s=n.closest(".dss-toolbar-dropdown-submenu"),i=n.closest(".dss-toolbar-dropdown-item-has-submenu");if(s||i)return}Et.value&&clearTimeout(Et.value),Et.value=setTimeout(()=>{Xe.value=null,Et.value=null},150)},Vn=a=>{Xe.value=null};let Ko=0;const Go=a=>{if(!a)return;const n=Array.from(a.children);n.forEach(s=>{s.classList.contains("dss-toolbar-dropdown-submenu")||s.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(s.tagName==="BUTTON"||s.tagName==="DIV")&&!s.classList.contains("dss-toolbar-dropdown-item")&&s.classList.add("dss-toolbar-dropdown-item")}),n.forEach((s,i)=>{if(s.classList.contains("dss-toolbar-dropdown-item-has-submenu")||s.classList.contains("dss-toolbar-dropdown-submenu")||!s.classList.contains("dss-toolbar-dropdown-item"))return;const c=Array.from(s.children).find(p=>p.tagName==="DIV"?p.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(p.children).filter(k=>k.tagName==="BUTTON"||k.tagName==="DIV").length>0:!1),d=s.nextElementSibling,u=d&&!d.classList.contains("dss-toolbar-dropdown-submenu")&&!d.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&d.tagName==="DIV"&&!d.classList.contains("dss-toolbar-dropdown-item")&&Array.from(d.children).some(p=>p.tagName==="BUTTON"||p.tagName==="DIV");if(c||u){const p=`submenu-auto-${++Ko}`;s.classList.add("dss-toolbar-dropdown-item-has-submenu"),s.setAttribute("data-submenu-id",p);let h=null;c?(s.tagName==="BUTTON"&&s.parentNode.insertBefore(c,s.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),h=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),h=d),h&&(h.setAttribute("data-submenu-id",p),h.setAttribute("data-processed","true"),c&&s.tagName!=="BUTTON"?h.dataset.originalParentRef="inside":h.dataset.originalParentRef="sibling",Array.from(h.children).forEach(D=>{(D.tagName==="BUTTON"||D.tagName==="DIV")&&!D.classList.contains("dss-toolbar-dropdown-item")&&D.classList.add("dss-toolbar-dropdown-item")}))}})},So=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(n=>{Go(n),n.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=h=>{const k=c.getAttribute("data-submenu-id");k&&Hn(h,k)},p=fo;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",p),c._subMenuHandlers={enter:u,leave:p}}),n.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=k=>{const D=c.getAttribute("data-submenu-id");D&&Hn(k,D)},p=fo;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",p),c._subMenuHandlers={enter:u,leave:p},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(k=>{k.addEventListener("click",Vn)})})})};let Rn=null;const Yn=()=>{if(Xe.value){const a=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${Xe.value}"]`),n=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${Xe.value}"]`);a&&n&&tn(a,n)}if(Qe.value&&cl(),L.richText){if(Rn!==null)return;Rn=setTimeout(()=>{Rn=null,Yl("handleWindowResize")},150)}},jn=()=>{if(!L.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(n=>{Array.from(n.children).filter(i=>i.tagName==="DIV"&&!i.classList.contains("dss-toolbar-button")).forEach(i=>{i.classList.add("dss-toolbar-button")})})},Qo=()=>{const a=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),n=s=>{if(s.preventDefault(),s.stopPropagation(),window.getSelection){const i=window.getSelection();i.removeAllRanges?i.removeAllRanges():i.empty&&i.empty()}return!1};a.forEach(s=>{s.addEventListener("selectstart",n),s.addEventListener("mousedown",n),s.addEventListener("dragstart",n),s.addEventListener("contextmenu",n),s.addEventListener("click",i=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{vl.value?le():ct(),M.value?st():Gt()})}),e.nextTick(()=>{Qo()}),L.richText&&v.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",Eo),window.addEventListener("resize",Yn);let a=null;const n=()=>{a===null&&(a=setTimeout(()=>{a=null,Yn()},150))};window.addEventListener("scroll",n,!0),v.value._windowScrollHandler=n,v.value._windowScrollTimeout=a,v.value.closest(".editor-with-comments"),v.value.closest(".dss-text-editor-content-wrapper");const s=v.value.closest(".dss-text-editor-content");let i=null;const c=()=>{i===null&&(i=setTimeout(()=>{i=null,Yn()},150))};s&&(s.addEventListener("scroll",c),v.value._scrollHandlers={wrapper:null,content:s,handler:c}),e.nextTick(()=>{So(),jn()}),v.value.addEventListener("click",p=>{const h=p.target;h.closest("a")&&!L.disabled&&p.preventDefault();const D=h.closest(".dss-image-no-alt-icon"),I=h.closest(".dss-image-wrapper");if(D||I&&h===I){p.preventDefault(),p.stopPropagation();const N=window.getSelection(),se=document.createRange();se.setStartAfter(I),se.collapse(!0),N.removeAllRanges(),N.addRange(se)}else I&&h.tagName!=="IMG"&&(p.preventDefault(),e.nextTick(()=>{const N=window.getSelection();if(N.rangeCount>0){const Q=N.getRangeAt(0).commonAncestorContainer,Be=Q.nodeType===3?Q.parentElement:Q;if(I.contains(Be)&&Be!==I.querySelector("img")){const _e=document.createRange();_e.setStartAfter(I),_e.collapse(!0),N.removeAllRanges(),N.addRange(_e)}}else{const se=document.createRange();se.setStartAfter(I),se.collapse(!0),N.addRange(se)}}))},!0),v.value.addEventListener("mousedown",p=>{const h=p.target,k=h.closest(".dss-image-no-alt-icon"),D=h.closest(".dss-image-wrapper");if(k||D&&h.tagName!=="IMG"){p.preventDefault();const I=window.getSelection(),N=document.createRange();D&&(N.setStartAfter(D),N.collapse(!0),I.removeAllRanges(),I.addRange(N))}},!0),v.value.addEventListener("paste",p=>{e.nextTick(()=>{if(!v.value)return;v.value.querySelectorAll("img").forEach(k=>{if(!k.closest(".dss-image-wrapper"))k.removeAttribute("alt"),k.removeAttribute("data-alt"),k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="";else{const I=k.getAttribute("alt")||k.alt||"";if(I){const N=k.getAttribute("src")||k.src||"",se=N.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),Q=I===N||I===se;(I.startsWith("http://")||I.startsWith("https://")||I.startsWith("data:")||Q||Q)&&(k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="")}}}),Zl()})}),v.value.addEventListener("dragstart",p=>{const h=p.target,k=h.tagName==="IMG"?h:h.closest("img"),D=k?.closest(".dss-image-wrapper");k&&v.value.contains(k)&&(et.value=D||k,p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/html","image-drag"))}),v.value.addEventListener("dragover",p=>{et.value&&(p.preventDefault(),p.stopPropagation(),p.dataTransfer.dropEffect="move")}),v.value.addEventListener("dragenter",p=>{et.value&&(p.preventDefault(),p.stopPropagation())}),v.value.addEventListener("drop",p=>{if(!et.value||!v.value)return;p.preventDefault(),p.stopPropagation();const h=et.value,k=h.classList?.contains("dss-image-wrapper"),D=k?h.querySelector("img"):h,I=k?h:D?.closest(".dss-image-wrapper");if(!D||!v.value.contains(D)){et.value=null;return}let N=null;const se=p.clientX,Q=p.clientY;if(document.caretRangeFromPoint)N=document.caretRangeFromPoint(se,Q);else{const ml=window.getSelection();ml.rangeCount>0?N=ml.getRangeAt(0).cloneRange():(N=document.createRange(),N.selectNodeContents(v.value),N.collapse(!1))}if(!N){et.value=null;return}const Be=N.commonAncestorContainer,_e=Be.nodeType===3?Be.parentElement:Be;if(_e?.closest(".dss-image-wrapper")===I||I&&I.contains(_e)){et.value=null;return}if(I&&(_e===I||I.contains(_e))){et.value=null;return}const Sl=D.getAttribute("src");let hl=null;I?hl=I.cloneNode(!0):hl=D.cloneNode(!0);try{let ml=N.startContainer;if(ml.nodeType===3&&(ml=ml.parentElement),I&&(ml===I||I.contains(ml))){const pl=document.createRange();pl.setStartAfter(I),pl.collapse(!0),N=pl}N.insertNode(hl);const vt=document.createRange();vt.setStartAfter(hl),vt.collapse(!0);const Xt=window.getSelection();Xt.removeAllRanges(),Xt.addRange(vt)}catch{if(v.value.childNodes.length===0){const vt=document.createElement("p");vt.appendChild(hl),v.value.appendChild(vt)}else{const vt=v.value.lastChild;if(vt&&vt.nodeType===1)vt.appendChild(hl);else{const Xt=document.createElement("p");Xt.appendChild(hl),v.value.appendChild(Xt)}}}I?I.remove():D.remove(),et.value=null,e.nextTick(()=>{const ml=v.value.querySelectorAll("img");let vt=!1;ml.forEach(Xt=>{if(Xt.getAttribute("src")===Sl)if(!vt)vt=!0;else{const pl=Xt.closest(".dss-image-wrapper");pl?pl.remove():Xt.remove()}}),Zl(),_t()})}),v.value.addEventListener("dragend",p=>{et.value=null});let d=null;const u=new MutationObserver(p=>{p.forEach(h=>{h.addedNodes.forEach(k=>{if(k.nodeType===1){k.tagName==="IMG"&&(k.removeAttribute("alt"),k.removeAttribute("data-alt"),k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="");const D=k.querySelectorAll&&k.querySelectorAll("img");D&&D.forEach(I=>{I.removeAttribute("alt"),I.removeAttribute("data-alt"),I.setAttribute("alt",""),I.setAttribute("data-alt",""),I.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{Zl(),jn(),d=null},100)});if(u.observe(v.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const p=document.querySelector(".dss-text-editor-toolbar");if(p){const h=new MutationObserver(()=>{e.nextTick(()=>{jn()})});h.observe(p,{childList:!0,subtree:!0}),p._toolbarMutationObserver=h}}),L.modelValue){const p=Kl(L.modelValue);v.value.innerHTML=p,En()}e.nextTick(()=>{const p=v.value.innerHTML||"",h=L.title||"",k=L.description||"";Dt.value=p,ne.value=h,j.value=k,K.value=h,de.value=k,Tt(),Zl(),Gl(),rn(),_o(),Qn()}),El(),yn(),v.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",Eo),window.removeEventListener("resize",Yn),v.value&&v.value._windowScrollHandler&&window.removeEventListener("scroll",v.value._windowScrollHandler,!0),Rn!==null&&(clearTimeout(Rn),Rn=null),v.value&&v.value._windowScrollTimeout!==null&&clearTimeout(v.value._windowScrollTimeout),Ue.value&&clearTimeout(Ue.value),Et.value&&clearTimeout(Et.value),v.value&&v.value._mutationObserver&&v.value._mutationObserver.disconnect(),Fe.value&&Fe.value.disconnect(),bt.value!==null&&(cancelAnimationFrame(bt.value),bt.value=null),ot.value!==null&&(clearTimeout(ot.value),ot.value=null),St.value!==null&&(clearTimeout(St.value),St.value=null),bn(!0),v.value&&v.value._scrollHandlers){const{wrapper:n,content:s,handler:i}=v.value._scrollHandlers;n&&n.removeEventListener("scroll",i),s&&s.removeEventListener("scroll",i)}const a=document.querySelector(".dss-text-editor-toolbar");a&&a._toolbarMutationObserver&&a._toolbarMutationObserver.disconnect()});const Vo=a=>{const n=a.target,s=n.closest("a");if(s&&!L.disabled){a.preventDefault();const c=document.createRange();c.selectNodeContents(s);const d=window.getSelection();d.removeAllRanges(),d.addRange(c)}const i=n.closest(".dss-image-wrapper");i&&n.tagName!=="IMG"?e.nextTick(()=>{const c=window.getSelection();if(c.rangeCount>0){const u=c.getRangeAt(0).commonAncestorContainer,p=u.nodeType===3?u.parentElement:u;if(i.contains(p)&&p!==i.querySelector("img")){const h=document.createRange();h.setStartAfter(i),h.collapse(!0),c.removeAllRanges(),c.addRange(h)}}Zl(),El(),yn(),cl(),rn()}):e.nextTick(()=>{Zl(),El(),yn(),cl(),rn()})},Kn=()=>{Ln();const a=window.getSelection();if(a&&a.rangeCount>0){const s=a.getRangeAt(0);ae.value=!s.collapsed&&Nn(s),!s.collapsed&&x.value&&(x.value=null)}else ae.value=!1;if(Zl(),El(),yn(),cl(),rn(),a&&a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c&&c.closest(".dss-text-editor-footer")){a.removeAllRanges(),ae.value=!1;return}}["bold","italic","underline"].forEach(s=>{try{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0);if(!c.collapsed)if(s==="bold"){const d=c.commonAncestorContainer,u=d.nodeType===3?d.parentElement:d;let p=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(p=!0),!p&&u.style&&parseInt(u.style.fontWeight)>=600&&(p=!0),!p))try{const h=window.getComputedStyle(u);parseInt(h.fontWeight)>=600&&(p=!0)}catch{}re.value[s]=p}else{const d=document.queryCommandState(s);re.value[s]=d}}}catch{}})},rn=()=>{if(!L.richText||L.disabled||!v.value){A.value="p";return}try{const a=window.getSelection();if(!a||a.rangeCount===0){A.value="p";return}const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(!i||!v.value.contains(i)){A.value="p";return}const c=i.closest("h1, h2, h3, h4, h5, h6, p");if(!c){A.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?A.value=d:A.value="p"}catch{A.value="p"}},yn=()=>{if(!v.value){je.value=!1;return}try{const a=window.getSelection();let n=!1;if(a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");n=!!(c&&v.value.contains(c))}je.value=n}catch{je.value=!1}},Nn=a=>{if(!a||!v.value)return!1;const n=a.commonAncestorContainer;if(!n)return!1;const s=n.nodeType===3?n.parentElement:n;return s?v.value.contains(s):!1},Bn=()=>{Qe.value=!1},cl=()=>{if(!L.floatingToolbar||!L.richText||L.disabled){Qe.value=!1;return}const a=window.getSelection();if(!a||a.rangeCount===0){Qe.value=!1;return}const n=a.getRangeAt(0);if(n.collapsed||!Nn(n)){Qe.value=!1;return}const s=n.getBoundingClientRect();if(!s||s.width===0&&s.height===0){Qe.value=!1;return}const i=v.value;if(!i){Qe.value=!1;return}const c=i.getBoundingClientRect();if(!c||c.width===0){Qe.value=!1;return}const d=40,u=8,p=s.top-d/2+15;let h=s.left+s.width/2;const k=window.innerWidth||document.documentElement.clientWidth||0;let D=0;Je.value&&(D=Je.value.getBoundingClientRect().width);const I=(D||320)/2;let N=c.left+I,se=c.right-I;if(se<N){const Q=c.left+c.width/2;N=Q,se=Q}if(k>0){const Q=I+u,Be=k-I-u;if(N=Math.max(N,Q),se=Math.min(se,Be),se<N){const _e=k/2;N=_e,se=_e}}h<N?h=N:h>se&&(h=se),Ce.value={position:"fixed",top:`${Math.max(p,8)}px`,left:`${h}px`,transform:"translate(-50%, -100%)",zIndex:10003},Qe.value=!0},Gn=a=>{L.disabled||!L.richText||(ut.value=ut.value===a?null:a,a==="askAi"&&(be.value=null))},Tl=()=>{ut.value=null,Xe.value=null},R=a=>{zl(a),Tl()};let ol=null,_l=null,en=null,al=null;const Bl=a=>{if(L.disabled||!L.richText){Ol(),Xl();return}const n=a.target,s=n.closest("a"),i=n.closest("img");if(ol&&(clearTimeout(ol),ol=null),en&&(clearTimeout(en),en=null),s&&s!==_l){Xl(),_l=s;let c=s.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=s.textContent||""),qe.value=s,me.value=c,Y.value=!0,ue.value=!0,dl(s)}else!s&&_l?(_l=null,ol=setTimeout(()=>{ue.value||Ol()},150)):s&&s===_l&&dl(s);if(i&&i!==al){Ol(),al=i;let c=i.getAttribute("alt");c===null&&(c=i.alt||"");let d=i.getAttribute("data-alt");d===null&&(d=c),i.hasAttribute("alt")||i.setAttribute("alt",c),i.hasAttribute("data-alt")||i.setAttribute("data-alt",d),yt.value=i,ge.value=c.trim()||V("textEditor.image.noAlt"),X.value=!0,G.value=!0,kn(i)}else!i&&al?(al=null,en=setTimeout(()=>{G.value||Xl()},150)):i&&i===al&&kn(i)},ul=a=>{const n=a.relatedTarget;(!n||!n.closest(".dss-text-editor-content")&&!n.closest(".dss-link-popup"))&&(_l=null,al=null,ol&&(clearTimeout(ol),ol=null),en&&(clearTimeout(en),en=null),Ol(),Xl())},Ol=()=>{ue.value=!1,setTimeout(()=>{ue.value||(Y.value=!1,me.value="",$e.value||(qe.value=null))},100)},dl=a=>{if(!a||!v.value)return;const n=a.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;F.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Xl=()=>{G.value=!1,setTimeout(()=>{G.value||(X.value=!1,ge.value="",ht.value||(yt.value=null))},100)},kn=a=>{if(!a||!v.value)return;const n=a.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;W.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Ut=()=>{if(!me.value||!qe.value)return;let n=qe.value.getAttribute("href")||me.value;!n.startsWith("http://")&&!n.startsWith("https://")&&!n.startsWith("mailto:")&&(n="https://"+n),window.open(n,"_blank","noopener,noreferrer")},Pt=()=>{if(qe.value){const a=qe.value.textContent||"",n=qe.value.getAttribute("href")||"",s=qe.value;tt.value=n,mt.value=a,Le.value=a,ue.value=!1,Y.value=!1,me.value="",qe.value=s,$e.value=!0}else if(ke.value){const a=window.getSelection();if(a.rangeCount>0){const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");if(i){const c=i.textContent||"",d=i.getAttribute("href")||"";tt.value=d,mt.value=c,Le.value=c,qe.value=i,$e.value=!0}}}else{Ve.value=Rt();const a=window.getSelection();let n="";a.rangeCount>0&&(n=a.getRangeAt(0).toString()),tt.value="",mt.value=n,Le.value="",qe.value=null,$e.value=!0}e.nextTick(()=>{U.value&&(U.value.focus(),U.value.select())})},gt=()=>{$e.value=!1,tt.value="",mt.value="",Le.value="",qe.value=null,Ve.value=null},sl=()=>{if(!tt.value.trim()){gt();return}if(We.value?(Ue.value&&(clearTimeout(Ue.value),Ue.value=null),Qt(),We.value=!1):Qt(),mt.value.trim()||(mt.value=tt.value.trim()),qe.value&&v.value&&v.value.contains(qe.value)){const a=window.getSelection();a.rangeCount>0&&a.removeAllRanges();const n=qe.value;if(n.setAttribute("href",tt.value.trim()),mt.value.trim()!==Le.value.trim()){for(;n.firstChild;)n.removeChild(n.firstChild);n.textContent=mt.value.trim()}n.style.color="#60afdf",n.style.textDecoration="underline";const s=document.createRange();s.selectNodeContents(n),s.collapse(!1),a.removeAllRanges(),a.addRange(s),_t()}else if(v.value){v.value.focus();const a=window.getSelection();a.removeAllRanges(),Ve.value&&Ll(Ve.value);let n=null;if(a.rangeCount>0&&(n=a.getRangeAt(0)),n&&!n.collapsed){n.toString();const s=document.createElement("a");s.href=tt.value.trim(),s.textContent=mt.value.trim(),s.style.color="#60afdf",s.style.textDecoration="underline",n.deleteContents(),n.insertNode(s);const i=document.createTextNode(" ");n.setStartAfter(s),n.insertNode(i),n.setStartAfter(i),n.collapse(!0),a.removeAllRanges(),a.addRange(n)}else{n||(n=document.createRange(),n.selectNodeContents(v.value),n.collapse(!1));const s=n.startContainer,i=s.nodeType===3,c=i&&n.startOffset===s.textContent.length,d=document.createElement("a");if(d.href=tt.value.trim(),d.textContent=mt.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=s.parentElement;for(;u&&u!==v.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==v.value){let p=u.nextElementSibling;if(p&&(p.innerHTML==="<br>"||p.innerHTML==="<br/>"||p.textContent.trim()==="")){p.textContent="",p.appendChild(d);const h=document.createTextNode(" ");p.appendChild(h);const k=document.createRange();k.setStartAfter(d),k.collapse(!0),a.removeAllRanges(),a.addRange(k)}else{if(n.startOffset>0){const k=s.textContent.substring(0,n.startOffset),D=k[k.length-1];if(D&&D!==" "&&D!==" "&&D!==`
|
|
104
|
-
`){const
|
|
105
|
-
`){const k=document.createTextNode(" ");n.insertNode(k),n.setStartAfter(k)}}n.insertNode(d);const u=document.createTextNode(" ");n.setStartAfter(d),n.insertNode(u),n.setStartAfter(u),n.collapse(!0),a.removeAllRanges(),a.addRange(n)}}_t()}e.nextTick(()=>{El(),gt()})},vo=()=>{if(!v.value||J.value)return;const a=window.getSelection();let n=null;a&&a.rangeCount>0&&(n=Rt());const s=/(https?:\/\/[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|(www\.[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.([a-zA-Z]{2,})(\/[^\s<>"{}|\\^`\[\]]*)?)/gi,i=document.createTreeWalker(v.value,NodeFilter.SHOW_TEXT,{acceptNode:p=>{const h=p.parentElement;return!h||h.closest("a")||h.closest(".dss-image-wrapper")||!p.textContent||p.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let d;for(;d=i.nextNode();)c.push(d);let u=!1;for(let p=c.length-1;p>=0;p--){const h=c[p],k=h.textContent;s.lastIndex=0;const D=[...k.matchAll(s)];if(D.length===0)continue;const I=D.filter(Q=>{const Be=Q[0],_e=Q.index;if(_e>0&&k[_e-1]==="@"||_e+Be.length<k.length&&k[_e+Be.length]==="@")return!1;const He=h.parentElement;return!(He&&He.closest("a"))});if(I.length===0)continue;if(I.length===1&&I[0][0]===k.trim()){const Q=I[0][0],Be=Q.startsWith("http://")||Q.startsWith("https://")?Q:`https://${Q}`,_e=document.createElement("a");_e.href=Be,_e.textContent=Q,_e.style.color="#60afdf",_e.style.textDecoration="underline",h.parentNode&&(h.parentNode.replaceChild(_e,h),u=!0);continue}let N=0;const se=document.createDocumentFragment();if(I.forEach(Q=>{const Be=Q.index,_e=Q[0];if(Be>N){const hl=k.substring(N,Be);hl&&se.appendChild(document.createTextNode(hl))}const He=_e.startsWith("http://")||_e.startsWith("https://")?_e:`https://${_e}`,Sl=document.createElement("a");Sl.href=He,Sl.textContent=_e,Sl.style.color="#60afdf",Sl.style.textDecoration="underline",se.appendChild(Sl),N=Be+_e.length}),N<k.length){const Q=k.substring(N);Q&&se.appendChild(document.createTextNode(Q))}h.parentNode&&se.childNodes.length>0&&(h.parentNode.replaceChild(se,h),u=!0)}u&&n&&e.nextTick(()=>{Ll(n),El()})},No=()=>{if(!v.value)return;const a=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,n=document.createTreeWalker(v.value,NodeFilter.SHOW_TEXT,{acceptNode:c=>{const d=c.parentElement;return!d||d.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),s=[];let i;for(;i=n.nextNode();)s.push(i);for(let c=s.length-1;c>=0;c--){const d=s[c],u=d.textContent,p=[...u.matchAll(a)];if(p.length===0)continue;let h=0;const k=document.createDocumentFragment();p.forEach(D=>{const I=D.index,N=D[0].startsWith("<u>")?"u":"ins",se=D[1]||D[2]||"";I>h&&k.appendChild(document.createTextNode(u.substring(h,I)));const Q=document.createElement(N);Q.textContent=se,k.appendChild(Q),h=I+D[0].length}),h<u.length&&k.appendChild(document.createTextNode(u.substring(h))),d.parentNode&&k.childNodes.length>0&&d.parentNode.replaceChild(k,d)}},Fn=a=>{if(!v.value||J.value)return;if(!a){No();return}if(!["*","_",">"].includes(a))return;const s=window.getSelection();if(!s||s.rangeCount===0)return;const i=s.getRangeAt(0);if(!i.collapsed)return;const c=i.startContainer.nodeType===Node.TEXT_NODE?i.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):i.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!c||c===v.value||!v.value.contains(c))return;const d=()=>{let hl="",ml=0,vt=!1;const Xt=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:gl=>gl.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let pl=0;for(;Xt.nextNode();){const gl=Xt.currentNode,xn=gl.textContent||"",Wl=pl;if(pl+=xn.length,gl===i.startContainer){hl+=xn.substring(0,i.startOffset),ml=Wl+i.startOffset,vt=!0;break}hl+=xn}return vt||(ml=hl.length),{textBeforeCursor:hl,cursorCharOffset:ml}},{textBeforeCursor:u}=d();if(!u.length)return;let p=null,h=null;if(u.endsWith("**")&&(p=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(p=u.match(/__(.+?)__$/s))?h="strong":u.endsWith("*")&&!u.endsWith("**")&&(p=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(p=u.match(new RegExp("(?<!_)_([^_]+)_$")))?h="em":a===">"&&((p=u.match(/<u>(.+?)<\/u>$/s))||(p=u.match(/<ins>(.+?)<\/ins>$/s)))&&(h=p[0].startsWith("<u>")?"u":"ins",p[0].startsWith("<u>"),p[0].startsWith("<u>")),!p||!p[1])return;const k=p[0],D=p[1],I=u.length-k.length,se=(hl=>{let ml=0;const vt=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:pl=>pl.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let Xt;for(;Xt=vt.nextNode();){const pl=(Xt.textContent||"").length;if(ml+pl>=hl)return{node:Xt,offset:hl-ml};ml+=pl}return null})(I);if(!se)return;const Q=document.createRange();Q.setStart(se.node,se.offset),Q.setEnd(i.endContainer,i.endOffset);const Be=document.createElement(h);Be.textContent=D,Q.deleteContents(),Q.insertNode(Be);const _e=window.getSelection(),He=document.createRange();He.setStartAfter(Be),He.collapse(!0),_e.removeAllRanges(),_e.addRange(He);const Sl=Rt();e.nextTick(()=>{_t(),Sl&&Ll(Sl)})},Wn=()=>{v.value&&(el.value=Rt(),dt.value="",qt.value="",Pe.value="",Ct.value="",wt.value="",Wt.value=null,yt.value=null,Ne.value="upload",ht.value=!0,nl(),e.nextTick(()=>{Yt.value&&Yt.value.focus(),it.value&&(it.value.value="")}))},Cn=a=>{const n=a.target?.files?.[0];if(!n){Wt.value=null,qt.value="";return}Wt.value=n;const s=new FileReader;s.onload=i=>{qt.value=i.target?.result||""},s.readAsDataURL(n)},ho=()=>{it.value&&it.value.click()},qn=()=>{Ct.value&&(wt.value="")},Bo=()=>{wt.value&&(Ct.value="")},Mo=()=>{let a=yt.value;if(!a){const n=window.getSelection();if(n&&n.rangeCount>0){const i=n.getRangeAt(0).commonAncestorContainer;a=i.nodeType===1?i.closest("img"):i.parentElement?.closest("img")}}if(a){const n=a.getAttribute("data-alt")||a.getAttribute("alt")||"";yt.value=a,dt.value=n.trim()===""||n.trim()==="Image"?"":n;const s=a.getAttribute("src")||a.src||"";s.startsWith("http://")||s.startsWith("https://")?(Pe.value=s,qt.value="",Ne.value="url"):(qt.value=s,Pe.value="",Ne.value="upload");const c=a.style.width||a.getAttribute("width")||"",d=a.style.height||a.getAttribute("height")||"";Ct.value=c.endsWith("px")?c.replace("px",""):c,wt.value=d.endsWith("px")?d.replace("px",""):d,el.value=null}else{Wn();return}ht.value=!0,G.value=!1,X.value=!1,e.nextTick(()=>{Ne.value==="url"&&Kt.value?(Kt.value.focus(),Kt.value.select()):Yt.value&&(Yt.value.focus(),Yt.value.select()),it.value&&(it.value.value="")})},Zn=()=>{ht.value=!1,dt.value="",qt.value="",Pe.value="",Ct.value="",wt.value="",Wt.value=null,yt.value=null,el.value=null,Ne.value="upload"},Rl=()=>{const a=(dt.value||"").trim(),n=v.value?._mutationObserver;n&&n.disconnect(),We.value?(Ue.value&&(clearTimeout(Ue.value),Ue.value=null),Qt(),We.value=!1):Qt();const s=Ne.value==="url"?Pe.value.trim():qt.value;if(yt.value&&v.value&&v.value.contains(yt.value)){s&&(yt.value.src=s),yt.value.setAttribute("alt",a),yt.value.setAttribute("data-alt",a),Ct.value?(yt.value.style.width=`${Ct.value}px`,yt.value.setAttribute("width",Ct.value)):(yt.value.style.removeProperty("width"),yt.value.removeAttribute("width")),wt.value?(yt.value.style.height=`${wt.value}px`,yt.value.setAttribute("height",wt.value)):(yt.value.style.removeProperty("height"),yt.value.removeAttribute("height"));const i=window.getSelection();if(i){i.removeAllRanges();const c=document.createRange();c.setStartAfter(yt.value),c.collapse(!0),i.addRange(c)}_t()}else{if(!s){n&&v.value&&n.observe(v.value,{childList:!0,subtree:!0}),Zn();return}if(v.value){v.value.focus();const i=window.getSelection();i&&i.rangeCount>0&&i.removeAllRanges();const c=window.getSelection();let d=null;if(el.value&&(Ll(el.value),c&&c.rangeCount>0&&(d=c.getRangeAt(0))),!d&&c&&c.rangeCount>0&&(d=c.getRangeAt(0)),!d&&v.value){if(d=document.createRange(),v.value.childNodes.length===0){const k=document.createElement("p");k.innerHTML="<br>",v.value.appendChild(k),d.setStart(k,0),d.collapse(!0)}else d.selectNodeContents(v.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){Zn();return}const u=d.commonAncestorContainer,p=u.nodeType===3?u.parentElement:u;if(!v.value.contains(p)){if(d=document.createRange(),v.value.childNodes.length===0){const k=document.createElement("p");k.innerHTML="<br>",v.value.appendChild(k),d.setStart(k,0),d.collapse(!0)}else d.selectNodeContents(v.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}const h=document.createElement("img");h.src=s,h.setAttribute("alt",a),h.setAttribute("data-alt",a),Ct.value&&(h.style.width=`${Ct.value}px`,h.setAttribute("width",Ct.value)),wt.value&&(h.style.height=`${wt.value}px`,h.setAttribute("height",wt.value));try{d.insertNode(h),d.setStartAfter(h),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(v.value){if(v.value.childNodes.length===0){const I=document.createElement("p");v.value.appendChild(I),I.appendChild(h)}else{const I=v.value.lastChild;if(I&&I.nodeType===1)I.appendChild(h);else{const N=document.createElement("p");v.value.appendChild(N),N.appendChild(h)}}const D=document.createRange();D.setStartAfter(h),D.collapse(!0),c&&(c.removeAllRanges(),c.addRange(D))}}yt.value=h,_t()}}e.nextTick(()=>{n&&v.value&&n.observe(v.value,{childList:!0,subtree:!0}),El(),cl(),Zn()})};e.watch(()=>L.modelValue,a=>{if(L.richText&&v.value&&!J.value){const n=Kl(a||""),i=v.value.innerHTML.replace(/ |\u00A0/g," "),c=n.replace(/ |\u00A0/g," ");if(i!==c){const d=Rt();v.value.innerHTML=n,e.nextTick(()=>{En();const u=v.value.innerHTML||"",p=L.title||"",h=L.description||"";Dt.value=u,ne.value=p,j.value=h,Lt.value=u,K.value=p,de.value=h,Ge.value=[],Zt.value=[],Ue.value&&(clearTimeout(Ue.value),Ue.value=null),We.value=!1,d&&Ll(d),Tt(),Zl(),Gl(),El(),cl(),rn(),Yl("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>L.richText,a=>{a?(cl(),e.nextTick(()=>{_o()})):(Bn(),oe.value=[],Fe.value&&(Fe.value.disconnect(),Fe.value=null)),rn()}),e.watch(()=>L.floatingToolbar,a=>{a?cl():Bn()}),e.watch(()=>L.disabled,a=>{a&&Bn(),rn()}),e.watch(()=>L.description,()=>{e.nextTick(()=>{M.value?st():Gt()})}),e.watch(()=>L.title,()=>{e.nextTick(()=>{vl.value?le():ct()})}),e.watch(()=>L.customToolbarSlots,()=>{e.nextTick(()=>{jn()})},{deep:!0}),e.watch(()=>L.comments,(a,n)=>{if(L.commentUser){if(Bt.value){Bt.value=!1;return}bl.value||L.richText&&v.value&&e.nextTick(()=>{Qn()})}},{deep:!0,immediate:!1});const Qn=()=>{if(L.commentUser&&!bl.value&&!(!L.comments||!Array.isArray(L.comments)||L.comments.length===0)&&!(!L.richText||!v.value)){bl.value=!0;try{const a=new Set,n=L.comments.filter(u=>{const p=String(u.conversation_id||u.id);return a.has(p)?!1:(a.add(p),!0)}),s=v.value.querySelectorAll("[data-comment], [data-fake-comment]"),i=s.length;s.forEach(u=>{const p=u.parentNode;if(p){for(;u.firstChild;)p.insertBefore(u.firstChild,u);p.removeChild(u)}});let c=0;const d=new Set;n.forEach(u=>{if(!u.conversation_id||!u.selection_range)return;const p=typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)||u.conversation_id;if(!p)return;const h=String(p);if(d.has(h))return;const k=v.value.querySelector(`[data-comment="${h}"]`);if(k){Jn(k,u),d.add(h);return}try{const D=Un(u.selection_range,u.selection_text);if(D&&!D.collapsed){const I=D.commonAncestorContainer,N=I.nodeType===3?I.parentElement:I;if(N){const Be=N.closest("[data-comment], [data-fake-comment]");if(Be){const _e=Be.getAttribute("data-comment")||Be.getAttribute("data-fake-comment");if(String(_e)===String(p)){Be.setAttribute("data-comment",h),Be.removeAttribute("data-fake-comment"),Jn(Be,u),d.add(h);return}else return}}const se=v.value.querySelector(`[data-comment="${h}"]`);if(se){Jn(se,u),d.add(h);return}const Q=document.createElement("span");Q.setAttribute("data-comment",h),Jn(Q,u);try{D.surroundContents(Q),c++,d.add(h)}catch{try{const _e=document.createRange();_e.setStart(D.startContainer,D.startOffset),_e.setEnd(D.endContainer,D.endOffset),an(_e),_e.surroundContents(Q),c++,d.add(h)}catch{try{const He=D.extractContents();Q.appendChild(He),D.insertNode(Q),c++,d.add(h)}catch(He){console.warn("Failed to create comment marker:",He)}}}}}catch{}}),e.nextTick(()=>{Yl("restoreCommentsFromModel"),_t(),bl.value=!1})}catch{bl.value=!1}}},an=a=>{if(!a||!v.value)return a;try{const n=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let s=a.startContainer,i=a.startOffset;if(s.nodeType===3){const u=s.parentElement;u&&n.includes(u.tagName)&&(i===0&&!Jo(s)||a.setStartBefore(u))}else s.nodeType===1&&n.includes(s.tagName)&&i>0&&a.setStartBefore(s);let c=a.endContainer,d=a.endOffset;if(c.nodeType===3){const u=c.parentElement;u&&n.includes(u.tagName)&&(d===c.length&&!ea(c)||a.setEndAfter(u))}else c.nodeType===1&&n.includes(c.tagName)&&d<c.childNodes.length&&a.setEndAfter(c);return a}catch{return a}},Jo=a=>{let n=a.previousSibling;for(;n;){if(n.nodeType===3&&n.textContent.trim().length>0||n.nodeType===1&&n.textContent.trim().length>0)return!0;n=n.previousSibling}return!1},ea=a=>{let n=a.nextSibling;for(;n;){if(n.nodeType===3&&n.textContent.trim().length>0||n.nodeType===1&&n.textContent.trim().length>0)return!0;n=n.nextSibling}return!1},Un=(a,n)=>{if(!a||!v.value)return null;try{const s=document.createRange();if(a.type==="text"&&typeof a.start=="number"&&typeof a.end=="number"){let i=0;const c=[v.value];let d=null,u=!1,p=!1;for(;!p&&(d=c.pop());)if(d.nodeType===3){const h=i+d.length;!u&&a.start>=i&&a.start<=h&&(s.setStart(d,a.start-i),u=!0),u&&a.end>=i&&a.end<=h&&(s.setEnd(d,a.end-i),p=!0),i=h}else{let h=d.childNodes.length;for(;h--;)c.push(d.childNodes[h])}return u?an(s):null}}catch{return null}return null},Jn=(a,n)=>{if(!a||!n)return;const s=n.conversation||[],i=new Set,c=[],d=p=>{p&&p.id&&!i.has(p.id)&&(i.add(p.id),c.push(p))};s.length>0&&s.forEach(p=>{p.user&&d(p.user)}),c.length>0?a.setAttribute("data-comment-user",JSON.stringify(c[0])):a.removeAttribute("data-comment-user"),c.length>1?a.setAttribute("data-comment-user-2",JSON.stringify(c[1])):a.removeAttribute("data-comment-user-2");const u=s.length;u>0?a.setAttribute("data-comment-count",String(u)):a.removeAttribute("data-comment-count")},Yl=(a="unknown")=>{if(!L.commentUser||!L.richText||!v.value){oe.value=[];return}Date.now()-xt.value<Mt&&bt.value!==null||bt.value===null&&(bt.value=requestAnimationFrame(()=>{if(bt.value=null,xt.value=Date.now(),Ie.value)return;Ie.value=!0;const s={},i=v.value;if(!i){Ie.value=!1;return}const c=i.closest(".editor-with-comments");if(!c){Ie.value=!1;return}const d=i.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],p=new Set;d.forEach(N=>{const se=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");se&&N.tagName==="SPAN"&&(p.has(se)||(u.push(N),p.add(se)))}),d.forEach(N=>{const se=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");!se||p.has(se)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(N.tagName)?N.querySelector(`span[data-comment="${se}"], span[data-fake-comment="${se}"]`)||(u.push(N),p.add(se)):N.tagName!=="SPAN"&&(u.push(N),p.add(se)))});const h=c.getBoundingClientRect(),k=i.getBoundingClientRect();u.forEach((N,se)=>{let Q=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");if(!Q)return;if(typeof Q=="string"&&Q.startsWith("comment-")){const cn=N.textContent?.trim(),$t=L.comments?.find(ln=>(typeof ln.conversation_id=="string"&&ln.conversation_id.startsWith("comment-")?null:ln.conversation_id)&&ln.selection_text?.trim()===cn);$t?(Q=String($t.conversation_id),N.setAttribute("data-comment",Q),N.removeAttribute("data-fake-comment")):(Q=String(Date.now()),N.setAttribute("data-comment",Q),N.removeAttribute("data-fake-comment"))}const Be=N.getBoundingClientRect(),_e=window.getComputedStyle(N),He=parseFloat(_e.lineHeight)||parseFloat(_e.fontSize)*1.2,ml=Be.top-k.top+He/2-15,Xt=k.top-h.top+ml;let pl=null,gl=null,xn=0;const Wl=[],to=new Set;if(Q&&L.comments){const cn=L.comments.find($t=>String($t.conversation_id||$t.id)===String(Q));if(cn){const $t=cn.conversation||[];$t.length>0?($t.forEach(ln=>{ln.user&&ln.user.id&&!to.has(ln.user.id)&&(to.add(ln.user.id),Wl.push(ln.user))}),xn=$t.length):(xn=0,pl=null,gl=null),Wl.length>0?pl=Wl[0]:pl=null,Wl.length>1?gl=Wl[1]:gl=null}}const $o=Be.top+He/2-15,Lo=$o+30,Ao=5,Do=Lo>k.top+Ao&&$o<k.bottom-Ao?1:0;oe.value.find(cn=>cn.id===Q);let lo=N;if(!lo&&Q&&v.value){const cn=String(Q);lo=v.value.querySelector(`[data-comment="${cn}"], [data-fake-comment="${cn}"]`)}const no=Wl.length;s[Q]?(s[Q].top=Xt,s[Q].opacity=Do,s[Q].element=lo,s[Q].firstUser=pl,s[Q].secondUser=gl,s[Q].totalCount=xn,s[Q].uniqueUserCount=no):s[Q]={id:Q,top:Xt,opacity:Do,element:lo,firstUser:pl,secondUser:gl,totalCount:xn,uniqueUserCount:no}});const D=Object.values(s).map(N=>{const se=Math.max(0,(N.uniqueUserCount??0)-2);if(!N.element&&N.id&&v.value){const Be=String(N.id);N.element=v.value.querySelector(`[data-comment="${Be}"], [data-fake-comment="${Be}"]`)}return{...N,firstUser:N.firstUser||null,secondUser:N.secondUser||null,totalCount:N.totalCount,additionalCount:se}});(oe.value.length!==D.length||D.some((N,se)=>{const Q=oe.value[se];if(!Q)return!0;const Be=(Q.firstUser?.id||null)!==(N.firstUser?.id||null),_e=(Q.secondUser?.id||null)!==(N.secondUser?.id||null);return Q.id!==N.id||Math.abs(Q.top-N.top)>1||Q.opacity!==N.opacity||Q.totalCount!==N.totalCount||Q.additionalCount!==N.additionalCount||Be||_e||Q.element!==N.element}))&&(oe.value=D),Ie.value=!1}))},ta=a=>{if(!a)return;let n=a.element;if(!n&&a.id&&v.value){const s=String(a.id);n=v.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`)}n&&(bn(),Al.value=n,n.classList.add("editor-comment-highlighted"))},bn=(a=!1)=>{!a&&Cl.value!==null&&Al.value&&(Al.value.getAttribute("data-comment")||Al.value.getAttribute("data-fake-comment"))===Cl.value||(v.value&&v.value.querySelectorAll(".editor-comment-highlighted").forEach(s=>{s.classList.remove("editor-comment-highlighted")}),Al.value&&(Al.value.classList.remove("editor-comment-highlighted"),Al.value=null))},eo=a=>{if(!a||!a.element)return;bn(!0);const n=a.element.getAttribute("data-comment")||a.element.getAttribute("data-fake-comment");if(!n)return;const s=`[data-comment="${n}"], [data-fake-comment="${n}"]`;fe("comment-marker-clicked",{commentId:n,selector:s,element:a.element})},la=()=>{bn()},_o=()=>{!L.richText||!v.value||(Fe.value&&Fe.value.disconnect(),St.value!==null&&(clearTimeout(St.value),St.value=null),Fe.value=new MutationObserver(()=>{St.value===null&&(St.value=setTimeout(()=>{St.value=null,e.nextTick(()=>{Yl("MutationObserver")})},200))}),Fe.value.observe(v.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),Yl("setupCommentMarkersObserver-initial"))},tn=(a,n)=>{if(!a||!n)return;const s=n.getBoundingClientRect();let i=s.top,c=s.right+4;a.style.top=`${i}px`,a.style.left=`${c}px`,a.offsetHeight;const d=a.getBoundingClientRect(),u=window.innerWidth,p=window.innerHeight;if(d.right>u){const h=s.left-d.width-4;a.style.left=`${h}px`}if(d.bottom>p){const h=Math.max(8,p-d.height-8);a.style.top=`${h}px`}d.top<0&&(a.style.top="8px")};return e.watch(()=>Xe.value,a=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(s=>{const i=s.getAttribute("data-submenu-id");if(i===a&&a){const c=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${i}"]`);if(c){if(s.parentNode!==document.body){const d=s.parentNode;s.dataset.originalParentRef=d===c?"inside":"sibling",document.body.appendChild(s)}s.style.display="block",s.style.visibility="hidden",s.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{tn(s,c),s.offsetHeight,s.setAttribute("data-active","true"),s.style.visibility="visible",s.style.opacity="1"})})}else s.setAttribute("data-active","true")}else s.setAttribute("data-active","false"),s.style.display="none",s.style.top="",s.style.left="",s.style.visibility="",s.style.opacity=""})})}),e.watch(()=>[be.value,ut.value],()=>{be.value==="askAi"||ut.value==="askAi"?e.nextTick(()=>{So()}):(Xe.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(n=>{if(n.parentNode===document.body){const s=n.getAttribute("data-submenu-id");if(s){const i=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${s}"]`);if(i)if(n.dataset.originalParentRef==="inside")i.appendChild(n);else{const d=i.closest(".dss-toolbar-dropdown");d&&d.insertBefore(n,i.nextSibling)}}}})}))}),e.watch(()=>L.locale,a=>{a&&a!==ce.value&&(ce.value=a)},{immediate:!0}),te({openCommentOverlayForSelector:Sn,updateCommentMarkers:Yl,restoreCommentsFromModel:Qn}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container",[{"editor-with-comments":At.value},It.value]]),style:e.normalizeStyle(Nt.value)},[E.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:n[14]||(n[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Vd,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:hn,title:e.unref(V)("textEditor.toolbar.undo")},[...n[45]||(n[45]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,Nd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Vl.value}]),onClick:An,title:e.unref(V)("textEditor.toolbar.redo")},[...n[46]||(n[46]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,Bd),n[61]||(n[61]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Md,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[0]||(n[0]=s=>Dn("paragraph")),title:e.unref(V)("textEditor.toolbar.paragraphFormat")},[A.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:O.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,$d)):A.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:O.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Ld)):A.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:O.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Ad)):A.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:O.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Td)):A.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:O.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Dd)):A.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:O.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,Hd)):(e.openBlock(),e.createElementBlock("svg",Rd,[...n[47]||(n[47]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),n[48]||(n[48]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,_d),be.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[8]||(n[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[1]||(n[1]=s=>zl("<h1>"))},[e.createElementVNode("img",{src:O.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Fd),e.createElementVNode("h1",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[2]||(n[2]=s=>zl("<h2>"))},[e.createElementVNode("img",{src:O.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Id),e.createElementVNode("h2",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[3]||(n[3]=s=>zl("<h3>"))},[e.createElementVNode("img",{src:O.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,zd),e.createElementVNode("h3",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[4]||(n[4]=s=>zl("<h4>"))},[e.createElementVNode("img",{src:O.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Pd),e.createElementVNode("h4",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[5]||(n[5]=s=>zl("<h5>"))},[e.createElementVNode("img",{src:O.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Od),e.createElementVNode("h5",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[6]||(n[6]=s=>zl("<h6>"))},[e.createElementVNode("img",{src:O.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,Wd),e.createElementVNode("h6",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[7]||(n[7]=s=>zl("<p>"))},[n[49]||(n[49]=e.createElementVNode("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"})],-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("bold")}]),onClick:n[9]||(n[9]=s=>Ql("bold")),title:e.unref(V)("textEditor.toolbar.bold")},[...n[50]||(n[50]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,qd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("italic")}]),onClick:n[10]||(n[10]=s=>Ql("italic")),title:e.unref(V)("textEditor.toolbar.italic")},[...n[51]||(n[51]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,Zd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("underline")}]),onClick:n[11]||(n[11]=s=>Ql("underline")),title:e.unref(V)("textEditor.toolbar.underline")},[...n[52]||(n[52]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,Ud),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":je.value}]),onClick:zt,title:e.unref(V)("textEditor.toolbar.citation")},[...n[53]||(n[53]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,Xd),n[62]||(n[62]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ke.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:Ml,title:e.unref(V)("textEditor.toolbar.removeLink")},[...n[55]||(n[55]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,jd)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:kt,title:e.unref(V)("textEditor.toolbar.insertLink")},[...n[54]||(n[54]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,Yd)),n[63]||(n[63]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("insertUnorderedList")}]),onClick:nt,title:e.unref(V)("textEditor.toolbar.bulletList")},[...n[56]||(n[56]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,Kd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("insertOrderedList")}]),onClick:ft,title:e.unref(V)("textEditor.toolbar.numberList")},[...n[57]||(n[57]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,Gd),n[64]||(n[64]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Wn,title:e.unref(V)("textEditor.toolbar.image")},[...n[58]||(n[58]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,Qd),At.value&&ae.value?(e.openBlock(),e.createElementBlock("div",Jd)):e.createCommentVNode("",!0),At.value&&ae.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(V)("textEditor.toolbar.comment"),onClick:Ul},[...n[59]||(n[59]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,e1)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",t1)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",l1,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:n[12]||(n[12]=s=>Dn("askAi")),title:e.unref(V)("textEditor.toolbar.askAi")},[n[60]||(n[60]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",o1,e.toDisplayString(e.unref(V)("textEditor.toolbar.askAi")),1)],8,n1),be.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[13]||(n[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(a.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",a1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[Hl(s)?(e.openBlock(),e.createElementBlock("div",s1,[e.renderSlot(a.$slots,s)])):e.createCommentVNode("",!0),Hl(s)&&i<E.customToolbarSlots.length-1&&Pn(i)?(e.openBlock(),e.createElementBlock("div",r1)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(be.value==="paragraph"||be.value==="askAi")&&E.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:nl})):e.createCommentVNode("",!0),e.createVNode(ma,{showModal:$e.value,width:"500px",height:"55vh",onCloseModal:gt},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(V)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",i1,[e.createElementVNode("div",c1,[e.createElementVNode("label",u1,e.toDisplayString(e.unref(V)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:ze,type:"text","onUpdate:modelValue":n[15]||(n[15]=s=>mt.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.link.enterAltText"),onKeyup:e.withKeys(sl,["enter"])},null,40,d1),[[e.vModelText,mt.value]])]),e.createElementVNode("div",m1,[e.createElementVNode("label",p1,e.toDisplayString(e.unref(V)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:U,type:"text","onUpdate:modelValue":n[16]||(n[16]=s=>tt.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.link.enterUrl"),onKeyup:e.withKeys(sl,["enter"])},null,40,f1),[[e.vModelText,tt.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:gt},e.toDisplayString(e.unref(V)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:sl},e.toDisplayString(e.unref(V)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(ma,{showModal:ht.value,width:"500px",height:"80vh",onCloseModal:Zn},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(yt.value?e.unref(V)("textEditor.image.editImage"):e.unref(V)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",v1,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Ne.value==="upload"}]),onClick:n[17]||(n[17]=s=>Ne.value="upload")},e.toDisplayString(e.unref(V)("textEditor.image.upload")),3),n[65]||(n[65]=e.createElementVNode("div",{class:"dss-image-modal-tab-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Ne.value==="url"}]),onClick:n[18]||(n[18]=s=>Ne.value="url")},e.toDisplayString(e.unref(V)("textEditor.image.imageLink")),3)]),Ne.value==="upload"?(e.openBlock(),e.createElementBlock("div",h1,[e.createElementVNode("div",g1,[e.createElementVNode("div",y1,[on.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",k1,e.toDisplayString(e.unref(V)("textEditor.image.uploadImage")),1)),on.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:ho},[e.createElementVNode("img",{src:qt.value,alt:"Preview",class:"dss-image-preview-image"},null,8,C1),n[66]||(n[66]=e.createElementVNode("div",{class:"dss-image-preview-overlay"},[e.createElementVNode("svg",{width:"35",height:"35",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.1 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z",fill:"white"})])],-1)),e.createElementVNode("input",{ref_key:"imageFileInput",ref:it,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:Cn},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:it,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:Cn},null,544))]),e.createElementVNode("div",b1,[e.createElementVNode("label",x1,e.toDisplayString(e.unref(V)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Yt,type:"text","onUpdate:modelValue":n[19]||(n[19]=s=>dt.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Rl,["enter"])},null,40,w1),[[e.vModelText,dt.value]])]),e.createElementVNode("div",E1,[e.createElementVNode("label",S1,e.toDisplayString(e.unref(V)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[20]||(n[20]=s=>Ct.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.auto"),onKeyup:e.withKeys(Rl,["enter"]),onInput:qn},null,40,V1),[[e.vModelText,Ct.value]])]),e.createElementVNode("div",N1,[e.createElementVNode("label",B1,e.toDisplayString(e.unref(V)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[21]||(n[21]=s=>wt.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.auto"),onKeyup:e.withKeys(Rl,["enter"]),onInput:Bo},null,40,M1),[[e.vModelText,wt.value]])])])])):e.createCommentVNode("",!0),Ne.value==="url"?(e.openBlock(),e.createElementBlock("div",_1,[e.createElementVNode("div",$1,[e.createElementVNode("div",L1,[e.createElementVNode("label",A1,e.toDisplayString(e.unref(V)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Kt,type:"text","onUpdate:modelValue":n[22]||(n[22]=s=>Pe.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(Rl,["enter"])},null,40,T1),[[e.vModelText,Pe.value]])]),e.createElementVNode("div",D1,[e.createElementVNode("label",H1,e.toDisplayString(e.unref(V)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[23]||(n[23]=s=>dt.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Rl,["enter"])},null,40,R1),[[e.vModelText,dt.value]])]),e.createElementVNode("div",F1,[e.createElementVNode("label",I1,e.toDisplayString(e.unref(V)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[24]||(n[24]=s=>Ct.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.auto"),onKeyup:e.withKeys(Rl,["enter"]),onInput:qn},null,40,z1),[[e.vModelText,Ct.value]])]),e.createElementVNode("div",P1,[e.createElementVNode("label",O1,e.toDisplayString(e.unref(V)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[25]||(n[25]=s=>wt.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.auto"),onKeyup:e.withKeys(Rl,["enter"]),onInput:Bo},null,40,W1),[[e.vModelText,wt.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Zn},e.toDisplayString(e.unref(V)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Rl},e.toDisplayString(e.unref(V)("textEditor.image.save")),1)]),_:1},8,["showModal"]),E.showTitle?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":ql.value&&vl.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(V)("textEditor.labels.title")),1),e.createElementVNode("div",q1,[vl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Z1,[E.title?(e.openBlock(),e.createElementBlock("span",U1,e.toDisplayString(E.title),1)):(e.openBlock(),e.createElementBlock("span",X1,e.toDisplayString(xl.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:xe,value:E.title,onInput:lt,onFocus:Te,onBlur:pt,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!vl.value}]),placeholder:xl.value,disabled:E.disabled,rows:"1"},null,42,Y1)])],2)):e.createCommentVNode("",!0),E.showTitle&&ql.value&&vl.value?(e.openBlock(),e.createElementBlock("div",j1,[e.renderSlot(a.$slots,"title-slot")])):e.createCommentVNode("",!0),E.showDescription?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":rl.value&&M.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(V)("textEditor.labels.description")),1),e.createElementVNode("div",K1,[M.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",G1,[E.description?(e.openBlock(),e.createElementBlock("span",Q1,e.toDisplayString(E.description),1)):(e.openBlock(),e.createElementBlock("span",J1,e.toDisplayString(Fl.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:Ke,value:E.description,onInput:wl,onFocus:il,onBlur:kl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!M.value}]),placeholder:Fl.value,disabled:E.disabled,rows:"1"},null,42,em)])],2)):e.createCommentVNode("",!0),E.showDescription&&rl.value&&M.value?(e.openBlock(),e.createElementBlock("div",tm,[e.renderSlot(a.$slots,"description-slot")])):e.createCommentVNode("",!0),At.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:6},e.renderList(oe.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":Cl.value===s.id,"editor-comment-marker-group-out-of-view":s.opacity===0}]),"data-comment-id":s.id,style:e.normalizeStyle({top:s.top+"px"}),onMouseenter:i=>ta(s),onMouseleave:la},[s.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(i=>eo(s),["stop"])},[s.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.firstUser.avatar,alt:s.firstUser.name||"avatar"},null,8,om)):(e.openBlock(),e.createElementBlock("span",am,e.toDisplayString(s.firstUser.initials||(s.firstUser.name?s.firstUser.name.charAt(0):"")),1))],8,nm)):e.createCommentVNode("",!0),s.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(i=>eo(s),["stop"])},[s.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.secondUser.avatar,alt:s.secondUser.name||"avatar"},null,8,rm)):(e.openBlock(),e.createElementBlock("span",im,e.toDisplayString(s.secondUser.initials||(s.secondUser.name?s.secondUser.name.charAt(0):"")),1))],8,sm)):e.createCommentVNode("",!0),s.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:s.secondUser?"30px":"15px"}),"data-has-second-user":s.secondUser?"true":"false",onClick:e.withModifiers(i=>eo(s),["stop"])},[e.createElementVNode("span",um,"+"+e.toDisplayString(s.additionalCount),1)],12,cm)):e.createCommentVNode("",!0)],46,lm))),128)):e.createCommentVNode("",!0),E.richText?(e.openBlock(),e.createElementBlock("div",gm,[e.createElementVNode("div",{ref_key:"editorRef",ref:v,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":E.disabled,"dss-text-editor-fixed-height":E.fixedHeight}]),style:e.normalizeStyle(nn.value),onInput:_t,onBlur:vn,onClick:Vo,onMouseup:Kn,onKeyup:Kn,onKeydown:jo,onPaste:wo,onMousemove:Bl,onMouseleave:ul},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[At.value&&Cl.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(y.value)},[Z.value||at.value.length>0?(e.openBlock(),e.createElementBlock("div",ym,[e.createElementVNode("div",km,[Z.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:Z.value},null,8,Cm)):e.createCommentVNode("",!0)]),e.createElementVNode("div",bm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(at.value,(s,i)=>(e.openBlock(),e.createElementBlock("div",{key:i,class:"dss-comment-message"},[s.user&&(s.user.avatar||s.user.initials||s.user.name)?(e.openBlock(),e.createElementBlock("div",xm,[e.createElementVNode("div",wm,[s.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.user.avatar,alt:s.user.name||"avatar"},null,8,Em)):(e.openBlock(),e.createElementBlock("span",Sm,e.toDisplayString(s.user.initials||(s.user.name?s.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Vm,[e.createElementVNode("div",Nm,[e.createElementVNode("div",Bm,e.toDisplayString(s.user&&s.user.name||"Comment"),1),s.createdAt?(e.openBlock(),e.createElementBlock("div",Mm,e.toDisplayString(T(new Date(s.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":z(s.text)||s.class==="comment-started"}])},e.toDisplayString(s.text||""),3)]),L.commentUser&&s.user&&s.user.id===L.commentUser.id&&!z(s.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>mo(s,i),["stop"]),title:e.unref(V)("textEditor.comment.delete")||"Delete comment"},[...n[68]||(n[68]=[e.createElementVNode("svg",{width:"22",height:"25",viewBox:"0 0 22 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M19.5986 21.3535C19.5985 23.3679 18.1282 25 16.2891 25H5.30957C3.48166 24.9997 2.00011 23.3702 2 21.3535V8H19.5986V21.3535ZM8 11C7.44772 11 7 11.4477 7 12V20C7 20.5523 7.44772 21 8 21C8.55229 21 9 20.5523 9 20V12C9 11.4477 8.55229 11 8 11ZM14 11C13.4477 11 13 11.4477 13 12V20C13 20.5523 13.4477 21 14 21C14.5523 21 15 20.5523 15 20V12C15 11.4477 14.5523 11 14 11ZM13.2002 0C15.0227 0.000104554 16.4999 1.46937 16.5 3.27246V4.36328H20.9092C21.5117 4.36348 21.9998 4.84789 22 5.4541C22 6.05615 21.4986 6.54569 20.9092 6.5459H1.09082C0.488195 6.54569 0 6.06052 0 5.4541C0.000246661 4.85225 0.50153 4.36349 1.09082 4.36328H5.5L5.50098 3.27246C5.50112 1.46505 6.98382 0.000171185 8.80078 0H13.2002ZM8.79004 2.18164C8.19615 2.18167 7.70034 2.67042 7.7002 3.27246C7.7002 3.87899 8.18837 4.36325 8.79004 4.36328H13.21C13.8039 4.36325 14.2998 3.87462 14.2998 3.27246C14.2997 2.66606 13.8115 2.18167 13.21 2.18164H8.79004Z",fill:"#323232"})],-1)])],8,_m)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",$m,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:w,"onUpdate:modelValue":n[26]||(n[26]=s=>g.value=s),class:"dss-comment-input",rows:"1",placeholder:e.unref(V)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(gn,["prevent","stop"]),["enter"]),onInput:n[27]||(n[27]=()=>{if(w.value){const s=w.value;s.style.height="auto",s.style.height=`${s.scrollHeight}px`}})},null,40,Lm),[[e.vModelText,g.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(gn,["stop"])},[...n[69]||(n[69]=[e.createElementVNode("svg",{width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0.00999999 18L21 9L0.00999999 0L0 7L15 9L0 11L0.00999999 18Z",fill:"#31312F"})],-1)])])])],4)):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",Am,[e.createElementVNode("div",Tm,[e.createElementVNode("span",Dm,e.toDisplayString(tl.value)+" "+e.toDisplayString(tl.value===1?e.unref(V)("textEditor.footer.word"):e.unref(V)("textEditor.footer.words")),1),n[70]||(n[70]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Hm,e.toDisplayString(jl.value)+" "+e.toDisplayString(jl.value===1?e.unref(V)("textEditor.footer.character"):e.unref(V)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",dm,[e.createElementVNode("textarea",{value:E.modelValue,onInput:_,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":E.fixedHeight}]),placeholder:dn.value,rows:E.rows,disabled:E.disabled,style:e.normalizeStyle(yl.value)},null,46,mm),e.createElementVNode("div",pm,[e.createElementVNode("div",fm,[e.createElementVNode("span",vm,e.toDisplayString(tl.value)+" "+e.toDisplayString(tl.value===1?e.unref(V)("textEditor.footer.word"):e.unref(V)("textEditor.footer.words")),1),n[67]||(n[67]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",hm,e.toDisplayString(jl.value)+" "+e.toDisplayString(jl.value===1?e.unref(V)("textEditor.footer.character"):e.unref(V)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Y.value&&me.value&&v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(F.value),onMouseenter:n[28]||(n[28]=s=>ue.value=!0),onMouseleave:Ol},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Ut,["stop"]),title:me.value},e.toDisplayString(me.value),9,Rm),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Pt,["stop"]),title:e.unref(V)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",Im,[...n[71]||(n[71]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,Fm)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[X.value&&ge.value&&v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(W.value),onMouseenter:n[29]||(n[29]=s=>G.value=!0),onMouseleave:Xl},[e.createElementVNode("div",zm,[ge.value===e.unref(V)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",Pm,[...n[72]||(n[72]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z",fill:"#fafafa"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:"dss-image-popup-alt",title:ge.value},e.toDisplayString(ge.value),9,Om)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Mo,["stop"]),title:e.unref(V)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",qm,[...n[73]||(n[73]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,Wm)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[E.floatingToolbar&&E.richText&&Qe.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:Je,class:"dss-floating-toolbar",style:e.normalizeStyle(Ce.value),onMousedown:n[44]||(n[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Zm,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(hn,["stop"]),title:e.unref(V)("textEditor.toolbar.undo")},[...n[74]||(n[74]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,Um),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Vl.value}]),onClick:e.withModifiers(An,["stop"]),title:e.unref(V)("textEditor.toolbar.redo")},[...n[75]||(n[75]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,Xm),n[89]||(n[89]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Ym,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[30]||(n[30]=e.withModifiers(s=>Gn("paragraph"),["stop"])),title:e.unref(V)("textEditor.toolbar.paragraphFormat")},[A.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:O.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Km)):A.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:O.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Gm)):A.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:O.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Qm)):A.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:O.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Jm)):A.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:O.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,e2)):A.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:O.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,t2)):(e.openBlock(),e.createElementBlock("svg",l2,[...n[76]||(n[76]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),n[77]||(n[77]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,jm),ut.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[38]||(n[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[31]||(n[31]=s=>R("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[32]||(n[32]=s=>R("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[33]||(n[33]=s=>R("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[34]||(n[34]=s=>R("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[35]||(n[35]=s=>R("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[36]||(n[36]=s=>R("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[37]||(n[37]=s=>R("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),n[90]||(n[90]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("bold")}]),onClick:n[39]||(n[39]=e.withModifiers(s=>Ql("bold"),["stop"])),title:e.unref(V)("textEditor.toolbar.bold")},[...n[78]||(n[78]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,n2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("italic")}]),onClick:n[40]||(n[40]=e.withModifiers(s=>Ql("italic"),["stop"])),title:e.unref(V)("textEditor.toolbar.italic")},[...n[79]||(n[79]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,o2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("underline")}]),onClick:n[41]||(n[41]=e.withModifiers(s=>Ql("underline"),["stop"])),title:e.unref(V)("textEditor.toolbar.underline")},[...n[80]||(n[80]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,a2),n[91]||(n[91]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":je.value}]),onClick:e.withModifiers(zt,["stop"]),title:e.unref(V)("textEditor.toolbar.citation")},[...n[81]||(n[81]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,s2),n[92]||(n[92]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ke.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(Ml,["stop"]),title:e.unref(V)("textEditor.toolbar.removeLink")},[...n[83]||(n[83]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,i2)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(kt,["stop"]),title:e.unref(V)("textEditor.toolbar.insertLink")},[...n[82]||(n[82]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,r2)),n[93]||(n[93]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("insertUnorderedList")}]),onClick:e.withModifiers(nt,["stop"]),title:e.unref(V)("textEditor.toolbar.bulletList")},[...n[84]||(n[84]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,c2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("insertOrderedList")}]),onClick:e.withModifiers(ft,["stop"]),title:e.unref(V)("textEditor.toolbar.numberList")},[...n[85]||(n[85]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,u2),n[94]||(n[94]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Wn,["stop"]),title:e.unref(V)("textEditor.toolbar.image")},[...n[86]||(n[86]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,d2),At.value?(e.openBlock(),e.createElementBlock("div",m2)):e.createCommentVNode("",!0),At.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(V)("textEditor.toolbar.comment"),onClick:e.withModifiers(Ul,["stop"])},[...n[87]||(n[87]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,p2)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",f2)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",v2,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:n[42]||(n[42]=e.withModifiers(s=>Gn("askAi"),["stop"])),title:e.unref(V)("textEditor.toolbar.askAi")},[n[88]||(n[88]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",g2,e.toDisplayString(e.unref(V)("textEditor.toolbar.askAi")),1)],8,h2),ut.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[43]||(n[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(a.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),wn.value?(e.openBlock(),e.createElementBlock("div",y2,[E.askAi&&wn.value?(e.openBlock(),e.createElementBlock("div",k2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[Hl(s)&&pn(s)?(e.openBlock(),e.createElementBlock("div",C2,[e.renderSlot(a.$slots,s)])):e.createCommentVNode("",!0),Hl(s)&&pn(s)&&i<E.customToolbarSlots.length-1&&mn(i)?(e.openBlock(),e.createElementBlock("div",b2)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),E2={class:"dss-color-picker__section-title"},S2={class:"dss-color-picker__presets-row"},V2=["title","onClick"],N2={key:1,class:"dss-color-picker__section"},B2={class:"dss-color-picker__presets-row"},M2=["title","onClick"],_2={key:2,class:"dss-color-picker__section"},$2={class:"dss-color-picker__section-header"},L2={class:"dss-color-picker__presets-row"},A2=["title","onClick"],T2=["onClick"],D2={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},H2=["title","onClick"],R2={class:"dss-color-picker__input-row"},F2=["value"],I2={__name:"DSSColorPicker",props:{modelValue:{type:String,default:"#b8a5de"},disabled:{type:Boolean,default:!1},presetColors:{type:Array,default:()=>[]},presetGroups:{type:Array,default:null},max:{type:Number,default:12},initialPresetCount:{type:Number,default:null},disableCustomColors:{type:Boolean,default:!1}},emits:["update:modelValue","update:presetColors"],setup(E,{emit:te}){function $(ne){const j=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(ne);if(!j)return{h:0,s:0,l:50};const K=parseInt(j[1],16)/255,de=parseInt(j[2],16)/255,xe=parseInt(j[3],16)/255,Ke=Math.max(K,de,xe),Ht=Math.min(K,de,xe);let jt=0,et=0;const vl=(Ke+Ht)/2;if(Ke!==Ht){const M=Ke-Ht;switch(et=vl>.5?M/(2-Ke-Ht):M/(Ke+Ht),Ke){case K:jt=((de-xe)/M+(de<xe?6:0))/6;break;case de:jt=((xe-K)/M+2)/6;break;case xe:jt=((K-de)/M+4)/6;break}}return{h:jt*360,s:et*100,l:vl*100}}function V(ne,j,K){j/=100,K/=100;const de=j*Math.min(K,1-K),xe=Ke=>{const Ht=(Ke+ne/30)%12,jt=K-de*Math.max(Math.min(Ht-3,9-Ht,1),-1);return Math.round(255*jt).toString(16).padStart(2,"0")};return`#${xe(0)}${xe(8)}${xe(4)}`}function ce(ne){const j=ne.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!j)return null;let K=j[1];return K.length===3&&(K=K.split("").map(de=>de+de).join("")),"#"+K}function O(ne){const j=ne.match(/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})(?:[\s,\/]+[\d.]+)?\s*\)$/i);if(!j)return null;const K=Math.max(0,Math.min(255,Number.parseInt(j[1],10))),de=Math.max(0,Math.min(255,Number.parseInt(j[2],10))),xe=Math.max(0,Math.min(255,Number.parseInt(j[3],10)));return`#${K.toString(16).padStart(2,"0")}${de.toString(16).padStart(2,"0")}${xe.toString(16).padStart(2,"0")}`}function L(ne){if(typeof ne!="string")return null;const j=ne.trim();return ce(j)||O(j)}function fe(ne,j,K){j/=100,K/=100;const de=K+j*Math.min(K,1-K),xe=de===0?0:2-2*K/de;return{h:ne,s:xe*100,v:de*100}}function rt(ne,j,K){j/=100,K/=100;const de=K*(1-j/2),xe=de===0||de===1?0:(K-de)/Math.min(de,1-de);return{h:ne,s:xe*100,l:de*100}}const ee=E,v=te,be=e.ref(!1),ke=e.ref(!1),J=e.ref(!1),Y=e.ref(-1),me=e.ref(-1),F=e.ref(null),ue=e.ref(null),$e=e.ref(null),tt=e.ref(null),mt=e.ref({top:0,left:0}),U=e.ref($(ee.modelValue||"#b8a5de")),ze=e.computed(()=>Array.isArray(ee.presetGroups)&&ee.presetGroups.length>0),qe=e.computed(()=>!ee.disableCustomColors),Ve=e.computed(()=>ze.value?0:ee.initialPresetCount!=null?ee.initialPresetCount:me.value<0?null:me.value),Le=e.computed(()=>{const ne=Ve.value;return ne==null?!0:Math.max(0,ee.presetColors.length-ne)<ee.max}),je=e.computed(()=>!!(ke.value||Y.value>=0||!re.value&&ee.presetColors.length===0));e.computed(()=>{const ne=Ve.value;return ne!=null&&ee.presetColors.length>ne});const re=e.computed(()=>ze.value||Ve.value!=null),Qe=e.computed(()=>{const ne=Ve.value;return ne==null?[]:ee.presetColors.slice(0,ne)}),Ce=e.computed(()=>{const ne=Ve.value;return ne==null?[]:ee.presetColors.slice(ne)});function Je(ne){const j=Ve.value;return j!=null?j+ne:-1}function ut(ne){const j=Ve.value;return j!=null&&ne>=j}function ht(ne){ut(ne)&&(Y.value=ne,U.value=$(ee.presetColors[ne]),ke.value=!0,e.nextTick(()=>tt.value?.focus()))}function dt(ne){if(!ut(ne))return;const j=ee.presetColors.filter((xe,Ke)=>Ke!==ne);v("update:presetColors",j);const K=ce(ee.modelValue),de=ce(ee.presetColors[ne]);if(K&&de&&K.toLowerCase()===de.toLowerCase()){const xe=j[Math.max(0,ne-1)]||j[0];xe&&v("update:modelValue",xe)}}function Wt(){J.value=!J.value,J.value||(Y.value=-1,ke.value=!1)}function qt(){if(!qe.value||Y.value<0)return;const ne=it.value,j=ce(ne);if(j){const K=[...ee.presetColors];K[Y.value]=j,v("update:presetColors",K),v("update:modelValue",j),Y.value=-1,ke.value=!1}}function Ct(){ee.disabled||!qe.value||(Y.value=-1,ke.value=!ke.value,ke.value&&(G(),e.nextTick(()=>tt.value?.focus())))}function wt(ne){const j=L(ne),K=L(ee.modelValue);return j&&K&&j.toLowerCase()===K.toLowerCase()}function Yt(){if(ee.disabled||!qe.value||!Le.value)return;const ne=it.value,j=ce(ne);if(j){const K=[...ee.presetColors,j];v("update:presetColors",K),v("update:modelValue",j);const de=Ve.value??me.value;de>=0&&K.length-de>=ee.max&&(ke.value=!1)}}const it=e.computed(()=>{const{h:ne,s:j,l:K}=U.value;return V(ne,j,K)}),Kt=e.computed(()=>it.value.toLowerCase()),yt=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${U.value.h}, 100%, 50%))`})),el=e.computed(()=>{const ne=fe(U.value.h,U.value.s,U.value.l);return{left:`${ne.s}%`,bottom:`${ne.v}%`,transform:"translate(-50%, 50%)"}}),X=e.computed(()=>({left:`${U.value.h/360*100}%`,transform:"translateX(-50%)"})),ge=e.computed(()=>({position:"fixed",left:`${mt.value.left}px`,top:`${mt.value.top}px`,zIndex:1002}));function W(){if(!F.value||!be.value)return;const ne=F.value.getBoundingClientRect(),j=window.innerHeight||document.documentElement.clientHeight;let K=ne.bottom+4;const de=ue.value;de&&K+de.offsetHeight>j-8&&(K=ne.top-4-de.offsetHeight),mt.value={top:K,left:ne.left}}function G(){const ne=ee.modelValue||"#b8a5de",j=L(ne);j&&(U.value=$(j))}function Ne(){v("update:modelValue",it.value)}function Pe(){ee.disabled||(be.value=!be.value,be.value&&(G(),e.nextTick(()=>{W(),tt.value?.focus()})))}function Xe(){const ne=it.value,j=ce(ne);if(j){if(Y.value>=0){const K=[...ee.presetColors];K[Y.value]=j,v("update:presetColors",K),v("update:modelValue",j)}else if(qe.value&&(ee.presetColors.length>0||ze.value)&&ke.value&&Le.value&&!ee.presetColors.some(de=>ce(de)?.toLowerCase()===j.toLowerCase())){const de=[...ee.presetColors,j];v("update:presetColors",de),v("update:modelValue",j)}}be.value=!1,ke.value=!1,J.value=!1,Y.value=-1}function Et(ne){if(!$e.value)return;const j=$e.value.getBoundingClientRect(),K=de=>{const xe=Math.max(0,Math.min(1,(de.clientX-j.left)/j.width)),Ke=Math.max(0,Math.min(1,1-(de.clientY-j.top)/j.height)),Ht={h:U.value.h,s:xe*100,v:Ke*100};U.value=rt(Ht.h,Ht.s,Ht.v)};K(ne),document.addEventListener("mousemove",K),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",K),Ne()},{once:!0})}function Ge(ne){if(!ne.currentTarget)return;const K=ne.currentTarget.getBoundingClientRect(),de=xe=>{const Ke=Math.max(0,Math.min(1,(xe.clientX-K.left)/K.width));U.value={...U.value,h:Ke*360}};de(ne),document.addEventListener("mousemove",de),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",de),Ne()},{once:!0})}function Zt(ne){const j=ne.target.value,K=L(j);K&&(U.value=$(K),v("update:modelValue",K))}function Ue(ne){if(ee.disabled)return;const j=L(ne);j&&(U.value=$(j),v("update:modelValue",j))}let We=null,Dt=null;function Lt(){We&&(document.removeEventListener("keydown",We),We=null),Dt&&(window.removeEventListener("resize",Dt),Dt=null)}return e.watch(be,ne=>{if(Lt(),ne){if(!ze.value&&ee.initialPresetCount==null){const j=ee.presetColors.length;j>0&&(me.value<0||j<me.value)&&(me.value=j)}We=j=>{j.key==="Escape"&&Xe()},Dt=W,document.addEventListener("keydown",We),window.addEventListener("resize",Dt)}}),e.watch(()=>ee.modelValue,()=>{be.value&&G()},{immediate:!1}),e.watch(Ce,ne=>{ne.length===0&&(J.value=!1,Y.value=-1,ke.value=!1)}),e.onBeforeUnmount(Lt),(ne,j)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":E.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:F,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":be.value}]),onClick:Pe},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:it.value})},[...j[0]||(j[0]=[e.createElementVNode("span",{class:"dss-color-picker__hover-layer"},[e.createElementVNode("svg",{class:"dss-color-picker__pen-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})])],-1)])],4)],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[be.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(Xe,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:ue,class:"dss-color-picker__dropdown",style:e.normalizeStyle(ge.value)},[re.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[ze.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(E.presetGroups,(K,de)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+de,class:"dss-color-picker__section"},[e.createElementVNode("span",E2,e.toDisplayString(K.title),1),e.createElementVNode("div",S2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.colors,(xe,Ke)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+de+"-"+Ke,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":wt(xe)}]),style:e.normalizeStyle({backgroundColor:xe,"--dss-preset-color":xe}),title:xe,onClick:e.withModifiers(Ht=>Ue(xe),["stop"])},null,14,V2))),128))])]))),128)):Qe.value.length?(e.openBlock(),e.createElementBlock("div",N2,[j[1]||(j[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",B2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qe.value,(K,de)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+de,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":wt(K)}]),style:e.normalizeStyle({backgroundColor:K,"--dss-preset-color":K}),title:K,onClick:e.withModifiers(xe=>Ue(K),["stop"])},null,14,M2))),128))])])):e.createCommentVNode("",!0),qe.value?(e.openBlock(),e.createElementBlock("div",_2,[e.createElementVNode("div",$2,[j[3]||(j[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),Ce.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__manage-icon",{"dss-color-picker__manage-icon--active":J.value}]),title:"Manage custom colors",onClick:e.withModifiers(Wt,["stop"])},[...j[2]||(j[2]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64V11.67c0 .19.15.33.33.33h2.03c.09 0 .17-.03.23-.1l7.28-7.27-2.5-2.5L.1 9.4A.33.33 0 0 0 0 9.64ZM11.8 2.69c.26-.26.26-.68 0-.94L10.25.2a.66.66 0 0 0-.94 0L8.09 1.41l2.5 2.5 1.22-1.22Z",fill:"currentColor"})],-1)])],2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",L2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,(K,de)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+de,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":J.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!J.value&&wt(K),"dss-color-picker__preset-bubble--editing":J.value&&Y.value===Je(de)}]),style:e.normalizeStyle({backgroundColor:Y.value===Je(de)?it.value:K,"--dss-preset-color":Y.value===Je(de)?it.value:K}),title:Y.value===Je(de)?it.value:K,onClick:e.withModifiers(xe=>J.value?ht(Je(de)):Ue(K),["stop"])},null,14,A2),J.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__preset-action dss-color-picker__preset-action--delete",title:"Delete",onClick:e.withModifiers(xe=>dt(Je(de)),["stop"])},[...j[4]||(j[4]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)])],8,T2)):e.createCommentVNode("",!0)],2))),128)),Le.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ke.value}]),onClick:e.withModifiers(Ct,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],64)):E.presetColors.length?(e.openBlock(),e.createElementBlock("div",D2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.presetColors,(K,de)=>(e.openBlock(),e.createElementBlock("button",{key:de,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":wt(K)}]),style:e.normalizeStyle({backgroundColor:K,"--dss-preset-color":K}),title:K,onClick:e.withModifiers(xe=>Ue(K),["stop"])},null,14,H2))),128)),qe.value&&Le.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ke.value}]),onClick:e.withModifiers(Ct,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),je.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:$e,onMousedown:Et},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(yt.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(el.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:Ge},[j[5]||(j[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(X.value)},null,4)],32),e.createElementVNode("div",R2,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:tt,type:"text",class:"dss-color-picker__hex-input",value:Kt.value,onInput:Zt},null,40,F2)]),qe.value&&re.value&&(E.presetColors.length||ze.value)&&Le.value&&Y.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:Yt}," Save color ")):e.createCommentVNode("",!0),qe.value&&re.value&&Y.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:qt}," Save color ")):e.createCommentVNode("",!0),re.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:Xe}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},z2={key:0,class:"dss-loader"},P2={key:0,class:"dss-loader-label"},O2={key:1,class:"dss-loader"},W2={key:0,class:"dss-loader-label"},q2={key:2,class:"dss-loader"},Z2={key:0,class:"dss-loader-label"},U2={key:3,class:"dss-loader"},X2={key:0,class:"dss-loader-label"},Y2={key:4,class:"dss-loader"},j2={key:0,class:"dss-loader-label"},K2={key:5,class:"dss-loader dss-loader--inline"},G2={class:"dss-loader-inline-text"},Q2={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""}},setup(E){const te=E,$=e.computed(()=>te.size==="small"?"dss-loaders--size-small":te.size==="large"?"dss-loaders--size-large":te.size==="medium"||te.size==null?"dss-loaders--size-medium":null),V=e.computed(()=>{const ce={};if(!(te.size==="small"||te.size==="medium"||te.size==="large"||te.size==null)){const O=typeof te.size=="number"?`${te.size}px`:String(te.size);ce["--dss-loader-size"]=O}return te.color&&(ce["--dss-loader-accent"]=te.color,ce["--dss-loader-accent-soft"]=`color-mix(in srgb, ${te.color} 30%, white)`),ce});return(ce,O)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",$.value]),style:e.normalizeStyle(V.value)},[E.type==="spinner"?(e.openBlock(),e.createElementBlock("div",z2,[O[0]||(O[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),E.label?(e.openBlock(),e.createElementBlock("span",P2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="dots"?(e.openBlock(),e.createElementBlock("div",O2,[O[1]||(O[1]=e.createElementVNode("span",{class:"dss-loader-dots","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"})],-1)),E.label?(e.openBlock(),e.createElementBlock("span",W2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="battery"?(e.openBlock(),e.createElementBlock("div",q2,[O[2]||(O[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),E.label?(e.openBlock(),e.createElementBlock("span",Z2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",U2,[O[3]||(O[3]=e.createElementVNode("span",{class:"dss-loader-double-circle","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-double-circle-outer"}),e.createElementVNode("span",{class:"dss-loader-double-circle-inner"})],-1)),E.label?(e.openBlock(),e.createElementBlock("span",X2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="bars"?(e.openBlock(),e.createElementBlock("div",Y2,[O[4]||(O[4]=e.createElementVNode("span",{class:"dss-loader-bars","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"})],-1)),E.label?(e.openBlock(),e.createElementBlock("span",j2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="inline"?(e.openBlock(),e.createElementBlock("div",K2,[O[5]||(O[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",G2,[e.renderSlot(ce.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(E.label),1)])])])):e.createCommentVNode("",!0)],6))}},Ba="dss-skeleton-item",J2={__name:"DSSSkeleton",props:{loading:{type:Boolean,default:!1},darkMode:{type:Boolean,default:!1},borderRadius:{type:String,default:"16px"},shimmer:{type:Boolean,default:!0},mode:{type:String,default:"single",validator:E=>["single","multiple"].includes(E)},targetClass:{type:String,default:Ba},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(E){const te=E,$=e.computed(()=>{const O={"dss-skeleton--loading":te.loading,"dss-skeleton--static":!te.shimmer,"dss-skeleton--multiple":te.mode==="multiple","dss-skeleton--dark":te.darkMode};return te.mode==="multiple"&&te.targetClass!==Ba&&(O[`dss-skeleton--target-${te.targetClass}`]=!0),O}),V=e.computed(()=>{const O={};return te.borderRadius&&(O.borderRadius=te.borderRadius),O}),ce=e.computed(()=>{const O={};return te.borderRadius&&(O["--dss-skeleton-border-radius"]=te.borderRadius),te.darkMode?(O["--dss-skeleton-bg"]=te.bgDark||"#322c3f",O["--dss-skeleton-shimmer"]=te.shimmerDark||"#3e3f41",O):(te.bgColor&&(O["--dss-skeleton-bg"]=te.bgColor),te.shimmerColor&&(O["--dss-skeleton-shimmer"]=te.shimmerColor),O)});return(O,L)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",$.value]),style:e.normalizeStyle(ce.value)},[E.loading&&E.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(V.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":E.loading&&E.mode==="single"}])},[e.renderSlot(O.$slots,"default")],2)],6))}},e0={key:0,class:"dss-dnd-column-header"},t0={class:"dss-dnd-column-title"},l0={class:"dss-dnd-column-count"},n0=["data-column"],o0={key:0,class:"dss-dnd-indicator"},a0=["onPointerdown"],s0=["onPointerdown"],r0={class:"dss-dnd-item-content"},i0={class:"dss-dnd-item-default"},c0={key:0,class:"dss-dnd-empty"},u0={name:"DSSDnd"},d0=Object.assign(u0,{props:{items:{type:Array,required:!0},columns:{type:Array,required:!0},columnKey:{type:String,default:"status"},positionKey:{type:String,default:"position"},itemKey:{type:String,default:"id"},options:{type:Object,default:()=>({})}},emits:["move","delete"],setup(E,{emit:te}){const $=E,V=te,ce=e.useSlots(),O=e.computed(()=>!!ce["delete-zone"]),L={columnMinWidth:"280px",columnMaxWidth:"none",columnGap:"12px",indicatorColor:"#7c6bc4",dragGhostOpacity:.75,dragSourceBackground:"#f5f5f5",dragSourceBorder:"#e0e0e0",useHandle:!1,columnBodyMaxHeight:"none",showHeader:!0,unstyled:!1,deleteZoneAlwaysVisible:!1,ColColor:!1},fe=e.computed(()=>({...L,...$.options})),rt=e.computed(()=>({"--dss-dnd-col-min-w":fe.value.columnMinWidth,"--dss-dnd-col-max-w":fe.value.columnMaxWidth,"--dss-dnd-col-gap":fe.value.columnGap,"--dss-dnd-indicator-color":fe.value.indicatorColor,"--dss-dnd-body-max-h":fe.value.columnBodyMaxHeight}));function ee(W){if(!fe.value.ColColor||!W)return{};const G=W.background||W.color;return G?{background:G}:{}}const v=e.ref(null),be=e.ref(null),ke=e.ref(!1),J=e.ref(-1),Y=e.ref(null);let me=null,F=null,ue=null,$e=null,tt=0,mt=0,U="",ze=null;const qe=5,Ve=e.computed(()=>{const W={};for(const G of $.columns)W[G.value]=$.items.filter(Ne=>Ne[$.columnKey]===G.value).sort((Ne,Pe)=>(Ne[$.positionKey]??0)-(Pe[$.positionKey]??0));return W}),Le=e.computed(()=>{const W={},G=!!v.value,Ne=v.value?.[$.itemKey],Pe=be.value,Xe=J.value;for(const Et of $.columns){const Ge=Ve.value[Et.value]||[],Zt=[],Ue=Pe==Et.value;let We=0;for(let Dt=0;Dt<Ge.length;Dt++){const Lt=Ge[Dt],ne=G&&Lt[$.itemKey]===Ne;!ne&&Ue&&Xe===We&&Zt.push({type:"indicator",key:`ind-${We}`}),ne||We++,Zt.push({type:"item",item:Lt,isDragged:ne,key:`item-${Lt[$.itemKey]}`})}Ue&&Xe>=We&&Zt.push({type:"indicator",key:"ind-end"}),W[Et.value]=Zt}return W});function je(W,G){const Pe=(Ve.value[W]||[]).filter(Ge=>Ge[$.itemKey]!==v.value?.[$.itemKey]);if(Pe.length===0)return 1;if(G<=0){const Ge=Pe[0][$.positionKey];return Ge!=null&&Ge>0?Ge/2:.5}if(G>=Pe.length){const Ge=Pe[Pe.length-1][$.positionKey];return(Ge??0)+1}const Xe=Pe[G-1][$.positionKey]??0,Et=Pe[G][$.positionKey]??0;return(Xe+Et)/2}function re(W,G,Ne){ue&&ue.remove();const Pe=W.getBoundingClientRect(),Xe=W.cloneNode(!0);Xe.classList.add("dss-dnd-ghost"),Xe.style.cssText=`
|
|
102
|
+
</svg>`,f=e.ref(null),we=e.ref(null),Ce=e.ref(!1),J=e.ref(!1),X=e.ref(!1),fe=e.ref(""),R=e.ref({}),me=e.ref(!1),_e=e.ref(!1),Je=e.ref(""),pt=e.ref(""),Z=e.ref(null),Fe=e.ref(null),We=e.ref(null),Se=e.ref(null),Le=e.ref(""),Ye=e.ref(!1),ie=e.ref({}),Ge=e.ref(!1),be=e.ref({}),Qe=e.ref(null),ct=e.ref(null),gt=e.ref(!1),ut=e.ref(""),qt=e.ref(null),Zt=e.ref(""),kt=e.ref(""),xt=e.ref(""),Yt=e.ref(null),rt=e.ref(null),Jt=e.ref(null),yt=e.ref(null),ol=e.ref(null),U=e.ref(!1),ke=e.ref(""),W=e.ref({}),G=e.ref(!1),Ne=e.ref("upload"),Ie=e.ref(""),Ue=e.ref(null),Et=e.ref(null),Ke=e.ref([]),Ut=e.ref([]),qe=e.ref(null),Pe=e.ref(!1),Ht=e.ref(""),$t=e.ref(""),oe=e.ref(""),Y=e.ref(""),j=e.ref(""),pe=e.ref(""),xe=e.ref(null),je=e.ref(null),Rt=e.ref(null),jt=e.ref(!1),et=e.ref(null),pl=e.ref(!1),M=e.ref(!1),w=e.ref(null),A=e.ref("p"),se=e.ref(!1),ae=e.ref([]),He=e.ref(null),Ct=e.ref(null),nt=e.ref(null),Re=e.ref(!1),bt=e.ref(0),_t=100,St=e.ref(null),Lt=e.computed(()=>!!T.commentUser),zt=e.computed(()=>({"dss-text-editor-no-border":!T.border,"dss-text-editor-rounded":T.rounded,"dss-text-editor-full-height":T.fullHeight,"dss-comment-overlay-open":Lt.value&&nl.value!==null})),Bt=e.computed(()=>({})),Kt=e.computed(()=>!T.fixedHeight||T.fullHeight?{}:{height:`${1.6*14*T.rows+24+2}px`,resize:"none",overflowY:"auto"}),ql=e.computed(()=>!T.fixedHeight||T.fullHeight?{}:{height:`${1.6*14*T.rows+32}px`,overflowY:"auto"}),jl=e.computed(()=>T.richText&&Ut.value.length>0),El=e.computed(()=>{if(!T.modelValue)return"";if(T.richText){let a=T.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return a=a.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),a=a.replace(/<[^>]+>/g,""),a=a.replace(/ /g," "),a=a.replace(/&/g,"&"),a=a.replace(/</g,"<"),a=a.replace(/>/g,">"),a=a.replace(/"/g,'"'),a=a.replace(/'/g,"'"),a=a.replace(/\s+/g," ").trim(),a}return T.modelValue}),il=e.computed(()=>{const a=El.value.trim();return a?a.split(/\s+/).filter(n=>n.length>0).length:0}),vl=e.computed(()=>El.value.length),dn=e.computed(()=>yt.value!==null&&Ne.value==="upload"&&Zt.value&&Zt.value.startsWith("data:")),wn=e.computed(()=>T.titlePlaceholder||B("textEditor.placeholders.title")),Dl=e.computed(()=>T.descriptionPlaceholder||B("textEditor.placeholders.description")),mn=e.computed(()=>T.placeholder||B("textEditor.placeholders.startTyping")),$l=a=>st&&st[a]!==void 0,zn=a=>{for(let n=a+1;n<T.customToolbarSlots.length;n++)if($l(T.customToolbarSlots[n]))return!0;return!1},Dn=a=>{for(let n=a+1;n<T.customToolbarSlots.length;n++){const s=T.customToolbarSlots[n];if($l(s)&&on(s))return!0}return!1},on=a=>T.customToolbarFloatingMap.hasOwnProperty(a)?T.customToolbarFloatingMap[a]===!0:!0,bl=e.computed(()=>T.customToolbarSlots.some(a=>$l(a)&&on(a))),Fl=e.computed(()=>$l("title-slot")),Kl=e.computed(()=>$l("description-slot")),Hl=a=>{if(!a||a.trim()==="")return"<html></html>";const n=a.trim();return n.startsWith("<html>")&&n.endsWith("</html>")?a:`<html>${a}</html>`},Ml=a=>{if(!a||a.trim()==="")return"";const n=a.replace(/<!--[\s\S]*?-->/g,""),s=n.trim();return s.startsWith("<html>")&&s.endsWith("</html>")?s.slice(6,-7).trim():n},pn=a=>{if(!a)return;const n=document.createTreeWalker(a,NodeFilter.SHOW_COMMENT,null,!1),s=[];let i=n.nextNode();for(;i;)s.push(i),i=n.nextNode();s.forEach(c=>c.remove())},$=a=>{try{const n=String(a.getDate()).padStart(2,"0"),i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][a.getMonth()],c=a.getFullYear();return`${n} ${i} ${c}`}catch{return""}},O=a=>{if(!a||typeof a!="string")return!1;const n=a.trim();if(!n)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(n))return!0;try{const c=B("textEditor.started_conversation");if(c&&n===c)return!0}catch{}const i=n.toLowerCase();return i.includes("started conversation")||i.includes("démarré la conversation")||i==="started conversation"||i==="a démarré la conversation"},D=a=>{const n=a.target.value;he("update:modelValue",n),he("change",n)},ne=()=>{if(!xe.value)return;const a=xe.value;if(a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important"),a.value.trim()===""){const i=a.value;a.value="M";const c=a.scrollHeight;a.value=i,a.style.setProperty("height",`${c}px`,"important"),a.style.setProperty("overflow-y","hidden","important");return}a.offsetHeight;const s=a.scrollHeight;a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important")},Ae=()=>{pl.value=!0,ne()},it=()=>{pl.value=!1,vt()},vt=()=>{if(!xe.value)return;const a=xe.value;a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important");const n=a.value;a.value="M";const s=a.scrollHeight;a.value=n,a.offsetHeight,a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important"),a.style.setProperty("overflow-x","hidden","important"),a.style.setProperty("text-overflow","ellipsis","important"),a.style.setProperty("white-space","nowrap","important")},tt=a=>{const s=a.target.value;pl.value&&ne(),he("update:title",s),he("title-change",s),Rt.value="title",T.richText&&(Pe.value||($t.value=Ht.value,j.value=oe.value,pe.value=Y.value),qe.value&&clearTimeout(qe.value),Pe.value=!0,qe.value=setTimeout(()=>{Pe.value=!1,al()},500))},lt=()=>{if(!je.value)return;const a=je.value;if(a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important"),a.value.trim()===""){const i=a.value;a.value="M";const c=a.scrollHeight;a.value=i,a.style.setProperty("height",`${c}px`,"important"),a.style.setProperty("overflow-y","hidden","important");return}a.offsetHeight;const s=a.scrollHeight;a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important")},kl=()=>{M.value=!0,lt()},Sl=()=>{M.value=!1,Tt()},Tt=()=>{if(!je.value)return;const a=je.value;a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important");const n=a.value;a.value="M";const s=a.scrollHeight;a.value=n,a.offsetHeight,a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important"),a.style.setProperty("overflow-x","hidden","important"),a.style.setProperty("text-overflow","ellipsis","important"),a.style.setProperty("white-space","nowrap","important")},wl=a=>{const s=a.target.value;M.value&<(),he("update:description",s),he("description-change",s),Rt.value="description",T.richText&&(Pe.value||($t.value=Ht.value,j.value=oe.value,pe.value=Y.value),qe.value&&clearTimeout(qe.value),Pe.value=!0,qe.value=setTimeout(()=>{Pe.value=!1,al()},500))},el=()=>{const a=window.getSelection();if(a.rangeCount===0)return null;const n=a.getRangeAt(0);if(n.startContainer.nodeType===1)return{type:"element",element:n.startContainer,offset:n.startOffset};const s=n.cloneRange();return s.selectNodeContents(f.value),s.setEnd(n.startContainer,n.startOffset),{type:"text",start:s.toString().length,end:s.toString().length+n.toString().length}},Vl=a=>{if(!(!a||!f.value))try{const n=window.getSelection(),s=document.createRange();if(a.type==="element"&&a.element)if(f.value.contains(a.element)){s.setStart(a.element,a.offset),s.collapse(!0),n.removeAllRanges(),n.addRange(s);return}else{f.value.focus();return}let i=0;const c=[f.value];let d=null,u=!1,p=!1;for(;!p&&(d=c.pop());)if(d.nodeType===3){const h=i+d.length;!u&&a.start>=i&&a.start<=h&&(s.setStart(d,a.start-i),u=!0),u&&a.end>=i&&a.end<=h&&(s.setEnd(d,a.end-i),p=!0),i=h}else{let h=d.childNodes.length;for(;h--;)c.push(d.childNodes[h])}n.removeAllRanges(),n.addRange(s)}catch{f.value.focus()}},an=()=>{if(!f.value)return;f.value.focus();const a=window.getSelection(),n=document.createRange(),s=c=>{if(c.nodeType===3||c.childNodes.length===0)return c;for(let d=c.childNodes.length-1;d>=0;d--){const u=c.childNodes[d],p=s(u);if(p)return p}return c},i=s(f.value);if(i.nodeType===3)n.setStart(i,i.length),n.setEnd(i,i.length);else if(i.childNodes.length>0){const c=s(i);c&&c.nodeType===3?(n.setStart(c,c.length),n.setEnd(c,c.length)):(n.selectNodeContents(i),n.collapse(!1))}else n.setStart(i,0),n.setEnd(i,0);a.removeAllRanges(),a.addRange(n)},al=(a=!1)=>{if(!f.value)return;const n=f.value.innerHTML,s=T.title||"",i=T.description||"";if(!a&&n===Ht.value&&s===oe.value&&i===Y.value)return;const c={content:$t.value||Ht.value,title:j.value!==void 0?j.value:oe.value,description:pe.value!==void 0?pe.value:Y.value},d=Ke.value.length>0?Ke.value[Ke.value.length-1]:null;let u=!0;d&&(typeof d=="string"?u=c.content!==d:u=c.content!==d.content||c.title!==d.title||c.description!==d.description),u&&(Ke.value.push(c),Ke.value.length>50&&Ke.value.shift(),Ut.value=[]),Ht.value=n,oe.value=s,Y.value=i,$t.value=n,j.value=s,pe.value=i},At=a=>{if(!f.value)return;Pn(),f.value&&pn(f.value);let n=null;f.value&&(f.value.querySelector("p")||(n=el(),xn()));const s=a&&a.inputType&&(a.inputType==="insertText"||a.inputType==="insertCompositionText"||a.inputType==="deleteContentBackward"||a.inputType==="deleteContentForward");s&&w.value&&(w.value=null),J.value=!0;const i=f.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/ |\u00A0/g," "),c=Hl(i);he("update:modelValue",c),he("change",c),Rt.value="editor",Pe.value||($t.value=Ht.value,j.value=oe.value,pe.value=Y.value),qe.value&&clearTimeout(qe.value),Pe.value=!0,qe.value=setTimeout(()=>{Pe.value=!1,al(),Mn(),Cn()},500),e.nextTick(()=>{n&&Vl(n),Pn();const d=["bold","italic","underline"],u=window.getSelection(),p=u.rangeCount>0?u.getRangeAt(0):null,h=p&&p.collapsed;if(d.forEach(k=>{try{if(h&&w.value?.command===k){ie.value[k]=w.value.state;return}if(k==="bold")if(p){const H=p.commonAncestorContainer,z=H.nodeType===3?H.parentElement:H;let V=!1;if(z&&((z.tagName==="STRONG"||z.tagName==="B"||z.closest&&z.closest("strong, b"))&&(V=!0),!V&&z.style&&parseInt(z.style.fontWeight)>=600&&(V=!0),!V))try{const Q=window.getComputedStyle(z);parseInt(Q.fontWeight)>=600&&(V=!0)}catch{}ie.value[k]=V}else ie.value.hasOwnProperty(k)||(ie.value[k]=!1);else if(k==="italic")if(p){const H=p.commonAncestorContainer,z=H.nodeType===3?H.parentElement:H,V=z&&(z.tagName==="EM"||z.tagName==="I"||z.closest&&z.closest("em, i"));ie.value[k]=!!V}else{const H=document.queryCommandState(k);ie.value[k]=H}else{const H=document.queryCommandState(k);ie.value[k]=H}}catch{}}),Ll(),Zl(),en(),Mt(),yn(),Yl("handleRichTextInput"),s&&(a.inputType==="insertText"||a.inputType==="insertCompositionText")){const k=a.data||"";k&&k.length===1&&setTimeout(()=>Cn(k),0),(k===" "||k===`
|
|
103
|
+
`||/[.,;:!?]/.test(k))&&setTimeout(()=>{Mn()},100)}J.value=!1})},Pn=()=>{if(!f.value)return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const n=a.getRangeAt(0),s=n.commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(!i)return;const c=i.closest(".dss-image-wrapper");if(c){const d=c.querySelector("img");if(i!==d&&!d?.contains(i)){const u=n.startContainer.nodeType===3?n.startContainer.parentElement:n.startContainer,p=n.endContainer.nodeType===3?n.endContainer.parentElement:n.endContainer;if(c.contains(u)&&u!==d||c.contains(p)&&p!==d){const h=document.createRange();h.setStartAfter(c),h.collapse(!0),a.removeAllRanges(),a.addRange(h)}}}},xn=()=>{if(!f.value)return;const a=f.value;if(a.querySelector&&a.querySelector("p"))return;const n=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),s=Array.from(a.childNodes);let i=null;s.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===a&&a.removeChild(c);return}i||(i=document.createElement("p"),a.insertBefore(i,c)),i.appendChild(c);return}if(c.nodeType===Node.ELEMENT_NODE){const d=c,u=d.tagName;if(u==="BR"){i=null;return}if(n.has(u)){i=null;return}i||(i=document.createElement("p"),a.insertBefore(i,d)),i.appendChild(d)}})},Zl=()=>{if(f.value&&!jt.value){jt.value=!0;try{f.value.querySelectorAll(".dss-image-wrapper").forEach(i=>{i.querySelector("img")||i.remove()}),f.value.querySelectorAll(".dss-image-no-alt-icon").forEach(i=>{const c=i.parentElement;!c||!c.classList.contains("dss-image-wrapper")?i.remove():c.querySelector("img")||i.remove()}),f.value.querySelectorAll("img").forEach(i=>{let c=i.getAttribute("alt");c===null&&(c=i.alt||"");const d=i.getAttribute("src")||i.src||"";if(c){const k=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),H=c===d||c===k;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||H||H)&&(c="")}i.setAttribute("alt",c),i.setAttribute("data-alt",c);const u=!c||c.trim()==="";let p=i.parentElement;const h=p&&p.classList.contains("dss-image-wrapper");if(h){const k=p.querySelector(".dss-image-no-alt-icon");k&&k.remove()}else{const k=i.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?i.nextElementSibling:null;k&&k.remove()}if(u){h?p.setAttribute("contenteditable","false"):(p=document.createElement("span"),p.className="dss-image-wrapper",p.setAttribute("contenteditable","false"),i.parentNode.insertBefore(p,i),p.appendChild(i));const k=document.createElement("div");k.className="dss-image-no-alt-icon",k.setAttribute("contenteditable","false"),k.innerHTML=te,p.appendChild(k)}else if(h&&p.children.length===1){const k=p.parentNode;k.insertBefore(i,p),k.removeChild(p)}})}finally{jt.value=!1}}},vn=a=>{Mn(),he("blur",a),Bn()},fn=()=>{if(T.disabled||!T.richText||!f.value)return;dl(),qe.value&&(clearTimeout(qe.value),qe.value=null),Pe.value&&(al(),Pe.value=!1);const a=Rt.value==="title",n=Rt.value==="description",s=Rt.value==="editor";if(Ke.value.length===0){a&&xe.value?xe.value.focus():n&&je.value?je.value.focus():f.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{At()});return}const i={content:f.value.innerHTML,title:T.title||"",description:T.description||""};Ut.value.push(i);const c=Ke.value.pop();if(c!==void 0){J.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",p=typeof c=="object"&&c.description||"";f.value.innerHTML=d,Ht.value=d,oe.value=u,Y.value=p,$t.value=d,j.value=u,pe.value=p,e.nextTick(()=>{Ll(),sl(),tn(),Mt();const h=Hl(d);he("update:modelValue",h),he("update:title",u),he("update:description",p),he("change",h),he("title-change",u),he("description-change",p),J.value=!1,e.nextTick(()=>{setTimeout(()=>{if(a){if(xe.value){xe.value.focus();const k=u.length;xe.value.setSelectionRange&&xe.value.setSelectionRange(k,k),ne()}}else if(n){if(je.value){je.value.focus();const k=p.length;je.value.setSelectionRange(k,k)}}else if(s)an();else if(xe.value&&document.activeElement===xe.value){const k=u.length;xe.value.setSelectionRange&&xe.value.setSelectionRange(k,k),ne()}else if(je.value&&document.activeElement===je.value){const k=p.length;je.value.setSelectionRange(k,k)}else f.value&&an()},10)})})}},Hn=()=>{if(T.disabled||!T.richText||!f.value)return;dl();const a=Rt.value==="title",n=Rt.value==="description",s=Rt.value==="editor";if(Ut.value.length===0){a&&xe.value?xe.value.focus():n&&je.value?je.value.focus():f.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{At()});return}const i={content:f.value.innerHTML,title:T.title||"",description:T.description||""};Ke.value.push(i);const c=Ut.value.pop();if(c!==void 0){J.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",p=typeof c=="object"&&c.description||"";f.value.innerHTML=d,Ht.value=d,oe.value=u,Y.value=p,$t.value=d,j.value=u,pe.value=p,e.nextTick(()=>{Ll(),sl(),tn(),Mt();const h=Hl(d);he("update:modelValue",h),he("update:title",u),he("update:description",p),he("change",h),he("title-change",u),he("description-change",p),J.value=!1,e.nextTick(()=>{setTimeout(()=>{if(a){if(xe.value){xe.value.focus();const k=u.length;xe.value.setSelectionRange&&xe.value.setSelectionRange(k,k),ne()}}else if(n){if(je.value){je.value.focus();const k=p.length;je.value.setSelectionRange(k,k)}}else if(s)an();else if(xe.value&&document.activeElement===xe.value){const k=u.length;xe.value.setSelectionRange&&xe.value.setSelectionRange(k,k),ne()}else if(je.value&&document.activeElement===je.value){const k=p.length;je.value.setSelectionRange(k,k)}else f.value&&an()},10)})})}},En=()=>{if(!f.value)return;f.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{const c=i.style.fontWeight;if(c==="normal"||c==="400"){const d=document.createDocumentFragment();for(;i.firstChild;)d.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(d,i)}}),f.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{if(parseInt(i.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";i.firstChild;)d.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(d,i)}}),f.value.querySelectorAll("b, strong").forEach(i=>{i.style.fontWeight="600"})},en=()=>{if(!f.value)return;f.value.querySelectorAll("i, em").forEach(n=>{n.style.fontStyle="italic"})},ul=()=>{const a=window.getSelection();if(!a||a.rangeCount===0)return!1;const n=a.getRangeAt(0);let s=!1;if(n.collapsed){const i=n.startContainer;let c=i.nodeType===3?i.parentElement:i;for(;c&&c!==f.value;){if(c.tagName==="EM"||c.tagName==="I"){s=!0;break}if(c.style&&c.style.fontStyle==="italic"){s=!0;break}c=c.parentElement}}else{const i=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(i){const c=document.createTreeWalker(i,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==f.value;){if(u.tagName==="EM"||u.tagName==="I"){s=!0;break}if(u.style&&u.style.fontStyle==="italic"){s=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="EM"||u.tagName==="I"){s=!0;break}if(u.style&&u.style.fontStyle==="italic"){s=!0;break}}if(s)break}}}if(s)return document.execCommand("italic",!1),e.nextTick(()=>{en()}),!1;if(n.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{en()});else try{const i=n.extractContents(),c=document.createElement("em");c.style.fontStyle="italic",c.appendChild(i),n.insertNode(c),n.setStartAfter(c),n.collapse(!0),a.removeAllRanges(),a.addRange(n),e.nextTick(()=>{en()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{en()})}return!0},On=()=>{const a=window.getSelection();if(!a||a.rangeCount===0)return!1;const n=a.getRangeAt(0);let s=!1;if(n.collapsed){const i=n.startContainer;let c=i.nodeType===3?i.parentElement:i;for(;c&&c!==f.value;){if(c.tagName==="STRONG"||c.tagName==="B"){s=!0;break}if(c.style&&parseInt(c.style.fontWeight)>=600){s=!0;break}c=c.parentElement}}else{const i=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(i){const c=document.createTreeWalker(i,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==f.value;){if(u.tagName==="STRONG"||u.tagName==="B"){s=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){s=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="STRONG"||u.tagName==="B"){s=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){s=!0;break}}if(s)break}}}if(s)return document.execCommand("bold",!1),e.nextTick(()=>{En()}),!1;if(n.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0),d=c.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==f.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const p=u.style.fontWeight;if(p==="normal"||p==="400"){const h=document.createElement("b");h.style.fontWeight="600";const k=document.createDocumentFragment();for(;u.firstChild;)k.appendChild(u.firstChild);h.appendChild(k),u.parentNode&&u.parentNode.replaceChild(h,u),c.setStart(h,0),c.collapse(!0),i.removeAllRanges(),i.addRange(c);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===f.value){const p=document.createElement("b");p.style.fontWeight="600",p.innerHTML="<br>",c.insertNode(p),c.setStart(p,0),c.collapse(!0),i.removeAllRanges(),i.addRange(c)}}En()});else try{const i=n.extractContents(),c=document.createElement("b");c.style.fontWeight="600",c.appendChild(i),n.insertNode(c),n.setStartAfter(c),n.collapse(!0),a.removeAllRanges(),a.addRange(n),e.nextTick(()=>{En()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{En()})}return!0},Il=(a,n=null)=>{if(T.disabled||!T.richText||!f.value)return;Pe.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),al(),Pe.value=!1):al(),dl(),f.value.focus();const s=window.getSelection();let i=null;if(s&&s.rangeCount>0){const d=s.getRangeAt(0);!d.collapsed&&Nn(d)&&(i=el())}if(a==="createLink"&&n){const d=window.getSelection();if(d.rangeCount>0){const u=d.getRangeAt(0);if(u.collapsed)try{u.expand("word")}catch{const h=document.createTextNode(n);u.insertNode(h),u.selectNodeContents(h)}}}if(a==="bold"){const d=On();ie.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(w.value={command:"bold",state:d}),e.nextTick(()=>{i&&(Vl(i),e.nextTick(()=>{const p=ll("bold");ie.value.bold=p})),At(),sl(),Mt()});return}if(a==="italic"){const d=ul();ie.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(w.value={command:"italic",state:d}),e.nextTick(()=>{i&&(Vl(i),e.nextTick(()=>{const p=ll("italic");ie.value.italic=p})),At(),en(),sl(),Mt()});return}let c=!1;try{c=document.execCommand(a,!1,n)}catch{}e.nextTick(()=>{if(i&&Vl(i),["bold","italic","underline"].includes(a))try{if(a==="bold")i&&e.nextTick(()=>{const u=ll("bold");ie.value.bold=u});else if(a==="italic")if(i)e.nextTick(()=>{const u=ll("italic");ie.value.italic=u});else{const u=document.queryCommandState(a);ie.value[a]=u}else{const u=document.queryCommandState(a);ie.value[a]=u}}catch{ie.value.hasOwnProperty(a)?ie.value[a]=!ie.value[a]:ie.value[a]=!0}if(a==="createLink"&&n){const u=window.getSelection();if(u.rangeCount>0){const h=u.getRangeAt(0),k=h.commonAncestorContainer.nodeType===1?h.commonAncestorContainer.closest("a"):h.commonAncestorContainer.parentElement?.closest("a");k&&(!k.getAttribute("href")||k.getAttribute("href")==="")&&k.setAttribute("href",n)}f.value.querySelectorAll("a").forEach(h=>{const k=h.getAttribute("href");(!k||k===""||k==="#")&&h.setAttribute("href",n)})}At(),sl(),Mt()})},ll=(a,n=null)=>{if(T.disabled||!f.value)return!1;try{if(a==="formatBlock"&&n){const i=document.queryCommandValue("formatBlock");if(n==="<blockquote>"){const c=i.toLowerCase();if(c==="blockquote"||c==="<blockquote>")return!0;const d=window.getSelection();if(d.rangeCount>0){const p=d.getRangeAt(0).commonAncestorContainer;return!!(p.nodeType===1?p.tagName==="BLOCKQUOTE"?p:p.closest("blockquote"):p.parentElement?.closest("blockquote"))}}return i===n||i.toLowerCase()===n.toLowerCase()}if(["bold","italic","underline"].includes(a))try{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0);if(a==="bold"){let u=!1;if(c.collapsed){const p=c.commonAncestorContainer,h=p.nodeType===3?p.parentElement:p;if(h&&((h.tagName==="STRONG"||h.tagName==="B"||h.closest&&h.closest("strong, b"))&&(u=!0),!u&&h.style&&parseInt(h.style.fontWeight)>=600&&(u=!0),!u))try{const k=window.getComputedStyle(h);parseInt(k.fontWeight)>=600&&(u=!0)}catch{}return ie.value.hasOwnProperty(a)?ie.value[a]:(ie.value[a]=u,u)}else{const p=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let h=!1;if(p){const k=document.createTreeWalker(p,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let H;for(;H=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(H))){if(H.nodeType===3){if(!(H.textContent||"").trim())continue;h=!0;let V=H.parentElement;for(;V&&V!==f.value;){if(V.tagName==="STRONG"||V.tagName==="B"){u=!0;break}if(V.style&&parseInt(V.style.fontWeight)>=600){u=!0;break}V=V.parentElement}}else if(H.nodeType===1){const z=H;if(z.tagName==="STRONG"||z.tagName==="B"){u=!0;break}if(z.style&&parseInt(z.style.fontWeight)>=600){u=!0;break}}if(u)break}}return ie.value[a]=u&&h,u&&h}}if(a==="italic"){let u=!1;if(c.collapsed){const p=c.commonAncestorContainer,h=p.nodeType===3?p.parentElement:p;if(h&&((h.tagName==="EM"||h.tagName==="I"||h.closest&&h.closest("em, i"))&&(u=!0),!u&&h.style&&h.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(h).fontStyle==="italic"&&(u=!0)}catch{}return ie.value.hasOwnProperty(a)?ie.value[a]:(ie.value[a]=u,u)}else{const p=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let h=!1;if(p){const k=document.createTreeWalker(p,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let H;for(;H=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(H))){if(H.nodeType===3){if(!(H.textContent||"").trim())continue;h=!0;let V=H.parentElement;for(;V&&V!==f.value;){if(V.tagName==="EM"||V.tagName==="I"){u=!0;break}if(V.style&&V.style.fontStyle==="italic"){u=!0;break}V=V.parentElement}}else if(H.nodeType===1){const z=H;if(z.tagName==="EM"||z.tagName==="I"){u=!0;break}if(z.style&&z.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return ie.value[a]=u&&h,u&&h}}const d=document.queryCommandState(a);return c.collapsed&&ie.value.hasOwnProperty(a)?ie.value[a]:(ie.value[a]=d,d)}return ie.value.hasOwnProperty(a)?ie.value[a]:!1}catch{return ie.value.hasOwnProperty(a)?ie.value[a]:!1}try{return document.queryCommandState(a)}catch{return!1}}catch{return!1}},Wn=a=>{T.disabled||!T.richText||(we.value=we.value===a?null:a,a==="askAi"&&(ct.value=null))},dl=()=>{we.value=null,Ue.value=null},wt=a=>{Il("formatBlock",a),dl()},$e=a=>{if(!a||!f.value)return a;const n=ge=>{let Me=ge.nodeType===Node.TEXT_NODE?ge.parentElement:ge;for(;Me&&Me!==f.value;){const ft=Me.tagName;if(ft==="P"){const xl=Me.parentElement;if(xl===f.value||xl.tagName==="BLOCKQUOTE")return Me}if(ft==="BLOCKQUOTE")break;Me=Me.parentElement}return null},s=n(a.startContainer),i=n(a.endContainer);if(!s||!i)return a;const c=[],d=document.createTreeWalker(f.value,NodeFilter.SHOW_ELEMENT,{acceptNode:ge=>{const Me=ge.tagName;if(Me==="P"){const ft=ge.parentElement;if(ft===f.value||ft.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return Me==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const p=c.indexOf(s),h=c.indexOf(i);if(p===-1||h===-1)return a;const k=Math.min(p,h),H=Math.max(p,h),z=c.slice(k,H+1);if(z.length===0)return a;const V=z[0],Q=z[z.length-1],ee=document.createRange();return ee.setStartBefore(V),ee.setEndAfter(Q),ee},Sn=()=>{if(T.disabled||!T.richText||!f.value)return;Pe.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),al(),Pe.value=!1):al(),dl(),f.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;let n=a.getRangeAt(0);!n.collapsed&&Nn(n)&&(n=$e(n),a.removeAllRanges(),a.addRange(n));let s=null;!n.collapsed&&Nn(n)&&(s=el());const i=n.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&f.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(h=>{if(h.nodeType===Node.ELEMENT_NODE)if(h.tagName==="P"||h.tagName==="DIV")u.insertBefore(h,c);else{const k=document.createElement("p");k.appendChild(h.cloneNode(!0)),u.insertBefore(k,c)}else if(h.nodeType===Node.TEXT_NODE&&h.textContent.trim()){const k=document.createElement("p");k.appendChild(h.cloneNode(!0)),u.insertBefore(k,c)}}),c.remove()}}else if(n.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),p=n.extractContents();u.appendChild(p),n.insertNode(u);const h=[],k=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:V=>V.parentNode===u&&V.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let H;for(;H=k.nextNode();)h.push(H);if(h.forEach(V=>{const Q=document.createElement("p");V.parentNode.insertBefore(Q,V),Q.appendChild(V)}),u.querySelectorAll("p, div").forEach(V=>{V.textContent.trim()===""&&!V.querySelector("img")&&(V.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const V=document.createElement("p");V.innerHTML="<br>",u.appendChild(V)}}e.nextTick(()=>{s&&Vl(s),tn(),At(),Mt()})},dt=()=>{if(!f.value)return;const a=window.getSelection();if(a.rangeCount===0)return;const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!i||!f.value.contains(i))return;const c=H=>{if(!H)return!1;const z=H.textContent||"",Q=(H.innerHTML||"").trim();return z.trim()===""||Q===""||Q==="<br>"||Q==="<br/>"||Q==="<p></p>"||Q==="<p><br></p>"||Q==="<p><br/></p>"||Q==="<p> </p>"||Q==="<p><br> </p>"||Q==="<div></div>"||Q==="<div><br></div>"||Q==="<div><br/></div>"};let d=null;for(s.nodeType===3?d=s.parentElement:s.tagName==="P"||s.tagName==="DIV"?d=s:d=s.closest("p, div"),d&&i.contains(d)&&c(d)&&d.remove();i.lastChild;){const H=i.lastChild;if(H.nodeType===1&&H.tagName==="BR")H.remove();else if(H.nodeType===3)if((H.textContent||"").trim()==="")H.remove();else break;else break}if(i.children.length>0)for(let H=i.children.length-1;H>=0;H--){const z=i.children[H];if((z.tagName==="P"||z.tagName==="DIV")&&c(z))z.remove();else break}let u=i.innerHTML;const p=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==p&&(i.innerHTML=u);const h=document.createElement("p");h.innerHTML="<br>",i.parentNode?i.nextSibling?i.parentNode.insertBefore(h,i.nextSibling):i.parentNode.appendChild(h):f.value&&f.value.appendChild(h);const k=document.createRange();k.selectNodeContents(h),k.collapse(!0),a.removeAllRanges(),a.addRange(k),e.nextTick(()=>{tn(),At()})},sl=()=>{if(!f.value){Ce.value=!1;return}try{const a=window.getSelection();if(a.rangeCount>0){const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");Ce.value=!!i}else Ce.value=!1}catch{Ce.value=!1}},ot=()=>{if(!f.value)return;const a=window.getSelection();a&&a.rangeCount>0&&a.getRangeAt(0),Se.value=el();const n=window.getSelection();let s="";n.rangeCount>0&&(s=n.getRangeAt(0).toString()),Je.value="",pt.value=s,Le.value="",We.value=null,_e.value=!0,dl(),e.nextTick(()=>{Z.value&&Z.value.focus()})},mt=()=>{if(!f.value)return;Pe.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),al(),Pe.value=!1):al();const a=window.getSelection();let n=null;if(a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer;n=i.nodeType===1?i.closest("a"):i.parentElement?.closest("a")}if(!n&&We.value&&(n=We.value),n&&n.parentNode){const s=document.createDocumentFragment();for(;n.firstChild;)s.appendChild(n.firstChild);if(n.parentNode.replaceChild(s,n),s.firstChild){const i=document.createRange();i.setStartBefore(s.firstChild),i.setEndAfter(s.lastChild||s.firstChild),a.removeAllRanges(),a.addRange(i),document.execCommand("removeFormat",!1),i.collapse(!1),a.removeAllRanges(),a.addRange(i)}We.value=null}else Il("unlink");Ce.value=!1,dl(),e.nextTick(()=>{At(),sl()})},ce=()=>{T.disabled||!T.richText||f.value&&(Pe.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),al(),Pe.value=!1):al(),dl(),f.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Ll(),At(),Mt()}))},tl=()=>{T.disabled||!T.richText||f.value&&(Pe.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),al(),Pe.value=!1):al(),dl(),f.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Ll(),At(),Mt()}))},Oe=a=>{const n=a.parentElement;if(!n||n.tagName!=="OL")return null;let s=0,i=a.previousElementSibling;for(;i;)i.tagName==="LI"&&s++,i=i.previousElementSibling;return s+1},Ll=()=>{if(!f.value)return;f.value.querySelectorAll("li > ol").forEach(n=>{const s=n.parentElement;if(s&&s.tagName==="LI"){const i=Oe(s);i!==null&&Array.from(n.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(i))})}})},sn=()=>{if(T.disabled||!T.richText||!f.value)return;dl(),f.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;const n=a.getRangeAt(0),s=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("indent",!1),e.nextTick(()=>{Ll(),At()});return}const i=s.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const c=s.previousElementSibling;if(c&&c.tagName==="LI"){const d=i.tagName.toLowerCase();let u=c.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),c.appendChild(u));const p=Oe(c);u.appendChild(s),p!==null&&i.tagName==="OL"&&s.setAttribute("data-parent-num",String(p)),Ll();const h=document.createRange();h.selectNodeContents(s),h.collapse(!1),a.removeAllRanges(),a.addRange(h),e.nextTick(()=>{At(),Mt()})}else document.execCommand("indent",!1),e.nextTick(()=>{Ll(),At(),Mt()})},Tl=()=>{if(T.disabled||!T.richText||!f.value)return;dl(),f.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;const n=a.getRangeAt(0),s=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("outdent",!1),e.nextTick(()=>{Ll(),At()});return}const i=s.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const c=i.parentElement;if(c&&c.tagName==="LI"){const d=c.parentElement;if(d&&(d.tagName==="OL"||d.tagName==="UL")){i.tagName==="OL"&&s.removeAttribute("data-parent-num"),d.insertBefore(s,c.nextSibling),i.children.length===0&&i.remove(),Ll();const u=document.createRange();u.selectNodeContents(s),u.collapse(!1),a.removeAllRanges(),a.addRange(u),e.nextTick(()=>{At(),Mt()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Ll(),At(),Mt()})},nl=e.ref(null),zl=e.ref(null),y=e.ref({}),g=e.ref(""),x=e.ref(null),q=e.ref("");e.ref("");const ue=e.ref(null);e.ref("");const at=e.ref([]),Xt=e.ref(!1),Cl=e.ref(!1),Pl=a=>{if(!a)return"";const n=a.cloneRange(),s=document.createElement("div");return s.appendChild(n.cloneContents()),s.innerHTML},Ul=()=>{if(!T.commentUser||T.disabled||!T.richText||!f.value)return;if(nl.value!==null){nl.value=null,g.value="",q.value="",ue.value=null,at.value=[],$n(!0);return}dl(),f.value.focus();const a=window.getSelection();if(!a||a.rangeCount===0)return;const n=a.getRangeAt(0);if(n.collapsed||!Nn(n))return;q.value=Pl(n)||"",ue.value=el();const s=n.getBoundingClientRect(),i=f.value.parentElement;if(!i)return;const c=i.getBoundingClientRect(),d=s.bottom-c.top,p=Math.max(d+8,0);y.value={top:`${p}px`,bottom:"auto"},nl.value=Date.now(),e.nextTick(()=>{if(g.value="",x.value){const k=x.value;k.style.height="auto",k.style.height=`${k.scrollHeight}px`,k.focus()}const h=i.querySelector(".dss-comment-overlay");if(h&&i){const k=i.querySelector(".dss-text-editor-footer");if(k){const H=i.getBoundingClientRect(),z=h.getBoundingClientRect(),V=k.getBoundingClientRect(),Q=z.bottom-H.top,ee=V.top-H.top,ge=8;if(Q>ee-ge){const Me=V.height;y.value={bottom:`${Me+ge}px`,top:"auto"}}else y.value={top:`${p}px`,bottom:"auto"}}}})},hn=()=>{if(!g.value.trim())return;const a=g.value.trim(),n=new Date,s={text:a,selectionText:q.value,selectionRange:ue.value,commentId:nl.value,user:T.commentUser||null,createdAt:n.toISOString()};at.value=[...at.value,s],he("comment-submitted",s),Xo(s),ue.value&&!So(ue.value)&&Vn(nl.value,ue.value),g.value="",e.nextTick(()=>{if(x.value){const i=x.value;i.style.height="auto",i.style.height=`${i.scrollHeight}px`,i.focus()}Yl("sendComment")})},uo=(a,n)=>{if(!(!T.commentUser||!a.user||a.user.id!==T.commentUser.id)){if(at.value=at.value.filter((s,i)=>i!==n),nl.value!==null&&f.value){const s=String(nl.value),i=f.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`);if(i&&at.value.length>0){const c=[],d=new Set;at.value.forEach(u=>{u.user&&u.user.id&&!d.has(u.user.id)&&(d.add(u.user.id),c.push(u.user))}),c.length>0?i.setAttribute("data-comment-user",JSON.stringify(c[0])):i.removeAttribute("data-comment-user"),c.length>1?i.setAttribute("data-comment-user-2",JSON.stringify(c[1])):i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count",String(at.value.length))}else i&&at.value.length===0&&(i.removeAttribute("data-comment-user"),i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count","0"))}if(he("comment-deleted",{comment:a,index:n,commentId:nl.value}),T.comments&&Array.isArray(T.comments)){const s=T.comments.filter(i=>!(i.commentId===a.commentId&&i.text===a.text&&i.user?.id===a.user?.id));he("update:comments",s)}e.nextTick(()=>{Yl("deleteComment")})}},So=a=>{if(!a||!f.value)return!1;try{const n=Vo(a);if(!n)return!1;const s=n.commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(i)return!!i.closest("[data-comment], [data-fake-comment]")}catch{}return!1},Vo=a=>{if(!a||!f.value)return null;try{const n=document.createRange();if(a.type==="element"&&a.element)return f.value.contains(a.element)?(n.setStart(a.element,a.offset),n.collapse(!0),n):null;let s=0;const i=[f.value];let c=null,d=!1,u=!1;for(;!u&&(c=i.pop());)if(c.nodeType===3){const p=s+c.length;!d&&a.start>=s&&a.start<=p&&(n.setStart(c,a.start-s),d=!0),d&&a.end>=s&&a.end<=p&&(n.setEnd(c,a.end-s),u=!0),s=p}else{let p=c.childNodes.length;for(;p--;)i.push(c.childNodes[p])}return d?n:null}catch{return null}},Vn=(a,n)=>{if(!(!a||!n||!f.value))try{const s=Vo(n);if(!s||s.collapsed)return;const i=s.commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c){const p=c.closest("[data-comment], [data-fake-comment]");if(p){p.getAttribute("data-comment")!==String(a)&&p.getAttribute("data-fake-comment")!==String(a)&&p.setAttribute("data-comment",String(a));return}}const d=document.createElement("span");d.setAttribute("data-comment",String(a));try{const p=s.startContainer,h=s.endContainer,k=s.startOffset,H=s.endOffset,z=p.nodeType===3?p.parentNode:p,V=h.nodeType===3?h.parentNode:h;if(z===V&&k===0&&H===(h.nodeType===3?h.length:V.childNodes.length)&&(z.tagName==="P"||z.tagName==="DIV"||z.tagName==="H1"||z.tagName==="H2"||z.tagName==="H3"||z.tagName==="H4"||z.tagName==="H5"||z.tagName==="H6")){const ee=s.extractContents();d.appendChild(ee),s.insertNode(d)}else s.surroundContents(d)}catch{const h=s.extractContents();d.appendChild(h),s.insertNode(d)}const u=f.value.querySelector(`[data-comment="${String(a)}"]`);e.nextTick(()=>{Yl("wrapSelectionWithCommentMarker"),At()})}catch{}},Xo=a=>{if(!a||!a.commentId)return;const n=Array.isArray(T.comments)?[...T.comments]:[],s=typeof a.commentId=="string"&&a.commentId.startsWith("comment-")?Date.now():Number(a.commentId)||a.commentId;let i=n.findIndex(d=>typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)===Number(s)||d.conversation_id===s);const c={text:a.text,user:a.user,createdAt:a.createdAt,created_at:a.createdAt,updated_at:a.createdAt};if(i>=0){const d=n[i];if(d.conversation||(d.conversation=[]),d.conversation.push(c),d.updated_at=a.createdAt,!d.article_id&&n.length>0){const u=n.find(p=>p.article_id);u&&(d.article_id=u.article_id)}}else{const d=a.selectionRange,u=n.length>0&&n.find(h=>h.article_id)?.article_id||null,p={conversation_id:s,article_id:u,selection_range:d?{start:d.start||0,end:d.end||0,type:d.type||"text"}:null,selection_text:a.selectionText||"",conversation:[c],created_by_user:a.user,created_at:a.createdAt,updated_at:a.createdAt,status:"active"};n.push(p)}Xt.value=!0,he("update:comments",n)},Yo=(a,n=[])=>{if(!T.commentUser||T.disabled||!T.richText||!f.value)return;const s=f.value;let i=null;try{i=s.querySelector(a)}catch{return}if(!i)return;dl(),s.focus();const c=document.createRange();c.selectNodeContents(i);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),q.value=i.innerHTML||"",ue.value=el();const u=c.getBoundingClientRect(),p=s.parentElement;if(p){const H=p.getBoundingClientRect(),z=u.bottom-H.top,Q=Math.max(z+8,0);y.value={top:`${Q}px`,bottom:"auto"}}const h=i.getAttribute("data-comment")||i.getAttribute("data-fake-comment");let k=[];if(h&&T.comments&&Array.isArray(T.comments)){const H=T.comments.find(z=>String(z.conversation_id)===String(h));if(H&&H.conversation&&Array.isArray(H.conversation)){const z=H.conversation.map(V=>({id:V.id||V.commentary_id,commentary_id:V.id||V.commentary_id,conversation_id:H.id||H.conversation_id,text:V.text,user:V.user,createdAt:V.created_at||V.createdAt,updated_at:V.updated_at||V.updatedAt}));k.push(...z)}}k.length===0&&Array.isArray(n)&&n.length>0&&(k=n.slice()),k.sort((H,z)=>{const V=ge=>{if(!ge)return 0;const Me=new Date(ge).getTime();return isNaN(Me)?0:Me},Q=V(H.createdAt),ee=V(z.createdAt);return Q===ee?0:Q-ee}),at.value=k,$n(!0),nl.value=h||null,i&&(zl.value=i,i.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(g.value="",x.value){const H=x.value;H.style.height="auto",H.style.height=`${H.scrollHeight}px`,H.focus()}if(p){const H=p.querySelector(".dss-comment-overlay");if(H){const z=p.querySelector(".dss-text-editor-footer");if(z){const V=p.getBoundingClientRect(),Q=H.getBoundingClientRect(),ee=z.getBoundingClientRect(),ge=Q.bottom-V.top,Me=ee.top-V.top,ft=8;if(ge>Me-ft){const xl=ee.height;y.value={bottom:`${xl+ft}px`,top:"auto"}}}}}Yl("openCommentOverlayForSelector")})},mo=e.ref(null),po=e.ref(0),jo=a=>{if(!(T.disabled||!T.richText)){if(a.key==="Escape"){const n=window.getSelection();if(n.rangeCount>0){const i=n.getRangeAt(0).commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){a.preventDefault();let u=null;i.nodeType===3?u=i.parentElement:i.tagName==="P"||i.tagName==="DIV"?u=i:u=i.closest("p, div");const p=document.createElement("p");p.innerHTML="<br>",u&&c.contains(u)&&u.nextSibling?c.insertBefore(p,u.nextSibling):c.appendChild(p),setTimeout(()=>{dt()},50);return}}}if(a.key.length===1||a.key==="Enter"){const n=window.getSelection();if(n&&n.rangeCount>0){const s=n.getRangeAt(0),i=s.commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c){const d=c.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(c!==u&&!u?.contains(c)){const p=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,h=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.contains(p)&&p!==u||d.contains(h)&&h!==u){a.preventDefault();const k=document.createRange();k.setStartAfter(d),k.collapse(!0),n.removeAllRanges(),n.addRange(k);return}}}}}}if(a.key==="Backspace"||a.key==="Delete"){const n=window.getSelection();if(n.rangeCount>0){const s=n.getRangeAt(0);let i=null,c=null;if(s.collapsed)if(a.key==="Backspace"){const d=s.startContainer;let u=d;d.nodeType===3&&(s.startOffset===0?u=d.previousSibling||d.parentNode:u=d.parentNode);const p=u.previousSibling;p&&(p.classList&&p.classList.contains("dss-image-wrapper")?c=p:p.tagName==="IMG"&&(i=p,c=i.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(i=c.querySelector("img")))}else{const d=s.startContainer;let u=d;d.nodeType===3&&(s.startOffset===d.length?u=d.nextSibling||d.parentNode:u=d.parentNode);const p=u.nextSibling;p&&(p.classList&&p.classList.contains("dss-image-wrapper")?c=p:p.tagName==="IMG"&&(i=p,c=i.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(i=c.querySelector("img")))}else{const d=s.commonAncestorContainer,u=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,p=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.nodeType===1&&d.tagName==="IMG"?(i=d,c=i.closest(".dss-image-wrapper")):(i=d.querySelector("img"),i&&(c=i.closest(".dss-image-wrapper"))),c){const h=c.contains(u)||u===c,k=c.contains(p)||p===c,z=s.cloneContents().textContent?.trim()||"",V=c.textContent?.trim()||"";(!h||!k||z.length>V.length)&&(c=null,i=null)}}if(c){a.preventDefault(),a.stopPropagation();const d=c.parentNode;if(d){const u=document.createTextNode("");d.insertBefore(u,c),c.remove();const p=document.createRange();p.setStartAfter(u),p.collapse(!0),n.removeAllRanges(),n.addRange(p),e.nextTick(()=>{At()});return}}}}if(a.key==="Tab"){a.preventDefault(),a.shiftKey?Tl():sn();return}if(a.key==="Enter"){const n=window.getSelection();if(n.rangeCount>0){const s=n.getRangeAt(0);if(s.collapsed){const u=s.startContainer,p=h=>{if(!h)return!1;let k=h.previousSibling;for(;k;){if(k.classList&&k.classList.contains("dss-image-wrapper")||k.tagName==="IMG"||k.querySelector&&k.querySelector(".dss-image-wrapper")||k.querySelector&&k.querySelector("img"))return!0;k=k.previousSibling}const H=h.parentElement;return H&&H!==f.value?p(H):!1};if(u.nodeType===3){const h=u.parentElement;if(h&&(p(h)||p(u))){const k=h.closest("p, div");if(k&&k!==f.value){a.preventDefault(),a.stopPropagation();let H=null;const z=s.startOffset;z<u.length&&(H=u.splitText(z));const V=document.createElement("p");if(H?V.appendChild(H):V.innerHTML="<br>",u.length===0){const ee=u.parentElement;ee&&(ee.removeChild(u),ee.childNodes.length===0&&ee.appendChild(document.createElement("br")))}k.nextSibling?k.parentNode.insertBefore(V,k.nextSibling):k.parentNode.appendChild(V);const Q=document.createRange();H?Q.setStart(H,0):Q.setStart(V,0),Q.collapse(!0),n.removeAllRanges(),n.addRange(Q),e.nextTick(()=>{At()});return}}}}const i=s.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){let u=null;i.nodeType===3?u=i.parentElement:i.tagName==="P"||i.tagName==="DIV"?u=i:u=i.closest("p, div");const p=ee=>{if(!ee)return!1;const ge=ee.textContent||"",ft=(ee.innerHTML||"").trim(),xl=ft.replace(/<br\s*\/?>/gi,"").trim();return ge.trim()===""||ft===""||xl===""||ft==="<br>"||ft==="<br/>"||ft==="<p></p>"||ft==="<p><br></p>"||ft==="<p><br/></p>"||ft==="<p> </p>"||ft==="<p><br> </p>"||ft==="<div></div>"||ft==="<div><br></div>"||ft==="<div><br/></div>"},h=c.lastChild,k=h&&h.nodeType===1&&h.tagName==="BR",H=s.startContainer,z=H.nodeType===3?H.parentElement:H,V=z===c||z&&z.parentElement===c;if(u&&p(u)||k&&V){a.preventDefault(),setTimeout(()=>{dt()},50);return}}}}if(a.key===" "){const n=Date.now(),s=n-po.value;if(mo.value===" "&&s<300){const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0),d=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer.closest("li"):c.commonAncestorContainer.parentElement?.closest("li");if(d){const u=c.startContainer.textContent?.substring(0,c.startOffset)||"";if((d.textContent||"").indexOf(u.trim())<=10||u.trim().length<=2){a.preventDefault(),sn();return}}}}mo.value=" ",po.value=n}else mo.value=a.key}},qn=a=>{if(T.disabled||!T.richText)return;a.preventDefault();let n=a.clipboardData.getData("text/html"),s=a.clipboardData.getData("text/plain");n&&(n=n.replace(/<!--[\s\S]*?-->/g,"")),s&&(s=s.replace(/<!--[\s\S]*?-->/g,"")),al();const i=window.getSelection();let c=null;if(i&&i.rangeCount>0){let p=i.getRangeAt(0).commonAncestorContainer;p.nodeType===3&&(p=p.parentNode),c=p.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const d=u=>{const h=new DOMParser().parseFromString(u,"text/html");let k=f.value.querySelector("h1")?1:0;if(h.querySelectorAll("h1").forEach(z=>{if(k>0){const V=h.createElement("p");V.innerHTML=z.innerHTML,z.parentNode.replaceChild(V,z)}else k++}),c){const z=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],V=Array.from(h.body.children).filter(Q=>z.includes(Q.tagName));if(V.length===1){const Q=V[0].tagName,ee=c.tagName,ge=c.textContent.trim()===""&&!c.querySelector("img");let Me=!1;if(["H1","H2","H3","H4","H5","H6"].includes(ee)?Me=!0:ge||(Q===ee||Q==="P")&&(Me=!0),Me)return V[0].innerHTML.trim()}}return h.body.innerHTML.trim()};if(n){const u=d(n);document.execCommand("insertHTML",!1,u)}else if(s)if(/<[a-z][\s\S]*>/i.test(s)){const p=d(s);document.execCommand("insertHTML",!1,p)}else document.execCommand("insertText",!1,s);At()},vo=a=>{if(we.value){const s=a.target;!s.closest(".dss-toolbar-dropdown")&&!s.closest(".dss-toolbar-dropdown-toggle")&&dl()}if(Ge.value){const s=a.target,i=s.closest(".dss-floating-toolbar"),c=f.value&&s.closest(".dss-text-editor-content");!i&&!c&&Bn()}if(ct.value){const s=a.target,i=s.closest(".dss-floating-toolbar"),c=s.closest(".dss-toolbar-dropdown");!i&&!c&&Nl()}const n=a.target;if(!n.closest(".dss-toolbar-dropdown")&&!n.closest(".dss-toolbar-dropdown-submenu")&&(Ue.value=null),!f.value||!n.closest(".dss-text-editor-content")){const s=window.getSelection();if(s&&s.rangeCount>0){const i=s.getRangeAt(0);se.value=!i.collapsed&&Nn(i)}else se.value=!1}if(nl.value!==null){const s=document.querySelector(".dss-comment-overlay");let i=!1;if(s){const u=s.getBoundingClientRect(),p=a.clientX,h=a.clientY;i=p>=u.left&&p<=u.right&&h>=u.top&&h<=u.bottom}const c=n.closest(".dss-toolbar-button"),d=c&&c.getAttribute("title")==="Comment";!i&&!d&&(nl.value=null,g.value="",q.value="",ue.value=null,at.value=[],$n(!0))}},gn=(a,n)=>{a&&a.stopPropagation&&a.stopPropagation(),Et.value&&(clearTimeout(Et.value),Et.value=null),Ue.value=n},No=a=>{const n=a.relatedTarget;if(n){const s=n.closest(".dss-toolbar-dropdown-submenu"),i=n.closest(".dss-toolbar-dropdown-item-has-submenu");if(s||i)return}Et.value&&clearTimeout(Et.value),Et.value=setTimeout(()=>{Ue.value=null,Et.value=null},150)},Ko=a=>{Ue.value=null};let Go=0;const Qo=a=>{if(!a)return;const n=Array.from(a.children);n.forEach(s=>{s.classList.contains("dss-toolbar-dropdown-submenu")||s.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(s.tagName==="BUTTON"||s.tagName==="DIV")&&!s.classList.contains("dss-toolbar-dropdown-item")&&s.classList.add("dss-toolbar-dropdown-item")}),n.forEach((s,i)=>{if(s.classList.contains("dss-toolbar-dropdown-item-has-submenu")||s.classList.contains("dss-toolbar-dropdown-submenu")||!s.classList.contains("dss-toolbar-dropdown-item"))return;const c=Array.from(s.children).find(p=>p.tagName==="DIV"?p.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(p.children).filter(k=>k.tagName==="BUTTON"||k.tagName==="DIV").length>0:!1),d=s.nextElementSibling,u=d&&!d.classList.contains("dss-toolbar-dropdown-submenu")&&!d.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&d.tagName==="DIV"&&!d.classList.contains("dss-toolbar-dropdown-item")&&Array.from(d.children).some(p=>p.tagName==="BUTTON"||p.tagName==="DIV");if(c||u){const p=`submenu-auto-${++Go}`;s.classList.add("dss-toolbar-dropdown-item-has-submenu"),s.setAttribute("data-submenu-id",p);let h=null;c?(s.tagName==="BUTTON"&&s.parentNode.insertBefore(c,s.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),h=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),h=d),h&&(h.setAttribute("data-submenu-id",p),h.setAttribute("data-processed","true"),c&&s.tagName!=="BUTTON"?h.dataset.originalParentRef="inside":h.dataset.originalParentRef="sibling",Array.from(h.children).forEach(H=>{(H.tagName==="BUTTON"||H.tagName==="DIV")&&!H.classList.contains("dss-toolbar-dropdown-item")&&H.classList.add("dss-toolbar-dropdown-item")}))}})},Bo=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(n=>{Qo(n),n.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=h=>{const k=c.getAttribute("data-submenu-id");k&&gn(h,k)},p=No;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",p),c._subMenuHandlers={enter:u,leave:p}}),n.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=k=>{const H=c.getAttribute("data-submenu-id");H&&gn(k,H)},p=No;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",p),c._subMenuHandlers={enter:u,leave:p},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(k=>{k.addEventListener("click",Ko)})})})};let Rn=null;const Kn=()=>{if(Ue.value){const a=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${Ue.value}"]`),n=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${Ue.value}"]`);a&&n&&eo(a,n)}if(Ge.value&&Mt(),T.richText){if(Rn!==null)return;Rn=setTimeout(()=>{Rn=null,Yl("handleWindowResize")},150)}},Zn=()=>{if(!T.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(n=>{Array.from(n.children).filter(i=>i.tagName==="DIV"&&!i.classList.contains("dss-toolbar-button")).forEach(i=>{i.classList.add("dss-toolbar-button")})})},fo=()=>{const a=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),n=s=>{if(s.preventDefault(),s.stopPropagation(),window.getSelection){const i=window.getSelection();i.removeAllRanges?i.removeAllRanges():i.empty&&i.empty()}return!1};a.forEach(s=>{s.addEventListener("selectstart",n),s.addEventListener("mousedown",n),s.addEventListener("dragstart",n),s.addEventListener("contextmenu",n),s.addEventListener("click",i=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{pl.value?ne():vt(),M.value?lt():Tt()})}),e.nextTick(()=>{fo()}),T.richText&&f.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",vo),window.addEventListener("resize",Kn);let a=null;const n=()=>{a===null&&(a=setTimeout(()=>{a=null,Kn()},150))};window.addEventListener("scroll",n,!0),f.value._windowScrollHandler=n,f.value._windowScrollTimeout=a,f.value.closest(".editor-with-comments"),f.value.closest(".dss-text-editor-content-wrapper");const s=f.value.closest(".dss-text-editor-content");let i=null;const c=()=>{i===null&&(i=setTimeout(()=>{i=null,Kn()},150))};s&&(s.addEventListener("scroll",c),f.value._scrollHandlers={wrapper:null,content:s,handler:c}),e.nextTick(()=>{Bo(),Zn()}),f.value.addEventListener("click",p=>{const h=p.target;h.closest("a")&&!T.disabled&&p.preventDefault();const H=h.closest(".dss-image-no-alt-icon"),z=h.closest(".dss-image-wrapper");if(H||z&&h===z){p.preventDefault(),p.stopPropagation();const V=window.getSelection(),Q=document.createRange();Q.setStartAfter(z),Q.collapse(!0),V.removeAllRanges(),V.addRange(Q)}else z&&h.tagName!=="IMG"&&(p.preventDefault(),e.nextTick(()=>{const V=window.getSelection();if(V.rangeCount>0){const ee=V.getRangeAt(0).commonAncestorContainer,ge=ee.nodeType===3?ee.parentElement:ee;if(z.contains(ge)&&ge!==z.querySelector("img")){const Me=document.createRange();Me.setStartAfter(z),Me.collapse(!0),V.removeAllRanges(),V.addRange(Me)}}else{const Q=document.createRange();Q.setStartAfter(z),Q.collapse(!0),V.addRange(Q)}}))},!0),f.value.addEventListener("mousedown",p=>{const h=p.target,k=h.closest(".dss-image-no-alt-icon"),H=h.closest(".dss-image-wrapper");if(k||H&&h.tagName!=="IMG"){p.preventDefault();const z=window.getSelection(),V=document.createRange();H&&(V.setStartAfter(H),V.collapse(!0),z.removeAllRanges(),z.addRange(V))}},!0),f.value.addEventListener("paste",p=>{e.nextTick(()=>{if(!f.value)return;f.value.querySelectorAll("img").forEach(k=>{if(!k.closest(".dss-image-wrapper"))k.removeAttribute("alt"),k.removeAttribute("data-alt"),k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="";else{const z=k.getAttribute("alt")||k.alt||"";if(z){const V=k.getAttribute("src")||k.src||"",Q=V.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),ee=z===V||z===Q;(z.startsWith("http://")||z.startsWith("https://")||z.startsWith("data:")||ee||ee)&&(k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="")}}}),Zl()})}),f.value.addEventListener("dragstart",p=>{const h=p.target,k=h.tagName==="IMG"?h:h.closest("img"),H=k?.closest(".dss-image-wrapper");k&&f.value.contains(k)&&(et.value=H||k,p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/html","image-drag"))}),f.value.addEventListener("dragover",p=>{et.value&&(p.preventDefault(),p.stopPropagation(),p.dataTransfer.dropEffect="move")}),f.value.addEventListener("dragenter",p=>{et.value&&(p.preventDefault(),p.stopPropagation())}),f.value.addEventListener("drop",p=>{if(!et.value||!f.value)return;p.preventDefault(),p.stopPropagation();const h=et.value,k=h.classList?.contains("dss-image-wrapper"),H=k?h.querySelector("img"):h,z=k?h:H?.closest(".dss-image-wrapper");if(!H||!f.value.contains(H)){et.value=null;return}let V=null;const Q=p.clientX,ee=p.clientY;if(document.caretRangeFromPoint)V=document.caretRangeFromPoint(Q,ee);else{const Ft=window.getSelection();Ft.rangeCount>0?V=Ft.getRangeAt(0).cloneRange():(V=document.createRange(),V.selectNodeContents(f.value),V.collapse(!1))}if(!V){et.value=null;return}const ge=V.commonAncestorContainer,Me=ge.nodeType===3?ge.parentElement:ge;if(Me?.closest(".dss-image-wrapper")===z||z&&z.contains(Me)){et.value=null;return}if(z&&(Me===z||z.contains(Me))){et.value=null;return}const xl=H.getAttribute("src");let ht=null;z?ht=z.cloneNode(!0):ht=H.cloneNode(!0);try{let Ft=V.startContainer;if(Ft.nodeType===3&&(Ft=Ft.parentElement),z&&(Ft===z||z.contains(Ft))){const yl=document.createRange();yl.setStartAfter(z),yl.collapse(!0),V=yl}V.insertNode(ht);const gl=document.createRange();gl.setStartAfter(ht),gl.collapse(!0);const Ot=window.getSelection();Ot.removeAllRanges(),Ot.addRange(gl)}catch{if(f.value.childNodes.length===0){const gl=document.createElement("p");gl.appendChild(ht),f.value.appendChild(gl)}else{const gl=f.value.lastChild;if(gl&&gl.nodeType===1)gl.appendChild(ht);else{const Ot=document.createElement("p");Ot.appendChild(ht),f.value.appendChild(Ot)}}}z?z.remove():H.remove(),et.value=null,e.nextTick(()=>{const Ft=f.value.querySelectorAll("img");let gl=!1;Ft.forEach(Ot=>{if(Ot.getAttribute("src")===xl)if(!gl)gl=!0;else{const yl=Ot.closest(".dss-image-wrapper");yl?yl.remove():Ot.remove()}}),Zl(),At()})}),f.value.addEventListener("dragend",p=>{et.value=null});let d=null;const u=new MutationObserver(p=>{p.forEach(h=>{h.addedNodes.forEach(k=>{if(k.nodeType===1){k.tagName==="IMG"&&(k.removeAttribute("alt"),k.removeAttribute("data-alt"),k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="");const H=k.querySelectorAll&&k.querySelectorAll("img");H&&H.forEach(z=>{z.removeAttribute("alt"),z.removeAttribute("data-alt"),z.setAttribute("alt",""),z.setAttribute("data-alt",""),z.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{Zl(),Zn(),d=null},100)});if(u.observe(f.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const p=document.querySelector(".dss-text-editor-toolbar");if(p){const h=new MutationObserver(()=>{e.nextTick(()=>{Zn()})});h.observe(p,{childList:!0,subtree:!0}),p._toolbarMutationObserver=h}}),T.modelValue){const p=Ml(T.modelValue);f.value.innerHTML=p,xn()}e.nextTick(()=>{const p=f.value.innerHTML||"",h=T.title||"",k=T.description||"";Ht.value=p,oe.value=h,Y.value=k,j.value=h,pe.value=k,Ll(),Zl(),en(),yn(),Ql(),yo()}),sl(),tn(),f.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",vo),window.removeEventListener("resize",Kn),f.value&&f.value._windowScrollHandler&&window.removeEventListener("scroll",f.value._windowScrollHandler,!0),Rn!==null&&(clearTimeout(Rn),Rn=null),f.value&&f.value._windowScrollTimeout!==null&&clearTimeout(f.value._windowScrollTimeout),qe.value&&clearTimeout(qe.value),Et.value&&clearTimeout(Et.value),f.value&&f.value._mutationObserver&&f.value._mutationObserver.disconnect(),He.value&&He.value.disconnect(),Ct.value!==null&&(cancelAnimationFrame(Ct.value),Ct.value=null),nt.value!==null&&(clearTimeout(nt.value),nt.value=null),St.value!==null&&(clearTimeout(St.value),St.value=null),$n(!0),f.value&&f.value._scrollHandlers){const{wrapper:n,content:s,handler:i}=f.value._scrollHandlers;n&&n.removeEventListener("scroll",i),s&&s.removeEventListener("scroll",i)}const a=document.querySelector(".dss-text-editor-toolbar");a&&a._toolbarMutationObserver&&a._toolbarMutationObserver.disconnect()});const Mo=a=>{const n=a.target,s=n.closest("a");if(s&&!T.disabled){a.preventDefault();const c=document.createRange();c.selectNodeContents(s);const d=window.getSelection();d.removeAllRanges(),d.addRange(c)}const i=n.closest(".dss-image-wrapper");i&&n.tagName!=="IMG"?e.nextTick(()=>{const c=window.getSelection();if(c.rangeCount>0){const u=c.getRangeAt(0).commonAncestorContainer,p=u.nodeType===3?u.parentElement:u;if(i.contains(p)&&p!==i.querySelector("img")){const h=document.createRange();h.setStartAfter(i),h.collapse(!0),c.removeAllRanges(),c.addRange(h)}}Zl(),sl(),tn(),Mt(),yn()}):e.nextTick(()=>{Zl(),sl(),tn(),Mt(),yn()})},_o=()=>{Pn();const a=window.getSelection();if(a&&a.rangeCount>0){const s=a.getRangeAt(0);se.value=!s.collapsed&&Nn(s),!s.collapsed&&w.value&&(w.value=null)}else se.value=!1;if(Zl(),sl(),tn(),Mt(),yn(),a&&a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c&&c.closest(".dss-text-editor-footer")){a.removeAllRanges(),se.value=!1;return}}["bold","italic","underline"].forEach(s=>{try{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0);if(!c.collapsed)if(s==="bold"){const d=c.commonAncestorContainer,u=d.nodeType===3?d.parentElement:d;let p=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(p=!0),!p&&u.style&&parseInt(u.style.fontWeight)>=600&&(p=!0),!p))try{const h=window.getComputedStyle(u);parseInt(h.fontWeight)>=600&&(p=!0)}catch{}ie.value[s]=p}else{const d=document.queryCommandState(s);ie.value[s]=d}}}catch{}})},yn=()=>{if(!T.richText||T.disabled||!f.value){A.value="p";return}try{const a=window.getSelection();if(!a||a.rangeCount===0){A.value="p";return}const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(!i||!f.value.contains(i)){A.value="p";return}const c=i.closest("h1, h2, h3, h4, h5, h6, p");if(!c){A.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?A.value=d:A.value="p"}catch{A.value="p"}},tn=()=>{if(!f.value){Ye.value=!1;return}try{const a=window.getSelection();let n=!1;if(a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");n=!!(c&&f.value.contains(c))}Ye.value=n}catch{Ye.value=!1}},Nn=a=>{if(!a||!f.value)return!1;const n=a.commonAncestorContainer;if(!n)return!1;const s=n.nodeType===3?n.parentElement:n;return s?f.value.contains(s):!1},Bn=()=>{Ge.value=!1},Mt=()=>{if(!T.floatingToolbar||!T.richText||T.disabled){Ge.value=!1;return}const a=window.getSelection();if(!a||a.rangeCount===0){Ge.value=!1;return}const n=a.getRangeAt(0);if(n.collapsed||!Nn(n)){Ge.value=!1;return}const s=n.getBoundingClientRect();if(!s||s.width===0&&s.height===0){Ge.value=!1;return}const i=f.value;if(!i){Ge.value=!1;return}const c=i.getBoundingClientRect();if(!c||c.width===0){Ge.value=!1;return}const d=40,u=8,p=s.top-d/2+15;let h=s.left+s.width/2;const k=window.innerWidth||document.documentElement.clientWidth||0;let H=0;Qe.value&&(H=Qe.value.getBoundingClientRect().width);const z=(H||320)/2;let V=c.left+z,Q=c.right-z;if(Q<V){const ee=c.left+c.width/2;V=ee,Q=ee}if(k>0){const ee=z+u,ge=k-z-u;if(V=Math.max(V,ee),Q=Math.min(Q,ge),Q<V){const Me=k/2;V=Me,Q=Me}}h<V?h=V:h>Q&&(h=Q),be.value={position:"fixed",top:`${Math.max(p,8)}px`,left:`${h}px`,transform:"translate(-50%, -100%)",zIndex:10003},Ge.value=!0},I=a=>{T.disabled||!T.richText||(ct.value=ct.value===a?null:a,a==="askAi"&&(we.value=null))},Nl=()=>{ct.value=null,Ue.value=null},Bl=a=>{wt(a),Nl()};let Gl=null,cl=null,rl=null,Gt=null;const rn=a=>{if(T.disabled||!T.richText){Xl(),Dt();return}const n=a.target,s=n.closest("a"),i=n.closest("img");if(Gl&&(clearTimeout(Gl),Gl=null),rl&&(clearTimeout(rl),rl=null),s&&s!==cl){Dt(),cl=s;let c=s.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=s.textContent||""),We.value=s,fe.value=c,X.value=!0,me.value=!0,kn(s)}else!s&&cl?(cl=null,Gl=setTimeout(()=>{me.value||Xl()},150)):s&&s===cl&&kn(s);if(i&&i!==Gt){Xl(),Gt=i;let c=i.getAttribute("alt");c===null&&(c=i.alt||"");let d=i.getAttribute("data-alt");d===null&&(d=c),i.hasAttribute("alt")||i.setAttribute("alt",c),i.hasAttribute("data-alt")||i.setAttribute("data-alt",d),yt.value=i,ke.value=c.trim()||B("textEditor.image.noAlt"),U.value=!0,G.value=!0,Pt(i)}else!i&&Gt?(Gt=null,rl=setTimeout(()=>{G.value||Dt()},150)):i&&i===Gt&&Pt(i)},fl=a=>{const n=a.relatedTarget;(!n||!n.closest(".dss-text-editor-content")&&!n.closest(".dss-link-popup"))&&(cl=null,Gt=null,Gl&&(clearTimeout(Gl),Gl=null),rl&&(clearTimeout(rl),rl=null),Xl(),Dt())},Xl=()=>{me.value=!1,setTimeout(()=>{me.value||(X.value=!1,fe.value="",_e.value||(We.value=null))},100)},kn=a=>{if(!a||!f.value)return;const n=a.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;R.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Dt=()=>{G.value=!1,setTimeout(()=>{G.value||(U.value=!1,ke.value="",gt.value||(yt.value=null))},100)},Pt=a=>{if(!a||!f.value)return;const n=a.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;W.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Vt=()=>{if(!fe.value||!We.value)return;let n=We.value.getAttribute("href")||fe.value;!n.startsWith("http://")&&!n.startsWith("https://")&&!n.startsWith("mailto:")&&(n="https://"+n),window.open(n,"_blank","noopener,noreferrer")},hl=()=>{if(We.value){const a=We.value.textContent||"",n=We.value.getAttribute("href")||"",s=We.value;Je.value=n,pt.value=a,Le.value=a,me.value=!1,X.value=!1,fe.value="",We.value=s,_e.value=!0}else if(Ce.value){const a=window.getSelection();if(a.rangeCount>0){const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");if(i){const c=i.textContent||"",d=i.getAttribute("href")||"";Je.value=d,pt.value=c,Le.value=c,We.value=i,_e.value=!0}}}else{Se.value=el();const a=window.getSelection();let n="";a.rangeCount>0&&(n=a.getRangeAt(0).toString()),Je.value="",pt.value=n,Le.value="",We.value=null,_e.value=!0}e.nextTick(()=>{Z.value&&(Z.value.focus(),Z.value.select())})},Gn=()=>{_e.value=!1,Je.value="",pt.value="",Le.value="",We.value=null,Se.value=null},Qn=()=>{if(!Je.value.trim()){Gn();return}if(Pe.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),al(),Pe.value=!1):al(),pt.value.trim()||(pt.value=Je.value.trim()),We.value&&f.value&&f.value.contains(We.value)){const a=window.getSelection();a.rangeCount>0&&a.removeAllRanges();const n=We.value;if(n.setAttribute("href",Je.value.trim()),pt.value.trim()!==Le.value.trim()){for(;n.firstChild;)n.removeChild(n.firstChild);n.textContent=pt.value.trim()}n.style.color="#60afdf",n.style.textDecoration="underline";const s=document.createRange();s.selectNodeContents(n),s.collapse(!1),a.removeAllRanges(),a.addRange(s),At()}else if(f.value){f.value.focus();const a=window.getSelection();a.removeAllRanges(),Se.value&&Vl(Se.value);let n=null;if(a.rangeCount>0&&(n=a.getRangeAt(0)),n&&!n.collapsed){n.toString();const s=document.createElement("a");s.href=Je.value.trim(),s.textContent=pt.value.trim(),s.style.color="#60afdf",s.style.textDecoration="underline",n.deleteContents(),n.insertNode(s);const i=document.createTextNode(" ");n.setStartAfter(s),n.insertNode(i),n.setStartAfter(i),n.collapse(!0),a.removeAllRanges(),a.addRange(n)}else{n||(n=document.createRange(),n.selectNodeContents(f.value),n.collapse(!1));const s=n.startContainer,i=s.nodeType===3,c=i&&n.startOffset===s.textContent.length,d=document.createElement("a");if(d.href=Je.value.trim(),d.textContent=pt.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=s.parentElement;for(;u&&u!==f.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==f.value){let p=u.nextElementSibling;if(p&&(p.innerHTML==="<br>"||p.innerHTML==="<br/>"||p.textContent.trim()==="")){p.textContent="",p.appendChild(d);const h=document.createTextNode(" ");p.appendChild(h);const k=document.createRange();k.setStartAfter(d),k.collapse(!0),a.removeAllRanges(),a.addRange(k)}else{if(n.startOffset>0){const k=s.textContent.substring(0,n.startOffset),H=k[k.length-1];if(H&&H!==" "&&H!==" "&&H!==`
|
|
104
|
+
`){const z=document.createTextNode(" ");n.insertNode(z),n.setStartAfter(z)}}n.insertNode(d);const h=document.createTextNode(" ");n.setStartAfter(d),n.insertNode(h),n.setStartAfter(h),n.collapse(!0),a.removeAllRanges(),a.addRange(n)}}}else{if(i&&n.startOffset>0){const p=s.textContent.substring(0,n.startOffset),h=p[p.length-1];if(h&&h!==" "&&h!==" "&&h!==`
|
|
105
|
+
`){const k=document.createTextNode(" ");n.insertNode(k),n.setStartAfter(k)}}n.insertNode(d);const u=document.createTextNode(" ");n.setStartAfter(d),n.insertNode(u),n.setStartAfter(u),n.collapse(!0),a.removeAllRanges(),a.addRange(n)}}At()}e.nextTick(()=>{sl(),Gn()})},Mn=()=>{if(!f.value||J.value)return;const a=window.getSelection();let n=null;a&&a.rangeCount>0&&(n=el());const s=/(https?:\/\/[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|(www\.[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.([a-zA-Z]{2,})(\/[^\s<>"{}|\\^`\[\]]*)?)/gi,i=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:p=>{const h=p.parentElement;return!h||h.closest("a")||h.closest(".dss-image-wrapper")||!p.textContent||p.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let d;for(;d=i.nextNode();)c.push(d);let u=!1;for(let p=c.length-1;p>=0;p--){const h=c[p],k=h.textContent;s.lastIndex=0;const H=[...k.matchAll(s)];if(H.length===0)continue;const z=H.filter(ee=>{const ge=ee[0],Me=ee.index;if(Me>0&&k[Me-1]==="@"||Me+ge.length<k.length&&k[Me+ge.length]==="@")return!1;const ft=h.parentElement;return!(ft&&ft.closest("a"))});if(z.length===0)continue;if(z.length===1&&z[0][0]===k.trim()){const ee=z[0][0],ge=ee.startsWith("http://")||ee.startsWith("https://")?ee:`https://${ee}`,Me=document.createElement("a");Me.href=ge,Me.textContent=ee,Me.style.color="#60afdf",Me.style.textDecoration="underline",h.parentNode&&(h.parentNode.replaceChild(Me,h),u=!0);continue}let V=0;const Q=document.createDocumentFragment();if(z.forEach(ee=>{const ge=ee.index,Me=ee[0];if(ge>V){const ht=k.substring(V,ge);ht&&Q.appendChild(document.createTextNode(ht))}const ft=Me.startsWith("http://")||Me.startsWith("https://")?Me:`https://${Me}`,xl=document.createElement("a");xl.href=ft,xl.textContent=Me,xl.style.color="#60afdf",xl.style.textDecoration="underline",Q.appendChild(xl),V=ge+Me.length}),V<k.length){const ee=k.substring(V);ee&&Q.appendChild(document.createTextNode(ee))}h.parentNode&&Q.childNodes.length>0&&(h.parentNode.replaceChild(Q,h),u=!0)}u&&n&&e.nextTick(()=>{Vl(n),sl()})},ho=()=>{if(!f.value)return;const a=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,n=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:c=>{const d=c.parentElement;return!d||d.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),s=[];let i;for(;i=n.nextNode();)s.push(i);for(let c=s.length-1;c>=0;c--){const d=s[c],u=d.textContent,p=[...u.matchAll(a)];if(p.length===0)continue;let h=0;const k=document.createDocumentFragment();p.forEach(H=>{const z=H.index,V=H[0].startsWith("<u>")?"u":"ins",Q=H[1]||H[2]||"";z>h&&k.appendChild(document.createTextNode(u.substring(h,z)));const ee=document.createElement(V);ee.textContent=Q,k.appendChild(ee),h=z+H[0].length}),h<u.length&&k.appendChild(document.createTextNode(u.substring(h))),d.parentNode&&k.childNodes.length>0&&d.parentNode.replaceChild(k,d)}},Cn=a=>{if(!f.value||J.value)return;if(!a){ho();return}if(!["*","_",">"].includes(a))return;const s=window.getSelection();if(!s||s.rangeCount===0)return;const i=s.getRangeAt(0);if(!i.collapsed)return;const c=i.startContainer.nodeType===Node.TEXT_NODE?i.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):i.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!c||c===f.value||!f.value.contains(c))return;const d=()=>{let ht="",Ft=0,gl=!1;const Ot=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:Al=>Al.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let yl=0;for(;Ot.nextNode();){const Al=Ot.currentNode,nn=Al.textContent||"",bn=yl;if(yl+=nn.length,Al===i.startContainer){ht+=nn.substring(0,i.startOffset),Ft=bn+i.startOffset,gl=!0;break}ht+=nn}return gl||(Ft=ht.length),{textBeforeCursor:ht,cursorCharOffset:Ft}},{textBeforeCursor:u}=d();if(!u.length)return;let p=null,h=null;if(u.endsWith("**")&&(p=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(p=u.match(/__(.+?)__$/s))?h="strong":u.endsWith("*")&&!u.endsWith("**")&&(p=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(p=u.match(new RegExp("(?<!_)_([^_]+)_$")))?h="em":a===">"&&((p=u.match(/<u>(.+?)<\/u>$/s))||(p=u.match(/<ins>(.+?)<\/ins>$/s)))&&(h=p[0].startsWith("<u>")?"u":"ins",p[0].startsWith("<u>"),p[0].startsWith("<u>")),!p||!p[1])return;const k=p[0],H=p[1],z=u.length-k.length,Q=(ht=>{let Ft=0;const gl=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:yl=>yl.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let Ot;for(;Ot=gl.nextNode();){const yl=(Ot.textContent||"").length;if(Ft+yl>=ht)return{node:Ot,offset:ht-Ft};Ft+=yl}return null})(z);if(!Q)return;const ee=document.createRange();ee.setStart(Q.node,Q.offset),ee.setEnd(i.endContainer,i.endOffset);const ge=document.createElement(h);ge.textContent=H,ee.deleteContents(),ee.insertNode(ge);const Me=window.getSelection(),ft=document.createRange();ft.setStartAfter(ge),ft.collapse(!0),Me.removeAllRanges(),Me.addRange(ft);const xl=el();e.nextTick(()=>{At(),xl&&Vl(xl)})},Un=()=>{f.value&&(ol.value=el(),ut.value="",Zt.value="",Ie.value="",kt.value="",xt.value="",qt.value=null,yt.value=null,Ne.value="upload",gt.value=!0,dl(),e.nextTick(()=>{Yt.value&&Yt.value.focus(),rt.value&&(rt.value.value="")}))},Xn=a=>{const n=a.target?.files?.[0];if(!n){qt.value=null,Zt.value="";return}qt.value=n;const s=new FileReader;s.onload=i=>{Zt.value=i.target?.result||""},s.readAsDataURL(n)},Jo=()=>{rt.value&&rt.value.click()},go=()=>{kt.value&&(xt.value="")},$o=()=>{xt.value&&(kt.value="")},_n=()=>{let a=yt.value;if(!a){const n=window.getSelection();if(n&&n.rangeCount>0){const i=n.getRangeAt(0).commonAncestorContainer;a=i.nodeType===1?i.closest("img"):i.parentElement?.closest("img")}}if(a){const n=a.getAttribute("data-alt")||a.getAttribute("alt")||"";yt.value=a,ut.value=n.trim()===""||n.trim()==="Image"?"":n;const s=a.getAttribute("src")||a.src||"";s.startsWith("http://")||s.startsWith("https://")?(Ie.value=s,Zt.value="",Ne.value="url"):(Zt.value=s,Ie.value="",Ne.value="upload");const c=a.style.width||a.getAttribute("width")||"",d=a.style.height||a.getAttribute("height")||"";kt.value=c.endsWith("px")?c.replace("px",""):c,xt.value=d.endsWith("px")?d.replace("px",""):d,ol.value=null}else{Un();return}gt.value=!0,G.value=!1,U.value=!1,e.nextTick(()=>{Ne.value==="url"&&Jt.value?(Jt.value.focus(),Jt.value.select()):Yt.value&&(Yt.value.focus(),Yt.value.select()),rt.value&&(rt.value.value="")})},Fn=()=>{gt.value=!1,ut.value="",Zt.value="",Ie.value="",kt.value="",xt.value="",qt.value=null,yt.value=null,ol.value=null,Ne.value="upload"},_l=()=>{const a=(ut.value||"").trim(),n=f.value?._mutationObserver;n&&n.disconnect(),Pe.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),al(),Pe.value=!1):al();const s=Ne.value==="url"?Ie.value.trim():Zt.value;if(yt.value&&f.value&&f.value.contains(yt.value)){s&&(yt.value.src=s),yt.value.setAttribute("alt",a),yt.value.setAttribute("data-alt",a),kt.value?(yt.value.style.width=`${kt.value}px`,yt.value.setAttribute("width",kt.value)):(yt.value.style.removeProperty("width"),yt.value.removeAttribute("width")),xt.value?(yt.value.style.height=`${xt.value}px`,yt.value.setAttribute("height",xt.value)):(yt.value.style.removeProperty("height"),yt.value.removeAttribute("height"));const i=window.getSelection();if(i){i.removeAllRanges();const c=document.createRange();c.setStartAfter(yt.value),c.collapse(!0),i.addRange(c)}At()}else{if(!s){n&&f.value&&n.observe(f.value,{childList:!0,subtree:!0}),Fn();return}if(f.value){f.value.focus();const i=window.getSelection();i&&i.rangeCount>0&&i.removeAllRanges();const c=window.getSelection();let d=null;if(ol.value&&(Vl(ol.value),c&&c.rangeCount>0&&(d=c.getRangeAt(0))),!d&&c&&c.rangeCount>0&&(d=c.getRangeAt(0)),!d&&f.value){if(d=document.createRange(),f.value.childNodes.length===0){const k=document.createElement("p");k.innerHTML="<br>",f.value.appendChild(k),d.setStart(k,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){Fn();return}const u=d.commonAncestorContainer,p=u.nodeType===3?u.parentElement:u;if(!f.value.contains(p)){if(d=document.createRange(),f.value.childNodes.length===0){const k=document.createElement("p");k.innerHTML="<br>",f.value.appendChild(k),d.setStart(k,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}const h=document.createElement("img");h.src=s,h.setAttribute("alt",a),h.setAttribute("data-alt",a),kt.value&&(h.style.width=`${kt.value}px`,h.setAttribute("width",kt.value)),xt.value&&(h.style.height=`${xt.value}px`,h.setAttribute("height",xt.value));try{d.insertNode(h),d.setStartAfter(h),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(f.value){if(f.value.childNodes.length===0){const z=document.createElement("p");f.value.appendChild(z),z.appendChild(h)}else{const z=f.value.lastChild;if(z&&z.nodeType===1)z.appendChild(h);else{const V=document.createElement("p");f.value.appendChild(V),V.appendChild(h)}}const H=document.createRange();H.setStartAfter(h),H.collapse(!0),c&&(c.removeAllRanges(),c.addRange(H))}}yt.value=h,At()}}e.nextTick(()=>{n&&f.value&&n.observe(f.value,{childList:!0,subtree:!0}),sl(),Mt(),Fn()})};e.watch(()=>T.modelValue,a=>{if(T.richText&&f.value&&!J.value){const n=Ml(a||""),i=f.value.innerHTML.replace(/ |\u00A0/g," "),c=n.replace(/ |\u00A0/g," ");if(i!==c){const d=el();f.value.innerHTML=n,e.nextTick(()=>{xn();const u=f.value.innerHTML||"",p=T.title||"",h=T.description||"";Ht.value=u,oe.value=p,Y.value=h,$t.value=u,j.value=p,pe.value=h,Ke.value=[],Ut.value=[],qe.value&&(clearTimeout(qe.value),qe.value=null),Pe.value=!1,d&&Vl(d),Ll(),Zl(),en(),sl(),Mt(),yn(),Yl("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>T.richText,a=>{a?(Mt(),e.nextTick(()=>{Ql()})):(Bn(),ae.value=[],He.value&&(He.value.disconnect(),He.value=null)),yn()}),e.watch(()=>T.floatingToolbar,a=>{a?Mt():Bn()}),e.watch(()=>T.disabled,a=>{a&&Bn(),yn()}),e.watch(()=>T.description,()=>{e.nextTick(()=>{M.value?lt():Tt()})}),e.watch(()=>T.title,()=>{e.nextTick(()=>{pl.value?ne():vt()})}),e.watch(()=>T.customToolbarSlots,()=>{e.nextTick(()=>{Zn()})},{deep:!0}),e.watch(()=>T.comments,(a,n)=>{if(T.commentUser){if(Xt.value){Xt.value=!1;return}Cl.value||T.richText&&f.value&&e.nextTick(()=>{yo()})}},{deep:!0,immediate:!1});const yo=()=>{if(T.commentUser&&!Cl.value&&!(!T.comments||!Array.isArray(T.comments)||T.comments.length===0)&&!(!T.richText||!f.value)){Cl.value=!0;try{const a=new Set,n=T.comments.filter(u=>{const p=String(u.conversation_id||u.id);return a.has(p)?!1:(a.add(p),!0)}),s=f.value.querySelectorAll("[data-comment], [data-fake-comment]"),i=s.length;s.forEach(u=>{const p=u.parentNode;if(p){for(;u.firstChild;)p.insertBefore(u.firstChild,u);p.removeChild(u)}});let c=0;const d=new Set;n.forEach(u=>{if(!u.conversation_id||!u.selection_range)return;const p=typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)||u.conversation_id;if(!p)return;const h=String(p);if(d.has(h))return;const k=f.value.querySelector(`[data-comment="${h}"]`);if(k){Jn(k,u),d.add(h);return}try{const H=To(u.selection_range,u.selection_text);if(H&&!H.collapsed){const z=H.commonAncestorContainer,V=z.nodeType===3?z.parentElement:z;if(V){const ge=V.closest("[data-comment], [data-fake-comment]");if(ge){const Me=ge.getAttribute("data-comment")||ge.getAttribute("data-fake-comment");if(String(Me)===String(p)){ge.setAttribute("data-comment",h),ge.removeAttribute("data-fake-comment"),Jn(ge,u),d.add(h);return}else return}}const Q=f.value.querySelector(`[data-comment="${h}"]`);if(Q){Jn(Q,u),d.add(h);return}const ee=document.createElement("span");ee.setAttribute("data-comment",h),Jn(ee,u);try{H.surroundContents(ee),c++,d.add(h)}catch{try{const Me=document.createRange();Me.setStart(H.startContainer,H.startOffset),Me.setEnd(H.endContainer,H.endOffset),Lo(Me),Me.surroundContents(ee),c++,d.add(h)}catch{try{const ft=H.extractContents();ee.appendChild(ft),H.insertNode(ee),c++,d.add(h)}catch(ft){console.warn("Failed to create comment marker:",ft)}}}}}catch{}}),e.nextTick(()=>{Yl("restoreCommentsFromModel"),At(),Cl.value=!1})}catch{Cl.value=!1}}},Lo=a=>{if(!a||!f.value)return a;try{const n=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let s=a.startContainer,i=a.startOffset;if(s.nodeType===3){const u=s.parentElement;u&&n.includes(u.tagName)&&(i===0&&!Yn(s)||a.setStartBefore(u))}else s.nodeType===1&&n.includes(s.tagName)&&i>0&&a.setStartBefore(s);let c=a.endContainer,d=a.endOffset;if(c.nodeType===3){const u=c.parentElement;u&&n.includes(u.tagName)&&(d===c.length&&!ea(c)||a.setEndAfter(u))}else c.nodeType===1&&n.includes(c.tagName)&&d<c.childNodes.length&&a.setEndAfter(c);return a}catch{return a}},Yn=a=>{let n=a.previousSibling;for(;n;){if(n.nodeType===3&&n.textContent.trim().length>0||n.nodeType===1&&n.textContent.trim().length>0)return!0;n=n.previousSibling}return!1},ea=a=>{let n=a.nextSibling;for(;n;){if(n.nodeType===3&&n.textContent.trim().length>0||n.nodeType===1&&n.textContent.trim().length>0)return!0;n=n.nextSibling}return!1},To=(a,n)=>{if(!a||!f.value)return null;try{const s=document.createRange();if(a.type==="text"&&typeof a.start=="number"&&typeof a.end=="number"){let i=0;const c=[f.value];let d=null,u=!1,p=!1;for(;!p&&(d=c.pop());)if(d.nodeType===3){const h=i+d.length;!u&&a.start>=i&&a.start<=h&&(s.setStart(d,a.start-i),u=!0),u&&a.end>=i&&a.end<=h&&(s.setEnd(d,a.end-i),p=!0),i=h}else{let h=d.childNodes.length;for(;h--;)c.push(d.childNodes[h])}return u?Lo(s):null}}catch{return null}return null},Jn=(a,n)=>{if(!a||!n)return;const s=n.conversation||[],i=new Set,c=[],d=p=>{p&&p.id&&!i.has(p.id)&&(i.add(p.id),c.push(p))};s.length>0&&s.forEach(p=>{p.user&&d(p.user)}),c.length>0?a.setAttribute("data-comment-user",JSON.stringify(c[0])):a.removeAttribute("data-comment-user"),c.length>1?a.setAttribute("data-comment-user-2",JSON.stringify(c[1])):a.removeAttribute("data-comment-user-2");const u=s.length;u>0?a.setAttribute("data-comment-count",String(u)):a.removeAttribute("data-comment-count")},Yl=(a="unknown")=>{if(!T.commentUser||!T.richText||!f.value){ae.value=[];return}Date.now()-bt.value<_t&&Ct.value!==null||Ct.value===null&&(Ct.value=requestAnimationFrame(()=>{if(Ct.value=null,bt.value=Date.now(),Re.value)return;Re.value=!0;const s={},i=f.value;if(!i){Re.value=!1;return}const c=i.closest(".editor-with-comments");if(!c){Re.value=!1;return}const d=i.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],p=new Set;d.forEach(V=>{const Q=V.getAttribute("data-comment")||V.getAttribute("data-fake-comment");Q&&V.tagName==="SPAN"&&(p.has(Q)||(u.push(V),p.add(Q)))}),d.forEach(V=>{const Q=V.getAttribute("data-comment")||V.getAttribute("data-fake-comment");!Q||p.has(Q)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(V.tagName)?V.querySelector(`span[data-comment="${Q}"], span[data-fake-comment="${Q}"]`)||(u.push(V),p.add(Q)):V.tagName!=="SPAN"&&(u.push(V),p.add(Q)))});const h=c.getBoundingClientRect(),k=i.getBoundingClientRect();u.forEach((V,Q)=>{let ee=V.getAttribute("data-comment")||V.getAttribute("data-fake-comment");if(!ee)return;if(typeof ee=="string"&&ee.startsWith("comment-")){const cn=V.textContent?.trim(),Jl=T.comments?.find(Ol=>(typeof Ol.conversation_id=="string"&&Ol.conversation_id.startsWith("comment-")?null:Ol.conversation_id)&&Ol.selection_text?.trim()===cn);Jl?(ee=String(Jl.conversation_id),V.setAttribute("data-comment",ee),V.removeAttribute("data-fake-comment")):(ee=String(Date.now()),V.setAttribute("data-comment",ee),V.removeAttribute("data-fake-comment"))}const ge=V.getBoundingClientRect(),Me=window.getComputedStyle(V),ft=parseFloat(Me.lineHeight)||parseFloat(Me.fontSize)*1.2,Ft=ge.top-k.top+ft/2-15,Ot=k.top-h.top+Ft;let yl=null,Al=null,nn=0;const bn=[],Co=new Set;if(ee&&T.comments){const cn=T.comments.find(Jl=>String(Jl.conversation_id||Jl.id)===String(ee));if(cn){const Jl=cn.conversation||[];Jl.length>0?(Jl.forEach(Ol=>{Ol.user&&Ol.user.id&&!Co.has(Ol.user.id)&&(Co.add(Ol.user.id),bn.push(Ol.user))}),nn=Jl.length):(nn=0,yl=null,Al=null),bn.length>0?yl=bn[0]:yl=null,bn.length>1?Al=bn[1]:Al=null}}const Do=ge.top+ft/2-15,bo=Do+30,Ho=5,to=bo>k.top+Ho&&Do<k.bottom-Ho?1:0;ae.value.find(cn=>cn.id===ee);let lo=V;if(!lo&&ee&&f.value){const cn=String(ee);lo=f.value.querySelector(`[data-comment="${cn}"], [data-fake-comment="${cn}"]`)}const Qt=bn.length;s[ee]?(s[ee].top=Ot,s[ee].opacity=to,s[ee].element=lo,s[ee].firstUser=yl,s[ee].secondUser=Al,s[ee].totalCount=nn,s[ee].uniqueUserCount=Qt):s[ee]={id:ee,top:Ot,opacity:to,element:lo,firstUser:yl,secondUser:Al,totalCount:nn,uniqueUserCount:Qt}});const H=Object.values(s).map(V=>{const Q=Math.max(0,(V.uniqueUserCount??0)-2);if(!V.element&&V.id&&f.value){const ge=String(V.id);V.element=f.value.querySelector(`[data-comment="${ge}"], [data-fake-comment="${ge}"]`)}return{...V,firstUser:V.firstUser||null,secondUser:V.secondUser||null,totalCount:V.totalCount,additionalCount:Q}});(ae.value.length!==H.length||H.some((V,Q)=>{const ee=ae.value[Q];if(!ee)return!0;const ge=(ee.firstUser?.id||null)!==(V.firstUser?.id||null),Me=(ee.secondUser?.id||null)!==(V.secondUser?.id||null);return ee.id!==V.id||Math.abs(ee.top-V.top)>1||ee.opacity!==V.opacity||ee.totalCount!==V.totalCount||ee.additionalCount!==V.additionalCount||ge||Me||ee.element!==V.element}))&&(ae.value=H),Re.value=!1}))},Ao=a=>{if(!a)return;let n=a.element;if(!n&&a.id&&f.value){const s=String(a.id);n=f.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`)}n&&($n(),zl.value=n,n.classList.add("editor-comment-highlighted"))},$n=(a=!1)=>{!a&&nl.value!==null&&zl.value&&(zl.value.getAttribute("data-comment")||zl.value.getAttribute("data-fake-comment"))===nl.value||(f.value&&f.value.querySelectorAll(".editor-comment-highlighted").forEach(s=>{s.classList.remove("editor-comment-highlighted")}),zl.value&&(zl.value.classList.remove("editor-comment-highlighted"),zl.value=null))},ko=a=>{if(!a||!a.element)return;$n(!0);const n=a.element.getAttribute("data-comment")||a.element.getAttribute("data-fake-comment");if(!n)return;const s=`[data-comment="${n}"], [data-fake-comment="${n}"]`;he("comment-marker-clicked",{commentId:n,selector:s,element:a.element})},ln=()=>{$n()},Ql=()=>{!T.richText||!f.value||(He.value&&He.value.disconnect(),St.value!==null&&(clearTimeout(St.value),St.value=null),He.value=new MutationObserver(()=>{St.value===null&&(St.value=setTimeout(()=>{St.value=null,e.nextTick(()=>{Yl("MutationObserver")})},200))}),He.value.observe(f.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),Yl("setupCommentMarkersObserver-initial"))},eo=(a,n)=>{if(!a||!n)return;const s=n.getBoundingClientRect();let i=s.top,c=s.right+4;a.style.top=`${i}px`,a.style.left=`${c}px`,a.offsetHeight;const d=a.getBoundingClientRect(),u=window.innerWidth,p=window.innerHeight;if(d.right>u){const h=s.left-d.width-4;a.style.left=`${h}px`}if(d.bottom>p){const h=Math.max(8,p-d.height-8);a.style.top=`${h}px`}d.top<0&&(a.style.top="8px")};return e.watch(()=>Ue.value,a=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(s=>{const i=s.getAttribute("data-submenu-id");if(i===a&&a){const c=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${i}"]`);if(c){if(s.parentNode!==document.body){const d=s.parentNode;s.dataset.originalParentRef=d===c?"inside":"sibling",document.body.appendChild(s)}s.style.display="block",s.style.visibility="hidden",s.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{eo(s,c),s.offsetHeight,s.setAttribute("data-active","true"),s.style.visibility="visible",s.style.opacity="1"})})}else s.setAttribute("data-active","true")}else s.setAttribute("data-active","false"),s.style.display="none",s.style.top="",s.style.left="",s.style.visibility="",s.style.opacity=""})})}),e.watch(()=>[we.value,ct.value],()=>{we.value==="askAi"||ct.value==="askAi"?e.nextTick(()=>{Bo()}):(Ue.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(n=>{if(n.parentNode===document.body){const s=n.getAttribute("data-submenu-id");if(s){const i=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${s}"]`);if(i)if(n.dataset.originalParentRef==="inside")i.appendChild(n);else{const d=i.closest(".dss-toolbar-dropdown");d&&d.insertBefore(n,i.nextSibling)}}}})}))}),e.watch(()=>T.locale,a=>{a&&a!==de.value&&(de.value=a)},{immediate:!0}),le({openCommentOverlayForSelector:Yo,updateCommentMarkers:Yl,restoreCommentsFromModel:yo}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container",[{"editor-with-comments":Lt.value},zt.value]]),style:e.normalizeStyle(Bt.value)},[E.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:n[14]||(n[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Ed,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:fn,title:e.unref(B)("textEditor.toolbar.undo")},[...n[45]||(n[45]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,Sd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!jl.value}]),onClick:Hn,title:e.unref(B)("textEditor.toolbar.redo")},[...n[46]||(n[46]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,Vd),n[61]||(n[61]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Nd,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[0]||(n[0]=s=>Wn("paragraph")),title:e.unref(B)("textEditor.toolbar.paragraphFormat")},[A.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:P.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Md)):A.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:P.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,_d)):A.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:P.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,$d)):A.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:P.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Ld)):A.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:P.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Td)):A.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:P.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,Ad)):(e.openBlock(),e.createElementBlock("svg",Dd,[...n[47]||(n[47]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),n[48]||(n[48]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Bd),we.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[8]||(n[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[1]||(n[1]=s=>wt("<h1>"))},[e.createElementVNode("img",{src:P.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Hd),e.createElementVNode("h1",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[2]||(n[2]=s=>wt("<h2>"))},[e.createElementVNode("img",{src:P.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Rd),e.createElementVNode("h2",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[3]||(n[3]=s=>wt("<h3>"))},[e.createElementVNode("img",{src:P.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Fd),e.createElementVNode("h3",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[4]||(n[4]=s=>wt("<h4>"))},[e.createElementVNode("img",{src:P.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Id),e.createElementVNode("h4",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[5]||(n[5]=s=>wt("<h5>"))},[e.createElementVNode("img",{src:P.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,zd),e.createElementVNode("h5",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[6]||(n[6]=s=>wt("<h6>"))},[e.createElementVNode("img",{src:P.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,Pd),e.createElementVNode("h6",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[7]||(n[7]=s=>wt("<p>"))},[n[49]||(n[49]=e.createElementVNode("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"})],-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ll("bold")}]),onClick:n[9]||(n[9]=s=>Il("bold")),title:e.unref(B)("textEditor.toolbar.bold")},[...n[50]||(n[50]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,Od),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ll("italic")}]),onClick:n[10]||(n[10]=s=>Il("italic")),title:e.unref(B)("textEditor.toolbar.italic")},[...n[51]||(n[51]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,Wd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ll("underline")}]),onClick:n[11]||(n[11]=s=>Il("underline")),title:e.unref(B)("textEditor.toolbar.underline")},[...n[52]||(n[52]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,qd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ye.value}]),onClick:Sn,title:e.unref(B)("textEditor.toolbar.citation")},[...n[53]||(n[53]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,Zd),n[62]||(n[62]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),Ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:mt,title:e.unref(B)("textEditor.toolbar.removeLink")},[...n[55]||(n[55]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,Xd)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:ot,title:e.unref(B)("textEditor.toolbar.insertLink")},[...n[54]||(n[54]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,Ud)),n[63]||(n[63]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ll("insertUnorderedList")}]),onClick:ce,title:e.unref(B)("textEditor.toolbar.bulletList")},[...n[56]||(n[56]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,Yd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ll("insertOrderedList")}]),onClick:tl,title:e.unref(B)("textEditor.toolbar.numberList")},[...n[57]||(n[57]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,jd),n[64]||(n[64]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Un,title:e.unref(B)("textEditor.toolbar.image")},[...n[58]||(n[58]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,Kd),Lt.value&&se.value?(e.openBlock(),e.createElementBlock("div",Gd)):e.createCommentVNode("",!0),Lt.value&&se.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(B)("textEditor.toolbar.comment"),onClick:Ul},[...n[59]||(n[59]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,Qd)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",Jd)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",e1,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:n[12]||(n[12]=s=>Wn("askAi")),title:e.unref(B)("textEditor.toolbar.askAi")},[n[60]||(n[60]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",l1,e.toDisplayString(e.unref(B)("textEditor.toolbar.askAi")),1)],8,t1),we.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[13]||(n[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(a.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",n1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[$l(s)?(e.openBlock(),e.createElementBlock("div",o1,[e.renderSlot(a.$slots,s)])):e.createCommentVNode("",!0),$l(s)&&i<E.customToolbarSlots.length-1&&zn(i)?(e.openBlock(),e.createElementBlock("div",a1)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(we.value==="paragraph"||we.value==="askAi")&&E.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:dl})):e.createCommentVNode("",!0),e.createVNode(ia,{showModal:_e.value,width:"500px",height:"55vh",onCloseModal:Gn},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(B)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",s1,[e.createElementVNode("div",r1,[e.createElementVNode("label",i1,e.toDisplayString(e.unref(B)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Fe,type:"text","onUpdate:modelValue":n[15]||(n[15]=s=>pt.value=s),class:"dss-link-modal-input",placeholder:e.unref(B)("textEditor.link.enterAltText"),onKeyup:e.withKeys(Qn,["enter"])},null,40,c1),[[e.vModelText,pt.value]])]),e.createElementVNode("div",u1,[e.createElementVNode("label",d1,e.toDisplayString(e.unref(B)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:Z,type:"text","onUpdate:modelValue":n[16]||(n[16]=s=>Je.value=s),class:"dss-link-modal-input",placeholder:e.unref(B)("textEditor.link.enterUrl"),onKeyup:e.withKeys(Qn,["enter"])},null,40,m1),[[e.vModelText,Je.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Gn},e.toDisplayString(e.unref(B)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Qn},e.toDisplayString(e.unref(B)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(ia,{showModal:gt.value,width:"500px",height:"80vh",onCloseModal:Fn},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(yt.value?e.unref(B)("textEditor.image.editImage"):e.unref(B)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",p1,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Ne.value==="upload"}]),onClick:n[17]||(n[17]=s=>Ne.value="upload")},e.toDisplayString(e.unref(B)("textEditor.image.upload")),3),n[65]||(n[65]=e.createElementVNode("div",{class:"dss-image-modal-tab-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Ne.value==="url"}]),onClick:n[18]||(n[18]=s=>Ne.value="url")},e.toDisplayString(e.unref(B)("textEditor.image.imageLink")),3)]),Ne.value==="upload"?(e.openBlock(),e.createElementBlock("div",v1,[e.createElementVNode("div",f1,[e.createElementVNode("div",h1,[dn.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",g1,e.toDisplayString(e.unref(B)("textEditor.image.uploadImage")),1)),dn.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:Jo},[e.createElementVNode("img",{src:Zt.value,alt:"Preview",class:"dss-image-preview-image"},null,8,y1),n[66]||(n[66]=e.createElementVNode("div",{class:"dss-image-preview-overlay"},[e.createElementVNode("svg",{width:"35",height:"35",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.1 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z",fill:"white"})])],-1)),e.createElementVNode("input",{ref_key:"imageFileInput",ref:rt,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:Xn},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:rt,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:Xn},null,544))]),e.createElementVNode("div",k1,[e.createElementVNode("label",C1,e.toDisplayString(e.unref(B)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Yt,type:"text","onUpdate:modelValue":n[19]||(n[19]=s=>ut.value=s),class:"dss-link-modal-input",placeholder:e.unref(B)("textEditor.image.enterAltText"),onKeyup:e.withKeys(_l,["enter"])},null,40,b1),[[e.vModelText,ut.value]])]),e.createElementVNode("div",w1,[e.createElementVNode("label",x1,e.toDisplayString(e.unref(B)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[20]||(n[20]=s=>kt.value=s),class:"dss-link-modal-input",placeholder:e.unref(B)("textEditor.image.auto"),onKeyup:e.withKeys(_l,["enter"]),onInput:go},null,40,E1),[[e.vModelText,kt.value]])]),e.createElementVNode("div",S1,[e.createElementVNode("label",V1,e.toDisplayString(e.unref(B)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[21]||(n[21]=s=>xt.value=s),class:"dss-link-modal-input",placeholder:e.unref(B)("textEditor.image.auto"),onKeyup:e.withKeys(_l,["enter"]),onInput:$o},null,40,N1),[[e.vModelText,xt.value]])])])])):e.createCommentVNode("",!0),Ne.value==="url"?(e.openBlock(),e.createElementBlock("div",B1,[e.createElementVNode("div",M1,[e.createElementVNode("div",_1,[e.createElementVNode("label",$1,e.toDisplayString(e.unref(B)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Jt,type:"text","onUpdate:modelValue":n[22]||(n[22]=s=>Ie.value=s),class:"dss-link-modal-input",placeholder:e.unref(B)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(_l,["enter"])},null,40,L1),[[e.vModelText,Ie.value]])]),e.createElementVNode("div",T1,[e.createElementVNode("label",A1,e.toDisplayString(e.unref(B)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[23]||(n[23]=s=>ut.value=s),class:"dss-link-modal-input",placeholder:e.unref(B)("textEditor.image.enterAltText"),onKeyup:e.withKeys(_l,["enter"])},null,40,D1),[[e.vModelText,ut.value]])]),e.createElementVNode("div",H1,[e.createElementVNode("label",R1,e.toDisplayString(e.unref(B)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[24]||(n[24]=s=>kt.value=s),class:"dss-link-modal-input",placeholder:e.unref(B)("textEditor.image.auto"),onKeyup:e.withKeys(_l,["enter"]),onInput:go},null,40,F1),[[e.vModelText,kt.value]])]),e.createElementVNode("div",I1,[e.createElementVNode("label",z1,e.toDisplayString(e.unref(B)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[25]||(n[25]=s=>xt.value=s),class:"dss-link-modal-input",placeholder:e.unref(B)("textEditor.image.auto"),onKeyup:e.withKeys(_l,["enter"]),onInput:$o},null,40,P1),[[e.vModelText,xt.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Fn},e.toDisplayString(e.unref(B)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:_l},e.toDisplayString(e.unref(B)("textEditor.image.save")),1)]),_:1},8,["showModal"]),E.showTitle?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":Fl.value&&pl.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(B)("textEditor.labels.title")),1),e.createElementVNode("div",O1,[pl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",W1,[E.title?(e.openBlock(),e.createElementBlock("span",q1,e.toDisplayString(E.title),1)):(e.openBlock(),e.createElementBlock("span",Z1,e.toDisplayString(wn.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:xe,value:E.title,onInput:tt,onFocus:Ae,onBlur:it,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!pl.value}]),placeholder:wn.value,disabled:E.disabled,rows:"1"},null,42,U1)])],2)):e.createCommentVNode("",!0),E.showTitle&&Fl.value&&pl.value?(e.openBlock(),e.createElementBlock("div",X1,[e.renderSlot(a.$slots,"title-slot")])):e.createCommentVNode("",!0),E.showDescription?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":Kl.value&&M.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(B)("textEditor.labels.description")),1),e.createElementVNode("div",Y1,[M.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",j1,[E.description?(e.openBlock(),e.createElementBlock("span",K1,e.toDisplayString(E.description),1)):(e.openBlock(),e.createElementBlock("span",G1,e.toDisplayString(Dl.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:je,value:E.description,onInput:wl,onFocus:kl,onBlur:Sl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!M.value}]),placeholder:Dl.value,disabled:E.disabled,rows:"1"},null,42,Q1)])],2)):e.createCommentVNode("",!0),E.showDescription&&Kl.value&&M.value?(e.openBlock(),e.createElementBlock("div",J1,[e.renderSlot(a.$slots,"description-slot")])):e.createCommentVNode("",!0),Lt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:6},e.renderList(ae.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":nl.value===s.id,"editor-comment-marker-group-out-of-view":s.opacity===0}]),"data-comment-id":s.id,style:e.normalizeStyle({top:s.top+"px"}),onMouseenter:i=>Ao(s),onMouseleave:ln},[s.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(i=>ko(s),["stop"])},[s.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.firstUser.avatar,alt:s.firstUser.name||"avatar"},null,8,lm)):(e.openBlock(),e.createElementBlock("span",nm,e.toDisplayString(s.firstUser.initials||(s.firstUser.name?s.firstUser.name.charAt(0):"")),1))],8,tm)):e.createCommentVNode("",!0),s.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(i=>ko(s),["stop"])},[s.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.secondUser.avatar,alt:s.secondUser.name||"avatar"},null,8,am)):(e.openBlock(),e.createElementBlock("span",sm,e.toDisplayString(s.secondUser.initials||(s.secondUser.name?s.secondUser.name.charAt(0):"")),1))],8,om)):e.createCommentVNode("",!0),s.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:s.secondUser?"30px":"15px"}),"data-has-second-user":s.secondUser?"true":"false",onClick:e.withModifiers(i=>ko(s),["stop"])},[e.createElementVNode("span",im,"+"+e.toDisplayString(s.additionalCount),1)],12,rm)):e.createCommentVNode("",!0)],46,em))),128)):e.createCommentVNode("",!0),E.richText?(e.openBlock(),e.createElementBlock("div",fm,[e.createElementVNode("div",{ref_key:"editorRef",ref:f,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":E.disabled,"dss-text-editor-fixed-height":E.fixedHeight}]),style:e.normalizeStyle(ql.value),onInput:At,onBlur:vn,onClick:Mo,onMouseup:_o,onKeyup:_o,onKeydown:jo,onPaste:qn,onMousemove:rn,onMouseleave:fl},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[Lt.value&&nl.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(y.value)},[q.value||at.value.length>0?(e.openBlock(),e.createElementBlock("div",hm,[e.createElementVNode("div",gm,[q.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:q.value},null,8,ym)):e.createCommentVNode("",!0)]),e.createElementVNode("div",km,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(at.value,(s,i)=>(e.openBlock(),e.createElementBlock("div",{key:i,class:"dss-comment-message"},[s.user&&(s.user.avatar||s.user.initials||s.user.name)?(e.openBlock(),e.createElementBlock("div",Cm,[e.createElementVNode("div",bm,[s.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.user.avatar,alt:s.user.name||"avatar"},null,8,wm)):(e.openBlock(),e.createElementBlock("span",xm,e.toDisplayString(s.user.initials||(s.user.name?s.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Em,[e.createElementVNode("div",Sm,[e.createElementVNode("div",Vm,e.toDisplayString(s.user&&s.user.name||"Comment"),1),s.createdAt?(e.openBlock(),e.createElementBlock("div",Nm,e.toDisplayString($(new Date(s.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":O(s.text)||s.class==="comment-started"}])},e.toDisplayString(s.text||""),3)]),T.commentUser&&s.user&&s.user.id===T.commentUser.id&&!O(s.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>uo(s,i),["stop"]),title:e.unref(B)("textEditor.comment.delete")||"Delete comment"},[...n[68]||(n[68]=[e.createElementVNode("svg",{width:"22",height:"25",viewBox:"0 0 22 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M19.5986 21.3535C19.5985 23.3679 18.1282 25 16.2891 25H5.30957C3.48166 24.9997 2.00011 23.3702 2 21.3535V8H19.5986V21.3535ZM8 11C7.44772 11 7 11.4477 7 12V20C7 20.5523 7.44772 21 8 21C8.55229 21 9 20.5523 9 20V12C9 11.4477 8.55229 11 8 11ZM14 11C13.4477 11 13 11.4477 13 12V20C13 20.5523 13.4477 21 14 21C14.5523 21 15 20.5523 15 20V12C15 11.4477 14.5523 11 14 11ZM13.2002 0C15.0227 0.000104554 16.4999 1.46937 16.5 3.27246V4.36328H20.9092C21.5117 4.36348 21.9998 4.84789 22 5.4541C22 6.05615 21.4986 6.54569 20.9092 6.5459H1.09082C0.488195 6.54569 0 6.06052 0 5.4541C0.000246661 4.85225 0.50153 4.36349 1.09082 4.36328H5.5L5.50098 3.27246C5.50112 1.46505 6.98382 0.000171185 8.80078 0H13.2002ZM8.79004 2.18164C8.19615 2.18167 7.70034 2.67042 7.7002 3.27246C7.7002 3.87899 8.18837 4.36325 8.79004 4.36328H13.21C13.8039 4.36325 14.2998 3.87462 14.2998 3.27246C14.2997 2.66606 13.8115 2.18167 13.21 2.18164H8.79004Z",fill:"#323232"})],-1)])],8,Bm)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Mm,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:x,"onUpdate:modelValue":n[26]||(n[26]=s=>g.value=s),class:"dss-comment-input",rows:"1",placeholder:e.unref(B)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(hn,["prevent","stop"]),["enter"]),onInput:n[27]||(n[27]=()=>{if(x.value){const s=x.value;s.style.height="auto",s.style.height=`${s.scrollHeight}px`}})},null,40,_m),[[e.vModelText,g.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(hn,["stop"])},[...n[69]||(n[69]=[e.createElementVNode("svg",{width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0.00999999 18L21 9L0.00999999 0L0 7L15 9L0 11L0.00999999 18Z",fill:"#31312F"})],-1)])])])],4)):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",$m,[e.createElementVNode("div",Lm,[e.createElementVNode("span",Tm,e.toDisplayString(il.value)+" "+e.toDisplayString(il.value===1?e.unref(B)("textEditor.footer.word"):e.unref(B)("textEditor.footer.words")),1),n[70]||(n[70]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Am,e.toDisplayString(vl.value)+" "+e.toDisplayString(vl.value===1?e.unref(B)("textEditor.footer.character"):e.unref(B)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",cm,[e.createElementVNode("textarea",{value:E.modelValue,onInput:D,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":E.fixedHeight}]),placeholder:mn.value,rows:E.rows,disabled:E.disabled,style:e.normalizeStyle(Kt.value)},null,46,um),e.createElementVNode("div",dm,[e.createElementVNode("div",mm,[e.createElementVNode("span",pm,e.toDisplayString(il.value)+" "+e.toDisplayString(il.value===1?e.unref(B)("textEditor.footer.word"):e.unref(B)("textEditor.footer.words")),1),n[67]||(n[67]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",vm,e.toDisplayString(vl.value)+" "+e.toDisplayString(vl.value===1?e.unref(B)("textEditor.footer.character"):e.unref(B)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[X.value&&fe.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(R.value),onMouseenter:n[28]||(n[28]=s=>me.value=!0),onMouseleave:Xl},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Vt,["stop"]),title:fe.value},e.toDisplayString(fe.value),9,Dm),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(hl,["stop"]),title:e.unref(B)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",Rm,[...n[71]||(n[71]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,Hm)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[U.value&&ke.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(W.value),onMouseenter:n[29]||(n[29]=s=>G.value=!0),onMouseleave:Dt},[e.createElementVNode("div",Fm,[ke.value===e.unref(B)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",Im,[...n[72]||(n[72]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z",fill:"#fafafa"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:"dss-image-popup-alt",title:ke.value},e.toDisplayString(ke.value),9,zm)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(_n,["stop"]),title:e.unref(B)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",Om,[...n[73]||(n[73]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,Pm)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[E.floatingToolbar&&E.richText&&Ge.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:Qe,class:"dss-floating-toolbar",style:e.normalizeStyle(be.value),onMousedown:n[44]||(n[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Wm,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(fn,["stop"]),title:e.unref(B)("textEditor.toolbar.undo")},[...n[74]||(n[74]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,qm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!jl.value}]),onClick:e.withModifiers(Hn,["stop"]),title:e.unref(B)("textEditor.toolbar.redo")},[...n[75]||(n[75]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,Zm),n[89]||(n[89]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Um,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[30]||(n[30]=e.withModifiers(s=>I("paragraph"),["stop"])),title:e.unref(B)("textEditor.toolbar.paragraphFormat")},[A.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:P.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Ym)):A.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:P.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,jm)):A.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:P.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Km)):A.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:P.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Gm)):A.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:P.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Qm)):A.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:P.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,Jm)):(e.openBlock(),e.createElementBlock("svg",e2,[...n[76]||(n[76]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),n[77]||(n[77]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Xm),ct.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[38]||(n[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[31]||(n[31]=s=>Bl("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[32]||(n[32]=s=>Bl("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[33]||(n[33]=s=>Bl("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[34]||(n[34]=s=>Bl("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[35]||(n[35]=s=>Bl("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[36]||(n[36]=s=>Bl("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[37]||(n[37]=s=>Bl("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),n[90]||(n[90]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ll("bold")}]),onClick:n[39]||(n[39]=e.withModifiers(s=>Il("bold"),["stop"])),title:e.unref(B)("textEditor.toolbar.bold")},[...n[78]||(n[78]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,t2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ll("italic")}]),onClick:n[40]||(n[40]=e.withModifiers(s=>Il("italic"),["stop"])),title:e.unref(B)("textEditor.toolbar.italic")},[...n[79]||(n[79]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,l2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ll("underline")}]),onClick:n[41]||(n[41]=e.withModifiers(s=>Il("underline"),["stop"])),title:e.unref(B)("textEditor.toolbar.underline")},[...n[80]||(n[80]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,n2),n[91]||(n[91]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ye.value}]),onClick:e.withModifiers(Sn,["stop"]),title:e.unref(B)("textEditor.toolbar.citation")},[...n[81]||(n[81]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,o2),n[92]||(n[92]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),Ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(mt,["stop"]),title:e.unref(B)("textEditor.toolbar.removeLink")},[...n[83]||(n[83]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,s2)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(ot,["stop"]),title:e.unref(B)("textEditor.toolbar.insertLink")},[...n[82]||(n[82]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,a2)),n[93]||(n[93]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ll("insertUnorderedList")}]),onClick:e.withModifiers(ce,["stop"]),title:e.unref(B)("textEditor.toolbar.bulletList")},[...n[84]||(n[84]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,r2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ll("insertOrderedList")}]),onClick:e.withModifiers(tl,["stop"]),title:e.unref(B)("textEditor.toolbar.numberList")},[...n[85]||(n[85]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,i2),n[94]||(n[94]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Un,["stop"]),title:e.unref(B)("textEditor.toolbar.image")},[...n[86]||(n[86]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,c2),Lt.value?(e.openBlock(),e.createElementBlock("div",u2)):e.createCommentVNode("",!0),Lt.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(B)("textEditor.toolbar.comment"),onClick:e.withModifiers(Ul,["stop"])},[...n[87]||(n[87]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,d2)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",m2)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",p2,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:n[42]||(n[42]=e.withModifiers(s=>I("askAi"),["stop"])),title:e.unref(B)("textEditor.toolbar.askAi")},[n[88]||(n[88]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",f2,e.toDisplayString(e.unref(B)("textEditor.toolbar.askAi")),1)],8,v2),ct.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[43]||(n[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(a.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),bl.value?(e.openBlock(),e.createElementBlock("div",h2,[E.askAi&&bl.value?(e.openBlock(),e.createElementBlock("div",g2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[$l(s)&&on(s)?(e.openBlock(),e.createElementBlock("div",y2,[e.renderSlot(a.$slots,s)])):e.createCommentVNode("",!0),$l(s)&&on(s)&&i<E.customToolbarSlots.length-1&&Dn(i)?(e.openBlock(),e.createElementBlock("div",k2)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),w2={class:"dss-color-picker__section-title"},x2={class:"dss-color-picker__presets-row"},E2=["title","onClick"],S2={key:1,class:"dss-color-picker__section"},V2={class:"dss-color-picker__presets-row"},N2=["title","onClick"],B2={key:2,class:"dss-color-picker__section"},M2={class:"dss-color-picker__section-header"},_2={class:"dss-color-picker__presets-row"},$2=["title","onClick"],L2=["onClick"],T2={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},A2=["title","onClick"],D2={class:"dss-color-picker__input-row"},H2=["value"],R2={__name:"DSSColorPicker",props:{modelValue:{type:String,default:"#b8a5de"},disabled:{type:Boolean,default:!1},presetColors:{type:Array,default:()=>[]},presetGroups:{type:Array,default:null},max:{type:Number,default:12},initialPresetCount:{type:Number,default:null},disableCustomColors:{type:Boolean,default:!1}},emits:["update:modelValue","update:presetColors"],setup(E,{emit:le}){function _(oe){const Y=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(oe);if(!Y)return{h:0,s:0,l:50};const j=parseInt(Y[1],16)/255,pe=parseInt(Y[2],16)/255,xe=parseInt(Y[3],16)/255,je=Math.max(j,pe,xe),Rt=Math.min(j,pe,xe);let jt=0,et=0;const pl=(je+Rt)/2;if(je!==Rt){const M=je-Rt;switch(et=pl>.5?M/(2-je-Rt):M/(je+Rt),je){case j:jt=((pe-xe)/M+(pe<xe?6:0))/6;break;case pe:jt=((xe-j)/M+2)/6;break;case xe:jt=((j-pe)/M+4)/6;break}}return{h:jt*360,s:et*100,l:pl*100}}function B(oe,Y,j){Y/=100,j/=100;const pe=Y*Math.min(j,1-j),xe=je=>{const Rt=(je+oe/30)%12,jt=j-pe*Math.max(Math.min(Rt-3,9-Rt,1),-1);return Math.round(255*jt).toString(16).padStart(2,"0")};return`#${xe(0)}${xe(8)}${xe(4)}`}function de(oe){const Y=oe.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!Y)return null;let j=Y[1];return j.length===3&&(j=j.split("").map(pe=>pe+pe).join("")),"#"+j}function P(oe){const Y=oe.match(/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})(?:[\s,\/]+[\d.]+)?\s*\)$/i);if(!Y)return null;const j=Math.max(0,Math.min(255,Number.parseInt(Y[1],10))),pe=Math.max(0,Math.min(255,Number.parseInt(Y[2],10))),xe=Math.max(0,Math.min(255,Number.parseInt(Y[3],10)));return`#${j.toString(16).padStart(2,"0")}${pe.toString(16).padStart(2,"0")}${xe.toString(16).padStart(2,"0")}`}function T(oe){if(typeof oe!="string")return null;const Y=oe.trim();return de(Y)||P(Y)}function he(oe,Y,j){Y/=100,j/=100;const pe=j+Y*Math.min(j,1-j),xe=pe===0?0:2-2*j/pe;return{h:oe,s:xe*100,v:pe*100}}function st(oe,Y,j){Y/=100,j/=100;const pe=j*(1-Y/2),xe=pe===0||pe===1?0:(j-pe)/Math.min(pe,1-pe);return{h:oe,s:xe*100,l:pe*100}}const te=E,f=le,we=e.ref(!1),Ce=e.ref(!1),J=e.ref(!1),X=e.ref(-1),fe=e.ref(-1),R=e.ref(null),me=e.ref(null),_e=e.ref(null),Je=e.ref(null),pt=e.ref({top:0,left:0}),Z=e.ref(_(te.modelValue||"#b8a5de")),Fe=e.computed(()=>Array.isArray(te.presetGroups)&&te.presetGroups.length>0),We=e.computed(()=>!te.disableCustomColors),Se=e.computed(()=>Fe.value?0:te.initialPresetCount!=null?te.initialPresetCount:fe.value<0?null:fe.value),Le=e.computed(()=>{const oe=Se.value;return oe==null?!0:Math.max(0,te.presetColors.length-oe)<te.max}),Ye=e.computed(()=>!!(Ce.value||X.value>=0||!ie.value&&te.presetColors.length===0));e.computed(()=>{const oe=Se.value;return oe!=null&&te.presetColors.length>oe});const ie=e.computed(()=>Fe.value||Se.value!=null),Ge=e.computed(()=>{const oe=Se.value;return oe==null?[]:te.presetColors.slice(0,oe)}),be=e.computed(()=>{const oe=Se.value;return oe==null?[]:te.presetColors.slice(oe)});function Qe(oe){const Y=Se.value;return Y!=null?Y+oe:-1}function ct(oe){const Y=Se.value;return Y!=null&&oe>=Y}function gt(oe){ct(oe)&&(X.value=oe,Z.value=_(te.presetColors[oe]),Ce.value=!0,e.nextTick(()=>Je.value?.focus()))}function ut(oe){if(!ct(oe))return;const Y=te.presetColors.filter((xe,je)=>je!==oe);f("update:presetColors",Y);const j=de(te.modelValue),pe=de(te.presetColors[oe]);if(j&&pe&&j.toLowerCase()===pe.toLowerCase()){const xe=Y[Math.max(0,oe-1)]||Y[0];xe&&f("update:modelValue",xe)}}function qt(){J.value=!J.value,J.value||(X.value=-1,Ce.value=!1)}function Zt(){if(!We.value||X.value<0)return;const oe=rt.value,Y=de(oe);if(Y){const j=[...te.presetColors];j[X.value]=Y,f("update:presetColors",j),f("update:modelValue",Y),X.value=-1,Ce.value=!1}}function kt(){te.disabled||!We.value||(X.value=-1,Ce.value=!Ce.value,Ce.value&&(G(),e.nextTick(()=>Je.value?.focus())))}function xt(oe){const Y=T(oe),j=T(te.modelValue);return Y&&j&&Y.toLowerCase()===j.toLowerCase()}function Yt(){if(te.disabled||!We.value||!Le.value)return;const oe=rt.value,Y=de(oe);if(Y){const j=[...te.presetColors,Y];f("update:presetColors",j),f("update:modelValue",Y);const pe=Se.value??fe.value;pe>=0&&j.length-pe>=te.max&&(Ce.value=!1)}}const rt=e.computed(()=>{const{h:oe,s:Y,l:j}=Z.value;return B(oe,Y,j)}),Jt=e.computed(()=>rt.value.toLowerCase()),yt=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${Z.value.h}, 100%, 50%))`})),ol=e.computed(()=>{const oe=he(Z.value.h,Z.value.s,Z.value.l);return{left:`${oe.s}%`,bottom:`${oe.v}%`,transform:"translate(-50%, 50%)"}}),U=e.computed(()=>({left:`${Z.value.h/360*100}%`,transform:"translateX(-50%)"})),ke=e.computed(()=>({position:"fixed",left:`${pt.value.left}px`,top:`${pt.value.top}px`,zIndex:1002}));function W(){if(!R.value||!we.value)return;const oe=R.value.getBoundingClientRect(),Y=window.innerHeight||document.documentElement.clientHeight;let j=oe.bottom+4;const pe=me.value;pe&&j+pe.offsetHeight>Y-8&&(j=oe.top-4-pe.offsetHeight),pt.value={top:j,left:oe.left}}function G(){const oe=te.modelValue||"#b8a5de",Y=T(oe);Y&&(Z.value=_(Y))}function Ne(){f("update:modelValue",rt.value)}function Ie(){te.disabled||(we.value=!we.value,we.value&&(G(),e.nextTick(()=>{W(),Je.value?.focus()})))}function Ue(){const oe=rt.value,Y=de(oe);if(Y){if(X.value>=0){const j=[...te.presetColors];j[X.value]=Y,f("update:presetColors",j),f("update:modelValue",Y)}else if(We.value&&(te.presetColors.length>0||Fe.value)&&Ce.value&&Le.value&&!te.presetColors.some(pe=>de(pe)?.toLowerCase()===Y.toLowerCase())){const pe=[...te.presetColors,Y];f("update:presetColors",pe),f("update:modelValue",Y)}}we.value=!1,Ce.value=!1,J.value=!1,X.value=-1}function Et(oe){if(!_e.value)return;const Y=_e.value.getBoundingClientRect(),j=pe=>{const xe=Math.max(0,Math.min(1,(pe.clientX-Y.left)/Y.width)),je=Math.max(0,Math.min(1,1-(pe.clientY-Y.top)/Y.height)),Rt={h:Z.value.h,s:xe*100,v:je*100};Z.value=st(Rt.h,Rt.s,Rt.v)};j(oe),document.addEventListener("mousemove",j),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",j),Ne()},{once:!0})}function Ke(oe){if(!oe.currentTarget)return;const j=oe.currentTarget.getBoundingClientRect(),pe=xe=>{const je=Math.max(0,Math.min(1,(xe.clientX-j.left)/j.width));Z.value={...Z.value,h:je*360}};pe(oe),document.addEventListener("mousemove",pe),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",pe),Ne()},{once:!0})}function Ut(oe){const Y=oe.target.value,j=T(Y);j&&(Z.value=_(j),f("update:modelValue",j))}function qe(oe){if(te.disabled)return;const Y=T(oe);Y&&(Z.value=_(Y),f("update:modelValue",Y))}let Pe=null,Ht=null;function $t(){Pe&&(document.removeEventListener("keydown",Pe),Pe=null),Ht&&(window.removeEventListener("resize",Ht),Ht=null)}return e.watch(we,oe=>{if($t(),oe){if(!Fe.value&&te.initialPresetCount==null){const Y=te.presetColors.length;Y>0&&(fe.value<0||Y<fe.value)&&(fe.value=Y)}Pe=Y=>{Y.key==="Escape"&&Ue()},Ht=W,document.addEventListener("keydown",Pe),window.addEventListener("resize",Ht)}}),e.watch(()=>te.modelValue,()=>{we.value&&G()},{immediate:!1}),e.watch(be,oe=>{oe.length===0&&(J.value=!1,X.value=-1,Ce.value=!1)}),e.onBeforeUnmount($t),(oe,Y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":E.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:R,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":we.value}]),onClick:Ie},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:rt.value})},[...Y[0]||(Y[0]=[e.createElementVNode("span",{class:"dss-color-picker__hover-layer"},[e.createElementVNode("svg",{class:"dss-color-picker__pen-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})])],-1)])],4)],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[we.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(Ue,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:me,class:"dss-color-picker__dropdown",style:e.normalizeStyle(ke.value)},[ie.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Fe.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(E.presetGroups,(j,pe)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+pe,class:"dss-color-picker__section"},[e.createElementVNode("span",w2,e.toDisplayString(j.title),1),e.createElementVNode("div",x2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.colors,(xe,je)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+pe+"-"+je,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":xt(xe)}]),style:e.normalizeStyle({backgroundColor:xe,"--dss-preset-color":xe}),title:xe,onClick:e.withModifiers(Rt=>qe(xe),["stop"])},null,14,E2))),128))])]))),128)):Ge.value.length?(e.openBlock(),e.createElementBlock("div",S2,[Y[1]||(Y[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",V2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ge.value,(j,pe)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+pe,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":xt(j)}]),style:e.normalizeStyle({backgroundColor:j,"--dss-preset-color":j}),title:j,onClick:e.withModifiers(xe=>qe(j),["stop"])},null,14,N2))),128))])])):e.createCommentVNode("",!0),We.value?(e.openBlock(),e.createElementBlock("div",B2,[e.createElementVNode("div",M2,[Y[3]||(Y[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),be.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__manage-icon",{"dss-color-picker__manage-icon--active":J.value}]),title:"Manage custom colors",onClick:e.withModifiers(qt,["stop"])},[...Y[2]||(Y[2]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64V11.67c0 .19.15.33.33.33h2.03c.09 0 .17-.03.23-.1l7.28-7.27-2.5-2.5L.1 9.4A.33.33 0 0 0 0 9.64ZM11.8 2.69c.26-.26.26-.68 0-.94L10.25.2a.66.66 0 0 0-.94 0L8.09 1.41l2.5 2.5 1.22-1.22Z",fill:"currentColor"})],-1)])],2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",_2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(be.value,(j,pe)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+pe,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":J.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!J.value&&xt(j),"dss-color-picker__preset-bubble--editing":J.value&&X.value===Qe(pe)}]),style:e.normalizeStyle({backgroundColor:X.value===Qe(pe)?rt.value:j,"--dss-preset-color":X.value===Qe(pe)?rt.value:j}),title:X.value===Qe(pe)?rt.value:j,onClick:e.withModifiers(xe=>J.value?gt(Qe(pe)):qe(j),["stop"])},null,14,$2),J.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__preset-action dss-color-picker__preset-action--delete",title:"Delete",onClick:e.withModifiers(xe=>ut(Qe(pe)),["stop"])},[...Y[4]||(Y[4]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)])],8,L2)):e.createCommentVNode("",!0)],2))),128)),Le.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":Ce.value}]),onClick:e.withModifiers(kt,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],64)):E.presetColors.length?(e.openBlock(),e.createElementBlock("div",T2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.presetColors,(j,pe)=>(e.openBlock(),e.createElementBlock("button",{key:pe,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":xt(j)}]),style:e.normalizeStyle({backgroundColor:j,"--dss-preset-color":j}),title:j,onClick:e.withModifiers(xe=>qe(j),["stop"])},null,14,A2))),128)),We.value&&Le.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":Ce.value}]),onClick:e.withModifiers(kt,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Ye.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:_e,onMousedown:Et},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(yt.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(ol.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:Ke},[Y[5]||(Y[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(U.value)},null,4)],32),e.createElementVNode("div",D2,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:Je,type:"text",class:"dss-color-picker__hex-input",value:Jt.value,onInput:Ut},null,40,H2)]),We.value&&ie.value&&(E.presetColors.length||Fe.value)&&Le.value&&X.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:Yt}," Save color ")):e.createCommentVNode("",!0),We.value&&ie.value&&X.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:Zt}," Save color ")):e.createCommentVNode("",!0),ie.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:Ue}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},F2={key:0,class:"dss-loader"},I2={key:0,class:"dss-loader-label"},z2={key:1,class:"dss-loader"},P2={key:0,class:"dss-loader-label"},O2={key:2,class:"dss-loader"},W2={key:0,class:"dss-loader-label"},q2={key:3,class:"dss-loader"},Z2={key:0,class:"dss-loader-label"},U2={key:4,class:"dss-loader"},X2={key:0,class:"dss-loader-label"},Y2={key:5,class:"dss-loader dss-loader--inline"},j2={class:"dss-loader-inline-text"},K2={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""}},setup(E){const le=E,_=e.computed(()=>le.size==="small"?"dss-loaders--size-small":le.size==="large"?"dss-loaders--size-large":le.size==="medium"||le.size==null?"dss-loaders--size-medium":null),B=e.computed(()=>{const de={};if(!(le.size==="small"||le.size==="medium"||le.size==="large"||le.size==null)){const P=typeof le.size=="number"?`${le.size}px`:String(le.size);de["--dss-loader-size"]=P}return le.color&&(de["--dss-loader-accent"]=le.color,de["--dss-loader-accent-soft"]=`color-mix(in srgb, ${le.color} 30%, white)`),de});return(de,P)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",_.value]),style:e.normalizeStyle(B.value)},[E.type==="spinner"?(e.openBlock(),e.createElementBlock("div",F2,[P[0]||(P[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),E.label?(e.openBlock(),e.createElementBlock("span",I2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="dots"?(e.openBlock(),e.createElementBlock("div",z2,[P[1]||(P[1]=e.createElementVNode("span",{class:"dss-loader-dots","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"})],-1)),E.label?(e.openBlock(),e.createElementBlock("span",P2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="battery"?(e.openBlock(),e.createElementBlock("div",O2,[P[2]||(P[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),E.label?(e.openBlock(),e.createElementBlock("span",W2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",q2,[P[3]||(P[3]=e.createElementVNode("span",{class:"dss-loader-double-circle","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-double-circle-outer"}),e.createElementVNode("span",{class:"dss-loader-double-circle-inner"})],-1)),E.label?(e.openBlock(),e.createElementBlock("span",Z2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="bars"?(e.openBlock(),e.createElementBlock("div",U2,[P[4]||(P[4]=e.createElementVNode("span",{class:"dss-loader-bars","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"})],-1)),E.label?(e.openBlock(),e.createElementBlock("span",X2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="inline"?(e.openBlock(),e.createElementBlock("div",Y2,[P[5]||(P[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",j2,[e.renderSlot(de.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(E.label),1)])])])):e.createCommentVNode("",!0)],6))}},Sa="dss-skeleton-item",G2={__name:"DSSSkeleton",props:{loading:{type:Boolean,default:!1},darkMode:{type:Boolean,default:!1},borderRadius:{type:String,default:"16px"},shimmer:{type:Boolean,default:!0},mode:{type:String,default:"single",validator:E=>["single","multiple"].includes(E)},targetClass:{type:String,default:Sa},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(E){const le=E,_=e.computed(()=>{const P={"dss-skeleton--loading":le.loading,"dss-skeleton--static":!le.shimmer,"dss-skeleton--multiple":le.mode==="multiple","dss-skeleton--dark":le.darkMode};return le.mode==="multiple"&&le.targetClass!==Sa&&(P[`dss-skeleton--target-${le.targetClass}`]=!0),P}),B=e.computed(()=>{const P={};return le.borderRadius&&(P.borderRadius=le.borderRadius),P}),de=e.computed(()=>{const P={};return le.borderRadius&&(P["--dss-skeleton-border-radius"]=le.borderRadius),le.darkMode?(P["--dss-skeleton-bg"]=le.bgDark||"#322c3f",P["--dss-skeleton-shimmer"]=le.shimmerDark||"#3e3f41",P):(le.bgColor&&(P["--dss-skeleton-bg"]=le.bgColor),le.shimmerColor&&(P["--dss-skeleton-shimmer"]=le.shimmerColor),P)});return(P,T)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",_.value]),style:e.normalizeStyle(de.value)},[E.loading&&E.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(B.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":E.loading&&E.mode==="single"}])},[e.renderSlot(P.$slots,"default")],2)],6))}},Q2={key:0,class:"dss-dnd-column-header"},J2={class:"dss-dnd-column-title"},e0={class:"dss-dnd-column-count"},t0=["data-column"],l0={key:0,class:"dss-dnd-indicator"},n0=["onPointerdown"],o0=["onPointerdown"],a0={class:"dss-dnd-item-content"},s0={class:"dss-dnd-item-default"},r0={key:0,class:"dss-dnd-empty"},i0={name:"DSSDnd"},c0=Object.assign(i0,{props:{items:{type:Array,required:!0},columns:{type:Array,required:!0},columnKey:{type:String,default:"status"},positionKey:{type:String,default:"position"},itemKey:{type:String,default:"id"},options:{type:Object,default:()=>({})}},emits:["move","delete"],setup(E,{emit:le}){const _=E,B=le,de=e.useSlots(),P=e.computed(()=>!!de["delete-zone"]),T={columnMinWidth:"280px",columnMaxWidth:"none",columnGap:"12px",indicatorColor:"#7c6bc4",dragGhostOpacity:.75,dragSourceBackground:"#f5f5f5",dragSourceBorder:"#e0e0e0",useHandle:!1,columnBodyMaxHeight:"none",showHeader:!0,unstyled:!1,deleteZoneAlwaysVisible:!1,ColColor:!1},he=e.computed(()=>({...T,..._.options})),st=e.computed(()=>({"--dss-dnd-col-min-w":he.value.columnMinWidth,"--dss-dnd-col-max-w":he.value.columnMaxWidth,"--dss-dnd-col-gap":he.value.columnGap,"--dss-dnd-indicator-color":he.value.indicatorColor,"--dss-dnd-body-max-h":he.value.columnBodyMaxHeight}));function te(W){if(!he.value.ColColor||!W)return{};const G=W.background||W.color;return G?{background:G}:{}}const f=e.ref(null),we=e.ref(null),Ce=e.ref(!1),J=e.ref(-1),X=e.ref(null);let fe=null,R=null,me=null,_e=null,Je=0,pt=0,Z="",Fe=null;const We=5,Se=e.computed(()=>{const W={};for(const G of _.columns)W[G.value]=_.items.filter(Ne=>Ne[_.columnKey]===G.value).sort((Ne,Ie)=>(Ne[_.positionKey]??0)-(Ie[_.positionKey]??0));return W}),Le=e.computed(()=>{const W={},G=!!f.value,Ne=f.value?.[_.itemKey],Ie=we.value,Ue=J.value;for(const Et of _.columns){const Ke=Se.value[Et.value]||[],Ut=[],qe=Ie==Et.value;let Pe=0;for(let Ht=0;Ht<Ke.length;Ht++){const $t=Ke[Ht],oe=G&&$t[_.itemKey]===Ne;!oe&&qe&&Ue===Pe&&Ut.push({type:"indicator",key:`ind-${Pe}`}),oe||Pe++,Ut.push({type:"item",item:$t,isDragged:oe,key:`item-${$t[_.itemKey]}`})}qe&&Ue>=Pe&&Ut.push({type:"indicator",key:"ind-end"}),W[Et.value]=Ut}return W});function Ye(W,G){const Ie=(Se.value[W]||[]).filter(Ke=>Ke[_.itemKey]!==f.value?.[_.itemKey]);if(Ie.length===0)return 1;if(G<=0){const Ke=Ie[0][_.positionKey];return Ke!=null&&Ke>0?Ke/2:.5}if(G>=Ie.length){const Ke=Ie[Ie.length-1][_.positionKey];return(Ke??0)+1}const Ue=Ie[G-1][_.positionKey]??0,Et=Ie[G][_.positionKey]??0;return(Ue+Et)/2}function ie(W,G,Ne){me&&me.remove();const Ie=W.getBoundingClientRect(),Ue=W.cloneNode(!0);Ue.classList.add("dss-dnd-ghost"),Ue.style.cssText=`
|
|
106
106
|
position: fixed;
|
|
107
|
-
left: ${G-
|
|
108
|
-
top: ${Ne-
|
|
109
|
-
width: ${
|
|
110
|
-
height: ${
|
|
107
|
+
left: ${G-Je}px;
|
|
108
|
+
top: ${Ne-pt}px;
|
|
109
|
+
width: ${Ie.width}px;
|
|
110
|
+
height: ${Ie.height}px;
|
|
111
111
|
z-index: 9999;
|
|
112
112
|
pointer-events: none;
|
|
113
|
-
opacity: ${
|
|
113
|
+
opacity: ${he.value.dragGhostOpacity};
|
|
114
114
|
box-sizing: border-box;
|
|
115
115
|
box-shadow: 0 8px 24px rgba(0,0,0,0.15);
|
|
116
|
-
background-color: ${
|
|
116
|
+
background-color: ${he.value.dragSourceBackground};
|
|
117
117
|
font-family: 'Work Sans', sans-serif;
|
|
118
118
|
cursor: grabbing;
|
|
119
|
-
`,document.body.appendChild(Xe),ue=Xe}function Qe(W,G){ue&&(ue.style.left=`${W-tt}px`,ue.style.top=`${G-mt}px`)}function Ce(W){W.classList.add("dss-dnd-item--dragging"),W.style.background=fe.value.dragSourceBackground,W.style.borderColor=fe.value.dragSourceBorder,W.style.transform="scale(0.97)"}function Je(W){W.classList.remove("dss-dnd-item--dragging"),W.style.background="",W.style.borderColor="",W.style.transform=""}function ut(W,G){return document.elementFromPoint(W,G)?.closest(".dss-dnd-column-body")??null}function ht(W,G){return!!document.elementFromPoint(W,G)?.closest("[data-dss-dnd-delete-zone]")}function dt(W,G){if(O.value&&ht(W,G)){ke.value=!0,be.value=null,J.value=-1;return}ke.value=!1;const Ne=ut(W,G),Pe=Ne?.getAttribute("data-column")??null;if(!Pe){be.value=null,J.value=-1;return}be.value=Pe;const Xe=Ne.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let Et=Xe.length;for(let Ge=0;Ge<Xe.length;Ge++){const Zt=Xe[Ge].getBoundingClientRect();if(G<Zt.top+Zt.height/2){Et=Ge;break}}J.value=Et}function Wt(W){W.preventDefault(),Qe(W.clientX,W.clientY),!me&&(me=requestAnimationFrame(()=>{me=null,dt(W.clientX,W.clientY)}))}function qt(W){window.removeEventListener("pointermove",Wt),window.removeEventListener("pointerup",qt),window.removeEventListener("pointercancel",qt),$e?.releasePointerCapture?.(W.pointerId),Je($e),$e=null;const G=O.value&&ht(W.clientX,W.clientY);if(v.value&&G)V("delete",{item:v.value});else{const Pe=ut(W.clientX,W.clientY)?.getAttribute("data-column")??null;if(v.value&&Pe){const Xe=v.value[$.columnKey],Et=Pe,Zt=(Ve.value[Et]||[]).filter(Lt=>Lt[$.itemKey]!==v.value[$.itemKey]),Ue=Math.max(0,Math.min(J.value,Zt.length)),We=je(Et,Ue),Dt=v.value[$.itemKey];V("move",{item:v.value,from:Xe,to:Et,position:We,index:Ue}),F&&clearTimeout(F),Y.value={id:Dt,from:Xe,to:Et},F=setTimeout(()=>{Y.value=null},3500)}}ue&&(ue.remove(),ue=null),U!==null&&(document.body.style.cursor=U,U=""),ge()}function Ct(W,G){W.preventDefault();const Ne=W.target.closest(".dss-dnd-item");if(!Ne)return;const Pe=Ne.getBoundingClientRect();tt=W.clientX-Pe.left,mt=W.clientY-Pe.top,U=document.body.style.cursor,document.body.style.cursor="grabbing",v.value=G,$e=Ne,re(Ne,W.clientX,W.clientY),requestAnimationFrame(()=>Ce(Ne)),Ne.setPointerCapture?.(W.pointerId),window.addEventListener("pointermove",Wt),window.addEventListener("pointerup",qt,{once:!0}),window.addEventListener("pointercancel",qt,{once:!0})}function wt(){ze&&(window.removeEventListener("pointermove",Yt),window.removeEventListener("pointerup",it),window.removeEventListener("pointercancel",it),ze=null)}function Yt(W){if(!ze||W.pointerId!==ze.pointerId)return;const G=W.clientX-ze.startX,Ne=W.clientY-ze.startY;if(Math.abs(G)>=qe||Math.abs(Ne)>=qe){const Pe=ze.item;wt(),Ct(W,Pe)}}function it(W){!ze||W.pointerId!==ze.pointerId||wt()}function Kt(W,G){wt(),ze={item:G,startX:W.clientX,startY:W.clientY,pointerId:W.pointerId},window.addEventListener("pointermove",Yt),window.addEventListener("pointerup",it),window.addEventListener("pointercancel",it)}function yt(W,G){fe.value.useHandle||Kt(W,G)}function el(W,G){Kt(W,G)}function X(){me&&(cancelAnimationFrame(me),me=null)}function ge(){X(),v.value=null,be.value=null,ke.value=!1,J.value=-1}return e.onBeforeUnmount(()=>{X(),wt(),F&&clearTimeout(F),ue&&(ue.remove(),ue=null)}),(W,G)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":fe.value.unstyled}]),style:e.normalizeStyle(rt.value)},[O.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["dss-dnd-delete-zone",{"dss-dnd-delete-zone--drag-over":ke.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(W.$slots,"delete-zone",{isDragging:!!v.value,isOver:ke.value})],2),[[e.vShow,!!v.value||fe.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.columns,Ne=>(e.openBlock(),e.createElementBlock("div",{key:Ne.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":be.value==Ne.value},Ne.class||""]]),style:e.normalizeStyle(ee(Ne))},[fe.value.showHeader?(e.openBlock(),e.createElementBlock("div",e0,[e.renderSlot(W.$slots,"column-header",{column:Ne,items:Ve.value[Ne.value]||[]},()=>[e.createElementVNode("span",t0,e.toDisplayString(Ne.title||Ne.value),1),e.createElementVNode("span",l0,e.toDisplayString((Ve.value[Ne.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":Ne.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Le.value[Ne.value],Pe=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Pe.key},[Pe.type==="indicator"?(e.openBlock(),e.createElementBlock("div",o0)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":Pe.isDragged,"dss-dnd-item--no-handle":!fe.value.useHandle}]),onPointerdown:Xe=>yt(Xe,Pe.item)},[fe.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(Xe=>el(Xe,Pe.item),["stop"])},[e.renderSlot(W.$slots,"handle",{},()=>[G[0]||(G[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,s0)):e.createCommentVNode("",!0),e.createElementVNode("div",r0,[e.renderSlot(W.$slots,"item",{item:Pe.item,column:Ne,justDropped:Y.value?.id===Pe.item[E.itemKey],droppedFrom:Y.value?.id===Pe.item[E.itemKey]?Y.value.from:null,droppedTo:Y.value?.id===Pe.item[E.itemKey]?Y.value.to:null},()=>[e.createElementVNode("div",i0,e.toDisplayString(Pe.item[E.itemKey]),1)])])],42,a0))],64))),128)),(Ve.value[Ne.value]||[]).length===0&&be.value!=Ne.value?(e.openBlock(),e.createElementBlock("div",c0,[e.renderSlot(W.$slots,"empty",{column:Ne},()=>[G[1]||(G[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,n0)],6))),128))],6))}}),m0={name:"DSSConfetti"},p0=Object.assign(m0,{props:{trigger:{type:Boolean,default:!1},duration:{type:Number,default:3e3},fadeStart:{type:Number,default:2e3},count:{type:Number,default:90},colors:{type:Array,default:()=>["#047395","#ffc230","#0897c1","#fe3b59","#11e1a2","#b3b2fb","#fadb8d","#ffa25b","#feaab1"]},delay:{type:Number,default:300}},setup(E){const te=E,$=e.ref(null),V=e.ref(!1);let ce=[],O=null,L=null;function fe(J,Y){const me=[];for(let F=0;F<te.count;F++)me.push(rt(J));return me}function rt(J,Y){return{x:Math.random()*J,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:te.colors[Math.floor(Math.random()*te.colors.length)],tilt:Math.floor(Math.random()*10)-10,tiltInc:Math.random()*.08+.04,tiltAngle:0,opacity:Math.random()*.7+.3,speed:Math.random()*4+1.5}}function ee(J,Y,me,F){J.clearRect(0,0,Y,me);for(const ue of ce)J.save(),J.globalAlpha=ue.opacity*F,J.beginPath(),J.lineWidth=ue.r,J.strokeStyle=ue.color,J.moveTo(ue.x+ue.tilt+ue.r/2,ue.y),J.lineTo(ue.x+ue.tilt,ue.y+ue.tilt+ue.r/2),J.stroke(),J.restore()}function v(J,Y,me){const F=.3+me*.7;for(let ue=0;ue<ce.length;ue++){const $e=ce[ue];$e.tiltAngle+=$e.tiltInc,$e.y+=$e.speed*F,$e.x+=Math.sin($e.d)*.5*F,$e.tilt=Math.sin($e.tiltAngle)*15,me>=.99&&$e.y>Y+20&&(ce[ue]=rt(J))}}function be(){V.value=!0,e.nextTick(()=>{const J=$.value;if(!J)return;const Y=J.getContext("2d"),me=J.parentElement;if(!me)return;const F=me.getBoundingClientRect();J.width=F.width,J.height=F.height,ce=fe(J.width,J.height);const ue=Date.now(),$e=ue+te.duration,tt=()=>{const mt=Date.now(),U=mt-ue;if(mt<$e){let ze=1;U>te.fadeStart&&(ze=1-(U-te.fadeStart)/(te.duration-te.fadeStart)),ee(Y,J.width,J.height,ze),v(J.width,J.height,ze),O=requestAnimationFrame(tt)}else ke()};tt()})}function ke(){O&&(cancelAnimationFrame(O),O=null),ce=[],V.value=!1}return e.watch(()=>te.trigger,J=>{J&&(L&&clearTimeout(L),L=setTimeout(be,te.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{ke(),L&&clearTimeout(L)}),(J,Y)=>V.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:$,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),f0={class:"dss-filter-global-inner"},v0=["placeholder","value"],h0=["title"],g0={key:0,class:"dss-filter-funnel-badge"},y0={key:1,class:"dss-filter-sortby"},k0=["value"],C0=["value"],b0=["disabled","title"],x0={key:0,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},w0={key:1,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},E0={key:2,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},S0={class:"dss-filter-panel"},V0={key:0,class:"dss-filter-empty"},N0={class:"dss-filter-row-prefix"},B0={class:"dss-filter-cell"},M0=["onClick"],_0={class:"dss-filter-trigger-text"},$0=["placeholder"],L0={class:"dss-filter-popup-list"},A0=["onClick"],T0={key:0,class:"dss-filter-popup-empty"},D0={key:0,class:"dss-filter-cell"},H0=["onClick"],R0={class:"dss-filter-trigger-text"},F0={class:"dss-filter-popup-list"},I0=["onClick"],z0={key:1,class:"dss-filter-cell dss-filter-cell--value"},P0=["placeholder","onUpdate:modelValue"],O0={key:1,class:"dss-filter-date-wrap"},W0=["placeholder","onUpdate:modelValue"],q0=["placeholder","value","onInput","step"],Z0={key:4,class:"dss-filter-between"},U0=["placeholder","value","onInput","step"],X0={class:"dss-filter-between-sep"},Y0=["placeholder","value","onInput","step"],j0={key:5,class:"dss-filter-multiselect"},K0=["onClick"],G0={class:"dss-filter-trigger-text"},Q0=["placeholder"],J0={class:"dss-filter-popup-list dss-filter-popup-list--check"},ep=["onClick"],tp=["checked"],lp={key:0,class:"dss-filter-popup-empty"},np=["onClick"],op={class:"dss-filter-foot"},ap={class:"dss-filter-cell"},sp=["placeholder"],rp={class:"dss-filter-popup-list"},ip=["onClick"],cp={key:0,class:"dss-filter-popup-divider"},up=["onClick"],dp=["placeholder"],mp={class:"dss-filter-popup-list"},pp=["onClick"],fp={key:0,class:"dss-filter-popup-empty"},vp=["placeholder"],hp={class:"dss-filter-popup-list"},gp=["onClick"],yp={key:0,class:"dss-filter-popup-empty"},kp={name:"DSSFilter"},Cp=Object.assign(kp,{props:{data:{type:Array,required:!0},modelValue:{type:Array,default:void 0},exclude:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})},showSortBy:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(E,{expose:te,emit:$}){const{t:V}=ro.useI18n(),ce=E,O=$,L={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},fe=e.computed(()=>({...L,...ce.options})),rt={text:[{value:"contains"},{value:"not_contains"},{value:"equals"},{value:"not_equals"},{value:"starts_with"},{value:"ends_with"},{value:"is_empty"},{value:"is_not_empty"}],select:[{value:"is_any_of"},{value:"is_none_of"},{value:"is_empty"},{value:"is_not_empty"}],range:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],int:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],arraySelect:[{value:"contains_any"},{value:"contains_all"},{value:"not_contains_any"},{value:"is_empty"},{value:"is_not_empty"}],arrayText:[{value:"contains"},{value:"not_contains"},{value:"is_empty"},{value:"is_not_empty"}],date:[{value:"eq"},{value:"before"},{value:"after"},{value:"is_empty"},{value:"is_not_empty"}],boolean:[{value:"is_true"},{value:"is_false"},{value:"is_empty"},{value:"is_not_empty"}]},ee=new Set(["is_empty","is_not_empty","is_true","is_false"]),v=["label","name","title","keyword","full_name","value","text"],be=e.ref(""),ke=e.ref([]),J=e.ref(null),Y=e.ref(!1),me=e.ref(null),F=e.ref(""),ue=e.ref(null),$e=e.ref(""),tt=e.ref("asc");let mt=1;function U(M){const x=M.find(A=>A&&typeof A=="object");if(!x)return null;for(const A of v)if(A in x&&typeof x[A]=="string")return A;return Object.keys(x).find(A=>typeof x[A]=="string")||null}function ze(M,x){const A=x.filter(ae=>ae!=null&&ae!=="NULL");if(A.length===0)return null;if(A.every(ae=>Array.isArray(ae))){const ae=A.flatMap(Fe=>Fe).filter(Fe=>Fe!=null);return ae.length===0?null:typeof ae.find(Fe=>Fe!=null)=="object"?"arraySelect":"arrayText"}return A.every(ae=>typeof ae=="boolean")?"boolean":A.every(ae=>typeof ae=="number")?new Set(A).size<=fe.value.maxUniqueForEnum?"select":"range":A.every(ae=>typeof ae=="string")?new Set(A).size<=fe.value.maxUniqueForSelect?"select":"text":A.some(ae=>typeof ae=="object"&&!Array.isArray(ae))?null:"text"}const qe=e.computed(()=>{if(!ce.data?.length)return[];const M=new Set;for(const oe of ce.data)if(oe&&typeof oe=="object")for(const Fe of Object.keys(oe))M.add(Fe);const x=new Set(ce.exclude),A=[];for(const oe of M){if(x.has(oe))continue;const Fe=ce.config[oe]||{},bt=ce.data.map(St=>St?.[oe]),ot=Fe.type||ze(oe,bt);if(!ot)continue;const Ie=Fe.filterMode||"contain",xt=Ie==="date"?"date":Ie==="string"?"text":ot,Mt={key:oe,label:Fe.label||et(oe),type:xt,filterMode:Ie};if(ot==="select"){const St=bt.filter(At=>At!=null&&At!=="NULL");Mt.uniqueValues=[...new Set(St)].sort((At,It)=>typeof At=="number"&&typeof It=="number"?At-It:String(At).localeCompare(String(It)))}else if(ot==="range"||ot==="int"){const St=bt.filter(At=>typeof At=="number");Mt.min=Math.min(...St),Mt.max=Math.max(...St)}else if(ot==="arraySelect"){const St=Fe.displayKey||U(bt.flatMap(At=>Array.isArray(At)?At:[]));if(Mt.displayKey=St,Array.isArray(Fe.uniqueValues)&&Fe.uniqueValues.length>0)Mt.uniqueValues=Fe.uniqueValues.map(At=>String(At));else{const At=bt.flatMap(It=>Array.isArray(It)?It:[]).filter(It=>It!=null).map(It=>St&&typeof It=="object"?It[St]:String(It)).filter(It=>It!=null&&It!=="");Mt.uniqueValues=[...new Set(At)].sort((It,Nt)=>String(It).localeCompare(String(Nt)))}}A.push(Mt)}const ae=ce.config._order;return ae&&A.sort((oe,Fe)=>{const bt=ae.indexOf(oe.key),ot=ae.indexOf(Fe.key);return bt===-1&&ot===-1?0:bt===-1?1:ot===-1?-1:bt-ot}),A}),Ve=e.computed(()=>{const M={};for(const x of qe.value)M[x.key]=x;return M}),Le=e.computed(()=>Array.isArray(ce.config.groups)&&ce.config.groups.length>0),je=e.computed(()=>{if(!Le.value)return[];const M=new Set(qe.value.map(x=>x.key));return ce.config.groups.map(x=>({...x,keys:x.keys.filter(A=>M.has(A))})).filter(x=>x.keys.length>0)}),re=e.computed(()=>{if(!Le.value)return[];const M=new Set(ce.config.groups.flatMap(x=>x.keys));return qe.value.filter(x=>!M.has(x.key))}),Qe=e.computed(()=>{if(!ue.value)return[];const M=new Set(ue.value.keys),x=qe.value.filter(ae=>M.has(ae.key));if(!F.value)return x;const A=F.value.toLowerCase();return x.filter(ae=>ae.label.toLowerCase().includes(A))}),Ce=e.computed(()=>{if(!F.value)return qe.value;const M=F.value.toLowerCase();return qe.value.filter(x=>x.label.toLowerCase().includes(M))}),Je=e.computed(()=>qe.value.filter(M=>!["arraySelect","arrayText"].includes(M.type))),ut=e.computed(()=>$e.value?tt.value==="asc"?"Ascending":"Descending":"No sort selected");function ht(M){J.value===M?dt():(J.value=M,F.value="",ue.value=null)}function dt(){J.value=null,F.value="",ue.value=null}function Wt(M){const x=M.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");J.value&&!x&&!M.target.closest(".dss-filter-popup")&&!M.target.closest(".dss-filter-trigger")&&!M.target.closest(".dss-filter-add-btn")&&dt(),Y.value&&me.value&&!me.value.contains(M.target)&&(x||(Y.value=!1))}e.onMounted(()=>document.addEventListener("click",Wt)),e.onBeforeUnmount(()=>document.removeEventListener("click",Wt));function qt(M){return Ve.value[M]?.label||et(M)}function Ct(M){return Ve.value[M.key]?.filterMode||"contain"}function wt(M){return V(`filter.operators.${M}`)}function Yt(M){const x=Ve.value[M.key];return(rt[x?.type]||rt.text).map(A=>({...A,label:V(`filter.operators.${A.value}`)}))}function it(M){return ee.has(M)}function Kt(M){const x=Ve.value[M.key];return x?x.type==="date"?"date":x.type==="boolean"?"boolean":x.type==="text"||x.type==="arrayText"?"text":x.type==="select"||x.type==="arraySelect"?"multiselect":x.type==="range"||x.type==="int"?M.operator==="between"?"between":"number":"text":"text"}function yt(M){return rt[M]?.[0]?.value||"contains"}function el(M,x){return ee.has(x)||M==="date"?null:M==="select"||M==="arraySelect"?[]:(M==="range"||M==="int")&&x==="between"?{min:null,max:null}:M==="range"||M==="int"?null:""}function X(M){return Ve.value[M.key]?.uniqueValues||[]}function ge(M){const x=X(M);if(!F.value)return x;const A=F.value.toLowerCase();return x.filter(ae=>String(ae).toLowerCase().includes(A))}function W(M){const x=M.value;return!x||x.length===0?V("filter.select"):x.length<=2?x.join(", "):V("filter.selectedCount",{count:x.length})}function G(M){const x=Ve.value[M],A=x?.filterMode||"contain",ae=x?.type||"text",oe=A==="string"?"contains":yt(ae);ke.value.push(e.reactive({id:mt++,key:M,operator:oe,value:el(ae,oe)})),dt()}function Ne(M){ke.value=ke.value.filter(x=>x.id!==M)}function Pe(M,x){const ae=Ve.value[x]?.type||"text";M.key=x,M.operator=yt(ae),M.value=el(ae,M.operator),dt()}function Xe(M,x){const A=Kt(M);M.operator=x;const ae=Kt(M);if(A!==ae||ee.has(x)){const oe=Ve.value[M.key];M.value=el(oe?.type||"text",x)}dt()}function Et(M,x){const A=x.target.value;M.value=A===""?null:Number(A)}function Ge(M,x,A){const ae=A.target.value,oe=ae===""?null:Number(ae);(!M.value||typeof M.value!="object")&&(M.value={min:null,max:null}),M.value={...M.value,[x]:isNaN(oe)?null:oe}}function Zt(M,x){const A=M.value||[],ae=A.indexOf(x);M.value=ae>=0?A.filter(oe=>oe!==x):[...A,x]}function Ue(){ke.value=[],be.value="",dt()}function We(M){be.value=M.target.value}function Dt(M){$e.value=M.target.value}function Lt(){tt.value=tt.value==="asc"?"desc":"asc"}const ne=e.computed(()=>{if(!ce.data)return[];let M=ce.data;if(be.value){const x=be.value.toLowerCase();M=M.filter(A=>{for(const ae of Object.keys(A)){const oe=A[ae];if(typeof oe=="string"&&oe.toLowerCase().includes(x)||typeof oe=="number"&&String(oe).includes(x)||Array.isArray(oe)&&oe.some(Fe=>Fe!=null&&(typeof Fe=="string"?Fe.toLowerCase().includes(x):typeof Fe=="object"?Object.values(Fe).some(bt=>typeof bt=="string"&&bt.toLowerCase().includes(x)):!1)))return!0}return!1})}for(const x of ke.value){if(!de(x))continue;const A=Ve.value[x.key];A&&(M=M.filter(ae=>xe(ae,x,A)))}if(ce.showSortBy&&$e.value){const x=$e.value,A=tt.value==="asc"?1:-1;M=[...M].sort((ae,oe)=>j(ae?.[x],oe?.[x])*A)}return M});function j(M,x){const A=K(M),ae=K(x);return A==null&&ae==null?0:A==null?1:ae==null?-1:typeof A=="number"&&typeof ae=="number"?A-ae:String(A).localeCompare(String(ae),void 0,{numeric:!0,sensitivity:"base"})}function K(M){return M==null||M==="NULL"?null:typeof M=="string"||typeof M=="number"||typeof M=="boolean"?M:M instanceof Date?M.getTime():null}function de(M){return ee.has(M.operator)?!0:M.value==null||typeof M.value=="string"&&M.value===""||Array.isArray(M.value)&&M.value.length===0?!1:M.value instanceof Date?!isNaN(M.value.getTime()):!(typeof M.value=="object"&&!Array.isArray(M.value)&&M.value.min==null&&M.value.max==null)}function xe(M,x,A){const ae=M?.[x.key],oe=x.value,Fe=x.operator;if(Fe==="is_empty")return jt(ae);if(Fe==="is_not_empty")return!jt(ae);const bt=A.type;if(bt==="text"||bt==="arrayText"){const ot=bt==="arrayText"&&Array.isArray(ae)?ae.filter(Mt=>Mt!=null).map(String).join(" "):ae!=null?String(ae):"",Ie=String(oe).toLowerCase(),xt=ot.toLowerCase();switch(Fe){case"contains":return xt.includes(Ie);case"not_contains":return!xt.includes(Ie);case"equals":return xt===Ie;case"not_equals":return xt!==Ie;case"starts_with":return xt.startsWith(Ie);case"ends_with":return xt.endsWith(Ie);default:return!0}}if(bt==="select")switch(Fe){case"is_any_of":return oe.includes(ae);case"is_none_of":return!oe.includes(ae);default:return!0}if(bt==="range"||bt==="int"){const ot=typeof ae=="number"?ae:Number(ae);if(typeof ot!="number"||isNaN(ot))return!1;if(Fe==="between"){const xt=oe?.min!=null?Number(oe.min):null,Mt=oe?.max!=null?Number(oe.max):null,St=xt!=null&&!isNaN(xt)?xt:null,At=Mt!=null&&!isNaN(Mt)?Mt:null;return(St==null||ot>=St)&&(At==null||ot<=At)}const Ie=typeof oe=="number"&&!isNaN(oe)?oe:Number(oe);if(Fe==="contains"||Fe==="not_contains"){const xt=String(ot),Mt=String(oe??"").toLowerCase(),St=xt.toLowerCase().includes(Mt);return Fe==="contains"?St:!St}if(typeof Ie!="number"||isNaN(Ie))return!1;switch(Fe){case"eq":return ot===Ie;case"neq":return ot!==Ie;case"gt":return ot>Ie;case"gte":return ot>=Ie;case"lt":return ot<Ie;case"lte":return ot<=Ie;default:return!0}}if(bt==="arraySelect"){if(!Array.isArray(ae))return!1;const ot=ae.filter(Ie=>Ie!=null).map(Ie=>A.displayKey&&typeof Ie=="object"?Ie[A.displayKey]:String(Ie));switch(Fe){case"contains_any":return ot.some(Ie=>oe.includes(Ie));case"contains_all":return oe.every(Ie=>ot.includes(Ie));case"not_contains_any":return!ot.some(Ie=>oe.includes(Ie));default:return!0}}if(bt==="date"){const ot=Ke(oe);if(!ot||isNaN(ot.getTime()))return!1;const Ie=Ke(ae);if(!Ie||isNaN(Ie.getTime()))return!1;const xt=Ht(Ie),Mt=Ht(ot);switch(Fe){case"eq":return xt===Mt;case"before":return xt<Mt;case"after":return xt>Mt;default:return!0}}if(bt==="boolean"){const ot=ae===!0||ae==="true"||ae===1,Ie=ae===!1||ae==="false"||ae===0;switch(Fe){case"is_true":return ot;case"is_false":return Ie;default:return!0}}return!0}function Ke(M){if(M==null)return null;if(M instanceof Date)return isNaN(M.getTime())?null:M;if(typeof M=="number")return new Date(M>1e10?M:M*1e3);if(typeof M=="string"){const x=new Date(M);return isNaN(x.getTime())?null:x}return null}function Ht(M){const x=M.getFullYear(),A=String(M.getMonth()+1).padStart(2,"0"),ae=String(M.getDate()).padStart(2,"0");return`${x}-${A}-${ae}`}function jt(M){return!!(M==null||M===""||M==="NULL"||Array.isArray(M)&&M.length===0||Array.isArray(M)&&M.every(x=>x==null))}e.watch(ne,M=>O("update:modelValue",M),{immediate:!0}),e.watch(()=>ce.data,()=>{ke.value=[],be.value="",Y.value=!1,$e.value="",tt.value="asc",dt()});function et(M){return M.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,x=>x.toUpperCase())}function vl(){const M=x=>{if(x==null)return x;if(x instanceof Date)return{_type:"Date",value:x.toISOString(),local:x.toLocaleDateString()};if(Array.isArray(x))return x.map(M);if(typeof x=="object"&&!Array.isArray(x)){const A={};for(const ae of Object.keys(x))A[ae]=M(x[ae]);return A}return x};return{globalSearch:be.value,rows:ke.value.map(x=>({key:x.key,operator:x.operator,value:M(x.value),defType:Ve.value[x.key]?.type,defFilterMode:Ve.value[x.key]?.filterMode})),filteredCount:ne.value?.length??0}}return te({getDebugState:vl}),(M,x)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":fe.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:me},[e.createElementVNode("div",f0,[x[20]||(x[20]=e.createElementVNode("svg",{class:"dss-filter-global-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),e.createElementVNode("input",{type:"text",class:"dss-filter-global-input",placeholder:e.unref(V)("filter.searchAcrossFields"),value:be.value,onInput:We},null,40,v0),be.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:x[0]||(x[0]=A=>be.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:Y.value||ke.value.length>0,"dss-filter-funnel-btn--with-sort":ce.showSortBy}]),onClick:x[1]||(x[1]=A=>Y.value=!Y.value),type:"button",title:Y.value?e.unref(V)("filter.closeAdvancedFilter"):e.unref(V)("filter.openAdvancedFilter")},[x[14]||(x[14]=e.createElementVNode("svg",{class:"dss-filter-funnel-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 2.00407L11.7537 2.00926L7.84558 6.18223V9.38409C7.84581 9.53637 7.80836 9.68634 7.73658 9.82064C7.6648 9.95494 7.56091 10.0694 7.43417 10.1538L5.58772 11.3852C5.44858 11.4779 5.28688 11.531 5.11988 11.539C4.95288 11.5469 4.78685 11.5094 4.63952 11.4304C4.49219 11.3514 4.36908 11.2338 4.28334 11.0903C4.1976 10.9467 4.15244 10.7826 4.15269 10.6154V6.18223L0.244567 2.00926L0.239951 2.00407C0.119785 1.87182 0.0405781 1.70755 0.0119374 1.53118C-0.0167033 1.35481 0.00645342 1.17391 0.0785984 1.01044C0.150743 0.846967 0.268776 0.707944 0.418378 0.610235C0.56798 0.512525 0.742722 0.460328 0.921405 0.459976H11.0769C11.2557 0.459994 11.4307 0.511948 11.5805 0.609528C11.7304 0.707107 11.8487 0.846111 11.9211 1.00965C11.9934 1.17319 12.0167 1.35422 11.9881 1.53075C11.9596 1.70728 11.8803 1.87172 11.7601 2.00407H11.7583Z",fill:"currentColor"})],-1)),ke.value.length>0?(e.openBlock(),e.createElementBlock("span",g0,e.toDisplayString(ke.value.length),1)):e.createCommentVNode("",!0)],10,h0),ce.showSortBy?(e.openBlock(),e.createElementBlock("div",y0,[x[19]||(x[19]=e.createElementVNode("label",{class:"dss-filter-sortby-label",for:"dss-filter-sort-select"},"Sort by",-1)),e.createElementVNode("select",{id:"dss-filter-sort-select",class:"dss-filter-sortby-select",value:$e.value,onChange:Dt},[x[15]||(x[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Je.value,A=>(e.openBlock(),e.createElementBlock("option",{key:A.key,value:A.key},e.toDisplayString(A.label),9,C0))),128))],40,k0),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:Lt,disabled:!$e.value,title:ut.value},[$e.value?tt.value==="asc"?(e.openBlock(),e.createElementBlock("svg",w0,[...x[17]||(x[17]=[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",E0,[...x[18]||(x[18]=[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",x0,[...x[16]||(x[16]=[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"currentColor"},null,-1)])]))],8,b0)])):e.createCommentVNode("",!0)]),Y.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:x[13]||(x[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",S0,[ke.value.length===0?(e.openBlock(),e.createElementBlock("div",V0,e.toDisplayString(e.unref(V)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ke.value,(A,ae)=>(e.openBlock(),e.createElementBlock("div",{key:A.id,class:"dss-filter-row"},[e.createElementVNode("span",N0,e.toDisplayString(ae===0?e.unref(V)("filter.where"):e.unref(V)("filter.and")),1),e.createElementVNode("div",B0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(oe=>ht(`${A.id}:field`),["stop"])},[e.createElementVNode("span",_0,e.toDisplayString(qt(A.key)),1),x[21]||(x[21]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,M0),J.value===`${A.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:x[3]||(x[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":x[2]||(x[2]=oe=>F.value=oe),placeholder:e.unref(V)("filter.searchAttributes")},null,8,$0),[[e.vModelText,F.value]]),e.createElementVNode("ul",L0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,oe=>(e.openBlock(),e.createElementBlock("li",{key:oe.key,class:"dss-filter-popup-item",onClick:Fe=>Pe(A,oe.key)},e.toDisplayString(oe.label),9,A0))),128)),Ce.value.length===0?(e.openBlock(),e.createElementBlock("li",T0,e.toDisplayString(e.unref(V)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),Ct(A)==="contain"||Ct(A)==="date"?(e.openBlock(),e.createElementBlock("div",D0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(oe=>ht(`${A.id}:op`),["stop"])},[e.createElementVNode("span",R0,e.toDisplayString(wt(A.operator)),1),x[22]||(x[22]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,H0),J.value===`${A.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:x[4]||(x[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",F0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yt(A),oe=>(e.openBlock(),e.createElementBlock("li",{key:oe.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:A.operator===oe.value}]),onClick:Fe=>Xe(A,oe.value)},e.toDisplayString(oe.label),11,I0))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),it(A.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",z0,[Ct(A)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref(V)("filter.enterValue"),"onUpdate:modelValue":oe=>A.value=oe},null,8,P0)),[[e.vModelText,A.value]]):Ct(A)==="date"?(e.openBlock(),e.createElementBlock("div",O0,[e.createVNode(pa,{mode:"single",modelValue:A.value,"onUpdate:modelValue":oe=>A.value=oe},null,8,["modelValue","onUpdate:modelValue"])])):Kt(A)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref(V)("filter.enterValue"),"onUpdate:modelValue":oe=>A.value=oe},null,8,W0)),[[e.vModelText,A.value]]):Kt(A)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref(V)("filter.enterValue"),value:A.value,onInput:oe=>Et(A,oe),step:Ve.value[A.key]?.type==="int"?1:void 0},null,40,q0)):Kt(A)==="between"?(e.openBlock(),e.createElementBlock("div",Z0,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(V)("filter.min"),value:A.value?.min,onInput:oe=>Ge(A,"min",oe),step:Ve.value[A.key]?.type==="int"?1:void 0},null,40,U0),e.createElementVNode("span",X0,e.toDisplayString(e.unref(V)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(V)("filter.max"),value:A.value?.max,onInput:oe=>Ge(A,"max",oe),step:Ve.value[A.key]?.type==="int"?1:void 0},null,40,Y0)])):Kt(A)==="multiselect"?(e.openBlock(),e.createElementBlock("div",j0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(oe=>ht(`${A.id}:val`),["stop"])},[e.createElementVNode("span",G0,e.toDisplayString(W(A)),1),x[23]||(x[23]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,K0),J.value===`${A.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:x[6]||(x[6]=e.withModifiers(()=>{},["stop"]))},[X(A).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":x[5]||(x[5]=oe=>F.value=oe),placeholder:e.unref(V)("filter.search")},null,8,Q0)),[[e.vModelText,F.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",J0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge(A),oe=>(e.openBlock(),e.createElementBlock("li",{key:oe,class:"dss-filter-popup-item",onClick:Fe=>Zt(A,oe)},[e.createElementVNode("input",{type:"checkbox",checked:(A.value||[]).includes(oe),tabindex:"-1"},null,8,tp),e.createElementVNode("span",null,e.toDisplayString(oe),1)],8,ep))),128)),ge(A).length===0?(e.openBlock(),e.createElementBlock("li",lp,e.toDisplayString(e.unref(V)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:oe=>Ne(A.id)},[...x[24]||(x[24]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,np)]))),128)),e.createElementVNode("div",op,[e.createElementVNode("div",ap,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:x[7]||(x[7]=e.withModifiers(A=>ht("add"),["stop"]))},e.toDisplayString(e.unref(V)("filter.addFilter")),1),J.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:x[12]||(x[12]=e.withModifiers(()=>{},["stop"]))},[Le.value&&!ue.value&&!F.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":x[8]||(x[8]=A=>F.value=A),placeholder:e.unref(V)("filter.searchAttributes")},null,8,sp),[[e.vModelText,F.value]]),e.createElementVNode("ul",rp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je.value,A=>(e.openBlock(),e.createElementBlock("li",{key:A.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:ae=>ue.value=A},[e.createElementVNode("span",null,e.toDisplayString(A.label),1),x[25]||(x[25]=e.createElementVNode("svg",{class:"dss-filter-chevron-right",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"9 18 15 12 9 6"})],-1))],8,ip))),128)),re.value.length>0?(e.openBlock(),e.createElementBlock("li",cp)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(re.value,A=>(e.openBlock(),e.createElementBlock("li",{key:A.key,class:"dss-filter-popup-item",onClick:ae=>G(A.key)},e.toDisplayString(A.label),9,up))),128))])],64)):ue.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:x[9]||(x[9]=A=>ue.value=null)},[x[26]||(x[26]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1)),e.createElementVNode("span",null,e.toDisplayString(ue.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":x[10]||(x[10]=A=>F.value=A),placeholder:e.unref(V)("filter.searchAttributes")},null,8,dp),[[e.vModelText,F.value]]),e.createElementVNode("ul",mp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qe.value,A=>(e.openBlock(),e.createElementBlock("li",{key:A.key,class:"dss-filter-popup-item",onClick:ae=>G(A.key)},e.toDisplayString(A.label),9,pp))),128)),Qe.value.length===0?(e.openBlock(),e.createElementBlock("li",fp,e.toDisplayString(e.unref(V)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":x[11]||(x[11]=A=>F.value=A),placeholder:e.unref(V)("filter.searchAttributes")},null,8,vp),[[e.vModelText,F.value]]),e.createElementVNode("ul",hp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,A=>(e.openBlock(),e.createElementBlock("li",{key:A.key,class:"dss-filter-popup-item",onClick:ae=>G(A.key)},e.toDisplayString(A.label),9,gp))),128)),Ce.value.length===0?(e.openBlock(),e.createElementBlock("li",yp,e.toDisplayString(e.unref(V)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),ke.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:Ue},e.toDisplayString(e.unref(V)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),bp={class:"dss-pill-field__pills"},xp=["data-value"],wp=["disabled"],Ep={class:"dss-pill-field__pill-text"},Sp={key:0,class:"dss-pill-field__pill-actions"},Vp=["onClick"],Np=["onClick"],Bp=["placeholder","disabled"],Mp=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(E,{emit:te}){const $=E,V=te,ce=e.ref(""),O=e.ref([...$.modelValue]),L=e.ref(null);let fe=null;const rt=e.ref(null),ee=e.ref(""),v=e.ref(null),be=e.ref(null),ke=e.computed(()=>{if(!be.value)return;const{width:Le,height:je}=be.value;return{minWidth:`${Le}px`,height:`${je}px`}});function J(Le,je){rt.value===je&&(v.value=Le)}function Y(){rt.value=null,ee.value="",be.value=null,v.value=null}const me=e.computed(()=>new Set(O.value.map(Le=>Le.trim()).filter(Boolean)));function F(Le){L.value=Le,fe&&clearTimeout(fe),fe=setTimeout(()=>{L.value=null,fe=null},900)}function ue(Le){const je=Le.trim();return je?me.value.has(je)?(F(je),!1):(O.value=[...O.value,je],V("update:modelValue",[...O.value]),!0):!1}function $e(Le){const je=Le.split(/\r?\n/g).map(Je=>Je.trim()).filter(Boolean);if(!je.length)return;const re=new Set(O.value.map(Je=>Je.trim()).filter(Boolean)),Qe=[...O.value];let Ce=null;for(const Je of je){if(re.has(Je)){Ce??=Je;continue}re.add(Je),Qe.push(Je)}Qe.length!==O.value.length&&(O.value=Qe,V("update:modelValue",[...O.value])),Ce&&F(Ce)}function tt(Le){$.disabled||(rt.value===Le&&Y(),O.value=O.value.filter((je,re)=>re!==Le),V("update:modelValue",[...O.value]))}async function mt(Le,je){if($.disabled)return;const re=je.currentTarget.closest(".dss-pill-field__pill");re&&(be.value={width:re.offsetWidth,height:re.offsetHeight}),rt.value=Le,ee.value=O.value[Le]??"",await e.nextTick();const Qe=v.value;if(!Qe)return;Qe.focus();const Ce=Qe.value.length;Qe.setSelectionRange(Ce,Ce)}function U(){Y()}function ze(){if($.disabled||rt.value===null)return;const Le=rt.value,je=O.value[Le]??"",re=ee.value.trim();if(Y(),re!==je&&me.value.has(re)){F(re);return}if(!re){O.value=O.value.filter((Ce,Je)=>Je!==Le),V("update:modelValue",[...O.value]);return}const Qe=O.value.map((Ce,Je)=>Je===Le?re:Ce);O.value=Qe,V("update:modelValue",[...O.value])}function qe(Le){Le.preventDefault(),!$.disabled&&(ue(ce.value),ce.value="")}function Ve(Le){if($.disabled)return;const je=Le.clipboardData?.getData("text")??"";!je.includes(`
|
|
120
|
-
`)&&!je.includes("\r")||(Le.preventDefault(),$e(je),ce.value="")}return e.watch(()=>$.modelValue,Le=>{O.value=Array.isArray(Le)?[...Le]:[]},{deep:!0}),e.onBeforeUnmount(()=>{fe&&clearTimeout(fe)}),(Le,je)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":Le.disabled}])},[e.createElementVNode("div",bp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,(re,Qe)=>(e.openBlock(),e.createElementBlock("span",{key:re,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":L.value===re,"dss-pill-field__pill--editing":rt.value===Qe}]),style:e.normalizeStyle(rt.value===Qe&&be.value?ke.value:void 0)},[rt.value===Qe?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-pill-field__pill-edit-wrap","data-value":ee.value||" "},[e.withDirectives(e.createElementVNode("input",{ref_for:!0,ref:Ce=>J(Ce,Qe),"onUpdate:modelValue":je[0]||(je[0]=Ce=>ee.value=Ce),class:"dss-pill-field__pill-edit",type:"text",disabled:Le.disabled,onKeydown:[e.withKeys(ze,["enter"]),e.withKeys(U,["esc"])],onBlur:ze},null,40,wp),[[e.vModelText,ee.value]])],8,xp)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",Ep,e.toDisplayString(re),1),Le.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Sp,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:Ce=>mt(Qe,Ce)},[...je[2]||(je[2]=[e.createElementVNode("svg",{class:"dss-pill-field__pill-action-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})],-1)])],8,Vp),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:Ce=>tt(Qe)}," × ",8,Np)]))],64))],6))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":je[1]||(je[1]=re=>ce.value=re),class:"dss-pill-field__input",type:"text",placeholder:O.value.length?"":Le.placeholder,disabled:Le.disabled,onPaste:Ve,onKeydown:e.withKeys(qe,["enter"])},null,40,Bp),[[e.vModelText,ce.value]])])],2))}}),_p={class:"dss-step-bar__layout"},$p={class:"dss-step-bar__header"},Lp={class:"dss-step-bar__label"},Ap={key:0,class:"dss-step-bar__counter"},Tp={class:"dss-step-bar__track-wrapper"},Dp=["aria-valuemax","aria-valuenow","aria-label"],Hp=["onMouseenter"],Rp={__name:"DSSStepBar",props:{label:{type:String,default:"Progress"},steps:{type:Number,default:5},currentStep:{type:Number,default:0},segments:{type:Array,default:()=>[]},segmentOrder:{type:String,default:"input",validator:E=>["input","desc","asc"].includes(E)},orientation:{type:String,default:"horizontal",validator:E=>["horizontal","vertical"].includes(E)},barHeight:{type:[Number,String],default:200},labelPosition:{type:String,default:"up",validator:E=>["up","down","left","right"].includes(E)},sideLabelMaxWidth:{type:[Number,String],default:null},sideLabelWrapWidth:{type:[Number,String],default:"18ch"},totalValue:{type:Number,default:null},activeColor:{type:String,default:"#34c759"},labelColor:{type:String,default:null},counterColor:{type:String,default:null},valueLabel:{type:String,default:""},counterAsPercentage:{type:Boolean,default:!1},showCounter:{type:Boolean,default:!0},inactiveColor:{type:String,default:"#e5e7eb"},remainderLabel:{type:String,default:"Unused"},remainderTooltipSummary:{type:Boolean,default:!1},options:{type:Object,default:()=>({})}},setup(E){const te=E,$={segmentMarker:{color:null,width:null,height:null,backgroundColor:"transparent",borderColor:"transparent"},maxSegment:{marker:{enabled:!1,color:null,width:null,height:null,backgroundColor:"transparent",borderColor:"transparent"}}},V=X=>X&&typeof X=="object"&&!Array.isArray(X),ce=(X,ge)=>{const W=Object.assign({},X);return!V(X)||!V(ge)||Object.keys(ge).forEach(G=>{if(V(ge[G])){G in X?W[G]=ce(X[G],ge[G]):Object.assign(W,{[G]:ge[G]});return}Object.assign(W,{[G]:ge[G]})}),W},O=e.computed(()=>ce($,te.options)),L=e.computed(()=>Math.max(1,Number(te.steps)||1)),fe=e.computed(()=>Math.min(L.value,Math.max(0,Number(te.currentStep)||0))),rt=e.computed(()=>Array.isArray(te.segments)&&te.segments.length>0),ee=e.computed(()=>{if(!rt.value)return[];const X=te.segments.map((ge,W)=>{const G=Number(ge?.value);return{label:ge?.label||`Step ${W+1}`,value:Number.isFinite(G)&&G>0?G:0,color:ge?.color||te.activeColor,marker:ge?.marker}});return te.segmentOrder==="desc"?[...X].sort((ge,W)=>W.value-ge.value):te.segmentOrder==="asc"?[...X].sort((ge,W)=>ge.value-W.value):X}),v=e.computed(()=>rt.value?ee.value.reduce((X,ge)=>X+ge.value,0):fe.value),be=e.computed(()=>rt.value?Number.isFinite(Number(te.totalValue))&&Number(te.totalValue)>0?Number(te.totalValue):Math.max(1,v.value):L.value),ke=e.computed(()=>rt.value&&Number.isFinite(Number(te.totalValue))&&Number(te.totalValue)>0),J=e.computed(()=>ke.value?Math.max(0,Number(te.totalValue)-v.value):0),Y=e.computed(()=>typeof te.remainderLabel=="string"&&te.remainderLabel.trim().length>0),me=e.computed(()=>J.value>0),F=e.computed(()=>ee.value.reduce((X,ge)=>Math.max(X,Number(ge.value)||0),0)),ue=e.computed(()=>ee.value.filter(X=>X.value>0).map(X=>`${X.label}: ${Ct(X.value)}`).join(" | ")),$e=e.computed(()=>rt.value?ke.value?ee.value.filter(X=>X.value>0):ee.value:[]),tt=e.computed(()=>{if(!te.counterAsPercentage)return`${v.value} / ${be.value}`;const X=Number(be.value);if(!Number.isFinite(X)||X<=0)return"0%";const ge=Math.round(Number(v.value)/X*100);return`${Math.min(Math.max(ge,0),100)}%`}),mt=e.computed(()=>v.value),U=e.computed(()=>be.value),ze=e.reactive({visible:!1,x:0,y:0,content:""}),qe=e.computed(()=>te.orientation==="vertical"),Ve=e.computed(()=>{const X=te.barHeight;return X==null||X===""?"200px":typeof X=="number"?`${X}px`:String(X)}),Le=e.computed(()=>{const X=te.sideLabelMaxWidth;if(!(X==null||X===""))return typeof X=="number"?`${X}px`:String(X)}),je=e.computed(()=>{const X=te.sideLabelWrapWidth;return X==null||X===""?"18ch":typeof X=="number"?`${X}ch`:String(X)}),re=e.computed(()=>({left:`${ze.x}px`,top:`${ze.y}px`,transform:"translate(-50%, calc(-100% - 8px))"})),Qe=X=>qe.value?{flex:`${X} 0 0`,minHeight:X>0?"6px":"0",minWidth:"0"}:{flex:`${X} 0 0`,minWidth:X>0?"6px":"0"},Ce=X=>{const ge=X?.parentElement;if(!ge)return{x:0,y:0};const W=ge.getBoundingClientRect();return{x:W.left+W.width/2,y:W.top}},Je=X=>{const ge=X.getBoundingClientRect();return{x:ge.left+ge.width/2,y:ge.top}},ut=X=>{if(ke.value){const G=Math.max(0,Number(X.value)||0);return{...Qe(G),backgroundColor:X.color}}const ge=v.value,W=X.value>0?X.value:ge>0?1e-4:1;return{...Qe(W),backgroundColor:X.color}},ht=X=>Number(X?.value||0)>0&&Number(X?.value||0)===F.value,dt=X=>{const ge=V(X?.marker)?X.marker:{},W=X?.marker===!0||ge.enabled===!0,G=ht(X)&&O.value.maxSegment?.marker?.enabled===!0;if(!(W||G))return{enabled:!1};const Pe=ge.backgroundColor??(G?O.value.maxSegment?.marker?.backgroundColor:O.value.segmentMarker?.backgroundColor),Xe=ge.borderColor??(G?O.value.maxSegment?.marker?.borderColor:O.value.segmentMarker?.borderColor),Et=ge.color??(G?O.value.maxSegment?.marker?.color:O.value.segmentMarker?.color),Ge=ge.width??(G?O.value.maxSegment?.marker?.width:O.value.segmentMarker?.width),Zt=ge.height??(G?O.value.maxSegment?.marker?.height:O.value.segmentMarker?.height);return{enabled:!0,backgroundColor:Pe,borderColor:Xe,color:Et,width:Ge,height:Zt,icon:ge.icon??null,...ge}},Wt=X=>{const ge=dt(X);return{backgroundColor:ge.backgroundColor??void 0,borderColor:ge.borderColor??void 0,color:ge.color??void 0}},qt=X=>{const ge=dt(X);return{width:ge.width??void 0,height:ge.height??void 0}},Ct=X=>`${X}${te.valueLabel}`,wt=e.computed(()=>({...Qe(J.value),backgroundColor:te.inactiveColor})),Yt=(X,ge)=>{if(!X||!ge?.currentTarget)return;const W=ge.currentTarget;if(te.remainderTooltipSummary){const Ne=Ce(W);ze.x=Ne.x,ze.y=Ne.y,ze.content=ue.value,ze.visible=!!ze.content;return}const G=Je(W);ze.x=G.x,ze.y=G.y,ze.content=`${X.label}: ${Ct(X.value)}`,ze.visible=!0},it=X=>{if(!J.value||!X?.currentTarget)return;const ge=X.currentTarget;if(te.remainderTooltipSummary){const G=Ce(ge);ze.x=G.x,ze.y=G.y,ze.content=ue.value,ze.visible=!!ze.content;return}const W=Je(ge);ze.x=W.x,ze.y=W.y,Y.value&&(ze.content=`${te.remainderLabel}: ${Ct(J.value)}`,ze.visible=!0)},Kt=()=>{ze.visible=!1},yt=()=>{ze.visible&&Kt()};e.onMounted(()=>{window.addEventListener("scroll",yt,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("scroll",yt,!0)});const el=e.computed(()=>({"--dss-step-bar-label-color":te.labelColor??void 0,"--dss-step-bar-counter-color":te.counterColor??void 0,"--dss-step-bar-active-color":te.activeColor,"--dss-step-bar-inactive-color":te.inactiveColor,"--dss-step-bar-bar-height":qe.value?Ve.value:void 0,"--dss-step-bar-side-label-max-width":Le.value,"--dss-step-bar-side-label-wrap-width":je.value}));return(X,ge)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-step-bar",[`dss-step-bar--${E.orientation}`,`dss-step-bar--label-${E.labelPosition}`]]),style:e.normalizeStyle(el.value)},[e.createElementVNode("div",_p,[e.createElementVNode("div",$p,[e.createElementVNode("span",Lp,[e.renderSlot(X.$slots,"label",{label:E.label},()=>[e.createTextVNode(e.toDisplayString(E.label),1)])]),E.showCounter?(e.openBlock(),e.createElementBlock("span",Ap,[e.renderSlot(X.$slots,"counter",{counterDisplay:tt.value},()=>[e.createTextVNode(e.toDisplayString(tt.value),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Tp,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":U.value,"aria-valuenow":mt.value,"aria-label":E.label},[rt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($e.value,(W,G)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${G}-${W.label}`,class:e.normalizeClass(["dss-step-bar__segment dss-step-bar__segment--interactive",{"dss-step-bar__segment--max":ht(W),"dss-step-bar__segment--marker-enabled":dt(W).enabled}]),style:e.normalizeStyle(ut(W)),onMouseenter:Ne=>Yt(W,Ne),onMouseleave:Kt},[dt(W).enabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment-marker",style:e.normalizeStyle(Wt(W)),"aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-step-bar__segment-marker-icon",style:e.normalizeStyle(qt(W))},[e.renderSlot(X.$slots,"segment-marker-icon",{segment:W,index:G,marker:dt(W)},()=>[e.renderSlot(X.$slots,"max-segment-icon",{segment:W,index:G,marker:dt(W)},()=>[e.createTextVNode(e.toDisplayString(dt(W).icon||""),1)])])],4)],4)):e.createCommentVNode("",!0)],46,Hp))),128)),me.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(wt.value),onMouseenter:ge[0]||(ge[0]=W=>it(W)),onMouseleave:Kt},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(L.value,W=>(e.openBlock(),e.createElementBlock("div",{key:W,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":W<=fe.value}])},null,2))),128))],8,Dp)])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[ze.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__tooltip dss-step-bar__tooltip--teleported",style:e.normalizeStyle(re.value)},e.toDisplayString(ze.content),5)):e.createCommentVNode("",!0)]))],6))}},Fp={key:0,class:"dss-title dss-title--separator"},Ip={__name:"DSSTitle",props:{type:{type:String,default:"main",validator:E=>["main","separator","subtitle"].includes(E)},h:{type:Number,default:null,validator:E=>E===null||Number.isInteger(E)&&E>=1&&E<=6},size:{type:[String,Number],default:null},weight:{type:[String,Number],default:null},color:{type:String,default:null},editable:{type:Boolean,default:!1},modelValue:{type:String,default:""}},emits:["update:modelValue","change"],setup(E,{expose:te,emit:$}){const V=E,ce=$,O=e.ref(null),L=e.computed(()=>`dss-title--${V.type}`),fe=e.computed(()=>V.h!=null?`dss-title--h${V.h}`:null),rt={main:"div",subtitle:"p",separator:"span"},ee=e.computed(()=>V.h!=null?`h${V.h}`:rt[V.type]??"div"),v=e.computed(()=>V.editable?"plaintext-only":void 0),be=e.computed(()=>{const ue={};return V.size!=null&&(ue.fontSize=typeof V.size=="number"?`${V.size}px`:V.size),V.weight!=null&&(ue.fontWeight=V.weight),V.color!=null&&(ue.color=V.color),Object.keys(ue).length?ue:void 0}),ke=e.computed(()=>V.editable?{input:Y,keydown:me,paste:F}:{}),J=()=>{const ue=O.value;!V.editable||!ue||document.activeElement!==ue&&(ue.innerText=V.modelValue??"")},Y=ue=>{const $e=ue.target.innerText;ce("update:modelValue",$e),ce("change",$e)},me=ue=>{ue.key==="Enter"&&ue.preventDefault()},F=ue=>{ue.preventDefault();const $e=(ue.clipboardData||window.clipboardData).getData("text/plain");document.execCommand("insertText",!1,$e)};return e.watch(()=>V.modelValue,()=>{J()}),e.watch(()=>V.editable,()=>{e.nextTick(J)}),e.onMounted(()=>{e.nextTick(J)}),te({focus:()=>O.value?.focus()}),(ue,$e)=>E.type==="separator"?(e.openBlock(),e.createElementBlock("div",Fp,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(ee.value),e.mergeProps({ref_key:"titleRef",ref:O,class:["dss-title__separator-label",fe.value,{"dss-title--editable":E.editable}],style:be.value,contenteditable:v.value,spellcheck:E.editable?!1:void 0},e.toHandlers(ke.value)),{default:e.withCtx(()=>[E.editable?e.createCommentVNode("",!0):e.renderSlot(ue.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(E.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(ee.value),e.mergeProps({key:1,ref_key:"titleRef",ref:O,class:["dss-title",[L.value,fe.value,{"dss-title--editable":E.editable}]],style:be.value,contenteditable:v.value,spellcheck:E.editable?!1:void 0},e.toHandlers(ke.value)),{default:e.withCtx(()=>[E.editable?e.createCommentVNode("",!0):e.renderSlot(ue.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(E.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))}},zp={contextMenu:{addMarker:"Add Marker",clearAllMarkers:"Clear All Markers",downloadSvg:"Download SVG",downloadPng:"Download PNG",downloadCsv:"Download CSV"},modalMarker:{editMarker:"Edit Marker",viewMarker:"View Marker",title:"Title",description:"Description",iconType:"Icon Type",defaultIcon:"Default Logo",iconPreview:"Icon Preview",deleteMarker:"Delete Marker",cancel:"Cancel",close:"Close",save:"Save",placeholderTitle:"Enter marker title",placeholderDescription:"Enter marker description (required)"},zoom:{doubleClickToReset:"(Double-click to reset)"},csv:{chartTitle:"Chart Title",chartSubtitle:"Chart Subtitle",generated:"Generated"},fallback:{item:"Item",axis:"Axis"},tooltip:{flags:"Flags",markers:"Markers",manualFlags:"Manual Flags",autoFlags:"Auto Flags"}},Pp={firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",currentPageAriaLabel:"Current page",rowsPerPage:"Rows per page",searchPlaceholder:"Search...",searchAriaLabel:"Search",searchTableAriaLabel:"Search table",clearSearchAriaLabel:"Clear search",downloadPdf:"Download PDF",downloadExcel:"Download Excel",columnVisibility:"Columns Visibility",expandRowAriaLabel:"Expand row",collapseRowAriaLabel:"Collapse row",filterColumnAriaLabel:"Filter column",clearFilter:"Clear",search:"Search...",filterFrom:"From:",filterTo:"To:",dateFormat:"dd/mm/yyyy",showingRange:"Showing {start}-{end} from {total}",ofPages:"of {total}",emptyMessage:"No data available"},Op={searchAcrossFields:"Search across all fields...",openAdvancedFilter:"Open advanced filter",closeAdvancedFilter:"Close advanced filter",noConditionsApplied:"No filter conditions are applied to this view",where:"Where",and:"And",searchAttributes:"Search attributes...",noMatch:"No match",enterValue:"Enter value...",min:"Min",max:"Max",search:"Search...",addFilter:"Add filter",clearAllFilters:"Clear all filters",select:"Select...",selectedCount:"{count} selected",operators:{contains:"contains",not_contains:"does not contain",equals:"equals",not_equals:"does not equal",starts_with:"starts with",ends_with:"ends with",is_empty:"is empty",is_not_empty:"is not empty",is_any_of:"is any of",is_none_of:"is none of",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"between",contains_any:"contains any of",contains_all:"contains all of",not_contains_any:"does not contain",before:"before",after:"after",is_true:"is true",is_false:"is false"}},Wp={selectDate:"Select Date",selectRange:"Select range",selectFromList:"Select a date",noAvailableDates:"No dates available",startDate:"Start date",endDate:"End date",prevMonth:"Previous month",nextMonth:"Next month",quickSelect:{today:"Today",lastWeek:"Last week",last15Days:"Last 15 days",last30Days:"Last 30 days",thisMonth:"This month",last3Months:"Last 3 months",last6Months:"Last 6 months",last12Months:"Last 12 months",lastYear:"Last year",allDates:"All dates",last2Dates:"Last 2 dates",last3Dates:"Last 3 dates",last4Dates:"Last 4 dates",last5Dates:"Last 5 dates"}},qp={toolbar:{undo:"Undo",redo:"Redo",paragraphFormat:"Paragraph Format",bold:"Bold",italic:"Italic",underline:"Underline",citation:"Citation",insertLink:"Insert Link",removeLink:"Remove Link",bulletList:"Bullet List",numberList:"Number List",image:"Image",comment:"Comment",askAi:"Ask AI"},paragraph:{heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",heading4:"Heading 4",heading5:"Heading 5",heading6:"Heading 6",paragraph:"Paragraph"},link:{editLink:"Edit Link",altText:"Alt text:",url:"URL:",enterAltText:"Enter alt text...",enterUrl:"Enter URL...",cancel:"Cancel",save:"Save"},image:{addImage:"Add Image",editImage:"Edit Image",upload:"Upload",imageLink:"Image Link",uploadImage:"Upload image:",imageUrl:"Image URL:",altText:"Alt text:",width:"Width (px):",height:"Height (px):",enterAltText:"Enter alt text...",enterImageUrl:"https://example.com/image.jpg",auto:"Auto",noAlt:"No alt",cancel:"Cancel",save:"Save"},comment:{placeholder:"Add a comment",send:"Send",delete:"Delete comment"},started_conversation:"Started conversation",labels:{title:"Title",description:"Description"},placeholders:{title:"Enter title...",description:"Enter description...",startTyping:"Start typing..."},footer:{word:"word",words:"words",character:"character",characters:"characters"}},io={chart:zp,table:Pp,filter:Op,datepicker:Wp,textEditor:qp},Zp={contextMenu:{addMarker:"Ajouter un marqueur",clearAllMarkers:"Effacer tous les marqueurs",downloadSvg:"Télécharger SVG",downloadPng:"Télécharger PNG",downloadCsv:"Télécharger CSV"},modalMarker:{editMarker:"Modifier le marqueur",viewMarker:"Voir le marqueur",title:"Titre",description:"Description",iconType:"Type d'icône",defaultIcon:"Logo par défaut",iconPreview:"Aperçu de l'icône",deleteMarker:"Supprimer le marqueur",cancel:"Annuler",close:"Fermer",save:"Enregistrer",placeholderTitle:"Entrez le titre du marqueur",placeholderDescription:"Entrez la description du marqueur (requise)"},zoom:{doubleClickToReset:"(Double-cliquez pour réinitialiser)"},csv:{chartTitle:"Titre du graphique",chartSubtitle:"Sous-titre du graphique",generated:"Généré"},fallback:{item:"Élément",axis:"Axe"},tooltip:{flags:"Drapeaux",markers:"Marqueurs",manualFlags:"Drapeaux manuels",autoFlags:"Drapeaux automatiques"}},Up={firstPage:"Première page",previousPage:"Page précédente",nextPage:"Page suivante",lastPage:"Dernière page",currentPageAriaLabel:"Page actuelle",rowsPerPage:"Lignes par page",searchPlaceholder:"Rechercher...",searchAriaLabel:"Rechercher",searchTableAriaLabel:"Rechercher dans le tableau",clearSearchAriaLabel:"Effacer la recherche",downloadPdf:"Télécharger PDF",downloadExcel:"Télécharger Excel",columnVisibility:"Visibilité des colonnes",expandRowAriaLabel:"Développer la ligne",collapseRowAriaLabel:"Réduire la ligne",filterColumnAriaLabel:"Filtrer la colonne",clearFilter:"Effacer",search:"Rechercher...",filterFrom:"Du :",filterTo:"Au :",dateFormat:"jj/mm/aaaa",showingRange:"Affichage de {start}-{end} sur {total}",ofPages:"sur {total}",emptyMessage:"Aucune donnée disponible"},Xp={searchAcrossFields:"Rechercher dans tous les champs...",openAdvancedFilter:"Ouvrir le filtre avancé",closeAdvancedFilter:"Fermer le filtre avancé",noConditionsApplied:"Aucune condition de filtre n'est appliquée à cette vue",where:"Où",and:"Et",searchAttributes:"Rechercher des attributs...",noMatch:"Aucun résultat",enterValue:"Saisir une valeur...",min:"Min",max:"Max",search:"Rechercher...",addFilter:"Ajouter un filtre",clearAllFilters:"Effacer tous les filtres",select:"Sélectionner...",selectedCount:"{count} sélectionnés",operators:{contains:"contient",not_contains:"ne contient pas",equals:"est égal à",not_equals:"est différent de",starts_with:"commence par",ends_with:"se termine par",is_empty:"est vide",is_not_empty:"n'est pas vide",is_any_of:"est l'un de",is_none_of:"n'est aucun de",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"entre",contains_any:"contient l'un de",contains_all:"contient tous",not_contains_any:"ne contient pas",before:"avant",after:"après",is_true:"est vrai",is_false:"est faux"}},Yp={selectDate:"Sélectionner une date",selectRange:"Sélectionner une plage",selectFromList:"Sélectionner une date",noAvailableDates:"Aucune date disponible",startDate:"Date de début",endDate:"Date de fin",prevMonth:"Mois précédent",nextMonth:"Mois suivant",quickSelect:{today:"Aujourd'hui",lastWeek:"Dernière semaine",last15Days:"15 derniers jours",last30Days:"30 derniers jours",thisMonth:"Ce mois",last3Months:"3 derniers mois",last6Months:"6 derniers mois",last12Months:"12 derniers mois",lastYear:"Dernière année",allDates:"Toutes les dates",last2Dates:"2 dernières dates",last3Dates:"3 dernières dates",last4Dates:"4 dernières dates",last5Dates:"5 dernières dates"}},jp={toolbar:{undo:"Annuler",redo:"Rétablir",paragraphFormat:"Format de paragraphe",bold:"Gras",italic:"Italique",underline:"Souligné",citation:"Citation",insertLink:"Insérer un lien",removeLink:"Supprimer le lien",bulletList:"Liste à puces",numberList:"Liste numérotée",image:"Image",comment:"Commentaire",askAi:"Demander à l'IA"},paragraph:{heading1:"En-tête 1",heading2:"En-tête 2",heading3:"En-tête 3",heading4:"En-tête 4",heading5:"En-tête 5",heading6:"En-tête 6",paragraph:"Paragraphe"},link:{editLink:"Modifier le lien",altText:"Texte alternatif :",url:"URL :",enterAltText:"Entrez le texte alternatif...",enterUrl:"Entrez l'URL...",cancel:"Annuler",save:"Enregistrer"},image:{addImage:"Ajouter une image",editImage:"Modifier l'image",upload:"Télécharger",imageLink:"Lien de l'image",uploadImage:"Télécharger l'image :",imageUrl:"URL de l'image :",altText:"Texte alternatif :",width:"Largeur (px) :",height:"Hauteur (px) :",enterAltText:"Entrez le texte alternatif...",enterImageUrl:"https://exemple.com/image.jpg",auto:"Auto",noAlt:"Pas de texte alternatif",cancel:"Annuler",save:"Enregistrer"},comment:{placeholder:"Ajouter un commentaire",send:"Envoyer",delete:"Supprimer le commentaire"},started_conversation:"A démarré la conversation",labels:{title:"Titre",description:"Description"},placeholders:{title:"Entrez le titre...",description:"Entrez la description...",startTyping:"Commencez à taper..."},footer:{word:"mot",words:"mots",character:"caractère",characters:"caractères"}},co={chart:Zp,table:Up,filter:Xp,datepicker:Yp,textEditor:jp},Kp={contextMenu:{addMarker:"Markering toevoegen",clearAllMarkers:"Alle markeringen wissen",downloadSvg:"SVG downloaden",downloadPng:"PNG downloaden",downloadCsv:"CSV downloaden"},modalMarker:{editMarker:"Markering bewerken",viewMarker:"Markering bekijken",title:"Titel",description:"Beschrijving",iconType:"Pictogramtype",defaultIcon:"Standaard logo",iconPreview:"Pictogramvoorbeeld",deleteMarker:"Markering verwijderen",cancel:"Annuleren",close:"Sluiten",save:"Opslaan",placeholderTitle:"Voer markeringstitel in",placeholderDescription:"Voer markeringsbeschrijving in (optioneel)"},zoom:{doubleClickToReset:"(Dubbelklik om te resetten)"},csv:{chartTitle:"Grafiek titel",chartSubtitle:"Grafiek ondertitel",generated:"Gegenereerd"},fallback:{item:"Item",axis:"As"},tooltip:{flags:"Vlaggen",markers:"Markeringen",manualFlags:"Handmatige vlaggen",autoFlags:"Automatische vlaggen"}},Gp={firstPage:"Eerste pagina",previousPage:"Vorige pagina",nextPage:"Volgende pagina",lastPage:"Laatste pagina",currentPageAriaLabel:"Huidige pagina",rowsPerPage:"Rijen per pagina",searchPlaceholder:"Zoeken...",searchAriaLabel:"Zoeken",searchTableAriaLabel:"Zoeken in tabel",clearSearchAriaLabel:"Zoekopdracht wissen",downloadPdf:"PDF downloaden",downloadExcel:"Excel downloaden",columnVisibility:"Kolommen weer te geven",expandRowAriaLabel:"Rij uitklappen",collapseRowAriaLabel:"Rij inklappen",filterColumnAriaLabel:"Kolom filteren",clearFilter:"Wissen",search:"Zoeken...",filterFrom:"Van:",filterTo:"Tot:",dateFormat:"dd-mm-jjjj",showingRange:"{start}-{end} van {total} weergegeven",ofPages:"van {total}",emptyMessage:"Geen gegevens beschikbaar"},Qp={searchAcrossFields:"Zoeken in alle velden...",openAdvancedFilter:"Geavanceerde filter openen",closeAdvancedFilter:"Geavanceerde filter sluiten",noConditionsApplied:"Er zijn geen filtervoorwaarden toegepast op deze weergave",where:"Waar",and:"En",searchAttributes:"Zoek attributen...",noMatch:"Geen overeenkomst",enterValue:"Voer waarde in...",min:"Min",max:"Max",search:"Zoeken...",addFilter:"Filter toevoegen",clearAllFilters:"Alle filters wissen",select:"Selecteren...",selectedCount:"{count} geselecteerd",operators:{contains:"bevat",not_contains:"bevat niet",equals:"is gelijk aan",not_equals:"is niet gelijk aan",starts_with:"begint met",ends_with:"eindigt op",is_empty:"is leeg",is_not_empty:"is niet leeg",is_any_of:"is een van",is_none_of:"is geen van",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"tussen",contains_any:"bevat een van",contains_all:"bevat alle",not_contains_any:"bevat niet",before:"voor",after:"na",is_true:"is waar",is_false:"is onwaar"}},Jp={selectDate:"Selecteer datum",selectRange:"Selecteer bereik",selectFromList:"Selecteer een datum",noAvailableDates:"Geen datums beschikbaar",startDate:"Startdatum",endDate:"Einddatum",prevMonth:"Vorige maand",nextMonth:"Volgende maand",quickSelect:{today:"Vandaag",lastWeek:"Afgelopen week",last15Days:"Laatste 15 dagen",last30Days:"Laatste 30 dagen",thisMonth:"Deze maand",last3Months:"Laatste 3 maanden",last6Months:"Laatste 6 maanden",last12Months:"Laatste 12 maanden",lastYear:"Afgelopen jaar",allDates:"Alle datums",last2Dates:"Laatste 2 datums",last3Dates:"Laatste 3 datums",last4Dates:"Laatste 4 datums",last5Dates:"Laatste 5 datums"}},e9={toolbar:{undo:"Ongedaan maken",redo:"Opnieuw",paragraphFormat:"Alineaopmaak",bold:"Vet",italic:"Cursief",underline:"Onderstreept",citation:"Citaat",insertLink:"Link invoegen",removeLink:"Link verwijderen",bulletList:"Lijst met opsommingstekens",numberList:"Genummerde lijst",image:"Afbeelding",comment:"Commentaar",askAi:"Vraag AI"},paragraph:{heading1:"Kop 1",heading2:"Kop 2",heading3:"Kop 3",heading4:"Kop 4",heading5:"Kop 5",heading6:"Kop 6",paragraph:"Alinea"},link:{editLink:"Link bewerken",altText:"Alt-tekst:",url:"URL:",enterAltText:"Voer alt-tekst in...",enterUrl:"Voer URL in...",cancel:"Annuleren",save:"Opslaan"},image:{addImage:"Afbeelding toevoegen",editImage:"Afbeelding bewerken",upload:"Uploaden",imageLink:"Afbeeldingslink",uploadImage:"Afbeelding uploaden:",imageUrl:"Afbeeldings-URL:",altText:"Alt-tekst:",width:"Breedte (px):",height:"Hoogte (px):",enterAltText:"Voer alt-tekst in...",enterImageUrl:"https://voorbeeld.com/afbeelding.jpg",auto:"Auto",noAlt:"Geen alt-tekst",cancel:"Annuleren",save:"Opslaan"},comment:{placeholder:"Voeg een opmerking toe",send:"Verzenden",delete:"Opmerking verwijderen"},started_conversation:"Gesprek gestart",labels:{title:"Titel",description:"Beschrijving"},placeholders:{title:"Voer titel in...",description:"Voer beschrijving in...",startTyping:"Begin met typen..."},footer:{word:"woord",words:"woorden",character:"teken",characters:"tekens"}},uo={chart:Kp,table:Gp,filter:Qp,datepicker:Jp,textEditor:e9},Oo={en:io,fr:co,nl:uo};function Ma(E){if(!E||!E.global)return;const te=E.global.availableLocales||[];Object.keys(Oo).forEach($=>{te.includes($)&&E.global.mergeLocaleMessage($,Oo[$])})}const Wo={en:{textEditor:io.textEditor},fr:{textEditor:co.textEditor},nl:{textEditor:uo.textEditor}};function _a(E){if(!E||!E.global)return;const te=E.global.availableLocales||[];Object.keys(Wo).forEach($=>{te.includes($)&&E.global.mergeLocaleMessage($,Wo[$])})}const qo={en:{table:io.table},fr:{table:co.table},nl:{table:uo.table}};function $a(E){if(!E||!E.global)return;const te=E.global.availableLocales||[];Object.keys(qo).forEach($=>{te.includes($)&&E.global.mergeLocaleMessage($,qo[$])})}const Zo={en:{datepicker:io.datepicker},fr:{datepicker:co.datepicker},nl:{datepicker:uo.datepicker}};function La(E){if(!E||!E.global)return;const te=E.global.availableLocales||[];Object.keys(Zo).forEach($=>{te.includes($)&&E.global.mergeLocaleMessage($,Zo[$])})}const Uo={en:{filter:io.filter},fr:{filter:co.filter},nl:{filter:uo.filter}};function Aa(E){if(!E||!E.global)return;const te=E.global.availableLocales||[];Object.keys(Uo).forEach($=>{te.includes($)&&E.global.mergeLocaleMessage($,Uo[$])})}const t9={chart:Oo,textEditor:Wo,table:qo,datepicker:Zo,filter:Uo};function l9(E){!E||!E.global||(Ma(E),_a(E),$a(E),La(E),Aa(E))}const n9={en:{...io},fr:{...co},nl:{...uo}};ro.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:n9});exports.DSSChart=Gc;exports.DSSChartMessages=Oo;exports.DSSColorPicker=I2;exports.DSSConfetti=p0;exports.DSSDatepicker=pa;exports.DSSDatepickerMessages=Zo;exports.DSSDnd=d0;exports.DSSFilter=Cp;exports.DSSFilterMessages=Uo;exports.DSSLoader=Q2;exports.DSSMessages=t9;exports.DSSModal=ma;exports.DSSPillField=Mp;exports.DSSSkeleton=J2;exports.DSSStepBar=Rp;exports.DSSTable=kd;exports.DSSTableMessages=qo;exports.DSSTextEditor=w2;exports.DSSTextEditorMessages=Wo;exports.DSSTitle=Ip;exports.addDSSChartTranslations=Ma;exports.addDSSDatepickerTranslations=La;exports.addDSSFilterTranslations=Aa;exports.addDSSTableTranslations=$a;exports.addDSSTextEditorTranslations=_a;exports.addDSSTranslations=l9;
|
|
119
|
+
`,document.body.appendChild(Ue),me=Ue}function Ge(W,G){me&&(me.style.left=`${W-Je}px`,me.style.top=`${G-pt}px`)}function be(W){W.classList.add("dss-dnd-item--dragging"),W.style.background=he.value.dragSourceBackground,W.style.borderColor=he.value.dragSourceBorder,W.style.transform="scale(0.97)"}function Qe(W){W.classList.remove("dss-dnd-item--dragging"),W.style.background="",W.style.borderColor="",W.style.transform=""}function ct(W,G){return document.elementFromPoint(W,G)?.closest(".dss-dnd-column-body")??null}function gt(W,G){return!!document.elementFromPoint(W,G)?.closest("[data-dss-dnd-delete-zone]")}function ut(W,G){if(P.value&>(W,G)){Ce.value=!0,we.value=null,J.value=-1;return}Ce.value=!1;const Ne=ct(W,G),Ie=Ne?.getAttribute("data-column")??null;if(!Ie){we.value=null,J.value=-1;return}we.value=Ie;const Ue=Ne.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let Et=Ue.length;for(let Ke=0;Ke<Ue.length;Ke++){const Ut=Ue[Ke].getBoundingClientRect();if(G<Ut.top+Ut.height/2){Et=Ke;break}}J.value=Et}function qt(W){W.preventDefault(),Ge(W.clientX,W.clientY),!fe&&(fe=requestAnimationFrame(()=>{fe=null,ut(W.clientX,W.clientY)}))}function Zt(W){window.removeEventListener("pointermove",qt),window.removeEventListener("pointerup",Zt),window.removeEventListener("pointercancel",Zt),_e?.releasePointerCapture?.(W.pointerId),Qe(_e),_e=null;const G=P.value&>(W.clientX,W.clientY);if(f.value&&G)B("delete",{item:f.value});else{const Ie=ct(W.clientX,W.clientY)?.getAttribute("data-column")??null;if(f.value&&Ie){const Ue=f.value[_.columnKey],Et=Ie,Ut=(Se.value[Et]||[]).filter($t=>$t[_.itemKey]!==f.value[_.itemKey]),qe=Math.max(0,Math.min(J.value,Ut.length)),Pe=Ye(Et,qe),Ht=f.value[_.itemKey];B("move",{item:f.value,from:Ue,to:Et,position:Pe,index:qe}),R&&clearTimeout(R),X.value={id:Ht,from:Ue,to:Et},R=setTimeout(()=>{X.value=null},3500)}}me&&(me.remove(),me=null),Z!==null&&(document.body.style.cursor=Z,Z=""),ke()}function kt(W,G){W.preventDefault();const Ne=W.target.closest(".dss-dnd-item");if(!Ne)return;const Ie=Ne.getBoundingClientRect();Je=W.clientX-Ie.left,pt=W.clientY-Ie.top,Z=document.body.style.cursor,document.body.style.cursor="grabbing",f.value=G,_e=Ne,ie(Ne,W.clientX,W.clientY),requestAnimationFrame(()=>be(Ne)),Ne.setPointerCapture?.(W.pointerId),window.addEventListener("pointermove",qt),window.addEventListener("pointerup",Zt,{once:!0}),window.addEventListener("pointercancel",Zt,{once:!0})}function xt(){Fe&&(window.removeEventListener("pointermove",Yt),window.removeEventListener("pointerup",rt),window.removeEventListener("pointercancel",rt),Fe=null)}function Yt(W){if(!Fe||W.pointerId!==Fe.pointerId)return;const G=W.clientX-Fe.startX,Ne=W.clientY-Fe.startY;if(Math.abs(G)>=We||Math.abs(Ne)>=We){const Ie=Fe.item;xt(),kt(W,Ie)}}function rt(W){!Fe||W.pointerId!==Fe.pointerId||xt()}function Jt(W,G){xt(),Fe={item:G,startX:W.clientX,startY:W.clientY,pointerId:W.pointerId},window.addEventListener("pointermove",Yt),window.addEventListener("pointerup",rt),window.addEventListener("pointercancel",rt)}function yt(W,G){he.value.useHandle||Jt(W,G)}function ol(W,G){Jt(W,G)}function U(){fe&&(cancelAnimationFrame(fe),fe=null)}function ke(){U(),f.value=null,we.value=null,Ce.value=!1,J.value=-1}return e.onBeforeUnmount(()=>{U(),xt(),R&&clearTimeout(R),me&&(me.remove(),me=null)}),(W,G)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":he.value.unstyled}]),style:e.normalizeStyle(st.value)},[P.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["dss-dnd-delete-zone",{"dss-dnd-delete-zone--drag-over":Ce.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(W.$slots,"delete-zone",{isDragging:!!f.value,isOver:Ce.value})],2),[[e.vShow,!!f.value||he.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.columns,Ne=>(e.openBlock(),e.createElementBlock("div",{key:Ne.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":we.value==Ne.value},Ne.class||""]]),style:e.normalizeStyle(te(Ne))},[he.value.showHeader?(e.openBlock(),e.createElementBlock("div",Q2,[e.renderSlot(W.$slots,"column-header",{column:Ne,items:Se.value[Ne.value]||[]},()=>[e.createElementVNode("span",J2,e.toDisplayString(Ne.title||Ne.value),1),e.createElementVNode("span",e0,e.toDisplayString((Se.value[Ne.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":Ne.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Le.value[Ne.value],Ie=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Ie.key},[Ie.type==="indicator"?(e.openBlock(),e.createElementBlock("div",l0)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":Ie.isDragged,"dss-dnd-item--no-handle":!he.value.useHandle}]),onPointerdown:Ue=>yt(Ue,Ie.item)},[he.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(Ue=>ol(Ue,Ie.item),["stop"])},[e.renderSlot(W.$slots,"handle",{},()=>[G[0]||(G[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,o0)):e.createCommentVNode("",!0),e.createElementVNode("div",a0,[e.renderSlot(W.$slots,"item",{item:Ie.item,column:Ne,justDropped:X.value?.id===Ie.item[E.itemKey],droppedFrom:X.value?.id===Ie.item[E.itemKey]?X.value.from:null,droppedTo:X.value?.id===Ie.item[E.itemKey]?X.value.to:null},()=>[e.createElementVNode("div",s0,e.toDisplayString(Ie.item[E.itemKey]),1)])])],42,n0))],64))),128)),(Se.value[Ne.value]||[]).length===0&&we.value!=Ne.value?(e.openBlock(),e.createElementBlock("div",r0,[e.renderSlot(W.$slots,"empty",{column:Ne},()=>[G[1]||(G[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,t0)],6))),128))],6))}}),u0={name:"DSSConfetti"},d0=Object.assign(u0,{props:{trigger:{type:Boolean,default:!1},duration:{type:Number,default:3e3},fadeStart:{type:Number,default:2e3},count:{type:Number,default:90},colors:{type:Array,default:()=>["#047395","#ffc230","#0897c1","#fe3b59","#11e1a2","#b3b2fb","#fadb8d","#ffa25b","#feaab1"]},delay:{type:Number,default:300}},setup(E){const le=E,_=e.ref(null),B=e.ref(!1);let de=[],P=null,T=null;function he(J,X){const fe=[];for(let R=0;R<le.count;R++)fe.push(st(J));return fe}function st(J,X){return{x:Math.random()*J,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:le.colors[Math.floor(Math.random()*le.colors.length)],tilt:Math.floor(Math.random()*10)-10,tiltInc:Math.random()*.08+.04,tiltAngle:0,opacity:Math.random()*.7+.3,speed:Math.random()*4+1.5}}function te(J,X,fe,R){J.clearRect(0,0,X,fe);for(const me of de)J.save(),J.globalAlpha=me.opacity*R,J.beginPath(),J.lineWidth=me.r,J.strokeStyle=me.color,J.moveTo(me.x+me.tilt+me.r/2,me.y),J.lineTo(me.x+me.tilt,me.y+me.tilt+me.r/2),J.stroke(),J.restore()}function f(J,X,fe){const R=.3+fe*.7;for(let me=0;me<de.length;me++){const _e=de[me];_e.tiltAngle+=_e.tiltInc,_e.y+=_e.speed*R,_e.x+=Math.sin(_e.d)*.5*R,_e.tilt=Math.sin(_e.tiltAngle)*15,fe>=.99&&_e.y>X+20&&(de[me]=st(J))}}function we(){B.value=!0,e.nextTick(()=>{const J=_.value;if(!J)return;const X=J.getContext("2d"),fe=J.parentElement;if(!fe)return;const R=fe.getBoundingClientRect();J.width=R.width,J.height=R.height,de=he(J.width,J.height);const me=Date.now(),_e=me+le.duration,Je=()=>{const pt=Date.now(),Z=pt-me;if(pt<_e){let Fe=1;Z>le.fadeStart&&(Fe=1-(Z-le.fadeStart)/(le.duration-le.fadeStart)),te(X,J.width,J.height,Fe),f(J.width,J.height,Fe),P=requestAnimationFrame(Je)}else Ce()};Je()})}function Ce(){P&&(cancelAnimationFrame(P),P=null),de=[],B.value=!1}return e.watch(()=>le.trigger,J=>{J&&(T&&clearTimeout(T),T=setTimeout(we,le.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{Ce(),T&&clearTimeout(T)}),(J,X)=>B.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:_,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),m0={class:"dss-filter-global-inner"},p0=["placeholder","value"],v0=["title"],f0={key:0,class:"dss-filter-funnel-badge"},h0={key:1,class:"dss-filter-sortby"},g0=["value"],y0=["value"],k0=["disabled","title"],C0={key:0,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b0={key:1,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},w0={key:2,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},x0={class:"dss-filter-panel"},E0={key:0,class:"dss-filter-empty"},S0={class:"dss-filter-row-prefix"},V0={class:"dss-filter-cell"},N0=["onClick"],B0={class:"dss-filter-trigger-text"},M0=["placeholder"],_0={class:"dss-filter-popup-list"},$0=["onClick"],L0={key:0,class:"dss-filter-popup-empty"},T0={key:0,class:"dss-filter-cell"},A0=["onClick"],D0={class:"dss-filter-trigger-text"},H0={class:"dss-filter-popup-list"},R0=["onClick"],F0={key:1,class:"dss-filter-cell dss-filter-cell--value"},I0=["placeholder","onUpdate:modelValue"],z0={key:1,class:"dss-filter-date-wrap"},P0=["placeholder","onUpdate:modelValue"],O0=["placeholder","value","onInput","step"],W0={key:4,class:"dss-filter-between"},q0=["placeholder","value","onInput","step"],Z0={class:"dss-filter-between-sep"},U0=["placeholder","value","onInput","step"],X0={key:5,class:"dss-filter-multiselect"},Y0=["onClick"],j0={class:"dss-filter-trigger-text"},K0=["placeholder"],G0={class:"dss-filter-popup-list dss-filter-popup-list--check"},Q0=["onClick"],J0=["checked"],ep={key:0,class:"dss-filter-popup-empty"},tp=["onClick"],lp={class:"dss-filter-foot"},np={class:"dss-filter-cell"},op=["placeholder"],ap={class:"dss-filter-popup-list"},sp=["onClick"],rp={key:0,class:"dss-filter-popup-divider"},ip=["onClick"],cp=["placeholder"],up={class:"dss-filter-popup-list"},dp=["onClick"],mp={key:0,class:"dss-filter-popup-empty"},pp=["placeholder"],vp={class:"dss-filter-popup-list"},fp=["onClick"],hp={key:0,class:"dss-filter-popup-empty"},gp={name:"DSSFilter"},yp=Object.assign(gp,{props:{data:{type:Array,required:!0},modelValue:{type:Array,default:void 0},exclude:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})},showSortBy:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(E,{expose:le,emit:_}){const{t:B}=so.useI18n(),de=E,P=_,T={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},he=e.computed(()=>({...T,...de.options})),st={text:[{value:"contains"},{value:"not_contains"},{value:"equals"},{value:"not_equals"},{value:"starts_with"},{value:"ends_with"},{value:"is_empty"},{value:"is_not_empty"}],select:[{value:"is_any_of"},{value:"is_none_of"},{value:"is_empty"},{value:"is_not_empty"}],range:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],int:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],arraySelect:[{value:"contains_any"},{value:"contains_all"},{value:"not_contains_any"},{value:"is_empty"},{value:"is_not_empty"}],arrayText:[{value:"contains"},{value:"not_contains"},{value:"is_empty"},{value:"is_not_empty"}],date:[{value:"eq"},{value:"before"},{value:"after"},{value:"is_empty"},{value:"is_not_empty"}],boolean:[{value:"is_true"},{value:"is_false"},{value:"is_empty"},{value:"is_not_empty"}]},te=new Set(["is_empty","is_not_empty","is_true","is_false"]),f=["label","name","title","keyword","full_name","value","text"],we=e.ref(""),Ce=e.ref([]),J=e.ref(null),X=e.ref(!1),fe=e.ref(null),R=e.ref(""),me=e.ref(null),_e=e.ref(""),Je=e.ref("asc");let pt=1;function Z(M){const w=M.find(A=>A&&typeof A=="object");if(!w)return null;for(const A of f)if(A in w&&typeof w[A]=="string")return A;return Object.keys(w).find(A=>typeof w[A]=="string")||null}function Fe(M,w){const A=w.filter(se=>se!=null&&se!=="NULL");if(A.length===0)return null;if(A.every(se=>Array.isArray(se))){const se=A.flatMap(He=>He).filter(He=>He!=null);return se.length===0?null:typeof se.find(He=>He!=null)=="object"?"arraySelect":"arrayText"}return A.every(se=>typeof se=="boolean")?"boolean":A.every(se=>typeof se=="number")?new Set(A).size<=he.value.maxUniqueForEnum?"select":"range":A.every(se=>typeof se=="string")?new Set(A).size<=he.value.maxUniqueForSelect?"select":"text":A.some(se=>typeof se=="object"&&!Array.isArray(se))?null:"text"}const We=e.computed(()=>{if(!de.data?.length)return[];const M=new Set;for(const ae of de.data)if(ae&&typeof ae=="object")for(const He of Object.keys(ae))M.add(He);const w=new Set(de.exclude),A=[];for(const ae of M){if(w.has(ae))continue;const He=de.config[ae]||{},Ct=de.data.map(St=>St?.[ae]),nt=He.type||Fe(ae,Ct);if(!nt)continue;const Re=He.filterMode||"contain",bt=Re==="date"?"date":Re==="string"?"text":nt,_t={key:ae,label:He.label||et(ae),type:bt,filterMode:Re};if(nt==="select"){const St=Ct.filter(Lt=>Lt!=null&&Lt!=="NULL");_t.uniqueValues=[...new Set(St)].sort((Lt,zt)=>typeof Lt=="number"&&typeof zt=="number"?Lt-zt:String(Lt).localeCompare(String(zt)))}else if(nt==="range"||nt==="int"){const St=Ct.filter(Lt=>typeof Lt=="number");_t.min=Math.min(...St),_t.max=Math.max(...St)}else if(nt==="arraySelect"){const St=He.displayKey||Z(Ct.flatMap(Lt=>Array.isArray(Lt)?Lt:[]));if(_t.displayKey=St,Array.isArray(He.uniqueValues)&&He.uniqueValues.length>0)_t.uniqueValues=He.uniqueValues.map(Lt=>String(Lt));else{const Lt=Ct.flatMap(zt=>Array.isArray(zt)?zt:[]).filter(zt=>zt!=null).map(zt=>St&&typeof zt=="object"?zt[St]:String(zt)).filter(zt=>zt!=null&&zt!=="");_t.uniqueValues=[...new Set(Lt)].sort((zt,Bt)=>String(zt).localeCompare(String(Bt)))}}A.push(_t)}const se=de.config._order;return se&&A.sort((ae,He)=>{const Ct=se.indexOf(ae.key),nt=se.indexOf(He.key);return Ct===-1&&nt===-1?0:Ct===-1?1:nt===-1?-1:Ct-nt}),A}),Se=e.computed(()=>{const M={};for(const w of We.value)M[w.key]=w;return M}),Le=e.computed(()=>Array.isArray(de.config.groups)&&de.config.groups.length>0),Ye=e.computed(()=>{if(!Le.value)return[];const M=new Set(We.value.map(w=>w.key));return de.config.groups.map(w=>({...w,keys:w.keys.filter(A=>M.has(A))})).filter(w=>w.keys.length>0)}),ie=e.computed(()=>{if(!Le.value)return[];const M=new Set(de.config.groups.flatMap(w=>w.keys));return We.value.filter(w=>!M.has(w.key))}),Ge=e.computed(()=>{if(!me.value)return[];const M=new Set(me.value.keys),w=We.value.filter(se=>M.has(se.key));if(!R.value)return w;const A=R.value.toLowerCase();return w.filter(se=>se.label.toLowerCase().includes(A))}),be=e.computed(()=>{if(!R.value)return We.value;const M=R.value.toLowerCase();return We.value.filter(w=>w.label.toLowerCase().includes(M))}),Qe=e.computed(()=>We.value.filter(M=>!["arraySelect","arrayText"].includes(M.type))),ct=e.computed(()=>_e.value?Je.value==="asc"?"Ascending":"Descending":"No sort selected");function gt(M){J.value===M?ut():(J.value=M,R.value="",me.value=null)}function ut(){J.value=null,R.value="",me.value=null}function qt(M){const w=M.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");J.value&&!w&&!M.target.closest(".dss-filter-popup")&&!M.target.closest(".dss-filter-trigger")&&!M.target.closest(".dss-filter-add-btn")&&ut(),X.value&&fe.value&&!fe.value.contains(M.target)&&(w||(X.value=!1))}e.onMounted(()=>document.addEventListener("click",qt)),e.onBeforeUnmount(()=>document.removeEventListener("click",qt));function Zt(M){return Se.value[M]?.label||et(M)}function kt(M){return Se.value[M.key]?.filterMode||"contain"}function xt(M){return B(`filter.operators.${M}`)}function Yt(M){const w=Se.value[M.key];return(st[w?.type]||st.text).map(A=>({...A,label:B(`filter.operators.${A.value}`)}))}function rt(M){return te.has(M)}function Jt(M){const w=Se.value[M.key];return w?w.type==="date"?"date":w.type==="boolean"?"boolean":w.type==="text"||w.type==="arrayText"?"text":w.type==="select"||w.type==="arraySelect"?"multiselect":w.type==="range"||w.type==="int"?M.operator==="between"?"between":"number":"text":"text"}function yt(M){return st[M]?.[0]?.value||"contains"}function ol(M,w){return te.has(w)||M==="date"?null:M==="select"||M==="arraySelect"?[]:(M==="range"||M==="int")&&w==="between"?{min:null,max:null}:M==="range"||M==="int"?null:""}function U(M){return Se.value[M.key]?.uniqueValues||[]}function ke(M){const w=U(M);if(!R.value)return w;const A=R.value.toLowerCase();return w.filter(se=>String(se).toLowerCase().includes(A))}function W(M){const w=M.value;return!w||w.length===0?B("filter.select"):w.length<=2?w.join(", "):B("filter.selectedCount",{count:w.length})}function G(M){const w=Se.value[M],A=w?.filterMode||"contain",se=w?.type||"text",ae=A==="string"?"contains":yt(se);Ce.value.push(e.reactive({id:pt++,key:M,operator:ae,value:ol(se,ae)})),ut()}function Ne(M){Ce.value=Ce.value.filter(w=>w.id!==M)}function Ie(M,w){const se=Se.value[w]?.type||"text";M.key=w,M.operator=yt(se),M.value=ol(se,M.operator),ut()}function Ue(M,w){const A=Jt(M);M.operator=w;const se=Jt(M);if(A!==se||te.has(w)){const ae=Se.value[M.key];M.value=ol(ae?.type||"text",w)}ut()}function Et(M,w){const A=w.target.value;M.value=A===""?null:Number(A)}function Ke(M,w,A){const se=A.target.value,ae=se===""?null:Number(se);(!M.value||typeof M.value!="object")&&(M.value={min:null,max:null}),M.value={...M.value,[w]:isNaN(ae)?null:ae}}function Ut(M,w){const A=M.value||[],se=A.indexOf(w);M.value=se>=0?A.filter(ae=>ae!==w):[...A,w]}function qe(){Ce.value=[],we.value="",ut()}function Pe(M){we.value=M.target.value}function Ht(M){_e.value=M.target.value}function $t(){Je.value=Je.value==="asc"?"desc":"asc"}const oe=e.computed(()=>{if(!de.data)return[];let M=de.data;if(we.value){const w=we.value.toLowerCase();M=M.filter(A=>{for(const se of Object.keys(A)){const ae=A[se];if(typeof ae=="string"&&ae.toLowerCase().includes(w)||typeof ae=="number"&&String(ae).includes(w)||Array.isArray(ae)&&ae.some(He=>He!=null&&(typeof He=="string"?He.toLowerCase().includes(w):typeof He=="object"?Object.values(He).some(Ct=>typeof Ct=="string"&&Ct.toLowerCase().includes(w)):!1)))return!0}return!1})}for(const w of Ce.value){if(!pe(w))continue;const A=Se.value[w.key];A&&(M=M.filter(se=>xe(se,w,A)))}if(de.showSortBy&&_e.value){const w=_e.value,A=Je.value==="asc"?1:-1;M=[...M].sort((se,ae)=>Y(se?.[w],ae?.[w])*A)}return M});function Y(M,w){const A=j(M),se=j(w);return A==null&&se==null?0:A==null?1:se==null?-1:typeof A=="number"&&typeof se=="number"?A-se:String(A).localeCompare(String(se),void 0,{numeric:!0,sensitivity:"base"})}function j(M){return M==null||M==="NULL"?null:typeof M=="string"||typeof M=="number"||typeof M=="boolean"?M:M instanceof Date?M.getTime():null}function pe(M){return te.has(M.operator)?!0:M.value==null||typeof M.value=="string"&&M.value===""||Array.isArray(M.value)&&M.value.length===0?!1:M.value instanceof Date?!isNaN(M.value.getTime()):!(typeof M.value=="object"&&!Array.isArray(M.value)&&M.value.min==null&&M.value.max==null)}function xe(M,w,A){const se=M?.[w.key],ae=w.value,He=w.operator;if(He==="is_empty")return jt(se);if(He==="is_not_empty")return!jt(se);const Ct=A.type;if(Ct==="text"||Ct==="arrayText"){const nt=Ct==="arrayText"&&Array.isArray(se)?se.filter(_t=>_t!=null).map(String).join(" "):se!=null?String(se):"",Re=String(ae).toLowerCase(),bt=nt.toLowerCase();switch(He){case"contains":return bt.includes(Re);case"not_contains":return!bt.includes(Re);case"equals":return bt===Re;case"not_equals":return bt!==Re;case"starts_with":return bt.startsWith(Re);case"ends_with":return bt.endsWith(Re);default:return!0}}if(Ct==="select")switch(He){case"is_any_of":return ae.includes(se);case"is_none_of":return!ae.includes(se);default:return!0}if(Ct==="range"||Ct==="int"){const nt=typeof se=="number"?se:Number(se);if(typeof nt!="number"||isNaN(nt))return!1;if(He==="between"){const bt=ae?.min!=null?Number(ae.min):null,_t=ae?.max!=null?Number(ae.max):null,St=bt!=null&&!isNaN(bt)?bt:null,Lt=_t!=null&&!isNaN(_t)?_t:null;return(St==null||nt>=St)&&(Lt==null||nt<=Lt)}const Re=typeof ae=="number"&&!isNaN(ae)?ae:Number(ae);if(He==="contains"||He==="not_contains"){const bt=String(nt),_t=String(ae??"").toLowerCase(),St=bt.toLowerCase().includes(_t);return He==="contains"?St:!St}if(typeof Re!="number"||isNaN(Re))return!1;switch(He){case"eq":return nt===Re;case"neq":return nt!==Re;case"gt":return nt>Re;case"gte":return nt>=Re;case"lt":return nt<Re;case"lte":return nt<=Re;default:return!0}}if(Ct==="arraySelect"){if(!Array.isArray(se))return!1;const nt=se.filter(Re=>Re!=null).map(Re=>A.displayKey&&typeof Re=="object"?Re[A.displayKey]:String(Re));switch(He){case"contains_any":return nt.some(Re=>ae.includes(Re));case"contains_all":return ae.every(Re=>nt.includes(Re));case"not_contains_any":return!nt.some(Re=>ae.includes(Re));default:return!0}}if(Ct==="date"){const nt=je(ae);if(!nt||isNaN(nt.getTime()))return!1;const Re=je(se);if(!Re||isNaN(Re.getTime()))return!1;const bt=Rt(Re),_t=Rt(nt);switch(He){case"eq":return bt===_t;case"before":return bt<_t;case"after":return bt>_t;default:return!0}}if(Ct==="boolean"){const nt=se===!0||se==="true"||se===1,Re=se===!1||se==="false"||se===0;switch(He){case"is_true":return nt;case"is_false":return Re;default:return!0}}return!0}function je(M){if(M==null)return null;if(M instanceof Date)return isNaN(M.getTime())?null:M;if(typeof M=="number")return new Date(M>1e10?M:M*1e3);if(typeof M=="string"){const w=new Date(M);return isNaN(w.getTime())?null:w}return null}function Rt(M){const w=M.getFullYear(),A=String(M.getMonth()+1).padStart(2,"0"),se=String(M.getDate()).padStart(2,"0");return`${w}-${A}-${se}`}function jt(M){return!!(M==null||M===""||M==="NULL"||Array.isArray(M)&&M.length===0||Array.isArray(M)&&M.every(w=>w==null))}e.watch(oe,M=>P("update:modelValue",M),{immediate:!0}),e.watch(()=>de.data,()=>{Ce.value=[],we.value="",X.value=!1,_e.value="",Je.value="asc",ut()});function et(M){return M.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,w=>w.toUpperCase())}function pl(){const M=w=>{if(w==null)return w;if(w instanceof Date)return{_type:"Date",value:w.toISOString(),local:w.toLocaleDateString()};if(Array.isArray(w))return w.map(M);if(typeof w=="object"&&!Array.isArray(w)){const A={};for(const se of Object.keys(w))A[se]=M(w[se]);return A}return w};return{globalSearch:we.value,rows:Ce.value.map(w=>({key:w.key,operator:w.operator,value:M(w.value),defType:Se.value[w.key]?.type,defFilterMode:Se.value[w.key]?.filterMode})),filteredCount:oe.value?.length??0}}return le({getDebugState:pl}),(M,w)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":he.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:fe},[e.createElementVNode("div",m0,[w[20]||(w[20]=e.createElementVNode("svg",{class:"dss-filter-global-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),e.createElementVNode("input",{type:"text",class:"dss-filter-global-input",placeholder:e.unref(B)("filter.searchAcrossFields"),value:we.value,onInput:Pe},null,40,p0),we.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:w[0]||(w[0]=A=>we.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:X.value||Ce.value.length>0,"dss-filter-funnel-btn--with-sort":de.showSortBy}]),onClick:w[1]||(w[1]=A=>X.value=!X.value),type:"button",title:X.value?e.unref(B)("filter.closeAdvancedFilter"):e.unref(B)("filter.openAdvancedFilter")},[w[14]||(w[14]=e.createElementVNode("svg",{class:"dss-filter-funnel-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 2.00407L11.7537 2.00926L7.84558 6.18223V9.38409C7.84581 9.53637 7.80836 9.68634 7.73658 9.82064C7.6648 9.95494 7.56091 10.0694 7.43417 10.1538L5.58772 11.3852C5.44858 11.4779 5.28688 11.531 5.11988 11.539C4.95288 11.5469 4.78685 11.5094 4.63952 11.4304C4.49219 11.3514 4.36908 11.2338 4.28334 11.0903C4.1976 10.9467 4.15244 10.7826 4.15269 10.6154V6.18223L0.244567 2.00926L0.239951 2.00407C0.119785 1.87182 0.0405781 1.70755 0.0119374 1.53118C-0.0167033 1.35481 0.00645342 1.17391 0.0785984 1.01044C0.150743 0.846967 0.268776 0.707944 0.418378 0.610235C0.56798 0.512525 0.742722 0.460328 0.921405 0.459976H11.0769C11.2557 0.459994 11.4307 0.511948 11.5805 0.609528C11.7304 0.707107 11.8487 0.846111 11.9211 1.00965C11.9934 1.17319 12.0167 1.35422 11.9881 1.53075C11.9596 1.70728 11.8803 1.87172 11.7601 2.00407H11.7583Z",fill:"currentColor"})],-1)),Ce.value.length>0?(e.openBlock(),e.createElementBlock("span",f0,e.toDisplayString(Ce.value.length),1)):e.createCommentVNode("",!0)],10,v0),de.showSortBy?(e.openBlock(),e.createElementBlock("div",h0,[w[19]||(w[19]=e.createElementVNode("label",{class:"dss-filter-sortby-label",for:"dss-filter-sort-select"},"Sort by",-1)),e.createElementVNode("select",{id:"dss-filter-sort-select",class:"dss-filter-sortby-select",value:_e.value,onChange:Ht},[w[15]||(w[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qe.value,A=>(e.openBlock(),e.createElementBlock("option",{key:A.key,value:A.key},e.toDisplayString(A.label),9,y0))),128))],40,g0),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:$t,disabled:!_e.value,title:ct.value},[_e.value?Je.value==="asc"?(e.openBlock(),e.createElementBlock("svg",b0,[...w[17]||(w[17]=[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",w0,[...w[18]||(w[18]=[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",C0,[...w[16]||(w[16]=[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"currentColor"},null,-1)])]))],8,k0)])):e.createCommentVNode("",!0)]),X.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:w[13]||(w[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",x0,[Ce.value.length===0?(e.openBlock(),e.createElementBlock("div",E0,e.toDisplayString(e.unref(B)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,(A,se)=>(e.openBlock(),e.createElementBlock("div",{key:A.id,class:"dss-filter-row"},[e.createElementVNode("span",S0,e.toDisplayString(se===0?e.unref(B)("filter.where"):e.unref(B)("filter.and")),1),e.createElementVNode("div",V0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(ae=>gt(`${A.id}:field`),["stop"])},[e.createElementVNode("span",B0,e.toDisplayString(Zt(A.key)),1),w[21]||(w[21]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,N0),J.value===`${A.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[3]||(w[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[2]||(w[2]=ae=>R.value=ae),placeholder:e.unref(B)("filter.searchAttributes")},null,8,M0),[[e.vModelText,R.value]]),e.createElementVNode("ul",_0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(be.value,ae=>(e.openBlock(),e.createElementBlock("li",{key:ae.key,class:"dss-filter-popup-item",onClick:He=>Ie(A,ae.key)},e.toDisplayString(ae.label),9,$0))),128)),be.value.length===0?(e.openBlock(),e.createElementBlock("li",L0,e.toDisplayString(e.unref(B)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),kt(A)==="contain"||kt(A)==="date"?(e.openBlock(),e.createElementBlock("div",T0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(ae=>gt(`${A.id}:op`),["stop"])},[e.createElementVNode("span",D0,e.toDisplayString(xt(A.operator)),1),w[22]||(w[22]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,A0),J.value===`${A.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[4]||(w[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",H0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yt(A),ae=>(e.openBlock(),e.createElementBlock("li",{key:ae.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:A.operator===ae.value}]),onClick:He=>Ue(A,ae.value)},e.toDisplayString(ae.label),11,R0))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),rt(A.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",F0,[kt(A)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref(B)("filter.enterValue"),"onUpdate:modelValue":ae=>A.value=ae},null,8,I0)),[[e.vModelText,A.value]]):kt(A)==="date"?(e.openBlock(),e.createElementBlock("div",z0,[e.createVNode(ca,{mode:"single",modelValue:A.value,"onUpdate:modelValue":ae=>A.value=ae},null,8,["modelValue","onUpdate:modelValue"])])):Jt(A)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref(B)("filter.enterValue"),"onUpdate:modelValue":ae=>A.value=ae},null,8,P0)),[[e.vModelText,A.value]]):Jt(A)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref(B)("filter.enterValue"),value:A.value,onInput:ae=>Et(A,ae),step:Se.value[A.key]?.type==="int"?1:void 0},null,40,O0)):Jt(A)==="between"?(e.openBlock(),e.createElementBlock("div",W0,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(B)("filter.min"),value:A.value?.min,onInput:ae=>Ke(A,"min",ae),step:Se.value[A.key]?.type==="int"?1:void 0},null,40,q0),e.createElementVNode("span",Z0,e.toDisplayString(e.unref(B)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(B)("filter.max"),value:A.value?.max,onInput:ae=>Ke(A,"max",ae),step:Se.value[A.key]?.type==="int"?1:void 0},null,40,U0)])):Jt(A)==="multiselect"?(e.openBlock(),e.createElementBlock("div",X0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(ae=>gt(`${A.id}:val`),["stop"])},[e.createElementVNode("span",j0,e.toDisplayString(W(A)),1),w[23]||(w[23]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,Y0),J.value===`${A.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[6]||(w[6]=e.withModifiers(()=>{},["stop"]))},[U(A).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[5]||(w[5]=ae=>R.value=ae),placeholder:e.unref(B)("filter.search")},null,8,K0)),[[e.vModelText,R.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",G0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ke(A),ae=>(e.openBlock(),e.createElementBlock("li",{key:ae,class:"dss-filter-popup-item",onClick:He=>Ut(A,ae)},[e.createElementVNode("input",{type:"checkbox",checked:(A.value||[]).includes(ae),tabindex:"-1"},null,8,J0),e.createElementVNode("span",null,e.toDisplayString(ae),1)],8,Q0))),128)),ke(A).length===0?(e.openBlock(),e.createElementBlock("li",ep,e.toDisplayString(e.unref(B)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:ae=>Ne(A.id)},[...w[24]||(w[24]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,tp)]))),128)),e.createElementVNode("div",lp,[e.createElementVNode("div",np,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:w[7]||(w[7]=e.withModifiers(A=>gt("add"),["stop"]))},e.toDisplayString(e.unref(B)("filter.addFilter")),1),J.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:w[12]||(w[12]=e.withModifiers(()=>{},["stop"]))},[Le.value&&!me.value&&!R.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[8]||(w[8]=A=>R.value=A),placeholder:e.unref(B)("filter.searchAttributes")},null,8,op),[[e.vModelText,R.value]]),e.createElementVNode("ul",ap,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ye.value,A=>(e.openBlock(),e.createElementBlock("li",{key:A.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:se=>me.value=A},[e.createElementVNode("span",null,e.toDisplayString(A.label),1),w[25]||(w[25]=e.createElementVNode("svg",{class:"dss-filter-chevron-right",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"9 18 15 12 9 6"})],-1))],8,sp))),128)),ie.value.length>0?(e.openBlock(),e.createElementBlock("li",rp)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ie.value,A=>(e.openBlock(),e.createElementBlock("li",{key:A.key,class:"dss-filter-popup-item",onClick:se=>G(A.key)},e.toDisplayString(A.label),9,ip))),128))])],64)):me.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:w[9]||(w[9]=A=>me.value=null)},[w[26]||(w[26]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1)),e.createElementVNode("span",null,e.toDisplayString(me.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[10]||(w[10]=A=>R.value=A),placeholder:e.unref(B)("filter.searchAttributes")},null,8,cp),[[e.vModelText,R.value]]),e.createElementVNode("ul",up,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ge.value,A=>(e.openBlock(),e.createElementBlock("li",{key:A.key,class:"dss-filter-popup-item",onClick:se=>G(A.key)},e.toDisplayString(A.label),9,dp))),128)),Ge.value.length===0?(e.openBlock(),e.createElementBlock("li",mp,e.toDisplayString(e.unref(B)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[11]||(w[11]=A=>R.value=A),placeholder:e.unref(B)("filter.searchAttributes")},null,8,pp),[[e.vModelText,R.value]]),e.createElementVNode("ul",vp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(be.value,A=>(e.openBlock(),e.createElementBlock("li",{key:A.key,class:"dss-filter-popup-item",onClick:se=>G(A.key)},e.toDisplayString(A.label),9,fp))),128)),be.value.length===0?(e.openBlock(),e.createElementBlock("li",hp,e.toDisplayString(e.unref(B)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),Ce.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:qe},e.toDisplayString(e.unref(B)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),kp={class:"dss-pill-field__pills"},Cp=["data-value"],bp=["disabled"],wp={class:"dss-pill-field__pill-text"},xp={key:0,class:"dss-pill-field__pill-actions"},Ep=["onClick"],Sp=["onClick"],Vp=["placeholder","disabled"],Np=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(E,{emit:le}){const _=E,B=le,de=e.ref(""),P=e.ref([..._.modelValue]),T=e.ref(null);let he=null;const st=e.ref(null),te=e.ref(""),f=e.ref(null),we=e.ref(null),Ce=e.computed(()=>{if(!we.value)return;const{width:Le,height:Ye}=we.value;return{minWidth:`${Le}px`,height:`${Ye}px`}});function J(Le,Ye){st.value===Ye&&(f.value=Le)}function X(){st.value=null,te.value="",we.value=null,f.value=null}const fe=e.computed(()=>new Set(P.value.map(Le=>Le.trim()).filter(Boolean)));function R(Le){T.value=Le,he&&clearTimeout(he),he=setTimeout(()=>{T.value=null,he=null},900)}function me(Le){const Ye=Le.trim();return Ye?fe.value.has(Ye)?(R(Ye),!1):(P.value=[...P.value,Ye],B("update:modelValue",[...P.value]),!0):!1}function _e(Le){const Ye=Le.split(/\r?\n/g).map(Qe=>Qe.trim()).filter(Boolean);if(!Ye.length)return;const ie=new Set(P.value.map(Qe=>Qe.trim()).filter(Boolean)),Ge=[...P.value];let be=null;for(const Qe of Ye){if(ie.has(Qe)){be??=Qe;continue}ie.add(Qe),Ge.push(Qe)}Ge.length!==P.value.length&&(P.value=Ge,B("update:modelValue",[...P.value])),be&&R(be)}function Je(Le){_.disabled||(st.value===Le&&X(),P.value=P.value.filter((Ye,ie)=>ie!==Le),B("update:modelValue",[...P.value]))}async function pt(Le,Ye){if(_.disabled)return;const ie=Ye.currentTarget.closest(".dss-pill-field__pill");ie&&(we.value={width:ie.offsetWidth,height:ie.offsetHeight}),st.value=Le,te.value=P.value[Le]??"",await e.nextTick();const Ge=f.value;if(!Ge)return;Ge.focus();const be=Ge.value.length;Ge.setSelectionRange(be,be)}function Z(){X()}function Fe(){if(_.disabled||st.value===null)return;const Le=st.value,Ye=P.value[Le]??"",ie=te.value.trim();if(X(),ie!==Ye&&fe.value.has(ie)){R(ie);return}if(!ie){P.value=P.value.filter((be,Qe)=>Qe!==Le),B("update:modelValue",[...P.value]);return}const Ge=P.value.map((be,Qe)=>Qe===Le?ie:be);P.value=Ge,B("update:modelValue",[...P.value])}function We(Le){Le.preventDefault(),!_.disabled&&(me(de.value),de.value="")}function Se(Le){if(_.disabled)return;const Ye=Le.clipboardData?.getData("text")??"";!Ye.includes(`
|
|
120
|
+
`)&&!Ye.includes("\r")||(Le.preventDefault(),_e(Ye),de.value="")}return e.watch(()=>_.modelValue,Le=>{P.value=Array.isArray(Le)?[...Le]:[]},{deep:!0}),e.onBeforeUnmount(()=>{he&&clearTimeout(he)}),(Le,Ye)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":Le.disabled}])},[e.createElementVNode("div",kp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(ie,Ge)=>(e.openBlock(),e.createElementBlock("span",{key:ie,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":T.value===ie,"dss-pill-field__pill--editing":st.value===Ge}]),style:e.normalizeStyle(st.value===Ge&&we.value?Ce.value:void 0)},[st.value===Ge?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-pill-field__pill-edit-wrap","data-value":te.value||" "},[e.withDirectives(e.createElementVNode("input",{ref_for:!0,ref:be=>J(be,Ge),"onUpdate:modelValue":Ye[0]||(Ye[0]=be=>te.value=be),class:"dss-pill-field__pill-edit",type:"text",disabled:Le.disabled,onKeydown:[e.withKeys(Fe,["enter"]),e.withKeys(Z,["esc"])],onBlur:Fe},null,40,bp),[[e.vModelText,te.value]])],8,Cp)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",wp,e.toDisplayString(ie),1),Le.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",xp,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:be=>pt(Ge,be)},[...Ye[2]||(Ye[2]=[e.createElementVNode("svg",{class:"dss-pill-field__pill-action-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})],-1)])],8,Ep),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:be=>Je(Ge)}," × ",8,Sp)]))],64))],6))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Ye[1]||(Ye[1]=ie=>de.value=ie),class:"dss-pill-field__input",type:"text",placeholder:P.value.length?"":Le.placeholder,disabled:Le.disabled,onPaste:Se,onKeydown:e.withKeys(We,["enter"])},null,40,Vp),[[e.vModelText,de.value]])])],2))}}),Bp={class:"dss-step-bar__layout"},Mp={class:"dss-step-bar__header"},_p={class:"dss-step-bar__label"},$p={key:0,class:"dss-step-bar__counter"},Lp={class:"dss-step-bar__track-wrapper"},Tp=["aria-valuemax","aria-valuenow","aria-label"],Ap=["onMouseenter"],Dp={__name:"DSSStepBar",props:{label:{type:String,default:"Progress"},steps:{type:Number,default:5},currentStep:{type:Number,default:0},segments:{type:Array,default:()=>[]},segmentOrder:{type:String,default:"input",validator:E=>["input","desc","asc"].includes(E)},orientation:{type:String,default:"horizontal",validator:E=>["horizontal","vertical"].includes(E)},barHeight:{type:[Number,String],default:200},labelPosition:{type:String,default:"up",validator:E=>["up","down","left","right"].includes(E)},sideLabelMaxWidth:{type:[Number,String],default:null},sideLabelWrapWidth:{type:[Number,String],default:"18ch"},totalValue:{type:Number,default:null},activeColor:{type:String,default:"#34c759"},labelColor:{type:String,default:null},counterColor:{type:String,default:null},valueLabel:{type:String,default:""},counterAsPercentage:{type:Boolean,default:!1},showCounter:{type:Boolean,default:!0},inactiveColor:{type:String,default:"#e5e7eb"},remainderLabel:{type:String,default:"Unused"},remainderTooltipSummary:{type:Boolean,default:!1},options:{type:Object,default:()=>({})}},setup(E){const le=E,_={segmentMarker:{color:null,width:null,height:null,backgroundColor:"transparent",borderColor:"transparent"},maxSegment:{marker:{enabled:!1,color:null,width:null,height:null,backgroundColor:"transparent",borderColor:"transparent"}}},B=U=>U&&typeof U=="object"&&!Array.isArray(U),de=(U,ke)=>{const W=Object.assign({},U);return!B(U)||!B(ke)||Object.keys(ke).forEach(G=>{if(B(ke[G])){G in U?W[G]=de(U[G],ke[G]):Object.assign(W,{[G]:ke[G]});return}Object.assign(W,{[G]:ke[G]})}),W},P=e.computed(()=>de(_,le.options)),T=e.computed(()=>Math.max(1,Number(le.steps)||1)),he=e.computed(()=>Math.min(T.value,Math.max(0,Number(le.currentStep)||0))),st=e.computed(()=>Array.isArray(le.segments)&&le.segments.length>0),te=e.computed(()=>{if(!st.value)return[];const U=le.segments.map((ke,W)=>{const G=Number(ke?.value);return{label:ke?.label||`Step ${W+1}`,value:Number.isFinite(G)&&G>0?G:0,color:ke?.color||le.activeColor,marker:ke?.marker}});return le.segmentOrder==="desc"?[...U].sort((ke,W)=>W.value-ke.value):le.segmentOrder==="asc"?[...U].sort((ke,W)=>ke.value-W.value):U}),f=e.computed(()=>st.value?te.value.reduce((U,ke)=>U+ke.value,0):he.value),we=e.computed(()=>st.value?Number.isFinite(Number(le.totalValue))&&Number(le.totalValue)>0?Number(le.totalValue):Math.max(1,f.value):T.value),Ce=e.computed(()=>st.value&&Number.isFinite(Number(le.totalValue))&&Number(le.totalValue)>0),J=e.computed(()=>Ce.value?Math.max(0,Number(le.totalValue)-f.value):0),X=e.computed(()=>typeof le.remainderLabel=="string"&&le.remainderLabel.trim().length>0),fe=e.computed(()=>J.value>0),R=e.computed(()=>te.value.reduce((U,ke)=>Math.max(U,Number(ke.value)||0),0)),me=e.computed(()=>te.value.filter(U=>U.value>0).map(U=>`${U.label}: ${kt(U.value)}`).join(" | ")),_e=e.computed(()=>st.value?Ce.value?te.value.filter(U=>U.value>0):te.value:[]),Je=e.computed(()=>{if(!le.counterAsPercentage)return`${f.value} / ${we.value}`;const U=Number(we.value);if(!Number.isFinite(U)||U<=0)return"0%";const ke=Math.round(Number(f.value)/U*100);return`${Math.min(Math.max(ke,0),100)}%`}),pt=e.computed(()=>f.value),Z=e.computed(()=>we.value),Fe=e.reactive({visible:!1,x:0,y:0,content:""}),We=e.computed(()=>le.orientation==="vertical"),Se=e.computed(()=>{const U=le.barHeight;return U==null||U===""?"200px":typeof U=="number"?`${U}px`:String(U)}),Le=e.computed(()=>{const U=le.sideLabelMaxWidth;if(!(U==null||U===""))return typeof U=="number"?`${U}px`:String(U)}),Ye=e.computed(()=>{const U=le.sideLabelWrapWidth;return U==null||U===""?"18ch":typeof U=="number"?`${U}ch`:String(U)}),ie=e.computed(()=>({left:`${Fe.x}px`,top:`${Fe.y}px`,transform:"translate(-50%, calc(-100% - 8px))"})),Ge=U=>We.value?{flex:`${U} 0 0`,minHeight:U>0?"6px":"0",minWidth:"0"}:{flex:`${U} 0 0`,minWidth:U>0?"6px":"0"},be=U=>{const ke=U?.parentElement;if(!ke)return{x:0,y:0};const W=ke.getBoundingClientRect();return{x:W.left+W.width/2,y:W.top}},Qe=U=>{const ke=U.getBoundingClientRect();return{x:ke.left+ke.width/2,y:ke.top}},ct=U=>{if(Ce.value){const G=Math.max(0,Number(U.value)||0);return{...Ge(G),backgroundColor:U.color}}const ke=f.value,W=U.value>0?U.value:ke>0?1e-4:1;return{...Ge(W),backgroundColor:U.color}},gt=U=>Number(U?.value||0)>0&&Number(U?.value||0)===R.value,ut=U=>{const ke=B(U?.marker)?U.marker:{},W=U?.marker===!0||ke.enabled===!0,G=gt(U)&&P.value.maxSegment?.marker?.enabled===!0;if(!(W||G))return{enabled:!1};const Ie=ke.backgroundColor??(G?P.value.maxSegment?.marker?.backgroundColor:P.value.segmentMarker?.backgroundColor),Ue=ke.borderColor??(G?P.value.maxSegment?.marker?.borderColor:P.value.segmentMarker?.borderColor),Et=ke.color??(G?P.value.maxSegment?.marker?.color:P.value.segmentMarker?.color),Ke=ke.width??(G?P.value.maxSegment?.marker?.width:P.value.segmentMarker?.width),Ut=ke.height??(G?P.value.maxSegment?.marker?.height:P.value.segmentMarker?.height);return{enabled:!0,backgroundColor:Ie,borderColor:Ue,color:Et,width:Ke,height:Ut,icon:ke.icon??null,...ke}},qt=U=>{const ke=ut(U);return{backgroundColor:ke.backgroundColor??void 0,borderColor:ke.borderColor??void 0,color:ke.color??void 0}},Zt=U=>{const ke=ut(U);return{width:ke.width??void 0,height:ke.height??void 0}},kt=U=>`${U}${le.valueLabel}`,xt=e.computed(()=>({...Ge(J.value),backgroundColor:le.inactiveColor})),Yt=(U,ke)=>{if(!U||!ke?.currentTarget)return;const W=ke.currentTarget;if(le.remainderTooltipSummary){const Ne=be(W);Fe.x=Ne.x,Fe.y=Ne.y,Fe.content=me.value,Fe.visible=!!Fe.content;return}const G=Qe(W);Fe.x=G.x,Fe.y=G.y,Fe.content=`${U.label}: ${kt(U.value)}`,Fe.visible=!0},rt=U=>{if(!J.value||!U?.currentTarget)return;const ke=U.currentTarget;if(le.remainderTooltipSummary){const G=be(ke);Fe.x=G.x,Fe.y=G.y,Fe.content=me.value,Fe.visible=!!Fe.content;return}const W=Qe(ke);Fe.x=W.x,Fe.y=W.y,X.value&&(Fe.content=`${le.remainderLabel}: ${kt(J.value)}`,Fe.visible=!0)},Jt=()=>{Fe.visible=!1},yt=()=>{Fe.visible&&Jt()};e.onMounted(()=>{window.addEventListener("scroll",yt,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("scroll",yt,!0)});const ol=e.computed(()=>({"--dss-step-bar-label-color":le.labelColor??void 0,"--dss-step-bar-counter-color":le.counterColor??void 0,"--dss-step-bar-active-color":le.activeColor,"--dss-step-bar-inactive-color":le.inactiveColor,"--dss-step-bar-bar-height":We.value?Se.value:void 0,"--dss-step-bar-side-label-max-width":Le.value,"--dss-step-bar-side-label-wrap-width":Ye.value}));return(U,ke)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-step-bar",[`dss-step-bar--${E.orientation}`,`dss-step-bar--label-${E.labelPosition}`]]),style:e.normalizeStyle(ol.value)},[e.createElementVNode("div",Bp,[e.createElementVNode("div",Mp,[e.createElementVNode("span",_p,[e.renderSlot(U.$slots,"label",{label:E.label},()=>[e.createTextVNode(e.toDisplayString(E.label),1)])]),E.showCounter?(e.openBlock(),e.createElementBlock("span",$p,[e.renderSlot(U.$slots,"counter",{counterDisplay:Je.value},()=>[e.createTextVNode(e.toDisplayString(Je.value),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Lp,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":Z.value,"aria-valuenow":pt.value,"aria-label":E.label},[st.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_e.value,(W,G)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${G}-${W.label}`,class:e.normalizeClass(["dss-step-bar__segment dss-step-bar__segment--interactive",{"dss-step-bar__segment--max":gt(W),"dss-step-bar__segment--marker-enabled":ut(W).enabled}]),style:e.normalizeStyle(ct(W)),onMouseenter:Ne=>Yt(W,Ne),onMouseleave:Jt},[ut(W).enabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment-marker",style:e.normalizeStyle(qt(W)),"aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-step-bar__segment-marker-icon",style:e.normalizeStyle(Zt(W))},[e.renderSlot(U.$slots,"segment-marker-icon",{segment:W,index:G,marker:ut(W)},()=>[e.renderSlot(U.$slots,"max-segment-icon",{segment:W,index:G,marker:ut(W)},()=>[e.createTextVNode(e.toDisplayString(ut(W).icon||""),1)])])],4)],4)):e.createCommentVNode("",!0)],46,Ap))),128)),fe.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(xt.value),onMouseenter:ke[0]||(ke[0]=W=>rt(W)),onMouseleave:Jt},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(T.value,W=>(e.openBlock(),e.createElementBlock("div",{key:W,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":W<=he.value}])},null,2))),128))],8,Tp)])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Fe.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__tooltip dss-step-bar__tooltip--teleported",style:e.normalizeStyle(ie.value)},e.toDisplayString(Fe.content),5)):e.createCommentVNode("",!0)]))],6))}},Hp={key:0,class:"dss-title dss-title--separator"},Rp={__name:"DSSTitle",props:{type:{type:String,default:"main",validator:E=>["main","separator","subtitle"].includes(E)},h:{type:Number,default:null,validator:E=>E===null||Number.isInteger(E)&&E>=1&&E<=6},size:{type:[String,Number],default:null},weight:{type:[String,Number],default:null},color:{type:String,default:null},editable:{type:Boolean,default:!1},modelValue:{type:String,default:""}},emits:["update:modelValue","change"],setup(E,{expose:le,emit:_}){const B=E,de=_,P=e.ref(null),T=e.computed(()=>`dss-title--${B.type}`),he=e.computed(()=>B.h!=null?`dss-title--h${B.h}`:null),st={main:"div",subtitle:"p",separator:"span"},te=e.computed(()=>B.h!=null?`h${B.h}`:st[B.type]??"div"),f=e.computed(()=>B.editable?"plaintext-only":void 0),we=e.computed(()=>{const me={};return B.size!=null&&(me.fontSize=typeof B.size=="number"?`${B.size}px`:B.size),B.weight!=null&&(me.fontWeight=B.weight),B.color!=null&&(me.color=B.color),Object.keys(me).length?me:void 0}),Ce=e.computed(()=>B.editable?{input:X,keydown:fe,paste:R}:{}),J=()=>{const me=P.value;!B.editable||!me||document.activeElement!==me&&(me.innerText=B.modelValue??"")},X=me=>{const _e=me.target.innerText;de("update:modelValue",_e),de("change",_e)},fe=me=>{me.key==="Enter"&&me.preventDefault()},R=me=>{me.preventDefault();const _e=(me.clipboardData||window.clipboardData).getData("text/plain");document.execCommand("insertText",!1,_e)};return e.watch(()=>B.modelValue,()=>{J()}),e.watch(()=>B.editable,()=>{e.nextTick(J)}),e.onMounted(()=>{e.nextTick(J)}),le({focus:()=>P.value?.focus()}),(me,_e)=>E.type==="separator"?(e.openBlock(),e.createElementBlock("div",Hp,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(te.value),e.mergeProps({ref_key:"titleRef",ref:P,class:["dss-title__separator-label",he.value,{"dss-title--editable":E.editable}],style:we.value,contenteditable:f.value,spellcheck:E.editable?!1:void 0},e.toHandlers(Ce.value)),{default:e.withCtx(()=>[E.editable?e.createCommentVNode("",!0):e.renderSlot(me.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(E.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(te.value),e.mergeProps({key:1,ref_key:"titleRef",ref:P,class:["dss-title",[T.value,he.value,{"dss-title--editable":E.editable}]],style:we.value,contenteditable:f.value,spellcheck:E.editable?!1:void 0},e.toHandlers(Ce.value)),{default:e.withCtx(()=>[E.editable?e.createCommentVNode("",!0):e.renderSlot(me.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(E.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))}},Fp={contextMenu:{addMarker:"Add Marker",clearAllMarkers:"Clear All Markers",downloadSvg:"Download SVG",downloadPng:"Download PNG",downloadCsv:"Download CSV"},modalMarker:{editMarker:"Edit Marker",viewMarker:"View Marker",title:"Title",description:"Description",iconType:"Icon Type",defaultIcon:"Default Logo",iconPreview:"Icon Preview",deleteMarker:"Delete Marker",cancel:"Cancel",close:"Close",save:"Save",placeholderTitle:"Enter marker title",placeholderDescription:"Enter marker description (required)"},zoom:{doubleClickToReset:"(Double-click to reset)"},csv:{chartTitle:"Chart Title",chartSubtitle:"Chart Subtitle",generated:"Generated"},fallback:{item:"Item",axis:"Axis"},tooltip:{flags:"Flags",markers:"Markers",manualFlags:"Manual Flags",autoFlags:"Auto Flags"}},Ip={firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",currentPageAriaLabel:"Current page",rowsPerPage:"Rows per page",searchPlaceholder:"Search...",searchAriaLabel:"Search",searchTableAriaLabel:"Search table",clearSearchAriaLabel:"Clear search",downloadPdf:"Download PDF",downloadExcel:"Download Excel",columnVisibility:"Columns Visibility",expandRowAriaLabel:"Expand row",collapseRowAriaLabel:"Collapse row",filterColumnAriaLabel:"Filter column",clearFilter:"Clear",search:"Search...",filterFrom:"From:",filterTo:"To:",dateFormat:"dd/mm/yyyy",showingRange:"Showing {start}-{end} from {total}",ofPages:"of {total}",emptyMessage:"No data available"},zp={searchAcrossFields:"Search across all fields...",openAdvancedFilter:"Open advanced filter",closeAdvancedFilter:"Close advanced filter",noConditionsApplied:"No filter conditions are applied to this view",where:"Where",and:"And",searchAttributes:"Search attributes...",noMatch:"No match",enterValue:"Enter value...",min:"Min",max:"Max",search:"Search...",addFilter:"Add filter",clearAllFilters:"Clear all filters",select:"Select...",selectedCount:"{count} selected",operators:{contains:"contains",not_contains:"does not contain",equals:"equals",not_equals:"does not equal",starts_with:"starts with",ends_with:"ends with",is_empty:"is empty",is_not_empty:"is not empty",is_any_of:"is any of",is_none_of:"is none of",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"between",contains_any:"contains any of",contains_all:"contains all of",not_contains_any:"does not contain",before:"before",after:"after",is_true:"is true",is_false:"is false"}},Pp={selectDate:"Select Date",selectRange:"Select range",selectFromList:"Select a date",noAvailableDates:"No dates available",startDate:"Start date",endDate:"End date",prevMonth:"Previous month",nextMonth:"Next month",quickSelect:{today:"Today",lastWeek:"Last week",last15Days:"Last 15 days",last30Days:"Last 30 days",thisMonth:"This month",last3Months:"Last 3 months",last6Months:"Last 6 months",last12Months:"Last 12 months",lastYear:"Last year",allDates:"All dates",last2Dates:"Last 2 dates",last3Dates:"Last 3 dates",last4Dates:"Last 4 dates",last5Dates:"Last 5 dates"}},Op={toolbar:{undo:"Undo",redo:"Redo",paragraphFormat:"Paragraph Format",bold:"Bold",italic:"Italic",underline:"Underline",citation:"Citation",insertLink:"Insert Link",removeLink:"Remove Link",bulletList:"Bullet List",numberList:"Number List",image:"Image",comment:"Comment",askAi:"Ask AI"},paragraph:{heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",heading4:"Heading 4",heading5:"Heading 5",heading6:"Heading 6",paragraph:"Paragraph"},link:{editLink:"Edit Link",altText:"Alt text:",url:"URL:",enterAltText:"Enter alt text...",enterUrl:"Enter URL...",cancel:"Cancel",save:"Save"},image:{addImage:"Add Image",editImage:"Edit Image",upload:"Upload",imageLink:"Image Link",uploadImage:"Upload image:",imageUrl:"Image URL:",altText:"Alt text:",width:"Width (px):",height:"Height (px):",enterAltText:"Enter alt text...",enterImageUrl:"https://example.com/image.jpg",auto:"Auto",noAlt:"No alt",cancel:"Cancel",save:"Save"},comment:{placeholder:"Add a comment",send:"Send",delete:"Delete comment"},started_conversation:"Started conversation",labels:{title:"Title",description:"Description"},placeholders:{title:"Enter title...",description:"Enter description...",startTyping:"Start typing..."},footer:{word:"word",words:"words",character:"character",characters:"characters"}},ro={chart:Fp,table:Ip,filter:zp,datepicker:Pp,textEditor:Op},Wp={contextMenu:{addMarker:"Ajouter un marqueur",clearAllMarkers:"Effacer tous les marqueurs",downloadSvg:"Télécharger SVG",downloadPng:"Télécharger PNG",downloadCsv:"Télécharger CSV"},modalMarker:{editMarker:"Modifier le marqueur",viewMarker:"Voir le marqueur",title:"Titre",description:"Description",iconType:"Type d'icône",defaultIcon:"Logo par défaut",iconPreview:"Aperçu de l'icône",deleteMarker:"Supprimer le marqueur",cancel:"Annuler",close:"Fermer",save:"Enregistrer",placeholderTitle:"Entrez le titre du marqueur",placeholderDescription:"Entrez la description du marqueur (requise)"},zoom:{doubleClickToReset:"(Double-cliquez pour réinitialiser)"},csv:{chartTitle:"Titre du graphique",chartSubtitle:"Sous-titre du graphique",generated:"Généré"},fallback:{item:"Élément",axis:"Axe"},tooltip:{flags:"Drapeaux",markers:"Marqueurs",manualFlags:"Drapeaux manuels",autoFlags:"Drapeaux automatiques"}},qp={firstPage:"Première page",previousPage:"Page précédente",nextPage:"Page suivante",lastPage:"Dernière page",currentPageAriaLabel:"Page actuelle",rowsPerPage:"Lignes par page",searchPlaceholder:"Rechercher...",searchAriaLabel:"Rechercher",searchTableAriaLabel:"Rechercher dans le tableau",clearSearchAriaLabel:"Effacer la recherche",downloadPdf:"Télécharger PDF",downloadExcel:"Télécharger Excel",columnVisibility:"Visibilité des colonnes",expandRowAriaLabel:"Développer la ligne",collapseRowAriaLabel:"Réduire la ligne",filterColumnAriaLabel:"Filtrer la colonne",clearFilter:"Effacer",search:"Rechercher...",filterFrom:"Du :",filterTo:"Au :",dateFormat:"jj/mm/aaaa",showingRange:"Affichage de {start}-{end} sur {total}",ofPages:"sur {total}",emptyMessage:"Aucune donnée disponible"},Zp={searchAcrossFields:"Rechercher dans tous les champs...",openAdvancedFilter:"Ouvrir le filtre avancé",closeAdvancedFilter:"Fermer le filtre avancé",noConditionsApplied:"Aucune condition de filtre n'est appliquée à cette vue",where:"Où",and:"Et",searchAttributes:"Rechercher des attributs...",noMatch:"Aucun résultat",enterValue:"Saisir une valeur...",min:"Min",max:"Max",search:"Rechercher...",addFilter:"Ajouter un filtre",clearAllFilters:"Effacer tous les filtres",select:"Sélectionner...",selectedCount:"{count} sélectionnés",operators:{contains:"contient",not_contains:"ne contient pas",equals:"est égal à",not_equals:"est différent de",starts_with:"commence par",ends_with:"se termine par",is_empty:"est vide",is_not_empty:"n'est pas vide",is_any_of:"est l'un de",is_none_of:"n'est aucun de",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"entre",contains_any:"contient l'un de",contains_all:"contient tous",not_contains_any:"ne contient pas",before:"avant",after:"après",is_true:"est vrai",is_false:"est faux"}},Up={selectDate:"Sélectionner une date",selectRange:"Sélectionner une plage",selectFromList:"Sélectionner une date",noAvailableDates:"Aucune date disponible",startDate:"Date de début",endDate:"Date de fin",prevMonth:"Mois précédent",nextMonth:"Mois suivant",quickSelect:{today:"Aujourd'hui",lastWeek:"Dernière semaine",last15Days:"15 derniers jours",last30Days:"30 derniers jours",thisMonth:"Ce mois",last3Months:"3 derniers mois",last6Months:"6 derniers mois",last12Months:"12 derniers mois",lastYear:"Dernière année",allDates:"Toutes les dates",last2Dates:"2 dernières dates",last3Dates:"3 dernières dates",last4Dates:"4 dernières dates",last5Dates:"5 dernières dates"}},Xp={toolbar:{undo:"Annuler",redo:"Rétablir",paragraphFormat:"Format de paragraphe",bold:"Gras",italic:"Italique",underline:"Souligné",citation:"Citation",insertLink:"Insérer un lien",removeLink:"Supprimer le lien",bulletList:"Liste à puces",numberList:"Liste numérotée",image:"Image",comment:"Commentaire",askAi:"Demander à l'IA"},paragraph:{heading1:"En-tête 1",heading2:"En-tête 2",heading3:"En-tête 3",heading4:"En-tête 4",heading5:"En-tête 5",heading6:"En-tête 6",paragraph:"Paragraphe"},link:{editLink:"Modifier le lien",altText:"Texte alternatif :",url:"URL :",enterAltText:"Entrez le texte alternatif...",enterUrl:"Entrez l'URL...",cancel:"Annuler",save:"Enregistrer"},image:{addImage:"Ajouter une image",editImage:"Modifier l'image",upload:"Télécharger",imageLink:"Lien de l'image",uploadImage:"Télécharger l'image :",imageUrl:"URL de l'image :",altText:"Texte alternatif :",width:"Largeur (px) :",height:"Hauteur (px) :",enterAltText:"Entrez le texte alternatif...",enterImageUrl:"https://exemple.com/image.jpg",auto:"Auto",noAlt:"Pas de texte alternatif",cancel:"Annuler",save:"Enregistrer"},comment:{placeholder:"Ajouter un commentaire",send:"Envoyer",delete:"Supprimer le commentaire"},started_conversation:"A démarré la conversation",labels:{title:"Titre",description:"Description"},placeholders:{title:"Entrez le titre...",description:"Entrez la description...",startTyping:"Commencez à taper..."},footer:{word:"mot",words:"mots",character:"caractère",characters:"caractères"}},io={chart:Wp,table:qp,filter:Zp,datepicker:Up,textEditor:Xp},Yp={contextMenu:{addMarker:"Markering toevoegen",clearAllMarkers:"Alle markeringen wissen",downloadSvg:"SVG downloaden",downloadPng:"PNG downloaden",downloadCsv:"CSV downloaden"},modalMarker:{editMarker:"Markering bewerken",viewMarker:"Markering bekijken",title:"Titel",description:"Beschrijving",iconType:"Pictogramtype",defaultIcon:"Standaard logo",iconPreview:"Pictogramvoorbeeld",deleteMarker:"Markering verwijderen",cancel:"Annuleren",close:"Sluiten",save:"Opslaan",placeholderTitle:"Voer markeringstitel in",placeholderDescription:"Voer markeringsbeschrijving in (optioneel)"},zoom:{doubleClickToReset:"(Dubbelklik om te resetten)"},csv:{chartTitle:"Grafiek titel",chartSubtitle:"Grafiek ondertitel",generated:"Gegenereerd"},fallback:{item:"Item",axis:"As"},tooltip:{flags:"Vlaggen",markers:"Markeringen",manualFlags:"Handmatige vlaggen",autoFlags:"Automatische vlaggen"}},jp={firstPage:"Eerste pagina",previousPage:"Vorige pagina",nextPage:"Volgende pagina",lastPage:"Laatste pagina",currentPageAriaLabel:"Huidige pagina",rowsPerPage:"Rijen per pagina",searchPlaceholder:"Zoeken...",searchAriaLabel:"Zoeken",searchTableAriaLabel:"Zoeken in tabel",clearSearchAriaLabel:"Zoekopdracht wissen",downloadPdf:"PDF downloaden",downloadExcel:"Excel downloaden",columnVisibility:"Kolommen weer te geven",expandRowAriaLabel:"Rij uitklappen",collapseRowAriaLabel:"Rij inklappen",filterColumnAriaLabel:"Kolom filteren",clearFilter:"Wissen",search:"Zoeken...",filterFrom:"Van:",filterTo:"Tot:",dateFormat:"dd-mm-jjjj",showingRange:"{start}-{end} van {total} weergegeven",ofPages:"van {total}",emptyMessage:"Geen gegevens beschikbaar"},Kp={searchAcrossFields:"Zoeken in alle velden...",openAdvancedFilter:"Geavanceerde filter openen",closeAdvancedFilter:"Geavanceerde filter sluiten",noConditionsApplied:"Er zijn geen filtervoorwaarden toegepast op deze weergave",where:"Waar",and:"En",searchAttributes:"Zoek attributen...",noMatch:"Geen overeenkomst",enterValue:"Voer waarde in...",min:"Min",max:"Max",search:"Zoeken...",addFilter:"Filter toevoegen",clearAllFilters:"Alle filters wissen",select:"Selecteren...",selectedCount:"{count} geselecteerd",operators:{contains:"bevat",not_contains:"bevat niet",equals:"is gelijk aan",not_equals:"is niet gelijk aan",starts_with:"begint met",ends_with:"eindigt op",is_empty:"is leeg",is_not_empty:"is niet leeg",is_any_of:"is een van",is_none_of:"is geen van",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"tussen",contains_any:"bevat een van",contains_all:"bevat alle",not_contains_any:"bevat niet",before:"voor",after:"na",is_true:"is waar",is_false:"is onwaar"}},Gp={selectDate:"Selecteer datum",selectRange:"Selecteer bereik",selectFromList:"Selecteer een datum",noAvailableDates:"Geen datums beschikbaar",startDate:"Startdatum",endDate:"Einddatum",prevMonth:"Vorige maand",nextMonth:"Volgende maand",quickSelect:{today:"Vandaag",lastWeek:"Afgelopen week",last15Days:"Laatste 15 dagen",last30Days:"Laatste 30 dagen",thisMonth:"Deze maand",last3Months:"Laatste 3 maanden",last6Months:"Laatste 6 maanden",last12Months:"Laatste 12 maanden",lastYear:"Afgelopen jaar",allDates:"Alle datums",last2Dates:"Laatste 2 datums",last3Dates:"Laatste 3 datums",last4Dates:"Laatste 4 datums",last5Dates:"Laatste 5 datums"}},Qp={toolbar:{undo:"Ongedaan maken",redo:"Opnieuw",paragraphFormat:"Alineaopmaak",bold:"Vet",italic:"Cursief",underline:"Onderstreept",citation:"Citaat",insertLink:"Link invoegen",removeLink:"Link verwijderen",bulletList:"Lijst met opsommingstekens",numberList:"Genummerde lijst",image:"Afbeelding",comment:"Commentaar",askAi:"Vraag AI"},paragraph:{heading1:"Kop 1",heading2:"Kop 2",heading3:"Kop 3",heading4:"Kop 4",heading5:"Kop 5",heading6:"Kop 6",paragraph:"Alinea"},link:{editLink:"Link bewerken",altText:"Alt-tekst:",url:"URL:",enterAltText:"Voer alt-tekst in...",enterUrl:"Voer URL in...",cancel:"Annuleren",save:"Opslaan"},image:{addImage:"Afbeelding toevoegen",editImage:"Afbeelding bewerken",upload:"Uploaden",imageLink:"Afbeeldingslink",uploadImage:"Afbeelding uploaden:",imageUrl:"Afbeeldings-URL:",altText:"Alt-tekst:",width:"Breedte (px):",height:"Hoogte (px):",enterAltText:"Voer alt-tekst in...",enterImageUrl:"https://voorbeeld.com/afbeelding.jpg",auto:"Auto",noAlt:"Geen alt-tekst",cancel:"Annuleren",save:"Opslaan"},comment:{placeholder:"Voeg een opmerking toe",send:"Verzenden",delete:"Opmerking verwijderen"},started_conversation:"Gesprek gestart",labels:{title:"Titel",description:"Beschrijving"},placeholders:{title:"Voer titel in...",description:"Voer beschrijving in...",startTyping:"Begin met typen..."},footer:{word:"woord",words:"woorden",character:"teken",characters:"tekens"}},co={chart:Yp,table:jp,filter:Kp,datepicker:Gp,textEditor:Qp},Oo={en:ro,fr:io,nl:co};function Va(E){if(!E||!E.global)return;const le=E.global.availableLocales||[];Object.keys(Oo).forEach(_=>{le.includes(_)&&E.global.mergeLocaleMessage(_,Oo[_])})}const Wo={en:{textEditor:ro.textEditor},fr:{textEditor:io.textEditor},nl:{textEditor:co.textEditor}};function Na(E){if(!E||!E.global)return;const le=E.global.availableLocales||[];Object.keys(Wo).forEach(_=>{le.includes(_)&&E.global.mergeLocaleMessage(_,Wo[_])})}const qo={en:{table:ro.table},fr:{table:io.table},nl:{table:co.table}};function Ba(E){if(!E||!E.global)return;const le=E.global.availableLocales||[];Object.keys(qo).forEach(_=>{le.includes(_)&&E.global.mergeLocaleMessage(_,qo[_])})}const Zo={en:{datepicker:ro.datepicker},fr:{datepicker:io.datepicker},nl:{datepicker:co.datepicker}};function Ma(E){if(!E||!E.global)return;const le=E.global.availableLocales||[];Object.keys(Zo).forEach(_=>{le.includes(_)&&E.global.mergeLocaleMessage(_,Zo[_])})}const Uo={en:{filter:ro.filter},fr:{filter:io.filter},nl:{filter:co.filter}};function _a(E){if(!E||!E.global)return;const le=E.global.availableLocales||[];Object.keys(Uo).forEach(_=>{le.includes(_)&&E.global.mergeLocaleMessage(_,Uo[_])})}const Jp={chart:Oo,textEditor:Wo,table:qo,datepicker:Zo,filter:Uo};function e9(E){!E||!E.global||(Va(E),Na(E),Ba(E),Ma(E),_a(E))}const t9={en:{...ro},fr:{...io},nl:{...co}};so.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:t9});exports.DSSChart=jc;exports.DSSChartMessages=Oo;exports.DSSColorPicker=R2;exports.DSSConfetti=d0;exports.DSSDatepicker=ca;exports.DSSDatepickerMessages=Zo;exports.DSSDnd=c0;exports.DSSFilter=yp;exports.DSSFilterMessages=Uo;exports.DSSLoader=K2;exports.DSSMessages=Jp;exports.DSSModal=ia;exports.DSSPillField=Np;exports.DSSSkeleton=G2;exports.DSSStepBar=Dp;exports.DSSTable=gd;exports.DSSTableMessages=qo;exports.DSSTextEditor=b2;exports.DSSTextEditorMessages=Wo;exports.DSSTitle=Rp;exports.addDSSChartTranslations=Va;exports.addDSSDatepickerTranslations=Ma;exports.addDSSFilterTranslations=_a;exports.addDSSTableTranslations=Ba;exports.addDSSTextEditorTranslations=Na;exports.addDSSTranslations=e9;
|