dsp-semactic 0.7.9 → 0.7.10

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/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),fo=require("vue-i18n"),xs={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},Es=["value"],Ss=["placeholder","value","disabled"],Vs=["placeholder","value"],Ns=["placeholder","value"],Bs=["aria-selected","onClick"],Ms={class:"dss-datepicker__list-item-label"},_s={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"},$s={key:1,class:"dss-datepicker__list-empty"},Ls={key:1,class:"dss-datepicker__double-wrap"},Ts={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},As=["disabled","onClick"],Ds={class:"dss-datepicker__double-calendars"},Hs={class:"dss-datepicker__double-calendar"},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__double-calendar"},Us={class:"dss-datepicker__calendar-header"},Xs=["aria-label"],Ys={class:"dss-datepicker__month-year-row"},js=["aria-label"],Ks={class:"dss-datepicker__weekdays"},Gs={class:"dss-datepicker__grid"},Qs=["disabled","onClick","onMouseenter"],Js={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},er={class:"dss-datepicker__calendar-header"},tr=["aria-label"],lr={class:"dss-datepicker__month-year-row"},nr=["aria-label"],or={class:"dss-datepicker__weekdays"},ar={class:"dss-datepicker__grid"},sr=["disabled","onClick","onMouseenter"],rr={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},ir={class:"dss-datepicker__calendar-header"},cr={class:"dss-datepicker__month-year-row"},ur={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},dr={class:"dss-datepicker__months-grid"},mr=["onClick"],pr={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},vr={class:"dss-datepicker__month-year"},fr={class:"dss-datepicker__years-grid"},hr=["data-year","onClick"],Da=27,qn=8,ga={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:S=>["single","range","singleFromAvailable","rangeFromAvailable","listFromAvailable","readonly"].includes(S)},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(S,{emit:ee}){const $=S,N=ee,{t:de,locale:P}=fo.useI18n(),T=e.ref(!1),me=e.ref("days"),ut=new Date,te=e.computed(()=>$.minDate instanceof Date?$.minDate:ut),f=e.ref(te.value.getMonth()),be=e.ref(te.value.getFullYear()),ye=e.ref(te.value.getMonth()),J=e.ref(te.value.getFullYear()),j=e.ref(te.value.getMonth()),ge=e.ref(te.value.getFullYear()),_e=e.ref("start"),ue=e.ref(null),Se=e.ref(null);function U(){const A=te.value,I=A.getMonth(),L=A.getFullYear(),K=I===11?0:I+1,He=I===11?L+1:L;return{left:{month:I,year:L},right:{month:K,year:He}}}const yt=e.ref(null),st=e.ref(null),De=e.ref(null),Ue=e.ref(null),Z=e.ref(null),Te=e.ref(null),qe=e.ref(null),ke=e.ref(null),Be=new Date().getFullYear(),Je=e.computed(()=>["single","singleFromAvailable"].includes($.mode)),Ge=e.computed(()=>["range","rangeFromAvailable"].includes($.mode)),rt=e.computed(()=>$.mode==="listFromAvailable"),Yt=e.computed(()=>{if(!["single","singleFromAvailable","listFromAvailable"].includes($.mode))return null;const A=$.modelValue;return A instanceof Date?A:null}),we=e.computed(()=>{if(!Ge.value)return{start:null,end:null};const A=$.modelValue;return!A||typeof A!="object"?{start:null,end:null}:{start:A.start instanceof Date?A.start:null,end:A.end instanceof Date?A.end:null}});function qt(A){if(!A||!(A instanceof Date))return"";const I=A.getDate(),L=A.getMonth()+1,K=A.getFullYear(),He=vt=>String(vt).padStart(2,"0");return`${He(I)}/${He(L)}/${K}`}const dt=e.computed(()=>qt(Yt.value)),et=e.computed(()=>{const{start:A,end:I}=we.value;if(!A&&!I)return"";const L=!I||A&&A<=I?A:I,K=!A||I&&I>=A?I:A;return Ut(L,K)?qt(L):`${qt(L)} - ${qt(K)}`}),Et=e.computed(()=>{if($.mode!=="readonly")return"—";const A=$.modelValue;if(A instanceof Date)return qt(A)||"—";if(A&&typeof A=="object"&&("start"in A||"end"in A)){const I=A.start instanceof Date?A.start:null,L=A.end instanceof Date?A.end:null;if(!I&&!L)return"—";const K=!L||I&&I<=L?I:L,He=!I||L&&L>=I?L:I;return Ut(K,He)?qt(K):`${qt(K)} - ${qt(He)}`}return"—"});e.computed(()=>{const A=new Date(be.value,f.value,1);return new Intl.DateTimeFormat(P.value,{month:"long",year:"numeric"}).format(A)});const tl=e.computed(()=>Se.value==="left"?ye.value:Se.value==="right"?j.value:f.value),ft=e.computed(()=>Se.value==="left"?J.value:Se.value==="right"?ge.value:be.value),Zt=e.computed(()=>{const A=new Date(be.value,f.value,1);return new Intl.DateTimeFormat(P.value,{month:"long"}).format(A)}),ht=e.computed(()=>{const A=new Date(ft.value,tl.value,1);return new Intl.DateTimeFormat(P.value,{month:"long"}).format(A)}),Jt=e.computed(()=>{const A=new Intl.DateTimeFormat(P.value,{month:"short"});return Array.from({length:12},(I,L)=>A.format(new Date(2024,L,1)))}),wt=e.computed(()=>{const I=(Se.value?ft.value:be.value)-Math.floor(Da/2);return Array.from({length:Da},(L,K)=>I+K)}),jt=e.computed(()=>{const A=wt.value;return A.length?`${A[0]} – ${A[A.length-1]}`:""});function fe(A){return A===7?0:A}function H(A){try{const I=new Intl.Locale(A);if(I.weekInfo?.firstDay!=null)return fe(I.weekInfo.firstDay)}catch{}return 1}function Y(A){const I=new Date(2024,0,1),L=(I.getDay()-A+7)%7,K=new Date(I);return K.setDate(I.getDate()-L),K}const ne=e.computed(()=>H(P.value)),he=e.computed(()=>{const A=new Intl.DateTimeFormat(P.value,{weekday:"short"}),I=Y(ne.value),L=[];for(let K=0;K<7;K++){const He=new Date(I);He.setDate(I.getDate()+K),L.push(A.format(He).slice(0,2))}return L});function Xe(A,I,L){const K=new Date(A,I,1),He=new Date(A,I+1,0),vt=(K.getDay()-L+7)%7,mt=He.getDate(),it=[];for(let ot=0;ot<vt;ot++)it.push(null);for(let ot=1;ot<=mt;ot++)it.push(new Date(A,I,ot));return it}const Ke=e.computed(()=>Xe(be.value,f.value,ne.value)),Lt=e.computed(()=>Xe(J.value,ye.value,ne.value)),$e=e.computed(()=>Xe(ge.value,j.value,ne.value));e.computed(()=>{const A=new Date(J.value,ye.value,1);return new Intl.DateTimeFormat(P.value,{month:"long",year:"numeric"}).format(A)}),e.computed(()=>{const A=new Date(ge.value,j.value,1);return new Intl.DateTimeFormat(P.value,{month:"long",year:"numeric"}).format(A)});const Qe=e.computed(()=>{const A=new Date(J.value,ye.value,1);return new Intl.DateTimeFormat(P.value,{month:"long"}).format(A)}),Ct=e.computed(()=>{const A=new Date(ge.value,j.value,1);return new Intl.DateTimeFormat(P.value,{month:"long"}).format(A)}),el=e.computed(()=>$.availableDates&&$.availableDates.length>0),ie=e.computed(()=>el.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"}]),X=e.ref({top:0,left:0}),Q=e.ref("left");let ae=null;function Ee(){T.value&&e.nextTick(()=>{T.value&&(ae!==null&&window.cancelAnimationFrame(ae),ae=window.requestAnimationFrame(()=>{ae=null,je()}))})}function je(){if(!Z.value||!T.value)return;const A=Z.value.getBoundingClientRect(),I=window.innerWidth||document.documentElement.clientWidth,L=window.innerHeight||document.documentElement.clientHeight;let K=A.left,He=A.bottom+4;const vt=Te.value;if(vt){const mt=vt.offsetWidth,it=vt.offsetHeight;Q.value==="right"||K+mt>I-qn?(Q.value="right",K=A.right-mt):Q.value="left";const yl=Math.max(qn,I-mt-qn);if(K=Math.min(Math.max(K,qn),yl),He+it>L-qn){const xl=A.top-4-it;xl>=qn?He=xl:He=Math.max(qn,L-it-qn)}}X.value={top:He,left:K}}const bt=e.computed(()=>!Z.value||!T.value?{}:{position:"fixed",left:`${X.value.left}px`,top:`${X.value.top}px`,zIndex:1002});function Ut(A,I){return!A||!I?!1:A.getFullYear()===I.getFullYear()&&A.getMonth()===I.getMonth()&&A.getDate()===I.getDate()}function lt(A){return new Date(A.getFullYear(),A.getMonth(),A.getDate()).getTime()}function sl(A){return!$.availableDates||!$.availableDates.length?!0:$.availableDates.some(I=>I instanceof Date&&Ut(I,A))}function M(A){const I=lt(A);return!($.minDate instanceof Date&&I<lt($.minDate)||$.maxDate instanceof Date&&I>lt($.maxDate))}function w(A){const I=new Date(A);return new Date(I.getFullYear(),I.getMonth(),I.getDate())}function E(A){return A.filter(I=>M(I))}function se(A,I){if(!(A instanceof Date)||!(I instanceof Date))return null;let L=lt(A),K=lt(I);if(L>K&&([L,K]=[K,L]),$.minDate instanceof Date){const He=lt($.minDate);L=Math.max(L,He),K=Math.max(K,He)}if($.maxDate instanceof Date){const He=lt($.maxDate);L=Math.min(L,He),K=Math.min(K,He)}return L>K?null:{start:w(L),end:w(K)}}function re(A){return!$.exceptDates||!$.exceptDates.length?!1:$.exceptDates.some(I=>I instanceof Date&&Ut(I,A))}function Re(A){return re(A)?!1:["singleFromAvailable","rangeFromAvailable"].includes($.mode)?sl(A):M(A)}function kt(A){const I=Yt.value,L=we.value,K=lt(A),He=Ge.value&&L.start&&L.end&&K>lt(L.start)&&K<lt(L.end),vt=Ge.value&&L.start&&Ut(A,L.start),mt=Ge.value&&L.end&&Ut(A,L.end),it=vt&&mt,ot=Je.value&&I&&Ut(A,I)||vt||mt;let yl=!1;if(Ge.value&&L.start&&!L.end&&ue.value){const xl=lt(L.start),Kt=lt(ue.value),Dt=Math.min(xl,Kt),Gt=Math.max(xl,Kt);yl=K>Dt&&K<Gt}return{"dss-datepicker__day--selected":ot&&!it,"dss-datepicker__day--range-start":vt&&!it,"dss-datepicker__day--range-end":mt&&!it,"dss-datepicker__day--range-single":it,"dss-datepicker__day--in-range":He&&!vt&&!mt,"dss-datepicker__day--in-range-preview":yl&&!vt&&!mt&&!He,"dss-datepicker__day--disabled":!Re(A)}}function nt(A){if(!Ge.value)return;const I=we.value;if(!I.start||I.end){ue.value=null;return}if(!Re(A)){ue.value=null;return}ue.value=new Date(A.getFullYear(),A.getMonth(),A.getDate())}function We(){ue.value=null}function xt(){if(!$.doubleCalendar||!Ge.value)return;const A=we.value,{start:I,end:L}=A;if(I&&L){const vt=I<=L?I:L,mt=I<=L?L:I,it=vt.getMonth(),ot=vt.getFullYear(),yl=mt.getMonth(),xl=mt.getFullYear();if(it!==yl||ot!==xl){const Kt=ye.value===it&&J.value===ot,Dt=j.value===yl&&ge.value===xl;if(Kt&&Dt)return;ye.value=it,J.value=ot,j.value=yl,ge.value=xl}else{const Kt=it===0?11:it-1,Dt=it===0?ot-1:ot;ye.value===Kt&&J.value===Dt&&j.value===it&&ge.value===ot||(ye.value=it,J.value=ot,it===11?(j.value=0,ge.value=ot+1):(j.value=it+1,ge.value=ot))}return}const K=I||L;if(K){const vt=K.getMonth(),mt=K.getFullYear(),it=ye.value===vt&&J.value===mt,ot=j.value===vt&&ge.value===mt;if(it||ot)return;ye.value=vt,J.value=mt,vt===11?(j.value=0,ge.value=mt+1):(j.value=vt+1,ge.value=mt);return}const He=U();ye.value=He.left.month,J.value=He.left.year,j.value=He.right.month,ge.value=He.right.year}const Bt=e.computed(()=>new Intl.DateTimeFormat(P.value,{day:"2-digit",month:"long",year:"numeric"})),pt=e.computed(()=>{if(!rt.value)return[];const A=($.availableDates||[]).filter(L=>L instanceof Date&&!Number.isNaN(L.getTime())).filter(L=>!re(L)&&M(L)).map(L=>new Date(L.getFullYear(),L.getMonth(),L.getDate()));A.sort((L,K)=>K.getTime()-L.getTime());const I=Yt.value;return A.map(L=>({date:L,ts:L.getTime(),label:Bt.value.format(L),selected:!!(I&&Ut(L,I))}))});function _t(){if(T.value){gl();return}Z.value=Ue.value?.closest(".dss-datepicker__input-wrap"),Q.value="left",T.value=!0,Ee(),e.nextTick(()=>{ke.value?.querySelector(".dss-datepicker__list-item--selected")?.scrollIntoView({block:"nearest",behavior:"auto"})})}function Tt(A){if(!(A instanceof Date))return;const I=new Date(A.getFullYear(),A.getMonth(),A.getDate());N("update:modelValue",I),gl()}function St(A="start"){if($.mode==="readonly")return;_e.value=A;const I=Yt.value,L=we.value;if(Je.value&&I)f.value=I.getMonth(),be.value=I.getFullYear();else if(Ge.value)if($.doubleCalendar)xt();else{const K=A==="start"&&L.start?L.start:L.end||L.start;K&&(f.value=K.getMonth(),be.value=K.getFullYear())}Z.value=Je.value?yt.value?.closest(".dss-datepicker__input-wrap"):st.value,me.value="days",Se.value=null,Q.value="left",T.value=!0,Ee()}function gl(){me.value="days",Se.value=null,ue.value=null,T.value=!1}function Jl(A,I){Se.value=A,me.value=I}function Il(){me.value="days",Se.value=null}function ml(A){const I=new Date,L=I.getFullYear(),K=I.getMonth(),He=I.getDate();let vt,mt;if(el.value){const it=E([...$.availableDates].filter(ot=>ot instanceof Date).map(ot=>new Date(ot.getFullYear(),ot.getMonth(),ot.getDate()))).sort((ot,yl)=>ot.getTime()-yl.getTime());if(it.length===0)return null;if(A==="all")vt=it[0],mt=it[it.length-1];else{const ot=parseInt(A.replace("last",""),10);if(ot<2||ot>5)return null;const yl=it.slice(-ot);if(yl.length===0)return null;vt=yl[0],mt=yl[yl.length-1]}}else{const it=new Date(L,K,He);switch(A){case"today":vt=it,mt=it;break;case"lastWeek":vt=new Date(L,K,He-6),mt=it;break;case"last15Days":vt=new Date(L,K,He-14),mt=it;break;case"last30Days":vt=new Date(L,K,He-29),mt=it;break;case"thisMonth":vt=new Date(L,K,1),mt=it;break;case"last3Months":vt=new Date(L,K-3,1),mt=new Date(L,K,0);break;case"last6Months":vt=new Date(L,K-6,1),mt=new Date(L,K,0);break;case"last12Months":vt=new Date(L,K-12,1),mt=new Date(L,K,0);break;case"lastYear":vt=new Date(L-1,0,1),mt=new Date(L-1,11,31);break;default:return null}}return{start:vt,end:mt}}function pl(A){const I=ml(A);return I?se(I.start,I.end):null}function an(A){return pl(A)!==null}function Wl(A){const I=pl(A);I&&(N("update:modelValue",I),xt())}function wl(A){Se.value==="left"?ye.value=A:Se.value==="right"?j.value=A:f.value=A,Il()}function Al(A){Se.value==="left"?J.value=A:Se.value==="right"?ge.value=A:be.value=A,Il()}function dn(){f.value===0?(f.value=11,be.value--):f.value--}function Dl(){f.value===11?(f.value=0,be.value++):f.value++}function Zn(){ye.value===0?(ye.value=11,J.value--):ye.value--}function ql(){ye.value===11?(ye.value=0,J.value++):ye.value++}function mn(){j.value===0?(j.value=11,ge.value--):j.value--}function wn(){j.value===11?(j.value=0,ge.value++):j.value++}function Zl(A){if(!Re(A))return;const I=new Date(A.getFullYear(),A.getMonth(),A.getDate());if(Je.value){N("update:modelValue",I),gl();return}const L=we.value;if(!L.start&&!L.end){N("update:modelValue",{start:I,end:null}),_e.value="end";return}if(L.start&&L.end){N("update:modelValue",{start:I,end:null}),_e.value="end";return}if(_e.value==="start"){let K=I,He=L.end;K&&He&&K>He&&([K,He]=[He,K]),N("update:modelValue",{start:K||He,end:He||K}),_e.value="end"}else{let K=L.start,He=I;K&&He&&He<K&&([K,He]=[He,K]),N("update:modelValue",{start:K||He,end:He||K}),_e.value="start"}}e.watch(we,()=>{$.doubleCalendar&&Ge.value&&T.value&&xt()},{deep:!0});let en=null,Ul=null,bl=null;function pn(){en&&(document.removeEventListener("keydown",en),en=null),Ul&&(window.removeEventListener("resize",Ul),Ul=null),bl&&(window.removeEventListener("scroll",bl,!0),bl=null)}return e.watch(me,A=>{A==="years"&&e.nextTick(()=>{qe.value?.querySelector(`[data-year="${ft.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(()=>[T.value,me.value,f.value,be.value,ye.value,J.value,j.value,ge.value,Se.value,$.doubleCalendar,$.quickSelect],()=>{Ee()}),e.watch(T,A=>{pn(),A&&(en=I=>{I.key==="Escape"&&(me.value==="years"||me.value==="months"?Il():gl())},Ul=()=>{je()},bl=()=>{je()},document.addEventListener("keydown",en),window.addEventListener("resize",Ul),window.addEventListener("scroll",bl,!0))}),e.onBeforeUnmount(()=>{ae!==null&&(window.cancelAnimationFrame(ae),ae=null),pn()}),(A,I)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":S.mode==="readonly"}])},[S.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",xs,[I[10]||(I[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:Et.value,readonly:"",disabled:"",tabindex:"-1"},null,8,Es)])):Je.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:I[0]||(I[0]=L=>St("start"))},[I[11]||(I[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:yt,type:"text",class:"dss-datepicker__input",placeholder:$.placeholder||e.unref(de)("datepicker.selectDate"),value:dt.value,readonly:"",disabled:S.mode==="readonly"},null,8,Ss)])):rt.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:_t},[I[13]||(I[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:Ue,type:"text",class:"dss-datepicker__input",placeholder:$.placeholder||e.unref(de)("datepicker.selectFromList"),value:dt.value,readonly:""},null,8,Vs),e.createElementVNode("span",{class:e.normalizeClass(["dss-datepicker__chevron",{"dss-datepicker__chevron--open":T.value}]),"aria-hidden":"true"},[...I[12]||(I[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)):Ge.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:st,onClick:I[1]||(I[1]=L=>St("start"))},[I[14]||(I[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:De,type:"text",class:"dss-datepicker__input",placeholder:$.placeholder||e.unref(de)("datepicker.selectRange"),value:et.value,readonly:""},null,8,Ns)],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(gl,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Te,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":S.doubleCalendar&&Ge.value&&me.value==="days","dss-datepicker__dropdown--quick-select":S.doubleCalendar&&Ge.value&&me.value==="days"&&S.quickSelect,"dss-datepicker__dropdown--list":rt.value}]),onClick:I[9]||(I[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(bt.value)},[rt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[pt.value.length?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"dss-datepicker__list",role:"listbox",ref_key:"listRef",ref:ke},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pt.value,L=>(e.openBlock(),e.createElementBlock("li",{key:L.ts,role:"option","aria-selected":L.selected,class:e.normalizeClass(["dss-datepicker__list-item",{"dss-datepicker__list-item--selected":L.selected}]),onClick:K=>Tt(L.date)},[e.createElementVNode("span",Ms,e.toDisplayString(L.label),1),L.selected?(e.openBlock(),e.createElementBlock("svg",_s,[...I[15]||(I[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,Bs))),128))],512)):(e.openBlock(),e.createElementBlock("div",$s,e.toDisplayString(e.unref(de)("datepicker.noAvailableDates")),1))],64)):me.value==="days"&&S.doubleCalendar&&Ge.value?(e.openBlock(),e.createElementBlock("div",Ls,[S.quickSelect?(e.openBlock(),e.createElementBlock("nav",Ts,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ie.value,L=>(e.openBlock(),e.createElementBlock("button",{key:L.id,type:"button",class:"dss-datepicker__quick-select-btn",disabled:!an(L.id),onClick:K=>Wl(L.id)},e.toDisplayString(e.unref(de)(L.labelKey)),9,As))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Ds,[e.createElementVNode("div",Hs,[e.createElementVNode("div",Rs,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.prevMonth"),onClick:Zn}," ‹ ",8,Fs),e.createElementVNode("div",Is,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:I[2]||(I[2]=L=>Jl("left","months"))},e.toDisplayString(Qe.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:I[3]||(I[3]=L=>Jl("left","years"))},e.toDisplayString(J.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.nextMonth"),onClick:ql}," › ",8,zs)]),e.createElementVNode("div",Ps,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he.value,L=>(e.openBlock(),e.createElementBlock("span",{key:L,class:"dss-datepicker__weekday"},e.toDisplayString(L),1))),128))]),e.createElementVNode("div",Os,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Lt.value,(L,K)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+K},[L?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",kt(L)]),disabled:!Re(L),onClick:He=>Zl(L),onMouseenter:He=>nt(L),onMouseleave:We},e.toDisplayString(L.getDate()),43,Ws)):(e.openBlock(),e.createElementBlock("span",qs))],64))),128))])]),e.createElementVNode("div",Zs,[e.createElementVNode("div",Us,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.prevMonth"),onClick:mn}," ‹ ",8,Xs),e.createElementVNode("div",Ys,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:I[4]||(I[4]=L=>Jl("right","months"))},e.toDisplayString(Ct.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:I[5]||(I[5]=L=>Jl("right","years"))},e.toDisplayString(ge.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.nextMonth"),onClick:wn}," › ",8,js)]),e.createElementVNode("div",Ks,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he.value,L=>(e.openBlock(),e.createElementBlock("span",{key:L,class:"dss-datepicker__weekday"},e.toDisplayString(L),1))),128))]),e.createElementVNode("div",Gs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($e.value,(L,K)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+K},[L?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",kt(L)]),disabled:!Re(L),onClick:He=>Zl(L),onMouseenter:He=>nt(L),onMouseleave:We},e.toDisplayString(L.getDate()),43,Qs)):(e.openBlock(),e.createElementBlock("span",Js))],64))),128))])])])])):me.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",er,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.prevMonth"),onClick:dn}," ‹ ",8,tr),e.createElementVNode("div",lr,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:I[6]||(I[6]=L=>me.value="months")},e.toDisplayString(Zt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:I[7]||(I[7]=L=>me.value="years")},e.toDisplayString(be.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.nextMonth"),onClick:Dl}," › ",8,nr)]),e.createElementVNode("div",or,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he.value,L=>(e.openBlock(),e.createElementBlock("span",{key:L,class:"dss-datepicker__weekday"},e.toDisplayString(L),1))),128))]),e.createElementVNode("div",ar,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke.value,(L,K)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:K},[L?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",kt(L)]),disabled:!Re(L),onClick:He=>Zl(L),onMouseenter:He=>nt(L),onMouseleave:We},e.toDisplayString(L.getDate()),43,sr)):(e.openBlock(),e.createElementBlock("span",rr))],64))),128))])],64)):me.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",ir,[e.createElementVNode("div",cr,[e.createElementVNode("span",ur,e.toDisplayString(ht.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:I[8]||(I[8]=L=>me.value="years")},e.toDisplayString(ft.value),1)])]),e.createElementVNode("div",dr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Jt.value,(L,K)=>(e.openBlock(),e.createElementBlock("button",{key:K,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":K===tl.value}]),onClick:He=>wl(K)},e.toDisplayString(L),11,mr))),128))])],64)):me.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",pr,[e.createElementVNode("span",vr,e.toDisplayString(jt.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:qe},[e.createElementVNode("div",fr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wt.value,L=>(e.openBlock(),e.createElementBlock("button",{key:L,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":L===ft.value,"dss-datepicker__year-cell--current":L===e.unref(Be)}]),"data-year":L,onClick:K=>Al(L)},e.toDisplayString(L),11,hr))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},gr={class:"dss-step-bar__layout"},yr={class:"dss-step-bar__header"},kr={class:"dss-step-bar__label"},Cr={key:0,class:"dss-step-bar__counter"},br={class:"dss-step-bar__track-wrapper"},wr=["aria-valuemax","aria-valuenow","aria-label"],xr=["onMouseenter"],Ra={__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:S=>["input","desc","asc"].includes(S)},orientation:{type:String,default:"horizontal",validator:S=>["horizontal","vertical"].includes(S)},barHeight:{type:[Number,String],default:200},labelPosition:{type:String,default:"up",validator:S=>["up","down","left","right"].includes(S)},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:()=>({})},disableTooltips:{type:Boolean,default:!1}},setup(S){const ee=S,$={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"}}},N=H=>H&&typeof H=="object"&&!Array.isArray(H),de=(H,Y)=>{const ne=Object.assign({},H);return!N(H)||!N(Y)||Object.keys(Y).forEach(he=>{if(N(Y[he])){he in H?ne[he]=de(H[he],Y[he]):Object.assign(ne,{[he]:Y[he]});return}Object.assign(ne,{[he]:Y[he]})}),ne},P=e.computed(()=>de($,ee.options)),T=e.computed(()=>Math.max(1,Number(ee.steps)||1)),me=e.computed(()=>Math.min(T.value,Math.max(0,Number(ee.currentStep)||0))),ut=e.computed(()=>Array.isArray(ee.segments)&&ee.segments.length>0),te=e.computed(()=>{if(!ut.value)return[];const H=ee.segments.map((Y,ne)=>{const he=Number(Y?.value);return{label:Y?.label||`Step ${ne+1}`,value:Number.isFinite(he)&&he>0?he:0,color:Y?.color||ee.activeColor,marker:Y?.marker}});return ee.segmentOrder==="desc"?[...H].sort((Y,ne)=>ne.value-Y.value):ee.segmentOrder==="asc"?[...H].sort((Y,ne)=>Y.value-ne.value):H}),f=e.computed(()=>ut.value?te.value.reduce((H,Y)=>H+Y.value,0):me.value),be=e.computed(()=>ut.value?Number.isFinite(Number(ee.totalValue))&&Number(ee.totalValue)>0?Number(ee.totalValue):Math.max(1,f.value):T.value),ye=e.computed(()=>ut.value&&Number.isFinite(Number(ee.totalValue))&&Number(ee.totalValue)>0),J=e.computed(()=>ye.value?Math.max(0,Number(ee.totalValue)-f.value):0),j=e.computed(()=>typeof ee.remainderLabel=="string"&&ee.remainderLabel.trim().length>0),ge=e.computed(()=>J.value>0),_e=e.computed(()=>te.value.reduce((H,Y)=>Math.max(H,Number(Y.value)||0),0)),ue=e.computed(()=>te.value.filter(H=>H.value>0).map(H=>`${H.label}: ${et(H.value)}`).join(" | ")),Se=e.computed(()=>ut.value?ye.value?te.value.filter(H=>H.value>0):te.value:[]),U=e.computed(()=>{if(!ee.counterAsPercentage)return`${f.value} / ${be.value}`;const H=Number(be.value);if(!Number.isFinite(H)||H<=0)return"0%";const Y=Math.round(Number(f.value)/H*100);return`${Math.min(Math.max(Y,0),100)}%`}),yt=e.computed(()=>f.value),st=e.computed(()=>be.value),De=e.reactive({visible:!1,x:0,y:0,content:""}),Ue=e.computed(()=>ee.orientation==="vertical"),Z=e.computed(()=>{const H=ee.barHeight;return H==null||H===""?"200px":typeof H=="number"?`${H}px`:String(H)}),Te=e.computed(()=>{const H=ee.sideLabelMaxWidth;if(!(H==null||H===""))return typeof H=="number"?`${H}px`:String(H)}),qe=e.computed(()=>{const H=ee.sideLabelWrapWidth;return H==null||H===""?"18ch":typeof H=="number"?`${H}ch`:String(H)}),ke=e.computed(()=>({left:`${De.x}px`,top:`${De.y}px`,transform:"translate(-50%, calc(-100% - 8px))"})),Be=H=>Ue.value?{flex:`${H} 0 0`,minHeight:H>0?"6px":"0",minWidth:"0"}:{flex:`${H} 0 0`,minWidth:H>0?"6px":"0"},Je=H=>{const Y=H?.parentElement;if(!Y)return{x:0,y:0};const ne=Y.getBoundingClientRect();return{x:ne.left+ne.width/2,y:ne.top}},Ge=H=>{const Y=H.getBoundingClientRect();return{x:Y.left+Y.width/2,y:Y.top}},rt=H=>{if(ye.value){const he=Math.max(0,Number(H.value)||0);return{...Be(he),backgroundColor:H.color}}const Y=f.value,ne=H.value>0?H.value:Y>0?1e-4:1;return{...Be(ne),backgroundColor:H.color}},Yt=H=>Number(H?.value||0)>0&&Number(H?.value||0)===_e.value,we=H=>{const Y=N(H?.marker)?H.marker:{},ne=H?.marker===!0||Y.enabled===!0,he=Yt(H)&&P.value.maxSegment?.marker?.enabled===!0;if(!(ne||he))return{enabled:!1};const Ke=Y.backgroundColor??(he?P.value.maxSegment?.marker?.backgroundColor:P.value.segmentMarker?.backgroundColor),Lt=Y.borderColor??(he?P.value.maxSegment?.marker?.borderColor:P.value.segmentMarker?.borderColor),$e=Y.color??(he?P.value.maxSegment?.marker?.color:P.value.segmentMarker?.color),Qe=Y.width??(he?P.value.maxSegment?.marker?.width:P.value.segmentMarker?.width),Ct=Y.height??(he?P.value.maxSegment?.marker?.height:P.value.segmentMarker?.height);return{enabled:!0,backgroundColor:Ke,borderColor:Lt,color:$e,width:Qe,height:Ct,icon:Y.icon??null,...Y}},qt=H=>{const Y=we(H);return{backgroundColor:Y.backgroundColor??void 0,borderColor:Y.borderColor??void 0,color:Y.color??void 0}},dt=H=>{const Y=we(H);return{width:Y.width??void 0,height:Y.height??void 0}},et=H=>`${H}${ee.valueLabel}`,Et=e.computed(()=>({...Be(J.value),backgroundColor:ee.inactiveColor})),tl=(H,Y)=>{ee.disableTooltips||ht(H,Y)},ft=H=>{ee.disableTooltips||Jt(H)},Zt=()=>{ee.disableTooltips||wt()},ht=(H,Y)=>{if(!H||!Y?.currentTarget)return;const ne=Y.currentTarget;if(ee.remainderTooltipSummary){const Xe=Je(ne);De.x=Xe.x,De.y=Xe.y,De.content=ue.value,De.visible=!!De.content;return}const he=Ge(ne);De.x=he.x,De.y=he.y,De.content=`${H.label}: ${et(H.value)}`,De.visible=!0},Jt=H=>{if(!J.value||!H?.currentTarget)return;const Y=H.currentTarget;if(ee.remainderTooltipSummary){const he=Je(Y);De.x=he.x,De.y=he.y,De.content=ue.value,De.visible=!!De.content;return}const ne=Ge(Y);De.x=ne.x,De.y=ne.y,j.value&&(De.content=`${ee.remainderLabel}: ${et(J.value)}`,De.visible=!0)},wt=()=>{De.visible=!1},jt=()=>{De.visible&&wt()};e.onMounted(()=>{window.addEventListener("scroll",jt,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("scroll",jt,!0)});const fe=e.computed(()=>({"--dss-step-bar-label-color":ee.labelColor??void 0,"--dss-step-bar-counter-color":ee.counterColor??void 0,"--dss-step-bar-active-color":ee.activeColor,"--dss-step-bar-inactive-color":ee.inactiveColor,"--dss-step-bar-bar-height":Ue.value?Z.value:void 0,"--dss-step-bar-side-label-max-width":Te.value,"--dss-step-bar-side-label-wrap-width":qe.value}));return(H,Y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-step-bar",[`dss-step-bar--${S.orientation}`,`dss-step-bar--label-${S.labelPosition}`]]),style:e.normalizeStyle(fe.value)},[e.createElementVNode("div",gr,[e.createElementVNode("div",yr,[e.createElementVNode("span",kr,[e.renderSlot(H.$slots,"label",{label:S.label},()=>[e.createTextVNode(e.toDisplayString(S.label),1)])]),S.showCounter?(e.openBlock(),e.createElementBlock("span",Cr,[e.renderSlot(H.$slots,"counter",{counterDisplay:U.value},()=>[e.createTextVNode(e.toDisplayString(U.value),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",br,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":st.value,"aria-valuenow":yt.value,"aria-label":S.label},[ut.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Se.value,(ne,he)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${he}-${ne.label}`,class:e.normalizeClass(["dss-step-bar__segment dss-step-bar__segment--interactive",{"dss-step-bar__segment--max":Yt(ne),"dss-step-bar__segment--marker-enabled":we(ne).enabled}]),style:e.normalizeStyle(rt(ne)),onMouseenter:Xe=>tl(ne,Xe),onMouseleave:Zt},[we(ne).enabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment-marker",style:e.normalizeStyle(qt(ne)),"aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-step-bar__segment-marker-icon",style:e.normalizeStyle(dt(ne))},[e.renderSlot(H.$slots,"segment-marker-icon",{segment:ne,index:he,marker:we(ne)},()=>[e.renderSlot(H.$slots,"max-segment-icon",{segment:ne,index:he,marker:we(ne)},()=>[e.createTextVNode(e.toDisplayString(we(ne).icon||""),1)])])],4)],4)):e.createCommentVNode("",!0)],46,xr))),128)),ge.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(Et.value),onMouseenter:Y[0]||(Y[0]=ne=>ft(ne)),onMouseleave:Zt},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(T.value,ne=>(e.openBlock(),e.createElementBlock("div",{key:ne,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":ne<=me.value}])},null,2))),128))],8,wr)])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[!S.disableTooltips&&De.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__tooltip dss-step-bar__tooltip--teleported",style:e.normalizeStyle(ke.value)},e.toDisplayString(De.content),5)):e.createCommentVNode("",!0)]))],6))}},Er=["data-chart-type"],Sr={class:"dss-chart-header-titles"},Vr={key:0,class:"dss-chart-title"},Nr={key:1,class:"dss-chart-subtitle"},Br=["onClick","onMouseenter"],Mr={class:"dss-legend-text"},_r=["onClick","onMouseenter"],$r={class:"dss-legend-text"},Lr=["title"],Tr=["src"],Ar={class:"dss-chart-area-wrapper"},Dr={key:0,class:"dss-chart-z-axis-label"},Hr=["width","height","data-smooth","data-animated"],Rr=["id"],Fr=["y","width","height"],Ir=["id"],zr=["d"],Pr=["id"],Or=["d"],Wr={key:0},qr=["clip-path"],Zr=["x1","x2","y1","y2"],Ur=["clip-path"],Xr=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray","opacity"],Yr={class:"dss-axes"},jr=["x1","x2","y1","y2"],Kr=["x1","x2","y1","y2"],Gr=["x1","x2","y1","y2"],Qr={class:"dss-axis-labels"},Jr=["x","y"],ei=["x","y"],ti=["x","y"],li=["x","y"],ni=["y","transform"],oi=["x","y","transform"],ai={key:2,class:"dss-flag-markers"},si=["clip-path"],ri=["x1","x2","y1","y2","onMouseover"],ii=["x1","x2","y1","y2","onMouseover"],ci=["x1","x2","y1","y2","onMouseover"],ui=["cx","cy","onMouseover"],di=["cx","cy","fill","onMouseover"],mi=["x","y"],pi=["clip-path"],vi={key:0},fi=["d","onMouseover"],hi=["x","y","width","height","fill","onMouseover"],gi={class:"dss-line-chart"},yi=["d","stroke","stroke-width","stroke-dasharray"],ki=["d","stroke","stroke-width","opacity"],Ci=["cx","cy","r","fill","onMouseover"],bi={key:1},wi=["d","stroke","stroke-width","stroke-dasharray"],xi=["d","stroke","stroke-width","stroke-dasharray"],Ei=["d","stroke","stroke-width","opacity"],Si=["cx","cy","r","fill","onMouseover"],Vi={key:2},Ni=["id"],Bi=["x","y","width","height"],Mi=["d","fill","fill-opacity","mask"],_i=["d","stroke","stroke-width"],$i=["d","fill","onMouseover"],Li=["x","y","width","height","onMouseover"],Ti=["clip-path"],Ai=["x1","x2","y1","y2","stroke"],Di=["cx","cy","r","fill"],Hi={key:1,class:"dss-bubble-chart"},Ri={key:0,class:"dss-bubble-group"},Fi=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],Ii=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],zi=["transform"],Pi=["cx","cy","r"],Oi=["data-chart-type","clip-path"],Wi=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],qi={key:1,class:"dss-radial-segment-data-labels"},Zi=["x","y"],Ui=["x","y","font-size","fill"],Xi=["x1","y1","x2","y2","stroke"],Yi=["x1","y1","x2","y2","stroke"],ji=["x","y","text-anchor","font-size"],Ki=["transform"],Gi={key:0,class:"dss-spider-grid"},Qi=["cx","cy","r"],Ji={class:"dss-spider-grid-labels"},ec=["x","y"],tc=["x","y"],lc=["x1","x2","y1","y2"],nc={class:"dss-spider-labels"},oc=["x","y","text-anchor","dominant-baseline"],ac=["points","fill","fill-opacity","stroke","stroke-width","stroke-dasharray"],sc=["cx","cy","r","fill","stroke","stroke-width","onMouseover"],rc={class:"dss-chart-logos"},ic=["cx","cy","r","fill"],cc=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],uc={key:0,class:"dss-stepbar-grid-lines","aria-hidden":"true"},dc=["onClick","onMouseenter"],mc=["src"],pc={class:"dss-marker-tooltip-category"},vc={key:0,class:"dss-marker-tooltip-description"},fc={key:0,class:"dss-tooltip-section dss-spider-tooltip-section"},hc={class:"dss-tooltip-title dss-spider-tooltip-area-title"},gc={class:"dss-tooltip-series-name"},yc={class:"dss-tooltip-series-value"},kc={key:1,class:"dss-tooltip-section"},Cc={key:0,class:"dss-tooltip-title"},bc={class:"dss-bubble-tooltip-data"},wc={key:2,class:"dss-tooltip-section"},xc={class:"dss-tooltip-title"},Ec={class:"dss-tooltip-value"},Sc={key:0,class:"dss-tooltip-section"},Vc={class:"dss-tooltip-section-title"},Nc={class:"dss-tooltip-group-header"},Bc={class:"dss-tooltip-item-content"},Mc={class:"dss-tooltip-item-text"},_c={key:1,class:"dss-tooltip-section"},$c={class:"dss-tooltip-section-title"},Lc={class:"dss-tooltip-item-content"},Tc={class:"dss-tooltip-item-title"},Ac={key:0,class:"dss-tooltip-item-description"},Dc={class:"dss-tooltip-section"},Hc={class:"dss-tooltip-title"},Rc={key:0,class:"dss-bubble-tooltip-data"},Fc={class:"dss-tooltip-series-name"},Ic={class:"dss-tooltip-series-value"},zc={key:0,class:"dss-tooltip-section"},Pc={class:"dss-tooltip-section-title"},Oc={class:"dss-tooltip-group-header"},Wc={class:"dss-tooltip-item-content"},qc={class:"dss-tooltip-item-text"},Zc={key:1,class:"dss-tooltip-section"},Uc={class:"dss-tooltip-section-title"},Xc={class:"dss-tooltip-item-content"},Yc={class:"dss-tooltip-item-title"},jc={key:0,class:"dss-tooltip-item-description"},Kc=["onClick","onMouseenter"],Gc={class:"dss-legend-text"},Qc={key:1,class:"dss-context-menu-separator"},Jc={key:0,class:"dss-context-menu-separator"},eu={key:0,class:"dss-context-menu-separator"},tu=["onClick"],lu=["innerHTML"],nu={key:0,class:"dss-context-menu-icon"},ou={class:"dss-marker-modal-header"},au={class:"dss-marker-modal-body"},su={class:"dss-form-group"},ru={class:"dss-form-group"},iu={for:"dss-marker-description"},cu={key:0,class:"dss-form-text-display"},uu=["placeholder"],du={class:"dss-marker-modal-footer"},mu={class:"modal-footer-left"},pu={class:"dss-modal-footer-right"},vu=["disabled"],fu={name:"DSSChart"},hu=Object.assign(fu,{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:S=>typeof S=="object"&&S!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(S,{emit:ee}){const{t:$,locale:N}=fo.useI18n(),de=ee,P=e.ref(null),T=e.ref(null);let me=null;const ut=()=>{me&&(me(),me=null);const t=T.value;if(!t||!zt.value)return;const o=l=>$o(l);t.addEventListener("wheel",o,{passive:!1}),me=()=>t.removeEventListener("wheel",o)},te=e.ref(null),f=e.ref(null),be=e.ref(0),ye=e.ref(0);let J=null,j=null;const ge=20,_e=e.computed(()=>{if(ye.value,be.value,!P.value||!te.value)return 0;try{const t=P.value.getBoundingClientRect();return te.value.getBoundingClientRect().top-t.top}catch{return 0}}),ue=e.computed(()=>`chart-clip-${U.chartId}`),Se=e.computed(()=>`url(#${ue.value})`),U=S,yt={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:14,columnWidth:72,trackWidth:14,minBarWidth:12,maxBarWidth:120,barRadius:6,columnGap:16,labelReserve:48,trackAreaHeight:220,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 st(t,o){const l=Object.assign({},t);return Ue(t)&&Ue(o)&&Object.keys(o).forEach(r=>{Ue(o[r])?r in t?l[r]=st(t[r],o[r]):Object.assign(l,{[r]:o[r]}):Object.assign(l,{[r]:o[r]})}),l}const De=()=>{let t=20,o=0,l=0;if(dt.value&&(t+=30),et.value&&(t+=25),he.value&&U.series.length>0){const r=U.series.filter((m,v)=>!O.value.has(v)).length;if(Xe.value==="top"||Xe.value==="bottom"){if(Ke.value==="horizontal"){const v=Math.floor(Be.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 Ue(t){return t&&typeof t=="object"&&!Array.isArray(t)}const Z=e.computed(()=>st(yt,U.options)),Te=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.width==="auto"}),qe=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.height==="auto"}),ke=e.computed(()=>{const t=Z.value;return zt.value&&t?.chart?.height==="fit"}),Be=e.computed(()=>{const t=Z.value;return Te.value?be.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),Je=e.ref(ge),Ge=e.computed(()=>{if(qe.value){const t=Ge.value;return t??Math.max(0,(ye.value||400)-Je.value*5)}}),rt=e.computed(()=>{const t=Z.value;if(we.value==="mini-radial")return Be.value;if(ke.value)return an.value;if(qe.value){const o=Ge.value;return o??Math.max(0,(ye.value||400)-Je.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),Yt=e.computed(()=>{if(qe.value&&we.value==="semi-radial"&&Ge.value!=null)return Je.value+rt.value+"px";if(qe.value)return"100%";if(El.value)return Je.value+rt.value+"px";if(he.value&&Xe.value==="bottom"){const t=De();return rt.value+(t.legendHeight||35)+"px"}return rt.value+(he.value?20:0)+"px"}),we=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),qt=e.computed(()=>{const t=U.series.map(o=>o.type||we.value);return new Set(t).size>1}),dt=e.computed(()=>{const t=Z.value;return t&&t.title&&t.title.text?t.title.text:""}),et=e.computed(()=>{const t=Z.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),Et=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:""}),tl=e.computed(()=>{const t=Z.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),ft=e.computed(()=>{const o=Z.value?.yAxis?.title?.text;return o==null||String(o).trim()===""?"":String(o)}),Zt=e.computed(()=>{const t=Z.value;return t&&t.yAxis&&t.yAxis.secondary&&typeof t.yAxis.secondary=="object"?t.yAxis.secondary:null}),ht=e.computed(()=>{const t=Zt.value;return t&&t.title&&t.title.text?t.title.text:""}),Jt=e.computed(()=>{const t=Z.value;if(!t||!t.yAxis)return _l;const o=t.yAxis.min;return typeof o=="number"||o===_l?o:_l}),wt=e.computed(()=>{const t=Z.value;if(!t||!t.yAxis)return _l;const o=t.yAxis.max;return typeof o=="number"||o===_l?o:_l}),jt=e.computed(()=>{const t=Zt.value;if(!t)return _l;const o=t.min;return typeof o=="number"||o===_l?o:_l}),fe=e.computed(()=>{const t=Zt.value;if(!t)return _l;const o=t.max;return typeof o=="number"||o===_l?o:_l}),H=e.computed(()=>{const t=Z.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),Y=e.computed(()=>{const t=Z.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),ne=e.computed(()=>{const t=Z.value;return t&&t.grid&&t.grid.show!==!1}),he=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.show!==!1}),Xe=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Ke=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Lt=e.computed(()=>{const t=Z.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),$e=e.computed(()=>{const t=Z.value;if(!t)return!1;if(zt.value){if(!t.crosshair)return!0;const l=t.crosshair.show;return l!==!1&&l!=="false"}if(!t.crosshair)return!1;const o=t.crosshair.show;return o===!0||o==="true"}),Qe=e.computed(()=>{const t=Z.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Ct=e.computed(()=>{const t=Z.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),el=e.computed(()=>{const t=Z.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),ie=e.computed(()=>{const t=Z.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),X=e.computed(()=>{const t=Z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),Q=e.computed(()=>{if(!El.value)return 0;const t=Z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),ae=e.computed(()=>{const t=Z.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),Ee=e.computed(()=>{const{maxX:t}=Nt.value;return t===0}),je=(t,o)=>Ee.value&&o===0?5:o,bt=t=>{const o=Number(t);return!Number.isFinite(o)||o<=0?0:o},Ut=e.computed(()=>{const t=Z.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),lt=e.computed(()=>{const t=Z.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),sl=e.computed(()=>{const t=Z.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),M=e.computed(()=>{const t=Z.value;return lt.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),w=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"]}),E=e.computed(()=>Z.value?.stepbar||{}),se=e.computed(()=>{const t=E.value?.segmentOrder;return["asc","desc","input"].includes(t)?t:"input"}),re=e.computed(()=>{const t=Number(E.value?.totalValue);return Number.isFinite(t)&&t>0?t:100}),Re=e.computed(()=>E.value?.showRemainder!==!1),kt=e.computed(()=>E.value?.remainderLabel||"Remaining"),nt=e.computed(()=>E.value?.remainderColor||"#E5E7EB"),We=e.computed(()=>{const t=Number(E.value?.barWidth);return Number.isFinite(t)&&t>0?t:42}),xt=e.computed(()=>{const t=Number(E.value?.minBarWidth);return Number.isFinite(t)&&t>0?t:12}),Bt=e.computed(()=>{const t=Number(E.value?.maxBarWidth);return Number.isFinite(t)&&t>0?t:58});e.computed(()=>{const t=Number(E.value?.barRadius);return Number.isFinite(t)&&t>=0?t:6});const pt=e.computed(()=>E.value?.axisBars||{}),_t=e.computed(()=>pt.value?.show!==!1);e.computed(()=>pt.value?.showVertical===!0);const Tt=e.computed(()=>pt.value?.color||"#d6d6d6"),St=e.computed(()=>{const t=Number(pt.value?.opacity);return Number.isFinite(t)?Math.min(Math.max(t,0),1):.75}),gl=e.computed(()=>{const t=Number(pt.value?.width);return Number.isFinite(t)&&t>0?t:1}),Jl=e.computed(()=>pt.value?.dashArray||"3,4"),Il=e.computed(()=>{const t=Number(E.value?.columnGap);return Number.isFinite(t)&&t>=0?t:16}),ml=e.computed(()=>{const t=Number(E.value?.labelReserve);return Number.isFinite(t)&&t>0?t:48}),pl=e.computed(()=>{const t=Number(E.value?.trackAreaHeight);return Number.isFinite(t)&&t>0?t:220}),an=e.computed(()=>{let t=0;dt.value&&(t+=15),et.value&&(t+=10);const o=50+t,l=ml.value+8;return o+pl.value+l}),Wl=e.computed(()=>Math.max(F.value.height,0)),wl=e.computed(()=>{const t=Number(E.value?.columnWidth);if(Number.isFinite(t)&&t>0)return t;const o=We.value,l=xt.value,r=Bt.value;return Math.max(l,Math.min(r,o))}),Al=e.computed(()=>{const t=Number(E.value?.trackWidth);if(Number.isFinite(t)&&t>0)return Math.min(t,wl.value);const o=Number(E.value?.barWidth);return Number.isFinite(Number(E.value?.columnWidth))&&Number(E.value?.columnWidth)>0&&Number.isFinite(o)&&o>0?Math.min(o,wl.value):Math.min(wl.value,Math.max(10,Math.round(wl.value*.32)))}),dn=e.computed(()=>({width:`${wl.value}px`,flex:`0 0 ${wl.value}px`,"--dss-step-bar-track-thickness":`${Al.value}px`,"--dss-stepbar-label-height":`${ml.value}px`})),Dl=e.computed(()=>{const t=ql.value.length;return t?t*wl.value+Math.max(0,t-1)*Il.value:0}),Zn=e.computed(()=>({maxSegment:{marker:{enabled:!1}}})),ql=e.computed(()=>zt.value?$n.value.map(t=>({key:t.key,label:t.axisLabel||t.label,totalValue:t.totalValue,segments:t.segments.filter(o=>!o.isRemainder).map(o=>({label:o.label,value:o.value,color:o.color,marker:o.marker}))})):[]),mn=e.computed(()=>{if(!zt.value)return[];const{minY:t,maxY:o}=Nt.value,l=5,r=[];for(let m=0;m<=l;m++){const v=t+(o-t)*(m/l);r.push({top:On(v)-F.value.top,value:v})}return r}),wn=e.computed(()=>({top:`${F.value.top}px`,left:`${F.value.left}px`,width:`${F.value.width}px`,height:`${Wl.value+ml.value}px`})),Zl=e.computed(()=>({width:`${Dl.value}px`,minHeight:`${Wl.value+ml.value}px`})),en=e.computed(()=>zt.value&&$e.value&&Ae.value.show&&!oe.value.isZooming),Ul=e.computed(()=>{const t=wl.value+Il.value;return{left:`${Ae.value.categoryIndex*t+wl.value/2}px`,height:`${Wl.value}px`,borderColor:Qe.value}}),bl=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.enabled!==!1}),pn=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),A=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),I=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),L=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),K=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),He=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.onDataChange!==!1}),vt=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),mt=e.computed(()=>{const t=Z.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),it=e.computed(()=>Z.value?.spider?.gridSteps||5),ot=e.computed(()=>{const t=[],o=it.value;for(let l=1;l<=o;l++)t.push(at.value/o*l);return t}),yl=t=>{const o=xl.value;if(o&&Array.isArray(o)&&o[t]!==void 0)return o[t].toString();const l=ot.value[t];return Math.round(l/at.value*100)+"%"},xl=e.computed(()=>Z.value?.spider?.gridLabels||null),Kt=e.computed(()=>{const t=Z.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),Dt=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}),Gt=e.computed(()=>{const t=Z.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Sl=e.computed(()=>{const t=Z.value;return t&&t.markers&&t.markers.icon?t.markers.icon:lo.value}),tn=e.computed(()=>{const t=Z.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Ft=e.computed(()=>{const t=Z.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),Vt=e.computed(()=>{const o=Z.value?.valueFormat?.extension;return typeof o=="string"?o:""}),$l=t=>{const o=Vt.value;if(t==null)return"";const l=String(t);return o?l+o:l},An=e.computed(()=>!oe.value.isZooming);e.computed(()=>fl.value.map(t=>{if(t.categoryIndex!==void 0&&(Ml.value||It.value)){const o=kl(t.categoryIndex),l=_e.value+F.value.bottom-Ft.value/2;return{...t,x:o,y:l}}return t}));function Hl(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("-"),W=Number(b?.length===2?`20${b}`:b);l=new Date(W,Number(C)-1,Number(v))}else return 0;let r=0,m=1/0;return o.forEach((v,C)=>{const[b,W,_]=v.split("-"),R=Number(_?.length===2?`20${_}`:_),B=new Date(R,Number(W)-1,Number(b)),G=Math.abs(B-l);G<m&&(m=G,r=C)}),r}const xn=e.computed(()=>{const t=U.markers.map(l=>{const r=Hl(l.marker_date,U.categories),m=kl(r),v=_e.value+F.value.bottom-Ft.value/2;return{...l,x:m,y:v,categoryIndex:r,source:"props"}}),o=fl.value.map(l=>{if(l.categoryIndex!==void 0&&(Ml.value||It.value)){const r=kl(l.categoryIndex),m=_e.value+F.value.bottom-Ft.value/2;return{...l,x:r,y:m,source:"internal"}}return{...l,source:"internal"}});return[...t,...o]}),ln=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.enabled===!0}),En=e.computed(()=>{const t=Z.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),Dn=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),zl=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),ll=e.computed(()=>{const t={left:F.value.left,top:F.value.top,width:F.value.width,height:F.value.height};let o,l;const r=String(Dn.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}}),to=e.computed(()=>{const{width:t,height:o}=ll.value,l=zl.value;let r,m;const v=F.value.left,C=F.value.right,b=F.value.top,W=F.value.bottom,_=F.value.width,R=F.value.height;switch(l){case"center":r=v+(_-t)/2,m=b+(R-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=W-o-5;break;case"bottom-right":default:r=C-t-15,m=W-o-5;break}return{backgroundPositionX:r+"px",backgroundPositionY:m+"px",backgroundSize:`${t}px ${o}px`}}),Xl=t=>!U.flags||!U.flags.length?[]:U.flags.filter(o=>o.categoryIndex===t),At=t=>{const o=Xl(t),l=ea(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"}))}},lo=e.computed(()=>{const t=U.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"),fo=require("vue-i18n"),xs={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},Es=["value"],Ss=["placeholder","value","disabled"],Vs=["placeholder","value"],Ns=["placeholder","value"],Bs=["aria-selected","onClick"],Ms={class:"dss-datepicker__list-item-label"},_s={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"},$s={key:1,class:"dss-datepicker__list-empty"},Ls={key:1,class:"dss-datepicker__double-wrap"},Ts={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},As=["disabled","onClick"],Ds={class:"dss-datepicker__double-calendars"},Hs={class:"dss-datepicker__double-calendar"},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__double-calendar"},Us={class:"dss-datepicker__calendar-header"},Xs=["aria-label"],Ys={class:"dss-datepicker__month-year-row"},js=["aria-label"],Ks={class:"dss-datepicker__weekdays"},Gs={class:"dss-datepicker__grid"},Qs=["disabled","onClick","onMouseenter"],Js={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},er={class:"dss-datepicker__calendar-header"},tr=["aria-label"],lr={class:"dss-datepicker__month-year-row"},nr=["aria-label"],or={class:"dss-datepicker__weekdays"},ar={class:"dss-datepicker__grid"},sr=["disabled","onClick","onMouseenter"],rr={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},ir={class:"dss-datepicker__calendar-header"},cr={class:"dss-datepicker__month-year-row"},ur={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},dr={class:"dss-datepicker__months-grid"},mr=["onClick"],pr={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},vr={class:"dss-datepicker__month-year"},fr={class:"dss-datepicker__years-grid"},hr=["data-year","onClick"],Da=27,qn=8,ga={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:S=>["single","range","singleFromAvailable","rangeFromAvailable","listFromAvailable","readonly"].includes(S)},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(S,{emit:ee}){const $=S,N=ee,{t:de,locale:P}=fo.useI18n(),T=e.ref(!1),me=e.ref("days"),ut=new Date,te=e.computed(()=>$.minDate instanceof Date?$.minDate:ut),f=e.ref(te.value.getMonth()),we=e.ref(te.value.getFullYear()),ye=e.ref(te.value.getMonth()),J=e.ref(te.value.getFullYear()),j=e.ref(te.value.getMonth()),ge=e.ref(te.value.getFullYear()),_e=e.ref("start"),ue=e.ref(null),Se=e.ref(null);function U(){const A=te.value,I=A.getMonth(),L=A.getFullYear(),K=I===11?0:I+1,He=I===11?L+1:L;return{left:{month:I,year:L},right:{month:K,year:He}}}const yt=e.ref(null),st=e.ref(null),De=e.ref(null),Ue=e.ref(null),Z=e.ref(null),Te=e.ref(null),qe=e.ref(null),ke=e.ref(null),Be=new Date().getFullYear(),Je=e.computed(()=>["single","singleFromAvailable"].includes($.mode)),Ge=e.computed(()=>["range","rangeFromAvailable"].includes($.mode)),rt=e.computed(()=>$.mode==="listFromAvailable"),Xt=e.computed(()=>{if(!["single","singleFromAvailable","listFromAvailable"].includes($.mode))return null;const A=$.modelValue;return A instanceof Date?A:null}),be=e.computed(()=>{if(!Ge.value)return{start:null,end:null};const A=$.modelValue;return!A||typeof A!="object"?{start:null,end:null}:{start:A.start instanceof Date?A.start:null,end:A.end instanceof Date?A.end:null}});function Wt(A){if(!A||!(A instanceof Date))return"";const I=A.getDate(),L=A.getMonth()+1,K=A.getFullYear(),He=vt=>String(vt).padStart(2,"0");return`${He(I)}/${He(L)}/${K}`}const dt=e.computed(()=>Wt(Xt.value)),et=e.computed(()=>{const{start:A,end:I}=be.value;if(!A&&!I)return"";const L=!I||A&&A<=I?A:I,K=!A||I&&I>=A?I:A;return Zt(L,K)?Wt(L):`${Wt(L)} - ${Wt(K)}`}),Et=e.computed(()=>{if($.mode!=="readonly")return"—";const A=$.modelValue;if(A instanceof Date)return Wt(A)||"—";if(A&&typeof A=="object"&&("start"in A||"end"in A)){const I=A.start instanceof Date?A.start:null,L=A.end instanceof Date?A.end:null;if(!I&&!L)return"—";const K=!L||I&&I<=L?I:L,He=!I||L&&L>=I?L:I;return Zt(K,He)?Wt(K):`${Wt(K)} - ${Wt(He)}`}return"—"});e.computed(()=>{const A=new Date(we.value,f.value,1);return new Intl.DateTimeFormat(P.value,{month:"long",year:"numeric"}).format(A)});const tl=e.computed(()=>Se.value==="left"?ye.value:Se.value==="right"?j.value:f.value),ft=e.computed(()=>Se.value==="left"?J.value:Se.value==="right"?ge.value:we.value),qt=e.computed(()=>{const A=new Date(we.value,f.value,1);return new Intl.DateTimeFormat(P.value,{month:"long"}).format(A)}),ht=e.computed(()=>{const A=new Date(ft.value,tl.value,1);return new Intl.DateTimeFormat(P.value,{month:"long"}).format(A)}),Jt=e.computed(()=>{const A=new Intl.DateTimeFormat(P.value,{month:"short"});return Array.from({length:12},(I,L)=>A.format(new Date(2024,L,1)))}),wt=e.computed(()=>{const I=(Se.value?ft.value:we.value)-Math.floor(Da/2);return Array.from({length:Da},(L,K)=>I+K)}),Yt=e.computed(()=>{const A=wt.value;return A.length?`${A[0]} – ${A[A.length-1]}`:""});function fe(A){return A===7?0:A}function H(A){try{const I=new Intl.Locale(A);if(I.weekInfo?.firstDay!=null)return fe(I.weekInfo.firstDay)}catch{}return 1}function Y(A){const I=new Date(2024,0,1),L=(I.getDay()-A+7)%7,K=new Date(I);return K.setDate(I.getDate()-L),K}const ne=e.computed(()=>H(P.value)),he=e.computed(()=>{const A=new Intl.DateTimeFormat(P.value,{weekday:"short"}),I=Y(ne.value),L=[];for(let K=0;K<7;K++){const He=new Date(I);He.setDate(I.getDate()+K),L.push(A.format(He).slice(0,2))}return L});function Xe(A,I,L){const K=new Date(A,I,1),He=new Date(A,I+1,0),vt=(K.getDay()-L+7)%7,mt=He.getDate(),it=[];for(let ot=0;ot<vt;ot++)it.push(null);for(let ot=1;ot<=mt;ot++)it.push(new Date(A,I,ot));return it}const Ke=e.computed(()=>Xe(we.value,f.value,ne.value)),Lt=e.computed(()=>Xe(J.value,ye.value,ne.value)),$e=e.computed(()=>Xe(ge.value,j.value,ne.value));e.computed(()=>{const A=new Date(J.value,ye.value,1);return new Intl.DateTimeFormat(P.value,{month:"long",year:"numeric"}).format(A)}),e.computed(()=>{const A=new Date(ge.value,j.value,1);return new Intl.DateTimeFormat(P.value,{month:"long",year:"numeric"}).format(A)});const Qe=e.computed(()=>{const A=new Date(J.value,ye.value,1);return new Intl.DateTimeFormat(P.value,{month:"long"}).format(A)}),Ct=e.computed(()=>{const A=new Date(ge.value,j.value,1);return new Intl.DateTimeFormat(P.value,{month:"long"}).format(A)}),el=e.computed(()=>$.availableDates&&$.availableDates.length>0),ie=e.computed(()=>el.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"}]),X=e.ref({top:0,left:0}),Q=e.ref("left");let ae=null;function Ee(){T.value&&e.nextTick(()=>{T.value&&(ae!==null&&window.cancelAnimationFrame(ae),ae=window.requestAnimationFrame(()=>{ae=null,je()}))})}function je(){if(!Z.value||!T.value)return;const A=Z.value.getBoundingClientRect(),I=window.innerWidth||document.documentElement.clientWidth,L=window.innerHeight||document.documentElement.clientHeight;let K=A.left,He=A.bottom+4;const vt=Te.value;if(vt){const mt=vt.offsetWidth,it=vt.offsetHeight;Q.value==="right"||K+mt>I-qn?(Q.value="right",K=A.right-mt):Q.value="left";const yl=Math.max(qn,I-mt-qn);if(K=Math.min(Math.max(K,qn),yl),He+it>L-qn){const xl=A.top-4-it;xl>=qn?He=xl:He=Math.max(qn,L-it-qn)}}X.value={top:He,left:K}}const bt=e.computed(()=>!Z.value||!T.value?{}:{position:"fixed",left:`${X.value.left}px`,top:`${X.value.top}px`,zIndex:1002});function Zt(A,I){return!A||!I?!1:A.getFullYear()===I.getFullYear()&&A.getMonth()===I.getMonth()&&A.getDate()===I.getDate()}function lt(A){return new Date(A.getFullYear(),A.getMonth(),A.getDate()).getTime()}function sl(A){return!$.availableDates||!$.availableDates.length?!0:$.availableDates.some(I=>I instanceof Date&&Zt(I,A))}function M(A){const I=lt(A);return!($.minDate instanceof Date&&I<lt($.minDate)||$.maxDate instanceof Date&&I>lt($.maxDate))}function w(A){const I=new Date(A);return new Date(I.getFullYear(),I.getMonth(),I.getDate())}function E(A){return A.filter(I=>M(I))}function se(A,I){if(!(A instanceof Date)||!(I instanceof Date))return null;let L=lt(A),K=lt(I);if(L>K&&([L,K]=[K,L]),$.minDate instanceof Date){const He=lt($.minDate);L=Math.max(L,He),K=Math.max(K,He)}if($.maxDate instanceof Date){const He=lt($.maxDate);L=Math.min(L,He),K=Math.min(K,He)}return L>K?null:{start:w(L),end:w(K)}}function re(A){return!$.exceptDates||!$.exceptDates.length?!1:$.exceptDates.some(I=>I instanceof Date&&Zt(I,A))}function Re(A){return re(A)?!1:["singleFromAvailable","rangeFromAvailable"].includes($.mode)?sl(A):M(A)}function kt(A){const I=Xt.value,L=be.value,K=lt(A),He=Ge.value&&L.start&&L.end&&K>lt(L.start)&&K<lt(L.end),vt=Ge.value&&L.start&&Zt(A,L.start),mt=Ge.value&&L.end&&Zt(A,L.end),it=vt&&mt,ot=Je.value&&I&&Zt(A,I)||vt||mt;let yl=!1;if(Ge.value&&L.start&&!L.end&&ue.value){const xl=lt(L.start),jt=lt(ue.value),Dt=Math.min(xl,jt),Kt=Math.max(xl,jt);yl=K>Dt&&K<Kt}return{"dss-datepicker__day--selected":ot&&!it,"dss-datepicker__day--range-start":vt&&!it,"dss-datepicker__day--range-end":mt&&!it,"dss-datepicker__day--range-single":it,"dss-datepicker__day--in-range":He&&!vt&&!mt,"dss-datepicker__day--in-range-preview":yl&&!vt&&!mt&&!He,"dss-datepicker__day--disabled":!Re(A)}}function nt(A){if(!Ge.value)return;const I=be.value;if(!I.start||I.end){ue.value=null;return}if(!Re(A)){ue.value=null;return}ue.value=new Date(A.getFullYear(),A.getMonth(),A.getDate())}function We(){ue.value=null}function xt(){if(!$.doubleCalendar||!Ge.value)return;const A=be.value,{start:I,end:L}=A;if(I&&L){const vt=I<=L?I:L,mt=I<=L?L:I,it=vt.getMonth(),ot=vt.getFullYear(),yl=mt.getMonth(),xl=mt.getFullYear();if(it!==yl||ot!==xl){const jt=ye.value===it&&J.value===ot,Dt=j.value===yl&&ge.value===xl;if(jt&&Dt)return;ye.value=it,J.value=ot,j.value=yl,ge.value=xl}else{const jt=it===0?11:it-1,Dt=it===0?ot-1:ot;ye.value===jt&&J.value===Dt&&j.value===it&&ge.value===ot||(ye.value=it,J.value=ot,it===11?(j.value=0,ge.value=ot+1):(j.value=it+1,ge.value=ot))}return}const K=I||L;if(K){const vt=K.getMonth(),mt=K.getFullYear(),it=ye.value===vt&&J.value===mt,ot=j.value===vt&&ge.value===mt;if(it||ot)return;ye.value=vt,J.value=mt,vt===11?(j.value=0,ge.value=mt+1):(j.value=vt+1,ge.value=mt);return}const He=U();ye.value=He.left.month,J.value=He.left.year,j.value=He.right.month,ge.value=He.right.year}const Bt=e.computed(()=>new Intl.DateTimeFormat(P.value,{day:"2-digit",month:"long",year:"numeric"})),pt=e.computed(()=>{if(!rt.value)return[];const A=($.availableDates||[]).filter(L=>L instanceof Date&&!Number.isNaN(L.getTime())).filter(L=>!re(L)&&M(L)).map(L=>new Date(L.getFullYear(),L.getMonth(),L.getDate()));A.sort((L,K)=>K.getTime()-L.getTime());const I=Xt.value;return A.map(L=>({date:L,ts:L.getTime(),label:Bt.value.format(L),selected:!!(I&&Zt(L,I))}))});function _t(){if(T.value){gl();return}Z.value=Ue.value?.closest(".dss-datepicker__input-wrap"),Q.value="left",T.value=!0,Ee(),e.nextTick(()=>{ke.value?.querySelector(".dss-datepicker__list-item--selected")?.scrollIntoView({block:"nearest",behavior:"auto"})})}function Tt(A){if(!(A instanceof Date))return;const I=new Date(A.getFullYear(),A.getMonth(),A.getDate());N("update:modelValue",I),gl()}function St(A="start"){if($.mode==="readonly")return;_e.value=A;const I=Xt.value,L=be.value;if(Je.value&&I)f.value=I.getMonth(),we.value=I.getFullYear();else if(Ge.value)if($.doubleCalendar)xt();else{const K=A==="start"&&L.start?L.start:L.end||L.start;K&&(f.value=K.getMonth(),we.value=K.getFullYear())}Z.value=Je.value?yt.value?.closest(".dss-datepicker__input-wrap"):st.value,me.value="days",Se.value=null,Q.value="left",T.value=!0,Ee()}function gl(){me.value="days",Se.value=null,ue.value=null,T.value=!1}function Jl(A,I){Se.value=A,me.value=I}function Il(){me.value="days",Se.value=null}function ml(A){const I=new Date,L=I.getFullYear(),K=I.getMonth(),He=I.getDate();let vt,mt;if(el.value){const it=E([...$.availableDates].filter(ot=>ot instanceof Date).map(ot=>new Date(ot.getFullYear(),ot.getMonth(),ot.getDate()))).sort((ot,yl)=>ot.getTime()-yl.getTime());if(it.length===0)return null;if(A==="all")vt=it[0],mt=it[it.length-1];else{const ot=parseInt(A.replace("last",""),10);if(ot<2||ot>5)return null;const yl=it.slice(-ot);if(yl.length===0)return null;vt=yl[0],mt=yl[yl.length-1]}}else{const it=new Date(L,K,He);switch(A){case"today":vt=it,mt=it;break;case"lastWeek":vt=new Date(L,K,He-6),mt=it;break;case"last15Days":vt=new Date(L,K,He-14),mt=it;break;case"last30Days":vt=new Date(L,K,He-29),mt=it;break;case"thisMonth":vt=new Date(L,K,1),mt=it;break;case"last3Months":vt=new Date(L,K-3,1),mt=new Date(L,K,0);break;case"last6Months":vt=new Date(L,K-6,1),mt=new Date(L,K,0);break;case"last12Months":vt=new Date(L,K-12,1),mt=new Date(L,K,0);break;case"lastYear":vt=new Date(L-1,0,1),mt=new Date(L-1,11,31);break;default:return null}}return{start:vt,end:mt}}function pl(A){const I=ml(A);return I?se(I.start,I.end):null}function an(A){return pl(A)!==null}function Wl(A){const I=pl(A);I&&(N("update:modelValue",I),xt())}function wl(A){Se.value==="left"?ye.value=A:Se.value==="right"?j.value=A:f.value=A,Il()}function Al(A){Se.value==="left"?J.value=A:Se.value==="right"?ge.value=A:we.value=A,Il()}function dn(){f.value===0?(f.value=11,we.value--):f.value--}function Dl(){f.value===11?(f.value=0,we.value++):f.value++}function Zn(){ye.value===0?(ye.value=11,J.value--):ye.value--}function ql(){ye.value===11?(ye.value=0,J.value++):ye.value++}function mn(){j.value===0?(j.value=11,ge.value--):j.value--}function wn(){j.value===11?(j.value=0,ge.value++):j.value++}function Zl(A){if(!Re(A))return;const I=new Date(A.getFullYear(),A.getMonth(),A.getDate());if(Je.value){N("update:modelValue",I),gl();return}const L=be.value;if(!L.start&&!L.end){N("update:modelValue",{start:I,end:null}),_e.value="end";return}if(L.start&&L.end){N("update:modelValue",{start:I,end:null}),_e.value="end";return}if(_e.value==="start"){let K=I,He=L.end;K&&He&&K>He&&([K,He]=[He,K]),N("update:modelValue",{start:K||He,end:He||K}),_e.value="end"}else{let K=L.start,He=I;K&&He&&He<K&&([K,He]=[He,K]),N("update:modelValue",{start:K||He,end:He||K}),_e.value="start"}}e.watch(be,()=>{$.doubleCalendar&&Ge.value&&T.value&&xt()},{deep:!0});let en=null,Ul=null,bl=null;function pn(){en&&(document.removeEventListener("keydown",en),en=null),Ul&&(window.removeEventListener("resize",Ul),Ul=null),bl&&(window.removeEventListener("scroll",bl,!0),bl=null)}return e.watch(me,A=>{A==="years"&&e.nextTick(()=>{qe.value?.querySelector(`[data-year="${ft.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(()=>[T.value,me.value,f.value,we.value,ye.value,J.value,j.value,ge.value,Se.value,$.doubleCalendar,$.quickSelect],()=>{Ee()}),e.watch(T,A=>{pn(),A&&(en=I=>{I.key==="Escape"&&(me.value==="years"||me.value==="months"?Il():gl())},Ul=()=>{je()},bl=()=>{je()},document.addEventListener("keydown",en),window.addEventListener("resize",Ul),window.addEventListener("scroll",bl,!0))}),e.onBeforeUnmount(()=>{ae!==null&&(window.cancelAnimationFrame(ae),ae=null),pn()}),(A,I)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":S.mode==="readonly"}])},[S.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",xs,[I[10]||(I[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:Et.value,readonly:"",disabled:"",tabindex:"-1"},null,8,Es)])):Je.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:I[0]||(I[0]=L=>St("start"))},[I[11]||(I[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:yt,type:"text",class:"dss-datepicker__input",placeholder:$.placeholder||e.unref(de)("datepicker.selectDate"),value:dt.value,readonly:"",disabled:S.mode==="readonly"},null,8,Ss)])):rt.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:_t},[I[13]||(I[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:Ue,type:"text",class:"dss-datepicker__input",placeholder:$.placeholder||e.unref(de)("datepicker.selectFromList"),value:dt.value,readonly:""},null,8,Vs),e.createElementVNode("span",{class:e.normalizeClass(["dss-datepicker__chevron",{"dss-datepicker__chevron--open":T.value}]),"aria-hidden":"true"},[...I[12]||(I[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)):Ge.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:st,onClick:I[1]||(I[1]=L=>St("start"))},[I[14]||(I[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:De,type:"text",class:"dss-datepicker__input",placeholder:$.placeholder||e.unref(de)("datepicker.selectRange"),value:et.value,readonly:""},null,8,Ns)],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(gl,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Te,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":S.doubleCalendar&&Ge.value&&me.value==="days","dss-datepicker__dropdown--quick-select":S.doubleCalendar&&Ge.value&&me.value==="days"&&S.quickSelect,"dss-datepicker__dropdown--list":rt.value}]),onClick:I[9]||(I[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(bt.value)},[rt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[pt.value.length?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"dss-datepicker__list",role:"listbox",ref_key:"listRef",ref:ke},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pt.value,L=>(e.openBlock(),e.createElementBlock("li",{key:L.ts,role:"option","aria-selected":L.selected,class:e.normalizeClass(["dss-datepicker__list-item",{"dss-datepicker__list-item--selected":L.selected}]),onClick:K=>Tt(L.date)},[e.createElementVNode("span",Ms,e.toDisplayString(L.label),1),L.selected?(e.openBlock(),e.createElementBlock("svg",_s,[...I[15]||(I[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,Bs))),128))],512)):(e.openBlock(),e.createElementBlock("div",$s,e.toDisplayString(e.unref(de)("datepicker.noAvailableDates")),1))],64)):me.value==="days"&&S.doubleCalendar&&Ge.value?(e.openBlock(),e.createElementBlock("div",Ls,[S.quickSelect?(e.openBlock(),e.createElementBlock("nav",Ts,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ie.value,L=>(e.openBlock(),e.createElementBlock("button",{key:L.id,type:"button",class:"dss-datepicker__quick-select-btn",disabled:!an(L.id),onClick:K=>Wl(L.id)},e.toDisplayString(e.unref(de)(L.labelKey)),9,As))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Ds,[e.createElementVNode("div",Hs,[e.createElementVNode("div",Rs,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.prevMonth"),onClick:Zn}," ‹ ",8,Fs),e.createElementVNode("div",Is,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:I[2]||(I[2]=L=>Jl("left","months"))},e.toDisplayString(Qe.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:I[3]||(I[3]=L=>Jl("left","years"))},e.toDisplayString(J.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.nextMonth"),onClick:ql}," › ",8,zs)]),e.createElementVNode("div",Ps,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he.value,L=>(e.openBlock(),e.createElementBlock("span",{key:L,class:"dss-datepicker__weekday"},e.toDisplayString(L),1))),128))]),e.createElementVNode("div",Os,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Lt.value,(L,K)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+K},[L?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",kt(L)]),disabled:!Re(L),onClick:He=>Zl(L),onMouseenter:He=>nt(L),onMouseleave:We},e.toDisplayString(L.getDate()),43,Ws)):(e.openBlock(),e.createElementBlock("span",qs))],64))),128))])]),e.createElementVNode("div",Zs,[e.createElementVNode("div",Us,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.prevMonth"),onClick:mn}," ‹ ",8,Xs),e.createElementVNode("div",Ys,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:I[4]||(I[4]=L=>Jl("right","months"))},e.toDisplayString(Ct.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:I[5]||(I[5]=L=>Jl("right","years"))},e.toDisplayString(ge.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.nextMonth"),onClick:wn}," › ",8,js)]),e.createElementVNode("div",Ks,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he.value,L=>(e.openBlock(),e.createElementBlock("span",{key:L,class:"dss-datepicker__weekday"},e.toDisplayString(L),1))),128))]),e.createElementVNode("div",Gs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($e.value,(L,K)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+K},[L?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",kt(L)]),disabled:!Re(L),onClick:He=>Zl(L),onMouseenter:He=>nt(L),onMouseleave:We},e.toDisplayString(L.getDate()),43,Qs)):(e.openBlock(),e.createElementBlock("span",Js))],64))),128))])])])])):me.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",er,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.prevMonth"),onClick:dn}," ‹ ",8,tr),e.createElementVNode("div",lr,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:I[6]||(I[6]=L=>me.value="months")},e.toDisplayString(qt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:I[7]||(I[7]=L=>me.value="years")},e.toDisplayString(we.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.nextMonth"),onClick:Dl}," › ",8,nr)]),e.createElementVNode("div",or,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he.value,L=>(e.openBlock(),e.createElementBlock("span",{key:L,class:"dss-datepicker__weekday"},e.toDisplayString(L),1))),128))]),e.createElementVNode("div",ar,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke.value,(L,K)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:K},[L?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",kt(L)]),disabled:!Re(L),onClick:He=>Zl(L),onMouseenter:He=>nt(L),onMouseleave:We},e.toDisplayString(L.getDate()),43,sr)):(e.openBlock(),e.createElementBlock("span",rr))],64))),128))])],64)):me.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",ir,[e.createElementVNode("div",cr,[e.createElementVNode("span",ur,e.toDisplayString(ht.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:I[8]||(I[8]=L=>me.value="years")},e.toDisplayString(ft.value),1)])]),e.createElementVNode("div",dr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Jt.value,(L,K)=>(e.openBlock(),e.createElementBlock("button",{key:K,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":K===tl.value}]),onClick:He=>wl(K)},e.toDisplayString(L),11,mr))),128))])],64)):me.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",pr,[e.createElementVNode("span",vr,e.toDisplayString(Yt.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:qe},[e.createElementVNode("div",fr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wt.value,L=>(e.openBlock(),e.createElementBlock("button",{key:L,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":L===ft.value,"dss-datepicker__year-cell--current":L===e.unref(Be)}]),"data-year":L,onClick:K=>Al(L)},e.toDisplayString(L),11,hr))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},gr={class:"dss-step-bar__layout"},yr={class:"dss-step-bar__header"},kr={class:"dss-step-bar__label"},Cr={key:0,class:"dss-step-bar__counter"},br={class:"dss-step-bar__track-wrapper"},wr=["aria-valuemax","aria-valuenow","aria-label"],xr=["onMouseenter"],Ra={__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:S=>["input","desc","asc"].includes(S)},orientation:{type:String,default:"horizontal",validator:S=>["horizontal","vertical"].includes(S)},barHeight:{type:[Number,String],default:200},labelPosition:{type:String,default:"up",validator:S=>["up","down","left","right"].includes(S)},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:()=>({})},disableTooltips:{type:Boolean,default:!1}},setup(S){const ee=S,$={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"}}},N=H=>H&&typeof H=="object"&&!Array.isArray(H),de=(H,Y)=>{const ne=Object.assign({},H);return!N(H)||!N(Y)||Object.keys(Y).forEach(he=>{if(N(Y[he])){he in H?ne[he]=de(H[he],Y[he]):Object.assign(ne,{[he]:Y[he]});return}Object.assign(ne,{[he]:Y[he]})}),ne},P=e.computed(()=>de($,ee.options)),T=e.computed(()=>Math.max(1,Number(ee.steps)||1)),me=e.computed(()=>Math.min(T.value,Math.max(0,Number(ee.currentStep)||0))),ut=e.computed(()=>Array.isArray(ee.segments)&&ee.segments.length>0),te=e.computed(()=>{if(!ut.value)return[];const H=ee.segments.map((Y,ne)=>{const he=Number(Y?.value);return{label:Y?.label||`Step ${ne+1}`,value:Number.isFinite(he)&&he>0?he:0,color:Y?.color||ee.activeColor,marker:Y?.marker}});return ee.segmentOrder==="desc"?[...H].sort((Y,ne)=>ne.value-Y.value):ee.segmentOrder==="asc"?[...H].sort((Y,ne)=>Y.value-ne.value):H}),f=e.computed(()=>ut.value?te.value.reduce((H,Y)=>H+Y.value,0):me.value),we=e.computed(()=>ut.value?Number.isFinite(Number(ee.totalValue))&&Number(ee.totalValue)>0?Number(ee.totalValue):Math.max(1,f.value):T.value),ye=e.computed(()=>ut.value&&Number.isFinite(Number(ee.totalValue))&&Number(ee.totalValue)>0),J=e.computed(()=>ye.value?Math.max(0,Number(ee.totalValue)-f.value):0),j=e.computed(()=>typeof ee.remainderLabel=="string"&&ee.remainderLabel.trim().length>0),ge=e.computed(()=>J.value>0),_e=e.computed(()=>te.value.reduce((H,Y)=>Math.max(H,Number(Y.value)||0),0)),ue=e.computed(()=>te.value.filter(H=>H.value>0).map(H=>`${H.label}: ${et(H.value)}`).join(" | ")),Se=e.computed(()=>ut.value?ye.value?te.value.filter(H=>H.value>0):te.value:[]),U=e.computed(()=>{if(!ee.counterAsPercentage)return`${f.value} / ${we.value}`;const H=Number(we.value);if(!Number.isFinite(H)||H<=0)return"0%";const Y=Math.round(Number(f.value)/H*100);return`${Math.min(Math.max(Y,0),100)}%`}),yt=e.computed(()=>f.value),st=e.computed(()=>we.value),De=e.reactive({visible:!1,x:0,y:0,content:""}),Ue=e.computed(()=>ee.orientation==="vertical"),Z=e.computed(()=>{const H=ee.barHeight;return H==null||H===""?"200px":typeof H=="number"?`${H}px`:String(H)}),Te=e.computed(()=>{const H=ee.sideLabelMaxWidth;if(!(H==null||H===""))return typeof H=="number"?`${H}px`:String(H)}),qe=e.computed(()=>{const H=ee.sideLabelWrapWidth;return H==null||H===""?"18ch":typeof H=="number"?`${H}ch`:String(H)}),ke=e.computed(()=>({left:`${De.x}px`,top:`${De.y}px`,transform:"translate(-50%, calc(-100% - 8px))"})),Be=H=>Ue.value?{flex:`${H} 0 0`,minHeight:H>0?"6px":"0",minWidth:"0"}:{flex:`${H} 0 0`,minWidth:H>0?"6px":"0"},Je=H=>{const Y=H?.parentElement;if(!Y)return{x:0,y:0};const ne=Y.getBoundingClientRect();return{x:ne.left+ne.width/2,y:ne.top}},Ge=H=>{const Y=H.getBoundingClientRect();return{x:Y.left+Y.width/2,y:Y.top}},rt=H=>{if(ye.value){const he=Math.max(0,Number(H.value)||0);return{...Be(he),backgroundColor:H.color}}const Y=f.value,ne=H.value>0?H.value:Y>0?1e-4:1;return{...Be(ne),backgroundColor:H.color}},Xt=H=>Number(H?.value||0)>0&&Number(H?.value||0)===_e.value,be=H=>{const Y=N(H?.marker)?H.marker:{},ne=H?.marker===!0||Y.enabled===!0,he=Xt(H)&&P.value.maxSegment?.marker?.enabled===!0;if(!(ne||he))return{enabled:!1};const Ke=Y.backgroundColor??(he?P.value.maxSegment?.marker?.backgroundColor:P.value.segmentMarker?.backgroundColor),Lt=Y.borderColor??(he?P.value.maxSegment?.marker?.borderColor:P.value.segmentMarker?.borderColor),$e=Y.color??(he?P.value.maxSegment?.marker?.color:P.value.segmentMarker?.color),Qe=Y.width??(he?P.value.maxSegment?.marker?.width:P.value.segmentMarker?.width),Ct=Y.height??(he?P.value.maxSegment?.marker?.height:P.value.segmentMarker?.height);return{enabled:!0,backgroundColor:Ke,borderColor:Lt,color:$e,width:Qe,height:Ct,icon:Y.icon??null,...Y}},Wt=H=>{const Y=be(H);return{backgroundColor:Y.backgroundColor??void 0,borderColor:Y.borderColor??void 0,color:Y.color??void 0}},dt=H=>{const Y=be(H);return{width:Y.width??void 0,height:Y.height??void 0}},et=H=>`${H}${ee.valueLabel}`,Et=e.computed(()=>({...Be(J.value),backgroundColor:ee.inactiveColor})),tl=(H,Y)=>{ee.disableTooltips||ht(H,Y)},ft=H=>{ee.disableTooltips||Jt(H)},qt=()=>{ee.disableTooltips||wt()},ht=(H,Y)=>{if(!H||!Y?.currentTarget)return;const ne=Y.currentTarget;if(ee.remainderTooltipSummary){const Xe=Je(ne);De.x=Xe.x,De.y=Xe.y,De.content=ue.value,De.visible=!!De.content;return}const he=Ge(ne);De.x=he.x,De.y=he.y,De.content=`${H.label}: ${et(H.value)}`,De.visible=!0},Jt=H=>{if(!J.value||!H?.currentTarget)return;const Y=H.currentTarget;if(ee.remainderTooltipSummary){const he=Je(Y);De.x=he.x,De.y=he.y,De.content=ue.value,De.visible=!!De.content;return}const ne=Ge(Y);De.x=ne.x,De.y=ne.y,j.value&&(De.content=`${ee.remainderLabel}: ${et(J.value)}`,De.visible=!0)},wt=()=>{De.visible=!1},Yt=()=>{De.visible&&wt()};e.onMounted(()=>{window.addEventListener("scroll",Yt,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("scroll",Yt,!0)});const fe=e.computed(()=>({"--dss-step-bar-label-color":ee.labelColor??void 0,"--dss-step-bar-counter-color":ee.counterColor??void 0,"--dss-step-bar-active-color":ee.activeColor,"--dss-step-bar-inactive-color":ee.inactiveColor,"--dss-step-bar-bar-height":Ue.value?Z.value:void 0,"--dss-step-bar-side-label-max-width":Te.value,"--dss-step-bar-side-label-wrap-width":qe.value}));return(H,Y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-step-bar",[`dss-step-bar--${S.orientation}`,`dss-step-bar--label-${S.labelPosition}`]]),style:e.normalizeStyle(fe.value)},[e.createElementVNode("div",gr,[e.createElementVNode("div",yr,[e.createElementVNode("span",kr,[e.renderSlot(H.$slots,"label",{label:S.label},()=>[e.createTextVNode(e.toDisplayString(S.label),1)])]),S.showCounter?(e.openBlock(),e.createElementBlock("span",Cr,[e.renderSlot(H.$slots,"counter",{counterDisplay:U.value},()=>[e.createTextVNode(e.toDisplayString(U.value),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",br,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":st.value,"aria-valuenow":yt.value,"aria-label":S.label},[ut.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Se.value,(ne,he)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${he}-${ne.label}`,class:e.normalizeClass(["dss-step-bar__segment dss-step-bar__segment--interactive",{"dss-step-bar__segment--max":Xt(ne),"dss-step-bar__segment--marker-enabled":be(ne).enabled}]),style:e.normalizeStyle(rt(ne)),onMouseenter:Xe=>tl(ne,Xe),onMouseleave:qt},[be(ne).enabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment-marker",style:e.normalizeStyle(Wt(ne)),"aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-step-bar__segment-marker-icon",style:e.normalizeStyle(dt(ne))},[e.renderSlot(H.$slots,"segment-marker-icon",{segment:ne,index:he,marker:be(ne)},()=>[e.renderSlot(H.$slots,"max-segment-icon",{segment:ne,index:he,marker:be(ne)},()=>[e.createTextVNode(e.toDisplayString(be(ne).icon||""),1)])])],4)],4)):e.createCommentVNode("",!0)],46,xr))),128)),ge.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(Et.value),onMouseenter:Y[0]||(Y[0]=ne=>ft(ne)),onMouseleave:qt},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(T.value,ne=>(e.openBlock(),e.createElementBlock("div",{key:ne,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":ne<=me.value}])},null,2))),128))],8,wr)])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[!S.disableTooltips&&De.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__tooltip dss-step-bar__tooltip--teleported",style:e.normalizeStyle(ke.value)},e.toDisplayString(De.content),5)):e.createCommentVNode("",!0)]))],6))}},Er=["data-chart-type"],Sr={class:"dss-chart-header-titles"},Vr={key:0,class:"dss-chart-title"},Nr={key:1,class:"dss-chart-subtitle"},Br=["onClick","onMouseenter"],Mr={class:"dss-legend-text"},_r=["onClick","onMouseenter"],$r={class:"dss-legend-text"},Lr=["title"],Tr=["src"],Ar={class:"dss-chart-area-wrapper"},Dr={key:0,class:"dss-chart-z-axis-label"},Hr=["width","height","data-smooth","data-animated"],Rr=["id"],Fr=["y","width","height"],Ir=["id"],zr=["d"],Pr=["id"],Or=["d"],Wr={key:0},qr=["clip-path"],Zr=["x1","x2","y1","y2"],Ur=["clip-path"],Xr=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray","opacity"],Yr={class:"dss-axes"},jr=["x1","x2","y1","y2"],Kr=["x1","x2","y1","y2"],Gr=["x1","x2","y1","y2"],Qr={class:"dss-axis-labels"},Jr=["x","y"],ei=["x","y"],ti=["x","y"],li=["x","y"],ni=["y","transform"],oi=["x","y","transform"],ai={key:2,class:"dss-flag-markers"},si=["clip-path"],ri=["x1","x2","y1","y2","onMouseover"],ii=["x1","x2","y1","y2","onMouseover"],ci=["x1","x2","y1","y2","onMouseover"],ui=["cx","cy","onMouseover"],di=["cx","cy","fill","onMouseover"],mi=["x","y"],pi=["clip-path"],vi={key:0},fi=["d","onMouseover"],hi=["x","y","width","height","fill","onMouseover"],gi={class:"dss-line-chart"},yi=["d","stroke","stroke-width","stroke-dasharray"],ki=["d","stroke","stroke-width","opacity"],Ci=["cx","cy","r","fill","onMouseover"],bi={key:1},wi=["d","stroke","stroke-width","stroke-dasharray"],xi=["d","stroke","stroke-width","stroke-dasharray"],Ei=["d","stroke","stroke-width","opacity"],Si=["cx","cy","r","fill","onMouseover"],Vi={key:2},Ni=["id"],Bi=["x","y","width","height"],Mi=["d","fill","fill-opacity","mask"],_i=["d","stroke","stroke-width"],$i=["d","fill","onMouseover"],Li=["x","y","width","height","onMouseover"],Ti=["clip-path"],Ai=["x1","x2","y1","y2","stroke"],Di=["cx","cy","r","fill"],Hi={key:1,class:"dss-bubble-chart"},Ri={key:0,class:"dss-bubble-group"},Fi=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],Ii=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],zi=["transform"],Pi=["cx","cy","r"],Oi=["data-chart-type","clip-path"],Wi=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],qi={key:1,class:"dss-radial-segment-data-labels"},Zi=["x","y"],Ui=["x","y","font-size","fill"],Xi=["x1","y1","x2","y2","stroke"],Yi=["x1","y1","x2","y2","stroke"],ji=["x","y","text-anchor","font-size"],Ki=["transform"],Gi={key:0,class:"dss-spider-grid"},Qi=["cx","cy","r"],Ji={class:"dss-spider-grid-labels"},ec=["x","y"],tc=["x","y"],lc=["x1","x2","y1","y2"],nc={class:"dss-spider-labels"},oc=["x","y","text-anchor","dominant-baseline"],ac=["points","fill","fill-opacity","stroke","stroke-width","stroke-dasharray"],sc=["cx","cy","r","fill","stroke","stroke-width","onMouseover"],rc={class:"dss-chart-logos"},ic=["cx","cy","r","fill"],cc=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],uc={key:0,class:"dss-stepbar-grid-lines","aria-hidden":"true"},dc=["onClick","onMouseenter"],mc=["src"],pc={class:"dss-marker-tooltip-category"},vc={key:0,class:"dss-marker-tooltip-description"},fc={key:0,class:"dss-tooltip-section dss-spider-tooltip-section"},hc={class:"dss-tooltip-title dss-spider-tooltip-area-title"},gc={class:"dss-tooltip-series-name"},yc={class:"dss-tooltip-series-value"},kc={key:1,class:"dss-tooltip-section"},Cc={key:0,class:"dss-tooltip-title"},bc={class:"dss-bubble-tooltip-data"},wc={key:2,class:"dss-tooltip-section"},xc={class:"dss-tooltip-title"},Ec={class:"dss-tooltip-value"},Sc={key:0,class:"dss-tooltip-section"},Vc={class:"dss-tooltip-section-title"},Nc={class:"dss-tooltip-group-header"},Bc={class:"dss-tooltip-item-content"},Mc={class:"dss-tooltip-item-text"},_c={key:1,class:"dss-tooltip-section"},$c={class:"dss-tooltip-section-title"},Lc={class:"dss-tooltip-item-content"},Tc={class:"dss-tooltip-item-title"},Ac={key:0,class:"dss-tooltip-item-description"},Dc={class:"dss-tooltip-section"},Hc={class:"dss-tooltip-title"},Rc={key:0,class:"dss-bubble-tooltip-data"},Fc={class:"dss-tooltip-series-name"},Ic={class:"dss-tooltip-series-value"},zc={key:0,class:"dss-tooltip-section"},Pc={class:"dss-tooltip-section-title"},Oc={class:"dss-tooltip-group-header"},Wc={class:"dss-tooltip-item-content"},qc={class:"dss-tooltip-item-text"},Zc={key:1,class:"dss-tooltip-section"},Uc={class:"dss-tooltip-section-title"},Xc={class:"dss-tooltip-item-content"},Yc={class:"dss-tooltip-item-title"},jc={key:0,class:"dss-tooltip-item-description"},Kc=["onClick","onMouseenter"],Gc={class:"dss-legend-text"},Qc={key:1,class:"dss-context-menu-separator"},Jc={key:0,class:"dss-context-menu-separator"},eu={key:0,class:"dss-context-menu-separator"},tu=["onClick"],lu=["innerHTML"],nu={key:0,class:"dss-context-menu-icon"},ou={class:"dss-marker-modal-header"},au={class:"dss-marker-modal-body"},su={class:"dss-form-group"},ru={class:"dss-form-group"},iu={for:"dss-marker-description"},cu={key:0,class:"dss-form-text-display"},uu=["placeholder"],du={class:"dss-marker-modal-footer"},mu={class:"modal-footer-left"},pu={class:"dss-modal-footer-right"},vu=["disabled"],fu={name:"DSSChart"},hu=Object.assign(fu,{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:S=>typeof S=="object"&&S!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(S,{emit:ee}){const{t:$,locale:N}=fo.useI18n(),de=ee,P=e.ref(null),T=e.ref(null);let me=null;const ut=()=>{me&&(me(),me=null);const t=T.value;if(!t||be.value!=="stepbar")return;const o=l=>$o(l);t.addEventListener("wheel",o,{passive:!1}),me=()=>t.removeEventListener("wheel",o)},te=e.ref(null),f=e.ref(null),we=e.ref(0),ye=e.ref(0);let J=null,j=null;const ge=20,_e=e.computed(()=>{if(ye.value,we.value,!P.value||!te.value)return 0;try{const t=P.value.getBoundingClientRect();return te.value.getBoundingClientRect().top-t.top}catch{return 0}}),ue=e.computed(()=>`chart-clip-${U.chartId}`),Se=e.computed(()=>`url(#${ue.value})`),U=S,yt={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:14,columnWidth:72,trackWidth:14,minBarWidth:12,maxBarWidth:120,barRadius:6,columnGap:16,labelReserve:48,trackAreaHeight:220,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 st(t,o){const l=Object.assign({},t);return Ue(t)&&Ue(o)&&Object.keys(o).forEach(r=>{Ue(o[r])?r in t?l[r]=st(t[r],o[r]):Object.assign(l,{[r]:o[r]}):Object.assign(l,{[r]:o[r]})}),l}const De=()=>{let t=20,o=0,l=0;if(dt.value&&(t+=30),et.value&&(t+=25),he.value&&U.series.length>0){const r=U.series.filter((m,v)=>!O.value.has(v)).length;if(Xe.value==="top"||Xe.value==="bottom"){if(Ke.value==="horizontal"){const v=Math.floor(Be.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 Ue(t){return t&&typeof t=="object"&&!Array.isArray(t)}const Z=e.computed(()=>st(yt,U.options)),Te=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.width==="auto"}),qe=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.height==="auto"}),ke=e.computed(()=>{const t=Z.value;return Qt.value&&t?.chart?.height==="fit"}),Be=e.computed(()=>{const t=Z.value;return Te.value?we.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),Je=e.ref(ge),Ge=e.computed(()=>{if(qe.value){const t=Ge.value;return t??Math.max(0,(ye.value||400)-Je.value*5)}}),rt=e.computed(()=>{const t=Z.value;if(be.value==="mini-radial")return Be.value;if(ke.value)return an.value;if(qe.value){const o=Ge.value;return o??Math.max(0,(ye.value||400)-Je.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),Xt=e.computed(()=>{if(qe.value&&be.value==="semi-radial"&&Ge.value!=null)return Je.value+rt.value+"px";if(qe.value)return"100%";if(El.value)return Je.value+rt.value+"px";if(he.value&&Xe.value==="bottom"){const t=De();return rt.value+(t.legendHeight||35)+"px"}return rt.value+(he.value?20:0)+"px"}),be=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),Wt=e.computed(()=>{const t=U.series.map(o=>o.type||be.value);return new Set(t).size>1}),dt=e.computed(()=>{const t=Z.value;return t&&t.title&&t.title.text?t.title.text:""}),et=e.computed(()=>{const t=Z.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),Et=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:""}),tl=e.computed(()=>{const t=Z.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),ft=e.computed(()=>{const o=Z.value?.yAxis?.title?.text;return o==null||String(o).trim()===""?"":String(o)}),qt=e.computed(()=>{const t=Z.value;return t&&t.yAxis&&t.yAxis.secondary&&typeof t.yAxis.secondary=="object"?t.yAxis.secondary:null}),ht=e.computed(()=>{const t=qt.value;return t&&t.title&&t.title.text?t.title.text:""}),Jt=e.computed(()=>{const t=Z.value;if(!t||!t.yAxis)return _l;const o=t.yAxis.min;return typeof o=="number"||o===_l?o:_l}),wt=e.computed(()=>{const t=Z.value;if(!t||!t.yAxis)return _l;const o=t.yAxis.max;return typeof o=="number"||o===_l?o:_l}),Yt=e.computed(()=>{const t=qt.value;if(!t)return _l;const o=t.min;return typeof o=="number"||o===_l?o:_l}),fe=e.computed(()=>{const t=qt.value;if(!t)return _l;const o=t.max;return typeof o=="number"||o===_l?o:_l}),H=e.computed(()=>{const t=Z.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),Y=e.computed(()=>{const t=Z.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),ne=e.computed(()=>{const t=Z.value;return t&&t.grid&&t.grid.show!==!1}),he=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.show!==!1}),Xe=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Ke=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Lt=e.computed(()=>{const t=Z.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),$e=e.computed(()=>{const t=Z.value;if(!t)return!1;if(Qt.value){if(!t.crosshair)return!0;const l=t.crosshair.show;return l!==!1&&l!=="false"}if(!t.crosshair)return!1;const o=t.crosshair.show;return o===!0||o==="true"}),Qe=e.computed(()=>{const t=Z.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Ct=e.computed(()=>{const t=Z.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),el=e.computed(()=>{const t=Z.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),ie=e.computed(()=>{const t=Z.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),X=e.computed(()=>{const t=Z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),Q=e.computed(()=>{if(!El.value)return 0;const t=Z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),ae=e.computed(()=>{const t=Z.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),Ee=e.computed(()=>{const{maxX:t}=Nt.value;return t===0}),je=(t,o)=>Ee.value&&o===0?5:o,bt=t=>{const o=Number(t);return!Number.isFinite(o)||o<=0?0:o},Zt=e.computed(()=>{const t=Z.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),lt=e.computed(()=>{const t=Z.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),sl=e.computed(()=>{const t=Z.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),M=e.computed(()=>{const t=Z.value;return lt.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),w=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"]}),E=e.computed(()=>Z.value?.stepbar||{}),se=e.computed(()=>{const t=E.value?.segmentOrder;return["asc","desc","input"].includes(t)?t:"input"}),re=e.computed(()=>{const t=Number(E.value?.totalValue);return Number.isFinite(t)&&t>0?t:100}),Re=e.computed(()=>E.value?.showRemainder!==!1),kt=e.computed(()=>E.value?.remainderLabel||"Remaining"),nt=e.computed(()=>E.value?.remainderColor||"#E5E7EB"),We=e.computed(()=>{const t=Number(E.value?.barWidth);return Number.isFinite(t)&&t>0?t:42}),xt=e.computed(()=>{const t=Number(E.value?.minBarWidth);return Number.isFinite(t)&&t>0?t:12}),Bt=e.computed(()=>{const t=Number(E.value?.maxBarWidth);return Number.isFinite(t)&&t>0?t:58});e.computed(()=>{const t=Number(E.value?.barRadius);return Number.isFinite(t)&&t>=0?t:6});const pt=e.computed(()=>E.value?.axisBars||{}),_t=e.computed(()=>pt.value?.show!==!1);e.computed(()=>pt.value?.showVertical===!0);const Tt=e.computed(()=>pt.value?.color||"#d6d6d6"),St=e.computed(()=>{const t=Number(pt.value?.opacity);return Number.isFinite(t)?Math.min(Math.max(t,0),1):.75}),gl=e.computed(()=>{const t=Number(pt.value?.width);return Number.isFinite(t)&&t>0?t:1}),Jl=e.computed(()=>pt.value?.dashArray||"3,4"),Il=e.computed(()=>{const t=Number(E.value?.columnGap);return Number.isFinite(t)&&t>=0?t:16}),ml=e.computed(()=>{const t=Number(E.value?.labelReserve);return Number.isFinite(t)&&t>0?t:48}),pl=e.computed(()=>{const t=Number(E.value?.trackAreaHeight);return Number.isFinite(t)&&t>0?t:220}),an=e.computed(()=>{let t=0;dt.value&&(t+=15),et.value&&(t+=10);const o=50+t,l=ml.value+8;return o+pl.value+l}),Wl=e.computed(()=>Math.max(F.value.height,0)),wl=e.computed(()=>{const t=Number(E.value?.columnWidth);if(Number.isFinite(t)&&t>0)return t;const o=We.value,l=xt.value,r=Bt.value;return Math.max(l,Math.min(r,o))}),Al=e.computed(()=>{const t=Number(E.value?.trackWidth);if(Number.isFinite(t)&&t>0)return Math.min(t,wl.value);const o=Number(E.value?.barWidth);return Number.isFinite(Number(E.value?.columnWidth))&&Number(E.value?.columnWidth)>0&&Number.isFinite(o)&&o>0?Math.min(o,wl.value):Math.min(wl.value,Math.max(10,Math.round(wl.value*.32)))}),dn=e.computed(()=>({width:`${wl.value}px`,flex:`0 0 ${wl.value}px`,"--dss-step-bar-track-thickness":`${Al.value}px`,"--dss-stepbar-label-height":`${ml.value}px`})),Dl=e.computed(()=>{const t=ql.value.length;return t?t*wl.value+Math.max(0,t-1)*Il.value:0}),Zn=e.computed(()=>({maxSegment:{marker:{enabled:!1}}})),ql=e.computed(()=>Qt.value?$n.value.map(t=>({key:t.key,label:t.axisLabel||t.label,totalValue:t.totalValue,segments:t.segments.filter(o=>!o.isRemainder).map(o=>({label:o.label,value:o.value,color:o.color,marker:o.marker}))})):[]),mn=e.computed(()=>{if(!Qt.value)return[];const{minY:t,maxY:o}=Nt.value,l=5,r=[];for(let m=0;m<=l;m++){const v=t+(o-t)*(m/l);r.push({top:On(v)-F.value.top,value:v})}return r}),wn=e.computed(()=>({top:`${F.value.top}px`,left:`${F.value.left}px`,width:`${F.value.width}px`,height:`${Wl.value+ml.value}px`})),Zl=e.computed(()=>({width:`${Dl.value}px`,minHeight:`${Wl.value+ml.value}px`})),en=e.computed(()=>Qt.value&&$e.value&&Ae.value.show&&!oe.value.isZooming),Ul=e.computed(()=>{const t=wl.value+Il.value;return{left:`${Ae.value.categoryIndex*t+wl.value/2}px`,height:`${Wl.value}px`,borderColor:Qe.value}}),bl=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.enabled!==!1}),pn=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),A=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),I=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),L=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),K=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),He=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.onDataChange!==!1}),vt=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),mt=e.computed(()=>{const t=Z.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),it=e.computed(()=>Z.value?.spider?.gridSteps||5),ot=e.computed(()=>{const t=[],o=it.value;for(let l=1;l<=o;l++)t.push(at.value/o*l);return t}),yl=t=>{const o=xl.value;if(o&&Array.isArray(o)&&o[t]!==void 0)return o[t].toString();const l=ot.value[t];return Math.round(l/at.value*100)+"%"},xl=e.computed(()=>Z.value?.spider?.gridLabels||null),jt=e.computed(()=>{const t=Z.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),Dt=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}),Kt=e.computed(()=>{const t=Z.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Sl=e.computed(()=>{const t=Z.value;return t&&t.markers&&t.markers.icon?t.markers.icon:lo.value}),tn=e.computed(()=>{const t=Z.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Ft=e.computed(()=>{const t=Z.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),Vt=e.computed(()=>{const o=Z.value?.valueFormat?.extension;return typeof o=="string"?o:""}),$l=t=>{const o=Vt.value;if(t==null)return"";const l=String(t);return o?l+o:l},An=e.computed(()=>!oe.value.isZooming);e.computed(()=>fl.value.map(t=>{if(t.categoryIndex!==void 0&&(Ml.value||It.value)){const o=kl(t.categoryIndex),l=_e.value+F.value.bottom-Ft.value/2;return{...t,x:o,y:l}}return t}));function Hl(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("-"),W=Number(b?.length===2?`20${b}`:b);l=new Date(W,Number(C)-1,Number(v))}else return 0;let r=0,m=1/0;return o.forEach((v,C)=>{const[b,W,_]=v.split("-"),R=Number(_?.length===2?`20${_}`:_),B=new Date(R,Number(W)-1,Number(b)),G=Math.abs(B-l);G<m&&(m=G,r=C)}),r}const xn=e.computed(()=>{const t=U.markers.map(l=>{const r=Hl(l.marker_date,U.categories),m=kl(r),v=_e.value+F.value.bottom-Ft.value/2;return{...l,x:m,y:v,categoryIndex:r,source:"props"}}),o=fl.value.map(l=>{if(l.categoryIndex!==void 0&&(Ml.value||It.value)){const r=kl(l.categoryIndex),m=_e.value+F.value.bottom-Ft.value/2;return{...l,x:r,y:m,source:"internal"}}return{...l,source:"internal"}});return[...t,...o]}),ln=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.enabled===!0}),En=e.computed(()=>{const t=Z.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),Dn=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),zl=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),ll=e.computed(()=>{const t={left:F.value.left,top:F.value.top,width:F.value.width,height:F.value.height};let o,l;const r=String(Dn.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}}),to=e.computed(()=>{const{width:t,height:o}=ll.value,l=zl.value;let r,m;const v=F.value.left,C=F.value.right,b=F.value.top,W=F.value.bottom,_=F.value.width,R=F.value.height;switch(l){case"center":r=v+(_-t)/2,m=b+(R-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=W-o-5;break;case"bottom-right":default:r=C-t-15,m=W-o-5;break}return{backgroundPositionX:r+"px",backgroundPositionY:m+"px",backgroundSize:`${t}px ${o}px`}}),Xl=t=>!U.flags||!U.flags.length?[]:U.flags.filter(o=>o.categoryIndex===t),At=t=>{const o=Xl(t),l=ea(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"}))}},lo=e.computed(()=>{const t=U.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"/>
@@ -41,8 +41,8 @@
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)}`}),Ll=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),Sn=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 Hn=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),vn=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),Vl=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),Un=e.computed(()=>{const o=Z.value?.radialBar?.dataLabels;return o&&(o.show===!0||o.enabled===!0)}),sn=e.computed(()=>{const o=Z.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof o=="number"&&o>=0?o:20}),Rn=e.computed(()=>{const o=Z.value?.radialBar?.dataCenter;return Pn.value?!0:Cn.value&&o&&(o.show===!0||o.enabled===!0)}),fn=e.computed(()=>{if(!Rn.value||!Ln.value.length)return"";if(Pn.value){const r=Ln.value[1]??Ln.value[0];return $l(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(l)}),Xn=e.computed(()=>{const o=Z.value?.radialBar?.dataCenter?.fontSize;return typeof o=="number"&&o>0?o:24}),Nl=e.computed(()=>({x:Pt.value,y:Pn.value?$t.value:$t.value-Xn.value/2})),rn=e.computed(()=>{const o=Z.value?.radialBar?.dataCenter?.color;return typeof o=="string"&&o?o:"#333"}),Yl=e.computed(()=>{if(!Un.value||!El.value||!Ln.value.length)return[];const t=sn.value*Math.PI/180,o=(hl.value+at.value)/2;return Ln.value.map(l=>{const m=l.endAngle-l.startAngle>=t&&!l.isHidden,v=Pt.value+Math.cos(l.midAngle)*o,C=$t.value+Math.sin(l.midAngle)*o;return{value:$l(l.value),x:v,y:C,show:m,color:l.color,contrastColor:Ya(l.color)}})}),vl=e.computed(()=>{if(!U.flags||!U.flags.length)return[];const t=new Map;return U.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=kl(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
- `)}})}),Rl=e.ref({show:!1,x:0,y:0,content:"",count:0}),y=e.computed(()=>Z.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),g=e.computed(()=>{const t=Z.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),x=e.computed(()=>Z.value?.bubbles?.tooltip?.formatters||{}),O=e.ref(new Set),q=e.ref(null),tt=e.ref(!1),Fe=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),Qt=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),Ae=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),ct=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),oe=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),fl=e.ref([]),Ze=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 tn.value&&t.push(...Object.keys(tn.value)),t}),e.computed(()=>{if(!U.categories||U.categories.length===0){const{maxX:t}=Nt.value;return Array.from({length:t+1},(o,l)=>$("chart.fallback.item",{number:l+1}))}return U.categories});const _o=e.computed(()=>{if(!U.categories||U.categories.length===0)return null;const t=U.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)}),jo=e.computed(()=>{if(!U.categories||U.categories.length===0)return null;const t=U.categories[U.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)}),Yn=e.computed(()=>Ze.value.editingMarkerId!==null),Fn=e.computed(()=>Ze.value.readonly),jn=t=>{O.value.has(t)||(pa.value=!0,q.value=t)},no=()=>{pa.value=!1,q.value=null},Ko=t=>{if(No.value||Po.value){Ae.value.show=!1;return}const l=t.currentTarget.getBoundingClientRect(),r=t.clientX-l.left,m=t.clientY-l.top,v=It.value?r>=F.value.left-50&&r<=F.value.right+50&&m>=F.value.top-50&&m<=F.value.bottom+100:zt.value?r>=F.value.left&&r<=F.value.right&&m>=F.value.top&&m<=F.value.bottom+ml.value:r>=F.value.left&&r<=F.value.right&&m>=F.value.top&&m<=F.value.bottom;if(tt.value=v,It.value){if(!$e.value||!v||oe.value.isDragging||oe.value.isZooming){Ae.value.show=!1;return}if(Io.value.find(ve=>!ve||ve.isHidden?!1:Math.sqrt(Math.pow(ve.x-r,2)+Math.pow(ve.y-m,2))<=ve.radius+3))Ae.value.show=!1;else{const ve=Io.value.filter(Ce=>!Ce||Ce.isHidden?!1:Math.sqrt(Math.pow(Ce.x-r,2)+Math.pow(Ce.y-m,2))<=250);if(ve.length>0){let Ce=ve[0],xe=Math.sqrt(Math.pow(Ce.x-r,2)+Math.pow(Ce.y-m,2));ve.forEach(ze=>{const Le=Math.sqrt(Math.pow(ze.x-r,2)+Math.pow(ze.y-m,2));Le<xe&&(xe=Le,Ce=ze)});const pe=30,Ye=Io.value.filter(ze=>!ze||ze.isHidden?!1:Math.abs(ze.x-Ce.x)<=pe).sort((ze,Le)=>ze.y-Le.y);Ae.value={show:!0,x:Ce.x,categoryIndex:Math.round(Ce.originalX),data:(()=>{const ze=y.value,Le=g.value,Ne=[];return Ye.forEach(Ie=>{ze.forEach(Mt=>{const Wt=Le[Mt]||Mt,Gl=Na(Mt,Ie);Gl&&Ne.push({seriesName:Ie.seriesName,label:Ie.label,value:`${Wt}: ${Gl}`,color:Ie.color,y:Ie.y})})}),Ne})()}}else Ae.value.show=!1}return}if(zt.value){if(!$e.value||!v||oe.value.isDragging||oe.value.isZooming){Ae.value.show=!1;return}const Oe=T.value;if(!Oe){Ae.value.show=!1;return}const ve=Oe.getBoundingClientRect(),Ce=t.clientX-ve.left+Oe.scrollLeft,xe=wl.value+Il.value,pe=Math.floor(Ce/xe);if(pe<0||pe>=ql.value.length){Ae.value.show=!1;return}const Ye=$n.value[pe];if(!Ye){Ae.value.show=!1;return}const ze=pe*xe+wl.value/2,Le=ve.left+ze-Oe.scrollLeft-l.left;Ae.value={show:!0,x:Le,categoryIndex:pe,data:Ye.segments.filter(Ne=>!Ne.isRemainder).map(Ne=>({seriesName:Ne.label,value:Ne.value,color:Ne.color,y:null}))};return}if(oe.value.isDragging&&oe.value.scale>1&&Ml.value&&Ct.value&&!zt.value){Ae.value.show=!1;const Oe=t.clientX-oe.value.lastMouseX,{minX:ve,maxX:Ce}=Nt.value,xe=Ce-ve||1,Ye=Oe*.8;oe.value.offsetX+=Ye;const ze=xe/oe.value.scale,Le=xe-ze,Ne=0,Ie=-Le/xe*F.value.width,Mt=Ne;oe.value.offsetX=Math.max(Ie,Math.min(Mt,oe.value.offsetX)),oe.value.lastMouseX=t.clientX,oe.value.lastMouseY=t.clientY;return}if(!$e.value||!Ml.value||zt.value||oe.value.isDragging||oe.value.isZooming||!v){Ae.value.show=!1;return}const{minX:C,maxX:b}=Nt.value,W=b-C||1,_=W/oe.value.scale,R=C-oe.value.offsetX/F.value.width*W,B=(r-F.value.left)/F.value.width,G=R+B*_,Ve=Math.round(G);if(Ve>=0&&Ve<=b){const Oe=kl(Ve),ve=Ot.value.map((Ce,xe)=>{const pe=U.series.findIndex(ze=>ze===Ce),Ye=Ce.data[Ve];return{seriesName:Ce.name,value:Ye!==void 0?Ye:null,color:al(pe),y:Ye!==void 0?un(Ce,Ye):null}}).filter(Ce=>Ce.value!==null);Ae.value={show:!0,x:Oe,categoryIndex:Ve,data:ve}}},Go=()=>{Ae.value.show&&(Ae.value.show=!1)},$o=t=>{const o=T.value;if(!o||o.scrollWidth<=o.clientWidth)return;t.preventDefault(),t.stopPropagation();const l=Math.abs(t.deltaX)>Math.abs(t.deltaY)?t.deltaX:t.deltaY;o.scrollLeft+=l};e.watch([T,zt,()=>ql.value.length],()=>{e.nextTick(ut)});const Lo=()=>ql.value[Ae.value.categoryIndex]?.label||$("chart.fallback.item",{number:Ae.value.categoryIndex+1}),To=()=>{Ae.value.show=!1,tt.value=!1,Po.value=!1,No.value||(Rl.value.show=!1),oe.value.isDragging&&(oe.value.isDragging=!1),oe.value.zoomTimeout&&(clearTimeout(oe.value.zoomTimeout),oe.value.zoomTimeout=null),oe.value.isZooming=!1,setTimeout(()=>{q.value=null,Fe.value.show=!1},150)},Qo=t=>{if(t.preventDefault(),t.stopPropagation(),!Kt.value)return;const o=t.currentTarget.getBoundingClientRect(),l=t.clientX-o.left,r=t.clientY-o.top;if(El.value){ct.value.show=!1,e.nextTick(()=>{ct.value.show=!0,ct.value.x=t.clientX,ct.value.y=t.clientY,ct.value.categoryIndex=null});return}const m=Math.max(0,F.value.left-20),v=F.value.right,C=F.value.top,b=F.value.bottom+80;l>=m&&l<=v&&r>=C&&r<=b&&(ct.value.show=!1,e.nextTick(()=>{ct.value.show=!0,ct.value.x=t.clientX,ct.value.y=t.clientY,ct.value.categoryIndex=null;const W=Math.max(F.value.left,Math.min(l,F.value.right))-F.value.left,R=F.value.width/sa.value.length,B=Math.floor(W/R);B>=0&&B<sa.value.length&&(ct.value.categoryIndex=B)}))},hn=t=>{if(!(t&&t.button===2)){if(ct.value.show&&t&&t.type==="click"){const o=document.querySelector(".dss-context-menu");if(o&&o.contains(t.target))return}ct.value.show=!1}},Jo=t=>{if(typeof t.template=="function"){const o={series:U.series,categories:U.categories,markers:fl.value},l={chartX:ct.value.chartX,chartY:ct.value.chartY,dataX:ct.value.mouseDataX,dataY:ct.value.mouseDataY,categoryIndex:ct.value.categoryIndex};return t.template(o,l)}return t.template||t.label||""},Ao=t=>{const o=["dss-context-menu-item"];return t.cssClass&&o.push(t.cssClass),o},In=t=>t.style||{},oo=t=>t.type&&tn.value[t.type]?tn.value[t.type]:t.customIcon?t.customIcon:Sl.value,ao=t=>t==null?"":U.categories&&U.categories[t]?U.categories[t]:"",ea=t=>fl.value.length?fl.value.filter(o=>o.categoryIndex===t):[],ta=t=>{if(!Ml.value&&!It.value)return{x:0,y:0};const o=kl(t),l=_e.value+F.value.bottom-Ft.value/2;return{x:o,y:l}},ko=()=>{fl.value.forEach(t=>{if(t.categoryIndex!==void 0&&(Ml.value||It.value)){const o=ta(t.categoryIndex);t.x=o.x,t.y=o.y}})},gn=()=>{if(Ze.value.description&&Ze.value.description.length&&Ze.value.date){if(Yn.value){const t=fl.value.findIndex(o=>o.id===Ze.value.editingMarkerId);t!==-1?(fl.value[t].description=Ze.value.description||"",fl.value[t].color=Ze.value.color||"",fl.value[t].type=Ze.value.type||"default",de("update-marker",fl.value[t])):de("update-marker",{id:Ze.value.editingMarkerId,description:Ze.value.description||"",color:Ze.value.color||"",type:Ze.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let o=Hl(Ze.value.date,U.categories||[]);if(It.value){const{maxX:C}=Nt.value;o=Math.max(0,Math.min(o,Math.floor(C)))}else Ml.value&&(o=Math.max(0,Math.min(o,Nt.value.maxX)));const l=kl(o),r=_e.value+F.value.bottom-Ft.value/2,m=Array.isArray(U.categories)?U.categories[o]:null,v={id:t,title:"",description:Ze.value.description||"",color:Ze.value.color||"",type:Ze.value.type||"default",categoryIndex:o,x:l,y:r,marker_date:m||null};Ze.value.categoryIndex=o,fl.value.push(v),de("add-marker",v)}Tl(),Co()}},Tl=()=>{Ze.value.show=!1,Ze.value.title="",Ze.value.description="",Ze.value.color="#FF6B6B",Ze.value.type="default",Ze.value.editingMarkerId=null,Ze.value.readonly=!1,Ze.value.categoryIndex=null,Ze.value.fromButton=!1,Ze.value.date=null},Vn=()=>{Yn.value&&(Kn(Ze.value.editingMarkerId),Tl())},Kn=t=>{const o=fl.value.findIndex(l=>l.id===t);o!==-1&&(fl.value.splice(o,1),Co()),de("delete-marker",t)},il=t=>{if(Ze.value.show=!0,Ze.value.title=t?.title??t?.comment??"",Ze.value.description=t?.description??t?.comment??"",Ze.value.color=t?.color??"",Ze.value.type=t?.type??"default",Ze.value.editingMarkerId=t?.id??t?.marker_id??null,Ze.value.readonly=t?.readonly??!1,Ze.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?Ze.value.date=new Date(m,C,v):Ze.value.date=null}else Ze.value.date=null},Co=()=>{try{const t=`dss-chart-markers-${U.chartId}`;localStorage.setItem(t,JSON.stringify(fl.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},Do=()=>{try{const t=`dss-chart-markers-${U.chartId}`,o=localStorage.getItem(t);if(o){const l=JSON.parse(o);Array.isArray(l)&&(fl.value=l.map(r=>({...r,originalYOffset:r.originalYOffset!==void 0?r.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),fl.value=[]}},jl=t=>{const o=dt.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}`},yn=()=>{const t=Ae.value.show,o=Fe.value.show;return Ae.value.show=!1,Fe.value.show=!1,{originalCrosshair:t,originalTooltip:o}},Pl=t=>{Ae.value.show=t.originalCrosshair,Fe.value.show=t.originalTooltip},Nn=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"),W=b.getContext("2d");b.width=o,b.height=l,W.fillStyle="#fafafa",W.fillRect(0,0,o,l),W.drawImage(v,0,0,o,l);const _=b.toDataURL("image/png");r(_)}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}),zn=async()=>{try{const t=yn();setTimeout(async()=>{try{const o=te.value;if(!o){console.error("Chart SVG element not found"),Pl(t);return}const l=De(),r=Be.value,m=rt.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(pe=>pe.remove());const b=v.querySelectorAll("image"),W=Array.from(b).map(async pe=>{const Ye=pe.getAttribute("xlink:href")||pe.getAttribute("href");if(Ye&&!Ye.startsWith("data:"))try{const ze=await Nn(Ye,32,32);pe.setAttribute("xlink:href",ze),pe.setAttribute("href",ze)}catch(ze){console.warn("Failed to convert logo to base64:",ze)}});await Promise.all(W);const R=new XMLSerializer().serializeToString(v).replace(/<svg[^>]*>/,"").replace("</svg>","");let B="",G=30;if(dt.value&&(B+=`
44
+ </svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),Ll=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),Sn=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 Hn=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),vn=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),Vl=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),Un=e.computed(()=>{const o=Z.value?.radialBar?.dataLabels;return o&&(o.show===!0||o.enabled===!0)}),sn=e.computed(()=>{const o=Z.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof o=="number"&&o>=0?o:20}),Rn=e.computed(()=>{const o=Z.value?.radialBar?.dataCenter;return Pn.value?!0:Cn.value&&o&&(o.show===!0||o.enabled===!0)}),fn=e.computed(()=>{if(!Rn.value||!Ln.value.length)return"";if(Pn.value){const r=Ln.value[1]??Ln.value[0];return $l(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(l)}),Xn=e.computed(()=>{const o=Z.value?.radialBar?.dataCenter?.fontSize;return typeof o=="number"&&o>0?o:24}),Nl=e.computed(()=>({x:zt.value,y:Pn.value?$t.value:$t.value-Xn.value/2})),rn=e.computed(()=>{const o=Z.value?.radialBar?.dataCenter?.color;return typeof o=="string"&&o?o:"#333"}),Yl=e.computed(()=>{if(!Un.value||!El.value||!Ln.value.length)return[];const t=sn.value*Math.PI/180,o=(hl.value+at.value)/2;return Ln.value.map(l=>{const m=l.endAngle-l.startAngle>=t&&!l.isHidden,v=zt.value+Math.cos(l.midAngle)*o,C=$t.value+Math.sin(l.midAngle)*o;return{value:$l(l.value),x:v,y:C,show:m,color:l.color,contrastColor:Ya(l.color)}})}),vl=e.computed(()=>{if(!U.flags||!U.flags.length)return[];const t=new Map;return U.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=kl(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
+ `)}})}),Rl=e.ref({show:!1,x:0,y:0,content:"",count:0}),y=e.computed(()=>Z.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),g=e.computed(()=>{const t=Z.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),x=e.computed(()=>Z.value?.bubbles?.tooltip?.formatters||{}),O=e.ref(new Set),q=e.ref(null),tt=e.ref(!1),Fe=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),Gt=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),Ae=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),ct=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),oe=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),fl=e.ref([]),Ze=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 tn.value&&t.push(...Object.keys(tn.value)),t}),e.computed(()=>{if(!U.categories||U.categories.length===0){const{maxX:t}=Nt.value;return Array.from({length:t+1},(o,l)=>$("chart.fallback.item",{number:l+1}))}return U.categories});const _o=e.computed(()=>{if(!U.categories||U.categories.length===0)return null;const t=U.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)}),jo=e.computed(()=>{if(!U.categories||U.categories.length===0)return null;const t=U.categories[U.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)}),Yn=e.computed(()=>Ze.value.editingMarkerId!==null),Fn=e.computed(()=>Ze.value.readonly),jn=t=>{O.value.has(t)||(pa.value=!0,q.value=t)},no=()=>{pa.value=!1,q.value=null},Ko=t=>{if(No.value||Po.value){Ae.value.show=!1;return}const l=t.currentTarget.getBoundingClientRect(),r=t.clientX-l.left,m=t.clientY-l.top,v=It.value?r>=F.value.left-50&&r<=F.value.right+50&&m>=F.value.top-50&&m<=F.value.bottom+100:Qt.value?r>=F.value.left&&r<=F.value.right&&m>=F.value.top&&m<=F.value.bottom+ml.value:r>=F.value.left&&r<=F.value.right&&m>=F.value.top&&m<=F.value.bottom;if(tt.value=v,It.value){if(!$e.value||!v||oe.value.isDragging||oe.value.isZooming){Ae.value.show=!1;return}if(Io.value.find(ve=>!ve||ve.isHidden?!1:Math.sqrt(Math.pow(ve.x-r,2)+Math.pow(ve.y-m,2))<=ve.radius+3))Ae.value.show=!1;else{const ve=Io.value.filter(Ce=>!Ce||Ce.isHidden?!1:Math.sqrt(Math.pow(Ce.x-r,2)+Math.pow(Ce.y-m,2))<=250);if(ve.length>0){let Ce=ve[0],xe=Math.sqrt(Math.pow(Ce.x-r,2)+Math.pow(Ce.y-m,2));ve.forEach(ze=>{const Le=Math.sqrt(Math.pow(ze.x-r,2)+Math.pow(ze.y-m,2));Le<xe&&(xe=Le,Ce=ze)});const pe=30,Ye=Io.value.filter(ze=>!ze||ze.isHidden?!1:Math.abs(ze.x-Ce.x)<=pe).sort((ze,Le)=>ze.y-Le.y);Ae.value={show:!0,x:Ce.x,categoryIndex:Math.round(Ce.originalX),data:(()=>{const ze=y.value,Le=g.value,Ne=[];return Ye.forEach(Ie=>{ze.forEach(Mt=>{const Ot=Le[Mt]||Mt,Gl=Na(Mt,Ie);Gl&&Ne.push({seriesName:Ie.seriesName,label:Ie.label,value:`${Ot}: ${Gl}`,color:Ie.color,y:Ie.y})})}),Ne})()}}else Ae.value.show=!1}return}if(Qt.value){if(!$e.value||!v||oe.value.isDragging||oe.value.isZooming){Ae.value.show=!1;return}const Oe=T.value;if(!Oe){Ae.value.show=!1;return}const ve=Oe.getBoundingClientRect(),Ce=t.clientX-ve.left+Oe.scrollLeft,xe=wl.value+Il.value,pe=Math.floor(Ce/xe);if(pe<0||pe>=ql.value.length){Ae.value.show=!1;return}const Ye=$n.value[pe];if(!Ye){Ae.value.show=!1;return}const ze=pe*xe+wl.value/2,Le=ve.left+ze-Oe.scrollLeft-l.left;Ae.value={show:!0,x:Le,categoryIndex:pe,data:Ye.segments.filter(Ne=>!Ne.isRemainder).map(Ne=>({seriesName:Ne.label,value:Ne.value,color:Ne.color,y:null}))};return}if(oe.value.isDragging&&oe.value.scale>1&&Ml.value&&Ct.value&&!Qt.value){Ae.value.show=!1;const Oe=t.clientX-oe.value.lastMouseX,{minX:ve,maxX:Ce}=Nt.value,xe=Ce-ve||1,Ye=Oe*.8;oe.value.offsetX+=Ye;const ze=xe/oe.value.scale,Le=xe-ze,Ne=0,Ie=-Le/xe*F.value.width,Mt=Ne;oe.value.offsetX=Math.max(Ie,Math.min(Mt,oe.value.offsetX)),oe.value.lastMouseX=t.clientX,oe.value.lastMouseY=t.clientY;return}if(!$e.value||!Ml.value||Qt.value||oe.value.isDragging||oe.value.isZooming||!v){Ae.value.show=!1;return}const{minX:C,maxX:b}=Nt.value,W=b-C||1,_=W/oe.value.scale,R=C-oe.value.offsetX/F.value.width*W,B=(r-F.value.left)/F.value.width,G=R+B*_,Ve=Math.round(G);if(Ve>=0&&Ve<=b){const Oe=kl(Ve),ve=Pt.value.map((Ce,xe)=>{const pe=U.series.findIndex(ze=>ze===Ce),Ye=Ce.data[Ve];return{seriesName:Ce.name,value:Ye!==void 0?Ye:null,color:al(pe),y:Ye!==void 0?un(Ce,Ye):null}}).filter(Ce=>Ce.value!==null);Ae.value={show:!0,x:Oe,categoryIndex:Ve,data:ve}}},Go=()=>{Ae.value.show&&(Ae.value.show=!1)},$o=t=>{const o=T.value;if(!o||o.scrollWidth<=o.clientWidth)return;t.preventDefault(),t.stopPropagation();const l=Math.abs(t.deltaX)>Math.abs(t.deltaY)?t.deltaX:t.deltaY;o.scrollLeft+=l};e.watch([T,()=>be.value,()=>ql.value.length],()=>{e.nextTick(ut)});const Lo=()=>ql.value[Ae.value.categoryIndex]?.label||$("chart.fallback.item",{number:Ae.value.categoryIndex+1}),To=()=>{Ae.value.show=!1,tt.value=!1,Po.value=!1,No.value||(Rl.value.show=!1),oe.value.isDragging&&(oe.value.isDragging=!1),oe.value.zoomTimeout&&(clearTimeout(oe.value.zoomTimeout),oe.value.zoomTimeout=null),oe.value.isZooming=!1,setTimeout(()=>{q.value=null,Fe.value.show=!1},150)},Qo=t=>{if(t.preventDefault(),t.stopPropagation(),!jt.value)return;const o=t.currentTarget.getBoundingClientRect(),l=t.clientX-o.left,r=t.clientY-o.top;if(El.value){ct.value.show=!1,e.nextTick(()=>{ct.value.show=!0,ct.value.x=t.clientX,ct.value.y=t.clientY,ct.value.categoryIndex=null});return}const m=Math.max(0,F.value.left-20),v=F.value.right,C=F.value.top,b=F.value.bottom+80;l>=m&&l<=v&&r>=C&&r<=b&&(ct.value.show=!1,e.nextTick(()=>{ct.value.show=!0,ct.value.x=t.clientX,ct.value.y=t.clientY,ct.value.categoryIndex=null;const W=Math.max(F.value.left,Math.min(l,F.value.right))-F.value.left,R=F.value.width/sa.value.length,B=Math.floor(W/R);B>=0&&B<sa.value.length&&(ct.value.categoryIndex=B)}))},hn=t=>{if(!(t&&t.button===2)){if(ct.value.show&&t&&t.type==="click"){const o=document.querySelector(".dss-context-menu");if(o&&o.contains(t.target))return}ct.value.show=!1}},Jo=t=>{if(typeof t.template=="function"){const o={series:U.series,categories:U.categories,markers:fl.value},l={chartX:ct.value.chartX,chartY:ct.value.chartY,dataX:ct.value.mouseDataX,dataY:ct.value.mouseDataY,categoryIndex:ct.value.categoryIndex};return t.template(o,l)}return t.template||t.label||""},Ao=t=>{const o=["dss-context-menu-item"];return t.cssClass&&o.push(t.cssClass),o},In=t=>t.style||{},oo=t=>t.type&&tn.value[t.type]?tn.value[t.type]:t.customIcon?t.customIcon:Sl.value,ao=t=>t==null?"":U.categories&&U.categories[t]?U.categories[t]:"",ea=t=>fl.value.length?fl.value.filter(o=>o.categoryIndex===t):[],ta=t=>{if(!Ml.value&&!It.value)return{x:0,y:0};const o=kl(t),l=_e.value+F.value.bottom-Ft.value/2;return{x:o,y:l}},ko=()=>{fl.value.forEach(t=>{if(t.categoryIndex!==void 0&&(Ml.value||It.value)){const o=ta(t.categoryIndex);t.x=o.x,t.y=o.y}})},gn=()=>{if(Ze.value.description&&Ze.value.description.length&&Ze.value.date){if(Yn.value){const t=fl.value.findIndex(o=>o.id===Ze.value.editingMarkerId);t!==-1?(fl.value[t].description=Ze.value.description||"",fl.value[t].color=Ze.value.color||"",fl.value[t].type=Ze.value.type||"default",de("update-marker",fl.value[t])):de("update-marker",{id:Ze.value.editingMarkerId,description:Ze.value.description||"",color:Ze.value.color||"",type:Ze.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let o=Hl(Ze.value.date,U.categories||[]);if(It.value){const{maxX:C}=Nt.value;o=Math.max(0,Math.min(o,Math.floor(C)))}else Ml.value&&(o=Math.max(0,Math.min(o,Nt.value.maxX)));const l=kl(o),r=_e.value+F.value.bottom-Ft.value/2,m=Array.isArray(U.categories)?U.categories[o]:null,v={id:t,title:"",description:Ze.value.description||"",color:Ze.value.color||"",type:Ze.value.type||"default",categoryIndex:o,x:l,y:r,marker_date:m||null};Ze.value.categoryIndex=o,fl.value.push(v),de("add-marker",v)}Tl(),Co()}},Tl=()=>{Ze.value.show=!1,Ze.value.title="",Ze.value.description="",Ze.value.color="#FF6B6B",Ze.value.type="default",Ze.value.editingMarkerId=null,Ze.value.readonly=!1,Ze.value.categoryIndex=null,Ze.value.fromButton=!1,Ze.value.date=null},Vn=()=>{Yn.value&&(Kn(Ze.value.editingMarkerId),Tl())},Kn=t=>{const o=fl.value.findIndex(l=>l.id===t);o!==-1&&(fl.value.splice(o,1),Co()),de("delete-marker",t)},il=t=>{if(Ze.value.show=!0,Ze.value.title=t?.title??t?.comment??"",Ze.value.description=t?.description??t?.comment??"",Ze.value.color=t?.color??"",Ze.value.type=t?.type??"default",Ze.value.editingMarkerId=t?.id??t?.marker_id??null,Ze.value.readonly=t?.readonly??!1,Ze.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?Ze.value.date=new Date(m,C,v):Ze.value.date=null}else Ze.value.date=null},Co=()=>{try{const t=`dss-chart-markers-${U.chartId}`;localStorage.setItem(t,JSON.stringify(fl.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},Do=()=>{try{const t=`dss-chart-markers-${U.chartId}`,o=localStorage.getItem(t);if(o){const l=JSON.parse(o);Array.isArray(l)&&(fl.value=l.map(r=>({...r,originalYOffset:r.originalYOffset!==void 0?r.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),fl.value=[]}},jl=t=>{const o=dt.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}`},yn=()=>{const t=Ae.value.show,o=Fe.value.show;return Ae.value.show=!1,Fe.value.show=!1,{originalCrosshair:t,originalTooltip:o}},Pl=t=>{Ae.value.show=t.originalCrosshair,Fe.value.show=t.originalTooltip},Nn=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"),W=b.getContext("2d");b.width=o,b.height=l,W.fillStyle="#fafafa",W.fillRect(0,0,o,l),W.drawImage(v,0,0,o,l);const _=b.toDataURL("image/png");r(_)}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}),zn=async()=>{try{const t=yn();setTimeout(async()=>{try{const o=te.value;if(!o){console.error("Chart SVG element not found"),Pl(t);return}const l=De(),r=Be.value,m=rt.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(pe=>pe.remove());const b=v.querySelectorAll("image"),W=Array.from(b).map(async pe=>{const Ye=pe.getAttribute("xlink:href")||pe.getAttribute("href");if(Ye&&!Ye.startsWith("data:"))try{const ze=await Nn(Ye,32,32);pe.setAttribute("xlink:href",ze),pe.setAttribute("href",ze)}catch(ze){console.warn("Failed to convert logo to base64:",ze)}});await Promise.all(W);const R=new XMLSerializer().serializeToString(v).replace(/<svg[^>]*>/,"").replace("</svg>","");let B="",G=30;if(dt.value&&(B+=`
46
46
  <text x="24" y="${G}"
47
47
  font-family="Arial, sans-serif"
48
48
  font-size="18"
@@ -55,7 +55,7 @@
55
55
  font-size="14"
56
56
  fill="#666">
57
57
  ${et.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
58
- </text>`,G+=25),he.value&&U.series.length>0){let pe=r-200,Ye=dt.value||et.value?35:25;const ze=Math.floor((r-250)/120);let Le=0;U.series.forEach((Ne,Ie)=>{if(!O.value.has(Ie)){const Mt=al(Ie),Wt=Ne.name.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");B+=`<circle cx="${pe+6}" cy="${Ye-4}" r="6" fill="${Mt}"/>`,B+=`<text x="${pe+18}" y="${Ye}" font-family="Arial, sans-serif" font-size="12" fill="#333">${Wt}</text>`,Le++,Le%ze===0?(pe=r-200,Ye+=20):pe+=Math.min(120,Wt.length*8+35)}})}let Ve="";if(ln.value)try{const{width:pe,height:Ye}=ll.value,ze=zl.value,Le=F.value.left,Ne=F.value.right,Ie=F.value.top,Mt=F.value.bottom,Wt=F.value.width,Gl=F.value.height;let Cl,Ql;switch(ze){case"center":Cl=Le+(Wt-pe)/2,Ql=Ie+(Gl-Ye)/2;break;case"top-left":Cl=Le+15,Ql=Ie+5;break;case"top-right":Cl=Ne-pe-5,Ql=Ie+5;break;case"bottom-left":Cl=Le+15,Ql=Mt-Ye-5;break;case"bottom-right":default:Cl=Ne-pe-5,Ql=Mt-Ye-5;break}Ve=`
58
+ </text>`,G+=25),he.value&&U.series.length>0){let pe=r-200,Ye=dt.value||et.value?35:25;const ze=Math.floor((r-250)/120);let Le=0;U.series.forEach((Ne,Ie)=>{if(!O.value.has(Ie)){const Mt=al(Ie),Ot=Ne.name.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");B+=`<circle cx="${pe+6}" cy="${Ye-4}" r="6" fill="${Mt}"/>`,B+=`<text x="${pe+18}" y="${Ye}" font-family="Arial, sans-serif" font-size="12" fill="#333">${Ot}</text>`,Le++,Le%ze===0?(pe=r-200,Ye+=20):pe+=Math.min(120,Ot.length*8+35)}})}let Ve="";if(ln.value)try{const{width:pe,height:Ye}=ll.value,ze=zl.value,Le=F.value.left,Ne=F.value.right,Ie=F.value.top,Mt=F.value.bottom,Ot=F.value.width,Gl=F.value.height;let Cl,Ql;switch(ze){case"center":Cl=Le+(Ot-pe)/2,Ql=Ie+(Gl-Ye)/2;break;case"top-left":Cl=Le+15,Ql=Ie+5;break;case"top-right":Cl=Ne-pe-5,Ql=Ie+5;break;case"bottom-left":Cl=Le+15,Ql=Mt-Ye-5;break;case"bottom-right":default:Cl=Ne-pe-5,Ql=Mt-Ye-5;break}Ve=`
59
59
  <g opacity="${En.value}">
60
60
  <g transform="translate(${Cl}, ${Ql}) scale(${pe/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"/>
@@ -89,20 +89,20 @@
89
89
  ${R}
90
90
  ${Ve}
91
91
  </g>
92
- </svg>`,ve=new Blob([Oe],{type:"image/svg+xml;charset=utf-8"}),Ce=URL.createObjectURL(ve),xe=document.createElement("a");xe.href=Ce,xe.download=jl("svg"),document.body.appendChild(xe),xe.click(),document.body.removeChild(xe),URL.revokeObjectURL(Ce),Pl(t),hn()}catch(o){console.error("Error downloading SVG:",o),Pl(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},la=async()=>{try{const t=yn();P.value&&P.value.offsetHeight,await new Promise(pe=>setTimeout(pe,300));const o=De(),l=Be.value,r=rt.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(dt.value&&(v.fillStyle="#333",v.font="bold 18px Arial, sans-serif",v.fillText(dt.value,24,b),b+=30),et.value&&(v.fillStyle="#666",v.font="14px Arial, sans-serif",v.fillText(et.value,24,b),b+=25),he.value&&U.series.length>0){let pe=l-200,Ye=dt.value||et.value?35:25;const ze=Math.floor((l-250)/120);let Le=0;v.font="12px Arial, sans-serif",U.series.forEach((Ne,Ie)=>{if(!O.value.has(Ie)){const Mt=al(Ie);v.beginPath(),v.arc(pe+6,Ye-4,6,0,2*Math.PI),v.fillStyle=Mt,v.fill(),v.fillStyle="#333",v.fillText(Ne.name,pe+18,Ye),Le++,Le%ze===0?(pe=l-200,Ye+=20):pe+=Math.min(120,Ne.name.length*8+35)}})}const _=te.value.cloneNode(!0),R=_.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),B=_.querySelectorAll(".dss-crosshair"),G=_.querySelectorAll('[class*="tooltip"]');R.forEach(pe=>pe.remove()),B.forEach(pe=>pe.remove()),G.forEach(pe=>pe.remove()),_.querySelectorAll("image").forEach((pe,Ye)=>{const ze=pe.getAttribute("xlink:href")||pe.getAttribute("href");if(ze&&!ze.startsWith("data:")){const Le=zo.value[Ye],Ne=Le?al(Le.seriesIndex):"#3B82F6",Ie=pe.getAttribute("x")||0,Mt=pe.getAttribute("y")||0,Wt=pe.getAttribute("width")||32,Gl=pe.getAttribute("height")||32,Cl=document.createElementNS("http://www.w3.org/2000/svg","circle");Cl.setAttribute("cx",parseFloat(Ie)+parseFloat(Wt)/2),Cl.setAttribute("cy",parseFloat(Mt)+parseFloat(Gl)/2),Cl.setAttribute("r",Math.min(parseFloat(Wt),parseFloat(Gl))/2-1),Cl.setAttribute("fill",Ne),Cl.setAttribute("stroke","#fafafa"),Cl.setAttribute("stroke-width","2"),pe.parentNode.replaceChild(Cl,pe)}});const Oe=new XMLSerializer().serializeToString(_),ve=new Blob([Oe],{type:"image/svg+xml;charset=utf-8"}),Ce=URL.createObjectURL(ve),xe=new Image;return new Promise((pe,Ye)=>{xe.onload=async()=>{try{if(v.drawImage(xe,0,o.height),zo.value.forEach(ze=>{const Le=ze.x,Ne=ze.y+o.height,Ie=(ze.width||32)/2,Mt=al(ze.seriesIndex);v.save(),v.beginPath(),v.arc(Le,Ne,Ie-1,0,2*Math.PI),v.fillStyle=Mt,v.fill(),v.strokeStyle="#fafafa",v.lineWidth=2,v.stroke(),v.restore()}),ln.value){const ze=new Image,Le=()=>{const{width:Ie,height:Mt}=ll.value,Wt=zl.value,Gl=F.value.left,Cl=F.value.right,Ql=F.value.top,Wo=F.value.bottom,bs=F.value.width,ws=F.value.height;let po,vo;switch(Wt){case"center":po=Gl+(bs-Ie)/2,vo=Ql+o.height+(ws-Mt)/2;break;case"top-left":po=Gl+15,vo=Ql+o.height+10;break;case"top-right":po=Cl-Ie-5,vo=Ql+o.height+10;break;case"bottom-left":po=Gl+15,vo=Wo+o.height-Mt-5;break;case"bottom-right":default:po=Cl-Ie-5,vo=Wo+o.height-Mt-5;break}v.globalAlpha=En.value,v.drawImage(ze,po,vo,Ie,Mt),v.globalAlpha=1,Ne()},Ne=()=>{m.toBlob(Ie=>{const Mt=URL.createObjectURL(Ie),Wt=document.createElement("a");Wt.href=Mt,Wt.download=jl("png"),document.body.appendChild(Wt),Wt.click(),document.body.removeChild(Wt),URL.revokeObjectURL(Mt),URL.revokeObjectURL(Ce),Pl(t),hn(),pe()},"image/png")};ze.onload=Le,ze.onerror=Ne,ze.src=rl.value}else m.toBlob(ze=>{const Le=URL.createObjectURL(ze),Ne=document.createElement("a");Ne.href=Le,Ne.download=jl("png"),document.body.appendChild(Ne),Ne.click(),document.body.removeChild(Ne),URL.revokeObjectURL(Le),URL.revokeObjectURL(Ce),Pl(t),hn(),pe()},"image/png")}catch(ze){URL.revokeObjectURL(Ce),Pl(t),Ye(ze)}},xe.onerror=()=>{URL.revokeObjectURL(Ce),Pl(t),Ye(new Error("Failed to load SVG image"))},xe.src=Ce})}catch(t){console.error("Error downloading PNG:",t)}},na=()=>{try{let t="";if(dt.value&&(t+=`# ${$("chart.csv.chartTitle")}: ${dt.value}
92
+ </svg>`,ve=new Blob([Oe],{type:"image/svg+xml;charset=utf-8"}),Ce=URL.createObjectURL(ve),xe=document.createElement("a");xe.href=Ce,xe.download=jl("svg"),document.body.appendChild(xe),xe.click(),document.body.removeChild(xe),URL.revokeObjectURL(Ce),Pl(t),hn()}catch(o){console.error("Error downloading SVG:",o),Pl(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},la=async()=>{try{const t=yn();P.value&&P.value.offsetHeight,await new Promise(pe=>setTimeout(pe,300));const o=De(),l=Be.value,r=rt.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(dt.value&&(v.fillStyle="#333",v.font="bold 18px Arial, sans-serif",v.fillText(dt.value,24,b),b+=30),et.value&&(v.fillStyle="#666",v.font="14px Arial, sans-serif",v.fillText(et.value,24,b),b+=25),he.value&&U.series.length>0){let pe=l-200,Ye=dt.value||et.value?35:25;const ze=Math.floor((l-250)/120);let Le=0;v.font="12px Arial, sans-serif",U.series.forEach((Ne,Ie)=>{if(!O.value.has(Ie)){const Mt=al(Ie);v.beginPath(),v.arc(pe+6,Ye-4,6,0,2*Math.PI),v.fillStyle=Mt,v.fill(),v.fillStyle="#333",v.fillText(Ne.name,pe+18,Ye),Le++,Le%ze===0?(pe=l-200,Ye+=20):pe+=Math.min(120,Ne.name.length*8+35)}})}const _=te.value.cloneNode(!0),R=_.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),B=_.querySelectorAll(".dss-crosshair"),G=_.querySelectorAll('[class*="tooltip"]');R.forEach(pe=>pe.remove()),B.forEach(pe=>pe.remove()),G.forEach(pe=>pe.remove()),_.querySelectorAll("image").forEach((pe,Ye)=>{const ze=pe.getAttribute("xlink:href")||pe.getAttribute("href");if(ze&&!ze.startsWith("data:")){const Le=zo.value[Ye],Ne=Le?al(Le.seriesIndex):"#3B82F6",Ie=pe.getAttribute("x")||0,Mt=pe.getAttribute("y")||0,Ot=pe.getAttribute("width")||32,Gl=pe.getAttribute("height")||32,Cl=document.createElementNS("http://www.w3.org/2000/svg","circle");Cl.setAttribute("cx",parseFloat(Ie)+parseFloat(Ot)/2),Cl.setAttribute("cy",parseFloat(Mt)+parseFloat(Gl)/2),Cl.setAttribute("r",Math.min(parseFloat(Ot),parseFloat(Gl))/2-1),Cl.setAttribute("fill",Ne),Cl.setAttribute("stroke","#fafafa"),Cl.setAttribute("stroke-width","2"),pe.parentNode.replaceChild(Cl,pe)}});const Oe=new XMLSerializer().serializeToString(_),ve=new Blob([Oe],{type:"image/svg+xml;charset=utf-8"}),Ce=URL.createObjectURL(ve),xe=new Image;return new Promise((pe,Ye)=>{xe.onload=async()=>{try{if(v.drawImage(xe,0,o.height),zo.value.forEach(ze=>{const Le=ze.x,Ne=ze.y+o.height,Ie=(ze.width||32)/2,Mt=al(ze.seriesIndex);v.save(),v.beginPath(),v.arc(Le,Ne,Ie-1,0,2*Math.PI),v.fillStyle=Mt,v.fill(),v.strokeStyle="#fafafa",v.lineWidth=2,v.stroke(),v.restore()}),ln.value){const ze=new Image,Le=()=>{const{width:Ie,height:Mt}=ll.value,Ot=zl.value,Gl=F.value.left,Cl=F.value.right,Ql=F.value.top,Wo=F.value.bottom,bs=F.value.width,ws=F.value.height;let po,vo;switch(Ot){case"center":po=Gl+(bs-Ie)/2,vo=Ql+o.height+(ws-Mt)/2;break;case"top-left":po=Gl+15,vo=Ql+o.height+10;break;case"top-right":po=Cl-Ie-5,vo=Ql+o.height+10;break;case"bottom-left":po=Gl+15,vo=Wo+o.height-Mt-5;break;case"bottom-right":default:po=Cl-Ie-5,vo=Wo+o.height-Mt-5;break}v.globalAlpha=En.value,v.drawImage(ze,po,vo,Ie,Mt),v.globalAlpha=1,Ne()},Ne=()=>{m.toBlob(Ie=>{const Mt=URL.createObjectURL(Ie),Ot=document.createElement("a");Ot.href=Mt,Ot.download=jl("png"),document.body.appendChild(Ot),Ot.click(),document.body.removeChild(Ot),URL.revokeObjectURL(Mt),URL.revokeObjectURL(Ce),Pl(t),hn(),pe()},"image/png")};ze.onload=Le,ze.onerror=Ne,ze.src=rl.value}else m.toBlob(ze=>{const Le=URL.createObjectURL(ze),Ne=document.createElement("a");Ne.href=Le,Ne.download=jl("png"),document.body.appendChild(Ne),Ne.click(),document.body.removeChild(Ne),URL.revokeObjectURL(Le),URL.revokeObjectURL(Ce),Pl(t),hn(),pe()},"image/png")}catch(ze){URL.revokeObjectURL(Ce),Pl(t),Ye(ze)}},xe.onerror=()=>{URL.revokeObjectURL(Ce),Pl(t),Ye(new Error("Failed to load SVG image"))},xe.src=Ce})}catch(t){console.error("Error downloading PNG:",t)}},na=()=>{try{let t="";if(dt.value&&(t+=`# ${$("chart.csv.chartTitle")}: ${dt.value}
93
93
  `),et.value&&(t+=`# ${$("chart.csv.chartSubtitle")}: ${et.value}
94
94
  `),t+=`# ${$("chart.csv.generated")}: ${new Date().toLocaleString()}
95
95
 
96
- `,zt.value){t+=`Category,Segment,Value
96
+ `,Qt.value){t+=`Category,Segment,Value
97
97
  `,$n.value.forEach(W=>{W.segments.forEach(_=>{const R=String(W.label||"").replace(/"/g,'""'),B=String(_.label||"").replace(/"/g,'""');t+=`"${R}","${B}",${_.value}
98
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=jl("csv"),document.body.appendChild(b),b.click(),document.body.removeChild(b),URL.revokeObjectURL(C),hn();return}t+="Category",U.series.forEach(v=>{const C=v.name.replace(/"/g,'""');t+=',"'+C+'"'}),t+=`
99
99
  `;const o=Math.max(...U.series.map(v=>v.data?.length||0));for(let v=0;v<o;v++){let W='"'+(U.categories[v]||$("chart.fallback.item",{number:v+1})).toString().replace(/"/g,'""')+'"';U.series.forEach(_=>{const R=_.data&&_.data[v]!==void 0?_.data[v]:"";W+=","+R}),t+=W+`
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=jl("csv"),document.body.appendChild(m),m.click(),document.body.removeChild(m),URL.revokeObjectURL(r),hn()}catch(t){console.error("Error downloading CSV:",t)}},Gn=t=>{if(typeof t.action=="function"){const o={series:U.series,categories:U.categories,markers:fl.value},l={chartX:ct.value.chartX,chartY:ct.value.chartY,dataX:ct.value.mouseDataX,dataY:ct.value.mouseDataY,categoryIndex:clampedCategoryIndex||ct.value.categoryIndex};t.action(o,l)}hn()},Ho=()=>{Tl(),Ze.value.show=!0,Ze.value.categoryIndex=ct.value.categoryIndex,Ze.value.fromButton=!1,hn()},Qn=()=>{Tl(),Ze.value.show=!0,Ze.value.categoryIndex=0,Ze.value.fromButton=!0},bo=t=>{if(ct.value.show){const o=document.querySelector(".dss-context-menu");o&&!o.contains(t.target)&&(ct.value.show=!1)}},wo=t=>{ct.value.show&&!t.target.closest(".context-menu")&&(ct.value.show=!1)},Ro=t=>{if(!Ml.value||!Ct.value||zt.value)return;t.preventDefault(),t.stopPropagation(),oe.value.isZooming=!0,Ae.value.show=!1,oe.value.zoomTimeout&&clearTimeout(oe.value.zoomTimeout);const l=t.currentTarget.getBoundingClientRect(),r=t.clientX-l.left,m=t.clientY-l.top;if(r<F.value.left-50||r>F.value.right+50||m<F.value.top-50||m>F.value.bottom+100){oe.value.isZooming=!1;return}const v=t.deltaY>0?.9:1.1,C=Math.max(oe.value.minScale,Math.min(oe.value.maxScale,oe.value.scale*v));if(C!==oe.value.scale){const{minX:b,maxX:W}=Nt.value,_=W-b||1,R=_/oe.value.scale,B=b-oe.value.offsetX/F.value.width*_,G=(r-F.value.left)/F.value.width,Ve=B+G*R;oe.value.scale=C;const Oe=_/oe.value.scale,ve=Ve-G*Oe;oe.value.offsetX=-(ve-b)/_*F.value.width,oe.value.scale<=1.01&&(oe.value.scale=1,oe.value.offsetX=0)}oe.value.zoomTimeout=setTimeout(()=>{oe.value.isZooming=!1,oe.value.zoomTimeout=null},300)},so=t=>{if(!Ml.value||!Ct.value||oe.value.scale<=1)return;Ae.value.show=!1;const l=t.currentTarget.getBoundingClientRect();t.clientX-l.left,t.clientY-l.top,oe.value.isDragging=!0,oe.value.lastMouseX=t.clientX,oe.value.lastMouseY=t.clientY,t.preventDefault()},xo=()=>{oe.value.isDragging=!1},Jn=()=>{!Ml.value||!Ct.value||(oe.value.scale=1,oe.value.offsetX=0,oe.value.isDragging=!1,oe.value.zoomTimeout&&(clearTimeout(oe.value.zoomTimeout),oe.value.zoomTimeout=null),oe.value.isZooming=!1)},oa=()=>!Ml.value||!tt.value||!Ct.value?"default":oe.value.isDragging?"grabbing":oe.value.scale>1?"grab":"dss-crosshair",ro=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*sl.value,W=m.y+(v.y-r.y)/6*sl.value,_=v.x-(C.x-m.x)/6*sl.value,R=v.y-(C.y-m.y)/6*sl.value;o+=` C ${b} ${W} ${_} ${R} ${v.x} ${v.y}`}return o},Bl=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+(tl.value?30:0)+60;if(cl.value){const B={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??B.left,top:r.top??B.top,right:r.right??B.right,bottom:r.bottom??B.bottom}:B}if(El.value){const B=!he.value,G=Ll.value,Ve=G?Hn.value+vn.value+Math.max(24,Sn.value+16):0,Oe=B?12:m;let ve=0;dt.value&&(ve+=B?8:15),et.value&&(ve+=B?6:10);const Ce=De();let xe=Oe+(B?4:16)+(G?Ve:0),pe=Oe+(G?Ve:0);he.value&&Xe.value==="left"?xe+=Ce.legendWidth||150:he.value&&Xe.value==="right"&&(pe+=Ce.legendWidth||150);const ze=we.value==="semi-radial"?G?Ve:8:G?Ve:B?8:m+80,Le=G?14:0,Ne=Oe+ve+Le,Ie={left:xe,top:Ne,right:pe,bottom:ze};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??Ie.left,top:r.top??Ie.top,right:r.right??Ie.right,bottom:r.bottom??Ie.bottom}:Ie}let C=0;dt.value&&(C+=15),et.value&&(C+=10);const b=De();let W=m+16+(ft.value?30:0),_=m+(ht.value?30:0);he.value&&Xe.value==="left"?W+=b.legendWidth||150:he.value&&Xe.value==="right"&&(_+=b.legendWidth||150),_n.value&&(_+=44),zt.value&&(v=ml.value+8);const R={left:W,top:m+C,right:_,bottom:v};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??R.left,top:r.top??R.top,right:r.right??R.right,bottom:r.bottom??R.bottom}:R}),F=e.computed(()=>({left:Bl.value.left,top:Bl.value.top,right:Be.value-Bl.value.right,bottom:rt.value-Bl.value.bottom,width:Be.value-(Bl.value.left+Bl.value.right),height:rt.value-(Bl.value.top+Bl.value.bottom)})),Ml=e.computed(()=>["line","area","bar","stepbar"].includes(we.value)||qt.value),Ol=e.computed(()=>qt.value),Pn=e.computed(()=>we.value==="mini-radial"),El=e.computed(()=>["radial","semi-radial","mini-radial"].includes(we.value)),cl=e.computed(()=>we.value==="spider"),It=e.computed(()=>we.value==="bubble"),zt=e.computed(()=>we.value==="stepbar"),ul=e.computed(()=>Z.value?.chart?.orientation==="horizontal"&&(we.value==="bar"||Ol.value)),kn=t=>{const{minY:o,maxY:l}=Nt.value,r=l-o||1;return F.value.left+(t-o)/r*F.value.width},Bn=t=>{const{maxX:o}=Nt.value,l=o+1,m=F.value.height/l;return F.value.top+(t+.5)*m},Pt=e.computed(()=>El.value?Bl.value.left+(Be.value-Bl.value.left-Bl.value.right)/2:Be.value/2),$t=e.computed(()=>cl.value?rt.value/2-40:El.value?Bl.value.top+(rt.value-Bl.value.top-Bl.value.bottom)/2:rt.value/2),at=e.computed(()=>{if(cl.value){const t=F.value.width-80,o=F.value.height-80;return Math.min(t,o)/2}return Math.min(F.value.width,F.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 at.value*l}),Mn=e.computed(()=>{const t=Z.value,o=typeof U.innerSize=="number"?U.innerSize:t?.innerSize;return typeof o!="number"||o<=-100||!(El.value||cl.value)?1:1+o/100}),io=e.computed(()=>{const t=Mn.value;if(t===1||t<=0)return;const o=Pt.value,l=$t.value;return`translate(${o}, ${l}) scale(${t}) translate(${-o}, ${-l})`}),eo=e.ref(0),co=e.computed(()=>`semi-radial-fill-clip-${U.chartId}`),Cn=e.computed(()=>we.value==="semi-radial"),a=e.computed(()=>Cn.value&&bl.value&&!Tn.value),n=e.computed(()=>Cn.value&&bl.value&&!Tn.value&&pn.value==="fill"),s=e.computed(()=>{const t=a.value?eo.value:1,o=Pt.value,l=$t.value,r=hl.value,m=at.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),W=l+m*Math.sin(v),_=o+m*Math.cos(C),R=l+m*Math.sin(C),B=o+r*Math.cos(C),G=l+r*Math.sin(C),Ve=o+r*Math.cos(v),Oe=l+r*Math.sin(v),ve=t>.5?1:0;return`M ${o} ${l} L ${b} ${W} A ${m} ${m} 0 ${ve} 1 ${_} ${R} L ${B} ${G} A ${r} ${r} 0 ${ve} 1 ${Ve} ${Oe} Z`}),i=e.computed(()=>{if(!(!Cn.value||!a.value)&&!n.value)return`url(#${co.value})`}),c=t=>{if(!(!n.value||t!==0))return`url(#${co.value})`},d=e.ref(0),u=e.computed(()=>`radial-reveal-clip-${U.chartId}`),p=e.computed(()=>we.value==="radial"),h=e.computed(()=>{const t=p.value?d.value:1,o=Pt.value,l=$t.value,r=Math.max(at.value*1.5,Be.value,rt.value);if(t<=0)return`M ${o} ${l} L ${o} ${l} Z`;if(t>=1){const B=o-r,G=o+r;return`M ${B} ${l} A ${r} ${r} 0 0 1 ${G} ${l} A ${r} ${r} 0 0 1 ${B} ${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),W=o+r*Math.cos(v),_=l+r*Math.sin(v),R=t>=.5?1:0;return`M ${o} ${l} L ${C} ${b} A ${r} ${r} 0 ${R} 1 ${W} ${_} Z`}),k=e.computed(()=>{if(i.value)return i.value;if(p.value)return`url(#${u.value})`});let D=null;const z=()=>{if(!a.value)return;eo.value=0;const t=A.value,o=performance.now(),l=r=>{const m=r-o,v=Math.min(1,m/t);eo.value=va(L.value,v),v<1&&(D=requestAnimationFrame(l))};D=requestAnimationFrame(l)},V=e.computed(()=>Z.value?.bubbles?.minSize||8),ce=e.computed(()=>Z.value?.bubbles?.maxSize||50),le=e.computed(()=>Z.value?.bubbles?.opacity||.7),Pe=(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)},Me=t=>{const o=document.querySelector(`.dss-bubble-image-${t}`);o&&(o.style.opacity="1")},gt=t=>{const o=document.querySelector(`.dss-bubble-image-${t}`);o&&(o.style.display="none")},Xt=e.computed(()=>U.series),Ot=e.computed(()=>U.series.filter((t,o)=>!O.value.has(o))),nl=t=>{if(!t)return"primary";const o=t.yAxis??t.axis??t.yAxisId;return o==="secondary"||o==="right"||o===1?"secondary":"primary"},dl=t=>t?typeof t.strokeDasharray=="string"?t.strokeDasharray:Array.isArray(t.strokeDasharray)?t.strokeDasharray.join(","):t.dotted===!0?"4,4":null:null,Ht=t=>t?t.old===!0||t.comparison===!0||t.dotted===!0:!1,ol=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}}),nn=(t,o)=>typeof t?.bubbles?.size=="number"?t.bubbles.size:typeof t?.bubbleSize=="number"?t.bubbleSize:o?ol.value.bubbleSize:ae.value,cn=(t,o)=>Ht(t)&&ol.value.usePrimaryColor?al(0):al(o),Fl=(t,o)=>cl.value&&Ht(t)?cn(t,o):al(o),Eo=e.computed(()=>Ot.value.filter(t=>nl(t)==="primary")),So=e.computed(()=>Ot.value.filter(t=>nl(t)==="secondary")),_n=e.computed(()=>!ul.value&&!!Zt.value&&So.value.length>0),Vo=(t,o=0)=>{const l=Number(t);return Number.isFinite(l)?l:o},ya=(t,o,l)=>{if(!Array.isArray(t))return[];const r=t.map((m,v)=>{const C=m&&typeof m=="object"&&!Array.isArray(m),b=Vo(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||al(v):al(l),marker:C?m.marker:null,isRemainder:!1}}).filter(Boolean);return se.value==="asc"?r.sort((m,v)=>m.value-v.value):se.value==="desc"?r.sort((m,v)=>v.value-m.value):r},Fo=(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:al(r)}],C=ya(v,l,r),b=C.reduce((B,G)=>B+G.value,0),W=Vo(m?t.totalValue??t.total??l?.totalValue??l?.total:l?.totalValue??l?.total,re.value),_=Math.max(W,b,1);Re.value&&_>b&&C.push({key:`${r}-${o}-remainder`,label:kt.value,value:_-b,color:nt.value,marker:null,isRemainder:!0});const R=C.filter(B=>!B.isRemainder).reduce((B,G)=>!B||G.value>B.value?G:B,null);return{key:`${r}-${o}`,label:m?t.label||t.name||U.categories?.[o]||$("chart.fallback.item",{number:o+1}):U.categories?.[o]||$("chart.fallback.item",{number:o+1}),axisLabel:m?t.xLabel??t.label??t.name??U.categories?.[o]??$("chart.fallback.item",{number:o+1}):U.categories?.[o]||$("chart.fallback.item",{number:o+1}),yLabel:m?t.yLabel??null:null,totalValue:_,usedValue:b,segments:C,maxSegmentKey:R?.key||null,seriesName:l?.name||"",seriesIndex:r}},$n=e.computed(()=>{if(!zt.value)return[];const t=[];return Xt.value.forEach((o,l)=>{O.value.has(l)||!Array.isArray(o?.data)||o.data.forEach(r=>{const m=Fo(r,t.length,o,l);m.segments.length>0&&t.push(m)})}),t}),_l="auto",on=(t,o,l,r=0,m=100)=>{let v=1/0,C=-1/0;if(t.forEach(_=>{_?.data?.length&&_.data.forEach(R=>{typeof R=="number"&&Number.isFinite(R)&&(v=Math.min(v,R),C=Math.max(C,R))})}),v===1/0)return{minY:r,maxY:m};let b;if(o===_l){const _=C-v,R=_>0?_*.1:1;b=Math.max(0,v-R)}else if(typeof o=="number")b=o;else{const _=C-v,R=_>0?_*.1:1;b=Math.max(0,v-R)}let W;if(l===_l){const _=C-v,R=_>0?_*.1:2;W=C+R}else if(typeof l=="number")W=l;else{const _=C-v,R=_>0?_*.1:2;W=C+R}return{minY:b,maxY:W}},Nt=e.computed(()=>{if(It.value)return Wa();if(zt.value)return Kl();if(!Ot.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=0;Ot.value.forEach(l=>{l.data&&l.data.length&&(t=Math.max(t,l.data.length-1))}),U.categories.length>0&&(t=Math.max(t,U.categories.length-1));const o=on(Eo.value.length?Eo.value:Ot.value,Jt.value,wt.value);return{minX:0,maxX:t,minY:o.minY,maxY:o.maxY}}),Kl=()=>{const t=$n.value,o=t.reduce((v,C)=>Math.max(v,C.totalValue),re.value),l=typeof Jt.value=="number"?Jt.value:0,r=typeof wt.value=="number"?wt.value:o,m=Math.max(r,l+1);return{minX:0,maxX:Math.max(t.length-1,0),minY:l,maxY:m}},aa=e.computed(()=>_n.value?on(So.value,jt.value,fe.value,Nt.value.minY,Nt.value.maxY):{minY:Nt.value.minY,maxY:Nt.value.maxY}),Wa=()=>{if(!Ot.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(Ot.value.forEach((Ve,Oe)=>{Ve?.data?.length&&Ve.data.forEach((ve,Ce)=>{let xe,pe,Ye;if(typeof ve=="object"&&ve!==null&&!Array.isArray(ve))xe=typeof ve.x=="number"?ve.x:Ce,pe=typeof ve.y=="number"?ve.y:0,Ye=typeof ve.size=="number"?ve.size:20;else if(Array.isArray(ve)&&ve.length>=3)xe=typeof ve[0]=="number"?ve[0]:Ce,pe=typeof ve[1]=="number"?ve[1]:0,Ye=typeof ve[2]=="number"?ve[2]:20;else if(typeof ve=="number")xe=Ce,pe=ve,Ye=Pe(Oe,Ce);else return;isFinite(xe)&&isFinite(pe)&&isFinite(Ye)&&(t=Math.min(t,xe),o=Math.max(o,xe),l=Math.min(l,pe),r=Math.max(r,pe),m=Math.min(m,Ye),v=Math.max(v,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,U.categories?.length-1||8)),l===r&&(l=Math.max(0,l-10),r=l+20);const b=o-t,W=r-l;let _,R,B,G;return H.value!==null?_=H.value:_=t-b*.1,Y.value!==null?R=Y.value:R=o+b*.1,Jt.value!==null&&typeof Jt.value=="number"?B=Jt.value:B=Math.max(0,l-W*.1),wt.value!==null&&typeof wt.value=="number"?G=wt.value:G=r+W*.1,{minX:_,maxX:R,minY:B,maxY:G,minSize:m,maxSize:v}},kl=t=>{if(It.value){const{minX:b,maxX:W}=Nt.value,_=W-b||1;return F.value.left+(t-b)/_*F.value.width}const{minX:o,maxX:l}=Nt.value,r=l-o;if(l===0||r===0)return F.value.left+F.value.width/2;const m=r/oe.value.scale,v=o-oe.value.offsetX/F.value.width*r,C=(t-v)/m;return F.value.left+C*F.value.width},On=t=>{const{minY:o,maxY:l}=Nt.value,r=l-o||1;return F.value.bottom-(t-o)/r*F.value.height},ka=t=>{const{minY:o,maxY:l}=aa.value,r=l-o||1;return F.value.bottom-(t-o)/r*F.value.height},un=(t,o)=>_n.value&&nl(t)==="secondary"?ka(o):On(o),qa=t=>{if(!It.value)return ae.value||4;const{maxSize:o}=Nt.value,l=Math.max(1,o),r=Math.min(1,Math.max(0,t/l));return V.value+r*(ce.value-V.value)},uo=(t,o=12,l="Arial, sans-serif")=>{if(typeof t!="string"||!t)return 0;if(typeof document>"u")return t.length*(o*.62);uo.canvas||(uo.canvas=document.createElement("canvas"));const r=uo.canvas.getContext("2d");return r?(r.font=`${o}px ${l}`,r.measureText(t).width):t.length*(o*.62)},Ca=(t,o,l=12)=>{if(typeof t!="string"||typeof o!="number"||o<=0||uo(t,l)<=o)return t;const r="..";if(uo(r,l)>=o)return r;let v=t.length;for(;v>0;){const C=`${t.slice(0,v)}${r}`;if(uo(C,l)<=o)return C;v-=1}return r},Za=e.computed(()=>ra.value.map(t=>({y:t.y}))),ba=e.computed(()=>!zt.value||!_t.value?[]:ra.value.map(t=>({y:t.y}))),sa=e.computed(()=>{if(It.value)return Ua();if(zt.value)return[];if(we.value==="bar"){if(ul.value){const Ne=[],{minY:Ie,maxY:Mt}=Nt.value,Wt=5,Gl=Mt-Ie||1;for(let Cl=0;Cl<=Wt;Cl++){const Ql=Ie+Gl*(Cl/Wt),Wo=kn(Ql);Ne.push({x:Wo,y:F.value.bottom+20,text:$l(Math.round(Ql))})}return Ne}const Ce=[],{maxX:xe}=Nt.value,pe=xe+1,Ye=5,Le=(F.value.width-Ye*2)/pe;for(let Ne=0;Ne<=xe;Ne++){const Ie=F.value.left+Ye+(Ne+.5)*Le;Ce.push({x:Ie,y:F.value.bottom+20,text:Ca(U.categories[Ne]||$("chart.fallback.item",{number:Ne+1}),Math.max(Le-8,24))})}return Ce}const t=[],{minX:o,maxX:l}=Nt.value,r=H.value!==null?H.value:o,m=Y.value!==null?Y.value:l,v=m-r||1,C=v/oe.value.scale,b=r-oe.value.offsetX/F.value.width*v,W=b+C,_=Math.max(0,Math.floor(b-2)),R=Math.min(m,Math.ceil(W+2)),B=R-_,G=F.value.width,Oe=Math.floor(G/60);let ve=1;B>Oe&&(ve=Math.ceil(B/Oe));for(let Ce=_;Ce<=R;Ce+=ve)if(Ce>=0&&Ce<=m){const xe=kl(Ce);xe>=F.value.left-100&&xe<=F.value.right+100&&t.push({x:xe,y:F.value.bottom+20,text:U.categories[Ce]||`Item ${Ce+1}`})}return t}),Ua=()=>{const t=[],{minX:o,maxX:l}=Nt.value,r=l-o||1,m=Math.min(8,Math.max(4,Math.floor(F.value.width/80)));for(let v=0;v<=m;v++){const C=o+r*v/m,b=kl(C);if(b>=F.value.left-10&&b<=F.value.right+10){const W=Math.round(C),_=U.categories?.[W];t.push({x:b,y:F.value.bottom+20,text:_||(Number.isInteger(C)?C.toString():C.toFixed(1))})}}return t},ra=e.computed(()=>{if(ul.value){const m=[],{maxX:v}=Nt.value;for(let C=0;C<=v;C++)m.push({x:F.value.left-10,y:Bn(C),text:Ca(U.categories[C]||`Item ${C+1}`,Math.max(F.value.left-28,40))});return m}const t=[],{minY:o,maxY:l}=Nt.value,r=5;for(let m=0;m<=r;m++){const v=o+(l-o)*(m/r),C=Math.round(v);t.push({x:F.value.left-10,y:On(v),text:$l(C)})}return t}),Xa=e.computed(()=>{if(!_n.value||ul.value)return[];const t=[],{minY:o,maxY:l}=aa.value,r=5;for(let m=0;m<=r;m++){const v=o+(l-o)*(m/r),C=Math.round(v);t.push({x:F.value.right+10,y:ka(v),text:$l(C)})}return t}),al=t=>{const o=w.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]},Ya=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 W=o.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(W){let _=W[1];_.length===3&&(_=_[0]+_[0]+_[1]+_[1]+_[2]+_[2]),l=parseInt(_.slice(0,2),16)/255,r=parseInt(_.slice(2,4),16)/255,m=parseInt(_.slice(4,6),16)/255}else if(typeof document<"u"){const _=document.createElement("span");_.style.color=o,_.style.display="none",document.body.appendChild(_);const R=getComputedStyle(_).color;document.body.removeChild(_);const B=R.match(/^rgb\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 return"#3a3a3a"}else return"#3a3a3a"}}return .2126*l+.7152*r+.0722*m>.5?"#3a3a3a":"#fafafa"},ia=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))),W=Math.max(0,Math.min(255,Math.floor(parseInt(v.slice(4,6),16)*.65)));return`#${[C,b,W].map(_=>_.toString(16).padStart(2,"0")).join("")}`}return o},ca=(t,o)=>{const r=Z.value?.stroke?.color;return r==null?ia(o):typeof r=="string"?r:Array.isArray(r)&&r.length?r[t%r.length]??ia(o):ia(o)},ua=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},wa=e.computed(()=>we.value==="line"||Ol.value?(Ol.value?U.series.filter(o=>(o.type||we.value)==="line"):Xt.value).map((o,l)=>{const r=U.series.findIndex(B=>B===o),m=[];let v=[];o.data.forEach((B,G)=>{B==null?v.length>0&&(m.push([...v]),v=[]):v.push({x:ul.value?kn(B):kl(G),y:ul.value?Bn(G):un(o,B),index:G})}),v.length>0&&m.push(v);let C="";m.forEach(B=>{if(B.length>0){let G="";lt.value?G=ro(B):G=`M ${B[0].x} ${B[0].y}`+B.slice(1).map(Ve=>` L ${Ve.x} ${Ve.y}`).join(""),C+=(C?" ":"")+G}});const b=m.reduce((B,G)=>B+ua(G),0),W=O.value.has(r),_=q.value===r,R=q.value!==null&&q.value!==r;return{path:C,color:al(r),strokeDasharray:dl(o),pathLength:b,seriesIndex:r,animationDelay:l*K.value,isHighlighted:_,isDimmed:R,isHidden:W}}):[]),xa=e.computed(()=>{if(!(we.value==="line"||Ol.value))return[];const t=Ol.value?U.series.filter(l=>(l.type||we.value)==="line"):Xt.value,o=[];return t.forEach((l,r)=>{const m=U.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,W=0;for(let _=v+1;_<l.data.length;_++){const R=l.data[_];if(R==null)W++;else{b=_;break}}if(W>0&&b!==-1){const _=l.data[b],R=ul.value?kn(C):kl(v),B=ul.value?Bn(v):un(l,C),G=ul.value?kn(_):kl(b),Ve=ul.value?Bn(b):un(l,_),Oe=O.value.has(m),ve=q.value===m,Ce=q.value!==null&&q.value!==m;o.push({path:`M ${R} ${B} L ${G} ${Ve}`,color:al(m),seriesIndex:m,animationDelay:r*K.value,isHighlighted:ve,isDimmed:Ce,isHidden:Oe,gapSize:W}),v=b-1}}}}),o}),ja=e.computed(()=>we.value==="line"||Ol.value?!bl.value||Tn.value||Rt.value.hasAnimated?[]:(Ol.value?U.series.filter(o=>(o.type||we.value)==="line"):Xt.value).map((o,l)=>{const r=U.series.findIndex(W=>W===o);let m="",v=null;o.data.forEach((W,_)=>{if(W!=null){const R={x:ul.value?kn(W):kl(_),y:ul.value?Bn(_):un(o,W)};v===null?m+=`M ${R.x} ${R.y}`:m+=` L ${R.x} ${R.y}`,v=R}else if(v!==null){const R=o.data.findIndex((B,G)=>G>_&&B!==null&&B!==void 0);if(R!==-1){const B={x:ul.value?kn(o.data[R]):kl(R),y:ul.value?Bn(R):un(o,o.data[R])};m+=` L ${B.x} ${B.y}`,v=B}}});const C=o.data.map((W,_)=>W==null?null:{x:ul.value?kn(W):kl(_),y:ul.value?Bn(_):un(o,W)}).filter(W=>W!==null),b=ua(C);return{path:m,pathLength:b,color:al(r),strokeDasharray:dl(o),animationDelay:l*K.value,seriesIndex:r}}):[]),Ka=e.computed(()=>{if(we.value!=="line")return[];const t=[];return Xt.value.forEach((o,l)=>{const r=q.value===l,m=q.value!==null&&q.value!==l,v=O.value.has(l);o.data.forEach((C,b)=>{C!=null&&t.push({x:kl(b),y:un(o,C),color:al(l),value:C,label:U.categories[b]||b.toString(),seriesName:o.name,categoryIndex:b,dataIndex:b,animationDelay:(l*o.data.length+b)*(K.value/8),isHighlighted:r,isDimmed:m,isHidden:v})})}),t}),Ga=e.computed(()=>{if(!Ol.value)return[];const t=[];return U.series.filter(l=>(l.type||we.value)==="line").forEach((l,r)=>{const m=U.series.findIndex(W=>W===l),v=q.value===m,C=q.value!==null&&q.value!==m,b=O.value.has(m);l.data.forEach((W,_)=>{W!=null&&t.push({x:kl(_),y:un(l,W),color:al(m),value:W,label:U.categories[_]||_.toString(),seriesName:l.name,categoryIndex:_,dataIndex:_,animationDelay:(r*l.data.length+_)*(K.value/8),isHighlighted:v,isDimmed:C,isHidden:b})})}),t}),Io=e.computed(()=>{if(!It.value)return[];const t=[];return Xt.value.forEach((o,l)=>{if(!o?.data?.length)return;const r=q.value,m=r!==null&&r===l,v=r!==null&&r!==l,C=O.value.has(l);o.data.forEach((b,W)=>{let _,R,B,G,Ve;if(typeof b=="object"&&b!==null&&!Array.isArray(b))_=typeof b.x=="number"?b.x:W,R=typeof b.y=="number"?b.y:0,B=typeof b.size=="number"?b.size:20,G=b.label||U.categories?.[W]||`Point ${W+1}`,Ve=b.image||b.imageUrl;else if(Array.isArray(b)&&b.length>=3)_=typeof b[0]=="number"?b[0]:W,R=typeof b[1]=="number"?b[1]:0,B=typeof b[2]=="number"?b[2]:20,G=b[3]||U.categories?.[W]||`Point ${W+1}`,Ve=b[4];else if(typeof b=="number")_=W,R=b,B=Pe(l,W),G=U.categories?.[W]||`Point ${W+1}`;else return;!isFinite(_)||!isFinite(R)||!isFinite(B)||t.push({x:kl(_),y:On(R),radius:qa(B),originalX:_,originalY:R,originalSize:B,color:al(l),seriesName:o.name||`Series ${l+1}`,label:G,imageUrl:Ve,seriesIndex:l,dataIndex:W,categoryIndex:Math.round(_),isHighlighted:m,isDimmed:v,isHidden:C,opacity:le.value})})}),t}),da=e.computed(()=>we.value!=="area"?[]:Xt.value.map((t,o)=>{const l=[];let r=[];if(t.data.forEach((B,G)=>{B==null?r.length>0&&(l.push([...r]),r=[]):r.push({x:kl(G),y:un(t,B),index:G})}),r.length>0&&l.push(r),l.length===0)return{linePath:"",areaPath:"",color:al(o),isHidden:O.value.has(o)};const m=F.value.bottom+1;let v="",C="";l.forEach((B,G)=>{if(B.length===0)return;let Ve=`M ${B[0].x} ${B[0].y}`;lt.value&&B.length>1?Ve=ro(B):B.slice(1).forEach(ve=>{Ve+=` L ${ve.x} ${ve.y}`}),v+=(v?" ":"")+Ve;let Oe=`M ${B[0].x} ${m}`;if(Oe+=` L ${B[0].x} ${B[0].y}`,lt.value&&B.length>1){const ve=ro(B),Ce=ve.substring(ve.indexOf("C")||ve.indexOf("Q")||ve.indexOf("L"));Ce?Oe+=" "+Ce:B.slice(1).forEach(xe=>{Oe+=` L ${xe.x} ${xe.y}`})}else B.slice(1).forEach(ve=>{Oe+=` L ${ve.x} ${ve.y}`});Oe+=` L ${B[B.length-1].x} ${m} Z`,C+=(C?" ":"")+Oe});const b=q.value===o,W=q.value!==null&&q.value!==o,_=O.value.has(o),R=l.reduce((B,G)=>B+ua(G),0);return{linePath:v,areaPath:C,color:al(o),pathLength:R,isHighlighted:b,isDimmed:W,isHidden:_}})),Ea=e.computed(()=>{if(!(["bar"].includes(we.value)||Ol.value))return[];const t=[],{maxX:o}=Nt.value,l=Ol.value?U.series.filter(m=>(m.type||we.value)==="bar"):Xt.value,r=l.length;if(ul.value){const m=o+1,C=F.value.height/m,b=C*(2/3),W=Math.min(4,b/r*.15),_=b-(r-1)*W,R=Math.max(4,_/r);l.forEach((B,G)=>{const Ve=U.series.findIndex(xe=>xe===B),Oe=q.value===Ve,ve=q.value!==null&&q.value!==Ve,Ce=O.value.has(Ve);B.data.forEach((xe,pe)=>{if(xe==null||typeof xe!="number"||!isFinite(xe))return;const Le=F.value.top+(pe+.5)*C-b/2+G*(R+W),Ne=F.value.left,Ie=Math.abs(kn(xe)-F.value.left);let Mt="";if(lt.value&&Ie>0){const Wt=Math.min(M.value,R/2,Ie/2);Mt=[`M ${Ne} ${Le}`,`L ${Ne+Ie-Wt} ${Le}`,`Q ${Ne+Ie} ${Le} ${Ne+Ie} ${Le+Wt}`,`L ${Ne+Ie} ${Le+R-Wt}`,`Q ${Ne+Ie} ${Le+R} ${Ne+Ie-Wt} ${Le+R}`,`L ${Ne} ${Le+R}`,"Z"].join(" ")}t.push({x:Ne,y:Le,width:Ie,height:R,color:al(r===1?pe:Ve),value:xe,label:U.categories[pe]||pe.toString(),seriesName:B.name,animationDelay:(G*l.length+pe)*(K.value/4),isHighlighted:Oe,isDimmed:ve,isHidden:Ce,barPath:Mt,isSmooth:lt.value&&Ie>0})})})}else{const m=o+1,C=F.value.width/m,b=C*.8,W=b/r,_=W*.05,R=W-_;l.forEach((B,G)=>{const Ve=U.series.findIndex(xe=>xe===B),Oe=q.value===Ve,ve=q.value!==null&&q.value!==Ve,Ce=O.value.has(Ve);B.data.forEach((xe,pe)=>{if(xe==null||typeof xe!="number"||!isFinite(xe))return;const Le=F.value.left+(pe+.5)*C-b/2+G*W+_/2,Ne=On(Math.max(0,xe)),Ie=Math.abs(On(0)-On(xe));let Mt="";if(lt.value&&Ie>0){const Wt=Math.min(M.value,R/2,Ie/2);Mt=[`M ${Le} ${Ne+Ie}`,`L ${Le} ${Ne+Wt}`,`Q ${Le} ${Ne} ${Le+Wt} ${Ne}`,`L ${Le+R-Wt} ${Ne}`,`Q ${Le+R} ${Ne} ${Le+R} ${Ne+Wt}`,`L ${Le+R} ${Ne+Ie}`,"Z"].join(" ")}t.push({x:Le,y:Ne,width:R,height:Ie,color:al(r===1?pe:Ve),value:xe,label:U.categories[pe]||pe.toString(),seriesName:B.name,animationDelay:(G*l.length+pe)*(K.value/4),isHighlighted:Oe,isDimmed:ve,isHidden:Ce,barPath:Mt,isSmooth:lt.value&&Ie>0})})})}return t}),Ln=e.computed(()=>{if(!El.value)return[];const t=Xt.value.map((C,b)=>({series:C,originalIndex:b})).filter(({originalIndex:C})=>!O.value.has(C));if(t.length===0)return[];let o=we.value==="semi-radial"?Math.PI:-Math.PI/2;const l=we.value==="semi-radial"?Math.PI:Math.PI*2,r=[],m=(C,b,W,_,R,B)=>{const G=C+(b-C)/2,Ve=b-C,Oe=Pt.value+Math.cos(C)*hl.value,ve=$t.value+Math.sin(C)*hl.value,Ce=Pt.value+Math.cos(b)*hl.value,xe=$t.value+Math.sin(b)*hl.value,pe=Pt.value+Math.cos(b)*at.value,Ye=$t.value+Math.sin(b)*at.value,ze=Pt.value+Math.cos(C)*at.value,Le=$t.value+Math.sin(C)*at.value,Ne=Ve>Math.PI?1:0,Ie=[`M ${Oe} ${ve}`,`A ${hl.value} ${hl.value} 0 ${Ne} 1 ${Ce} ${xe}`,`L ${pe} ${Ye}`,`A ${at.value} ${at.value} 0 ${Ne} 0 ${ze} ${Le}`,"Z"].join(" "),Mt=B||al(W);return{path:Ie,color:Mt,strokeWidth:Q.value,strokeColor:ca(r.length,Mt),value:R,seriesName:_,opacity:.8,isHighlighted:q.value===W,isDimmed:q.value!==null&&q.value!==W,isHidden:!1,startAngle:C,endAngle:b,midAngle:G}};if(Pn.value){const{series:C,originalIndex:b}=t[0],W=Number(C?.data?.[0]??0),_=Number.isFinite(W)?Math.min(Math.max(W,0),100):0,R=Z.value,B=Math.min(Math.max(Number(R?.miniRadial?.minVisiblePercent??1),0),100),Ve=(_<=0?B:_)/100*l,Oe=Number(R?.miniRadial?.thresholds?.low??33),ve=Number(R?.miniRadial?.thresholds?.medium??66),Ce=R?.miniRadial?.colors?.low||"#E53E3E",xe=R?.miniRadial?.colors?.medium||"#ED8936",pe=R?.miniRadial?.colors?.high||"#38A169",Ye=_<=Oe?Ce:_<=ve?xe:pe,ze=R?.miniRadial?.trackColor||"#E5E7EB",Le=C?.name||"Score";return r.push(m(o,o+l-.001,b+1,"Track",100,ze)),r.push(m(o,o+Ve,b,Le,_,Ye)),r}if(t.length===1){const{series:C,originalIndex:b}=t[0],W=C.data[0]||0,_=o,R=o+l-.001,B=_+l/2,G=Pt.value+Math.cos(_)*hl.value,Ve=$t.value+Math.sin(_)*hl.value,Oe=Pt.value+Math.cos(R)*hl.value,ve=$t.value+Math.sin(R)*hl.value,Ce=Pt.value+Math.cos(R)*at.value,xe=$t.value+Math.sin(R)*at.value,pe=Pt.value+Math.cos(_)*at.value,Ye=$t.value+Math.sin(_)*at.value,ze=1,Le=[`M ${G} ${Ve}`,`A ${hl.value} ${hl.value} 0 ${ze} 1 ${Oe} ${ve}`,`L ${Ce} ${xe}`,`A ${at.value} ${at.value} 0 ${ze} 0 ${pe} ${Ye}`,"Z"].join(" "),Ne=al(b);return r.push({path:Le,color:Ne,strokeWidth:Q.value,strokeColor:ca(0,Ne),value:W,seriesName:C.name,opacity:.8,isHighlighted:q.value===b,isDimmed:!1,isHidden:!1,startAngle:_,endAngle:R,midAngle:B}),r}if(n.value&&t.length===2){const C=t[0],b=t[1],W=Math.min(100,Math.max(0,C.series.data[0]||0)),_=W/100*l;return r.push(m(o,o+_,C.originalIndex,C.series.name,W)),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 W=C.data[0]||0,_=W/v*l,R=o,B=o+_,G=R+_/2,Ve=Pt.value+Math.cos(R)*hl.value,Oe=$t.value+Math.sin(R)*hl.value,ve=Pt.value+Math.cos(B)*hl.value,Ce=$t.value+Math.sin(B)*hl.value,xe=Pt.value+Math.cos(B)*at.value,pe=$t.value+Math.sin(B)*at.value,Ye=Pt.value+Math.cos(R)*at.value,ze=$t.value+Math.sin(R)*at.value,Le=_>Math.PI?1:0,Ne=[`M ${Ve} ${Oe}`,`A ${hl.value} ${hl.value} 0 ${Le} 1 ${ve} ${Ce}`,`L ${xe} ${pe}`,`A ${at.value} ${at.value} 0 ${Le} 0 ${Ye} ${ze}`,"Z"].join(" "),Ie=al(b);r.push({path:Ne,color:Ie,strokeWidth:Q.value,strokeColor:ca(r.length,Ie),value:W,seriesName:C.name,opacity:.8,isHighlighted:q.value===b,isDimmed:q.value!==null&&q.value!==b,isHidden:!1,startAngle:R,endAngle:B,midAngle:G}),o=B}),r)}),Qa=e.computed(()=>{const t=Ln.value;return n.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((o,l)=>({segment:o,originalIndex:l}))}),Ja=e.computed(()=>{if(!Ll.value||!El.value)return[];const t=Sn.value,o=Hn.value,l=vn.value,r=Vl.value,m=15,v=t*1.3,C=.55,b=(B,G)=>{const Ve=Pt.value+Math.cos(B.midAngle)*at.value,Oe=$t.value+Math.sin(B.midAngle)*at.value,ve=Pt.value+Math.cos(B.midAngle)*(at.value+o),Ce=$t.value+Math.sin(B.midAngle)*(at.value+o),pe=ve+l*(G?1:-1),Ye=G?ve+m:ve-m,ze=Ce-r,Le=`${B.seriesName}: ${$l(B.value)}`,Ne=Le.length*t*C;return{pointerStartX:Ve,pointerStartY:Oe,pointerEndX:ve,pointerEndY:Ce,horizontalEndX:pe,horizontalEndY:Ce,textX:Ye,textY:ze,text:Le,textWidth:Ne,textAnchor:G?"start":"end",isRightSide:G,pointerLineLength:Math.hypot(ve-Ve,Ce-Oe),horizontalLineLength:Math.hypot(pe-ve,0)}},W=(B,G)=>{const Ve=Math.abs(B.textY-G.textY)<v,Oe=B.isRightSide?B.textX:B.textX-B.textWidth,ve=B.isRightSide?B.textX+B.textWidth:B.textX,Ce=G.isRightSide?G.textX:G.textX-G.textWidth,xe=G.isRightSide?G.textX+G.textWidth:G.textX,pe=Oe<xe&&Ce<ve;return Ve&&pe},_=Ln.value.filter(B=>!B.isHidden),R=[];for(let B=0;B<_.length;B++){const G=_[B];let Ve=Math.cos(G.midAngle)>=0;if(B>0){const ve=R[B-1],Ce=b(G,Ve);W(ve,Ce)&&(Ve=!Ve)}const Oe=b(G,Ve);R.push({...Oe,color:G.color,isHighlighted:G.isHighlighted,isDimmed:G.isDimmed})}return R}),es=t=>{if(!t||t.isHidden)return 0;const o=t.opacity||le.value||.7;return q.value===null||q.value===void 0?o:q.value!==null?t.seriesIndex===q.value?Math.min(1,o+.1):Math.max(.5,o*.8):o},ts=t=>{if(!t||t.isHidden)return 0;const o=t.radius>20?.9:.8;return q.value!==null?t.seriesIndex===q.value?Math.min(1,o+.1):o*.7:o},Sa=(t,o)=>{if(t)try{if(q.value===t.seriesIndex?q.value=null:q.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const l=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:o,chartId:U.chartId}});window.dispatchEvent(l)}}catch(l){console.error("Error in onBubbleClick:",l)}},ls=(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(" ")},Va=(t,o)=>{if(!t||(o.stopPropagation(),Po.value=!0,q.value=t.seriesIndex,Ae.value.show=!1,!Lt.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>Be.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 W=y.value,_=g.value,R=W.map(B=>{const G=_[B]||B,Ve=Na(B,t);return Ve?{seriesName:t.seriesName,label:t.label,value:`${G}: ${Ve}`,color:t.color}:null}).filter(Boolean);Fe.value={show:!0,x:m,y:v,title:t.label||t.seriesName||"",value:"",bubbleData:R,categoryIndex:void 0,spiderAreas:[]}},Na=(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=x.value[t];if(typeof r=="function")return r(l,o);if(typeof l=="number"){const m=l.toFixed(1);return Vt.value?m+Vt.value:m}return l?.toString()||""},ns=()=>{if(!It.value||!Ae.value.data||Ae.value.data.length===0)return"Bubbles";const t=[],o=new Set;return Ae.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"},Ba=(t,o)=>{t&&(Po.value=!1,q.value=null,Fe.value.show=!1,Fe.value.bubbleData=[])},os=(t,o)=>{const l=o.target.closest(".dss-custom-chart-container");if(!l)return;const r=l.getBoundingClientRect(),m=ao(t.categoryIndex),v=t.description||t.comment||"";let C=o.clientX-r.left+15,b=o.clientY-r.top-10;const W=200,_=v?80:50;C+W>Be.value&&(C=o.clientX-r.left-W-15),b+_>rt.value&&(b=o.clientY-r.top-_-10),C<0&&(C=10),b<0&&(b=10),Qt.value={show:!0,x:C,y:b,categoryValue:m,description:v}},as=()=>{Qt.value.show=!1},mo=e.computed(()=>U.categories.length||Math.max(...Ot.value.map(t=>t.data.length))),ss=e.computed(()=>{let t=0;return Ot.value.forEach(o=>{o.data.forEach(l=>{typeof l=="number"&&(t=Math.max(t,l))})}),t||100}),Ma=e.computed(()=>{const t=[],o=mo.value;for(let l=0;l<o;l++){const r=l*2*Math.PI/o-Math.PI/2,m=Pt.value+Math.cos(r)*at.value,v=$t.value+Math.sin(r)*at.value;t.push({x:m,y:v,angle:r,index:l})}return t}),rs=e.computed(()=>{const t=[],o=mo.value;return Ma.value.forEach((l,r)=>{const m=at.value+15,v=r*2*Math.PI/o-Math.PI/2,C=Pt.value+Math.cos(v)*m,b=$t.value+Math.sin(v)*m+5;let W="middle",_="middle";Math.abs(Math.cos(v))>.5&&(W=Math.cos(v)>0?"start":"end"),Math.abs(Math.sin(v))>.5&&(_=Math.sin(v)>0?"hanging":"auto"),t.push({x:C,y:b,text:U.categories[r]||`Axis ${r+1}`,anchor:W,baseline:_})}),t}),is=e.ref(new Set),cs=(t,o,l)=>{const r=`current-${l}`,m=is.value.has(r),v=o.fillOpacity??mt.value;return!m&&q.value===null?v:o.isHighlighted||m?o.isComparison?v:v+.15:o.isDimmed?v*.3:v},_a=e.computed(()=>{if(!cl.value)return[];const t=[],o=mo.value;return Xt.value.map((r,m)=>({series:r,seriesIndex:m})).sort((r,m)=>{const v=Ht(r.series)?0:1,C=Ht(m.series)?0:1;return v-C}).forEach(({series:r,seriesIndex:m})=>{const v=Ht(r),C=[],b=[],W=[],_=q.value===m,R=q.value!==null&&q.value!==m,B=O.value.has(m);for(let G=0;G<o;G++){const Ve=r.data[G]||0,ve=Ve/ss.value*at.value,Ce=G*2*Math.PI/o-Math.PI/2,xe=Pt.value+Math.cos(Ce)*ve,pe=$t.value+Math.sin(Ce)*ve;C.push(`${xe},${pe}`),b.push({x:xe,y:pe}),W.push({x:xe,y:pe,value:Ve,label:U.categories[G]||`Axis ${G+1}`,seriesName:r.name})}t.push({points:C.join(" "),polygonPoints:b,dataPoints:W,color:cn(r,m),fillOpacity:v?ol.value.fillOpacity:mt.value,strokeDasharray:v?dl(r)||ol.value.strokeDasharray:null,pointRadius:nn(r,v),seriesName:r.name,value:`${r.name}: ${r.data.join(", ")}`,isHighlighted:_,isDimmed:R,isHidden:B,isComparison:v,seriesIndex:m})}),t}),us=(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,W=o[m].y;C>t.y!=W>t.y&&t.x<(b-v)*(t.y-C)/(W-C)+v&&(l=!l)}return l},ds=t=>{if(!cl.value)return;const o=t.currentTarget.closest(".dss-custom-chart-container");if(!o)return;const l=o.getBoundingClientRect(),r=te.value?.getBoundingClientRect();if(!r)return;const m=t.clientX-r.left,v=t.clientY-r.top,C=_a.value.filter(b=>b.isHidden?!1:us({x:m,y:v},b.polygonPoints));if(C.length>0){C.length,q.value=C[0].seriesIndex;const b=t.clientX-l.left+10,W=t.clientY-l.top-10,_=C.length>1?460:260,R=70+mo.value*20;let B=b,G=W;B+_>Be.value&&(B=t.clientX-l.left-_-10),G+R>rt.value&&(G=t.clientY-l.top-R-10),B<0&&(B=10),G<0&&(G=10);const Ve=C.map(Oe=>({seriesName:Oe.seriesName,color:Oe.color,points:Oe.dataPoints.map(ve=>({label:ve.label,value:$l(ve.value)}))}));Fe.value={show:!0,x:B,y:G,title:"",value:"",bubbleData:[],spiderAreas:Ve}}else bn()},zo=e.computed(()=>{const t=Z.value;return t.logos.map((o,l)=>{const r=U.series[o.seriesIndex];if(!r||!r.data||r.data.length===0||O.value.has(o.seriesIndex))return null;let m,v;if(Ml.value){let b=-1,W=null;for(let R=r.data.length-1;R>=0;R--)if(r.data[R]!==null&&r.data[R]!==void 0){b=R,W=r.data[R];break}if(b===-1||W===null)return null;const _=r.data.map((R,B)=>R==null?null:{x:kl(B),y:un(r,R),index:B}).filter(R=>R!==null);if(t.animations.enabled&&!Tn.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(Rt.value.isAnimating||!Rt.value.hasAnimated))if(Rt.value.isAnimating){const R=Rt.value.currentFrame/Rt.value.totalFrames,B=va(t.animations.easing,Math.min(R,1)),G=Cs(_,B);m=G.x+(o.offsetX||0),v=G.y+(o.offsetY||0)}else m=_[0].x+(o.offsetX||0),v=_[0].y+(o.offsetY||0);else m=kl(b)+(o.offsetX||0),v=On(W)+(o.offsetY||0)}else if(El.value||cl.value){const b=Math.PI*2/t.logos.length*l;m=Pt.value+Math.cos(b)*(at.value+30)+(o.offsetX||0),v=$t.value+Math.sin(b)*(at.value+30)+(o.offsetY||0)}return{...o,x:m,y:v,seriesIndex:o.seriesIndex}}).filter(Boolean)}),ms=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")},ps=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const o=document.querySelector(`.dss-logo-image-${t}`);o&&(o.style.display="none")},ma=t=>{O.value.has(t)?O.value.delete(t):O.value.add(t)},vs=e.computed(()=>{if(!Fe.value.show&&!($e.value&&Ae.value.show&&!oe.value.isZooming))return{display:"none"};let t,o;if($e.value&&Ae.value.show&&!oe.value.isZooming){t=Ae.value.x+15,o=F.value.top;const l=It.value?200:150;t+l>Be.value&&(t=Ae.value.x-l-15),t<0&&(t=10),o<10&&(o=10)}else t=Fe.value.x,o=Fe.value.y;return{left:t+"px",top:o+"px"}}),Wn=(t,o)=>{if(!Lt.value||No.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,W=Be.value,_=rt.value;m+C>W&&(m=o.clientX-r.left-C-10),v+b>_&&(v=o.clientY-r.top-b-10),m<0&&(m=10),v<0&&(v=10);let R;typeof t.categoryIndex=="number"?R=t.categoryIndex:typeof t.dataIndex=="number"?R=t.dataIndex:t.label&&U.categories.includes(t.label)&&(R=U.categories.indexOf(t.label));let B=t.seriesName||t.label||"";(ul.value||we.value==="bar")&&t.label&&(B=t.label),t.tooltipTitle&&(B=t.tooltipTitle),Fe.value={show:!0,x:m,y:v,title:B,value:$l(t.value)||"",categoryIndex:R,spiderAreas:[]}},pa=e.ref(!1),Po=e.ref(!1),bn=()=>{Fe.value.show=!1,Fe.value.spiderAreas=[],Fe.value.bubbleData=[],Ae.value.show=!1,pa.value||(q.value=null)},No=e.ref(!1),Bo=(t,o)=>{No.value=!0,Fe.value.show=!1,Ae.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>Be.value&&(m=o.clientX-r.left-C-15),m<0&&(m=10),v<0&&(v=10),Rl.value={show:!0,x:m,y:v,content:t.texts,count:t.totalCount}},Mo=()=>{No.value=!1,Rl.value.show=!1},Rt=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),va=(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}},Tn=e.computed(()=>vt.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),$a=()=>{if(!bl.value||Tn.value){Rt.value.hasAnimated=!0,p.value&&(d.value=1);return}p.value&&(d.value=0),Rt.value.isAnimating=!0,Rt.value.currentFrame=0,Rt.value.totalFrames=Math.ceil(A.value/16.67);const t=()=>{const o=Rt.value.currentFrame/Rt.value.totalFrames,l=va(L.value,Math.min(o,1));fs(l),p.value&&(d.value=l),o<1?(Rt.value.currentFrame++,Rt.value.animationId=requestAnimationFrame(t)):hs()};Rt.value.animationId=requestAnimationFrame(t)},fs=t=>{const o=P.value;o&&o.style.setProperty("--dss-animation-progress",t)},hs=()=>{Rt.value.isAnimating=!1,Rt.value.hasAnimated=!0,p.value&&(d.value=1),Rt.value.animationId&&(cancelAnimationFrame(Rt.value.animationId),Rt.value.animationId=null)},fa=e.computed(()=>!El.value||Rt.value.hasAnimated?!0:p.value?d.value>=1:Cn.value?eo.value>=1:!0),La=e.computed(()=>Ll.value&&fa.value),Oo=e.ref(!1);e.watch(La,t=>{t?(Oo.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Oo.value=!0})})):Oo.value=!1},{immediate:!0});const gs=e.computed(()=>{if(!bl.value||Tn.value||Rt.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${A.value}ms`,t["--dss-animation-easing"]=ys(L.value),t["--dss-stagger-delay"]=`${K.value}ms`,t}),ys=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",ks=()=>{if(!bl.value||Tn.value)return"";const t=["dss-chart-animated"];return Rt.value.hasAnimated||t.push(`dss-animate-${pn.value}`),Rt.value.hasAnimated||(El.value&&we.value!=="semi-radial"?t.push("dss-animate-fill"):El.value||t.push(`dss-animate-${pn.value}`)),Rt.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>U.series,(t,o)=>{He.value&&o&&Rt.value.hasAnimated&&(Rt.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>$a(),I.value)}))},{deep:!0}),e.watch(()=>oe.value.isZooming,(t,o)=>{o&&!t&&setTimeout(()=>{ko()},50)}),e.watch(()=>[oe.value.scale,oe.value.offsetX],()=>{!oe.value.isZooming&&!oe.value.isDragging&&ko()},{flush:"post"}),e.watch([el,ie],([t,o])=>{oe.value.minScale=t,oe.value.maxScale=o,(oe.value.scale<t||oe.value.scale>o)&&Jn()},{immediate:!0}),e.watch(()=>U.locale,t=>{t&&t!==N.value&&(N.value=t)},{immediate:!0}),e.watch(()=>ct.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",wo)}):document.removeEventListener("click",wo)}),e.onMounted(()=>{q.value=null,p.value&&(!bl.value||Tn.value)&&(d.value=1),Do(),e.nextTick(ut),P.value&&typeof ResizeObserver<"u"&&(J=new ResizeObserver(t=>{const o=t[0];!o||!o.contentRect||(j&&cancelAnimationFrame(j),j=requestAnimationFrame(()=>{j=null;const{width:l,height:r}=o.contentRect;be.value=Math.round(l),ye.value=Math.round(r),f.value&&(Je.value=f.value.offsetHeight||ge)}))}),J.observe(P.value)),bl.value&&!Tn.value?we.value==="semi-radial"?setTimeout(()=>z(),I.value):setTimeout(()=>$a(),I.value):(Rt.value.hasAnimated=!0,we.value==="semi-radial"&&(eo.value=1)),document.addEventListener("mousemove",Ta),document.addEventListener("mouseup",Aa),document.addEventListener("click",bo)}),e.onUnmounted(()=>{me&&(me(),me=null),j&&cancelAnimationFrame(j),J&&P.value&&(J.unobserve(P.value),J.disconnect(),J=null),Rt.value.animationId&&cancelAnimationFrame(Rt.value.animationId),D&&(cancelAnimationFrame(D),D=null),oe.value.zoomTimeout&&clearTimeout(oe.value.zoomTimeout),document.removeEventListener("mousemove",Ta),document.removeEventListener("mouseup",Aa),document.removeEventListener("click",bo),document.removeEventListener("click",wo)});const Ta=t=>{if(oe.value.isDragging&&oe.value.scale>1&&Ml.value){Ae.value.show=!1;const o=t.clientX-oe.value.lastMouseX,{minX:l,maxX:r}=Nt.value,m=r-l||1,C=o*.8;oe.value.offsetX+=C;const b=m/oe.value.scale,W=m-b,_=0,R=-W/m*F.value.width,B=_;oe.value.offsetX=Math.max(R,Math.min(B,oe.value.offsetX)),oe.value.lastMouseX=t.clientX,oe.value.lastMouseY=t.clientY}},Aa=()=>{oe.value.isDragging&&(oe.value.isDragging=!1,setTimeout(()=>{!oe.value.isDragging&&oe.value.isZooming},100))},Cs=(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 W=l[b].x-l[b-1].x,_=l[b].y-l[b-1].y,R=Math.sqrt(W*W+_*_);m.push(R),r+=R}const v=r*o;let C=0;for(let b=0;b<m.length;b++){const W=C+m[b];if(v<=W){const _=(v-C)/m[b],R=l[b],B=l[b+1];return{x:R.x+(B.x-R.x)*_,y:R.y+(B.y-R.y)*_}}C=W}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",[ks(),{"dss-chart-fill-width":Te.value,"dss-chart-fill-height":qe.value,"dss-chart-compact":El.value&&!he.value}]]),style:e.normalizeStyle({width:Te.value?"100%":Be.value+"px",height:Yt.value,...Te.value||qe.value?{overflow:El.value?"visible":(zt.value,"hidden"),maxWidth:"100%",maxHeight:"100%"}:{},...gs.value,cursor:oa()}),"data-chart-type":we.value,ref_key:"containerEl",ref:P,onWheel:Ro,onMousedown:so,onMousemove:Ko,onMouseup:xo,onMouseleave:To,onDblclick:Jn,onContextmenu:e.withModifiers(Qo,["prevent"]),onClick:e.withModifiers(hn,["left"]),onWheelCapture:Ro},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:f},[e.createElementVNode("div",Sr,[dt.value?(e.openBlock(),e.createElementBlock("div",Vr,e.toDisplayString(dt.value),1)):e.createCommentVNode("",!0),et.value?(e.openBlock(),e.createElementBlock("div",Nr,e.toDisplayString(et.value),1)):e.createCommentVNode("",!0)]),he.value&&Xe.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Ke.value==="horizontal","dss-legend-vertical":Ke.value==="vertical","dss-legend-top":Xe.value==="top","dss-legend-bottom":Xe.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":O.value.has(r),"dss-legend-hovered":q.value===r,"dss-legend-dimmed":q.value!==null&&q.value!==r}]),onClick:m=>ma(r),onMouseenter:m=>jn(r),onMouseleave:no,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":cl.value&&Ht(l)}]),style:e.normalizeStyle({backgroundColor:cl.value&&Ht(l)?"transparent":Fl(l,r),borderColor:Fl(l,r)})},null,6),e.createElementVNode("span",Mr,e.toDisplayString(l.name),1)],46,Br))),128))],2)):e.createCommentVNode("",!0),he.value&&(Xe.value==="left"||Xe.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":Xe.value==="left","dss-legend-right":Xe.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":O.value.has(r),"dss-legend-hovered":q.value===r,"dss-legend-dimmed":q.value!==null&&q.value!==r}]),onClick:m=>ma(r),onMouseenter:m=>jn(r),onMouseleave:no,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":cl.value&&Ht(l)}]),style:e.normalizeStyle({backgroundColor:cl.value&&Ht(l)?"transparent":Fl(l,r),borderColor:Fl(l,r)})},null,6),e.createElementVNode("span",$r,e.toDisplayString(l.name),1)],46,_r))),128))],2)):e.createCommentVNode("",!0)],512),S.showAddMarkerButton&&Kt.value&&Dt.value.addMarker&&(Ml.value||It.value)&&!zt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Qn,title:e.unref($)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Sl.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,Tr),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,Lr)):e.createCommentVNode("",!0),e.createElementVNode("div",Ar,[It.value&&Et.value?(e.openBlock(),e.createElementBlock("div",Dr,"Bubble size: "+e.toDisplayString(Et.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Be.value,height:rt.value,class:"dss-chart-svg","data-smooth":lt.value,"data-animated":bl.value,ref_key:"svgEl",ref:te},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:ue.value},[e.createElementVNode("rect",{x:0,y:F.value.top,width:Be.value,height:F.value.height*4},null,8,Fr)],8,Rr),Cn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:co.value},[e.createElementVNode("path",{d:s.value},null,8,zr)],8,Ir)):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:u.value},[e.createElementVNode("path",{d:h.value},null,8,Or)],8,Pr)):e.createCommentVNode("",!0)]),Ml.value||It.value?(e.openBlock(),e.createElementBlock("g",Wr,[ne.value&&!zt.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":Se.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Za.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${r}`,x1:F.value.left,x2:F.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,Zr))),128))],8,qr)):e.createCommentVNode("",!0),zt.value&&ba.value.length?(e.openBlock(),e.createElementBlock("g",{key:1,class:"dss-stepbar-axis-bars dss-stepbar-axis-bars--y-only","clip-path":Se.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ba.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`stepbar-axis-bar-${r}`,x1:F.value.left,x2:F.value.right,y1:l.y,y2:l.y,stroke:Tt.value,"stroke-width":gl.value,"stroke-dasharray":Jl.value,opacity:St.value},null,8,Xr))),128))],8,Ur)):e.createCommentVNode("",!0),e.createElementVNode("g",Yr,[e.createElementVNode("line",{x1:F.value.left,x2:F.value.right,y1:F.value.bottom,y2:F.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,jr),e.createElementVNode("line",{x1:F.value.left,x2:F.value.left,y1:F.value.top,y2:F.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Kr),_n.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:F.value.right,x2:F.value.right,y1:F.value.top,y2:F.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Gr)):e.createCommentVNode("",!0)]),e.createElementVNode("g",Qr,[zt.value?e.createCommentVNode("",!0):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(sa.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,Jr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ra.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,ei))),128)),_n.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Xa.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,ti))),128)):e.createCommentVNode("",!0),tl.value?(e.openBlock(),e.createElementBlock("text",{key:2,x:F.value.left+F.value.width/2,y:F.value.bottom+45,"text-anchor":"middle","font-size":"14",fill:"#666"},e.toDisplayString(tl.value),9,li)):e.createCommentVNode("",!0),ft.value?(e.openBlock(),e.createElementBlock("text",{key:3,x:15,y:F.value.top+12+F.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(-90, 15, ${F.value.top+F.value.height/2})`},e.toDisplayString(ft.value),9,ni)):e.createCommentVNode("",!0),_n.value&&ht.value?(e.openBlock(),e.createElementBlock("text",{key:4,x:Be.value-15,y:F.value.top+12+F.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(90, ${Be.value-15}, ${F.value.top+F.value.height/2})`},e.toDisplayString(ht.value),9,oi)):e.createCommentVNode("",!0)]),vl.value.length>0?(e.openBlock(),e.createElementBlock("g",ai,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vl.value,l=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${l.categoryIndex}`},[e.createElementVNode("g",{"clip-path":Se.value},[l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:l.x,x2:l.x,y1:F.value.bottom,y2:F.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>Bo(l,r),onMouseleave:Mo},null,40,ri)):e.createCommentVNode("",!0),l.hasAuto&&!l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:l.x,x2:l.x,y1:F.value.bottom,y2:F.value.top,stroke:"#a1d499","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>Bo(l,r),onMouseleave:Mo},null,40,ii)):e.createCommentVNode("",!0),l.hasAuto&&l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:l.x,x2:l.x,y1:F.value.bottom,y2:F.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>Bo(l,r),onMouseleave:Mo},null,40,ci)):e.createCommentVNode("",!0)],8,si),l.hasManual&&l.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x+8,cy:Math.max(15,F.value.top-10),r:"14",fill:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:r=>Bo(l,r),onMouseleave:Mo},null,40,ui)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:l.x,cy:Math.max(15,F.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=>Bo(l,r),onMouseleave:Mo},null,40,di),e.createElementVNode("text",{x:l.x,y:Math.max(15,F.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,mi)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":Se.value},[Ol.value?(e.openBlock(),e.createElementBlock("g",vi,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":ul.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ea.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=>Wn(l,m),onMouseleave:bn},null,46,fi)):(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=>Wn(l,m),onMouseleave:bn},null,46,hi))],64))),128))],2),e.createElementVNode("g",gi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wa.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?X.value+2:X.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,yi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xa.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?X.value+2:X.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,ki))),128)),ae.value>0||Ee.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Ga.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${r}`,cx:l.x,cy:l.y,r:bt(l.isHighlighted?je(l,ae.value)+2:je(l,ae.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=>Wn(l,m),onMouseleave:bn},null,46,Ci))),128)):e.createCommentVNode("",!0)])])):we.value==="line"?(e.openBlock(),e.createElementBlock("g",bi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ja.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${r}`,d:l.path,stroke:l.color,"stroke-width":X.value,"stroke-dasharray":l.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":Rt.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,wi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wa.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?X.value+2:X.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,xi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xa.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?X.value+2:X.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,Ei))),128)),ae.value>0||Ee.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Ka.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${r}`,cx:l.x,cy:l.y,r:bt(l.isHighlighted?je(l,ae.value)+2:je(l,ae.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=>Wn(l,m),onMouseleave:bn},null,46,Si))),128)):e.createCommentVNode("",!0)])):we.value==="area"?(e.openBlock(),e.createElementBlock("g",Vi,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(da.value,(l,r)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${r}`,id:`area-mask-${r}-${S.chartId}`},[e.createElementVNode("rect",{x:F.value.left-10,y:F.value.top-10,width:F.value.width+20,height:F.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${F.value.width+20}px`})},null,12,Bi)],8,Ni))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(da.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${r}`,d:l.areaPath,fill:l.color,"fill-opacity":l.isHighlighted?Ut.value+.2:Ut.value,mask:`url(#area-mask-${r}-${S.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,Mi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(da.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${r}`,d:l.linePath,stroke:l.color,"stroke-width":l.isHighlighted?X.value+1:X.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*K.value}ms`})},null,14,_i))),128))])):we.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":ul.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ea.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=>Wn(l,m),onMouseleave:bn},null,46,$i)):(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=>Wn(l,m),onMouseleave:bn},null,46,Li))],64))),128))],2)):e.createCommentVNode("",!0)],8,pi),$e.value&&Ae.value.show&&!oe.value.isZooming&&!zt.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-crosshair","clip-path":Se.value},[e.createElementVNode("line",{x1:Ae.value.x,x2:Ae.value.x,y1:F.value.top,y2:F.value.bottom,stroke:Qe.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,Ai),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ae.value.data,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${r}`,cx:Ae.value.x,cy:l.y,r:bt(ae.value+2),fill:l.color,stroke:"none",opacity:"0.9"},null,8,Di))),128))],8,Ti)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),It.value?(e.openBlock(),e.createElementBlock("g",Hi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Io.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${r}`},[l?(e.openBlock(),e.createElementBlock("g",Ri,[e.createElementVNode("circle",{cx:l.x,cy:l.y,r:bt(l.radius),fill:l.color,"fill-opacity":es(l),stroke:l.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(ls(l,r)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:m=>Va(l,m),onMouseleave:m=>Ba(l),onClick:m=>Sa(l,m)},null,42,Fi),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:ts(l)}),onLoad:m=>Me(r),onError:m=>gt(r),onMouseenter:m=>Va(l,m),onMouseleave:m=>Ba(l),onClick:m=>Sa(l,m)},null,46,Ii)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),El.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:io.value},[we.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Pt.value,cy:$t.value,r:at.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,Pi)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":we.value,"clip-path":k.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qa.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":c(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=>Wn(l.segment,m),onMouseleave:bn},null,42,Wi))),128))],8,Oi),Un.value&&fa.value?(e.openBlock(),e.createElementBlock("g",qi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yl.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,Zi)),[[e.vShow,l.show]])),128))])):e.createCommentVNode("",!0),Rn.value&&(fa.value||Cn.value||Pn.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:Nl.value.x,y:Nl.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":Xn.value,fill:rn.value,class:"dss-radial-data-center"},e.toDisplayString(fn.value),9,Ui)):e.createCommentVNode("",!0),La.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Oo.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ja.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,Xi),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,Yi),e.createElementVNode("text",{class:"dss-radial-label-text",x:l.textX,y:l.textY,"text-anchor":l.textAnchor,"font-size":Sn.value,"dominant-baseline":"middle"},e.toDisplayString(l.text),9,ji)],6))),128))],2)):e.createCommentVNode("",!0)],8,zi)):e.createCommentVNode("",!0),cl.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:io.value},[ne.value?(e.openBlock(),e.createElementBlock("g",Gi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ot.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${r}`,cx:Pt.value,cy:$t.value,r:bt(l),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*150}ms`})},null,12,Qi))),128)),e.createElementVNode("g",Ji,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ot.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${r}`},[e.createElementVNode("rect",{x:Pt.value-16,y:$t.value-l-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,ec),e.createElementVNode("text",{x:Pt.value,y:$t.value-l+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(yl(r)),9,tc)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ma.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${r}`,x1:Pt.value,x2:l.x,y1:$t.value,y2:l.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*100}ms`})},null,12,lc))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",nc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(rs.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${r}`,x:l.x+Math.cos(r*2*Math.PI/mo.value-Math.PI/2)*16,y:l.y+Math.sin(r*2*Math.PI/mo.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,oc))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:ds,onMouseleave:bn},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_a.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${r}`},[e.createElementVNode("polygon",{points:l.points,fill:l.color,"fill-opacity":cs("current",l,r),stroke:l.color,"stroke-width":l.isHighlighted?X.value+1:X.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*K.value}ms`,transition:"all 0.2s ease"})},null,14,ac),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:bt(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*K.value+v*50}ms`,transition:"all 0.2s ease"}),onMouseover:C=>Wn(m,C),onMouseleave:bn},null,46,sc))),128)):e.createCommentVNode("",!0)]))),128))],32)],8,Ki)):e.createCommentVNode("",!0),e.createElementVNode("g",rc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zo.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${r}`,cx:l.x,cy:l.y,r:bt(l.width/2),fill:al(l.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${r}`),style:e.normalizeStyle({animationDelay:`${r*200}ms`})},null,14,ic))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zo.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=>ms(r),onError:m=>ps(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,cc))),128))])],8,Hr)),zt.value&&ql.value.length?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-stepbar-chart-host",style:e.normalizeStyle(wn.value)},[e.createElementVNode("div",{ref_key:"stepbarScrollEl",ref:T,class:"dss-stepbar-scroll",onScroll:Go},[e.createElementVNode("div",{class:"dss-stepbar-scroll-content",style:e.normalizeStyle(Zl.value)},[_t.value?(e.openBlock(),e.createElementBlock("div",uc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mn.value,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`stepbar-grid-${r}`,class:"dss-stepbar-grid-line",style:e.normalizeStyle({top:`${l.top}px`,borderTopColor:Tt.value,borderTopWidth:`${gl.value}px`,borderTopStyle:"dashed",opacity:St.value})},null,4))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-stepbar-columns",style:e.normalizeStyle({gap:`${Il.value}px`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ql.value,l=>(e.openBlock(),e.createBlock(Ra,{key:l.key,class:"dss-stepbar-chart-column",style:e.normalizeStyle(dn.value),label:l.label,segments:l.segments,"total-value":l.totalValue,"show-counter":!1,"value-label":Vt.value,orientation:"vertical","label-position":"down","bar-height":Wl.value,"segment-order":se.value,"remainder-label":kt.value,"inactive-color":nt.value,options:Zn.value,"disable-tooltips":""},null,8,["style","label","segments","total-value","value-label","bar-height","segment-order","remainder-label","inactive-color","options"]))),128))],4),en.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-stepbar-crosshair-line",style:e.normalizeStyle(Ul.value)},null,4)):e.createCommentVNode("",!0)],4)],544)],4)):e.createCommentVNode("",!0)]),ln.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:Be.value+"px",height:rt.value+"px",backgroundImage:`url('${rl.value}')`,backgroundRepeat:"no-repeat",...to.value,opacity:En.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xn.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:Ft.value+"px",height:Ft.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(m=>il(l),["stop"]),onMouseenter:m=>os(l,m),onMouseleave:as},[e.createElementVNode("img",{src:oo(l),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,mc)],44,dc)),[[e.vShow,An.value]])),128)),Qt.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:Qt.value.x+"px",top:Qt.value.y+"px"})},[e.createElementVNode("div",pc,e.toDisplayString(Qt.value.categoryValue),1),Qt.value.description?(e.openBlock(),e.createElementBlock("div",vc,e.toDisplayString(Qt.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Lt.value&&(Fe.value.show||$e.value&&Ae.value.show&&!oe.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":$e.value&&Ae.value.show&&!oe.value.isZooming,"dss-spider-tooltip":cl.value&&Fe.value.spiderAreas&&Fe.value.spiderAreas.length>0}]),style:e.normalizeStyle(vs.value)},[!$e.value||!Ae.value.show||oe.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[cl.value&&Fe.value.spiderAreas&&Fe.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",fc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe.value.spiderAreas,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-area-${r}`,class:"dss-spider-tooltip-area"},[e.createElementVNode("div",hc,[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",gc,e.toDisplayString(m.label),1),e.createElementVNode("span",yc,e.toDisplayString(m.value),1)]))),128))]))),128))])):It.value&&Fe.value.bubbleData&&Fe.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",kc,[Fe.value.title?(e.openBlock(),e.createElementBlock("div",Cc,e.toDisplayString(Fe.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",bc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe.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",wc,[e.createElementVNode("div",xc,e.toDisplayString(Fe.value.title),1),e.createElementVNode("div",Ec,e.toDisplayString(Fe.value.value),1)])),Fe.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[At(Fe.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",Vc,e.toDisplayString(e.unref($)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(At(Fe.value.categoryIndex).flagGroups,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${r}`},[e.createElementVNode("div",Nc,[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",Bc,[e.createElementVNode("div",Mc,e.toDisplayString(m.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),At(Fe.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",_c,[o[6]||(o[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",$c,e.toDisplayString(e.unref($)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(At(Fe.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",Lc,[e.createElementVNode("div",Tc,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",Ac,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",Dc,[e.createElementVNode("div",Hc,e.toDisplayString(zt.value?Lo():It.value?ns():S.categories[Ae.value.categoryIndex]||`Category ${Ae.value.categoryIndex+1}`),1),It.value?(e.openBlock(),e.createElementBlock("div",Rc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ae.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(Ae.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",Fc,e.toDisplayString(l.seriesName)+":",1),e.createElementVNode("span",Ic,e.toDisplayString($l(l.value)),1)]))),128))]),At(Ae.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",zc,[o[7]||(o[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Pc,e.toDisplayString(e.unref($)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(At(Ae.value.categoryIndex).flagGroups,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${r}`},[e.createElementVNode("div",Oc,[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",qc,e.toDisplayString(m.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),At(Ae.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Zc,[o[8]||(o[8]=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(At(Ae.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",Xc,[e.createElementVNode("div",Yc,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",jc,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),Ml.value&&Ct.value&&oe.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Jn},[o[9]||(o[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(oe.value.scale*100))+"% "+e.toDisplayString(e.unref($)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Er),he.value&&Xe.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Ke.value==="horizontal","dss-legend-vertical":Ke.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(U.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":O.value.has(r),"dss-legend-hovered":q.value===r,"dss-legend-dimmed":q.value!==null&&q.value!==r}]),onClick:m=>ma(r),onMouseenter:m=>jn(r),onMouseleave:no,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":cl.value&&Ht(l)}]),style:e.normalizeStyle({backgroundColor:cl.value&&Ht(l)?"transparent":Fl(l,r),borderColor:Fl(l,r)})},null,6),e.createElementVNode("span",Gc,e.toDisplayString(l.name),1)],46,Kc))),128))],2)):e.createCommentVNode("",!0),ct.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:ct.value.x+"px",top:ct.value.y+"px"}),onClick:o[0]||(o[0]=e.withModifiers(()=>{},["stop"]))},[Dt.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:Ho},e.toDisplayString(e.unref($)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),Dt.value.addMarker&&(Dt.value.downloadSvg||Dt.value.downloadPng||Dt.value.downloadCsv||Gt.value.length>0)?(e.openBlock(),e.createElementBlock("div",Qc)):e.createCommentVNode("",!0),Dt.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:zn},e.toDisplayString(e.unref($)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),Dt.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:la},e.toDisplayString(e.unref($)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),Dt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:na},e.toDisplayString(e.unref($)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Gt.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[Dt.value.downloadSvg||Dt.value.downloadPng||Dt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",Jc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Gt.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+r},[l.separator?(e.openBlock(),e.createElementBlock("div",eu)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Ao(l)),style:e.normalizeStyle(In(l)),onClick:m=>Gn(l)},[l.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:Jo(l),class:"dss-custom-menu-content"},null,8,lu)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.icon?(e.openBlock(),e.createElementBlock("span",nu,e.toDisplayString(l.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)],64))],14,tu)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Ze.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:Tl},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:o[3]||(o[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",ou,[e.createElementVNode("h3",null,e.toDisplayString(Fn.value?e.unref($)("chart.modalMarker.viewMarker"):Yn.value?e.unref($)("chart.modalMarker.editMarker"):e.unref($)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:Tl},"×")]),e.createElementVNode("div",au,[e.createElementVNode("div",su,[e.createVNode(ga,{id:"dss-marker-date",mode:"single",modelValue:Ze.value.date,"onUpdate:modelValue":o[1]||(o[1]=l=>Ze.value.date=l),"min-date":_o.value,"max-date":jo.value,disabled:Fn.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",ru,[e.createElementVNode("label",iu,e.toDisplayString(e.unref($)("chart.modalMarker.description")),1),Fn.value?(e.openBlock(),e.createElementBlock("div",cu,e.toDisplayString(Ze.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":o[2]||(o[2]=l=>Ze.value.description=l),placeholder:e.unref($)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,uu)),[[e.vModelText,Ze.value.description]])])]),e.createElementVNode("div",du,[e.createElementVNode("div",mu,[Yn.value&&!Fn.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:Vn},e.toDisplayString(e.unref($)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",pu,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:Tl},e.toDisplayString(Fn.value?e.unref($)("chart.modalMarker.close"):e.unref($)("chart.modalMarker.cancel")),1),Fn.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:gn,disabled:!(Ze.value.description&&Ze.value.description.length)},e.toDisplayString(Yn.value?e.unref($)("chart.modalMarker.save"):e.unref($)("chart.contextMenu.addMarker")),9,vu))])])])])):e.createCommentVNode("",!0)],64))}}),gu={class:"dss-modal-title"},yu={class:"dss-modal-actions"},ha={__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(S,{emit:ee}){const $=S,N=ee,de=e.ref(null),P=e.ref(null),T=e.computed(()=>{const j={"max-width":$.width};return $.height!=="auto"&&(j.height=$.height,j["min-height"]="0"),j}),me=e.computed(()=>({}));function ut(){N("close-modal")}function te(){$.backDrop&&!de.value&&N("close-modal")}function f(j){j.target.tagName==="INPUT"&&(de.value=j.target.tagName)}function be(){setTimeout(()=>{de.value=null},300)}function ye(){const j=document.body,ge=document.documentElement;P.value={bodyOverflow:j.style.overflow,bodyPosition:j.style.position,bodyTop:j.style.top,bodyWidth:j.style.width,htmlOverflow:ge.style.overflow,scrollY:window.scrollY},j.style.overflow="hidden",j.style.position="fixed",j.style.top=`-${P.value.scrollY}px`,j.style.width="100%",j.style.left="0",ge.style.overflow="hidden"}function J(){if(!P.value)return;const j=document.body,ge=document.documentElement,{bodyOverflow:_e,bodyPosition:ue,bodyTop:Se,bodyWidth:U,htmlOverflow:yt,scrollY:st}=P.value;j.style.overflow=_e||"",j.style.position=ue||"",j.style.top=Se||"",j.style.width=U||"",j.style.left="",ge.style.overflow=yt||"",window.scrollTo(0,st||0)}return e.watch(()=>$.showModal,j=>{if(j)ye(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const ge=document.getElementById("dss-modal-backdrop");ge&&(ge.addEventListener("focusin",f),ge.addEventListener("focusout",be))},100);else{J(),document.body.classList.remove("dss-modal-open");const ge=document.getElementById("dss-modal-backdrop");ge&&(ge.removeEventListener("focusin",f),ge.removeEventListener("focusout",be))}},{immediate:!0}),e.onUnmounted(()=>{$.showModal&&J()}),(j,ge)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[S.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:ge[0]||(ge[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":S.headerType,"font-size":S.titleSize})},[e.createElementVNode("h1",gu,[e.renderSlot(j.$slots,"title",{},()=>[ge[1]||(ge[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(j.$slots,"title-data"),S.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:ut,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(me.value)},[e.renderSlot(j.$slots,"content",{},()=>[ge[2]||(ge[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",yu,[e.renderSlot(j.$slots,"actions")])])],4),[[e.vShow,S.showModal]])])):e.createCommentVNode("",!0)]))}},ku={key:0,class:"dss-table-toolbar"},Cu={class:"dss-table-toolbar-left"},bu=["aria-expanded"],wu={class:"dss-pagination-select-dropdown",role:"listbox"},xu={class:"dss-table-column-visibility-label"},Eu={class:"dss-table-checkbox-wrapper"},Su=["checked","onChange"],Vu={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Nu={class:"dss-table-column-visibility-text"},Bu={class:"dss-table-toolbar-right"},Mu=["placeholder","aria-label"],_u=["aria-label"],$u=["aria-label","aria-expanded"],Lu={key:1,class:"dss-table-toolbar-extra"},Tu={class:"dss-table-thead"},Au={key:0,class:"dss-table-th dss-table-selection-column"},Du={key:0,class:"dss-table-checkbox-wrapper"},Hu=["checked","indeterminate"],Ru={key:0,class:"dss-table-checkbox__indeterminate"},Fu={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},Iu=["aria-label"],zu=["onClick"],Pu={class:"dss-table-th-content"},Ou={class:"dss-table-th-text"},Wu={key:0},qu={key:1},Zu={key:2},Uu=["data-filter-column-key","aria-expanded","aria-label","onClick"],Xu={class:"dss-table-tbody"},Yu=["onClick"],ju={class:"dss-table-checkbox-wrapper"},Ku=["type","name","checked","disabled","onChange"],Gu={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Qu={key:1,class:"dss-table-checkbox__dot"},Ju=["onClick"],ed=["aria-expanded","aria-label"],td={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},ld={key:0,class:"dss-table-expansion-row"},nd=["colspan"],od=["colspan"],ad={key:1,class:"dss-table-pagination"},sd={class:"dss-table-pagination-left"},rd={key:0},id={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},cd={class:"dss-table-pagination-center"},ud={key:0,class:"dss-pagination-controls"},dd=["disabled","title"],md=["disabled","title"],pd=["aria-label","onKeydown"],vd={class:"dss-pagination-of"},fd=["disabled","title"],hd=["disabled","title"],gd={class:"dss-table-pagination-right"},yd={class:"dss-pagination-rows-label"},kd=["aria-expanded"],Cd=["aria-selected","onClick"],bd={key:0,class:"dss-table-filter-row"},wd=["value","placeholder"],xd=["min","max","value"],Ed=["min","max","value"],Sd={class:"dss-table-filter-double-range-values"},Vd={key:2,class:"dss-table-filter-daterange"},Nd={class:"dss-table-filter-daterange-row"},Bd={class:"dss-table-filter-daterange-label"},Md=["value"],_d={class:"dss-table-filter-daterange-row"},$d={class:"dss-table-filter-daterange-label"},Ld=["value"],Td=["value","placeholder"],Ad={class:"dss-table-filter-list"},Dd=["checked","onChange"],Hd={class:"dss-table-filter-actions"},Rd={name:"DSSTable"},Fd=Object.assign(Rd,{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:S=>typeof S=="object"&&S!==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(S,{emit:ee}){const{t:$,locale:N}=fo.useI18n(),de=S,P=ee,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 me(y,g){const x=Object.assign({},y);return ut(y)&&ut(g)&&Object.keys(g).forEach(O=>{ut(g[O])?O in y?x[O]=me(y[O],g[O]):Object.assign(x,{[O]:g[O]}):Object.assign(x,{[O]:g[O]})}),x}function ut(y){return y&&typeof y=="object"&&!Array.isArray(y)}const te=e.computed(()=>me(T,de.options)),f=e.computed(()=>{const y=te.value.table.width;return y==="auto"?null:typeof y=="number"?y:null}),be=e.computed(()=>te.value.table.height),ye=e.computed(()=>te.value.table.rowHeight??"auto"),J=e.computed(()=>({height:ye.value})),j=e.computed(()=>te.value.table.expandable===!0),ge=e.computed(()=>te.value.table.expandableRowData??null),_e=e.computed(()=>te.value.table.expandableRowCondition??null),ue=e.computed(()=>te.value.table.truncated===!0),Se=e.computed(()=>te.value.table.striped),U=e.computed(()=>te.value.table.bordered),yt=e.computed(()=>te.value.table.hoverable),st=e.computed(()=>te.value.table.size),De=e.computed(()=>te.value.table.align||"left");e.computed(()=>te.value.title.text),e.computed(()=>te.value.subtitle.text);const Ue=e.computed(()=>te.value.selection.enabled),Z=e.computed(()=>te.value.selection.mode),Te=e.computed(()=>te.value.selection.rowCondition??null),qe=e.computed(()=>te.value.sorting.enabled),ke=e.computed(()=>te.value.sorting.mode),Be=e.computed(()=>te.value.pagination.enabled),Je=e.computed(()=>te.value.pagination.rows),Ge=e.computed(()=>te.value.pagination.rowsPerPageOptions),rt=e.computed(()=>te.value.pagination.showCounter!==!1),Yt=e.computed(()=>te.value.pagination.showControlsGroup),we=e.computed(()=>Yt.value===!1?!1:te.value.pagination.showControls!==!1),qt=e.computed(()=>Yt.value===!1?!1:te.value.pagination.showRowsPerPage!==!1),dt=e.computed(()=>Be.value&&(rt.value||we.value||qt.value)),et=e.computed(()=>te.value.scrollable),Et=e.computed(()=>te.value.emptyMessage||$("table.emptyMessage")),tl=e.computed(()=>te.value.toolbar?.downloads?.pdf!==!1),ft=e.computed(()=>te.value.toolbar?.downloads?.excel!==!1),Zt=e.computed(()=>te.value.toolbar?.search!==!1),ht=e.computed(()=>tl.value||ft.value||Zt.value||Jt.value),Jt=e.computed(()=>te.value.toolbar?.columnVisibility!==!1),wt=e.ref(""),jt=e.ref(!1),fe=e.ref(null);let H=null;function Y(){jt.value?(H&&(clearTimeout(H),H=null),jt.value=!1,wt.value="",P("search",""),fe.value?.blur()):(jt.value=!0,H=setTimeout(()=>{H=null,fe.value?.focus()},80))}function ne(){wt.value||(jt.value=!1)}function he(){wt.value="",P("search",""),fe.value?.focus()}const Xe=e.computed(()=>({"dss-table-striped":Se.value,"dss-table-bordered":U.value,"dss-table-hoverable":yt.value,[`dss-table-${st.value}`]:st.value!=="default","dss-table-truncated":ue.value})),Ke=(y,g)=>y?.field??y?.key??g,Lt=e.ref(new Set);function $e(){const y=new Set;return de.columns.forEach((g,x)=>{g?.hidden!==!0&&y.add(Ke(g,x))}),y}function Qe(){const y=new Set;return de.columns.forEach((g,x)=>{y.add(Ke(g,x))}),y}function Ct(y){if(!Array.isArray(y))return null;const g=Qe(),x=[];return y.forEach(O=>{g.has(O)&&x.push(O)}),x}function el(){Lt.value=$e()}const ie=e.computed(()=>{const y=Ct(de.columnVisibility);return y===null?null:new Set(y)}),X=e.computed(()=>ie.value??Lt.value),Q=e.computed(()=>de.columns.filter((y,g)=>X.value.has(Ke(y,g)))),ae=y=>{const g=de.columns.findIndex(x=>x===y);return Ke(y,g>=0?g:0)},Ee=(y,g)=>X.value.has(Ke(y,g));function je(y){P("update:columnVisibility",Array.from(y))}function bt(y,g){const x=Ke(y,g),O=new Set(X.value);O.has(x)?O.delete(x):O.add(x),ie.value===null&&(Lt.value=O),je(O)}const Ut=e.ref(null),lt=e.ref(!1);function sl(y){Ut.value&&!Ut.value.contains(y.target)&&(lt.value=!1)}const M=e.computed(()=>Q.value.length+(Ue.value?1:0)+(j.value?1:0)),w=(y,g)=>y?.id??y?.key??g,E=e.ref(new Set),se=e.ref(null),re=(y,g)=>E.value.has(w(y,g)),Re=(y,g)=>{if(!j.value)return!1;if(typeof _e.value=="function")return!!_e.value(y,g);if(typeof ge.value=="string"&&ge.value.trim()){const x=Yl(y,ge.value.trim());return Array.isArray(x)?x.length>0:x&&typeof x=="object"?Object.keys(x).length>0:x!=null&&x!==""}return!0},kt=(y,g,x)=>{if(x&&x.stopPropagation(),!Re(y,g))return;const O=w(y,g),q=new Set(E.value);q.has(O)?(q.delete(O),P("row-collapse",{data:y,index:g})):(q.add(O),P("row-expand",{data:y,index:g})),E.value=q},nt=(y,g)=>{if(!ue.value)return;const x=w(y,g);se.value!==x&&(se.value=x)},We=e.ref(null),xt=e.ref(0),Bt=e.ref([]),pt=y=>{if(ke.value==="single")return We.value===y.field?xt.value:0;{const g=Bt.value.find(x=>x.field===y.field);return g?g.order:0}},_t=y=>{const g=pt(y);return{"dss-sort-active":g!==0,"dss-sort-asc":g===1,"dss-sort-desc":g===-1}},Tt=e.ref({}),St=e.ref(null),gl=e.ref(null),Jl=220,Il=e.ref(null),ml=e.computed(()=>Q.value.find(y=>ae(y)===St.value)??null),pl=e.computed(()=>{if(!ml.value||ml.value.filter!=="range")return null;const y=ml.value,g=St.value,{min:x,max:O}=pn(y),q=y.filterMin??x,tt=y.filterMax??O,Fe=Al(g),Qt=Fe.min??q,Ae=Fe.max??tt,ct=tt-q,oe=ct===0?0:(Qt-q)/ct*100,fl=ct===0?100:(Ae-q)/ct*100;return{rangeMin:q,rangeMax:tt,currentMin:Qt,currentMax:Ae,minPct:oe,maxPct:fl}}),an=e.ref(null),Wl=e.ref("max");function wl(y){const g=an.value,x=pl.value;if(!g||!x)return;const O=g.getBoundingClientRect(),tt=(y.clientX-O.left)/O.width*100,Fe=(x.minPct+x.maxPct)/2;Wl.value=tt<Fe?"min":"max"}function Al(y){return Tt.value[y]??{}}function dn(y,g){Tt.value={...Tt.value,[y]:g}}function Dl(y){const g=Tt.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={...Tt.value};delete g[y],Tt.value=g,St.value=null,gl.value=null}function ql(){if(!St.value){gl.value=null;return}const y=Il.value;if(!y)return;const g=y.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${St.value}"]`);if(!g)return;const x=g.getBoundingClientRect();gl.value={top:x.bottom+6,left:Math.max(8,x.right-Jl)}}const mn=e.computed(()=>{const y=String(wt.value??"").trim().toLowerCase();return y?de.data.filter(g=>Q.value.some(x=>Zl(rn(g,x)).some(q=>String(q).toLowerCase().includes(y)))):de.data}),wn=e.computed(()=>{let y=[...mn.value];const g=(wt.value??"").trim().toLowerCase();return g&&(y=y.filter(x=>de.columns.some(O=>{if(!O||!O.field)return!1;const q=rn(x,O);return String(q??"").toLowerCase().includes(g)}))),Q.value.forEach(x=>{const O=ae(x),q=Tt.value[O];if(!q)return;const tt=x.field;if(tt){if(q.type==="string"&&q.value?.trim()){const Fe=q.value.trim().toLowerCase();y=y.filter(Qt=>{const Ae=rn(Qt,x);return String(Ae??"").toLowerCase().includes(Fe)})}else if(q.type==="range")y=y.filter(Fe=>{const Qt=Yl(Fe,tt),Ae=Number(Qt);return!(Number.isNaN(Ae)||q.min!=null&&Ae<q.min||q.max!=null&&Ae>q.max)});else if(q.type==="dateRange"){const Fe=q.from?new Date(q.from).getTime():null,Qt=q.to?new Date(q.to).getTime():null;y=y.filter(Ae=>{const ct=Yl(Ae,tt),oe=ct?new Date(ct).getTime():NaN;return!(Number.isNaN(oe)||Fe!=null&&oe<Fe||Qt!=null&&oe>Qt)})}else if(q.type==="list"&&q.selected?.length){const Fe=new Set(q.selected);y=y.filter(Qt=>Zl(rn(Qt,x)).some(ct=>Fe.has(ct)))}}}),y});function Zl(y){if(y==null)return[""];if(Array.isArray(y))return y.flatMap(Zl);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 en(y){const g=new Set;return de.data.forEach(x=>{Zl(rn(x,y)).forEach(q=>g.add(q))}),Array.from(g).sort((x,O)=>String(x).localeCompare(String(O)))}function Ul(y,g){if(St.value===y){St.value=null,gl.value=null;return}if(St.value=y,g?.currentTarget){const x=g.currentTarget.getBoundingClientRect();gl.value={top:x.bottom+6,left:Math.max(8,x.right-Jl)}}else ql()}function bl(y,g){dn(y,{type:"string",value:g})}function pn(y){const g=y.field;if(!g)return{min:0,max:100};let x=1/0,O=-1/0;return de.data.forEach(q=>{const tt=Yl(q,g),Fe=Number(tt);Number.isNaN(Fe)||(x=Math.min(x,Fe),O=Math.max(O,Fe))}),{min:x===1/0?0:x,max:O===-1/0?100:O}}function A(y,g,x){const O={...Al(y),type:"range"},q=x===""?null:Number(x),tt=q===null||Number.isNaN(q)?null:q;O[g]=tt,tt!=null&&(g==="min"&&O.max!=null&&tt>O.max&&(O.max=tt),g==="max"&&O.min!=null&&tt<O.min&&(O.min=tt)),dn(y,O)}function I(y,g,x){const O={...Al(y),type:"dateRange"};O[g]=x||"",dn(y,O)}const L=e.reactive({});function K(y,g){L[y]=g}function He(y){const g=ae(y),x=(L[g]??"").trim().toLowerCase(),O=en(y);return x?O.filter(q=>String(q).toLowerCase().includes(x)):O}function vt(y,g){return(Al(y).selected??[]).includes(g!=null?String(g):"")}function mt(y,g){const O=[...Al(y).selected??[]],q=g!=null?String(g):"",tt=O.indexOf(q);tt>=0?O.splice(tt,1):O.push(q),dn(y,{type:"list",selected:O})}function it(y){St.value&&!y.target.closest(".dss-table-filter-wrap")&&!y.target.closest(".dss-table-filter-dropdown")&&(St.value=null,gl.value=null)}function ot(){ql(),Gt.value&&Hl()}const yl=y=>{if(!(y.sortable===!1||!qe.value))if(ke.value==="single")We.value===y.field?xt.value=xt.value===1?-1:xt.value===-1?0:1:(We.value=y.field,xt.value=1),xt.value===0&&(We.value=null),P("sort",{field:We.value,order:xt.value});else{const g=Bt.value.findIndex(x=>x.field===y.field);g>=0?Bt.value[g].order===1?Bt.value[g].order=-1:Bt.value.splice(g,1):Bt.value.push({field:y.field,order:1}),P("sort",{multiSortMeta:Bt.value})}},xl=e.computed(()=>{if(!qe.value)return wn.value;let y=[...wn.value];return ke.value==="single"&&We.value&&xt.value!==0?y.sort((g,x)=>{const O=Yl(g,We.value),q=Yl(x,We.value);return O===q?0:O==null?1:q==null?-1:(O<q?-1:O>q?1:0)*xt.value}):ke.value==="multiple"&&Bt.value.length>0&&y.sort((g,x)=>{for(const O of Bt.value){const q=Yl(g,O.field),tt=Yl(x,O.field);if(q===tt)continue;if(q==null)return 1;if(tt==null)return-1;const Fe=q<tt?-1:q>tt?1:0;if(Fe!==0)return Fe*O.order}return 0}),y}),Kt=e.ref(0),Dt=e.ref(Je.value),Gt=e.ref(!1),Sl=e.ref(null),tn=e.ref(null),Ft=e.ref("bottom"),Vt=e.ref(null),$l=y=>{Dt.value=y,Gt.value=!1,Kt.value=0,P("page",{page:0,rows:Dt.value})};function An(y){Sl.value&&!Sl.value.contains(y.target)&&(Gt.value=!1)}function Hl(){const y=Sl.value,g=tn.value;if(!y||!g)return;const x=y.querySelector(".dss-pagination-select-dropdown");if(!x)return;const O=g.getBoundingClientRect(),q=x.offsetHeight||0,Fe=(window.innerHeight||document.documentElement.clientHeight)-O.bottom,Qt=O.top;Ft.value=Fe<q+8&&Qt>Fe?"top":"bottom",Vt.value={width:`${Math.ceil(O.width)}px`,left:`${Math.max(0,Math.round(g.offsetLeft))}px`}}const xn=e.computed(()=>xl.value.length),ln=e.computed(()=>Math.ceil(xn.value/Dt.value)),En=e.computed(()=>Math.max(ln.value,1)),Dn=e.computed(()=>xn.value===0?0:ll.value+1),zl=e.computed(()=>to.value),ll=e.computed(()=>Be.value?Kt.value*Dt.value:0),to=e.computed(()=>Be.value?Math.min((Kt.value+1)*Dt.value,xn.value):xn.value),Xl=e.computed(()=>{if(!Be.value)return xl.value;const y=ll.value,g=to.value;return xl.value.slice(y,g)}),At=e.ref(new Set),lo=e.computed(()=>xl.value.filter((y,g)=>At.value.has(w(y,g)))),rl=(y,g)=>{const x=Te.value;return typeof x!="function"?!0:!!x(y,g)},Ll=e.computed(()=>xl.value.map((y,g)=>({row:y,index:g})).filter(({row:y,index:g})=>rl(y,g))),Sn=e.computed(()=>{const y=Ll.value;return y.length===0?!1:y.every(({row:g,index:x})=>At.value.has(w(g,x)))}),Hn=e.computed(()=>{const y=Ll.value;if(y.length===0)return!1;const g=y.filter(({row:x,index:O})=>At.value.has(w(x,O))).length;return g>0&&g<y.length}),vn=(y,g)=>At.value.has(w(y,g)),Vl=()=>{if(Sn.value)At.value=new Set,P("unselect-all");else{const y=new Set;Ll.value.forEach(({row:g,index:x})=>y.add(w(g,x))),At.value=y,P("select-all",lo.value)}},Un=(y,g)=>{if(!rl(y,g))return;const x=w(y,g),O=new Set(At.value),q=O.has(x);Z.value==="single"?q?(O.delete(x),P("row-unselect",y)):(O.clear(),O.add(x),P("row-select",y)):q?(O.delete(x),P("row-unselect",y)):(O.add(x),P("row-select",y)),At.value=O},sn=e.ref("1"),Rn=()=>{const y=Number.parseInt(String(sn.value),10);if(!Number.isFinite(y)){sn.value=String(Kt.value+1);return}const g=Math.min(En.value,Math.max(1,y));g!==Kt.value+1?fn(g-1):sn.value=String(g)},fn=y=>{y<0||y>=ln.value||(Kt.value=y,P("page",{page:y,rows:Dt.value}))},Xn=(y,g,x)=>{P("row-click",{data:y,index:g,originalEvent:x}),nt(y,ll.value+g)},Nl=(y,g)=>{const x=ll.value+g;return{"dss-table-row-selected":vn(y,x),"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":se.value===w(y,x)}},rn=(y,g)=>g.field?Yl(y,g.field):"",Yl=(y,g)=>g.split(".").reduce((x,O)=>x&&x[O],y),vl=y=>{const g=y.align??De.value;return{"dss-table-sortable":y.sortable!==!1&&qe.value,"dss-table-align-left":g==="left","dss-table-align-center":g==="center","dss-table-align-right":g==="right",[y.className]:y.className}},Rl=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!==N.value&&(N.value=y)},{immediate:!0}),e.watch(Je,y=>{Dt.value=y,Kt.value=0}),e.watch(Gt,async y=>{y&&(await e.nextTick(),Hl())}),e.watch(Kt,y=>{sn.value=String(y+1)},{immediate:!0}),e.watch(wt,y=>{P("search",y??"")}),e.watch(()=>de.columns,()=>{if(ie.value===null){el();return}const y=Ct(de.columnVisibility)??[];y.length!==de.columnVisibility.length&&P("update:columnVisibility",y)},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",An),document.addEventListener("click",sl),document.addEventListener("click",it),window.addEventListener("resize",ot),window.addEventListener("scroll",ot,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",An),document.removeEventListener("click",sl),document.removeEventListener("click",it),window.removeEventListener("resize",ot),window.removeEventListener("scroll",ot,!0)}),(y,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:Il,style:e.normalizeStyle({width:f.value+"px",height:be.value?be.value+"px":"auto"})},[ht.value?(e.openBlock(),e.createElementBlock("div",ku,[e.createElementVNode("div",Cu,[tl.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),ft.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),Jt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:Ut},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":lt.value}]),onClick:g[2]||(g[2]=x=>lt.value=!lt.value),"aria-expanded":lt.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,bu),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",wu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.columns,(x,O)=>(e.openBlock(),e.createElementBlock("li",{key:Ke(x,O),role:"option",class:"dss-table-column-visibility-option",onClick:g[3]||(g[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",xu,[e.createElementVNode("span",Eu,[e.createElementVNode("input",{type:"checkbox",checked:Ee(x,O),onChange:q=>bt(x,O),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Su),Ee(x,O)?(e.openBlock(),e.createElementBlock("span",Vu,[...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",Nu,e.toDisplayString(x.header),1)])]))),128))],512),[[e.vShow,lt.value]])]),_:1})],512)):e.createCommentVNode("",!0),e.renderSlot(y.$slots,"header")]),e.createElementVNode("div",Bu,[Zt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":jt.value||wt.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:fe,"onUpdate:modelValue":g[4]||(g[4]=x=>wt.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=>jt.value=!0),onBlur:ne},null,40,Mu),[[e.vModelText,wt.value]]),wt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":e.unref($)("table.clearSearchAriaLabel"),onClick:he},[...g[26]||(g[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,_u)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref($)("table.searchAriaLabel"),"aria-expanded":jt.value||!!wt.value,onMousedown:e.withModifiers(Y,["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,$u)],2)):e.createCommentVNode("",!0),y.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",Lu,[e.renderSlot(y.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":et.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",Xe.value])},[e.createElementVNode("thead",Tu,[e.createElementVNode("tr",null,[Ue.value?(e.openBlock(),e.createElementBlock("th",Au,[Z.value==="multiple"?(e.openBlock(),e.createElementBlock("span",Du,[e.createElementVNode("input",{type:"checkbox",checked:Sn.value,indeterminate:Hn.value,onChange:Vl,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Hu),Hn.value?(e.openBlock(),e.createElementBlock("span",Ru)):Sn.value?(e.openBlock(),e.createElementBlock("span",Fu,[...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),j.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:"dss-table-th dss-table-expansion-column","aria-label":e.unref($)("table.expandRowAriaLabel")},null,8,Iu)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,(x,O)=>(e.openBlock(),e.createElementBlock("th",{key:ae(x),class:e.normalizeClass(["dss-table-th",vl(x)]),style:e.normalizeStyle(Rl(x)),onClick:q=>yl(x)},[e.createElementVNode("div",Pu,[e.createElementVNode("span",Ou,e.toDisplayString(x.header),1),x.sortable!==!1&&qe.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",_t(x)])},[pt(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)])])):pt(x)===1?(e.openBlock(),e.createElementBlock("span",qu,[...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)])])):pt(x)===-1?(e.openBlock(),e.createElementBlock("span",Zu,[...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":St.value===ae(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":Dl(ae(x))}]),"data-filter-column-key":ae(x),"aria-expanded":St.value===ae(x),"aria-label":e.unref($)("table.filterColumnAriaLabel"),onClick:q=>Ul(ae(x),q)},[...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,Uu)],2)):e.createCommentVNode("",!0)])],14,zu))),128))])]),e.createElementVNode("tbody",Xu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xl.value,(x,O)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:w(x,ll.value+O)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Nl(x,O)]),style:e.normalizeStyle(J.value),onClick:q=>Xn(x,O,q)},[Ue.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",ju,[e.createElementVNode("input",{type:Z.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${S.tableId}`,checked:vn(x,ll.value+O),disabled:!rl(x,ll.value+O),onChange:q=>Un(x,ll.value+O),class:e.normalizeClass(["dss-table-checkbox",Z.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio",{"dss-table-checkbox--disabled":!rl(x,ll.value+O)}])},null,42,Ku),Z.value==="multiple"&&vn(x,ll.value+O)?(e.openBlock(),e.createElementBlock("span",Gu,[...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)])])):Z.value==="single"&&vn(x,ll.value+O)?(e.openBlock(),e.createElementBlock("span",Qu)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),j.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(q=>kt(x,ll.value+O,q),["stop"])},[Re(x,ll.value+O)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":re(x,ll.value+O),"aria-label":re(x,ll.value+O)?e.unref($)("table.collapseRowAriaLabel"):e.unref($)("table.expandRowAriaLabel")},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":re(x,ll.value+O)}]),"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,ed)):(e.openBlock(),e.createElementBlock("span",td))],8,Ju)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,(q,tt)=>(e.openBlock(),e.createElementBlock("td",{key:ae(q),class:e.normalizeClass(["dss-table-td",vl(q)]),style:e.normalizeStyle(Rl(q))},[e.renderSlot(y.$slots,`cell-${q.field}`,{data:x,column:q,rowIndex:O,isExpanded:se.value===w(x,ll.value+O)},()=>[e.createTextVNode(e.toDisplayString(rn(x,q)),1)])],6))),128))],14,Yu),j.value&&Re(x,ll.value+O)&&re(x,ll.value+O)?(e.openBlock(),e.createElementBlock("tr",ld,[e.createElementVNode("td",{colspan:M.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(y.$slots,"expansion",{data:x,rowIndex:O})],8,nd)])):e.createCommentVNode("",!0)],64))),128)),Xl.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(Et.value),1)])],8,od)],4))])],2)],2),dt.value?(e.openBlock(),e.createElementBlock("div",ad,[e.createElementVNode("div",sd,[rt.value?(e.openBlock(),e.createElementBlock("span",rd,e.toDisplayString(e.unref($)("table.showingRange",{start:Dn.value,end:zl.value,total:xn.value})),1)):(e.openBlock(),e.createElementBlock("span",id," "))]),e.createElementVNode("div",cd,[we.value?(e.openBlock(),e.createElementBlock("div",ud,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Kt.value===0,onClick:g[8]||(g[8]=x=>fn(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,dd),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Kt.value===0,onClick:g[9]||(g[9]=x=>fn(Kt.value-1)),title:e.unref($)("table.previousPage")}," ‹ ",8,md),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":g[10]||(g[10]=x=>sn.value=x),type:"text",class:"dss-pagination-page-input","aria-label":e.unref($)("table.currentPageAriaLabel"),onBlur:Rn,onKeydown:e.withKeys(e.withModifiers(Rn,["prevent"]),["enter"])},null,40,pd),[[e.vModelText,sn.value]]),e.createElementVNode("span",vd,e.toDisplayString(e.unref($)("table.ofPages",{total:En.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Kt.value>=ln.value-1,onClick:g[11]||(g[11]=x=>fn(Kt.value+1)),title:e.unref($)("table.nextPage")}," › ",8,fd),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Kt.value>=ln.value-1,onClick:g[12]||(g[12]=x=>fn(ln.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,hd)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",gd,[qt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:Sl},[e.createElementVNode("span",yd,e.toDisplayString(e.unref($)("table.rowsPerPage"))+":",1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Gt.value}]),onClick:g[13]||(g[13]=x=>Gt.value=!Gt.value),"aria-expanded":Gt.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:tn},[e.createTextVNode(e.toDisplayString(Dt.value)+" ",1),g[37]||(g[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,kd),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":Ft.value==="top"}]),style:e.normalizeStyle(Vt.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ge.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x,role:"option","aria-selected":x===Dt.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":x===Dt.value}]),onClick:O=>$l(x)},e.toDisplayString(x),11,Cd))),128))],6),[[e.vShow,Gt.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(gl.value?{top:gl.value.top+"px",left:gl.value.left+"px",width:Jl+"px"}:void 0),onClick:g[21]||(g[21]=e.withModifiers(()=>{},["stop"]))},[ml.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[ml.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",bd,[e.createElementVNode("input",{type:"text",value:Al(St.value).value??"",onInput:g[14]||(g[14]=x=>bl(St.value,x.target.value)),class:"dss-table-filter-input",placeholder:e.unref($)("table.search")},null,40,wd)])):ml.value.filter==="range"&&pl.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":pl.value.minPct+"%","--range-max-pct":pl.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:an,class:"dss-table-filter-double-range-track",onMousemove:wl,onMouseenter:wl},[e.createElementVNode("input",{type:"range",min:pl.value.rangeMin,max:pl.value.rangeMax,value:pl.value.currentMin,onInput:g[15]||(g[15]=x=>A(St.value,"min",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:Wl.value==="min"?2:1})},null,44,xd),e.createElementVNode("input",{type:"range",min:pl.value.rangeMin,max:pl.value.rangeMax,value:pl.value.currentMax,onInput:g[16]||(g[16]=x=>A(St.value,"max",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:Wl.value==="max"?2:1})},null,44,Ed)],544),e.createElementVNode("div",Sd,e.toDisplayString(pl.value.currentMin)+" – "+e.toDisplayString(pl.value.currentMax),1)],4)):ml.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",Vd,[e.createElementVNode("div",Nd,[e.createElementVNode("label",Bd,e.toDisplayString(e.unref($)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:Al(St.value).from??"",onInput:g[17]||(g[17]=x=>I(St.value,"from",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Md)]),e.createElementVNode("div",_d,[e.createElementVNode("label",$d,e.toDisplayString(e.unref($)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:Al(St.value).to??"",onInput:g[18]||(g[18]=x=>I(St.value,"to",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Ld)])])):ml.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:L[St.value]??"",onInput:g[19]||(g[19]=x=>K(St.value,x.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref($)("table.search")},null,40,Td),e.createElementVNode("div",Ad,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(He(ml.value),x=>(e.openBlock(),e.createElementBlock("label",{key:x,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:vt(St.value,x),onChange:O=>mt(St.value,x)},null,40,Dd),e.createElementVNode("span",null,e.toDisplayString(x),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",Hd,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:g[20]||(g[20]=x=>Zn(St.value))},e.toDisplayString(e.unref($)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,St.value&&ml.value&&gl.value]])]),_:1})]))],64))}}),Id="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",zd="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",Pd="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",Od="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",qd="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",Zd={class:"dss-toolbar-left"},Ud=["title"],Xd=["title"],Yd={class:"dss-toolbar-dropdown-wrapper"},jd=["title"],Kd=["src"],Gd=["src"],Qd=["src"],Jd=["src"],e1=["src"],t1=["src"],l1={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},n1=["src"],o1=["src"],a1=["src"],s1=["src"],r1=["src"],i1=["src"],c1=["title"],u1=["title"],d1=["title"],m1=["title"],p1=["title"],v1=["title"],f1=["title"],h1=["title"],g1=["title"],y1={key:2,class:"dss-toolbar-separator"},k1=["title"],C1={key:4,class:"dss-toolbar-separator"},b1={key:5,class:"dss-toolbar-dropdown-wrapper"},w1=["title"],x1={class:"dss-toolbar-dropdown-ai"},E1={class:"dss-toolbar-right"},S1={key:0,class:"dss-toolbar-custom-group"},V1={key:1,class:"dss-toolbar-separator"},N1={class:"dss-link-modal-content"},B1={class:"dss-link-modal-field"},M1={class:"dss-link-modal-label"},_1=["placeholder"],$1={class:"dss-link-modal-field"},L1={class:"dss-link-modal-label"},T1=["placeholder"],A1={class:"dss-image-modal-tabs"},D1={key:0,class:"dss-image-tab-content"},H1={class:"dss-link-modal-content"},R1={class:"dss-link-modal-field"},F1={key:0,class:"dss-link-modal-label"},I1=["src"],z1={class:"dss-link-modal-field"},P1={class:"dss-link-modal-label"},O1=["placeholder"],W1={class:"dss-link-modal-field"},q1={class:"dss-link-modal-label"},Z1=["placeholder"],U1={class:"dss-link-modal-field"},X1={class:"dss-link-modal-label"},Y1=["placeholder"],j1={key:1,class:"dss-image-tab-content"},K1={class:"dss-link-modal-content"},G1={class:"dss-link-modal-field"},Q1={class:"dss-link-modal-label"},J1=["placeholder"],em={class:"dss-link-modal-field"},tm={class:"dss-link-modal-label"},lm=["placeholder"],nm={class:"dss-link-modal-field"},om={class:"dss-link-modal-label"},am=["placeholder"],sm={class:"dss-link-modal-field"},rm={class:"dss-link-modal-label"},im=["placeholder"],cm={class:"dss-text-editor-title-input-container"},um={key:0,class:"dss-text-editor-title-preview"},dm={key:0},mm={key:1,class:"dss-text-editor-preview-placeholder"},pm=["value","placeholder","disabled"],vm={key:3,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},fm={class:"dss-text-editor-description-input-container"},hm={key:0,class:"dss-text-editor-description-preview"},gm={key:0},ym={key:1,class:"dss-text-editor-preview-placeholder"},km=["value","placeholder","disabled"],Cm={key:5,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},bm=["data-comment-id","onMouseenter"],wm=["onClick"],xm=["src","alt"],Em={key:1},Sm=["onClick"],Vm=["src","alt"],Nm={key:1},Bm=["data-has-second-user","onClick"],Mm={class:"editor-comment-marker-count"},_m={key:7,class:"dss-text-editor-textarea-wrapper"},$m=["value","placeholder","rows","disabled"],Lm={class:"dss-text-editor-footer"},Tm={class:"dss-text-editor-footer-content"},Am={class:"dss-text-editor-footer-stat"},Dm={class:"dss-text-editor-footer-stat"},Hm={key:8,class:"dss-text-editor-content-wrapper"},Rm={key:0,class:"dss-comment-overlay-body"},Fm={class:"dss-comment-selection-wrapper"},Im=["innerHTML"],zm={class:"dss-comment-messages-wrapper"},Pm={key:0,class:"dss-comment-avatar-wrapper"},Om={class:"dss-comment-avatar"},Wm=["src","alt"],qm={key:1},Zm={class:"dss-comment-header"},Um={class:"dss-comment-header-text"},Xm={class:"dss-comment-author"},Ym={key:0,class:"dss-comment-date"},jm=["onClick","title"],Km={class:"dss-comment-overlay-inner"},Gm=["placeholder","onKeydown"],Qm={class:"dss-text-editor-footer"},Jm={class:"dss-text-editor-footer-content"},e2={class:"dss-text-editor-footer-stat"},t2={class:"dss-text-editor-footer-stat"},l2=["title"],n2=["title"],o2={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:""},a2={class:"dss-image-popup-content"},s2={key:0,class:"dss-image-popup-no-alt-icon"},r2=["title"],i2=["title"],c2={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:""},u2={class:"dss-toolbar-left"},d2=["title"],m2=["title"],p2={class:"dss-toolbar-dropdown-wrapper"},v2=["title"],f2=["src"],h2=["src"],g2=["src"],y2=["src"],k2=["src"],C2=["src"],b2={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},w2=["title"],x2=["title"],E2=["title"],S2=["title"],V2=["title"],N2=["title"],B2=["title"],M2=["title"],_2=["title"],$2={key:2,class:"dss-toolbar-separator"},L2=["title"],T2={key:4,class:"dss-toolbar-separator"},A2={key:5,class:"dss-toolbar-dropdown-wrapper"},D2=["title"],H2={class:"dss-toolbar-dropdown-ai"},R2={key:0,class:"dss-toolbar-right"},F2={key:0,class:"dss-toolbar-separator"},I2={key:0,class:"dss-toolbar-custom-group"},z2={key:1,class:"dss-toolbar-separator"},P2={name:"DSSTextEditor"},O2=Object.assign(P2,{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:S=>typeof S=="object"&&S!==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:S=>typeof S=="object"&&S!==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(S,{expose:ee,emit:$}){const{t:N,locale:de}=fo.useI18n(),P={h1:Id,h2:zd,h3:Pd,h4:Od,h5:Wd,h6:qd},T=S,me=$,ut=e.useSlots(),te=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
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=jl("csv"),document.body.appendChild(m),m.click(),document.body.removeChild(m),URL.revokeObjectURL(r),hn()}catch(t){console.error("Error downloading CSV:",t)}},Gn=t=>{if(typeof t.action=="function"){const o={series:U.series,categories:U.categories,markers:fl.value},l={chartX:ct.value.chartX,chartY:ct.value.chartY,dataX:ct.value.mouseDataX,dataY:ct.value.mouseDataY,categoryIndex:clampedCategoryIndex||ct.value.categoryIndex};t.action(o,l)}hn()},Ho=()=>{Tl(),Ze.value.show=!0,Ze.value.categoryIndex=ct.value.categoryIndex,Ze.value.fromButton=!1,hn()},Qn=()=>{Tl(),Ze.value.show=!0,Ze.value.categoryIndex=0,Ze.value.fromButton=!0},bo=t=>{if(ct.value.show){const o=document.querySelector(".dss-context-menu");o&&!o.contains(t.target)&&(ct.value.show=!1)}},wo=t=>{ct.value.show&&!t.target.closest(".context-menu")&&(ct.value.show=!1)},Ro=t=>{if(!Ml.value||!Ct.value||Qt.value)return;t.preventDefault(),t.stopPropagation(),oe.value.isZooming=!0,Ae.value.show=!1,oe.value.zoomTimeout&&clearTimeout(oe.value.zoomTimeout);const l=t.currentTarget.getBoundingClientRect(),r=t.clientX-l.left,m=t.clientY-l.top;if(r<F.value.left-50||r>F.value.right+50||m<F.value.top-50||m>F.value.bottom+100){oe.value.isZooming=!1;return}const v=t.deltaY>0?.9:1.1,C=Math.max(oe.value.minScale,Math.min(oe.value.maxScale,oe.value.scale*v));if(C!==oe.value.scale){const{minX:b,maxX:W}=Nt.value,_=W-b||1,R=_/oe.value.scale,B=b-oe.value.offsetX/F.value.width*_,G=(r-F.value.left)/F.value.width,Ve=B+G*R;oe.value.scale=C;const Oe=_/oe.value.scale,ve=Ve-G*Oe;oe.value.offsetX=-(ve-b)/_*F.value.width,oe.value.scale<=1.01&&(oe.value.scale=1,oe.value.offsetX=0)}oe.value.zoomTimeout=setTimeout(()=>{oe.value.isZooming=!1,oe.value.zoomTimeout=null},300)},so=t=>{if(!Ml.value||!Ct.value||oe.value.scale<=1)return;Ae.value.show=!1;const l=t.currentTarget.getBoundingClientRect();t.clientX-l.left,t.clientY-l.top,oe.value.isDragging=!0,oe.value.lastMouseX=t.clientX,oe.value.lastMouseY=t.clientY,t.preventDefault()},xo=()=>{oe.value.isDragging=!1},Jn=()=>{!Ml.value||!Ct.value||(oe.value.scale=1,oe.value.offsetX=0,oe.value.isDragging=!1,oe.value.zoomTimeout&&(clearTimeout(oe.value.zoomTimeout),oe.value.zoomTimeout=null),oe.value.isZooming=!1)},oa=()=>!Ml.value||!tt.value||!Ct.value?"default":oe.value.isDragging?"grabbing":oe.value.scale>1?"grab":"dss-crosshair",ro=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*sl.value,W=m.y+(v.y-r.y)/6*sl.value,_=v.x-(C.x-m.x)/6*sl.value,R=v.y-(C.y-m.y)/6*sl.value;o+=` C ${b} ${W} ${_} ${R} ${v.x} ${v.y}`}return o},Bl=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+(tl.value?30:0)+60;if(cl.value){const B={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??B.left,top:r.top??B.top,right:r.right??B.right,bottom:r.bottom??B.bottom}:B}if(El.value){const B=!he.value,G=Ll.value,Ve=G?Hn.value+vn.value+Math.max(24,Sn.value+16):0,Oe=B?12:m;let ve=0;dt.value&&(ve+=B?8:15),et.value&&(ve+=B?6:10);const Ce=De();let xe=Oe+(B?4:16)+(G?Ve:0),pe=Oe+(G?Ve:0);he.value&&Xe.value==="left"?xe+=Ce.legendWidth||150:he.value&&Xe.value==="right"&&(pe+=Ce.legendWidth||150);const ze=be.value==="semi-radial"?G?Ve:8:G?Ve:B?8:m+80,Le=G?14:0,Ne=Oe+ve+Le,Ie={left:xe,top:Ne,right:pe,bottom:ze};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??Ie.left,top:r.top??Ie.top,right:r.right??Ie.right,bottom:r.bottom??Ie.bottom}:Ie}let C=0;dt.value&&(C+=15),et.value&&(C+=10);const b=De();let W=m+16+(ft.value?30:0),_=m+(ht.value?30:0);he.value&&Xe.value==="left"?W+=b.legendWidth||150:he.value&&Xe.value==="right"&&(_+=b.legendWidth||150),_n.value&&(_+=44),Qt.value&&(v=ml.value+8);const R={left:W,top:m+C,right:_,bottom:v};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??R.left,top:r.top??R.top,right:r.right??R.right,bottom:r.bottom??R.bottom}:R}),F=e.computed(()=>({left:Bl.value.left,top:Bl.value.top,right:Be.value-Bl.value.right,bottom:rt.value-Bl.value.bottom,width:Be.value-(Bl.value.left+Bl.value.right),height:rt.value-(Bl.value.top+Bl.value.bottom)})),Ml=e.computed(()=>["line","area","bar","stepbar"].includes(be.value)||Wt.value),Ol=e.computed(()=>Wt.value),Pn=e.computed(()=>be.value==="mini-radial"),El=e.computed(()=>["radial","semi-radial","mini-radial"].includes(be.value)),cl=e.computed(()=>be.value==="spider"),It=e.computed(()=>be.value==="bubble"),Qt=e.computed(()=>be.value==="stepbar"),ul=e.computed(()=>Z.value?.chart?.orientation==="horizontal"&&(be.value==="bar"||Ol.value)),kn=t=>{const{minY:o,maxY:l}=Nt.value,r=l-o||1;return F.value.left+(t-o)/r*F.value.width},Bn=t=>{const{maxX:o}=Nt.value,l=o+1,m=F.value.height/l;return F.value.top+(t+.5)*m},zt=e.computed(()=>El.value?Bl.value.left+(Be.value-Bl.value.left-Bl.value.right)/2:Be.value/2),$t=e.computed(()=>cl.value?rt.value/2-40:El.value?Bl.value.top+(rt.value-Bl.value.top-Bl.value.bottom)/2:rt.value/2),at=e.computed(()=>{if(cl.value){const t=F.value.width-80,o=F.value.height-80;return Math.min(t,o)/2}return Math.min(F.value.width,F.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 at.value*l}),Mn=e.computed(()=>{const t=Z.value,o=typeof U.innerSize=="number"?U.innerSize:t?.innerSize;return typeof o!="number"||o<=-100||!(El.value||cl.value)?1:1+o/100}),io=e.computed(()=>{const t=Mn.value;if(t===1||t<=0)return;const o=zt.value,l=$t.value;return`translate(${o}, ${l}) scale(${t}) translate(${-o}, ${-l})`}),eo=e.ref(0),co=e.computed(()=>`semi-radial-fill-clip-${U.chartId}`),Cn=e.computed(()=>be.value==="semi-radial"),a=e.computed(()=>Cn.value&&bl.value&&!Tn.value),n=e.computed(()=>Cn.value&&bl.value&&!Tn.value&&pn.value==="fill"),s=e.computed(()=>{const t=a.value?eo.value:1,o=zt.value,l=$t.value,r=hl.value,m=at.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),W=l+m*Math.sin(v),_=o+m*Math.cos(C),R=l+m*Math.sin(C),B=o+r*Math.cos(C),G=l+r*Math.sin(C),Ve=o+r*Math.cos(v),Oe=l+r*Math.sin(v),ve=t>.5?1:0;return`M ${o} ${l} L ${b} ${W} A ${m} ${m} 0 ${ve} 1 ${_} ${R} L ${B} ${G} A ${r} ${r} 0 ${ve} 1 ${Ve} ${Oe} Z`}),i=e.computed(()=>{if(!(!Cn.value||!a.value)&&!n.value)return`url(#${co.value})`}),c=t=>{if(!(!n.value||t!==0))return`url(#${co.value})`},d=e.ref(0),u=e.computed(()=>`radial-reveal-clip-${U.chartId}`),p=e.computed(()=>be.value==="radial"),h=e.computed(()=>{const t=p.value?d.value:1,o=zt.value,l=$t.value,r=Math.max(at.value*1.5,Be.value,rt.value);if(t<=0)return`M ${o} ${l} L ${o} ${l} Z`;if(t>=1){const B=o-r,G=o+r;return`M ${B} ${l} A ${r} ${r} 0 0 1 ${G} ${l} A ${r} ${r} 0 0 1 ${B} ${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),W=o+r*Math.cos(v),_=l+r*Math.sin(v),R=t>=.5?1:0;return`M ${o} ${l} L ${C} ${b} A ${r} ${r} 0 ${R} 1 ${W} ${_} Z`}),k=e.computed(()=>{if(i.value)return i.value;if(p.value)return`url(#${u.value})`});let D=null;const z=()=>{if(!a.value)return;eo.value=0;const t=A.value,o=performance.now(),l=r=>{const m=r-o,v=Math.min(1,m/t);eo.value=va(L.value,v),v<1&&(D=requestAnimationFrame(l))};D=requestAnimationFrame(l)},V=e.computed(()=>Z.value?.bubbles?.minSize||8),ce=e.computed(()=>Z.value?.bubbles?.maxSize||50),le=e.computed(()=>Z.value?.bubbles?.opacity||.7),Pe=(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)},Me=t=>{const o=document.querySelector(`.dss-bubble-image-${t}`);o&&(o.style.opacity="1")},gt=t=>{const o=document.querySelector(`.dss-bubble-image-${t}`);o&&(o.style.display="none")},Ut=e.computed(()=>U.series),Pt=e.computed(()=>U.series.filter((t,o)=>!O.value.has(o))),nl=t=>{if(!t)return"primary";const o=t.yAxis??t.axis??t.yAxisId;return o==="secondary"||o==="right"||o===1?"secondary":"primary"},dl=t=>t?typeof t.strokeDasharray=="string"?t.strokeDasharray:Array.isArray(t.strokeDasharray)?t.strokeDasharray.join(","):t.dotted===!0?"4,4":null:null,Ht=t=>t?t.old===!0||t.comparison===!0||t.dotted===!0:!1,ol=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}}),nn=(t,o)=>typeof t?.bubbles?.size=="number"?t.bubbles.size:typeof t?.bubbleSize=="number"?t.bubbleSize:o?ol.value.bubbleSize:ae.value,cn=(t,o)=>Ht(t)&&ol.value.usePrimaryColor?al(0):al(o),Fl=(t,o)=>cl.value&&Ht(t)?cn(t,o):al(o),Eo=e.computed(()=>Pt.value.filter(t=>nl(t)==="primary")),So=e.computed(()=>Pt.value.filter(t=>nl(t)==="secondary")),_n=e.computed(()=>!ul.value&&!!qt.value&&So.value.length>0),Vo=(t,o=0)=>{const l=Number(t);return Number.isFinite(l)?l:o},ya=(t,o,l)=>{if(!Array.isArray(t))return[];const r=t.map((m,v)=>{const C=m&&typeof m=="object"&&!Array.isArray(m),b=Vo(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||al(v):al(l),marker:C?m.marker:null,isRemainder:!1}}).filter(Boolean);return se.value==="asc"?r.sort((m,v)=>m.value-v.value):se.value==="desc"?r.sort((m,v)=>v.value-m.value):r},Fo=(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:al(r)}],C=ya(v,l,r),b=C.reduce((B,G)=>B+G.value,0),W=Vo(m?t.totalValue??t.total??l?.totalValue??l?.total:l?.totalValue??l?.total,re.value),_=Math.max(W,b,1);Re.value&&_>b&&C.push({key:`${r}-${o}-remainder`,label:kt.value,value:_-b,color:nt.value,marker:null,isRemainder:!0});const R=C.filter(B=>!B.isRemainder).reduce((B,G)=>!B||G.value>B.value?G:B,null);return{key:`${r}-${o}`,label:m?t.label||t.name||U.categories?.[o]||$("chart.fallback.item",{number:o+1}):U.categories?.[o]||$("chart.fallback.item",{number:o+1}),axisLabel:m?t.xLabel??t.label??t.name??U.categories?.[o]??$("chart.fallback.item",{number:o+1}):U.categories?.[o]||$("chart.fallback.item",{number:o+1}),yLabel:m?t.yLabel??null:null,totalValue:_,usedValue:b,segments:C,maxSegmentKey:R?.key||null,seriesName:l?.name||"",seriesIndex:r}},$n=e.computed(()=>{if(!Qt.value)return[];const t=[];return Ut.value.forEach((o,l)=>{O.value.has(l)||!Array.isArray(o?.data)||o.data.forEach(r=>{const m=Fo(r,t.length,o,l);m.segments.length>0&&t.push(m)})}),t}),_l="auto",on=(t,o,l,r=0,m=100)=>{let v=1/0,C=-1/0;if(t.forEach(_=>{_?.data?.length&&_.data.forEach(R=>{typeof R=="number"&&Number.isFinite(R)&&(v=Math.min(v,R),C=Math.max(C,R))})}),v===1/0)return{minY:r,maxY:m};let b;if(o===_l){const _=C-v,R=_>0?_*.1:1;b=Math.max(0,v-R)}else if(typeof o=="number")b=o;else{const _=C-v,R=_>0?_*.1:1;b=Math.max(0,v-R)}let W;if(l===_l){const _=C-v,R=_>0?_*.1:2;W=C+R}else if(typeof l=="number")W=l;else{const _=C-v,R=_>0?_*.1:2;W=C+R}return{minY:b,maxY:W}},Nt=e.computed(()=>{if(It.value)return Wa();if(Qt.value)return Kl();if(!Pt.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=0;Pt.value.forEach(l=>{l.data&&l.data.length&&(t=Math.max(t,l.data.length-1))}),U.categories.length>0&&(t=Math.max(t,U.categories.length-1));const o=on(Eo.value.length?Eo.value:Pt.value,Jt.value,wt.value);return{minX:0,maxX:t,minY:o.minY,maxY:o.maxY}}),Kl=()=>{const t=$n.value,o=t.reduce((v,C)=>Math.max(v,C.totalValue),re.value),l=typeof Jt.value=="number"?Jt.value:0,r=typeof wt.value=="number"?wt.value:o,m=Math.max(r,l+1);return{minX:0,maxX:Math.max(t.length-1,0),minY:l,maxY:m}},aa=e.computed(()=>_n.value?on(So.value,Yt.value,fe.value,Nt.value.minY,Nt.value.maxY):{minY:Nt.value.minY,maxY:Nt.value.maxY}),Wa=()=>{if(!Pt.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(Pt.value.forEach((Ve,Oe)=>{Ve?.data?.length&&Ve.data.forEach((ve,Ce)=>{let xe,pe,Ye;if(typeof ve=="object"&&ve!==null&&!Array.isArray(ve))xe=typeof ve.x=="number"?ve.x:Ce,pe=typeof ve.y=="number"?ve.y:0,Ye=typeof ve.size=="number"?ve.size:20;else if(Array.isArray(ve)&&ve.length>=3)xe=typeof ve[0]=="number"?ve[0]:Ce,pe=typeof ve[1]=="number"?ve[1]:0,Ye=typeof ve[2]=="number"?ve[2]:20;else if(typeof ve=="number")xe=Ce,pe=ve,Ye=Pe(Oe,Ce);else return;isFinite(xe)&&isFinite(pe)&&isFinite(Ye)&&(t=Math.min(t,xe),o=Math.max(o,xe),l=Math.min(l,pe),r=Math.max(r,pe),m=Math.min(m,Ye),v=Math.max(v,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,U.categories?.length-1||8)),l===r&&(l=Math.max(0,l-10),r=l+20);const b=o-t,W=r-l;let _,R,B,G;return H.value!==null?_=H.value:_=t-b*.1,Y.value!==null?R=Y.value:R=o+b*.1,Jt.value!==null&&typeof Jt.value=="number"?B=Jt.value:B=Math.max(0,l-W*.1),wt.value!==null&&typeof wt.value=="number"?G=wt.value:G=r+W*.1,{minX:_,maxX:R,minY:B,maxY:G,minSize:m,maxSize:v}},kl=t=>{if(It.value){const{minX:b,maxX:W}=Nt.value,_=W-b||1;return F.value.left+(t-b)/_*F.value.width}const{minX:o,maxX:l}=Nt.value,r=l-o;if(l===0||r===0)return F.value.left+F.value.width/2;const m=r/oe.value.scale,v=o-oe.value.offsetX/F.value.width*r,C=(t-v)/m;return F.value.left+C*F.value.width},On=t=>{const{minY:o,maxY:l}=Nt.value,r=l-o||1;return F.value.bottom-(t-o)/r*F.value.height},ka=t=>{const{minY:o,maxY:l}=aa.value,r=l-o||1;return F.value.bottom-(t-o)/r*F.value.height},un=(t,o)=>_n.value&&nl(t)==="secondary"?ka(o):On(o),qa=t=>{if(!It.value)return ae.value||4;const{maxSize:o}=Nt.value,l=Math.max(1,o),r=Math.min(1,Math.max(0,t/l));return V.value+r*(ce.value-V.value)},uo=(t,o=12,l="Arial, sans-serif")=>{if(typeof t!="string"||!t)return 0;if(typeof document>"u")return t.length*(o*.62);uo.canvas||(uo.canvas=document.createElement("canvas"));const r=uo.canvas.getContext("2d");return r?(r.font=`${o}px ${l}`,r.measureText(t).width):t.length*(o*.62)},Ca=(t,o,l=12)=>{if(typeof t!="string"||typeof o!="number"||o<=0||uo(t,l)<=o)return t;const r="..";if(uo(r,l)>=o)return r;let v=t.length;for(;v>0;){const C=`${t.slice(0,v)}${r}`;if(uo(C,l)<=o)return C;v-=1}return r},Za=e.computed(()=>ra.value.map(t=>({y:t.y}))),ba=e.computed(()=>!Qt.value||!_t.value?[]:ra.value.map(t=>({y:t.y}))),sa=e.computed(()=>{if(It.value)return Ua();if(Qt.value)return[];if(be.value==="bar"){if(ul.value){const Ne=[],{minY:Ie,maxY:Mt}=Nt.value,Ot=5,Gl=Mt-Ie||1;for(let Cl=0;Cl<=Ot;Cl++){const Ql=Ie+Gl*(Cl/Ot),Wo=kn(Ql);Ne.push({x:Wo,y:F.value.bottom+20,text:$l(Math.round(Ql))})}return Ne}const Ce=[],{maxX:xe}=Nt.value,pe=xe+1,Ye=5,Le=(F.value.width-Ye*2)/pe;for(let Ne=0;Ne<=xe;Ne++){const Ie=F.value.left+Ye+(Ne+.5)*Le;Ce.push({x:Ie,y:F.value.bottom+20,text:Ca(U.categories[Ne]||$("chart.fallback.item",{number:Ne+1}),Math.max(Le-8,24))})}return Ce}const t=[],{minX:o,maxX:l}=Nt.value,r=H.value!==null?H.value:o,m=Y.value!==null?Y.value:l,v=m-r||1,C=v/oe.value.scale,b=r-oe.value.offsetX/F.value.width*v,W=b+C,_=Math.max(0,Math.floor(b-2)),R=Math.min(m,Math.ceil(W+2)),B=R-_,G=F.value.width,Oe=Math.floor(G/60);let ve=1;B>Oe&&(ve=Math.ceil(B/Oe));for(let Ce=_;Ce<=R;Ce+=ve)if(Ce>=0&&Ce<=m){const xe=kl(Ce);xe>=F.value.left-100&&xe<=F.value.right+100&&t.push({x:xe,y:F.value.bottom+20,text:U.categories[Ce]||`Item ${Ce+1}`})}return t}),Ua=()=>{const t=[],{minX:o,maxX:l}=Nt.value,r=l-o||1,m=Math.min(8,Math.max(4,Math.floor(F.value.width/80)));for(let v=0;v<=m;v++){const C=o+r*v/m,b=kl(C);if(b>=F.value.left-10&&b<=F.value.right+10){const W=Math.round(C),_=U.categories?.[W];t.push({x:b,y:F.value.bottom+20,text:_||(Number.isInteger(C)?C.toString():C.toFixed(1))})}}return t},ra=e.computed(()=>{if(ul.value){const m=[],{maxX:v}=Nt.value;for(let C=0;C<=v;C++)m.push({x:F.value.left-10,y:Bn(C),text:Ca(U.categories[C]||`Item ${C+1}`,Math.max(F.value.left-28,40))});return m}const t=[],{minY:o,maxY:l}=Nt.value,r=5;for(let m=0;m<=r;m++){const v=o+(l-o)*(m/r),C=Math.round(v);t.push({x:F.value.left-10,y:On(v),text:$l(C)})}return t}),Xa=e.computed(()=>{if(!_n.value||ul.value)return[];const t=[],{minY:o,maxY:l}=aa.value,r=5;for(let m=0;m<=r;m++){const v=o+(l-o)*(m/r),C=Math.round(v);t.push({x:F.value.right+10,y:ka(v),text:$l(C)})}return t}),al=t=>{const o=w.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]},Ya=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 W=o.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(W){let _=W[1];_.length===3&&(_=_[0]+_[0]+_[1]+_[1]+_[2]+_[2]),l=parseInt(_.slice(0,2),16)/255,r=parseInt(_.slice(2,4),16)/255,m=parseInt(_.slice(4,6),16)/255}else if(typeof document<"u"){const _=document.createElement("span");_.style.color=o,_.style.display="none",document.body.appendChild(_);const R=getComputedStyle(_).color;document.body.removeChild(_);const B=R.match(/^rgb\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 return"#3a3a3a"}else return"#3a3a3a"}}return .2126*l+.7152*r+.0722*m>.5?"#3a3a3a":"#fafafa"},ia=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))),W=Math.max(0,Math.min(255,Math.floor(parseInt(v.slice(4,6),16)*.65)));return`#${[C,b,W].map(_=>_.toString(16).padStart(2,"0")).join("")}`}return o},ca=(t,o)=>{const r=Z.value?.stroke?.color;return r==null?ia(o):typeof r=="string"?r:Array.isArray(r)&&r.length?r[t%r.length]??ia(o):ia(o)},ua=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},wa=e.computed(()=>be.value==="line"||Ol.value?(Ol.value?U.series.filter(o=>(o.type||be.value)==="line"):Ut.value).map((o,l)=>{const r=U.series.findIndex(B=>B===o),m=[];let v=[];o.data.forEach((B,G)=>{B==null?v.length>0&&(m.push([...v]),v=[]):v.push({x:ul.value?kn(B):kl(G),y:ul.value?Bn(G):un(o,B),index:G})}),v.length>0&&m.push(v);let C="";m.forEach(B=>{if(B.length>0){let G="";lt.value?G=ro(B):G=`M ${B[0].x} ${B[0].y}`+B.slice(1).map(Ve=>` L ${Ve.x} ${Ve.y}`).join(""),C+=(C?" ":"")+G}});const b=m.reduce((B,G)=>B+ua(G),0),W=O.value.has(r),_=q.value===r,R=q.value!==null&&q.value!==r;return{path:C,color:al(r),strokeDasharray:dl(o),pathLength:b,seriesIndex:r,animationDelay:l*K.value,isHighlighted:_,isDimmed:R,isHidden:W}}):[]),xa=e.computed(()=>{if(!(be.value==="line"||Ol.value))return[];const t=Ol.value?U.series.filter(l=>(l.type||be.value)==="line"):Ut.value,o=[];return t.forEach((l,r)=>{const m=U.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,W=0;for(let _=v+1;_<l.data.length;_++){const R=l.data[_];if(R==null)W++;else{b=_;break}}if(W>0&&b!==-1){const _=l.data[b],R=ul.value?kn(C):kl(v),B=ul.value?Bn(v):un(l,C),G=ul.value?kn(_):kl(b),Ve=ul.value?Bn(b):un(l,_),Oe=O.value.has(m),ve=q.value===m,Ce=q.value!==null&&q.value!==m;o.push({path:`M ${R} ${B} L ${G} ${Ve}`,color:al(m),seriesIndex:m,animationDelay:r*K.value,isHighlighted:ve,isDimmed:Ce,isHidden:Oe,gapSize:W}),v=b-1}}}}),o}),ja=e.computed(()=>be.value==="line"||Ol.value?!bl.value||Tn.value||Rt.value.hasAnimated?[]:(Ol.value?U.series.filter(o=>(o.type||be.value)==="line"):Ut.value).map((o,l)=>{const r=U.series.findIndex(W=>W===o);let m="",v=null;o.data.forEach((W,_)=>{if(W!=null){const R={x:ul.value?kn(W):kl(_),y:ul.value?Bn(_):un(o,W)};v===null?m+=`M ${R.x} ${R.y}`:m+=` L ${R.x} ${R.y}`,v=R}else if(v!==null){const R=o.data.findIndex((B,G)=>G>_&&B!==null&&B!==void 0);if(R!==-1){const B={x:ul.value?kn(o.data[R]):kl(R),y:ul.value?Bn(R):un(o,o.data[R])};m+=` L ${B.x} ${B.y}`,v=B}}});const C=o.data.map((W,_)=>W==null?null:{x:ul.value?kn(W):kl(_),y:ul.value?Bn(_):un(o,W)}).filter(W=>W!==null),b=ua(C);return{path:m,pathLength:b,color:al(r),strokeDasharray:dl(o),animationDelay:l*K.value,seriesIndex:r}}):[]),Ka=e.computed(()=>{if(be.value!=="line")return[];const t=[];return Ut.value.forEach((o,l)=>{const r=q.value===l,m=q.value!==null&&q.value!==l,v=O.value.has(l);o.data.forEach((C,b)=>{C!=null&&t.push({x:kl(b),y:un(o,C),color:al(l),value:C,label:U.categories[b]||b.toString(),seriesName:o.name,categoryIndex:b,dataIndex:b,animationDelay:(l*o.data.length+b)*(K.value/8),isHighlighted:r,isDimmed:m,isHidden:v})})}),t}),Ga=e.computed(()=>{if(!Ol.value)return[];const t=[];return U.series.filter(l=>(l.type||be.value)==="line").forEach((l,r)=>{const m=U.series.findIndex(W=>W===l),v=q.value===m,C=q.value!==null&&q.value!==m,b=O.value.has(m);l.data.forEach((W,_)=>{W!=null&&t.push({x:kl(_),y:un(l,W),color:al(m),value:W,label:U.categories[_]||_.toString(),seriesName:l.name,categoryIndex:_,dataIndex:_,animationDelay:(r*l.data.length+_)*(K.value/8),isHighlighted:v,isDimmed:C,isHidden:b})})}),t}),Io=e.computed(()=>{if(!It.value)return[];const t=[];return Ut.value.forEach((o,l)=>{if(!o?.data?.length)return;const r=q.value,m=r!==null&&r===l,v=r!==null&&r!==l,C=O.value.has(l);o.data.forEach((b,W)=>{let _,R,B,G,Ve;if(typeof b=="object"&&b!==null&&!Array.isArray(b))_=typeof b.x=="number"?b.x:W,R=typeof b.y=="number"?b.y:0,B=typeof b.size=="number"?b.size:20,G=b.label||U.categories?.[W]||`Point ${W+1}`,Ve=b.image||b.imageUrl;else if(Array.isArray(b)&&b.length>=3)_=typeof b[0]=="number"?b[0]:W,R=typeof b[1]=="number"?b[1]:0,B=typeof b[2]=="number"?b[2]:20,G=b[3]||U.categories?.[W]||`Point ${W+1}`,Ve=b[4];else if(typeof b=="number")_=W,R=b,B=Pe(l,W),G=U.categories?.[W]||`Point ${W+1}`;else return;!isFinite(_)||!isFinite(R)||!isFinite(B)||t.push({x:kl(_),y:On(R),radius:qa(B),originalX:_,originalY:R,originalSize:B,color:al(l),seriesName:o.name||`Series ${l+1}`,label:G,imageUrl:Ve,seriesIndex:l,dataIndex:W,categoryIndex:Math.round(_),isHighlighted:m,isDimmed:v,isHidden:C,opacity:le.value})})}),t}),da=e.computed(()=>be.value!=="area"?[]:Ut.value.map((t,o)=>{const l=[];let r=[];if(t.data.forEach((B,G)=>{B==null?r.length>0&&(l.push([...r]),r=[]):r.push({x:kl(G),y:un(t,B),index:G})}),r.length>0&&l.push(r),l.length===0)return{linePath:"",areaPath:"",color:al(o),isHidden:O.value.has(o)};const m=F.value.bottom+1;let v="",C="";l.forEach((B,G)=>{if(B.length===0)return;let Ve=`M ${B[0].x} ${B[0].y}`;lt.value&&B.length>1?Ve=ro(B):B.slice(1).forEach(ve=>{Ve+=` L ${ve.x} ${ve.y}`}),v+=(v?" ":"")+Ve;let Oe=`M ${B[0].x} ${m}`;if(Oe+=` L ${B[0].x} ${B[0].y}`,lt.value&&B.length>1){const ve=ro(B),Ce=ve.substring(ve.indexOf("C")||ve.indexOf("Q")||ve.indexOf("L"));Ce?Oe+=" "+Ce:B.slice(1).forEach(xe=>{Oe+=` L ${xe.x} ${xe.y}`})}else B.slice(1).forEach(ve=>{Oe+=` L ${ve.x} ${ve.y}`});Oe+=` L ${B[B.length-1].x} ${m} Z`,C+=(C?" ":"")+Oe});const b=q.value===o,W=q.value!==null&&q.value!==o,_=O.value.has(o),R=l.reduce((B,G)=>B+ua(G),0);return{linePath:v,areaPath:C,color:al(o),pathLength:R,isHighlighted:b,isDimmed:W,isHidden:_}})),Ea=e.computed(()=>{if(!(["bar"].includes(be.value)||Ol.value))return[];const t=[],{maxX:o}=Nt.value,l=Ol.value?U.series.filter(m=>(m.type||be.value)==="bar"):Ut.value,r=l.length;if(ul.value){const m=o+1,C=F.value.height/m,b=C*(2/3),W=Math.min(4,b/r*.15),_=b-(r-1)*W,R=Math.max(4,_/r);l.forEach((B,G)=>{const Ve=U.series.findIndex(xe=>xe===B),Oe=q.value===Ve,ve=q.value!==null&&q.value!==Ve,Ce=O.value.has(Ve);B.data.forEach((xe,pe)=>{if(xe==null||typeof xe!="number"||!isFinite(xe))return;const Le=F.value.top+(pe+.5)*C-b/2+G*(R+W),Ne=F.value.left,Ie=Math.abs(kn(xe)-F.value.left);let Mt="";if(lt.value&&Ie>0){const Ot=Math.min(M.value,R/2,Ie/2);Mt=[`M ${Ne} ${Le}`,`L ${Ne+Ie-Ot} ${Le}`,`Q ${Ne+Ie} ${Le} ${Ne+Ie} ${Le+Ot}`,`L ${Ne+Ie} ${Le+R-Ot}`,`Q ${Ne+Ie} ${Le+R} ${Ne+Ie-Ot} ${Le+R}`,`L ${Ne} ${Le+R}`,"Z"].join(" ")}t.push({x:Ne,y:Le,width:Ie,height:R,color:al(r===1?pe:Ve),value:xe,label:U.categories[pe]||pe.toString(),seriesName:B.name,animationDelay:(G*l.length+pe)*(K.value/4),isHighlighted:Oe,isDimmed:ve,isHidden:Ce,barPath:Mt,isSmooth:lt.value&&Ie>0})})})}else{const m=o+1,C=F.value.width/m,b=C*.8,W=b/r,_=W*.05,R=W-_;l.forEach((B,G)=>{const Ve=U.series.findIndex(xe=>xe===B),Oe=q.value===Ve,ve=q.value!==null&&q.value!==Ve,Ce=O.value.has(Ve);B.data.forEach((xe,pe)=>{if(xe==null||typeof xe!="number"||!isFinite(xe))return;const Le=F.value.left+(pe+.5)*C-b/2+G*W+_/2,Ne=On(Math.max(0,xe)),Ie=Math.abs(On(0)-On(xe));let Mt="";if(lt.value&&Ie>0){const Ot=Math.min(M.value,R/2,Ie/2);Mt=[`M ${Le} ${Ne+Ie}`,`L ${Le} ${Ne+Ot}`,`Q ${Le} ${Ne} ${Le+Ot} ${Ne}`,`L ${Le+R-Ot} ${Ne}`,`Q ${Le+R} ${Ne} ${Le+R} ${Ne+Ot}`,`L ${Le+R} ${Ne+Ie}`,"Z"].join(" ")}t.push({x:Le,y:Ne,width:R,height:Ie,color:al(r===1?pe:Ve),value:xe,label:U.categories[pe]||pe.toString(),seriesName:B.name,animationDelay:(G*l.length+pe)*(K.value/4),isHighlighted:Oe,isDimmed:ve,isHidden:Ce,barPath:Mt,isSmooth:lt.value&&Ie>0})})})}return t}),Ln=e.computed(()=>{if(!El.value)return[];const t=Ut.value.map((C,b)=>({series:C,originalIndex:b})).filter(({originalIndex:C})=>!O.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,W,_,R,B)=>{const G=C+(b-C)/2,Ve=b-C,Oe=zt.value+Math.cos(C)*hl.value,ve=$t.value+Math.sin(C)*hl.value,Ce=zt.value+Math.cos(b)*hl.value,xe=$t.value+Math.sin(b)*hl.value,pe=zt.value+Math.cos(b)*at.value,Ye=$t.value+Math.sin(b)*at.value,ze=zt.value+Math.cos(C)*at.value,Le=$t.value+Math.sin(C)*at.value,Ne=Ve>Math.PI?1:0,Ie=[`M ${Oe} ${ve}`,`A ${hl.value} ${hl.value} 0 ${Ne} 1 ${Ce} ${xe}`,`L ${pe} ${Ye}`,`A ${at.value} ${at.value} 0 ${Ne} 0 ${ze} ${Le}`,"Z"].join(" "),Mt=B||al(W);return{path:Ie,color:Mt,strokeWidth:Q.value,strokeColor:ca(r.length,Mt),value:R,seriesName:_,opacity:.8,isHighlighted:q.value===W,isDimmed:q.value!==null&&q.value!==W,isHidden:!1,startAngle:C,endAngle:b,midAngle:G}};if(Pn.value){const{series:C,originalIndex:b}=t[0],W=Number(C?.data?.[0]??0),_=Number.isFinite(W)?Math.min(Math.max(W,0),100):0,R=Z.value,B=Math.min(Math.max(Number(R?.miniRadial?.minVisiblePercent??1),0),100),Ve=(_<=0?B:_)/100*l,Oe=Number(R?.miniRadial?.thresholds?.low??33),ve=Number(R?.miniRadial?.thresholds?.medium??66),Ce=R?.miniRadial?.colors?.low||"#E53E3E",xe=R?.miniRadial?.colors?.medium||"#ED8936",pe=R?.miniRadial?.colors?.high||"#38A169",Ye=_<=Oe?Ce:_<=ve?xe:pe,ze=R?.miniRadial?.trackColor||"#E5E7EB",Le=C?.name||"Score";return r.push(m(o,o+l-.001,b+1,"Track",100,ze)),r.push(m(o,o+Ve,b,Le,_,Ye)),r}if(t.length===1){const{series:C,originalIndex:b}=t[0],W=C.data[0]||0,_=o,R=o+l-.001,B=_+l/2,G=zt.value+Math.cos(_)*hl.value,Ve=$t.value+Math.sin(_)*hl.value,Oe=zt.value+Math.cos(R)*hl.value,ve=$t.value+Math.sin(R)*hl.value,Ce=zt.value+Math.cos(R)*at.value,xe=$t.value+Math.sin(R)*at.value,pe=zt.value+Math.cos(_)*at.value,Ye=$t.value+Math.sin(_)*at.value,ze=1,Le=[`M ${G} ${Ve}`,`A ${hl.value} ${hl.value} 0 ${ze} 1 ${Oe} ${ve}`,`L ${Ce} ${xe}`,`A ${at.value} ${at.value} 0 ${ze} 0 ${pe} ${Ye}`,"Z"].join(" "),Ne=al(b);return r.push({path:Le,color:Ne,strokeWidth:Q.value,strokeColor:ca(0,Ne),value:W,seriesName:C.name,opacity:.8,isHighlighted:q.value===b,isDimmed:!1,isHidden:!1,startAngle:_,endAngle:R,midAngle:B}),r}if(n.value&&t.length===2){const C=t[0],b=t[1],W=Math.min(100,Math.max(0,C.series.data[0]||0)),_=W/100*l;return r.push(m(o,o+_,C.originalIndex,C.series.name,W)),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 W=C.data[0]||0,_=W/v*l,R=o,B=o+_,G=R+_/2,Ve=zt.value+Math.cos(R)*hl.value,Oe=$t.value+Math.sin(R)*hl.value,ve=zt.value+Math.cos(B)*hl.value,Ce=$t.value+Math.sin(B)*hl.value,xe=zt.value+Math.cos(B)*at.value,pe=$t.value+Math.sin(B)*at.value,Ye=zt.value+Math.cos(R)*at.value,ze=$t.value+Math.sin(R)*at.value,Le=_>Math.PI?1:0,Ne=[`M ${Ve} ${Oe}`,`A ${hl.value} ${hl.value} 0 ${Le} 1 ${ve} ${Ce}`,`L ${xe} ${pe}`,`A ${at.value} ${at.value} 0 ${Le} 0 ${Ye} ${ze}`,"Z"].join(" "),Ie=al(b);r.push({path:Ne,color:Ie,strokeWidth:Q.value,strokeColor:ca(r.length,Ie),value:W,seriesName:C.name,opacity:.8,isHighlighted:q.value===b,isDimmed:q.value!==null&&q.value!==b,isHidden:!1,startAngle:R,endAngle:B,midAngle:G}),o=B}),r)}),Qa=e.computed(()=>{const t=Ln.value;return n.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((o,l)=>({segment:o,originalIndex:l}))}),Ja=e.computed(()=>{if(!Ll.value||!El.value)return[];const t=Sn.value,o=Hn.value,l=vn.value,r=Vl.value,m=15,v=t*1.3,C=.55,b=(B,G)=>{const Ve=zt.value+Math.cos(B.midAngle)*at.value,Oe=$t.value+Math.sin(B.midAngle)*at.value,ve=zt.value+Math.cos(B.midAngle)*(at.value+o),Ce=$t.value+Math.sin(B.midAngle)*(at.value+o),pe=ve+l*(G?1:-1),Ye=G?ve+m:ve-m,ze=Ce-r,Le=`${B.seriesName}: ${$l(B.value)}`,Ne=Le.length*t*C;return{pointerStartX:Ve,pointerStartY:Oe,pointerEndX:ve,pointerEndY:Ce,horizontalEndX:pe,horizontalEndY:Ce,textX:Ye,textY:ze,text:Le,textWidth:Ne,textAnchor:G?"start":"end",isRightSide:G,pointerLineLength:Math.hypot(ve-Ve,Ce-Oe),horizontalLineLength:Math.hypot(pe-ve,0)}},W=(B,G)=>{const Ve=Math.abs(B.textY-G.textY)<v,Oe=B.isRightSide?B.textX:B.textX-B.textWidth,ve=B.isRightSide?B.textX+B.textWidth:B.textX,Ce=G.isRightSide?G.textX:G.textX-G.textWidth,xe=G.isRightSide?G.textX+G.textWidth:G.textX,pe=Oe<xe&&Ce<ve;return Ve&&pe},_=Ln.value.filter(B=>!B.isHidden),R=[];for(let B=0;B<_.length;B++){const G=_[B];let Ve=Math.cos(G.midAngle)>=0;if(B>0){const ve=R[B-1],Ce=b(G,Ve);W(ve,Ce)&&(Ve=!Ve)}const Oe=b(G,Ve);R.push({...Oe,color:G.color,isHighlighted:G.isHighlighted,isDimmed:G.isDimmed})}return R}),es=t=>{if(!t||t.isHidden)return 0;const o=t.opacity||le.value||.7;return q.value===null||q.value===void 0?o:q.value!==null?t.seriesIndex===q.value?Math.min(1,o+.1):Math.max(.5,o*.8):o},ts=t=>{if(!t||t.isHidden)return 0;const o=t.radius>20?.9:.8;return q.value!==null?t.seriesIndex===q.value?Math.min(1,o+.1):o*.7:o},Sa=(t,o)=>{if(t)try{if(q.value===t.seriesIndex?q.value=null:q.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const l=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:o,chartId:U.chartId}});window.dispatchEvent(l)}}catch(l){console.error("Error in onBubbleClick:",l)}},ls=(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(" ")},Va=(t,o)=>{if(!t||(o.stopPropagation(),Po.value=!0,q.value=t.seriesIndex,Ae.value.show=!1,!Lt.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>Be.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 W=y.value,_=g.value,R=W.map(B=>{const G=_[B]||B,Ve=Na(B,t);return Ve?{seriesName:t.seriesName,label:t.label,value:`${G}: ${Ve}`,color:t.color}:null}).filter(Boolean);Fe.value={show:!0,x:m,y:v,title:t.label||t.seriesName||"",value:"",bubbleData:R,categoryIndex:void 0,spiderAreas:[]}},Na=(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=x.value[t];if(typeof r=="function")return r(l,o);if(typeof l=="number"){const m=l.toFixed(1);return Vt.value?m+Vt.value:m}return l?.toString()||""},ns=()=>{if(!It.value||!Ae.value.data||Ae.value.data.length===0)return"Bubbles";const t=[],o=new Set;return Ae.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"},Ba=(t,o)=>{t&&(Po.value=!1,q.value=null,Fe.value.show=!1,Fe.value.bubbleData=[])},os=(t,o)=>{const l=o.target.closest(".dss-custom-chart-container");if(!l)return;const r=l.getBoundingClientRect(),m=ao(t.categoryIndex),v=t.description||t.comment||"";let C=o.clientX-r.left+15,b=o.clientY-r.top-10;const W=200,_=v?80:50;C+W>Be.value&&(C=o.clientX-r.left-W-15),b+_>rt.value&&(b=o.clientY-r.top-_-10),C<0&&(C=10),b<0&&(b=10),Gt.value={show:!0,x:C,y:b,categoryValue:m,description:v}},as=()=>{Gt.value.show=!1},mo=e.computed(()=>U.categories.length||Math.max(...Pt.value.map(t=>t.data.length))),ss=e.computed(()=>{let t=0;return Pt.value.forEach(o=>{o.data.forEach(l=>{typeof l=="number"&&(t=Math.max(t,l))})}),t||100}),Ma=e.computed(()=>{const t=[],o=mo.value;for(let l=0;l<o;l++){const r=l*2*Math.PI/o-Math.PI/2,m=zt.value+Math.cos(r)*at.value,v=$t.value+Math.sin(r)*at.value;t.push({x:m,y:v,angle:r,index:l})}return t}),rs=e.computed(()=>{const t=[],o=mo.value;return Ma.value.forEach((l,r)=>{const m=at.value+15,v=r*2*Math.PI/o-Math.PI/2,C=zt.value+Math.cos(v)*m,b=$t.value+Math.sin(v)*m+5;let W="middle",_="middle";Math.abs(Math.cos(v))>.5&&(W=Math.cos(v)>0?"start":"end"),Math.abs(Math.sin(v))>.5&&(_=Math.sin(v)>0?"hanging":"auto"),t.push({x:C,y:b,text:U.categories[r]||`Axis ${r+1}`,anchor:W,baseline:_})}),t}),is=e.ref(new Set),cs=(t,o,l)=>{const r=`current-${l}`,m=is.value.has(r),v=o.fillOpacity??mt.value;return!m&&q.value===null?v:o.isHighlighted||m?o.isComparison?v:v+.15:o.isDimmed?v*.3:v},_a=e.computed(()=>{if(!cl.value)return[];const t=[],o=mo.value;return Ut.value.map((r,m)=>({series:r,seriesIndex:m})).sort((r,m)=>{const v=Ht(r.series)?0:1,C=Ht(m.series)?0:1;return v-C}).forEach(({series:r,seriesIndex:m})=>{const v=Ht(r),C=[],b=[],W=[],_=q.value===m,R=q.value!==null&&q.value!==m,B=O.value.has(m);for(let G=0;G<o;G++){const Ve=r.data[G]||0,ve=Ve/ss.value*at.value,Ce=G*2*Math.PI/o-Math.PI/2,xe=zt.value+Math.cos(Ce)*ve,pe=$t.value+Math.sin(Ce)*ve;C.push(`${xe},${pe}`),b.push({x:xe,y:pe}),W.push({x:xe,y:pe,value:Ve,label:U.categories[G]||`Axis ${G+1}`,seriesName:r.name})}t.push({points:C.join(" "),polygonPoints:b,dataPoints:W,color:cn(r,m),fillOpacity:v?ol.value.fillOpacity:mt.value,strokeDasharray:v?dl(r)||ol.value.strokeDasharray:null,pointRadius:nn(r,v),seriesName:r.name,value:`${r.name}: ${r.data.join(", ")}`,isHighlighted:_,isDimmed:R,isHidden:B,isComparison:v,seriesIndex:m})}),t}),us=(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,W=o[m].y;C>t.y!=W>t.y&&t.x<(b-v)*(t.y-C)/(W-C)+v&&(l=!l)}return l},ds=t=>{if(!cl.value)return;const o=t.currentTarget.closest(".dss-custom-chart-container");if(!o)return;const l=o.getBoundingClientRect(),r=te.value?.getBoundingClientRect();if(!r)return;const m=t.clientX-r.left,v=t.clientY-r.top,C=_a.value.filter(b=>b.isHidden?!1:us({x:m,y:v},b.polygonPoints));if(C.length>0){C.length,q.value=C[0].seriesIndex;const b=t.clientX-l.left+10,W=t.clientY-l.top-10,_=C.length>1?460:260,R=70+mo.value*20;let B=b,G=W;B+_>Be.value&&(B=t.clientX-l.left-_-10),G+R>rt.value&&(G=t.clientY-l.top-R-10),B<0&&(B=10),G<0&&(G=10);const Ve=C.map(Oe=>({seriesName:Oe.seriesName,color:Oe.color,points:Oe.dataPoints.map(ve=>({label:ve.label,value:$l(ve.value)}))}));Fe.value={show:!0,x:B,y:G,title:"",value:"",bubbleData:[],spiderAreas:Ve}}else bn()},zo=e.computed(()=>{const t=Z.value;return t.logos.map((o,l)=>{const r=U.series[o.seriesIndex];if(!r||!r.data||r.data.length===0||O.value.has(o.seriesIndex))return null;let m,v;if(Ml.value){let b=-1,W=null;for(let R=r.data.length-1;R>=0;R--)if(r.data[R]!==null&&r.data[R]!==void 0){b=R,W=r.data[R];break}if(b===-1||W===null)return null;const _=r.data.map((R,B)=>R==null?null:{x:kl(B),y:un(r,R),index:B}).filter(R=>R!==null);if(t.animations.enabled&&!Tn.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(Rt.value.isAnimating||!Rt.value.hasAnimated))if(Rt.value.isAnimating){const R=Rt.value.currentFrame/Rt.value.totalFrames,B=va(t.animations.easing,Math.min(R,1)),G=Cs(_,B);m=G.x+(o.offsetX||0),v=G.y+(o.offsetY||0)}else m=_[0].x+(o.offsetX||0),v=_[0].y+(o.offsetY||0);else m=kl(b)+(o.offsetX||0),v=On(W)+(o.offsetY||0)}else if(El.value||cl.value){const b=Math.PI*2/t.logos.length*l;m=zt.value+Math.cos(b)*(at.value+30)+(o.offsetX||0),v=$t.value+Math.sin(b)*(at.value+30)+(o.offsetY||0)}return{...o,x:m,y:v,seriesIndex:o.seriesIndex}}).filter(Boolean)}),ms=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")},ps=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const o=document.querySelector(`.dss-logo-image-${t}`);o&&(o.style.display="none")},ma=t=>{O.value.has(t)?O.value.delete(t):O.value.add(t)},vs=e.computed(()=>{if(!Fe.value.show&&!($e.value&&Ae.value.show&&!oe.value.isZooming))return{display:"none"};let t,o;if($e.value&&Ae.value.show&&!oe.value.isZooming){t=Ae.value.x+15,o=F.value.top;const l=It.value?200:150;t+l>Be.value&&(t=Ae.value.x-l-15),t<0&&(t=10),o<10&&(o=10)}else t=Fe.value.x,o=Fe.value.y;return{left:t+"px",top:o+"px"}}),Wn=(t,o)=>{if(!Lt.value||No.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,W=Be.value,_=rt.value;m+C>W&&(m=o.clientX-r.left-C-10),v+b>_&&(v=o.clientY-r.top-b-10),m<0&&(m=10),v<0&&(v=10);let R;typeof t.categoryIndex=="number"?R=t.categoryIndex:typeof t.dataIndex=="number"?R=t.dataIndex:t.label&&U.categories.includes(t.label)&&(R=U.categories.indexOf(t.label));let B=t.seriesName||t.label||"";(ul.value||be.value==="bar")&&t.label&&(B=t.label),t.tooltipTitle&&(B=t.tooltipTitle),Fe.value={show:!0,x:m,y:v,title:B,value:$l(t.value)||"",categoryIndex:R,spiderAreas:[]}},pa=e.ref(!1),Po=e.ref(!1),bn=()=>{Fe.value.show=!1,Fe.value.spiderAreas=[],Fe.value.bubbleData=[],Ae.value.show=!1,pa.value||(q.value=null)},No=e.ref(!1),Bo=(t,o)=>{No.value=!0,Fe.value.show=!1,Ae.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>Be.value&&(m=o.clientX-r.left-C-15),m<0&&(m=10),v<0&&(v=10),Rl.value={show:!0,x:m,y:v,content:t.texts,count:t.totalCount}},Mo=()=>{No.value=!1,Rl.value.show=!1},Rt=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),va=(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}},Tn=e.computed(()=>vt.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),$a=()=>{if(!bl.value||Tn.value){Rt.value.hasAnimated=!0,p.value&&(d.value=1);return}p.value&&(d.value=0),Rt.value.isAnimating=!0,Rt.value.currentFrame=0,Rt.value.totalFrames=Math.ceil(A.value/16.67);const t=()=>{const o=Rt.value.currentFrame/Rt.value.totalFrames,l=va(L.value,Math.min(o,1));fs(l),p.value&&(d.value=l),o<1?(Rt.value.currentFrame++,Rt.value.animationId=requestAnimationFrame(t)):hs()};Rt.value.animationId=requestAnimationFrame(t)},fs=t=>{const o=P.value;o&&o.style.setProperty("--dss-animation-progress",t)},hs=()=>{Rt.value.isAnimating=!1,Rt.value.hasAnimated=!0,p.value&&(d.value=1),Rt.value.animationId&&(cancelAnimationFrame(Rt.value.animationId),Rt.value.animationId=null)},fa=e.computed(()=>!El.value||Rt.value.hasAnimated?!0:p.value?d.value>=1:Cn.value?eo.value>=1:!0),La=e.computed(()=>Ll.value&&fa.value),Oo=e.ref(!1);e.watch(La,t=>{t?(Oo.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Oo.value=!0})})):Oo.value=!1},{immediate:!0});const gs=e.computed(()=>{if(!bl.value||Tn.value||Rt.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${A.value}ms`,t["--dss-animation-easing"]=ys(L.value),t["--dss-stagger-delay"]=`${K.value}ms`,t}),ys=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",ks=()=>{if(!bl.value||Tn.value)return"";const t=["dss-chart-animated"];return Rt.value.hasAnimated||t.push(`dss-animate-${pn.value}`),Rt.value.hasAnimated||(El.value&&be.value!=="semi-radial"?t.push("dss-animate-fill"):El.value||t.push(`dss-animate-${pn.value}`)),Rt.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>U.series,(t,o)=>{He.value&&o&&Rt.value.hasAnimated&&(Rt.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>$a(),I.value)}))},{deep:!0}),e.watch(()=>oe.value.isZooming,(t,o)=>{o&&!t&&setTimeout(()=>{ko()},50)}),e.watch(()=>[oe.value.scale,oe.value.offsetX],()=>{!oe.value.isZooming&&!oe.value.isDragging&&ko()},{flush:"post"}),e.watch([el,ie],([t,o])=>{oe.value.minScale=t,oe.value.maxScale=o,(oe.value.scale<t||oe.value.scale>o)&&Jn()},{immediate:!0}),e.watch(()=>U.locale,t=>{t&&t!==N.value&&(N.value=t)},{immediate:!0}),e.watch(()=>ct.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",wo)}):document.removeEventListener("click",wo)}),e.onMounted(()=>{q.value=null,p.value&&(!bl.value||Tn.value)&&(d.value=1),Do(),e.nextTick(ut),P.value&&typeof ResizeObserver<"u"&&(J=new ResizeObserver(t=>{const o=t[0];!o||!o.contentRect||(j&&cancelAnimationFrame(j),j=requestAnimationFrame(()=>{j=null;const{width:l,height:r}=o.contentRect;we.value=Math.round(l),ye.value=Math.round(r),f.value&&(Je.value=f.value.offsetHeight||ge)}))}),J.observe(P.value)),bl.value&&!Tn.value?be.value==="semi-radial"?setTimeout(()=>z(),I.value):setTimeout(()=>$a(),I.value):(Rt.value.hasAnimated=!0,be.value==="semi-radial"&&(eo.value=1)),document.addEventListener("mousemove",Ta),document.addEventListener("mouseup",Aa),document.addEventListener("click",bo)}),e.onUnmounted(()=>{me&&(me(),me=null),j&&cancelAnimationFrame(j),J&&P.value&&(J.unobserve(P.value),J.disconnect(),J=null),Rt.value.animationId&&cancelAnimationFrame(Rt.value.animationId),D&&(cancelAnimationFrame(D),D=null),oe.value.zoomTimeout&&clearTimeout(oe.value.zoomTimeout),document.removeEventListener("mousemove",Ta),document.removeEventListener("mouseup",Aa),document.removeEventListener("click",bo),document.removeEventListener("click",wo)});const Ta=t=>{if(oe.value.isDragging&&oe.value.scale>1&&Ml.value){Ae.value.show=!1;const o=t.clientX-oe.value.lastMouseX,{minX:l,maxX:r}=Nt.value,m=r-l||1,C=o*.8;oe.value.offsetX+=C;const b=m/oe.value.scale,W=m-b,_=0,R=-W/m*F.value.width,B=_;oe.value.offsetX=Math.max(R,Math.min(B,oe.value.offsetX)),oe.value.lastMouseX=t.clientX,oe.value.lastMouseY=t.clientY}},Aa=()=>{oe.value.isDragging&&(oe.value.isDragging=!1,setTimeout(()=>{!oe.value.isDragging&&oe.value.isZooming},100))},Cs=(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 W=l[b].x-l[b-1].x,_=l[b].y-l[b-1].y,R=Math.sqrt(W*W+_*_);m.push(R),r+=R}const v=r*o;let C=0;for(let b=0;b<m.length;b++){const W=C+m[b];if(v<=W){const _=(v-C)/m[b],R=l[b],B=l[b+1];return{x:R.x+(B.x-R.x)*_,y:R.y+(B.y-R.y)*_}}C=W}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",[ks(),{"dss-chart-fill-width":Te.value,"dss-chart-fill-height":qe.value,"dss-chart-compact":El.value&&!he.value}]]),style:e.normalizeStyle({width:Te.value?"100%":Be.value+"px",height:Xt.value,...Te.value||qe.value?{overflow:El.value?"visible":(Qt.value,"hidden"),maxWidth:"100%",maxHeight:"100%"}:{},...gs.value,cursor:oa()}),"data-chart-type":be.value,ref_key:"containerEl",ref:P,onWheel:Ro,onMousedown:so,onMousemove:Ko,onMouseup:xo,onMouseleave:To,onDblclick:Jn,onContextmenu:e.withModifiers(Qo,["prevent"]),onClick:e.withModifiers(hn,["left"]),onWheelCapture:Ro},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:f},[e.createElementVNode("div",Sr,[dt.value?(e.openBlock(),e.createElementBlock("div",Vr,e.toDisplayString(dt.value),1)):e.createCommentVNode("",!0),et.value?(e.openBlock(),e.createElementBlock("div",Nr,e.toDisplayString(et.value),1)):e.createCommentVNode("",!0)]),he.value&&Xe.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Ke.value==="horizontal","dss-legend-vertical":Ke.value==="vertical","dss-legend-top":Xe.value==="top","dss-legend-bottom":Xe.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":O.value.has(r),"dss-legend-hovered":q.value===r,"dss-legend-dimmed":q.value!==null&&q.value!==r}]),onClick:m=>ma(r),onMouseenter:m=>jn(r),onMouseleave:no,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":cl.value&&Ht(l)}]),style:e.normalizeStyle({backgroundColor:cl.value&&Ht(l)?"transparent":Fl(l,r),borderColor:Fl(l,r)})},null,6),e.createElementVNode("span",Mr,e.toDisplayString(l.name),1)],46,Br))),128))],2)):e.createCommentVNode("",!0),he.value&&(Xe.value==="left"||Xe.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":Xe.value==="left","dss-legend-right":Xe.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":O.value.has(r),"dss-legend-hovered":q.value===r,"dss-legend-dimmed":q.value!==null&&q.value!==r}]),onClick:m=>ma(r),onMouseenter:m=>jn(r),onMouseleave:no,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":cl.value&&Ht(l)}]),style:e.normalizeStyle({backgroundColor:cl.value&&Ht(l)?"transparent":Fl(l,r),borderColor:Fl(l,r)})},null,6),e.createElementVNode("span",$r,e.toDisplayString(l.name),1)],46,_r))),128))],2)):e.createCommentVNode("",!0)],512),S.showAddMarkerButton&&jt.value&&Dt.value.addMarker&&(Ml.value||It.value)&&!Qt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Qn,title:e.unref($)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Sl.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,Tr),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,Lr)):e.createCommentVNode("",!0),e.createElementVNode("div",Ar,[It.value&&Et.value?(e.openBlock(),e.createElementBlock("div",Dr,"Bubble size: "+e.toDisplayString(Et.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Be.value,height:rt.value,class:"dss-chart-svg","data-smooth":lt.value,"data-animated":bl.value,ref_key:"svgEl",ref:te},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:ue.value},[e.createElementVNode("rect",{x:0,y:F.value.top,width:Be.value,height:F.value.height*4},null,8,Fr)],8,Rr),Cn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:co.value},[e.createElementVNode("path",{d:s.value},null,8,zr)],8,Ir)):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:u.value},[e.createElementVNode("path",{d:h.value},null,8,Or)],8,Pr)):e.createCommentVNode("",!0)]),Ml.value||It.value?(e.openBlock(),e.createElementBlock("g",Wr,[ne.value&&!Qt.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":Se.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Za.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${r}`,x1:F.value.left,x2:F.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,Zr))),128))],8,qr)):e.createCommentVNode("",!0),Qt.value&&ba.value.length?(e.openBlock(),e.createElementBlock("g",{key:1,class:"dss-stepbar-axis-bars dss-stepbar-axis-bars--y-only","clip-path":Se.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ba.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`stepbar-axis-bar-${r}`,x1:F.value.left,x2:F.value.right,y1:l.y,y2:l.y,stroke:Tt.value,"stroke-width":gl.value,"stroke-dasharray":Jl.value,opacity:St.value},null,8,Xr))),128))],8,Ur)):e.createCommentVNode("",!0),e.createElementVNode("g",Yr,[e.createElementVNode("line",{x1:F.value.left,x2:F.value.right,y1:F.value.bottom,y2:F.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,jr),e.createElementVNode("line",{x1:F.value.left,x2:F.value.left,y1:F.value.top,y2:F.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Kr),_n.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:F.value.right,x2:F.value.right,y1:F.value.top,y2:F.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Gr)):e.createCommentVNode("",!0)]),e.createElementVNode("g",Qr,[Qt.value?e.createCommentVNode("",!0):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(sa.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,Jr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ra.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,ei))),128)),_n.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Xa.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,ti))),128)):e.createCommentVNode("",!0),tl.value?(e.openBlock(),e.createElementBlock("text",{key:2,x:F.value.left+F.value.width/2,y:F.value.bottom+45,"text-anchor":"middle","font-size":"14",fill:"#666"},e.toDisplayString(tl.value),9,li)):e.createCommentVNode("",!0),ft.value?(e.openBlock(),e.createElementBlock("text",{key:3,x:15,y:F.value.top+12+F.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(-90, 15, ${F.value.top+F.value.height/2})`},e.toDisplayString(ft.value),9,ni)):e.createCommentVNode("",!0),_n.value&&ht.value?(e.openBlock(),e.createElementBlock("text",{key:4,x:Be.value-15,y:F.value.top+12+F.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(90, ${Be.value-15}, ${F.value.top+F.value.height/2})`},e.toDisplayString(ht.value),9,oi)):e.createCommentVNode("",!0)]),vl.value.length>0?(e.openBlock(),e.createElementBlock("g",ai,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vl.value,l=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${l.categoryIndex}`},[e.createElementVNode("g",{"clip-path":Se.value},[l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:l.x,x2:l.x,y1:F.value.bottom,y2:F.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>Bo(l,r),onMouseleave:Mo},null,40,ri)):e.createCommentVNode("",!0),l.hasAuto&&!l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:l.x,x2:l.x,y1:F.value.bottom,y2:F.value.top,stroke:"#a1d499","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>Bo(l,r),onMouseleave:Mo},null,40,ii)):e.createCommentVNode("",!0),l.hasAuto&&l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:l.x,x2:l.x,y1:F.value.bottom,y2:F.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>Bo(l,r),onMouseleave:Mo},null,40,ci)):e.createCommentVNode("",!0)],8,si),l.hasManual&&l.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x+8,cy:Math.max(15,F.value.top-10),r:"14",fill:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:r=>Bo(l,r),onMouseleave:Mo},null,40,ui)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:l.x,cy:Math.max(15,F.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=>Bo(l,r),onMouseleave:Mo},null,40,di),e.createElementVNode("text",{x:l.x,y:Math.max(15,F.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,mi)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":Se.value},[Ol.value?(e.openBlock(),e.createElementBlock("g",vi,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":ul.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ea.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=>Wn(l,m),onMouseleave:bn},null,46,fi)):(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=>Wn(l,m),onMouseleave:bn},null,46,hi))],64))),128))],2),e.createElementVNode("g",gi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wa.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?X.value+2:X.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,yi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xa.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?X.value+2:X.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,ki))),128)),ae.value>0||Ee.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Ga.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${r}`,cx:l.x,cy:l.y,r:bt(l.isHighlighted?je(l,ae.value)+2:je(l,ae.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=>Wn(l,m),onMouseleave:bn},null,46,Ci))),128)):e.createCommentVNode("",!0)])])):be.value==="line"?(e.openBlock(),e.createElementBlock("g",bi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ja.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${r}`,d:l.path,stroke:l.color,"stroke-width":X.value,"stroke-dasharray":l.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":Rt.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,wi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wa.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?X.value+2:X.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,xi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xa.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?X.value+2:X.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,Ei))),128)),ae.value>0||Ee.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Ka.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${r}`,cx:l.x,cy:l.y,r:bt(l.isHighlighted?je(l,ae.value)+2:je(l,ae.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=>Wn(l,m),onMouseleave:bn},null,46,Si))),128)):e.createCommentVNode("",!0)])):be.value==="area"?(e.openBlock(),e.createElementBlock("g",Vi,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(da.value,(l,r)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${r}`,id:`area-mask-${r}-${S.chartId}`},[e.createElementVNode("rect",{x:F.value.left-10,y:F.value.top-10,width:F.value.width+20,height:F.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${F.value.width+20}px`})},null,12,Bi)],8,Ni))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(da.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${r}`,d:l.areaPath,fill:l.color,"fill-opacity":l.isHighlighted?Zt.value+.2:Zt.value,mask:`url(#area-mask-${r}-${S.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,Mi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(da.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${r}`,d:l.linePath,stroke:l.color,"stroke-width":l.isHighlighted?X.value+1:X.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*K.value}ms`})},null,14,_i))),128))])):be.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":ul.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ea.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=>Wn(l,m),onMouseleave:bn},null,46,$i)):(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=>Wn(l,m),onMouseleave:bn},null,46,Li))],64))),128))],2)):e.createCommentVNode("",!0)],8,pi),$e.value&&Ae.value.show&&!oe.value.isZooming&&!Qt.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-crosshair","clip-path":Se.value},[e.createElementVNode("line",{x1:Ae.value.x,x2:Ae.value.x,y1:F.value.top,y2:F.value.bottom,stroke:Qe.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,Ai),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ae.value.data,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${r}`,cx:Ae.value.x,cy:l.y,r:bt(ae.value+2),fill:l.color,stroke:"none",opacity:"0.9"},null,8,Di))),128))],8,Ti)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),It.value?(e.openBlock(),e.createElementBlock("g",Hi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Io.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${r}`},[l?(e.openBlock(),e.createElementBlock("g",Ri,[e.createElementVNode("circle",{cx:l.x,cy:l.y,r:bt(l.radius),fill:l.color,"fill-opacity":es(l),stroke:l.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(ls(l,r)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:m=>Va(l,m),onMouseleave:m=>Ba(l),onClick:m=>Sa(l,m)},null,42,Fi),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:ts(l)}),onLoad:m=>Me(r),onError:m=>gt(r),onMouseenter:m=>Va(l,m),onMouseleave:m=>Ba(l),onClick:m=>Sa(l,m)},null,46,Ii)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),El.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:io.value},[be.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:zt.value,cy:$t.value,r:at.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,Pi)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":be.value,"clip-path":k.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qa.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":c(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=>Wn(l.segment,m),onMouseleave:bn},null,42,Wi))),128))],8,Oi),Un.value&&fa.value?(e.openBlock(),e.createElementBlock("g",qi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yl.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,Zi)),[[e.vShow,l.show]])),128))])):e.createCommentVNode("",!0),Rn.value&&(fa.value||Cn.value||Pn.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:Nl.value.x,y:Nl.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":Xn.value,fill:rn.value,class:"dss-radial-data-center"},e.toDisplayString(fn.value),9,Ui)):e.createCommentVNode("",!0),La.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Oo.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ja.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,Xi),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,Yi),e.createElementVNode("text",{class:"dss-radial-label-text",x:l.textX,y:l.textY,"text-anchor":l.textAnchor,"font-size":Sn.value,"dominant-baseline":"middle"},e.toDisplayString(l.text),9,ji)],6))),128))],2)):e.createCommentVNode("",!0)],8,zi)):e.createCommentVNode("",!0),cl.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:io.value},[ne.value?(e.openBlock(),e.createElementBlock("g",Gi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ot.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${r}`,cx:zt.value,cy:$t.value,r:bt(l),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*150}ms`})},null,12,Qi))),128)),e.createElementVNode("g",Ji,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ot.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${r}`},[e.createElementVNode("rect",{x:zt.value-16,y:$t.value-l-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,ec),e.createElementVNode("text",{x:zt.value,y:$t.value-l+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(yl(r)),9,tc)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ma.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${r}`,x1:zt.value,x2:l.x,y1:$t.value,y2:l.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*100}ms`})},null,12,lc))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",nc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(rs.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${r}`,x:l.x+Math.cos(r*2*Math.PI/mo.value-Math.PI/2)*16,y:l.y+Math.sin(r*2*Math.PI/mo.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,oc))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:ds,onMouseleave:bn},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_a.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${r}`},[e.createElementVNode("polygon",{points:l.points,fill:l.color,"fill-opacity":cs("current",l,r),stroke:l.color,"stroke-width":l.isHighlighted?X.value+1:X.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*K.value}ms`,transition:"all 0.2s ease"})},null,14,ac),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:bt(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*K.value+v*50}ms`,transition:"all 0.2s ease"}),onMouseover:C=>Wn(m,C),onMouseleave:bn},null,46,sc))),128)):e.createCommentVNode("",!0)]))),128))],32)],8,Ki)):e.createCommentVNode("",!0),e.createElementVNode("g",rc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zo.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${r}`,cx:l.x,cy:l.y,r:bt(l.width/2),fill:al(l.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${r}`),style:e.normalizeStyle({animationDelay:`${r*200}ms`})},null,14,ic))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zo.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=>ms(r),onError:m=>ps(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,cc))),128))])],8,Hr)),Qt.value&&ql.value.length?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-stepbar-chart-host",style:e.normalizeStyle(wn.value)},[e.createElementVNode("div",{ref_key:"stepbarScrollEl",ref:T,class:"dss-stepbar-scroll",onScroll:Go},[e.createElementVNode("div",{class:"dss-stepbar-scroll-content",style:e.normalizeStyle(Zl.value)},[_t.value?(e.openBlock(),e.createElementBlock("div",uc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mn.value,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`stepbar-grid-${r}`,class:"dss-stepbar-grid-line",style:e.normalizeStyle({top:`${l.top}px`,borderTopColor:Tt.value,borderTopWidth:`${gl.value}px`,borderTopStyle:"dashed",opacity:St.value})},null,4))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-stepbar-columns",style:e.normalizeStyle({gap:`${Il.value}px`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ql.value,l=>(e.openBlock(),e.createBlock(Ra,{key:l.key,class:"dss-stepbar-chart-column",style:e.normalizeStyle(dn.value),label:l.label,segments:l.segments,"total-value":l.totalValue,"show-counter":!1,"value-label":Vt.value,orientation:"vertical","label-position":"down","bar-height":Wl.value,"segment-order":se.value,"remainder-label":kt.value,"inactive-color":nt.value,options:Zn.value,"disable-tooltips":""},null,8,["style","label","segments","total-value","value-label","bar-height","segment-order","remainder-label","inactive-color","options"]))),128))],4),en.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-stepbar-crosshair-line",style:e.normalizeStyle(Ul.value)},null,4)):e.createCommentVNode("",!0)],4)],544)],4)):e.createCommentVNode("",!0)]),ln.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:Be.value+"px",height:rt.value+"px",backgroundImage:`url('${rl.value}')`,backgroundRepeat:"no-repeat",...to.value,opacity:En.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xn.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:Ft.value+"px",height:Ft.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(m=>il(l),["stop"]),onMouseenter:m=>os(l,m),onMouseleave:as},[e.createElementVNode("img",{src:oo(l),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,mc)],44,dc)),[[e.vShow,An.value]])),128)),Gt.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:Gt.value.x+"px",top:Gt.value.y+"px"})},[e.createElementVNode("div",pc,e.toDisplayString(Gt.value.categoryValue),1),Gt.value.description?(e.openBlock(),e.createElementBlock("div",vc,e.toDisplayString(Gt.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Lt.value&&(Fe.value.show||$e.value&&Ae.value.show&&!oe.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":$e.value&&Ae.value.show&&!oe.value.isZooming,"dss-spider-tooltip":cl.value&&Fe.value.spiderAreas&&Fe.value.spiderAreas.length>0}]),style:e.normalizeStyle(vs.value)},[!$e.value||!Ae.value.show||oe.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[cl.value&&Fe.value.spiderAreas&&Fe.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",fc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe.value.spiderAreas,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-area-${r}`,class:"dss-spider-tooltip-area"},[e.createElementVNode("div",hc,[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",gc,e.toDisplayString(m.label),1),e.createElementVNode("span",yc,e.toDisplayString(m.value),1)]))),128))]))),128))])):It.value&&Fe.value.bubbleData&&Fe.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",kc,[Fe.value.title?(e.openBlock(),e.createElementBlock("div",Cc,e.toDisplayString(Fe.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",bc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe.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",wc,[e.createElementVNode("div",xc,e.toDisplayString(Fe.value.title),1),e.createElementVNode("div",Ec,e.toDisplayString(Fe.value.value),1)])),Fe.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[At(Fe.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",Vc,e.toDisplayString(e.unref($)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(At(Fe.value.categoryIndex).flagGroups,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${r}`},[e.createElementVNode("div",Nc,[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",Bc,[e.createElementVNode("div",Mc,e.toDisplayString(m.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),At(Fe.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",_c,[o[6]||(o[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",$c,e.toDisplayString(e.unref($)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(At(Fe.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",Lc,[e.createElementVNode("div",Tc,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",Ac,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",Dc,[e.createElementVNode("div",Hc,e.toDisplayString(Qt.value?Lo():It.value?ns():S.categories[Ae.value.categoryIndex]||`Category ${Ae.value.categoryIndex+1}`),1),It.value?(e.openBlock(),e.createElementBlock("div",Rc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ae.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(Ae.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",Fc,e.toDisplayString(l.seriesName)+":",1),e.createElementVNode("span",Ic,e.toDisplayString($l(l.value)),1)]))),128))]),At(Ae.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",zc,[o[7]||(o[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Pc,e.toDisplayString(e.unref($)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(At(Ae.value.categoryIndex).flagGroups,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${r}`},[e.createElementVNode("div",Oc,[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",qc,e.toDisplayString(m.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),At(Ae.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Zc,[o[8]||(o[8]=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(At(Ae.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",Xc,[e.createElementVNode("div",Yc,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",jc,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),Ml.value&&Ct.value&&oe.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Jn},[o[9]||(o[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(oe.value.scale*100))+"% "+e.toDisplayString(e.unref($)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Er),he.value&&Xe.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Ke.value==="horizontal","dss-legend-vertical":Ke.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(U.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":O.value.has(r),"dss-legend-hovered":q.value===r,"dss-legend-dimmed":q.value!==null&&q.value!==r}]),onClick:m=>ma(r),onMouseenter:m=>jn(r),onMouseleave:no,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":cl.value&&Ht(l)}]),style:e.normalizeStyle({backgroundColor:cl.value&&Ht(l)?"transparent":Fl(l,r),borderColor:Fl(l,r)})},null,6),e.createElementVNode("span",Gc,e.toDisplayString(l.name),1)],46,Kc))),128))],2)):e.createCommentVNode("",!0),ct.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:ct.value.x+"px",top:ct.value.y+"px"}),onClick:o[0]||(o[0]=e.withModifiers(()=>{},["stop"]))},[Dt.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:Ho},e.toDisplayString(e.unref($)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),Dt.value.addMarker&&(Dt.value.downloadSvg||Dt.value.downloadPng||Dt.value.downloadCsv||Kt.value.length>0)?(e.openBlock(),e.createElementBlock("div",Qc)):e.createCommentVNode("",!0),Dt.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:zn},e.toDisplayString(e.unref($)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),Dt.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:la},e.toDisplayString(e.unref($)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),Dt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:na},e.toDisplayString(e.unref($)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Kt.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[Dt.value.downloadSvg||Dt.value.downloadPng||Dt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",Jc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Kt.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+r},[l.separator?(e.openBlock(),e.createElementBlock("div",eu)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Ao(l)),style:e.normalizeStyle(In(l)),onClick:m=>Gn(l)},[l.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:Jo(l),class:"dss-custom-menu-content"},null,8,lu)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.icon?(e.openBlock(),e.createElementBlock("span",nu,e.toDisplayString(l.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)],64))],14,tu)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Ze.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:Tl},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:o[3]||(o[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",ou,[e.createElementVNode("h3",null,e.toDisplayString(Fn.value?e.unref($)("chart.modalMarker.viewMarker"):Yn.value?e.unref($)("chart.modalMarker.editMarker"):e.unref($)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:Tl},"×")]),e.createElementVNode("div",au,[e.createElementVNode("div",su,[e.createVNode(ga,{id:"dss-marker-date",mode:"single",modelValue:Ze.value.date,"onUpdate:modelValue":o[1]||(o[1]=l=>Ze.value.date=l),"min-date":_o.value,"max-date":jo.value,disabled:Fn.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",ru,[e.createElementVNode("label",iu,e.toDisplayString(e.unref($)("chart.modalMarker.description")),1),Fn.value?(e.openBlock(),e.createElementBlock("div",cu,e.toDisplayString(Ze.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":o[2]||(o[2]=l=>Ze.value.description=l),placeholder:e.unref($)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,uu)),[[e.vModelText,Ze.value.description]])])]),e.createElementVNode("div",du,[e.createElementVNode("div",mu,[Yn.value&&!Fn.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:Vn},e.toDisplayString(e.unref($)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",pu,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:Tl},e.toDisplayString(Fn.value?e.unref($)("chart.modalMarker.close"):e.unref($)("chart.modalMarker.cancel")),1),Fn.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:gn,disabled:!(Ze.value.description&&Ze.value.description.length)},e.toDisplayString(Yn.value?e.unref($)("chart.modalMarker.save"):e.unref($)("chart.contextMenu.addMarker")),9,vu))])])])])):e.createCommentVNode("",!0)],64))}}),gu={class:"dss-modal-title"},yu={class:"dss-modal-actions"},ha={__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(S,{emit:ee}){const $=S,N=ee,de=e.ref(null),P=e.ref(null),T=e.computed(()=>{const j={"max-width":$.width};return $.height!=="auto"&&(j.height=$.height,j["min-height"]="0"),j}),me=e.computed(()=>({}));function ut(){N("close-modal")}function te(){$.backDrop&&!de.value&&N("close-modal")}function f(j){j.target.tagName==="INPUT"&&(de.value=j.target.tagName)}function we(){setTimeout(()=>{de.value=null},300)}function ye(){const j=document.body,ge=document.documentElement;P.value={bodyOverflow:j.style.overflow,bodyPosition:j.style.position,bodyTop:j.style.top,bodyWidth:j.style.width,htmlOverflow:ge.style.overflow,scrollY:window.scrollY},j.style.overflow="hidden",j.style.position="fixed",j.style.top=`-${P.value.scrollY}px`,j.style.width="100%",j.style.left="0",ge.style.overflow="hidden"}function J(){if(!P.value)return;const j=document.body,ge=document.documentElement,{bodyOverflow:_e,bodyPosition:ue,bodyTop:Se,bodyWidth:U,htmlOverflow:yt,scrollY:st}=P.value;j.style.overflow=_e||"",j.style.position=ue||"",j.style.top=Se||"",j.style.width=U||"",j.style.left="",ge.style.overflow=yt||"",window.scrollTo(0,st||0)}return e.watch(()=>$.showModal,j=>{if(j)ye(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const ge=document.getElementById("dss-modal-backdrop");ge&&(ge.addEventListener("focusin",f),ge.addEventListener("focusout",we))},100);else{J(),document.body.classList.remove("dss-modal-open");const ge=document.getElementById("dss-modal-backdrop");ge&&(ge.removeEventListener("focusin",f),ge.removeEventListener("focusout",we))}},{immediate:!0}),e.onUnmounted(()=>{$.showModal&&J()}),(j,ge)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[S.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:ge[0]||(ge[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":S.headerType,"font-size":S.titleSize})},[e.createElementVNode("h1",gu,[e.renderSlot(j.$slots,"title",{},()=>[ge[1]||(ge[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(j.$slots,"title-data"),S.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:ut,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(me.value)},[e.renderSlot(j.$slots,"content",{},()=>[ge[2]||(ge[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",yu,[e.renderSlot(j.$slots,"actions")])])],4),[[e.vShow,S.showModal]])])):e.createCommentVNode("",!0)]))}},ku={key:0,class:"dss-table-toolbar"},Cu={class:"dss-table-toolbar-left"},bu=["aria-expanded"],wu={class:"dss-pagination-select-dropdown",role:"listbox"},xu={class:"dss-table-column-visibility-label"},Eu={class:"dss-table-checkbox-wrapper"},Su=["checked","onChange"],Vu={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Nu={class:"dss-table-column-visibility-text"},Bu={class:"dss-table-toolbar-right"},Mu=["placeholder","aria-label"],_u=["aria-label"],$u=["aria-label","aria-expanded"],Lu={key:1,class:"dss-table-toolbar-extra"},Tu={class:"dss-table-thead"},Au={key:0,class:"dss-table-th dss-table-selection-column"},Du={key:0,class:"dss-table-checkbox-wrapper"},Hu=["checked","indeterminate"],Ru={key:0,class:"dss-table-checkbox__indeterminate"},Fu={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},Iu=["aria-label"],zu=["onClick"],Pu={class:"dss-table-th-content"},Ou={class:"dss-table-th-text"},Wu={key:0},qu={key:1},Zu={key:2},Uu=["data-filter-column-key","aria-expanded","aria-label","onClick"],Xu={class:"dss-table-tbody"},Yu=["onClick"],ju={class:"dss-table-checkbox-wrapper"},Ku=["type","name","checked","disabled","onChange"],Gu={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Qu={key:1,class:"dss-table-checkbox__dot"},Ju=["onClick"],ed=["aria-expanded","aria-label"],td={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},ld={key:0,class:"dss-table-expansion-row"},nd=["colspan"],od=["colspan"],ad={key:1,class:"dss-table-pagination"},sd={class:"dss-table-pagination-left"},rd={key:0},id={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},cd={class:"dss-table-pagination-center"},ud={key:0,class:"dss-pagination-controls"},dd=["disabled","title"],md=["disabled","title"],pd=["aria-label","onKeydown"],vd={class:"dss-pagination-of"},fd=["disabled","title"],hd=["disabled","title"],gd={class:"dss-table-pagination-right"},yd={class:"dss-pagination-rows-label"},kd=["aria-expanded"],Cd=["aria-selected","onClick"],bd={key:0,class:"dss-table-filter-row"},wd=["value","placeholder"],xd=["min","max","value"],Ed=["min","max","value"],Sd={class:"dss-table-filter-double-range-values"},Vd={key:2,class:"dss-table-filter-daterange"},Nd={class:"dss-table-filter-daterange-row"},Bd={class:"dss-table-filter-daterange-label"},Md=["value"],_d={class:"dss-table-filter-daterange-row"},$d={class:"dss-table-filter-daterange-label"},Ld=["value"],Td=["value","placeholder"],Ad={class:"dss-table-filter-list"},Dd=["checked","onChange"],Hd={class:"dss-table-filter-actions"},Rd={name:"DSSTable"},Fd=Object.assign(Rd,{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:S=>typeof S=="object"&&S!==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(S,{emit:ee}){const{t:$,locale:N}=fo.useI18n(),de=S,P=ee,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 me(y,g){const x=Object.assign({},y);return ut(y)&&ut(g)&&Object.keys(g).forEach(O=>{ut(g[O])?O in y?x[O]=me(y[O],g[O]):Object.assign(x,{[O]:g[O]}):Object.assign(x,{[O]:g[O]})}),x}function ut(y){return y&&typeof y=="object"&&!Array.isArray(y)}const te=e.computed(()=>me(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),ye=e.computed(()=>te.value.table.rowHeight??"auto"),J=e.computed(()=>({height:ye.value})),j=e.computed(()=>te.value.table.expandable===!0),ge=e.computed(()=>te.value.table.expandableRowData??null),_e=e.computed(()=>te.value.table.expandableRowCondition??null),ue=e.computed(()=>te.value.table.truncated===!0),Se=e.computed(()=>te.value.table.striped),U=e.computed(()=>te.value.table.bordered),yt=e.computed(()=>te.value.table.hoverable),st=e.computed(()=>te.value.table.size),De=e.computed(()=>te.value.table.align||"left");e.computed(()=>te.value.title.text),e.computed(()=>te.value.subtitle.text);const Ue=e.computed(()=>te.value.selection.enabled),Z=e.computed(()=>te.value.selection.mode),Te=e.computed(()=>te.value.selection.rowCondition??null),qe=e.computed(()=>te.value.sorting.enabled),ke=e.computed(()=>te.value.sorting.mode),Be=e.computed(()=>te.value.pagination.enabled),Je=e.computed(()=>te.value.pagination.rows),Ge=e.computed(()=>te.value.pagination.rowsPerPageOptions),rt=e.computed(()=>te.value.pagination.showCounter!==!1),Xt=e.computed(()=>te.value.pagination.showControlsGroup),be=e.computed(()=>Xt.value===!1?!1:te.value.pagination.showControls!==!1),Wt=e.computed(()=>Xt.value===!1?!1:te.value.pagination.showRowsPerPage!==!1),dt=e.computed(()=>Be.value&&(rt.value||be.value||Wt.value)),et=e.computed(()=>te.value.scrollable),Et=e.computed(()=>te.value.emptyMessage||$("table.emptyMessage")),tl=e.computed(()=>te.value.toolbar?.downloads?.pdf!==!1),ft=e.computed(()=>te.value.toolbar?.downloads?.excel!==!1),qt=e.computed(()=>te.value.toolbar?.search!==!1),ht=e.computed(()=>tl.value||ft.value||qt.value||Jt.value),Jt=e.computed(()=>te.value.toolbar?.columnVisibility!==!1),wt=e.ref(""),Yt=e.ref(!1),fe=e.ref(null);let H=null;function Y(){Yt.value?(H&&(clearTimeout(H),H=null),Yt.value=!1,wt.value="",P("search",""),fe.value?.blur()):(Yt.value=!0,H=setTimeout(()=>{H=null,fe.value?.focus()},80))}function ne(){wt.value||(Yt.value=!1)}function he(){wt.value="",P("search",""),fe.value?.focus()}const Xe=e.computed(()=>({"dss-table-striped":Se.value,"dss-table-bordered":U.value,"dss-table-hoverable":yt.value,[`dss-table-${st.value}`]:st.value!=="default","dss-table-truncated":ue.value})),Ke=(y,g)=>y?.field??y?.key??g,Lt=e.ref(new Set);function $e(){const y=new Set;return de.columns.forEach((g,x)=>{g?.hidden!==!0&&y.add(Ke(g,x))}),y}function Qe(){const y=new Set;return de.columns.forEach((g,x)=>{y.add(Ke(g,x))}),y}function Ct(y){if(!Array.isArray(y))return null;const g=Qe(),x=[];return y.forEach(O=>{g.has(O)&&x.push(O)}),x}function el(){Lt.value=$e()}const ie=e.computed(()=>{const y=Ct(de.columnVisibility);return y===null?null:new Set(y)}),X=e.computed(()=>ie.value??Lt.value),Q=e.computed(()=>de.columns.filter((y,g)=>X.value.has(Ke(y,g)))),ae=y=>{const g=de.columns.findIndex(x=>x===y);return Ke(y,g>=0?g:0)},Ee=(y,g)=>X.value.has(Ke(y,g));function je(y){P("update:columnVisibility",Array.from(y))}function bt(y,g){const x=Ke(y,g),O=new Set(X.value);O.has(x)?O.delete(x):O.add(x),ie.value===null&&(Lt.value=O),je(O)}const Zt=e.ref(null),lt=e.ref(!1);function sl(y){Zt.value&&!Zt.value.contains(y.target)&&(lt.value=!1)}const M=e.computed(()=>Q.value.length+(Ue.value?1:0)+(j.value?1:0)),w=(y,g)=>y?.id??y?.key??g,E=e.ref(new Set),se=e.ref(null),re=(y,g)=>E.value.has(w(y,g)),Re=(y,g)=>{if(!j.value)return!1;if(typeof _e.value=="function")return!!_e.value(y,g);if(typeof ge.value=="string"&&ge.value.trim()){const x=Yl(y,ge.value.trim());return Array.isArray(x)?x.length>0:x&&typeof x=="object"?Object.keys(x).length>0:x!=null&&x!==""}return!0},kt=(y,g,x)=>{if(x&&x.stopPropagation(),!Re(y,g))return;const O=w(y,g),q=new Set(E.value);q.has(O)?(q.delete(O),P("row-collapse",{data:y,index:g})):(q.add(O),P("row-expand",{data:y,index:g})),E.value=q},nt=(y,g)=>{if(!ue.value)return;const x=w(y,g);se.value!==x&&(se.value=x)},We=e.ref(null),xt=e.ref(0),Bt=e.ref([]),pt=y=>{if(ke.value==="single")return We.value===y.field?xt.value:0;{const g=Bt.value.find(x=>x.field===y.field);return g?g.order:0}},_t=y=>{const g=pt(y);return{"dss-sort-active":g!==0,"dss-sort-asc":g===1,"dss-sort-desc":g===-1}},Tt=e.ref({}),St=e.ref(null),gl=e.ref(null),Jl=220,Il=e.ref(null),ml=e.computed(()=>Q.value.find(y=>ae(y)===St.value)??null),pl=e.computed(()=>{if(!ml.value||ml.value.filter!=="range")return null;const y=ml.value,g=St.value,{min:x,max:O}=pn(y),q=y.filterMin??x,tt=y.filterMax??O,Fe=Al(g),Gt=Fe.min??q,Ae=Fe.max??tt,ct=tt-q,oe=ct===0?0:(Gt-q)/ct*100,fl=ct===0?100:(Ae-q)/ct*100;return{rangeMin:q,rangeMax:tt,currentMin:Gt,currentMax:Ae,minPct:oe,maxPct:fl}}),an=e.ref(null),Wl=e.ref("max");function wl(y){const g=an.value,x=pl.value;if(!g||!x)return;const O=g.getBoundingClientRect(),tt=(y.clientX-O.left)/O.width*100,Fe=(x.minPct+x.maxPct)/2;Wl.value=tt<Fe?"min":"max"}function Al(y){return Tt.value[y]??{}}function dn(y,g){Tt.value={...Tt.value,[y]:g}}function Dl(y){const g=Tt.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={...Tt.value};delete g[y],Tt.value=g,St.value=null,gl.value=null}function ql(){if(!St.value){gl.value=null;return}const y=Il.value;if(!y)return;const g=y.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${St.value}"]`);if(!g)return;const x=g.getBoundingClientRect();gl.value={top:x.bottom+6,left:Math.max(8,x.right-Jl)}}const mn=e.computed(()=>{const y=String(wt.value??"").trim().toLowerCase();return y?de.data.filter(g=>Q.value.some(x=>Zl(rn(g,x)).some(q=>String(q).toLowerCase().includes(y)))):de.data}),wn=e.computed(()=>{let y=[...mn.value];const g=(wt.value??"").trim().toLowerCase();return g&&(y=y.filter(x=>de.columns.some(O=>{if(!O||!O.field)return!1;const q=rn(x,O);return String(q??"").toLowerCase().includes(g)}))),Q.value.forEach(x=>{const O=ae(x),q=Tt.value[O];if(!q)return;const tt=x.field;if(tt){if(q.type==="string"&&q.value?.trim()){const Fe=q.value.trim().toLowerCase();y=y.filter(Gt=>{const Ae=rn(Gt,x);return String(Ae??"").toLowerCase().includes(Fe)})}else if(q.type==="range")y=y.filter(Fe=>{const Gt=Yl(Fe,tt),Ae=Number(Gt);return!(Number.isNaN(Ae)||q.min!=null&&Ae<q.min||q.max!=null&&Ae>q.max)});else if(q.type==="dateRange"){const Fe=q.from?new Date(q.from).getTime():null,Gt=q.to?new Date(q.to).getTime():null;y=y.filter(Ae=>{const ct=Yl(Ae,tt),oe=ct?new Date(ct).getTime():NaN;return!(Number.isNaN(oe)||Fe!=null&&oe<Fe||Gt!=null&&oe>Gt)})}else if(q.type==="list"&&q.selected?.length){const Fe=new Set(q.selected);y=y.filter(Gt=>Zl(rn(Gt,x)).some(ct=>Fe.has(ct)))}}}),y});function Zl(y){if(y==null)return[""];if(Array.isArray(y))return y.flatMap(Zl);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 en(y){const g=new Set;return de.data.forEach(x=>{Zl(rn(x,y)).forEach(q=>g.add(q))}),Array.from(g).sort((x,O)=>String(x).localeCompare(String(O)))}function Ul(y,g){if(St.value===y){St.value=null,gl.value=null;return}if(St.value=y,g?.currentTarget){const x=g.currentTarget.getBoundingClientRect();gl.value={top:x.bottom+6,left:Math.max(8,x.right-Jl)}}else ql()}function bl(y,g){dn(y,{type:"string",value:g})}function pn(y){const g=y.field;if(!g)return{min:0,max:100};let x=1/0,O=-1/0;return de.data.forEach(q=>{const tt=Yl(q,g),Fe=Number(tt);Number.isNaN(Fe)||(x=Math.min(x,Fe),O=Math.max(O,Fe))}),{min:x===1/0?0:x,max:O===-1/0?100:O}}function A(y,g,x){const O={...Al(y),type:"range"},q=x===""?null:Number(x),tt=q===null||Number.isNaN(q)?null:q;O[g]=tt,tt!=null&&(g==="min"&&O.max!=null&&tt>O.max&&(O.max=tt),g==="max"&&O.min!=null&&tt<O.min&&(O.min=tt)),dn(y,O)}function I(y,g,x){const O={...Al(y),type:"dateRange"};O[g]=x||"",dn(y,O)}const L=e.reactive({});function K(y,g){L[y]=g}function He(y){const g=ae(y),x=(L[g]??"").trim().toLowerCase(),O=en(y);return x?O.filter(q=>String(q).toLowerCase().includes(x)):O}function vt(y,g){return(Al(y).selected??[]).includes(g!=null?String(g):"")}function mt(y,g){const O=[...Al(y).selected??[]],q=g!=null?String(g):"",tt=O.indexOf(q);tt>=0?O.splice(tt,1):O.push(q),dn(y,{type:"list",selected:O})}function it(y){St.value&&!y.target.closest(".dss-table-filter-wrap")&&!y.target.closest(".dss-table-filter-dropdown")&&(St.value=null,gl.value=null)}function ot(){ql(),Kt.value&&Hl()}const yl=y=>{if(!(y.sortable===!1||!qe.value))if(ke.value==="single")We.value===y.field?xt.value=xt.value===1?-1:xt.value===-1?0:1:(We.value=y.field,xt.value=1),xt.value===0&&(We.value=null),P("sort",{field:We.value,order:xt.value});else{const g=Bt.value.findIndex(x=>x.field===y.field);g>=0?Bt.value[g].order===1?Bt.value[g].order=-1:Bt.value.splice(g,1):Bt.value.push({field:y.field,order:1}),P("sort",{multiSortMeta:Bt.value})}},xl=e.computed(()=>{if(!qe.value)return wn.value;let y=[...wn.value];return ke.value==="single"&&We.value&&xt.value!==0?y.sort((g,x)=>{const O=Yl(g,We.value),q=Yl(x,We.value);return O===q?0:O==null?1:q==null?-1:(O<q?-1:O>q?1:0)*xt.value}):ke.value==="multiple"&&Bt.value.length>0&&y.sort((g,x)=>{for(const O of Bt.value){const q=Yl(g,O.field),tt=Yl(x,O.field);if(q===tt)continue;if(q==null)return 1;if(tt==null)return-1;const Fe=q<tt?-1:q>tt?1:0;if(Fe!==0)return Fe*O.order}return 0}),y}),jt=e.ref(0),Dt=e.ref(Je.value),Kt=e.ref(!1),Sl=e.ref(null),tn=e.ref(null),Ft=e.ref("bottom"),Vt=e.ref(null),$l=y=>{Dt.value=y,Kt.value=!1,jt.value=0,P("page",{page:0,rows:Dt.value})};function An(y){Sl.value&&!Sl.value.contains(y.target)&&(Kt.value=!1)}function Hl(){const y=Sl.value,g=tn.value;if(!y||!g)return;const x=y.querySelector(".dss-pagination-select-dropdown");if(!x)return;const O=g.getBoundingClientRect(),q=x.offsetHeight||0,Fe=(window.innerHeight||document.documentElement.clientHeight)-O.bottom,Gt=O.top;Ft.value=Fe<q+8&&Gt>Fe?"top":"bottom",Vt.value={width:`${Math.ceil(O.width)}px`,left:`${Math.max(0,Math.round(g.offsetLeft))}px`}}const xn=e.computed(()=>xl.value.length),ln=e.computed(()=>Math.ceil(xn.value/Dt.value)),En=e.computed(()=>Math.max(ln.value,1)),Dn=e.computed(()=>xn.value===0?0:ll.value+1),zl=e.computed(()=>to.value),ll=e.computed(()=>Be.value?jt.value*Dt.value:0),to=e.computed(()=>Be.value?Math.min((jt.value+1)*Dt.value,xn.value):xn.value),Xl=e.computed(()=>{if(!Be.value)return xl.value;const y=ll.value,g=to.value;return xl.value.slice(y,g)}),At=e.ref(new Set),lo=e.computed(()=>xl.value.filter((y,g)=>At.value.has(w(y,g)))),rl=(y,g)=>{const x=Te.value;return typeof x!="function"?!0:!!x(y,g)},Ll=e.computed(()=>xl.value.map((y,g)=>({row:y,index:g})).filter(({row:y,index:g})=>rl(y,g))),Sn=e.computed(()=>{const y=Ll.value;return y.length===0?!1:y.every(({row:g,index:x})=>At.value.has(w(g,x)))}),Hn=e.computed(()=>{const y=Ll.value;if(y.length===0)return!1;const g=y.filter(({row:x,index:O})=>At.value.has(w(x,O))).length;return g>0&&g<y.length}),vn=(y,g)=>At.value.has(w(y,g)),Vl=()=>{if(Sn.value)At.value=new Set,P("unselect-all");else{const y=new Set;Ll.value.forEach(({row:g,index:x})=>y.add(w(g,x))),At.value=y,P("select-all",lo.value)}},Un=(y,g)=>{if(!rl(y,g))return;const x=w(y,g),O=new Set(At.value),q=O.has(x);Z.value==="single"?q?(O.delete(x),P("row-unselect",y)):(O.clear(),O.add(x),P("row-select",y)):q?(O.delete(x),P("row-unselect",y)):(O.add(x),P("row-select",y)),At.value=O},sn=e.ref("1"),Rn=()=>{const y=Number.parseInt(String(sn.value),10);if(!Number.isFinite(y)){sn.value=String(jt.value+1);return}const g=Math.min(En.value,Math.max(1,y));g!==jt.value+1?fn(g-1):sn.value=String(g)},fn=y=>{y<0||y>=ln.value||(jt.value=y,P("page",{page:y,rows:Dt.value}))},Xn=(y,g,x)=>{P("row-click",{data:y,index:g,originalEvent:x}),nt(y,ll.value+g)},Nl=(y,g)=>{const x=ll.value+g;return{"dss-table-row-selected":vn(y,x),"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":se.value===w(y,x)}},rn=(y,g)=>g.field?Yl(y,g.field):"",Yl=(y,g)=>g.split(".").reduce((x,O)=>x&&x[O],y),vl=y=>{const g=y.align??De.value;return{"dss-table-sortable":y.sortable!==!1&&qe.value,"dss-table-align-left":g==="left","dss-table-align-center":g==="center","dss-table-align-right":g==="right",[y.className]:y.className}},Rl=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!==N.value&&(N.value=y)},{immediate:!0}),e.watch(Je,y=>{Dt.value=y,jt.value=0}),e.watch(Kt,async y=>{y&&(await e.nextTick(),Hl())}),e.watch(jt,y=>{sn.value=String(y+1)},{immediate:!0}),e.watch(wt,y=>{P("search",y??"")}),e.watch(()=>de.columns,()=>{if(ie.value===null){el();return}const y=Ct(de.columnVisibility)??[];y.length!==de.columnVisibility.length&&P("update:columnVisibility",y)},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",An),document.addEventListener("click",sl),document.addEventListener("click",it),window.addEventListener("resize",ot),window.addEventListener("scroll",ot,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",An),document.removeEventListener("click",sl),document.removeEventListener("click",it),window.removeEventListener("resize",ot),window.removeEventListener("scroll",ot,!0)}),(y,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:Il,style:e.normalizeStyle({width:f.value+"px",height:we.value?we.value+"px":"auto"})},[ht.value?(e.openBlock(),e.createElementBlock("div",ku,[e.createElementVNode("div",Cu,[tl.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),ft.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),Jt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:Zt},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":lt.value}]),onClick:g[2]||(g[2]=x=>lt.value=!lt.value),"aria-expanded":lt.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,bu),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",wu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.columns,(x,O)=>(e.openBlock(),e.createElementBlock("li",{key:Ke(x,O),role:"option",class:"dss-table-column-visibility-option",onClick:g[3]||(g[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",xu,[e.createElementVNode("span",Eu,[e.createElementVNode("input",{type:"checkbox",checked:Ee(x,O),onChange:q=>bt(x,O),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Su),Ee(x,O)?(e.openBlock(),e.createElementBlock("span",Vu,[...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",Nu,e.toDisplayString(x.header),1)])]))),128))],512),[[e.vShow,lt.value]])]),_:1})],512)):e.createCommentVNode("",!0),e.renderSlot(y.$slots,"header")]),e.createElementVNode("div",Bu,[qt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":Yt.value||wt.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:fe,"onUpdate:modelValue":g[4]||(g[4]=x=>wt.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=>Yt.value=!0),onBlur:ne},null,40,Mu),[[e.vModelText,wt.value]]),wt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":e.unref($)("table.clearSearchAriaLabel"),onClick:he},[...g[26]||(g[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,_u)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref($)("table.searchAriaLabel"),"aria-expanded":Yt.value||!!wt.value,onMousedown:e.withModifiers(Y,["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,$u)],2)):e.createCommentVNode("",!0),y.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",Lu,[e.renderSlot(y.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":et.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",Xe.value])},[e.createElementVNode("thead",Tu,[e.createElementVNode("tr",null,[Ue.value?(e.openBlock(),e.createElementBlock("th",Au,[Z.value==="multiple"?(e.openBlock(),e.createElementBlock("span",Du,[e.createElementVNode("input",{type:"checkbox",checked:Sn.value,indeterminate:Hn.value,onChange:Vl,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Hu),Hn.value?(e.openBlock(),e.createElementBlock("span",Ru)):Sn.value?(e.openBlock(),e.createElementBlock("span",Fu,[...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),j.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:"dss-table-th dss-table-expansion-column","aria-label":e.unref($)("table.expandRowAriaLabel")},null,8,Iu)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,(x,O)=>(e.openBlock(),e.createElementBlock("th",{key:ae(x),class:e.normalizeClass(["dss-table-th",vl(x)]),style:e.normalizeStyle(Rl(x)),onClick:q=>yl(x)},[e.createElementVNode("div",Pu,[e.createElementVNode("span",Ou,e.toDisplayString(x.header),1),x.sortable!==!1&&qe.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",_t(x)])},[pt(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)])])):pt(x)===1?(e.openBlock(),e.createElementBlock("span",qu,[...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)])])):pt(x)===-1?(e.openBlock(),e.createElementBlock("span",Zu,[...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":St.value===ae(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":Dl(ae(x))}]),"data-filter-column-key":ae(x),"aria-expanded":St.value===ae(x),"aria-label":e.unref($)("table.filterColumnAriaLabel"),onClick:q=>Ul(ae(x),q)},[...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,Uu)],2)):e.createCommentVNode("",!0)])],14,zu))),128))])]),e.createElementVNode("tbody",Xu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xl.value,(x,O)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:w(x,ll.value+O)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Nl(x,O)]),style:e.normalizeStyle(J.value),onClick:q=>Xn(x,O,q)},[Ue.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",ju,[e.createElementVNode("input",{type:Z.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${S.tableId}`,checked:vn(x,ll.value+O),disabled:!rl(x,ll.value+O),onChange:q=>Un(x,ll.value+O),class:e.normalizeClass(["dss-table-checkbox",Z.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio",{"dss-table-checkbox--disabled":!rl(x,ll.value+O)}])},null,42,Ku),Z.value==="multiple"&&vn(x,ll.value+O)?(e.openBlock(),e.createElementBlock("span",Gu,[...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)])])):Z.value==="single"&&vn(x,ll.value+O)?(e.openBlock(),e.createElementBlock("span",Qu)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),j.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(q=>kt(x,ll.value+O,q),["stop"])},[Re(x,ll.value+O)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":re(x,ll.value+O),"aria-label":re(x,ll.value+O)?e.unref($)("table.collapseRowAriaLabel"):e.unref($)("table.expandRowAriaLabel")},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":re(x,ll.value+O)}]),"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,ed)):(e.openBlock(),e.createElementBlock("span",td))],8,Ju)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,(q,tt)=>(e.openBlock(),e.createElementBlock("td",{key:ae(q),class:e.normalizeClass(["dss-table-td",vl(q)]),style:e.normalizeStyle(Rl(q))},[e.renderSlot(y.$slots,`cell-${q.field}`,{data:x,column:q,rowIndex:O,isExpanded:se.value===w(x,ll.value+O)},()=>[e.createTextVNode(e.toDisplayString(rn(x,q)),1)])],6))),128))],14,Yu),j.value&&Re(x,ll.value+O)&&re(x,ll.value+O)?(e.openBlock(),e.createElementBlock("tr",ld,[e.createElementVNode("td",{colspan:M.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(y.$slots,"expansion",{data:x,rowIndex:O})],8,nd)])):e.createCommentVNode("",!0)],64))),128)),Xl.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(Et.value),1)])],8,od)],4))])],2)],2),dt.value?(e.openBlock(),e.createElementBlock("div",ad,[e.createElementVNode("div",sd,[rt.value?(e.openBlock(),e.createElementBlock("span",rd,e.toDisplayString(e.unref($)("table.showingRange",{start:Dn.value,end:zl.value,total:xn.value})),1)):(e.openBlock(),e.createElementBlock("span",id," "))]),e.createElementVNode("div",cd,[be.value?(e.openBlock(),e.createElementBlock("div",ud,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:jt.value===0,onClick:g[8]||(g[8]=x=>fn(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,dd),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:jt.value===0,onClick:g[9]||(g[9]=x=>fn(jt.value-1)),title:e.unref($)("table.previousPage")}," ‹ ",8,md),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":g[10]||(g[10]=x=>sn.value=x),type:"text",class:"dss-pagination-page-input","aria-label":e.unref($)("table.currentPageAriaLabel"),onBlur:Rn,onKeydown:e.withKeys(e.withModifiers(Rn,["prevent"]),["enter"])},null,40,pd),[[e.vModelText,sn.value]]),e.createElementVNode("span",vd,e.toDisplayString(e.unref($)("table.ofPages",{total:En.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:jt.value>=ln.value-1,onClick:g[11]||(g[11]=x=>fn(jt.value+1)),title:e.unref($)("table.nextPage")}," › ",8,fd),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:jt.value>=ln.value-1,onClick:g[12]||(g[12]=x=>fn(ln.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,hd)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",gd,[Wt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:Sl},[e.createElementVNode("span",yd,e.toDisplayString(e.unref($)("table.rowsPerPage"))+":",1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Kt.value}]),onClick:g[13]||(g[13]=x=>Kt.value=!Kt.value),"aria-expanded":Kt.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:tn},[e.createTextVNode(e.toDisplayString(Dt.value)+" ",1),g[37]||(g[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,kd),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":Ft.value==="top"}]),style:e.normalizeStyle(Vt.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ge.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x,role:"option","aria-selected":x===Dt.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":x===Dt.value}]),onClick:O=>$l(x)},e.toDisplayString(x),11,Cd))),128))],6),[[e.vShow,Kt.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(gl.value?{top:gl.value.top+"px",left:gl.value.left+"px",width:Jl+"px"}:void 0),onClick:g[21]||(g[21]=e.withModifiers(()=>{},["stop"]))},[ml.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[ml.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",bd,[e.createElementVNode("input",{type:"text",value:Al(St.value).value??"",onInput:g[14]||(g[14]=x=>bl(St.value,x.target.value)),class:"dss-table-filter-input",placeholder:e.unref($)("table.search")},null,40,wd)])):ml.value.filter==="range"&&pl.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":pl.value.minPct+"%","--range-max-pct":pl.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:an,class:"dss-table-filter-double-range-track",onMousemove:wl,onMouseenter:wl},[e.createElementVNode("input",{type:"range",min:pl.value.rangeMin,max:pl.value.rangeMax,value:pl.value.currentMin,onInput:g[15]||(g[15]=x=>A(St.value,"min",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:Wl.value==="min"?2:1})},null,44,xd),e.createElementVNode("input",{type:"range",min:pl.value.rangeMin,max:pl.value.rangeMax,value:pl.value.currentMax,onInput:g[16]||(g[16]=x=>A(St.value,"max",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:Wl.value==="max"?2:1})},null,44,Ed)],544),e.createElementVNode("div",Sd,e.toDisplayString(pl.value.currentMin)+" – "+e.toDisplayString(pl.value.currentMax),1)],4)):ml.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",Vd,[e.createElementVNode("div",Nd,[e.createElementVNode("label",Bd,e.toDisplayString(e.unref($)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:Al(St.value).from??"",onInput:g[17]||(g[17]=x=>I(St.value,"from",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Md)]),e.createElementVNode("div",_d,[e.createElementVNode("label",$d,e.toDisplayString(e.unref($)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:Al(St.value).to??"",onInput:g[18]||(g[18]=x=>I(St.value,"to",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Ld)])])):ml.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:L[St.value]??"",onInput:g[19]||(g[19]=x=>K(St.value,x.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref($)("table.search")},null,40,Td),e.createElementVNode("div",Ad,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(He(ml.value),x=>(e.openBlock(),e.createElementBlock("label",{key:x,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:vt(St.value,x),onChange:O=>mt(St.value,x)},null,40,Dd),e.createElementVNode("span",null,e.toDisplayString(x),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",Hd,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:g[20]||(g[20]=x=>Zn(St.value))},e.toDisplayString(e.unref($)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,St.value&&ml.value&&gl.value]])]),_:1})]))],64))}}),Id="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",zd="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",Pd="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",Od="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",qd="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",Zd={class:"dss-toolbar-left"},Ud=["title"],Xd=["title"],Yd={class:"dss-toolbar-dropdown-wrapper"},jd=["title"],Kd=["src"],Gd=["src"],Qd=["src"],Jd=["src"],e1=["src"],t1=["src"],l1={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},n1=["src"],o1=["src"],a1=["src"],s1=["src"],r1=["src"],i1=["src"],c1=["title"],u1=["title"],d1=["title"],m1=["title"],p1=["title"],v1=["title"],f1=["title"],h1=["title"],g1=["title"],y1={key:2,class:"dss-toolbar-separator"},k1=["title"],C1={key:4,class:"dss-toolbar-separator"},b1={key:5,class:"dss-toolbar-dropdown-wrapper"},w1=["title"],x1={class:"dss-toolbar-dropdown-ai"},E1={class:"dss-toolbar-right"},S1={key:0,class:"dss-toolbar-custom-group"},V1={key:1,class:"dss-toolbar-separator"},N1={class:"dss-link-modal-content"},B1={class:"dss-link-modal-field"},M1={class:"dss-link-modal-label"},_1=["placeholder"],$1={class:"dss-link-modal-field"},L1={class:"dss-link-modal-label"},T1=["placeholder"],A1={class:"dss-image-modal-tabs"},D1={key:0,class:"dss-image-tab-content"},H1={class:"dss-link-modal-content"},R1={class:"dss-link-modal-field"},F1={key:0,class:"dss-link-modal-label"},I1=["src"],z1={class:"dss-link-modal-field"},P1={class:"dss-link-modal-label"},O1=["placeholder"],W1={class:"dss-link-modal-field"},q1={class:"dss-link-modal-label"},Z1=["placeholder"],U1={class:"dss-link-modal-field"},X1={class:"dss-link-modal-label"},Y1=["placeholder"],j1={key:1,class:"dss-image-tab-content"},K1={class:"dss-link-modal-content"},G1={class:"dss-link-modal-field"},Q1={class:"dss-link-modal-label"},J1=["placeholder"],em={class:"dss-link-modal-field"},tm={class:"dss-link-modal-label"},lm=["placeholder"],nm={class:"dss-link-modal-field"},om={class:"dss-link-modal-label"},am=["placeholder"],sm={class:"dss-link-modal-field"},rm={class:"dss-link-modal-label"},im=["placeholder"],cm={class:"dss-text-editor-title-input-container"},um={key:0,class:"dss-text-editor-title-preview"},dm={key:0},mm={key:1,class:"dss-text-editor-preview-placeholder"},pm=["value","placeholder","disabled"],vm={key:3,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},fm={class:"dss-text-editor-description-input-container"},hm={key:0,class:"dss-text-editor-description-preview"},gm={key:0},ym={key:1,class:"dss-text-editor-preview-placeholder"},km=["value","placeholder","disabled"],Cm={key:5,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},bm=["data-comment-id","onMouseenter"],wm=["onClick"],xm=["src","alt"],Em={key:1},Sm=["onClick"],Vm=["src","alt"],Nm={key:1},Bm=["data-has-second-user","onClick"],Mm={class:"editor-comment-marker-count"},_m={key:7,class:"dss-text-editor-textarea-wrapper"},$m=["value","placeholder","rows","disabled"],Lm={class:"dss-text-editor-footer"},Tm={class:"dss-text-editor-footer-content"},Am={class:"dss-text-editor-footer-stat"},Dm={class:"dss-text-editor-footer-stat"},Hm={key:8,class:"dss-text-editor-content-wrapper"},Rm={key:0,class:"dss-comment-overlay-body"},Fm={class:"dss-comment-selection-wrapper"},Im=["innerHTML"],zm={class:"dss-comment-messages-wrapper"},Pm={key:0,class:"dss-comment-avatar-wrapper"},Om={class:"dss-comment-avatar"},Wm=["src","alt"],qm={key:1},Zm={class:"dss-comment-header"},Um={class:"dss-comment-header-text"},Xm={class:"dss-comment-author"},Ym={key:0,class:"dss-comment-date"},jm=["onClick","title"],Km={class:"dss-comment-overlay-inner"},Gm=["placeholder","onKeydown"],Qm={class:"dss-text-editor-footer"},Jm={class:"dss-text-editor-footer-content"},e2={class:"dss-text-editor-footer-stat"},t2={class:"dss-text-editor-footer-stat"},l2=["title"],n2=["title"],o2={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:""},a2={class:"dss-image-popup-content"},s2={key:0,class:"dss-image-popup-no-alt-icon"},r2=["title"],i2=["title"],c2={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:""},u2={class:"dss-toolbar-left"},d2=["title"],m2=["title"],p2={class:"dss-toolbar-dropdown-wrapper"},v2=["title"],f2=["src"],h2=["src"],g2=["src"],y2=["src"],k2=["src"],C2=["src"],b2={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},w2=["title"],x2=["title"],E2=["title"],S2=["title"],V2=["title"],N2=["title"],B2=["title"],M2=["title"],_2=["title"],$2={key:2,class:"dss-toolbar-separator"},L2=["title"],T2={key:4,class:"dss-toolbar-separator"},A2={key:5,class:"dss-toolbar-dropdown-wrapper"},D2=["title"],H2={class:"dss-toolbar-dropdown-ai"},R2={key:0,class:"dss-toolbar-right"},F2={key:0,class:"dss-toolbar-separator"},I2={key:0,class:"dss-toolbar-custom-group"},z2={key:1,class:"dss-toolbar-separator"},P2={name:"DSSTextEditor"},O2=Object.assign(P2,{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:S=>typeof S=="object"&&S!==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:S=>typeof S=="object"&&S!==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(S,{expose:ee,emit:$}){const{t:N,locale:de}=fo.useI18n(),P={h1:Id,h2:zd,h3:Pd,h4:Od,h5:Wd,h6:qd},T=S,me=$,ut=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>`,f=e.ref(null),be=e.ref(null),ye=e.ref(!1),J=e.ref(!1),j=e.ref(!1),ge=e.ref(""),_e=e.ref({}),ue=e.ref(!1),Se=e.ref(!1),U=e.ref(""),yt=e.ref(""),st=e.ref(null),De=e.ref(null),Ue=e.ref(null),Z=e.ref(null),Te=e.ref(""),qe=e.ref(!1),ke=e.ref({}),Be=e.ref(!1),Je=e.ref({}),Ge=e.ref(null),rt=e.ref(null),Yt=e.ref(!1),we=e.ref(""),qt=e.ref(null),dt=e.ref(""),et=e.ref(""),Et=e.ref(""),tl=e.ref(null),ft=e.ref(null),Zt=e.ref(null),ht=e.ref(null),Jt=e.ref(null),wt=e.ref(!1),jt=e.ref(""),fe=e.ref({}),H=e.ref(!1),Y=e.ref("upload"),ne=e.ref(""),he=e.ref(null),Xe=e.ref(null),Ke=e.ref([]),Lt=e.ref([]),$e=e.ref(null),Qe=e.ref(!1),Ct=e.ref(""),el=e.ref(""),ie=e.ref(""),X=e.ref(""),Q=e.ref(""),ae=e.ref(""),Ee=e.ref(null),je=e.ref(null),bt=e.ref(null),Ut=e.ref(!1),lt=e.ref(null),sl=e.ref(!1),M=e.ref(!1),w=e.ref(null),E=e.ref("p"),se=e.ref(!1),re=e.ref([]),Re=e.ref(null),kt=e.ref(null),nt=e.ref(null),We=e.ref(!1),xt=e.ref(0),Bt=100,pt=e.ref(null),_t=e.computed(()=>!!T.commentUser),Tt=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":_t.value&&vl.value!==null})),St=e.computed(()=>({})),gl=e.computed(()=>!T.fixedHeight||T.fullHeight?{}:{height:`${1.6*14*T.rows+24+2}px`,resize:"none",overflowY:"auto"}),Jl=e.computed(()=>!T.fixedHeight||T.fullHeight?{}:{height:`${1.6*14*T.rows+32}px`,overflowY:"auto"}),Il=e.computed(()=>T.richText&&Lt.value.length>0),ml=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(/&nbsp;/g," "),a=a.replace(/&amp;/g,"&"),a=a.replace(/&lt;/g,"<"),a=a.replace(/&gt;/g,">"),a=a.replace(/&quot;/g,'"'),a=a.replace(/&#39;/g,"'"),a=a.replace(/\s+/g," ").trim(),a}return T.modelValue}),pl=e.computed(()=>{const a=ml.value.trim();return a?a.split(/\s+/).filter(n=>n.length>0).length:0}),an=e.computed(()=>ml.value.length),Wl=e.computed(()=>ht.value!==null&&Y.value==="upload"&&dt.value&&dt.value.startsWith("data:")),wl=e.computed(()=>T.titlePlaceholder||N("textEditor.placeholders.title")),Al=e.computed(()=>T.descriptionPlaceholder||N("textEditor.placeholders.description")),dn=e.computed(()=>T.placeholder||N("textEditor.placeholders.startTyping")),Dl=a=>ut&&ut[a]!==void 0,Zn=a=>{for(let n=a+1;n<T.customToolbarSlots.length;n++)if(Dl(T.customToolbarSlots[n]))return!0;return!1},ql=a=>{for(let n=a+1;n<T.customToolbarSlots.length;n++){const s=T.customToolbarSlots[n];if(Dl(s)&&mn(s))return!0}return!1},mn=a=>T.customToolbarFloatingMap.hasOwnProperty(a)?T.customToolbarFloatingMap[a]===!0:!0,wn=e.computed(()=>T.customToolbarSlots.some(a=>Dl(a)&&mn(a))),Zl=e.computed(()=>Dl("title-slot")),en=e.computed(()=>Dl("description-slot")),Ul=a=>{if(!a||a.trim()==="")return"<html></html>";const n=a.trim();return n.startsWith("<html>")&&n.endsWith("</html>")?a:`<html>${a}</html>`},bl=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=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""}},I=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=N("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"},L=a=>{const n=a.target.value;me("update:modelValue",n),me("change",n)},K=()=>{if(!Ee.value)return;const a=Ee.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")},He=()=>{sl.value=!0,K()},vt=()=>{sl.value=!1,mt()},mt=()=>{if(!Ee.value)return;const a=Ee.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")},it=a=>{const s=a.target.value;sl.value&&K(),me("update:title",s),me("title-change",s),bt.value="title",T.richText&&(Qe.value||(el.value=Ct.value,Q.value=ie.value,ae.value=X.value),$e.value&&clearTimeout($e.value),Qe.value=!0,$e.value=setTimeout(()=>{Qe.value=!1,Ft()},500))},ot=()=>{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")},yl=()=>{M.value=!0,ot()},xl=()=>{M.value=!1,Kt()},Kt=()=>{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")},Dt=a=>{const s=a.target.value;M.value&&ot(),me("update:description",s),me("description-change",s),bt.value="description",T.richText&&(Qe.value||(el.value=Ct.value,Q.value=ie.value,ae.value=X.value),$e.value&&clearTimeout($e.value),Qe.value=!0,$e.value=setTimeout(()=>{Qe.value=!1,Ft()},500))},Gt=()=>{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}},Sl=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()}},tn=()=>{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)},Ft=(a=!1)=>{if(!f.value)return;const n=f.value.innerHTML,s=T.title||"",i=T.description||"";if(!a&&n===Ct.value&&s===ie.value&&i===X.value)return;const c={content:el.value||Ct.value,title:Q.value!==void 0?Q.value:ie.value,description:ae.value!==void 0?ae.value:X.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(),Lt.value=[]),Ct.value=n,ie.value=s,X.value=i,el.value=n,Q.value=s,ae.value=i},Vt=a=>{if(!f.value)return;$l(),f.value&&pn(f.value);let n=null;f.value&&(f.value.querySelector("p")||(n=Gt(),An()));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(/&nbsp;|\u00A0/g," "),c=Ul(i);me("update:modelValue",c),me("change",c),bt.value="editor",Qe.value||(el.value=Ct.value,Q.value=ie.value,ae.value=X.value),$e.value&&clearTimeout($e.value),Qe.value=!0,$e.value=setTimeout(()=>{Qe.value=!1,Ft(),Jn(),ro()},500),e.nextTick(()=>{n&&Sl(n),$l();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){ke.value[k]=w.value.state;return}if(k==="bold")if(p){const D=p.commonAncestorContainer,z=D.nodeType===3?D.parentElement:D;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 ce=window.getComputedStyle(z);parseInt(ce.fontWeight)>=600&&(V=!0)}catch{}ke.value[k]=V}else ke.value.hasOwnProperty(k)||(ke.value[k]=!1);else if(k==="italic")if(p){const D=p.commonAncestorContainer,z=D.nodeType===3?D.parentElement:D,V=z&&(z.tagName==="EM"||z.tagName==="I"||z.closest&&z.closest("em, i"));ke.value[k]=!!V}else{const D=document.queryCommandState(k);ke.value[k]=D}else{const D=document.queryCommandState(k);ke.value[k]=D}}catch{}}),Nl(),Hl(),zl(),il(),gn(),at("handleRichTextInput"),s&&(a.inputType==="insertText"||a.inputType==="insertCompositionText")){const k=a.data||"";k&&k.length===1&&setTimeout(()=>ro(k),0),(k===" "||k===`
103
- `||/[.,;:!?]/.test(k))&&setTimeout(()=>{Jn()},100)}J.value=!1})},$l=()=>{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)}}}},An=()=>{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)}})},Hl=()=>{if(f.value&&!Ut.value){Ut.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:.*,/,""),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=te,p.appendChild(k)}else if(h&&p.children.length===1){const k=p.parentNode;k.insertBefore(i,p),k.removeChild(p)}})}finally{Ut.value=!1}}},xn=a=>{Jn(),me("blur",a),Kn()},ln=()=>{if(T.disabled||!T.richText||!f.value)return;rl(),$e.value&&(clearTimeout($e.value),$e.value=null),Qe.value&&(Ft(),Qe.value=!1);const a=bt.value==="title",n=bt.value==="description",s=bt.value==="editor";if(Ke.value.length===0){a&&Ee.value?Ee.value.focus():n&&je.value?je.value.focus():f.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{Vt()});return}const i={content:f.value.innerHTML,title:T.title||"",description:T.description||""};Lt.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,Ct.value=d,ie.value=u,X.value=p,el.value=d,Q.value=u,ae.value=p,e.nextTick(()=>{Nl(),Vl(),Tl(),il();const h=Ul(d);me("update:modelValue",h),me("update:title",u),me("update:description",p),me("change",h),me("title-change",u),me("description-change",p),J.value=!1,e.nextTick(()=>{setTimeout(()=>{if(a){if(Ee.value){Ee.value.focus();const k=u.length;Ee.value.setSelectionRange&&Ee.value.setSelectionRange(k,k),K()}}else if(n){if(je.value){je.value.focus();const k=p.length;je.value.setSelectionRange(k,k)}}else if(s)tn();else if(Ee.value&&document.activeElement===Ee.value){const k=u.length;Ee.value.setSelectionRange&&Ee.value.setSelectionRange(k,k),K()}else if(je.value&&document.activeElement===je.value){const k=p.length;je.value.setSelectionRange(k,k)}else f.value&&tn()},10)})})}},En=()=>{if(T.disabled||!T.richText||!f.value)return;rl();const a=bt.value==="title",n=bt.value==="description",s=bt.value==="editor";if(Lt.value.length===0){a&&Ee.value?Ee.value.focus():n&&je.value?je.value.focus():f.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{Vt()});return}const i={content:f.value.innerHTML,title:T.title||"",description:T.description||""};Ke.value.push(i);const c=Lt.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,Ct.value=d,ie.value=u,X.value=p,el.value=d,Q.value=u,ae.value=p,e.nextTick(()=>{Nl(),Vl(),Tl(),il();const h=Ul(d);me("update:modelValue",h),me("update:title",u),me("update:description",p),me("change",h),me("title-change",u),me("description-change",p),J.value=!1,e.nextTick(()=>{setTimeout(()=>{if(a){if(Ee.value){Ee.value.focus();const k=u.length;Ee.value.setSelectionRange&&Ee.value.setSelectionRange(k,k),K()}}else if(n){if(je.value){je.value.focus();const k=p.length;je.value.setSelectionRange(k,k)}}else if(s)tn();else if(Ee.value&&document.activeElement===Ee.value){const k=u.length;Ee.value.setSelectionRange&&Ee.value.setSelectionRange(k,k),K()}else if(je.value&&document.activeElement===je.value){const k=p.length;je.value.setSelectionRange(k,k)}else f.value&&tn()},10)})})}},Dn=()=>{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"})},zl=()=>{if(!f.value)return;f.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!==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(()=>{zl()}),!1;if(n.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{zl()});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(()=>{zl()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{zl()})}return!0},to=()=>{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(()=>{Dn()}),!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)}}Dn()});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(()=>{Dn()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Dn()})}return!0},Xl=(a,n=null)=>{if(T.disabled||!T.richText||!f.value)return;Qe.value?($e.value&&(clearTimeout($e.value),$e.value=null),Ft(),Qe.value=!1):Ft(),rl(),f.value.focus();const s=window.getSelection();let i=null;if(s&&s.rangeCount>0){const d=s.getRangeAt(0);!d.collapsed&&Vn(d)&&(i=Gt())}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=to();ke.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(w.value={command:"bold",state:d}),e.nextTick(()=>{i&&(Sl(i),e.nextTick(()=>{const p=At("bold");ke.value.bold=p})),Vt(),Vl(),il()});return}if(a==="italic"){const d=ll();ke.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(w.value={command:"italic",state:d}),e.nextTick(()=>{i&&(Sl(i),e.nextTick(()=>{const p=At("italic");ke.value.italic=p})),Vt(),zl(),Vl(),il()});return}let c=!1;try{c=document.execCommand(a,!1,n)}catch{}e.nextTick(()=>{if(i&&Sl(i),["bold","italic","underline"].includes(a))try{if(a==="bold")i&&e.nextTick(()=>{const u=At("bold");ke.value.bold=u});else if(a==="italic")if(i)e.nextTick(()=>{const u=At("italic");ke.value.italic=u});else{const u=document.queryCommandState(a);ke.value[a]=u}else{const u=document.queryCommandState(a);ke.value[a]=u}}catch{ke.value.hasOwnProperty(a)?ke.value[a]=!ke.value[a]:ke.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)})}Vt(),Vl(),il()})},At=(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 ke.value.hasOwnProperty(a)?ke.value[a]:(ke.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 V=D.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(D.nodeType===1){const z=D;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 ke.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 ke.value.hasOwnProperty(a)?ke.value[a]:(ke.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 V=D.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(D.nodeType===1){const z=D;if(z.tagName==="EM"||z.tagName==="I"){u=!0;break}if(z.style&&z.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return ke.value[a]=u&&h,u&&h}}const d=document.queryCommandState(a);return c.collapsed&&ke.value.hasOwnProperty(a)?ke.value[a]:(ke.value[a]=d,d)}return ke.value.hasOwnProperty(a)?ke.value[a]:!1}catch{return ke.value.hasOwnProperty(a)?ke.value[a]:!1}try{return document.queryCommandState(a)}catch{return!1}}catch{return!1}},lo=a=>{T.disabled||!T.richText||(be.value=be.value===a?null:a,a==="askAi"&&(rt.value=null))},rl=()=>{be.value=null,he.value=null},Ll=a=>{Xl("formatBlock",a),rl()},Sn=a=>{if(!a||!f.value)return a;const n=Pe=>{let Me=Pe.nodeType===Node.TEXT_NODE?Pe.parentElement:Pe;for(;Me&&Me!==f.value;){const gt=Me.tagName;if(gt==="P"){const Xt=Me.parentElement;if(Xt===f.value||Xt.tagName==="BLOCKQUOTE")return Me}if(gt==="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:Pe=>{const Me=Pe.tagName;if(Me==="P"){const gt=Pe.parentElement;if(gt===f.value||gt.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),D=Math.max(p,h),z=c.slice(k,D+1);if(z.length===0)return a;const V=z[0],ce=z[z.length-1],le=document.createRange();return le.setStartBefore(V),le.setEndAfter(ce),le},Hn=()=>{if(T.disabled||!T.richText||!f.value)return;Qe.value?($e.value&&(clearTimeout($e.value),$e.value=null),Ft(),Qe.value=!1):Ft(),rl(),f.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;let n=a.getRangeAt(0);!n.collapsed&&Vn(n)&&(n=Sn(n),a.removeAllRanges(),a.addRange(n));let s=null;!n.collapsed&&Vn(n)&&(s=Gt());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 D;for(;D=k.nextNode();)h.push(D);if(h.forEach(V=>{const ce=document.createElement("p");V.parentNode.insertBefore(ce,V),ce.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&&Sl(s),Tl(),Vt(),il()})},vn=()=>{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=D=>{if(!D)return!1;const z=D.textContent||"",ce=(D.innerHTML||"").trim();return z.trim()===""||ce===""||ce==="<br>"||ce==="<br/>"||ce==="<p></p>"||ce==="<p><br></p>"||ce==="<p><br/></p>"||ce==="<p> </p>"||ce==="<p><br> </p>"||ce==="<div></div>"||ce==="<div><br></div>"||ce==="<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 z=i.children[D];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(()=>{Tl(),Vt()})},Vl=()=>{if(!f.value){ye.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");ye.value=!!i}else ye.value=!1}catch{ye.value=!1}},Un=()=>{if(!f.value)return;const a=window.getSelection();a&&a.rangeCount>0&&a.getRangeAt(0),Z.value=Gt();const n=window.getSelection();let s="";n.rangeCount>0&&(s=n.getRangeAt(0).toString()),U.value="",yt.value=s,Te.value="",Ue.value=null,Se.value=!0,rl(),e.nextTick(()=>{st.value&&st.value.focus()})},sn=()=>{if(!f.value)return;Qe.value?($e.value&&(clearTimeout($e.value),$e.value=null),Ft(),Qe.value=!1):Ft();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&&Ue.value&&(n=Ue.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)}Ue.value=null}else Xl("unlink");ye.value=!1,rl(),e.nextTick(()=>{Vt(),Vl()})},Rn=()=>{T.disabled||!T.richText||f.value&&(Qe.value?($e.value&&(clearTimeout($e.value),$e.value=null),Ft(),Qe.value=!1):Ft(),rl(),f.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Nl(),Vt(),il()}))},fn=()=>{T.disabled||!T.richText||f.value&&(Qe.value?($e.value&&(clearTimeout($e.value),$e.value=null),Ft(),Qe.value=!1):Ft(),rl(),f.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Nl(),Vt(),il()}))},Xn=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},Nl=()=>{if(!f.value)return;f.value.querySelectorAll("li > ol").forEach(n=>{const s=n.parentElement;if(s&&s.tagName==="LI"){const i=Xn(s);i!==null&&Array.from(n.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(i))})}})},rn=()=>{if(T.disabled||!T.richText||!f.value)return;rl(),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(()=>{Nl(),Vt()});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=Xn(c);u.appendChild(s),p!==null&&i.tagName==="OL"&&s.setAttribute("data-parent-num",String(p)),Nl();const h=document.createRange();h.selectNodeContents(s),h.collapse(!1),a.removeAllRanges(),a.addRange(h),e.nextTick(()=>{Vt(),il()})}else document.execCommand("indent",!1),e.nextTick(()=>{Nl(),Vt(),il()})},Yl=()=>{if(T.disabled||!T.richText||!f.value)return;rl(),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(()=>{Nl(),Vt()});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(),Nl();const u=document.createRange();u.selectNodeContents(s),u.collapse(!1),a.removeAllRanges(),a.addRange(u),e.nextTick(()=>{Vt(),il()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Nl(),Vt(),il()})},vl=e.ref(null),Rl=e.ref(null),y=e.ref({}),g=e.ref(""),x=e.ref(null),O=e.ref("");e.ref("");const q=e.ref(null);e.ref("");const tt=e.ref([]),Fe=e.ref(!1),Qt=e.ref(!1),Ae=a=>{if(!a)return"";const n=a.cloneRange(),s=document.createElement("div");return s.appendChild(n.cloneContents()),s.innerHTML},ct=()=>{if(!T.commentUser||T.disabled||!T.richText||!f.value)return;if(vl.value!==null){vl.value=null,g.value="",O.value="",q.value=null,tt.value=[],Mn(!0);return}rl(),f.value.focus();const a=window.getSelection();if(!a||a.rangeCount===0)return;const n=a.getRangeAt(0);if(n.collapsed||!Vn(n))return;O.value=Ae(n)||"",q.value=Gt();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"},vl.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 D=i.getBoundingClientRect(),z=h.getBoundingClientRect(),V=k.getBoundingClientRect(),ce=z.bottom-D.top,le=V.top-D.top,Pe=8;if(ce>le-Pe){const Me=V.height;y.value={bottom:`${Me+Pe}px`,top:"auto"}}else y.value={top:`${p}px`,bottom:"auto"}}}})},oe=()=>{if(!g.value.trim())return;const a=g.value.trim(),n=new Date,s={text:a,selectionText:O.value,selectionRange:q.value,commentId:vl.value,user:T.commentUser||null,createdAt:n.toISOString()};tt.value=[...tt.value,s],me("comment-submitted",s),Yn(s),q.value&&!Ze(q.value)&&jo(vl.value,q.value),g.value="",e.nextTick(()=>{if(x.value){const i=x.value;i.style.height="auto",i.style.height=`${i.scrollHeight}px`,i.focus()}at("sendComment")})},fl=(a,n)=>{if(!(!T.commentUser||!a.user||a.user.id!==T.commentUser.id)){if(tt.value=tt.value.filter((s,i)=>i!==n),vl.value!==null&&f.value){const s=String(vl.value),i=f.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`);if(i&&tt.value.length>0){const c=[],d=new Set;tt.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(tt.value.length))}else i&&tt.value.length===0&&(i.removeAttribute("data-comment-user"),i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count","0"))}if(me("comment-deleted",{comment:a,index:n,commentId:vl.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));me("update:comments",s)}e.nextTick(()=>{at("deleteComment")})}},Ze=a=>{if(!a||!f.value)return!1;try{const n=_o(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},_o=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}},jo=(a,n)=>{if(!(!a||!n||!f.value))try{const s=_o(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,z=p.nodeType===3?p.parentNode:p,V=h.nodeType===3?h.parentNode:h;if(z===V&&k===0&&D===(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 le=s.extractContents();d.appendChild(le),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(()=>{at("wrapSelectionWithCommentMarker"),Vt()})}catch{}},Yn=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)}Fe.value=!0,me("update:comments",n)},Fn=(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;rl(),s.focus();const c=document.createRange();c.selectNodeContents(i);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),O.value=i.innerHTML||"",q.value=Gt();const u=c.getBoundingClientRect(),p=s.parentElement;if(p){const D=p.getBoundingClientRect(),z=u.bottom-D.top,ce=Math.max(z+8,0);y.value={top:`${ce}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 D=T.comments.find(z=>String(z.conversation_id)===String(h));if(D&&D.conversation&&Array.isArray(D.conversation)){const z=D.conversation.map(V=>({id:V.id||V.commentary_id,commentary_id:V.id||V.commentary_id,conversation_id:D.id||D.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((D,z)=>{const V=Pe=>{if(!Pe)return 0;const Me=new Date(Pe).getTime();return isNaN(Me)?0:Me},ce=V(D.createdAt),le=V(z.createdAt);return ce===le?0:ce-le}),tt.value=k,Mn(!0),vl.value=h||null,i&&(Rl.value=i,i.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(g.value="",x.value){const D=x.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 z=p.querySelector(".dss-text-editor-footer");if(z){const V=p.getBoundingClientRect(),ce=D.getBoundingClientRect(),le=z.getBoundingClientRect(),Pe=ce.bottom-V.top,Me=le.top-V.top,gt=8;if(Pe>Me-gt){const Xt=le.height;y.value={bottom:`${Xt+gt}px`,top:"auto"}}}}}at("openCommentOverlayForSelector")})},jn=e.ref(null),no=e.ref(0),Ko=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(()=>{vn()},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(()=>{Vt()});return}}}}if(a.key==="Tab"){a.preventDefault(),a.shiftKey?Yl():rn();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!==f.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!==f.value){a.preventDefault(),a.stopPropagation();let D=null;const z=s.startOffset;z<u.length&&(D=u.splitText(z));const V=document.createElement("p");if(D?V.appendChild(D):V.innerHTML="<br>",u.length===0){const le=u.parentElement;le&&(le.removeChild(u),le.childNodes.length===0&&le.appendChild(document.createElement("br")))}k.nextSibling?k.parentNode.insertBefore(V,k.nextSibling):k.parentNode.appendChild(V);const ce=document.createRange();D?ce.setStart(D,0):ce.setStart(V,0),ce.collapse(!0),n.removeAllRanges(),n.addRange(ce),e.nextTick(()=>{Vt()});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=le=>{if(!le)return!1;const Pe=le.textContent||"",gt=(le.innerHTML||"").trim(),Xt=gt.replace(/<br\s*\/?>/gi,"").trim();return Pe.trim()===""||gt===""||Xt===""||gt==="<br>"||gt==="<br/>"||gt==="<p></p>"||gt==="<p><br></p>"||gt==="<p><br/></p>"||gt==="<p> </p>"||gt==="<p><br> </p>"||gt==="<div></div>"||gt==="<div><br></div>"||gt==="<div><br/></div>"},h=c.lastChild,k=h&&h.nodeType===1&&h.tagName==="BR",D=s.startContainer,z=D.nodeType===3?D.parentElement:D,V=z===c||z&&z.parentElement===c;if(u&&p(u)||k&&V){a.preventDefault(),setTimeout(()=>{vn()},50);return}}}}if(a.key===" "){const n=Date.now(),s=n-no.value;if(jn.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(),rn();return}}}}jn.value=" ",no.value=n}else jn.value=a.key}},Go=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,"")),Ft();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(ce=>z.includes(ce.tagName));if(V.length===1){const ce=V[0].tagName,le=c.tagName,Pe=c.textContent.trim()===""&&!c.querySelector("img");let Me=!1;if(["H1","H2","H3","H4","H5","H6"].includes(le)?Me=!0:Pe||(ce===le||ce==="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);Vt()},$o=a=>{if(be.value){const s=a.target;!s.closest(".dss-toolbar-dropdown")&&!s.closest(".dss-toolbar-dropdown-toggle")&&rl()}if(Be.value){const s=a.target,i=s.closest(".dss-floating-toolbar"),c=f.value&&s.closest(".dss-text-editor-content");!i&&!c&&Kn()}if(rt.value){const s=a.target,i=s.closest(".dss-floating-toolbar"),c=s.closest(".dss-toolbar-dropdown");!i&&!c&&Do()}const n=a.target;if(!n.closest(".dss-toolbar-dropdown")&&!n.closest(".dss-toolbar-dropdown-submenu")&&(he.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&&Vn(i)}else se.value=!1}if(vl.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&&(vl.value=null,g.value="",O.value="",q.value=null,tt.value=[],Mn(!0))}},Lo=(a,n)=>{a&&a.stopPropagation&&a.stopPropagation(),Xe.value&&(clearTimeout(Xe.value),Xe.value=null),he.value=n},To=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}Xe.value&&clearTimeout(Xe.value),Xe.value=setTimeout(()=>{he.value=null,Xe.value=null},150)},Qo=a=>{he.value=null};let hn=0;const Jo=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-${++hn}`;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")}))}})},Ao=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(n=>{Jo(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&&Lo(h,k)},p=To;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&&Lo(k,D)},p=To;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",Qo)})})})};let In=null;const oo=()=>{if(he.value){const a=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${he.value}"]`),n=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${he.value}"]`);a&&n&&Cn(a,n)}if(Be.value&&il(),T.richText){if(In!==null)return;In=setTimeout(()=>{In=null,at("handleWindowResize")},150)}},ao=()=>{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")})})},ea=()=>{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(()=>{sl.value?K():mt(),M.value?ot():Kt()})}),e.nextTick(()=>{ea()}),T.richText&&f.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",$o),window.addEventListener("resize",oo);let a=null;const n=()=>{a===null&&(a=setTimeout(()=>{a=null,oo()},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,oo()},150))};s&&(s.addEventListener("scroll",c),f.value._scrollHandlers={wrapper:null,content:s,handler:c}),e.nextTick(()=>{Ao(),ao()}),f.value.addEventListener("click",p=>{const h=p.target;h.closest("a")&&!T.disabled&&p.preventDefault();const D=h.closest(".dss-image-no-alt-icon"),z=h.closest(".dss-image-wrapper");if(D||z&&h===z){p.preventDefault(),p.stopPropagation();const V=window.getSelection(),ce=document.createRange();ce.setStartAfter(z),ce.collapse(!0),V.removeAllRanges(),V.addRange(ce)}else z&&h.tagName!=="IMG"&&(p.preventDefault(),e.nextTick(()=>{const V=window.getSelection();if(V.rangeCount>0){const le=V.getRangeAt(0).commonAncestorContainer,Pe=le.nodeType===3?le.parentElement:le;if(z.contains(Pe)&&Pe!==z.querySelector("img")){const Me=document.createRange();Me.setStartAfter(z),Me.collapse(!0),V.removeAllRanges(),V.addRange(Me)}}else{const ce=document.createRange();ce.setStartAfter(z),ce.collapse(!0),V.addRange(ce)}}))},!0),f.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 z=window.getSelection(),V=document.createRange();D&&(V.setStartAfter(D),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||"",ce=V.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),le=z===V||z===ce;(z.startsWith("http://")||z.startsWith("https://")||z.startsWith("data:")||le||le)&&(k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="")}}}),Hl()})}),f.value.addEventListener("dragstart",p=>{const h=p.target,k=h.tagName==="IMG"?h:h.closest("img"),D=k?.closest(".dss-image-wrapper");k&&f.value.contains(k)&&(lt.value=D||k,p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/html","image-drag"))}),f.value.addEventListener("dragover",p=>{lt.value&&(p.preventDefault(),p.stopPropagation(),p.dataTransfer.dropEffect="move")}),f.value.addEventListener("dragenter",p=>{lt.value&&(p.preventDefault(),p.stopPropagation())}),f.value.addEventListener("drop",p=>{if(!lt.value||!f.value)return;p.preventDefault(),p.stopPropagation();const h=lt.value,k=h.classList?.contains("dss-image-wrapper"),D=k?h.querySelector("img"):h,z=k?h:D?.closest(".dss-image-wrapper");if(!D||!f.value.contains(D)){lt.value=null;return}let V=null;const ce=p.clientX,le=p.clientY;if(document.caretRangeFromPoint)V=document.caretRangeFromPoint(ce,le);else{const nl=window.getSelection();nl.rangeCount>0?V=nl.getRangeAt(0).cloneRange():(V=document.createRange(),V.selectNodeContents(f.value),V.collapse(!1))}if(!V){lt.value=null;return}const Pe=V.commonAncestorContainer,Me=Pe.nodeType===3?Pe.parentElement:Pe;if(Me?.closest(".dss-image-wrapper")===z||z&&z.contains(Me)){lt.value=null;return}if(z&&(Me===z||z.contains(Me))){lt.value=null;return}const Xt=D.getAttribute("src");let Ot=null;z?Ot=z.cloneNode(!0):Ot=D.cloneNode(!0);try{let nl=V.startContainer;if(nl.nodeType===3&&(nl=nl.parentElement),z&&(nl===z||z.contains(nl))){const ol=document.createRange();ol.setStartAfter(z),ol.collapse(!0),V=ol}V.insertNode(Ot);const dl=document.createRange();dl.setStartAfter(Ot),dl.collapse(!0);const Ht=window.getSelection();Ht.removeAllRanges(),Ht.addRange(dl)}catch{if(f.value.childNodes.length===0){const dl=document.createElement("p");dl.appendChild(Ot),f.value.appendChild(dl)}else{const dl=f.value.lastChild;if(dl&&dl.nodeType===1)dl.appendChild(Ot);else{const Ht=document.createElement("p");Ht.appendChild(Ot),f.value.appendChild(Ht)}}}z?z.remove():D.remove(),lt.value=null,e.nextTick(()=>{const nl=f.value.querySelectorAll("img");let dl=!1;nl.forEach(Ht=>{if(Ht.getAttribute("src")===Xt)if(!dl)dl=!0;else{const ol=Ht.closest(".dss-image-wrapper");ol?ol.remove():Ht.remove()}}),Hl(),Vt()})}),f.value.addEventListener("dragend",p=>{lt.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(z=>{z.removeAttribute("alt"),z.removeAttribute("data-alt"),z.setAttribute("alt",""),z.setAttribute("data-alt",""),z.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{Hl(),ao(),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(()=>{ao()})});h.observe(p,{childList:!0,subtree:!0}),p._toolbarMutationObserver=h}}),T.modelValue){const p=bl(T.modelValue);f.value.innerHTML=p,An()}e.nextTick(()=>{const p=f.value.innerHTML||"",h=T.title||"",k=T.description||"";Ct.value=p,ie.value=h,X.value=k,Q.value=h,ae.value=k,Nl(),Hl(),zl(),gn(),co(),zt()}),Vl(),Tl(),f.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",$o),window.removeEventListener("resize",oo),f.value&&f.value._windowScrollHandler&&window.removeEventListener("scroll",f.value._windowScrollHandler,!0),In!==null&&(clearTimeout(In),In=null),f.value&&f.value._windowScrollTimeout!==null&&clearTimeout(f.value._windowScrollTimeout),$e.value&&clearTimeout($e.value),Xe.value&&clearTimeout(Xe.value),f.value&&f.value._mutationObserver&&f.value._mutationObserver.disconnect(),Re.value&&Re.value.disconnect(),kt.value!==null&&(cancelAnimationFrame(kt.value),kt.value=null),nt.value!==null&&(clearTimeout(nt.value),nt.value=null),pt.value!==null&&(clearTimeout(pt.value),pt.value=null),Mn(!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 ta=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)}}Hl(),Vl(),Tl(),il(),gn()}):e.nextTick(()=>{Hl(),Vl(),Tl(),il(),gn()})},ko=()=>{$l();const a=window.getSelection();if(a&&a.rangeCount>0){const s=a.getRangeAt(0);se.value=!s.collapsed&&Vn(s),!s.collapsed&&w.value&&(w.value=null)}else se.value=!1;if(Hl(),Vl(),Tl(),il(),gn(),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{}ke.value[s]=p}else{const d=document.queryCommandState(s);ke.value[s]=d}}}catch{}})},gn=()=>{if(!T.richText||T.disabled||!f.value){E.value="p";return}try{const a=window.getSelection();if(!a||a.rangeCount===0){E.value="p";return}const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(!i||!f.value.contains(i)){E.value="p";return}const c=i.closest("h1, h2, h3, h4, h5, h6, p");if(!c){E.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?E.value=d:E.value="p"}catch{E.value="p"}},Tl=()=>{if(!f.value){qe.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))}qe.value=n}catch{qe.value=!1}},Vn=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},Kn=()=>{Be.value=!1},il=()=>{if(!T.floatingToolbar||!T.richText||T.disabled){Be.value=!1;return}const a=window.getSelection();if(!a||a.rangeCount===0){Be.value=!1;return}const n=a.getRangeAt(0);if(n.collapsed||!Vn(n)){Be.value=!1;return}const s=n.getBoundingClientRect();if(!s||s.width===0&&s.height===0){Be.value=!1;return}const i=f.value;if(!i){Be.value=!1;return}const c=i.getBoundingClientRect();if(!c||c.width===0){Be.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;Ge.value&&(D=Ge.value.getBoundingClientRect().width);const z=(D||320)/2;let V=c.left+z,ce=c.right-z;if(ce<V){const le=c.left+c.width/2;V=le,ce=le}if(k>0){const le=z+u,Pe=k-z-u;if(V=Math.max(V,le),ce=Math.min(ce,Pe),ce<V){const Me=k/2;V=Me,ce=Me}}h<V?h=V:h>ce&&(h=ce),Je.value={position:"fixed",top:`${Math.max(p,8)}px`,left:`${h}px`,transform:"translate(-50%, -100%)",zIndex:10003},Be.value=!0},Co=a=>{T.disabled||!T.richText||(rt.value=rt.value===a?null:a,a==="askAi"&&(be.value=null))},Do=()=>{rt.value=null,he.value=null},jl=a=>{Ll(a),Do()};let yn=null,Pl=null,Nn=null,zn=null;const la=a=>{if(T.disabled||!T.richText){Gn(),Qn();return}const n=a.target,s=n.closest("a"),i=n.closest("img");if(yn&&(clearTimeout(yn),yn=null),Nn&&(clearTimeout(Nn),Nn=null),s&&s!==Pl){Qn(),Pl=s;let c=s.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=s.textContent||""),Ue.value=s,ge.value=c,j.value=!0,ue.value=!0,Ho(s)}else!s&&Pl?(Pl=null,yn=setTimeout(()=>{ue.value||Gn()},150)):s&&s===Pl&&Ho(s);if(i&&i!==zn){Gn(),zn=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),ht.value=i,jt.value=c.trim()||N("textEditor.image.noAlt"),wt.value=!0,H.value=!0,bo(i)}else!i&&zn?(zn=null,Nn=setTimeout(()=>{H.value||Qn()},150)):i&&i===zn&&bo(i)},na=a=>{const n=a.relatedTarget;(!n||!n.closest(".dss-text-editor-content")&&!n.closest(".dss-link-popup"))&&(Pl=null,zn=null,yn&&(clearTimeout(yn),yn=null),Nn&&(clearTimeout(Nn),Nn=null),Gn(),Qn())},Gn=()=>{ue.value=!1,setTimeout(()=>{ue.value||(j.value=!1,ge.value="",Se.value||(Ue.value=null))},100)},Ho=a=>{if(!a||!f.value)return;const n=a.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;_e.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Qn=()=>{H.value=!1,setTimeout(()=>{H.value||(wt.value=!1,jt.value="",Yt.value||(ht.value=null))},100)},bo=a=>{if(!a||!f.value)return;const n=a.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;fe.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},wo=()=>{if(!ge.value||!Ue.value)return;let n=Ue.value.getAttribute("href")||ge.value;!n.startsWith("http://")&&!n.startsWith("https://")&&!n.startsWith("mailto:")&&(n="https://"+n),window.open(n,"_blank","noopener,noreferrer")},Ro=()=>{if(Ue.value){const a=Ue.value.textContent||"",n=Ue.value.getAttribute("href")||"",s=Ue.value;U.value=n,yt.value=a,Te.value=a,ue.value=!1,j.value=!1,ge.value="",Ue.value=s,Se.value=!0}else if(ye.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")||"";U.value=d,yt.value=c,Te.value=c,Ue.value=i,Se.value=!0}}}else{Z.value=Gt();const a=window.getSelection();let n="";a.rangeCount>0&&(n=a.getRangeAt(0).toString()),U.value="",yt.value=n,Te.value="",Ue.value=null,Se.value=!0}e.nextTick(()=>{st.value&&(st.value.focus(),st.value.select())})},so=()=>{Se.value=!1,U.value="",yt.value="",Te.value="",Ue.value=null,Z.value=null},xo=()=>{if(!U.value.trim()){so();return}if(Qe.value?($e.value&&(clearTimeout($e.value),$e.value=null),Ft(),Qe.value=!1):Ft(),yt.value.trim()||(yt.value=U.value.trim()),Ue.value&&f.value&&f.value.contains(Ue.value)){const a=window.getSelection();a.rangeCount>0&&a.removeAllRanges();const n=Ue.value;if(n.setAttribute("href",U.value.trim()),yt.value.trim()!==Te.value.trim()){for(;n.firstChild;)n.removeChild(n.firstChild);n.textContent=yt.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),Vt()}else if(f.value){f.value.focus();const a=window.getSelection();a.removeAllRanges(),Z.value&&Sl(Z.value);let n=null;if(a.rangeCount>0&&(n=a.getRangeAt(0)),n&&!n.collapsed){n.toString();const s=document.createElement("a");s.href=U.value.trim(),s.textContent=yt.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=U.value.trim(),d.textContent=yt.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),D=k[k.length-1];if(D&&D!==" "&&D!==" "&&D!==`
102
+ </svg>`,f=e.ref(null),we=e.ref(null),ye=e.ref(!1),J=e.ref(!1),j=e.ref(!1),ge=e.ref(""),_e=e.ref({}),ue=e.ref(!1),Se=e.ref(!1),U=e.ref(""),yt=e.ref(""),st=e.ref(null),De=e.ref(null),Ue=e.ref(null),Z=e.ref(null),Te=e.ref(""),qe=e.ref(!1),ke=e.ref({}),Be=e.ref(!1),Je=e.ref({}),Ge=e.ref(null),rt=e.ref(null),Xt=e.ref(!1),be=e.ref(""),Wt=e.ref(null),dt=e.ref(""),et=e.ref(""),Et=e.ref(""),tl=e.ref(null),ft=e.ref(null),qt=e.ref(null),ht=e.ref(null),Jt=e.ref(null),wt=e.ref(!1),Yt=e.ref(""),fe=e.ref({}),H=e.ref(!1),Y=e.ref("upload"),ne=e.ref(""),he=e.ref(null),Xe=e.ref(null),Ke=e.ref([]),Lt=e.ref([]),$e=e.ref(null),Qe=e.ref(!1),Ct=e.ref(""),el=e.ref(""),ie=e.ref(""),X=e.ref(""),Q=e.ref(""),ae=e.ref(""),Ee=e.ref(null),je=e.ref(null),bt=e.ref(null),Zt=e.ref(!1),lt=e.ref(null),sl=e.ref(!1),M=e.ref(!1),w=e.ref(null),E=e.ref("p"),se=e.ref(!1),re=e.ref([]),Re=e.ref(null),kt=e.ref(null),nt=e.ref(null),We=e.ref(!1),xt=e.ref(0),Bt=100,pt=e.ref(null),_t=e.computed(()=>!!T.commentUser),Tt=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":_t.value&&vl.value!==null})),St=e.computed(()=>({})),gl=e.computed(()=>!T.fixedHeight||T.fullHeight?{}:{height:`${1.6*14*T.rows+24+2}px`,resize:"none",overflowY:"auto"}),Jl=e.computed(()=>!T.fixedHeight||T.fullHeight?{}:{height:`${1.6*14*T.rows+32}px`,overflowY:"auto"}),Il=e.computed(()=>T.richText&&Lt.value.length>0),ml=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(/&nbsp;/g," "),a=a.replace(/&amp;/g,"&"),a=a.replace(/&lt;/g,"<"),a=a.replace(/&gt;/g,">"),a=a.replace(/&quot;/g,'"'),a=a.replace(/&#39;/g,"'"),a=a.replace(/\s+/g," ").trim(),a}return T.modelValue}),pl=e.computed(()=>{const a=ml.value.trim();return a?a.split(/\s+/).filter(n=>n.length>0).length:0}),an=e.computed(()=>ml.value.length),Wl=e.computed(()=>ht.value!==null&&Y.value==="upload"&&dt.value&&dt.value.startsWith("data:")),wl=e.computed(()=>T.titlePlaceholder||N("textEditor.placeholders.title")),Al=e.computed(()=>T.descriptionPlaceholder||N("textEditor.placeholders.description")),dn=e.computed(()=>T.placeholder||N("textEditor.placeholders.startTyping")),Dl=a=>ut&&ut[a]!==void 0,Zn=a=>{for(let n=a+1;n<T.customToolbarSlots.length;n++)if(Dl(T.customToolbarSlots[n]))return!0;return!1},ql=a=>{for(let n=a+1;n<T.customToolbarSlots.length;n++){const s=T.customToolbarSlots[n];if(Dl(s)&&mn(s))return!0}return!1},mn=a=>T.customToolbarFloatingMap.hasOwnProperty(a)?T.customToolbarFloatingMap[a]===!0:!0,wn=e.computed(()=>T.customToolbarSlots.some(a=>Dl(a)&&mn(a))),Zl=e.computed(()=>Dl("title-slot")),en=e.computed(()=>Dl("description-slot")),Ul=a=>{if(!a||a.trim()==="")return"<html></html>";const n=a.trim();return n.startsWith("<html>")&&n.endsWith("</html>")?a:`<html>${a}</html>`},bl=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=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""}},I=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=N("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"},L=a=>{const n=a.target.value;me("update:modelValue",n),me("change",n)},K=()=>{if(!Ee.value)return;const a=Ee.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")},He=()=>{sl.value=!0,K()},vt=()=>{sl.value=!1,mt()},mt=()=>{if(!Ee.value)return;const a=Ee.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")},it=a=>{const s=a.target.value;sl.value&&K(),me("update:title",s),me("title-change",s),bt.value="title",T.richText&&(Qe.value||(el.value=Ct.value,Q.value=ie.value,ae.value=X.value),$e.value&&clearTimeout($e.value),Qe.value=!0,$e.value=setTimeout(()=>{Qe.value=!1,Ft()},500))},ot=()=>{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")},yl=()=>{M.value=!0,ot()},xl=()=>{M.value=!1,jt()},jt=()=>{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")},Dt=a=>{const s=a.target.value;M.value&&ot(),me("update:description",s),me("description-change",s),bt.value="description",T.richText&&(Qe.value||(el.value=Ct.value,Q.value=ie.value,ae.value=X.value),$e.value&&clearTimeout($e.value),Qe.value=!0,$e.value=setTimeout(()=>{Qe.value=!1,Ft()},500))},Kt=()=>{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}},Sl=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()}},tn=()=>{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)},Ft=(a=!1)=>{if(!f.value)return;const n=f.value.innerHTML,s=T.title||"",i=T.description||"";if(!a&&n===Ct.value&&s===ie.value&&i===X.value)return;const c={content:el.value||Ct.value,title:Q.value!==void 0?Q.value:ie.value,description:ae.value!==void 0?ae.value:X.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(),Lt.value=[]),Ct.value=n,ie.value=s,X.value=i,el.value=n,Q.value=s,ae.value=i},Vt=a=>{if(!f.value)return;$l(),f.value&&pn(f.value);let n=null;f.value&&(f.value.querySelector("p")||(n=Kt(),An()));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(/&nbsp;|\u00A0/g," "),c=Ul(i);me("update:modelValue",c),me("change",c),bt.value="editor",Qe.value||(el.value=Ct.value,Q.value=ie.value,ae.value=X.value),$e.value&&clearTimeout($e.value),Qe.value=!0,$e.value=setTimeout(()=>{Qe.value=!1,Ft(),Jn(),ro()},500),e.nextTick(()=>{n&&Sl(n),$l();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){ke.value[k]=w.value.state;return}if(k==="bold")if(p){const D=p.commonAncestorContainer,z=D.nodeType===3?D.parentElement:D;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 ce=window.getComputedStyle(z);parseInt(ce.fontWeight)>=600&&(V=!0)}catch{}ke.value[k]=V}else ke.value.hasOwnProperty(k)||(ke.value[k]=!1);else if(k==="italic")if(p){const D=p.commonAncestorContainer,z=D.nodeType===3?D.parentElement:D,V=z&&(z.tagName==="EM"||z.tagName==="I"||z.closest&&z.closest("em, i"));ke.value[k]=!!V}else{const D=document.queryCommandState(k);ke.value[k]=D}else{const D=document.queryCommandState(k);ke.value[k]=D}}catch{}}),Nl(),Hl(),zl(),il(),gn(),at("handleRichTextInput"),s&&(a.inputType==="insertText"||a.inputType==="insertCompositionText")){const k=a.data||"";k&&k.length===1&&setTimeout(()=>ro(k),0),(k===" "||k===`
103
+ `||/[.,;:!?]/.test(k))&&setTimeout(()=>{Jn()},100)}J.value=!1})},$l=()=>{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)}}}},An=()=>{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)}})},Hl=()=>{if(f.value&&!Zt.value){Zt.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:.*,/,""),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=te,p.appendChild(k)}else if(h&&p.children.length===1){const k=p.parentNode;k.insertBefore(i,p),k.removeChild(p)}})}finally{Zt.value=!1}}},xn=a=>{Jn(),me("blur",a),Kn()},ln=()=>{if(T.disabled||!T.richText||!f.value)return;rl(),$e.value&&(clearTimeout($e.value),$e.value=null),Qe.value&&(Ft(),Qe.value=!1);const a=bt.value==="title",n=bt.value==="description",s=bt.value==="editor";if(Ke.value.length===0){a&&Ee.value?Ee.value.focus():n&&je.value?je.value.focus():f.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{Vt()});return}const i={content:f.value.innerHTML,title:T.title||"",description:T.description||""};Lt.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,Ct.value=d,ie.value=u,X.value=p,el.value=d,Q.value=u,ae.value=p,e.nextTick(()=>{Nl(),Vl(),Tl(),il();const h=Ul(d);me("update:modelValue",h),me("update:title",u),me("update:description",p),me("change",h),me("title-change",u),me("description-change",p),J.value=!1,e.nextTick(()=>{setTimeout(()=>{if(a){if(Ee.value){Ee.value.focus();const k=u.length;Ee.value.setSelectionRange&&Ee.value.setSelectionRange(k,k),K()}}else if(n){if(je.value){je.value.focus();const k=p.length;je.value.setSelectionRange(k,k)}}else if(s)tn();else if(Ee.value&&document.activeElement===Ee.value){const k=u.length;Ee.value.setSelectionRange&&Ee.value.setSelectionRange(k,k),K()}else if(je.value&&document.activeElement===je.value){const k=p.length;je.value.setSelectionRange(k,k)}else f.value&&tn()},10)})})}},En=()=>{if(T.disabled||!T.richText||!f.value)return;rl();const a=bt.value==="title",n=bt.value==="description",s=bt.value==="editor";if(Lt.value.length===0){a&&Ee.value?Ee.value.focus():n&&je.value?je.value.focus():f.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{Vt()});return}const i={content:f.value.innerHTML,title:T.title||"",description:T.description||""};Ke.value.push(i);const c=Lt.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,Ct.value=d,ie.value=u,X.value=p,el.value=d,Q.value=u,ae.value=p,e.nextTick(()=>{Nl(),Vl(),Tl(),il();const h=Ul(d);me("update:modelValue",h),me("update:title",u),me("update:description",p),me("change",h),me("title-change",u),me("description-change",p),J.value=!1,e.nextTick(()=>{setTimeout(()=>{if(a){if(Ee.value){Ee.value.focus();const k=u.length;Ee.value.setSelectionRange&&Ee.value.setSelectionRange(k,k),K()}}else if(n){if(je.value){je.value.focus();const k=p.length;je.value.setSelectionRange(k,k)}}else if(s)tn();else if(Ee.value&&document.activeElement===Ee.value){const k=u.length;Ee.value.setSelectionRange&&Ee.value.setSelectionRange(k,k),K()}else if(je.value&&document.activeElement===je.value){const k=p.length;je.value.setSelectionRange(k,k)}else f.value&&tn()},10)})})}},Dn=()=>{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"})},zl=()=>{if(!f.value)return;f.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!==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(()=>{zl()}),!1;if(n.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{zl()});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(()=>{zl()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{zl()})}return!0},to=()=>{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(()=>{Dn()}),!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)}}Dn()});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(()=>{Dn()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Dn()})}return!0},Xl=(a,n=null)=>{if(T.disabled||!T.richText||!f.value)return;Qe.value?($e.value&&(clearTimeout($e.value),$e.value=null),Ft(),Qe.value=!1):Ft(),rl(),f.value.focus();const s=window.getSelection();let i=null;if(s&&s.rangeCount>0){const d=s.getRangeAt(0);!d.collapsed&&Vn(d)&&(i=Kt())}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=to();ke.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(w.value={command:"bold",state:d}),e.nextTick(()=>{i&&(Sl(i),e.nextTick(()=>{const p=At("bold");ke.value.bold=p})),Vt(),Vl(),il()});return}if(a==="italic"){const d=ll();ke.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(w.value={command:"italic",state:d}),e.nextTick(()=>{i&&(Sl(i),e.nextTick(()=>{const p=At("italic");ke.value.italic=p})),Vt(),zl(),Vl(),il()});return}let c=!1;try{c=document.execCommand(a,!1,n)}catch{}e.nextTick(()=>{if(i&&Sl(i),["bold","italic","underline"].includes(a))try{if(a==="bold")i&&e.nextTick(()=>{const u=At("bold");ke.value.bold=u});else if(a==="italic")if(i)e.nextTick(()=>{const u=At("italic");ke.value.italic=u});else{const u=document.queryCommandState(a);ke.value[a]=u}else{const u=document.queryCommandState(a);ke.value[a]=u}}catch{ke.value.hasOwnProperty(a)?ke.value[a]=!ke.value[a]:ke.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)})}Vt(),Vl(),il()})},At=(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 ke.value.hasOwnProperty(a)?ke.value[a]:(ke.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 V=D.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(D.nodeType===1){const z=D;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 ke.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 ke.value.hasOwnProperty(a)?ke.value[a]:(ke.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 V=D.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(D.nodeType===1){const z=D;if(z.tagName==="EM"||z.tagName==="I"){u=!0;break}if(z.style&&z.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return ke.value[a]=u&&h,u&&h}}const d=document.queryCommandState(a);return c.collapsed&&ke.value.hasOwnProperty(a)?ke.value[a]:(ke.value[a]=d,d)}return ke.value.hasOwnProperty(a)?ke.value[a]:!1}catch{return ke.value.hasOwnProperty(a)?ke.value[a]:!1}try{return document.queryCommandState(a)}catch{return!1}}catch{return!1}},lo=a=>{T.disabled||!T.richText||(we.value=we.value===a?null:a,a==="askAi"&&(rt.value=null))},rl=()=>{we.value=null,he.value=null},Ll=a=>{Xl("formatBlock",a),rl()},Sn=a=>{if(!a||!f.value)return a;const n=Pe=>{let Me=Pe.nodeType===Node.TEXT_NODE?Pe.parentElement:Pe;for(;Me&&Me!==f.value;){const gt=Me.tagName;if(gt==="P"){const Ut=Me.parentElement;if(Ut===f.value||Ut.tagName==="BLOCKQUOTE")return Me}if(gt==="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:Pe=>{const Me=Pe.tagName;if(Me==="P"){const gt=Pe.parentElement;if(gt===f.value||gt.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),D=Math.max(p,h),z=c.slice(k,D+1);if(z.length===0)return a;const V=z[0],ce=z[z.length-1],le=document.createRange();return le.setStartBefore(V),le.setEndAfter(ce),le},Hn=()=>{if(T.disabled||!T.richText||!f.value)return;Qe.value?($e.value&&(clearTimeout($e.value),$e.value=null),Ft(),Qe.value=!1):Ft(),rl(),f.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;let n=a.getRangeAt(0);!n.collapsed&&Vn(n)&&(n=Sn(n),a.removeAllRanges(),a.addRange(n));let s=null;!n.collapsed&&Vn(n)&&(s=Kt());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 D;for(;D=k.nextNode();)h.push(D);if(h.forEach(V=>{const ce=document.createElement("p");V.parentNode.insertBefore(ce,V),ce.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&&Sl(s),Tl(),Vt(),il()})},vn=()=>{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=D=>{if(!D)return!1;const z=D.textContent||"",ce=(D.innerHTML||"").trim();return z.trim()===""||ce===""||ce==="<br>"||ce==="<br/>"||ce==="<p></p>"||ce==="<p><br></p>"||ce==="<p><br/></p>"||ce==="<p> </p>"||ce==="<p><br> </p>"||ce==="<div></div>"||ce==="<div><br></div>"||ce==="<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 z=i.children[D];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(()=>{Tl(),Vt()})},Vl=()=>{if(!f.value){ye.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");ye.value=!!i}else ye.value=!1}catch{ye.value=!1}},Un=()=>{if(!f.value)return;const a=window.getSelection();a&&a.rangeCount>0&&a.getRangeAt(0),Z.value=Kt();const n=window.getSelection();let s="";n.rangeCount>0&&(s=n.getRangeAt(0).toString()),U.value="",yt.value=s,Te.value="",Ue.value=null,Se.value=!0,rl(),e.nextTick(()=>{st.value&&st.value.focus()})},sn=()=>{if(!f.value)return;Qe.value?($e.value&&(clearTimeout($e.value),$e.value=null),Ft(),Qe.value=!1):Ft();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&&Ue.value&&(n=Ue.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)}Ue.value=null}else Xl("unlink");ye.value=!1,rl(),e.nextTick(()=>{Vt(),Vl()})},Rn=()=>{T.disabled||!T.richText||f.value&&(Qe.value?($e.value&&(clearTimeout($e.value),$e.value=null),Ft(),Qe.value=!1):Ft(),rl(),f.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Nl(),Vt(),il()}))},fn=()=>{T.disabled||!T.richText||f.value&&(Qe.value?($e.value&&(clearTimeout($e.value),$e.value=null),Ft(),Qe.value=!1):Ft(),rl(),f.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Nl(),Vt(),il()}))},Xn=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},Nl=()=>{if(!f.value)return;f.value.querySelectorAll("li > ol").forEach(n=>{const s=n.parentElement;if(s&&s.tagName==="LI"){const i=Xn(s);i!==null&&Array.from(n.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(i))})}})},rn=()=>{if(T.disabled||!T.richText||!f.value)return;rl(),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(()=>{Nl(),Vt()});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=Xn(c);u.appendChild(s),p!==null&&i.tagName==="OL"&&s.setAttribute("data-parent-num",String(p)),Nl();const h=document.createRange();h.selectNodeContents(s),h.collapse(!1),a.removeAllRanges(),a.addRange(h),e.nextTick(()=>{Vt(),il()})}else document.execCommand("indent",!1),e.nextTick(()=>{Nl(),Vt(),il()})},Yl=()=>{if(T.disabled||!T.richText||!f.value)return;rl(),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(()=>{Nl(),Vt()});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(),Nl();const u=document.createRange();u.selectNodeContents(s),u.collapse(!1),a.removeAllRanges(),a.addRange(u),e.nextTick(()=>{Vt(),il()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Nl(),Vt(),il()})},vl=e.ref(null),Rl=e.ref(null),y=e.ref({}),g=e.ref(""),x=e.ref(null),O=e.ref("");e.ref("");const q=e.ref(null);e.ref("");const tt=e.ref([]),Fe=e.ref(!1),Gt=e.ref(!1),Ae=a=>{if(!a)return"";const n=a.cloneRange(),s=document.createElement("div");return s.appendChild(n.cloneContents()),s.innerHTML},ct=()=>{if(!T.commentUser||T.disabled||!T.richText||!f.value)return;if(vl.value!==null){vl.value=null,g.value="",O.value="",q.value=null,tt.value=[],Mn(!0);return}rl(),f.value.focus();const a=window.getSelection();if(!a||a.rangeCount===0)return;const n=a.getRangeAt(0);if(n.collapsed||!Vn(n))return;O.value=Ae(n)||"",q.value=Kt();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"},vl.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 D=i.getBoundingClientRect(),z=h.getBoundingClientRect(),V=k.getBoundingClientRect(),ce=z.bottom-D.top,le=V.top-D.top,Pe=8;if(ce>le-Pe){const Me=V.height;y.value={bottom:`${Me+Pe}px`,top:"auto"}}else y.value={top:`${p}px`,bottom:"auto"}}}})},oe=()=>{if(!g.value.trim())return;const a=g.value.trim(),n=new Date,s={text:a,selectionText:O.value,selectionRange:q.value,commentId:vl.value,user:T.commentUser||null,createdAt:n.toISOString()};tt.value=[...tt.value,s],me("comment-submitted",s),Yn(s),q.value&&!Ze(q.value)&&jo(vl.value,q.value),g.value="",e.nextTick(()=>{if(x.value){const i=x.value;i.style.height="auto",i.style.height=`${i.scrollHeight}px`,i.focus()}at("sendComment")})},fl=(a,n)=>{if(!(!T.commentUser||!a.user||a.user.id!==T.commentUser.id)){if(tt.value=tt.value.filter((s,i)=>i!==n),vl.value!==null&&f.value){const s=String(vl.value),i=f.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`);if(i&&tt.value.length>0){const c=[],d=new Set;tt.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(tt.value.length))}else i&&tt.value.length===0&&(i.removeAttribute("data-comment-user"),i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count","0"))}if(me("comment-deleted",{comment:a,index:n,commentId:vl.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));me("update:comments",s)}e.nextTick(()=>{at("deleteComment")})}},Ze=a=>{if(!a||!f.value)return!1;try{const n=_o(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},_o=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}},jo=(a,n)=>{if(!(!a||!n||!f.value))try{const s=_o(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,z=p.nodeType===3?p.parentNode:p,V=h.nodeType===3?h.parentNode:h;if(z===V&&k===0&&D===(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 le=s.extractContents();d.appendChild(le),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(()=>{at("wrapSelectionWithCommentMarker"),Vt()})}catch{}},Yn=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)}Fe.value=!0,me("update:comments",n)},Fn=(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;rl(),s.focus();const c=document.createRange();c.selectNodeContents(i);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),O.value=i.innerHTML||"",q.value=Kt();const u=c.getBoundingClientRect(),p=s.parentElement;if(p){const D=p.getBoundingClientRect(),z=u.bottom-D.top,ce=Math.max(z+8,0);y.value={top:`${ce}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 D=T.comments.find(z=>String(z.conversation_id)===String(h));if(D&&D.conversation&&Array.isArray(D.conversation)){const z=D.conversation.map(V=>({id:V.id||V.commentary_id,commentary_id:V.id||V.commentary_id,conversation_id:D.id||D.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((D,z)=>{const V=Pe=>{if(!Pe)return 0;const Me=new Date(Pe).getTime();return isNaN(Me)?0:Me},ce=V(D.createdAt),le=V(z.createdAt);return ce===le?0:ce-le}),tt.value=k,Mn(!0),vl.value=h||null,i&&(Rl.value=i,i.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(g.value="",x.value){const D=x.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 z=p.querySelector(".dss-text-editor-footer");if(z){const V=p.getBoundingClientRect(),ce=D.getBoundingClientRect(),le=z.getBoundingClientRect(),Pe=ce.bottom-V.top,Me=le.top-V.top,gt=8;if(Pe>Me-gt){const Ut=le.height;y.value={bottom:`${Ut+gt}px`,top:"auto"}}}}}at("openCommentOverlayForSelector")})},jn=e.ref(null),no=e.ref(0),Ko=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(()=>{vn()},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(()=>{Vt()});return}}}}if(a.key==="Tab"){a.preventDefault(),a.shiftKey?Yl():rn();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!==f.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!==f.value){a.preventDefault(),a.stopPropagation();let D=null;const z=s.startOffset;z<u.length&&(D=u.splitText(z));const V=document.createElement("p");if(D?V.appendChild(D):V.innerHTML="<br>",u.length===0){const le=u.parentElement;le&&(le.removeChild(u),le.childNodes.length===0&&le.appendChild(document.createElement("br")))}k.nextSibling?k.parentNode.insertBefore(V,k.nextSibling):k.parentNode.appendChild(V);const ce=document.createRange();D?ce.setStart(D,0):ce.setStart(V,0),ce.collapse(!0),n.removeAllRanges(),n.addRange(ce),e.nextTick(()=>{Vt()});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=le=>{if(!le)return!1;const Pe=le.textContent||"",gt=(le.innerHTML||"").trim(),Ut=gt.replace(/<br\s*\/?>/gi,"").trim();return Pe.trim()===""||gt===""||Ut===""||gt==="<br>"||gt==="<br/>"||gt==="<p></p>"||gt==="<p><br></p>"||gt==="<p><br/></p>"||gt==="<p> </p>"||gt==="<p><br> </p>"||gt==="<div></div>"||gt==="<div><br></div>"||gt==="<div><br/></div>"},h=c.lastChild,k=h&&h.nodeType===1&&h.tagName==="BR",D=s.startContainer,z=D.nodeType===3?D.parentElement:D,V=z===c||z&&z.parentElement===c;if(u&&p(u)||k&&V){a.preventDefault(),setTimeout(()=>{vn()},50);return}}}}if(a.key===" "){const n=Date.now(),s=n-no.value;if(jn.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(),rn();return}}}}jn.value=" ",no.value=n}else jn.value=a.key}},Go=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,"")),Ft();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(ce=>z.includes(ce.tagName));if(V.length===1){const ce=V[0].tagName,le=c.tagName,Pe=c.textContent.trim()===""&&!c.querySelector("img");let Me=!1;if(["H1","H2","H3","H4","H5","H6"].includes(le)?Me=!0:Pe||(ce===le||ce==="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);Vt()},$o=a=>{if(we.value){const s=a.target;!s.closest(".dss-toolbar-dropdown")&&!s.closest(".dss-toolbar-dropdown-toggle")&&rl()}if(Be.value){const s=a.target,i=s.closest(".dss-floating-toolbar"),c=f.value&&s.closest(".dss-text-editor-content");!i&&!c&&Kn()}if(rt.value){const s=a.target,i=s.closest(".dss-floating-toolbar"),c=s.closest(".dss-toolbar-dropdown");!i&&!c&&Do()}const n=a.target;if(!n.closest(".dss-toolbar-dropdown")&&!n.closest(".dss-toolbar-dropdown-submenu")&&(he.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&&Vn(i)}else se.value=!1}if(vl.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&&(vl.value=null,g.value="",O.value="",q.value=null,tt.value=[],Mn(!0))}},Lo=(a,n)=>{a&&a.stopPropagation&&a.stopPropagation(),Xe.value&&(clearTimeout(Xe.value),Xe.value=null),he.value=n},To=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}Xe.value&&clearTimeout(Xe.value),Xe.value=setTimeout(()=>{he.value=null,Xe.value=null},150)},Qo=a=>{he.value=null};let hn=0;const Jo=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-${++hn}`;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")}))}})},Ao=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(n=>{Jo(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&&Lo(h,k)},p=To;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&&Lo(k,D)},p=To;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",Qo)})})})};let In=null;const oo=()=>{if(he.value){const a=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${he.value}"]`),n=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${he.value}"]`);a&&n&&Cn(a,n)}if(Be.value&&il(),T.richText){if(In!==null)return;In=setTimeout(()=>{In=null,at("handleWindowResize")},150)}},ao=()=>{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")})})},ea=()=>{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(()=>{sl.value?K():mt(),M.value?ot():jt()})}),e.nextTick(()=>{ea()}),T.richText&&f.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",$o),window.addEventListener("resize",oo);let a=null;const n=()=>{a===null&&(a=setTimeout(()=>{a=null,oo()},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,oo()},150))};s&&(s.addEventListener("scroll",c),f.value._scrollHandlers={wrapper:null,content:s,handler:c}),e.nextTick(()=>{Ao(),ao()}),f.value.addEventListener("click",p=>{const h=p.target;h.closest("a")&&!T.disabled&&p.preventDefault();const D=h.closest(".dss-image-no-alt-icon"),z=h.closest(".dss-image-wrapper");if(D||z&&h===z){p.preventDefault(),p.stopPropagation();const V=window.getSelection(),ce=document.createRange();ce.setStartAfter(z),ce.collapse(!0),V.removeAllRanges(),V.addRange(ce)}else z&&h.tagName!=="IMG"&&(p.preventDefault(),e.nextTick(()=>{const V=window.getSelection();if(V.rangeCount>0){const le=V.getRangeAt(0).commonAncestorContainer,Pe=le.nodeType===3?le.parentElement:le;if(z.contains(Pe)&&Pe!==z.querySelector("img")){const Me=document.createRange();Me.setStartAfter(z),Me.collapse(!0),V.removeAllRanges(),V.addRange(Me)}}else{const ce=document.createRange();ce.setStartAfter(z),ce.collapse(!0),V.addRange(ce)}}))},!0),f.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 z=window.getSelection(),V=document.createRange();D&&(V.setStartAfter(D),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||"",ce=V.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),le=z===V||z===ce;(z.startsWith("http://")||z.startsWith("https://")||z.startsWith("data:")||le||le)&&(k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="")}}}),Hl()})}),f.value.addEventListener("dragstart",p=>{const h=p.target,k=h.tagName==="IMG"?h:h.closest("img"),D=k?.closest(".dss-image-wrapper");k&&f.value.contains(k)&&(lt.value=D||k,p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/html","image-drag"))}),f.value.addEventListener("dragover",p=>{lt.value&&(p.preventDefault(),p.stopPropagation(),p.dataTransfer.dropEffect="move")}),f.value.addEventListener("dragenter",p=>{lt.value&&(p.preventDefault(),p.stopPropagation())}),f.value.addEventListener("drop",p=>{if(!lt.value||!f.value)return;p.preventDefault(),p.stopPropagation();const h=lt.value,k=h.classList?.contains("dss-image-wrapper"),D=k?h.querySelector("img"):h,z=k?h:D?.closest(".dss-image-wrapper");if(!D||!f.value.contains(D)){lt.value=null;return}let V=null;const ce=p.clientX,le=p.clientY;if(document.caretRangeFromPoint)V=document.caretRangeFromPoint(ce,le);else{const nl=window.getSelection();nl.rangeCount>0?V=nl.getRangeAt(0).cloneRange():(V=document.createRange(),V.selectNodeContents(f.value),V.collapse(!1))}if(!V){lt.value=null;return}const Pe=V.commonAncestorContainer,Me=Pe.nodeType===3?Pe.parentElement:Pe;if(Me?.closest(".dss-image-wrapper")===z||z&&z.contains(Me)){lt.value=null;return}if(z&&(Me===z||z.contains(Me))){lt.value=null;return}const Ut=D.getAttribute("src");let Pt=null;z?Pt=z.cloneNode(!0):Pt=D.cloneNode(!0);try{let nl=V.startContainer;if(nl.nodeType===3&&(nl=nl.parentElement),z&&(nl===z||z.contains(nl))){const ol=document.createRange();ol.setStartAfter(z),ol.collapse(!0),V=ol}V.insertNode(Pt);const dl=document.createRange();dl.setStartAfter(Pt),dl.collapse(!0);const Ht=window.getSelection();Ht.removeAllRanges(),Ht.addRange(dl)}catch{if(f.value.childNodes.length===0){const dl=document.createElement("p");dl.appendChild(Pt),f.value.appendChild(dl)}else{const dl=f.value.lastChild;if(dl&&dl.nodeType===1)dl.appendChild(Pt);else{const Ht=document.createElement("p");Ht.appendChild(Pt),f.value.appendChild(Ht)}}}z?z.remove():D.remove(),lt.value=null,e.nextTick(()=>{const nl=f.value.querySelectorAll("img");let dl=!1;nl.forEach(Ht=>{if(Ht.getAttribute("src")===Ut)if(!dl)dl=!0;else{const ol=Ht.closest(".dss-image-wrapper");ol?ol.remove():Ht.remove()}}),Hl(),Vt()})}),f.value.addEventListener("dragend",p=>{lt.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(z=>{z.removeAttribute("alt"),z.removeAttribute("data-alt"),z.setAttribute("alt",""),z.setAttribute("data-alt",""),z.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{Hl(),ao(),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(()=>{ao()})});h.observe(p,{childList:!0,subtree:!0}),p._toolbarMutationObserver=h}}),T.modelValue){const p=bl(T.modelValue);f.value.innerHTML=p,An()}e.nextTick(()=>{const p=f.value.innerHTML||"",h=T.title||"",k=T.description||"";Ct.value=p,ie.value=h,X.value=k,Q.value=h,ae.value=k,Nl(),Hl(),zl(),gn(),co(),Qt()}),Vl(),Tl(),f.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",$o),window.removeEventListener("resize",oo),f.value&&f.value._windowScrollHandler&&window.removeEventListener("scroll",f.value._windowScrollHandler,!0),In!==null&&(clearTimeout(In),In=null),f.value&&f.value._windowScrollTimeout!==null&&clearTimeout(f.value._windowScrollTimeout),$e.value&&clearTimeout($e.value),Xe.value&&clearTimeout(Xe.value),f.value&&f.value._mutationObserver&&f.value._mutationObserver.disconnect(),Re.value&&Re.value.disconnect(),kt.value!==null&&(cancelAnimationFrame(kt.value),kt.value=null),nt.value!==null&&(clearTimeout(nt.value),nt.value=null),pt.value!==null&&(clearTimeout(pt.value),pt.value=null),Mn(!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 ta=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)}}Hl(),Vl(),Tl(),il(),gn()}):e.nextTick(()=>{Hl(),Vl(),Tl(),il(),gn()})},ko=()=>{$l();const a=window.getSelection();if(a&&a.rangeCount>0){const s=a.getRangeAt(0);se.value=!s.collapsed&&Vn(s),!s.collapsed&&w.value&&(w.value=null)}else se.value=!1;if(Hl(),Vl(),Tl(),il(),gn(),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{}ke.value[s]=p}else{const d=document.queryCommandState(s);ke.value[s]=d}}}catch{}})},gn=()=>{if(!T.richText||T.disabled||!f.value){E.value="p";return}try{const a=window.getSelection();if(!a||a.rangeCount===0){E.value="p";return}const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(!i||!f.value.contains(i)){E.value="p";return}const c=i.closest("h1, h2, h3, h4, h5, h6, p");if(!c){E.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?E.value=d:E.value="p"}catch{E.value="p"}},Tl=()=>{if(!f.value){qe.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))}qe.value=n}catch{qe.value=!1}},Vn=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},Kn=()=>{Be.value=!1},il=()=>{if(!T.floatingToolbar||!T.richText||T.disabled){Be.value=!1;return}const a=window.getSelection();if(!a||a.rangeCount===0){Be.value=!1;return}const n=a.getRangeAt(0);if(n.collapsed||!Vn(n)){Be.value=!1;return}const s=n.getBoundingClientRect();if(!s||s.width===0&&s.height===0){Be.value=!1;return}const i=f.value;if(!i){Be.value=!1;return}const c=i.getBoundingClientRect();if(!c||c.width===0){Be.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;Ge.value&&(D=Ge.value.getBoundingClientRect().width);const z=(D||320)/2;let V=c.left+z,ce=c.right-z;if(ce<V){const le=c.left+c.width/2;V=le,ce=le}if(k>0){const le=z+u,Pe=k-z-u;if(V=Math.max(V,le),ce=Math.min(ce,Pe),ce<V){const Me=k/2;V=Me,ce=Me}}h<V?h=V:h>ce&&(h=ce),Je.value={position:"fixed",top:`${Math.max(p,8)}px`,left:`${h}px`,transform:"translate(-50%, -100%)",zIndex:10003},Be.value=!0},Co=a=>{T.disabled||!T.richText||(rt.value=rt.value===a?null:a,a==="askAi"&&(we.value=null))},Do=()=>{rt.value=null,he.value=null},jl=a=>{Ll(a),Do()};let yn=null,Pl=null,Nn=null,zn=null;const la=a=>{if(T.disabled||!T.richText){Gn(),Qn();return}const n=a.target,s=n.closest("a"),i=n.closest("img");if(yn&&(clearTimeout(yn),yn=null),Nn&&(clearTimeout(Nn),Nn=null),s&&s!==Pl){Qn(),Pl=s;let c=s.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=s.textContent||""),Ue.value=s,ge.value=c,j.value=!0,ue.value=!0,Ho(s)}else!s&&Pl?(Pl=null,yn=setTimeout(()=>{ue.value||Gn()},150)):s&&s===Pl&&Ho(s);if(i&&i!==zn){Gn(),zn=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),ht.value=i,Yt.value=c.trim()||N("textEditor.image.noAlt"),wt.value=!0,H.value=!0,bo(i)}else!i&&zn?(zn=null,Nn=setTimeout(()=>{H.value||Qn()},150)):i&&i===zn&&bo(i)},na=a=>{const n=a.relatedTarget;(!n||!n.closest(".dss-text-editor-content")&&!n.closest(".dss-link-popup"))&&(Pl=null,zn=null,yn&&(clearTimeout(yn),yn=null),Nn&&(clearTimeout(Nn),Nn=null),Gn(),Qn())},Gn=()=>{ue.value=!1,setTimeout(()=>{ue.value||(j.value=!1,ge.value="",Se.value||(Ue.value=null))},100)},Ho=a=>{if(!a||!f.value)return;const n=a.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;_e.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Qn=()=>{H.value=!1,setTimeout(()=>{H.value||(wt.value=!1,Yt.value="",Xt.value||(ht.value=null))},100)},bo=a=>{if(!a||!f.value)return;const n=a.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;fe.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},wo=()=>{if(!ge.value||!Ue.value)return;let n=Ue.value.getAttribute("href")||ge.value;!n.startsWith("http://")&&!n.startsWith("https://")&&!n.startsWith("mailto:")&&(n="https://"+n),window.open(n,"_blank","noopener,noreferrer")},Ro=()=>{if(Ue.value){const a=Ue.value.textContent||"",n=Ue.value.getAttribute("href")||"",s=Ue.value;U.value=n,yt.value=a,Te.value=a,ue.value=!1,j.value=!1,ge.value="",Ue.value=s,Se.value=!0}else if(ye.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")||"";U.value=d,yt.value=c,Te.value=c,Ue.value=i,Se.value=!0}}}else{Z.value=Kt();const a=window.getSelection();let n="";a.rangeCount>0&&(n=a.getRangeAt(0).toString()),U.value="",yt.value=n,Te.value="",Ue.value=null,Se.value=!0}e.nextTick(()=>{st.value&&(st.value.focus(),st.value.select())})},so=()=>{Se.value=!1,U.value="",yt.value="",Te.value="",Ue.value=null,Z.value=null},xo=()=>{if(!U.value.trim()){so();return}if(Qe.value?($e.value&&(clearTimeout($e.value),$e.value=null),Ft(),Qe.value=!1):Ft(),yt.value.trim()||(yt.value=U.value.trim()),Ue.value&&f.value&&f.value.contains(Ue.value)){const a=window.getSelection();a.rangeCount>0&&a.removeAllRanges();const n=Ue.value;if(n.setAttribute("href",U.value.trim()),yt.value.trim()!==Te.value.trim()){for(;n.firstChild;)n.removeChild(n.firstChild);n.textContent=yt.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),Vt()}else if(f.value){f.value.focus();const a=window.getSelection();a.removeAllRanges(),Z.value&&Sl(Z.value);let n=null;if(a.rangeCount>0&&(n=a.getRangeAt(0)),n&&!n.collapsed){n.toString();const s=document.createElement("a");s.href=U.value.trim(),s.textContent=yt.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=U.value.trim(),d.textContent=yt.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),D=k[k.length-1];if(D&&D!==" "&&D!==" "&&D!==`
104
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)}}Vt()}e.nextTick(()=>{Vl(),so()})},Jn=()=>{if(!f.value||J.value)return;const a=window.getSelection();let n=null;a&&a.rangeCount>0&&(n=Gt());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 D=[...k.matchAll(s)];if(D.length===0)continue;const z=D.filter(le=>{const Pe=le[0],Me=le.index;if(Me>0&&k[Me-1]==="@"||Me+Pe.length<k.length&&k[Me+Pe.length]==="@")return!1;const gt=h.parentElement;return!(gt&&gt.closest("a"))});if(z.length===0)continue;if(z.length===1&&z[0][0]===k.trim()){const le=z[0][0],Pe=le.startsWith("http://")||le.startsWith("https://")?le:`https://${le}`,Me=document.createElement("a");Me.href=Pe,Me.textContent=le,Me.style.color="#60afdf",Me.style.textDecoration="underline",h.parentNode&&(h.parentNode.replaceChild(Me,h),u=!0);continue}let V=0;const ce=document.createDocumentFragment();if(z.forEach(le=>{const Pe=le.index,Me=le[0];if(Pe>V){const Ot=k.substring(V,Pe);Ot&&ce.appendChild(document.createTextNode(Ot))}const gt=Me.startsWith("http://")||Me.startsWith("https://")?Me:`https://${Me}`,Xt=document.createElement("a");Xt.href=gt,Xt.textContent=Me,Xt.style.color="#60afdf",Xt.style.textDecoration="underline",ce.appendChild(Xt),V=Pe+Me.length}),V<k.length){const le=k.substring(V);le&&ce.appendChild(document.createTextNode(le))}h.parentNode&&ce.childNodes.length>0&&(h.parentNode.replaceChild(ce,h),u=!0)}u&&n&&e.nextTick(()=>{Sl(n),Vl()})},oa=()=>{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(D=>{const z=D.index,V=D[0].startsWith("<u>")?"u":"ins",ce=D[1]||D[2]||"";z>h&&k.appendChild(document.createTextNode(u.substring(h,z)));const le=document.createElement(V);le.textContent=ce,k.appendChild(le),h=z+D[0].length}),h<u.length&&k.appendChild(document.createTextNode(u.substring(h))),d.parentNode&&k.childNodes.length>0&&d.parentNode.replaceChild(k,d)}},ro=a=>{if(!f.value||J.value)return;if(!a){oa();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 Ot="",nl=0,dl=!1;const Ht=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:nn=>nn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let ol=0;for(;Ht.nextNode();){const nn=Ht.currentNode,cn=nn.textContent||"",Fl=ol;if(ol+=cn.length,nn===i.startContainer){Ot+=cn.substring(0,i.startOffset),nl=Fl+i.startOffset,dl=!0;break}Ot+=cn}return dl||(nl=Ot.length),{textBeforeCursor:Ot,cursorCharOffset:nl}},{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],z=u.length-k.length,ce=(Ot=>{let nl=0;const dl=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:ol=>ol.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let Ht;for(;Ht=dl.nextNode();){const ol=(Ht.textContent||"").length;if(nl+ol>=Ot)return{node:Ht,offset:Ot-nl};nl+=ol}return null})(z);if(!ce)return;const le=document.createRange();le.setStart(ce.node,ce.offset),le.setEnd(i.endContainer,i.endOffset);const Pe=document.createElement(h);Pe.textContent=D,le.deleteContents(),le.insertNode(Pe);const Me=window.getSelection(),gt=document.createRange();gt.setStartAfter(Pe),gt.collapse(!0),Me.removeAllRanges(),Me.addRange(gt);const Xt=Gt();e.nextTick(()=>{Vt(),Xt&&Sl(Xt)})},Bl=()=>{f.value&&(Jt.value=Gt(),we.value="",dt.value="",ne.value="",et.value="",Et.value="",qt.value=null,ht.value=null,Y.value="upload",Yt.value=!0,rl(),e.nextTick(()=>{tl.value&&tl.value.focus(),ft.value&&(ft.value.value="")}))},F=a=>{const n=a.target?.files?.[0];if(!n){qt.value=null,dt.value="";return}qt.value=n;const s=new FileReader;s.onload=i=>{dt.value=i.target?.result||""},s.readAsDataURL(n)},Ml=()=>{ft.value&&ft.value.click()},Ol=()=>{et.value&&(Et.value="")},Pn=()=>{Et.value&&(et.value="")},El=()=>{let a=ht.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")||"";ht.value=a,we.value=n.trim()===""||n.trim()==="Image"?"":n;const s=a.getAttribute("src")||a.src||"";s.startsWith("http://")||s.startsWith("https://")?(ne.value=s,dt.value="",Y.value="url"):(dt.value=s,ne.value="",Y.value="upload");const c=a.style.width||a.getAttribute("width")||"",d=a.style.height||a.getAttribute("height")||"";et.value=c.endsWith("px")?c.replace("px",""):c,Et.value=d.endsWith("px")?d.replace("px",""):d,Jt.value=null}else{Bl();return}Yt.value=!0,H.value=!1,wt.value=!1,e.nextTick(()=>{Y.value==="url"&&Zt.value?(Zt.value.focus(),Zt.value.select()):tl.value&&(tl.value.focus(),tl.value.select()),ft.value&&(ft.value.value="")})},cl=()=>{Yt.value=!1,we.value="",dt.value="",ne.value="",et.value="",Et.value="",qt.value=null,ht.value=null,Jt.value=null,Y.value="upload"},It=()=>{const a=(we.value||"").trim(),n=f.value?._mutationObserver;n&&n.disconnect(),Qe.value?($e.value&&(clearTimeout($e.value),$e.value=null),Ft(),Qe.value=!1):Ft();const s=Y.value==="url"?ne.value.trim():dt.value;if(ht.value&&f.value&&f.value.contains(ht.value)){s&&(ht.value.src=s),ht.value.setAttribute("alt",a),ht.value.setAttribute("data-alt",a),et.value?(ht.value.style.width=`${et.value}px`,ht.value.setAttribute("width",et.value)):(ht.value.style.removeProperty("width"),ht.value.removeAttribute("width")),Et.value?(ht.value.style.height=`${Et.value}px`,ht.value.setAttribute("height",Et.value)):(ht.value.style.removeProperty("height"),ht.value.removeAttribute("height"));const i=window.getSelection();if(i){i.removeAllRanges();const c=document.createRange();c.setStartAfter(ht.value),c.collapse(!0),i.addRange(c)}Vt()}else{if(!s){n&&f.value&&n.observe(f.value,{childList:!0,subtree:!0}),cl();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(Jt.value&&(Sl(Jt.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){cl();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),et.value&&(h.style.width=`${et.value}px`,h.setAttribute("width",et.value)),Et.value&&(h.style.height=`${Et.value}px`,h.setAttribute("height",Et.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 D=document.createRange();D.setStartAfter(h),D.collapse(!0),c&&(c.removeAllRanges(),c.addRange(D))}}ht.value=h,Vt()}}e.nextTick(()=>{n&&f.value&&n.observe(f.value,{childList:!0,subtree:!0}),Vl(),il(),cl()})};e.watch(()=>T.modelValue,a=>{if(T.richText&&f.value&&!J.value){const n=bl(a||""),i=f.value.innerHTML.replace(/&nbsp;|\u00A0/g," "),c=n.replace(/&nbsp;|\u00A0/g," ");if(i!==c){const d=Gt();f.value.innerHTML=n,e.nextTick(()=>{An();const u=f.value.innerHTML||"",p=T.title||"",h=T.description||"";Ct.value=u,ie.value=p,X.value=h,el.value=u,Q.value=p,ae.value=h,Ke.value=[],Lt.value=[],$e.value&&(clearTimeout($e.value),$e.value=null),Qe.value=!1,d&&Sl(d),Nl(),Hl(),zl(),Vl(),il(),gn(),at("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>T.richText,a=>{a?(il(),e.nextTick(()=>{co()})):(Kn(),re.value=[],Re.value&&(Re.value.disconnect(),Re.value=null)),gn()}),e.watch(()=>T.floatingToolbar,a=>{a?il():Kn()}),e.watch(()=>T.disabled,a=>{a&&Kn(),gn()}),e.watch(()=>T.description,()=>{e.nextTick(()=>{M.value?ot():Kt()})}),e.watch(()=>T.title,()=>{e.nextTick(()=>{sl.value?K():mt()})}),e.watch(()=>T.customToolbarSlots,()=>{e.nextTick(()=>{ao()})},{deep:!0}),e.watch(()=>T.comments,(a,n)=>{if(T.commentUser){if(Fe.value){Fe.value=!1;return}Qt.value||T.richText&&f.value&&e.nextTick(()=>{zt()})}},{deep:!0,immediate:!1});const zt=()=>{if(T.commentUser&&!Qt.value&&!(!T.comments||!Array.isArray(T.comments)||T.comments.length===0)&&!(!T.richText||!f.value)){Qt.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){$t(k,u),d.add(h);return}try{const D=Pt(u.selection_range,u.selection_text);if(D&&!D.collapsed){const z=D.commonAncestorContainer,V=z.nodeType===3?z.parentElement:z;if(V){const Pe=V.closest("[data-comment], [data-fake-comment]");if(Pe){const Me=Pe.getAttribute("data-comment")||Pe.getAttribute("data-fake-comment");if(String(Me)===String(p)){Pe.setAttribute("data-comment",h),Pe.removeAttribute("data-fake-comment"),$t(Pe,u),d.add(h);return}else return}}const ce=f.value.querySelector(`[data-comment="${h}"]`);if(ce){$t(ce,u),d.add(h);return}const le=document.createElement("span");le.setAttribute("data-comment",h),$t(le,u);try{D.surroundContents(le),c++,d.add(h)}catch{try{const Me=document.createRange();Me.setStart(D.startContainer,D.startOffset),Me.setEnd(D.endContainer,D.endOffset),ul(Me),Me.surroundContents(le),c++,d.add(h)}catch{try{const gt=D.extractContents();le.appendChild(gt),D.insertNode(le),c++,d.add(h)}catch(gt){console.warn("Failed to create comment marker:",gt)}}}}}catch{}}),e.nextTick(()=>{at("restoreCommentsFromModel"),Vt(),Qt.value=!1})}catch{Qt.value=!1}}},ul=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&&!kn(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&&!Bn(c)||a.setEndAfter(u))}else c.nodeType===1&&n.includes(c.tagName)&&d<c.childNodes.length&&a.setEndAfter(c);return a}catch{return a}},kn=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},Bn=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},Pt=(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?ul(s):null}}catch{return null}return null},$t=(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")},at=(a="unknown")=>{if(!T.commentUser||!T.richText||!f.value){re.value=[];return}Date.now()-xt.value<Bt&&kt.value!==null||kt.value===null&&(kt.value=requestAnimationFrame(()=>{if(kt.value=null,xt.value=Date.now(),We.value)return;We.value=!0;const s={},i=f.value;if(!i){We.value=!1;return}const c=i.closest(".editor-with-comments");if(!c){We.value=!1;return}const d=i.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],p=new Set;d.forEach(V=>{const ce=V.getAttribute("data-comment")||V.getAttribute("data-fake-comment");ce&&V.tagName==="SPAN"&&(p.has(ce)||(u.push(V),p.add(ce)))}),d.forEach(V=>{const ce=V.getAttribute("data-comment")||V.getAttribute("data-fake-comment");!ce||p.has(ce)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(V.tagName)?V.querySelector(`span[data-comment="${ce}"], span[data-fake-comment="${ce}"]`)||(u.push(V),p.add(ce)):V.tagName!=="SPAN"&&(u.push(V),p.add(ce)))});const h=c.getBoundingClientRect(),k=i.getBoundingClientRect();u.forEach((V,ce)=>{let le=V.getAttribute("data-comment")||V.getAttribute("data-fake-comment");if(!le)return;if(typeof le=="string"&&le.startsWith("comment-")){const on=V.textContent?.trim(),Nt=T.comments?.find(Kl=>(typeof Kl.conversation_id=="string"&&Kl.conversation_id.startsWith("comment-")?null:Kl.conversation_id)&&Kl.selection_text?.trim()===on);Nt?(le=String(Nt.conversation_id),V.setAttribute("data-comment",le),V.removeAttribute("data-fake-comment")):(le=String(Date.now()),V.setAttribute("data-comment",le),V.removeAttribute("data-fake-comment"))}const Pe=V.getBoundingClientRect(),Me=window.getComputedStyle(V),gt=parseFloat(Me.lineHeight)||parseFloat(Me.fontSize)*1.2,nl=Pe.top-k.top+gt/2-15,Ht=k.top-h.top+nl;let ol=null,nn=null,cn=0;const Fl=[],Eo=new Set;if(le&&T.comments){const on=T.comments.find(Nt=>String(Nt.conversation_id||Nt.id)===String(le));if(on){const Nt=on.conversation||[];Nt.length>0?(Nt.forEach(Kl=>{Kl.user&&Kl.user.id&&!Eo.has(Kl.user.id)&&(Eo.add(Kl.user.id),Fl.push(Kl.user))}),cn=Nt.length):(cn=0,ol=null,nn=null),Fl.length>0?ol=Fl[0]:ol=null,Fl.length>1?nn=Fl[1]:nn=null}}const So=Pe.top+gt/2-15,_n=So+30,Vo=5,Fo=_n>k.top+Vo&&So<k.bottom-Vo?1:0;re.value.find(on=>on.id===le);let $n=V;if(!$n&&le&&f.value){const on=String(le);$n=f.value.querySelector(`[data-comment="${on}"], [data-fake-comment="${on}"]`)}const _l=Fl.length;s[le]?(s[le].top=Ht,s[le].opacity=Fo,s[le].element=$n,s[le].firstUser=ol,s[le].secondUser=nn,s[le].totalCount=cn,s[le].uniqueUserCount=_l):s[le]={id:le,top:Ht,opacity:Fo,element:$n,firstUser:ol,secondUser:nn,totalCount:cn,uniqueUserCount:_l}});const D=Object.values(s).map(V=>{const ce=Math.max(0,(V.uniqueUserCount??0)-2);if(!V.element&&V.id&&f.value){const Pe=String(V.id);V.element=f.value.querySelector(`[data-comment="${Pe}"], [data-fake-comment="${Pe}"]`)}return{...V,firstUser:V.firstUser||null,secondUser:V.secondUser||null,totalCount:V.totalCount,additionalCount:ce}});(re.value.length!==D.length||D.some((V,ce)=>{const le=re.value[ce];if(!le)return!0;const Pe=(le.firstUser?.id||null)!==(V.firstUser?.id||null),Me=(le.secondUser?.id||null)!==(V.secondUser?.id||null);return le.id!==V.id||Math.abs(le.top-V.top)>1||le.opacity!==V.opacity||le.totalCount!==V.totalCount||le.additionalCount!==V.additionalCount||Pe||Me||le.element!==V.element}))&&(re.value=D),We.value=!1}))},hl=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&&(Mn(),Rl.value=n,n.classList.add("editor-comment-highlighted"))},Mn=(a=!1)=>{!a&&vl.value!==null&&Rl.value&&(Rl.value.getAttribute("data-comment")||Rl.value.getAttribute("data-fake-comment"))===vl.value||(f.value&&f.value.querySelectorAll(".editor-comment-highlighted").forEach(s=>{s.classList.remove("editor-comment-highlighted")}),Rl.value&&(Rl.value.classList.remove("editor-comment-highlighted"),Rl.value=null))},io=a=>{if(!a||!a.element)return;Mn(!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}"]`;me("comment-marker-clicked",{commentId:n,selector:s,element:a.element})},eo=()=>{Mn()},co=()=>{!T.richText||!f.value||(Re.value&&Re.value.disconnect(),pt.value!==null&&(clearTimeout(pt.value),pt.value=null),Re.value=new MutationObserver(()=>{pt.value===null&&(pt.value=setTimeout(()=>{pt.value=null,e.nextTick(()=>{at("MutationObserver")})},200))}),Re.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"]}),at("setupCommentMarkersObserver-initial"))},Cn=(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(()=>he.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(()=>{Cn(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,rt.value],()=>{be.value==="askAi"||rt.value==="askAi"?e.nextTick(()=>{Ao()}):(he.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}),ee({openCommentOverlayForSelector:Fn,updateCommentMarkers:at,restoreCommentsFromModel:zt}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container",[{"editor-with-comments":_t.value},Tt.value]]),style:e.normalizeStyle(St.value)},[S.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:n[14]||(n[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Zd,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:ln,title:e.unref(N)("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,Ud),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Il.value}]),onClick:En,title:e.unref(N)("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,Xd),n[61]||(n[61]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Yd,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[0]||(n[0]=s=>lo("paragraph")),title:e.unref(N)("textEditor.toolbar.paragraphFormat")},[E.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:P.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Kd)):E.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:P.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Gd)):E.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:P.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Qd)):E.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:P.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Jd)):E.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:P.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,e1)):E.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:P.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,t1)):(e.openBlock(),e.createElementBlock("svg",l1,[...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,jd),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=>Ll("<h1>"))},[e.createElementVNode("img",{src:P.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,n1),e.createElementVNode("h1",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[2]||(n[2]=s=>Ll("<h2>"))},[e.createElementVNode("img",{src:P.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,o1),e.createElementVNode("h2",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[3]||(n[3]=s=>Ll("<h3>"))},[e.createElementVNode("img",{src:P.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,a1),e.createElementVNode("h3",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[4]||(n[4]=s=>Ll("<h4>"))},[e.createElementVNode("img",{src:P.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,s1),e.createElementVNode("h4",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[5]||(n[5]=s=>Ll("<h5>"))},[e.createElementVNode("img",{src:P.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,r1),e.createElementVNode("h5",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[6]||(n[6]=s=>Ll("<h6>"))},[e.createElementVNode("img",{src:P.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,i1),e.createElementVNode("h6",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[7]||(n[7]=s=>Ll("<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(N)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":At("bold")}]),onClick:n[9]||(n[9]=s=>Xl("bold")),title:e.unref(N)("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,c1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":At("italic")}]),onClick:n[10]||(n[10]=s=>Xl("italic")),title:e.unref(N)("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,u1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":At("underline")}]),onClick:n[11]||(n[11]=s=>Xl("underline")),title:e.unref(N)("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,d1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":qe.value}]),onClick:Hn,title:e.unref(N)("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,m1),n[62]||(n[62]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ye.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:sn,title:e.unref(N)("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,v1)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:Un,title:e.unref(N)("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,p1)),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":At("insertUnorderedList")}]),onClick:Rn,title:e.unref(N)("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,f1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":At("insertOrderedList")}]),onClick:fn,title:e.unref(N)("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,h1),n[64]||(n[64]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Bl,title:e.unref(N)("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,g1),_t.value&&se.value?(e.openBlock(),e.createElementBlock("div",y1)):e.createCommentVNode("",!0),_t.value&&se.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(N)("textEditor.toolbar.comment"),onClick:ct},[...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,k1)):e.createCommentVNode("",!0),S.askAi?(e.openBlock(),e.createElementBlock("div",C1)):e.createCommentVNode("",!0),S.askAi?(e.openBlock(),e.createElementBlock("div",b1,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:n[12]||(n[12]=s=>lo("askAi")),title:e.unref(N)("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",x1,e.toDisplayString(e.unref(N)("textEditor.toolbar.askAi")),1)],8,w1),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",E1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[Dl(s)?(e.openBlock(),e.createElementBlock("div",S1,[e.renderSlot(a.$slots,s)])):e.createCommentVNode("",!0),Dl(s)&&i<S.customToolbarSlots.length-1&&Zn(i)?(e.openBlock(),e.createElementBlock("div",V1)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(be.value==="paragraph"||be.value==="askAi")&&S.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:rl})):e.createCommentVNode("",!0),e.createVNode(ha,{showModal:Se.value,width:"500px",height:"55vh",onCloseModal:so},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(N)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",N1,[e.createElementVNode("div",B1,[e.createElementVNode("label",M1,e.toDisplayString(e.unref(N)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:De,type:"text","onUpdate:modelValue":n[15]||(n[15]=s=>yt.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.link.enterAltText"),onKeyup:e.withKeys(xo,["enter"])},null,40,_1),[[e.vModelText,yt.value]])]),e.createElementVNode("div",$1,[e.createElementVNode("label",L1,e.toDisplayString(e.unref(N)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:st,type:"text","onUpdate:modelValue":n[16]||(n[16]=s=>U.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.link.enterUrl"),onKeyup:e.withKeys(xo,["enter"])},null,40,T1),[[e.vModelText,U.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:so},e.toDisplayString(e.unref(N)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:xo},e.toDisplayString(e.unref(N)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(ha,{showModal:Yt.value,width:"500px",height:"80vh",onCloseModal:cl},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(ht.value?e.unref(N)("textEditor.image.editImage"):e.unref(N)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",A1,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Y.value==="upload"}]),onClick:n[17]||(n[17]=s=>Y.value="upload")},e.toDisplayString(e.unref(N)("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":Y.value==="url"}]),onClick:n[18]||(n[18]=s=>Y.value="url")},e.toDisplayString(e.unref(N)("textEditor.image.imageLink")),3)]),Y.value==="upload"?(e.openBlock(),e.createElementBlock("div",D1,[e.createElementVNode("div",H1,[e.createElementVNode("div",R1,[Wl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",F1,e.toDisplayString(e.unref(N)("textEditor.image.uploadImage")),1)),Wl.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:Ml},[e.createElementVNode("img",{src:dt.value,alt:"Preview",class:"dss-image-preview-image"},null,8,I1),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:ft,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:F},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:ft,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:F},null,544))]),e.createElementVNode("div",z1,[e.createElementVNode("label",P1,e.toDisplayString(e.unref(N)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:tl,type:"text","onUpdate:modelValue":n[19]||(n[19]=s=>we.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.image.enterAltText"),onKeyup:e.withKeys(It,["enter"])},null,40,O1),[[e.vModelText,we.value]])]),e.createElementVNode("div",W1,[e.createElementVNode("label",q1,e.toDisplayString(e.unref(N)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[20]||(n[20]=s=>et.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.image.auto"),onKeyup:e.withKeys(It,["enter"]),onInput:Ol},null,40,Z1),[[e.vModelText,et.value]])]),e.createElementVNode("div",U1,[e.createElementVNode("label",X1,e.toDisplayString(e.unref(N)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[21]||(n[21]=s=>Et.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.image.auto"),onKeyup:e.withKeys(It,["enter"]),onInput:Pn},null,40,Y1),[[e.vModelText,Et.value]])])])])):e.createCommentVNode("",!0),Y.value==="url"?(e.openBlock(),e.createElementBlock("div",j1,[e.createElementVNode("div",K1,[e.createElementVNode("div",G1,[e.createElementVNode("label",Q1,e.toDisplayString(e.unref(N)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Zt,type:"text","onUpdate:modelValue":n[22]||(n[22]=s=>ne.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(It,["enter"])},null,40,J1),[[e.vModelText,ne.value]])]),e.createElementVNode("div",em,[e.createElementVNode("label",tm,e.toDisplayString(e.unref(N)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[23]||(n[23]=s=>we.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.image.enterAltText"),onKeyup:e.withKeys(It,["enter"])},null,40,lm),[[e.vModelText,we.value]])]),e.createElementVNode("div",nm,[e.createElementVNode("label",om,e.toDisplayString(e.unref(N)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[24]||(n[24]=s=>et.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.image.auto"),onKeyup:e.withKeys(It,["enter"]),onInput:Ol},null,40,am),[[e.vModelText,et.value]])]),e.createElementVNode("div",sm,[e.createElementVNode("label",rm,e.toDisplayString(e.unref(N)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[25]||(n[25]=s=>Et.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.image.auto"),onKeyup:e.withKeys(It,["enter"]),onInput:Pn},null,40,im),[[e.vModelText,Et.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:cl},e.toDisplayString(e.unref(N)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:It},e.toDisplayString(e.unref(N)("textEditor.image.save")),1)]),_:1},8,["showModal"]),S.showTitle?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":Zl.value&&sl.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(N)("textEditor.labels.title")),1),e.createElementVNode("div",cm,[sl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",um,[S.title?(e.openBlock(),e.createElementBlock("span",dm,e.toDisplayString(S.title),1)):(e.openBlock(),e.createElementBlock("span",mm,e.toDisplayString(wl.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:Ee,value:S.title,onInput:it,onFocus:He,onBlur:vt,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!sl.value}]),placeholder:wl.value,disabled:S.disabled,rows:"1"},null,42,pm)])],2)):e.createCommentVNode("",!0),S.showTitle&&Zl.value&&sl.value?(e.openBlock(),e.createElementBlock("div",vm,[e.renderSlot(a.$slots,"title-slot")])):e.createCommentVNode("",!0),S.showDescription?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":en.value&&M.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(N)("textEditor.labels.description")),1),e.createElementVNode("div",fm,[M.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",hm,[S.description?(e.openBlock(),e.createElementBlock("span",gm,e.toDisplayString(S.description),1)):(e.openBlock(),e.createElementBlock("span",ym,e.toDisplayString(Al.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:je,value:S.description,onInput:Dt,onFocus:yl,onBlur:xl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!M.value}]),placeholder:Al.value,disabled:S.disabled,rows:"1"},null,42,km)])],2)):e.createCommentVNode("",!0),S.showDescription&&en.value&&M.value?(e.openBlock(),e.createElementBlock("div",Cm,[e.renderSlot(a.$slots,"description-slot")])):e.createCommentVNode("",!0),_t.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:6},e.renderList(re.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":vl.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=>hl(s),onMouseleave:eo},[s.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(i=>io(s),["stop"])},[s.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.firstUser.avatar,alt:s.firstUser.name||"avatar"},null,8,xm)):(e.openBlock(),e.createElementBlock("span",Em,e.toDisplayString(s.firstUser.initials||(s.firstUser.name?s.firstUser.name.charAt(0):"")),1))],8,wm)):e.createCommentVNode("",!0),s.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(i=>io(s),["stop"])},[s.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.secondUser.avatar,alt:s.secondUser.name||"avatar"},null,8,Vm)):(e.openBlock(),e.createElementBlock("span",Nm,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=>io(s),["stop"])},[e.createElementVNode("span",Mm,"+"+e.toDisplayString(s.additionalCount),1)],12,Bm)):e.createCommentVNode("",!0)],46,bm))),128)):e.createCommentVNode("",!0),S.richText?(e.openBlock(),e.createElementBlock("div",Hm,[e.createElementVNode("div",{ref_key:"editorRef",ref:f,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":S.disabled,"dss-text-editor-fixed-height":S.fixedHeight}]),style:e.normalizeStyle(Jl.value),onInput:Vt,onBlur:xn,onClick:ta,onMouseup:ko,onKeyup:ko,onKeydown:Ko,onPaste:Go,onMousemove:la,onMouseleave:na},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[_t.value&&vl.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(y.value)},[O.value||tt.value.length>0?(e.openBlock(),e.createElementBlock("div",Rm,[e.createElementVNode("div",Fm,[O.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:O.value},null,8,Im)):e.createCommentVNode("",!0)]),e.createElementVNode("div",zm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tt.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",Pm,[e.createElementVNode("div",Om,[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",qm,e.toDisplayString(s.user.initials||(s.user.name?s.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Zm,[e.createElementVNode("div",Um,[e.createElementVNode("div",Xm,e.toDisplayString(s.user&&s.user.name||"Comment"),1),s.createdAt?(e.openBlock(),e.createElementBlock("div",Ym,e.toDisplayString(A(new Date(s.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":I(s.text)||s.class==="comment-started"}])},e.toDisplayString(s.text||""),3)]),T.commentUser&&s.user&&s.user.id===T.commentUser.id&&!I(s.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>fl(s,i),["stop"]),title:e.unref(N)("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,jm)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Km,[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(N)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(oe,["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,Gm),[[e.vModelText,g.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(oe,["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",Qm,[e.createElementVNode("div",Jm,[e.createElementVNode("span",e2,e.toDisplayString(pl.value)+" "+e.toDisplayString(pl.value===1?e.unref(N)("textEditor.footer.word"):e.unref(N)("textEditor.footer.words")),1),n[70]||(n[70]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",t2,e.toDisplayString(an.value)+" "+e.toDisplayString(an.value===1?e.unref(N)("textEditor.footer.character"):e.unref(N)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",_m,[e.createElementVNode("textarea",{value:S.modelValue,onInput:L,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":S.fixedHeight}]),placeholder:dn.value,rows:S.rows,disabled:S.disabled,style:e.normalizeStyle(gl.value)},null,46,$m),e.createElementVNode("div",Lm,[e.createElementVNode("div",Tm,[e.createElementVNode("span",Am,e.toDisplayString(pl.value)+" "+e.toDisplayString(pl.value===1?e.unref(N)("textEditor.footer.word"):e.unref(N)("textEditor.footer.words")),1),n[67]||(n[67]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Dm,e.toDisplayString(an.value)+" "+e.toDisplayString(an.value===1?e.unref(N)("textEditor.footer.character"):e.unref(N)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[j.value&&ge.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(_e.value),onMouseenter:n[28]||(n[28]=s=>ue.value=!0),onMouseleave:Gn},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(wo,["stop"]),title:ge.value},e.toDisplayString(ge.value),9,l2),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Ro,["stop"]),title:e.unref(N)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",o2,[...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,n2)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[wt.value&&jt.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(fe.value),onMouseenter:n[29]||(n[29]=s=>H.value=!0),onMouseleave:Qn},[e.createElementVNode("div",a2,[jt.value===e.unref(N)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",s2,[...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:jt.value},e.toDisplayString(jt.value),9,r2)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(El,["stop"]),title:e.unref(N)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",c2,[...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,i2)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[S.floatingToolbar&&S.richText&&Be.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:Ge,class:"dss-floating-toolbar",style:e.normalizeStyle(Je.value),onMousedown:n[44]||(n[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",u2,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(ln,["stop"]),title:e.unref(N)("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,d2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Il.value}]),onClick:e.withModifiers(En,["stop"]),title:e.unref(N)("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,m2),n[89]||(n[89]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",p2,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[30]||(n[30]=e.withModifiers(s=>Co("paragraph"),["stop"])),title:e.unref(N)("textEditor.toolbar.paragraphFormat")},[E.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:P.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,f2)):E.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:P.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,h2)):E.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:P.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,g2)):E.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:P.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,y2)):E.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:P.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,k2)):E.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:P.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,C2)):(e.openBlock(),e.createElementBlock("svg",b2,[...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,v2),rt.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=>jl("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[32]||(n[32]=s=>jl("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[33]||(n[33]=s=>jl("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[34]||(n[34]=s=>jl("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[35]||(n[35]=s=>jl("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[36]||(n[36]=s=>jl("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[37]||(n[37]=s=>jl("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(N)("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":At("bold")}]),onClick:n[39]||(n[39]=e.withModifiers(s=>Xl("bold"),["stop"])),title:e.unref(N)("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,w2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":At("italic")}]),onClick:n[40]||(n[40]=e.withModifiers(s=>Xl("italic"),["stop"])),title:e.unref(N)("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,x2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":At("underline")}]),onClick:n[41]||(n[41]=e.withModifiers(s=>Xl("underline"),["stop"])),title:e.unref(N)("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,E2),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":qe.value}]),onClick:e.withModifiers(Hn,["stop"]),title:e.unref(N)("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)),ye.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(sn,["stop"]),title:e.unref(N)("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,N2)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(Un,["stop"]),title:e.unref(N)("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,V2)),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":At("insertUnorderedList")}]),onClick:e.withModifiers(Rn,["stop"]),title:e.unref(N)("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,B2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":At("insertOrderedList")}]),onClick:e.withModifiers(fn,["stop"]),title:e.unref(N)("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,M2),n[94]||(n[94]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Bl,["stop"]),title:e.unref(N)("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,_2),_t.value?(e.openBlock(),e.createElementBlock("div",$2)):e.createCommentVNode("",!0),_t.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(N)("textEditor.toolbar.comment"),onClick:e.withModifiers(ct,["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,L2)):e.createCommentVNode("",!0),S.askAi?(e.openBlock(),e.createElementBlock("div",T2)):e.createCommentVNode("",!0),S.askAi?(e.openBlock(),e.createElementBlock("div",A2,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:n[42]||(n[42]=e.withModifiers(s=>Co("askAi"),["stop"])),title:e.unref(N)("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",H2,e.toDisplayString(e.unref(N)("textEditor.toolbar.askAi")),1)],8,D2),rt.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",R2,[S.askAi&&wn.value?(e.openBlock(),e.createElementBlock("div",F2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[Dl(s)&&mn(s)?(e.openBlock(),e.createElementBlock("div",I2,[e.renderSlot(a.$slots,s)])):e.createCommentVNode("",!0),Dl(s)&&mn(s)&&i<S.customToolbarSlots.length-1&&ql(i)?(e.openBlock(),e.createElementBlock("div",z2)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),W2={class:"dss-color-picker__section-title"},q2={class:"dss-color-picker__presets-row"},Z2=["title","onClick"],U2={key:1,class:"dss-color-picker__section"},X2={class:"dss-color-picker__presets-row"},Y2=["title","onClick"],j2={key:2,class:"dss-color-picker__section"},K2={class:"dss-color-picker__section-header"},G2={class:"dss-color-picker__presets-row"},Q2=["title","onClick"],J2=["onClick"],ep={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},tp=["title","onClick"],lp={class:"dss-color-picker__input-row"},np=["value"],op={__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(S,{emit:ee}){function $(ie){const X=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(ie);if(!X)return{h:0,s:0,l:50};const Q=parseInt(X[1],16)/255,ae=parseInt(X[2],16)/255,Ee=parseInt(X[3],16)/255,je=Math.max(Q,ae,Ee),bt=Math.min(Q,ae,Ee);let Ut=0,lt=0;const sl=(je+bt)/2;if(je!==bt){const M=je-bt;switch(lt=sl>.5?M/(2-je-bt):M/(je+bt),je){case Q:Ut=((ae-Ee)/M+(ae<Ee?6:0))/6;break;case ae:Ut=((Ee-Q)/M+2)/6;break;case Ee:Ut=((Q-ae)/M+4)/6;break}}return{h:Ut*360,s:lt*100,l:sl*100}}function N(ie,X,Q){X/=100,Q/=100;const ae=X*Math.min(Q,1-Q),Ee=je=>{const bt=(je+ie/30)%12,Ut=Q-ae*Math.max(Math.min(bt-3,9-bt,1),-1);return Math.round(255*Ut).toString(16).padStart(2,"0")};return`#${Ee(0)}${Ee(8)}${Ee(4)}`}function de(ie){const X=ie.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!X)return null;let Q=X[1];return Q.length===3&&(Q=Q.split("").map(ae=>ae+ae).join("")),"#"+Q}function P(ie){const X=ie.match(/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})(?:[\s,\/]+[\d.]+)?\s*\)$/i);if(!X)return null;const Q=Math.max(0,Math.min(255,Number.parseInt(X[1],10))),ae=Math.max(0,Math.min(255,Number.parseInt(X[2],10))),Ee=Math.max(0,Math.min(255,Number.parseInt(X[3],10)));return`#${Q.toString(16).padStart(2,"0")}${ae.toString(16).padStart(2,"0")}${Ee.toString(16).padStart(2,"0")}`}function T(ie){if(typeof ie!="string")return null;const X=ie.trim();return de(X)||P(X)}function me(ie,X,Q){X/=100,Q/=100;const ae=Q+X*Math.min(Q,1-Q),Ee=ae===0?0:2-2*Q/ae;return{h:ie,s:Ee*100,v:ae*100}}function ut(ie,X,Q){X/=100,Q/=100;const ae=Q*(1-X/2),Ee=ae===0||ae===1?0:(Q-ae)/Math.min(ae,1-ae);return{h:ie,s:Ee*100,l:ae*100}}const te=S,f=ee,be=e.ref(!1),ye=e.ref(!1),J=e.ref(!1),j=e.ref(-1),ge=e.ref(-1),_e=e.ref(null),ue=e.ref(null),Se=e.ref(null),U=e.ref(null),yt=e.ref({top:0,left:0}),st=e.ref($(te.modelValue||"#b8a5de")),De=e.computed(()=>Array.isArray(te.presetGroups)&&te.presetGroups.length>0),Ue=e.computed(()=>!te.disableCustomColors),Z=e.computed(()=>De.value?0:te.initialPresetCount!=null?te.initialPresetCount:ge.value<0?null:ge.value),Te=e.computed(()=>{const ie=Z.value;return ie==null?!0:Math.max(0,te.presetColors.length-ie)<te.max}),qe=e.computed(()=>!!(ye.value||j.value>=0||!ke.value&&te.presetColors.length===0));e.computed(()=>{const ie=Z.value;return ie!=null&&te.presetColors.length>ie});const ke=e.computed(()=>De.value||Z.value!=null),Be=e.computed(()=>{const ie=Z.value;return ie==null?[]:te.presetColors.slice(0,ie)}),Je=e.computed(()=>{const ie=Z.value;return ie==null?[]:te.presetColors.slice(ie)});function Ge(ie){const X=Z.value;return X!=null?X+ie:-1}function rt(ie){const X=Z.value;return X!=null&&ie>=X}function Yt(ie){rt(ie)&&(j.value=ie,st.value=$(te.presetColors[ie]),ye.value=!0,e.nextTick(()=>U.value?.focus()))}function we(ie){if(!rt(ie))return;const X=te.presetColors.filter((Ee,je)=>je!==ie);f("update:presetColors",X);const Q=de(te.modelValue),ae=de(te.presetColors[ie]);if(Q&&ae&&Q.toLowerCase()===ae.toLowerCase()){const Ee=X[Math.max(0,ie-1)]||X[0];Ee&&f("update:modelValue",Ee)}}function qt(){J.value=!J.value,J.value||(j.value=-1,ye.value=!1)}function dt(){if(!Ue.value||j.value<0)return;const ie=ft.value,X=de(ie);if(X){const Q=[...te.presetColors];Q[j.value]=X,f("update:presetColors",Q),f("update:modelValue",X),j.value=-1,ye.value=!1}}function et(){te.disabled||!Ue.value||(j.value=-1,ye.value=!ye.value,ye.value&&(H(),e.nextTick(()=>U.value?.focus())))}function Et(ie){const X=T(ie),Q=T(te.modelValue);return X&&Q&&X.toLowerCase()===Q.toLowerCase()}function tl(){if(te.disabled||!Ue.value||!Te.value)return;const ie=ft.value,X=de(ie);if(X){const Q=[...te.presetColors,X];f("update:presetColors",Q),f("update:modelValue",X);const ae=Z.value??ge.value;ae>=0&&Q.length-ae>=te.max&&(ye.value=!1)}}const ft=e.computed(()=>{const{h:ie,s:X,l:Q}=st.value;return N(ie,X,Q)}),Zt=e.computed(()=>ft.value.toLowerCase()),ht=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${st.value.h}, 100%, 50%))`})),Jt=e.computed(()=>{const ie=me(st.value.h,st.value.s,st.value.l);return{left:`${ie.s}%`,bottom:`${ie.v}%`,transform:"translate(-50%, 50%)"}}),wt=e.computed(()=>({left:`${st.value.h/360*100}%`,transform:"translateX(-50%)"})),jt=e.computed(()=>({position:"fixed",left:`${yt.value.left}px`,top:`${yt.value.top}px`,zIndex:1002}));function fe(){if(!_e.value||!be.value)return;const ie=_e.value.getBoundingClientRect(),X=window.innerHeight||document.documentElement.clientHeight;let Q=ie.bottom+4;const ae=ue.value;ae&&Q+ae.offsetHeight>X-8&&(Q=ie.top-4-ae.offsetHeight),yt.value={top:Q,left:ie.left}}function H(){const ie=te.modelValue||"#b8a5de",X=T(ie);X&&(st.value=$(X))}function Y(){f("update:modelValue",ft.value)}function ne(){te.disabled||(be.value=!be.value,be.value&&(H(),e.nextTick(()=>{fe(),U.value?.focus()})))}function he(){const ie=ft.value,X=de(ie);if(X){if(j.value>=0){const Q=[...te.presetColors];Q[j.value]=X,f("update:presetColors",Q),f("update:modelValue",X)}else if(Ue.value&&(te.presetColors.length>0||De.value)&&ye.value&&Te.value&&!te.presetColors.some(ae=>de(ae)?.toLowerCase()===X.toLowerCase())){const ae=[...te.presetColors,X];f("update:presetColors",ae),f("update:modelValue",X)}}be.value=!1,ye.value=!1,J.value=!1,j.value=-1}function Xe(ie){if(!Se.value)return;const X=Se.value.getBoundingClientRect(),Q=ae=>{const Ee=Math.max(0,Math.min(1,(ae.clientX-X.left)/X.width)),je=Math.max(0,Math.min(1,1-(ae.clientY-X.top)/X.height)),bt={h:st.value.h,s:Ee*100,v:je*100};st.value=ut(bt.h,bt.s,bt.v)};Q(ie),document.addEventListener("mousemove",Q),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",Q),Y()},{once:!0})}function Ke(ie){if(!ie.currentTarget)return;const Q=ie.currentTarget.getBoundingClientRect(),ae=Ee=>{const je=Math.max(0,Math.min(1,(Ee.clientX-Q.left)/Q.width));st.value={...st.value,h:je*360}};ae(ie),document.addEventListener("mousemove",ae),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",ae),Y()},{once:!0})}function Lt(ie){const X=ie.target.value,Q=T(X);Q&&(st.value=$(Q),f("update:modelValue",Q))}function $e(ie){if(te.disabled)return;const X=T(ie);X&&(st.value=$(X),f("update:modelValue",X))}let Qe=null,Ct=null;function el(){Qe&&(document.removeEventListener("keydown",Qe),Qe=null),Ct&&(window.removeEventListener("resize",Ct),Ct=null)}return e.watch(be,ie=>{if(el(),ie){if(!De.value&&te.initialPresetCount==null){const X=te.presetColors.length;X>0&&(ge.value<0||X<ge.value)&&(ge.value=X)}Qe=X=>{X.key==="Escape"&&he()},Ct=fe,document.addEventListener("keydown",Qe),window.addEventListener("resize",Ct)}}),e.watch(()=>te.modelValue,()=>{be.value&&H()},{immediate:!1}),e.watch(Je,ie=>{ie.length===0&&(J.value=!1,j.value=-1,ye.value=!1)}),e.onBeforeUnmount(el),(ie,X)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":S.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:_e,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":be.value}]),onClick:ne},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:ft.value})},[...X[0]||(X[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(he,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:ue,class:"dss-color-picker__dropdown",style:e.normalizeStyle(jt.value)},[ke.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[De.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(S.presetGroups,(Q,ae)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+ae,class:"dss-color-picker__section"},[e.createElementVNode("span",W2,e.toDisplayString(Q.title),1),e.createElementVNode("div",q2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.colors,(Ee,je)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+ae+"-"+je,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Et(Ee)}]),style:e.normalizeStyle({backgroundColor:Ee,"--dss-preset-color":Ee}),title:Ee,onClick:e.withModifiers(bt=>$e(Ee),["stop"])},null,14,Z2))),128))])]))),128)):Be.value.length?(e.openBlock(),e.createElementBlock("div",U2,[X[1]||(X[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",X2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Be.value,(Q,ae)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+ae,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Et(Q)}]),style:e.normalizeStyle({backgroundColor:Q,"--dss-preset-color":Q}),title:Q,onClick:e.withModifiers(Ee=>$e(Q),["stop"])},null,14,Y2))),128))])])):e.createCommentVNode("",!0),Ue.value?(e.openBlock(),e.createElementBlock("div",j2,[e.createElementVNode("div",K2,[X[3]||(X[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),Je.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"])},[...X[2]||(X[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",G2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Je.value,(Q,ae)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+ae,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&&Et(Q),"dss-color-picker__preset-bubble--editing":J.value&&j.value===Ge(ae)}]),style:e.normalizeStyle({backgroundColor:j.value===Ge(ae)?ft.value:Q,"--dss-preset-color":j.value===Ge(ae)?ft.value:Q}),title:j.value===Ge(ae)?ft.value:Q,onClick:e.withModifiers(Ee=>J.value?Yt(Ge(ae)):$e(Q),["stop"])},null,14,Q2),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(Ee=>we(Ge(ae)),["stop"])},[...X[4]||(X[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,J2)):e.createCommentVNode("",!0)],2))),128)),Te.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ye.value}]),onClick:e.withModifiers(et,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],64)):S.presetColors.length?(e.openBlock(),e.createElementBlock("div",ep,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.presetColors,(Q,ae)=>(e.openBlock(),e.createElementBlock("button",{key:ae,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Et(Q)}]),style:e.normalizeStyle({backgroundColor:Q,"--dss-preset-color":Q}),title:Q,onClick:e.withModifiers(Ee=>$e(Q),["stop"])},null,14,tp))),128)),Ue.value&&Te.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ye.value}]),onClick:e.withModifiers(et,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),qe.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:Se,onMousedown:Xe},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(ht.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(Jt.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:Ke},[X[5]||(X[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(wt.value)},null,4)],32),e.createElementVNode("div",lp,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:U,type:"text",class:"dss-color-picker__hex-input",value:Zt.value,onInput:Lt},null,40,np)]),Ue.value&&ke.value&&(S.presetColors.length||De.value)&&Te.value&&j.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:tl}," Save color ")):e.createCommentVNode("",!0),Ue.value&&ke.value&&j.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:dt}," Save color ")):e.createCommentVNode("",!0),ke.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:he}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},ap={key:0,class:"dss-loader"},sp={key:0,class:"dss-loader-label"},rp={key:1,class:"dss-loader"},ip={key:0,class:"dss-loader-label"},cp={key:2,class:"dss-loader"},up={key:0,class:"dss-loader-label"},dp={key:3,class:"dss-loader"},mp={key:0,class:"dss-loader-label"},pp={key:4,class:"dss-loader"},vp={key:0,class:"dss-loader-label"},fp={key:5,class:"dss-loader dss-loader--inline"},hp={class:"dss-loader-inline-text"},gp={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""}},setup(S){const ee=S,$=e.computed(()=>ee.size==="small"?"dss-loaders--size-small":ee.size==="large"?"dss-loaders--size-large":ee.size==="medium"||ee.size==null?"dss-loaders--size-medium":null),N=e.computed(()=>{const de={};if(!(ee.size==="small"||ee.size==="medium"||ee.size==="large"||ee.size==null)){const P=typeof ee.size=="number"?`${ee.size}px`:String(ee.size);de["--dss-loader-size"]=P}return ee.color&&(de["--dss-loader-accent"]=ee.color,de["--dss-loader-accent-soft"]=`color-mix(in srgb, ${ee.color} 30%, white)`),de});return(de,P)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",$.value]),style:e.normalizeStyle(N.value)},[S.type==="spinner"?(e.openBlock(),e.createElementBlock("div",ap,[P[0]||(P[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),S.label?(e.openBlock(),e.createElementBlock("span",sp,e.toDisplayString(S.label),1)):e.createCommentVNode("",!0)])):S.type==="dots"?(e.openBlock(),e.createElementBlock("div",rp,[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)),S.label?(e.openBlock(),e.createElementBlock("span",ip,e.toDisplayString(S.label),1)):e.createCommentVNode("",!0)])):S.type==="battery"?(e.openBlock(),e.createElementBlock("div",cp,[P[2]||(P[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),S.label?(e.openBlock(),e.createElementBlock("span",up,e.toDisplayString(S.label),1)):e.createCommentVNode("",!0)])):S.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",dp,[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)),S.label?(e.openBlock(),e.createElementBlock("span",mp,e.toDisplayString(S.label),1)):e.createCommentVNode("",!0)])):S.type==="bars"?(e.openBlock(),e.createElementBlock("div",pp,[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)),S.label?(e.openBlock(),e.createElementBlock("span",vp,e.toDisplayString(S.label),1)):e.createCommentVNode("",!0)])):S.type==="inline"?(e.openBlock(),e.createElementBlock("div",fp,[P[5]||(P[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",hp,[e.renderSlot(de.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(S.label),1)])])])):e.createCommentVNode("",!0)],6))}},Ha="dss-skeleton-item",yp={__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:S=>["single","multiple"].includes(S)},targetClass:{type:String,default:Ha},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(S){const ee=S,$=e.computed(()=>{const P={"dss-skeleton--loading":ee.loading,"dss-skeleton--static":!ee.shimmer,"dss-skeleton--multiple":ee.mode==="multiple","dss-skeleton--dark":ee.darkMode};return ee.mode==="multiple"&&ee.targetClass!==Ha&&(P[`dss-skeleton--target-${ee.targetClass}`]=!0),P}),N=e.computed(()=>{const P={};return ee.borderRadius&&(P.borderRadius=ee.borderRadius),P}),de=e.computed(()=>{const P={};return ee.borderRadius&&(P["--dss-skeleton-border-radius"]=ee.borderRadius),ee.darkMode?(P["--dss-skeleton-bg"]=ee.bgDark||"#322c3f",P["--dss-skeleton-shimmer"]=ee.shimmerDark||"#3e3f41",P):(ee.bgColor&&(P["--dss-skeleton-bg"]=ee.bgColor),ee.shimmerColor&&(P["--dss-skeleton-shimmer"]=ee.shimmerColor),P)});return(P,T)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",$.value]),style:e.normalizeStyle(de.value)},[S.loading&&S.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(N.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":S.loading&&S.mode==="single"}])},[e.renderSlot(P.$slots,"default")],2)],6))}},kp={key:0,class:"dss-dnd-column-header"},Cp={class:"dss-dnd-column-title"},bp={class:"dss-dnd-column-count"},wp=["data-column"],xp={key:0,class:"dss-dnd-indicator"},Ep=["onPointerdown"],Sp=["onPointerdown"],Vp={class:"dss-dnd-item-content"},Np={class:"dss-dnd-item-default"},Bp={key:0,class:"dss-dnd-empty"},Mp={name:"DSSDnd"},_p=Object.assign(Mp,{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(S,{emit:ee}){const $=S,N=ee,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},me=e.computed(()=>({...T,...$.options})),ut=e.computed(()=>({"--dss-dnd-col-min-w":me.value.columnMinWidth,"--dss-dnd-col-max-w":me.value.columnMaxWidth,"--dss-dnd-col-gap":me.value.columnGap,"--dss-dnd-indicator-color":me.value.indicatorColor,"--dss-dnd-body-max-h":me.value.columnBodyMaxHeight}));function te(fe){if(!me.value.ColColor||!fe)return{};const H=fe.background||fe.color;return H?{background:H}:{}}const f=e.ref(null),be=e.ref(null),ye=e.ref(!1),J=e.ref(-1),j=e.ref(null);let ge=null,_e=null,ue=null,Se=null,U=0,yt=0,st="",De=null;const Ue=5,Z=e.computed(()=>{const fe={};for(const H of $.columns)fe[H.value]=$.items.filter(Y=>Y[$.columnKey]===H.value).sort((Y,ne)=>(Y[$.positionKey]??0)-(ne[$.positionKey]??0));return fe}),Te=e.computed(()=>{const fe={},H=!!f.value,Y=f.value?.[$.itemKey],ne=be.value,he=J.value;for(const Xe of $.columns){const Ke=Z.value[Xe.value]||[],Lt=[],$e=ne==Xe.value;let Qe=0;for(let Ct=0;Ct<Ke.length;Ct++){const el=Ke[Ct],ie=H&&el[$.itemKey]===Y;!ie&&$e&&he===Qe&&Lt.push({type:"indicator",key:`ind-${Qe}`}),ie||Qe++,Lt.push({type:"item",item:el,isDragged:ie,key:`item-${el[$.itemKey]}`})}$e&&he>=Qe&&Lt.push({type:"indicator",key:"ind-end"}),fe[Xe.value]=Lt}return fe});function qe(fe,H){const ne=(Z.value[fe]||[]).filter(Ke=>Ke[$.itemKey]!==f.value?.[$.itemKey]);if(ne.length===0)return 1;if(H<=0){const Ke=ne[0][$.positionKey];return Ke!=null&&Ke>0?Ke/2:.5}if(H>=ne.length){const Ke=ne[ne.length-1][$.positionKey];return(Ke??0)+1}const he=ne[H-1][$.positionKey]??0,Xe=ne[H][$.positionKey]??0;return(he+Xe)/2}function ke(fe,H,Y){ue&&ue.remove();const ne=fe.getBoundingClientRect(),he=fe.cloneNode(!0);he.classList.add("dss-dnd-ghost"),he.style.cssText=`
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)}}Vt()}e.nextTick(()=>{Vl(),so()})},Jn=()=>{if(!f.value||J.value)return;const a=window.getSelection();let n=null;a&&a.rangeCount>0&&(n=Kt());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 D=[...k.matchAll(s)];if(D.length===0)continue;const z=D.filter(le=>{const Pe=le[0],Me=le.index;if(Me>0&&k[Me-1]==="@"||Me+Pe.length<k.length&&k[Me+Pe.length]==="@")return!1;const gt=h.parentElement;return!(gt&&gt.closest("a"))});if(z.length===0)continue;if(z.length===1&&z[0][0]===k.trim()){const le=z[0][0],Pe=le.startsWith("http://")||le.startsWith("https://")?le:`https://${le}`,Me=document.createElement("a");Me.href=Pe,Me.textContent=le,Me.style.color="#60afdf",Me.style.textDecoration="underline",h.parentNode&&(h.parentNode.replaceChild(Me,h),u=!0);continue}let V=0;const ce=document.createDocumentFragment();if(z.forEach(le=>{const Pe=le.index,Me=le[0];if(Pe>V){const Pt=k.substring(V,Pe);Pt&&ce.appendChild(document.createTextNode(Pt))}const gt=Me.startsWith("http://")||Me.startsWith("https://")?Me:`https://${Me}`,Ut=document.createElement("a");Ut.href=gt,Ut.textContent=Me,Ut.style.color="#60afdf",Ut.style.textDecoration="underline",ce.appendChild(Ut),V=Pe+Me.length}),V<k.length){const le=k.substring(V);le&&ce.appendChild(document.createTextNode(le))}h.parentNode&&ce.childNodes.length>0&&(h.parentNode.replaceChild(ce,h),u=!0)}u&&n&&e.nextTick(()=>{Sl(n),Vl()})},oa=()=>{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(D=>{const z=D.index,V=D[0].startsWith("<u>")?"u":"ins",ce=D[1]||D[2]||"";z>h&&k.appendChild(document.createTextNode(u.substring(h,z)));const le=document.createElement(V);le.textContent=ce,k.appendChild(le),h=z+D[0].length}),h<u.length&&k.appendChild(document.createTextNode(u.substring(h))),d.parentNode&&k.childNodes.length>0&&d.parentNode.replaceChild(k,d)}},ro=a=>{if(!f.value||J.value)return;if(!a){oa();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 Pt="",nl=0,dl=!1;const Ht=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:nn=>nn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let ol=0;for(;Ht.nextNode();){const nn=Ht.currentNode,cn=nn.textContent||"",Fl=ol;if(ol+=cn.length,nn===i.startContainer){Pt+=cn.substring(0,i.startOffset),nl=Fl+i.startOffset,dl=!0;break}Pt+=cn}return dl||(nl=Pt.length),{textBeforeCursor:Pt,cursorCharOffset:nl}},{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],z=u.length-k.length,ce=(Pt=>{let nl=0;const dl=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:ol=>ol.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let Ht;for(;Ht=dl.nextNode();){const ol=(Ht.textContent||"").length;if(nl+ol>=Pt)return{node:Ht,offset:Pt-nl};nl+=ol}return null})(z);if(!ce)return;const le=document.createRange();le.setStart(ce.node,ce.offset),le.setEnd(i.endContainer,i.endOffset);const Pe=document.createElement(h);Pe.textContent=D,le.deleteContents(),le.insertNode(Pe);const Me=window.getSelection(),gt=document.createRange();gt.setStartAfter(Pe),gt.collapse(!0),Me.removeAllRanges(),Me.addRange(gt);const Ut=Kt();e.nextTick(()=>{Vt(),Ut&&Sl(Ut)})},Bl=()=>{f.value&&(Jt.value=Kt(),be.value="",dt.value="",ne.value="",et.value="",Et.value="",Wt.value=null,ht.value=null,Y.value="upload",Xt.value=!0,rl(),e.nextTick(()=>{tl.value&&tl.value.focus(),ft.value&&(ft.value.value="")}))},F=a=>{const n=a.target?.files?.[0];if(!n){Wt.value=null,dt.value="";return}Wt.value=n;const s=new FileReader;s.onload=i=>{dt.value=i.target?.result||""},s.readAsDataURL(n)},Ml=()=>{ft.value&&ft.value.click()},Ol=()=>{et.value&&(Et.value="")},Pn=()=>{Et.value&&(et.value="")},El=()=>{let a=ht.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")||"";ht.value=a,be.value=n.trim()===""||n.trim()==="Image"?"":n;const s=a.getAttribute("src")||a.src||"";s.startsWith("http://")||s.startsWith("https://")?(ne.value=s,dt.value="",Y.value="url"):(dt.value=s,ne.value="",Y.value="upload");const c=a.style.width||a.getAttribute("width")||"",d=a.style.height||a.getAttribute("height")||"";et.value=c.endsWith("px")?c.replace("px",""):c,Et.value=d.endsWith("px")?d.replace("px",""):d,Jt.value=null}else{Bl();return}Xt.value=!0,H.value=!1,wt.value=!1,e.nextTick(()=>{Y.value==="url"&&qt.value?(qt.value.focus(),qt.value.select()):tl.value&&(tl.value.focus(),tl.value.select()),ft.value&&(ft.value.value="")})},cl=()=>{Xt.value=!1,be.value="",dt.value="",ne.value="",et.value="",Et.value="",Wt.value=null,ht.value=null,Jt.value=null,Y.value="upload"},It=()=>{const a=(be.value||"").trim(),n=f.value?._mutationObserver;n&&n.disconnect(),Qe.value?($e.value&&(clearTimeout($e.value),$e.value=null),Ft(),Qe.value=!1):Ft();const s=Y.value==="url"?ne.value.trim():dt.value;if(ht.value&&f.value&&f.value.contains(ht.value)){s&&(ht.value.src=s),ht.value.setAttribute("alt",a),ht.value.setAttribute("data-alt",a),et.value?(ht.value.style.width=`${et.value}px`,ht.value.setAttribute("width",et.value)):(ht.value.style.removeProperty("width"),ht.value.removeAttribute("width")),Et.value?(ht.value.style.height=`${Et.value}px`,ht.value.setAttribute("height",Et.value)):(ht.value.style.removeProperty("height"),ht.value.removeAttribute("height"));const i=window.getSelection();if(i){i.removeAllRanges();const c=document.createRange();c.setStartAfter(ht.value),c.collapse(!0),i.addRange(c)}Vt()}else{if(!s){n&&f.value&&n.observe(f.value,{childList:!0,subtree:!0}),cl();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(Jt.value&&(Sl(Jt.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){cl();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),et.value&&(h.style.width=`${et.value}px`,h.setAttribute("width",et.value)),Et.value&&(h.style.height=`${Et.value}px`,h.setAttribute("height",Et.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 D=document.createRange();D.setStartAfter(h),D.collapse(!0),c&&(c.removeAllRanges(),c.addRange(D))}}ht.value=h,Vt()}}e.nextTick(()=>{n&&f.value&&n.observe(f.value,{childList:!0,subtree:!0}),Vl(),il(),cl()})};e.watch(()=>T.modelValue,a=>{if(T.richText&&f.value&&!J.value){const n=bl(a||""),i=f.value.innerHTML.replace(/&nbsp;|\u00A0/g," "),c=n.replace(/&nbsp;|\u00A0/g," ");if(i!==c){const d=Kt();f.value.innerHTML=n,e.nextTick(()=>{An();const u=f.value.innerHTML||"",p=T.title||"",h=T.description||"";Ct.value=u,ie.value=p,X.value=h,el.value=u,Q.value=p,ae.value=h,Ke.value=[],Lt.value=[],$e.value&&(clearTimeout($e.value),$e.value=null),Qe.value=!1,d&&Sl(d),Nl(),Hl(),zl(),Vl(),il(),gn(),at("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>T.richText,a=>{a?(il(),e.nextTick(()=>{co()})):(Kn(),re.value=[],Re.value&&(Re.value.disconnect(),Re.value=null)),gn()}),e.watch(()=>T.floatingToolbar,a=>{a?il():Kn()}),e.watch(()=>T.disabled,a=>{a&&Kn(),gn()}),e.watch(()=>T.description,()=>{e.nextTick(()=>{M.value?ot():jt()})}),e.watch(()=>T.title,()=>{e.nextTick(()=>{sl.value?K():mt()})}),e.watch(()=>T.customToolbarSlots,()=>{e.nextTick(()=>{ao()})},{deep:!0}),e.watch(()=>T.comments,(a,n)=>{if(T.commentUser){if(Fe.value){Fe.value=!1;return}Gt.value||T.richText&&f.value&&e.nextTick(()=>{Qt()})}},{deep:!0,immediate:!1});const Qt=()=>{if(T.commentUser&&!Gt.value&&!(!T.comments||!Array.isArray(T.comments)||T.comments.length===0)&&!(!T.richText||!f.value)){Gt.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){$t(k,u),d.add(h);return}try{const D=zt(u.selection_range,u.selection_text);if(D&&!D.collapsed){const z=D.commonAncestorContainer,V=z.nodeType===3?z.parentElement:z;if(V){const Pe=V.closest("[data-comment], [data-fake-comment]");if(Pe){const Me=Pe.getAttribute("data-comment")||Pe.getAttribute("data-fake-comment");if(String(Me)===String(p)){Pe.setAttribute("data-comment",h),Pe.removeAttribute("data-fake-comment"),$t(Pe,u),d.add(h);return}else return}}const ce=f.value.querySelector(`[data-comment="${h}"]`);if(ce){$t(ce,u),d.add(h);return}const le=document.createElement("span");le.setAttribute("data-comment",h),$t(le,u);try{D.surroundContents(le),c++,d.add(h)}catch{try{const Me=document.createRange();Me.setStart(D.startContainer,D.startOffset),Me.setEnd(D.endContainer,D.endOffset),ul(Me),Me.surroundContents(le),c++,d.add(h)}catch{try{const gt=D.extractContents();le.appendChild(gt),D.insertNode(le),c++,d.add(h)}catch(gt){console.warn("Failed to create comment marker:",gt)}}}}}catch{}}),e.nextTick(()=>{at("restoreCommentsFromModel"),Vt(),Gt.value=!1})}catch{Gt.value=!1}}},ul=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&&!kn(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&&!Bn(c)||a.setEndAfter(u))}else c.nodeType===1&&n.includes(c.tagName)&&d<c.childNodes.length&&a.setEndAfter(c);return a}catch{return a}},kn=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},Bn=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},zt=(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?ul(s):null}}catch{return null}return null},$t=(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")},at=(a="unknown")=>{if(!T.commentUser||!T.richText||!f.value){re.value=[];return}Date.now()-xt.value<Bt&&kt.value!==null||kt.value===null&&(kt.value=requestAnimationFrame(()=>{if(kt.value=null,xt.value=Date.now(),We.value)return;We.value=!0;const s={},i=f.value;if(!i){We.value=!1;return}const c=i.closest(".editor-with-comments");if(!c){We.value=!1;return}const d=i.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],p=new Set;d.forEach(V=>{const ce=V.getAttribute("data-comment")||V.getAttribute("data-fake-comment");ce&&V.tagName==="SPAN"&&(p.has(ce)||(u.push(V),p.add(ce)))}),d.forEach(V=>{const ce=V.getAttribute("data-comment")||V.getAttribute("data-fake-comment");!ce||p.has(ce)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(V.tagName)?V.querySelector(`span[data-comment="${ce}"], span[data-fake-comment="${ce}"]`)||(u.push(V),p.add(ce)):V.tagName!=="SPAN"&&(u.push(V),p.add(ce)))});const h=c.getBoundingClientRect(),k=i.getBoundingClientRect();u.forEach((V,ce)=>{let le=V.getAttribute("data-comment")||V.getAttribute("data-fake-comment");if(!le)return;if(typeof le=="string"&&le.startsWith("comment-")){const on=V.textContent?.trim(),Nt=T.comments?.find(Kl=>(typeof Kl.conversation_id=="string"&&Kl.conversation_id.startsWith("comment-")?null:Kl.conversation_id)&&Kl.selection_text?.trim()===on);Nt?(le=String(Nt.conversation_id),V.setAttribute("data-comment",le),V.removeAttribute("data-fake-comment")):(le=String(Date.now()),V.setAttribute("data-comment",le),V.removeAttribute("data-fake-comment"))}const Pe=V.getBoundingClientRect(),Me=window.getComputedStyle(V),gt=parseFloat(Me.lineHeight)||parseFloat(Me.fontSize)*1.2,nl=Pe.top-k.top+gt/2-15,Ht=k.top-h.top+nl;let ol=null,nn=null,cn=0;const Fl=[],Eo=new Set;if(le&&T.comments){const on=T.comments.find(Nt=>String(Nt.conversation_id||Nt.id)===String(le));if(on){const Nt=on.conversation||[];Nt.length>0?(Nt.forEach(Kl=>{Kl.user&&Kl.user.id&&!Eo.has(Kl.user.id)&&(Eo.add(Kl.user.id),Fl.push(Kl.user))}),cn=Nt.length):(cn=0,ol=null,nn=null),Fl.length>0?ol=Fl[0]:ol=null,Fl.length>1?nn=Fl[1]:nn=null}}const So=Pe.top+gt/2-15,_n=So+30,Vo=5,Fo=_n>k.top+Vo&&So<k.bottom-Vo?1:0;re.value.find(on=>on.id===le);let $n=V;if(!$n&&le&&f.value){const on=String(le);$n=f.value.querySelector(`[data-comment="${on}"], [data-fake-comment="${on}"]`)}const _l=Fl.length;s[le]?(s[le].top=Ht,s[le].opacity=Fo,s[le].element=$n,s[le].firstUser=ol,s[le].secondUser=nn,s[le].totalCount=cn,s[le].uniqueUserCount=_l):s[le]={id:le,top:Ht,opacity:Fo,element:$n,firstUser:ol,secondUser:nn,totalCount:cn,uniqueUserCount:_l}});const D=Object.values(s).map(V=>{const ce=Math.max(0,(V.uniqueUserCount??0)-2);if(!V.element&&V.id&&f.value){const Pe=String(V.id);V.element=f.value.querySelector(`[data-comment="${Pe}"], [data-fake-comment="${Pe}"]`)}return{...V,firstUser:V.firstUser||null,secondUser:V.secondUser||null,totalCount:V.totalCount,additionalCount:ce}});(re.value.length!==D.length||D.some((V,ce)=>{const le=re.value[ce];if(!le)return!0;const Pe=(le.firstUser?.id||null)!==(V.firstUser?.id||null),Me=(le.secondUser?.id||null)!==(V.secondUser?.id||null);return le.id!==V.id||Math.abs(le.top-V.top)>1||le.opacity!==V.opacity||le.totalCount!==V.totalCount||le.additionalCount!==V.additionalCount||Pe||Me||le.element!==V.element}))&&(re.value=D),We.value=!1}))},hl=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&&(Mn(),Rl.value=n,n.classList.add("editor-comment-highlighted"))},Mn=(a=!1)=>{!a&&vl.value!==null&&Rl.value&&(Rl.value.getAttribute("data-comment")||Rl.value.getAttribute("data-fake-comment"))===vl.value||(f.value&&f.value.querySelectorAll(".editor-comment-highlighted").forEach(s=>{s.classList.remove("editor-comment-highlighted")}),Rl.value&&(Rl.value.classList.remove("editor-comment-highlighted"),Rl.value=null))},io=a=>{if(!a||!a.element)return;Mn(!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}"]`;me("comment-marker-clicked",{commentId:n,selector:s,element:a.element})},eo=()=>{Mn()},co=()=>{!T.richText||!f.value||(Re.value&&Re.value.disconnect(),pt.value!==null&&(clearTimeout(pt.value),pt.value=null),Re.value=new MutationObserver(()=>{pt.value===null&&(pt.value=setTimeout(()=>{pt.value=null,e.nextTick(()=>{at("MutationObserver")})},200))}),Re.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"]}),at("setupCommentMarkersObserver-initial"))},Cn=(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(()=>he.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(()=>{Cn(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,rt.value],()=>{we.value==="askAi"||rt.value==="askAi"?e.nextTick(()=>{Ao()}):(he.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}),ee({openCommentOverlayForSelector:Fn,updateCommentMarkers:at,restoreCommentsFromModel:Qt}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container",[{"editor-with-comments":_t.value},Tt.value]]),style:e.normalizeStyle(St.value)},[S.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:n[14]||(n[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Zd,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:ln,title:e.unref(N)("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,Ud),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Il.value}]),onClick:En,title:e.unref(N)("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,Xd),n[61]||(n[61]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Yd,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[0]||(n[0]=s=>lo("paragraph")),title:e.unref(N)("textEditor.toolbar.paragraphFormat")},[E.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:P.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Kd)):E.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:P.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Gd)):E.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:P.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Qd)):E.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:P.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Jd)):E.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:P.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,e1)):E.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:P.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,t1)):(e.openBlock(),e.createElementBlock("svg",l1,[...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,jd),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=>Ll("<h1>"))},[e.createElementVNode("img",{src:P.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,n1),e.createElementVNode("h1",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[2]||(n[2]=s=>Ll("<h2>"))},[e.createElementVNode("img",{src:P.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,o1),e.createElementVNode("h2",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[3]||(n[3]=s=>Ll("<h3>"))},[e.createElementVNode("img",{src:P.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,a1),e.createElementVNode("h3",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[4]||(n[4]=s=>Ll("<h4>"))},[e.createElementVNode("img",{src:P.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,s1),e.createElementVNode("h4",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[5]||(n[5]=s=>Ll("<h5>"))},[e.createElementVNode("img",{src:P.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,r1),e.createElementVNode("h5",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[6]||(n[6]=s=>Ll("<h6>"))},[e.createElementVNode("img",{src:P.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,i1),e.createElementVNode("h6",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[7]||(n[7]=s=>Ll("<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(N)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":At("bold")}]),onClick:n[9]||(n[9]=s=>Xl("bold")),title:e.unref(N)("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,c1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":At("italic")}]),onClick:n[10]||(n[10]=s=>Xl("italic")),title:e.unref(N)("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,u1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":At("underline")}]),onClick:n[11]||(n[11]=s=>Xl("underline")),title:e.unref(N)("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,d1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":qe.value}]),onClick:Hn,title:e.unref(N)("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,m1),n[62]||(n[62]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ye.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:sn,title:e.unref(N)("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,v1)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:Un,title:e.unref(N)("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,p1)),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":At("insertUnorderedList")}]),onClick:Rn,title:e.unref(N)("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,f1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":At("insertOrderedList")}]),onClick:fn,title:e.unref(N)("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,h1),n[64]||(n[64]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Bl,title:e.unref(N)("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,g1),_t.value&&se.value?(e.openBlock(),e.createElementBlock("div",y1)):e.createCommentVNode("",!0),_t.value&&se.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(N)("textEditor.toolbar.comment"),onClick:ct},[...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,k1)):e.createCommentVNode("",!0),S.askAi?(e.openBlock(),e.createElementBlock("div",C1)):e.createCommentVNode("",!0),S.askAi?(e.openBlock(),e.createElementBlock("div",b1,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:n[12]||(n[12]=s=>lo("askAi")),title:e.unref(N)("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",x1,e.toDisplayString(e.unref(N)("textEditor.toolbar.askAi")),1)],8,w1),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",E1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[Dl(s)?(e.openBlock(),e.createElementBlock("div",S1,[e.renderSlot(a.$slots,s)])):e.createCommentVNode("",!0),Dl(s)&&i<S.customToolbarSlots.length-1&&Zn(i)?(e.openBlock(),e.createElementBlock("div",V1)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(we.value==="paragraph"||we.value==="askAi")&&S.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:rl})):e.createCommentVNode("",!0),e.createVNode(ha,{showModal:Se.value,width:"500px",height:"55vh",onCloseModal:so},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(N)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",N1,[e.createElementVNode("div",B1,[e.createElementVNode("label",M1,e.toDisplayString(e.unref(N)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:De,type:"text","onUpdate:modelValue":n[15]||(n[15]=s=>yt.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.link.enterAltText"),onKeyup:e.withKeys(xo,["enter"])},null,40,_1),[[e.vModelText,yt.value]])]),e.createElementVNode("div",$1,[e.createElementVNode("label",L1,e.toDisplayString(e.unref(N)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:st,type:"text","onUpdate:modelValue":n[16]||(n[16]=s=>U.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.link.enterUrl"),onKeyup:e.withKeys(xo,["enter"])},null,40,T1),[[e.vModelText,U.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:so},e.toDisplayString(e.unref(N)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:xo},e.toDisplayString(e.unref(N)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(ha,{showModal:Xt.value,width:"500px",height:"80vh",onCloseModal:cl},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(ht.value?e.unref(N)("textEditor.image.editImage"):e.unref(N)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",A1,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Y.value==="upload"}]),onClick:n[17]||(n[17]=s=>Y.value="upload")},e.toDisplayString(e.unref(N)("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":Y.value==="url"}]),onClick:n[18]||(n[18]=s=>Y.value="url")},e.toDisplayString(e.unref(N)("textEditor.image.imageLink")),3)]),Y.value==="upload"?(e.openBlock(),e.createElementBlock("div",D1,[e.createElementVNode("div",H1,[e.createElementVNode("div",R1,[Wl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",F1,e.toDisplayString(e.unref(N)("textEditor.image.uploadImage")),1)),Wl.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:Ml},[e.createElementVNode("img",{src:dt.value,alt:"Preview",class:"dss-image-preview-image"},null,8,I1),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:ft,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:F},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:ft,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:F},null,544))]),e.createElementVNode("div",z1,[e.createElementVNode("label",P1,e.toDisplayString(e.unref(N)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:tl,type:"text","onUpdate:modelValue":n[19]||(n[19]=s=>be.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.image.enterAltText"),onKeyup:e.withKeys(It,["enter"])},null,40,O1),[[e.vModelText,be.value]])]),e.createElementVNode("div",W1,[e.createElementVNode("label",q1,e.toDisplayString(e.unref(N)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[20]||(n[20]=s=>et.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.image.auto"),onKeyup:e.withKeys(It,["enter"]),onInput:Ol},null,40,Z1),[[e.vModelText,et.value]])]),e.createElementVNode("div",U1,[e.createElementVNode("label",X1,e.toDisplayString(e.unref(N)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[21]||(n[21]=s=>Et.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.image.auto"),onKeyup:e.withKeys(It,["enter"]),onInput:Pn},null,40,Y1),[[e.vModelText,Et.value]])])])])):e.createCommentVNode("",!0),Y.value==="url"?(e.openBlock(),e.createElementBlock("div",j1,[e.createElementVNode("div",K1,[e.createElementVNode("div",G1,[e.createElementVNode("label",Q1,e.toDisplayString(e.unref(N)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:qt,type:"text","onUpdate:modelValue":n[22]||(n[22]=s=>ne.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(It,["enter"])},null,40,J1),[[e.vModelText,ne.value]])]),e.createElementVNode("div",em,[e.createElementVNode("label",tm,e.toDisplayString(e.unref(N)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[23]||(n[23]=s=>be.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.image.enterAltText"),onKeyup:e.withKeys(It,["enter"])},null,40,lm),[[e.vModelText,be.value]])]),e.createElementVNode("div",nm,[e.createElementVNode("label",om,e.toDisplayString(e.unref(N)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[24]||(n[24]=s=>et.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.image.auto"),onKeyup:e.withKeys(It,["enter"]),onInput:Ol},null,40,am),[[e.vModelText,et.value]])]),e.createElementVNode("div",sm,[e.createElementVNode("label",rm,e.toDisplayString(e.unref(N)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[25]||(n[25]=s=>Et.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.image.auto"),onKeyup:e.withKeys(It,["enter"]),onInput:Pn},null,40,im),[[e.vModelText,Et.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:cl},e.toDisplayString(e.unref(N)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:It},e.toDisplayString(e.unref(N)("textEditor.image.save")),1)]),_:1},8,["showModal"]),S.showTitle?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":Zl.value&&sl.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(N)("textEditor.labels.title")),1),e.createElementVNode("div",cm,[sl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",um,[S.title?(e.openBlock(),e.createElementBlock("span",dm,e.toDisplayString(S.title),1)):(e.openBlock(),e.createElementBlock("span",mm,e.toDisplayString(wl.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:Ee,value:S.title,onInput:it,onFocus:He,onBlur:vt,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!sl.value}]),placeholder:wl.value,disabled:S.disabled,rows:"1"},null,42,pm)])],2)):e.createCommentVNode("",!0),S.showTitle&&Zl.value&&sl.value?(e.openBlock(),e.createElementBlock("div",vm,[e.renderSlot(a.$slots,"title-slot")])):e.createCommentVNode("",!0),S.showDescription?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":en.value&&M.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(N)("textEditor.labels.description")),1),e.createElementVNode("div",fm,[M.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",hm,[S.description?(e.openBlock(),e.createElementBlock("span",gm,e.toDisplayString(S.description),1)):(e.openBlock(),e.createElementBlock("span",ym,e.toDisplayString(Al.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:je,value:S.description,onInput:Dt,onFocus:yl,onBlur:xl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!M.value}]),placeholder:Al.value,disabled:S.disabled,rows:"1"},null,42,km)])],2)):e.createCommentVNode("",!0),S.showDescription&&en.value&&M.value?(e.openBlock(),e.createElementBlock("div",Cm,[e.renderSlot(a.$slots,"description-slot")])):e.createCommentVNode("",!0),_t.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:6},e.renderList(re.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":vl.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=>hl(s),onMouseleave:eo},[s.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(i=>io(s),["stop"])},[s.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.firstUser.avatar,alt:s.firstUser.name||"avatar"},null,8,xm)):(e.openBlock(),e.createElementBlock("span",Em,e.toDisplayString(s.firstUser.initials||(s.firstUser.name?s.firstUser.name.charAt(0):"")),1))],8,wm)):e.createCommentVNode("",!0),s.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(i=>io(s),["stop"])},[s.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.secondUser.avatar,alt:s.secondUser.name||"avatar"},null,8,Vm)):(e.openBlock(),e.createElementBlock("span",Nm,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=>io(s),["stop"])},[e.createElementVNode("span",Mm,"+"+e.toDisplayString(s.additionalCount),1)],12,Bm)):e.createCommentVNode("",!0)],46,bm))),128)):e.createCommentVNode("",!0),S.richText?(e.openBlock(),e.createElementBlock("div",Hm,[e.createElementVNode("div",{ref_key:"editorRef",ref:f,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":S.disabled,"dss-text-editor-fixed-height":S.fixedHeight}]),style:e.normalizeStyle(Jl.value),onInput:Vt,onBlur:xn,onClick:ta,onMouseup:ko,onKeyup:ko,onKeydown:Ko,onPaste:Go,onMousemove:la,onMouseleave:na},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[_t.value&&vl.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(y.value)},[O.value||tt.value.length>0?(e.openBlock(),e.createElementBlock("div",Rm,[e.createElementVNode("div",Fm,[O.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:O.value},null,8,Im)):e.createCommentVNode("",!0)]),e.createElementVNode("div",zm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tt.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",Pm,[e.createElementVNode("div",Om,[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",qm,e.toDisplayString(s.user.initials||(s.user.name?s.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Zm,[e.createElementVNode("div",Um,[e.createElementVNode("div",Xm,e.toDisplayString(s.user&&s.user.name||"Comment"),1),s.createdAt?(e.openBlock(),e.createElementBlock("div",Ym,e.toDisplayString(A(new Date(s.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":I(s.text)||s.class==="comment-started"}])},e.toDisplayString(s.text||""),3)]),T.commentUser&&s.user&&s.user.id===T.commentUser.id&&!I(s.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>fl(s,i),["stop"]),title:e.unref(N)("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,jm)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Km,[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(N)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(oe,["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,Gm),[[e.vModelText,g.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(oe,["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",Qm,[e.createElementVNode("div",Jm,[e.createElementVNode("span",e2,e.toDisplayString(pl.value)+" "+e.toDisplayString(pl.value===1?e.unref(N)("textEditor.footer.word"):e.unref(N)("textEditor.footer.words")),1),n[70]||(n[70]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",t2,e.toDisplayString(an.value)+" "+e.toDisplayString(an.value===1?e.unref(N)("textEditor.footer.character"):e.unref(N)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",_m,[e.createElementVNode("textarea",{value:S.modelValue,onInput:L,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":S.fixedHeight}]),placeholder:dn.value,rows:S.rows,disabled:S.disabled,style:e.normalizeStyle(gl.value)},null,46,$m),e.createElementVNode("div",Lm,[e.createElementVNode("div",Tm,[e.createElementVNode("span",Am,e.toDisplayString(pl.value)+" "+e.toDisplayString(pl.value===1?e.unref(N)("textEditor.footer.word"):e.unref(N)("textEditor.footer.words")),1),n[67]||(n[67]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Dm,e.toDisplayString(an.value)+" "+e.toDisplayString(an.value===1?e.unref(N)("textEditor.footer.character"):e.unref(N)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[j.value&&ge.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(_e.value),onMouseenter:n[28]||(n[28]=s=>ue.value=!0),onMouseleave:Gn},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(wo,["stop"]),title:ge.value},e.toDisplayString(ge.value),9,l2),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Ro,["stop"]),title:e.unref(N)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",o2,[...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,n2)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[wt.value&&Yt.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(fe.value),onMouseenter:n[29]||(n[29]=s=>H.value=!0),onMouseleave:Qn},[e.createElementVNode("div",a2,[Yt.value===e.unref(N)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",s2,[...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:Yt.value},e.toDisplayString(Yt.value),9,r2)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(El,["stop"]),title:e.unref(N)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",c2,[...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,i2)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[S.floatingToolbar&&S.richText&&Be.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:Ge,class:"dss-floating-toolbar",style:e.normalizeStyle(Je.value),onMousedown:n[44]||(n[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",u2,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(ln,["stop"]),title:e.unref(N)("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,d2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Il.value}]),onClick:e.withModifiers(En,["stop"]),title:e.unref(N)("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,m2),n[89]||(n[89]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",p2,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[30]||(n[30]=e.withModifiers(s=>Co("paragraph"),["stop"])),title:e.unref(N)("textEditor.toolbar.paragraphFormat")},[E.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:P.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,f2)):E.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:P.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,h2)):E.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:P.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,g2)):E.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:P.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,y2)):E.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:P.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,k2)):E.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:P.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,C2)):(e.openBlock(),e.createElementBlock("svg",b2,[...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,v2),rt.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=>jl("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[32]||(n[32]=s=>jl("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[33]||(n[33]=s=>jl("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[34]||(n[34]=s=>jl("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[35]||(n[35]=s=>jl("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[36]||(n[36]=s=>jl("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[37]||(n[37]=s=>jl("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(N)("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":At("bold")}]),onClick:n[39]||(n[39]=e.withModifiers(s=>Xl("bold"),["stop"])),title:e.unref(N)("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,w2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":At("italic")}]),onClick:n[40]||(n[40]=e.withModifiers(s=>Xl("italic"),["stop"])),title:e.unref(N)("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,x2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":At("underline")}]),onClick:n[41]||(n[41]=e.withModifiers(s=>Xl("underline"),["stop"])),title:e.unref(N)("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,E2),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":qe.value}]),onClick:e.withModifiers(Hn,["stop"]),title:e.unref(N)("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)),ye.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(sn,["stop"]),title:e.unref(N)("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,N2)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(Un,["stop"]),title:e.unref(N)("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,V2)),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":At("insertUnorderedList")}]),onClick:e.withModifiers(Rn,["stop"]),title:e.unref(N)("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,B2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":At("insertOrderedList")}]),onClick:e.withModifiers(fn,["stop"]),title:e.unref(N)("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,M2),n[94]||(n[94]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Bl,["stop"]),title:e.unref(N)("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,_2),_t.value?(e.openBlock(),e.createElementBlock("div",$2)):e.createCommentVNode("",!0),_t.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(N)("textEditor.toolbar.comment"),onClick:e.withModifiers(ct,["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,L2)):e.createCommentVNode("",!0),S.askAi?(e.openBlock(),e.createElementBlock("div",T2)):e.createCommentVNode("",!0),S.askAi?(e.openBlock(),e.createElementBlock("div",A2,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:n[42]||(n[42]=e.withModifiers(s=>Co("askAi"),["stop"])),title:e.unref(N)("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",H2,e.toDisplayString(e.unref(N)("textEditor.toolbar.askAi")),1)],8,D2),rt.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",R2,[S.askAi&&wn.value?(e.openBlock(),e.createElementBlock("div",F2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[Dl(s)&&mn(s)?(e.openBlock(),e.createElementBlock("div",I2,[e.renderSlot(a.$slots,s)])):e.createCommentVNode("",!0),Dl(s)&&mn(s)&&i<S.customToolbarSlots.length-1&&ql(i)?(e.openBlock(),e.createElementBlock("div",z2)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),W2={class:"dss-color-picker__section-title"},q2={class:"dss-color-picker__presets-row"},Z2=["title","onClick"],U2={key:1,class:"dss-color-picker__section"},X2={class:"dss-color-picker__presets-row"},Y2=["title","onClick"],j2={key:2,class:"dss-color-picker__section"},K2={class:"dss-color-picker__section-header"},G2={class:"dss-color-picker__presets-row"},Q2=["title","onClick"],J2=["onClick"],ep={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},tp=["title","onClick"],lp={class:"dss-color-picker__input-row"},np=["value"],op={__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(S,{emit:ee}){function $(ie){const X=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(ie);if(!X)return{h:0,s:0,l:50};const Q=parseInt(X[1],16)/255,ae=parseInt(X[2],16)/255,Ee=parseInt(X[3],16)/255,je=Math.max(Q,ae,Ee),bt=Math.min(Q,ae,Ee);let Zt=0,lt=0;const sl=(je+bt)/2;if(je!==bt){const M=je-bt;switch(lt=sl>.5?M/(2-je-bt):M/(je+bt),je){case Q:Zt=((ae-Ee)/M+(ae<Ee?6:0))/6;break;case ae:Zt=((Ee-Q)/M+2)/6;break;case Ee:Zt=((Q-ae)/M+4)/6;break}}return{h:Zt*360,s:lt*100,l:sl*100}}function N(ie,X,Q){X/=100,Q/=100;const ae=X*Math.min(Q,1-Q),Ee=je=>{const bt=(je+ie/30)%12,Zt=Q-ae*Math.max(Math.min(bt-3,9-bt,1),-1);return Math.round(255*Zt).toString(16).padStart(2,"0")};return`#${Ee(0)}${Ee(8)}${Ee(4)}`}function de(ie){const X=ie.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!X)return null;let Q=X[1];return Q.length===3&&(Q=Q.split("").map(ae=>ae+ae).join("")),"#"+Q}function P(ie){const X=ie.match(/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})(?:[\s,\/]+[\d.]+)?\s*\)$/i);if(!X)return null;const Q=Math.max(0,Math.min(255,Number.parseInt(X[1],10))),ae=Math.max(0,Math.min(255,Number.parseInt(X[2],10))),Ee=Math.max(0,Math.min(255,Number.parseInt(X[3],10)));return`#${Q.toString(16).padStart(2,"0")}${ae.toString(16).padStart(2,"0")}${Ee.toString(16).padStart(2,"0")}`}function T(ie){if(typeof ie!="string")return null;const X=ie.trim();return de(X)||P(X)}function me(ie,X,Q){X/=100,Q/=100;const ae=Q+X*Math.min(Q,1-Q),Ee=ae===0?0:2-2*Q/ae;return{h:ie,s:Ee*100,v:ae*100}}function ut(ie,X,Q){X/=100,Q/=100;const ae=Q*(1-X/2),Ee=ae===0||ae===1?0:(Q-ae)/Math.min(ae,1-ae);return{h:ie,s:Ee*100,l:ae*100}}const te=S,f=ee,we=e.ref(!1),ye=e.ref(!1),J=e.ref(!1),j=e.ref(-1),ge=e.ref(-1),_e=e.ref(null),ue=e.ref(null),Se=e.ref(null),U=e.ref(null),yt=e.ref({top:0,left:0}),st=e.ref($(te.modelValue||"#b8a5de")),De=e.computed(()=>Array.isArray(te.presetGroups)&&te.presetGroups.length>0),Ue=e.computed(()=>!te.disableCustomColors),Z=e.computed(()=>De.value?0:te.initialPresetCount!=null?te.initialPresetCount:ge.value<0?null:ge.value),Te=e.computed(()=>{const ie=Z.value;return ie==null?!0:Math.max(0,te.presetColors.length-ie)<te.max}),qe=e.computed(()=>!!(ye.value||j.value>=0||!ke.value&&te.presetColors.length===0));e.computed(()=>{const ie=Z.value;return ie!=null&&te.presetColors.length>ie});const ke=e.computed(()=>De.value||Z.value!=null),Be=e.computed(()=>{const ie=Z.value;return ie==null?[]:te.presetColors.slice(0,ie)}),Je=e.computed(()=>{const ie=Z.value;return ie==null?[]:te.presetColors.slice(ie)});function Ge(ie){const X=Z.value;return X!=null?X+ie:-1}function rt(ie){const X=Z.value;return X!=null&&ie>=X}function Xt(ie){rt(ie)&&(j.value=ie,st.value=$(te.presetColors[ie]),ye.value=!0,e.nextTick(()=>U.value?.focus()))}function be(ie){if(!rt(ie))return;const X=te.presetColors.filter((Ee,je)=>je!==ie);f("update:presetColors",X);const Q=de(te.modelValue),ae=de(te.presetColors[ie]);if(Q&&ae&&Q.toLowerCase()===ae.toLowerCase()){const Ee=X[Math.max(0,ie-1)]||X[0];Ee&&f("update:modelValue",Ee)}}function Wt(){J.value=!J.value,J.value||(j.value=-1,ye.value=!1)}function dt(){if(!Ue.value||j.value<0)return;const ie=ft.value,X=de(ie);if(X){const Q=[...te.presetColors];Q[j.value]=X,f("update:presetColors",Q),f("update:modelValue",X),j.value=-1,ye.value=!1}}function et(){te.disabled||!Ue.value||(j.value=-1,ye.value=!ye.value,ye.value&&(H(),e.nextTick(()=>U.value?.focus())))}function Et(ie){const X=T(ie),Q=T(te.modelValue);return X&&Q&&X.toLowerCase()===Q.toLowerCase()}function tl(){if(te.disabled||!Ue.value||!Te.value)return;const ie=ft.value,X=de(ie);if(X){const Q=[...te.presetColors,X];f("update:presetColors",Q),f("update:modelValue",X);const ae=Z.value??ge.value;ae>=0&&Q.length-ae>=te.max&&(ye.value=!1)}}const ft=e.computed(()=>{const{h:ie,s:X,l:Q}=st.value;return N(ie,X,Q)}),qt=e.computed(()=>ft.value.toLowerCase()),ht=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${st.value.h}, 100%, 50%))`})),Jt=e.computed(()=>{const ie=me(st.value.h,st.value.s,st.value.l);return{left:`${ie.s}%`,bottom:`${ie.v}%`,transform:"translate(-50%, 50%)"}}),wt=e.computed(()=>({left:`${st.value.h/360*100}%`,transform:"translateX(-50%)"})),Yt=e.computed(()=>({position:"fixed",left:`${yt.value.left}px`,top:`${yt.value.top}px`,zIndex:1002}));function fe(){if(!_e.value||!we.value)return;const ie=_e.value.getBoundingClientRect(),X=window.innerHeight||document.documentElement.clientHeight;let Q=ie.bottom+4;const ae=ue.value;ae&&Q+ae.offsetHeight>X-8&&(Q=ie.top-4-ae.offsetHeight),yt.value={top:Q,left:ie.left}}function H(){const ie=te.modelValue||"#b8a5de",X=T(ie);X&&(st.value=$(X))}function Y(){f("update:modelValue",ft.value)}function ne(){te.disabled||(we.value=!we.value,we.value&&(H(),e.nextTick(()=>{fe(),U.value?.focus()})))}function he(){const ie=ft.value,X=de(ie);if(X){if(j.value>=0){const Q=[...te.presetColors];Q[j.value]=X,f("update:presetColors",Q),f("update:modelValue",X)}else if(Ue.value&&(te.presetColors.length>0||De.value)&&ye.value&&Te.value&&!te.presetColors.some(ae=>de(ae)?.toLowerCase()===X.toLowerCase())){const ae=[...te.presetColors,X];f("update:presetColors",ae),f("update:modelValue",X)}}we.value=!1,ye.value=!1,J.value=!1,j.value=-1}function Xe(ie){if(!Se.value)return;const X=Se.value.getBoundingClientRect(),Q=ae=>{const Ee=Math.max(0,Math.min(1,(ae.clientX-X.left)/X.width)),je=Math.max(0,Math.min(1,1-(ae.clientY-X.top)/X.height)),bt={h:st.value.h,s:Ee*100,v:je*100};st.value=ut(bt.h,bt.s,bt.v)};Q(ie),document.addEventListener("mousemove",Q),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",Q),Y()},{once:!0})}function Ke(ie){if(!ie.currentTarget)return;const Q=ie.currentTarget.getBoundingClientRect(),ae=Ee=>{const je=Math.max(0,Math.min(1,(Ee.clientX-Q.left)/Q.width));st.value={...st.value,h:je*360}};ae(ie),document.addEventListener("mousemove",ae),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",ae),Y()},{once:!0})}function Lt(ie){const X=ie.target.value,Q=T(X);Q&&(st.value=$(Q),f("update:modelValue",Q))}function $e(ie){if(te.disabled)return;const X=T(ie);X&&(st.value=$(X),f("update:modelValue",X))}let Qe=null,Ct=null;function el(){Qe&&(document.removeEventListener("keydown",Qe),Qe=null),Ct&&(window.removeEventListener("resize",Ct),Ct=null)}return e.watch(we,ie=>{if(el(),ie){if(!De.value&&te.initialPresetCount==null){const X=te.presetColors.length;X>0&&(ge.value<0||X<ge.value)&&(ge.value=X)}Qe=X=>{X.key==="Escape"&&he()},Ct=fe,document.addEventListener("keydown",Qe),window.addEventListener("resize",Ct)}}),e.watch(()=>te.modelValue,()=>{we.value&&H()},{immediate:!1}),e.watch(Je,ie=>{ie.length===0&&(J.value=!1,j.value=-1,ye.value=!1)}),e.onBeforeUnmount(el),(ie,X)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":S.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:_e,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":we.value}]),onClick:ne},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:ft.value})},[...X[0]||(X[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(he,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:ue,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Yt.value)},[ke.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[De.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(S.presetGroups,(Q,ae)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+ae,class:"dss-color-picker__section"},[e.createElementVNode("span",W2,e.toDisplayString(Q.title),1),e.createElementVNode("div",q2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.colors,(Ee,je)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+ae+"-"+je,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Et(Ee)}]),style:e.normalizeStyle({backgroundColor:Ee,"--dss-preset-color":Ee}),title:Ee,onClick:e.withModifiers(bt=>$e(Ee),["stop"])},null,14,Z2))),128))])]))),128)):Be.value.length?(e.openBlock(),e.createElementBlock("div",U2,[X[1]||(X[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",X2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Be.value,(Q,ae)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+ae,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Et(Q)}]),style:e.normalizeStyle({backgroundColor:Q,"--dss-preset-color":Q}),title:Q,onClick:e.withModifiers(Ee=>$e(Q),["stop"])},null,14,Y2))),128))])])):e.createCommentVNode("",!0),Ue.value?(e.openBlock(),e.createElementBlock("div",j2,[e.createElementVNode("div",K2,[X[3]||(X[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),Je.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"])},[...X[2]||(X[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",G2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Je.value,(Q,ae)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+ae,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&&Et(Q),"dss-color-picker__preset-bubble--editing":J.value&&j.value===Ge(ae)}]),style:e.normalizeStyle({backgroundColor:j.value===Ge(ae)?ft.value:Q,"--dss-preset-color":j.value===Ge(ae)?ft.value:Q}),title:j.value===Ge(ae)?ft.value:Q,onClick:e.withModifiers(Ee=>J.value?Xt(Ge(ae)):$e(Q),["stop"])},null,14,Q2),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(Ee=>be(Ge(ae)),["stop"])},[...X[4]||(X[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,J2)):e.createCommentVNode("",!0)],2))),128)),Te.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ye.value}]),onClick:e.withModifiers(et,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],64)):S.presetColors.length?(e.openBlock(),e.createElementBlock("div",ep,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.presetColors,(Q,ae)=>(e.openBlock(),e.createElementBlock("button",{key:ae,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Et(Q)}]),style:e.normalizeStyle({backgroundColor:Q,"--dss-preset-color":Q}),title:Q,onClick:e.withModifiers(Ee=>$e(Q),["stop"])},null,14,tp))),128)),Ue.value&&Te.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ye.value}]),onClick:e.withModifiers(et,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),qe.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:Se,onMousedown:Xe},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(ht.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(Jt.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:Ke},[X[5]||(X[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(wt.value)},null,4)],32),e.createElementVNode("div",lp,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:U,type:"text",class:"dss-color-picker__hex-input",value:qt.value,onInput:Lt},null,40,np)]),Ue.value&&ke.value&&(S.presetColors.length||De.value)&&Te.value&&j.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:tl}," Save color ")):e.createCommentVNode("",!0),Ue.value&&ke.value&&j.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:dt}," Save color ")):e.createCommentVNode("",!0),ke.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:he}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},ap={key:0,class:"dss-loader"},sp={key:0,class:"dss-loader-label"},rp={key:1,class:"dss-loader"},ip={key:0,class:"dss-loader-label"},cp={key:2,class:"dss-loader"},up={key:0,class:"dss-loader-label"},dp={key:3,class:"dss-loader"},mp={key:0,class:"dss-loader-label"},pp={key:4,class:"dss-loader"},vp={key:0,class:"dss-loader-label"},fp={key:5,class:"dss-loader dss-loader--inline"},hp={class:"dss-loader-inline-text"},gp={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""}},setup(S){const ee=S,$=e.computed(()=>ee.size==="small"?"dss-loaders--size-small":ee.size==="large"?"dss-loaders--size-large":ee.size==="medium"||ee.size==null?"dss-loaders--size-medium":null),N=e.computed(()=>{const de={};if(!(ee.size==="small"||ee.size==="medium"||ee.size==="large"||ee.size==null)){const P=typeof ee.size=="number"?`${ee.size}px`:String(ee.size);de["--dss-loader-size"]=P}return ee.color&&(de["--dss-loader-accent"]=ee.color,de["--dss-loader-accent-soft"]=`color-mix(in srgb, ${ee.color} 30%, white)`),de});return(de,P)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",$.value]),style:e.normalizeStyle(N.value)},[S.type==="spinner"?(e.openBlock(),e.createElementBlock("div",ap,[P[0]||(P[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),S.label?(e.openBlock(),e.createElementBlock("span",sp,e.toDisplayString(S.label),1)):e.createCommentVNode("",!0)])):S.type==="dots"?(e.openBlock(),e.createElementBlock("div",rp,[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)),S.label?(e.openBlock(),e.createElementBlock("span",ip,e.toDisplayString(S.label),1)):e.createCommentVNode("",!0)])):S.type==="battery"?(e.openBlock(),e.createElementBlock("div",cp,[P[2]||(P[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),S.label?(e.openBlock(),e.createElementBlock("span",up,e.toDisplayString(S.label),1)):e.createCommentVNode("",!0)])):S.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",dp,[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)),S.label?(e.openBlock(),e.createElementBlock("span",mp,e.toDisplayString(S.label),1)):e.createCommentVNode("",!0)])):S.type==="bars"?(e.openBlock(),e.createElementBlock("div",pp,[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)),S.label?(e.openBlock(),e.createElementBlock("span",vp,e.toDisplayString(S.label),1)):e.createCommentVNode("",!0)])):S.type==="inline"?(e.openBlock(),e.createElementBlock("div",fp,[P[5]||(P[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",hp,[e.renderSlot(de.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(S.label),1)])])])):e.createCommentVNode("",!0)],6))}},Ha="dss-skeleton-item",yp={__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:S=>["single","multiple"].includes(S)},targetClass:{type:String,default:Ha},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(S){const ee=S,$=e.computed(()=>{const P={"dss-skeleton--loading":ee.loading,"dss-skeleton--static":!ee.shimmer,"dss-skeleton--multiple":ee.mode==="multiple","dss-skeleton--dark":ee.darkMode};return ee.mode==="multiple"&&ee.targetClass!==Ha&&(P[`dss-skeleton--target-${ee.targetClass}`]=!0),P}),N=e.computed(()=>{const P={};return ee.borderRadius&&(P.borderRadius=ee.borderRadius),P}),de=e.computed(()=>{const P={};return ee.borderRadius&&(P["--dss-skeleton-border-radius"]=ee.borderRadius),ee.darkMode?(P["--dss-skeleton-bg"]=ee.bgDark||"#322c3f",P["--dss-skeleton-shimmer"]=ee.shimmerDark||"#3e3f41",P):(ee.bgColor&&(P["--dss-skeleton-bg"]=ee.bgColor),ee.shimmerColor&&(P["--dss-skeleton-shimmer"]=ee.shimmerColor),P)});return(P,T)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",$.value]),style:e.normalizeStyle(de.value)},[S.loading&&S.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(N.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":S.loading&&S.mode==="single"}])},[e.renderSlot(P.$slots,"default")],2)],6))}},kp={key:0,class:"dss-dnd-column-header"},Cp={class:"dss-dnd-column-title"},bp={class:"dss-dnd-column-count"},wp=["data-column"],xp={key:0,class:"dss-dnd-indicator"},Ep=["onPointerdown"],Sp=["onPointerdown"],Vp={class:"dss-dnd-item-content"},Np={class:"dss-dnd-item-default"},Bp={key:0,class:"dss-dnd-empty"},Mp={name:"DSSDnd"},_p=Object.assign(Mp,{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(S,{emit:ee}){const $=S,N=ee,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},me=e.computed(()=>({...T,...$.options})),ut=e.computed(()=>({"--dss-dnd-col-min-w":me.value.columnMinWidth,"--dss-dnd-col-max-w":me.value.columnMaxWidth,"--dss-dnd-col-gap":me.value.columnGap,"--dss-dnd-indicator-color":me.value.indicatorColor,"--dss-dnd-body-max-h":me.value.columnBodyMaxHeight}));function te(fe){if(!me.value.ColColor||!fe)return{};const H=fe.background||fe.color;return H?{background:H}:{}}const f=e.ref(null),we=e.ref(null),ye=e.ref(!1),J=e.ref(-1),j=e.ref(null);let ge=null,_e=null,ue=null,Se=null,U=0,yt=0,st="",De=null;const Ue=5,Z=e.computed(()=>{const fe={};for(const H of $.columns)fe[H.value]=$.items.filter(Y=>Y[$.columnKey]===H.value).sort((Y,ne)=>(Y[$.positionKey]??0)-(ne[$.positionKey]??0));return fe}),Te=e.computed(()=>{const fe={},H=!!f.value,Y=f.value?.[$.itemKey],ne=we.value,he=J.value;for(const Xe of $.columns){const Ke=Z.value[Xe.value]||[],Lt=[],$e=ne==Xe.value;let Qe=0;for(let Ct=0;Ct<Ke.length;Ct++){const el=Ke[Ct],ie=H&&el[$.itemKey]===Y;!ie&&$e&&he===Qe&&Lt.push({type:"indicator",key:`ind-${Qe}`}),ie||Qe++,Lt.push({type:"item",item:el,isDragged:ie,key:`item-${el[$.itemKey]}`})}$e&&he>=Qe&&Lt.push({type:"indicator",key:"ind-end"}),fe[Xe.value]=Lt}return fe});function qe(fe,H){const ne=(Z.value[fe]||[]).filter(Ke=>Ke[$.itemKey]!==f.value?.[$.itemKey]);if(ne.length===0)return 1;if(H<=0){const Ke=ne[0][$.positionKey];return Ke!=null&&Ke>0?Ke/2:.5}if(H>=ne.length){const Ke=ne[ne.length-1][$.positionKey];return(Ke??0)+1}const he=ne[H-1][$.positionKey]??0,Xe=ne[H][$.positionKey]??0;return(he+Xe)/2}function ke(fe,H,Y){ue&&ue.remove();const ne=fe.getBoundingClientRect(),he=fe.cloneNode(!0);he.classList.add("dss-dnd-ghost"),he.style.cssText=`
106
106
  position: fixed;
107
107
  left: ${H-U}px;
108
108
  top: ${Y-yt}px;
@@ -116,5 +116,5 @@
116
116
  background-color: ${me.value.dragSourceBackground};
117
117
  font-family: 'Work Sans', sans-serif;
118
118
  cursor: grabbing;
119
- `,document.body.appendChild(he),ue=he}function Be(fe,H){ue&&(ue.style.left=`${fe-U}px`,ue.style.top=`${H-yt}px`)}function Je(fe){fe.classList.add("dss-dnd-item--dragging"),fe.style.background=me.value.dragSourceBackground,fe.style.borderColor=me.value.dragSourceBorder,fe.style.transform="scale(0.97)"}function Ge(fe){fe.classList.remove("dss-dnd-item--dragging"),fe.style.background="",fe.style.borderColor="",fe.style.transform=""}function rt(fe,H){return document.elementFromPoint(fe,H)?.closest(".dss-dnd-column-body")??null}function Yt(fe,H){return!!document.elementFromPoint(fe,H)?.closest("[data-dss-dnd-delete-zone]")}function we(fe,H){if(P.value&&Yt(fe,H)){ye.value=!0,be.value=null,J.value=-1;return}ye.value=!1;const Y=rt(fe,H),ne=Y?.getAttribute("data-column")??null;if(!ne){be.value=null,J.value=-1;return}be.value=ne;const he=Y.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let Xe=he.length;for(let Ke=0;Ke<he.length;Ke++){const Lt=he[Ke].getBoundingClientRect();if(H<Lt.top+Lt.height/2){Xe=Ke;break}}J.value=Xe}function qt(fe){fe.preventDefault(),Be(fe.clientX,fe.clientY),!ge&&(ge=requestAnimationFrame(()=>{ge=null,we(fe.clientX,fe.clientY)}))}function dt(fe){window.removeEventListener("pointermove",qt),window.removeEventListener("pointerup",dt),window.removeEventListener("pointercancel",dt),Se?.releasePointerCapture?.(fe.pointerId),Ge(Se),Se=null;const H=P.value&&Yt(fe.clientX,fe.clientY);if(f.value&&H)N("delete",{item:f.value});else{const ne=rt(fe.clientX,fe.clientY)?.getAttribute("data-column")??null;if(f.value&&ne){const he=f.value[$.columnKey],Xe=ne,Lt=(Z.value[Xe]||[]).filter(el=>el[$.itemKey]!==f.value[$.itemKey]),$e=Math.max(0,Math.min(J.value,Lt.length)),Qe=qe(Xe,$e),Ct=f.value[$.itemKey];N("move",{item:f.value,from:he,to:Xe,position:Qe,index:$e}),_e&&clearTimeout(_e),j.value={id:Ct,from:he,to:Xe},_e=setTimeout(()=>{j.value=null},3500)}}ue&&(ue.remove(),ue=null),st!==null&&(document.body.style.cursor=st,st=""),jt()}function et(fe,H){fe.preventDefault();const Y=fe.target.closest(".dss-dnd-item");if(!Y)return;const ne=Y.getBoundingClientRect();U=fe.clientX-ne.left,yt=fe.clientY-ne.top,st=document.body.style.cursor,document.body.style.cursor="grabbing",f.value=H,Se=Y,ke(Y,fe.clientX,fe.clientY),requestAnimationFrame(()=>Je(Y)),Y.setPointerCapture?.(fe.pointerId),window.addEventListener("pointermove",qt),window.addEventListener("pointerup",dt,{once:!0}),window.addEventListener("pointercancel",dt,{once:!0})}function Et(){De&&(window.removeEventListener("pointermove",tl),window.removeEventListener("pointerup",ft),window.removeEventListener("pointercancel",ft),De=null)}function tl(fe){if(!De||fe.pointerId!==De.pointerId)return;const H=fe.clientX-De.startX,Y=fe.clientY-De.startY;if(Math.abs(H)>=Ue||Math.abs(Y)>=Ue){const ne=De.item;Et(),et(fe,ne)}}function ft(fe){!De||fe.pointerId!==De.pointerId||Et()}function Zt(fe,H){Et(),De={item:H,startX:fe.clientX,startY:fe.clientY,pointerId:fe.pointerId},window.addEventListener("pointermove",tl),window.addEventListener("pointerup",ft),window.addEventListener("pointercancel",ft)}function ht(fe,H){me.value.useHandle||Zt(fe,H)}function Jt(fe,H){Zt(fe,H)}function wt(){ge&&(cancelAnimationFrame(ge),ge=null)}function jt(){wt(),f.value=null,be.value=null,ye.value=!1,J.value=-1}return e.onBeforeUnmount(()=>{wt(),Et(),_e&&clearTimeout(_e),ue&&(ue.remove(),ue=null)}),(fe,H)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":me.value.unstyled}]),style:e.normalizeStyle(ut.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":ye.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(fe.$slots,"delete-zone",{isDragging:!!f.value,isOver:ye.value})],2),[[e.vShow,!!f.value||me.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.columns,Y=>(e.openBlock(),e.createElementBlock("div",{key:Y.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":be.value==Y.value},Y.class||""]]),style:e.normalizeStyle(te(Y))},[me.value.showHeader?(e.openBlock(),e.createElementBlock("div",kp,[e.renderSlot(fe.$slots,"column-header",{column:Y,items:Z.value[Y.value]||[]},()=>[e.createElementVNode("span",Cp,e.toDisplayString(Y.title||Y.value),1),e.createElementVNode("span",bp,e.toDisplayString((Z.value[Y.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":Y.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Te.value[Y.value],ne=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ne.key},[ne.type==="indicator"?(e.openBlock(),e.createElementBlock("div",xp)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":ne.isDragged,"dss-dnd-item--no-handle":!me.value.useHandle}]),onPointerdown:he=>ht(he,ne.item)},[me.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(he=>Jt(he,ne.item),["stop"])},[e.renderSlot(fe.$slots,"handle",{},()=>[H[0]||(H[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,Sp)):e.createCommentVNode("",!0),e.createElementVNode("div",Vp,[e.renderSlot(fe.$slots,"item",{item:ne.item,column:Y,justDropped:j.value?.id===ne.item[S.itemKey],droppedFrom:j.value?.id===ne.item[S.itemKey]?j.value.from:null,droppedTo:j.value?.id===ne.item[S.itemKey]?j.value.to:null},()=>[e.createElementVNode("div",Np,e.toDisplayString(ne.item[S.itemKey]),1)])])],42,Ep))],64))),128)),(Z.value[Y.value]||[]).length===0&&be.value!=Y.value?(e.openBlock(),e.createElementBlock("div",Bp,[e.renderSlot(fe.$slots,"empty",{column:Y},()=>[H[1]||(H[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,wp)],6))),128))],6))}}),$p={name:"DSSConfetti"},Lp=Object.assign($p,{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(S){const ee=S,$=e.ref(null),N=e.ref(!1);let de=[],P=null,T=null;function me(J,j){const ge=[];for(let _e=0;_e<ee.count;_e++)ge.push(ut(J));return ge}function ut(J,j){return{x:Math.random()*J,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:ee.colors[Math.floor(Math.random()*ee.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,j,ge,_e){J.clearRect(0,0,j,ge);for(const ue of de)J.save(),J.globalAlpha=ue.opacity*_e,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 f(J,j,ge){const _e=.3+ge*.7;for(let ue=0;ue<de.length;ue++){const Se=de[ue];Se.tiltAngle+=Se.tiltInc,Se.y+=Se.speed*_e,Se.x+=Math.sin(Se.d)*.5*_e,Se.tilt=Math.sin(Se.tiltAngle)*15,ge>=.99&&Se.y>j+20&&(de[ue]=ut(J))}}function be(){N.value=!0,e.nextTick(()=>{const J=$.value;if(!J)return;const j=J.getContext("2d"),ge=J.parentElement;if(!ge)return;const _e=ge.getBoundingClientRect();J.width=_e.width,J.height=_e.height,de=me(J.width,J.height);const ue=Date.now(),Se=ue+ee.duration,U=()=>{const yt=Date.now(),st=yt-ue;if(yt<Se){let De=1;st>ee.fadeStart&&(De=1-(st-ee.fadeStart)/(ee.duration-ee.fadeStart)),te(j,J.width,J.height,De),f(J.width,J.height,De),P=requestAnimationFrame(U)}else ye()};U()})}function ye(){P&&(cancelAnimationFrame(P),P=null),de=[],N.value=!1}return e.watch(()=>ee.trigger,J=>{J&&(T&&clearTimeout(T),T=setTimeout(be,ee.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{ye(),T&&clearTimeout(T)}),(J,j)=>N.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:$,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),Tp={class:"dss-filter-global-inner"},Ap=["placeholder","value"],Dp=["title"],Hp={key:0,class:"dss-filter-funnel-badge"},Rp={key:1,class:"dss-filter-sortby"},Fp=["value"],Ip=["value"],zp=["disabled","title"],Pp={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"},Op={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"},Wp={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"},qp={class:"dss-filter-panel"},Zp={key:0,class:"dss-filter-empty"},Up={class:"dss-filter-row-prefix"},Xp={class:"dss-filter-cell"},Yp=["onClick"],jp={class:"dss-filter-trigger-text"},Kp=["placeholder"],Gp={class:"dss-filter-popup-list"},Qp=["onClick"],Jp={key:0,class:"dss-filter-popup-empty"},e0={key:0,class:"dss-filter-cell"},t0=["onClick"],l0={class:"dss-filter-trigger-text"},n0={class:"dss-filter-popup-list"},o0=["onClick"],a0={key:1,class:"dss-filter-cell dss-filter-cell--value"},s0=["placeholder","onUpdate:modelValue"],r0={key:1,class:"dss-filter-date-wrap"},i0=["placeholder","onUpdate:modelValue"],c0=["placeholder","value","onInput","step"],u0={key:4,class:"dss-filter-between"},d0=["placeholder","value","onInput","step"],m0={class:"dss-filter-between-sep"},p0=["placeholder","value","onInput","step"],v0={key:5,class:"dss-filter-multiselect"},f0=["onClick"],h0={class:"dss-filter-trigger-text"},g0=["placeholder"],y0={class:"dss-filter-popup-list dss-filter-popup-list--check"},k0=["onClick"],C0=["checked"],b0={key:0,class:"dss-filter-popup-empty"},w0=["onClick"],x0={class:"dss-filter-foot"},E0={class:"dss-filter-cell"},S0=["placeholder"],V0={class:"dss-filter-popup-list"},N0=["onClick"],B0={key:0,class:"dss-filter-popup-divider"},M0=["onClick"],_0=["placeholder"],$0={class:"dss-filter-popup-list"},L0=["onClick"],T0={key:0,class:"dss-filter-popup-empty"},A0=["placeholder"],D0={class:"dss-filter-popup-list"},H0=["onClick"],R0={key:0,class:"dss-filter-popup-empty"},F0={name:"DSSFilter"},I0=Object.assign(F0,{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(S,{expose:ee,emit:$}){const{t:N}=fo.useI18n(),de=S,P=$,T={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},me=e.computed(()=>({...T,...de.options})),ut={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"],be=e.ref(""),ye=e.ref([]),J=e.ref(null),j=e.ref(!1),ge=e.ref(null),_e=e.ref(""),ue=e.ref(null),Se=e.ref(""),U=e.ref("asc");let yt=1;function st(M){const w=M.find(E=>E&&typeof E=="object");if(!w)return null;for(const E of f)if(E in w&&typeof w[E]=="string")return E;return Object.keys(w).find(E=>typeof w[E]=="string")||null}function De(M,w){const E=w.filter(se=>se!=null&&se!=="NULL");if(E.length===0)return null;if(E.every(se=>Array.isArray(se))){const se=E.flatMap(Re=>Re).filter(Re=>Re!=null);return se.length===0?null:typeof se.find(Re=>Re!=null)=="object"?"arraySelect":"arrayText"}return E.every(se=>typeof se=="boolean")?"boolean":E.every(se=>typeof se=="number")?new Set(E).size<=me.value.maxUniqueForEnum?"select":"range":E.every(se=>typeof se=="string")?new Set(E).size<=me.value.maxUniqueForSelect?"select":"text":E.some(se=>typeof se=="object"&&!Array.isArray(se))?null:"text"}const Ue=e.computed(()=>{if(!de.data?.length)return[];const M=new Set;for(const re of de.data)if(re&&typeof re=="object")for(const Re of Object.keys(re))M.add(Re);const w=new Set(de.exclude),E=[];for(const re of M){if(w.has(re))continue;const Re=de.config[re]||{},kt=de.data.map(pt=>pt?.[re]),nt=Re.type||De(re,kt);if(!nt)continue;const We=Re.filterMode||"contain",xt=We==="date"?"date":We==="string"?"text":nt,Bt={key:re,label:Re.label||lt(re),type:xt,filterMode:We};if(nt==="select"){const pt=kt.filter(_t=>_t!=null&&_t!=="NULL");Bt.uniqueValues=[...new Set(pt)].sort((_t,Tt)=>typeof _t=="number"&&typeof Tt=="number"?_t-Tt:String(_t).localeCompare(String(Tt)))}else if(nt==="range"||nt==="int"){const pt=kt.filter(_t=>typeof _t=="number");Bt.min=Math.min(...pt),Bt.max=Math.max(...pt)}else if(nt==="arraySelect"){const pt=Re.displayKey||st(kt.flatMap(_t=>Array.isArray(_t)?_t:[]));if(Bt.displayKey=pt,Array.isArray(Re.uniqueValues)&&Re.uniqueValues.length>0)Bt.uniqueValues=Re.uniqueValues.map(_t=>String(_t));else{const _t=kt.flatMap(Tt=>Array.isArray(Tt)?Tt:[]).filter(Tt=>Tt!=null).map(Tt=>pt&&typeof Tt=="object"?Tt[pt]:String(Tt)).filter(Tt=>Tt!=null&&Tt!=="");Bt.uniqueValues=[...new Set(_t)].sort((Tt,St)=>String(Tt).localeCompare(String(St)))}}E.push(Bt)}const se=de.config._order;return se&&E.sort((re,Re)=>{const kt=se.indexOf(re.key),nt=se.indexOf(Re.key);return kt===-1&&nt===-1?0:kt===-1?1:nt===-1?-1:kt-nt}),E}),Z=e.computed(()=>{const M={};for(const w of Ue.value)M[w.key]=w;return M}),Te=e.computed(()=>Array.isArray(de.config.groups)&&de.config.groups.length>0),qe=e.computed(()=>{if(!Te.value)return[];const M=new Set(Ue.value.map(w=>w.key));return de.config.groups.map(w=>({...w,keys:w.keys.filter(E=>M.has(E))})).filter(w=>w.keys.length>0)}),ke=e.computed(()=>{if(!Te.value)return[];const M=new Set(de.config.groups.flatMap(w=>w.keys));return Ue.value.filter(w=>!M.has(w.key))}),Be=e.computed(()=>{if(!ue.value)return[];const M=new Set(ue.value.keys),w=Ue.value.filter(se=>M.has(se.key));if(!_e.value)return w;const E=_e.value.toLowerCase();return w.filter(se=>se.label.toLowerCase().includes(E))}),Je=e.computed(()=>{if(!_e.value)return Ue.value;const M=_e.value.toLowerCase();return Ue.value.filter(w=>w.label.toLowerCase().includes(M))}),Ge=e.computed(()=>Ue.value.filter(M=>!["arraySelect","arrayText"].includes(M.type))),rt=e.computed(()=>Se.value?U.value==="asc"?"Ascending":"Descending":"No sort selected");function Yt(M){J.value===M?we():(J.value=M,_e.value="",ue.value=null)}function we(){J.value=null,_e.value="",ue.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")&&we(),j.value&&ge.value&&!ge.value.contains(M.target)&&(w||(j.value=!1))}e.onMounted(()=>document.addEventListener("click",qt)),e.onBeforeUnmount(()=>document.removeEventListener("click",qt));function dt(M){return Z.value[M]?.label||lt(M)}function et(M){return Z.value[M.key]?.filterMode||"contain"}function Et(M){return N(`filter.operators.${M}`)}function tl(M){const w=Z.value[M.key];return(ut[w?.type]||ut.text).map(E=>({...E,label:N(`filter.operators.${E.value}`)}))}function ft(M){return te.has(M)}function Zt(M){const w=Z.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 ht(M){return ut[M]?.[0]?.value||"contains"}function Jt(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 wt(M){return Z.value[M.key]?.uniqueValues||[]}function jt(M){const w=wt(M);if(!_e.value)return w;const E=_e.value.toLowerCase();return w.filter(se=>String(se).toLowerCase().includes(E))}function fe(M){const w=M.value;return!w||w.length===0?N("filter.select"):w.length<=2?w.join(", "):N("filter.selectedCount",{count:w.length})}function H(M){const w=Z.value[M],E=w?.filterMode||"contain",se=w?.type||"text",re=E==="string"?"contains":ht(se);ye.value.push(e.reactive({id:yt++,key:M,operator:re,value:Jt(se,re)})),we()}function Y(M){ye.value=ye.value.filter(w=>w.id!==M)}function ne(M,w){const se=Z.value[w]?.type||"text";M.key=w,M.operator=ht(se),M.value=Jt(se,M.operator),we()}function he(M,w){const E=Zt(M);M.operator=w;const se=Zt(M);if(E!==se||te.has(w)){const re=Z.value[M.key];M.value=Jt(re?.type||"text",w)}we()}function Xe(M,w){const E=w.target.value;M.value=E===""?null:Number(E)}function Ke(M,w,E){const se=E.target.value,re=se===""?null:Number(se);(!M.value||typeof M.value!="object")&&(M.value={min:null,max:null}),M.value={...M.value,[w]:isNaN(re)?null:re}}function Lt(M,w){const E=M.value||[],se=E.indexOf(w);M.value=se>=0?E.filter(re=>re!==w):[...E,w]}function $e(){ye.value=[],be.value="",we()}function Qe(M){be.value=M.target.value}function Ct(M){Se.value=M.target.value}function el(){U.value=U.value==="asc"?"desc":"asc"}const ie=e.computed(()=>{if(!de.data)return[];let M=de.data;if(be.value){const w=be.value.toLowerCase();M=M.filter(E=>{for(const se of Object.keys(E)){const re=E[se];if(typeof re=="string"&&re.toLowerCase().includes(w)||typeof re=="number"&&String(re).includes(w)||Array.isArray(re)&&re.some(Re=>Re!=null&&(typeof Re=="string"?Re.toLowerCase().includes(w):typeof Re=="object"?Object.values(Re).some(kt=>typeof kt=="string"&&kt.toLowerCase().includes(w)):!1)))return!0}return!1})}for(const w of ye.value){if(!ae(w))continue;const E=Z.value[w.key];E&&(M=M.filter(se=>Ee(se,w,E)))}if(de.showSortBy&&Se.value){const w=Se.value,E=U.value==="asc"?1:-1;M=[...M].sort((se,re)=>X(se?.[w],re?.[w])*E)}return M});function X(M,w){const E=Q(M),se=Q(w);return E==null&&se==null?0:E==null?1:se==null?-1:typeof E=="number"&&typeof se=="number"?E-se:String(E).localeCompare(String(se),void 0,{numeric:!0,sensitivity:"base"})}function Q(M){return M==null||M==="NULL"?null:typeof M=="string"||typeof M=="number"||typeof M=="boolean"?M:M instanceof Date?M.getTime():null}function ae(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 Ee(M,w,E){const se=M?.[w.key],re=w.value,Re=w.operator;if(Re==="is_empty")return Ut(se);if(Re==="is_not_empty")return!Ut(se);const kt=E.type;if(kt==="text"||kt==="arrayText"){const nt=kt==="arrayText"&&Array.isArray(se)?se.filter(Bt=>Bt!=null).map(String).join(" "):se!=null?String(se):"",We=String(re).toLowerCase(),xt=nt.toLowerCase();switch(Re){case"contains":return xt.includes(We);case"not_contains":return!xt.includes(We);case"equals":return xt===We;case"not_equals":return xt!==We;case"starts_with":return xt.startsWith(We);case"ends_with":return xt.endsWith(We);default:return!0}}if(kt==="select")switch(Re){case"is_any_of":return re.includes(se);case"is_none_of":return!re.includes(se);default:return!0}if(kt==="range"||kt==="int"){const nt=typeof se=="number"?se:Number(se);if(typeof nt!="number"||isNaN(nt))return!1;if(Re==="between"){const xt=re?.min!=null?Number(re.min):null,Bt=re?.max!=null?Number(re.max):null,pt=xt!=null&&!isNaN(xt)?xt:null,_t=Bt!=null&&!isNaN(Bt)?Bt:null;return(pt==null||nt>=pt)&&(_t==null||nt<=_t)}const We=typeof re=="number"&&!isNaN(re)?re:Number(re);if(Re==="contains"||Re==="not_contains"){const xt=String(nt),Bt=String(re??"").toLowerCase(),pt=xt.toLowerCase().includes(Bt);return Re==="contains"?pt:!pt}if(typeof We!="number"||isNaN(We))return!1;switch(Re){case"eq":return nt===We;case"neq":return nt!==We;case"gt":return nt>We;case"gte":return nt>=We;case"lt":return nt<We;case"lte":return nt<=We;default:return!0}}if(kt==="arraySelect"){if(!Array.isArray(se))return!1;const nt=se.filter(We=>We!=null).map(We=>E.displayKey&&typeof We=="object"?We[E.displayKey]:String(We));switch(Re){case"contains_any":return nt.some(We=>re.includes(We));case"contains_all":return re.every(We=>nt.includes(We));case"not_contains_any":return!nt.some(We=>re.includes(We));default:return!0}}if(kt==="date"){const nt=je(re);if(!nt||isNaN(nt.getTime()))return!1;const We=je(se);if(!We||isNaN(We.getTime()))return!1;const xt=bt(We),Bt=bt(nt);switch(Re){case"eq":return xt===Bt;case"before":return xt<Bt;case"after":return xt>Bt;default:return!0}}if(kt==="boolean"){const nt=se===!0||se==="true"||se===1,We=se===!1||se==="false"||se===0;switch(Re){case"is_true":return nt;case"is_false":return We;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 bt(M){const w=M.getFullYear(),E=String(M.getMonth()+1).padStart(2,"0"),se=String(M.getDate()).padStart(2,"0");return`${w}-${E}-${se}`}function Ut(M){return!!(M==null||M===""||M==="NULL"||Array.isArray(M)&&M.length===0||Array.isArray(M)&&M.every(w=>w==null))}e.watch(ie,M=>P("update:modelValue",M),{immediate:!0}),e.watch(()=>de.data,()=>{ye.value=[],be.value="",j.value=!1,Se.value="",U.value="asc",we()});function lt(M){return M.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,w=>w.toUpperCase())}function sl(){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 E={};for(const se of Object.keys(w))E[se]=M(w[se]);return E}return w};return{globalSearch:be.value,rows:ye.value.map(w=>({key:w.key,operator:w.operator,value:M(w.value),defType:Z.value[w.key]?.type,defFilterMode:Z.value[w.key]?.filterMode})),filteredCount:ie.value?.length??0}}return ee({getDebugState:sl}),(M,w)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":me.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:ge},[e.createElementVNode("div",Tp,[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(N)("filter.searchAcrossFields"),value:be.value,onInput:Qe},null,40,Ap),be.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:w[0]||(w[0]=E=>be.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:j.value||ye.value.length>0,"dss-filter-funnel-btn--with-sort":de.showSortBy}]),onClick:w[1]||(w[1]=E=>j.value=!j.value),type:"button",title:j.value?e.unref(N)("filter.closeAdvancedFilter"):e.unref(N)("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)),ye.value.length>0?(e.openBlock(),e.createElementBlock("span",Hp,e.toDisplayString(ye.value.length),1)):e.createCommentVNode("",!0)],10,Dp),de.showSortBy?(e.openBlock(),e.createElementBlock("div",Rp,[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:Se.value,onChange:Ct},[w[15]||(w[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ge.value,E=>(e.openBlock(),e.createElementBlock("option",{key:E.key,value:E.key},e.toDisplayString(E.label),9,Ip))),128))],40,Fp),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:el,disabled:!Se.value,title:rt.value},[Se.value?U.value==="asc"?(e.openBlock(),e.createElementBlock("svg",Op,[...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",Wp,[...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",Pp,[...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,zp)])):e.createCommentVNode("",!0)]),j.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:w[13]||(w[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",qp,[ye.value.length===0?(e.openBlock(),e.createElementBlock("div",Zp,e.toDisplayString(e.unref(N)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ye.value,(E,se)=>(e.openBlock(),e.createElementBlock("div",{key:E.id,class:"dss-filter-row"},[e.createElementVNode("span",Up,e.toDisplayString(se===0?e.unref(N)("filter.where"):e.unref(N)("filter.and")),1),e.createElementVNode("div",Xp,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(re=>Yt(`${E.id}:field`),["stop"])},[e.createElementVNode("span",jp,e.toDisplayString(dt(E.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,Yp),J.value===`${E.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]=re=>_e.value=re),placeholder:e.unref(N)("filter.searchAttributes")},null,8,Kp),[[e.vModelText,_e.value]]),e.createElementVNode("ul",Gp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Je.value,re=>(e.openBlock(),e.createElementBlock("li",{key:re.key,class:"dss-filter-popup-item",onClick:Re=>ne(E,re.key)},e.toDisplayString(re.label),9,Qp))),128)),Je.value.length===0?(e.openBlock(),e.createElementBlock("li",Jp,e.toDisplayString(e.unref(N)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),et(E)==="contain"||et(E)==="date"?(e.openBlock(),e.createElementBlock("div",e0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(re=>Yt(`${E.id}:op`),["stop"])},[e.createElementVNode("span",l0,e.toDisplayString(Et(E.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,t0),J.value===`${E.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[4]||(w[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",n0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tl(E),re=>(e.openBlock(),e.createElementBlock("li",{key:re.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:E.operator===re.value}]),onClick:Re=>he(E,re.value)},e.toDisplayString(re.label),11,o0))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),ft(E.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",a0,[et(E)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref(N)("filter.enterValue"),"onUpdate:modelValue":re=>E.value=re},null,8,s0)),[[e.vModelText,E.value]]):et(E)==="date"?(e.openBlock(),e.createElementBlock("div",r0,[e.createVNode(ga,{mode:"single",modelValue:E.value,"onUpdate:modelValue":re=>E.value=re},null,8,["modelValue","onUpdate:modelValue"])])):Zt(E)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref(N)("filter.enterValue"),"onUpdate:modelValue":re=>E.value=re},null,8,i0)),[[e.vModelText,E.value]]):Zt(E)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref(N)("filter.enterValue"),value:E.value,onInput:re=>Xe(E,re),step:Z.value[E.key]?.type==="int"?1:void 0},null,40,c0)):Zt(E)==="between"?(e.openBlock(),e.createElementBlock("div",u0,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(N)("filter.min"),value:E.value?.min,onInput:re=>Ke(E,"min",re),step:Z.value[E.key]?.type==="int"?1:void 0},null,40,d0),e.createElementVNode("span",m0,e.toDisplayString(e.unref(N)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(N)("filter.max"),value:E.value?.max,onInput:re=>Ke(E,"max",re),step:Z.value[E.key]?.type==="int"?1:void 0},null,40,p0)])):Zt(E)==="multiselect"?(e.openBlock(),e.createElementBlock("div",v0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(re=>Yt(`${E.id}:val`),["stop"])},[e.createElementVNode("span",h0,e.toDisplayString(fe(E)),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,f0),J.value===`${E.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[6]||(w[6]=e.withModifiers(()=>{},["stop"]))},[wt(E).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[5]||(w[5]=re=>_e.value=re),placeholder:e.unref(N)("filter.search")},null,8,g0)),[[e.vModelText,_e.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",y0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(jt(E),re=>(e.openBlock(),e.createElementBlock("li",{key:re,class:"dss-filter-popup-item",onClick:Re=>Lt(E,re)},[e.createElementVNode("input",{type:"checkbox",checked:(E.value||[]).includes(re),tabindex:"-1"},null,8,C0),e.createElementVNode("span",null,e.toDisplayString(re),1)],8,k0))),128)),jt(E).length===0?(e.openBlock(),e.createElementBlock("li",b0,e.toDisplayString(e.unref(N)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:re=>Y(E.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,w0)]))),128)),e.createElementVNode("div",x0,[e.createElementVNode("div",E0,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:w[7]||(w[7]=e.withModifiers(E=>Yt("add"),["stop"]))},e.toDisplayString(e.unref(N)("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"]))},[Te.value&&!ue.value&&!_e.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]=E=>_e.value=E),placeholder:e.unref(N)("filter.searchAttributes")},null,8,S0),[[e.vModelText,_e.value]]),e.createElementVNode("ul",V0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qe.value,E=>(e.openBlock(),e.createElementBlock("li",{key:E.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:se=>ue.value=E},[e.createElementVNode("span",null,e.toDisplayString(E.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,N0))),128)),ke.value.length>0?(e.openBlock(),e.createElementBlock("li",B0)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ke.value,E=>(e.openBlock(),e.createElementBlock("li",{key:E.key,class:"dss-filter-popup-item",onClick:se=>H(E.key)},e.toDisplayString(E.label),9,M0))),128))])],64)):ue.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:w[9]||(w[9]=E=>ue.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(ue.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[10]||(w[10]=E=>_e.value=E),placeholder:e.unref(N)("filter.searchAttributes")},null,8,_0),[[e.vModelText,_e.value]]),e.createElementVNode("ul",$0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Be.value,E=>(e.openBlock(),e.createElementBlock("li",{key:E.key,class:"dss-filter-popup-item",onClick:se=>H(E.key)},e.toDisplayString(E.label),9,L0))),128)),Be.value.length===0?(e.openBlock(),e.createElementBlock("li",T0,e.toDisplayString(e.unref(N)("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]=E=>_e.value=E),placeholder:e.unref(N)("filter.searchAttributes")},null,8,A0),[[e.vModelText,_e.value]]),e.createElementVNode("ul",D0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Je.value,E=>(e.openBlock(),e.createElementBlock("li",{key:E.key,class:"dss-filter-popup-item",onClick:se=>H(E.key)},e.toDisplayString(E.label),9,H0))),128)),Je.value.length===0?(e.openBlock(),e.createElementBlock("li",R0,e.toDisplayString(e.unref(N)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),ye.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:$e},e.toDisplayString(e.unref(N)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),z0={class:"dss-pill-field__pills"},P0=["data-value"],O0=["disabled"],W0={class:"dss-pill-field__pill-text"},q0={key:0,class:"dss-pill-field__pill-actions"},Z0=["onClick"],U0=["onClick"],X0=["placeholder","disabled"],Y0=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(S,{emit:ee}){const $=S,N=ee,de=e.ref(""),P=e.ref([...$.modelValue]),T=e.ref(null);let me=null;const ut=e.ref(null),te=e.ref(""),f=e.ref(null),be=e.ref(null),ye=e.computed(()=>{if(!be.value)return;const{width:Te,height:qe}=be.value;return{minWidth:`${Te}px`,height:`${qe}px`}});function J(Te,qe){ut.value===qe&&(f.value=Te)}function j(){ut.value=null,te.value="",be.value=null,f.value=null}const ge=e.computed(()=>new Set(P.value.map(Te=>Te.trim()).filter(Boolean)));function _e(Te){T.value=Te,me&&clearTimeout(me),me=setTimeout(()=>{T.value=null,me=null},900)}function ue(Te){const qe=Te.trim();return qe?ge.value.has(qe)?(_e(qe),!1):(P.value=[...P.value,qe],N("update:modelValue",[...P.value]),!0):!1}function Se(Te){const qe=Te.split(/\r?\n/g).map(Ge=>Ge.trim()).filter(Boolean);if(!qe.length)return;const ke=new Set(P.value.map(Ge=>Ge.trim()).filter(Boolean)),Be=[...P.value];let Je=null;for(const Ge of qe){if(ke.has(Ge)){Je??=Ge;continue}ke.add(Ge),Be.push(Ge)}Be.length!==P.value.length&&(P.value=Be,N("update:modelValue",[...P.value])),Je&&_e(Je)}function U(Te){$.disabled||(ut.value===Te&&j(),P.value=P.value.filter((qe,ke)=>ke!==Te),N("update:modelValue",[...P.value]))}async function yt(Te,qe){if($.disabled)return;const ke=qe.currentTarget.closest(".dss-pill-field__pill");ke&&(be.value={width:ke.offsetWidth,height:ke.offsetHeight}),ut.value=Te,te.value=P.value[Te]??"",await e.nextTick();const Be=f.value;if(!Be)return;Be.focus();const Je=Be.value.length;Be.setSelectionRange(Je,Je)}function st(){j()}function De(){if($.disabled||ut.value===null)return;const Te=ut.value,qe=P.value[Te]??"",ke=te.value.trim();if(j(),ke!==qe&&ge.value.has(ke)){_e(ke);return}if(!ke){P.value=P.value.filter((Je,Ge)=>Ge!==Te),N("update:modelValue",[...P.value]);return}const Be=P.value.map((Je,Ge)=>Ge===Te?ke:Je);P.value=Be,N("update:modelValue",[...P.value])}function Ue(Te){Te.preventDefault(),!$.disabled&&(ue(de.value),de.value="")}function Z(Te){if($.disabled)return;const qe=Te.clipboardData?.getData("text")??"";!qe.includes(`
120
- `)&&!qe.includes("\r")||(Te.preventDefault(),Se(qe),de.value="")}return e.watch(()=>$.modelValue,Te=>{P.value=Array.isArray(Te)?[...Te]:[]},{deep:!0}),e.onBeforeUnmount(()=>{me&&clearTimeout(me)}),(Te,qe)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":Te.disabled}])},[e.createElementVNode("div",z0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(ke,Be)=>(e.openBlock(),e.createElementBlock("span",{key:ke,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":T.value===ke,"dss-pill-field__pill--editing":ut.value===Be}]),style:e.normalizeStyle(ut.value===Be&&be.value?ye.value:void 0)},[ut.value===Be?(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:Je=>J(Je,Be),"onUpdate:modelValue":qe[0]||(qe[0]=Je=>te.value=Je),class:"dss-pill-field__pill-edit",type:"text",disabled:Te.disabled,onKeydown:[e.withKeys(De,["enter"]),e.withKeys(st,["esc"])],onBlur:De},null,40,O0),[[e.vModelText,te.value]])],8,P0)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",W0,e.toDisplayString(ke),1),Te.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",q0,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:Je=>yt(Be,Je)},[...qe[2]||(qe[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,Z0),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:Je=>U(Be)}," × ",8,U0)]))],64))],6))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":qe[1]||(qe[1]=ke=>de.value=ke),class:"dss-pill-field__input",type:"text",placeholder:P.value.length?"":Te.placeholder,disabled:Te.disabled,onPaste:Z,onKeydown:e.withKeys(Ue,["enter"])},null,40,X0),[[e.vModelText,de.value]])])],2))}}),j0={key:0,class:"dss-title dss-title--separator"},K0={__name:"DSSTitle",props:{type:{type:String,default:"main",validator:S=>["main","separator","subtitle"].includes(S)},h:{type:Number,default:null,validator:S=>S===null||Number.isInteger(S)&&S>=1&&S<=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(S,{expose:ee,emit:$}){const N=S,de=$,P=e.ref(null),T=e.computed(()=>`dss-title--${N.type}`),me=e.computed(()=>N.h!=null?`dss-title--h${N.h}`:null),ut={main:"div",subtitle:"p",separator:"span"},te=e.computed(()=>N.h!=null?`h${N.h}`:ut[N.type]??"div"),f=e.computed(()=>N.editable?"plaintext-only":void 0),be=e.computed(()=>{const ue={};return N.size!=null&&(ue.fontSize=typeof N.size=="number"?`${N.size}px`:N.size),N.weight!=null&&(ue.fontWeight=N.weight),N.color!=null&&(ue.color=N.color),Object.keys(ue).length?ue:void 0}),ye=e.computed(()=>N.editable?{input:j,keydown:ge,paste:_e}:{}),J=()=>{const ue=P.value;!N.editable||!ue||document.activeElement!==ue&&(ue.innerText=N.modelValue??"")},j=ue=>{const Se=ue.target.innerText;de("update:modelValue",Se),de("change",Se)},ge=ue=>{ue.key==="Enter"&&ue.preventDefault()},_e=ue=>{ue.preventDefault();const Se=(ue.clipboardData||window.clipboardData).getData("text/plain");document.execCommand("insertText",!1,Se)};return e.watch(()=>N.modelValue,()=>{J()}),e.watch(()=>N.editable,()=>{e.nextTick(J)}),e.onMounted(()=>{e.nextTick(J)}),ee({focus:()=>P.value?.focus()}),(ue,Se)=>S.type==="separator"?(e.openBlock(),e.createElementBlock("div",j0,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(te.value),e.mergeProps({ref_key:"titleRef",ref:P,class:["dss-title__separator-label",me.value,{"dss-title--editable":S.editable}],style:be.value,contenteditable:f.value,spellcheck:S.editable?!1:void 0},e.toHandlers(ye.value)),{default:e.withCtx(()=>[S.editable?e.createCommentVNode("",!0):e.renderSlot(ue.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(S.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,me.value,{"dss-title--editable":S.editable}]],style:be.value,contenteditable:f.value,spellcheck:S.editable?!1:void 0},e.toHandlers(ye.value)),{default:e.withCtx(()=>[S.editable?e.createCommentVNode("",!0):e.renderSlot(ue.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(S.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))}},G0={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"}},Q0={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"},J0={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"}},e9={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"}},t9={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"}},ho={chart:G0,table:Q0,filter:J0,datepicker:e9,textEditor:t9},l9={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"}},n9={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"},o9={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"}},a9={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"}},s9={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"}},go={chart:l9,table:n9,filter:o9,datepicker:a9,textEditor:s9},r9={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"}},i9={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"},c9={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"}},u9={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"}},d9={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"}},yo={chart:r9,table:i9,filter:c9,datepicker:u9,textEditor:d9},qo={en:ho,fr:go,nl:yo};function Fa(S){if(!S||!S.global)return;const ee=S.global.availableLocales||[];Object.keys(qo).forEach($=>{ee.includes($)&&S.global.mergeLocaleMessage($,qo[$])})}const Zo={en:{textEditor:ho.textEditor},fr:{textEditor:go.textEditor},nl:{textEditor:yo.textEditor}};function Ia(S){if(!S||!S.global)return;const ee=S.global.availableLocales||[];Object.keys(Zo).forEach($=>{ee.includes($)&&S.global.mergeLocaleMessage($,Zo[$])})}const Uo={en:{table:ho.table},fr:{table:go.table},nl:{table:yo.table}};function za(S){if(!S||!S.global)return;const ee=S.global.availableLocales||[];Object.keys(Uo).forEach($=>{ee.includes($)&&S.global.mergeLocaleMessage($,Uo[$])})}const Xo={en:{datepicker:ho.datepicker},fr:{datepicker:go.datepicker},nl:{datepicker:yo.datepicker}};function Pa(S){if(!S||!S.global)return;const ee=S.global.availableLocales||[];Object.keys(Xo).forEach($=>{ee.includes($)&&S.global.mergeLocaleMessage($,Xo[$])})}const Yo={en:{filter:ho.filter},fr:{filter:go.filter},nl:{filter:yo.filter}};function Oa(S){if(!S||!S.global)return;const ee=S.global.availableLocales||[];Object.keys(Yo).forEach($=>{ee.includes($)&&S.global.mergeLocaleMessage($,Yo[$])})}const m9={chart:qo,textEditor:Zo,table:Uo,datepicker:Xo,filter:Yo};function p9(S){!S||!S.global||(Fa(S),Ia(S),za(S),Pa(S),Oa(S))}const v9={en:{...ho},fr:{...go},nl:{...yo}};fo.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:v9});exports.DSSChart=hu;exports.DSSChartMessages=qo;exports.DSSColorPicker=op;exports.DSSConfetti=Lp;exports.DSSDatepicker=ga;exports.DSSDatepickerMessages=Xo;exports.DSSDnd=_p;exports.DSSFilter=I0;exports.DSSFilterMessages=Yo;exports.DSSLoader=gp;exports.DSSMessages=m9;exports.DSSModal=ha;exports.DSSPillField=Y0;exports.DSSSkeleton=yp;exports.DSSStepBar=Ra;exports.DSSTable=Fd;exports.DSSTableMessages=Uo;exports.DSSTextEditor=O2;exports.DSSTextEditorMessages=Zo;exports.DSSTitle=K0;exports.addDSSChartTranslations=Fa;exports.addDSSDatepickerTranslations=Pa;exports.addDSSFilterTranslations=Oa;exports.addDSSTableTranslations=za;exports.addDSSTextEditorTranslations=Ia;exports.addDSSTranslations=p9;
119
+ `,document.body.appendChild(he),ue=he}function Be(fe,H){ue&&(ue.style.left=`${fe-U}px`,ue.style.top=`${H-yt}px`)}function Je(fe){fe.classList.add("dss-dnd-item--dragging"),fe.style.background=me.value.dragSourceBackground,fe.style.borderColor=me.value.dragSourceBorder,fe.style.transform="scale(0.97)"}function Ge(fe){fe.classList.remove("dss-dnd-item--dragging"),fe.style.background="",fe.style.borderColor="",fe.style.transform=""}function rt(fe,H){return document.elementFromPoint(fe,H)?.closest(".dss-dnd-column-body")??null}function Xt(fe,H){return!!document.elementFromPoint(fe,H)?.closest("[data-dss-dnd-delete-zone]")}function be(fe,H){if(P.value&&Xt(fe,H)){ye.value=!0,we.value=null,J.value=-1;return}ye.value=!1;const Y=rt(fe,H),ne=Y?.getAttribute("data-column")??null;if(!ne){we.value=null,J.value=-1;return}we.value=ne;const he=Y.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let Xe=he.length;for(let Ke=0;Ke<he.length;Ke++){const Lt=he[Ke].getBoundingClientRect();if(H<Lt.top+Lt.height/2){Xe=Ke;break}}J.value=Xe}function Wt(fe){fe.preventDefault(),Be(fe.clientX,fe.clientY),!ge&&(ge=requestAnimationFrame(()=>{ge=null,be(fe.clientX,fe.clientY)}))}function dt(fe){window.removeEventListener("pointermove",Wt),window.removeEventListener("pointerup",dt),window.removeEventListener("pointercancel",dt),Se?.releasePointerCapture?.(fe.pointerId),Ge(Se),Se=null;const H=P.value&&Xt(fe.clientX,fe.clientY);if(f.value&&H)N("delete",{item:f.value});else{const ne=rt(fe.clientX,fe.clientY)?.getAttribute("data-column")??null;if(f.value&&ne){const he=f.value[$.columnKey],Xe=ne,Lt=(Z.value[Xe]||[]).filter(el=>el[$.itemKey]!==f.value[$.itemKey]),$e=Math.max(0,Math.min(J.value,Lt.length)),Qe=qe(Xe,$e),Ct=f.value[$.itemKey];N("move",{item:f.value,from:he,to:Xe,position:Qe,index:$e}),_e&&clearTimeout(_e),j.value={id:Ct,from:he,to:Xe},_e=setTimeout(()=>{j.value=null},3500)}}ue&&(ue.remove(),ue=null),st!==null&&(document.body.style.cursor=st,st=""),Yt()}function et(fe,H){fe.preventDefault();const Y=fe.target.closest(".dss-dnd-item");if(!Y)return;const ne=Y.getBoundingClientRect();U=fe.clientX-ne.left,yt=fe.clientY-ne.top,st=document.body.style.cursor,document.body.style.cursor="grabbing",f.value=H,Se=Y,ke(Y,fe.clientX,fe.clientY),requestAnimationFrame(()=>Je(Y)),Y.setPointerCapture?.(fe.pointerId),window.addEventListener("pointermove",Wt),window.addEventListener("pointerup",dt,{once:!0}),window.addEventListener("pointercancel",dt,{once:!0})}function Et(){De&&(window.removeEventListener("pointermove",tl),window.removeEventListener("pointerup",ft),window.removeEventListener("pointercancel",ft),De=null)}function tl(fe){if(!De||fe.pointerId!==De.pointerId)return;const H=fe.clientX-De.startX,Y=fe.clientY-De.startY;if(Math.abs(H)>=Ue||Math.abs(Y)>=Ue){const ne=De.item;Et(),et(fe,ne)}}function ft(fe){!De||fe.pointerId!==De.pointerId||Et()}function qt(fe,H){Et(),De={item:H,startX:fe.clientX,startY:fe.clientY,pointerId:fe.pointerId},window.addEventListener("pointermove",tl),window.addEventListener("pointerup",ft),window.addEventListener("pointercancel",ft)}function ht(fe,H){me.value.useHandle||qt(fe,H)}function Jt(fe,H){qt(fe,H)}function wt(){ge&&(cancelAnimationFrame(ge),ge=null)}function Yt(){wt(),f.value=null,we.value=null,ye.value=!1,J.value=-1}return e.onBeforeUnmount(()=>{wt(),Et(),_e&&clearTimeout(_e),ue&&(ue.remove(),ue=null)}),(fe,H)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":me.value.unstyled}]),style:e.normalizeStyle(ut.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":ye.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(fe.$slots,"delete-zone",{isDragging:!!f.value,isOver:ye.value})],2),[[e.vShow,!!f.value||me.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.columns,Y=>(e.openBlock(),e.createElementBlock("div",{key:Y.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":we.value==Y.value},Y.class||""]]),style:e.normalizeStyle(te(Y))},[me.value.showHeader?(e.openBlock(),e.createElementBlock("div",kp,[e.renderSlot(fe.$slots,"column-header",{column:Y,items:Z.value[Y.value]||[]},()=>[e.createElementVNode("span",Cp,e.toDisplayString(Y.title||Y.value),1),e.createElementVNode("span",bp,e.toDisplayString((Z.value[Y.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":Y.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Te.value[Y.value],ne=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ne.key},[ne.type==="indicator"?(e.openBlock(),e.createElementBlock("div",xp)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":ne.isDragged,"dss-dnd-item--no-handle":!me.value.useHandle}]),onPointerdown:he=>ht(he,ne.item)},[me.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(he=>Jt(he,ne.item),["stop"])},[e.renderSlot(fe.$slots,"handle",{},()=>[H[0]||(H[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,Sp)):e.createCommentVNode("",!0),e.createElementVNode("div",Vp,[e.renderSlot(fe.$slots,"item",{item:ne.item,column:Y,justDropped:j.value?.id===ne.item[S.itemKey],droppedFrom:j.value?.id===ne.item[S.itemKey]?j.value.from:null,droppedTo:j.value?.id===ne.item[S.itemKey]?j.value.to:null},()=>[e.createElementVNode("div",Np,e.toDisplayString(ne.item[S.itemKey]),1)])])],42,Ep))],64))),128)),(Z.value[Y.value]||[]).length===0&&we.value!=Y.value?(e.openBlock(),e.createElementBlock("div",Bp,[e.renderSlot(fe.$slots,"empty",{column:Y},()=>[H[1]||(H[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,wp)],6))),128))],6))}}),$p={name:"DSSConfetti"},Lp=Object.assign($p,{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(S){const ee=S,$=e.ref(null),N=e.ref(!1);let de=[],P=null,T=null;function me(J,j){const ge=[];for(let _e=0;_e<ee.count;_e++)ge.push(ut(J));return ge}function ut(J,j){return{x:Math.random()*J,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:ee.colors[Math.floor(Math.random()*ee.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,j,ge,_e){J.clearRect(0,0,j,ge);for(const ue of de)J.save(),J.globalAlpha=ue.opacity*_e,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 f(J,j,ge){const _e=.3+ge*.7;for(let ue=0;ue<de.length;ue++){const Se=de[ue];Se.tiltAngle+=Se.tiltInc,Se.y+=Se.speed*_e,Se.x+=Math.sin(Se.d)*.5*_e,Se.tilt=Math.sin(Se.tiltAngle)*15,ge>=.99&&Se.y>j+20&&(de[ue]=ut(J))}}function we(){N.value=!0,e.nextTick(()=>{const J=$.value;if(!J)return;const j=J.getContext("2d"),ge=J.parentElement;if(!ge)return;const _e=ge.getBoundingClientRect();J.width=_e.width,J.height=_e.height,de=me(J.width,J.height);const ue=Date.now(),Se=ue+ee.duration,U=()=>{const yt=Date.now(),st=yt-ue;if(yt<Se){let De=1;st>ee.fadeStart&&(De=1-(st-ee.fadeStart)/(ee.duration-ee.fadeStart)),te(j,J.width,J.height,De),f(J.width,J.height,De),P=requestAnimationFrame(U)}else ye()};U()})}function ye(){P&&(cancelAnimationFrame(P),P=null),de=[],N.value=!1}return e.watch(()=>ee.trigger,J=>{J&&(T&&clearTimeout(T),T=setTimeout(we,ee.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{ye(),T&&clearTimeout(T)}),(J,j)=>N.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:$,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),Tp={class:"dss-filter-global-inner"},Ap=["placeholder","value"],Dp=["title"],Hp={key:0,class:"dss-filter-funnel-badge"},Rp={key:1,class:"dss-filter-sortby"},Fp=["value"],Ip=["value"],zp=["disabled","title"],Pp={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"},Op={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"},Wp={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"},qp={class:"dss-filter-panel"},Zp={key:0,class:"dss-filter-empty"},Up={class:"dss-filter-row-prefix"},Xp={class:"dss-filter-cell"},Yp=["onClick"],jp={class:"dss-filter-trigger-text"},Kp=["placeholder"],Gp={class:"dss-filter-popup-list"},Qp=["onClick"],Jp={key:0,class:"dss-filter-popup-empty"},e0={key:0,class:"dss-filter-cell"},t0=["onClick"],l0={class:"dss-filter-trigger-text"},n0={class:"dss-filter-popup-list"},o0=["onClick"],a0={key:1,class:"dss-filter-cell dss-filter-cell--value"},s0=["placeholder","onUpdate:modelValue"],r0={key:1,class:"dss-filter-date-wrap"},i0=["placeholder","onUpdate:modelValue"],c0=["placeholder","value","onInput","step"],u0={key:4,class:"dss-filter-between"},d0=["placeholder","value","onInput","step"],m0={class:"dss-filter-between-sep"},p0=["placeholder","value","onInput","step"],v0={key:5,class:"dss-filter-multiselect"},f0=["onClick"],h0={class:"dss-filter-trigger-text"},g0=["placeholder"],y0={class:"dss-filter-popup-list dss-filter-popup-list--check"},k0=["onClick"],C0=["checked"],b0={key:0,class:"dss-filter-popup-empty"},w0=["onClick"],x0={class:"dss-filter-foot"},E0={class:"dss-filter-cell"},S0=["placeholder"],V0={class:"dss-filter-popup-list"},N0=["onClick"],B0={key:0,class:"dss-filter-popup-divider"},M0=["onClick"],_0=["placeholder"],$0={class:"dss-filter-popup-list"},L0=["onClick"],T0={key:0,class:"dss-filter-popup-empty"},A0=["placeholder"],D0={class:"dss-filter-popup-list"},H0=["onClick"],R0={key:0,class:"dss-filter-popup-empty"},F0={name:"DSSFilter"},I0=Object.assign(F0,{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(S,{expose:ee,emit:$}){const{t:N}=fo.useI18n(),de=S,P=$,T={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},me=e.computed(()=>({...T,...de.options})),ut={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(""),ye=e.ref([]),J=e.ref(null),j=e.ref(!1),ge=e.ref(null),_e=e.ref(""),ue=e.ref(null),Se=e.ref(""),U=e.ref("asc");let yt=1;function st(M){const w=M.find(E=>E&&typeof E=="object");if(!w)return null;for(const E of f)if(E in w&&typeof w[E]=="string")return E;return Object.keys(w).find(E=>typeof w[E]=="string")||null}function De(M,w){const E=w.filter(se=>se!=null&&se!=="NULL");if(E.length===0)return null;if(E.every(se=>Array.isArray(se))){const se=E.flatMap(Re=>Re).filter(Re=>Re!=null);return se.length===0?null:typeof se.find(Re=>Re!=null)=="object"?"arraySelect":"arrayText"}return E.every(se=>typeof se=="boolean")?"boolean":E.every(se=>typeof se=="number")?new Set(E).size<=me.value.maxUniqueForEnum?"select":"range":E.every(se=>typeof se=="string")?new Set(E).size<=me.value.maxUniqueForSelect?"select":"text":E.some(se=>typeof se=="object"&&!Array.isArray(se))?null:"text"}const Ue=e.computed(()=>{if(!de.data?.length)return[];const M=new Set;for(const re of de.data)if(re&&typeof re=="object")for(const Re of Object.keys(re))M.add(Re);const w=new Set(de.exclude),E=[];for(const re of M){if(w.has(re))continue;const Re=de.config[re]||{},kt=de.data.map(pt=>pt?.[re]),nt=Re.type||De(re,kt);if(!nt)continue;const We=Re.filterMode||"contain",xt=We==="date"?"date":We==="string"?"text":nt,Bt={key:re,label:Re.label||lt(re),type:xt,filterMode:We};if(nt==="select"){const pt=kt.filter(_t=>_t!=null&&_t!=="NULL");Bt.uniqueValues=[...new Set(pt)].sort((_t,Tt)=>typeof _t=="number"&&typeof Tt=="number"?_t-Tt:String(_t).localeCompare(String(Tt)))}else if(nt==="range"||nt==="int"){const pt=kt.filter(_t=>typeof _t=="number");Bt.min=Math.min(...pt),Bt.max=Math.max(...pt)}else if(nt==="arraySelect"){const pt=Re.displayKey||st(kt.flatMap(_t=>Array.isArray(_t)?_t:[]));if(Bt.displayKey=pt,Array.isArray(Re.uniqueValues)&&Re.uniqueValues.length>0)Bt.uniqueValues=Re.uniqueValues.map(_t=>String(_t));else{const _t=kt.flatMap(Tt=>Array.isArray(Tt)?Tt:[]).filter(Tt=>Tt!=null).map(Tt=>pt&&typeof Tt=="object"?Tt[pt]:String(Tt)).filter(Tt=>Tt!=null&&Tt!=="");Bt.uniqueValues=[...new Set(_t)].sort((Tt,St)=>String(Tt).localeCompare(String(St)))}}E.push(Bt)}const se=de.config._order;return se&&E.sort((re,Re)=>{const kt=se.indexOf(re.key),nt=se.indexOf(Re.key);return kt===-1&&nt===-1?0:kt===-1?1:nt===-1?-1:kt-nt}),E}),Z=e.computed(()=>{const M={};for(const w of Ue.value)M[w.key]=w;return M}),Te=e.computed(()=>Array.isArray(de.config.groups)&&de.config.groups.length>0),qe=e.computed(()=>{if(!Te.value)return[];const M=new Set(Ue.value.map(w=>w.key));return de.config.groups.map(w=>({...w,keys:w.keys.filter(E=>M.has(E))})).filter(w=>w.keys.length>0)}),ke=e.computed(()=>{if(!Te.value)return[];const M=new Set(de.config.groups.flatMap(w=>w.keys));return Ue.value.filter(w=>!M.has(w.key))}),Be=e.computed(()=>{if(!ue.value)return[];const M=new Set(ue.value.keys),w=Ue.value.filter(se=>M.has(se.key));if(!_e.value)return w;const E=_e.value.toLowerCase();return w.filter(se=>se.label.toLowerCase().includes(E))}),Je=e.computed(()=>{if(!_e.value)return Ue.value;const M=_e.value.toLowerCase();return Ue.value.filter(w=>w.label.toLowerCase().includes(M))}),Ge=e.computed(()=>Ue.value.filter(M=>!["arraySelect","arrayText"].includes(M.type))),rt=e.computed(()=>Se.value?U.value==="asc"?"Ascending":"Descending":"No sort selected");function Xt(M){J.value===M?be():(J.value=M,_e.value="",ue.value=null)}function be(){J.value=null,_e.value="",ue.value=null}function Wt(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")&&be(),j.value&&ge.value&&!ge.value.contains(M.target)&&(w||(j.value=!1))}e.onMounted(()=>document.addEventListener("click",Wt)),e.onBeforeUnmount(()=>document.removeEventListener("click",Wt));function dt(M){return Z.value[M]?.label||lt(M)}function et(M){return Z.value[M.key]?.filterMode||"contain"}function Et(M){return N(`filter.operators.${M}`)}function tl(M){const w=Z.value[M.key];return(ut[w?.type]||ut.text).map(E=>({...E,label:N(`filter.operators.${E.value}`)}))}function ft(M){return te.has(M)}function qt(M){const w=Z.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 ht(M){return ut[M]?.[0]?.value||"contains"}function Jt(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 wt(M){return Z.value[M.key]?.uniqueValues||[]}function Yt(M){const w=wt(M);if(!_e.value)return w;const E=_e.value.toLowerCase();return w.filter(se=>String(se).toLowerCase().includes(E))}function fe(M){const w=M.value;return!w||w.length===0?N("filter.select"):w.length<=2?w.join(", "):N("filter.selectedCount",{count:w.length})}function H(M){const w=Z.value[M],E=w?.filterMode||"contain",se=w?.type||"text",re=E==="string"?"contains":ht(se);ye.value.push(e.reactive({id:yt++,key:M,operator:re,value:Jt(se,re)})),be()}function Y(M){ye.value=ye.value.filter(w=>w.id!==M)}function ne(M,w){const se=Z.value[w]?.type||"text";M.key=w,M.operator=ht(se),M.value=Jt(se,M.operator),be()}function he(M,w){const E=qt(M);M.operator=w;const se=qt(M);if(E!==se||te.has(w)){const re=Z.value[M.key];M.value=Jt(re?.type||"text",w)}be()}function Xe(M,w){const E=w.target.value;M.value=E===""?null:Number(E)}function Ke(M,w,E){const se=E.target.value,re=se===""?null:Number(se);(!M.value||typeof M.value!="object")&&(M.value={min:null,max:null}),M.value={...M.value,[w]:isNaN(re)?null:re}}function Lt(M,w){const E=M.value||[],se=E.indexOf(w);M.value=se>=0?E.filter(re=>re!==w):[...E,w]}function $e(){ye.value=[],we.value="",be()}function Qe(M){we.value=M.target.value}function Ct(M){Se.value=M.target.value}function el(){U.value=U.value==="asc"?"desc":"asc"}const ie=e.computed(()=>{if(!de.data)return[];let M=de.data;if(we.value){const w=we.value.toLowerCase();M=M.filter(E=>{for(const se of Object.keys(E)){const re=E[se];if(typeof re=="string"&&re.toLowerCase().includes(w)||typeof re=="number"&&String(re).includes(w)||Array.isArray(re)&&re.some(Re=>Re!=null&&(typeof Re=="string"?Re.toLowerCase().includes(w):typeof Re=="object"?Object.values(Re).some(kt=>typeof kt=="string"&&kt.toLowerCase().includes(w)):!1)))return!0}return!1})}for(const w of ye.value){if(!ae(w))continue;const E=Z.value[w.key];E&&(M=M.filter(se=>Ee(se,w,E)))}if(de.showSortBy&&Se.value){const w=Se.value,E=U.value==="asc"?1:-1;M=[...M].sort((se,re)=>X(se?.[w],re?.[w])*E)}return M});function X(M,w){const E=Q(M),se=Q(w);return E==null&&se==null?0:E==null?1:se==null?-1:typeof E=="number"&&typeof se=="number"?E-se:String(E).localeCompare(String(se),void 0,{numeric:!0,sensitivity:"base"})}function Q(M){return M==null||M==="NULL"?null:typeof M=="string"||typeof M=="number"||typeof M=="boolean"?M:M instanceof Date?M.getTime():null}function ae(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 Ee(M,w,E){const se=M?.[w.key],re=w.value,Re=w.operator;if(Re==="is_empty")return Zt(se);if(Re==="is_not_empty")return!Zt(se);const kt=E.type;if(kt==="text"||kt==="arrayText"){const nt=kt==="arrayText"&&Array.isArray(se)?se.filter(Bt=>Bt!=null).map(String).join(" "):se!=null?String(se):"",We=String(re).toLowerCase(),xt=nt.toLowerCase();switch(Re){case"contains":return xt.includes(We);case"not_contains":return!xt.includes(We);case"equals":return xt===We;case"not_equals":return xt!==We;case"starts_with":return xt.startsWith(We);case"ends_with":return xt.endsWith(We);default:return!0}}if(kt==="select")switch(Re){case"is_any_of":return re.includes(se);case"is_none_of":return!re.includes(se);default:return!0}if(kt==="range"||kt==="int"){const nt=typeof se=="number"?se:Number(se);if(typeof nt!="number"||isNaN(nt))return!1;if(Re==="between"){const xt=re?.min!=null?Number(re.min):null,Bt=re?.max!=null?Number(re.max):null,pt=xt!=null&&!isNaN(xt)?xt:null,_t=Bt!=null&&!isNaN(Bt)?Bt:null;return(pt==null||nt>=pt)&&(_t==null||nt<=_t)}const We=typeof re=="number"&&!isNaN(re)?re:Number(re);if(Re==="contains"||Re==="not_contains"){const xt=String(nt),Bt=String(re??"").toLowerCase(),pt=xt.toLowerCase().includes(Bt);return Re==="contains"?pt:!pt}if(typeof We!="number"||isNaN(We))return!1;switch(Re){case"eq":return nt===We;case"neq":return nt!==We;case"gt":return nt>We;case"gte":return nt>=We;case"lt":return nt<We;case"lte":return nt<=We;default:return!0}}if(kt==="arraySelect"){if(!Array.isArray(se))return!1;const nt=se.filter(We=>We!=null).map(We=>E.displayKey&&typeof We=="object"?We[E.displayKey]:String(We));switch(Re){case"contains_any":return nt.some(We=>re.includes(We));case"contains_all":return re.every(We=>nt.includes(We));case"not_contains_any":return!nt.some(We=>re.includes(We));default:return!0}}if(kt==="date"){const nt=je(re);if(!nt||isNaN(nt.getTime()))return!1;const We=je(se);if(!We||isNaN(We.getTime()))return!1;const xt=bt(We),Bt=bt(nt);switch(Re){case"eq":return xt===Bt;case"before":return xt<Bt;case"after":return xt>Bt;default:return!0}}if(kt==="boolean"){const nt=se===!0||se==="true"||se===1,We=se===!1||se==="false"||se===0;switch(Re){case"is_true":return nt;case"is_false":return We;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 bt(M){const w=M.getFullYear(),E=String(M.getMonth()+1).padStart(2,"0"),se=String(M.getDate()).padStart(2,"0");return`${w}-${E}-${se}`}function Zt(M){return!!(M==null||M===""||M==="NULL"||Array.isArray(M)&&M.length===0||Array.isArray(M)&&M.every(w=>w==null))}e.watch(ie,M=>P("update:modelValue",M),{immediate:!0}),e.watch(()=>de.data,()=>{ye.value=[],we.value="",j.value=!1,Se.value="",U.value="asc",be()});function lt(M){return M.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,w=>w.toUpperCase())}function sl(){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 E={};for(const se of Object.keys(w))E[se]=M(w[se]);return E}return w};return{globalSearch:we.value,rows:ye.value.map(w=>({key:w.key,operator:w.operator,value:M(w.value),defType:Z.value[w.key]?.type,defFilterMode:Z.value[w.key]?.filterMode})),filteredCount:ie.value?.length??0}}return ee({getDebugState:sl}),(M,w)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":me.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:ge},[e.createElementVNode("div",Tp,[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(N)("filter.searchAcrossFields"),value:we.value,onInput:Qe},null,40,Ap),we.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:w[0]||(w[0]=E=>we.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:j.value||ye.value.length>0,"dss-filter-funnel-btn--with-sort":de.showSortBy}]),onClick:w[1]||(w[1]=E=>j.value=!j.value),type:"button",title:j.value?e.unref(N)("filter.closeAdvancedFilter"):e.unref(N)("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)),ye.value.length>0?(e.openBlock(),e.createElementBlock("span",Hp,e.toDisplayString(ye.value.length),1)):e.createCommentVNode("",!0)],10,Dp),de.showSortBy?(e.openBlock(),e.createElementBlock("div",Rp,[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:Se.value,onChange:Ct},[w[15]||(w[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ge.value,E=>(e.openBlock(),e.createElementBlock("option",{key:E.key,value:E.key},e.toDisplayString(E.label),9,Ip))),128))],40,Fp),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:el,disabled:!Se.value,title:rt.value},[Se.value?U.value==="asc"?(e.openBlock(),e.createElementBlock("svg",Op,[...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",Wp,[...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",Pp,[...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,zp)])):e.createCommentVNode("",!0)]),j.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:w[13]||(w[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",qp,[ye.value.length===0?(e.openBlock(),e.createElementBlock("div",Zp,e.toDisplayString(e.unref(N)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ye.value,(E,se)=>(e.openBlock(),e.createElementBlock("div",{key:E.id,class:"dss-filter-row"},[e.createElementVNode("span",Up,e.toDisplayString(se===0?e.unref(N)("filter.where"):e.unref(N)("filter.and")),1),e.createElementVNode("div",Xp,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(re=>Xt(`${E.id}:field`),["stop"])},[e.createElementVNode("span",jp,e.toDisplayString(dt(E.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,Yp),J.value===`${E.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]=re=>_e.value=re),placeholder:e.unref(N)("filter.searchAttributes")},null,8,Kp),[[e.vModelText,_e.value]]),e.createElementVNode("ul",Gp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Je.value,re=>(e.openBlock(),e.createElementBlock("li",{key:re.key,class:"dss-filter-popup-item",onClick:Re=>ne(E,re.key)},e.toDisplayString(re.label),9,Qp))),128)),Je.value.length===0?(e.openBlock(),e.createElementBlock("li",Jp,e.toDisplayString(e.unref(N)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),et(E)==="contain"||et(E)==="date"?(e.openBlock(),e.createElementBlock("div",e0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(re=>Xt(`${E.id}:op`),["stop"])},[e.createElementVNode("span",l0,e.toDisplayString(Et(E.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,t0),J.value===`${E.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[4]||(w[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",n0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tl(E),re=>(e.openBlock(),e.createElementBlock("li",{key:re.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:E.operator===re.value}]),onClick:Re=>he(E,re.value)},e.toDisplayString(re.label),11,o0))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),ft(E.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",a0,[et(E)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref(N)("filter.enterValue"),"onUpdate:modelValue":re=>E.value=re},null,8,s0)),[[e.vModelText,E.value]]):et(E)==="date"?(e.openBlock(),e.createElementBlock("div",r0,[e.createVNode(ga,{mode:"single",modelValue:E.value,"onUpdate:modelValue":re=>E.value=re},null,8,["modelValue","onUpdate:modelValue"])])):qt(E)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref(N)("filter.enterValue"),"onUpdate:modelValue":re=>E.value=re},null,8,i0)),[[e.vModelText,E.value]]):qt(E)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref(N)("filter.enterValue"),value:E.value,onInput:re=>Xe(E,re),step:Z.value[E.key]?.type==="int"?1:void 0},null,40,c0)):qt(E)==="between"?(e.openBlock(),e.createElementBlock("div",u0,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(N)("filter.min"),value:E.value?.min,onInput:re=>Ke(E,"min",re),step:Z.value[E.key]?.type==="int"?1:void 0},null,40,d0),e.createElementVNode("span",m0,e.toDisplayString(e.unref(N)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(N)("filter.max"),value:E.value?.max,onInput:re=>Ke(E,"max",re),step:Z.value[E.key]?.type==="int"?1:void 0},null,40,p0)])):qt(E)==="multiselect"?(e.openBlock(),e.createElementBlock("div",v0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(re=>Xt(`${E.id}:val`),["stop"])},[e.createElementVNode("span",h0,e.toDisplayString(fe(E)),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,f0),J.value===`${E.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[6]||(w[6]=e.withModifiers(()=>{},["stop"]))},[wt(E).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[5]||(w[5]=re=>_e.value=re),placeholder:e.unref(N)("filter.search")},null,8,g0)),[[e.vModelText,_e.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",y0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yt(E),re=>(e.openBlock(),e.createElementBlock("li",{key:re,class:"dss-filter-popup-item",onClick:Re=>Lt(E,re)},[e.createElementVNode("input",{type:"checkbox",checked:(E.value||[]).includes(re),tabindex:"-1"},null,8,C0),e.createElementVNode("span",null,e.toDisplayString(re),1)],8,k0))),128)),Yt(E).length===0?(e.openBlock(),e.createElementBlock("li",b0,e.toDisplayString(e.unref(N)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:re=>Y(E.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,w0)]))),128)),e.createElementVNode("div",x0,[e.createElementVNode("div",E0,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:w[7]||(w[7]=e.withModifiers(E=>Xt("add"),["stop"]))},e.toDisplayString(e.unref(N)("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"]))},[Te.value&&!ue.value&&!_e.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]=E=>_e.value=E),placeholder:e.unref(N)("filter.searchAttributes")},null,8,S0),[[e.vModelText,_e.value]]),e.createElementVNode("ul",V0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qe.value,E=>(e.openBlock(),e.createElementBlock("li",{key:E.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:se=>ue.value=E},[e.createElementVNode("span",null,e.toDisplayString(E.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,N0))),128)),ke.value.length>0?(e.openBlock(),e.createElementBlock("li",B0)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ke.value,E=>(e.openBlock(),e.createElementBlock("li",{key:E.key,class:"dss-filter-popup-item",onClick:se=>H(E.key)},e.toDisplayString(E.label),9,M0))),128))])],64)):ue.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:w[9]||(w[9]=E=>ue.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(ue.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[10]||(w[10]=E=>_e.value=E),placeholder:e.unref(N)("filter.searchAttributes")},null,8,_0),[[e.vModelText,_e.value]]),e.createElementVNode("ul",$0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Be.value,E=>(e.openBlock(),e.createElementBlock("li",{key:E.key,class:"dss-filter-popup-item",onClick:se=>H(E.key)},e.toDisplayString(E.label),9,L0))),128)),Be.value.length===0?(e.openBlock(),e.createElementBlock("li",T0,e.toDisplayString(e.unref(N)("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]=E=>_e.value=E),placeholder:e.unref(N)("filter.searchAttributes")},null,8,A0),[[e.vModelText,_e.value]]),e.createElementVNode("ul",D0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Je.value,E=>(e.openBlock(),e.createElementBlock("li",{key:E.key,class:"dss-filter-popup-item",onClick:se=>H(E.key)},e.toDisplayString(E.label),9,H0))),128)),Je.value.length===0?(e.openBlock(),e.createElementBlock("li",R0,e.toDisplayString(e.unref(N)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),ye.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:$e},e.toDisplayString(e.unref(N)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),z0={class:"dss-pill-field__pills"},P0=["data-value"],O0=["disabled"],W0={class:"dss-pill-field__pill-text"},q0={key:0,class:"dss-pill-field__pill-actions"},Z0=["onClick"],U0=["onClick"],X0=["placeholder","disabled"],Y0=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(S,{emit:ee}){const $=S,N=ee,de=e.ref(""),P=e.ref([...$.modelValue]),T=e.ref(null);let me=null;const ut=e.ref(null),te=e.ref(""),f=e.ref(null),we=e.ref(null),ye=e.computed(()=>{if(!we.value)return;const{width:Te,height:qe}=we.value;return{minWidth:`${Te}px`,height:`${qe}px`}});function J(Te,qe){ut.value===qe&&(f.value=Te)}function j(){ut.value=null,te.value="",we.value=null,f.value=null}const ge=e.computed(()=>new Set(P.value.map(Te=>Te.trim()).filter(Boolean)));function _e(Te){T.value=Te,me&&clearTimeout(me),me=setTimeout(()=>{T.value=null,me=null},900)}function ue(Te){const qe=Te.trim();return qe?ge.value.has(qe)?(_e(qe),!1):(P.value=[...P.value,qe],N("update:modelValue",[...P.value]),!0):!1}function Se(Te){const qe=Te.split(/\r?\n/g).map(Ge=>Ge.trim()).filter(Boolean);if(!qe.length)return;const ke=new Set(P.value.map(Ge=>Ge.trim()).filter(Boolean)),Be=[...P.value];let Je=null;for(const Ge of qe){if(ke.has(Ge)){Je??=Ge;continue}ke.add(Ge),Be.push(Ge)}Be.length!==P.value.length&&(P.value=Be,N("update:modelValue",[...P.value])),Je&&_e(Je)}function U(Te){$.disabled||(ut.value===Te&&j(),P.value=P.value.filter((qe,ke)=>ke!==Te),N("update:modelValue",[...P.value]))}async function yt(Te,qe){if($.disabled)return;const ke=qe.currentTarget.closest(".dss-pill-field__pill");ke&&(we.value={width:ke.offsetWidth,height:ke.offsetHeight}),ut.value=Te,te.value=P.value[Te]??"",await e.nextTick();const Be=f.value;if(!Be)return;Be.focus();const Je=Be.value.length;Be.setSelectionRange(Je,Je)}function st(){j()}function De(){if($.disabled||ut.value===null)return;const Te=ut.value,qe=P.value[Te]??"",ke=te.value.trim();if(j(),ke!==qe&&ge.value.has(ke)){_e(ke);return}if(!ke){P.value=P.value.filter((Je,Ge)=>Ge!==Te),N("update:modelValue",[...P.value]);return}const Be=P.value.map((Je,Ge)=>Ge===Te?ke:Je);P.value=Be,N("update:modelValue",[...P.value])}function Ue(Te){Te.preventDefault(),!$.disabled&&(ue(de.value),de.value="")}function Z(Te){if($.disabled)return;const qe=Te.clipboardData?.getData("text")??"";!qe.includes(`
120
+ `)&&!qe.includes("\r")||(Te.preventDefault(),Se(qe),de.value="")}return e.watch(()=>$.modelValue,Te=>{P.value=Array.isArray(Te)?[...Te]:[]},{deep:!0}),e.onBeforeUnmount(()=>{me&&clearTimeout(me)}),(Te,qe)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":Te.disabled}])},[e.createElementVNode("div",z0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(ke,Be)=>(e.openBlock(),e.createElementBlock("span",{key:ke,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":T.value===ke,"dss-pill-field__pill--editing":ut.value===Be}]),style:e.normalizeStyle(ut.value===Be&&we.value?ye.value:void 0)},[ut.value===Be?(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:Je=>J(Je,Be),"onUpdate:modelValue":qe[0]||(qe[0]=Je=>te.value=Je),class:"dss-pill-field__pill-edit",type:"text",disabled:Te.disabled,onKeydown:[e.withKeys(De,["enter"]),e.withKeys(st,["esc"])],onBlur:De},null,40,O0),[[e.vModelText,te.value]])],8,P0)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",W0,e.toDisplayString(ke),1),Te.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",q0,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:Je=>yt(Be,Je)},[...qe[2]||(qe[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,Z0),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:Je=>U(Be)}," × ",8,U0)]))],64))],6))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":qe[1]||(qe[1]=ke=>de.value=ke),class:"dss-pill-field__input",type:"text",placeholder:P.value.length?"":Te.placeholder,disabled:Te.disabled,onPaste:Z,onKeydown:e.withKeys(Ue,["enter"])},null,40,X0),[[e.vModelText,de.value]])])],2))}}),j0={key:0,class:"dss-title dss-title--separator"},K0={__name:"DSSTitle",props:{type:{type:String,default:"main",validator:S=>["main","separator","subtitle"].includes(S)},h:{type:Number,default:null,validator:S=>S===null||Number.isInteger(S)&&S>=1&&S<=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(S,{expose:ee,emit:$}){const N=S,de=$,P=e.ref(null),T=e.computed(()=>`dss-title--${N.type}`),me=e.computed(()=>N.h!=null?`dss-title--h${N.h}`:null),ut={main:"div",subtitle:"p",separator:"span"},te=e.computed(()=>N.h!=null?`h${N.h}`:ut[N.type]??"div"),f=e.computed(()=>N.editable?"plaintext-only":void 0),we=e.computed(()=>{const ue={};return N.size!=null&&(ue.fontSize=typeof N.size=="number"?`${N.size}px`:N.size),N.weight!=null&&(ue.fontWeight=N.weight),N.color!=null&&(ue.color=N.color),Object.keys(ue).length?ue:void 0}),ye=e.computed(()=>N.editable?{input:j,keydown:ge,paste:_e}:{}),J=()=>{const ue=P.value;!N.editable||!ue||document.activeElement!==ue&&(ue.innerText=N.modelValue??"")},j=ue=>{const Se=ue.target.innerText;de("update:modelValue",Se),de("change",Se)},ge=ue=>{ue.key==="Enter"&&ue.preventDefault()},_e=ue=>{ue.preventDefault();const Se=(ue.clipboardData||window.clipboardData).getData("text/plain");document.execCommand("insertText",!1,Se)};return e.watch(()=>N.modelValue,()=>{J()}),e.watch(()=>N.editable,()=>{e.nextTick(J)}),e.onMounted(()=>{e.nextTick(J)}),ee({focus:()=>P.value?.focus()}),(ue,Se)=>S.type==="separator"?(e.openBlock(),e.createElementBlock("div",j0,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(te.value),e.mergeProps({ref_key:"titleRef",ref:P,class:["dss-title__separator-label",me.value,{"dss-title--editable":S.editable}],style:we.value,contenteditable:f.value,spellcheck:S.editable?!1:void 0},e.toHandlers(ye.value)),{default:e.withCtx(()=>[S.editable?e.createCommentVNode("",!0):e.renderSlot(ue.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(S.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,me.value,{"dss-title--editable":S.editable}]],style:we.value,contenteditable:f.value,spellcheck:S.editable?!1:void 0},e.toHandlers(ye.value)),{default:e.withCtx(()=>[S.editable?e.createCommentVNode("",!0):e.renderSlot(ue.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(S.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))}},G0={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"}},Q0={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"},J0={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"}},e9={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"}},t9={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"}},ho={chart:G0,table:Q0,filter:J0,datepicker:e9,textEditor:t9},l9={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"}},n9={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"},o9={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"}},a9={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"}},s9={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"}},go={chart:l9,table:n9,filter:o9,datepicker:a9,textEditor:s9},r9={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"}},i9={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"},c9={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"}},u9={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"}},d9={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"}},yo={chart:r9,table:i9,filter:c9,datepicker:u9,textEditor:d9},qo={en:ho,fr:go,nl:yo};function Fa(S){if(!S||!S.global)return;const ee=S.global.availableLocales||[];Object.keys(qo).forEach($=>{ee.includes($)&&S.global.mergeLocaleMessage($,qo[$])})}const Zo={en:{textEditor:ho.textEditor},fr:{textEditor:go.textEditor},nl:{textEditor:yo.textEditor}};function Ia(S){if(!S||!S.global)return;const ee=S.global.availableLocales||[];Object.keys(Zo).forEach($=>{ee.includes($)&&S.global.mergeLocaleMessage($,Zo[$])})}const Uo={en:{table:ho.table},fr:{table:go.table},nl:{table:yo.table}};function za(S){if(!S||!S.global)return;const ee=S.global.availableLocales||[];Object.keys(Uo).forEach($=>{ee.includes($)&&S.global.mergeLocaleMessage($,Uo[$])})}const Xo={en:{datepicker:ho.datepicker},fr:{datepicker:go.datepicker},nl:{datepicker:yo.datepicker}};function Pa(S){if(!S||!S.global)return;const ee=S.global.availableLocales||[];Object.keys(Xo).forEach($=>{ee.includes($)&&S.global.mergeLocaleMessage($,Xo[$])})}const Yo={en:{filter:ho.filter},fr:{filter:go.filter},nl:{filter:yo.filter}};function Oa(S){if(!S||!S.global)return;const ee=S.global.availableLocales||[];Object.keys(Yo).forEach($=>{ee.includes($)&&S.global.mergeLocaleMessage($,Yo[$])})}const m9={chart:qo,textEditor:Zo,table:Uo,datepicker:Xo,filter:Yo};function p9(S){!S||!S.global||(Fa(S),Ia(S),za(S),Pa(S),Oa(S))}const v9={en:{...ho},fr:{...go},nl:{...yo}};fo.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:v9});exports.DSSChart=hu;exports.DSSChartMessages=qo;exports.DSSColorPicker=op;exports.DSSConfetti=Lp;exports.DSSDatepicker=ga;exports.DSSDatepickerMessages=Xo;exports.DSSDnd=_p;exports.DSSFilter=I0;exports.DSSFilterMessages=Yo;exports.DSSLoader=gp;exports.DSSMessages=m9;exports.DSSModal=ha;exports.DSSPillField=Y0;exports.DSSSkeleton=yp;exports.DSSStepBar=Ra;exports.DSSTable=Fd;exports.DSSTableMessages=Uo;exports.DSSTextEditor=O2;exports.DSSTextEditorMessages=Zo;exports.DSSTitle=K0;exports.addDSSChartTranslations=Fa;exports.addDSSDatepickerTranslations=Pa;exports.addDSSFilterTranslations=Oa;exports.addDSSTableTranslations=za;exports.addDSSTextEditorTranslations=Ia;exports.addDSSTranslations=p9;