dsp-semactic 0.7.12 → 0.7.14

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"),ho=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={key:3,class:"dss-datepicker__range-field"},Bs=["placeholder","value"],_s={key:0,class:"dss-datepicker__comparison-summary"},Ms={key:0,class:"dss-datepicker__comparison-value"},$s=["aria-selected","onClick"],Ls={class:"dss-datepicker__list-item-label"},Ts={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"},Ds={key:1,class:"dss-datepicker__list-empty"},As={key:1,class:"dss-datepicker__double-wrap"},Hs={key:0,class:"dss-datepicker__side-panel"},Rs={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},Fs=["disabled","onClick"],Is={key:1,class:"dss-datepicker__comparison-panel"},zs={key:0,class:"dss-datepicker__comparison-modes"},Ps=["onClick"],Os={class:"dss-datepicker__double-content"},Ws={class:"dss-datepicker__double-calendars"},qs={class:"dss-datepicker__double-calendar"},Zs={class:"dss-datepicker__calendar-header"},Us=["aria-label"],Ys={class:"dss-datepicker__month-year-row"},Xs=["aria-label"],js={class:"dss-datepicker__weekdays"},Ks={class:"dss-datepicker__grid"},Gs=["disabled","onClick","onMouseenter"],Qs={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Js={class:"dss-datepicker__double-calendar"},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={key:0,class:"dss-datepicker__comparison-panel dss-datepicker__comparison-panel--bottom"},cr={key:0,class:"dss-datepicker__comparison-modes dss-datepicker__comparison-modes--inline"},ur=["onClick"],dr={key:0,class:"dss-datepicker__comparison-panel dss-datepicker__comparison-panel--single"},mr={key:0,class:"dss-datepicker__comparison-modes"},pr=["onClick"],vr={class:"dss-datepicker__calendar-header"},fr=["aria-label"],hr={class:"dss-datepicker__month-year-row"},gr=["aria-label"],yr={class:"dss-datepicker__weekdays"},kr={class:"dss-datepicker__grid"},Cr=["disabled","onClick","onMouseenter"],br={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},wr={class:"dss-datepicker__calendar-header"},xr={class:"dss-datepicker__month-year-row"},Er={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},Sr={class:"dss-datepicker__months-grid"},Vr=["onClick"],Nr={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},Br={class:"dss-datepicker__month-year"},_r={class:"dss-datepicker__years-grid"},Mr=["data-year","onClick"],Aa=27,Xn=8,ga={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:_=>["single","range","singleFromAvailable","rangeFromAvailable","listFromAvailable","readonly"].includes(_)},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},quickSelectOptions:{type:Array,default:null},comparisonEnabled:{type:Boolean,default:!1},comparisonValue:{type:Object,default:()=>({start:null,end:null})},comparisonControlsPlacement:{type:String,default:"side",validator:_=>["side","bottom"].includes(_)},comparisonModeOptions:{type:Array,default:null},placeholder:{type:String,default:""}},emits:["update:modelValue","update:comparisonValue"],setup(_,{emit:J}){const N=_,L=J,{t:oe,locale:W}=ho.useI18n(),A=e.ref(!1),de=e.ref("days"),dt=new Date,ee=e.computed(()=>N.minDate instanceof Date?N.minDate:dt),h=e.ref(ee.value.getMonth()),we=e.ref(ee.value.getFullYear()),ye=e.ref(ee.value.getMonth()),Q=e.ref(ee.value.getFullYear()),K=e.ref(ee.value.getMonth()),he=e.ref(ee.value.getFullYear()),Re=e.ref("start"),ge=e.ref("start"),Ae=e.ref(null),Z=e.ref(null),Oe=e.ref(!1),Ye=e.ref("previousPeriod"),_e=e.ref("primary"),Xe=e.ref({start:null,end:null});function U(){const k=ee.value,S=k.getMonth(),x=k.getFullYear(),j=S===11?0:S+1,Ce=S===11?x+1:x;return{left:{month:S,year:x},right:{month:j,year:Ce}}}const He=e.ref(null),Ke=e.ref(null),ke=e.ref(null),Me=e.ref(null),rt=e.ref(null),gt=e.ref(null),mt=e.ref(null),Qt=e.ref(null),xe=new Date().getFullYear(),Jt=e.computed(()=>["single","singleFromAvailable"].includes(N.mode)),et=e.computed(()=>["range","rangeFromAvailable"].includes(N.mode)),lt=e.computed(()=>N.mode==="listFromAvailable"),yt=e.computed(()=>{if(!["single","singleFromAvailable","listFromAvailable"].includes(N.mode))return null;const k=N.modelValue;return k instanceof Date?k:null}),Rt=e.computed(()=>{if(!et.value)return{start:null,end:null};const k=N.modelValue;return!k||typeof k!="object"?{start:null,end:null}:{start:k.start instanceof Date?k.start:null,end:k.end instanceof Date?k.end:null}}),ct=e.computed(()=>Et(N.comparisonValue)),xt=e.computed(()=>N.comparisonEnabled&&et.value),pt=e.computed(()=>xt.value&&N.comparisonControlsPlacement==="side"),Xt=e.computed(()=>xt.value&&N.comparisonControlsPlacement==="bottom"),kt=e.computed(()=>xt.value&&Oe.value&&Ye.value==="custom"&&_e.value==="comparison"),Pt={previousPeriod:"datepicker.comparison.previousPeriod",previousYear:"datepicker.comparison.previousYear",custom:"datepicker.comparison.custom"},pe=[{id:"previousPeriod",labelKey:"datepicker.comparison.previousPeriod"},{id:"previousYear",labelKey:"datepicker.comparison.previousYear"},{id:"custom",labelKey:"datepicker.comparison.custom"}],H=e.computed(()=>{const S=(Array.isArray(N.comparisonModeOptions)&&N.comparisonModeOptions.length?N.comparisonModeOptions:pe).map(x=>typeof x=="string"?{id:x,labelKey:Pt[x]}:!x||typeof x!="object"||!x.id?null:{...x,labelKey:x.labelKey||Pt[x.id]}).filter(x=>x&&Pt[x.id]);return S.length?S:pe});function Y(k){return k.label?k.label:k.labelKey?oe(k.labelKey):k.id}function re(k){return H.value.some(S=>S.id===k)}function fe(){if(re(Ye.value))return;const k=H.value[0]?.id||"previousPeriod";Ye.value=k,_e.value=k==="custom"?"comparison":"primary",Oe.value&&k!=="custom"&&Bl()}function ze(k){if(!k||!(k instanceof Date))return"";const S=k.getDate(),x=k.getMonth()+1,j=k.getFullYear(),Ce=qe=>String(qe).padStart(2,"0");return`${Ce(S)}/${Ce(x)}/${j}`}function tt(k){return k instanceof Date&&!Number.isNaN(k.getTime())?new Date(k.getFullYear(),k.getMonth(),k.getDate()):null}function Et(k){return!k||typeof k!="object"?{start:null,end:null}:{start:tt(k.start),end:tt(k.end)}}function Se(k){const S=Et(k),{start:x,end:j}=S;return x&&j&&x>j?{start:j,end:x}:S}function nt(k){const{start:S,end:x}=Se(k);return!S&&!x?"":!S||!x?ze(S||x):S&&x&&yl(S,x)?ze(S):`${ze(S||x)} - ${ze(x||S)}`}const Ct=e.computed(()=>ze(yt.value)),tl=e.computed(()=>nt(Rt.value)),ie=e.computed(()=>nt(ct.value)),X=e.computed(()=>{if(N.mode!=="readonly")return"—";const k=N.modelValue;if(k instanceof Date)return ze(k)||"—";if(k&&typeof k=="object"&&("start"in k||"end"in k)){const S=k.start instanceof Date?k.start:null,x=k.end instanceof Date?k.end:null;if(!S&&!x)return"—";const j=!x||S&&S<=x?S:x,Ce=!S||x&&x>=S?x:S;return yl(j,Ce)?ze(j):`${ze(j)} - ${ze(Ce)}`}return"—"});e.computed(()=>{const k=new Date(we.value,h.value,1);return new Intl.DateTimeFormat(W.value,{month:"long",year:"numeric"}).format(k)});const te=e.computed(()=>Z.value==="left"?ye.value:Z.value==="right"?K.value:h.value),ce=e.computed(()=>Z.value==="left"?Q.value:Z.value==="right"?he.value:we.value),Ve=e.computed(()=>{const k=new Date(we.value,h.value,1);return new Intl.DateTimeFormat(W.value,{month:"long"}).format(k)}),ot=e.computed(()=>{const k=new Date(ce.value,te.value,1);return new Intl.DateTimeFormat(W.value,{month:"long"}).format(k)}),wt=e.computed(()=>{const k=new Intl.DateTimeFormat(W.value,{month:"short"});return Array.from({length:12},(S,x)=>k.format(new Date(2024,x,1)))}),dl=e.computed(()=>{const S=(Z.value?ce.value:we.value)-Math.floor(Aa/2);return Array.from({length:Aa},(x,j)=>S+j)}),Vt=e.computed(()=>{const k=dl.value;return k.length?`${k[0]} – ${k[k.length-1]}`:""});function sl(k){return k===7?0:k}function D(k){try{const S=new Intl.Locale(k);if(S.weekInfo?.firstDay!=null)return sl(S.weekInfo.firstDay)}catch{}return 1}function V(k){const S=new Date(2024,0,1),x=(S.getDay()-k+7)%7,j=new Date(S);return j.setDate(S.getDate()-x),j}const B=e.computed(()=>D(W.value)),ae=e.computed(()=>{const k=new Intl.DateTimeFormat(W.value,{weekday:"short"}),S=V(B.value),x=[];for(let j=0;j<7;j++){const Ce=new Date(S);Ce.setDate(S.getDate()+j),x.push(k.format(Ce).slice(0,2))}return x});function se(k,S,x){const j=new Date(k,S,1),Ce=new Date(k,S+1,0),qe=(j.getDay()-x+7)%7,Fe=Ce.getDate(),at=[];for(let f=0;f<qe;f++)at.push(null);for(let f=1;f<=Fe;f++)at.push(new Date(k,S,f));return at}const je=e.computed(()=>se(we.value,h.value,B.value)),St=e.computed(()=>se(Q.value,ye.value,B.value)),ut=e.computed(()=>se(he.value,K.value,B.value));e.computed(()=>{const k=new Date(Q.value,ye.value,1);return new Intl.DateTimeFormat(W.value,{month:"long",year:"numeric"}).format(k)}),e.computed(()=>{const k=new Date(he.value,K.value,1);return new Intl.DateTimeFormat(W.value,{month:"long",year:"numeric"}).format(k)});const Ge=e.computed(()=>{const k=new Date(Q.value,ye.value,1);return new Intl.DateTimeFormat(W.value,{month:"long"}).format(k)}),_t=e.computed(()=>{const k=new Date(he.value,K.value,1);return new Intl.DateTimeFormat(W.value,{month:"long"}).format(k)}),Nt=e.computed(()=>N.availableDates&&N.availableDates.length>0),vt={all:"datepicker.quickSelect.allDates",last2:"datepicker.quickSelect.last2Dates",last3:"datepicker.quickSelect.last3Dates",last4:"datepicker.quickSelect.last4Dates",last5:"datepicker.quickSelect.last5Dates",today:"datepicker.quickSelect.today",lastWeek:"datepicker.quickSelect.lastWeek",last15Days:"datepicker.quickSelect.last15Days",last30Days:"datepicker.quickSelect.last30Days",thisMonth:"datepicker.quickSelect.thisMonth",lastMonth:"datepicker.quickSelect.lastMonth",last3Months:"datepicker.quickSelect.last3Months",last6Months:"datepicker.quickSelect.last6Months",last12Months:"datepicker.quickSelect.last12Months",lastYear:"datepicker.quickSelect.lastYear"},Lt=e.computed(()=>Nt.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:"lastMonth",labelKey:"datepicker.quickSelect.lastMonth"},{id:"last3Months",labelKey:"datepicker.quickSelect.last3Months"},{id:"last6Months",labelKey:"datepicker.quickSelect.last6Months"},{id:"last12Months",labelKey:"datepicker.quickSelect.last12Months"},{id:"lastYear",labelKey:"datepicker.quickSelect.lastYear"}]),Ht=e.computed(()=>(Array.isArray(N.quickSelectOptions)&&N.quickSelectOptions.length?N.quickSelectOptions:Lt.value).map(S=>typeof S=="string"?{id:S,labelKey:vt[S]}:!S||typeof S!="object"||!S.id?null:{...S,labelKey:S.labelKey||vt[S.id]}).filter(S=>S&&S.id));function Mt(k){return k.label?k.label:k.labelKey?oe(k.labelKey):k.id}const wl=e.ref({top:0,left:0}),jl=e.ref("left");let El=null;function rl(){A.value&&e.nextTick(()=>{A.value&&(El!==null&&window.cancelAnimationFrame(El),El=window.requestAnimationFrame(()=>{El=null,ml()}))})}function ml(){if(!rt.value||!A.value)return;const k=rt.value.getBoundingClientRect(),S=window.innerWidth||document.documentElement.clientWidth,x=window.innerHeight||document.documentElement.clientHeight;let j=k.left,Ce=k.bottom+4;const qe=gt.value;if(qe){const Fe=qe.offsetWidth,at=qe.offsetHeight;jl.value==="right"||j+Fe>S-Xn?(jl.value="right",j=k.right-Fe):jl.value="left";const g=Math.max(Xn,S-Fe-Xn);if(j=Math.min(Math.max(j,Xn),g),Ce+at>x-Xn){const E=k.top-4-at;E>=Xn?Ce=E:Ce=Math.max(Xn,x-at-Xn)}}wl.value={top:Ce,left:j}}const un=e.computed(()=>!rt.value||!A.value?{}:{position:"fixed",left:`${wl.value.left}px`,top:`${wl.value.top}px`,zIndex:1002});function yl(k,S){return!k||!S?!1:k.getFullYear()===S.getFullYear()&&k.getMonth()===S.getMonth()&&k.getDate()===S.getDate()}function ft(k){return new Date(k.getFullYear(),k.getMonth(),k.getDate()).getTime()}function zl(k){return!N.availableDates||!N.availableDates.length?!0:N.availableDates.some(S=>S instanceof Date&&yl(S,k))}function Kl(k){const S=ft(k);return!(N.minDate instanceof Date&&S<ft(N.minDate)||N.maxDate instanceof Date&&S>ft(N.maxDate))}function Hl(k){const S=new Date(k);return new Date(S.getFullYear(),S.getMonth(),S.getDate())}function Rn(k){return Math.floor(Date.UTC(k.getFullYear(),k.getMonth(),k.getDate())/864e5)}function Gl(k,S){return new Date(k.getFullYear(),k.getMonth(),k.getDate()+S)}function bn(k){return k.filter(S=>Kl(S))}function Bn(k,S){if(!(k instanceof Date)||!(S instanceof Date))return null;let x=ft(k),j=ft(S);if(x>j&&([x,j]=[j,x]),N.minDate instanceof Date){const Ce=ft(N.minDate);x=Math.max(x,Ce),j=Math.max(j,Ce)}if(N.maxDate instanceof Date){const Ce=ft(N.maxDate);x=Math.min(x,Ce),j=Math.min(j,Ce)}return x>j?null:{start:Hl(x),end:Hl(j)}}function nn(k){return!N.exceptDates||!N.exceptDates.length?!1:N.exceptDates.some(S=>S instanceof Date&&yl(S,k))}function Rl(k){return nn(k)?!1:["singleFromAvailable","rangeFromAvailable"].includes(N.mode)?zl(k)&&Kl(k):Kl(k)}function dn(k){const S=yt.value,x=Rt.value,j=ct.value,Ce=ft(k),qe=et.value&&x.start&&x.end&&Ce>Math.min(ft(x.start),ft(x.end))&&Ce<Math.max(ft(x.start),ft(x.end)),Fe=et.value&&x.start&&yl(k,x.start),at=et.value&&x.end&&yl(k,x.end),f=Fe&&at,g=xt.value&&Oe.value,E=g&&j.start&&yl(k,j.start),F=g&&j.end&&yl(k,j.end),z=E&&F,Qe=g&&j.start&&j.end&&Ce>Math.min(ft(j.start),ft(j.end))&&Ce<Math.max(ft(j.start),ft(j.end)),Te=Jt.value&&S&&yl(k,S)||Fe||at;let Ft=!1,Le=!1;const st=kt.value?j:x;if(et.value&&st.start&&!st.end&&Ae.value){const ne=ft(st.start),ll=ft(Ae.value),Ze=Math.min(ne,ll),Kn=Math.max(ne,ll);kt.value?Le=Ce>Ze&&Ce<Kn:Ft=Ce>Ze&&Ce<Kn}return{"dss-datepicker__day--comparison-start":E&&!z&&!Te,"dss-datepicker__day--comparison-end":F&&!z&&!Te,"dss-datepicker__day--comparison-single":z&&!Te,"dss-datepicker__day--in-comparison-range":Qe&&!E&&!F&&!Fe&&!at,"dss-datepicker__day--in-comparison-preview":Le&&!E&&!F&&!Qe&&!Fe&&!at,"dss-datepicker__day--selected":Te&&!f,"dss-datepicker__day--range-start":Fe&&!f,"dss-datepicker__day--range-end":at&&!f,"dss-datepicker__day--range-single":f,"dss-datepicker__day--in-range":qe&&!Fe&&!at,"dss-datepicker__day--in-range-preview":Ft&&!Fe&&!at&&!qe,"dss-datepicker__day--disabled":!Rl(k)}}function Sl(k){if(!et.value)return;const S=kt.value?ct.value:Rt.value;if(!S.start||S.end){Ae.value=null;return}if(!Rl(k)){Ae.value=null;return}Ae.value=new Date(k.getFullYear(),k.getMonth(),k.getDate())}function mn(){Ae.value=null}function Wl(k=Rt.value){if(!N.doubleCalendar||!et.value)return;const S=Et(k),{start:x,end:j}=S;if(x&&j){const Fe=x<=j?x:j,at=x<=j?j:x,f=Fe.getMonth(),g=Fe.getFullYear(),E=at.getMonth(),F=at.getFullYear();if(f!==E||g!==F){const z=ye.value===f&&Q.value===g,Qe=K.value===E&&he.value===F;if(z&&Qe)return;ye.value=f,Q.value=g,K.value=E,he.value=F}else{const z=f===0?11:f-1,Qe=f===0?g-1:g;ye.value===z&&Q.value===Qe&&K.value===f&&he.value===g||(ye.value=f,Q.value=g,f===11?(K.value=0,he.value=g+1):(K.value=f+1,he.value=g))}return}const Ce=x||j;if(Ce){const Fe=Ce.getMonth(),at=Ce.getFullYear(),f=ye.value===Fe&&Q.value===at,g=K.value===Fe&&he.value===at;if(f||g)return;ye.value=Fe,Q.value=at,Fe===11?(K.value=0,he.value=at+1):(K.value=Fe+1,he.value=at);return}const qe=U();ye.value=qe.left.month,Q.value=qe.left.year,K.value=qe.right.month,he.value=qe.right.year}const pn=e.computed(()=>new Intl.DateTimeFormat(W.value,{day:"2-digit",month:"long",year:"numeric"})),on=e.computed(()=>{if(!lt.value)return[];const k=(N.availableDates||[]).filter(x=>x instanceof Date&&!Number.isNaN(x.getTime())).filter(x=>!nn(x)&&Kl(x)).map(x=>new Date(x.getFullYear(),x.getMonth(),x.getDate()));k.sort((x,j)=>j.getTime()-x.getTime());const S=yt.value;return k.map(x=>({date:x,ts:x.getTime(),label:pn.value.format(x),selected:!!(S&&yl(x,S))}))});function il(){if(A.value){ql();return}rt.value=Me.value?.closest(".dss-datepicker__input-wrap"),jl.value="left",A.value=!0,rl(),e.nextTick(()=>{Qt.value?.querySelector(".dss-datepicker__list-item--selected")?.scrollIntoView({block:"nearest",behavior:"auto"})})}function jn(k){if(!(k instanceof Date))return;const S=new Date(k.getFullYear(),k.getMonth(),k.getDate());L("update:modelValue",S),ql()}function Fn(k="start"){if(N.mode==="readonly")return;Re.value=k;const S=yt.value,x=Rt.value;if(Jt.value&&S)h.value=S.getMonth(),we.value=S.getFullYear();else if(et.value)if(N.doubleCalendar)Wl();else{const j=k==="start"&&x.start?x.start:x.end||x.start;j&&(h.value=j.getMonth(),we.value=j.getFullYear())}rt.value=Jt.value?He.value?.closest(".dss-datepicker__input-wrap"):Ke.value,de.value="days",Z.value=null,jl.value="left",A.value=!0,rl()}function ql(){de.value="days",Z.value=null,Ae.value=null,A.value=!1}function vn(k,S){Z.value=k,de.value=S}function Ll(){de.value="days",Z.value=null}function In(k,S,x,j){const Ce=new Date(S,x,j);let qe,Fe;switch(k){case"today":qe=Ce,Fe=Ce;break;case"lastWeek":qe=new Date(S,x,j-6),Fe=Ce;break;case"last15Days":qe=new Date(S,x,j-14),Fe=Ce;break;case"last30Days":qe=new Date(S,x,j-29),Fe=Ce;break;case"thisMonth":qe=new Date(S,x,1),Fe=Ce;break;case"lastMonth":qe=new Date(S,x-1,1),Fe=new Date(S,x,0);break;case"last3Months":qe=new Date(S,x-3,1),Fe=new Date(S,x,0);break;case"last6Months":qe=new Date(S,x-6,1),Fe=new Date(S,x,0);break;case"last12Months":qe=new Date(S,x-12,1),Fe=new Date(S,x,0);break;case"lastYear":qe=new Date(S-1,0,1),Fe=new Date(S-1,11,31);break;default:return null}return{start:qe,end:Fe}}function fn(k){const S=new Date,x=S.getFullYear(),j=S.getMonth(),Ce=S.getDate();let qe,Fe;if(Nt.value){const at=bn([...N.availableDates].filter(f=>f instanceof Date).map(f=>new Date(f.getFullYear(),f.getMonth(),f.getDate()))).sort((f,g)=>f.getTime()-g.getTime());if(at.length===0)return null;if(k==="all")qe=at[0],Fe=at[at.length-1];else{const f=parseInt(k.replace("last",""),10);if(Number.isInteger(f)&&f>=2&&f<=5){const g=at.slice(-f);if(g.length===0)return null;qe=g[0],Fe=g[g.length-1]}else{const g=In(k,x,j,Ce);if(!g)return null;const E=hn(g);if(!E.length)return null;qe=E[0],Fe=E[E.length-1]}}}else{const at=In(k,x,j,Ce);if(!at)return null;qe=at.start,Fe=at.end}return{start:qe,end:Fe}}function cl(k){const S=fn(k);return S?Bn(S.start,S.end):null}function jt(k){return cl(k)!==null}function Kt(k){const S=cl(k);S&&(L("update:modelValue",S),Wl())}function Yt(k){return!!(k&&k.start instanceof Date&&k.end instanceof Date)}function Tl(k){L("update:comparisonValue",Et(k))}function Tt(k=ct.value){const S=Et(k);Yt(S)&&(Xe.value=S)}function bt(){return Yt(Xe.value)?(Tl(Xe.value),N.doubleCalendar&&Wl(Xe.value),!0):!1}function Vl(k){const S=Se(k);return Yt(S)?Rl(S.start)&&Rl(S.end):!1}function hn(k){const S=Se(k);if(!Yt(S))return[];const x=ft(S.start),j=ft(S.end);return(N.availableDates||[]).filter(Ce=>Ce instanceof Date&&!Number.isNaN(Ce.getTime())).map(Ce=>tt(Ce)).filter(Ce=>{const qe=ft(Ce);return qe>=x&&qe<=j&&Rl(Ce)}).sort((Ce,qe)=>ft(Ce)-ft(qe))}function Nl(k){if(!(k instanceof Date))return null;const S=new Date(k.getFullYear()-1,k.getMonth(),k.getDate());return S.getMonth()!==k.getMonth()?new Date(k.getFullYear()-1,k.getMonth()+1,0):S}function gn(k=Ye.value){const S=Se(Rt.value);if(!Yt(S))return{start:null,end:null};let x,j;if(k==="previousPeriod"){const qe=Rn(S.end)-Rn(S.start)+1;j=Gl(S.start,-1),x=Gl(j,-(qe-1))}else if(k==="previousYear")x=Nl(S.start),j=Nl(S.end);else return ct.value;let Ce=Se({start:x,end:j});if(N.mode==="rangeFromAvailable"&&N.availableDates?.length){const qe=hn(Ce);if(!qe.length)return{start:null,end:null};Ce={start:qe[0],end:qe[qe.length-1]}}return Vl(Ce)?Ce:{start:null,end:null}}function Bl(){!xt.value||!Oe.value||Ye.value==="custom"||Tl(gn())}function Zl(){if(xt.value){if(Oe.value=!Oe.value,!Oe.value){Ye.value==="custom"&&Tt(),_e.value="primary",Tl({start:null,end:null});return}if(Ye.value==="custom"){_e.value="comparison",bt();return}_e.value="primary",Bl()}}function an(k){if(re(k)){if(Ye.value=k,Ae.value=null,k==="custom"){if(_e.value="comparison",bt())return;N.doubleCalendar&&Yt(ct.value)&&Wl(ct.value);return}_e.value="primary",Bl()}}function Dl(k,S,x){const j=Et(k);return!j.start&&!j.end?(x.value="end",{start:S,end:null}):j.start&&j.end?(x.value="end",{start:S,end:null}):x.value==="start"?(x.value="end",Se({start:S,end:j.end})):(x.value="start",Se({start:j.start,end:S}))}function Gt(k){Z.value==="left"?ye.value=k:Z.value==="right"?K.value=k:h.value=k,Ll()}function zn(k){Z.value==="left"?Q.value=k:Z.value==="right"?he.value=k:we.value=k,Ll()}function Pl(){h.value===0?(h.value=11,we.value--):h.value--}function Dt(){h.value===11?(h.value=0,we.value++):h.value++}function Pn(){ye.value===0?(ye.value=11,Q.value--):ye.value--}function el(){ye.value===11?(ye.value=0,Q.value++):ye.value++}function _l(){K.value===0?(K.value=11,he.value--):K.value--}function yn(){K.value===11?(K.value=0,he.value++):K.value++}function sn(k){if(!Rl(k))return;const S=new Date(k.getFullYear(),k.getMonth(),k.getDate());if(Jt.value){L("update:modelValue",S),ql();return}if(kt.value){const j=Dl(ct.value,S,ge);Yt(j)&&Tt(j),Tl(j);return}_e.value="primary";const x=Dl(Rt.value,S,Re);L("update:modelValue",x)}e.watch(Rt,()=>{N.doubleCalendar&&et.value&&A.value&&Wl(),Bl()},{deep:!0}),e.watch(()=>N.comparisonEnabled,k=>{if(fe(),!k){Oe.value=!1,_e.value="primary";return}Yt(ct.value)?Oe.value=!0:Oe.value&&Ye.value!=="custom"&&Bl()}),e.watch(H,()=>{fe()},{deep:!0}),e.watch(ct,k=>{xt.value&&Yt(k)&&(Oe.value=!0,Ye.value==="custom"&&Tt(k))},{deep:!0,immediate:!0});let Fl=null,ul=null,Ql=null;function Ul(){Fl&&(document.removeEventListener("keydown",Fl),Fl=null),ul&&(window.removeEventListener("resize",ul),ul=null),Ql&&(window.removeEventListener("scroll",Ql,!0),Ql=null)}return e.watch(de,k=>{k==="years"&&e.nextTick(()=>{mt.value?.querySelector(`[data-year="${ce.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(()=>[A.value,de.value,h.value,we.value,ye.value,Q.value,K.value,he.value,Z.value,N.doubleCalendar,N.quickSelect,N.quickSelectOptions,N.comparisonControlsPlacement],()=>{rl()}),e.watch(A,k=>{Ul(),k&&(Fl=S=>{S.key==="Escape"&&(de.value==="years"||de.value==="months"?Ll():ql())},ul=()=>{ml()},Ql=()=>{ml()},document.addEventListener("keydown",Fl),window.addEventListener("resize",ul),window.addEventListener("scroll",Ql,!0))}),e.onBeforeUnmount(()=>{El!==null&&(window.cancelAnimationFrame(El),El=null),Ul()}),(k,S)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":_.mode==="readonly"}])},[_.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",xs,[S[10]||(S[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:X.value,readonly:"",disabled:"",tabindex:"-1"},null,8,Es)])):Jt.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:S[0]||(S[0]=x=>Fn("start"))},[S[11]||(S[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:He,type:"text",class:"dss-datepicker__input",placeholder:N.placeholder||e.unref(oe)("datepicker.selectDate"),value:Ct.value,readonly:"",disabled:_.mode==="readonly"},null,8,Ss)])):lt.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":A.value}]),onClick:il},[S[13]||(S[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:Me,type:"text",class:"dss-datepicker__input",placeholder:N.placeholder||e.unref(oe)("datepicker.selectFromList"),value:Ct.value,readonly:""},null,8,Vs),e.createElementVNode("span",{class:e.normalizeClass(["dss-datepicker__chevron",{"dss-datepicker__chevron--open":A.value}]),"aria-hidden":"true"},[...S[12]||(S[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)):et.value?(e.openBlock(),e.createElementBlock("div",Ns,[e.createElementVNode("div",{class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:Ke,onClick:S[1]||(S[1]=x=>Fn("start"))},[S[14]||(S[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:ke,type:"text",class:"dss-datepicker__input",placeholder:N.placeholder||e.unref(oe)("datepicker.selectRange"),value:tl.value,readonly:""},null,8,Bs)],512),xt.value?(e.openBlock(),e.createElementBlock("div",_s,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-datepicker__comparison-toggle",{"dss-datepicker__comparison-toggle--active":Oe.value}]),onClick:e.withModifiers(Zl,["stop"])},e.toDisplayString(Oe.value?e.unref(oe)("datepicker.comparison.active"):e.unref(oe)("datepicker.comparison.compareTo")),3),Oe.value&&ie.value?(e.openBlock(),e.createElementBlock("span",Ms,e.toDisplayString(ie.value),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[A.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(ql,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:gt,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":_.doubleCalendar&&et.value&&de.value==="days","dss-datepicker__dropdown--quick-select":_.doubleCalendar&&et.value&&de.value==="days"&&(_.quickSelect||pt.value),"dss-datepicker__dropdown--list":lt.value}]),onClick:S[9]||(S[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(un.value)},[lt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[on.value.length?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"dss-datepicker__list",role:"listbox",ref_key:"listRef",ref:Qt},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(on.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x.ts,role:"option","aria-selected":x.selected,class:e.normalizeClass(["dss-datepicker__list-item",{"dss-datepicker__list-item--selected":x.selected}]),onClick:j=>jn(x.date)},[e.createElementVNode("span",Ls,e.toDisplayString(x.label),1),x.selected?(e.openBlock(),e.createElementBlock("svg",Ts,[...S[15]||(S[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,$s))),128))],512)):(e.openBlock(),e.createElementBlock("div",Ds,e.toDisplayString(e.unref(oe)("datepicker.noAvailableDates")),1))],64)):de.value==="days"&&_.doubleCalendar&&et.value?(e.openBlock(),e.createElementBlock("div",As,[_.quickSelect||pt.value?(e.openBlock(),e.createElementBlock("div",Hs,[_.quickSelect?(e.openBlock(),e.createElementBlock("nav",Rs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ht.value,x=>(e.openBlock(),e.createElementBlock("button",{key:x.id,type:"button",class:"dss-datepicker__quick-select-btn",disabled:!jt(x.id),onClick:j=>Kt(x.id)},e.toDisplayString(Mt(x)),9,Fs))),128))])):e.createCommentVNode("",!0),pt.value?(e.openBlock(),e.createElementBlock("div",Is,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-datepicker__comparison-toggle",{"dss-datepicker__comparison-toggle--active":Oe.value}]),onClick:Zl},e.toDisplayString(Oe.value?e.unref(oe)("datepicker.comparison.active"):e.unref(oe)("datepicker.comparison.compareTo")),3),Oe.value?(e.openBlock(),e.createElementBlock("div",zs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.value,x=>(e.openBlock(),e.createElementBlock("button",{key:x.id,type:"button",class:e.normalizeClass(["dss-datepicker__comparison-mode",{"dss-datepicker__comparison-mode--active":Ye.value===x.id}]),onClick:j=>an(x.id)},e.toDisplayString(Y(x)),11,Ps))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Os,[e.createElementVNode("div",Ws,[e.createElementVNode("div",qs,[e.createElementVNode("div",Zs,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(oe)("datepicker.prevMonth"),onClick:Pn}," ‹ ",8,Us),e.createElementVNode("div",Ys,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:S[2]||(S[2]=x=>vn("left","months"))},e.toDisplayString(Ge.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:S[3]||(S[3]=x=>vn("left","years"))},e.toDisplayString(Q.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(oe)("datepicker.nextMonth"),onClick:el}," › ",8,Xs)]),e.createElementVNode("div",js,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ae.value,x=>(e.openBlock(),e.createElementBlock("span",{key:x,class:"dss-datepicker__weekday"},e.toDisplayString(x),1))),128))]),e.createElementVNode("div",Ks,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(St.value,(x,j)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+j},[x?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",dn(x)]),disabled:!Rl(x),onClick:Ce=>sn(x),onMouseenter:Ce=>Sl(x),onMouseleave:mn},e.toDisplayString(x.getDate()),43,Gs)):(e.openBlock(),e.createElementBlock("span",Qs))],64))),128))])]),e.createElementVNode("div",Js,[e.createElementVNode("div",er,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(oe)("datepicker.prevMonth"),onClick:_l}," ‹ ",8,tr),e.createElementVNode("div",lr,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:S[4]||(S[4]=x=>vn("right","months"))},e.toDisplayString(_t.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:S[5]||(S[5]=x=>vn("right","years"))},e.toDisplayString(he.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(oe)("datepicker.nextMonth"),onClick:yn}," › ",8,nr)]),e.createElementVNode("div",or,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ae.value,x=>(e.openBlock(),e.createElementBlock("span",{key:x,class:"dss-datepicker__weekday"},e.toDisplayString(x),1))),128))]),e.createElementVNode("div",ar,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ut.value,(x,j)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+j},[x?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",dn(x)]),disabled:!Rl(x),onClick:Ce=>sn(x),onMouseenter:Ce=>Sl(x),onMouseleave:mn},e.toDisplayString(x.getDate()),43,sr)):(e.openBlock(),e.createElementBlock("span",rr))],64))),128))])])]),Xt.value?(e.openBlock(),e.createElementBlock("div",ir,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-datepicker__comparison-toggle",{"dss-datepicker__comparison-toggle--active":Oe.value}]),onClick:Zl},e.toDisplayString(Oe.value?e.unref(oe)("datepicker.comparison.active"):e.unref(oe)("datepicker.comparison.compareTo")),3),Oe.value?(e.openBlock(),e.createElementBlock("div",cr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.value,x=>(e.openBlock(),e.createElementBlock("button",{key:x.id,type:"button",class:e.normalizeClass(["dss-datepicker__comparison-mode",{"dss-datepicker__comparison-mode--active":Ye.value===x.id}]),onClick:j=>an(x.id)},e.toDisplayString(Y(x)),11,ur))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])):de.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[xt.value?(e.openBlock(),e.createElementBlock("div",dr,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-datepicker__comparison-toggle",{"dss-datepicker__comparison-toggle--active":Oe.value}]),onClick:Zl},e.toDisplayString(Oe.value?e.unref(oe)("datepicker.comparison.active"):e.unref(oe)("datepicker.comparison.compareTo")),3),Oe.value?(e.openBlock(),e.createElementBlock("div",mr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.value,x=>(e.openBlock(),e.createElementBlock("button",{key:x.id,type:"button",class:e.normalizeClass(["dss-datepicker__comparison-mode",{"dss-datepicker__comparison-mode--active":Ye.value===x.id}]),onClick:j=>an(x.id)},e.toDisplayString(Y(x)),11,pr))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",vr,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(oe)("datepicker.prevMonth"),onClick:Pl}," ‹ ",8,fr),e.createElementVNode("div",hr,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:S[6]||(S[6]=x=>de.value="months")},e.toDisplayString(Ve.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:S[7]||(S[7]=x=>de.value="years")},e.toDisplayString(we.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(oe)("datepicker.nextMonth"),onClick:Dt}," › ",8,gr)]),e.createElementVNode("div",yr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ae.value,x=>(e.openBlock(),e.createElementBlock("span",{key:x,class:"dss-datepicker__weekday"},e.toDisplayString(x),1))),128))]),e.createElementVNode("div",kr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je.value,(x,j)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:j},[x?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",dn(x)]),disabled:!Rl(x),onClick:Ce=>sn(x),onMouseenter:Ce=>Sl(x),onMouseleave:mn},e.toDisplayString(x.getDate()),43,Cr)):(e.openBlock(),e.createElementBlock("span",br))],64))),128))])],64)):de.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",wr,[e.createElementVNode("div",xr,[e.createElementVNode("span",Er,e.toDisplayString(ot.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:S[8]||(S[8]=x=>de.value="years")},e.toDisplayString(ce.value),1)])]),e.createElementVNode("div",Sr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wt.value,(x,j)=>(e.openBlock(),e.createElementBlock("button",{key:j,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":j===te.value}]),onClick:Ce=>Gt(j)},e.toDisplayString(x),11,Vr))),128))])],64)):de.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",Nr,[e.createElementVNode("span",Br,e.toDisplayString(Vt.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:mt},[e.createElementVNode("div",_r,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(dl.value,x=>(e.openBlock(),e.createElementBlock("button",{key:x,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":x===ce.value,"dss-datepicker__year-cell--current":x===e.unref(xe)}]),"data-year":x,onClick:j=>zn(x)},e.toDisplayString(x),11,Mr))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},$r={class:"dss-step-bar__layout"},Lr={class:"dss-step-bar__header"},Tr={class:"dss-step-bar__label"},Dr={key:0,class:"dss-step-bar__counter"},Ar={class:"dss-step-bar__track-wrapper"},Hr=["aria-valuemax","aria-valuenow","aria-label"],Rr=["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:_=>["input","desc","asc"].includes(_)},orientation:{type:String,default:"horizontal",validator:_=>["horizontal","vertical"].includes(_)},barHeight:{type:[Number,String],default:200},labelPosition:{type:String,default:"up",validator:_=>["up","down","left","right"].includes(_)},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(_){const J=_,N={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"}}},L=H=>H&&typeof H=="object"&&!Array.isArray(H),oe=(H,Y)=>{const re=Object.assign({},H);return!L(H)||!L(Y)||Object.keys(Y).forEach(fe=>{if(L(Y[fe])){fe in H?re[fe]=oe(H[fe],Y[fe]):Object.assign(re,{[fe]:Y[fe]});return}Object.assign(re,{[fe]:Y[fe]})}),re},W=e.computed(()=>oe(N,J.options)),A=e.computed(()=>Math.max(1,Number(J.steps)||1)),de=e.computed(()=>Math.min(A.value,Math.max(0,Number(J.currentStep)||0))),dt=e.computed(()=>Array.isArray(J.segments)&&J.segments.length>0),ee=e.computed(()=>{if(!dt.value)return[];const H=J.segments.map((Y,re)=>{const fe=Number(Y?.value);return{label:Y?.label||`Step ${re+1}`,value:Number.isFinite(fe)&&fe>0?fe:0,color:Y?.color||J.activeColor,marker:Y?.marker}});return J.segmentOrder==="desc"?[...H].sort((Y,re)=>re.value-Y.value):J.segmentOrder==="asc"?[...H].sort((Y,re)=>Y.value-re.value):H}),h=e.computed(()=>dt.value?ee.value.reduce((H,Y)=>H+Y.value,0):de.value),we=e.computed(()=>dt.value?Number.isFinite(Number(J.totalValue))&&Number(J.totalValue)>0?Number(J.totalValue):Math.max(1,h.value):A.value),ye=e.computed(()=>dt.value&&Number.isFinite(Number(J.totalValue))&&Number(J.totalValue)>0),Q=e.computed(()=>ye.value?Math.max(0,Number(J.totalValue)-h.value):0),K=e.computed(()=>typeof J.remainderLabel=="string"&&J.remainderLabel.trim().length>0),he=e.computed(()=>Q.value>0),Re=e.computed(()=>ee.value.reduce((H,Y)=>Math.max(H,Number(Y.value)||0),0)),ge=e.computed(()=>ee.value.filter(H=>H.value>0).map(H=>`${H.label}: ${lt(H.value)}`).join(" | ")),Ae=e.computed(()=>dt.value?ye.value?ee.value.filter(H=>H.value>0):ee.value:[]),Z=e.computed(()=>{if(!J.counterAsPercentage)return`${h.value} / ${we.value}`;const H=Number(we.value);if(!Number.isFinite(H)||H<=0)return"0%";const Y=Math.round(Number(h.value)/H*100);return`${Math.min(Math.max(Y,0),100)}%`}),Oe=e.computed(()=>h.value),Ye=e.computed(()=>we.value),_e=e.reactive({visible:!1,x:0,y:0,content:""}),Xe=e.computed(()=>J.orientation==="vertical"),U=e.computed(()=>{const H=J.barHeight;return H==null||H===""?"200px":typeof H=="number"?`${H}px`:String(H)}),He=e.computed(()=>{const H=J.sideLabelMaxWidth;if(!(H==null||H===""))return typeof H=="number"?`${H}px`:String(H)}),Ke=e.computed(()=>{const H=J.sideLabelWrapWidth;return H==null||H===""?"18ch":typeof H=="number"?`${H}ch`:String(H)}),ke=e.computed(()=>({left:`${_e.x}px`,top:`${_e.y}px`,transform:"translate(-50%, calc(-100% - 8px))"})),Me=H=>Xe.value?{flex:`${H} 0 0`,minHeight:H>0?"6px":"0",minWidth:"0"}:{flex:`${H} 0 0`,minWidth:H>0?"6px":"0"},rt=H=>{const Y=H?.parentElement;if(!Y)return{x:0,y:0};const re=Y.getBoundingClientRect();return{x:re.left+re.width/2,y:re.top}},gt=H=>{const Y=H.getBoundingClientRect();return{x:Y.left+Y.width/2,y:Y.top}},mt=H=>{if(ye.value){const fe=Math.max(0,Number(H.value)||0);return{...Me(fe),backgroundColor:H.color}}const Y=h.value,re=H.value>0?H.value:Y>0?1e-4:1;return{...Me(re),backgroundColor:H.color}},Qt=H=>Number(H?.value||0)>0&&Number(H?.value||0)===Re.value,xe=H=>{const Y=L(H?.marker)?H.marker:{},re=H?.marker===!0||Y.enabled===!0,fe=Qt(H)&&W.value.maxSegment?.marker?.enabled===!0;if(!(re||fe))return{enabled:!1};const tt=Y.backgroundColor??(fe?W.value.maxSegment?.marker?.backgroundColor:W.value.segmentMarker?.backgroundColor),Et=Y.borderColor??(fe?W.value.maxSegment?.marker?.borderColor:W.value.segmentMarker?.borderColor),Se=Y.color??(fe?W.value.maxSegment?.marker?.color:W.value.segmentMarker?.color),nt=Y.width??(fe?W.value.maxSegment?.marker?.width:W.value.segmentMarker?.width),Ct=Y.height??(fe?W.value.maxSegment?.marker?.height:W.value.segmentMarker?.height);return{enabled:!0,backgroundColor:tt,borderColor:Et,color:Se,width:nt,height:Ct,icon:Y.icon??null,...Y}},Jt=H=>{const Y=xe(H);return{backgroundColor:Y.backgroundColor??void 0,borderColor:Y.borderColor??void 0,color:Y.color??void 0}},et=H=>{const Y=xe(H);return{width:Y.width??void 0,height:Y.height??void 0}},lt=H=>`${H}${J.valueLabel}`,yt=e.computed(()=>({...Me(Q.value),backgroundColor:J.inactiveColor})),Rt=(H,Y)=>{J.disableTooltips||pt(H,Y)},ct=H=>{J.disableTooltips||Xt(H)},xt=()=>{J.disableTooltips||kt()},pt=(H,Y)=>{if(!H||!Y?.currentTarget)return;const re=Y.currentTarget;if(J.remainderTooltipSummary){const ze=rt(re);_e.x=ze.x,_e.y=ze.y,_e.content=ge.value,_e.visible=!!_e.content;return}const fe=gt(re);_e.x=fe.x,_e.y=fe.y,_e.content=`${H.label}: ${lt(H.value)}`,_e.visible=!0},Xt=H=>{if(!Q.value||!H?.currentTarget)return;const Y=H.currentTarget;if(J.remainderTooltipSummary){const fe=rt(Y);_e.x=fe.x,_e.y=fe.y,_e.content=ge.value,_e.visible=!!_e.content;return}const re=gt(Y);_e.x=re.x,_e.y=re.y,K.value&&(_e.content=`${J.remainderLabel}: ${lt(Q.value)}`,_e.visible=!0)},kt=()=>{_e.visible=!1},Pt=()=>{_e.visible&&kt()};e.onMounted(()=>{window.addEventListener("scroll",Pt,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("scroll",Pt,!0)});const pe=e.computed(()=>({"--dss-step-bar-label-color":J.labelColor??void 0,"--dss-step-bar-counter-color":J.counterColor??void 0,"--dss-step-bar-active-color":J.activeColor,"--dss-step-bar-inactive-color":J.inactiveColor,"--dss-step-bar-bar-height":Xe.value?U.value:void 0,"--dss-step-bar-side-label-max-width":He.value,"--dss-step-bar-side-label-wrap-width":Ke.value}));return(H,Y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-step-bar",[`dss-step-bar--${_.orientation}`,`dss-step-bar--label-${_.labelPosition}`]]),style:e.normalizeStyle(pe.value)},[e.createElementVNode("div",$r,[e.createElementVNode("div",Lr,[e.createElementVNode("span",Tr,[e.renderSlot(H.$slots,"label",{label:_.label},()=>[e.createTextVNode(e.toDisplayString(_.label),1)])]),_.showCounter?(e.openBlock(),e.createElementBlock("span",Dr,[e.renderSlot(H.$slots,"counter",{counterDisplay:Z.value},()=>[e.createTextVNode(e.toDisplayString(Z.value),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ar,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":Ye.value,"aria-valuenow":Oe.value,"aria-label":_.label},[dt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ae.value,(re,fe)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${fe}-${re.label}`,class:e.normalizeClass(["dss-step-bar__segment dss-step-bar__segment--interactive",{"dss-step-bar__segment--max":Qt(re),"dss-step-bar__segment--marker-enabled":xe(re).enabled}]),style:e.normalizeStyle(mt(re)),onMouseenter:ze=>Rt(re,ze),onMouseleave:xt},[xe(re).enabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment-marker",style:e.normalizeStyle(Jt(re)),"aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-step-bar__segment-marker-icon",style:e.normalizeStyle(et(re))},[e.renderSlot(H.$slots,"segment-marker-icon",{segment:re,index:fe,marker:xe(re)},()=>[e.renderSlot(H.$slots,"max-segment-icon",{segment:re,index:fe,marker:xe(re)},()=>[e.createTextVNode(e.toDisplayString(xe(re).icon||""),1)])])],4)],4)):e.createCommentVNode("",!0)],46,Rr))),128)),he.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(yt.value),onMouseenter:Y[0]||(Y[0]=re=>ct(re)),onMouseleave:xt},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(A.value,re=>(e.openBlock(),e.createElementBlock("div",{key:re,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":re<=de.value}])},null,2))),128))],8,Hr)])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[!_.disableTooltips&&_e.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(_e.content),5)):e.createCommentVNode("",!0)]))],6))}},Fr=["data-chart-type"],Ir={class:"dss-chart-header-titles"},zr={key:0,class:"dss-chart-title"},Pr={key:1,class:"dss-chart-subtitle"},Or=["onClick","onMouseenter"],Wr={class:"dss-legend-text"},qr=["onClick","onMouseenter"],Zr={class:"dss-legend-text"},Ur=["title"],Yr=["src"],Xr={class:"dss-chart-area-wrapper"},jr={key:0,class:"dss-chart-z-axis-label"},Kr=["width","height","data-smooth","data-animated"],Gr=["id"],Qr=["y","width","height"],Jr=["id"],ei=["d"],ti=["id"],li=["d"],ni={key:0},oi=["clip-path"],ai=["x1","x2","y1","y2"],si=["clip-path"],ri=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray","opacity"],ii={class:"dss-axes"},ci=["x1","x2","y1","y2"],ui=["x1","x2","y1","y2"],di=["x1","x2","y1","y2"],mi={class:"dss-axis-labels"},pi=["x","y"],vi=["x","y"],fi=["x","y"],hi=["x","y"],gi=["y","transform"],yi=["x","y","transform"],ki={key:2,class:"dss-flag-markers"},Ci=["clip-path"],bi=["x1","x2","y1","y2","onMouseover"],wi=["x1","x2","y1","y2","onMouseover"],xi=["x1","x2","y1","y2","onMouseover"],Ei=["cx","cy","onMouseover"],Si=["cx","cy","fill","onMouseover"],Vi=["x","y"],Ni=["clip-path"],Bi={key:0},_i=["d","onMouseover"],Mi=["x","y","width","height","fill","onMouseover"],$i={class:"dss-line-chart"},Li=["d","stroke","stroke-width","stroke-dasharray"],Ti=["d","stroke","stroke-width","opacity"],Di=["cx","cy","r","fill","onMouseover"],Ai={key:1},Hi=["d","stroke","stroke-width","stroke-dasharray"],Ri=["d","stroke","stroke-width","stroke-dasharray"],Fi=["d","stroke","stroke-width","opacity"],Ii=["cx","cy","r","fill","onMouseover"],zi={key:2},Pi=["id"],Oi=["x","y","width","height"],Wi=["d","fill","fill-opacity","mask"],qi=["d","stroke","stroke-width"],Zi=["d","fill","onMouseover"],Ui=["x","y","width","height","onMouseover"],Yi=["clip-path"],Xi=["x1","x2","y1","y2","stroke"],ji=["cx","cy","r","fill"],Ki={key:1,class:"dss-bubble-chart"},Gi={key:0,class:"dss-bubble-group"},Qi=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],Ji=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],ec=["transform"],tc=["cx","cy","r"],lc=["data-chart-type","clip-path"],nc=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],oc={key:1,class:"dss-radial-segment-data-labels"},ac=["x","y"],sc=["x","y","font-size","fill"],rc=["x1","y1","x2","y2","stroke"],ic=["x1","y1","x2","y2","stroke"],cc=["x","y","text-anchor","font-size"],uc=["transform"],dc={key:0,class:"dss-spider-grid"},mc=["cx","cy","r"],pc={class:"dss-spider-grid-labels"},vc=["x","y"],fc=["x","y"],hc=["x1","x2","y1","y2"],gc={class:"dss-spider-labels"},yc=["x","y","text-anchor","dominant-baseline"],kc=["points","fill","fill-opacity","stroke","stroke-width","stroke-dasharray"],Cc=["cx","cy","r","fill","stroke","stroke-width","onMouseover"],bc={class:"dss-chart-logos"},wc=["cx","cy","r","fill"],xc=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Ec={key:0,class:"dss-stepbar-grid-lines","aria-hidden":"true"},Sc=["onClick","onMouseenter"],Vc=["src"],Nc={class:"dss-marker-tooltip-category"},Bc={key:0,class:"dss-marker-tooltip-description"},_c={key:0,class:"dss-tooltip-section dss-spider-tooltip-section"},Mc={class:"dss-tooltip-title dss-spider-tooltip-area-title"},$c={class:"dss-tooltip-series-name"},Lc={class:"dss-tooltip-series-value"},Tc={key:1,class:"dss-tooltip-section"},Dc={key:0,class:"dss-tooltip-title"},Ac={class:"dss-bubble-tooltip-data"},Hc={key:2,class:"dss-tooltip-section"},Rc={class:"dss-tooltip-title"},Fc={class:"dss-tooltip-value"},Ic={key:0,class:"dss-tooltip-section"},zc={class:"dss-tooltip-section-title"},Pc={class:"dss-tooltip-group-header"},Oc={class:"dss-tooltip-item-content"},Wc={class:"dss-tooltip-item-text"},qc={key:1,class:"dss-tooltip-section"},Zc={class:"dss-tooltip-section-title"},Uc={class:"dss-tooltip-item-content"},Yc={class:"dss-tooltip-item-title"},Xc={key:0,class:"dss-tooltip-item-description"},jc={class:"dss-tooltip-section"},Kc={class:"dss-tooltip-title"},Gc={key:0,class:"dss-bubble-tooltip-data"},Qc={class:"dss-tooltip-series-name"},Jc={class:"dss-tooltip-series-value"},eu={key:0,class:"dss-tooltip-section"},tu={class:"dss-tooltip-section-title"},lu={class:"dss-tooltip-group-header"},nu={class:"dss-tooltip-item-content"},ou={class:"dss-tooltip-item-text"},au={key:1,class:"dss-tooltip-section"},su={class:"dss-tooltip-section-title"},ru={class:"dss-tooltip-item-content"},iu={class:"dss-tooltip-item-title"},cu={key:0,class:"dss-tooltip-item-description"},uu=["onClick","onMouseenter"],du={class:"dss-legend-text"},mu={key:1,class:"dss-context-menu-separator"},pu={key:0,class:"dss-context-menu-separator"},vu={key:0,class:"dss-context-menu-separator"},fu=["onClick"],hu=["innerHTML"],gu={key:0,class:"dss-context-menu-icon"},yu={class:"dss-marker-modal-header"},ku={class:"dss-marker-modal-body"},Cu={class:"dss-form-group"},bu={class:"dss-form-group"},wu={for:"dss-marker-description"},xu={key:0,class:"dss-form-text-display"},Eu=["placeholder"],Su={class:"dss-marker-modal-footer"},Vu={class:"modal-footer-left"},Nu={class:"dss-modal-footer-right"},Bu=["disabled"],_u={name:"DSSChart"},Mu=Object.assign(_u,{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:_=>typeof _=="object"&&_!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(_,{emit:J}){const{t:N,locale:L}=ho.useI18n(),oe=J,W=e.ref(null),A=e.ref(null);let de=null;const dt=()=>{de&&(de(),de=null);const t=A.value;if(!t||xe.value!=="stepbar")return;const o=l=>$o(l);t.addEventListener("wheel",o,{passive:!1}),de=()=>t.removeEventListener("wheel",o)},ee=e.ref(null),h=e.ref(null),we=e.ref(0),ye=e.ref(0);let Q=null,K=null;const he=20,Re=e.computed(()=>{if(ye.value,we.value,!W.value||!ee.value)return 0;try{const t=W.value.getBoundingClientRect();return ee.value.getBoundingClientRect().top-t.top}catch{return 0}}),ge=e.computed(()=>`chart-clip-${Z.chartId}`),Ae=e.computed(()=>`url(#${ge.value})`),Z=_,Oe={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 Ye(t,o){const l=Object.assign({},t);return Xe(t)&&Xe(o)&&Object.keys(o).forEach(r=>{Xe(o[r])?r in t?l[r]=Ye(t[r],o[r]):Object.assign(l,{[r]:o[r]}):Object.assign(l,{[r]:o[r]})}),l}const _e=()=>{let t=20,o=0,l=0;if(et.value&&(t+=30),lt.value&&(t+=25),fe.value&&Z.series.length>0){const r=Z.series.filter((m,v)=>!F.value.has(v)).length;if(ze.value==="top"||ze.value==="bottom"){if(tt.value==="horizontal"){const v=Math.floor(Me.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 Xe(t){return t&&typeof t=="object"&&!Array.isArray(t)}const U=e.computed(()=>Ye(Oe,Z.options)),He=e.computed(()=>{const t=U.value;return t&&t.chart&&t.chart.width==="auto"}),Ke=e.computed(()=>{const t=U.value;return t&&t.chart&&t.chart.height==="auto"}),ke=e.computed(()=>{const t=U.value;return t?.chart?.type==="stepbar"&&t?.chart?.height==="fit"}),Me=e.computed(()=>{const t=U.value;return He.value?we.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),rt=e.ref(he),gt=e.computed(()=>{if(Ke.value){const t=gt.value;return t??Math.max(0,(ye.value||400)-rt.value*5)}}),mt=e.computed(()=>{const t=U.value;if(xe.value==="mini-radial")return Me.value;if(ke.value)return un.value;if(Ke.value){const o=gt.value;return o??Math.max(0,(ye.value||400)-rt.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),Qt=e.computed(()=>{if(Ke.value&&xe.value==="semi-radial"&&gt.value!=null)return rt.value+mt.value+"px";if(Ke.value)return"100%";if(xl.value)return rt.value+mt.value+"px";if(fe.value&&ze.value==="bottom"){const t=_e();return mt.value+(t.legendHeight||35)+"px"}return mt.value+(fe.value?20:0)+"px"}),xe=e.computed(()=>{const t=U.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),Jt=e.computed(()=>{const t=Z.series.map(o=>o.type||xe.value);return new Set(t).size>1}),et=e.computed(()=>{const t=U.value;return t&&t.title&&t.title.text?t.title.text:""}),lt=e.computed(()=>{const t=U.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),yt=e.computed(()=>{const t=U.value;if(!t||!t.zAxis)return"";const o=t.zAxis;return typeof o=="string"?o:o&&typeof o.label=="string"?o.label:""}),Rt=e.computed(()=>{const t=U.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),ct=e.computed(()=>{const o=U.value?.yAxis?.title?.text;return o==null||String(o).trim()===""?"":String(o)}),xt=e.computed(()=>{const t=U.value;return t&&t.yAxis&&t.yAxis.secondary&&typeof t.yAxis.secondary=="object"?t.yAxis.secondary:null}),pt=e.computed(()=>{const t=xt.value;return t&&t.title&&t.title.text?t.title.text:""}),Xt=e.computed(()=>{const t=U.value;if(!t||!t.yAxis)return Al;const o=t.yAxis.min;return typeof o=="number"||o===Al?o:Al}),kt=e.computed(()=>{const t=U.value;if(!t||!t.yAxis)return Al;const o=t.yAxis.max;return typeof o=="number"||o===Al?o:Al}),Pt=e.computed(()=>{const t=xt.value;if(!t)return Al;const o=t.min;return typeof o=="number"||o===Al?o:Al}),pe=e.computed(()=>{const t=xt.value;if(!t)return Al;const o=t.max;return typeof o=="number"||o===Al?o:Al}),H=e.computed(()=>{const t=U.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),Y=e.computed(()=>{const t=U.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),re=e.computed(()=>{const t=U.value;return t&&t.grid&&t.grid.show!==!1}),fe=e.computed(()=>{const t=U.value;return t&&t.legend&&t.legend.show!==!1}),ze=e.computed(()=>{const t=U.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),tt=e.computed(()=>{const t=U.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Et=e.computed(()=>{const t=U.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),Se=e.computed(()=>{const t=U.value;if(!t)return!1;if(xe.value==="stepbar"){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"}),nt=e.computed(()=>{const t=U.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Ct=e.computed(()=>{const t=U.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),tl=e.computed(()=>{const t=U.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),ie=e.computed(()=>{const t=U.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),X=e.computed(()=>{const t=U.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),te=e.computed(()=>{if(!xl.value)return 0;const t=U.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),ce=e.computed(()=>{const t=U.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),Ve=e.computed(()=>{const{maxX:t}=Bt.value;return t===0}),ot=(t,o)=>Ve.value&&o===0?5:o,wt=t=>{const o=Number(t);return!Number.isFinite(o)||o<=0?0:o},dl=e.computed(()=>{const t=U.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),Vt=e.computed(()=>{const t=U.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),sl=e.computed(()=>{const t=U.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),D=e.computed(()=>{const t=U.value;return Vt.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),V=e.computed(()=>{const t=U.value,o=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return o.length>0?o:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),B=e.computed(()=>U.value?.stepbar||{}),ae=e.computed(()=>{const t=B.value?.segmentOrder;return["asc","desc","input"].includes(t)?t:"input"}),se=e.computed(()=>{const t=Number(B.value?.totalValue);return Number.isFinite(t)&&t>0?t:100}),je=e.computed(()=>B.value?.showRemainder!==!1),St=e.computed(()=>B.value?.remainderLabel||"Remaining"),ut=e.computed(()=>B.value?.remainderColor||"#E5E7EB"),Ge=e.computed(()=>{const t=Number(B.value?.barWidth);return Number.isFinite(t)&&t>0?t:42}),_t=e.computed(()=>{const t=Number(B.value?.minBarWidth);return Number.isFinite(t)&&t>0?t:12}),Nt=e.computed(()=>{const t=Number(B.value?.maxBarWidth);return Number.isFinite(t)&&t>0?t:58});e.computed(()=>{const t=Number(B.value?.barRadius);return Number.isFinite(t)&&t>=0?t:6});const vt=e.computed(()=>B.value?.axisBars||{}),Lt=e.computed(()=>vt.value?.show!==!1);e.computed(()=>vt.value?.showVertical===!0);const Ht=e.computed(()=>vt.value?.color||"#d6d6d6"),Mt=e.computed(()=>{const t=Number(vt.value?.opacity);return Number.isFinite(t)?Math.min(Math.max(t,0),1):.75}),wl=e.computed(()=>{const t=Number(vt.value?.width);return Number.isFinite(t)&&t>0?t:1}),jl=e.computed(()=>vt.value?.dashArray||"3,4"),El=e.computed(()=>{const t=Number(B.value?.columnGap);return Number.isFinite(t)&&t>=0?t:16}),rl=e.computed(()=>{const t=Number(B.value?.labelReserve);return Number.isFinite(t)&&t>0?t:48}),ml=e.computed(()=>{const t=Number(B.value?.trackAreaHeight);return Number.isFinite(t)&&t>0?t:220}),un=e.computed(()=>{let t=0;et.value&&(t+=15),lt.value&&(t+=10);const o=50+t,l=rl.value+8;return o+ml.value+l}),yl=e.computed(()=>Math.max(P.value.height,0)),ft=e.computed(()=>{const t=Number(B.value?.columnWidth);if(Number.isFinite(t)&&t>0)return t;const o=Ge.value,l=_t.value,r=Nt.value;return Math.max(l,Math.min(r,o))}),zl=e.computed(()=>{const t=Number(B.value?.trackWidth);if(Number.isFinite(t)&&t>0)return Math.min(t,ft.value);const o=Number(B.value?.barWidth);return Number.isFinite(Number(B.value?.columnWidth))&&Number(B.value?.columnWidth)>0&&Number.isFinite(o)&&o>0?Math.min(o,ft.value):Math.min(ft.value,Math.max(10,Math.round(ft.value*.32)))}),Kl=e.computed(()=>({width:`${ft.value}px`,flex:`0 0 ${ft.value}px`,"--dss-step-bar-track-thickness":`${zl.value}px`,"--dss-stepbar-label-height":`${rl.value}px`})),Hl=e.computed(()=>{const t=Gl.value.length;return t?t*ft.value+Math.max(0,t-1)*El.value:0}),Rn=e.computed(()=>({maxSegment:{marker:{enabled:!1}}})),Gl=e.computed(()=>xe.value!=="stepbar"?[]:Dn.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}))}))),bn=e.computed(()=>{if(xe.value!=="stepbar")return[];const{minY:t,maxY:o}=Bt.value,l=5,r=[];for(let m=0;m<=l;m++){const v=t+(o-t)*(m/l);r.push({top:Un(v)-P.value.top,value:v})}return r}),Bn=e.computed(()=>({top:`${P.value.top}px`,left:`${P.value.left}px`,width:`${P.value.width}px`,height:`${yl.value+rl.value}px`})),nn=e.computed(()=>({width:`${Hl.value}px`,minHeight:`${yl.value+rl.value}px`})),Rl=e.computed(()=>xe.value==="stepbar"&&Se.value&&Le.value.show&&!ne.value.isZooming),dn=e.computed(()=>{const t=ft.value+El.value;return{left:`${Le.value.categoryIndex*t+ft.value/2}px`,height:`${yl.value}px`,borderColor:nt.value}}),Sl=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.enabled!==!1}),mn=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),Wl=e.computed(()=>{const t=U.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),pn=e.computed(()=>{const t=U.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),on=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),il=e.computed(()=>{const t=U.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),jn=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.onDataChange!==!1}),Fn=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),ql=e.computed(()=>{const t=U.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),vn=e.computed(()=>U.value?.spider?.gridSteps||5),Ll=e.computed(()=>{const t=[],o=vn.value;for(let l=1;l<=o;l++)t.push(it.value/o*l);return t}),In=t=>{const o=fn.value;if(o&&Array.isArray(o)&&o[t]!==void 0)return o[t].toString();const l=Ll.value[t];return Math.round(l/it.value*100)+"%"},fn=e.computed(()=>U.value?.spider?.gridLabels||null),cl=e.computed(()=>{const t=U.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),jt=e.computed(()=>{const t=U.value,o={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...o,...t.contextMenu.items}:o}),Kt=e.computed(()=>{const t=U.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Yt=e.computed(()=>{const t=U.value;return t&&t.markers&&t.markers.icon?t.markers.icon:Pn.value}),Tl=e.computed(()=>{const t=U.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Tt=e.computed(()=>{const t=U.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),bt=e.computed(()=>{const o=U.value?.valueFormat?.extension;return typeof o=="string"?o:""}),Vl=t=>{const o=bt.value;if(t==null)return"";const l=String(t);return o?l+o:l},hn=e.computed(()=>!ne.value.isZooming);e.computed(()=>ll.value.map(t=>{if(t.categoryIndex!==void 0&&($l.value||Ot.value)){const o=Cl(t.categoryIndex),l=Re.value+P.value.bottom-Tt.value/2;return{...t,x:o,y:l}}return t}));function Nl(t,o){let l;if(t instanceof Date)l=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[v,b,w]=t.split("-"),q=Number(w?.length===2?`20${w}`:w);l=new Date(q,Number(b)-1,Number(v))}else return 0;let r=0,m=1/0;return o.forEach((v,b)=>{const[w,q,T]=v.split("-"),I=Number(T?.length===2?`20${T}`:T),$=new Date(I,Number(q)-1,Number(w)),G=Math.abs($-l);G<m&&(m=G,r=b)}),r}const gn=e.computed(()=>{const t=Z.markers.map(l=>{const r=Nl(l.marker_date,Z.categories),m=Cl(r),v=Re.value+P.value.bottom-Tt.value/2;return{...l,x:m,y:v,categoryIndex:r,source:"props"}}),o=ll.value.map(l=>{if(l.categoryIndex!==void 0&&($l.value||Ot.value)){const r=Cl(l.categoryIndex),m=Re.value+P.value.bottom-Tt.value/2;return{...l,x:r,y:m,source:"internal"}}return{...l,source:"internal"}});return[...t,...o]}),Bl=e.computed(()=>{const t=U.value;return t&&t.watermark&&t.watermark.enabled===!0}),Zl=e.computed(()=>{const t=U.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),an=e.computed(()=>{const t=U.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),Dl=e.computed(()=>{const t=U.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),Gt=e.computed(()=>{const t={left:P.value.left,top:P.value.top,width:P.value.width,height:P.value.height};let o,l;const r=String(an.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}}),zn=e.computed(()=>{const{width:t,height:o}=Gt.value,l=Dl.value;let r,m;const v=P.value.left,b=P.value.right,w=P.value.top,q=P.value.bottom,T=P.value.width,I=P.value.height;switch(l){case"center":r=v+(T-t)/2,m=w+(I-o)/2;break;case"top-left":r=v+15,m=w+5;break;case"top-right":r=b-t-15,m=w+5;break;case"bottom-left":r=v+15,m=q-o-5;break;case"bottom-right":default:r=b-t-15,m=q-o-5;break}return{backgroundPositionX:r+"px",backgroundPositionY:m+"px",backgroundSize:`${t}px ${o}px`}}),Pl=t=>!Z.flags||!Z.flags.length?[]:Z.flags.filter(o=>o.categoryIndex===t),Dt=t=>{const o=Pl(t),l=ea(t),r=o.filter(b=>b.manual),m=o.filter(b=>!b.manual),v=[];return r.length>0&&v.push({type:N("chart.tooltip.manualFlags"),color:"#698dbe",flags:r.map(b=>({text:b.text,color:"#698dbe"}))}),m.length>0&&v.push({type:N("chart.tooltip.autoFlags"),color:"#a1d499",flags:m.map(b=>({text:b.text,color:"#a1d499"}))}),{flagGroups:v,markers:l.map(b=>({title:b.title,description:b.description,type:N("chart.tooltip.markers"),color:b.color||"#9784ba"}))}},Pn=e.computed(()=>{const t=Z.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"),ho=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={key:0,class:"dss-datepicker__range-values"},Bs=["placeholder","value"],_s={key:0,class:"dss-datepicker__comparison-range"},Ms={class:"dss-datepicker__comparison-date"},$s={class:"dss-datepicker__comparison-date"},Ls=["placeholder","value"],Ts=["aria-label","aria-pressed"],Ds=["aria-selected","onClick"],As={class:"dss-datepicker__list-item-label"},Hs={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"},Rs={key:1,class:"dss-datepicker__list-empty"},Fs={key:1,class:"dss-datepicker__double-wrap"},Is={key:0,class:"dss-datepicker__side-panel"},zs={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},Ps=["disabled","onClick"],Os={key:1,class:"dss-datepicker__comparison-panel"},Ws={key:0,class:"dss-datepicker__comparison-modes"},qs=["onClick"],Zs={class:"dss-datepicker__double-content"},Us={class:"dss-datepicker__double-calendars"},Ys={class:"dss-datepicker__double-calendar"},Xs={class:"dss-datepicker__calendar-header"},js=["aria-label"],Ks={class:"dss-datepicker__month-year-row"},Gs=["aria-label"],Qs={class:"dss-datepicker__weekdays"},Js={class:"dss-datepicker__grid"},er=["disabled","onClick","onMouseenter"],tr={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},lr={class:"dss-datepicker__double-calendar"},nr={class:"dss-datepicker__calendar-header"},or=["aria-label"],ar={class:"dss-datepicker__month-year-row"},sr=["aria-label"],rr={class:"dss-datepicker__weekdays"},ir={class:"dss-datepicker__grid"},cr=["disabled","onClick","onMouseenter"],ur={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},dr={key:0,class:"dss-datepicker__comparison-panel dss-datepicker__comparison-panel--bottom"},mr={key:0,class:"dss-datepicker__comparison-modes dss-datepicker__comparison-modes--inline"},pr=["onClick"],vr={key:0,class:"dss-datepicker__comparison-panel dss-datepicker__comparison-panel--single"},fr={key:0,class:"dss-datepicker__comparison-modes"},hr=["onClick"],gr={class:"dss-datepicker__calendar-header"},yr=["aria-label"],kr={class:"dss-datepicker__month-year-row"},Cr=["aria-label"],br={class:"dss-datepicker__weekdays"},wr={class:"dss-datepicker__grid"},xr=["disabled","onClick","onMouseenter"],Er={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Sr={class:"dss-datepicker__calendar-header"},Vr={class:"dss-datepicker__month-year-row"},Nr={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},Br={class:"dss-datepicker__months-grid"},_r=["onClick"],Mr={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},$r={class:"dss-datepicker__month-year"},Lr={class:"dss-datepicker__years-grid"},Tr=["data-year","onClick"],Aa=27,Xn=8,ga={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:_=>["single","range","singleFromAvailable","rangeFromAvailable","listFromAvailable","readonly"].includes(_)},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},quickSelectOptions:{type:Array,default:null},comparisonEnabled:{type:Boolean,default:!1},comparisonValue:{type:Object,default:()=>({start:null,end:null})},comparisonControlsPlacement:{type:String,default:"side",validator:_=>["side","bottom"].includes(_)},comparisonModeOptions:{type:Array,default:null},placeholder:{type:String,default:""}},emits:["update:modelValue","update:comparisonValue"],setup(_,{emit:J}){const N=_,L=J,{t:oe,locale:W}=ho.useI18n(),A=e.ref(!1),de=e.ref("days"),dt=new Date,ee=e.computed(()=>N.minDate instanceof Date?N.minDate:dt),h=e.ref(ee.value.getMonth()),we=e.ref(ee.value.getFullYear()),ye=e.ref(ee.value.getMonth()),Q=e.ref(ee.value.getFullYear()),K=e.ref(ee.value.getMonth()),he=e.ref(ee.value.getFullYear()),Re=e.ref("start"),ge=e.ref("start"),Ae=e.ref(null),Z=e.ref(null),ze=e.ref(!1),Ye=e.ref("previousPeriod"),_e=e.ref("primary"),Xe=e.ref({start:null,end:null});function U(){const k=ee.value,w=k.getMonth(),E=k.getFullYear(),j=w===11?0:w+1,Ce=w===11?E+1:E;return{left:{month:w,year:E},right:{month:j,year:Ce}}}const He=e.ref(null),Ke=e.ref(null),ke=e.ref(null),Me=e.ref(null),rt=e.ref(null),yt=e.ref(null),mt=e.ref(null),Qt=e.ref(null),xe=new Date().getFullYear(),Jt=e.computed(()=>["single","singleFromAvailable"].includes(N.mode)),et=e.computed(()=>["range","rangeFromAvailable"].includes(N.mode)),lt=e.computed(()=>N.mode==="listFromAvailable"),kt=e.computed(()=>{if(!["single","singleFromAvailable","listFromAvailable"].includes(N.mode))return null;const k=N.modelValue;return k instanceof Date?k:null}),Rt=e.computed(()=>{if(!et.value)return{start:null,end:null};const k=N.modelValue;return!k||typeof k!="object"?{start:null,end:null}:{start:k.start instanceof Date?k.start:null,end:k.end instanceof Date?k.end:null}}),ct=e.computed(()=>Et(N.comparisonValue)),ht=e.computed(()=>N.comparisonEnabled&&et.value),pt=e.computed(()=>ht.value&&N.comparisonControlsPlacement==="side"),Xt=e.computed(()=>ht.value&&N.comparisonControlsPlacement==="bottom"),Ct=e.computed(()=>ht.value&&ze.value&&Ye.value==="custom"&&_e.value==="comparison"),Pt={previousPeriod:"datepicker.comparison.previousPeriod",previousYear:"datepicker.comparison.previousYear",custom:"datepicker.comparison.custom"},pe=[{id:"previousPeriod",labelKey:"datepicker.comparison.previousPeriod"},{id:"previousYear",labelKey:"datepicker.comparison.previousYear"},{id:"custom",labelKey:"datepicker.comparison.custom"}],H=e.computed(()=>{const w=(Array.isArray(N.comparisonModeOptions)&&N.comparisonModeOptions.length?N.comparisonModeOptions:pe).map(E=>typeof E=="string"?{id:E,labelKey:Pt[E]}:!E||typeof E!="object"||!E.id?null:{...E,labelKey:E.labelKey||Pt[E.id]}).filter(E=>E&&Pt[E.id]);return w.length?w:pe});function Y(k){return k.label?k.label:k.labelKey?oe(k.labelKey):k.id}function ie(k){return H.value.some(w=>w.id===k)}function fe(){if(ie(Ye.value))return;const k=H.value[0]?.id||"previousPeriod";Ye.value=k,_e.value=k==="custom"?"comparison":"primary",ze.value&&k!=="custom"&&Bl()}function Fe(k){if(!k||!(k instanceof Date))return"";const w=k.getDate(),E=k.getMonth()+1,j=k.getFullYear(),Ce=qe=>String(qe).padStart(2,"0");return`${Ce(w)}/${Ce(E)}/${j}`}function tt(k){return k instanceof Date&&!Number.isNaN(k.getTime())?new Date(k.getFullYear(),k.getMonth(),k.getDate()):null}function Et(k){return!k||typeof k!="object"?{start:null,end:null}:{start:tt(k.start),end:tt(k.end)}}function Se(k){const w=Et(k),{start:E,end:j}=w;return E&&j&&E>j?{start:j,end:E}:w}function ot(k){const{start:w,end:E}=Se(k);return!w&&!E?"":!w||!E?Fe(w||E):w&&E&&yl(w,E)?Fe(w):`${Fe(w||E)} - ${Fe(E||w)}`}const bt=e.computed(()=>Fe(kt.value)),el=e.computed(()=>ot(Rt.value)),re=e.computed(()=>{const{start:k,end:w}=Se(ct.value);return!k||!w?null:{start:Fe(k),end:Fe(w)}}),X=e.computed(()=>{if(N.mode!=="readonly")return"—";const k=N.modelValue;if(k instanceof Date)return Fe(k)||"—";if(k&&typeof k=="object"&&("start"in k||"end"in k)){const w=k.start instanceof Date?k.start:null,E=k.end instanceof Date?k.end:null;if(!w&&!E)return"—";const j=!E||w&&w<=E?w:E,Ce=!w||E&&E>=w?E:w;return yl(j,Ce)?Fe(j):`${Fe(j)} - ${Fe(Ce)}`}return"—"});e.computed(()=>{const k=new Date(we.value,h.value,1);return new Intl.DateTimeFormat(W.value,{month:"long",year:"numeric"}).format(k)});const te=e.computed(()=>Z.value==="left"?ye.value:Z.value==="right"?K.value:h.value),ce=e.computed(()=>Z.value==="left"?Q.value:Z.value==="right"?he.value:we.value),Ve=e.computed(()=>{const k=new Date(we.value,h.value,1);return new Intl.DateTimeFormat(W.value,{month:"long"}).format(k)}),nt=e.computed(()=>{const k=new Date(ce.value,te.value,1);return new Intl.DateTimeFormat(W.value,{month:"long"}).format(k)}),xt=e.computed(()=>{const k=new Intl.DateTimeFormat(W.value,{month:"short"});return Array.from({length:12},(w,E)=>k.format(new Date(2024,E,1)))}),dl=e.computed(()=>{const w=(Z.value?ce.value:we.value)-Math.floor(Aa/2);return Array.from({length:Aa},(E,j)=>w+j)}),Vt=e.computed(()=>{const k=dl.value;return k.length?`${k[0]} – ${k[k.length-1]}`:""});function sl(k){return k===7?0:k}function D(k){try{const w=new Intl.Locale(k);if(w.weekInfo?.firstDay!=null)return sl(w.weekInfo.firstDay)}catch{}return 1}function V(k){const w=new Date(2024,0,1),E=(w.getDay()-k+7)%7,j=new Date(w);return j.setDate(w.getDate()-E),j}const B=e.computed(()=>D(W.value)),ae=e.computed(()=>{const k=new Intl.DateTimeFormat(W.value,{weekday:"short"}),w=V(B.value),E=[];for(let j=0;j<7;j++){const Ce=new Date(w);Ce.setDate(w.getDate()+j),E.push(k.format(Ce).slice(0,2))}return E});function se(k,w,E){const j=new Date(k,w,1),Ce=new Date(k,w+1,0),qe=(j.getDay()-E+7)%7,Ie=Ce.getDate(),at=[];for(let f=0;f<qe;f++)at.push(null);for(let f=1;f<=Ie;f++)at.push(new Date(k,w,f));return at}const je=e.computed(()=>se(we.value,h.value,B.value)),St=e.computed(()=>se(Q.value,ye.value,B.value)),ut=e.computed(()=>se(he.value,K.value,B.value));e.computed(()=>{const k=new Date(Q.value,ye.value,1);return new Intl.DateTimeFormat(W.value,{month:"long",year:"numeric"}).format(k)}),e.computed(()=>{const k=new Date(he.value,K.value,1);return new Intl.DateTimeFormat(W.value,{month:"long",year:"numeric"}).format(k)});const Ge=e.computed(()=>{const k=new Date(Q.value,ye.value,1);return new Intl.DateTimeFormat(W.value,{month:"long"}).format(k)}),_t=e.computed(()=>{const k=new Date(he.value,K.value,1);return new Intl.DateTimeFormat(W.value,{month:"long"}).format(k)}),Nt=e.computed(()=>N.availableDates&&N.availableDates.length>0),vt={all:"datepicker.quickSelect.allDates",last2:"datepicker.quickSelect.last2Dates",last3:"datepicker.quickSelect.last3Dates",last4:"datepicker.quickSelect.last4Dates",last5:"datepicker.quickSelect.last5Dates",today:"datepicker.quickSelect.today",lastWeek:"datepicker.quickSelect.lastWeek",last15Days:"datepicker.quickSelect.last15Days",last30Days:"datepicker.quickSelect.last30Days",thisMonth:"datepicker.quickSelect.thisMonth",lastMonth:"datepicker.quickSelect.lastMonth",last3Months:"datepicker.quickSelect.last3Months",last6Months:"datepicker.quickSelect.last6Months",last12Months:"datepicker.quickSelect.last12Months",lastYear:"datepicker.quickSelect.lastYear"},Lt=e.computed(()=>Nt.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:"lastMonth",labelKey:"datepicker.quickSelect.lastMonth"},{id:"last3Months",labelKey:"datepicker.quickSelect.last3Months"},{id:"last6Months",labelKey:"datepicker.quickSelect.last6Months"},{id:"last12Months",labelKey:"datepicker.quickSelect.last12Months"},{id:"lastYear",labelKey:"datepicker.quickSelect.lastYear"}]),Ht=e.computed(()=>(Array.isArray(N.quickSelectOptions)&&N.quickSelectOptions.length?N.quickSelectOptions:Lt.value).map(w=>typeof w=="string"?{id:w,labelKey:vt[w]}:!w||typeof w!="object"||!w.id?null:{...w,labelKey:w.labelKey||vt[w.id]}).filter(w=>w&&w.id));function Mt(k){return k.label?k.label:k.labelKey?oe(k.labelKey):k.id}const wl=e.ref({top:0,left:0}),jl=e.ref("left");let El=null;function rl(){A.value&&e.nextTick(()=>{A.value&&(El!==null&&window.cancelAnimationFrame(El),El=window.requestAnimationFrame(()=>{El=null,ml()}))})}function ml(){if(!rt.value||!A.value)return;const k=rt.value.getBoundingClientRect(),w=window.innerWidth||document.documentElement.clientWidth,E=window.innerHeight||document.documentElement.clientHeight;let j=k.left,Ce=k.bottom+4;const qe=yt.value;if(qe){const Ie=qe.offsetWidth,at=qe.offsetHeight;jl.value==="right"||j+Ie>w-Xn?(jl.value="right",j=k.right-Ie):jl.value="left";const g=Math.max(Xn,w-Ie-Xn);if(j=Math.min(Math.max(j,Xn),g),Ce+at>E-Xn){const S=k.top-4-at;S>=Xn?Ce=S:Ce=Math.max(Xn,E-at-Xn)}}wl.value={top:Ce,left:j}}const un=e.computed(()=>!rt.value||!A.value?{}:{position:"fixed",left:`${wl.value.left}px`,top:`${wl.value.top}px`,zIndex:1002});function yl(k,w){return!k||!w?!1:k.getFullYear()===w.getFullYear()&&k.getMonth()===w.getMonth()&&k.getDate()===w.getDate()}function ft(k){return new Date(k.getFullYear(),k.getMonth(),k.getDate()).getTime()}function zl(k){return!N.availableDates||!N.availableDates.length?!0:N.availableDates.some(w=>w instanceof Date&&yl(w,k))}function Kl(k){const w=ft(k);return!(N.minDate instanceof Date&&w<ft(N.minDate)||N.maxDate instanceof Date&&w>ft(N.maxDate))}function Hl(k){const w=new Date(k);return new Date(w.getFullYear(),w.getMonth(),w.getDate())}function Rn(k){return Math.floor(Date.UTC(k.getFullYear(),k.getMonth(),k.getDate())/864e5)}function Gl(k,w){return new Date(k.getFullYear(),k.getMonth(),k.getDate()+w)}function bn(k){return k.filter(w=>Kl(w))}function Bn(k,w){if(!(k instanceof Date)||!(w instanceof Date))return null;let E=ft(k),j=ft(w);if(E>j&&([E,j]=[j,E]),N.minDate instanceof Date){const Ce=ft(N.minDate);E=Math.max(E,Ce),j=Math.max(j,Ce)}if(N.maxDate instanceof Date){const Ce=ft(N.maxDate);E=Math.min(E,Ce),j=Math.min(j,Ce)}return E>j?null:{start:Hl(E),end:Hl(j)}}function nn(k){return!N.exceptDates||!N.exceptDates.length?!1:N.exceptDates.some(w=>w instanceof Date&&yl(w,k))}function Rl(k){return nn(k)?!1:["singleFromAvailable","rangeFromAvailable"].includes(N.mode)?zl(k)&&Kl(k):Kl(k)}function dn(k){const w=kt.value,E=Rt.value,j=ct.value,Ce=ft(k),qe=et.value&&E.start&&E.end&&Ce>Math.min(ft(E.start),ft(E.end))&&Ce<Math.max(ft(E.start),ft(E.end)),Ie=et.value&&E.start&&yl(k,E.start),at=et.value&&E.end&&yl(k,E.end),f=Ie&&at,g=ht.value&&ze.value,S=g&&j.start&&yl(k,j.start),F=g&&j.end&&yl(k,j.end),z=S&&F,Qe=g&&j.start&&j.end&&Ce>Math.min(ft(j.start),ft(j.end))&&Ce<Math.max(ft(j.start),ft(j.end)),Te=Jt.value&&w&&yl(k,w)||Ie||at;let Ft=!1,Le=!1;const st=Ct.value?j:E;if(et.value&&st.start&&!st.end&&Ae.value){const ne=ft(st.start),ll=ft(Ae.value),Ze=Math.min(ne,ll),Kn=Math.max(ne,ll);Ct.value?Le=Ce>Ze&&Ce<Kn:Ft=Ce>Ze&&Ce<Kn}return{"dss-datepicker__day--comparison-start":S&&!z&&!Te,"dss-datepicker__day--comparison-end":F&&!z&&!Te,"dss-datepicker__day--comparison-single":z&&!Te,"dss-datepicker__day--in-comparison-range":Qe&&!S&&!F&&!Ie&&!at,"dss-datepicker__day--in-comparison-preview":Le&&!S&&!F&&!Qe&&!Ie&&!at,"dss-datepicker__day--selected":Te&&!f,"dss-datepicker__day--range-start":Ie&&!f,"dss-datepicker__day--range-end":at&&!f,"dss-datepicker__day--range-single":f,"dss-datepicker__day--in-range":qe&&!Ie&&!at,"dss-datepicker__day--in-range-preview":Ft&&!Ie&&!at&&!qe,"dss-datepicker__day--disabled":!Rl(k)}}function Sl(k){if(!et.value)return;const w=Ct.value?ct.value:Rt.value;if(!w.start||w.end){Ae.value=null;return}if(!Rl(k)){Ae.value=null;return}Ae.value=new Date(k.getFullYear(),k.getMonth(),k.getDate())}function mn(){Ae.value=null}function Wl(k=Rt.value){if(!N.doubleCalendar||!et.value)return;const w=Et(k),{start:E,end:j}=w;if(E&&j){const Ie=E<=j?E:j,at=E<=j?j:E,f=Ie.getMonth(),g=Ie.getFullYear(),S=at.getMonth(),F=at.getFullYear();if(f!==S||g!==F){const z=ye.value===f&&Q.value===g,Qe=K.value===S&&he.value===F;if(z&&Qe)return;ye.value=f,Q.value=g,K.value=S,he.value=F}else{const z=f===0?11:f-1,Qe=f===0?g-1:g;ye.value===z&&Q.value===Qe&&K.value===f&&he.value===g||(ye.value=f,Q.value=g,f===11?(K.value=0,he.value=g+1):(K.value=f+1,he.value=g))}return}const Ce=E||j;if(Ce){const Ie=Ce.getMonth(),at=Ce.getFullYear(),f=ye.value===Ie&&Q.value===at,g=K.value===Ie&&he.value===at;if(f||g)return;ye.value=Ie,Q.value=at,Ie===11?(K.value=0,he.value=at+1):(K.value=Ie+1,he.value=at);return}const qe=U();ye.value=qe.left.month,Q.value=qe.left.year,K.value=qe.right.month,he.value=qe.right.year}const pn=e.computed(()=>new Intl.DateTimeFormat(W.value,{day:"2-digit",month:"long",year:"numeric"})),on=e.computed(()=>{if(!lt.value)return[];const k=(N.availableDates||[]).filter(E=>E instanceof Date&&!Number.isNaN(E.getTime())).filter(E=>!nn(E)&&Kl(E)).map(E=>new Date(E.getFullYear(),E.getMonth(),E.getDate()));k.sort((E,j)=>j.getTime()-E.getTime());const w=kt.value;return k.map(E=>({date:E,ts:E.getTime(),label:pn.value.format(E),selected:!!(w&&yl(E,w))}))});function il(){if(A.value){ql();return}rt.value=Me.value?.closest(".dss-datepicker__input-wrap"),jl.value="left",A.value=!0,rl(),e.nextTick(()=>{Qt.value?.querySelector(".dss-datepicker__list-item--selected")?.scrollIntoView({block:"nearest",behavior:"auto"})})}function jn(k){if(!(k instanceof Date))return;const w=new Date(k.getFullYear(),k.getMonth(),k.getDate());L("update:modelValue",w),ql()}function Fn(k="start"){if(N.mode==="readonly")return;Re.value=k;const w=kt.value,E=Rt.value;if(Jt.value&&w)h.value=w.getMonth(),we.value=w.getFullYear();else if(et.value)if(N.doubleCalendar)Wl();else{const j=k==="start"&&E.start?E.start:E.end||E.start;j&&(h.value=j.getMonth(),we.value=j.getFullYear())}rt.value=Jt.value?He.value?.closest(".dss-datepicker__input-wrap"):Ke.value,de.value="days",Z.value=null,jl.value="left",A.value=!0,rl()}function ql(){de.value="days",Z.value=null,Ae.value=null,A.value=!1}function vn(k,w){Z.value=k,de.value=w}function Ll(){de.value="days",Z.value=null}function In(k,w,E,j){const Ce=new Date(w,E,j);let qe,Ie;switch(k){case"today":qe=Ce,Ie=Ce;break;case"lastWeek":qe=new Date(w,E,j-6),Ie=Ce;break;case"last15Days":qe=new Date(w,E,j-14),Ie=Ce;break;case"last30Days":qe=new Date(w,E,j-29),Ie=Ce;break;case"thisMonth":qe=new Date(w,E,1),Ie=Ce;break;case"lastMonth":qe=new Date(w,E-1,1),Ie=new Date(w,E,0);break;case"last3Months":qe=new Date(w,E-3,1),Ie=new Date(w,E,0);break;case"last6Months":qe=new Date(w,E-6,1),Ie=new Date(w,E,0);break;case"last12Months":qe=new Date(w,E-12,1),Ie=new Date(w,E,0);break;case"lastYear":qe=new Date(w-1,0,1),Ie=new Date(w-1,11,31);break;default:return null}return{start:qe,end:Ie}}function fn(k){const w=new Date,E=w.getFullYear(),j=w.getMonth(),Ce=w.getDate();let qe,Ie;if(Nt.value){const at=bn([...N.availableDates].filter(f=>f instanceof Date).map(f=>new Date(f.getFullYear(),f.getMonth(),f.getDate()))).sort((f,g)=>f.getTime()-g.getTime());if(at.length===0)return null;if(k==="all")qe=at[0],Ie=at[at.length-1];else{const f=parseInt(k.replace("last",""),10);if(Number.isInteger(f)&&f>=2&&f<=5){const g=at.slice(-f);if(g.length===0)return null;qe=g[0],Ie=g[g.length-1]}else{const g=In(k,E,j,Ce);if(!g)return null;const S=hn(g);if(!S.length)return null;qe=S[0],Ie=S[S.length-1]}}}else{const at=In(k,E,j,Ce);if(!at)return null;qe=at.start,Ie=at.end}return{start:qe,end:Ie}}function cl(k){const w=fn(k);return w?Bn(w.start,w.end):null}function jt(k){return cl(k)!==null}function Kt(k){const w=cl(k);w&&(L("update:modelValue",w),Wl())}function Yt(k){return!!(k&&k.start instanceof Date&&k.end instanceof Date)}function Tl(k){L("update:comparisonValue",Et(k))}function Tt(k=ct.value){const w=Et(k);Yt(w)&&(Xe.value=w)}function wt(){return Yt(Xe.value)?(Tl(Xe.value),N.doubleCalendar&&Wl(Xe.value),!0):!1}function Vl(k){const w=Se(k);return Yt(w)?Rl(w.start)&&Rl(w.end):!1}function hn(k){const w=Se(k);if(!Yt(w))return[];const E=ft(w.start),j=ft(w.end);return(N.availableDates||[]).filter(Ce=>Ce instanceof Date&&!Number.isNaN(Ce.getTime())).map(Ce=>tt(Ce)).filter(Ce=>{const qe=ft(Ce);return qe>=E&&qe<=j&&Rl(Ce)}).sort((Ce,qe)=>ft(Ce)-ft(qe))}function Nl(k){if(!(k instanceof Date))return null;const w=new Date(k.getFullYear()-1,k.getMonth(),k.getDate());return w.getMonth()!==k.getMonth()?new Date(k.getFullYear()-1,k.getMonth()+1,0):w}function gn(k=Ye.value){const w=Se(Rt.value);if(!Yt(w))return{start:null,end:null};let E,j;if(k==="previousPeriod"){const qe=Rn(w.end)-Rn(w.start)+1;j=Gl(w.start,-1),E=Gl(j,-(qe-1))}else if(k==="previousYear")E=Nl(w.start),j=Nl(w.end);else return ct.value;let Ce=Se({start:E,end:j});if(N.mode==="rangeFromAvailable"&&N.availableDates?.length){const qe=hn(Ce);if(!qe.length)return{start:null,end:null};Ce={start:qe[0],end:qe[qe.length-1]}}return Vl(Ce)?Ce:{start:null,end:null}}function Bl(){!ht.value||!ze.value||Ye.value==="custom"||Tl(gn())}function Zl(){if(ht.value){if(ze.value=!ze.value,!ze.value){Ye.value==="custom"&&Tt(),_e.value="primary",Tl({start:null,end:null});return}if(Ye.value==="custom"){_e.value="comparison",wt();return}_e.value="primary",Bl()}}function an(k){if(ie(k)){if(Ye.value=k,Ae.value=null,k==="custom"){if(_e.value="comparison",wt())return;N.doubleCalendar&&Yt(ct.value)&&Wl(ct.value);return}_e.value="primary",Bl()}}function Dl(k,w,E){const j=Et(k);return!j.start&&!j.end?(E.value="end",{start:w,end:null}):j.start&&j.end?(E.value="end",{start:w,end:null}):E.value==="start"?(E.value="end",Se({start:w,end:j.end})):(E.value="start",Se({start:j.start,end:w}))}function Gt(k){Z.value==="left"?ye.value=k:Z.value==="right"?K.value=k:h.value=k,Ll()}function zn(k){Z.value==="left"?Q.value=k:Z.value==="right"?he.value=k:we.value=k,Ll()}function Pl(){h.value===0?(h.value=11,we.value--):h.value--}function Dt(){h.value===11?(h.value=0,we.value++):h.value++}function Pn(){ye.value===0?(ye.value=11,Q.value--):ye.value--}function tl(){ye.value===11?(ye.value=0,Q.value++):ye.value++}function _l(){K.value===0?(K.value=11,he.value--):K.value--}function yn(){K.value===11?(K.value=0,he.value++):K.value++}function sn(k){if(!Rl(k))return;const w=new Date(k.getFullYear(),k.getMonth(),k.getDate());if(Jt.value){L("update:modelValue",w),ql();return}if(Ct.value){const j=Dl(ct.value,w,ge);Yt(j)&&Tt(j),Tl(j);return}_e.value="primary";const E=Dl(Rt.value,w,Re);L("update:modelValue",E)}e.watch(Rt,()=>{N.doubleCalendar&&et.value&&A.value&&Wl(),Bl()},{deep:!0}),e.watch(()=>N.comparisonEnabled,k=>{if(fe(),!k){ze.value=!1,_e.value="primary";return}Yt(ct.value)?ze.value=!0:ze.value&&Ye.value!=="custom"&&Bl()}),e.watch(H,()=>{fe()},{deep:!0}),e.watch(ct,k=>{ht.value&&Yt(k)&&(ze.value=!0,Ye.value==="custom"&&Tt(k))},{deep:!0,immediate:!0});let Fl=null,ul=null,Ql=null;function Ul(){Fl&&(document.removeEventListener("keydown",Fl),Fl=null),ul&&(window.removeEventListener("resize",ul),ul=null),Ql&&(window.removeEventListener("scroll",Ql,!0),Ql=null)}return e.watch(de,k=>{k==="years"&&e.nextTick(()=>{mt.value?.querySelector(`[data-year="${ce.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(()=>[A.value,de.value,h.value,we.value,ye.value,Q.value,K.value,he.value,Z.value,N.doubleCalendar,N.quickSelect,N.quickSelectOptions,N.comparisonControlsPlacement],()=>{rl()}),e.watch(A,k=>{Ul(),k&&(Fl=w=>{w.key==="Escape"&&(de.value==="years"||de.value==="months"?Ll():ql())},ul=()=>{ml()},Ql=()=>{ml()},document.addEventListener("keydown",Fl),window.addEventListener("resize",ul),window.addEventListener("scroll",Ql,!0))}),e.onBeforeUnmount(()=>{El!==null&&(window.cancelAnimationFrame(El),El=null),Ul()}),(k,w)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":_.mode==="readonly"}])},[_.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",xs,[w[10]||(w[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:X.value,readonly:"",disabled:"",tabindex:"-1"},null,8,Es)])):Jt.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:w[0]||(w[0]=E=>Fn("start"))},[w[11]||(w[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:He,type:"text",class:"dss-datepicker__input",placeholder:N.placeholder||e.unref(oe)("datepicker.selectDate"),value:bt.value,readonly:"",disabled:_.mode==="readonly"},null,8,Ss)])):lt.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":A.value}]),onClick:il},[w[13]||(w[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:Me,type:"text",class:"dss-datepicker__input",placeholder:N.placeholder||e.unref(oe)("datepicker.selectFromList"),value:bt.value,readonly:""},null,8,Vs),e.createElementVNode("span",{class:e.normalizeClass(["dss-datepicker__chevron",{"dss-datepicker__chevron--open":A.value}]),"aria-hidden":"true"},[...w[12]||(w[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)):et.value?(e.openBlock(),e.createElementBlock("div",{key:3,ref_key:"inputRangeWrapRef",ref:Ke,class:e.normalizeClass(["dss-datepicker__input-wrap",{"dss-datepicker__input-wrap--with-comparison":ht.value,"dss-datepicker__input-wrap--comparison-active":ht.value&&ze.value,"dss-datepicker__input-wrap--open":A.value}]),onClick:w[1]||(w[1]=E=>Fn("start"))},[w[16]||(w[16]=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)),ht.value?(e.openBlock(),e.createElementBlock("div",Ns,[e.createElementVNode("input",{ref_key:"inputRangeRef",ref:ke,type:"text",class:"dss-datepicker__input",placeholder:N.placeholder||e.unref(oe)("datepicker.selectRange"),value:el.value,readonly:""},null,8,Bs),ze.value&&re.value?(e.openBlock(),e.createElementBlock("div",_s,[e.createElementVNode("span",Ms,e.toDisplayString(re.value.start),1),w[14]||(w[14]=e.createElementVNode("span",{class:"dss-datepicker__comparison-sep"},"/",-1)),e.createElementVNode("span",$s,e.toDisplayString(re.value.end),1)])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("input",{key:1,ref_key:"inputRangeRef",ref:ke,type:"text",class:"dss-datepicker__input",placeholder:N.placeholder||e.unref(oe)("datepicker.selectRange"),value:el.value,readonly:""},null,8,Ls)),ht.value?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:e.normalizeClass(["dss-datepicker__comparison-toggle dss-datepicker__comparison-toggle--icon",{"dss-datepicker__comparison-toggle--active":ze.value}]),"aria-label":ze.value?e.unref(oe)("datepicker.comparison.active"):e.unref(oe)("datepicker.comparison.compareTo"),"aria-pressed":ze.value,onClick:e.withModifiers(Zl,["stop"])},[...w[15]||(w[15]=[e.createElementVNode("svg",{class:"dss-datepicker__comparison-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M9.06387 6.587C9.16352 6.54566 9.27319 6.5348 9.37901 6.5558C9.48484 6.57679 9.58205 6.6287 9.65837 6.70495L11.84 8.88661C11.8907 8.93727 11.931 8.99742 11.9584 9.06363C11.9859 9.12984 12 9.20082 12 9.27249C12 9.34417 11.9859 9.41514 11.9584 9.48135C11.931 9.54757 11.8907 9.60772 11.84 9.65837L9.65837 11.84C9.58209 11.9164 9.48487 11.9684 9.37902 11.9895C9.27316 12.0106 9.16343 11.9998 9.06371 11.9585C8.964 11.9171 8.87879 11.8472 8.81886 11.7574C8.75894 11.6676 8.72699 11.5621 8.72708 11.4542L8.72708 9.81791L0.545845 9.81791C0.401191 9.81791 0.262463 9.76045 0.160178 9.65816C0.0578924 9.55587 0.00042901 9.41715 0.000429004 9.27249C0.000428997 9.12784 0.0578924 8.98911 0.160178 8.88683C0.262463 8.78454 0.401191 8.72708 0.545845 8.72708L8.72708 8.72708L8.72708 7.09083C8.7271 6.98296 8.75911 6.87752 8.81906 6.78783C8.87901 6.69815 8.9642 6.62826 9.06387 6.587ZM2.34162 0.159964L0.159963 2.34163C0.109252 2.39228 0.0690227 2.45243 0.0415751 2.51865C0.0141274 2.58486 -4.08447e-07 2.65583 -4.05314e-07 2.72751C-4.0218e-07 2.79918 0.0141274 2.87016 0.0415751 2.93637C0.0690227 3.00258 0.109252 3.06273 0.159963 3.11339L2.34162 5.29505C2.4179 5.37142 2.51513 5.42343 2.62098 5.44451C2.72684 5.46559 2.83657 5.45479 2.93629 5.41347C3.036 5.37216 3.12121 5.30218 3.18114 5.21241C3.24106 5.12264 3.27301 5.0171 3.27292 4.90917L3.27292 3.27292L11.4542 3.27292C11.5988 3.27292 11.7375 3.21546 11.8398 3.11317C11.9421 3.01089 11.9996 2.87216 11.9996 2.72751C11.9996 2.58285 11.9421 2.44412 11.8398 2.34184C11.7375 2.23955 11.5988 2.18209 11.4542 2.18209L3.27292 2.18209L3.27292 0.545846C3.27301 0.43791 3.24106 0.332376 3.18114 0.242604C3.12121 0.152832 3.036 0.0828592 2.93629 0.0415426C2.83657 0.000226074 2.72684 -0.0105762 2.62098 0.0105043C2.51513 0.0315849 2.4179 0.0835995 2.34162 0.159964Z"})],-1)])],10,Ts)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[A.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(ql,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:yt,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":_.doubleCalendar&&et.value&&de.value==="days","dss-datepicker__dropdown--quick-select":_.doubleCalendar&&et.value&&de.value==="days"&&(_.quickSelect||pt.value),"dss-datepicker__dropdown--list":lt.value}]),onClick:w[9]||(w[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(un.value)},[lt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[on.value.length?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"dss-datepicker__list",role:"listbox",ref_key:"listRef",ref:Qt},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(on.value,E=>(e.openBlock(),e.createElementBlock("li",{key:E.ts,role:"option","aria-selected":E.selected,class:e.normalizeClass(["dss-datepicker__list-item",{"dss-datepicker__list-item--selected":E.selected}]),onClick:j=>jn(E.date)},[e.createElementVNode("span",As,e.toDisplayString(E.label),1),E.selected?(e.openBlock(),e.createElementBlock("svg",Hs,[...w[17]||(w[17]=[e.createElementVNode("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"},null,-1)])])):e.createCommentVNode("",!0)],10,Ds))),128))],512)):(e.openBlock(),e.createElementBlock("div",Rs,e.toDisplayString(e.unref(oe)("datepicker.noAvailableDates")),1))],64)):de.value==="days"&&_.doubleCalendar&&et.value?(e.openBlock(),e.createElementBlock("div",Fs,[_.quickSelect||pt.value?(e.openBlock(),e.createElementBlock("div",Is,[_.quickSelect?(e.openBlock(),e.createElementBlock("nav",zs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ht.value,E=>(e.openBlock(),e.createElementBlock("button",{key:E.id,type:"button",class:"dss-datepicker__quick-select-btn",disabled:!jt(E.id),onClick:j=>Kt(E.id)},e.toDisplayString(Mt(E)),9,Ps))),128))])):e.createCommentVNode("",!0),pt.value?(e.openBlock(),e.createElementBlock("div",Os,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-datepicker__comparison-toggle",{"dss-datepicker__comparison-toggle--active":ze.value}]),onClick:Zl},e.toDisplayString(ze.value?e.unref(oe)("datepicker.comparison.active"):e.unref(oe)("datepicker.comparison.compareTo")),3),ze.value?(e.openBlock(),e.createElementBlock("div",Ws,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.value,E=>(e.openBlock(),e.createElementBlock("button",{key:E.id,type:"button",class:e.normalizeClass(["dss-datepicker__comparison-mode",{"dss-datepicker__comparison-mode--active":Ye.value===E.id}]),onClick:j=>an(E.id)},e.toDisplayString(Y(E)),11,qs))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Zs,[e.createElementVNode("div",Us,[e.createElementVNode("div",Ys,[e.createElementVNode("div",Xs,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(oe)("datepicker.prevMonth"),onClick:Pn}," ‹ ",8,js),e.createElementVNode("div",Ks,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:w[2]||(w[2]=E=>vn("left","months"))},e.toDisplayString(Ge.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:w[3]||(w[3]=E=>vn("left","years"))},e.toDisplayString(Q.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(oe)("datepicker.nextMonth"),onClick:tl}," › ",8,Gs)]),e.createElementVNode("div",Qs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ae.value,E=>(e.openBlock(),e.createElementBlock("span",{key:E,class:"dss-datepicker__weekday"},e.toDisplayString(E),1))),128))]),e.createElementVNode("div",Js,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(St.value,(E,j)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+j},[E?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",dn(E)]),disabled:!Rl(E),onClick:Ce=>sn(E),onMouseenter:Ce=>Sl(E),onMouseleave:mn},e.toDisplayString(E.getDate()),43,er)):(e.openBlock(),e.createElementBlock("span",tr))],64))),128))])]),e.createElementVNode("div",lr,[e.createElementVNode("div",nr,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(oe)("datepicker.prevMonth"),onClick:_l}," ‹ ",8,or),e.createElementVNode("div",ar,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:w[4]||(w[4]=E=>vn("right","months"))},e.toDisplayString(_t.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:w[5]||(w[5]=E=>vn("right","years"))},e.toDisplayString(he.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(oe)("datepicker.nextMonth"),onClick:yn}," › ",8,sr)]),e.createElementVNode("div",rr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ae.value,E=>(e.openBlock(),e.createElementBlock("span",{key:E,class:"dss-datepicker__weekday"},e.toDisplayString(E),1))),128))]),e.createElementVNode("div",ir,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ut.value,(E,j)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+j},[E?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",dn(E)]),disabled:!Rl(E),onClick:Ce=>sn(E),onMouseenter:Ce=>Sl(E),onMouseleave:mn},e.toDisplayString(E.getDate()),43,cr)):(e.openBlock(),e.createElementBlock("span",ur))],64))),128))])])]),Xt.value?(e.openBlock(),e.createElementBlock("div",dr,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-datepicker__comparison-toggle",{"dss-datepicker__comparison-toggle--active":ze.value}]),onClick:Zl},e.toDisplayString(ze.value?e.unref(oe)("datepicker.comparison.active"):e.unref(oe)("datepicker.comparison.compareTo")),3),ze.value?(e.openBlock(),e.createElementBlock("div",mr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.value,E=>(e.openBlock(),e.createElementBlock("button",{key:E.id,type:"button",class:e.normalizeClass(["dss-datepicker__comparison-mode",{"dss-datepicker__comparison-mode--active":Ye.value===E.id}]),onClick:j=>an(E.id)},e.toDisplayString(Y(E)),11,pr))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])):de.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[ht.value?(e.openBlock(),e.createElementBlock("div",vr,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-datepicker__comparison-toggle",{"dss-datepicker__comparison-toggle--active":ze.value}]),onClick:Zl},e.toDisplayString(ze.value?e.unref(oe)("datepicker.comparison.active"):e.unref(oe)("datepicker.comparison.compareTo")),3),ze.value?(e.openBlock(),e.createElementBlock("div",fr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.value,E=>(e.openBlock(),e.createElementBlock("button",{key:E.id,type:"button",class:e.normalizeClass(["dss-datepicker__comparison-mode",{"dss-datepicker__comparison-mode--active":Ye.value===E.id}]),onClick:j=>an(E.id)},e.toDisplayString(Y(E)),11,hr))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",gr,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(oe)("datepicker.prevMonth"),onClick:Pl}," ‹ ",8,yr),e.createElementVNode("div",kr,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:w[6]||(w[6]=E=>de.value="months")},e.toDisplayString(Ve.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:w[7]||(w[7]=E=>de.value="years")},e.toDisplayString(we.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(oe)("datepicker.nextMonth"),onClick:Dt}," › ",8,Cr)]),e.createElementVNode("div",br,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ae.value,E=>(e.openBlock(),e.createElementBlock("span",{key:E,class:"dss-datepicker__weekday"},e.toDisplayString(E),1))),128))]),e.createElementVNode("div",wr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je.value,(E,j)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:j},[E?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",dn(E)]),disabled:!Rl(E),onClick:Ce=>sn(E),onMouseenter:Ce=>Sl(E),onMouseleave:mn},e.toDisplayString(E.getDate()),43,xr)):(e.openBlock(),e.createElementBlock("span",Er))],64))),128))])],64)):de.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",Sr,[e.createElementVNode("div",Vr,[e.createElementVNode("span",Nr,e.toDisplayString(nt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:w[8]||(w[8]=E=>de.value="years")},e.toDisplayString(ce.value),1)])]),e.createElementVNode("div",Br,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xt.value,(E,j)=>(e.openBlock(),e.createElementBlock("button",{key:j,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":j===te.value}]),onClick:Ce=>Gt(j)},e.toDisplayString(E),11,_r))),128))])],64)):de.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",Mr,[e.createElementVNode("span",$r,e.toDisplayString(Vt.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:mt},[e.createElementVNode("div",Lr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(dl.value,E=>(e.openBlock(),e.createElementBlock("button",{key:E,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":E===ce.value,"dss-datepicker__year-cell--current":E===e.unref(xe)}]),"data-year":E,onClick:j=>zn(E)},e.toDisplayString(E),11,Tr))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},Dr={class:"dss-step-bar__layout"},Ar={class:"dss-step-bar__header"},Hr={class:"dss-step-bar__label"},Rr={key:0,class:"dss-step-bar__counter"},Fr={class:"dss-step-bar__track-wrapper"},Ir=["aria-valuemax","aria-valuenow","aria-label"],zr=["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:_=>["input","desc","asc"].includes(_)},orientation:{type:String,default:"horizontal",validator:_=>["horizontal","vertical"].includes(_)},barHeight:{type:[Number,String],default:200},labelPosition:{type:String,default:"up",validator:_=>["up","down","left","right"].includes(_)},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(_){const J=_,N={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"}}},L=H=>H&&typeof H=="object"&&!Array.isArray(H),oe=(H,Y)=>{const ie=Object.assign({},H);return!L(H)||!L(Y)||Object.keys(Y).forEach(fe=>{if(L(Y[fe])){fe in H?ie[fe]=oe(H[fe],Y[fe]):Object.assign(ie,{[fe]:Y[fe]});return}Object.assign(ie,{[fe]:Y[fe]})}),ie},W=e.computed(()=>oe(N,J.options)),A=e.computed(()=>Math.max(1,Number(J.steps)||1)),de=e.computed(()=>Math.min(A.value,Math.max(0,Number(J.currentStep)||0))),dt=e.computed(()=>Array.isArray(J.segments)&&J.segments.length>0),ee=e.computed(()=>{if(!dt.value)return[];const H=J.segments.map((Y,ie)=>{const fe=Number(Y?.value);return{label:Y?.label||`Step ${ie+1}`,value:Number.isFinite(fe)&&fe>0?fe:0,color:Y?.color||J.activeColor,marker:Y?.marker}});return J.segmentOrder==="desc"?[...H].sort((Y,ie)=>ie.value-Y.value):J.segmentOrder==="asc"?[...H].sort((Y,ie)=>Y.value-ie.value):H}),h=e.computed(()=>dt.value?ee.value.reduce((H,Y)=>H+Y.value,0):de.value),we=e.computed(()=>dt.value?Number.isFinite(Number(J.totalValue))&&Number(J.totalValue)>0?Number(J.totalValue):Math.max(1,h.value):A.value),ye=e.computed(()=>dt.value&&Number.isFinite(Number(J.totalValue))&&Number(J.totalValue)>0),Q=e.computed(()=>ye.value?Math.max(0,Number(J.totalValue)-h.value):0),K=e.computed(()=>typeof J.remainderLabel=="string"&&J.remainderLabel.trim().length>0),he=e.computed(()=>Q.value>0),Re=e.computed(()=>ee.value.reduce((H,Y)=>Math.max(H,Number(Y.value)||0),0)),ge=e.computed(()=>ee.value.filter(H=>H.value>0).map(H=>`${H.label}: ${lt(H.value)}`).join(" | ")),Ae=e.computed(()=>dt.value?ye.value?ee.value.filter(H=>H.value>0):ee.value:[]),Z=e.computed(()=>{if(!J.counterAsPercentage)return`${h.value} / ${we.value}`;const H=Number(we.value);if(!Number.isFinite(H)||H<=0)return"0%";const Y=Math.round(Number(h.value)/H*100);return`${Math.min(Math.max(Y,0),100)}%`}),ze=e.computed(()=>h.value),Ye=e.computed(()=>we.value),_e=e.reactive({visible:!1,x:0,y:0,content:""}),Xe=e.computed(()=>J.orientation==="vertical"),U=e.computed(()=>{const H=J.barHeight;return H==null||H===""?"200px":typeof H=="number"?`${H}px`:String(H)}),He=e.computed(()=>{const H=J.sideLabelMaxWidth;if(!(H==null||H===""))return typeof H=="number"?`${H}px`:String(H)}),Ke=e.computed(()=>{const H=J.sideLabelWrapWidth;return H==null||H===""?"18ch":typeof H=="number"?`${H}ch`:String(H)}),ke=e.computed(()=>({left:`${_e.x}px`,top:`${_e.y}px`,transform:"translate(-50%, calc(-100% - 8px))"})),Me=H=>Xe.value?{flex:`${H} 0 0`,minHeight:H>0?"6px":"0",minWidth:"0"}:{flex:`${H} 0 0`,minWidth:H>0?"6px":"0"},rt=H=>{const Y=H?.parentElement;if(!Y)return{x:0,y:0};const ie=Y.getBoundingClientRect();return{x:ie.left+ie.width/2,y:ie.top}},yt=H=>{const Y=H.getBoundingClientRect();return{x:Y.left+Y.width/2,y:Y.top}},mt=H=>{if(ye.value){const fe=Math.max(0,Number(H.value)||0);return{...Me(fe),backgroundColor:H.color}}const Y=h.value,ie=H.value>0?H.value:Y>0?1e-4:1;return{...Me(ie),backgroundColor:H.color}},Qt=H=>Number(H?.value||0)>0&&Number(H?.value||0)===Re.value,xe=H=>{const Y=L(H?.marker)?H.marker:{},ie=H?.marker===!0||Y.enabled===!0,fe=Qt(H)&&W.value.maxSegment?.marker?.enabled===!0;if(!(ie||fe))return{enabled:!1};const tt=Y.backgroundColor??(fe?W.value.maxSegment?.marker?.backgroundColor:W.value.segmentMarker?.backgroundColor),Et=Y.borderColor??(fe?W.value.maxSegment?.marker?.borderColor:W.value.segmentMarker?.borderColor),Se=Y.color??(fe?W.value.maxSegment?.marker?.color:W.value.segmentMarker?.color),ot=Y.width??(fe?W.value.maxSegment?.marker?.width:W.value.segmentMarker?.width),bt=Y.height??(fe?W.value.maxSegment?.marker?.height:W.value.segmentMarker?.height);return{enabled:!0,backgroundColor:tt,borderColor:Et,color:Se,width:ot,height:bt,icon:Y.icon??null,...Y}},Jt=H=>{const Y=xe(H);return{backgroundColor:Y.backgroundColor??void 0,borderColor:Y.borderColor??void 0,color:Y.color??void 0}},et=H=>{const Y=xe(H);return{width:Y.width??void 0,height:Y.height??void 0}},lt=H=>`${H}${J.valueLabel}`,kt=e.computed(()=>({...Me(Q.value),backgroundColor:J.inactiveColor})),Rt=(H,Y)=>{J.disableTooltips||pt(H,Y)},ct=H=>{J.disableTooltips||Xt(H)},ht=()=>{J.disableTooltips||Ct()},pt=(H,Y)=>{if(!H||!Y?.currentTarget)return;const ie=Y.currentTarget;if(J.remainderTooltipSummary){const Fe=rt(ie);_e.x=Fe.x,_e.y=Fe.y,_e.content=ge.value,_e.visible=!!_e.content;return}const fe=yt(ie);_e.x=fe.x,_e.y=fe.y,_e.content=`${H.label}: ${lt(H.value)}`,_e.visible=!0},Xt=H=>{if(!Q.value||!H?.currentTarget)return;const Y=H.currentTarget;if(J.remainderTooltipSummary){const fe=rt(Y);_e.x=fe.x,_e.y=fe.y,_e.content=ge.value,_e.visible=!!_e.content;return}const ie=yt(Y);_e.x=ie.x,_e.y=ie.y,K.value&&(_e.content=`${J.remainderLabel}: ${lt(Q.value)}`,_e.visible=!0)},Ct=()=>{_e.visible=!1},Pt=()=>{_e.visible&&Ct()};e.onMounted(()=>{window.addEventListener("scroll",Pt,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("scroll",Pt,!0)});const pe=e.computed(()=>({"--dss-step-bar-label-color":J.labelColor??void 0,"--dss-step-bar-counter-color":J.counterColor??void 0,"--dss-step-bar-active-color":J.activeColor,"--dss-step-bar-inactive-color":J.inactiveColor,"--dss-step-bar-bar-height":Xe.value?U.value:void 0,"--dss-step-bar-side-label-max-width":He.value,"--dss-step-bar-side-label-wrap-width":Ke.value}));return(H,Y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-step-bar",[`dss-step-bar--${_.orientation}`,`dss-step-bar--label-${_.labelPosition}`]]),style:e.normalizeStyle(pe.value)},[e.createElementVNode("div",Dr,[e.createElementVNode("div",Ar,[e.createElementVNode("span",Hr,[e.renderSlot(H.$slots,"label",{label:_.label},()=>[e.createTextVNode(e.toDisplayString(_.label),1)])]),_.showCounter?(e.openBlock(),e.createElementBlock("span",Rr,[e.renderSlot(H.$slots,"counter",{counterDisplay:Z.value},()=>[e.createTextVNode(e.toDisplayString(Z.value),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Fr,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":Ye.value,"aria-valuenow":ze.value,"aria-label":_.label},[dt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ae.value,(ie,fe)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${fe}-${ie.label}`,class:e.normalizeClass(["dss-step-bar__segment dss-step-bar__segment--interactive",{"dss-step-bar__segment--max":Qt(ie),"dss-step-bar__segment--marker-enabled":xe(ie).enabled}]),style:e.normalizeStyle(mt(ie)),onMouseenter:Fe=>Rt(ie,Fe),onMouseleave:ht},[xe(ie).enabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment-marker",style:e.normalizeStyle(Jt(ie)),"aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-step-bar__segment-marker-icon",style:e.normalizeStyle(et(ie))},[e.renderSlot(H.$slots,"segment-marker-icon",{segment:ie,index:fe,marker:xe(ie)},()=>[e.renderSlot(H.$slots,"max-segment-icon",{segment:ie,index:fe,marker:xe(ie)},()=>[e.createTextVNode(e.toDisplayString(xe(ie).icon||""),1)])])],4)],4)):e.createCommentVNode("",!0)],46,zr))),128)),he.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(kt.value),onMouseenter:Y[0]||(Y[0]=ie=>ct(ie)),onMouseleave:ht},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(A.value,ie=>(e.openBlock(),e.createElementBlock("div",{key:ie,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":ie<=de.value}])},null,2))),128))],8,Ir)])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[!_.disableTooltips&&_e.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(_e.content),5)):e.createCommentVNode("",!0)]))],6))}},Pr=["data-chart-type"],Or={class:"dss-chart-header-titles"},Wr={key:0,class:"dss-chart-title"},qr={key:1,class:"dss-chart-subtitle"},Zr=["onClick","onMouseenter"],Ur={class:"dss-legend-text"},Yr=["onClick","onMouseenter"],Xr={class:"dss-legend-text"},jr=["title"],Kr=["src"],Gr={class:"dss-chart-area-wrapper"},Qr={key:0,class:"dss-chart-z-axis-label"},Jr=["width","height","data-smooth","data-animated"],ei=["id"],ti=["y","width","height"],li=["id"],ni=["d"],oi=["id"],ai=["d"],si={key:0},ri=["clip-path"],ii=["x1","x2","y1","y2"],ci=["clip-path"],ui=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray","opacity"],di={class:"dss-axes"},mi=["x1","x2","y1","y2"],pi=["x1","x2","y1","y2"],vi=["x1","x2","y1","y2"],fi={class:"dss-axis-labels"},hi=["x","y"],gi=["x","y"],yi=["x","y"],ki=["x","y"],Ci=["y","transform"],bi=["x","y","transform"],wi={key:2,class:"dss-flag-markers"},xi=["clip-path"],Ei=["x1","x2","y1","y2","onMouseover"],Si=["x1","x2","y1","y2","onMouseover"],Vi=["x1","x2","y1","y2","onMouseover"],Ni=["cx","cy","onMouseover"],Bi=["cx","cy","fill","onMouseover"],_i=["x","y"],Mi=["clip-path"],$i={key:0},Li=["d","onMouseover"],Ti=["x","y","width","height","fill","onMouseover"],Di={class:"dss-line-chart"},Ai=["d","stroke","stroke-width","stroke-dasharray"],Hi=["d","stroke","stroke-width","opacity"],Ri=["cx","cy","r","fill","onMouseover"],Fi={key:1},Ii=["d","stroke","stroke-width","stroke-dasharray"],zi=["d","stroke","stroke-width","stroke-dasharray"],Pi=["d","stroke","stroke-width","opacity"],Oi=["cx","cy","r","fill","onMouseover"],Wi={key:2},qi=["id"],Zi=["x","y","width","height"],Ui=["d","fill","fill-opacity","mask"],Yi=["d","stroke","stroke-width"],Xi=["d","fill","onMouseover"],ji=["x","y","width","height","onMouseover"],Ki=["clip-path"],Gi=["x1","x2","y1","y2","stroke"],Qi=["cx","cy","r","fill"],Ji={key:1,class:"dss-bubble-chart"},ec={key:0,class:"dss-bubble-group"},tc=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],lc=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],nc=["transform"],oc=["cx","cy","r"],ac=["data-chart-type","clip-path"],sc=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],rc={key:1,class:"dss-radial-segment-data-labels"},ic=["x","y"],cc=["x","y","font-size","fill"],uc=["x1","y1","x2","y2","stroke"],dc=["x1","y1","x2","y2","stroke"],mc=["x","y","text-anchor","font-size"],pc=["transform"],vc={key:0,class:"dss-spider-grid"},fc=["cx","cy","r"],hc={class:"dss-spider-grid-labels"},gc=["x","y"],yc=["x","y"],kc=["x1","x2","y1","y2"],Cc={class:"dss-spider-labels"},bc=["x","y","text-anchor","dominant-baseline"],wc=["points","fill","fill-opacity","stroke","stroke-width","stroke-dasharray"],xc=["cx","cy","r","fill","stroke","stroke-width","onMouseover"],Ec={class:"dss-chart-logos"},Sc=["cx","cy","r","fill"],Vc=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Nc={key:0,class:"dss-stepbar-grid-lines","aria-hidden":"true"},Bc=["onClick","onMouseenter"],_c=["src"],Mc={class:"dss-marker-tooltip-category"},$c={key:0,class:"dss-marker-tooltip-description"},Lc={key:0,class:"dss-tooltip-section dss-spider-tooltip-section"},Tc={class:"dss-tooltip-title dss-spider-tooltip-area-title"},Dc={class:"dss-tooltip-series-name"},Ac={class:"dss-tooltip-series-value"},Hc={key:1,class:"dss-tooltip-section"},Rc={key:0,class:"dss-tooltip-title"},Fc={class:"dss-bubble-tooltip-data"},Ic={key:2,class:"dss-tooltip-section"},zc={class:"dss-tooltip-title"},Pc={class:"dss-tooltip-value"},Oc={key:0,class:"dss-tooltip-section"},Wc={class:"dss-tooltip-section-title"},qc={class:"dss-tooltip-group-header"},Zc={class:"dss-tooltip-item-content"},Uc={class:"dss-tooltip-item-text"},Yc={key:1,class:"dss-tooltip-section"},Xc={class:"dss-tooltip-section-title"},jc={class:"dss-tooltip-item-content"},Kc={class:"dss-tooltip-item-title"},Gc={key:0,class:"dss-tooltip-item-description"},Qc={class:"dss-tooltip-section"},Jc={class:"dss-tooltip-title"},eu={key:0,class:"dss-bubble-tooltip-data"},tu={class:"dss-tooltip-series-name"},lu={class:"dss-tooltip-series-value"},nu={key:0,class:"dss-tooltip-section"},ou={class:"dss-tooltip-section-title"},au={class:"dss-tooltip-group-header"},su={class:"dss-tooltip-item-content"},ru={class:"dss-tooltip-item-text"},iu={key:1,class:"dss-tooltip-section"},cu={class:"dss-tooltip-section-title"},uu={class:"dss-tooltip-item-content"},du={class:"dss-tooltip-item-title"},mu={key:0,class:"dss-tooltip-item-description"},pu=["onClick","onMouseenter"],vu={class:"dss-legend-text"},fu={key:1,class:"dss-context-menu-separator"},hu={key:0,class:"dss-context-menu-separator"},gu={key:0,class:"dss-context-menu-separator"},yu=["onClick"],ku=["innerHTML"],Cu={key:0,class:"dss-context-menu-icon"},bu={class:"dss-marker-modal-header"},wu={class:"dss-marker-modal-body"},xu={class:"dss-form-group"},Eu={class:"dss-form-group"},Su={for:"dss-marker-description"},Vu={key:0,class:"dss-form-text-display"},Nu=["placeholder"],Bu={class:"dss-marker-modal-footer"},_u={class:"modal-footer-left"},Mu={class:"dss-modal-footer-right"},$u=["disabled"],Lu={name:"DSSChart"},Tu=Object.assign(Lu,{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:_=>typeof _=="object"&&_!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(_,{emit:J}){const{t:N,locale:L}=ho.useI18n(),oe=J,W=e.ref(null),A=e.ref(null);let de=null;const dt=()=>{de&&(de(),de=null);const t=A.value;if(!t||xe.value!=="stepbar")return;const o=l=>$o(l);t.addEventListener("wheel",o,{passive:!1}),de=()=>t.removeEventListener("wheel",o)},ee=e.ref(null),h=e.ref(null),we=e.ref(0),ye=e.ref(0);let Q=null,K=null;const he=20,Re=e.computed(()=>{if(ye.value,we.value,!W.value||!ee.value)return 0;try{const t=W.value.getBoundingClientRect();return ee.value.getBoundingClientRect().top-t.top}catch{return 0}}),ge=e.computed(()=>`chart-clip-${Z.chartId}`),Ae=e.computed(()=>`url(#${ge.value})`),Z=_,ze={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 Ye(t,o){const l=Object.assign({},t);return Xe(t)&&Xe(o)&&Object.keys(o).forEach(r=>{Xe(o[r])?r in t?l[r]=Ye(t[r],o[r]):Object.assign(l,{[r]:o[r]}):Object.assign(l,{[r]:o[r]})}),l}const _e=()=>{let t=20,o=0,l=0;if(et.value&&(t+=30),lt.value&&(t+=25),fe.value&&Z.series.length>0){const r=Z.series.filter((m,v)=>!F.value.has(v)).length;if(Fe.value==="top"||Fe.value==="bottom"){if(tt.value==="horizontal"){const v=Math.floor(Me.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 Xe(t){return t&&typeof t=="object"&&!Array.isArray(t)}const U=e.computed(()=>Ye(ze,Z.options)),He=e.computed(()=>{const t=U.value;return t&&t.chart&&t.chart.width==="auto"}),Ke=e.computed(()=>{const t=U.value;return t&&t.chart&&t.chart.height==="auto"}),ke=e.computed(()=>{const t=U.value;return t?.chart?.type==="stepbar"&&t?.chart?.height==="fit"}),Me=e.computed(()=>{const t=U.value;return He.value?we.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),rt=e.ref(he),yt=e.computed(()=>{if(Ke.value){const t=yt.value;return t??Math.max(0,(ye.value||400)-rt.value*5)}}),mt=e.computed(()=>{const t=U.value;if(xe.value==="mini-radial")return Me.value;if(ke.value)return un.value;if(Ke.value){const o=yt.value;return o??Math.max(0,(ye.value||400)-rt.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),Qt=e.computed(()=>{if(Ke.value&&xe.value==="semi-radial"&&yt.value!=null)return rt.value+mt.value+"px";if(Ke.value)return"100%";if(xl.value)return rt.value+mt.value+"px";if(fe.value&&Fe.value==="bottom"){const t=_e();return mt.value+(t.legendHeight||35)+"px"}return mt.value+(fe.value?20:0)+"px"}),xe=e.computed(()=>{const t=U.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),Jt=e.computed(()=>{const t=Z.series.map(o=>o.type||xe.value);return new Set(t).size>1}),et=e.computed(()=>{const t=U.value;return t&&t.title&&t.title.text?t.title.text:""}),lt=e.computed(()=>{const t=U.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),kt=e.computed(()=>{const t=U.value;if(!t||!t.zAxis)return"";const o=t.zAxis;return typeof o=="string"?o:o&&typeof o.label=="string"?o.label:""}),Rt=e.computed(()=>{const t=U.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),ct=e.computed(()=>{const o=U.value?.yAxis?.title?.text;return o==null||String(o).trim()===""?"":String(o)}),ht=e.computed(()=>{const t=U.value;return t&&t.yAxis&&t.yAxis.secondary&&typeof t.yAxis.secondary=="object"?t.yAxis.secondary:null}),pt=e.computed(()=>{const t=ht.value;return t&&t.title&&t.title.text?t.title.text:""}),Xt=e.computed(()=>{const t=U.value;if(!t||!t.yAxis)return Al;const o=t.yAxis.min;return typeof o=="number"||o===Al?o:Al}),Ct=e.computed(()=>{const t=U.value;if(!t||!t.yAxis)return Al;const o=t.yAxis.max;return typeof o=="number"||o===Al?o:Al}),Pt=e.computed(()=>{const t=ht.value;if(!t)return Al;const o=t.min;return typeof o=="number"||o===Al?o:Al}),pe=e.computed(()=>{const t=ht.value;if(!t)return Al;const o=t.max;return typeof o=="number"||o===Al?o:Al}),H=e.computed(()=>{const t=U.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),Y=e.computed(()=>{const t=U.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),ie=e.computed(()=>{const t=U.value;return t&&t.grid&&t.grid.show!==!1}),fe=e.computed(()=>{const t=U.value;return t&&t.legend&&t.legend.show!==!1}),Fe=e.computed(()=>{const t=U.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),tt=e.computed(()=>{const t=U.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Et=e.computed(()=>{const t=U.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),Se=e.computed(()=>{const t=U.value;if(!t)return!1;if(xe.value==="stepbar"){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"}),ot=e.computed(()=>{const t=U.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),bt=e.computed(()=>{const t=U.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),el=e.computed(()=>{const t=U.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),re=e.computed(()=>{const t=U.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),X=e.computed(()=>{const t=U.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),te=e.computed(()=>{if(!xl.value)return 0;const t=U.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),ce=e.computed(()=>{const t=U.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),Ve=e.computed(()=>{const{maxX:t}=Bt.value;return t===0}),nt=(t,o)=>Ve.value&&o===0?5:o,xt=t=>{const o=Number(t);return!Number.isFinite(o)||o<=0?0:o},dl=e.computed(()=>{const t=U.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),Vt=e.computed(()=>{const t=U.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),sl=e.computed(()=>{const t=U.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),D=e.computed(()=>{const t=U.value;return Vt.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),V=e.computed(()=>{const t=U.value,o=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return o.length>0?o:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),B=e.computed(()=>U.value?.stepbar||{}),ae=e.computed(()=>{const t=B.value?.segmentOrder;return["asc","desc","input"].includes(t)?t:"input"}),se=e.computed(()=>{const t=Number(B.value?.totalValue);return Number.isFinite(t)&&t>0?t:100}),je=e.computed(()=>B.value?.showRemainder!==!1),St=e.computed(()=>B.value?.remainderLabel||"Remaining"),ut=e.computed(()=>B.value?.remainderColor||"#E5E7EB"),Ge=e.computed(()=>{const t=Number(B.value?.barWidth);return Number.isFinite(t)&&t>0?t:42}),_t=e.computed(()=>{const t=Number(B.value?.minBarWidth);return Number.isFinite(t)&&t>0?t:12}),Nt=e.computed(()=>{const t=Number(B.value?.maxBarWidth);return Number.isFinite(t)&&t>0?t:58});e.computed(()=>{const t=Number(B.value?.barRadius);return Number.isFinite(t)&&t>=0?t:6});const vt=e.computed(()=>B.value?.axisBars||{}),Lt=e.computed(()=>vt.value?.show!==!1);e.computed(()=>vt.value?.showVertical===!0);const Ht=e.computed(()=>vt.value?.color||"#d6d6d6"),Mt=e.computed(()=>{const t=Number(vt.value?.opacity);return Number.isFinite(t)?Math.min(Math.max(t,0),1):.75}),wl=e.computed(()=>{const t=Number(vt.value?.width);return Number.isFinite(t)&&t>0?t:1}),jl=e.computed(()=>vt.value?.dashArray||"3,4"),El=e.computed(()=>{const t=Number(B.value?.columnGap);return Number.isFinite(t)&&t>=0?t:16}),rl=e.computed(()=>{const t=Number(B.value?.labelReserve);return Number.isFinite(t)&&t>0?t:48}),ml=e.computed(()=>{const t=Number(B.value?.trackAreaHeight);return Number.isFinite(t)&&t>0?t:220}),un=e.computed(()=>{let t=0;et.value&&(t+=15),lt.value&&(t+=10);const o=50+t,l=rl.value+8;return o+ml.value+l}),yl=e.computed(()=>Math.max(P.value.height,0)),ft=e.computed(()=>{const t=Number(B.value?.columnWidth);if(Number.isFinite(t)&&t>0)return t;const o=Ge.value,l=_t.value,r=Nt.value;return Math.max(l,Math.min(r,o))}),zl=e.computed(()=>{const t=Number(B.value?.trackWidth);if(Number.isFinite(t)&&t>0)return Math.min(t,ft.value);const o=Number(B.value?.barWidth);return Number.isFinite(Number(B.value?.columnWidth))&&Number(B.value?.columnWidth)>0&&Number.isFinite(o)&&o>0?Math.min(o,ft.value):Math.min(ft.value,Math.max(10,Math.round(ft.value*.32)))}),Kl=e.computed(()=>({width:`${ft.value}px`,flex:`0 0 ${ft.value}px`,"--dss-step-bar-track-thickness":`${zl.value}px`,"--dss-stepbar-label-height":`${rl.value}px`})),Hl=e.computed(()=>{const t=Gl.value.length;return t?t*ft.value+Math.max(0,t-1)*El.value:0}),Rn=e.computed(()=>({maxSegment:{marker:{enabled:!1}}})),Gl=e.computed(()=>xe.value!=="stepbar"?[]:Dn.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}))}))),bn=e.computed(()=>{if(xe.value!=="stepbar")return[];const{minY:t,maxY:o}=Bt.value,l=5,r=[];for(let m=0;m<=l;m++){const v=t+(o-t)*(m/l);r.push({top:Un(v)-P.value.top,value:v})}return r}),Bn=e.computed(()=>({top:`${P.value.top}px`,left:`${P.value.left}px`,width:`${P.value.width}px`,height:`${yl.value+rl.value}px`})),nn=e.computed(()=>({width:`${Hl.value}px`,minHeight:`${yl.value+rl.value}px`})),Rl=e.computed(()=>xe.value==="stepbar"&&Se.value&&Le.value.show&&!ne.value.isZooming),dn=e.computed(()=>{const t=ft.value+El.value;return{left:`${Le.value.categoryIndex*t+ft.value/2}px`,height:`${yl.value}px`,borderColor:ot.value}}),Sl=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.enabled!==!1}),mn=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),Wl=e.computed(()=>{const t=U.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),pn=e.computed(()=>{const t=U.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),on=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),il=e.computed(()=>{const t=U.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),jn=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.onDataChange!==!1}),Fn=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),ql=e.computed(()=>{const t=U.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),vn=e.computed(()=>U.value?.spider?.gridSteps||5),Ll=e.computed(()=>{const t=[],o=vn.value;for(let l=1;l<=o;l++)t.push(it.value/o*l);return t}),In=t=>{const o=fn.value;if(o&&Array.isArray(o)&&o[t]!==void 0)return o[t].toString();const l=Ll.value[t];return Math.round(l/it.value*100)+"%"},fn=e.computed(()=>U.value?.spider?.gridLabels||null),cl=e.computed(()=>{const t=U.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),jt=e.computed(()=>{const t=U.value,o={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...o,...t.contextMenu.items}:o}),Kt=e.computed(()=>{const t=U.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Yt=e.computed(()=>{const t=U.value;return t&&t.markers&&t.markers.icon?t.markers.icon:Pn.value}),Tl=e.computed(()=>{const t=U.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Tt=e.computed(()=>{const t=U.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),wt=e.computed(()=>{const o=U.value?.valueFormat?.extension;return typeof o=="string"?o:""}),Vl=t=>{const o=wt.value;if(t==null)return"";const l=String(t);return o?l+o:l},hn=e.computed(()=>!ne.value.isZooming);e.computed(()=>ll.value.map(t=>{if(t.categoryIndex!==void 0&&($l.value||Ot.value)){const o=Cl(t.categoryIndex),l=Re.value+P.value.bottom-Tt.value/2;return{...t,x:o,y:l}}return t}));function Nl(t,o){let l;if(t instanceof Date)l=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[v,b,x]=t.split("-"),q=Number(x?.length===2?`20${x}`:x);l=new Date(q,Number(b)-1,Number(v))}else return 0;let r=0,m=1/0;return o.forEach((v,b)=>{const[x,q,T]=v.split("-"),I=Number(T?.length===2?`20${T}`:T),$=new Date(I,Number(q)-1,Number(x)),G=Math.abs($-l);G<m&&(m=G,r=b)}),r}const gn=e.computed(()=>{const t=Z.markers.map(l=>{const r=Nl(l.marker_date,Z.categories),m=Cl(r),v=Re.value+P.value.bottom-Tt.value/2;return{...l,x:m,y:v,categoryIndex:r,source:"props"}}),o=ll.value.map(l=>{if(l.categoryIndex!==void 0&&($l.value||Ot.value)){const r=Cl(l.categoryIndex),m=Re.value+P.value.bottom-Tt.value/2;return{...l,x:r,y:m,source:"internal"}}return{...l,source:"internal"}});return[...t,...o]}),Bl=e.computed(()=>{const t=U.value;return t&&t.watermark&&t.watermark.enabled===!0}),Zl=e.computed(()=>{const t=U.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),an=e.computed(()=>{const t=U.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),Dl=e.computed(()=>{const t=U.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),Gt=e.computed(()=>{const t={left:P.value.left,top:P.value.top,width:P.value.width,height:P.value.height};let o,l;const r=String(an.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}}),zn=e.computed(()=>{const{width:t,height:o}=Gt.value,l=Dl.value;let r,m;const v=P.value.left,b=P.value.right,x=P.value.top,q=P.value.bottom,T=P.value.width,I=P.value.height;switch(l){case"center":r=v+(T-t)/2,m=x+(I-o)/2;break;case"top-left":r=v+15,m=x+5;break;case"top-right":r=b-t-15,m=x+5;break;case"bottom-left":r=v+15,m=q-o-5;break;case"bottom-right":default:r=b-t-15,m=q-o-5;break}return{backgroundPositionX:r+"px",backgroundPositionY:m+"px",backgroundSize:`${t}px ${o}px`}}),Pl=t=>!Z.flags||!Z.flags.length?[]:Z.flags.filter(o=>o.categoryIndex===t),Dt=t=>{const o=Pl(t),l=ea(t),r=o.filter(b=>b.manual),m=o.filter(b=>!b.manual),v=[];return r.length>0&&v.push({type:N("chart.tooltip.manualFlags"),color:"#698dbe",flags:r.map(b=>({text:b.text,color:"#698dbe"}))}),m.length>0&&v.push({type:N("chart.tooltip.autoFlags"),color:"#a1d499",flags:m.map(b=>({text:b.text,color:"#a1d499"}))}),{flagGroups:v,markers:l.map(b=>({title:b.title,description:b.description,type:N("chart.tooltip.markers"),color:b.color||"#9784ba"}))}},Pn=e.computed(()=>{const t=Z.old?`<svg width="55" height="56" viewBox="0 0 55 56" fill="none" xmlns="http://www.w3.org/2000/svg">
2
2
  <path d="M55 51.841V4.14647C55 1.86149 53.1797 0.00915527 50.9343 0.00915527L4.06568 0.00915527C1.82027 0.00915527 0 1.86149 0 4.14647V51.841C0 54.126 1.82027 55.9783 4.06568 55.9783H50.9343C53.1797 55.9783 55 54.126 55 51.841Z" fill="#020203"/>
3
3
  <path d="M27.7145 10.8883H16.9591C12.7639 10.8883 9.3623 14.3498 9.3623 18.619C9.3623 22.8882 12.7639 26.3497 16.9591 26.3497H27.8036C28.3624 26.3497 28.816 25.8881 28.816 25.3112L28.7188 11.9103C28.7188 11.3416 28.2653 10.8883 27.7064 10.8883H27.7145Z" fill="#FFC230"/>
4
4
  <path d="M38.6799 25.649C42.5176 25.649 45.6288 22.483 45.6288 18.5776C45.6288 14.6722 42.5176 11.5063 38.6799 11.5063C34.8421 11.5063 31.731 14.6722 31.731 18.5776C31.731 22.483 34.8421 25.649 38.6799 25.649Z" fill="white"/>
@@ -15,7 +15,7 @@
15
15
  <rect width="57" height="57" fill="white"/>
16
16
  </clipPath>
17
17
  </defs>
18
- </svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),el=e.computed(()=>{const t=Z.old?`<svg width="499" height="96" viewBox="0 0 499 96" fill="none" xmlns="http://www.w3.org/2000/svg">
18
+ </svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),tl=e.computed(()=>{const t=Z.old?`<svg width="499" height="96" viewBox="0 0 499 96" fill="none" xmlns="http://www.w3.org/2000/svg">
19
19
  <path d="M171.52 37.8399H160.38C160.26 36.4799 160.02 35.0599 159.68 33.5699C159.34 32.0799 158.77 30.7399 157.96 29.5299C157.16 28.3199 156 27.3199 154.48 26.5099C152.96 25.7099 150.94 25.2999 148.4 25.2999C144.69 25.2999 141.93 26.1299 140.14 27.8099C138.34 29.4799 137.45 31.5499 137.45 34.0299C137.45 37.7999 139.29 40.0799 142.97 40.8499C146.65 41.6299 150.67 42.3799 155.03 43.1199C159.39 43.8599 163.41 45.3899 167.09 47.7099C170.77 50.0299 172.61 54.6199 172.61 61.4899C172.61 64.6499 172.02 67.5099 170.85 70.0699C169.67 72.6399 168.02 74.7899 165.89 76.5199C163.76 78.2499 161.19 79.5799 158.19 80.5099C155.19 81.4399 151.93 81.8999 148.4 81.8999C143.95 81.8999 140.12 81.2699 136.94 79.9999C133.75 78.7299 131.19 77.0799 129.24 75.0399C127.29 72.9999 125.93 70.6899 125.16 68.1299C124.39 65.5599 124.19 62.9499 124.56 60.2899H136.25C136.37 62.0799 136.58 63.7899 136.85 65.3899C137.13 66.9999 137.68 68.4099 138.52 69.6099C139.35 70.8199 140.58 71.7799 142.19 72.4899C143.8 73.1999 145.99 73.5599 148.78 73.5599C153.3 73.5599 156.47 72.6199 158.29 70.7299C160.11 68.8399 161.03 66.6899 161.03 64.2799C161.03 60.2599 159.19 57.7799 155.51 56.8599C151.83 55.9299 147.79 55.0499 143.4 54.2099C139.01 53.3799 134.97 51.7699 131.29 49.3799C127.61 46.9999 125.77 42.3699 125.77 35.5099C125.77 32.8499 126.3 30.3899 127.35 28.1299C128.4 25.8699 129.9 23.9199 131.85 22.2799C133.8 20.6399 136.16 19.3399 138.95 18.3799C141.73 17.4199 144.8 16.9399 148.14 16.9399C152.41 16.9399 156.07 17.4699 159.14 18.5199C162.2 19.5699 164.69 21.0299 166.61 22.8799C168.53 24.7399 169.89 26.9499 170.69 29.5199C171.49 32.0899 171.77 34.8599 171.52 37.8199V37.8399Z" fill="#020203"/>
20
20
  <path d="M179.04 58.1699C179.04 55.0799 179.55 52.0499 180.57 49.0699C181.59 46.0999 183.04 43.4899 184.93 41.2299C186.82 38.9699 189.09 37.1499 191.75 35.7499C194.41 34.3599 197.35 33.6599 200.57 33.6599C207 33.6599 212.15 35.9299 216.02 40.4799C219.89 45.0299 221.97 51.5999 222.28 60.1999H189.34C189.77 64.2199 191.09 67.1499 193.28 68.9699C195.48 70.7999 198.12 71.7099 201.21 71.7099C203 71.7099 204.5 71.4599 205.71 70.9699C206.92 70.4799 207.91 69.8899 208.68 69.2099C209.45 68.5299 210.06 67.8199 210.49 67.0799C210.92 66.3399 211.26 65.7199 211.51 65.2199H221.72C221.6 66.7699 221.1 68.5099 220.24 70.4599C219.37 72.4099 218.14 74.2299 216.53 75.9399C214.92 77.6399 212.85 79.0599 210.31 80.2099C207.77 81.3499 204.77 81.9299 201.31 81.9299C197.85 81.9299 194.91 81.2799 192.12 79.9799C189.34 78.6799 186.98 76.9499 185.07 74.7799C183.15 72.6099 181.67 70.0899 180.61 67.2199C179.56 64.3399 179.03 61.3299 179.03 58.1699H179.04ZM200.94 42.0199C198.47 42.0199 196.24 42.7299 194.26 44.1499C192.28 45.5699 190.89 47.8299 190.08 50.9199H211.33C211.02 48.0799 209.95 45.8799 208.13 44.3299C206.3 42.7899 203.91 42.0099 200.94 42.0099V42.0199Z" fill="#020203"/>
21
21
  <path d="M268.59 80.9999H258.01V50.3799C258.01 48.2099 257.3 46.5099 255.88 45.2799C254.46 44.0399 252.6 43.4199 250.31 43.4199C248.45 43.4199 246.94 43.8399 245.76 44.6699C244.58 45.4999 243.67 46.5399 243.02 47.7799C242.37 49.0199 241.94 50.3799 241.72 51.8599C241.5 53.3399 241.4 54.7099 241.4 55.9399V80.9999H230.82V34.5999H241.03V38.3099C241.83 37.6899 243.27 36.7599 245.34 35.5199C247.41 34.2799 250.3 33.6599 254.02 33.6599C256.68 33.6599 259.12 34.1599 261.35 35.1399C263.58 36.1299 265.31 37.6799 266.55 39.7799C267.04 39.2899 267.71 38.6799 268.55 37.9699C269.38 37.2599 270.41 36.5799 271.61 35.9299C272.82 35.2799 274.22 34.7399 275.83 34.3099C277.44 33.8799 279.23 33.6599 281.21 33.6599C285.23 33.6599 288.67 34.8099 291.51 37.0899C294.36 39.3799 295.78 43.0599 295.78 48.1299V80.9799H285.2V50.3599C285.2 48.1899 284.49 46.4899 283.07 45.2599C281.65 44.0199 279.79 43.3999 277.5 43.3999C275.64 43.3999 274.13 43.8199 272.95 44.6499C271.77 45.4799 270.86 46.5199 270.21 47.7599C269.56 48.9999 269.13 50.3599 268.91 51.8399C268.69 53.3199 268.59 54.6899 268.59 55.9199V80.9799V80.9999Z" fill="#020203"/>
@@ -41,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)}`}),_l=e.computed(()=>{const t=U.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),yn=e.computed(()=>{const t=U.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=U.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const sn=e.computed(()=>{const t=U.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),Fl=e.computed(()=>{const t=U.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),ul=e.computed(()=>{const t=U.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),Ql=e.computed(()=>{const o=U.value?.radialBar?.dataLabels;return o&&(o.show===!0||o.enabled===!0)}),Ul=e.computed(()=>{const o=U.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof o=="number"&&o>=0?o:20}),k=e.computed(()=>{const o=U.value?.radialBar?.dataCenter;return Zn.value?!0:Vn.value&&o&&(o.show===!0||o.enabled===!0)}),S=e.computed(()=>{if(!k.value||!An.value.length)return"";if(Zn.value){const r=An.value[1]??An.value[0];return Vl(r?.value??0)}const l=U.value?.radialBar?.dataCenter?.showValueOnly===!0?An.value[0]?.value??0:An.value.reduce((r,m)=>r+(m.value??0),0);return Vl(l)}),x=e.computed(()=>{const o=U.value?.radialBar?.dataCenter?.fontSize;return typeof o=="number"&&o>0?o:24}),j=e.computed(()=>({x:Wt.value,y:Zn.value?At.value:At.value-x.value/2})),Ce=e.computed(()=>{const o=U.value?.radialBar?.dataCenter?.color;return typeof o=="string"&&o?o:"#333"}),qe=e.computed(()=>{if(!Ql.value||!xl.value||!An.value.length)return[];const t=Ul.value*Math.PI/180,o=(kl.value+it.value)/2;return An.value.map(l=>{const m=l.endAngle-l.startAngle>=t&&!l.isHidden,v=Wt.value+Math.cos(l.midAngle)*o,b=At.value+Math.sin(l.midAngle)*o;return{value:Vl(l.value),x:v,y:b,show:m,color:l.color,contrastColor:Xa(l.color)}})}),Fe=e.computed(()=>{if(!Z.flags||!Z.flags.length)return[];const t=new Map;return Z.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=Cl(o),m=l.filter(b=>b.manual),v=l.filter(b=>!b.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(b=>b.text).join(`
45
- `)}})}),at=e.ref({show:!1,x:0,y:0,content:"",count:0}),f=e.computed(()=>U.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),g=e.computed(()=>{const t=U.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),E=e.computed(()=>U.value?.bubbles?.tooltip?.formatters||{}),F=e.ref(new Set),z=e.ref(null),Qe=e.ref(!1),Te=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),Ft=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),Le=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),st=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),ne=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),ll=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 Tl.value&&t.push(...Object.keys(Tl.value)),t}),e.computed(()=>{if(!Z.categories||Z.categories.length===0){const{maxX:t}=Bt.value;return Array.from({length:t+1},(o,l)=>N("chart.fallback.item",{number:l+1}))}return Z.categories});const Kn=e.computed(()=>{if(!Z.categories||Z.categories.length===0)return null;const t=Z.categories[0],[o,l,r]=String(t).split("-"),m=Number(r?.length===2?`20${r}`:r),v=Number(o),b=Number(l)-1;return!v||!l||!m?null:new Date(m,b,v)}),jo=e.computed(()=>{if(!Z.categories||Z.categories.length===0)return null;const t=Z.categories[Z.categories.length-1],[o,l,r]=String(t).split("-"),m=Number(r?.length===2?`20${r}`:r),v=Number(o),b=Number(l)-1;return!v||!l||!m?null:new Date(m,b,v)}),Gn=e.computed(()=>Ze.value.editingMarkerId!==null),On=e.computed(()=>Ze.value.readonly),Qn=t=>{F.value.has(t)||(pa.value=!0,z.value=t)},oo=()=>{pa.value=!1,z.value=null},Ko=t=>{if(Bo.value||Po.value){Le.value.show=!1;return}const l=t.currentTarget.getBoundingClientRect(),r=t.clientX-l.left,m=t.clientY-l.top,v=Ot.value?r>=P.value.left-50&&r<=P.value.right+50&&m>=P.value.top-50&&m<=P.value.bottom+100:fl.value?r>=P.value.left&&r<=P.value.right&&m>=P.value.top&&m<=P.value.bottom+rl.value:r>=P.value.left&&r<=P.value.right&&m>=P.value.top&&m<=P.value.bottom;if(Qe.value=v,Ot.value){if(!Se.value||!v||ne.value.isDragging||ne.value.isZooming){Le.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))Le.value.show=!1;else{const ve=Io.value.filter(be=>!be||be.isHidden?!1:Math.sqrt(Math.pow(be.x-r,2)+Math.pow(be.y-m,2))<=250);if(ve.length>0){let be=ve[0],Ee=Math.sqrt(Math.pow(be.x-r,2)+Math.pow(be.y-m,2));ve.forEach(Pe=>{const De=Math.sqrt(Math.pow(Pe.x-r,2)+Math.pow(Pe.y-m,2));De<Ee&&(Ee=De,be=Pe)});const me=30,Je=Io.value.filter(Pe=>!Pe||Pe.isHidden?!1:Math.abs(Pe.x-be.x)<=me).sort((Pe,De)=>Pe.y-De.y);Le.value={show:!0,x:be.x,categoryIndex:Math.round(be.originalX),data:(()=>{const Pe=f.value,De=g.value,Be=[];return Je.forEach(Ie=>{Pe.forEach($t=>{const Zt=De[$t]||$t,tn=Na($t,Ie);tn&&Be.push({seriesName:Ie.seriesName,label:Ie.label,value:`${Zt}: ${tn}`,color:Ie.color,y:Ie.y})})}),Be})()}}else Le.value.show=!1}return}if(fl.value){if(!Se.value||!v||ne.value.isDragging||ne.value.isZooming){Le.value.show=!1;return}const Ue=A.value;if(!Ue){Le.value.show=!1;return}const ve=Ue.getBoundingClientRect(),be=t.clientX-ve.left+Ue.scrollLeft,Ee=ft.value+El.value,me=Math.floor(be/Ee);if(me<0||me>=Gl.value.length){Le.value.show=!1;return}const Je=Dn.value[me];if(!Je){Le.value.show=!1;return}const Pe=me*Ee+ft.value/2,De=ve.left+Pe-Ue.scrollLeft-l.left;Le.value={show:!0,x:De,categoryIndex:me,data:Je.segments.filter(Be=>!Be.isRemainder).map(Be=>({seriesName:Be.label,value:Be.value,color:Be.color,y:null}))};return}if(ne.value.isDragging&&ne.value.scale>1&&$l.value&&Ct.value&&!fl.value){Le.value.show=!1;const Ue=t.clientX-ne.value.lastMouseX,{minX:ve,maxX:be}=Bt.value,Ee=be-ve||1,Je=Ue*.8;ne.value.offsetX+=Je;const Pe=Ee/ne.value.scale,De=Ee-Pe,Be=0,Ie=-De/Ee*P.value.width,$t=Be;ne.value.offsetX=Math.max(Ie,Math.min($t,ne.value.offsetX)),ne.value.lastMouseX=t.clientX,ne.value.lastMouseY=t.clientY;return}if(!Se.value||!$l.value||fl.value||ne.value.isDragging||ne.value.isZooming||!v){Le.value.show=!1;return}const{minX:b,maxX:w}=Bt.value,q=w-b||1,T=q/ne.value.scale,I=b-ne.value.offsetX/P.value.width*q,$=(r-P.value.left)/P.value.width,G=I+$*T,Ne=Math.round(G);if(Ne>=0&&Ne<=w){const Ue=Cl(Ne),ve=qt.value.map((be,Ee)=>{const me=Z.series.findIndex(Pe=>Pe===be),Je=be.data[Ne];return{seriesName:be.name,value:Je!==void 0?Je:null,color:al(me),y:Je!==void 0?Cn(be,Je):null}}).filter(be=>be.value!==null);Le.value={show:!0,x:Ue,categoryIndex:Ne,data:ve}}},Go=()=>{Le.value.show&&(Le.value.show=!1)},$o=t=>{const o=A.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},Lo=()=>Gl.value[Le.value.categoryIndex]?.label||N("chart.fallback.item",{number:Le.value.categoryIndex+1}),To=()=>{Le.value.show=!1,Qe.value=!1,Po.value=!1,Bo.value||(at.value.show=!1),ne.value.isDragging&&(ne.value.isDragging=!1),ne.value.zoomTimeout&&(clearTimeout(ne.value.zoomTimeout),ne.value.zoomTimeout=null),ne.value.isZooming=!1,setTimeout(()=>{z.value=null,Te.value.show=!1},150)},Qo=t=>{if(t.preventDefault(),t.stopPropagation(),!cl.value)return;const o=t.currentTarget.getBoundingClientRect(),l=t.clientX-o.left,r=t.clientY-o.top;if(xl.value){st.value.show=!1,e.nextTick(()=>{st.value.show=!0,st.value.x=t.clientX,st.value.y=t.clientY,st.value.categoryIndex=null});return}const m=Math.max(0,P.value.left-20),v=P.value.right,b=P.value.top,w=P.value.bottom+80;l>=m&&l<=v&&r>=b&&r<=w&&(st.value.show=!1,e.nextTick(()=>{st.value.show=!0,st.value.x=t.clientX,st.value.y=t.clientY,st.value.categoryIndex=null;const q=Math.max(P.value.left,Math.min(l,P.value.right))-P.value.left,I=P.value.width/sa.value.length,$=Math.floor(q/I);$>=0&&$<sa.value.length&&(st.value.categoryIndex=$)}))},wn=t=>{if(!(t&&t.button===2)){if(st.value.show&&t&&t.type==="click"){const o=document.querySelector(".dss-context-menu");if(o&&o.contains(t.target))return}st.value.show=!1}},Jo=t=>{if(typeof t.template=="function"){const o={series:Z.series,categories:Z.categories,markers:ll.value},l={chartX:st.value.chartX,chartY:st.value.chartY,dataX:st.value.mouseDataX,dataY:st.value.mouseDataY,categoryIndex:st.value.categoryIndex};return t.template(o,l)}return t.template||t.label||""},Do=t=>{const o=["dss-context-menu-item"];return t.cssClass&&o.push(t.cssClass),o},Wn=t=>t.style||{},ao=t=>t.type&&Tl.value[t.type]?Tl.value[t.type]:t.customIcon?t.customIcon:Yt.value,so=t=>t==null?"":Z.categories&&Z.categories[t]?Z.categories[t]:"",ea=t=>ll.value.length?ll.value.filter(o=>o.categoryIndex===t):[],ta=t=>{if(!$l.value&&!Ot.value)return{x:0,y:0};const o=Cl(t),l=Re.value+P.value.bottom-Tt.value/2;return{x:o,y:l}},Co=()=>{ll.value.forEach(t=>{if(t.categoryIndex!==void 0&&($l.value||Ot.value)){const o=ta(t.categoryIndex);t.x=o.x,t.y=o.y}})},xn=()=>{if(Ze.value.description&&Ze.value.description.length&&Ze.value.date){if(Gn.value){const t=ll.value.findIndex(o=>o.id===Ze.value.editingMarkerId);t!==-1?(ll.value[t].description=Ze.value.description||"",ll.value[t].color=Ze.value.color||"",ll.value[t].type=Ze.value.type||"default",oe("update-marker",ll.value[t])):oe("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=Nl(Ze.value.date,Z.categories||[]);if(Ot.value){const{maxX:b}=Bt.value;o=Math.max(0,Math.min(o,Math.floor(b)))}else $l.value&&(o=Math.max(0,Math.min(o,Bt.value.maxX)));const l=Cl(o),r=Re.value+P.value.bottom-Tt.value/2,m=Array.isArray(Z.categories)?Z.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,ll.value.push(v),oe("add-marker",v)}Il(),bo()}},Il=()=>{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},_n=()=>{Gn.value&&(Jn(Ze.value.editingMarkerId),Il())},Jn=t=>{const o=ll.value.findIndex(l=>l.id===t);o!==-1&&(ll.value.splice(o,1),bo()),oe("delete-marker",t)},pl=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),b=Number(l)-1;v&&l&&m?Ze.value.date=new Date(m,b,v):Ze.value.date=null}else Ze.value.date=null},bo=()=>{try{const t=`dss-chart-markers-${Z.chartId}`;localStorage.setItem(t,JSON.stringify(ll.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},Ao=()=>{try{const t=`dss-chart-markers-${Z.chartId}`,o=localStorage.getItem(t);if(o){const l=JSON.parse(o);Array.isArray(l)&&(ll.value=l.map(r=>({...r,originalYOffset:r.originalYOffset!==void 0?r.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),ll.value=[]}},Jl=t=>{const o=et.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}`},En=()=>{const t=Le.value.show,o=Te.value.show;return Le.value.show=!1,Te.value.show=!1,{originalCrosshair:t,originalTooltip:o}},Yl=t=>{Le.value.show=t.originalCrosshair,Te.value.show=t.originalTooltip},Mn=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 b=setTimeout(()=>{console.warn("Image conversion timeout for:",t),r(t)},5e3);v.onload=()=>{clearTimeout(b);try{const w=document.createElement("canvas"),q=w.getContext("2d");w.width=o,w.height=l,q.fillStyle="#fafafa",q.fillRect(0,0,o,l),q.drawImage(v,0,0,o,l);const T=w.toDataURL("image/png");r(T)}catch(w){console.warn("Canvas conversion failed:",w),r(t)}},v.onerror=w=>{clearTimeout(b),console.warn("Failed to load image:",t,w),r(t)},v.src=t}),qn=async()=>{try{const t=En();setTimeout(async()=>{try{const o=ee.value;if(!o){console.error("Chart SVG element not found"),Yl(t);return}const l=_e(),r=Me.value,m=mt.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(me=>me.remove());const w=v.querySelectorAll("image"),q=Array.from(w).map(async me=>{const Je=me.getAttribute("xlink:href")||me.getAttribute("href");if(Je&&!Je.startsWith("data:"))try{const Pe=await Mn(Je,32,32);me.setAttribute("xlink:href",Pe),me.setAttribute("href",Pe)}catch(Pe){console.warn("Failed to convert logo to base64:",Pe)}});await Promise.all(q);const I=new XMLSerializer().serializeToString(v).replace(/<svg[^>]*>/,"").replace("</svg>","");let $="",G=30;if(et.value&&($+=`
44
+ </svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),_l=e.computed(()=>{const t=U.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),yn=e.computed(()=>{const t=U.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=U.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const sn=e.computed(()=>{const t=U.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),Fl=e.computed(()=>{const t=U.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),ul=e.computed(()=>{const t=U.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),Ql=e.computed(()=>{const o=U.value?.radialBar?.dataLabels;return o&&(o.show===!0||o.enabled===!0)}),Ul=e.computed(()=>{const o=U.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof o=="number"&&o>=0?o:20}),k=e.computed(()=>{const o=U.value?.radialBar?.dataCenter;return Zn.value?!0:Vn.value&&o&&(o.show===!0||o.enabled===!0)}),w=e.computed(()=>{if(!k.value||!An.value.length)return"";if(Zn.value){const r=An.value[1]??An.value[0];return Vl(r?.value??0)}const l=U.value?.radialBar?.dataCenter?.showValueOnly===!0?An.value[0]?.value??0:An.value.reduce((r,m)=>r+(m.value??0),0);return Vl(l)}),E=e.computed(()=>{const o=U.value?.radialBar?.dataCenter?.fontSize;return typeof o=="number"&&o>0?o:24}),j=e.computed(()=>({x:Wt.value,y:Zn.value?At.value:At.value-E.value/2})),Ce=e.computed(()=>{const o=U.value?.radialBar?.dataCenter?.color;return typeof o=="string"&&o?o:"#333"}),qe=e.computed(()=>{if(!Ql.value||!xl.value||!An.value.length)return[];const t=Ul.value*Math.PI/180,o=(kl.value+it.value)/2;return An.value.map(l=>{const m=l.endAngle-l.startAngle>=t&&!l.isHidden,v=Wt.value+Math.cos(l.midAngle)*o,b=At.value+Math.sin(l.midAngle)*o;return{value:Vl(l.value),x:v,y:b,show:m,color:l.color,contrastColor:Xa(l.color)}})}),Ie=e.computed(()=>{if(!Z.flags||!Z.flags.length)return[];const t=new Map;return Z.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=Cl(o),m=l.filter(b=>b.manual),v=l.filter(b=>!b.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(b=>b.text).join(`
45
+ `)}})}),at=e.ref({show:!1,x:0,y:0,content:"",count:0}),f=e.computed(()=>U.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),g=e.computed(()=>{const t=U.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),S=e.computed(()=>U.value?.bubbles?.tooltip?.formatters||{}),F=e.ref(new Set),z=e.ref(null),Qe=e.ref(!1),Te=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),Ft=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),Le=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),st=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),ne=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),ll=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 Tl.value&&t.push(...Object.keys(Tl.value)),t}),e.computed(()=>{if(!Z.categories||Z.categories.length===0){const{maxX:t}=Bt.value;return Array.from({length:t+1},(o,l)=>N("chart.fallback.item",{number:l+1}))}return Z.categories});const Kn=e.computed(()=>{if(!Z.categories||Z.categories.length===0)return null;const t=Z.categories[0],[o,l,r]=String(t).split("-"),m=Number(r?.length===2?`20${r}`:r),v=Number(o),b=Number(l)-1;return!v||!l||!m?null:new Date(m,b,v)}),jo=e.computed(()=>{if(!Z.categories||Z.categories.length===0)return null;const t=Z.categories[Z.categories.length-1],[o,l,r]=String(t).split("-"),m=Number(r?.length===2?`20${r}`:r),v=Number(o),b=Number(l)-1;return!v||!l||!m?null:new Date(m,b,v)}),Gn=e.computed(()=>Ze.value.editingMarkerId!==null),On=e.computed(()=>Ze.value.readonly),Qn=t=>{F.value.has(t)||(pa.value=!0,z.value=t)},oo=()=>{pa.value=!1,z.value=null},Ko=t=>{if(Bo.value||Po.value){Le.value.show=!1;return}const l=t.currentTarget.getBoundingClientRect(),r=t.clientX-l.left,m=t.clientY-l.top,v=Ot.value?r>=P.value.left-50&&r<=P.value.right+50&&m>=P.value.top-50&&m<=P.value.bottom+100:fl.value?r>=P.value.left&&r<=P.value.right&&m>=P.value.top&&m<=P.value.bottom+rl.value:r>=P.value.left&&r<=P.value.right&&m>=P.value.top&&m<=P.value.bottom;if(Qe.value=v,Ot.value){if(!Se.value||!v||ne.value.isDragging||ne.value.isZooming){Le.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))Le.value.show=!1;else{const ve=Io.value.filter(be=>!be||be.isHidden?!1:Math.sqrt(Math.pow(be.x-r,2)+Math.pow(be.y-m,2))<=250);if(ve.length>0){let be=ve[0],Ee=Math.sqrt(Math.pow(be.x-r,2)+Math.pow(be.y-m,2));ve.forEach(Oe=>{const De=Math.sqrt(Math.pow(Oe.x-r,2)+Math.pow(Oe.y-m,2));De<Ee&&(Ee=De,be=Oe)});const me=30,Je=Io.value.filter(Oe=>!Oe||Oe.isHidden?!1:Math.abs(Oe.x-be.x)<=me).sort((Oe,De)=>Oe.y-De.y);Le.value={show:!0,x:be.x,categoryIndex:Math.round(be.originalX),data:(()=>{const Oe=f.value,De=g.value,Be=[];return Je.forEach(Pe=>{Oe.forEach($t=>{const Zt=De[$t]||$t,tn=Na($t,Pe);tn&&Be.push({seriesName:Pe.seriesName,label:Pe.label,value:`${Zt}: ${tn}`,color:Pe.color,y:Pe.y})})}),Be})()}}else Le.value.show=!1}return}if(fl.value){if(!Se.value||!v||ne.value.isDragging||ne.value.isZooming){Le.value.show=!1;return}const Ue=A.value;if(!Ue){Le.value.show=!1;return}const ve=Ue.getBoundingClientRect(),be=t.clientX-ve.left+Ue.scrollLeft,Ee=ft.value+El.value,me=Math.floor(be/Ee);if(me<0||me>=Gl.value.length){Le.value.show=!1;return}const Je=Dn.value[me];if(!Je){Le.value.show=!1;return}const Oe=me*Ee+ft.value/2,De=ve.left+Oe-Ue.scrollLeft-l.left;Le.value={show:!0,x:De,categoryIndex:me,data:Je.segments.filter(Be=>!Be.isRemainder).map(Be=>({seriesName:Be.label,value:Be.value,color:Be.color,y:null}))};return}if(ne.value.isDragging&&ne.value.scale>1&&$l.value&&bt.value&&!fl.value){Le.value.show=!1;const Ue=t.clientX-ne.value.lastMouseX,{minX:ve,maxX:be}=Bt.value,Ee=be-ve||1,Je=Ue*.8;ne.value.offsetX+=Je;const Oe=Ee/ne.value.scale,De=Ee-Oe,Be=0,Pe=-De/Ee*P.value.width,$t=Be;ne.value.offsetX=Math.max(Pe,Math.min($t,ne.value.offsetX)),ne.value.lastMouseX=t.clientX,ne.value.lastMouseY=t.clientY;return}if(!Se.value||!$l.value||fl.value||ne.value.isDragging||ne.value.isZooming||!v){Le.value.show=!1;return}const{minX:b,maxX:x}=Bt.value,q=x-b||1,T=q/ne.value.scale,I=b-ne.value.offsetX/P.value.width*q,$=(r-P.value.left)/P.value.width,G=I+$*T,Ne=Math.round(G);if(Ne>=0&&Ne<=x){const Ue=Cl(Ne),ve=qt.value.map((be,Ee)=>{const me=Z.series.findIndex(Oe=>Oe===be),Je=be.data[Ne];return{seriesName:be.name,value:Je!==void 0?Je:null,color:al(me),y:Je!==void 0?Cn(be,Je):null}}).filter(be=>be.value!==null);Le.value={show:!0,x:Ue,categoryIndex:Ne,data:ve}}},Go=()=>{Le.value.show&&(Le.value.show=!1)},$o=t=>{const o=A.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},Lo=()=>Gl.value[Le.value.categoryIndex]?.label||N("chart.fallback.item",{number:Le.value.categoryIndex+1}),To=()=>{Le.value.show=!1,Qe.value=!1,Po.value=!1,Bo.value||(at.value.show=!1),ne.value.isDragging&&(ne.value.isDragging=!1),ne.value.zoomTimeout&&(clearTimeout(ne.value.zoomTimeout),ne.value.zoomTimeout=null),ne.value.isZooming=!1,setTimeout(()=>{z.value=null,Te.value.show=!1},150)},Qo=t=>{if(t.preventDefault(),t.stopPropagation(),!cl.value)return;const o=t.currentTarget.getBoundingClientRect(),l=t.clientX-o.left,r=t.clientY-o.top;if(xl.value){st.value.show=!1,e.nextTick(()=>{st.value.show=!0,st.value.x=t.clientX,st.value.y=t.clientY,st.value.categoryIndex=null});return}const m=Math.max(0,P.value.left-20),v=P.value.right,b=P.value.top,x=P.value.bottom+80;l>=m&&l<=v&&r>=b&&r<=x&&(st.value.show=!1,e.nextTick(()=>{st.value.show=!0,st.value.x=t.clientX,st.value.y=t.clientY,st.value.categoryIndex=null;const q=Math.max(P.value.left,Math.min(l,P.value.right))-P.value.left,I=P.value.width/sa.value.length,$=Math.floor(q/I);$>=0&&$<sa.value.length&&(st.value.categoryIndex=$)}))},wn=t=>{if(!(t&&t.button===2)){if(st.value.show&&t&&t.type==="click"){const o=document.querySelector(".dss-context-menu");if(o&&o.contains(t.target))return}st.value.show=!1}},Jo=t=>{if(typeof t.template=="function"){const o={series:Z.series,categories:Z.categories,markers:ll.value},l={chartX:st.value.chartX,chartY:st.value.chartY,dataX:st.value.mouseDataX,dataY:st.value.mouseDataY,categoryIndex:st.value.categoryIndex};return t.template(o,l)}return t.template||t.label||""},Do=t=>{const o=["dss-context-menu-item"];return t.cssClass&&o.push(t.cssClass),o},Wn=t=>t.style||{},ao=t=>t.type&&Tl.value[t.type]?Tl.value[t.type]:t.customIcon?t.customIcon:Yt.value,so=t=>t==null?"":Z.categories&&Z.categories[t]?Z.categories[t]:"",ea=t=>ll.value.length?ll.value.filter(o=>o.categoryIndex===t):[],ta=t=>{if(!$l.value&&!Ot.value)return{x:0,y:0};const o=Cl(t),l=Re.value+P.value.bottom-Tt.value/2;return{x:o,y:l}},Co=()=>{ll.value.forEach(t=>{if(t.categoryIndex!==void 0&&($l.value||Ot.value)){const o=ta(t.categoryIndex);t.x=o.x,t.y=o.y}})},xn=()=>{if(Ze.value.description&&Ze.value.description.length&&Ze.value.date){if(Gn.value){const t=ll.value.findIndex(o=>o.id===Ze.value.editingMarkerId);t!==-1?(ll.value[t].description=Ze.value.description||"",ll.value[t].color=Ze.value.color||"",ll.value[t].type=Ze.value.type||"default",oe("update-marker",ll.value[t])):oe("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=Nl(Ze.value.date,Z.categories||[]);if(Ot.value){const{maxX:b}=Bt.value;o=Math.max(0,Math.min(o,Math.floor(b)))}else $l.value&&(o=Math.max(0,Math.min(o,Bt.value.maxX)));const l=Cl(o),r=Re.value+P.value.bottom-Tt.value/2,m=Array.isArray(Z.categories)?Z.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,ll.value.push(v),oe("add-marker",v)}Il(),bo()}},Il=()=>{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},_n=()=>{Gn.value&&(Jn(Ze.value.editingMarkerId),Il())},Jn=t=>{const o=ll.value.findIndex(l=>l.id===t);o!==-1&&(ll.value.splice(o,1),bo()),oe("delete-marker",t)},pl=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),b=Number(l)-1;v&&l&&m?Ze.value.date=new Date(m,b,v):Ze.value.date=null}else Ze.value.date=null},bo=()=>{try{const t=`dss-chart-markers-${Z.chartId}`;localStorage.setItem(t,JSON.stringify(ll.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},Ao=()=>{try{const t=`dss-chart-markers-${Z.chartId}`,o=localStorage.getItem(t);if(o){const l=JSON.parse(o);Array.isArray(l)&&(ll.value=l.map(r=>({...r,originalYOffset:r.originalYOffset!==void 0?r.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),ll.value=[]}},Jl=t=>{const o=et.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}`},En=()=>{const t=Le.value.show,o=Te.value.show;return Le.value.show=!1,Te.value.show=!1,{originalCrosshair:t,originalTooltip:o}},Yl=t=>{Le.value.show=t.originalCrosshair,Te.value.show=t.originalTooltip},Mn=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 b=setTimeout(()=>{console.warn("Image conversion timeout for:",t),r(t)},5e3);v.onload=()=>{clearTimeout(b);try{const x=document.createElement("canvas"),q=x.getContext("2d");x.width=o,x.height=l,q.fillStyle="#fafafa",q.fillRect(0,0,o,l),q.drawImage(v,0,0,o,l);const T=x.toDataURL("image/png");r(T)}catch(x){console.warn("Canvas conversion failed:",x),r(t)}},v.onerror=x=>{clearTimeout(b),console.warn("Failed to load image:",t,x),r(t)},v.src=t}),qn=async()=>{try{const t=En();setTimeout(async()=>{try{const o=ee.value;if(!o){console.error("Chart SVG element not found"),Yl(t);return}const l=_e(),r=Me.value,m=mt.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(me=>me.remove());const x=v.querySelectorAll("image"),q=Array.from(x).map(async me=>{const Je=me.getAttribute("xlink:href")||me.getAttribute("href");if(Je&&!Je.startsWith("data:"))try{const Oe=await Mn(Je,32,32);me.setAttribute("xlink:href",Oe),me.setAttribute("href",Oe)}catch(Oe){console.warn("Failed to convert logo to base64:",Oe)}});await Promise.all(q);const I=new XMLSerializer().serializeToString(v).replace(/<svg[^>]*>/,"").replace("</svg>","");let $="",G=30;if(et.value&&($+=`
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
  ${lt.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
58
- </text>`,G+=25),fe.value&&Z.series.length>0){let me=r-200,Je=et.value||lt.value?35:25;const Pe=Math.floor((r-250)/120);let De=0;Z.series.forEach((Be,Ie)=>{if(!F.value.has(Ie)){const $t=al(Ie),Zt=Be.name.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");$+=`<circle cx="${me+6}" cy="${Je-4}" r="6" fill="${$t}"/>`,$+=`<text x="${me+18}" y="${Je}" font-family="Arial, sans-serif" font-size="12" fill="#333">${Zt}</text>`,De++,De%Pe===0?(me=r-200,Je+=20):me+=Math.min(120,Zt.length*8+35)}})}let Ne="";if(Bl.value)try{const{width:me,height:Je}=Gt.value,Pe=Dl.value,De=P.value.left,Be=P.value.right,Ie=P.value.top,$t=P.value.bottom,Zt=P.value.width,tn=P.value.height;let bl,ln;switch(Pe){case"center":bl=De+(Zt-me)/2,ln=Ie+(tn-Je)/2;break;case"top-left":bl=De+15,ln=Ie+5;break;case"top-right":bl=Be-me-5,ln=Ie+5;break;case"bottom-left":bl=De+15,ln=$t-Je-5;break;case"bottom-right":default:bl=Be-me-5,ln=$t-Je-5;break}Ne=`
58
+ </text>`,G+=25),fe.value&&Z.series.length>0){let me=r-200,Je=et.value||lt.value?35:25;const Oe=Math.floor((r-250)/120);let De=0;Z.series.forEach((Be,Pe)=>{if(!F.value.has(Pe)){const $t=al(Pe),Zt=Be.name.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");$+=`<circle cx="${me+6}" cy="${Je-4}" r="6" fill="${$t}"/>`,$+=`<text x="${me+18}" y="${Je}" font-family="Arial, sans-serif" font-size="12" fill="#333">${Zt}</text>`,De++,De%Oe===0?(me=r-200,Je+=20):me+=Math.min(120,Zt.length*8+35)}})}let Ne="";if(Bl.value)try{const{width:me,height:Je}=Gt.value,Oe=Dl.value,De=P.value.left,Be=P.value.right,Pe=P.value.top,$t=P.value.bottom,Zt=P.value.width,tn=P.value.height;let bl,ln;switch(Oe){case"center":bl=De+(Zt-me)/2,ln=Pe+(tn-Je)/2;break;case"top-left":bl=De+15,ln=Pe+5;break;case"top-right":bl=Be-me-5,ln=Pe+5;break;case"bottom-left":bl=De+15,ln=$t-Je-5;break;case"bottom-right":default:bl=Be-me-5,ln=$t-Je-5;break}Ne=`
59
59
  <g opacity="${Zl.value}">
60
60
  <g transform="translate(${bl}, ${ln}) scale(${me/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,25 +89,25 @@
89
89
  ${I}
90
90
  ${Ne}
91
91
  </g>
92
- </svg>`,ve=new Blob([Ue],{type:"image/svg+xml;charset=utf-8"}),be=URL.createObjectURL(ve),Ee=document.createElement("a");Ee.href=be,Ee.download=Jl("svg"),document.body.appendChild(Ee),Ee.click(),document.body.removeChild(Ee),URL.revokeObjectURL(be),Yl(t),wn()}catch(o){console.error("Error downloading SVG:",o),Yl(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},la=async()=>{try{const t=En();W.value&&W.value.offsetHeight,await new Promise(me=>setTimeout(me,300));const o=_e(),l=Me.value,r=mt.value+o.height,m=document.createElement("canvas"),v=m.getContext("2d"),b=2;m.width=l*b,m.height=r*b,m.style.width=l+"px",m.style.height=r+"px",v.scale(b,b),v.fillStyle="#fafafa",v.fillRect(0,0,l,r);let w=30;if(et.value&&(v.fillStyle="#333",v.font="bold 18px Arial, sans-serif",v.fillText(et.value,24,w),w+=30),lt.value&&(v.fillStyle="#666",v.font="14px Arial, sans-serif",v.fillText(lt.value,24,w),w+=25),fe.value&&Z.series.length>0){let me=l-200,Je=et.value||lt.value?35:25;const Pe=Math.floor((l-250)/120);let De=0;v.font="12px Arial, sans-serif",Z.series.forEach((Be,Ie)=>{if(!F.value.has(Ie)){const $t=al(Ie);v.beginPath(),v.arc(me+6,Je-4,6,0,2*Math.PI),v.fillStyle=$t,v.fill(),v.fillStyle="#333",v.fillText(Be.name,me+18,Je),De++,De%Pe===0?(me=l-200,Je+=20):me+=Math.min(120,Be.name.length*8+35)}})}const T=ee.value.cloneNode(!0),I=T.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),$=T.querySelectorAll(".dss-crosshair"),G=T.querySelectorAll('[class*="tooltip"]');I.forEach(me=>me.remove()),$.forEach(me=>me.remove()),G.forEach(me=>me.remove()),T.querySelectorAll("image").forEach((me,Je)=>{const Pe=me.getAttribute("xlink:href")||me.getAttribute("href");if(Pe&&!Pe.startsWith("data:")){const De=zo.value[Je],Be=De?al(De.seriesIndex):"#3B82F6",Ie=me.getAttribute("x")||0,$t=me.getAttribute("y")||0,Zt=me.getAttribute("width")||32,tn=me.getAttribute("height")||32,bl=document.createElementNS("http://www.w3.org/2000/svg","circle");bl.setAttribute("cx",parseFloat(Ie)+parseFloat(Zt)/2),bl.setAttribute("cy",parseFloat($t)+parseFloat(tn)/2),bl.setAttribute("r",Math.min(parseFloat(Zt),parseFloat(tn))/2-1),bl.setAttribute("fill",Be),bl.setAttribute("stroke","#fafafa"),bl.setAttribute("stroke-width","2"),me.parentNode.replaceChild(bl,me)}});const Ue=new XMLSerializer().serializeToString(T),ve=new Blob([Ue],{type:"image/svg+xml;charset=utf-8"}),be=URL.createObjectURL(ve),Ee=new Image;return new Promise((me,Je)=>{Ee.onload=async()=>{try{if(v.drawImage(Ee,0,o.height),zo.value.forEach(Pe=>{const De=Pe.x,Be=Pe.y+o.height,Ie=(Pe.width||32)/2,$t=al(Pe.seriesIndex);v.save(),v.beginPath(),v.arc(De,Be,Ie-1,0,2*Math.PI),v.fillStyle=$t,v.fill(),v.strokeStyle="#fafafa",v.lineWidth=2,v.stroke(),v.restore()}),Bl.value){const Pe=new Image,De=()=>{const{width:Ie,height:$t}=Gt.value,Zt=Dl.value,tn=P.value.left,bl=P.value.right,ln=P.value.top,Wo=P.value.bottom,bs=P.value.width,ws=P.value.height;let vo,fo;switch(Zt){case"center":vo=tn+(bs-Ie)/2,fo=ln+o.height+(ws-$t)/2;break;case"top-left":vo=tn+15,fo=ln+o.height+10;break;case"top-right":vo=bl-Ie-5,fo=ln+o.height+10;break;case"bottom-left":vo=tn+15,fo=Wo+o.height-$t-5;break;case"bottom-right":default:vo=bl-Ie-5,fo=Wo+o.height-$t-5;break}v.globalAlpha=Zl.value,v.drawImage(Pe,vo,fo,Ie,$t),v.globalAlpha=1,Be()},Be=()=>{m.toBlob(Ie=>{const $t=URL.createObjectURL(Ie),Zt=document.createElement("a");Zt.href=$t,Zt.download=Jl("png"),document.body.appendChild(Zt),Zt.click(),document.body.removeChild(Zt),URL.revokeObjectURL($t),URL.revokeObjectURL(be),Yl(t),wn(),me()},"image/png")};Pe.onload=De,Pe.onerror=Be,Pe.src=el.value}else m.toBlob(Pe=>{const De=URL.createObjectURL(Pe),Be=document.createElement("a");Be.href=De,Be.download=Jl("png"),document.body.appendChild(Be),Be.click(),document.body.removeChild(Be),URL.revokeObjectURL(De),URL.revokeObjectURL(be),Yl(t),wn(),me()},"image/png")}catch(Pe){URL.revokeObjectURL(be),Yl(t),Je(Pe)}},Ee.onerror=()=>{URL.revokeObjectURL(be),Yl(t),Je(new Error("Failed to load SVG image"))},Ee.src=be})}catch(t){console.error("Error downloading PNG:",t)}},na=()=>{try{let t="";if(et.value&&(t+=`# ${N("chart.csv.chartTitle")}: ${et.value}
92
+ </svg>`,ve=new Blob([Ue],{type:"image/svg+xml;charset=utf-8"}),be=URL.createObjectURL(ve),Ee=document.createElement("a");Ee.href=be,Ee.download=Jl("svg"),document.body.appendChild(Ee),Ee.click(),document.body.removeChild(Ee),URL.revokeObjectURL(be),Yl(t),wn()}catch(o){console.error("Error downloading SVG:",o),Yl(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},la=async()=>{try{const t=En();W.value&&W.value.offsetHeight,await new Promise(me=>setTimeout(me,300));const o=_e(),l=Me.value,r=mt.value+o.height,m=document.createElement("canvas"),v=m.getContext("2d"),b=2;m.width=l*b,m.height=r*b,m.style.width=l+"px",m.style.height=r+"px",v.scale(b,b),v.fillStyle="#fafafa",v.fillRect(0,0,l,r);let x=30;if(et.value&&(v.fillStyle="#333",v.font="bold 18px Arial, sans-serif",v.fillText(et.value,24,x),x+=30),lt.value&&(v.fillStyle="#666",v.font="14px Arial, sans-serif",v.fillText(lt.value,24,x),x+=25),fe.value&&Z.series.length>0){let me=l-200,Je=et.value||lt.value?35:25;const Oe=Math.floor((l-250)/120);let De=0;v.font="12px Arial, sans-serif",Z.series.forEach((Be,Pe)=>{if(!F.value.has(Pe)){const $t=al(Pe);v.beginPath(),v.arc(me+6,Je-4,6,0,2*Math.PI),v.fillStyle=$t,v.fill(),v.fillStyle="#333",v.fillText(Be.name,me+18,Je),De++,De%Oe===0?(me=l-200,Je+=20):me+=Math.min(120,Be.name.length*8+35)}})}const T=ee.value.cloneNode(!0),I=T.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),$=T.querySelectorAll(".dss-crosshair"),G=T.querySelectorAll('[class*="tooltip"]');I.forEach(me=>me.remove()),$.forEach(me=>me.remove()),G.forEach(me=>me.remove()),T.querySelectorAll("image").forEach((me,Je)=>{const Oe=me.getAttribute("xlink:href")||me.getAttribute("href");if(Oe&&!Oe.startsWith("data:")){const De=zo.value[Je],Be=De?al(De.seriesIndex):"#3B82F6",Pe=me.getAttribute("x")||0,$t=me.getAttribute("y")||0,Zt=me.getAttribute("width")||32,tn=me.getAttribute("height")||32,bl=document.createElementNS("http://www.w3.org/2000/svg","circle");bl.setAttribute("cx",parseFloat(Pe)+parseFloat(Zt)/2),bl.setAttribute("cy",parseFloat($t)+parseFloat(tn)/2),bl.setAttribute("r",Math.min(parseFloat(Zt),parseFloat(tn))/2-1),bl.setAttribute("fill",Be),bl.setAttribute("stroke","#fafafa"),bl.setAttribute("stroke-width","2"),me.parentNode.replaceChild(bl,me)}});const Ue=new XMLSerializer().serializeToString(T),ve=new Blob([Ue],{type:"image/svg+xml;charset=utf-8"}),be=URL.createObjectURL(ve),Ee=new Image;return new Promise((me,Je)=>{Ee.onload=async()=>{try{if(v.drawImage(Ee,0,o.height),zo.value.forEach(Oe=>{const De=Oe.x,Be=Oe.y+o.height,Pe=(Oe.width||32)/2,$t=al(Oe.seriesIndex);v.save(),v.beginPath(),v.arc(De,Be,Pe-1,0,2*Math.PI),v.fillStyle=$t,v.fill(),v.strokeStyle="#fafafa",v.lineWidth=2,v.stroke(),v.restore()}),Bl.value){const Oe=new Image,De=()=>{const{width:Pe,height:$t}=Gt.value,Zt=Dl.value,tn=P.value.left,bl=P.value.right,ln=P.value.top,Wo=P.value.bottom,bs=P.value.width,ws=P.value.height;let vo,fo;switch(Zt){case"center":vo=tn+(bs-Pe)/2,fo=ln+o.height+(ws-$t)/2;break;case"top-left":vo=tn+15,fo=ln+o.height+10;break;case"top-right":vo=bl-Pe-5,fo=ln+o.height+10;break;case"bottom-left":vo=tn+15,fo=Wo+o.height-$t-5;break;case"bottom-right":default:vo=bl-Pe-5,fo=Wo+o.height-$t-5;break}v.globalAlpha=Zl.value,v.drawImage(Oe,vo,fo,Pe,$t),v.globalAlpha=1,Be()},Be=()=>{m.toBlob(Pe=>{const $t=URL.createObjectURL(Pe),Zt=document.createElement("a");Zt.href=$t,Zt.download=Jl("png"),document.body.appendChild(Zt),Zt.click(),document.body.removeChild(Zt),URL.revokeObjectURL($t),URL.revokeObjectURL(be),Yl(t),wn(),me()},"image/png")};Oe.onload=De,Oe.onerror=Be,Oe.src=tl.value}else m.toBlob(Oe=>{const De=URL.createObjectURL(Oe),Be=document.createElement("a");Be.href=De,Be.download=Jl("png"),document.body.appendChild(Be),Be.click(),document.body.removeChild(Be),URL.revokeObjectURL(De),URL.revokeObjectURL(be),Yl(t),wn(),me()},"image/png")}catch(Oe){URL.revokeObjectURL(be),Yl(t),Je(Oe)}},Ee.onerror=()=>{URL.revokeObjectURL(be),Yl(t),Je(new Error("Failed to load SVG image"))},Ee.src=be})}catch(t){console.error("Error downloading PNG:",t)}},na=()=>{try{let t="";if(et.value&&(t+=`# ${N("chart.csv.chartTitle")}: ${et.value}
93
93
  `),lt.value&&(t+=`# ${N("chart.csv.chartSubtitle")}: ${lt.value}
94
94
  `),t+=`# ${N("chart.csv.generated")}: ${new Date().toLocaleString()}
95
95
 
96
96
  `,fl.value){t+=`Category,Segment,Value
97
97
  `,Dn.value.forEach(q=>{q.segments.forEach(T=>{const I=String(q.label||"").replace(/"/g,'""'),$=String(T.label||"").replace(/"/g,'""');t+=`"${I}","${$}",${T.value}
98
- `})});const v=new Blob([t],{type:"text/csv;charset=utf-8;"}),b=URL.createObjectURL(v),w=document.createElement("a");w.href=b,w.download=Jl("csv"),document.body.appendChild(w),w.click(),document.body.removeChild(w),URL.revokeObjectURL(b),wn();return}t+="Category",Z.series.forEach(v=>{const b=v.name.replace(/"/g,'""');t+=',"'+b+'"'}),t+=`
98
+ `})});const v=new Blob([t],{type:"text/csv;charset=utf-8;"}),b=URL.createObjectURL(v),x=document.createElement("a");x.href=b,x.download=Jl("csv"),document.body.appendChild(x),x.click(),document.body.removeChild(x),URL.revokeObjectURL(b),wn();return}t+="Category",Z.series.forEach(v=>{const b=v.name.replace(/"/g,'""');t+=',"'+b+'"'}),t+=`
99
99
  `;const o=Math.max(...Z.series.map(v=>v.data?.length||0));for(let v=0;v<o;v++){let q='"'+(Z.categories[v]||N("chart.fallback.item",{number:v+1})).toString().replace(/"/g,'""')+'"';Z.series.forEach(T=>{const I=T.data&&T.data[v]!==void 0?T.data[v]:"";q+=","+I}),t+=q+`
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),wn()}catch(t){console.error("Error downloading CSV:",t)}},eo=t=>{if(typeof t.action=="function"){const o={series:Z.series,categories:Z.categories,markers:ll.value},l={chartX:st.value.chartX,chartY:st.value.chartY,dataX:st.value.mouseDataX,dataY:st.value.mouseDataY,categoryIndex:clampedCategoryIndex||st.value.categoryIndex};t.action(o,l)}wn()},Ho=()=>{Il(),Ze.value.show=!0,Ze.value.categoryIndex=st.value.categoryIndex,Ze.value.fromButton=!1,wn()},to=()=>{Il(),Ze.value.show=!0,Ze.value.categoryIndex=0,Ze.value.fromButton=!0},wo=t=>{if(st.value.show){const o=document.querySelector(".dss-context-menu");o&&!o.contains(t.target)&&(st.value.show=!1)}},xo=t=>{st.value.show&&!t.target.closest(".context-menu")&&(st.value.show=!1)},Ro=t=>{if(!$l.value||!Ct.value||fl.value)return;t.preventDefault(),t.stopPropagation(),ne.value.isZooming=!0,Le.value.show=!1,ne.value.zoomTimeout&&clearTimeout(ne.value.zoomTimeout);const l=t.currentTarget.getBoundingClientRect(),r=t.clientX-l.left,m=t.clientY-l.top;if(r<P.value.left-50||r>P.value.right+50||m<P.value.top-50||m>P.value.bottom+100){ne.value.isZooming=!1;return}const v=t.deltaY>0?.9:1.1,b=Math.max(ne.value.minScale,Math.min(ne.value.maxScale,ne.value.scale*v));if(b!==ne.value.scale){const{minX:w,maxX:q}=Bt.value,T=q-w||1,I=T/ne.value.scale,$=w-ne.value.offsetX/P.value.width*T,G=(r-P.value.left)/P.value.width,Ne=$+G*I;ne.value.scale=b;const Ue=T/ne.value.scale,ve=Ne-G*Ue;ne.value.offsetX=-(ve-w)/T*P.value.width,ne.value.scale<=1.01&&(ne.value.scale=1,ne.value.offsetX=0)}ne.value.zoomTimeout=setTimeout(()=>{ne.value.isZooming=!1,ne.value.zoomTimeout=null},300)},ro=t=>{if(!$l.value||!Ct.value||ne.value.scale<=1)return;Le.value.show=!1;const l=t.currentTarget.getBoundingClientRect();t.clientX-l.left,t.clientY-l.top,ne.value.isDragging=!0,ne.value.lastMouseX=t.clientX,ne.value.lastMouseY=t.clientY,t.preventDefault()},Eo=()=>{ne.value.isDragging=!1},lo=()=>{!$l.value||!Ct.value||(ne.value.scale=1,ne.value.offsetX=0,ne.value.isDragging=!1,ne.value.zoomTimeout&&(clearTimeout(ne.value.zoomTimeout),ne.value.zoomTimeout=null),ne.value.isZooming=!1)},oa=()=>!$l.value||!Qe.value||!Ct.value?"default":ne.value.isDragging?"grabbing":ne.value.scale>1?"grab":"dss-crosshair",io=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],b=t[Math.min(l+2,t.length-1)],w=m.x+(v.x-r.x)/6*sl.value,q=m.y+(v.y-r.y)/6*sl.value,T=v.x-(b.x-m.x)/6*sl.value,I=v.y-(b.y-m.y)/6*sl.value;o+=` C ${w} ${q} ${T} ${I} ${v.x} ${v.y}`}return o},Ml=e.computed(()=>{const o=U.value?.chart?.padding,l=typeof o=="number"?o:null,r=o&&typeof o=="object"?o:null,m=50;let v=m+(Rt.value?30:0)+60;if(vl.value){const $={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??$.left,top:r.top??$.top,right:r.right??$.right,bottom:r.bottom??$.bottom}:$}if(xl.value){const $=!fe.value,G=_l.value,Ne=G?sn.value+Fl.value+Math.max(24,yn.value+16):0,Ue=$?12:m;let ve=0;et.value&&(ve+=$?8:15),lt.value&&(ve+=$?6:10);const be=_e();let Ee=Ue+($?4:16)+(G?Ne:0),me=Ue+(G?Ne:0);fe.value&&ze.value==="left"?Ee+=be.legendWidth||150:fe.value&&ze.value==="right"&&(me+=be.legendWidth||150);const Pe=xe.value==="semi-radial"?G?Ne:8:G?Ne:$?8:m+80,De=G?14:0,Be=Ue+ve+De,Ie={left:Ee,top:Be,right:me,bottom:Pe};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 b=0;et.value&&(b+=15),lt.value&&(b+=10);const w=_e();let q=m+16+(ct.value?30:0),T=m+(pt.value?30:0);fe.value&&ze.value==="left"?q+=w.legendWidth||150:fe.value&&ze.value==="right"&&(T+=w.legendWidth||150),Tn.value&&(T+=44),xe.value==="stepbar"&&(v=rl.value+8);const I={left:q,top:m+b,right:T,bottom:v};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??I.left,top:r.top??I.top,right:r.right??I.right,bottom:r.bottom??I.bottom}:I}),P=e.computed(()=>({left:Ml.value.left,top:Ml.value.top,right:Me.value-Ml.value.right,bottom:mt.value-Ml.value.bottom,width:Me.value-(Ml.value.left+Ml.value.right),height:mt.value-(Ml.value.top+Ml.value.bottom)})),$l=e.computed(()=>["line","area","bar","stepbar"].includes(xe.value)||Jt.value),Xl=e.computed(()=>Jt.value),Zn=e.computed(()=>xe.value==="mini-radial"),xl=e.computed(()=>["radial","semi-radial","mini-radial"].includes(xe.value)),vl=e.computed(()=>xe.value==="spider"),Ot=e.computed(()=>xe.value==="bubble"),fl=e.computed(()=>xe.value==="stepbar");e.watch([A,fl,()=>Z.series],()=>{e.nextTick(dt)},{deep:!0});const hl=e.computed(()=>U.value?.chart?.orientation==="horizontal"&&(xe.value==="bar"||Xl.value)),Sn=t=>{const{minY:o,maxY:l}=Bt.value,r=l-o||1;return P.value.left+(t-o)/r*P.value.width},$n=t=>{const{maxX:o}=Bt.value,l=o+1,m=P.value.height/l;return P.value.top+(t+.5)*m},Wt=e.computed(()=>xl.value?Ml.value.left+(Me.value-Ml.value.left-Ml.value.right)/2:Me.value/2),At=e.computed(()=>vl.value?mt.value/2-40:xl.value?Ml.value.top+(mt.value-Ml.value.top-Ml.value.bottom)/2:mt.value/2),it=e.computed(()=>{if(vl.value){const t=P.value.width-80,o=P.value.height-80;return Math.min(t,o)/2}return Math.min(P.value.width,P.value.height)/2}),kl=e.computed(()=>{const t=U.value,o=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,l=typeof o=="number"&&o>=0&&o<=1?o:.45;return it.value*l}),Ln=e.computed(()=>{const t=U.value,o=typeof Z.innerSize=="number"?Z.innerSize:t?.innerSize;return typeof o!="number"||o<=-100||!(xl.value||vl.value)?1:1+o/100}),co=e.computed(()=>{const t=Ln.value;if(t===1||t<=0)return;const o=Wt.value,l=At.value;return`translate(${o}, ${l}) scale(${t}) translate(${-o}, ${-l})`}),no=e.ref(0),uo=e.computed(()=>`semi-radial-fill-clip-${Z.chartId}`),Vn=e.computed(()=>xe.value==="semi-radial"),a=e.computed(()=>Vn.value&&Sl.value&&!Hn.value),n=e.computed(()=>Vn.value&&Sl.value&&!Hn.value&&mn.value==="fill"),s=e.computed(()=>{const t=a.value?no.value:1,o=Wt.value,l=At.value,r=kl.value,m=it.value,v=Math.PI,b=Math.PI+t*Math.PI;if(t<=0)return`M ${o} ${l} L ${o} ${l} Z`;const w=o+m*Math.cos(v),q=l+m*Math.sin(v),T=o+m*Math.cos(b),I=l+m*Math.sin(b),$=o+r*Math.cos(b),G=l+r*Math.sin(b),Ne=o+r*Math.cos(v),Ue=l+r*Math.sin(v),ve=t>.5?1:0;return`M ${o} ${l} L ${w} ${q} A ${m} ${m} 0 ${ve} 1 ${T} ${I} L ${$} ${G} A ${r} ${r} 0 ${ve} 1 ${Ne} ${Ue} Z`}),i=e.computed(()=>{if(!(!Vn.value||!a.value)&&!n.value)return`url(#${uo.value})`}),c=t=>{if(!(!n.value||t!==0))return`url(#${uo.value})`},d=e.ref(0),u=e.computed(()=>`radial-reveal-clip-${Z.chartId}`),p=e.computed(()=>xe.value==="radial"),y=e.computed(()=>{const t=p.value?d.value:1,o=Wt.value,l=At.value,r=Math.max(it.value*1.5,Me.value,mt.value);if(t<=0)return`M ${o} ${l} L ${o} ${l} Z`;if(t>=1){const $=o-r,G=o+r;return`M ${$} ${l} A ${r} ${r} 0 0 1 ${G} ${l} A ${r} ${r} 0 0 1 ${$} ${l} Z`}const m=-Math.PI/2,v=m+t*Math.PI*2,b=o+r*Math.cos(m),w=l+r*Math.sin(m),q=o+r*Math.cos(v),T=l+r*Math.sin(v),I=t>=.5?1:0;return`M ${o} ${l} L ${b} ${w} A ${r} ${r} 0 ${I} 1 ${q} ${T} Z`}),C=e.computed(()=>{if(i.value)return i.value;if(p.value)return`url(#${u.value})`});let R=null;const O=()=>{if(!a.value)return;no.value=0;const t=Wl.value,o=performance.now(),l=r=>{const m=r-o,v=Math.min(1,m/t);no.value=va(on.value,v),v<1&&(R=requestAnimationFrame(l))};R=requestAnimationFrame(l)},M=e.computed(()=>U.value?.bubbles?.minSize||8),ue=e.computed(()=>U.value?.bubbles?.maxSize||50),le=e.computed(()=>U.value?.bubbles?.opacity||.7),We=(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)},$e=t=>{const o=document.querySelector(`.dss-bubble-image-${t}`);o&&(o.style.opacity="1")},ht=t=>{const o=document.querySelector(`.dss-bubble-image-${t}`);o&&(o.style.display="none")},Ut=e.computed(()=>Z.series),qt=e.computed(()=>Z.series.filter((t,o)=>!F.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"},gl=t=>t?typeof t.strokeDasharray=="string"?t.strokeDasharray:Array.isArray(t.strokeDasharray)?t.strokeDasharray.join(","):t.dotted===!0?"4,4":null:null,It=t=>t?t.old===!0||t.comparison===!0||t.dotted===!0:!1,ol=e.computed(()=>{const o=U.value?.spider?.comparison||{};return{fillOpacity:typeof o.fillOpacity=="number"?o.fillOpacity:0,strokeDasharray:o.strokeDasharray||"6,4",usePrimaryColor:o.usePrimaryColor!==!1,bubbleSize:typeof o.bubbleSize=="number"?o.bubbleSize:0}}),rn=(t,o)=>typeof t?.bubbles?.size=="number"?t.bubbles.size:typeof t?.bubbleSize=="number"?t.bubbleSize:o?ol.value.bubbleSize:ce.value,kn=(t,o)=>It(t)&&ol.value.usePrimaryColor?al(0):al(o),Ol=(t,o)=>vl.value&&It(t)?kn(t,o):al(o),So=e.computed(()=>qt.value.filter(t=>nl(t)==="primary")),Vo=e.computed(()=>qt.value.filter(t=>nl(t)==="secondary")),Tn=e.computed(()=>!hl.value&&!!xt.value&&Vo.value.length>0),No=(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 b=m&&typeof m=="object"&&!Array.isArray(m),w=No(b?m.value:m,0);return w<=0?null:{key:`${l}-${v}-${b&&m.label||v}`,label:b?m.label||o?.name||`Segment ${v+1}`:o?.name||`Segment ${v+1}`,value:w,color:b?m.color||al(v):al(l),marker:b?m.marker:null,isRemainder:!1}}).filter(Boolean);return ae.value==="asc"?r.sort((m,v)=>m.value-v.value):ae.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)}],b=ya(v,l,r),w=b.reduce(($,G)=>$+G.value,0),q=No(m?t.totalValue??t.total??l?.totalValue??l?.total:l?.totalValue??l?.total,se.value),T=Math.max(q,w,1);je.value&&T>w&&b.push({key:`${r}-${o}-remainder`,label:St.value,value:T-w,color:ut.value,marker:null,isRemainder:!0});const I=b.filter($=>!$.isRemainder).reduce(($,G)=>!$||G.value>$.value?G:$,null);return{key:`${r}-${o}`,label:m?t.label||t.name||Z.categories?.[o]||N("chart.fallback.item",{number:o+1}):Z.categories?.[o]||N("chart.fallback.item",{number:o+1}),axisLabel:m?t.xLabel??t.label??t.name??Z.categories?.[o]??N("chart.fallback.item",{number:o+1}):Z.categories?.[o]||N("chart.fallback.item",{number:o+1}),yLabel:m?t.yLabel??null:null,totalValue:T,usedValue:w,segments:b,maxSegmentKey:I?.key||null,seriesName:l?.name||"",seriesIndex:r}},Dn=e.computed(()=>{if(!fl.value)return[];const t=[];return Ut.value.forEach((o,l)=>{F.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}),Al="auto",cn=(t,o,l,r=0,m=100)=>{let v=1/0,b=-1/0;if(t.forEach(T=>{T?.data?.length&&T.data.forEach(I=>{typeof I=="number"&&Number.isFinite(I)&&(v=Math.min(v,I),b=Math.max(b,I))})}),v===1/0)return{minY:r,maxY:m};let w;if(o===Al){const T=b-v,I=T>0?T*.1:1;w=Math.max(0,v-I)}else if(typeof o=="number")w=o;else{const T=b-v,I=T>0?T*.1:1;w=Math.max(0,v-I)}let q;if(l===Al){const T=b-v,I=T>0?T*.1:2;q=b+I}else if(typeof l=="number")q=l;else{const T=b-v,I=T>0?T*.1:2;q=b+I}return{minY:w,maxY:q}},Bt=e.computed(()=>{if(Ot.value)return Wa();if(fl.value)return en();if(!qt.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=0;qt.value.forEach(l=>{l.data&&l.data.length&&(t=Math.max(t,l.data.length-1))}),Z.categories.length>0&&(t=Math.max(t,Z.categories.length-1));const o=cn(So.value.length?So.value:qt.value,Xt.value,kt.value);return{minX:0,maxX:t,minY:o.minY,maxY:o.maxY}}),en=()=>{const t=Dn.value,o=t.reduce((v,b)=>Math.max(v,b.totalValue),se.value),l=typeof Xt.value=="number"?Xt.value:0,r=typeof kt.value=="number"?kt.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(()=>Tn.value?cn(Vo.value,Pt.value,pe.value,Bt.value.minY,Bt.value.maxY):{minY:Bt.value.minY,maxY:Bt.value.maxY}),Wa=()=>{if(!qt.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,b=!1;if(qt.value.forEach((Ne,Ue)=>{Ne?.data?.length&&Ne.data.forEach((ve,be)=>{let Ee,me,Je;if(typeof ve=="object"&&ve!==null&&!Array.isArray(ve))Ee=typeof ve.x=="number"?ve.x:be,me=typeof ve.y=="number"?ve.y:0,Je=typeof ve.size=="number"?ve.size:20;else if(Array.isArray(ve)&&ve.length>=3)Ee=typeof ve[0]=="number"?ve[0]:be,me=typeof ve[1]=="number"?ve[1]:0,Je=typeof ve[2]=="number"?ve[2]:20;else if(typeof ve=="number")Ee=be,me=ve,Je=We(Ue,be);else return;isFinite(Ee)&&isFinite(me)&&isFinite(Je)&&(t=Math.min(t,Ee),o=Math.max(o,Ee),l=Math.min(l,me),r=Math.max(r,me),m=Math.min(m,Je),v=Math.max(v,Je),b=!0)})}),!b)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===o&&(t=Math.min(t,0),o=Math.max(o,Z.categories?.length-1||8)),l===r&&(l=Math.max(0,l-10),r=l+20);const w=o-t,q=r-l;let T,I,$,G;return H.value!==null?T=H.value:T=t-w*.1,Y.value!==null?I=Y.value:I=o+w*.1,Xt.value!==null&&typeof Xt.value=="number"?$=Xt.value:$=Math.max(0,l-q*.1),kt.value!==null&&typeof kt.value=="number"?G=kt.value:G=r+q*.1,{minX:T,maxX:I,minY:$,maxY:G,minSize:m,maxSize:v}},Cl=t=>{if(Ot.value){const{minX:w,maxX:q}=Bt.value,T=q-w||1;return P.value.left+(t-w)/T*P.value.width}const{minX:o,maxX:l}=Bt.value,r=l-o;if(l===0||r===0)return P.value.left+P.value.width/2;const m=r/ne.value.scale,v=o-ne.value.offsetX/P.value.width*r,b=(t-v)/m;return P.value.left+b*P.value.width},Un=t=>{const{minY:o,maxY:l}=Bt.value,r=l-o||1;return P.value.bottom-(t-o)/r*P.value.height},ka=t=>{const{minY:o,maxY:l}=aa.value,r=l-o||1;return P.value.bottom-(t-o)/r*P.value.height},Cn=(t,o)=>Tn.value&&nl(t)==="secondary"?ka(o):Un(o),qa=t=>{if(!Ot.value)return ce.value||4;const{maxSize:o}=Bt.value,l=Math.max(1,o),r=Math.min(1,Math.max(0,t/l));return M.value+r*(ue.value-M.value)},mo=(t,o=12,l="Arial, sans-serif")=>{if(typeof t!="string"||!t)return 0;if(typeof document>"u")return t.length*(o*.62);mo.canvas||(mo.canvas=document.createElement("canvas"));const r=mo.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||mo(t,l)<=o)return t;const r="..";if(mo(r,l)>=o)return r;let v=t.length;for(;v>0;){const b=`${t.slice(0,v)}${r}`;if(mo(b,l)<=o)return b;v-=1}return r},Za=e.computed(()=>ra.value.map(t=>({y:t.y}))),ba=e.computed(()=>!fl.value||!Lt.value?[]:ra.value.map(t=>({y:t.y}))),sa=e.computed(()=>{if(Ot.value)return Ua();if(fl.value)return[];if(xe.value==="bar"){if(hl.value){const Be=[],{minY:Ie,maxY:$t}=Bt.value,Zt=5,tn=$t-Ie||1;for(let bl=0;bl<=Zt;bl++){const ln=Ie+tn*(bl/Zt),Wo=Sn(ln);Be.push({x:Wo,y:P.value.bottom+20,text:Vl(Math.round(ln))})}return Be}const be=[],{maxX:Ee}=Bt.value,me=Ee+1,Je=5,De=(P.value.width-Je*2)/me;for(let Be=0;Be<=Ee;Be++){const Ie=P.value.left+Je+(Be+.5)*De;be.push({x:Ie,y:P.value.bottom+20,text:Ca(Z.categories[Be]||N("chart.fallback.item",{number:Be+1}),Math.max(De-8,24))})}return be}const t=[],{minX:o,maxX:l}=Bt.value,r=H.value!==null?H.value:o,m=Y.value!==null?Y.value:l,v=m-r||1,b=v/ne.value.scale,w=r-ne.value.offsetX/P.value.width*v,q=w+b,T=Math.max(0,Math.floor(w-2)),I=Math.min(m,Math.ceil(q+2)),$=I-T,G=P.value.width,Ue=Math.floor(G/60);let ve=1;$>Ue&&(ve=Math.ceil($/Ue));for(let be=T;be<=I;be+=ve)if(be>=0&&be<=m){const Ee=Cl(be);Ee>=P.value.left-100&&Ee<=P.value.right+100&&t.push({x:Ee,y:P.value.bottom+20,text:Z.categories[be]||`Item ${be+1}`})}return t}),Ua=()=>{const t=[],{minX:o,maxX:l}=Bt.value,r=l-o||1,m=Math.min(8,Math.max(4,Math.floor(P.value.width/80)));for(let v=0;v<=m;v++){const b=o+r*v/m,w=Cl(b);if(w>=P.value.left-10&&w<=P.value.right+10){const q=Math.round(b),T=Z.categories?.[q];t.push({x:w,y:P.value.bottom+20,text:T||(Number.isInteger(b)?b.toString():b.toFixed(1))})}}return t},ra=e.computed(()=>{if(hl.value){const m=[],{maxX:v}=Bt.value;for(let b=0;b<=v;b++)m.push({x:P.value.left-10,y:$n(b),text:Ca(Z.categories[b]||`Item ${b+1}`,Math.max(P.value.left-28,40))});return m}const t=[],{minY:o,maxY:l}=Bt.value,r=5;for(let m=0;m<=r;m++){const v=o+(l-o)*(m/r),b=Math.round(v);t.push({x:P.value.left-10,y:Un(v),text:Vl(b)})}return t}),Ya=e.computed(()=>{if(!Tn.value||hl.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),b=Math.round(v);t.push({x:P.value.right+10,y:ka(v),text:Vl(b)})}return t}),al=t=>{const o=V.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]},Xa=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 w=o.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(w)l=Number(w[1])/255,r=Number(w[2])/255,m=Number(w[3])/255;else{const q=o.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(q){let T=q[1];T.length===3&&(T=T[0]+T[0]+T[1]+T[1]+T[2]+T[2]),l=parseInt(T.slice(0,2),16)/255,r=parseInt(T.slice(2,4),16)/255,m=parseInt(T.slice(4,6),16)/255}else if(typeof document<"u"){const T=document.createElement("span");T.style.color=o,T.style.display="none",document.body.appendChild(T);const I=getComputedStyle(T).color;document.body.removeChild(T);const $=I.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if($)l=Number($[1])/255,r=Number($[2])/255,m=Number($[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)),b=Math.max(0,Math.floor(Number(l[2])*.65)),w=Math.max(0,Math.floor(Number(l[3])*.65));return`rgb(${v}, ${b}, ${w})`}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)),b=Math.max(0,Math.floor(Number(r[2])*.65)),w=Math.max(0,Math.floor(Number(r[3])*.65));return`rgba(${v}, ${b}, ${w}, ${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 b=Math.max(0,Math.min(255,Math.floor(parseInt(v.slice(0,2),16)*.65))),w=Math.max(0,Math.min(255,Math.floor(parseInt(v.slice(2,4),16)*.65))),q=Math.max(0,Math.min(255,Math.floor(parseInt(v.slice(4,6),16)*.65)));return`#${[b,w,q].map(T=>T.toString(16).padStart(2,"0")).join("")}`}return o},ca=(t,o)=>{const r=U.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(()=>xe.value==="line"||Xl.value?(Xl.value?Z.series.filter(o=>(o.type||xe.value)==="line"):Ut.value).map((o,l)=>{const r=Z.series.findIndex($=>$===o),m=[];let v=[];o.data.forEach(($,G)=>{$==null?v.length>0&&(m.push([...v]),v=[]):v.push({x:hl.value?Sn($):Cl(G),y:hl.value?$n(G):Cn(o,$),index:G})}),v.length>0&&m.push(v);let b="";m.forEach($=>{if($.length>0){let G="";Vt.value?G=io($):G=`M ${$[0].x} ${$[0].y}`+$.slice(1).map(Ne=>` L ${Ne.x} ${Ne.y}`).join(""),b+=(b?" ":"")+G}});const w=m.reduce(($,G)=>$+ua(G),0),q=F.value.has(r),T=z.value===r,I=z.value!==null&&z.value!==r;return{path:b,color:al(r),strokeDasharray:gl(o),pathLength:w,seriesIndex:r,animationDelay:l*il.value,isHighlighted:T,isDimmed:I,isHidden:q}}):[]),xa=e.computed(()=>{if(!(xe.value==="line"||Xl.value))return[];const t=Xl.value?Z.series.filter(l=>(l.type||xe.value)==="line"):Ut.value,o=[];return t.forEach((l,r)=>{const m=Z.series.findIndex(v=>v===l);for(let v=0;v<l.data.length-1;v++){const b=l.data[v];if(b!=null){let w=-1,q=0;for(let T=v+1;T<l.data.length;T++){const I=l.data[T];if(I==null)q++;else{w=T;break}}if(q>0&&w!==-1){const T=l.data[w],I=hl.value?Sn(b):Cl(v),$=hl.value?$n(v):Cn(l,b),G=hl.value?Sn(T):Cl(w),Ne=hl.value?$n(w):Cn(l,T),Ue=F.value.has(m),ve=z.value===m,be=z.value!==null&&z.value!==m;o.push({path:`M ${I} ${$} L ${G} ${Ne}`,color:al(m),seriesIndex:m,animationDelay:r*il.value,isHighlighted:ve,isDimmed:be,isHidden:Ue,gapSize:q}),v=w-1}}}}),o}),ja=e.computed(()=>xe.value==="line"||Xl.value?!Sl.value||Hn.value||zt.value.hasAnimated?[]:(Xl.value?Z.series.filter(o=>(o.type||xe.value)==="line"):Ut.value).map((o,l)=>{const r=Z.series.findIndex(q=>q===o);let m="",v=null;o.data.forEach((q,T)=>{if(q!=null){const I={x:hl.value?Sn(q):Cl(T),y:hl.value?$n(T):Cn(o,q)};v===null?m+=`M ${I.x} ${I.y}`:m+=` L ${I.x} ${I.y}`,v=I}else if(v!==null){const I=o.data.findIndex(($,G)=>G>T&&$!==null&&$!==void 0);if(I!==-1){const $={x:hl.value?Sn(o.data[I]):Cl(I),y:hl.value?$n(I):Cn(o,o.data[I])};m+=` L ${$.x} ${$.y}`,v=$}}});const b=o.data.map((q,T)=>q==null?null:{x:hl.value?Sn(q):Cl(T),y:hl.value?$n(T):Cn(o,q)}).filter(q=>q!==null),w=ua(b);return{path:m,pathLength:w,color:al(r),strokeDasharray:gl(o),animationDelay:l*il.value,seriesIndex:r}}):[]),Ka=e.computed(()=>{if(xe.value!=="line")return[];const t=[];return Ut.value.forEach((o,l)=>{const r=z.value===l,m=z.value!==null&&z.value!==l,v=F.value.has(l);o.data.forEach((b,w)=>{b!=null&&t.push({x:Cl(w),y:Cn(o,b),color:al(l),value:b,label:Z.categories[w]||w.toString(),seriesName:o.name,categoryIndex:w,dataIndex:w,animationDelay:(l*o.data.length+w)*(il.value/8),isHighlighted:r,isDimmed:m,isHidden:v})})}),t}),Ga=e.computed(()=>{if(!Xl.value)return[];const t=[];return Z.series.filter(l=>(l.type||xe.value)==="line").forEach((l,r)=>{const m=Z.series.findIndex(q=>q===l),v=z.value===m,b=z.value!==null&&z.value!==m,w=F.value.has(m);l.data.forEach((q,T)=>{q!=null&&t.push({x:Cl(T),y:Cn(l,q),color:al(m),value:q,label:Z.categories[T]||T.toString(),seriesName:l.name,categoryIndex:T,dataIndex:T,animationDelay:(r*l.data.length+T)*(il.value/8),isHighlighted:v,isDimmed:b,isHidden:w})})}),t}),Io=e.computed(()=>{if(!Ot.value)return[];const t=[];return Ut.value.forEach((o,l)=>{if(!o?.data?.length)return;const r=z.value,m=r!==null&&r===l,v=r!==null&&r!==l,b=F.value.has(l);o.data.forEach((w,q)=>{let T,I,$,G,Ne;if(typeof w=="object"&&w!==null&&!Array.isArray(w))T=typeof w.x=="number"?w.x:q,I=typeof w.y=="number"?w.y:0,$=typeof w.size=="number"?w.size:20,G=w.label||Z.categories?.[q]||`Point ${q+1}`,Ne=w.image||w.imageUrl;else if(Array.isArray(w)&&w.length>=3)T=typeof w[0]=="number"?w[0]:q,I=typeof w[1]=="number"?w[1]:0,$=typeof w[2]=="number"?w[2]:20,G=w[3]||Z.categories?.[q]||`Point ${q+1}`,Ne=w[4];else if(typeof w=="number")T=q,I=w,$=We(l,q),G=Z.categories?.[q]||`Point ${q+1}`;else return;!isFinite(T)||!isFinite(I)||!isFinite($)||t.push({x:Cl(T),y:Un(I),radius:qa($),originalX:T,originalY:I,originalSize:$,color:al(l),seriesName:o.name||`Series ${l+1}`,label:G,imageUrl:Ne,seriesIndex:l,dataIndex:q,categoryIndex:Math.round(T),isHighlighted:m,isDimmed:v,isHidden:b,opacity:le.value})})}),t}),da=e.computed(()=>xe.value!=="area"?[]:Ut.value.map((t,o)=>{const l=[];let r=[];if(t.data.forEach(($,G)=>{$==null?r.length>0&&(l.push([...r]),r=[]):r.push({x:Cl(G),y:Cn(t,$),index:G})}),r.length>0&&l.push(r),l.length===0)return{linePath:"",areaPath:"",color:al(o),isHidden:F.value.has(o)};const m=P.value.bottom+1;let v="",b="";l.forEach(($,G)=>{if($.length===0)return;let Ne=`M ${$[0].x} ${$[0].y}`;Vt.value&&$.length>1?Ne=io($):$.slice(1).forEach(ve=>{Ne+=` L ${ve.x} ${ve.y}`}),v+=(v?" ":"")+Ne;let Ue=`M ${$[0].x} ${m}`;if(Ue+=` L ${$[0].x} ${$[0].y}`,Vt.value&&$.length>1){const ve=io($),be=ve.substring(ve.indexOf("C")||ve.indexOf("Q")||ve.indexOf("L"));be?Ue+=" "+be:$.slice(1).forEach(Ee=>{Ue+=` L ${Ee.x} ${Ee.y}`})}else $.slice(1).forEach(ve=>{Ue+=` L ${ve.x} ${ve.y}`});Ue+=` L ${$[$.length-1].x} ${m} Z`,b+=(b?" ":"")+Ue});const w=z.value===o,q=z.value!==null&&z.value!==o,T=F.value.has(o),I=l.reduce(($,G)=>$+ua(G),0);return{linePath:v,areaPath:b,color:al(o),pathLength:I,isHighlighted:w,isDimmed:q,isHidden:T}})),Ea=e.computed(()=>{if(!(["bar"].includes(xe.value)||Xl.value))return[];const t=[],{maxX:o}=Bt.value,l=Xl.value?Z.series.filter(m=>(m.type||xe.value)==="bar"):Ut.value,r=l.length;if(hl.value){const m=o+1,b=P.value.height/m,w=b*(2/3),q=Math.min(4,w/r*.15),T=w-(r-1)*q,I=Math.max(4,T/r);l.forEach(($,G)=>{const Ne=Z.series.findIndex(Ee=>Ee===$),Ue=z.value===Ne,ve=z.value!==null&&z.value!==Ne,be=F.value.has(Ne);$.data.forEach((Ee,me)=>{if(Ee==null||typeof Ee!="number"||!isFinite(Ee))return;const De=P.value.top+(me+.5)*b-w/2+G*(I+q),Be=P.value.left,Ie=Math.abs(Sn(Ee)-P.value.left);let $t="";if(Vt.value&&Ie>0){const Zt=Math.min(D.value,I/2,Ie/2);$t=[`M ${Be} ${De}`,`L ${Be+Ie-Zt} ${De}`,`Q ${Be+Ie} ${De} ${Be+Ie} ${De+Zt}`,`L ${Be+Ie} ${De+I-Zt}`,`Q ${Be+Ie} ${De+I} ${Be+Ie-Zt} ${De+I}`,`L ${Be} ${De+I}`,"Z"].join(" ")}t.push({x:Be,y:De,width:Ie,height:I,color:al(r===1?me:Ne),value:Ee,label:Z.categories[me]||me.toString(),seriesName:$.name,animationDelay:(G*l.length+me)*(il.value/4),isHighlighted:Ue,isDimmed:ve,isHidden:be,barPath:$t,isSmooth:Vt.value&&Ie>0})})})}else{const m=o+1,b=P.value.width/m,w=b*.8,q=w/r,T=q*.05,I=q-T;l.forEach(($,G)=>{const Ne=Z.series.findIndex(Ee=>Ee===$),Ue=z.value===Ne,ve=z.value!==null&&z.value!==Ne,be=F.value.has(Ne);$.data.forEach((Ee,me)=>{if(Ee==null||typeof Ee!="number"||!isFinite(Ee))return;const De=P.value.left+(me+.5)*b-w/2+G*q+T/2,Be=Un(Math.max(0,Ee)),Ie=Math.abs(Un(0)-Un(Ee));let $t="";if(Vt.value&&Ie>0){const Zt=Math.min(D.value,I/2,Ie/2);$t=[`M ${De} ${Be+Ie}`,`L ${De} ${Be+Zt}`,`Q ${De} ${Be} ${De+Zt} ${Be}`,`L ${De+I-Zt} ${Be}`,`Q ${De+I} ${Be} ${De+I} ${Be+Zt}`,`L ${De+I} ${Be+Ie}`,"Z"].join(" ")}t.push({x:De,y:Be,width:I,height:Ie,color:al(r===1?me:Ne),value:Ee,label:Z.categories[me]||me.toString(),seriesName:$.name,animationDelay:(G*l.length+me)*(il.value/4),isHighlighted:Ue,isDimmed:ve,isHidden:be,barPath:$t,isSmooth:Vt.value&&Ie>0})})})}return t}),An=e.computed(()=>{if(!xl.value)return[];const t=Ut.value.map((b,w)=>({series:b,originalIndex:w})).filter(({originalIndex:b})=>!F.value.has(b));if(t.length===0)return[];let o=xe.value==="semi-radial"?Math.PI:-Math.PI/2;const l=xe.value==="semi-radial"?Math.PI:Math.PI*2,r=[],m=(b,w,q,T,I,$)=>{const G=b+(w-b)/2,Ne=w-b,Ue=Wt.value+Math.cos(b)*kl.value,ve=At.value+Math.sin(b)*kl.value,be=Wt.value+Math.cos(w)*kl.value,Ee=At.value+Math.sin(w)*kl.value,me=Wt.value+Math.cos(w)*it.value,Je=At.value+Math.sin(w)*it.value,Pe=Wt.value+Math.cos(b)*it.value,De=At.value+Math.sin(b)*it.value,Be=Ne>Math.PI?1:0,Ie=[`M ${Ue} ${ve}`,`A ${kl.value} ${kl.value} 0 ${Be} 1 ${be} ${Ee}`,`L ${me} ${Je}`,`A ${it.value} ${it.value} 0 ${Be} 0 ${Pe} ${De}`,"Z"].join(" "),$t=$||al(q);return{path:Ie,color:$t,strokeWidth:te.value,strokeColor:ca(r.length,$t),value:I,seriesName:T,opacity:.8,isHighlighted:z.value===q,isDimmed:z.value!==null&&z.value!==q,isHidden:!1,startAngle:b,endAngle:w,midAngle:G}};if(Zn.value){const{series:b,originalIndex:w}=t[0],q=Number(b?.data?.[0]??0),T=Number.isFinite(q)?Math.min(Math.max(q,0),100):0,I=U.value,$=Math.min(Math.max(Number(I?.miniRadial?.minVisiblePercent??1),0),100),Ne=(T<=0?$:T)/100*l,Ue=Number(I?.miniRadial?.thresholds?.low??33),ve=Number(I?.miniRadial?.thresholds?.medium??66),be=I?.miniRadial?.colors?.low||"#E53E3E",Ee=I?.miniRadial?.colors?.medium||"#ED8936",me=I?.miniRadial?.colors?.high||"#38A169",Je=T<=Ue?be:T<=ve?Ee:me,Pe=I?.miniRadial?.trackColor||"#E5E7EB",De=b?.name||"Score";return r.push(m(o,o+l-.001,w+1,"Track",100,Pe)),r.push(m(o,o+Ne,w,De,T,Je)),r}if(t.length===1){const{series:b,originalIndex:w}=t[0],q=b.data[0]||0,T=o,I=o+l-.001,$=T+l/2,G=Wt.value+Math.cos(T)*kl.value,Ne=At.value+Math.sin(T)*kl.value,Ue=Wt.value+Math.cos(I)*kl.value,ve=At.value+Math.sin(I)*kl.value,be=Wt.value+Math.cos(I)*it.value,Ee=At.value+Math.sin(I)*it.value,me=Wt.value+Math.cos(T)*it.value,Je=At.value+Math.sin(T)*it.value,Pe=1,De=[`M ${G} ${Ne}`,`A ${kl.value} ${kl.value} 0 ${Pe} 1 ${Ue} ${ve}`,`L ${be} ${Ee}`,`A ${it.value} ${it.value} 0 ${Pe} 0 ${me} ${Je}`,"Z"].join(" "),Be=al(w);return r.push({path:De,color:Be,strokeWidth:te.value,strokeColor:ca(0,Be),value:q,seriesName:b.name,opacity:.8,isHighlighted:z.value===w,isDimmed:!1,isHidden:!1,startAngle:T,endAngle:I,midAngle:$}),r}if(n.value&&t.length===2){const b=t[0],w=t[1],q=Math.min(100,Math.max(0,b.series.data[0]||0)),T=q/100*l;return r.push(m(o,o+T,b.originalIndex,b.series.name,q)),r.push(m(o,o+l,w.originalIndex,w.series.name,100)),r}const v=t.reduce((b,{series:w})=>b+(w.data[0]||0),0);return v===0?[]:(t.forEach(({series:b,originalIndex:w})=>{const q=b.data[0]||0,T=q/v*l,I=o,$=o+T,G=I+T/2,Ne=Wt.value+Math.cos(I)*kl.value,Ue=At.value+Math.sin(I)*kl.value,ve=Wt.value+Math.cos($)*kl.value,be=At.value+Math.sin($)*kl.value,Ee=Wt.value+Math.cos($)*it.value,me=At.value+Math.sin($)*it.value,Je=Wt.value+Math.cos(I)*it.value,Pe=At.value+Math.sin(I)*it.value,De=T>Math.PI?1:0,Be=[`M ${Ne} ${Ue}`,`A ${kl.value} ${kl.value} 0 ${De} 1 ${ve} ${be}`,`L ${Ee} ${me}`,`A ${it.value} ${it.value} 0 ${De} 0 ${Je} ${Pe}`,"Z"].join(" "),Ie=al(w);r.push({path:Be,color:Ie,strokeWidth:te.value,strokeColor:ca(r.length,Ie),value:q,seriesName:b.name,opacity:.8,isHighlighted:z.value===w,isDimmed:z.value!==null&&z.value!==w,isHidden:!1,startAngle:I,endAngle:$,midAngle:G}),o=$}),r)}),Qa=e.computed(()=>{const t=An.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(!_l.value||!xl.value)return[];const t=yn.value,o=sn.value,l=Fl.value,r=ul.value,m=15,v=t*1.3,b=.55,w=($,G)=>{const Ne=Wt.value+Math.cos($.midAngle)*it.value,Ue=At.value+Math.sin($.midAngle)*it.value,ve=Wt.value+Math.cos($.midAngle)*(it.value+o),be=At.value+Math.sin($.midAngle)*(it.value+o),me=ve+l*(G?1:-1),Je=G?ve+m:ve-m,Pe=be-r,De=`${$.seriesName}: ${Vl($.value)}`,Be=De.length*t*b;return{pointerStartX:Ne,pointerStartY:Ue,pointerEndX:ve,pointerEndY:be,horizontalEndX:me,horizontalEndY:be,textX:Je,textY:Pe,text:De,textWidth:Be,textAnchor:G?"start":"end",isRightSide:G,pointerLineLength:Math.hypot(ve-Ne,be-Ue),horizontalLineLength:Math.hypot(me-ve,0)}},q=($,G)=>{const Ne=Math.abs($.textY-G.textY)<v,Ue=$.isRightSide?$.textX:$.textX-$.textWidth,ve=$.isRightSide?$.textX+$.textWidth:$.textX,be=G.isRightSide?G.textX:G.textX-G.textWidth,Ee=G.isRightSide?G.textX+G.textWidth:G.textX,me=Ue<Ee&&be<ve;return Ne&&me},T=An.value.filter($=>!$.isHidden),I=[];for(let $=0;$<T.length;$++){const G=T[$];let Ne=Math.cos(G.midAngle)>=0;if($>0){const ve=I[$-1],be=w(G,Ne);q(ve,be)&&(Ne=!Ne)}const Ue=w(G,Ne);I.push({...Ue,color:G.color,isHighlighted:G.isHighlighted,isDimmed:G.isDimmed})}return I}),es=t=>{if(!t||t.isHidden)return 0;const o=t.opacity||le.value||.7;return z.value===null||z.value===void 0?o:z.value!==null?t.seriesIndex===z.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 z.value!==null?t.seriesIndex===z.value?Math.min(1,o+.1):o*.7:o},Sa=(t,o)=>{if(t)try{if(z.value===t.seriesIndex?z.value=null:z.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const l=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:o,chartId:Z.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,z.value=t.seriesIndex,Le.value.show=!1,!Et.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 b=200,w=120;m+b>Me.value&&(m=o.clientX-r.left-b-10),v+w>r.height&&(v=o.clientY-r.top-w-10),m<0&&(m=10),v<0&&(v=10);const q=f.value,T=g.value,I=q.map($=>{const G=T[$]||$,Ne=Na($,t);return Ne?{seriesName:t.seriesName,label:t.label,value:`${G}: ${Ne}`,color:t.color}:null}).filter(Boolean);Te.value={show:!0,x:m,y:v,title:t.label||t.seriesName||"",value:"",bubbleData:I,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=E.value[t];if(typeof r=="function")return r(l,o);if(typeof l=="number"){const m=l.toFixed(1);return bt.value?m+bt.value:m}return l?.toString()||""},ns=()=>{if(!Ot.value||!Le.value.data||Le.value.data.length===0)return"Bubbles";const t=[],o=new Set;return Le.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,z.value=null,Te.value.show=!1,Te.value.bubbleData=[])},os=(t,o)=>{const l=o.target.closest(".dss-custom-chart-container");if(!l)return;const r=l.getBoundingClientRect(),m=so(t.categoryIndex),v=t.description||t.comment||"";let b=o.clientX-r.left+15,w=o.clientY-r.top-10;const q=200,T=v?80:50;b+q>Me.value&&(b=o.clientX-r.left-q-15),w+T>mt.value&&(w=o.clientY-r.top-T-10),b<0&&(b=10),w<0&&(w=10),Ft.value={show:!0,x:b,y:w,categoryValue:m,description:v}},as=()=>{Ft.value.show=!1},po=e.computed(()=>Z.categories.length||Math.max(...qt.value.map(t=>t.data.length))),ss=e.computed(()=>{let t=0;return qt.value.forEach(o=>{o.data.forEach(l=>{typeof l=="number"&&(t=Math.max(t,l))})}),t||100}),_a=e.computed(()=>{const t=[],o=po.value;for(let l=0;l<o;l++){const r=l*2*Math.PI/o-Math.PI/2,m=Wt.value+Math.cos(r)*it.value,v=At.value+Math.sin(r)*it.value;t.push({x:m,y:v,angle:r,index:l})}return t}),rs=e.computed(()=>{const t=[],o=po.value;return _a.value.forEach((l,r)=>{const m=it.value+15,v=r*2*Math.PI/o-Math.PI/2,b=Wt.value+Math.cos(v)*m,w=At.value+Math.sin(v)*m+5;let q="middle",T="middle";Math.abs(Math.cos(v))>.5&&(q=Math.cos(v)>0?"start":"end"),Math.abs(Math.sin(v))>.5&&(T=Math.sin(v)>0?"hanging":"auto"),t.push({x:b,y:w,text:Z.categories[r]||`Axis ${r+1}`,anchor:q,baseline:T})}),t}),is=e.ref(new Set),cs=(t,o,l)=>{const r=`current-${l}`,m=is.value.has(r),v=o.fillOpacity??ql.value;return!m&&z.value===null?v:o.isHighlighted||m?o.isComparison?v:v+.15:o.isDimmed?v*.3:v},Ma=e.computed(()=>{if(!vl.value)return[];const t=[],o=po.value;return Ut.value.map((r,m)=>({series:r,seriesIndex:m})).sort((r,m)=>{const v=It(r.series)?0:1,b=It(m.series)?0:1;return v-b}).forEach(({series:r,seriesIndex:m})=>{const v=It(r),b=[],w=[],q=[],T=z.value===m,I=z.value!==null&&z.value!==m,$=F.value.has(m);for(let G=0;G<o;G++){const Ne=r.data[G]||0,ve=Ne/ss.value*it.value,be=G*2*Math.PI/o-Math.PI/2,Ee=Wt.value+Math.cos(be)*ve,me=At.value+Math.sin(be)*ve;b.push(`${Ee},${me}`),w.push({x:Ee,y:me}),q.push({x:Ee,y:me,value:Ne,label:Z.categories[G]||`Axis ${G+1}`,seriesName:r.name})}t.push({points:b.join(" "),polygonPoints:w,dataPoints:q,color:kn(r,m),fillOpacity:v?ol.value.fillOpacity:ql.value,strokeDasharray:v?gl(r)||ol.value.strokeDasharray:null,pointRadius:rn(r,v),seriesName:r.name,value:`${r.name}: ${r.data.join(", ")}`,isHighlighted:T,isDimmed:I,isHidden:$,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,b=o[r].y,w=o[m].x,q=o[m].y;b>t.y!=q>t.y&&t.x<(w-v)*(t.y-b)/(q-b)+v&&(l=!l)}return l},ds=t=>{if(!vl.value)return;const o=t.currentTarget.closest(".dss-custom-chart-container");if(!o)return;const l=o.getBoundingClientRect(),r=ee.value?.getBoundingClientRect();if(!r)return;const m=t.clientX-r.left,v=t.clientY-r.top,b=Ma.value.filter(w=>w.isHidden?!1:us({x:m,y:v},w.polygonPoints));if(b.length>0){b.length,z.value=b[0].seriesIndex;const w=t.clientX-l.left+10,q=t.clientY-l.top-10,T=b.length>1?460:260,I=70+po.value*20;let $=w,G=q;$+T>Me.value&&($=t.clientX-l.left-T-10),G+I>mt.value&&(G=t.clientY-l.top-I-10),$<0&&($=10),G<0&&(G=10);const Ne=b.map(Ue=>({seriesName:Ue.seriesName,color:Ue.color,points:Ue.dataPoints.map(ve=>({label:ve.label,value:Vl(ve.value)}))}));Te.value={show:!0,x:$,y:G,title:"",value:"",bubbleData:[],spiderAreas:Ne}}else Nn()},zo=e.computed(()=>{const t=U.value;return t.logos.map((o,l)=>{const r=Z.series[o.seriesIndex];if(!r||!r.data||r.data.length===0||F.value.has(o.seriesIndex))return null;let m,v;if($l.value){let w=-1,q=null;for(let I=r.data.length-1;I>=0;I--)if(r.data[I]!==null&&r.data[I]!==void 0){w=I,q=r.data[I];break}if(w===-1||q===null)return null;const T=r.data.map((I,$)=>I==null?null:{x:Cl($),y:Cn(r,I),index:$}).filter(I=>I!==null);if(t.animations.enabled&&!Hn.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(zt.value.isAnimating||!zt.value.hasAnimated))if(zt.value.isAnimating){const I=zt.value.currentFrame/zt.value.totalFrames,$=va(t.animations.easing,Math.min(I,1)),G=Cs(T,$);m=G.x+(o.offsetX||0),v=G.y+(o.offsetY||0)}else m=T[0].x+(o.offsetX||0),v=T[0].y+(o.offsetY||0);else m=Cl(w)+(o.offsetX||0),v=Un(q)+(o.offsetY||0)}else if(xl.value||vl.value){const w=Math.PI*2/t.logos.length*l;m=Wt.value+Math.cos(w)*(it.value+30)+(o.offsetX||0),v=At.value+Math.sin(w)*(it.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=>{F.value.has(t)?F.value.delete(t):F.value.add(t)},vs=e.computed(()=>{if(!Te.value.show&&!(Se.value&&Le.value.show&&!ne.value.isZooming))return{display:"none"};let t,o;if(Se.value&&Le.value.show&&!ne.value.isZooming){t=Le.value.x+15,o=P.value.top;const l=Ot.value?200:150;t+l>Me.value&&(t=Le.value.x-l-15),t<0&&(t=10),o<10&&(o=10)}else t=Te.value.x,o=Te.value.y;return{left:t+"px",top:o+"px"}}),Yn=(t,o)=>{if(!Et.value||Bo.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 b=200,w=120,q=Me.value,T=mt.value;m+b>q&&(m=o.clientX-r.left-b-10),v+w>T&&(v=o.clientY-r.top-w-10),m<0&&(m=10),v<0&&(v=10);let I;typeof t.categoryIndex=="number"?I=t.categoryIndex:typeof t.dataIndex=="number"?I=t.dataIndex:t.label&&Z.categories.includes(t.label)&&(I=Z.categories.indexOf(t.label));let $=t.seriesName||t.label||"";(hl.value||xe.value==="bar")&&t.label&&($=t.label),t.tooltipTitle&&($=t.tooltipTitle),Te.value={show:!0,x:m,y:v,title:$,value:Vl(t.value)||"",categoryIndex:I,spiderAreas:[]}},pa=e.ref(!1),Po=e.ref(!1),Nn=()=>{Te.value.show=!1,Te.value.spiderAreas=[],Te.value.bubbleData=[],Le.value.show=!1,pa.value||(z.value=null)},Bo=e.ref(!1),_o=(t,o)=>{Bo.value=!0,Te.value.show=!1,Le.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 b=250;m+b>Me.value&&(m=o.clientX-r.left-b-15),m<0&&(m=10),v<0&&(v=10),at.value={show:!0,x:m,y:v,content:t.texts,count:t.totalCount}},Mo=()=>{Bo.value=!1,at.value.show=!1},zt=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}},Hn=e.computed(()=>Fn.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),$a=()=>{if(!Sl.value||Hn.value){zt.value.hasAnimated=!0,p.value&&(d.value=1);return}p.value&&(d.value=0),zt.value.isAnimating=!0,zt.value.currentFrame=0,zt.value.totalFrames=Math.ceil(Wl.value/16.67);const t=()=>{const o=zt.value.currentFrame/zt.value.totalFrames,l=va(on.value,Math.min(o,1));fs(l),p.value&&(d.value=l),o<1?(zt.value.currentFrame++,zt.value.animationId=requestAnimationFrame(t)):hs()};zt.value.animationId=requestAnimationFrame(t)},fs=t=>{const o=W.value;o&&o.style.setProperty("--dss-animation-progress",t)},hs=()=>{zt.value.isAnimating=!1,zt.value.hasAnimated=!0,p.value&&(d.value=1),zt.value.animationId&&(cancelAnimationFrame(zt.value.animationId),zt.value.animationId=null)},fa=e.computed(()=>!xl.value||zt.value.hasAnimated?!0:p.value?d.value>=1:Vn.value?no.value>=1:!0),La=e.computed(()=>_l.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(!Sl.value||Hn.value||zt.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${Wl.value}ms`,t["--dss-animation-easing"]=ys(on.value),t["--dss-stagger-delay"]=`${il.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(!Sl.value||Hn.value)return"";const t=["dss-chart-animated"];return zt.value.hasAnimated||t.push(`dss-animate-${mn.value}`),zt.value.hasAnimated||(xl.value&&xe.value!=="semi-radial"?t.push("dss-animate-fill"):xl.value||t.push(`dss-animate-${mn.value}`)),zt.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>Z.series,(t,o)=>{jn.value&&o&&zt.value.hasAnimated&&(zt.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>$a(),pn.value)}))},{deep:!0}),e.watch(()=>ne.value.isZooming,(t,o)=>{o&&!t&&setTimeout(()=>{Co()},50)}),e.watch(()=>[ne.value.scale,ne.value.offsetX],()=>{!ne.value.isZooming&&!ne.value.isDragging&&Co()},{flush:"post"}),e.watch([tl,ie],([t,o])=>{ne.value.minScale=t,ne.value.maxScale=o,(ne.value.scale<t||ne.value.scale>o)&&lo()},{immediate:!0}),e.watch(()=>Z.locale,t=>{t&&t!==L.value&&(L.value=t)},{immediate:!0}),e.watch(()=>st.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",xo)}):document.removeEventListener("click",xo)}),e.onMounted(()=>{z.value=null,p.value&&(!Sl.value||Hn.value)&&(d.value=1),Ao(),e.nextTick(dt),W.value&&typeof ResizeObserver<"u"&&(Q=new ResizeObserver(t=>{const o=t[0];!o||!o.contentRect||(K&&cancelAnimationFrame(K),K=requestAnimationFrame(()=>{K=null;const{width:l,height:r}=o.contentRect;we.value=Math.round(l),ye.value=Math.round(r),h.value&&(rt.value=h.value.offsetHeight||he)}))}),Q.observe(W.value)),Sl.value&&!Hn.value?xe.value==="semi-radial"?setTimeout(()=>O(),pn.value):setTimeout(()=>$a(),pn.value):(zt.value.hasAnimated=!0,xe.value==="semi-radial"&&(no.value=1)),document.addEventListener("mousemove",Ta),document.addEventListener("mouseup",Da),document.addEventListener("click",wo)}),e.onUnmounted(()=>{de&&(de(),de=null),K&&cancelAnimationFrame(K),Q&&W.value&&(Q.unobserve(W.value),Q.disconnect(),Q=null),zt.value.animationId&&cancelAnimationFrame(zt.value.animationId),R&&(cancelAnimationFrame(R),R=null),ne.value.zoomTimeout&&clearTimeout(ne.value.zoomTimeout),document.removeEventListener("mousemove",Ta),document.removeEventListener("mouseup",Da),document.removeEventListener("click",wo),document.removeEventListener("click",xo)});const Ta=t=>{if(ne.value.isDragging&&ne.value.scale>1&&$l.value){Le.value.show=!1;const o=t.clientX-ne.value.lastMouseX,{minX:l,maxX:r}=Bt.value,m=r-l||1,b=o*.8;ne.value.offsetX+=b;const w=m/ne.value.scale,q=m-w,T=0,I=-q/m*P.value.width,$=T;ne.value.offsetX=Math.max(I,Math.min($,ne.value.offsetX)),ne.value.lastMouseX=t.clientX,ne.value.lastMouseY=t.clientY}},Da=()=>{ne.value.isDragging&&(ne.value.isDragging=!1,setTimeout(()=>{!ne.value.isDragging&&ne.value.isZooming},100))},Cs=(t,o)=>{const l=t.filter(w=>w!=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 w=1;w<l.length;w++){const q=l[w].x-l[w-1].x,T=l[w].y-l[w-1].y,I=Math.sqrt(q*q+T*T);m.push(I),r+=I}const v=r*o;let b=0;for(let w=0;w<m.length;w++){const q=b+m[w];if(v<=q){const T=(v-b)/m[w],I=l[w],$=l[w+1];return{x:I.x+($.x-I.x)*T,y:I.y+($.y-I.y)*T}}b=q}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":He.value,"dss-chart-fill-height":Ke.value,"dss-chart-compact":xl.value&&!fe.value}]]),style:e.normalizeStyle({width:He.value?"100%":Me.value+"px",height:Qt.value,...He.value||Ke.value?{overflow:xl.value?"visible":(fl.value,"hidden"),maxWidth:"100%",maxHeight:"100%"}:{},...gs.value,cursor:oa()}),"data-chart-type":xe.value,ref_key:"containerEl",ref:W,onWheel:Ro,onMousedown:ro,onMousemove:Ko,onMouseup:Eo,onMouseleave:To,onDblclick:lo,onContextmenu:e.withModifiers(Qo,["prevent"]),onClick:e.withModifiers(wn,["left"]),onWheelCapture:Ro},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:h},[e.createElementVNode("div",Ir,[et.value?(e.openBlock(),e.createElementBlock("div",zr,e.toDisplayString(et.value),1)):e.createCommentVNode("",!0),lt.value?(e.openBlock(),e.createElementBlock("div",Pr,e.toDisplayString(lt.value),1)):e.createCommentVNode("",!0)]),fe.value&&ze.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":tt.value==="horizontal","dss-legend-vertical":tt.value==="vertical","dss-legend-top":ze.value==="top","dss-legend-bottom":ze.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":F.value.has(r),"dss-legend-hovered":z.value===r,"dss-legend-dimmed":z.value!==null&&z.value!==r}]),onClick:m=>ma(r),onMouseenter:m=>Qn(r),onMouseleave:oo,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":vl.value&&It(l)}]),style:e.normalizeStyle({backgroundColor:vl.value&&It(l)?"transparent":Ol(l,r),borderColor:Ol(l,r)})},null,6),e.createElementVNode("span",Wr,e.toDisplayString(l.name),1)],46,Or))),128))],2)):e.createCommentVNode("",!0),fe.value&&(ze.value==="left"||ze.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":ze.value==="left","dss-legend-right":ze.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":F.value.has(r),"dss-legend-hovered":z.value===r,"dss-legend-dimmed":z.value!==null&&z.value!==r}]),onClick:m=>ma(r),onMouseenter:m=>Qn(r),onMouseleave:oo,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":vl.value&&It(l)}]),style:e.normalizeStyle({backgroundColor:vl.value&&It(l)?"transparent":Ol(l,r),borderColor:Ol(l,r)})},null,6),e.createElementVNode("span",Zr,e.toDisplayString(l.name),1)],46,qr))),128))],2)):e.createCommentVNode("",!0)],512),_.showAddMarkerButton&&cl.value&&jt.value.addMarker&&($l.value||Ot.value)&&!fl.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:to,title:e.unref(N)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Yt.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,Yr),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,Ur)):e.createCommentVNode("",!0),e.createElementVNode("div",Xr,[Ot.value&&yt.value?(e.openBlock(),e.createElementBlock("div",jr,"Bubble size: "+e.toDisplayString(yt.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Me.value,height:mt.value,class:"dss-chart-svg","data-smooth":Vt.value,"data-animated":Sl.value,ref_key:"svgEl",ref:ee},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:ge.value},[e.createElementVNode("rect",{x:0,y:P.value.top,width:Me.value,height:P.value.height*4},null,8,Qr)],8,Gr),Vn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:uo.value},[e.createElementVNode("path",{d:s.value},null,8,ei)],8,Jr)):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:u.value},[e.createElementVNode("path",{d:y.value},null,8,li)],8,ti)):e.createCommentVNode("",!0)]),$l.value||Ot.value?(e.openBlock(),e.createElementBlock("g",ni,[re.value&&!fl.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":Ae.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:P.value.left,x2:P.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,ai))),128))],8,oi)):e.createCommentVNode("",!0),fl.value&&ba.value.length?(e.openBlock(),e.createElementBlock("g",{key:1,class:"dss-stepbar-axis-bars dss-stepbar-axis-bars--y-only","clip-path":Ae.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:P.value.left,x2:P.value.right,y1:l.y,y2:l.y,stroke:Ht.value,"stroke-width":wl.value,"stroke-dasharray":jl.value,opacity:Mt.value},null,8,ri))),128))],8,si)):e.createCommentVNode("",!0),e.createElementVNode("g",ii,[e.createElementVNode("line",{x1:P.value.left,x2:P.value.right,y1:P.value.bottom,y2:P.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,ci),e.createElementVNode("line",{x1:P.value.left,x2:P.value.left,y1:P.value.top,y2:P.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,ui),Tn.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:P.value.right,x2:P.value.right,y1:P.value.top,y2:P.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,di)):e.createCommentVNode("",!0)]),e.createElementVNode("g",mi,[fl.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,pi))),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,vi))),128)),Tn.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Ya.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,fi))),128)):e.createCommentVNode("",!0),Rt.value?(e.openBlock(),e.createElementBlock("text",{key:2,x:P.value.left+P.value.width/2,y:P.value.bottom+45,"text-anchor":"middle","font-size":"14",fill:"#666"},e.toDisplayString(Rt.value),9,hi)):e.createCommentVNode("",!0),ct.value?(e.openBlock(),e.createElementBlock("text",{key:3,x:15,y:P.value.top+12+P.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(-90, 15, ${P.value.top+P.value.height/2})`},e.toDisplayString(ct.value),9,gi)):e.createCommentVNode("",!0),Tn.value&&pt.value?(e.openBlock(),e.createElementBlock("text",{key:4,x:Me.value-15,y:P.value.top+12+P.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(90, ${Me.value-15}, ${P.value.top+P.value.height/2})`},e.toDisplayString(pt.value),9,yi)):e.createCommentVNode("",!0)]),Fe.value.length>0?(e.openBlock(),e.createElementBlock("g",ki,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe.value,l=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${l.categoryIndex}`},[e.createElementVNode("g",{"clip-path":Ae.value},[l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:l.x,x2:l.x,y1:P.value.bottom,y2:P.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>_o(l,r),onMouseleave:Mo},null,40,bi)):e.createCommentVNode("",!0),l.hasAuto&&!l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:l.x,x2:l.x,y1:P.value.bottom,y2:P.value.top,stroke:"#a1d499","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>_o(l,r),onMouseleave:Mo},null,40,wi)):e.createCommentVNode("",!0),l.hasAuto&&l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:l.x,x2:l.x,y1:P.value.bottom,y2:P.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>_o(l,r),onMouseleave:Mo},null,40,xi)):e.createCommentVNode("",!0)],8,Ci),l.hasManual&&l.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x+8,cy:Math.max(15,P.value.top-10),r:"14",fill:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:r=>_o(l,r),onMouseleave:Mo},null,40,Ei)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:l.x,cy:Math.max(15,P.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=>_o(l,r),onMouseleave:Mo},null,40,Si),e.createElementVNode("text",{x:l.x,y:Math.max(15,P.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,Vi)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":Ae.value},[Xl.value?(e.openBlock(),e.createElementBlock("g",Bi,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":hl.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=>Yn(l,m),onMouseleave:Nn},null,46,_i)):(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=>Yn(l,m),onMouseleave:Nn},null,46,Mi))],64))),128))],2),e.createElementVNode("g",$i,[(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,Li))),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,Ti))),128)),ce.value>0||Ve.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:wt(l.isHighlighted?ot(l,ce.value)+2:ot(l,ce.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=>Yn(l,m),onMouseleave:Nn},null,46,Di))),128)):e.createCommentVNode("",!0)])])):xe.value==="line"?(e.openBlock(),e.createElementBlock("g",Ai,[(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":zt.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,Hi))),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,Ri))),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,Fi))),128)),ce.value>0||Ve.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:wt(l.isHighlighted?ot(l,ce.value)+2:ot(l,ce.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=>Yn(l,m),onMouseleave:Nn},null,46,Ii))),128)):e.createCommentVNode("",!0)])):xe.value==="area"?(e.openBlock(),e.createElementBlock("g",zi,[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}-${_.chartId}`},[e.createElementVNode("rect",{x:P.value.left-10,y:P.value.top-10,width:P.value.width+20,height:P.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${P.value.width+20}px`})},null,12,Oi)],8,Pi))),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?dl.value+.2:dl.value,mask:`url(#area-mask-${r}-${_.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,Wi))),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*il.value}ms`})},null,14,qi))),128))])):xe.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":hl.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=>Yn(l,m),onMouseleave:Nn},null,46,Zi)):(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=>Yn(l,m),onMouseleave:Nn},null,46,Ui))],64))),128))],2)):e.createCommentVNode("",!0)],8,Ni),Se.value&&Le.value.show&&!ne.value.isZooming&&!fl.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-crosshair","clip-path":Ae.value},[e.createElementVNode("line",{x1:Le.value.x,x2:Le.value.x,y1:P.value.top,y2:P.value.bottom,stroke:nt.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,Xi),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Le.value.data,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${r}`,cx:Le.value.x,cy:l.y,r:wt(ce.value+2),fill:l.color,stroke:"none",opacity:"0.9"},null,8,ji))),128))],8,Yi)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Ot.value?(e.openBlock(),e.createElementBlock("g",Ki,[(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",Gi,[e.createElementVNode("circle",{cx:l.x,cy:l.y,r:wt(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,Qi),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=>$e(r),onError:m=>ht(r),onMouseenter:m=>Va(l,m),onMouseleave:m=>Ba(l),onClick:m=>Sa(l,m)},null,46,Ji)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),xl.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:co.value},[xe.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Wt.value,cy:At.value,r:it.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,tc)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":xe.value,"clip-path":C.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=>Yn(l.segment,m),onMouseleave:Nn},null,42,nc))),128))],8,lc),Ql.value&&fa.value?(e.openBlock(),e.createElementBlock("g",oc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qe.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,ac)),[[e.vShow,l.show]])),128))])):e.createCommentVNode("",!0),k.value&&(fa.value||Vn.value||Zn.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:j.value.x,y:j.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":x.value,fill:Ce.value,class:"dss-radial-data-center"},e.toDisplayString(S.value),9,sc)):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,rc),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,ic),e.createElementVNode("text",{class:"dss-radial-label-text",x:l.textX,y:l.textY,"text-anchor":l.textAnchor,"font-size":yn.value,"dominant-baseline":"middle"},e.toDisplayString(l.text),9,cc)],6))),128))],2)):e.createCommentVNode("",!0)],8,ec)):e.createCommentVNode("",!0),vl.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:co.value},[re.value?(e.openBlock(),e.createElementBlock("g",dc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ll.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${r}`,cx:Wt.value,cy:At.value,r:wt(l),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*150}ms`})},null,12,mc))),128)),e.createElementVNode("g",pc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ll.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${r}`},[e.createElementVNode("rect",{x:Wt.value-16,y:At.value-l-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,vc),e.createElementVNode("text",{x:Wt.value,y:At.value-l+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(In(r)),9,fc)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_a.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${r}`,x1:Wt.value,x2:l.x,y1:At.value,y2:l.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*100}ms`})},null,12,hc))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",gc,[(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/po.value-Math.PI/2)*16,y:l.y+Math.sin(r*2*Math.PI/po.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,yc))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:ds,onMouseleave:Nn},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ma.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*il.value}ms`,transition:"all 0.2s ease"})},null,14,kc),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:wt(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*il.value+v*50}ms`,transition:"all 0.2s ease"}),onMouseover:b=>Yn(m,b),onMouseleave:Nn},null,46,Cc))),128)):e.createCommentVNode("",!0)]))),128))],32)],8,uc)):e.createCommentVNode("",!0),e.createElementVNode("g",bc,[(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:wt(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,wc))),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,xc))),128))])],8,Kr)),fl.value&&Gl.value.length?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-stepbar-chart-host",style:e.normalizeStyle(Bn.value)},[e.createElementVNode("div",{ref_key:"stepbarScrollEl",ref:A,class:"dss-stepbar-scroll",onScroll:Go},[e.createElementVNode("div",{class:"dss-stepbar-scroll-content",style:e.normalizeStyle(nn.value)},[Lt.value?(e.openBlock(),e.createElementBlock("div",Ec,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bn.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:Ht.value,borderTopWidth:`${wl.value}px`,borderTopStyle:"dashed",opacity:Mt.value})},null,4))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-stepbar-columns",style:e.normalizeStyle({gap:`${El.value}px`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Gl.value,l=>(e.openBlock(),e.createBlock(Ra,{key:l.key,class:"dss-stepbar-chart-column",style:e.normalizeStyle(Kl.value),label:l.label,segments:l.segments,"total-value":l.totalValue,"show-counter":!1,"value-label":bt.value,orientation:"vertical","label-position":"down","bar-height":yl.value,"segment-order":ae.value,"remainder-label":St.value,"inactive-color":ut.value,options:Rn.value,"disable-tooltips":""},null,8,["style","label","segments","total-value","value-label","bar-height","segment-order","remainder-label","inactive-color","options"]))),128))],4),Rl.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-stepbar-crosshair-line",style:e.normalizeStyle(dn.value)},null,4)):e.createCommentVNode("",!0)],4)],544)],4)):e.createCommentVNode("",!0)]),Bl.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:Me.value+"px",height:mt.value+"px",backgroundImage:`url('${el.value}')`,backgroundRepeat:"no-repeat",...zn.value,opacity:Zl.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gn.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:Tt.value+"px",height:Tt.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(m=>pl(l),["stop"]),onMouseenter:m=>os(l,m),onMouseleave:as},[e.createElementVNode("img",{src:ao(l),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Vc)],44,Sc)),[[e.vShow,hn.value]])),128)),Ft.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:Ft.value.x+"px",top:Ft.value.y+"px"})},[e.createElementVNode("div",Nc,e.toDisplayString(Ft.value.categoryValue),1),Ft.value.description?(e.openBlock(),e.createElementBlock("div",Bc,e.toDisplayString(Ft.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Et.value&&(Te.value.show||Se.value&&Le.value.show&&!ne.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":Se.value&&Le.value.show&&!ne.value.isZooming,"dss-spider-tooltip":vl.value&&Te.value.spiderAreas&&Te.value.spiderAreas.length>0}]),style:e.normalizeStyle(vs.value)},[!Se.value||!Le.value.show||ne.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[vl.value&&Te.value.spiderAreas&&Te.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",_c,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Te.value.spiderAreas,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-area-${r}`,class:"dss-spider-tooltip-area"},[e.createElementVNode("div",Mc,[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",$c,e.toDisplayString(m.label),1),e.createElementVNode("span",Lc,e.toDisplayString(m.value),1)]))),128))]))),128))])):Ot.value&&Te.value.bubbleData&&Te.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",Tc,[Te.value.title?(e.openBlock(),e.createElementBlock("div",Dc,e.toDisplayString(Te.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Ac,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Te.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",Hc,[e.createElementVNode("div",Rc,e.toDisplayString(Te.value.title),1),e.createElementVNode("div",Fc,e.toDisplayString(Te.value.value),1)])),Te.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[Dt(Te.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Ic,[o[5]||(o[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",zc,e.toDisplayString(e.unref(N)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dt(Te.value.categoryIndex).flagGroups,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${r}`},[e.createElementVNode("div",Pc,[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",Oc,[e.createElementVNode("div",Wc,e.toDisplayString(m.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Dt(Te.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",qc,[o[6]||(o[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Zc,e.toDisplayString(e.unref(N)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dt(Te.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",Uc,[e.createElementVNode("div",Yc,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",Xc,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",jc,[e.createElementVNode("div",Kc,e.toDisplayString(fl.value?Lo():Ot.value?ns():_.categories[Le.value.categoryIndex]||`Category ${Le.value.categoryIndex+1}`),1),Ot.value?(e.openBlock(),e.createElementBlock("div",Gc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Le.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(Le.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",Qc,e.toDisplayString(l.seriesName)+":",1),e.createElementVNode("span",Jc,e.toDisplayString(Vl(l.value)),1)]))),128))]),Dt(Le.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",eu,[o[7]||(o[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",tu,e.toDisplayString(e.unref(N)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dt(Le.value.categoryIndex).flagGroups,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${r}`},[e.createElementVNode("div",lu,[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",nu,[e.createElementVNode("div",ou,e.toDisplayString(m.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Dt(Le.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",au,[o[8]||(o[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",su,e.toDisplayString(e.unref(N)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dt(Le.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",ru,[e.createElementVNode("div",iu,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",cu,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),$l.value&&Ct.value&&ne.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:lo},[o[9]||(o[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(ne.value.scale*100))+"% "+e.toDisplayString(e.unref(N)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Fr),fe.value&&ze.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":tt.value==="horizontal","dss-legend-vertical":tt.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(Z.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":F.value.has(r),"dss-legend-hovered":z.value===r,"dss-legend-dimmed":z.value!==null&&z.value!==r}]),onClick:m=>ma(r),onMouseenter:m=>Qn(r),onMouseleave:oo,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":vl.value&&It(l)}]),style:e.normalizeStyle({backgroundColor:vl.value&&It(l)?"transparent":Ol(l,r),borderColor:Ol(l,r)})},null,6),e.createElementVNode("span",du,e.toDisplayString(l.name),1)],46,uu))),128))],2)):e.createCommentVNode("",!0),st.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:st.value.x+"px",top:st.value.y+"px"}),onClick:o[0]||(o[0]=e.withModifiers(()=>{},["stop"]))},[jt.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:Ho},e.toDisplayString(e.unref(N)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),jt.value.addMarker&&(jt.value.downloadSvg||jt.value.downloadPng||jt.value.downloadCsv||Kt.value.length>0)?(e.openBlock(),e.createElementBlock("div",mu)):e.createCommentVNode("",!0),jt.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:qn},e.toDisplayString(e.unref(N)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),jt.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:la},e.toDisplayString(e.unref(N)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),jt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:na},e.toDisplayString(e.unref(N)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Kt.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[jt.value.downloadSvg||jt.value.downloadPng||jt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",pu)):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",vu)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Do(l)),style:e.normalizeStyle(Wn(l)),onClick:m=>eo(l)},[l.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:Jo(l),class:"dss-custom-menu-content"},null,8,hu)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.icon?(e.openBlock(),e.createElementBlock("span",gu,e.toDisplayString(l.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)],64))],14,fu)],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:Il},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:o[3]||(o[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",yu,[e.createElementVNode("h3",null,e.toDisplayString(On.value?e.unref(N)("chart.modalMarker.viewMarker"):Gn.value?e.unref(N)("chart.modalMarker.editMarker"):e.unref(N)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:Il},"×")]),e.createElementVNode("div",ku,[e.createElementVNode("div",Cu,[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":Kn.value,"max-date":jo.value,disabled:On.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",bu,[e.createElementVNode("label",wu,e.toDisplayString(e.unref(N)("chart.modalMarker.description")),1),On.value?(e.openBlock(),e.createElementBlock("div",xu,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(N)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,Eu)),[[e.vModelText,Ze.value.description]])])]),e.createElementVNode("div",Su,[e.createElementVNode("div",Vu,[Gn.value&&!On.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:_n},e.toDisplayString(e.unref(N)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Nu,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:Il},e.toDisplayString(On.value?e.unref(N)("chart.modalMarker.close"):e.unref(N)("chart.modalMarker.cancel")),1),On.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:xn,disabled:!(Ze.value.description&&Ze.value.description.length)},e.toDisplayString(Gn.value?e.unref(N)("chart.modalMarker.save"):e.unref(N)("chart.contextMenu.addMarker")),9,Bu))])])])])):e.createCommentVNode("",!0)],64))}}),$u={class:"dss-modal-title"},Lu={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(_,{emit:J}){const N=_,L=J,oe=e.ref(null),W=e.ref(null),A=e.computed(()=>{const K={"max-width":N.width};return N.height!=="auto"&&(K.height=N.height,K["min-height"]="0"),K}),de=e.computed(()=>({}));function dt(){L("close-modal")}function ee(){N.backDrop&&!oe.value&&L("close-modal")}function h(K){K.target.tagName==="INPUT"&&(oe.value=K.target.tagName)}function we(){setTimeout(()=>{oe.value=null},300)}function ye(){const K=document.body,he=document.documentElement;W.value={bodyOverflow:K.style.overflow,bodyPosition:K.style.position,bodyTop:K.style.top,bodyWidth:K.style.width,htmlOverflow:he.style.overflow,scrollY:window.scrollY},K.style.overflow="hidden",K.style.position="fixed",K.style.top=`-${W.value.scrollY}px`,K.style.width="100%",K.style.left="0",he.style.overflow="hidden"}function Q(){if(!W.value)return;const K=document.body,he=document.documentElement,{bodyOverflow:Re,bodyPosition:ge,bodyTop:Ae,bodyWidth:Z,htmlOverflow:Oe,scrollY:Ye}=W.value;K.style.overflow=Re||"",K.style.position=ge||"",K.style.top=Ae||"",K.style.width=Z||"",K.style.left="",he.style.overflow=Oe||"",window.scrollTo(0,Ye||0)}return e.watch(()=>N.showModal,K=>{if(K)ye(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const he=document.getElementById("dss-modal-backdrop");he&&(he.addEventListener("focusin",h),he.addEventListener("focusout",we))},100);else{Q(),document.body.classList.remove("dss-modal-open");const he=document.getElementById("dss-modal-backdrop");he&&(he.removeEventListener("focusin",h),he.removeEventListener("focusout",we))}},{immediate:!0}),e.onUnmounted(()=>{N.showModal&&Q()}),(K,he)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[_.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:ee},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(A.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:he[0]||(he[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":_.headerType,"font-size":_.titleSize})},[e.createElementVNode("h1",$u,[e.renderSlot(K.$slots,"title",{},()=>[he[1]||(he[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(K.$slots,"title-data"),_.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:dt,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(de.value)},[e.renderSlot(K.$slots,"content",{},()=>[he[2]||(he[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Lu,[e.renderSlot(K.$slots,"actions")])])],4),[[e.vShow,_.showModal]])])):e.createCommentVNode("",!0)]))}},Tu={key:0,class:"dss-table-toolbar"},Du={class:"dss-table-toolbar-left"},Au=["aria-expanded"],Hu={class:"dss-pagination-select-dropdown",role:"listbox"},Ru={class:"dss-table-column-visibility-label"},Fu={class:"dss-table-checkbox-wrapper"},Iu=["checked","onChange"],zu={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Pu={class:"dss-table-column-visibility-text"},Ou={class:"dss-table-toolbar-right"},Wu=["placeholder","aria-label"],qu=["aria-label"],Zu=["aria-label","aria-expanded"],Uu={key:1,class:"dss-table-toolbar-extra"},Yu={class:"dss-table-thead"},Xu={key:0,class:"dss-table-th dss-table-selection-column"},ju={key:0,class:"dss-table-checkbox-wrapper"},Ku=["checked","indeterminate"],Gu={key:0,class:"dss-table-checkbox__indeterminate"},Qu={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},Ju=["aria-label"],ed=["onClick"],td={class:"dss-table-th-content"},ld={class:"dss-table-th-text"},nd={key:0},od={key:1},ad={key:2},sd=["data-filter-column-key","aria-expanded","aria-label","onClick"],rd={class:"dss-table-tbody"},id=["onClick"],cd={class:"dss-table-checkbox-wrapper"},ud=["type","name","checked","disabled","onChange"],dd={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},md={key:1,class:"dss-table-checkbox__dot"},pd=["onClick"],vd=["aria-expanded","aria-label"],fd={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},hd={key:0,class:"dss-table-expansion-row"},gd=["colspan"],yd=["colspan"],kd={key:1,class:"dss-table-pagination"},Cd={class:"dss-table-pagination-left"},bd={key:0},wd={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},xd={class:"dss-table-pagination-center"},Ed={key:0,class:"dss-pagination-controls"},Sd=["disabled","title"],Vd=["disabled","title"],Nd=["aria-label","onKeydown"],Bd={class:"dss-pagination-of"},_d=["disabled","title"],Md=["disabled","title"],$d={class:"dss-table-pagination-right"},Ld={class:"dss-pagination-rows-label"},Td=["aria-expanded"],Dd=["aria-selected","onClick"],Ad={key:0,class:"dss-table-filter-row"},Hd=["value","placeholder"],Rd=["min","max","value"],Fd=["min","max","value"],Id={class:"dss-table-filter-double-range-values"},zd={key:2,class:"dss-table-filter-daterange"},Pd={class:"dss-table-filter-daterange-row"},Od={class:"dss-table-filter-daterange-label"},Wd=["value"],qd={class:"dss-table-filter-daterange-row"},Zd={class:"dss-table-filter-daterange-label"},Ud=["value"],Yd=["value","placeholder"],Xd={class:"dss-table-filter-list"},jd=["checked","onChange"],Kd={class:"dss-table-filter-actions"},Gd={name:"DSSTable"},Qd=Object.assign(Gd,{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:_=>typeof _=="object"&&_!==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(_,{emit:J}){const{t:N,locale:L}=ho.useI18n(),oe=_,W=J,A={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 de(f,g){const E=Object.assign({},f);return dt(f)&&dt(g)&&Object.keys(g).forEach(F=>{dt(g[F])?F in f?E[F]=de(f[F],g[F]):Object.assign(E,{[F]:g[F]}):Object.assign(E,{[F]:g[F]})}),E}function dt(f){return f&&typeof f=="object"&&!Array.isArray(f)}const ee=e.computed(()=>de(A,oe.options)),h=e.computed(()=>{const f=ee.value.table.width;return f==="auto"?null:typeof f=="number"?f:null}),we=e.computed(()=>ee.value.table.height),ye=e.computed(()=>ee.value.table.rowHeight??"auto"),Q=e.computed(()=>({height:ye.value})),K=e.computed(()=>ee.value.table.expandable===!0),he=e.computed(()=>ee.value.table.expandableRowData??null),Re=e.computed(()=>ee.value.table.expandableRowCondition??null),ge=e.computed(()=>ee.value.table.truncated===!0),Ae=e.computed(()=>ee.value.table.striped),Z=e.computed(()=>ee.value.table.bordered),Oe=e.computed(()=>ee.value.table.hoverable),Ye=e.computed(()=>ee.value.table.size),_e=e.computed(()=>ee.value.table.align||"left");e.computed(()=>ee.value.title.text),e.computed(()=>ee.value.subtitle.text);const Xe=e.computed(()=>ee.value.selection.enabled),U=e.computed(()=>ee.value.selection.mode),He=e.computed(()=>ee.value.selection.rowCondition??null),Ke=e.computed(()=>ee.value.sorting.enabled),ke=e.computed(()=>ee.value.sorting.mode),Me=e.computed(()=>ee.value.pagination.enabled),rt=e.computed(()=>ee.value.pagination.rows),gt=e.computed(()=>ee.value.pagination.rowsPerPageOptions),mt=e.computed(()=>ee.value.pagination.showCounter!==!1),Qt=e.computed(()=>ee.value.pagination.showControlsGroup),xe=e.computed(()=>Qt.value===!1?!1:ee.value.pagination.showControls!==!1),Jt=e.computed(()=>Qt.value===!1?!1:ee.value.pagination.showRowsPerPage!==!1),et=e.computed(()=>Me.value&&(mt.value||xe.value||Jt.value)),lt=e.computed(()=>ee.value.scrollable),yt=e.computed(()=>ee.value.emptyMessage||N("table.emptyMessage")),Rt=e.computed(()=>ee.value.toolbar?.downloads?.pdf!==!1),ct=e.computed(()=>ee.value.toolbar?.downloads?.excel!==!1),xt=e.computed(()=>ee.value.toolbar?.search!==!1),pt=e.computed(()=>Rt.value||ct.value||xt.value||Xt.value),Xt=e.computed(()=>ee.value.toolbar?.columnVisibility!==!1),kt=e.ref(""),Pt=e.ref(!1),pe=e.ref(null);let H=null;function Y(){Pt.value?(H&&(clearTimeout(H),H=null),Pt.value=!1,kt.value="",W("search",""),pe.value?.blur()):(Pt.value=!0,H=setTimeout(()=>{H=null,pe.value?.focus()},80))}function re(){kt.value||(Pt.value=!1)}function fe(){kt.value="",W("search",""),pe.value?.focus()}const ze=e.computed(()=>({"dss-table-striped":Ae.value,"dss-table-bordered":Z.value,"dss-table-hoverable":Oe.value,[`dss-table-${Ye.value}`]:Ye.value!=="default","dss-table-truncated":ge.value})),tt=(f,g)=>f?.field??f?.key??g,Et=e.ref(new Set);function Se(){const f=new Set;return oe.columns.forEach((g,E)=>{g?.hidden!==!0&&f.add(tt(g,E))}),f}function nt(){const f=new Set;return oe.columns.forEach((g,E)=>{f.add(tt(g,E))}),f}function Ct(f){if(!Array.isArray(f))return null;const g=nt(),E=[];return f.forEach(F=>{g.has(F)&&E.push(F)}),E}function tl(){Et.value=Se()}const ie=e.computed(()=>{const f=Ct(oe.columnVisibility);return f===null?null:new Set(f)}),X=e.computed(()=>ie.value??Et.value),te=e.computed(()=>oe.columns.filter((f,g)=>X.value.has(tt(f,g)))),ce=f=>{const g=oe.columns.findIndex(E=>E===f);return tt(f,g>=0?g:0)},Ve=(f,g)=>X.value.has(tt(f,g));function ot(f){W("update:columnVisibility",Array.from(f))}function wt(f,g){const E=tt(f,g),F=new Set(X.value);F.has(E)?F.delete(E):F.add(E),ie.value===null&&(Et.value=F),ot(F)}const dl=e.ref(null),Vt=e.ref(!1);function sl(f){dl.value&&!dl.value.contains(f.target)&&(Vt.value=!1)}const D=e.computed(()=>te.value.length+(Xe.value?1:0)+(K.value?1:0)),V=(f,g)=>f?.id??f?.key??g,B=e.ref(new Set),ae=e.ref(null),se=(f,g)=>B.value.has(V(f,g)),je=(f,g)=>{if(!K.value)return!1;if(typeof Re.value=="function")return!!Re.value(f,g);if(typeof he.value=="string"&&he.value.trim()){const E=qe(f,he.value.trim());return Array.isArray(E)?E.length>0:E&&typeof E=="object"?Object.keys(E).length>0:E!=null&&E!==""}return!0},St=(f,g,E)=>{if(E&&E.stopPropagation(),!je(f,g))return;const F=V(f,g),z=new Set(B.value);z.has(F)?(z.delete(F),W("row-collapse",{data:f,index:g})):(z.add(F),W("row-expand",{data:f,index:g})),B.value=z},ut=(f,g)=>{if(!ge.value)return;const E=V(f,g);ae.value!==E&&(ae.value=E)},Ge=e.ref(null),_t=e.ref(0),Nt=e.ref([]),vt=f=>{if(ke.value==="single")return Ge.value===f.field?_t.value:0;{const g=Nt.value.find(E=>E.field===f.field);return g?g.order:0}},Lt=f=>{const g=vt(f);return{"dss-sort-active":g!==0,"dss-sort-asc":g===1,"dss-sort-desc":g===-1}},Ht=e.ref({}),Mt=e.ref(null),wl=e.ref(null),jl=220,El=e.ref(null),rl=e.computed(()=>te.value.find(f=>ce(f)===Mt.value)??null),ml=e.computed(()=>{if(!rl.value||rl.value.filter!=="range")return null;const f=rl.value,g=Mt.value,{min:E,max:F}=mn(f),z=f.filterMin??E,Qe=f.filterMax??F,Te=zl(g),Ft=Te.min??z,Le=Te.max??Qe,st=Qe-z,ne=st===0?0:(Ft-z)/st*100,ll=st===0?100:(Le-z)/st*100;return{rangeMin:z,rangeMax:Qe,currentMin:Ft,currentMax:Le,minPct:ne,maxPct:ll}}),un=e.ref(null),yl=e.ref("max");function ft(f){const g=un.value,E=ml.value;if(!g||!E)return;const F=g.getBoundingClientRect(),Qe=(f.clientX-F.left)/F.width*100,Te=(E.minPct+E.maxPct)/2;yl.value=Qe<Te?"min":"max"}function zl(f){return Ht.value[f]??{}}function Kl(f,g){Ht.value={...Ht.value,[f]:g}}function Hl(f){const g=Ht.value[f];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 Rn(f){const g={...Ht.value};delete g[f],Ht.value=g,Mt.value=null,wl.value=null}function Gl(){if(!Mt.value){wl.value=null;return}const f=El.value;if(!f)return;const g=f.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${Mt.value}"]`);if(!g)return;const E=g.getBoundingClientRect();wl.value={top:E.bottom+6,left:Math.max(8,E.right-jl)}}const bn=e.computed(()=>{const f=String(kt.value??"").trim().toLowerCase();return f?oe.data.filter(g=>te.value.some(E=>nn(Ce(g,E)).some(z=>String(z).toLowerCase().includes(f)))):oe.data}),Bn=e.computed(()=>{let f=[...bn.value];const g=(kt.value??"").trim().toLowerCase();return g&&(f=f.filter(E=>oe.columns.some(F=>{if(!F||!F.field)return!1;const z=Ce(E,F);return String(z??"").toLowerCase().includes(g)}))),te.value.forEach(E=>{const F=ce(E),z=Ht.value[F];if(!z)return;const Qe=E.field;if(Qe){if(z.type==="string"&&z.value?.trim()){const Te=z.value.trim().toLowerCase();f=f.filter(Ft=>{const Le=Ce(Ft,E);return String(Le??"").toLowerCase().includes(Te)})}else if(z.type==="range")f=f.filter(Te=>{const Ft=qe(Te,Qe),Le=Number(Ft);return!(Number.isNaN(Le)||z.min!=null&&Le<z.min||z.max!=null&&Le>z.max)});else if(z.type==="dateRange"){const Te=z.from?new Date(z.from).getTime():null,Ft=z.to?new Date(z.to).getTime():null;f=f.filter(Le=>{const st=qe(Le,Qe),ne=st?new Date(st).getTime():NaN;return!(Number.isNaN(ne)||Te!=null&&ne<Te||Ft!=null&&ne>Ft)})}else if(z.type==="list"&&z.selected?.length){const Te=new Set(z.selected);f=f.filter(Ft=>nn(Ce(Ft,E)).some(st=>Te.has(st)))}}}),f});function nn(f){if(f==null)return[""];if(Array.isArray(f))return f.flatMap(nn);if(typeof f=="object"){const g=f?.label??f?.name??f?.value??f?.title;return[g!=null?String(g):String(f)]}return[String(f)]}function Rl(f){const g=new Set;return oe.data.forEach(E=>{nn(Ce(E,f)).forEach(z=>g.add(z))}),Array.from(g).sort((E,F)=>String(E).localeCompare(String(F)))}function dn(f,g){if(Mt.value===f){Mt.value=null,wl.value=null;return}if(Mt.value=f,g?.currentTarget){const E=g.currentTarget.getBoundingClientRect();wl.value={top:E.bottom+6,left:Math.max(8,E.right-jl)}}else Gl()}function Sl(f,g){Kl(f,{type:"string",value:g})}function mn(f){const g=f.field;if(!g)return{min:0,max:100};let E=1/0,F=-1/0;return oe.data.forEach(z=>{const Qe=qe(z,g),Te=Number(Qe);Number.isNaN(Te)||(E=Math.min(E,Te),F=Math.max(F,Te))}),{min:E===1/0?0:E,max:F===-1/0?100:F}}function Wl(f,g,E){const F={...zl(f),type:"range"},z=E===""?null:Number(E),Qe=z===null||Number.isNaN(z)?null:z;F[g]=Qe,Qe!=null&&(g==="min"&&F.max!=null&&Qe>F.max&&(F.max=Qe),g==="max"&&F.min!=null&&Qe<F.min&&(F.min=Qe)),Kl(f,F)}function pn(f,g,E){const F={...zl(f),type:"dateRange"};F[g]=E||"",Kl(f,F)}const on=e.reactive({});function il(f,g){on[f]=g}function jn(f){const g=ce(f),E=(on[g]??"").trim().toLowerCase(),F=Rl(f);return E?F.filter(z=>String(z).toLowerCase().includes(E)):F}function Fn(f,g){return(zl(f).selected??[]).includes(g!=null?String(g):"")}function ql(f,g){const F=[...zl(f).selected??[]],z=g!=null?String(g):"",Qe=F.indexOf(z);Qe>=0?F.splice(Qe,1):F.push(z),Kl(f,{type:"list",selected:F})}function vn(f){Mt.value&&!f.target.closest(".dss-table-filter-wrap")&&!f.target.closest(".dss-table-filter-dropdown")&&(Mt.value=null,wl.value=null)}function Ll(){Gl(),Kt.value&&Nl()}const In=f=>{if(!(f.sortable===!1||!Ke.value))if(ke.value==="single")Ge.value===f.field?_t.value=_t.value===1?-1:_t.value===-1?0:1:(Ge.value=f.field,_t.value=1),_t.value===0&&(Ge.value=null),W("sort",{field:Ge.value,order:_t.value});else{const g=Nt.value.findIndex(E=>E.field===f.field);g>=0?Nt.value[g].order===1?Nt.value[g].order=-1:Nt.value.splice(g,1):Nt.value.push({field:f.field,order:1}),W("sort",{multiSortMeta:Nt.value})}},fn=e.computed(()=>{if(!Ke.value)return Bn.value;let f=[...Bn.value];return ke.value==="single"&&Ge.value&&_t.value!==0?f.sort((g,E)=>{const F=qe(g,Ge.value),z=qe(E,Ge.value);return F===z?0:F==null?1:z==null?-1:(F<z?-1:F>z?1:0)*_t.value}):ke.value==="multiple"&&Nt.value.length>0&&f.sort((g,E)=>{for(const F of Nt.value){const z=qe(g,F.field),Qe=qe(E,F.field);if(z===Qe)continue;if(z==null)return 1;if(Qe==null)return-1;const Te=z<Qe?-1:z>Qe?1:0;if(Te!==0)return Te*F.order}return 0}),f}),cl=e.ref(0),jt=e.ref(rt.value),Kt=e.ref(!1),Yt=e.ref(null),Tl=e.ref(null),Tt=e.ref("bottom"),bt=e.ref(null),Vl=f=>{jt.value=f,Kt.value=!1,cl.value=0,W("page",{page:0,rows:jt.value})};function hn(f){Yt.value&&!Yt.value.contains(f.target)&&(Kt.value=!1)}function Nl(){const f=Yt.value,g=Tl.value;if(!f||!g)return;const E=f.querySelector(".dss-pagination-select-dropdown");if(!E)return;const F=g.getBoundingClientRect(),z=E.offsetHeight||0,Te=(window.innerHeight||document.documentElement.clientHeight)-F.bottom,Ft=F.top;Tt.value=Te<z+8&&Ft>Te?"top":"bottom",bt.value={width:`${Math.ceil(F.width)}px`,left:`${Math.max(0,Math.round(g.offsetLeft))}px`}}const gn=e.computed(()=>fn.value.length),Bl=e.computed(()=>Math.ceil(gn.value/jt.value)),Zl=e.computed(()=>Math.max(Bl.value,1)),an=e.computed(()=>gn.value===0?0:Gt.value+1),Dl=e.computed(()=>zn.value),Gt=e.computed(()=>Me.value?cl.value*jt.value:0),zn=e.computed(()=>Me.value?Math.min((cl.value+1)*jt.value,gn.value):gn.value),Pl=e.computed(()=>{if(!Me.value)return fn.value;const f=Gt.value,g=zn.value;return fn.value.slice(f,g)}),Dt=e.ref(new Set),Pn=e.computed(()=>fn.value.filter((f,g)=>Dt.value.has(V(f,g)))),el=(f,g)=>{const E=He.value;return typeof E!="function"?!0:!!E(f,g)},_l=e.computed(()=>fn.value.map((f,g)=>({row:f,index:g})).filter(({row:f,index:g})=>el(f,g))),yn=e.computed(()=>{const f=_l.value;return f.length===0?!1:f.every(({row:g,index:E})=>Dt.value.has(V(g,E)))}),sn=e.computed(()=>{const f=_l.value;if(f.length===0)return!1;const g=f.filter(({row:E,index:F})=>Dt.value.has(V(E,F))).length;return g>0&&g<f.length}),Fl=(f,g)=>Dt.value.has(V(f,g)),ul=()=>{if(yn.value)Dt.value=new Set,W("unselect-all");else{const f=new Set;_l.value.forEach(({row:g,index:E})=>f.add(V(g,E))),Dt.value=f,W("select-all",Pn.value)}},Ql=(f,g)=>{if(!el(f,g))return;const E=V(f,g),F=new Set(Dt.value),z=F.has(E);U.value==="single"?z?(F.delete(E),W("row-unselect",f)):(F.clear(),F.add(E),W("row-select",f)):z?(F.delete(E),W("row-unselect",f)):(F.add(E),W("row-select",f)),Dt.value=F},Ul=e.ref("1"),k=()=>{const f=Number.parseInt(String(Ul.value),10);if(!Number.isFinite(f)){Ul.value=String(cl.value+1);return}const g=Math.min(Zl.value,Math.max(1,f));g!==cl.value+1?S(g-1):Ul.value=String(g)},S=f=>{f<0||f>=Bl.value||(cl.value=f,W("page",{page:f,rows:jt.value}))},x=(f,g,E)=>{W("row-click",{data:f,index:g,originalEvent:E}),ut(f,Gt.value+g)},j=(f,g)=>{const E=Gt.value+g;return{"dss-table-row-selected":Fl(f,E),"dss-table-row-even":g%2===0,"dss-table-row-odd":g%2!==0,"dss-table-row-truncated-clickable":ge.value,"dss-table-row-truncated-expanded":ae.value===V(f,E)}},Ce=(f,g)=>g.field?qe(f,g.field):"",qe=(f,g)=>g.split(".").reduce((E,F)=>E&&E[F],f),Fe=f=>{const g=f.align??_e.value;return{"dss-table-sortable":f.sortable!==!1&&Ke.value,"dss-table-align-left":g==="left","dss-table-align-center":g==="center","dss-table-align-right":g==="right",[f.className]:f.className}},at=f=>{const g={};return f.width&&(g.width=typeof f.width=="number"?`${f.width}px`:f.width),f.minWidth&&(g.minWidth=typeof f.minWidth=="number"?`${f.minWidth}px`:f.minWidth),f.maxWidth&&(g.maxWidth=typeof f.maxWidth=="number"?`${f.maxWidth}px`:f.maxWidth),g};return e.watch(()=>oe.locale,f=>{f&&f!==L.value&&(L.value=f)},{immediate:!0}),e.watch(rt,f=>{jt.value=f,cl.value=0}),e.watch(Kt,async f=>{f&&(await e.nextTick(),Nl())}),e.watch(cl,f=>{Ul.value=String(f+1)},{immediate:!0}),e.watch(kt,f=>{W("search",f??"")}),e.watch(()=>oe.columns,()=>{if(ie.value===null){tl();return}const f=Ct(oe.columnVisibility)??[];f.length!==oe.columnVisibility.length&&W("update:columnVisibility",f)},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",hn),document.addEventListener("click",sl),document.addEventListener("click",vn),window.addEventListener("resize",Ll),window.addEventListener("scroll",Ll,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",hn),document.removeEventListener("click",sl),document.removeEventListener("click",vn),window.removeEventListener("resize",Ll),window.removeEventListener("scroll",Ll,!0)}),(f,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:El,style:e.normalizeStyle({width:h.value+"px",height:we.value?we.value+"px":"auto"})},[pt.value?(e.openBlock(),e.createElementBlock("div",Tu,[e.createElementVNode("div",Du,[Rt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:g[0]||(g[0]=E=>W("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(N)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),ct.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:g[1]||(g[1]=E=>W("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(N)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),Xt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:dl},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Vt.value}]),onClick:g[2]||(g[2]=E=>Vt.value=!Vt.value),"aria-expanded":Vt.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(N)("table.columnVisibility"))+" ",1),g[24]||(g[24]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Au),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Hu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.columns,(E,F)=>(e.openBlock(),e.createElementBlock("li",{key:tt(E,F),role:"option",class:"dss-table-column-visibility-option",onClick:g[3]||(g[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",Ru,[e.createElementVNode("span",Fu,[e.createElementVNode("input",{type:"checkbox",checked:Ve(E,F),onChange:z=>wt(E,F),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Iu),Ve(E,F)?(e.openBlock(),e.createElementBlock("span",zu,[...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",Pu,e.toDisplayString(E.header),1)])]))),128))],512),[[e.vShow,Vt.value]])]),_:1})],512)):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"header")]),e.createElementVNode("div",Ou,[xt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":Pt.value||kt.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:pe,"onUpdate:modelValue":g[4]||(g[4]=E=>kt.value=E),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(N)("table.searchPlaceholder"),"aria-label":e.unref(N)("table.searchTableAriaLabel"),onFocus:g[5]||(g[5]=E=>Pt.value=!0),onBlur:re},null,40,Wu),[[e.vModelText,kt.value]]),kt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":e.unref(N)("table.clearSearchAriaLabel"),onClick:fe},[...g[26]||(g[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,qu)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref(N)("table.searchAriaLabel"),"aria-expanded":Pt.value||!!kt.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,Zu)],2)):e.createCommentVNode("",!0),f.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",Uu,[e.renderSlot(f.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":lt.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",ze.value])},[e.createElementVNode("thead",Yu,[e.createElementVNode("tr",null,[Xe.value?(e.openBlock(),e.createElementBlock("th",Xu,[U.value==="multiple"?(e.openBlock(),e.createElementBlock("span",ju,[e.createElementVNode("input",{type:"checkbox",checked:yn.value,indeterminate:sn.value,onChange:ul,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Ku),sn.value?(e.openBlock(),e.createElementBlock("span",Gu)):yn.value?(e.openBlock(),e.createElementBlock("span",Qu,[...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),K.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:"dss-table-th dss-table-expansion-column","aria-label":e.unref(N)("table.expandRowAriaLabel")},null,8,Ju)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,(E,F)=>(e.openBlock(),e.createElementBlock("th",{key:ce(E),class:e.normalizeClass(["dss-table-th",Fe(E)]),style:e.normalizeStyle(at(E)),onClick:z=>In(E)},[e.createElementVNode("div",td,[e.createElementVNode("span",ld,e.toDisplayString(E.header),1),E.sortable!==!1&&Ke.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",Lt(E)])},[vt(E)===0?(e.openBlock(),e.createElementBlock("span",nd,[...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)])])):vt(E)===1?(e.openBlock(),e.createElementBlock("span",od,[...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)])])):vt(E)===-1?(e.openBlock(),e.createElementBlock("span",ad,[...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),E.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":Mt.value===ce(E)}]),onClick:g[6]||(g[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":Hl(ce(E))}]),"data-filter-column-key":ce(E),"aria-expanded":Mt.value===ce(E),"aria-label":e.unref(N)("table.filterColumnAriaLabel"),onClick:z=>dn(ce(E),z)},[...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,sd)],2)):e.createCommentVNode("",!0)])],14,ed))),128))])]),e.createElementVNode("tbody",rd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pl.value,(E,F)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:V(E,Gt.value+F)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",j(E,F)]),style:e.normalizeStyle(Q.value),onClick:z=>x(E,F,z)},[Xe.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",cd,[e.createElementVNode("input",{type:U.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${_.tableId}`,checked:Fl(E,Gt.value+F),disabled:!el(E,Gt.value+F),onChange:z=>Ql(E,Gt.value+F),class:e.normalizeClass(["dss-table-checkbox",U.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio",{"dss-table-checkbox--disabled":!el(E,Gt.value+F)}])},null,42,ud),U.value==="multiple"&&Fl(E,Gt.value+F)?(e.openBlock(),e.createElementBlock("span",dd,[...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)])])):U.value==="single"&&Fl(E,Gt.value+F)?(e.openBlock(),e.createElementBlock("span",md)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),K.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(z=>St(E,Gt.value+F,z),["stop"])},[je(E,Gt.value+F)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":se(E,Gt.value+F),"aria-label":se(E,Gt.value+F)?e.unref(N)("table.collapseRowAriaLabel"):e.unref(N)("table.expandRowAriaLabel")},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":se(E,Gt.value+F)}]),"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,vd)):(e.openBlock(),e.createElementBlock("span",fd))],8,pd)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,(z,Qe)=>(e.openBlock(),e.createElementBlock("td",{key:ce(z),class:e.normalizeClass(["dss-table-td",Fe(z)]),style:e.normalizeStyle(at(z))},[e.renderSlot(f.$slots,`cell-${z.field}`,{data:E,column:z,rowIndex:F,isExpanded:ae.value===V(E,Gt.value+F)},()=>[e.createTextVNode(e.toDisplayString(Ce(E,z)),1)])],6))),128))],14,id),K.value&&je(E,Gt.value+F)&&se(E,Gt.value+F)?(e.openBlock(),e.createElementBlock("tr",hd,[e.createElementVNode("td",{colspan:D.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(f.$slots,"expansion",{data:E,rowIndex:F})],8,gd)])):e.createCommentVNode("",!0)],64))),128)),Pl.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(Q.value)},[e.createElementVNode("td",{colspan:D.value,class:"dss-table-empty-cell"},[e.renderSlot(f.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(yt.value),1)])],8,yd)],4))])],2)],2),et.value?(e.openBlock(),e.createElementBlock("div",kd,[e.createElementVNode("div",Cd,[mt.value?(e.openBlock(),e.createElementBlock("span",bd,e.toDisplayString(e.unref(N)("table.showingRange",{start:an.value,end:Dl.value,total:gn.value})),1)):(e.openBlock(),e.createElementBlock("span",wd," "))]),e.createElementVNode("div",xd,[xe.value?(e.openBlock(),e.createElementBlock("div",Ed,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:cl.value===0,onClick:g[8]||(g[8]=E=>S(0)),title:e.unref(N)("table.firstPage")},[...g[35]||(g[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,Sd),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:cl.value===0,onClick:g[9]||(g[9]=E=>S(cl.value-1)),title:e.unref(N)("table.previousPage")}," ‹ ",8,Vd),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":g[10]||(g[10]=E=>Ul.value=E),type:"text",class:"dss-pagination-page-input","aria-label":e.unref(N)("table.currentPageAriaLabel"),onBlur:k,onKeydown:e.withKeys(e.withModifiers(k,["prevent"]),["enter"])},null,40,Nd),[[e.vModelText,Ul.value]]),e.createElementVNode("span",Bd,e.toDisplayString(e.unref(N)("table.ofPages",{total:Zl.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:cl.value>=Bl.value-1,onClick:g[11]||(g[11]=E=>S(cl.value+1)),title:e.unref(N)("table.nextPage")}," › ",8,_d),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:cl.value>=Bl.value-1,onClick:g[12]||(g[12]=E=>S(Bl.value-1)),title:e.unref(N)("table.lastPage")},[...g[36]||(g[36]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,Md)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",$d,[Jt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:Yt},[e.createElementVNode("span",Ld,e.toDisplayString(e.unref(N)("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]=E=>Kt.value=!Kt.value),"aria-expanded":Kt.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:Tl},[e.createTextVNode(e.toDisplayString(jt.value)+" ",1),g[37]||(g[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Td),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":Tt.value==="top"}]),style:e.normalizeStyle(bt.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gt.value,E=>(e.openBlock(),e.createElementBlock("li",{key:E,role:"option","aria-selected":E===jt.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":E===jt.value}]),onClick:F=>Vl(E)},e.toDisplayString(E),11,Dd))),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(wl.value?{top:wl.value.top+"px",left:wl.value.left+"px",width:jl+"px"}:void 0),onClick:g[21]||(g[21]=e.withModifiers(()=>{},["stop"]))},[rl.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[rl.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",Ad,[e.createElementVNode("input",{type:"text",value:zl(Mt.value).value??"",onInput:g[14]||(g[14]=E=>Sl(Mt.value,E.target.value)),class:"dss-table-filter-input",placeholder:e.unref(N)("table.search")},null,40,Hd)])):rl.value.filter==="range"&&ml.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":ml.value.minPct+"%","--range-max-pct":ml.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:un,class:"dss-table-filter-double-range-track",onMousemove:ft,onMouseenter:ft},[e.createElementVNode("input",{type:"range",min:ml.value.rangeMin,max:ml.value.rangeMax,value:ml.value.currentMin,onInput:g[15]||(g[15]=E=>Wl(Mt.value,"min",E.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:yl.value==="min"?2:1})},null,44,Rd),e.createElementVNode("input",{type:"range",min:ml.value.rangeMin,max:ml.value.rangeMax,value:ml.value.currentMax,onInput:g[16]||(g[16]=E=>Wl(Mt.value,"max",E.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:yl.value==="max"?2:1})},null,44,Fd)],544),e.createElementVNode("div",Id,e.toDisplayString(ml.value.currentMin)+" – "+e.toDisplayString(ml.value.currentMax),1)],4)):rl.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",zd,[e.createElementVNode("div",Pd,[e.createElementVNode("label",Od,e.toDisplayString(e.unref(N)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:zl(Mt.value).from??"",onInput:g[17]||(g[17]=E=>pn(Mt.value,"from",E.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Wd)]),e.createElementVNode("div",qd,[e.createElementVNode("label",Zd,e.toDisplayString(e.unref(N)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:zl(Mt.value).to??"",onInput:g[18]||(g[18]=E=>pn(Mt.value,"to",E.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Ud)])])):rl.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:on[Mt.value]??"",onInput:g[19]||(g[19]=E=>il(Mt.value,E.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(N)("table.search")},null,40,Yd),e.createElementVNode("div",Xd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(jn(rl.value),E=>(e.openBlock(),e.createElementBlock("label",{key:E,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:Fn(Mt.value,E),onChange:F=>ql(Mt.value,E)},null,40,jd),e.createElementVNode("span",null,e.toDisplayString(E),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",Kd,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:g[20]||(g[20]=E=>Rn(Mt.value))},e.toDisplayString(e.unref(N)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,Mt.value&&rl.value&&wl.value]])]),_:1})]))],64))}}),Jd="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",e1="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",t1="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",l1="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",n1="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",o1="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",a1={class:"dss-toolbar-left"},s1=["title"],r1=["title"],i1={class:"dss-toolbar-dropdown-wrapper"},c1=["title"],u1=["src"],d1=["src"],m1=["src"],p1=["src"],v1=["src"],f1=["src"],h1={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},g1=["src"],y1=["src"],k1=["src"],C1=["src"],b1=["src"],w1=["src"],x1=["title"],E1=["title"],S1=["title"],V1=["title"],N1=["title"],B1=["title"],_1=["title"],M1=["title"],$1=["title"],L1={key:2,class:"dss-toolbar-separator"},T1=["title"],D1={key:4,class:"dss-toolbar-separator"},A1={key:5,class:"dss-toolbar-dropdown-wrapper"},H1=["title"],R1={class:"dss-toolbar-dropdown-ai"},F1={class:"dss-toolbar-right"},I1={key:0,class:"dss-toolbar-custom-group"},z1={key:1,class:"dss-toolbar-separator"},P1={class:"dss-link-modal-content"},O1={class:"dss-link-modal-field"},W1={class:"dss-link-modal-label"},q1=["placeholder"],Z1={class:"dss-link-modal-field"},U1={class:"dss-link-modal-label"},Y1=["placeholder"],X1={class:"dss-image-modal-tabs"},j1={key:0,class:"dss-image-tab-content"},K1={class:"dss-link-modal-content"},G1={class:"dss-link-modal-field"},Q1={key:0,class:"dss-link-modal-label"},J1=["src"],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={key:1,class:"dss-image-tab-content"},um={class:"dss-link-modal-content"},dm={class:"dss-link-modal-field"},mm={class:"dss-link-modal-label"},pm=["placeholder"],vm={class:"dss-link-modal-field"},fm={class:"dss-link-modal-label"},hm=["placeholder"],gm={class:"dss-link-modal-field"},ym={class:"dss-link-modal-label"},km=["placeholder"],Cm={class:"dss-link-modal-field"},bm={class:"dss-link-modal-label"},wm=["placeholder"],xm={class:"dss-text-editor-title-input-container"},Em={key:0,class:"dss-text-editor-title-preview"},Sm={key:0},Vm={key:1,class:"dss-text-editor-preview-placeholder"},Nm=["value","placeholder","disabled"],Bm={key:3,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},_m={class:"dss-text-editor-description-input-container"},Mm={key:0,class:"dss-text-editor-description-preview"},$m={key:0},Lm={key:1,class:"dss-text-editor-preview-placeholder"},Tm=["value","placeholder","disabled"],Dm={key:5,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},Am=["data-comment-id","onMouseenter"],Hm=["onClick"],Rm=["src","alt"],Fm={key:1},Im=["onClick"],zm=["src","alt"],Pm={key:1},Om=["data-has-second-user","onClick"],Wm={class:"editor-comment-marker-count"},qm={key:7,class:"dss-text-editor-textarea-wrapper"},Zm=["value","placeholder","rows","disabled"],Um={class:"dss-text-editor-footer"},Ym={class:"dss-text-editor-footer-content"},Xm={class:"dss-text-editor-footer-stat"},jm={class:"dss-text-editor-footer-stat"},Km={key:8,class:"dss-text-editor-content-wrapper"},Gm={key:0,class:"dss-comment-overlay-body"},Qm={class:"dss-comment-selection-wrapper"},Jm=["innerHTML"],e2={class:"dss-comment-messages-wrapper"},t2={key:0,class:"dss-comment-avatar-wrapper"},l2={class:"dss-comment-avatar"},n2=["src","alt"],o2={key:1},a2={class:"dss-comment-header"},s2={class:"dss-comment-header-text"},r2={class:"dss-comment-author"},i2={key:0,class:"dss-comment-date"},c2=["onClick","title"],u2={class:"dss-comment-overlay-inner"},d2=["placeholder","onKeydown"],m2={class:"dss-text-editor-footer"},p2={class:"dss-text-editor-footer-content"},v2={class:"dss-text-editor-footer-stat"},f2={class:"dss-text-editor-footer-stat"},h2=["title"],g2=["title"],y2={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:""},k2={class:"dss-image-popup-content"},C2={key:0,class:"dss-image-popup-no-alt-icon"},b2=["title"],w2=["title"],x2={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:""},E2={class:"dss-toolbar-left"},S2=["title"],V2=["title"],N2={class:"dss-toolbar-dropdown-wrapper"},B2=["title"],_2=["src"],M2=["src"],$2=["src"],L2=["src"],T2=["src"],D2=["src"],A2={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},H2=["title"],R2=["title"],F2=["title"],I2=["title"],z2=["title"],P2=["title"],O2=["title"],W2=["title"],q2=["title"],Z2={key:2,class:"dss-toolbar-separator"},U2=["title"],Y2={key:4,class:"dss-toolbar-separator"},X2={key:5,class:"dss-toolbar-dropdown-wrapper"},j2=["title"],K2={class:"dss-toolbar-dropdown-ai"},G2={key:0,class:"dss-toolbar-right"},Q2={key:0,class:"dss-toolbar-separator"},J2={key:0,class:"dss-toolbar-custom-group"},ep={key:1,class:"dss-toolbar-separator"},tp={name:"DSSTextEditor"},lp=Object.assign(tp,{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:_=>typeof _=="object"&&_!==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:_=>typeof _=="object"&&_!==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(_,{expose:J,emit:N}){const{t:L,locale:oe}=ho.useI18n(),W={h1:Jd,h2:e1,h3:t1,h4:l1,h5:n1,h6:o1},A=_,de=N,dt=e.useSlots(),ee=`<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),wn()}catch(t){console.error("Error downloading CSV:",t)}},eo=t=>{if(typeof t.action=="function"){const o={series:Z.series,categories:Z.categories,markers:ll.value},l={chartX:st.value.chartX,chartY:st.value.chartY,dataX:st.value.mouseDataX,dataY:st.value.mouseDataY,categoryIndex:clampedCategoryIndex||st.value.categoryIndex};t.action(o,l)}wn()},Ho=()=>{Il(),Ze.value.show=!0,Ze.value.categoryIndex=st.value.categoryIndex,Ze.value.fromButton=!1,wn()},to=()=>{Il(),Ze.value.show=!0,Ze.value.categoryIndex=0,Ze.value.fromButton=!0},wo=t=>{if(st.value.show){const o=document.querySelector(".dss-context-menu");o&&!o.contains(t.target)&&(st.value.show=!1)}},xo=t=>{st.value.show&&!t.target.closest(".context-menu")&&(st.value.show=!1)},Ro=t=>{if(!$l.value||!bt.value||fl.value)return;t.preventDefault(),t.stopPropagation(),ne.value.isZooming=!0,Le.value.show=!1,ne.value.zoomTimeout&&clearTimeout(ne.value.zoomTimeout);const l=t.currentTarget.getBoundingClientRect(),r=t.clientX-l.left,m=t.clientY-l.top;if(r<P.value.left-50||r>P.value.right+50||m<P.value.top-50||m>P.value.bottom+100){ne.value.isZooming=!1;return}const v=t.deltaY>0?.9:1.1,b=Math.max(ne.value.minScale,Math.min(ne.value.maxScale,ne.value.scale*v));if(b!==ne.value.scale){const{minX:x,maxX:q}=Bt.value,T=q-x||1,I=T/ne.value.scale,$=x-ne.value.offsetX/P.value.width*T,G=(r-P.value.left)/P.value.width,Ne=$+G*I;ne.value.scale=b;const Ue=T/ne.value.scale,ve=Ne-G*Ue;ne.value.offsetX=-(ve-x)/T*P.value.width,ne.value.scale<=1.01&&(ne.value.scale=1,ne.value.offsetX=0)}ne.value.zoomTimeout=setTimeout(()=>{ne.value.isZooming=!1,ne.value.zoomTimeout=null},300)},ro=t=>{if(!$l.value||!bt.value||ne.value.scale<=1)return;Le.value.show=!1;const l=t.currentTarget.getBoundingClientRect();t.clientX-l.left,t.clientY-l.top,ne.value.isDragging=!0,ne.value.lastMouseX=t.clientX,ne.value.lastMouseY=t.clientY,t.preventDefault()},Eo=()=>{ne.value.isDragging=!1},lo=()=>{!$l.value||!bt.value||(ne.value.scale=1,ne.value.offsetX=0,ne.value.isDragging=!1,ne.value.zoomTimeout&&(clearTimeout(ne.value.zoomTimeout),ne.value.zoomTimeout=null),ne.value.isZooming=!1)},oa=()=>!$l.value||!Qe.value||!bt.value?"default":ne.value.isDragging?"grabbing":ne.value.scale>1?"grab":"dss-crosshair",io=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],b=t[Math.min(l+2,t.length-1)],x=m.x+(v.x-r.x)/6*sl.value,q=m.y+(v.y-r.y)/6*sl.value,T=v.x-(b.x-m.x)/6*sl.value,I=v.y-(b.y-m.y)/6*sl.value;o+=` C ${x} ${q} ${T} ${I} ${v.x} ${v.y}`}return o},Ml=e.computed(()=>{const o=U.value?.chart?.padding,l=typeof o=="number"?o:null,r=o&&typeof o=="object"?o:null,m=50;let v=m+(Rt.value?30:0)+60;if(vl.value){const $={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??$.left,top:r.top??$.top,right:r.right??$.right,bottom:r.bottom??$.bottom}:$}if(xl.value){const $=!fe.value,G=_l.value,Ne=G?sn.value+Fl.value+Math.max(24,yn.value+16):0,Ue=$?12:m;let ve=0;et.value&&(ve+=$?8:15),lt.value&&(ve+=$?6:10);const be=_e();let Ee=Ue+($?4:16)+(G?Ne:0),me=Ue+(G?Ne:0);fe.value&&Fe.value==="left"?Ee+=be.legendWidth||150:fe.value&&Fe.value==="right"&&(me+=be.legendWidth||150);const Oe=xe.value==="semi-radial"?G?Ne:8:G?Ne:$?8:m+80,De=G?14:0,Be=Ue+ve+De,Pe={left:Ee,top:Be,right:me,bottom:Oe};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??Pe.left,top:r.top??Pe.top,right:r.right??Pe.right,bottom:r.bottom??Pe.bottom}:Pe}let b=0;et.value&&(b+=15),lt.value&&(b+=10);const x=_e();let q=m+16+(ct.value?30:0),T=m+(pt.value?30:0);fe.value&&Fe.value==="left"?q+=x.legendWidth||150:fe.value&&Fe.value==="right"&&(T+=x.legendWidth||150),Tn.value&&(T+=44),xe.value==="stepbar"&&(v=rl.value+8);const I={left:q,top:m+b,right:T,bottom:v};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??I.left,top:r.top??I.top,right:r.right??I.right,bottom:r.bottom??I.bottom}:I}),P=e.computed(()=>({left:Ml.value.left,top:Ml.value.top,right:Me.value-Ml.value.right,bottom:mt.value-Ml.value.bottom,width:Me.value-(Ml.value.left+Ml.value.right),height:mt.value-(Ml.value.top+Ml.value.bottom)})),$l=e.computed(()=>["line","area","bar","stepbar"].includes(xe.value)||Jt.value),Xl=e.computed(()=>Jt.value),Zn=e.computed(()=>xe.value==="mini-radial"),xl=e.computed(()=>["radial","semi-radial","mini-radial"].includes(xe.value)),vl=e.computed(()=>xe.value==="spider"),Ot=e.computed(()=>xe.value==="bubble"),fl=e.computed(()=>xe.value==="stepbar");e.watch([A,fl,()=>Z.series],()=>{e.nextTick(dt)},{deep:!0});const hl=e.computed(()=>U.value?.chart?.orientation==="horizontal"&&(xe.value==="bar"||Xl.value)),Sn=t=>{const{minY:o,maxY:l}=Bt.value,r=l-o||1;return P.value.left+(t-o)/r*P.value.width},$n=t=>{const{maxX:o}=Bt.value,l=o+1,m=P.value.height/l;return P.value.top+(t+.5)*m},Wt=e.computed(()=>xl.value?Ml.value.left+(Me.value-Ml.value.left-Ml.value.right)/2:Me.value/2),At=e.computed(()=>vl.value?mt.value/2-40:xl.value?Ml.value.top+(mt.value-Ml.value.top-Ml.value.bottom)/2:mt.value/2),it=e.computed(()=>{if(vl.value){const t=P.value.width-80,o=P.value.height-80;return Math.min(t,o)/2}return Math.min(P.value.width,P.value.height)/2}),kl=e.computed(()=>{const t=U.value,o=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,l=typeof o=="number"&&o>=0&&o<=1?o:.45;return it.value*l}),Ln=e.computed(()=>{const t=U.value,o=typeof Z.innerSize=="number"?Z.innerSize:t?.innerSize;return typeof o!="number"||o<=-100||!(xl.value||vl.value)?1:1+o/100}),co=e.computed(()=>{const t=Ln.value;if(t===1||t<=0)return;const o=Wt.value,l=At.value;return`translate(${o}, ${l}) scale(${t}) translate(${-o}, ${-l})`}),no=e.ref(0),uo=e.computed(()=>`semi-radial-fill-clip-${Z.chartId}`),Vn=e.computed(()=>xe.value==="semi-radial"),a=e.computed(()=>Vn.value&&Sl.value&&!Hn.value),n=e.computed(()=>Vn.value&&Sl.value&&!Hn.value&&mn.value==="fill"),s=e.computed(()=>{const t=a.value?no.value:1,o=Wt.value,l=At.value,r=kl.value,m=it.value,v=Math.PI,b=Math.PI+t*Math.PI;if(t<=0)return`M ${o} ${l} L ${o} ${l} Z`;const x=o+m*Math.cos(v),q=l+m*Math.sin(v),T=o+m*Math.cos(b),I=l+m*Math.sin(b),$=o+r*Math.cos(b),G=l+r*Math.sin(b),Ne=o+r*Math.cos(v),Ue=l+r*Math.sin(v),ve=t>.5?1:0;return`M ${o} ${l} L ${x} ${q} A ${m} ${m} 0 ${ve} 1 ${T} ${I} L ${$} ${G} A ${r} ${r} 0 ${ve} 1 ${Ne} ${Ue} Z`}),i=e.computed(()=>{if(!(!Vn.value||!a.value)&&!n.value)return`url(#${uo.value})`}),c=t=>{if(!(!n.value||t!==0))return`url(#${uo.value})`},d=e.ref(0),u=e.computed(()=>`radial-reveal-clip-${Z.chartId}`),p=e.computed(()=>xe.value==="radial"),y=e.computed(()=>{const t=p.value?d.value:1,o=Wt.value,l=At.value,r=Math.max(it.value*1.5,Me.value,mt.value);if(t<=0)return`M ${o} ${l} L ${o} ${l} Z`;if(t>=1){const $=o-r,G=o+r;return`M ${$} ${l} A ${r} ${r} 0 0 1 ${G} ${l} A ${r} ${r} 0 0 1 ${$} ${l} Z`}const m=-Math.PI/2,v=m+t*Math.PI*2,b=o+r*Math.cos(m),x=l+r*Math.sin(m),q=o+r*Math.cos(v),T=l+r*Math.sin(v),I=t>=.5?1:0;return`M ${o} ${l} L ${b} ${x} A ${r} ${r} 0 ${I} 1 ${q} ${T} Z`}),C=e.computed(()=>{if(i.value)return i.value;if(p.value)return`url(#${u.value})`});let R=null;const O=()=>{if(!a.value)return;no.value=0;const t=Wl.value,o=performance.now(),l=r=>{const m=r-o,v=Math.min(1,m/t);no.value=va(on.value,v),v<1&&(R=requestAnimationFrame(l))};R=requestAnimationFrame(l)},M=e.computed(()=>U.value?.bubbles?.minSize||8),ue=e.computed(()=>U.value?.bubbles?.maxSize||50),le=e.computed(()=>U.value?.bubbles?.opacity||.7),We=(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)},$e=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(()=>Z.series),qt=e.computed(()=>Z.series.filter((t,o)=>!F.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"},gl=t=>t?typeof t.strokeDasharray=="string"?t.strokeDasharray:Array.isArray(t.strokeDasharray)?t.strokeDasharray.join(","):t.dotted===!0?"4,4":null:null,It=t=>t?t.old===!0||t.comparison===!0||t.dotted===!0:!1,ol=e.computed(()=>{const o=U.value?.spider?.comparison||{};return{fillOpacity:typeof o.fillOpacity=="number"?o.fillOpacity:0,strokeDasharray:o.strokeDasharray||"6,4",usePrimaryColor:o.usePrimaryColor!==!1,bubbleSize:typeof o.bubbleSize=="number"?o.bubbleSize:0}}),rn=(t,o)=>typeof t?.bubbles?.size=="number"?t.bubbles.size:typeof t?.bubbleSize=="number"?t.bubbleSize:o?ol.value.bubbleSize:ce.value,kn=(t,o)=>It(t)&&ol.value.usePrimaryColor?al(0):al(o),Ol=(t,o)=>vl.value&&It(t)?kn(t,o):al(o),So=e.computed(()=>qt.value.filter(t=>nl(t)==="primary")),Vo=e.computed(()=>qt.value.filter(t=>nl(t)==="secondary")),Tn=e.computed(()=>!hl.value&&!!ht.value&&Vo.value.length>0),No=(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 b=m&&typeof m=="object"&&!Array.isArray(m),x=No(b?m.value:m,0);return x<=0?null:{key:`${l}-${v}-${b&&m.label||v}`,label:b?m.label||o?.name||`Segment ${v+1}`:o?.name||`Segment ${v+1}`,value:x,color:b?m.color||al(v):al(l),marker:b?m.marker:null,isRemainder:!1}}).filter(Boolean);return ae.value==="asc"?r.sort((m,v)=>m.value-v.value):ae.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)}],b=ya(v,l,r),x=b.reduce(($,G)=>$+G.value,0),q=No(m?t.totalValue??t.total??l?.totalValue??l?.total:l?.totalValue??l?.total,se.value),T=Math.max(q,x,1);je.value&&T>x&&b.push({key:`${r}-${o}-remainder`,label:St.value,value:T-x,color:ut.value,marker:null,isRemainder:!0});const I=b.filter($=>!$.isRemainder).reduce(($,G)=>!$||G.value>$.value?G:$,null);return{key:`${r}-${o}`,label:m?t.label||t.name||Z.categories?.[o]||N("chart.fallback.item",{number:o+1}):Z.categories?.[o]||N("chart.fallback.item",{number:o+1}),axisLabel:m?t.xLabel??t.label??t.name??Z.categories?.[o]??N("chart.fallback.item",{number:o+1}):Z.categories?.[o]||N("chart.fallback.item",{number:o+1}),yLabel:m?t.yLabel??null:null,totalValue:T,usedValue:x,segments:b,maxSegmentKey:I?.key||null,seriesName:l?.name||"",seriesIndex:r}},Dn=e.computed(()=>{if(!fl.value)return[];const t=[];return Ut.value.forEach((o,l)=>{F.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}),Al="auto",cn=(t,o,l,r=0,m=100)=>{let v=1/0,b=-1/0;if(t.forEach(T=>{T?.data?.length&&T.data.forEach(I=>{typeof I=="number"&&Number.isFinite(I)&&(v=Math.min(v,I),b=Math.max(b,I))})}),v===1/0)return{minY:r,maxY:m};let x;if(o===Al){const T=b-v,I=T>0?T*.1:1;x=Math.max(0,v-I)}else if(typeof o=="number")x=o;else{const T=b-v,I=T>0?T*.1:1;x=Math.max(0,v-I)}let q;if(l===Al){const T=b-v,I=T>0?T*.1:2;q=b+I}else if(typeof l=="number")q=l;else{const T=b-v,I=T>0?T*.1:2;q=b+I}return{minY:x,maxY:q}},Bt=e.computed(()=>{if(Ot.value)return Wa();if(fl.value)return en();if(!qt.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=0;qt.value.forEach(l=>{l.data&&l.data.length&&(t=Math.max(t,l.data.length-1))}),Z.categories.length>0&&(t=Math.max(t,Z.categories.length-1));const o=cn(So.value.length?So.value:qt.value,Xt.value,Ct.value);return{minX:0,maxX:t,minY:o.minY,maxY:o.maxY}}),en=()=>{const t=Dn.value,o=t.reduce((v,b)=>Math.max(v,b.totalValue),se.value),l=typeof Xt.value=="number"?Xt.value:0,r=typeof Ct.value=="number"?Ct.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(()=>Tn.value?cn(Vo.value,Pt.value,pe.value,Bt.value.minY,Bt.value.maxY):{minY:Bt.value.minY,maxY:Bt.value.maxY}),Wa=()=>{if(!qt.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,b=!1;if(qt.value.forEach((Ne,Ue)=>{Ne?.data?.length&&Ne.data.forEach((ve,be)=>{let Ee,me,Je;if(typeof ve=="object"&&ve!==null&&!Array.isArray(ve))Ee=typeof ve.x=="number"?ve.x:be,me=typeof ve.y=="number"?ve.y:0,Je=typeof ve.size=="number"?ve.size:20;else if(Array.isArray(ve)&&ve.length>=3)Ee=typeof ve[0]=="number"?ve[0]:be,me=typeof ve[1]=="number"?ve[1]:0,Je=typeof ve[2]=="number"?ve[2]:20;else if(typeof ve=="number")Ee=be,me=ve,Je=We(Ue,be);else return;isFinite(Ee)&&isFinite(me)&&isFinite(Je)&&(t=Math.min(t,Ee),o=Math.max(o,Ee),l=Math.min(l,me),r=Math.max(r,me),m=Math.min(m,Je),v=Math.max(v,Je),b=!0)})}),!b)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===o&&(t=Math.min(t,0),o=Math.max(o,Z.categories?.length-1||8)),l===r&&(l=Math.max(0,l-10),r=l+20);const x=o-t,q=r-l;let T,I,$,G;return H.value!==null?T=H.value:T=t-x*.1,Y.value!==null?I=Y.value:I=o+x*.1,Xt.value!==null&&typeof Xt.value=="number"?$=Xt.value:$=Math.max(0,l-q*.1),Ct.value!==null&&typeof Ct.value=="number"?G=Ct.value:G=r+q*.1,{minX:T,maxX:I,minY:$,maxY:G,minSize:m,maxSize:v}},Cl=t=>{if(Ot.value){const{minX:x,maxX:q}=Bt.value,T=q-x||1;return P.value.left+(t-x)/T*P.value.width}const{minX:o,maxX:l}=Bt.value,r=l-o;if(l===0||r===0)return P.value.left+P.value.width/2;const m=r/ne.value.scale,v=o-ne.value.offsetX/P.value.width*r,b=(t-v)/m;return P.value.left+b*P.value.width},Un=t=>{const{minY:o,maxY:l}=Bt.value,r=l-o||1;return P.value.bottom-(t-o)/r*P.value.height},ka=t=>{const{minY:o,maxY:l}=aa.value,r=l-o||1;return P.value.bottom-(t-o)/r*P.value.height},Cn=(t,o)=>Tn.value&&nl(t)==="secondary"?ka(o):Un(o),qa=t=>{if(!Ot.value)return ce.value||4;const{maxSize:o}=Bt.value,l=Math.max(1,o),r=Math.min(1,Math.max(0,t/l));return M.value+r*(ue.value-M.value)},mo=(t,o=12,l="Arial, sans-serif")=>{if(typeof t!="string"||!t)return 0;if(typeof document>"u")return t.length*(o*.62);mo.canvas||(mo.canvas=document.createElement("canvas"));const r=mo.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||mo(t,l)<=o)return t;const r="..";if(mo(r,l)>=o)return r;let v=t.length;for(;v>0;){const b=`${t.slice(0,v)}${r}`;if(mo(b,l)<=o)return b;v-=1}return r},Za=e.computed(()=>ra.value.map(t=>({y:t.y}))),ba=e.computed(()=>!fl.value||!Lt.value?[]:ra.value.map(t=>({y:t.y}))),sa=e.computed(()=>{if(Ot.value)return Ua();if(fl.value)return[];if(xe.value==="bar"){if(hl.value){const Be=[],{minY:Pe,maxY:$t}=Bt.value,Zt=5,tn=$t-Pe||1;for(let bl=0;bl<=Zt;bl++){const ln=Pe+tn*(bl/Zt),Wo=Sn(ln);Be.push({x:Wo,y:P.value.bottom+20,text:Vl(Math.round(ln))})}return Be}const be=[],{maxX:Ee}=Bt.value,me=Ee+1,Je=5,De=(P.value.width-Je*2)/me;for(let Be=0;Be<=Ee;Be++){const Pe=P.value.left+Je+(Be+.5)*De;be.push({x:Pe,y:P.value.bottom+20,text:Ca(Z.categories[Be]||N("chart.fallback.item",{number:Be+1}),Math.max(De-8,24))})}return be}const t=[],{minX:o,maxX:l}=Bt.value,r=H.value!==null?H.value:o,m=Y.value!==null?Y.value:l,v=m-r||1,b=v/ne.value.scale,x=r-ne.value.offsetX/P.value.width*v,q=x+b,T=Math.max(0,Math.floor(x-2)),I=Math.min(m,Math.ceil(q+2)),$=I-T,G=P.value.width,Ue=Math.floor(G/60);let ve=1;$>Ue&&(ve=Math.ceil($/Ue));for(let be=T;be<=I;be+=ve)if(be>=0&&be<=m){const Ee=Cl(be);Ee>=P.value.left-100&&Ee<=P.value.right+100&&t.push({x:Ee,y:P.value.bottom+20,text:Z.categories[be]||`Item ${be+1}`})}return t}),Ua=()=>{const t=[],{minX:o,maxX:l}=Bt.value,r=l-o||1,m=Math.min(8,Math.max(4,Math.floor(P.value.width/80)));for(let v=0;v<=m;v++){const b=o+r*v/m,x=Cl(b);if(x>=P.value.left-10&&x<=P.value.right+10){const q=Math.round(b),T=Z.categories?.[q];t.push({x,y:P.value.bottom+20,text:T||(Number.isInteger(b)?b.toString():b.toFixed(1))})}}return t},ra=e.computed(()=>{if(hl.value){const m=[],{maxX:v}=Bt.value;for(let b=0;b<=v;b++)m.push({x:P.value.left-10,y:$n(b),text:Ca(Z.categories[b]||`Item ${b+1}`,Math.max(P.value.left-28,40))});return m}const t=[],{minY:o,maxY:l}=Bt.value,r=5;for(let m=0;m<=r;m++){const v=o+(l-o)*(m/r),b=Math.round(v);t.push({x:P.value.left-10,y:Un(v),text:Vl(b)})}return t}),Ya=e.computed(()=>{if(!Tn.value||hl.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),b=Math.round(v);t.push({x:P.value.right+10,y:ka(v),text:Vl(b)})}return t}),al=t=>{const o=V.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]},Xa=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 x=o.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(x)l=Number(x[1])/255,r=Number(x[2])/255,m=Number(x[3])/255;else{const q=o.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(q){let T=q[1];T.length===3&&(T=T[0]+T[0]+T[1]+T[1]+T[2]+T[2]),l=parseInt(T.slice(0,2),16)/255,r=parseInt(T.slice(2,4),16)/255,m=parseInt(T.slice(4,6),16)/255}else if(typeof document<"u"){const T=document.createElement("span");T.style.color=o,T.style.display="none",document.body.appendChild(T);const I=getComputedStyle(T).color;document.body.removeChild(T);const $=I.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if($)l=Number($[1])/255,r=Number($[2])/255,m=Number($[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)),b=Math.max(0,Math.floor(Number(l[2])*.65)),x=Math.max(0,Math.floor(Number(l[3])*.65));return`rgb(${v}, ${b}, ${x})`}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)),b=Math.max(0,Math.floor(Number(r[2])*.65)),x=Math.max(0,Math.floor(Number(r[3])*.65));return`rgba(${v}, ${b}, ${x}, ${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 b=Math.max(0,Math.min(255,Math.floor(parseInt(v.slice(0,2),16)*.65))),x=Math.max(0,Math.min(255,Math.floor(parseInt(v.slice(2,4),16)*.65))),q=Math.max(0,Math.min(255,Math.floor(parseInt(v.slice(4,6),16)*.65)));return`#${[b,x,q].map(T=>T.toString(16).padStart(2,"0")).join("")}`}return o},ca=(t,o)=>{const r=U.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(()=>xe.value==="line"||Xl.value?(Xl.value?Z.series.filter(o=>(o.type||xe.value)==="line"):Ut.value).map((o,l)=>{const r=Z.series.findIndex($=>$===o),m=[];let v=[];o.data.forEach(($,G)=>{$==null?v.length>0&&(m.push([...v]),v=[]):v.push({x:hl.value?Sn($):Cl(G),y:hl.value?$n(G):Cn(o,$),index:G})}),v.length>0&&m.push(v);let b="";m.forEach($=>{if($.length>0){let G="";Vt.value?G=io($):G=`M ${$[0].x} ${$[0].y}`+$.slice(1).map(Ne=>` L ${Ne.x} ${Ne.y}`).join(""),b+=(b?" ":"")+G}});const x=m.reduce(($,G)=>$+ua(G),0),q=F.value.has(r),T=z.value===r,I=z.value!==null&&z.value!==r;return{path:b,color:al(r),strokeDasharray:gl(o),pathLength:x,seriesIndex:r,animationDelay:l*il.value,isHighlighted:T,isDimmed:I,isHidden:q}}):[]),xa=e.computed(()=>{if(!(xe.value==="line"||Xl.value))return[];const t=Xl.value?Z.series.filter(l=>(l.type||xe.value)==="line"):Ut.value,o=[];return t.forEach((l,r)=>{const m=Z.series.findIndex(v=>v===l);for(let v=0;v<l.data.length-1;v++){const b=l.data[v];if(b!=null){let x=-1,q=0;for(let T=v+1;T<l.data.length;T++){const I=l.data[T];if(I==null)q++;else{x=T;break}}if(q>0&&x!==-1){const T=l.data[x],I=hl.value?Sn(b):Cl(v),$=hl.value?$n(v):Cn(l,b),G=hl.value?Sn(T):Cl(x),Ne=hl.value?$n(x):Cn(l,T),Ue=F.value.has(m),ve=z.value===m,be=z.value!==null&&z.value!==m;o.push({path:`M ${I} ${$} L ${G} ${Ne}`,color:al(m),seriesIndex:m,animationDelay:r*il.value,isHighlighted:ve,isDimmed:be,isHidden:Ue,gapSize:q}),v=x-1}}}}),o}),ja=e.computed(()=>xe.value==="line"||Xl.value?!Sl.value||Hn.value||zt.value.hasAnimated?[]:(Xl.value?Z.series.filter(o=>(o.type||xe.value)==="line"):Ut.value).map((o,l)=>{const r=Z.series.findIndex(q=>q===o);let m="",v=null;o.data.forEach((q,T)=>{if(q!=null){const I={x:hl.value?Sn(q):Cl(T),y:hl.value?$n(T):Cn(o,q)};v===null?m+=`M ${I.x} ${I.y}`:m+=` L ${I.x} ${I.y}`,v=I}else if(v!==null){const I=o.data.findIndex(($,G)=>G>T&&$!==null&&$!==void 0);if(I!==-1){const $={x:hl.value?Sn(o.data[I]):Cl(I),y:hl.value?$n(I):Cn(o,o.data[I])};m+=` L ${$.x} ${$.y}`,v=$}}});const b=o.data.map((q,T)=>q==null?null:{x:hl.value?Sn(q):Cl(T),y:hl.value?$n(T):Cn(o,q)}).filter(q=>q!==null),x=ua(b);return{path:m,pathLength:x,color:al(r),strokeDasharray:gl(o),animationDelay:l*il.value,seriesIndex:r}}):[]),Ka=e.computed(()=>{if(xe.value!=="line")return[];const t=[];return Ut.value.forEach((o,l)=>{const r=z.value===l,m=z.value!==null&&z.value!==l,v=F.value.has(l);o.data.forEach((b,x)=>{b!=null&&t.push({x:Cl(x),y:Cn(o,b),color:al(l),value:b,label:Z.categories[x]||x.toString(),seriesName:o.name,categoryIndex:x,dataIndex:x,animationDelay:(l*o.data.length+x)*(il.value/8),isHighlighted:r,isDimmed:m,isHidden:v})})}),t}),Ga=e.computed(()=>{if(!Xl.value)return[];const t=[];return Z.series.filter(l=>(l.type||xe.value)==="line").forEach((l,r)=>{const m=Z.series.findIndex(q=>q===l),v=z.value===m,b=z.value!==null&&z.value!==m,x=F.value.has(m);l.data.forEach((q,T)=>{q!=null&&t.push({x:Cl(T),y:Cn(l,q),color:al(m),value:q,label:Z.categories[T]||T.toString(),seriesName:l.name,categoryIndex:T,dataIndex:T,animationDelay:(r*l.data.length+T)*(il.value/8),isHighlighted:v,isDimmed:b,isHidden:x})})}),t}),Io=e.computed(()=>{if(!Ot.value)return[];const t=[];return Ut.value.forEach((o,l)=>{if(!o?.data?.length)return;const r=z.value,m=r!==null&&r===l,v=r!==null&&r!==l,b=F.value.has(l);o.data.forEach((x,q)=>{let T,I,$,G,Ne;if(typeof x=="object"&&x!==null&&!Array.isArray(x))T=typeof x.x=="number"?x.x:q,I=typeof x.y=="number"?x.y:0,$=typeof x.size=="number"?x.size:20,G=x.label||Z.categories?.[q]||`Point ${q+1}`,Ne=x.image||x.imageUrl;else if(Array.isArray(x)&&x.length>=3)T=typeof x[0]=="number"?x[0]:q,I=typeof x[1]=="number"?x[1]:0,$=typeof x[2]=="number"?x[2]:20,G=x[3]||Z.categories?.[q]||`Point ${q+1}`,Ne=x[4];else if(typeof x=="number")T=q,I=x,$=We(l,q),G=Z.categories?.[q]||`Point ${q+1}`;else return;!isFinite(T)||!isFinite(I)||!isFinite($)||t.push({x:Cl(T),y:Un(I),radius:qa($),originalX:T,originalY:I,originalSize:$,color:al(l),seriesName:o.name||`Series ${l+1}`,label:G,imageUrl:Ne,seriesIndex:l,dataIndex:q,categoryIndex:Math.round(T),isHighlighted:m,isDimmed:v,isHidden:b,opacity:le.value})})}),t}),da=e.computed(()=>xe.value!=="area"?[]:Ut.value.map((t,o)=>{const l=[];let r=[];if(t.data.forEach(($,G)=>{$==null?r.length>0&&(l.push([...r]),r=[]):r.push({x:Cl(G),y:Cn(t,$),index:G})}),r.length>0&&l.push(r),l.length===0)return{linePath:"",areaPath:"",color:al(o),isHidden:F.value.has(o)};const m=P.value.bottom+1;let v="",b="";l.forEach(($,G)=>{if($.length===0)return;let Ne=`M ${$[0].x} ${$[0].y}`;Vt.value&&$.length>1?Ne=io($):$.slice(1).forEach(ve=>{Ne+=` L ${ve.x} ${ve.y}`}),v+=(v?" ":"")+Ne;let Ue=`M ${$[0].x} ${m}`;if(Ue+=` L ${$[0].x} ${$[0].y}`,Vt.value&&$.length>1){const ve=io($),be=ve.substring(ve.indexOf("C")||ve.indexOf("Q")||ve.indexOf("L"));be?Ue+=" "+be:$.slice(1).forEach(Ee=>{Ue+=` L ${Ee.x} ${Ee.y}`})}else $.slice(1).forEach(ve=>{Ue+=` L ${ve.x} ${ve.y}`});Ue+=` L ${$[$.length-1].x} ${m} Z`,b+=(b?" ":"")+Ue});const x=z.value===o,q=z.value!==null&&z.value!==o,T=F.value.has(o),I=l.reduce(($,G)=>$+ua(G),0);return{linePath:v,areaPath:b,color:al(o),pathLength:I,isHighlighted:x,isDimmed:q,isHidden:T}})),Ea=e.computed(()=>{if(!(["bar"].includes(xe.value)||Xl.value))return[];const t=[],{maxX:o}=Bt.value,l=Xl.value?Z.series.filter(m=>(m.type||xe.value)==="bar"):Ut.value,r=l.length;if(hl.value){const m=o+1,b=P.value.height/m,x=b*(2/3),q=Math.min(4,x/r*.15),T=x-(r-1)*q,I=Math.max(4,T/r);l.forEach(($,G)=>{const Ne=Z.series.findIndex(Ee=>Ee===$),Ue=z.value===Ne,ve=z.value!==null&&z.value!==Ne,be=F.value.has(Ne);$.data.forEach((Ee,me)=>{if(Ee==null||typeof Ee!="number"||!isFinite(Ee))return;const De=P.value.top+(me+.5)*b-x/2+G*(I+q),Be=P.value.left,Pe=Math.abs(Sn(Ee)-P.value.left);let $t="";if(Vt.value&&Pe>0){const Zt=Math.min(D.value,I/2,Pe/2);$t=[`M ${Be} ${De}`,`L ${Be+Pe-Zt} ${De}`,`Q ${Be+Pe} ${De} ${Be+Pe} ${De+Zt}`,`L ${Be+Pe} ${De+I-Zt}`,`Q ${Be+Pe} ${De+I} ${Be+Pe-Zt} ${De+I}`,`L ${Be} ${De+I}`,"Z"].join(" ")}t.push({x:Be,y:De,width:Pe,height:I,color:al(r===1?me:Ne),value:Ee,label:Z.categories[me]||me.toString(),seriesName:$.name,animationDelay:(G*l.length+me)*(il.value/4),isHighlighted:Ue,isDimmed:ve,isHidden:be,barPath:$t,isSmooth:Vt.value&&Pe>0})})})}else{const m=o+1,b=P.value.width/m,x=b*.8,q=x/r,T=q*.05,I=q-T;l.forEach(($,G)=>{const Ne=Z.series.findIndex(Ee=>Ee===$),Ue=z.value===Ne,ve=z.value!==null&&z.value!==Ne,be=F.value.has(Ne);$.data.forEach((Ee,me)=>{if(Ee==null||typeof Ee!="number"||!isFinite(Ee))return;const De=P.value.left+(me+.5)*b-x/2+G*q+T/2,Be=Un(Math.max(0,Ee)),Pe=Math.abs(Un(0)-Un(Ee));let $t="";if(Vt.value&&Pe>0){const Zt=Math.min(D.value,I/2,Pe/2);$t=[`M ${De} ${Be+Pe}`,`L ${De} ${Be+Zt}`,`Q ${De} ${Be} ${De+Zt} ${Be}`,`L ${De+I-Zt} ${Be}`,`Q ${De+I} ${Be} ${De+I} ${Be+Zt}`,`L ${De+I} ${Be+Pe}`,"Z"].join(" ")}t.push({x:De,y:Be,width:I,height:Pe,color:al(r===1?me:Ne),value:Ee,label:Z.categories[me]||me.toString(),seriesName:$.name,animationDelay:(G*l.length+me)*(il.value/4),isHighlighted:Ue,isDimmed:ve,isHidden:be,barPath:$t,isSmooth:Vt.value&&Pe>0})})})}return t}),An=e.computed(()=>{if(!xl.value)return[];const t=Ut.value.map((b,x)=>({series:b,originalIndex:x})).filter(({originalIndex:b})=>!F.value.has(b));if(t.length===0)return[];let o=xe.value==="semi-radial"?Math.PI:-Math.PI/2;const l=xe.value==="semi-radial"?Math.PI:Math.PI*2,r=[],m=(b,x,q,T,I,$)=>{const G=b+(x-b)/2,Ne=x-b,Ue=Wt.value+Math.cos(b)*kl.value,ve=At.value+Math.sin(b)*kl.value,be=Wt.value+Math.cos(x)*kl.value,Ee=At.value+Math.sin(x)*kl.value,me=Wt.value+Math.cos(x)*it.value,Je=At.value+Math.sin(x)*it.value,Oe=Wt.value+Math.cos(b)*it.value,De=At.value+Math.sin(b)*it.value,Be=Ne>Math.PI?1:0,Pe=[`M ${Ue} ${ve}`,`A ${kl.value} ${kl.value} 0 ${Be} 1 ${be} ${Ee}`,`L ${me} ${Je}`,`A ${it.value} ${it.value} 0 ${Be} 0 ${Oe} ${De}`,"Z"].join(" "),$t=$||al(q);return{path:Pe,color:$t,strokeWidth:te.value,strokeColor:ca(r.length,$t),value:I,seriesName:T,opacity:.8,isHighlighted:z.value===q,isDimmed:z.value!==null&&z.value!==q,isHidden:!1,startAngle:b,endAngle:x,midAngle:G}};if(Zn.value){const{series:b,originalIndex:x}=t[0],q=Number(b?.data?.[0]??0),T=Number.isFinite(q)?Math.min(Math.max(q,0),100):0,I=U.value,$=Math.min(Math.max(Number(I?.miniRadial?.minVisiblePercent??1),0),100),Ne=(T<=0?$:T)/100*l,Ue=Number(I?.miniRadial?.thresholds?.low??33),ve=Number(I?.miniRadial?.thresholds?.medium??66),be=I?.miniRadial?.colors?.low||"#E53E3E",Ee=I?.miniRadial?.colors?.medium||"#ED8936",me=I?.miniRadial?.colors?.high||"#38A169",Je=T<=Ue?be:T<=ve?Ee:me,Oe=I?.miniRadial?.trackColor||"#E5E7EB",De=b?.name||"Score";return r.push(m(o,o+l-.001,x+1,"Track",100,Oe)),r.push(m(o,o+Ne,x,De,T,Je)),r}if(t.length===1){const{series:b,originalIndex:x}=t[0],q=b.data[0]||0,T=o,I=o+l-.001,$=T+l/2,G=Wt.value+Math.cos(T)*kl.value,Ne=At.value+Math.sin(T)*kl.value,Ue=Wt.value+Math.cos(I)*kl.value,ve=At.value+Math.sin(I)*kl.value,be=Wt.value+Math.cos(I)*it.value,Ee=At.value+Math.sin(I)*it.value,me=Wt.value+Math.cos(T)*it.value,Je=At.value+Math.sin(T)*it.value,Oe=1,De=[`M ${G} ${Ne}`,`A ${kl.value} ${kl.value} 0 ${Oe} 1 ${Ue} ${ve}`,`L ${be} ${Ee}`,`A ${it.value} ${it.value} 0 ${Oe} 0 ${me} ${Je}`,"Z"].join(" "),Be=al(x);return r.push({path:De,color:Be,strokeWidth:te.value,strokeColor:ca(0,Be),value:q,seriesName:b.name,opacity:.8,isHighlighted:z.value===x,isDimmed:!1,isHidden:!1,startAngle:T,endAngle:I,midAngle:$}),r}if(n.value&&t.length===2){const b=t[0],x=t[1],q=Math.min(100,Math.max(0,b.series.data[0]||0)),T=q/100*l;return r.push(m(o,o+T,b.originalIndex,b.series.name,q)),r.push(m(o,o+l,x.originalIndex,x.series.name,100)),r}const v=t.reduce((b,{series:x})=>b+(x.data[0]||0),0);return v===0?[]:(t.forEach(({series:b,originalIndex:x})=>{const q=b.data[0]||0,T=q/v*l,I=o,$=o+T,G=I+T/2,Ne=Wt.value+Math.cos(I)*kl.value,Ue=At.value+Math.sin(I)*kl.value,ve=Wt.value+Math.cos($)*kl.value,be=At.value+Math.sin($)*kl.value,Ee=Wt.value+Math.cos($)*it.value,me=At.value+Math.sin($)*it.value,Je=Wt.value+Math.cos(I)*it.value,Oe=At.value+Math.sin(I)*it.value,De=T>Math.PI?1:0,Be=[`M ${Ne} ${Ue}`,`A ${kl.value} ${kl.value} 0 ${De} 1 ${ve} ${be}`,`L ${Ee} ${me}`,`A ${it.value} ${it.value} 0 ${De} 0 ${Je} ${Oe}`,"Z"].join(" "),Pe=al(x);r.push({path:Be,color:Pe,strokeWidth:te.value,strokeColor:ca(r.length,Pe),value:q,seriesName:b.name,opacity:.8,isHighlighted:z.value===x,isDimmed:z.value!==null&&z.value!==x,isHidden:!1,startAngle:I,endAngle:$,midAngle:G}),o=$}),r)}),Qa=e.computed(()=>{const t=An.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(!_l.value||!xl.value)return[];const t=yn.value,o=sn.value,l=Fl.value,r=ul.value,m=15,v=t*1.3,b=.55,x=($,G)=>{const Ne=Wt.value+Math.cos($.midAngle)*it.value,Ue=At.value+Math.sin($.midAngle)*it.value,ve=Wt.value+Math.cos($.midAngle)*(it.value+o),be=At.value+Math.sin($.midAngle)*(it.value+o),me=ve+l*(G?1:-1),Je=G?ve+m:ve-m,Oe=be-r,De=`${$.seriesName}: ${Vl($.value)}`,Be=De.length*t*b;return{pointerStartX:Ne,pointerStartY:Ue,pointerEndX:ve,pointerEndY:be,horizontalEndX:me,horizontalEndY:be,textX:Je,textY:Oe,text:De,textWidth:Be,textAnchor:G?"start":"end",isRightSide:G,pointerLineLength:Math.hypot(ve-Ne,be-Ue),horizontalLineLength:Math.hypot(me-ve,0)}},q=($,G)=>{const Ne=Math.abs($.textY-G.textY)<v,Ue=$.isRightSide?$.textX:$.textX-$.textWidth,ve=$.isRightSide?$.textX+$.textWidth:$.textX,be=G.isRightSide?G.textX:G.textX-G.textWidth,Ee=G.isRightSide?G.textX+G.textWidth:G.textX,me=Ue<Ee&&be<ve;return Ne&&me},T=An.value.filter($=>!$.isHidden),I=[];for(let $=0;$<T.length;$++){const G=T[$];let Ne=Math.cos(G.midAngle)>=0;if($>0){const ve=I[$-1],be=x(G,Ne);q(ve,be)&&(Ne=!Ne)}const Ue=x(G,Ne);I.push({...Ue,color:G.color,isHighlighted:G.isHighlighted,isDimmed:G.isDimmed})}return I}),es=t=>{if(!t||t.isHidden)return 0;const o=t.opacity||le.value||.7;return z.value===null||z.value===void 0?o:z.value!==null?t.seriesIndex===z.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 z.value!==null?t.seriesIndex===z.value?Math.min(1,o+.1):o*.7:o},Sa=(t,o)=>{if(t)try{if(z.value===t.seriesIndex?z.value=null:z.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const l=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:o,chartId:Z.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,z.value=t.seriesIndex,Le.value.show=!1,!Et.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 b=200,x=120;m+b>Me.value&&(m=o.clientX-r.left-b-10),v+x>r.height&&(v=o.clientY-r.top-x-10),m<0&&(m=10),v<0&&(v=10);const q=f.value,T=g.value,I=q.map($=>{const G=T[$]||$,Ne=Na($,t);return Ne?{seriesName:t.seriesName,label:t.label,value:`${G}: ${Ne}`,color:t.color}:null}).filter(Boolean);Te.value={show:!0,x:m,y:v,title:t.label||t.seriesName||"",value:"",bubbleData:I,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=S.value[t];if(typeof r=="function")return r(l,o);if(typeof l=="number"){const m=l.toFixed(1);return wt.value?m+wt.value:m}return l?.toString()||""},ns=()=>{if(!Ot.value||!Le.value.data||Le.value.data.length===0)return"Bubbles";const t=[],o=new Set;return Le.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,z.value=null,Te.value.show=!1,Te.value.bubbleData=[])},os=(t,o)=>{const l=o.target.closest(".dss-custom-chart-container");if(!l)return;const r=l.getBoundingClientRect(),m=so(t.categoryIndex),v=t.description||t.comment||"";let b=o.clientX-r.left+15,x=o.clientY-r.top-10;const q=200,T=v?80:50;b+q>Me.value&&(b=o.clientX-r.left-q-15),x+T>mt.value&&(x=o.clientY-r.top-T-10),b<0&&(b=10),x<0&&(x=10),Ft.value={show:!0,x:b,y:x,categoryValue:m,description:v}},as=()=>{Ft.value.show=!1},po=e.computed(()=>Z.categories.length||Math.max(...qt.value.map(t=>t.data.length))),ss=e.computed(()=>{let t=0;return qt.value.forEach(o=>{o.data.forEach(l=>{typeof l=="number"&&(t=Math.max(t,l))})}),t||100}),_a=e.computed(()=>{const t=[],o=po.value;for(let l=0;l<o;l++){const r=l*2*Math.PI/o-Math.PI/2,m=Wt.value+Math.cos(r)*it.value,v=At.value+Math.sin(r)*it.value;t.push({x:m,y:v,angle:r,index:l})}return t}),rs=e.computed(()=>{const t=[],o=po.value;return _a.value.forEach((l,r)=>{const m=it.value+15,v=r*2*Math.PI/o-Math.PI/2,b=Wt.value+Math.cos(v)*m,x=At.value+Math.sin(v)*m+5;let q="middle",T="middle";Math.abs(Math.cos(v))>.5&&(q=Math.cos(v)>0?"start":"end"),Math.abs(Math.sin(v))>.5&&(T=Math.sin(v)>0?"hanging":"auto"),t.push({x:b,y:x,text:Z.categories[r]||`Axis ${r+1}`,anchor:q,baseline:T})}),t}),is=e.ref(new Set),cs=(t,o,l)=>{const r=`current-${l}`,m=is.value.has(r),v=o.fillOpacity??ql.value;return!m&&z.value===null?v:o.isHighlighted||m?o.isComparison?v:v+.15:o.isDimmed?v*.3:v},Ma=e.computed(()=>{if(!vl.value)return[];const t=[],o=po.value;return Ut.value.map((r,m)=>({series:r,seriesIndex:m})).sort((r,m)=>{const v=It(r.series)?0:1,b=It(m.series)?0:1;return v-b}).forEach(({series:r,seriesIndex:m})=>{const v=It(r),b=[],x=[],q=[],T=z.value===m,I=z.value!==null&&z.value!==m,$=F.value.has(m);for(let G=0;G<o;G++){const Ne=r.data[G]||0,ve=Ne/ss.value*it.value,be=G*2*Math.PI/o-Math.PI/2,Ee=Wt.value+Math.cos(be)*ve,me=At.value+Math.sin(be)*ve;b.push(`${Ee},${me}`),x.push({x:Ee,y:me}),q.push({x:Ee,y:me,value:Ne,label:Z.categories[G]||`Axis ${G+1}`,seriesName:r.name})}t.push({points:b.join(" "),polygonPoints:x,dataPoints:q,color:kn(r,m),fillOpacity:v?ol.value.fillOpacity:ql.value,strokeDasharray:v?gl(r)||ol.value.strokeDasharray:null,pointRadius:rn(r,v),seriesName:r.name,value:`${r.name}: ${r.data.join(", ")}`,isHighlighted:T,isDimmed:I,isHidden:$,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,b=o[r].y,x=o[m].x,q=o[m].y;b>t.y!=q>t.y&&t.x<(x-v)*(t.y-b)/(q-b)+v&&(l=!l)}return l},ds=t=>{if(!vl.value)return;const o=t.currentTarget.closest(".dss-custom-chart-container");if(!o)return;const l=o.getBoundingClientRect(),r=ee.value?.getBoundingClientRect();if(!r)return;const m=t.clientX-r.left,v=t.clientY-r.top,b=Ma.value.filter(x=>x.isHidden?!1:us({x:m,y:v},x.polygonPoints));if(b.length>0){b.length,z.value=b[0].seriesIndex;const x=t.clientX-l.left+10,q=t.clientY-l.top-10,T=b.length>1?460:260,I=70+po.value*20;let $=x,G=q;$+T>Me.value&&($=t.clientX-l.left-T-10),G+I>mt.value&&(G=t.clientY-l.top-I-10),$<0&&($=10),G<0&&(G=10);const Ne=b.map(Ue=>({seriesName:Ue.seriesName,color:Ue.color,points:Ue.dataPoints.map(ve=>({label:ve.label,value:Vl(ve.value)}))}));Te.value={show:!0,x:$,y:G,title:"",value:"",bubbleData:[],spiderAreas:Ne}}else Nn()},zo=e.computed(()=>{const t=U.value;return t.logos.map((o,l)=>{const r=Z.series[o.seriesIndex];if(!r||!r.data||r.data.length===0||F.value.has(o.seriesIndex))return null;let m,v;if($l.value){let x=-1,q=null;for(let I=r.data.length-1;I>=0;I--)if(r.data[I]!==null&&r.data[I]!==void 0){x=I,q=r.data[I];break}if(x===-1||q===null)return null;const T=r.data.map((I,$)=>I==null?null:{x:Cl($),y:Cn(r,I),index:$}).filter(I=>I!==null);if(t.animations.enabled&&!Hn.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(zt.value.isAnimating||!zt.value.hasAnimated))if(zt.value.isAnimating){const I=zt.value.currentFrame/zt.value.totalFrames,$=va(t.animations.easing,Math.min(I,1)),G=Cs(T,$);m=G.x+(o.offsetX||0),v=G.y+(o.offsetY||0)}else m=T[0].x+(o.offsetX||0),v=T[0].y+(o.offsetY||0);else m=Cl(x)+(o.offsetX||0),v=Un(q)+(o.offsetY||0)}else if(xl.value||vl.value){const x=Math.PI*2/t.logos.length*l;m=Wt.value+Math.cos(x)*(it.value+30)+(o.offsetX||0),v=At.value+Math.sin(x)*(it.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=>{F.value.has(t)?F.value.delete(t):F.value.add(t)},vs=e.computed(()=>{if(!Te.value.show&&!(Se.value&&Le.value.show&&!ne.value.isZooming))return{display:"none"};let t,o;if(Se.value&&Le.value.show&&!ne.value.isZooming){t=Le.value.x+15,o=P.value.top;const l=Ot.value?200:150;t+l>Me.value&&(t=Le.value.x-l-15),t<0&&(t=10),o<10&&(o=10)}else t=Te.value.x,o=Te.value.y;return{left:t+"px",top:o+"px"}}),Yn=(t,o)=>{if(!Et.value||Bo.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 b=200,x=120,q=Me.value,T=mt.value;m+b>q&&(m=o.clientX-r.left-b-10),v+x>T&&(v=o.clientY-r.top-x-10),m<0&&(m=10),v<0&&(v=10);let I;typeof t.categoryIndex=="number"?I=t.categoryIndex:typeof t.dataIndex=="number"?I=t.dataIndex:t.label&&Z.categories.includes(t.label)&&(I=Z.categories.indexOf(t.label));let $=t.seriesName||t.label||"";(hl.value||xe.value==="bar")&&t.label&&($=t.label),t.tooltipTitle&&($=t.tooltipTitle),Te.value={show:!0,x:m,y:v,title:$,value:Vl(t.value)||"",categoryIndex:I,spiderAreas:[]}},pa=e.ref(!1),Po=e.ref(!1),Nn=()=>{Te.value.show=!1,Te.value.spiderAreas=[],Te.value.bubbleData=[],Le.value.show=!1,pa.value||(z.value=null)},Bo=e.ref(!1),_o=(t,o)=>{Bo.value=!0,Te.value.show=!1,Le.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 b=250;m+b>Me.value&&(m=o.clientX-r.left-b-15),m<0&&(m=10),v<0&&(v=10),at.value={show:!0,x:m,y:v,content:t.texts,count:t.totalCount}},Mo=()=>{Bo.value=!1,at.value.show=!1},zt=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}},Hn=e.computed(()=>Fn.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),$a=()=>{if(!Sl.value||Hn.value){zt.value.hasAnimated=!0,p.value&&(d.value=1);return}p.value&&(d.value=0),zt.value.isAnimating=!0,zt.value.currentFrame=0,zt.value.totalFrames=Math.ceil(Wl.value/16.67);const t=()=>{const o=zt.value.currentFrame/zt.value.totalFrames,l=va(on.value,Math.min(o,1));fs(l),p.value&&(d.value=l),o<1?(zt.value.currentFrame++,zt.value.animationId=requestAnimationFrame(t)):hs()};zt.value.animationId=requestAnimationFrame(t)},fs=t=>{const o=W.value;o&&o.style.setProperty("--dss-animation-progress",t)},hs=()=>{zt.value.isAnimating=!1,zt.value.hasAnimated=!0,p.value&&(d.value=1),zt.value.animationId&&(cancelAnimationFrame(zt.value.animationId),zt.value.animationId=null)},fa=e.computed(()=>!xl.value||zt.value.hasAnimated?!0:p.value?d.value>=1:Vn.value?no.value>=1:!0),La=e.computed(()=>_l.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(!Sl.value||Hn.value||zt.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${Wl.value}ms`,t["--dss-animation-easing"]=ys(on.value),t["--dss-stagger-delay"]=`${il.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(!Sl.value||Hn.value)return"";const t=["dss-chart-animated"];return zt.value.hasAnimated||t.push(`dss-animate-${mn.value}`),zt.value.hasAnimated||(xl.value&&xe.value!=="semi-radial"?t.push("dss-animate-fill"):xl.value||t.push(`dss-animate-${mn.value}`)),zt.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>Z.series,(t,o)=>{jn.value&&o&&zt.value.hasAnimated&&(zt.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>$a(),pn.value)}))},{deep:!0}),e.watch(()=>ne.value.isZooming,(t,o)=>{o&&!t&&setTimeout(()=>{Co()},50)}),e.watch(()=>[ne.value.scale,ne.value.offsetX],()=>{!ne.value.isZooming&&!ne.value.isDragging&&Co()},{flush:"post"}),e.watch([el,re],([t,o])=>{ne.value.minScale=t,ne.value.maxScale=o,(ne.value.scale<t||ne.value.scale>o)&&lo()},{immediate:!0}),e.watch(()=>Z.locale,t=>{t&&t!==L.value&&(L.value=t)},{immediate:!0}),e.watch(()=>st.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",xo)}):document.removeEventListener("click",xo)}),e.onMounted(()=>{z.value=null,p.value&&(!Sl.value||Hn.value)&&(d.value=1),Ao(),e.nextTick(dt),W.value&&typeof ResizeObserver<"u"&&(Q=new ResizeObserver(t=>{const o=t[0];!o||!o.contentRect||(K&&cancelAnimationFrame(K),K=requestAnimationFrame(()=>{K=null;const{width:l,height:r}=o.contentRect;we.value=Math.round(l),ye.value=Math.round(r),h.value&&(rt.value=h.value.offsetHeight||he)}))}),Q.observe(W.value)),Sl.value&&!Hn.value?xe.value==="semi-radial"?setTimeout(()=>O(),pn.value):setTimeout(()=>$a(),pn.value):(zt.value.hasAnimated=!0,xe.value==="semi-radial"&&(no.value=1)),document.addEventListener("mousemove",Ta),document.addEventListener("mouseup",Da),document.addEventListener("click",wo)}),e.onUnmounted(()=>{de&&(de(),de=null),K&&cancelAnimationFrame(K),Q&&W.value&&(Q.unobserve(W.value),Q.disconnect(),Q=null),zt.value.animationId&&cancelAnimationFrame(zt.value.animationId),R&&(cancelAnimationFrame(R),R=null),ne.value.zoomTimeout&&clearTimeout(ne.value.zoomTimeout),document.removeEventListener("mousemove",Ta),document.removeEventListener("mouseup",Da),document.removeEventListener("click",wo),document.removeEventListener("click",xo)});const Ta=t=>{if(ne.value.isDragging&&ne.value.scale>1&&$l.value){Le.value.show=!1;const o=t.clientX-ne.value.lastMouseX,{minX:l,maxX:r}=Bt.value,m=r-l||1,b=o*.8;ne.value.offsetX+=b;const x=m/ne.value.scale,q=m-x,T=0,I=-q/m*P.value.width,$=T;ne.value.offsetX=Math.max(I,Math.min($,ne.value.offsetX)),ne.value.lastMouseX=t.clientX,ne.value.lastMouseY=t.clientY}},Da=()=>{ne.value.isDragging&&(ne.value.isDragging=!1,setTimeout(()=>{!ne.value.isDragging&&ne.value.isZooming},100))},Cs=(t,o)=>{const l=t.filter(x=>x!=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 x=1;x<l.length;x++){const q=l[x].x-l[x-1].x,T=l[x].y-l[x-1].y,I=Math.sqrt(q*q+T*T);m.push(I),r+=I}const v=r*o;let b=0;for(let x=0;x<m.length;x++){const q=b+m[x];if(v<=q){const T=(v-b)/m[x],I=l[x],$=l[x+1];return{x:I.x+($.x-I.x)*T,y:I.y+($.y-I.y)*T}}b=q}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":He.value,"dss-chart-fill-height":Ke.value,"dss-chart-compact":xl.value&&!fe.value}]]),style:e.normalizeStyle({width:He.value?"100%":Me.value+"px",height:Qt.value,...He.value||Ke.value?{overflow:xl.value?"visible":(fl.value,"hidden"),maxWidth:"100%",maxHeight:"100%"}:{},...gs.value,cursor:oa()}),"data-chart-type":xe.value,ref_key:"containerEl",ref:W,onWheel:Ro,onMousedown:ro,onMousemove:Ko,onMouseup:Eo,onMouseleave:To,onDblclick:lo,onContextmenu:e.withModifiers(Qo,["prevent"]),onClick:e.withModifiers(wn,["left"]),onWheelCapture:Ro},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:h},[e.createElementVNode("div",Or,[et.value?(e.openBlock(),e.createElementBlock("div",Wr,e.toDisplayString(et.value),1)):e.createCommentVNode("",!0),lt.value?(e.openBlock(),e.createElementBlock("div",qr,e.toDisplayString(lt.value),1)):e.createCommentVNode("",!0)]),fe.value&&Fe.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":tt.value==="horizontal","dss-legend-vertical":tt.value==="vertical","dss-legend-top":Fe.value==="top","dss-legend-bottom":Fe.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":F.value.has(r),"dss-legend-hovered":z.value===r,"dss-legend-dimmed":z.value!==null&&z.value!==r}]),onClick:m=>ma(r),onMouseenter:m=>Qn(r),onMouseleave:oo,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":vl.value&&It(l)}]),style:e.normalizeStyle({backgroundColor:vl.value&&It(l)?"transparent":Ol(l,r),borderColor:Ol(l,r)})},null,6),e.createElementVNode("span",Ur,e.toDisplayString(l.name),1)],46,Zr))),128))],2)):e.createCommentVNode("",!0),fe.value&&(Fe.value==="left"||Fe.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":Fe.value==="left","dss-legend-right":Fe.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":F.value.has(r),"dss-legend-hovered":z.value===r,"dss-legend-dimmed":z.value!==null&&z.value!==r}]),onClick:m=>ma(r),onMouseenter:m=>Qn(r),onMouseleave:oo,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":vl.value&&It(l)}]),style:e.normalizeStyle({backgroundColor:vl.value&&It(l)?"transparent":Ol(l,r),borderColor:Ol(l,r)})},null,6),e.createElementVNode("span",Xr,e.toDisplayString(l.name),1)],46,Yr))),128))],2)):e.createCommentVNode("",!0)],512),_.showAddMarkerButton&&cl.value&&jt.value.addMarker&&($l.value||Ot.value)&&!fl.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:to,title:e.unref(N)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Yt.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,Kr),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,jr)):e.createCommentVNode("",!0),e.createElementVNode("div",Gr,[Ot.value&&kt.value?(e.openBlock(),e.createElementBlock("div",Qr,"Bubble size: "+e.toDisplayString(kt.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Me.value,height:mt.value,class:"dss-chart-svg","data-smooth":Vt.value,"data-animated":Sl.value,ref_key:"svgEl",ref:ee},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:ge.value},[e.createElementVNode("rect",{x:0,y:P.value.top,width:Me.value,height:P.value.height*4},null,8,ti)],8,ei),Vn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:uo.value},[e.createElementVNode("path",{d:s.value},null,8,ni)],8,li)):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:u.value},[e.createElementVNode("path",{d:y.value},null,8,ai)],8,oi)):e.createCommentVNode("",!0)]),$l.value||Ot.value?(e.openBlock(),e.createElementBlock("g",si,[ie.value&&!fl.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":Ae.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:P.value.left,x2:P.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,ii))),128))],8,ri)):e.createCommentVNode("",!0),fl.value&&ba.value.length?(e.openBlock(),e.createElementBlock("g",{key:1,class:"dss-stepbar-axis-bars dss-stepbar-axis-bars--y-only","clip-path":Ae.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:P.value.left,x2:P.value.right,y1:l.y,y2:l.y,stroke:Ht.value,"stroke-width":wl.value,"stroke-dasharray":jl.value,opacity:Mt.value},null,8,ui))),128))],8,ci)):e.createCommentVNode("",!0),e.createElementVNode("g",di,[e.createElementVNode("line",{x1:P.value.left,x2:P.value.right,y1:P.value.bottom,y2:P.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,mi),e.createElementVNode("line",{x1:P.value.left,x2:P.value.left,y1:P.value.top,y2:P.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,pi),Tn.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:P.value.right,x2:P.value.right,y1:P.value.top,y2:P.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,vi)):e.createCommentVNode("",!0)]),e.createElementVNode("g",fi,[fl.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,hi))),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,gi))),128)),Tn.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Ya.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,yi))),128)):e.createCommentVNode("",!0),Rt.value?(e.openBlock(),e.createElementBlock("text",{key:2,x:P.value.left+P.value.width/2,y:P.value.bottom+45,"text-anchor":"middle","font-size":"14",fill:"#666"},e.toDisplayString(Rt.value),9,ki)):e.createCommentVNode("",!0),ct.value?(e.openBlock(),e.createElementBlock("text",{key:3,x:15,y:P.value.top+12+P.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(-90, 15, ${P.value.top+P.value.height/2})`},e.toDisplayString(ct.value),9,Ci)):e.createCommentVNode("",!0),Tn.value&&pt.value?(e.openBlock(),e.createElementBlock("text",{key:4,x:Me.value-15,y:P.value.top+12+P.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(90, ${Me.value-15}, ${P.value.top+P.value.height/2})`},e.toDisplayString(pt.value),9,bi)):e.createCommentVNode("",!0)]),Ie.value.length>0?(e.openBlock(),e.createElementBlock("g",wi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ie.value,l=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${l.categoryIndex}`},[e.createElementVNode("g",{"clip-path":Ae.value},[l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:l.x,x2:l.x,y1:P.value.bottom,y2:P.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>_o(l,r),onMouseleave:Mo},null,40,Ei)):e.createCommentVNode("",!0),l.hasAuto&&!l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:l.x,x2:l.x,y1:P.value.bottom,y2:P.value.top,stroke:"#a1d499","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>_o(l,r),onMouseleave:Mo},null,40,Si)):e.createCommentVNode("",!0),l.hasAuto&&l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:l.x,x2:l.x,y1:P.value.bottom,y2:P.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>_o(l,r),onMouseleave:Mo},null,40,Vi)):e.createCommentVNode("",!0)],8,xi),l.hasManual&&l.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x+8,cy:Math.max(15,P.value.top-10),r:"14",fill:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:r=>_o(l,r),onMouseleave:Mo},null,40,Ni)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:l.x,cy:Math.max(15,P.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=>_o(l,r),onMouseleave:Mo},null,40,Bi),e.createElementVNode("text",{x:l.x,y:Math.max(15,P.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,_i)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":Ae.value},[Xl.value?(e.openBlock(),e.createElementBlock("g",$i,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":hl.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=>Yn(l,m),onMouseleave:Nn},null,46,Li)):(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=>Yn(l,m),onMouseleave:Nn},null,46,Ti))],64))),128))],2),e.createElementVNode("g",Di,[(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,Ai))),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,Hi))),128)),ce.value>0||Ve.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:xt(l.isHighlighted?nt(l,ce.value)+2:nt(l,ce.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=>Yn(l,m),onMouseleave:Nn},null,46,Ri))),128)):e.createCommentVNode("",!0)])])):xe.value==="line"?(e.openBlock(),e.createElementBlock("g",Fi,[(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":zt.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,Ii))),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,zi))),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,Pi))),128)),ce.value>0||Ve.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:xt(l.isHighlighted?nt(l,ce.value)+2:nt(l,ce.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=>Yn(l,m),onMouseleave:Nn},null,46,Oi))),128)):e.createCommentVNode("",!0)])):xe.value==="area"?(e.openBlock(),e.createElementBlock("g",Wi,[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}-${_.chartId}`},[e.createElementVNode("rect",{x:P.value.left-10,y:P.value.top-10,width:P.value.width+20,height:P.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${P.value.width+20}px`})},null,12,Zi)],8,qi))),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?dl.value+.2:dl.value,mask:`url(#area-mask-${r}-${_.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,Ui))),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*il.value}ms`})},null,14,Yi))),128))])):xe.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":hl.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=>Yn(l,m),onMouseleave:Nn},null,46,Xi)):(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=>Yn(l,m),onMouseleave:Nn},null,46,ji))],64))),128))],2)):e.createCommentVNode("",!0)],8,Mi),Se.value&&Le.value.show&&!ne.value.isZooming&&!fl.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-crosshair","clip-path":Ae.value},[e.createElementVNode("line",{x1:Le.value.x,x2:Le.value.x,y1:P.value.top,y2:P.value.bottom,stroke:ot.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,Gi),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Le.value.data,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${r}`,cx:Le.value.x,cy:l.y,r:xt(ce.value+2),fill:l.color,stroke:"none",opacity:"0.9"},null,8,Qi))),128))],8,Ki)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Ot.value?(e.openBlock(),e.createElementBlock("g",Ji,[(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",ec,[e.createElementVNode("circle",{cx:l.x,cy:l.y,r:xt(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,tc),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=>$e(r),onError:m=>gt(r),onMouseenter:m=>Va(l,m),onMouseleave:m=>Ba(l),onClick:m=>Sa(l,m)},null,46,lc)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),xl.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:co.value},[xe.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Wt.value,cy:At.value,r:it.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,oc)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":xe.value,"clip-path":C.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=>Yn(l.segment,m),onMouseleave:Nn},null,42,sc))),128))],8,ac),Ql.value&&fa.value?(e.openBlock(),e.createElementBlock("g",rc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qe.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,ic)),[[e.vShow,l.show]])),128))])):e.createCommentVNode("",!0),k.value&&(fa.value||Vn.value||Zn.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:j.value.x,y:j.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":E.value,fill:Ce.value,class:"dss-radial-data-center"},e.toDisplayString(w.value),9,cc)):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,uc),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,dc),e.createElementVNode("text",{class:"dss-radial-label-text",x:l.textX,y:l.textY,"text-anchor":l.textAnchor,"font-size":yn.value,"dominant-baseline":"middle"},e.toDisplayString(l.text),9,mc)],6))),128))],2)):e.createCommentVNode("",!0)],8,nc)):e.createCommentVNode("",!0),vl.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:co.value},[ie.value?(e.openBlock(),e.createElementBlock("g",vc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ll.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${r}`,cx:Wt.value,cy:At.value,r:xt(l),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*150}ms`})},null,12,fc))),128)),e.createElementVNode("g",hc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ll.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${r}`},[e.createElementVNode("rect",{x:Wt.value-16,y:At.value-l-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,gc),e.createElementVNode("text",{x:Wt.value,y:At.value-l+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(In(r)),9,yc)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_a.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${r}`,x1:Wt.value,x2:l.x,y1:At.value,y2:l.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*100}ms`})},null,12,kc))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Cc,[(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/po.value-Math.PI/2)*16,y:l.y+Math.sin(r*2*Math.PI/po.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,bc))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:ds,onMouseleave:Nn},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ma.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*il.value}ms`,transition:"all 0.2s ease"})},null,14,wc),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:xt(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*il.value+v*50}ms`,transition:"all 0.2s ease"}),onMouseover:b=>Yn(m,b),onMouseleave:Nn},null,46,xc))),128)):e.createCommentVNode("",!0)]))),128))],32)],8,pc)):e.createCommentVNode("",!0),e.createElementVNode("g",Ec,[(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:xt(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,Sc))),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,Vc))),128))])],8,Jr)),fl.value&&Gl.value.length?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-stepbar-chart-host",style:e.normalizeStyle(Bn.value)},[e.createElementVNode("div",{ref_key:"stepbarScrollEl",ref:A,class:"dss-stepbar-scroll",onScroll:Go},[e.createElementVNode("div",{class:"dss-stepbar-scroll-content",style:e.normalizeStyle(nn.value)},[Lt.value?(e.openBlock(),e.createElementBlock("div",Nc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bn.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:Ht.value,borderTopWidth:`${wl.value}px`,borderTopStyle:"dashed",opacity:Mt.value})},null,4))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-stepbar-columns",style:e.normalizeStyle({gap:`${El.value}px`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Gl.value,l=>(e.openBlock(),e.createBlock(Ra,{key:l.key,class:"dss-stepbar-chart-column",style:e.normalizeStyle(Kl.value),label:l.label,segments:l.segments,"total-value":l.totalValue,"show-counter":!1,"value-label":wt.value,orientation:"vertical","label-position":"down","bar-height":yl.value,"segment-order":ae.value,"remainder-label":St.value,"inactive-color":ut.value,options:Rn.value,"disable-tooltips":""},null,8,["style","label","segments","total-value","value-label","bar-height","segment-order","remainder-label","inactive-color","options"]))),128))],4),Rl.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-stepbar-crosshair-line",style:e.normalizeStyle(dn.value)},null,4)):e.createCommentVNode("",!0)],4)],544)],4)):e.createCommentVNode("",!0)]),Bl.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:Me.value+"px",height:mt.value+"px",backgroundImage:`url('${tl.value}')`,backgroundRepeat:"no-repeat",...zn.value,opacity:Zl.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gn.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:Tt.value+"px",height:Tt.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(m=>pl(l),["stop"]),onMouseenter:m=>os(l,m),onMouseleave:as},[e.createElementVNode("img",{src:ao(l),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,_c)],44,Bc)),[[e.vShow,hn.value]])),128)),Ft.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:Ft.value.x+"px",top:Ft.value.y+"px"})},[e.createElementVNode("div",Mc,e.toDisplayString(Ft.value.categoryValue),1),Ft.value.description?(e.openBlock(),e.createElementBlock("div",$c,e.toDisplayString(Ft.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Et.value&&(Te.value.show||Se.value&&Le.value.show&&!ne.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":Se.value&&Le.value.show&&!ne.value.isZooming,"dss-spider-tooltip":vl.value&&Te.value.spiderAreas&&Te.value.spiderAreas.length>0}]),style:e.normalizeStyle(vs.value)},[!Se.value||!Le.value.show||ne.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[vl.value&&Te.value.spiderAreas&&Te.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",Lc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Te.value.spiderAreas,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-area-${r}`,class:"dss-spider-tooltip-area"},[e.createElementVNode("div",Tc,[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",Dc,e.toDisplayString(m.label),1),e.createElementVNode("span",Ac,e.toDisplayString(m.value),1)]))),128))]))),128))])):Ot.value&&Te.value.bubbleData&&Te.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",Hc,[Te.value.title?(e.openBlock(),e.createElementBlock("div",Rc,e.toDisplayString(Te.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Fc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Te.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",Ic,[e.createElementVNode("div",zc,e.toDisplayString(Te.value.title),1),e.createElementVNode("div",Pc,e.toDisplayString(Te.value.value),1)])),Te.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[Dt(Te.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Oc,[o[5]||(o[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Wc,e.toDisplayString(e.unref(N)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dt(Te.value.categoryIndex).flagGroups,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${r}`},[e.createElementVNode("div",qc,[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",Zc,[e.createElementVNode("div",Uc,e.toDisplayString(m.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Dt(Te.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Yc,[o[6]||(o[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Xc,e.toDisplayString(e.unref(N)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dt(Te.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",jc,[e.createElementVNode("div",Kc,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",Gc,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",Qc,[e.createElementVNode("div",Jc,e.toDisplayString(fl.value?Lo():Ot.value?ns():_.categories[Le.value.categoryIndex]||`Category ${Le.value.categoryIndex+1}`),1),Ot.value?(e.openBlock(),e.createElementBlock("div",eu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Le.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(Le.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",tu,e.toDisplayString(l.seriesName)+":",1),e.createElementVNode("span",lu,e.toDisplayString(Vl(l.value)),1)]))),128))]),Dt(Le.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",nu,[o[7]||(o[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ou,e.toDisplayString(e.unref(N)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dt(Le.value.categoryIndex).flagGroups,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${r}`},[e.createElementVNode("div",au,[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",su,[e.createElementVNode("div",ru,e.toDisplayString(m.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Dt(Le.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",iu,[o[8]||(o[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",cu,e.toDisplayString(e.unref(N)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dt(Le.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",uu,[e.createElementVNode("div",du,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",mu,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),$l.value&&bt.value&&ne.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:lo},[o[9]||(o[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(ne.value.scale*100))+"% "+e.toDisplayString(e.unref(N)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Pr),fe.value&&Fe.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":tt.value==="horizontal","dss-legend-vertical":tt.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(Z.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":F.value.has(r),"dss-legend-hovered":z.value===r,"dss-legend-dimmed":z.value!==null&&z.value!==r}]),onClick:m=>ma(r),onMouseenter:m=>Qn(r),onMouseleave:oo,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":vl.value&&It(l)}]),style:e.normalizeStyle({backgroundColor:vl.value&&It(l)?"transparent":Ol(l,r),borderColor:Ol(l,r)})},null,6),e.createElementVNode("span",vu,e.toDisplayString(l.name),1)],46,pu))),128))],2)):e.createCommentVNode("",!0),st.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:st.value.x+"px",top:st.value.y+"px"}),onClick:o[0]||(o[0]=e.withModifiers(()=>{},["stop"]))},[jt.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:Ho},e.toDisplayString(e.unref(N)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),jt.value.addMarker&&(jt.value.downloadSvg||jt.value.downloadPng||jt.value.downloadCsv||Kt.value.length>0)?(e.openBlock(),e.createElementBlock("div",fu)):e.createCommentVNode("",!0),jt.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:qn},e.toDisplayString(e.unref(N)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),jt.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:la},e.toDisplayString(e.unref(N)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),jt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:na},e.toDisplayString(e.unref(N)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Kt.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[jt.value.downloadSvg||jt.value.downloadPng||jt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",hu)):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",gu)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Do(l)),style:e.normalizeStyle(Wn(l)),onClick:m=>eo(l)},[l.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:Jo(l),class:"dss-custom-menu-content"},null,8,ku)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.icon?(e.openBlock(),e.createElementBlock("span",Cu,e.toDisplayString(l.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)],64))],14,yu)],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:Il},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:o[3]||(o[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",bu,[e.createElementVNode("h3",null,e.toDisplayString(On.value?e.unref(N)("chart.modalMarker.viewMarker"):Gn.value?e.unref(N)("chart.modalMarker.editMarker"):e.unref(N)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:Il},"×")]),e.createElementVNode("div",wu,[e.createElementVNode("div",xu,[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":Kn.value,"max-date":jo.value,disabled:On.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",Eu,[e.createElementVNode("label",Su,e.toDisplayString(e.unref(N)("chart.modalMarker.description")),1),On.value?(e.openBlock(),e.createElementBlock("div",Vu,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(N)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,Nu)),[[e.vModelText,Ze.value.description]])])]),e.createElementVNode("div",Bu,[e.createElementVNode("div",_u,[Gn.value&&!On.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:_n},e.toDisplayString(e.unref(N)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Mu,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:Il},e.toDisplayString(On.value?e.unref(N)("chart.modalMarker.close"):e.unref(N)("chart.modalMarker.cancel")),1),On.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:xn,disabled:!(Ze.value.description&&Ze.value.description.length)},e.toDisplayString(Gn.value?e.unref(N)("chart.modalMarker.save"):e.unref(N)("chart.contextMenu.addMarker")),9,$u))])])])])):e.createCommentVNode("",!0)],64))}}),Du={class:"dss-modal-title"},Au={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(_,{emit:J}){const N=_,L=J,oe=e.ref(null),W=e.ref(null),A=e.computed(()=>{const K={"max-width":N.width};return N.height!=="auto"&&(K.height=N.height,K["min-height"]="0"),K}),de=e.computed(()=>({}));function dt(){L("close-modal")}function ee(){N.backDrop&&!oe.value&&L("close-modal")}function h(K){K.target.tagName==="INPUT"&&(oe.value=K.target.tagName)}function we(){setTimeout(()=>{oe.value=null},300)}function ye(){const K=document.body,he=document.documentElement;W.value={bodyOverflow:K.style.overflow,bodyPosition:K.style.position,bodyTop:K.style.top,bodyWidth:K.style.width,htmlOverflow:he.style.overflow,scrollY:window.scrollY},K.style.overflow="hidden",K.style.position="fixed",K.style.top=`-${W.value.scrollY}px`,K.style.width="100%",K.style.left="0",he.style.overflow="hidden"}function Q(){if(!W.value)return;const K=document.body,he=document.documentElement,{bodyOverflow:Re,bodyPosition:ge,bodyTop:Ae,bodyWidth:Z,htmlOverflow:ze,scrollY:Ye}=W.value;K.style.overflow=Re||"",K.style.position=ge||"",K.style.top=Ae||"",K.style.width=Z||"",K.style.left="",he.style.overflow=ze||"",window.scrollTo(0,Ye||0)}return e.watch(()=>N.showModal,K=>{if(K)ye(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const he=document.getElementById("dss-modal-backdrop");he&&(he.addEventListener("focusin",h),he.addEventListener("focusout",we))},100);else{Q(),document.body.classList.remove("dss-modal-open");const he=document.getElementById("dss-modal-backdrop");he&&(he.removeEventListener("focusin",h),he.removeEventListener("focusout",we))}},{immediate:!0}),e.onUnmounted(()=>{N.showModal&&Q()}),(K,he)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[_.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:ee},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(A.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:he[0]||(he[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":_.headerType,"font-size":_.titleSize})},[e.createElementVNode("h1",Du,[e.renderSlot(K.$slots,"title",{},()=>[he[1]||(he[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(K.$slots,"title-data"),_.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:dt,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(de.value)},[e.renderSlot(K.$slots,"content",{},()=>[he[2]||(he[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Au,[e.renderSlot(K.$slots,"actions")])])],4),[[e.vShow,_.showModal]])])):e.createCommentVNode("",!0)]))}},Hu={key:0,class:"dss-table-toolbar"},Ru={class:"dss-table-toolbar-left"},Fu=["aria-expanded"],Iu={class:"dss-pagination-select-dropdown",role:"listbox"},zu={class:"dss-table-column-visibility-label"},Pu={class:"dss-table-checkbox-wrapper"},Ou=["checked","onChange"],Wu={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},qu={class:"dss-table-column-visibility-text"},Zu={class:"dss-table-toolbar-right"},Uu=["placeholder","aria-label"],Yu=["aria-label"],Xu=["aria-label","aria-expanded"],ju={key:1,class:"dss-table-toolbar-extra"},Ku={class:"dss-table-thead"},Gu={key:0,class:"dss-table-th dss-table-selection-column"},Qu={key:0,class:"dss-table-checkbox-wrapper"},Ju=["checked","indeterminate"],ed={key:0,class:"dss-table-checkbox__indeterminate"},td={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},ld=["aria-label"],nd=["onClick"],od={class:"dss-table-th-content"},ad={class:"dss-table-th-text"},sd={key:0},rd={key:1},id={key:2},cd=["data-filter-column-key","aria-expanded","aria-label","onClick"],ud={class:"dss-table-tbody"},dd=["onClick"],md={class:"dss-table-checkbox-wrapper"},pd=["type","name","checked","disabled","onChange"],vd={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},fd={key:1,class:"dss-table-checkbox__dot"},hd=["onClick"],gd=["aria-expanded","aria-label"],yd={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},kd={key:0,class:"dss-table-expansion-row"},Cd=["colspan"],bd=["colspan"],wd={key:1,class:"dss-table-pagination"},xd={class:"dss-table-pagination-left"},Ed={key:0},Sd={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},Vd={class:"dss-table-pagination-center"},Nd={key:0,class:"dss-pagination-controls"},Bd=["disabled","title"],_d=["disabled","title"],Md=["aria-label","onKeydown"],$d={class:"dss-pagination-of"},Ld=["disabled","title"],Td=["disabled","title"],Dd={class:"dss-table-pagination-right"},Ad={class:"dss-pagination-rows-label"},Hd=["aria-expanded"],Rd=["aria-selected","onClick"],Fd={key:0,class:"dss-table-filter-row"},Id=["value","placeholder"],zd=["min","max","value"],Pd=["min","max","value"],Od={class:"dss-table-filter-double-range-values"},Wd={key:2,class:"dss-table-filter-daterange"},qd={class:"dss-table-filter-daterange-row"},Zd={class:"dss-table-filter-daterange-label"},Ud=["value"],Yd={class:"dss-table-filter-daterange-row"},Xd={class:"dss-table-filter-daterange-label"},jd=["value"],Kd=["value","placeholder"],Gd={class:"dss-table-filter-list"},Qd=["checked","onChange"],Jd={class:"dss-table-filter-actions"},e1={name:"DSSTable"},t1=Object.assign(e1,{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:_=>typeof _=="object"&&_!==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(_,{emit:J}){const{t:N,locale:L}=ho.useI18n(),oe=_,W=J,A={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 de(f,g){const S=Object.assign({},f);return dt(f)&&dt(g)&&Object.keys(g).forEach(F=>{dt(g[F])?F in f?S[F]=de(f[F],g[F]):Object.assign(S,{[F]:g[F]}):Object.assign(S,{[F]:g[F]})}),S}function dt(f){return f&&typeof f=="object"&&!Array.isArray(f)}const ee=e.computed(()=>de(A,oe.options)),h=e.computed(()=>{const f=ee.value.table.width;return f==="auto"?null:typeof f=="number"?f:null}),we=e.computed(()=>ee.value.table.height),ye=e.computed(()=>ee.value.table.rowHeight??"auto"),Q=e.computed(()=>({height:ye.value})),K=e.computed(()=>ee.value.table.expandable===!0),he=e.computed(()=>ee.value.table.expandableRowData??null),Re=e.computed(()=>ee.value.table.expandableRowCondition??null),ge=e.computed(()=>ee.value.table.truncated===!0),Ae=e.computed(()=>ee.value.table.striped),Z=e.computed(()=>ee.value.table.bordered),ze=e.computed(()=>ee.value.table.hoverable),Ye=e.computed(()=>ee.value.table.size),_e=e.computed(()=>ee.value.table.align||"left");e.computed(()=>ee.value.title.text),e.computed(()=>ee.value.subtitle.text);const Xe=e.computed(()=>ee.value.selection.enabled),U=e.computed(()=>ee.value.selection.mode),He=e.computed(()=>ee.value.selection.rowCondition??null),Ke=e.computed(()=>ee.value.sorting.enabled),ke=e.computed(()=>ee.value.sorting.mode),Me=e.computed(()=>ee.value.pagination.enabled),rt=e.computed(()=>ee.value.pagination.rows),yt=e.computed(()=>ee.value.pagination.rowsPerPageOptions),mt=e.computed(()=>ee.value.pagination.showCounter!==!1),Qt=e.computed(()=>ee.value.pagination.showControlsGroup),xe=e.computed(()=>Qt.value===!1?!1:ee.value.pagination.showControls!==!1),Jt=e.computed(()=>Qt.value===!1?!1:ee.value.pagination.showRowsPerPage!==!1),et=e.computed(()=>Me.value&&(mt.value||xe.value||Jt.value)),lt=e.computed(()=>ee.value.scrollable),kt=e.computed(()=>ee.value.emptyMessage||N("table.emptyMessage")),Rt=e.computed(()=>ee.value.toolbar?.downloads?.pdf!==!1),ct=e.computed(()=>ee.value.toolbar?.downloads?.excel!==!1),ht=e.computed(()=>ee.value.toolbar?.search!==!1),pt=e.computed(()=>Rt.value||ct.value||ht.value||Xt.value),Xt=e.computed(()=>ee.value.toolbar?.columnVisibility!==!1),Ct=e.ref(""),Pt=e.ref(!1),pe=e.ref(null);let H=null;function Y(){Pt.value?(H&&(clearTimeout(H),H=null),Pt.value=!1,Ct.value="",W("search",""),pe.value?.blur()):(Pt.value=!0,H=setTimeout(()=>{H=null,pe.value?.focus()},80))}function ie(){Ct.value||(Pt.value=!1)}function fe(){Ct.value="",W("search",""),pe.value?.focus()}const Fe=e.computed(()=>({"dss-table-striped":Ae.value,"dss-table-bordered":Z.value,"dss-table-hoverable":ze.value,[`dss-table-${Ye.value}`]:Ye.value!=="default","dss-table-truncated":ge.value})),tt=(f,g)=>f?.field??f?.key??g,Et=e.ref(new Set);function Se(){const f=new Set;return oe.columns.forEach((g,S)=>{g?.hidden!==!0&&f.add(tt(g,S))}),f}function ot(){const f=new Set;return oe.columns.forEach((g,S)=>{f.add(tt(g,S))}),f}function bt(f){if(!Array.isArray(f))return null;const g=ot(),S=[];return f.forEach(F=>{g.has(F)&&S.push(F)}),S}function el(){Et.value=Se()}const re=e.computed(()=>{const f=bt(oe.columnVisibility);return f===null?null:new Set(f)}),X=e.computed(()=>re.value??Et.value),te=e.computed(()=>oe.columns.filter((f,g)=>X.value.has(tt(f,g)))),ce=f=>{const g=oe.columns.findIndex(S=>S===f);return tt(f,g>=0?g:0)},Ve=(f,g)=>X.value.has(tt(f,g));function nt(f){W("update:columnVisibility",Array.from(f))}function xt(f,g){const S=tt(f,g),F=new Set(X.value);F.has(S)?F.delete(S):F.add(S),re.value===null&&(Et.value=F),nt(F)}const dl=e.ref(null),Vt=e.ref(!1);function sl(f){dl.value&&!dl.value.contains(f.target)&&(Vt.value=!1)}const D=e.computed(()=>te.value.length+(Xe.value?1:0)+(K.value?1:0)),V=(f,g)=>f?.id??f?.key??g,B=e.ref(new Set),ae=e.ref(null),se=(f,g)=>B.value.has(V(f,g)),je=(f,g)=>{if(!K.value)return!1;if(typeof Re.value=="function")return!!Re.value(f,g);if(typeof he.value=="string"&&he.value.trim()){const S=qe(f,he.value.trim());return Array.isArray(S)?S.length>0:S&&typeof S=="object"?Object.keys(S).length>0:S!=null&&S!==""}return!0},St=(f,g,S)=>{if(S&&S.stopPropagation(),!je(f,g))return;const F=V(f,g),z=new Set(B.value);z.has(F)?(z.delete(F),W("row-collapse",{data:f,index:g})):(z.add(F),W("row-expand",{data:f,index:g})),B.value=z},ut=(f,g)=>{if(!ge.value)return;const S=V(f,g);ae.value!==S&&(ae.value=S)},Ge=e.ref(null),_t=e.ref(0),Nt=e.ref([]),vt=f=>{if(ke.value==="single")return Ge.value===f.field?_t.value:0;{const g=Nt.value.find(S=>S.field===f.field);return g?g.order:0}},Lt=f=>{const g=vt(f);return{"dss-sort-active":g!==0,"dss-sort-asc":g===1,"dss-sort-desc":g===-1}},Ht=e.ref({}),Mt=e.ref(null),wl=e.ref(null),jl=220,El=e.ref(null),rl=e.computed(()=>te.value.find(f=>ce(f)===Mt.value)??null),ml=e.computed(()=>{if(!rl.value||rl.value.filter!=="range")return null;const f=rl.value,g=Mt.value,{min:S,max:F}=mn(f),z=f.filterMin??S,Qe=f.filterMax??F,Te=zl(g),Ft=Te.min??z,Le=Te.max??Qe,st=Qe-z,ne=st===0?0:(Ft-z)/st*100,ll=st===0?100:(Le-z)/st*100;return{rangeMin:z,rangeMax:Qe,currentMin:Ft,currentMax:Le,minPct:ne,maxPct:ll}}),un=e.ref(null),yl=e.ref("max");function ft(f){const g=un.value,S=ml.value;if(!g||!S)return;const F=g.getBoundingClientRect(),Qe=(f.clientX-F.left)/F.width*100,Te=(S.minPct+S.maxPct)/2;yl.value=Qe<Te?"min":"max"}function zl(f){return Ht.value[f]??{}}function Kl(f,g){Ht.value={...Ht.value,[f]:g}}function Hl(f){const g=Ht.value[f];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 Rn(f){const g={...Ht.value};delete g[f],Ht.value=g,Mt.value=null,wl.value=null}function Gl(){if(!Mt.value){wl.value=null;return}const f=El.value;if(!f)return;const g=f.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${Mt.value}"]`);if(!g)return;const S=g.getBoundingClientRect();wl.value={top:S.bottom+6,left:Math.max(8,S.right-jl)}}const bn=e.computed(()=>{const f=String(Ct.value??"").trim().toLowerCase();return f?oe.data.filter(g=>te.value.some(S=>nn(Ce(g,S)).some(z=>String(z).toLowerCase().includes(f)))):oe.data}),Bn=e.computed(()=>{let f=[...bn.value];const g=(Ct.value??"").trim().toLowerCase();return g&&(f=f.filter(S=>oe.columns.some(F=>{if(!F||!F.field)return!1;const z=Ce(S,F);return String(z??"").toLowerCase().includes(g)}))),te.value.forEach(S=>{const F=ce(S),z=Ht.value[F];if(!z)return;const Qe=S.field;if(Qe){if(z.type==="string"&&z.value?.trim()){const Te=z.value.trim().toLowerCase();f=f.filter(Ft=>{const Le=Ce(Ft,S);return String(Le??"").toLowerCase().includes(Te)})}else if(z.type==="range")f=f.filter(Te=>{const Ft=qe(Te,Qe),Le=Number(Ft);return!(Number.isNaN(Le)||z.min!=null&&Le<z.min||z.max!=null&&Le>z.max)});else if(z.type==="dateRange"){const Te=z.from?new Date(z.from).getTime():null,Ft=z.to?new Date(z.to).getTime():null;f=f.filter(Le=>{const st=qe(Le,Qe),ne=st?new Date(st).getTime():NaN;return!(Number.isNaN(ne)||Te!=null&&ne<Te||Ft!=null&&ne>Ft)})}else if(z.type==="list"&&z.selected?.length){const Te=new Set(z.selected);f=f.filter(Ft=>nn(Ce(Ft,S)).some(st=>Te.has(st)))}}}),f});function nn(f){if(f==null)return[""];if(Array.isArray(f))return f.flatMap(nn);if(typeof f=="object"){const g=f?.label??f?.name??f?.value??f?.title;return[g!=null?String(g):String(f)]}return[String(f)]}function Rl(f){const g=new Set;return oe.data.forEach(S=>{nn(Ce(S,f)).forEach(z=>g.add(z))}),Array.from(g).sort((S,F)=>String(S).localeCompare(String(F)))}function dn(f,g){if(Mt.value===f){Mt.value=null,wl.value=null;return}if(Mt.value=f,g?.currentTarget){const S=g.currentTarget.getBoundingClientRect();wl.value={top:S.bottom+6,left:Math.max(8,S.right-jl)}}else Gl()}function Sl(f,g){Kl(f,{type:"string",value:g})}function mn(f){const g=f.field;if(!g)return{min:0,max:100};let S=1/0,F=-1/0;return oe.data.forEach(z=>{const Qe=qe(z,g),Te=Number(Qe);Number.isNaN(Te)||(S=Math.min(S,Te),F=Math.max(F,Te))}),{min:S===1/0?0:S,max:F===-1/0?100:F}}function Wl(f,g,S){const F={...zl(f),type:"range"},z=S===""?null:Number(S),Qe=z===null||Number.isNaN(z)?null:z;F[g]=Qe,Qe!=null&&(g==="min"&&F.max!=null&&Qe>F.max&&(F.max=Qe),g==="max"&&F.min!=null&&Qe<F.min&&(F.min=Qe)),Kl(f,F)}function pn(f,g,S){const F={...zl(f),type:"dateRange"};F[g]=S||"",Kl(f,F)}const on=e.reactive({});function il(f,g){on[f]=g}function jn(f){const g=ce(f),S=(on[g]??"").trim().toLowerCase(),F=Rl(f);return S?F.filter(z=>String(z).toLowerCase().includes(S)):F}function Fn(f,g){return(zl(f).selected??[]).includes(g!=null?String(g):"")}function ql(f,g){const F=[...zl(f).selected??[]],z=g!=null?String(g):"",Qe=F.indexOf(z);Qe>=0?F.splice(Qe,1):F.push(z),Kl(f,{type:"list",selected:F})}function vn(f){Mt.value&&!f.target.closest(".dss-table-filter-wrap")&&!f.target.closest(".dss-table-filter-dropdown")&&(Mt.value=null,wl.value=null)}function Ll(){Gl(),Kt.value&&Nl()}const In=f=>{if(!(f.sortable===!1||!Ke.value))if(ke.value==="single")Ge.value===f.field?_t.value=_t.value===1?-1:_t.value===-1?0:1:(Ge.value=f.field,_t.value=1),_t.value===0&&(Ge.value=null),W("sort",{field:Ge.value,order:_t.value});else{const g=Nt.value.findIndex(S=>S.field===f.field);g>=0?Nt.value[g].order===1?Nt.value[g].order=-1:Nt.value.splice(g,1):Nt.value.push({field:f.field,order:1}),W("sort",{multiSortMeta:Nt.value})}},fn=e.computed(()=>{if(!Ke.value)return Bn.value;let f=[...Bn.value];return ke.value==="single"&&Ge.value&&_t.value!==0?f.sort((g,S)=>{const F=qe(g,Ge.value),z=qe(S,Ge.value);return F===z?0:F==null?1:z==null?-1:(F<z?-1:F>z?1:0)*_t.value}):ke.value==="multiple"&&Nt.value.length>0&&f.sort((g,S)=>{for(const F of Nt.value){const z=qe(g,F.field),Qe=qe(S,F.field);if(z===Qe)continue;if(z==null)return 1;if(Qe==null)return-1;const Te=z<Qe?-1:z>Qe?1:0;if(Te!==0)return Te*F.order}return 0}),f}),cl=e.ref(0),jt=e.ref(rt.value),Kt=e.ref(!1),Yt=e.ref(null),Tl=e.ref(null),Tt=e.ref("bottom"),wt=e.ref(null),Vl=f=>{jt.value=f,Kt.value=!1,cl.value=0,W("page",{page:0,rows:jt.value})};function hn(f){Yt.value&&!Yt.value.contains(f.target)&&(Kt.value=!1)}function Nl(){const f=Yt.value,g=Tl.value;if(!f||!g)return;const S=f.querySelector(".dss-pagination-select-dropdown");if(!S)return;const F=g.getBoundingClientRect(),z=S.offsetHeight||0,Te=(window.innerHeight||document.documentElement.clientHeight)-F.bottom,Ft=F.top;Tt.value=Te<z+8&&Ft>Te?"top":"bottom",wt.value={width:`${Math.ceil(F.width)}px`,left:`${Math.max(0,Math.round(g.offsetLeft))}px`}}const gn=e.computed(()=>fn.value.length),Bl=e.computed(()=>Math.ceil(gn.value/jt.value)),Zl=e.computed(()=>Math.max(Bl.value,1)),an=e.computed(()=>gn.value===0?0:Gt.value+1),Dl=e.computed(()=>zn.value),Gt=e.computed(()=>Me.value?cl.value*jt.value:0),zn=e.computed(()=>Me.value?Math.min((cl.value+1)*jt.value,gn.value):gn.value),Pl=e.computed(()=>{if(!Me.value)return fn.value;const f=Gt.value,g=zn.value;return fn.value.slice(f,g)}),Dt=e.ref(new Set),Pn=e.computed(()=>fn.value.filter((f,g)=>Dt.value.has(V(f,g)))),tl=(f,g)=>{const S=He.value;return typeof S!="function"?!0:!!S(f,g)},_l=e.computed(()=>fn.value.map((f,g)=>({row:f,index:g})).filter(({row:f,index:g})=>tl(f,g))),yn=e.computed(()=>{const f=_l.value;return f.length===0?!1:f.every(({row:g,index:S})=>Dt.value.has(V(g,S)))}),sn=e.computed(()=>{const f=_l.value;if(f.length===0)return!1;const g=f.filter(({row:S,index:F})=>Dt.value.has(V(S,F))).length;return g>0&&g<f.length}),Fl=(f,g)=>Dt.value.has(V(f,g)),ul=()=>{if(yn.value)Dt.value=new Set,W("unselect-all");else{const f=new Set;_l.value.forEach(({row:g,index:S})=>f.add(V(g,S))),Dt.value=f,W("select-all",Pn.value)}},Ql=(f,g)=>{if(!tl(f,g))return;const S=V(f,g),F=new Set(Dt.value),z=F.has(S);U.value==="single"?z?(F.delete(S),W("row-unselect",f)):(F.clear(),F.add(S),W("row-select",f)):z?(F.delete(S),W("row-unselect",f)):(F.add(S),W("row-select",f)),Dt.value=F},Ul=e.ref("1"),k=()=>{const f=Number.parseInt(String(Ul.value),10);if(!Number.isFinite(f)){Ul.value=String(cl.value+1);return}const g=Math.min(Zl.value,Math.max(1,f));g!==cl.value+1?w(g-1):Ul.value=String(g)},w=f=>{f<0||f>=Bl.value||(cl.value=f,W("page",{page:f,rows:jt.value}))},E=(f,g,S)=>{W("row-click",{data:f,index:g,originalEvent:S}),ut(f,Gt.value+g)},j=(f,g)=>{const S=Gt.value+g;return{"dss-table-row-selected":Fl(f,S),"dss-table-row-even":g%2===0,"dss-table-row-odd":g%2!==0,"dss-table-row-truncated-clickable":ge.value,"dss-table-row-truncated-expanded":ae.value===V(f,S)}},Ce=(f,g)=>g.field?qe(f,g.field):"",qe=(f,g)=>g.split(".").reduce((S,F)=>S&&S[F],f),Ie=f=>{const g=f.align??_e.value;return{"dss-table-sortable":f.sortable!==!1&&Ke.value,"dss-table-align-left":g==="left","dss-table-align-center":g==="center","dss-table-align-right":g==="right",[f.className]:f.className}},at=f=>{const g={};return f.width&&(g.width=typeof f.width=="number"?`${f.width}px`:f.width),f.minWidth&&(g.minWidth=typeof f.minWidth=="number"?`${f.minWidth}px`:f.minWidth),f.maxWidth&&(g.maxWidth=typeof f.maxWidth=="number"?`${f.maxWidth}px`:f.maxWidth),g};return e.watch(()=>oe.locale,f=>{f&&f!==L.value&&(L.value=f)},{immediate:!0}),e.watch(rt,f=>{jt.value=f,cl.value=0}),e.watch(Kt,async f=>{f&&(await e.nextTick(),Nl())}),e.watch(cl,f=>{Ul.value=String(f+1)},{immediate:!0}),e.watch(Ct,f=>{W("search",f??"")}),e.watch(()=>oe.columns,()=>{if(re.value===null){el();return}const f=bt(oe.columnVisibility)??[];f.length!==oe.columnVisibility.length&&W("update:columnVisibility",f)},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",hn),document.addEventListener("click",sl),document.addEventListener("click",vn),window.addEventListener("resize",Ll),window.addEventListener("scroll",Ll,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",hn),document.removeEventListener("click",sl),document.removeEventListener("click",vn),window.removeEventListener("resize",Ll),window.removeEventListener("scroll",Ll,!0)}),(f,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:El,style:e.normalizeStyle({width:h.value+"px",height:we.value?we.value+"px":"auto"})},[pt.value?(e.openBlock(),e.createElementBlock("div",Hu,[e.createElementVNode("div",Ru,[Rt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:g[0]||(g[0]=S=>W("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(N)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),ct.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:g[1]||(g[1]=S=>W("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(N)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),Xt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:dl},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Vt.value}]),onClick:g[2]||(g[2]=S=>Vt.value=!Vt.value),"aria-expanded":Vt.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(N)("table.columnVisibility"))+" ",1),g[24]||(g[24]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Fu),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Iu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.columns,(S,F)=>(e.openBlock(),e.createElementBlock("li",{key:tt(S,F),role:"option",class:"dss-table-column-visibility-option",onClick:g[3]||(g[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",zu,[e.createElementVNode("span",Pu,[e.createElementVNode("input",{type:"checkbox",checked:Ve(S,F),onChange:z=>xt(S,F),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Ou),Ve(S,F)?(e.openBlock(),e.createElementBlock("span",Wu,[...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",qu,e.toDisplayString(S.header),1)])]))),128))],512),[[e.vShow,Vt.value]])]),_:1})],512)):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"header")]),e.createElementVNode("div",Zu,[ht.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":Pt.value||Ct.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:pe,"onUpdate:modelValue":g[4]||(g[4]=S=>Ct.value=S),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(N)("table.searchPlaceholder"),"aria-label":e.unref(N)("table.searchTableAriaLabel"),onFocus:g[5]||(g[5]=S=>Pt.value=!0),onBlur:ie},null,40,Uu),[[e.vModelText,Ct.value]]),Ct.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":e.unref(N)("table.clearSearchAriaLabel"),onClick:fe},[...g[26]||(g[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,Yu)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref(N)("table.searchAriaLabel"),"aria-expanded":Pt.value||!!Ct.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,Xu)],2)):e.createCommentVNode("",!0),f.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",ju,[e.renderSlot(f.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":lt.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",Fe.value])},[e.createElementVNode("thead",Ku,[e.createElementVNode("tr",null,[Xe.value?(e.openBlock(),e.createElementBlock("th",Gu,[U.value==="multiple"?(e.openBlock(),e.createElementBlock("span",Qu,[e.createElementVNode("input",{type:"checkbox",checked:yn.value,indeterminate:sn.value,onChange:ul,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Ju),sn.value?(e.openBlock(),e.createElementBlock("span",ed)):yn.value?(e.openBlock(),e.createElementBlock("span",td,[...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),K.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:"dss-table-th dss-table-expansion-column","aria-label":e.unref(N)("table.expandRowAriaLabel")},null,8,ld)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,(S,F)=>(e.openBlock(),e.createElementBlock("th",{key:ce(S),class:e.normalizeClass(["dss-table-th",Ie(S)]),style:e.normalizeStyle(at(S)),onClick:z=>In(S)},[e.createElementVNode("div",od,[e.createElementVNode("span",ad,e.toDisplayString(S.header),1),S.sortable!==!1&&Ke.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",Lt(S)])},[vt(S)===0?(e.openBlock(),e.createElementBlock("span",sd,[...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)])])):vt(S)===1?(e.openBlock(),e.createElementBlock("span",rd,[...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)])])):vt(S)===-1?(e.openBlock(),e.createElementBlock("span",id,[...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),S.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":Mt.value===ce(S)}]),onClick:g[6]||(g[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":Hl(ce(S))}]),"data-filter-column-key":ce(S),"aria-expanded":Mt.value===ce(S),"aria-label":e.unref(N)("table.filterColumnAriaLabel"),onClick:z=>dn(ce(S),z)},[...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,cd)],2)):e.createCommentVNode("",!0)])],14,nd))),128))])]),e.createElementVNode("tbody",ud,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pl.value,(S,F)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:V(S,Gt.value+F)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",j(S,F)]),style:e.normalizeStyle(Q.value),onClick:z=>E(S,F,z)},[Xe.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",md,[e.createElementVNode("input",{type:U.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${_.tableId}`,checked:Fl(S,Gt.value+F),disabled:!tl(S,Gt.value+F),onChange:z=>Ql(S,Gt.value+F),class:e.normalizeClass(["dss-table-checkbox",U.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio",{"dss-table-checkbox--disabled":!tl(S,Gt.value+F)}])},null,42,pd),U.value==="multiple"&&Fl(S,Gt.value+F)?(e.openBlock(),e.createElementBlock("span",vd,[...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)])])):U.value==="single"&&Fl(S,Gt.value+F)?(e.openBlock(),e.createElementBlock("span",fd)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),K.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(z=>St(S,Gt.value+F,z),["stop"])},[je(S,Gt.value+F)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":se(S,Gt.value+F),"aria-label":se(S,Gt.value+F)?e.unref(N)("table.collapseRowAriaLabel"):e.unref(N)("table.expandRowAriaLabel")},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":se(S,Gt.value+F)}]),"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,gd)):(e.openBlock(),e.createElementBlock("span",yd))],8,hd)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,(z,Qe)=>(e.openBlock(),e.createElementBlock("td",{key:ce(z),class:e.normalizeClass(["dss-table-td",Ie(z)]),style:e.normalizeStyle(at(z))},[e.renderSlot(f.$slots,`cell-${z.field}`,{data:S,column:z,rowIndex:F,isExpanded:ae.value===V(S,Gt.value+F)},()=>[e.createTextVNode(e.toDisplayString(Ce(S,z)),1)])],6))),128))],14,dd),K.value&&je(S,Gt.value+F)&&se(S,Gt.value+F)?(e.openBlock(),e.createElementBlock("tr",kd,[e.createElementVNode("td",{colspan:D.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(f.$slots,"expansion",{data:S,rowIndex:F})],8,Cd)])):e.createCommentVNode("",!0)],64))),128)),Pl.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(Q.value)},[e.createElementVNode("td",{colspan:D.value,class:"dss-table-empty-cell"},[e.renderSlot(f.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(kt.value),1)])],8,bd)],4))])],2)],2),et.value?(e.openBlock(),e.createElementBlock("div",wd,[e.createElementVNode("div",xd,[mt.value?(e.openBlock(),e.createElementBlock("span",Ed,e.toDisplayString(e.unref(N)("table.showingRange",{start:an.value,end:Dl.value,total:gn.value})),1)):(e.openBlock(),e.createElementBlock("span",Sd," "))]),e.createElementVNode("div",Vd,[xe.value?(e.openBlock(),e.createElementBlock("div",Nd,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:cl.value===0,onClick:g[8]||(g[8]=S=>w(0)),title:e.unref(N)("table.firstPage")},[...g[35]||(g[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,Bd),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:cl.value===0,onClick:g[9]||(g[9]=S=>w(cl.value-1)),title:e.unref(N)("table.previousPage")}," ‹ ",8,_d),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":g[10]||(g[10]=S=>Ul.value=S),type:"text",class:"dss-pagination-page-input","aria-label":e.unref(N)("table.currentPageAriaLabel"),onBlur:k,onKeydown:e.withKeys(e.withModifiers(k,["prevent"]),["enter"])},null,40,Md),[[e.vModelText,Ul.value]]),e.createElementVNode("span",$d,e.toDisplayString(e.unref(N)("table.ofPages",{total:Zl.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:cl.value>=Bl.value-1,onClick:g[11]||(g[11]=S=>w(cl.value+1)),title:e.unref(N)("table.nextPage")}," › ",8,Ld),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:cl.value>=Bl.value-1,onClick:g[12]||(g[12]=S=>w(Bl.value-1)),title:e.unref(N)("table.lastPage")},[...g[36]||(g[36]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,Td)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Dd,[Jt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:Yt},[e.createElementVNode("span",Ad,e.toDisplayString(e.unref(N)("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]=S=>Kt.value=!Kt.value),"aria-expanded":Kt.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:Tl},[e.createTextVNode(e.toDisplayString(jt.value)+" ",1),g[37]||(g[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Hd),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":Tt.value==="top"}]),style:e.normalizeStyle(wt.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yt.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S,role:"option","aria-selected":S===jt.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":S===jt.value}]),onClick:F=>Vl(S)},e.toDisplayString(S),11,Rd))),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(wl.value?{top:wl.value.top+"px",left:wl.value.left+"px",width:jl+"px"}:void 0),onClick:g[21]||(g[21]=e.withModifiers(()=>{},["stop"]))},[rl.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[rl.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",Fd,[e.createElementVNode("input",{type:"text",value:zl(Mt.value).value??"",onInput:g[14]||(g[14]=S=>Sl(Mt.value,S.target.value)),class:"dss-table-filter-input",placeholder:e.unref(N)("table.search")},null,40,Id)])):rl.value.filter==="range"&&ml.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":ml.value.minPct+"%","--range-max-pct":ml.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:un,class:"dss-table-filter-double-range-track",onMousemove:ft,onMouseenter:ft},[e.createElementVNode("input",{type:"range",min:ml.value.rangeMin,max:ml.value.rangeMax,value:ml.value.currentMin,onInput:g[15]||(g[15]=S=>Wl(Mt.value,"min",S.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:yl.value==="min"?2:1})},null,44,zd),e.createElementVNode("input",{type:"range",min:ml.value.rangeMin,max:ml.value.rangeMax,value:ml.value.currentMax,onInput:g[16]||(g[16]=S=>Wl(Mt.value,"max",S.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:yl.value==="max"?2:1})},null,44,Pd)],544),e.createElementVNode("div",Od,e.toDisplayString(ml.value.currentMin)+" – "+e.toDisplayString(ml.value.currentMax),1)],4)):rl.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",Wd,[e.createElementVNode("div",qd,[e.createElementVNode("label",Zd,e.toDisplayString(e.unref(N)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:zl(Mt.value).from??"",onInput:g[17]||(g[17]=S=>pn(Mt.value,"from",S.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Ud)]),e.createElementVNode("div",Yd,[e.createElementVNode("label",Xd,e.toDisplayString(e.unref(N)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:zl(Mt.value).to??"",onInput:g[18]||(g[18]=S=>pn(Mt.value,"to",S.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,jd)])])):rl.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:on[Mt.value]??"",onInput:g[19]||(g[19]=S=>il(Mt.value,S.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(N)("table.search")},null,40,Kd),e.createElementVNode("div",Gd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(jn(rl.value),S=>(e.openBlock(),e.createElementBlock("label",{key:S,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:Fn(Mt.value,S),onChange:F=>ql(Mt.value,S)},null,40,Qd),e.createElementVNode("span",null,e.toDisplayString(S),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",Jd,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:g[20]||(g[20]=S=>Rn(Mt.value))},e.toDisplayString(e.unref(N)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,Mt.value&&rl.value&&wl.value]])]),_:1})]))],64))}}),l1="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",n1="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",o1="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",a1="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",s1="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",r1="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",i1={class:"dss-toolbar-left"},c1=["title"],u1=["title"],d1={class:"dss-toolbar-dropdown-wrapper"},m1=["title"],p1=["src"],v1=["src"],f1=["src"],h1=["src"],g1=["src"],y1=["src"],k1={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},C1=["src"],b1=["src"],w1=["src"],x1=["src"],E1=["src"],S1=["src"],V1=["title"],N1=["title"],B1=["title"],_1=["title"],M1=["title"],$1=["title"],L1=["title"],T1=["title"],D1=["title"],A1={key:2,class:"dss-toolbar-separator"},H1=["title"],R1={key:4,class:"dss-toolbar-separator"},F1={key:5,class:"dss-toolbar-dropdown-wrapper"},I1=["title"],z1={class:"dss-toolbar-dropdown-ai"},P1={class:"dss-toolbar-right"},O1={key:0,class:"dss-toolbar-custom-group"},W1={key:1,class:"dss-toolbar-separator"},q1={class:"dss-link-modal-content"},Z1={class:"dss-link-modal-field"},U1={class:"dss-link-modal-label"},Y1=["placeholder"],X1={class:"dss-link-modal-field"},j1={class:"dss-link-modal-label"},K1=["placeholder"],G1={class:"dss-image-modal-tabs"},Q1={key:0,class:"dss-image-tab-content"},J1={class:"dss-link-modal-content"},em={class:"dss-link-modal-field"},tm={key:0,class:"dss-link-modal-label"},lm=["src"],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-link-modal-field"},um={class:"dss-link-modal-label"},dm=["placeholder"],mm={key:1,class:"dss-image-tab-content"},pm={class:"dss-link-modal-content"},vm={class:"dss-link-modal-field"},fm={class:"dss-link-modal-label"},hm=["placeholder"],gm={class:"dss-link-modal-field"},ym={class:"dss-link-modal-label"},km=["placeholder"],Cm={class:"dss-link-modal-field"},bm={class:"dss-link-modal-label"},wm=["placeholder"],xm={class:"dss-link-modal-field"},Em={class:"dss-link-modal-label"},Sm=["placeholder"],Vm={class:"dss-text-editor-title-input-container"},Nm={key:0,class:"dss-text-editor-title-preview"},Bm={key:0},_m={key:1,class:"dss-text-editor-preview-placeholder"},Mm=["value","placeholder","disabled"],$m={key:3,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},Lm={class:"dss-text-editor-description-input-container"},Tm={key:0,class:"dss-text-editor-description-preview"},Dm={key:0},Am={key:1,class:"dss-text-editor-preview-placeholder"},Hm=["value","placeholder","disabled"],Rm={key:5,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},Fm=["data-comment-id","onMouseenter"],Im=["onClick"],zm=["src","alt"],Pm={key:1},Om=["onClick"],Wm=["src","alt"],qm={key:1},Zm=["data-has-second-user","onClick"],Um={class:"editor-comment-marker-count"},Ym={key:7,class:"dss-text-editor-textarea-wrapper"},Xm=["value","placeholder","rows","disabled"],jm={class:"dss-text-editor-footer"},Km={class:"dss-text-editor-footer-content"},Gm={class:"dss-text-editor-footer-stat"},Qm={class:"dss-text-editor-footer-stat"},Jm={key:8,class:"dss-text-editor-content-wrapper"},e2={key:0,class:"dss-comment-overlay-body"},t2={class:"dss-comment-selection-wrapper"},l2=["innerHTML"],n2={class:"dss-comment-messages-wrapper"},o2={key:0,class:"dss-comment-avatar-wrapper"},a2={class:"dss-comment-avatar"},s2=["src","alt"],r2={key:1},i2={class:"dss-comment-header"},c2={class:"dss-comment-header-text"},u2={class:"dss-comment-author"},d2={key:0,class:"dss-comment-date"},m2=["onClick","title"],p2={class:"dss-comment-overlay-inner"},v2=["placeholder","onKeydown"],f2={class:"dss-text-editor-footer"},h2={class:"dss-text-editor-footer-content"},g2={class:"dss-text-editor-footer-stat"},y2={class:"dss-text-editor-footer-stat"},k2=["title"],C2=["title"],b2={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:""},w2={class:"dss-image-popup-content"},x2={key:0,class:"dss-image-popup-no-alt-icon"},E2=["title"],S2=["title"],V2={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:""},N2={class:"dss-toolbar-left"},B2=["title"],_2=["title"],M2={class:"dss-toolbar-dropdown-wrapper"},$2=["title"],L2=["src"],T2=["src"],D2=["src"],A2=["src"],H2=["src"],R2=["src"],F2={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},I2=["title"],z2=["title"],P2=["title"],O2=["title"],W2=["title"],q2=["title"],Z2=["title"],U2=["title"],Y2=["title"],X2={key:2,class:"dss-toolbar-separator"},j2=["title"],K2={key:4,class:"dss-toolbar-separator"},G2={key:5,class:"dss-toolbar-dropdown-wrapper"},Q2=["title"],J2={class:"dss-toolbar-dropdown-ai"},ep={key:0,class:"dss-toolbar-right"},tp={key:0,class:"dss-toolbar-separator"},lp={key:0,class:"dss-toolbar-custom-group"},np={key:1,class:"dss-toolbar-separator"},op={name:"DSSTextEditor"},ap=Object.assign(op,{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:_=>typeof _=="object"&&_!==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:_=>typeof _=="object"&&_!==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(_,{expose:J,emit:N}){const{t:L,locale:oe}=ho.useI18n(),W={h1:l1,h2:n1,h3:o1,h4:a1,h5:s1,h6:r1},A=_,de=N,dt=e.useSlots(),ee=`<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>`,h=e.ref(null),we=e.ref(null),ye=e.ref(!1),Q=e.ref(!1),K=e.ref(!1),he=e.ref(""),Re=e.ref({}),ge=e.ref(!1),Ae=e.ref(!1),Z=e.ref(""),Oe=e.ref(""),Ye=e.ref(null),_e=e.ref(null),Xe=e.ref(null),U=e.ref(null),He=e.ref(""),Ke=e.ref(!1),ke=e.ref({}),Me=e.ref(!1),rt=e.ref({}),gt=e.ref(null),mt=e.ref(null),Qt=e.ref(!1),xe=e.ref(""),Jt=e.ref(null),et=e.ref(""),lt=e.ref(""),yt=e.ref(""),Rt=e.ref(null),ct=e.ref(null),xt=e.ref(null),pt=e.ref(null),Xt=e.ref(null),kt=e.ref(!1),Pt=e.ref(""),pe=e.ref({}),H=e.ref(!1),Y=e.ref("upload"),re=e.ref(""),fe=e.ref(null),ze=e.ref(null),tt=e.ref([]),Et=e.ref([]),Se=e.ref(null),nt=e.ref(!1),Ct=e.ref(""),tl=e.ref(""),ie=e.ref(""),X=e.ref(""),te=e.ref(""),ce=e.ref(""),Ve=e.ref(null),ot=e.ref(null),wt=e.ref(null),dl=e.ref(!1),Vt=e.ref(null),sl=e.ref(!1),D=e.ref(!1),V=e.ref(null),B=e.ref("p"),ae=e.ref(!1),se=e.ref([]),je=e.ref(null),St=e.ref(null),ut=e.ref(null),Ge=e.ref(!1),_t=e.ref(0),Nt=100,vt=e.ref(null),Lt=e.computed(()=>!!A.commentUser),Ht=e.computed(()=>({"dss-text-editor-no-border":!A.border,"dss-text-editor-rounded":A.rounded,"dss-text-editor-full-height":A.fullHeight,"dss-comment-overlay-open":Lt.value&&Fe.value!==null})),Mt=e.computed(()=>({})),wl=e.computed(()=>!A.fixedHeight||A.fullHeight?{}:{height:`${1.6*14*A.rows+24+2}px`,resize:"none",overflowY:"auto"}),jl=e.computed(()=>!A.fixedHeight||A.fullHeight?{}:{height:`${1.6*14*A.rows+32}px`,overflowY:"auto"}),El=e.computed(()=>A.richText&&Et.value.length>0),rl=e.computed(()=>{if(!A.modelValue)return"";if(A.richText){let a=A.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 A.modelValue}),ml=e.computed(()=>{const a=rl.value.trim();return a?a.split(/\s+/).filter(n=>n.length>0).length:0}),un=e.computed(()=>rl.value.length),yl=e.computed(()=>pt.value!==null&&Y.value==="upload"&&et.value&&et.value.startsWith("data:")),ft=e.computed(()=>A.titlePlaceholder||L("textEditor.placeholders.title")),zl=e.computed(()=>A.descriptionPlaceholder||L("textEditor.placeholders.description")),Kl=e.computed(()=>A.placeholder||L("textEditor.placeholders.startTyping")),Hl=a=>dt&&dt[a]!==void 0,Rn=a=>{for(let n=a+1;n<A.customToolbarSlots.length;n++)if(Hl(A.customToolbarSlots[n]))return!0;return!1},Gl=a=>{for(let n=a+1;n<A.customToolbarSlots.length;n++){const s=A.customToolbarSlots[n];if(Hl(s)&&bn(s))return!0}return!1},bn=a=>A.customToolbarFloatingMap.hasOwnProperty(a)?A.customToolbarFloatingMap[a]===!0:!0,Bn=e.computed(()=>A.customToolbarSlots.some(a=>Hl(a)&&bn(a))),nn=e.computed(()=>Hl("title-slot")),Rl=e.computed(()=>Hl("description-slot")),dn=a=>{if(!a||a.trim()==="")return"<html></html>";const n=a.trim();return n.startsWith("<html>")&&n.endsWith("</html>")?a:`<html>${a}</html>`},Sl=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},mn=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())},Wl=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""}},pn=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=L("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"},on=a=>{const n=a.target.value;de("update:modelValue",n),de("change",n)},il=()=>{if(!Ve.value)return;const a=Ve.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")},jn=()=>{sl.value=!0,il()},Fn=()=>{sl.value=!1,ql()},ql=()=>{if(!Ve.value)return;const a=Ve.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")},vn=a=>{const s=a.target.value;sl.value&&il(),de("update:title",s),de("title-change",s),wt.value="title",A.richText&&(nt.value||(tl.value=Ct.value,te.value=ie.value,ce.value=X.value),Se.value&&clearTimeout(Se.value),nt.value=!0,Se.value=setTimeout(()=>{nt.value=!1,Tt()},500))},Ll=()=>{if(!ot.value)return;const a=ot.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")},In=()=>{D.value=!0,Ll()},fn=()=>{D.value=!1,cl()},cl=()=>{if(!ot.value)return;const a=ot.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")},jt=a=>{const s=a.target.value;D.value&&Ll(),de("update:description",s),de("description-change",s),wt.value="description",A.richText&&(nt.value||(tl.value=Ct.value,te.value=ie.value,ce.value=X.value),Se.value&&clearTimeout(Se.value),nt.value=!0,Se.value=setTimeout(()=>{nt.value=!1,Tt()},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(h.value),s.setEnd(n.startContainer,n.startOffset),{type:"text",start:s.toString().length,end:s.toString().length+n.toString().length}},Yt=a=>{if(!(!a||!h.value))try{const n=window.getSelection(),s=document.createRange();if(a.type==="element"&&a.element)if(h.value.contains(a.element)){s.setStart(a.element,a.offset),s.collapse(!0),n.removeAllRanges(),n.addRange(s);return}else{h.value.focus();return}let i=0;const c=[h.value];let d=null,u=!1,p=!1;for(;!p&&(d=c.pop());)if(d.nodeType===3){const y=i+d.length;!u&&a.start>=i&&a.start<=y&&(s.setStart(d,a.start-i),u=!0),u&&a.end>=i&&a.end<=y&&(s.setEnd(d,a.end-i),p=!0),i=y}else{let y=d.childNodes.length;for(;y--;)c.push(d.childNodes[y])}n.removeAllRanges(),n.addRange(s)}catch{h.value.focus()}},Tl=()=>{if(!h.value)return;h.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(h.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)},Tt=(a=!1)=>{if(!h.value)return;const n=h.value.innerHTML,s=A.title||"",i=A.description||"";if(!a&&n===Ct.value&&s===ie.value&&i===X.value)return;const c={content:tl.value||Ct.value,title:te.value!==void 0?te.value:ie.value,description:ce.value!==void 0?ce.value:X.value},d=tt.value.length>0?tt.value[tt.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&&(tt.value.push(c),tt.value.length>50&&tt.value.shift(),Et.value=[]),Ct.value=n,ie.value=s,X.value=i,tl.value=n,te.value=s,ce.value=i},bt=a=>{if(!h.value)return;Vl(),h.value&&mn(h.value);let n=null;h.value&&(h.value.querySelector("p")||(n=Kt(),hn()));const s=a&&a.inputType&&(a.inputType==="insertText"||a.inputType==="insertCompositionText"||a.inputType==="deleteContentBackward"||a.inputType==="deleteContentForward");s&&V.value&&(V.value=null),Q.value=!0;const i=h.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/&nbsp;|\u00A0/g," "),c=dn(i);de("update:modelValue",c),de("change",c),wt.value="editor",nt.value||(tl.value=Ct.value,te.value=ie.value,ce.value=X.value),Se.value&&clearTimeout(Se.value),nt.value=!0,Se.value=setTimeout(()=>{nt.value=!1,Tt(),lo(),io()},500),e.nextTick(()=>{n&&Yt(n),Vl();const d=["bold","italic","underline"],u=window.getSelection(),p=u.rangeCount>0?u.getRangeAt(0):null,y=p&&p.collapsed;if(d.forEach(C=>{try{if(y&&V.value?.command===C){ke.value[C]=V.value.state;return}if(C==="bold")if(p){const R=p.commonAncestorContainer,O=R.nodeType===3?R.parentElement:R;let M=!1;if(O&&((O.tagName==="STRONG"||O.tagName==="B"||O.closest&&O.closest("strong, b"))&&(M=!0),!M&&O.style&&parseInt(O.style.fontWeight)>=600&&(M=!0),!M))try{const ue=window.getComputedStyle(O);parseInt(ue.fontWeight)>=600&&(M=!0)}catch{}ke.value[C]=M}else ke.value.hasOwnProperty(C)||(ke.value[C]=!1);else if(C==="italic")if(p){const R=p.commonAncestorContainer,O=R.nodeType===3?R.parentElement:R,M=O&&(O.tagName==="EM"||O.tagName==="I"||O.closest&&O.closest("em, i"));ke.value[C]=!!M}else{const R=document.queryCommandState(C);ke.value[C]=R}else{const R=document.queryCommandState(C);ke.value[C]=R}}catch{}}),j(),Nl(),Dl(),pl(),xn(),it("handleRichTextInput"),s&&(a.inputType==="insertText"||a.inputType==="insertCompositionText")){const C=a.data||"";C&&C.length===1&&setTimeout(()=>io(C),0),(C===" "||C===`
103
- `||/[.,;:!?]/.test(C))&&setTimeout(()=>{lo()},100)}Q.value=!1})},Vl=()=>{if(!h.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 y=document.createRange();y.setStartAfter(c),y.collapse(!0),a.removeAllRanges(),a.addRange(y)}}}},hn=()=>{if(!h.value)return;const a=h.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)}})},Nl=()=>{if(h.value&&!dl.value){dl.value=!0;try{h.value.querySelectorAll(".dss-image-wrapper").forEach(i=>{i.querySelector("img")||i.remove()}),h.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()}),h.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 C=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),R=c===d||c===C;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||R||R)&&(c="")}i.setAttribute("alt",c),i.setAttribute("data-alt",c);const u=!c||c.trim()==="";let p=i.parentElement;const y=p&&p.classList.contains("dss-image-wrapper");if(y){const C=p.querySelector(".dss-image-no-alt-icon");C&&C.remove()}else{const C=i.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?i.nextElementSibling:null;C&&C.remove()}if(u){y?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 C=document.createElement("div");C.className="dss-image-no-alt-icon",C.setAttribute("contenteditable","false"),C.innerHTML=ee,p.appendChild(C)}else if(y&&p.children.length===1){const C=p.parentNode;C.insertBefore(i,p),C.removeChild(p)}})}finally{dl.value=!1}}},gn=a=>{lo(),de("blur",a),Jn()},Bl=()=>{if(A.disabled||!A.richText||!h.value)return;el(),Se.value&&(clearTimeout(Se.value),Se.value=null),nt.value&&(Tt(),nt.value=!1);const a=wt.value==="title",n=wt.value==="description",s=wt.value==="editor";if(tt.value.length===0){a&&Ve.value?Ve.value.focus():n&&ot.value?ot.value.focus():h.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{bt()});return}const i={content:h.value.innerHTML,title:A.title||"",description:A.description||""};Et.value.push(i);const c=tt.value.pop();if(c!==void 0){Q.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",p=typeof c=="object"&&c.description||"";h.value.innerHTML=d,Ct.value=d,ie.value=u,X.value=p,tl.value=d,te.value=u,ce.value=p,e.nextTick(()=>{j(),ul(),Il(),pl();const y=dn(d);de("update:modelValue",y),de("update:title",u),de("update:description",p),de("change",y),de("title-change",u),de("description-change",p),Q.value=!1,e.nextTick(()=>{setTimeout(()=>{if(a){if(Ve.value){Ve.value.focus();const C=u.length;Ve.value.setSelectionRange&&Ve.value.setSelectionRange(C,C),il()}}else if(n){if(ot.value){ot.value.focus();const C=p.length;ot.value.setSelectionRange(C,C)}}else if(s)Tl();else if(Ve.value&&document.activeElement===Ve.value){const C=u.length;Ve.value.setSelectionRange&&Ve.value.setSelectionRange(C,C),il()}else if(ot.value&&document.activeElement===ot.value){const C=p.length;ot.value.setSelectionRange(C,C)}else h.value&&Tl()},10)})})}},Zl=()=>{if(A.disabled||!A.richText||!h.value)return;el();const a=wt.value==="title",n=wt.value==="description",s=wt.value==="editor";if(Et.value.length===0){a&&Ve.value?Ve.value.focus():n&&ot.value?ot.value.focus():h.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{bt()});return}const i={content:h.value.innerHTML,title:A.title||"",description:A.description||""};tt.value.push(i);const c=Et.value.pop();if(c!==void 0){Q.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",p=typeof c=="object"&&c.description||"";h.value.innerHTML=d,Ct.value=d,ie.value=u,X.value=p,tl.value=d,te.value=u,ce.value=p,e.nextTick(()=>{j(),ul(),Il(),pl();const y=dn(d);de("update:modelValue",y),de("update:title",u),de("update:description",p),de("change",y),de("title-change",u),de("description-change",p),Q.value=!1,e.nextTick(()=>{setTimeout(()=>{if(a){if(Ve.value){Ve.value.focus();const C=u.length;Ve.value.setSelectionRange&&Ve.value.setSelectionRange(C,C),il()}}else if(n){if(ot.value){ot.value.focus();const C=p.length;ot.value.setSelectionRange(C,C)}}else if(s)Tl();else if(Ve.value&&document.activeElement===Ve.value){const C=u.length;Ve.value.setSelectionRange&&Ve.value.setSelectionRange(C,C),il()}else if(ot.value&&document.activeElement===ot.value){const C=p.length;ot.value.setSelectionRange(C,C)}else h.value&&Tl()},10)})})}},an=()=>{if(!h.value)return;h.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)}}),h.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)}}),h.value.querySelectorAll("b, strong").forEach(i=>{i.style.fontWeight="600"})},Dl=()=>{if(!h.value)return;h.value.querySelectorAll("i, em").forEach(n=>{n.style.fontStyle="italic"})},Gt=()=>{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!==h.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!==h.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(()=>{Dl()}),!1;if(n.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{Dl()});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(()=>{Dl()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{Dl()})}return!0},zn=()=>{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!==h.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!==h.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(()=>{an()}),!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!==h.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const p=u.style.fontWeight;if(p==="normal"||p==="400"){const y=document.createElement("b");y.style.fontWeight="600";const C=document.createDocumentFragment();for(;u.firstChild;)C.appendChild(u.firstChild);y.appendChild(C),u.parentNode&&u.parentNode.replaceChild(y,u),c.setStart(y,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===h.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)}}an()});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(()=>{an()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{an()})}return!0},Pl=(a,n=null)=>{if(A.disabled||!A.richText||!h.value)return;nt.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),Tt(),nt.value=!1):Tt(),el(),h.value.focus();const s=window.getSelection();let i=null;if(s&&s.rangeCount>0){const d=s.getRangeAt(0);!d.collapsed&&_n(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 y=document.createTextNode(n);u.insertNode(y),u.selectNodeContents(y)}}}if(a==="bold"){const d=zn();ke.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(V.value={command:"bold",state:d}),e.nextTick(()=>{i&&(Yt(i),e.nextTick(()=>{const p=Dt("bold");ke.value.bold=p})),bt(),ul(),pl()});return}if(a==="italic"){const d=Gt();ke.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(V.value={command:"italic",state:d}),e.nextTick(()=>{i&&(Yt(i),e.nextTick(()=>{const p=Dt("italic");ke.value.italic=p})),bt(),Dl(),ul(),pl()});return}let c=!1;try{c=document.execCommand(a,!1,n)}catch{}e.nextTick(()=>{if(i&&Yt(i),["bold","italic","underline"].includes(a))try{if(a==="bold")i&&e.nextTick(()=>{const u=Dt("bold");ke.value.bold=u});else if(a==="italic")if(i)e.nextTick(()=>{const u=Dt("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 y=u.getRangeAt(0),C=y.commonAncestorContainer.nodeType===1?y.commonAncestorContainer.closest("a"):y.commonAncestorContainer.parentElement?.closest("a");C&&(!C.getAttribute("href")||C.getAttribute("href")==="")&&C.setAttribute("href",n)}h.value.querySelectorAll("a").forEach(y=>{const C=y.getAttribute("href");(!C||C===""||C==="#")&&y.setAttribute("href",n)})}bt(),ul(),pl()})},Dt=(a,n=null)=>{if(A.disabled||!h.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,y=p.nodeType===3?p.parentElement:p;if(y&&((y.tagName==="STRONG"||y.tagName==="B"||y.closest&&y.closest("strong, b"))&&(u=!0),!u&&y.style&&parseInt(y.style.fontWeight)>=600&&(u=!0),!u))try{const C=window.getComputedStyle(y);parseInt(C.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 y=!1;if(p){const C=document.createTreeWalker(p,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let R;for(;R=C.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(R))){if(R.nodeType===3){if(!(R.textContent||"").trim())continue;y=!0;let M=R.parentElement;for(;M&&M!==h.value;){if(M.tagName==="STRONG"||M.tagName==="B"){u=!0;break}if(M.style&&parseInt(M.style.fontWeight)>=600){u=!0;break}M=M.parentElement}}else if(R.nodeType===1){const O=R;if(O.tagName==="STRONG"||O.tagName==="B"){u=!0;break}if(O.style&&parseInt(O.style.fontWeight)>=600){u=!0;break}}if(u)break}}return ke.value[a]=u&&y,u&&y}}if(a==="italic"){let u=!1;if(c.collapsed){const p=c.commonAncestorContainer,y=p.nodeType===3?p.parentElement:p;if(y&&((y.tagName==="EM"||y.tagName==="I"||y.closest&&y.closest("em, i"))&&(u=!0),!u&&y.style&&y.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(y).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 y=!1;if(p){const C=document.createTreeWalker(p,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let R;for(;R=C.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(R))){if(R.nodeType===3){if(!(R.textContent||"").trim())continue;y=!0;let M=R.parentElement;for(;M&&M!==h.value;){if(M.tagName==="EM"||M.tagName==="I"){u=!0;break}if(M.style&&M.style.fontStyle==="italic"){u=!0;break}M=M.parentElement}}else if(R.nodeType===1){const O=R;if(O.tagName==="EM"||O.tagName==="I"){u=!0;break}if(O.style&&O.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return ke.value[a]=u&&y,u&&y}}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}},Pn=a=>{A.disabled||!A.richText||(we.value=we.value===a?null:a,a==="askAi"&&(mt.value=null))},el=()=>{we.value=null,fe.value=null},_l=a=>{Pl("formatBlock",a),el()},yn=a=>{if(!a||!h.value)return a;const n=We=>{let $e=We.nodeType===Node.TEXT_NODE?We.parentElement:We;for(;$e&&$e!==h.value;){const ht=$e.tagName;if(ht==="P"){const Ut=$e.parentElement;if(Ut===h.value||Ut.tagName==="BLOCKQUOTE")return $e}if(ht==="BLOCKQUOTE")break;$e=$e.parentElement}return null},s=n(a.startContainer),i=n(a.endContainer);if(!s||!i)return a;const c=[],d=document.createTreeWalker(h.value,NodeFilter.SHOW_ELEMENT,{acceptNode:We=>{const $e=We.tagName;if($e==="P"){const ht=We.parentElement;if(ht===h.value||ht.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return $e==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const p=c.indexOf(s),y=c.indexOf(i);if(p===-1||y===-1)return a;const C=Math.min(p,y),R=Math.max(p,y),O=c.slice(C,R+1);if(O.length===0)return a;const M=O[0],ue=O[O.length-1],le=document.createRange();return le.setStartBefore(M),le.setEndAfter(ue),le},sn=()=>{if(A.disabled||!A.richText||!h.value)return;nt.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),Tt(),nt.value=!1):Tt(),el(),h.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;let n=a.getRangeAt(0);!n.collapsed&&_n(n)&&(n=yn(n),a.removeAllRanges(),a.addRange(n));let s=null;!n.collapsed&&_n(n)&&(s=Kt());const i=n.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&h.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(y=>{if(y.nodeType===Node.ELEMENT_NODE)if(y.tagName==="P"||y.tagName==="DIV")u.insertBefore(y,c);else{const C=document.createElement("p");C.appendChild(y.cloneNode(!0)),u.insertBefore(C,c)}else if(y.nodeType===Node.TEXT_NODE&&y.textContent.trim()){const C=document.createElement("p");C.appendChild(y.cloneNode(!0)),u.insertBefore(C,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 y=[],C=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:M=>M.parentNode===u&&M.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let R;for(;R=C.nextNode();)y.push(R);if(y.forEach(M=>{const ue=document.createElement("p");M.parentNode.insertBefore(ue,M),ue.appendChild(M)}),u.querySelectorAll("p, div").forEach(M=>{M.textContent.trim()===""&&!M.querySelector("img")&&(M.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const M=document.createElement("p");M.innerHTML="<br>",u.appendChild(M)}}e.nextTick(()=>{s&&Yt(s),Il(),bt(),pl()})},Fl=()=>{if(!h.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||!h.value.contains(i))return;const c=R=>{if(!R)return!1;const O=R.textContent||"",ue=(R.innerHTML||"").trim();return O.trim()===""||ue===""||ue==="<br>"||ue==="<br/>"||ue==="<p></p>"||ue==="<p><br></p>"||ue==="<p><br/></p>"||ue==="<p> </p>"||ue==="<p><br> </p>"||ue==="<div></div>"||ue==="<div><br></div>"||ue==="<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 R=i.lastChild;if(R.nodeType===1&&R.tagName==="BR")R.remove();else if(R.nodeType===3)if((R.textContent||"").trim()==="")R.remove();else break;else break}if(i.children.length>0)for(let R=i.children.length-1;R>=0;R--){const O=i.children[R];if((O.tagName==="P"||O.tagName==="DIV")&&c(O))O.remove();else break}let u=i.innerHTML;const p=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==p&&(i.innerHTML=u);const y=document.createElement("p");y.innerHTML="<br>",i.parentNode?i.nextSibling?i.parentNode.insertBefore(y,i.nextSibling):i.parentNode.appendChild(y):h.value&&h.value.appendChild(y);const C=document.createRange();C.selectNodeContents(y),C.collapse(!0),a.removeAllRanges(),a.addRange(C),e.nextTick(()=>{Il(),bt()})},ul=()=>{if(!h.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}},Ql=()=>{if(!h.value)return;const a=window.getSelection();a&&a.rangeCount>0&&a.getRangeAt(0),U.value=Kt();const n=window.getSelection();let s="";n.rangeCount>0&&(s=n.getRangeAt(0).toString()),Z.value="",Oe.value=s,He.value="",Xe.value=null,Ae.value=!0,el(),e.nextTick(()=>{Ye.value&&Ye.value.focus()})},Ul=()=>{if(!h.value)return;nt.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),Tt(),nt.value=!1):Tt();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&&Xe.value&&(n=Xe.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)}Xe.value=null}else Pl("unlink");ye.value=!1,el(),e.nextTick(()=>{bt(),ul()})},k=()=>{A.disabled||!A.richText||h.value&&(nt.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),Tt(),nt.value=!1):Tt(),el(),h.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{j(),bt(),pl()}))},S=()=>{A.disabled||!A.richText||h.value&&(nt.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),Tt(),nt.value=!1):Tt(),el(),h.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{j(),bt(),pl()}))},x=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},j=()=>{if(!h.value)return;h.value.querySelectorAll("li > ol").forEach(n=>{const s=n.parentElement;if(s&&s.tagName==="LI"){const i=x(s);i!==null&&Array.from(n.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(i))})}})},Ce=()=>{if(A.disabled||!A.richText||!h.value)return;el(),h.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(()=>{j(),bt()});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=x(c);u.appendChild(s),p!==null&&i.tagName==="OL"&&s.setAttribute("data-parent-num",String(p)),j();const y=document.createRange();y.selectNodeContents(s),y.collapse(!1),a.removeAllRanges(),a.addRange(y),e.nextTick(()=>{bt(),pl()})}else document.execCommand("indent",!1),e.nextTick(()=>{j(),bt(),pl()})},qe=()=>{if(A.disabled||!A.richText||!h.value)return;el(),h.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(()=>{j(),bt()});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(),j();const u=document.createRange();u.selectNodeContents(s),u.collapse(!1),a.removeAllRanges(),a.addRange(u),e.nextTick(()=>{bt(),pl()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{j(),bt(),pl()})},Fe=e.ref(null),at=e.ref(null),f=e.ref({}),g=e.ref(""),E=e.ref(null),F=e.ref("");e.ref("");const z=e.ref(null);e.ref("");const Qe=e.ref([]),Te=e.ref(!1),Ft=e.ref(!1),Le=a=>{if(!a)return"";const n=a.cloneRange(),s=document.createElement("div");return s.appendChild(n.cloneContents()),s.innerHTML},st=()=>{if(!A.commentUser||A.disabled||!A.richText||!h.value)return;if(Fe.value!==null){Fe.value=null,g.value="",F.value="",z.value=null,Qe.value=[],Ln(!0);return}el(),h.value.focus();const a=window.getSelection();if(!a||a.rangeCount===0)return;const n=a.getRangeAt(0);if(n.collapsed||!_n(n))return;F.value=Le(n)||"",z.value=Kt();const s=n.getBoundingClientRect(),i=h.value.parentElement;if(!i)return;const c=i.getBoundingClientRect(),d=s.bottom-c.top,p=Math.max(d+8,0);f.value={top:`${p}px`,bottom:"auto"},Fe.value=Date.now(),e.nextTick(()=>{if(g.value="",E.value){const C=E.value;C.style.height="auto",C.style.height=`${C.scrollHeight}px`,C.focus()}const y=i.querySelector(".dss-comment-overlay");if(y&&i){const C=i.querySelector(".dss-text-editor-footer");if(C){const R=i.getBoundingClientRect(),O=y.getBoundingClientRect(),M=C.getBoundingClientRect(),ue=O.bottom-R.top,le=M.top-R.top,We=8;if(ue>le-We){const $e=M.height;f.value={bottom:`${$e+We}px`,top:"auto"}}else f.value={top:`${p}px`,bottom:"auto"}}}})},ne=()=>{if(!g.value.trim())return;const a=g.value.trim(),n=new Date,s={text:a,selectionText:F.value,selectionRange:z.value,commentId:Fe.value,user:A.commentUser||null,createdAt:n.toISOString()};Qe.value=[...Qe.value,s],de("comment-submitted",s),Gn(s),z.value&&!Ze(z.value)&&jo(Fe.value,z.value),g.value="",e.nextTick(()=>{if(E.value){const i=E.value;i.style.height="auto",i.style.height=`${i.scrollHeight}px`,i.focus()}it("sendComment")})},ll=(a,n)=>{if(!(!A.commentUser||!a.user||a.user.id!==A.commentUser.id)){if(Qe.value=Qe.value.filter((s,i)=>i!==n),Fe.value!==null&&h.value){const s=String(Fe.value),i=h.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`);if(i&&Qe.value.length>0){const c=[],d=new Set;Qe.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(Qe.value.length))}else i&&Qe.value.length===0&&(i.removeAttribute("data-comment-user"),i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count","0"))}if(de("comment-deleted",{comment:a,index:n,commentId:Fe.value}),A.comments&&Array.isArray(A.comments)){const s=A.comments.filter(i=>!(i.commentId===a.commentId&&i.text===a.text&&i.user?.id===a.user?.id));de("update:comments",s)}e.nextTick(()=>{it("deleteComment")})}},Ze=a=>{if(!a||!h.value)return!1;try{const n=Kn(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},Kn=a=>{if(!a||!h.value)return null;try{const n=document.createRange();if(a.type==="element"&&a.element)return h.value.contains(a.element)?(n.setStart(a.element,a.offset),n.collapse(!0),n):null;let s=0;const i=[h.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||!h.value))try{const s=Kn(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,y=s.endContainer,C=s.startOffset,R=s.endOffset,O=p.nodeType===3?p.parentNode:p,M=y.nodeType===3?y.parentNode:y;if(O===M&&C===0&&R===(y.nodeType===3?y.length:M.childNodes.length)&&(O.tagName==="P"||O.tagName==="DIV"||O.tagName==="H1"||O.tagName==="H2"||O.tagName==="H3"||O.tagName==="H4"||O.tagName==="H5"||O.tagName==="H6")){const le=s.extractContents();d.appendChild(le),s.insertNode(d)}else s.surroundContents(d)}catch{const y=s.extractContents();d.appendChild(y),s.insertNode(d)}const u=h.value.querySelector(`[data-comment="${String(a)}"]`);e.nextTick(()=>{it("wrapSelectionWithCommentMarker"),bt()})}catch{}},Gn=a=>{if(!a||!a.commentId)return;const n=Array.isArray(A.comments)?[...A.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(y=>y.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)}Te.value=!0,de("update:comments",n)},On=(a,n=[])=>{if(!A.commentUser||A.disabled||!A.richText||!h.value)return;const s=h.value;let i=null;try{i=s.querySelector(a)}catch{return}if(!i)return;el(),s.focus();const c=document.createRange();c.selectNodeContents(i);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),F.value=i.innerHTML||"",z.value=Kt();const u=c.getBoundingClientRect(),p=s.parentElement;if(p){const R=p.getBoundingClientRect(),O=u.bottom-R.top,ue=Math.max(O+8,0);f.value={top:`${ue}px`,bottom:"auto"}}const y=i.getAttribute("data-comment")||i.getAttribute("data-fake-comment");let C=[];if(y&&A.comments&&Array.isArray(A.comments)){const R=A.comments.find(O=>String(O.conversation_id)===String(y));if(R&&R.conversation&&Array.isArray(R.conversation)){const O=R.conversation.map(M=>({id:M.id||M.commentary_id,commentary_id:M.id||M.commentary_id,conversation_id:R.id||R.conversation_id,text:M.text,user:M.user,createdAt:M.created_at||M.createdAt,updated_at:M.updated_at||M.updatedAt}));C.push(...O)}}C.length===0&&Array.isArray(n)&&n.length>0&&(C=n.slice()),C.sort((R,O)=>{const M=We=>{if(!We)return 0;const $e=new Date(We).getTime();return isNaN($e)?0:$e},ue=M(R.createdAt),le=M(O.createdAt);return ue===le?0:ue-le}),Qe.value=C,Ln(!0),Fe.value=y||null,i&&(at.value=i,i.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(g.value="",E.value){const R=E.value;R.style.height="auto",R.style.height=`${R.scrollHeight}px`,R.focus()}if(p){const R=p.querySelector(".dss-comment-overlay");if(R){const O=p.querySelector(".dss-text-editor-footer");if(O){const M=p.getBoundingClientRect(),ue=R.getBoundingClientRect(),le=O.getBoundingClientRect(),We=ue.bottom-M.top,$e=le.top-M.top,ht=8;if(We>$e-ht){const Ut=le.height;f.value={bottom:`${Ut+ht}px`,top:"auto"}}}}}it("openCommentOverlayForSelector")})},Qn=e.ref(null),oo=e.ref(0),Ko=a=>{if(!(A.disabled||!A.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&&h.value&&h.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(()=>{Fl()},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,y=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.contains(p)&&p!==u||d.contains(y)&&y!==u){a.preventDefault();const C=document.createRange();C.setStartAfter(d),C.collapse(!0),n.removeAllRanges(),n.addRange(C);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 y=c.contains(u)||u===c,C=c.contains(p)||p===c,O=s.cloneContents().textContent?.trim()||"",M=c.textContent?.trim()||"";(!y||!C||O.length>M.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(()=>{bt()});return}}}}if(a.key==="Tab"){a.preventDefault(),a.shiftKey?qe():Ce();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=y=>{if(!y)return!1;let C=y.previousSibling;for(;C;){if(C.classList&&C.classList.contains("dss-image-wrapper")||C.tagName==="IMG"||C.querySelector&&C.querySelector(".dss-image-wrapper")||C.querySelector&&C.querySelector("img"))return!0;C=C.previousSibling}const R=y.parentElement;return R&&R!==h.value?p(R):!1};if(u.nodeType===3){const y=u.parentElement;if(y&&(p(y)||p(u))){const C=y.closest("p, div");if(C&&C!==h.value){a.preventDefault(),a.stopPropagation();let R=null;const O=s.startOffset;O<u.length&&(R=u.splitText(O));const M=document.createElement("p");if(R?M.appendChild(R):M.innerHTML="<br>",u.length===0){const le=u.parentElement;le&&(le.removeChild(u),le.childNodes.length===0&&le.appendChild(document.createElement("br")))}C.nextSibling?C.parentNode.insertBefore(M,C.nextSibling):C.parentNode.appendChild(M);const ue=document.createRange();R?ue.setStart(R,0):ue.setStart(M,0),ue.collapse(!0),n.removeAllRanges(),n.addRange(ue),e.nextTick(()=>{bt()});return}}}}const i=s.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&h.value&&h.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 We=le.textContent||"",ht=(le.innerHTML||"").trim(),Ut=ht.replace(/<br\s*\/?>/gi,"").trim();return We.trim()===""||ht===""||Ut===""||ht==="<br>"||ht==="<br/>"||ht==="<p></p>"||ht==="<p><br></p>"||ht==="<p><br/></p>"||ht==="<p> </p>"||ht==="<p><br> </p>"||ht==="<div></div>"||ht==="<div><br></div>"||ht==="<div><br/></div>"},y=c.lastChild,C=y&&y.nodeType===1&&y.tagName==="BR",R=s.startContainer,O=R.nodeType===3?R.parentElement:R,M=O===c||O&&O.parentElement===c;if(u&&p(u)||C&&M){a.preventDefault(),setTimeout(()=>{Fl()},50);return}}}}if(a.key===" "){const n=Date.now(),s=n-oo.value;if(Qn.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(),Ce();return}}}}Qn.value=" ",oo.value=n}else Qn.value=a.key}},Go=a=>{if(A.disabled||!A.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,"")),Tt();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 y=new DOMParser().parseFromString(u,"text/html");let C=h.value.querySelector("h1")?1:0;if(y.querySelectorAll("h1").forEach(O=>{if(C>0){const M=y.createElement("p");M.innerHTML=O.innerHTML,O.parentNode.replaceChild(M,O)}else C++}),c){const O=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],M=Array.from(y.body.children).filter(ue=>O.includes(ue.tagName));if(M.length===1){const ue=M[0].tagName,le=c.tagName,We=c.textContent.trim()===""&&!c.querySelector("img");let $e=!1;if(["H1","H2","H3","H4","H5","H6"].includes(le)?$e=!0:We||(ue===le||ue==="P")&&($e=!0),$e)return M[0].innerHTML.trim()}}return y.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);bt()},$o=a=>{if(we.value){const s=a.target;!s.closest(".dss-toolbar-dropdown")&&!s.closest(".dss-toolbar-dropdown-toggle")&&el()}if(Me.value){const s=a.target,i=s.closest(".dss-floating-toolbar"),c=h.value&&s.closest(".dss-text-editor-content");!i&&!c&&Jn()}if(mt.value){const s=a.target,i=s.closest(".dss-floating-toolbar"),c=s.closest(".dss-toolbar-dropdown");!i&&!c&&Ao()}const n=a.target;if(!n.closest(".dss-toolbar-dropdown")&&!n.closest(".dss-toolbar-dropdown-submenu")&&(fe.value=null),!h.value||!n.closest(".dss-text-editor-content")){const s=window.getSelection();if(s&&s.rangeCount>0){const i=s.getRangeAt(0);ae.value=!i.collapsed&&_n(i)}else ae.value=!1}if(Fe.value!==null){const s=document.querySelector(".dss-comment-overlay");let i=!1;if(s){const u=s.getBoundingClientRect(),p=a.clientX,y=a.clientY;i=p>=u.left&&p<=u.right&&y>=u.top&&y<=u.bottom}const c=n.closest(".dss-toolbar-button"),d=c&&c.getAttribute("title")==="Comment";!i&&!d&&(Fe.value=null,g.value="",F.value="",z.value=null,Qe.value=[],Ln(!0))}},Lo=(a,n)=>{a&&a.stopPropagation&&a.stopPropagation(),ze.value&&(clearTimeout(ze.value),ze.value=null),fe.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}ze.value&&clearTimeout(ze.value),ze.value=setTimeout(()=>{fe.value=null,ze.value=null},150)},Qo=a=>{fe.value=null};let wn=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(C=>C.tagName==="BUTTON"||C.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-${++wn}`;s.classList.add("dss-toolbar-dropdown-item-has-submenu"),s.setAttribute("data-submenu-id",p);let y=null;c?(s.tagName==="BUTTON"&&s.parentNode.insertBefore(c,s.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),y=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),y=d),y&&(y.setAttribute("data-submenu-id",p),y.setAttribute("data-processed","true"),c&&s.tagName!=="BUTTON"?y.dataset.originalParentRef="inside":y.dataset.originalParentRef="sibling",Array.from(y.children).forEach(R=>{(R.tagName==="BUTTON"||R.tagName==="DIV")&&!R.classList.contains("dss-toolbar-dropdown-item")&&R.classList.add("dss-toolbar-dropdown-item")}))}})},Do=()=>{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=y=>{const C=c.getAttribute("data-submenu-id");C&&Lo(y,C)},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=C=>{const R=c.getAttribute("data-submenu-id");R&&Lo(C,R)},p=To;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",p),c._subMenuHandlers={enter:u,leave:p},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(C=>{C.addEventListener("click",Qo)})})})};let Wn=null;const ao=()=>{if(fe.value){const a=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${fe.value}"]`),n=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${fe.value}"]`);a&&n&&Vn(a,n)}if(Me.value&&pl(),A.richText){if(Wn!==null)return;Wn=setTimeout(()=>{Wn=null,it("handleWindowResize")},150)}},so=()=>{if(!A.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?il():ql(),D.value?Ll():cl()})}),e.nextTick(()=>{ea()}),A.richText&&h.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",$o),window.addEventListener("resize",ao);let a=null;const n=()=>{a===null&&(a=setTimeout(()=>{a=null,ao()},150))};window.addEventListener("scroll",n,!0),h.value._windowScrollHandler=n,h.value._windowScrollTimeout=a,h.value.closest(".editor-with-comments"),h.value.closest(".dss-text-editor-content-wrapper");const s=h.value.closest(".dss-text-editor-content");let i=null;const c=()=>{i===null&&(i=setTimeout(()=>{i=null,ao()},150))};s&&(s.addEventListener("scroll",c),h.value._scrollHandlers={wrapper:null,content:s,handler:c}),e.nextTick(()=>{Do(),so()}),h.value.addEventListener("click",p=>{const y=p.target;y.closest("a")&&!A.disabled&&p.preventDefault();const R=y.closest(".dss-image-no-alt-icon"),O=y.closest(".dss-image-wrapper");if(R||O&&y===O){p.preventDefault(),p.stopPropagation();const M=window.getSelection(),ue=document.createRange();ue.setStartAfter(O),ue.collapse(!0),M.removeAllRanges(),M.addRange(ue)}else O&&y.tagName!=="IMG"&&(p.preventDefault(),e.nextTick(()=>{const M=window.getSelection();if(M.rangeCount>0){const le=M.getRangeAt(0).commonAncestorContainer,We=le.nodeType===3?le.parentElement:le;if(O.contains(We)&&We!==O.querySelector("img")){const $e=document.createRange();$e.setStartAfter(O),$e.collapse(!0),M.removeAllRanges(),M.addRange($e)}}else{const ue=document.createRange();ue.setStartAfter(O),ue.collapse(!0),M.addRange(ue)}}))},!0),h.value.addEventListener("mousedown",p=>{const y=p.target,C=y.closest(".dss-image-no-alt-icon"),R=y.closest(".dss-image-wrapper");if(C||R&&y.tagName!=="IMG"){p.preventDefault();const O=window.getSelection(),M=document.createRange();R&&(M.setStartAfter(R),M.collapse(!0),O.removeAllRanges(),O.addRange(M))}},!0),h.value.addEventListener("paste",p=>{e.nextTick(()=>{if(!h.value)return;h.value.querySelectorAll("img").forEach(C=>{if(!C.closest(".dss-image-wrapper"))C.removeAttribute("alt"),C.removeAttribute("data-alt"),C.setAttribute("alt",""),C.setAttribute("data-alt",""),C.alt="";else{const O=C.getAttribute("alt")||C.alt||"";if(O){const M=C.getAttribute("src")||C.src||"",ue=M.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),le=O===M||O===ue;(O.startsWith("http://")||O.startsWith("https://")||O.startsWith("data:")||le||le)&&(C.setAttribute("alt",""),C.setAttribute("data-alt",""),C.alt="")}}}),Nl()})}),h.value.addEventListener("dragstart",p=>{const y=p.target,C=y.tagName==="IMG"?y:y.closest("img"),R=C?.closest(".dss-image-wrapper");C&&h.value.contains(C)&&(Vt.value=R||C,p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/html","image-drag"))}),h.value.addEventListener("dragover",p=>{Vt.value&&(p.preventDefault(),p.stopPropagation(),p.dataTransfer.dropEffect="move")}),h.value.addEventListener("dragenter",p=>{Vt.value&&(p.preventDefault(),p.stopPropagation())}),h.value.addEventListener("drop",p=>{if(!Vt.value||!h.value)return;p.preventDefault(),p.stopPropagation();const y=Vt.value,C=y.classList?.contains("dss-image-wrapper"),R=C?y.querySelector("img"):y,O=C?y:R?.closest(".dss-image-wrapper");if(!R||!h.value.contains(R)){Vt.value=null;return}let M=null;const ue=p.clientX,le=p.clientY;if(document.caretRangeFromPoint)M=document.caretRangeFromPoint(ue,le);else{const nl=window.getSelection();nl.rangeCount>0?M=nl.getRangeAt(0).cloneRange():(M=document.createRange(),M.selectNodeContents(h.value),M.collapse(!1))}if(!M){Vt.value=null;return}const We=M.commonAncestorContainer,$e=We.nodeType===3?We.parentElement:We;if($e?.closest(".dss-image-wrapper")===O||O&&O.contains($e)){Vt.value=null;return}if(O&&($e===O||O.contains($e))){Vt.value=null;return}const Ut=R.getAttribute("src");let qt=null;O?qt=O.cloneNode(!0):qt=R.cloneNode(!0);try{let nl=M.startContainer;if(nl.nodeType===3&&(nl=nl.parentElement),O&&(nl===O||O.contains(nl))){const ol=document.createRange();ol.setStartAfter(O),ol.collapse(!0),M=ol}M.insertNode(qt);const gl=document.createRange();gl.setStartAfter(qt),gl.collapse(!0);const It=window.getSelection();It.removeAllRanges(),It.addRange(gl)}catch{if(h.value.childNodes.length===0){const gl=document.createElement("p");gl.appendChild(qt),h.value.appendChild(gl)}else{const gl=h.value.lastChild;if(gl&&gl.nodeType===1)gl.appendChild(qt);else{const It=document.createElement("p");It.appendChild(qt),h.value.appendChild(It)}}}O?O.remove():R.remove(),Vt.value=null,e.nextTick(()=>{const nl=h.value.querySelectorAll("img");let gl=!1;nl.forEach(It=>{if(It.getAttribute("src")===Ut)if(!gl)gl=!0;else{const ol=It.closest(".dss-image-wrapper");ol?ol.remove():It.remove()}}),Nl(),bt()})}),h.value.addEventListener("dragend",p=>{Vt.value=null});let d=null;const u=new MutationObserver(p=>{p.forEach(y=>{y.addedNodes.forEach(C=>{if(C.nodeType===1){C.tagName==="IMG"&&(C.removeAttribute("alt"),C.removeAttribute("data-alt"),C.setAttribute("alt",""),C.setAttribute("data-alt",""),C.alt="");const R=C.querySelectorAll&&C.querySelectorAll("img");R&&R.forEach(O=>{O.removeAttribute("alt"),O.removeAttribute("data-alt"),O.setAttribute("alt",""),O.setAttribute("data-alt",""),O.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{Nl(),so(),d=null},100)});if(u.observe(h.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const p=document.querySelector(".dss-text-editor-toolbar");if(p){const y=new MutationObserver(()=>{e.nextTick(()=>{so()})});y.observe(p,{childList:!0,subtree:!0}),p._toolbarMutationObserver=y}}),A.modelValue){const p=Sl(A.modelValue);h.value.innerHTML=p,hn()}e.nextTick(()=>{const p=h.value.innerHTML||"",y=A.title||"",C=A.description||"";Ct.value=p,ie.value=y,X.value=C,te.value=y,ce.value=C,j(),Nl(),Dl(),xn(),uo(),fl()}),ul(),Il(),h.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",$o),window.removeEventListener("resize",ao),h.value&&h.value._windowScrollHandler&&window.removeEventListener("scroll",h.value._windowScrollHandler,!0),Wn!==null&&(clearTimeout(Wn),Wn=null),h.value&&h.value._windowScrollTimeout!==null&&clearTimeout(h.value._windowScrollTimeout),Se.value&&clearTimeout(Se.value),ze.value&&clearTimeout(ze.value),h.value&&h.value._mutationObserver&&h.value._mutationObserver.disconnect(),je.value&&je.value.disconnect(),St.value!==null&&(cancelAnimationFrame(St.value),St.value=null),ut.value!==null&&(clearTimeout(ut.value),ut.value=null),vt.value!==null&&(clearTimeout(vt.value),vt.value=null),Ln(!0),h.value&&h.value._scrollHandlers){const{wrapper:n,content:s,handler:i}=h.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&&!A.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 y=document.createRange();y.setStartAfter(i),y.collapse(!0),c.removeAllRanges(),c.addRange(y)}}Nl(),ul(),Il(),pl(),xn()}):e.nextTick(()=>{Nl(),ul(),Il(),pl(),xn()})},Co=()=>{Vl();const a=window.getSelection();if(a&&a.rangeCount>0){const s=a.getRangeAt(0);ae.value=!s.collapsed&&_n(s),!s.collapsed&&V.value&&(V.value=null)}else ae.value=!1;if(Nl(),ul(),Il(),pl(),xn(),a&&a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c&&c.closest(".dss-text-editor-footer")){a.removeAllRanges(),ae.value=!1;return}}["bold","italic","underline"].forEach(s=>{try{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0);if(!c.collapsed)if(s==="bold"){const d=c.commonAncestorContainer,u=d.nodeType===3?d.parentElement:d;let p=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(p=!0),!p&&u.style&&parseInt(u.style.fontWeight)>=600&&(p=!0),!p))try{const y=window.getComputedStyle(u);parseInt(y.fontWeight)>=600&&(p=!0)}catch{}ke.value[s]=p}else{const d=document.queryCommandState(s);ke.value[s]=d}}}catch{}})},xn=()=>{if(!A.richText||A.disabled||!h.value){B.value="p";return}try{const a=window.getSelection();if(!a||a.rangeCount===0){B.value="p";return}const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(!i||!h.value.contains(i)){B.value="p";return}const c=i.closest("h1, h2, h3, h4, h5, h6, p");if(!c){B.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?B.value=d:B.value="p"}catch{B.value="p"}},Il=()=>{if(!h.value){Ke.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&&h.value.contains(c))}Ke.value=n}catch{Ke.value=!1}},_n=a=>{if(!a||!h.value)return!1;const n=a.commonAncestorContainer;if(!n)return!1;const s=n.nodeType===3?n.parentElement:n;return s?h.value.contains(s):!1},Jn=()=>{Me.value=!1},pl=()=>{if(!A.floatingToolbar||!A.richText||A.disabled){Me.value=!1;return}const a=window.getSelection();if(!a||a.rangeCount===0){Me.value=!1;return}const n=a.getRangeAt(0);if(n.collapsed||!_n(n)){Me.value=!1;return}const s=n.getBoundingClientRect();if(!s||s.width===0&&s.height===0){Me.value=!1;return}const i=h.value;if(!i){Me.value=!1;return}const c=i.getBoundingClientRect();if(!c||c.width===0){Me.value=!1;return}const d=40,u=8,p=s.top-d/2+15;let y=s.left+s.width/2;const C=window.innerWidth||document.documentElement.clientWidth||0;let R=0;gt.value&&(R=gt.value.getBoundingClientRect().width);const O=(R||320)/2;let M=c.left+O,ue=c.right-O;if(ue<M){const le=c.left+c.width/2;M=le,ue=le}if(C>0){const le=O+u,We=C-O-u;if(M=Math.max(M,le),ue=Math.min(ue,We),ue<M){const $e=C/2;M=$e,ue=$e}}y<M?y=M:y>ue&&(y=ue),rt.value={position:"fixed",top:`${Math.max(p,8)}px`,left:`${y}px`,transform:"translate(-50%, -100%)",zIndex:10003},Me.value=!0},bo=a=>{A.disabled||!A.richText||(mt.value=mt.value===a?null:a,a==="askAi"&&(we.value=null))},Ao=()=>{mt.value=null,fe.value=null},Jl=a=>{_l(a),Ao()};let En=null,Yl=null,Mn=null,qn=null;const la=a=>{if(A.disabled||!A.richText){eo(),to();return}const n=a.target,s=n.closest("a"),i=n.closest("img");if(En&&(clearTimeout(En),En=null),Mn&&(clearTimeout(Mn),Mn=null),s&&s!==Yl){to(),Yl=s;let c=s.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=s.textContent||""),Xe.value=s,he.value=c,K.value=!0,ge.value=!0,Ho(s)}else!s&&Yl?(Yl=null,En=setTimeout(()=>{ge.value||eo()},150)):s&&s===Yl&&Ho(s);if(i&&i!==qn){eo(),qn=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),pt.value=i,Pt.value=c.trim()||L("textEditor.image.noAlt"),kt.value=!0,H.value=!0,wo(i)}else!i&&qn?(qn=null,Mn=setTimeout(()=>{H.value||to()},150)):i&&i===qn&&wo(i)},na=a=>{const n=a.relatedTarget;(!n||!n.closest(".dss-text-editor-content")&&!n.closest(".dss-link-popup"))&&(Yl=null,qn=null,En&&(clearTimeout(En),En=null),Mn&&(clearTimeout(Mn),Mn=null),eo(),to())},eo=()=>{ge.value=!1,setTimeout(()=>{ge.value||(K.value=!1,he.value="",Ae.value||(Xe.value=null))},100)},Ho=a=>{if(!a||!h.value)return;const n=a.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;Re.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},to=()=>{H.value=!1,setTimeout(()=>{H.value||(kt.value=!1,Pt.value="",Qt.value||(pt.value=null))},100)},wo=a=>{if(!a||!h.value)return;const n=a.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;pe.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},xo=()=>{if(!he.value||!Xe.value)return;let n=Xe.value.getAttribute("href")||he.value;!n.startsWith("http://")&&!n.startsWith("https://")&&!n.startsWith("mailto:")&&(n="https://"+n),window.open(n,"_blank","noopener,noreferrer")},Ro=()=>{if(Xe.value){const a=Xe.value.textContent||"",n=Xe.value.getAttribute("href")||"",s=Xe.value;Z.value=n,Oe.value=a,He.value=a,ge.value=!1,K.value=!1,he.value="",Xe.value=s,Ae.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")||"";Z.value=d,Oe.value=c,He.value=c,Xe.value=i,Ae.value=!0}}}else{U.value=Kt();const a=window.getSelection();let n="";a.rangeCount>0&&(n=a.getRangeAt(0).toString()),Z.value="",Oe.value=n,He.value="",Xe.value=null,Ae.value=!0}e.nextTick(()=>{Ye.value&&(Ye.value.focus(),Ye.value.select())})},ro=()=>{Ae.value=!1,Z.value="",Oe.value="",He.value="",Xe.value=null,U.value=null},Eo=()=>{if(!Z.value.trim()){ro();return}if(nt.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),Tt(),nt.value=!1):Tt(),Oe.value.trim()||(Oe.value=Z.value.trim()),Xe.value&&h.value&&h.value.contains(Xe.value)){const a=window.getSelection();a.rangeCount>0&&a.removeAllRanges();const n=Xe.value;if(n.setAttribute("href",Z.value.trim()),Oe.value.trim()!==He.value.trim()){for(;n.firstChild;)n.removeChild(n.firstChild);n.textContent=Oe.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),bt()}else if(h.value){h.value.focus();const a=window.getSelection();a.removeAllRanges(),U.value&&Yt(U.value);let n=null;if(a.rangeCount>0&&(n=a.getRangeAt(0)),n&&!n.collapsed){n.toString();const s=document.createElement("a");s.href=Z.value.trim(),s.textContent=Oe.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(h.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=Z.value.trim(),d.textContent=Oe.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=s.parentElement;for(;u&&u!==h.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==h.value){let p=u.nextElementSibling;if(p&&(p.innerHTML==="<br>"||p.innerHTML==="<br/>"||p.textContent.trim()==="")){p.textContent="",p.appendChild(d);const y=document.createTextNode(" ");p.appendChild(y);const C=document.createRange();C.setStartAfter(d),C.collapse(!0),a.removeAllRanges(),a.addRange(C)}else{if(n.startOffset>0){const C=s.textContent.substring(0,n.startOffset),R=C[C.length-1];if(R&&R!==" "&&R!==" "&&R!==`
102
+ </svg>`,h=e.ref(null),we=e.ref(null),ye=e.ref(!1),Q=e.ref(!1),K=e.ref(!1),he=e.ref(""),Re=e.ref({}),ge=e.ref(!1),Ae=e.ref(!1),Z=e.ref(""),ze=e.ref(""),Ye=e.ref(null),_e=e.ref(null),Xe=e.ref(null),U=e.ref(null),He=e.ref(""),Ke=e.ref(!1),ke=e.ref({}),Me=e.ref(!1),rt=e.ref({}),yt=e.ref(null),mt=e.ref(null),Qt=e.ref(!1),xe=e.ref(""),Jt=e.ref(null),et=e.ref(""),lt=e.ref(""),kt=e.ref(""),Rt=e.ref(null),ct=e.ref(null),ht=e.ref(null),pt=e.ref(null),Xt=e.ref(null),Ct=e.ref(!1),Pt=e.ref(""),pe=e.ref({}),H=e.ref(!1),Y=e.ref("upload"),ie=e.ref(""),fe=e.ref(null),Fe=e.ref(null),tt=e.ref([]),Et=e.ref([]),Se=e.ref(null),ot=e.ref(!1),bt=e.ref(""),el=e.ref(""),re=e.ref(""),X=e.ref(""),te=e.ref(""),ce=e.ref(""),Ve=e.ref(null),nt=e.ref(null),xt=e.ref(null),dl=e.ref(!1),Vt=e.ref(null),sl=e.ref(!1),D=e.ref(!1),V=e.ref(null),B=e.ref("p"),ae=e.ref(!1),se=e.ref([]),je=e.ref(null),St=e.ref(null),ut=e.ref(null),Ge=e.ref(!1),_t=e.ref(0),Nt=100,vt=e.ref(null),Lt=e.computed(()=>!!A.commentUser),Ht=e.computed(()=>({"dss-text-editor-no-border":!A.border,"dss-text-editor-rounded":A.rounded,"dss-text-editor-full-height":A.fullHeight,"dss-comment-overlay-open":Lt.value&&Ie.value!==null})),Mt=e.computed(()=>({})),wl=e.computed(()=>!A.fixedHeight||A.fullHeight?{}:{height:`${1.6*14*A.rows+24+2}px`,resize:"none",overflowY:"auto"}),jl=e.computed(()=>!A.fixedHeight||A.fullHeight?{}:{height:`${1.6*14*A.rows+32}px`,overflowY:"auto"}),El=e.computed(()=>A.richText&&Et.value.length>0),rl=e.computed(()=>{if(!A.modelValue)return"";if(A.richText){let a=A.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 A.modelValue}),ml=e.computed(()=>{const a=rl.value.trim();return a?a.split(/\s+/).filter(n=>n.length>0).length:0}),un=e.computed(()=>rl.value.length),yl=e.computed(()=>pt.value!==null&&Y.value==="upload"&&et.value&&et.value.startsWith("data:")),ft=e.computed(()=>A.titlePlaceholder||L("textEditor.placeholders.title")),zl=e.computed(()=>A.descriptionPlaceholder||L("textEditor.placeholders.description")),Kl=e.computed(()=>A.placeholder||L("textEditor.placeholders.startTyping")),Hl=a=>dt&&dt[a]!==void 0,Rn=a=>{for(let n=a+1;n<A.customToolbarSlots.length;n++)if(Hl(A.customToolbarSlots[n]))return!0;return!1},Gl=a=>{for(let n=a+1;n<A.customToolbarSlots.length;n++){const s=A.customToolbarSlots[n];if(Hl(s)&&bn(s))return!0}return!1},bn=a=>A.customToolbarFloatingMap.hasOwnProperty(a)?A.customToolbarFloatingMap[a]===!0:!0,Bn=e.computed(()=>A.customToolbarSlots.some(a=>Hl(a)&&bn(a))),nn=e.computed(()=>Hl("title-slot")),Rl=e.computed(()=>Hl("description-slot")),dn=a=>{if(!a||a.trim()==="")return"<html></html>";const n=a.trim();return n.startsWith("<html>")&&n.endsWith("</html>")?a:`<html>${a}</html>`},Sl=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},mn=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())},Wl=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""}},pn=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=L("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"},on=a=>{const n=a.target.value;de("update:modelValue",n),de("change",n)},il=()=>{if(!Ve.value)return;const a=Ve.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")},jn=()=>{sl.value=!0,il()},Fn=()=>{sl.value=!1,ql()},ql=()=>{if(!Ve.value)return;const a=Ve.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")},vn=a=>{const s=a.target.value;sl.value&&il(),de("update:title",s),de("title-change",s),xt.value="title",A.richText&&(ot.value||(el.value=bt.value,te.value=re.value,ce.value=X.value),Se.value&&clearTimeout(Se.value),ot.value=!0,Se.value=setTimeout(()=>{ot.value=!1,Tt()},500))},Ll=()=>{if(!nt.value)return;const a=nt.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")},In=()=>{D.value=!0,Ll()},fn=()=>{D.value=!1,cl()},cl=()=>{if(!nt.value)return;const a=nt.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")},jt=a=>{const s=a.target.value;D.value&&Ll(),de("update:description",s),de("description-change",s),xt.value="description",A.richText&&(ot.value||(el.value=bt.value,te.value=re.value,ce.value=X.value),Se.value&&clearTimeout(Se.value),ot.value=!0,Se.value=setTimeout(()=>{ot.value=!1,Tt()},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(h.value),s.setEnd(n.startContainer,n.startOffset),{type:"text",start:s.toString().length,end:s.toString().length+n.toString().length}},Yt=a=>{if(!(!a||!h.value))try{const n=window.getSelection(),s=document.createRange();if(a.type==="element"&&a.element)if(h.value.contains(a.element)){s.setStart(a.element,a.offset),s.collapse(!0),n.removeAllRanges(),n.addRange(s);return}else{h.value.focus();return}let i=0;const c=[h.value];let d=null,u=!1,p=!1;for(;!p&&(d=c.pop());)if(d.nodeType===3){const y=i+d.length;!u&&a.start>=i&&a.start<=y&&(s.setStart(d,a.start-i),u=!0),u&&a.end>=i&&a.end<=y&&(s.setEnd(d,a.end-i),p=!0),i=y}else{let y=d.childNodes.length;for(;y--;)c.push(d.childNodes[y])}n.removeAllRanges(),n.addRange(s)}catch{h.value.focus()}},Tl=()=>{if(!h.value)return;h.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(h.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)},Tt=(a=!1)=>{if(!h.value)return;const n=h.value.innerHTML,s=A.title||"",i=A.description||"";if(!a&&n===bt.value&&s===re.value&&i===X.value)return;const c={content:el.value||bt.value,title:te.value!==void 0?te.value:re.value,description:ce.value!==void 0?ce.value:X.value},d=tt.value.length>0?tt.value[tt.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&&(tt.value.push(c),tt.value.length>50&&tt.value.shift(),Et.value=[]),bt.value=n,re.value=s,X.value=i,el.value=n,te.value=s,ce.value=i},wt=a=>{if(!h.value)return;Vl(),h.value&&mn(h.value);let n=null;h.value&&(h.value.querySelector("p")||(n=Kt(),hn()));const s=a&&a.inputType&&(a.inputType==="insertText"||a.inputType==="insertCompositionText"||a.inputType==="deleteContentBackward"||a.inputType==="deleteContentForward");s&&V.value&&(V.value=null),Q.value=!0;const i=h.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/&nbsp;|\u00A0/g," "),c=dn(i);de("update:modelValue",c),de("change",c),xt.value="editor",ot.value||(el.value=bt.value,te.value=re.value,ce.value=X.value),Se.value&&clearTimeout(Se.value),ot.value=!0,Se.value=setTimeout(()=>{ot.value=!1,Tt(),lo(),io()},500),e.nextTick(()=>{n&&Yt(n),Vl();const d=["bold","italic","underline"],u=window.getSelection(),p=u.rangeCount>0?u.getRangeAt(0):null,y=p&&p.collapsed;if(d.forEach(C=>{try{if(y&&V.value?.command===C){ke.value[C]=V.value.state;return}if(C==="bold")if(p){const R=p.commonAncestorContainer,O=R.nodeType===3?R.parentElement:R;let M=!1;if(O&&((O.tagName==="STRONG"||O.tagName==="B"||O.closest&&O.closest("strong, b"))&&(M=!0),!M&&O.style&&parseInt(O.style.fontWeight)>=600&&(M=!0),!M))try{const ue=window.getComputedStyle(O);parseInt(ue.fontWeight)>=600&&(M=!0)}catch{}ke.value[C]=M}else ke.value.hasOwnProperty(C)||(ke.value[C]=!1);else if(C==="italic")if(p){const R=p.commonAncestorContainer,O=R.nodeType===3?R.parentElement:R,M=O&&(O.tagName==="EM"||O.tagName==="I"||O.closest&&O.closest("em, i"));ke.value[C]=!!M}else{const R=document.queryCommandState(C);ke.value[C]=R}else{const R=document.queryCommandState(C);ke.value[C]=R}}catch{}}),j(),Nl(),Dl(),pl(),xn(),it("handleRichTextInput"),s&&(a.inputType==="insertText"||a.inputType==="insertCompositionText")){const C=a.data||"";C&&C.length===1&&setTimeout(()=>io(C),0),(C===" "||C===`
103
+ `||/[.,;:!?]/.test(C))&&setTimeout(()=>{lo()},100)}Q.value=!1})},Vl=()=>{if(!h.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 y=document.createRange();y.setStartAfter(c),y.collapse(!0),a.removeAllRanges(),a.addRange(y)}}}},hn=()=>{if(!h.value)return;const a=h.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)}})},Nl=()=>{if(h.value&&!dl.value){dl.value=!0;try{h.value.querySelectorAll(".dss-image-wrapper").forEach(i=>{i.querySelector("img")||i.remove()}),h.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()}),h.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 C=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),R=c===d||c===C;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||R||R)&&(c="")}i.setAttribute("alt",c),i.setAttribute("data-alt",c);const u=!c||c.trim()==="";let p=i.parentElement;const y=p&&p.classList.contains("dss-image-wrapper");if(y){const C=p.querySelector(".dss-image-no-alt-icon");C&&C.remove()}else{const C=i.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?i.nextElementSibling:null;C&&C.remove()}if(u){y?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 C=document.createElement("div");C.className="dss-image-no-alt-icon",C.setAttribute("contenteditable","false"),C.innerHTML=ee,p.appendChild(C)}else if(y&&p.children.length===1){const C=p.parentNode;C.insertBefore(i,p),C.removeChild(p)}})}finally{dl.value=!1}}},gn=a=>{lo(),de("blur",a),Jn()},Bl=()=>{if(A.disabled||!A.richText||!h.value)return;tl(),Se.value&&(clearTimeout(Se.value),Se.value=null),ot.value&&(Tt(),ot.value=!1);const a=xt.value==="title",n=xt.value==="description",s=xt.value==="editor";if(tt.value.length===0){a&&Ve.value?Ve.value.focus():n&&nt.value?nt.value.focus():h.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{wt()});return}const i={content:h.value.innerHTML,title:A.title||"",description:A.description||""};Et.value.push(i);const c=tt.value.pop();if(c!==void 0){Q.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",p=typeof c=="object"&&c.description||"";h.value.innerHTML=d,bt.value=d,re.value=u,X.value=p,el.value=d,te.value=u,ce.value=p,e.nextTick(()=>{j(),ul(),Il(),pl();const y=dn(d);de("update:modelValue",y),de("update:title",u),de("update:description",p),de("change",y),de("title-change",u),de("description-change",p),Q.value=!1,e.nextTick(()=>{setTimeout(()=>{if(a){if(Ve.value){Ve.value.focus();const C=u.length;Ve.value.setSelectionRange&&Ve.value.setSelectionRange(C,C),il()}}else if(n){if(nt.value){nt.value.focus();const C=p.length;nt.value.setSelectionRange(C,C)}}else if(s)Tl();else if(Ve.value&&document.activeElement===Ve.value){const C=u.length;Ve.value.setSelectionRange&&Ve.value.setSelectionRange(C,C),il()}else if(nt.value&&document.activeElement===nt.value){const C=p.length;nt.value.setSelectionRange(C,C)}else h.value&&Tl()},10)})})}},Zl=()=>{if(A.disabled||!A.richText||!h.value)return;tl();const a=xt.value==="title",n=xt.value==="description",s=xt.value==="editor";if(Et.value.length===0){a&&Ve.value?Ve.value.focus():n&&nt.value?nt.value.focus():h.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{wt()});return}const i={content:h.value.innerHTML,title:A.title||"",description:A.description||""};tt.value.push(i);const c=Et.value.pop();if(c!==void 0){Q.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",p=typeof c=="object"&&c.description||"";h.value.innerHTML=d,bt.value=d,re.value=u,X.value=p,el.value=d,te.value=u,ce.value=p,e.nextTick(()=>{j(),ul(),Il(),pl();const y=dn(d);de("update:modelValue",y),de("update:title",u),de("update:description",p),de("change",y),de("title-change",u),de("description-change",p),Q.value=!1,e.nextTick(()=>{setTimeout(()=>{if(a){if(Ve.value){Ve.value.focus();const C=u.length;Ve.value.setSelectionRange&&Ve.value.setSelectionRange(C,C),il()}}else if(n){if(nt.value){nt.value.focus();const C=p.length;nt.value.setSelectionRange(C,C)}}else if(s)Tl();else if(Ve.value&&document.activeElement===Ve.value){const C=u.length;Ve.value.setSelectionRange&&Ve.value.setSelectionRange(C,C),il()}else if(nt.value&&document.activeElement===nt.value){const C=p.length;nt.value.setSelectionRange(C,C)}else h.value&&Tl()},10)})})}},an=()=>{if(!h.value)return;h.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)}}),h.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)}}),h.value.querySelectorAll("b, strong").forEach(i=>{i.style.fontWeight="600"})},Dl=()=>{if(!h.value)return;h.value.querySelectorAll("i, em").forEach(n=>{n.style.fontStyle="italic"})},Gt=()=>{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!==h.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!==h.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(()=>{Dl()}),!1;if(n.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{Dl()});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(()=>{Dl()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{Dl()})}return!0},zn=()=>{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!==h.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!==h.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(()=>{an()}),!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!==h.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const p=u.style.fontWeight;if(p==="normal"||p==="400"){const y=document.createElement("b");y.style.fontWeight="600";const C=document.createDocumentFragment();for(;u.firstChild;)C.appendChild(u.firstChild);y.appendChild(C),u.parentNode&&u.parentNode.replaceChild(y,u),c.setStart(y,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===h.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)}}an()});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(()=>{an()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{an()})}return!0},Pl=(a,n=null)=>{if(A.disabled||!A.richText||!h.value)return;ot.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),Tt(),ot.value=!1):Tt(),tl(),h.value.focus();const s=window.getSelection();let i=null;if(s&&s.rangeCount>0){const d=s.getRangeAt(0);!d.collapsed&&_n(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 y=document.createTextNode(n);u.insertNode(y),u.selectNodeContents(y)}}}if(a==="bold"){const d=zn();ke.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(V.value={command:"bold",state:d}),e.nextTick(()=>{i&&(Yt(i),e.nextTick(()=>{const p=Dt("bold");ke.value.bold=p})),wt(),ul(),pl()});return}if(a==="italic"){const d=Gt();ke.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(V.value={command:"italic",state:d}),e.nextTick(()=>{i&&(Yt(i),e.nextTick(()=>{const p=Dt("italic");ke.value.italic=p})),wt(),Dl(),ul(),pl()});return}let c=!1;try{c=document.execCommand(a,!1,n)}catch{}e.nextTick(()=>{if(i&&Yt(i),["bold","italic","underline"].includes(a))try{if(a==="bold")i&&e.nextTick(()=>{const u=Dt("bold");ke.value.bold=u});else if(a==="italic")if(i)e.nextTick(()=>{const u=Dt("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 y=u.getRangeAt(0),C=y.commonAncestorContainer.nodeType===1?y.commonAncestorContainer.closest("a"):y.commonAncestorContainer.parentElement?.closest("a");C&&(!C.getAttribute("href")||C.getAttribute("href")==="")&&C.setAttribute("href",n)}h.value.querySelectorAll("a").forEach(y=>{const C=y.getAttribute("href");(!C||C===""||C==="#")&&y.setAttribute("href",n)})}wt(),ul(),pl()})},Dt=(a,n=null)=>{if(A.disabled||!h.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,y=p.nodeType===3?p.parentElement:p;if(y&&((y.tagName==="STRONG"||y.tagName==="B"||y.closest&&y.closest("strong, b"))&&(u=!0),!u&&y.style&&parseInt(y.style.fontWeight)>=600&&(u=!0),!u))try{const C=window.getComputedStyle(y);parseInt(C.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 y=!1;if(p){const C=document.createTreeWalker(p,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let R;for(;R=C.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(R))){if(R.nodeType===3){if(!(R.textContent||"").trim())continue;y=!0;let M=R.parentElement;for(;M&&M!==h.value;){if(M.tagName==="STRONG"||M.tagName==="B"){u=!0;break}if(M.style&&parseInt(M.style.fontWeight)>=600){u=!0;break}M=M.parentElement}}else if(R.nodeType===1){const O=R;if(O.tagName==="STRONG"||O.tagName==="B"){u=!0;break}if(O.style&&parseInt(O.style.fontWeight)>=600){u=!0;break}}if(u)break}}return ke.value[a]=u&&y,u&&y}}if(a==="italic"){let u=!1;if(c.collapsed){const p=c.commonAncestorContainer,y=p.nodeType===3?p.parentElement:p;if(y&&((y.tagName==="EM"||y.tagName==="I"||y.closest&&y.closest("em, i"))&&(u=!0),!u&&y.style&&y.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(y).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 y=!1;if(p){const C=document.createTreeWalker(p,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let R;for(;R=C.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(R))){if(R.nodeType===3){if(!(R.textContent||"").trim())continue;y=!0;let M=R.parentElement;for(;M&&M!==h.value;){if(M.tagName==="EM"||M.tagName==="I"){u=!0;break}if(M.style&&M.style.fontStyle==="italic"){u=!0;break}M=M.parentElement}}else if(R.nodeType===1){const O=R;if(O.tagName==="EM"||O.tagName==="I"){u=!0;break}if(O.style&&O.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return ke.value[a]=u&&y,u&&y}}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}},Pn=a=>{A.disabled||!A.richText||(we.value=we.value===a?null:a,a==="askAi"&&(mt.value=null))},tl=()=>{we.value=null,fe.value=null},_l=a=>{Pl("formatBlock",a),tl()},yn=a=>{if(!a||!h.value)return a;const n=We=>{let $e=We.nodeType===Node.TEXT_NODE?We.parentElement:We;for(;$e&&$e!==h.value;){const gt=$e.tagName;if(gt==="P"){const Ut=$e.parentElement;if(Ut===h.value||Ut.tagName==="BLOCKQUOTE")return $e}if(gt==="BLOCKQUOTE")break;$e=$e.parentElement}return null},s=n(a.startContainer),i=n(a.endContainer);if(!s||!i)return a;const c=[],d=document.createTreeWalker(h.value,NodeFilter.SHOW_ELEMENT,{acceptNode:We=>{const $e=We.tagName;if($e==="P"){const gt=We.parentElement;if(gt===h.value||gt.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return $e==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const p=c.indexOf(s),y=c.indexOf(i);if(p===-1||y===-1)return a;const C=Math.min(p,y),R=Math.max(p,y),O=c.slice(C,R+1);if(O.length===0)return a;const M=O[0],ue=O[O.length-1],le=document.createRange();return le.setStartBefore(M),le.setEndAfter(ue),le},sn=()=>{if(A.disabled||!A.richText||!h.value)return;ot.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),Tt(),ot.value=!1):Tt(),tl(),h.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;let n=a.getRangeAt(0);!n.collapsed&&_n(n)&&(n=yn(n),a.removeAllRanges(),a.addRange(n));let s=null;!n.collapsed&&_n(n)&&(s=Kt());const i=n.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&h.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(y=>{if(y.nodeType===Node.ELEMENT_NODE)if(y.tagName==="P"||y.tagName==="DIV")u.insertBefore(y,c);else{const C=document.createElement("p");C.appendChild(y.cloneNode(!0)),u.insertBefore(C,c)}else if(y.nodeType===Node.TEXT_NODE&&y.textContent.trim()){const C=document.createElement("p");C.appendChild(y.cloneNode(!0)),u.insertBefore(C,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 y=[],C=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:M=>M.parentNode===u&&M.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let R;for(;R=C.nextNode();)y.push(R);if(y.forEach(M=>{const ue=document.createElement("p");M.parentNode.insertBefore(ue,M),ue.appendChild(M)}),u.querySelectorAll("p, div").forEach(M=>{M.textContent.trim()===""&&!M.querySelector("img")&&(M.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const M=document.createElement("p");M.innerHTML="<br>",u.appendChild(M)}}e.nextTick(()=>{s&&Yt(s),Il(),wt(),pl()})},Fl=()=>{if(!h.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||!h.value.contains(i))return;const c=R=>{if(!R)return!1;const O=R.textContent||"",ue=(R.innerHTML||"").trim();return O.trim()===""||ue===""||ue==="<br>"||ue==="<br/>"||ue==="<p></p>"||ue==="<p><br></p>"||ue==="<p><br/></p>"||ue==="<p> </p>"||ue==="<p><br> </p>"||ue==="<div></div>"||ue==="<div><br></div>"||ue==="<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 R=i.lastChild;if(R.nodeType===1&&R.tagName==="BR")R.remove();else if(R.nodeType===3)if((R.textContent||"").trim()==="")R.remove();else break;else break}if(i.children.length>0)for(let R=i.children.length-1;R>=0;R--){const O=i.children[R];if((O.tagName==="P"||O.tagName==="DIV")&&c(O))O.remove();else break}let u=i.innerHTML;const p=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==p&&(i.innerHTML=u);const y=document.createElement("p");y.innerHTML="<br>",i.parentNode?i.nextSibling?i.parentNode.insertBefore(y,i.nextSibling):i.parentNode.appendChild(y):h.value&&h.value.appendChild(y);const C=document.createRange();C.selectNodeContents(y),C.collapse(!0),a.removeAllRanges(),a.addRange(C),e.nextTick(()=>{Il(),wt()})},ul=()=>{if(!h.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}},Ql=()=>{if(!h.value)return;const a=window.getSelection();a&&a.rangeCount>0&&a.getRangeAt(0),U.value=Kt();const n=window.getSelection();let s="";n.rangeCount>0&&(s=n.getRangeAt(0).toString()),Z.value="",ze.value=s,He.value="",Xe.value=null,Ae.value=!0,tl(),e.nextTick(()=>{Ye.value&&Ye.value.focus()})},Ul=()=>{if(!h.value)return;ot.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),Tt(),ot.value=!1):Tt();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&&Xe.value&&(n=Xe.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)}Xe.value=null}else Pl("unlink");ye.value=!1,tl(),e.nextTick(()=>{wt(),ul()})},k=()=>{A.disabled||!A.richText||h.value&&(ot.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),Tt(),ot.value=!1):Tt(),tl(),h.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{j(),wt(),pl()}))},w=()=>{A.disabled||!A.richText||h.value&&(ot.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),Tt(),ot.value=!1):Tt(),tl(),h.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{j(),wt(),pl()}))},E=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},j=()=>{if(!h.value)return;h.value.querySelectorAll("li > ol").forEach(n=>{const s=n.parentElement;if(s&&s.tagName==="LI"){const i=E(s);i!==null&&Array.from(n.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(i))})}})},Ce=()=>{if(A.disabled||!A.richText||!h.value)return;tl(),h.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(()=>{j(),wt()});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=E(c);u.appendChild(s),p!==null&&i.tagName==="OL"&&s.setAttribute("data-parent-num",String(p)),j();const y=document.createRange();y.selectNodeContents(s),y.collapse(!1),a.removeAllRanges(),a.addRange(y),e.nextTick(()=>{wt(),pl()})}else document.execCommand("indent",!1),e.nextTick(()=>{j(),wt(),pl()})},qe=()=>{if(A.disabled||!A.richText||!h.value)return;tl(),h.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(()=>{j(),wt()});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(),j();const u=document.createRange();u.selectNodeContents(s),u.collapse(!1),a.removeAllRanges(),a.addRange(u),e.nextTick(()=>{wt(),pl()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{j(),wt(),pl()})},Ie=e.ref(null),at=e.ref(null),f=e.ref({}),g=e.ref(""),S=e.ref(null),F=e.ref("");e.ref("");const z=e.ref(null);e.ref("");const Qe=e.ref([]),Te=e.ref(!1),Ft=e.ref(!1),Le=a=>{if(!a)return"";const n=a.cloneRange(),s=document.createElement("div");return s.appendChild(n.cloneContents()),s.innerHTML},st=()=>{if(!A.commentUser||A.disabled||!A.richText||!h.value)return;if(Ie.value!==null){Ie.value=null,g.value="",F.value="",z.value=null,Qe.value=[],Ln(!0);return}tl(),h.value.focus();const a=window.getSelection();if(!a||a.rangeCount===0)return;const n=a.getRangeAt(0);if(n.collapsed||!_n(n))return;F.value=Le(n)||"",z.value=Kt();const s=n.getBoundingClientRect(),i=h.value.parentElement;if(!i)return;const c=i.getBoundingClientRect(),d=s.bottom-c.top,p=Math.max(d+8,0);f.value={top:`${p}px`,bottom:"auto"},Ie.value=Date.now(),e.nextTick(()=>{if(g.value="",S.value){const C=S.value;C.style.height="auto",C.style.height=`${C.scrollHeight}px`,C.focus()}const y=i.querySelector(".dss-comment-overlay");if(y&&i){const C=i.querySelector(".dss-text-editor-footer");if(C){const R=i.getBoundingClientRect(),O=y.getBoundingClientRect(),M=C.getBoundingClientRect(),ue=O.bottom-R.top,le=M.top-R.top,We=8;if(ue>le-We){const $e=M.height;f.value={bottom:`${$e+We}px`,top:"auto"}}else f.value={top:`${p}px`,bottom:"auto"}}}})},ne=()=>{if(!g.value.trim())return;const a=g.value.trim(),n=new Date,s={text:a,selectionText:F.value,selectionRange:z.value,commentId:Ie.value,user:A.commentUser||null,createdAt:n.toISOString()};Qe.value=[...Qe.value,s],de("comment-submitted",s),Gn(s),z.value&&!Ze(z.value)&&jo(Ie.value,z.value),g.value="",e.nextTick(()=>{if(S.value){const i=S.value;i.style.height="auto",i.style.height=`${i.scrollHeight}px`,i.focus()}it("sendComment")})},ll=(a,n)=>{if(!(!A.commentUser||!a.user||a.user.id!==A.commentUser.id)){if(Qe.value=Qe.value.filter((s,i)=>i!==n),Ie.value!==null&&h.value){const s=String(Ie.value),i=h.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`);if(i&&Qe.value.length>0){const c=[],d=new Set;Qe.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(Qe.value.length))}else i&&Qe.value.length===0&&(i.removeAttribute("data-comment-user"),i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count","0"))}if(de("comment-deleted",{comment:a,index:n,commentId:Ie.value}),A.comments&&Array.isArray(A.comments)){const s=A.comments.filter(i=>!(i.commentId===a.commentId&&i.text===a.text&&i.user?.id===a.user?.id));de("update:comments",s)}e.nextTick(()=>{it("deleteComment")})}},Ze=a=>{if(!a||!h.value)return!1;try{const n=Kn(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},Kn=a=>{if(!a||!h.value)return null;try{const n=document.createRange();if(a.type==="element"&&a.element)return h.value.contains(a.element)?(n.setStart(a.element,a.offset),n.collapse(!0),n):null;let s=0;const i=[h.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||!h.value))try{const s=Kn(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,y=s.endContainer,C=s.startOffset,R=s.endOffset,O=p.nodeType===3?p.parentNode:p,M=y.nodeType===3?y.parentNode:y;if(O===M&&C===0&&R===(y.nodeType===3?y.length:M.childNodes.length)&&(O.tagName==="P"||O.tagName==="DIV"||O.tagName==="H1"||O.tagName==="H2"||O.tagName==="H3"||O.tagName==="H4"||O.tagName==="H5"||O.tagName==="H6")){const le=s.extractContents();d.appendChild(le),s.insertNode(d)}else s.surroundContents(d)}catch{const y=s.extractContents();d.appendChild(y),s.insertNode(d)}const u=h.value.querySelector(`[data-comment="${String(a)}"]`);e.nextTick(()=>{it("wrapSelectionWithCommentMarker"),wt()})}catch{}},Gn=a=>{if(!a||!a.commentId)return;const n=Array.isArray(A.comments)?[...A.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(y=>y.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)}Te.value=!0,de("update:comments",n)},On=(a,n=[])=>{if(!A.commentUser||A.disabled||!A.richText||!h.value)return;const s=h.value;let i=null;try{i=s.querySelector(a)}catch{return}if(!i)return;tl(),s.focus();const c=document.createRange();c.selectNodeContents(i);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),F.value=i.innerHTML||"",z.value=Kt();const u=c.getBoundingClientRect(),p=s.parentElement;if(p){const R=p.getBoundingClientRect(),O=u.bottom-R.top,ue=Math.max(O+8,0);f.value={top:`${ue}px`,bottom:"auto"}}const y=i.getAttribute("data-comment")||i.getAttribute("data-fake-comment");let C=[];if(y&&A.comments&&Array.isArray(A.comments)){const R=A.comments.find(O=>String(O.conversation_id)===String(y));if(R&&R.conversation&&Array.isArray(R.conversation)){const O=R.conversation.map(M=>({id:M.id||M.commentary_id,commentary_id:M.id||M.commentary_id,conversation_id:R.id||R.conversation_id,text:M.text,user:M.user,createdAt:M.created_at||M.createdAt,updated_at:M.updated_at||M.updatedAt}));C.push(...O)}}C.length===0&&Array.isArray(n)&&n.length>0&&(C=n.slice()),C.sort((R,O)=>{const M=We=>{if(!We)return 0;const $e=new Date(We).getTime();return isNaN($e)?0:$e},ue=M(R.createdAt),le=M(O.createdAt);return ue===le?0:ue-le}),Qe.value=C,Ln(!0),Ie.value=y||null,i&&(at.value=i,i.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(g.value="",S.value){const R=S.value;R.style.height="auto",R.style.height=`${R.scrollHeight}px`,R.focus()}if(p){const R=p.querySelector(".dss-comment-overlay");if(R){const O=p.querySelector(".dss-text-editor-footer");if(O){const M=p.getBoundingClientRect(),ue=R.getBoundingClientRect(),le=O.getBoundingClientRect(),We=ue.bottom-M.top,$e=le.top-M.top,gt=8;if(We>$e-gt){const Ut=le.height;f.value={bottom:`${Ut+gt}px`,top:"auto"}}}}}it("openCommentOverlayForSelector")})},Qn=e.ref(null),oo=e.ref(0),Ko=a=>{if(!(A.disabled||!A.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&&h.value&&h.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(()=>{Fl()},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,y=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.contains(p)&&p!==u||d.contains(y)&&y!==u){a.preventDefault();const C=document.createRange();C.setStartAfter(d),C.collapse(!0),n.removeAllRanges(),n.addRange(C);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 y=c.contains(u)||u===c,C=c.contains(p)||p===c,O=s.cloneContents().textContent?.trim()||"",M=c.textContent?.trim()||"";(!y||!C||O.length>M.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(()=>{wt()});return}}}}if(a.key==="Tab"){a.preventDefault(),a.shiftKey?qe():Ce();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=y=>{if(!y)return!1;let C=y.previousSibling;for(;C;){if(C.classList&&C.classList.contains("dss-image-wrapper")||C.tagName==="IMG"||C.querySelector&&C.querySelector(".dss-image-wrapper")||C.querySelector&&C.querySelector("img"))return!0;C=C.previousSibling}const R=y.parentElement;return R&&R!==h.value?p(R):!1};if(u.nodeType===3){const y=u.parentElement;if(y&&(p(y)||p(u))){const C=y.closest("p, div");if(C&&C!==h.value){a.preventDefault(),a.stopPropagation();let R=null;const O=s.startOffset;O<u.length&&(R=u.splitText(O));const M=document.createElement("p");if(R?M.appendChild(R):M.innerHTML="<br>",u.length===0){const le=u.parentElement;le&&(le.removeChild(u),le.childNodes.length===0&&le.appendChild(document.createElement("br")))}C.nextSibling?C.parentNode.insertBefore(M,C.nextSibling):C.parentNode.appendChild(M);const ue=document.createRange();R?ue.setStart(R,0):ue.setStart(M,0),ue.collapse(!0),n.removeAllRanges(),n.addRange(ue),e.nextTick(()=>{wt()});return}}}}const i=s.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&h.value&&h.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 We=le.textContent||"",gt=(le.innerHTML||"").trim(),Ut=gt.replace(/<br\s*\/?>/gi,"").trim();return We.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>"},y=c.lastChild,C=y&&y.nodeType===1&&y.tagName==="BR",R=s.startContainer,O=R.nodeType===3?R.parentElement:R,M=O===c||O&&O.parentElement===c;if(u&&p(u)||C&&M){a.preventDefault(),setTimeout(()=>{Fl()},50);return}}}}if(a.key===" "){const n=Date.now(),s=n-oo.value;if(Qn.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(),Ce();return}}}}Qn.value=" ",oo.value=n}else Qn.value=a.key}},Go=a=>{if(A.disabled||!A.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,"")),Tt();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 y=new DOMParser().parseFromString(u,"text/html");let C=h.value.querySelector("h1")?1:0;if(y.querySelectorAll("h1").forEach(O=>{if(C>0){const M=y.createElement("p");M.innerHTML=O.innerHTML,O.parentNode.replaceChild(M,O)}else C++}),c){const O=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],M=Array.from(y.body.children).filter(ue=>O.includes(ue.tagName));if(M.length===1){const ue=M[0].tagName,le=c.tagName,We=c.textContent.trim()===""&&!c.querySelector("img");let $e=!1;if(["H1","H2","H3","H4","H5","H6"].includes(le)?$e=!0:We||(ue===le||ue==="P")&&($e=!0),$e)return M[0].innerHTML.trim()}}return y.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);wt()},$o=a=>{if(we.value){const s=a.target;!s.closest(".dss-toolbar-dropdown")&&!s.closest(".dss-toolbar-dropdown-toggle")&&tl()}if(Me.value){const s=a.target,i=s.closest(".dss-floating-toolbar"),c=h.value&&s.closest(".dss-text-editor-content");!i&&!c&&Jn()}if(mt.value){const s=a.target,i=s.closest(".dss-floating-toolbar"),c=s.closest(".dss-toolbar-dropdown");!i&&!c&&Ao()}const n=a.target;if(!n.closest(".dss-toolbar-dropdown")&&!n.closest(".dss-toolbar-dropdown-submenu")&&(fe.value=null),!h.value||!n.closest(".dss-text-editor-content")){const s=window.getSelection();if(s&&s.rangeCount>0){const i=s.getRangeAt(0);ae.value=!i.collapsed&&_n(i)}else ae.value=!1}if(Ie.value!==null){const s=document.querySelector(".dss-comment-overlay");let i=!1;if(s){const u=s.getBoundingClientRect(),p=a.clientX,y=a.clientY;i=p>=u.left&&p<=u.right&&y>=u.top&&y<=u.bottom}const c=n.closest(".dss-toolbar-button"),d=c&&c.getAttribute("title")==="Comment";!i&&!d&&(Ie.value=null,g.value="",F.value="",z.value=null,Qe.value=[],Ln(!0))}},Lo=(a,n)=>{a&&a.stopPropagation&&a.stopPropagation(),Fe.value&&(clearTimeout(Fe.value),Fe.value=null),fe.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}Fe.value&&clearTimeout(Fe.value),Fe.value=setTimeout(()=>{fe.value=null,Fe.value=null},150)},Qo=a=>{fe.value=null};let wn=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(C=>C.tagName==="BUTTON"||C.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-${++wn}`;s.classList.add("dss-toolbar-dropdown-item-has-submenu"),s.setAttribute("data-submenu-id",p);let y=null;c?(s.tagName==="BUTTON"&&s.parentNode.insertBefore(c,s.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),y=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),y=d),y&&(y.setAttribute("data-submenu-id",p),y.setAttribute("data-processed","true"),c&&s.tagName!=="BUTTON"?y.dataset.originalParentRef="inside":y.dataset.originalParentRef="sibling",Array.from(y.children).forEach(R=>{(R.tagName==="BUTTON"||R.tagName==="DIV")&&!R.classList.contains("dss-toolbar-dropdown-item")&&R.classList.add("dss-toolbar-dropdown-item")}))}})},Do=()=>{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=y=>{const C=c.getAttribute("data-submenu-id");C&&Lo(y,C)},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=C=>{const R=c.getAttribute("data-submenu-id");R&&Lo(C,R)},p=To;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",p),c._subMenuHandlers={enter:u,leave:p},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(C=>{C.addEventListener("click",Qo)})})})};let Wn=null;const ao=()=>{if(fe.value){const a=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${fe.value}"]`),n=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${fe.value}"]`);a&&n&&Vn(a,n)}if(Me.value&&pl(),A.richText){if(Wn!==null)return;Wn=setTimeout(()=>{Wn=null,it("handleWindowResize")},150)}},so=()=>{if(!A.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?il():ql(),D.value?Ll():cl()})}),e.nextTick(()=>{ea()}),A.richText&&h.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",$o),window.addEventListener("resize",ao);let a=null;const n=()=>{a===null&&(a=setTimeout(()=>{a=null,ao()},150))};window.addEventListener("scroll",n,!0),h.value._windowScrollHandler=n,h.value._windowScrollTimeout=a,h.value.closest(".editor-with-comments"),h.value.closest(".dss-text-editor-content-wrapper");const s=h.value.closest(".dss-text-editor-content");let i=null;const c=()=>{i===null&&(i=setTimeout(()=>{i=null,ao()},150))};s&&(s.addEventListener("scroll",c),h.value._scrollHandlers={wrapper:null,content:s,handler:c}),e.nextTick(()=>{Do(),so()}),h.value.addEventListener("click",p=>{const y=p.target;y.closest("a")&&!A.disabled&&p.preventDefault();const R=y.closest(".dss-image-no-alt-icon"),O=y.closest(".dss-image-wrapper");if(R||O&&y===O){p.preventDefault(),p.stopPropagation();const M=window.getSelection(),ue=document.createRange();ue.setStartAfter(O),ue.collapse(!0),M.removeAllRanges(),M.addRange(ue)}else O&&y.tagName!=="IMG"&&(p.preventDefault(),e.nextTick(()=>{const M=window.getSelection();if(M.rangeCount>0){const le=M.getRangeAt(0).commonAncestorContainer,We=le.nodeType===3?le.parentElement:le;if(O.contains(We)&&We!==O.querySelector("img")){const $e=document.createRange();$e.setStartAfter(O),$e.collapse(!0),M.removeAllRanges(),M.addRange($e)}}else{const ue=document.createRange();ue.setStartAfter(O),ue.collapse(!0),M.addRange(ue)}}))},!0),h.value.addEventListener("mousedown",p=>{const y=p.target,C=y.closest(".dss-image-no-alt-icon"),R=y.closest(".dss-image-wrapper");if(C||R&&y.tagName!=="IMG"){p.preventDefault();const O=window.getSelection(),M=document.createRange();R&&(M.setStartAfter(R),M.collapse(!0),O.removeAllRanges(),O.addRange(M))}},!0),h.value.addEventListener("paste",p=>{e.nextTick(()=>{if(!h.value)return;h.value.querySelectorAll("img").forEach(C=>{if(!C.closest(".dss-image-wrapper"))C.removeAttribute("alt"),C.removeAttribute("data-alt"),C.setAttribute("alt",""),C.setAttribute("data-alt",""),C.alt="";else{const O=C.getAttribute("alt")||C.alt||"";if(O){const M=C.getAttribute("src")||C.src||"",ue=M.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),le=O===M||O===ue;(O.startsWith("http://")||O.startsWith("https://")||O.startsWith("data:")||le||le)&&(C.setAttribute("alt",""),C.setAttribute("data-alt",""),C.alt="")}}}),Nl()})}),h.value.addEventListener("dragstart",p=>{const y=p.target,C=y.tagName==="IMG"?y:y.closest("img"),R=C?.closest(".dss-image-wrapper");C&&h.value.contains(C)&&(Vt.value=R||C,p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/html","image-drag"))}),h.value.addEventListener("dragover",p=>{Vt.value&&(p.preventDefault(),p.stopPropagation(),p.dataTransfer.dropEffect="move")}),h.value.addEventListener("dragenter",p=>{Vt.value&&(p.preventDefault(),p.stopPropagation())}),h.value.addEventListener("drop",p=>{if(!Vt.value||!h.value)return;p.preventDefault(),p.stopPropagation();const y=Vt.value,C=y.classList?.contains("dss-image-wrapper"),R=C?y.querySelector("img"):y,O=C?y:R?.closest(".dss-image-wrapper");if(!R||!h.value.contains(R)){Vt.value=null;return}let M=null;const ue=p.clientX,le=p.clientY;if(document.caretRangeFromPoint)M=document.caretRangeFromPoint(ue,le);else{const nl=window.getSelection();nl.rangeCount>0?M=nl.getRangeAt(0).cloneRange():(M=document.createRange(),M.selectNodeContents(h.value),M.collapse(!1))}if(!M){Vt.value=null;return}const We=M.commonAncestorContainer,$e=We.nodeType===3?We.parentElement:We;if($e?.closest(".dss-image-wrapper")===O||O&&O.contains($e)){Vt.value=null;return}if(O&&($e===O||O.contains($e))){Vt.value=null;return}const Ut=R.getAttribute("src");let qt=null;O?qt=O.cloneNode(!0):qt=R.cloneNode(!0);try{let nl=M.startContainer;if(nl.nodeType===3&&(nl=nl.parentElement),O&&(nl===O||O.contains(nl))){const ol=document.createRange();ol.setStartAfter(O),ol.collapse(!0),M=ol}M.insertNode(qt);const gl=document.createRange();gl.setStartAfter(qt),gl.collapse(!0);const It=window.getSelection();It.removeAllRanges(),It.addRange(gl)}catch{if(h.value.childNodes.length===0){const gl=document.createElement("p");gl.appendChild(qt),h.value.appendChild(gl)}else{const gl=h.value.lastChild;if(gl&&gl.nodeType===1)gl.appendChild(qt);else{const It=document.createElement("p");It.appendChild(qt),h.value.appendChild(It)}}}O?O.remove():R.remove(),Vt.value=null,e.nextTick(()=>{const nl=h.value.querySelectorAll("img");let gl=!1;nl.forEach(It=>{if(It.getAttribute("src")===Ut)if(!gl)gl=!0;else{const ol=It.closest(".dss-image-wrapper");ol?ol.remove():It.remove()}}),Nl(),wt()})}),h.value.addEventListener("dragend",p=>{Vt.value=null});let d=null;const u=new MutationObserver(p=>{p.forEach(y=>{y.addedNodes.forEach(C=>{if(C.nodeType===1){C.tagName==="IMG"&&(C.removeAttribute("alt"),C.removeAttribute("data-alt"),C.setAttribute("alt",""),C.setAttribute("data-alt",""),C.alt="");const R=C.querySelectorAll&&C.querySelectorAll("img");R&&R.forEach(O=>{O.removeAttribute("alt"),O.removeAttribute("data-alt"),O.setAttribute("alt",""),O.setAttribute("data-alt",""),O.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{Nl(),so(),d=null},100)});if(u.observe(h.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const p=document.querySelector(".dss-text-editor-toolbar");if(p){const y=new MutationObserver(()=>{e.nextTick(()=>{so()})});y.observe(p,{childList:!0,subtree:!0}),p._toolbarMutationObserver=y}}),A.modelValue){const p=Sl(A.modelValue);h.value.innerHTML=p,hn()}e.nextTick(()=>{const p=h.value.innerHTML||"",y=A.title||"",C=A.description||"";bt.value=p,re.value=y,X.value=C,te.value=y,ce.value=C,j(),Nl(),Dl(),xn(),uo(),fl()}),ul(),Il(),h.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",$o),window.removeEventListener("resize",ao),h.value&&h.value._windowScrollHandler&&window.removeEventListener("scroll",h.value._windowScrollHandler,!0),Wn!==null&&(clearTimeout(Wn),Wn=null),h.value&&h.value._windowScrollTimeout!==null&&clearTimeout(h.value._windowScrollTimeout),Se.value&&clearTimeout(Se.value),Fe.value&&clearTimeout(Fe.value),h.value&&h.value._mutationObserver&&h.value._mutationObserver.disconnect(),je.value&&je.value.disconnect(),St.value!==null&&(cancelAnimationFrame(St.value),St.value=null),ut.value!==null&&(clearTimeout(ut.value),ut.value=null),vt.value!==null&&(clearTimeout(vt.value),vt.value=null),Ln(!0),h.value&&h.value._scrollHandlers){const{wrapper:n,content:s,handler:i}=h.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&&!A.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 y=document.createRange();y.setStartAfter(i),y.collapse(!0),c.removeAllRanges(),c.addRange(y)}}Nl(),ul(),Il(),pl(),xn()}):e.nextTick(()=>{Nl(),ul(),Il(),pl(),xn()})},Co=()=>{Vl();const a=window.getSelection();if(a&&a.rangeCount>0){const s=a.getRangeAt(0);ae.value=!s.collapsed&&_n(s),!s.collapsed&&V.value&&(V.value=null)}else ae.value=!1;if(Nl(),ul(),Il(),pl(),xn(),a&&a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c&&c.closest(".dss-text-editor-footer")){a.removeAllRanges(),ae.value=!1;return}}["bold","italic","underline"].forEach(s=>{try{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0);if(!c.collapsed)if(s==="bold"){const d=c.commonAncestorContainer,u=d.nodeType===3?d.parentElement:d;let p=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(p=!0),!p&&u.style&&parseInt(u.style.fontWeight)>=600&&(p=!0),!p))try{const y=window.getComputedStyle(u);parseInt(y.fontWeight)>=600&&(p=!0)}catch{}ke.value[s]=p}else{const d=document.queryCommandState(s);ke.value[s]=d}}}catch{}})},xn=()=>{if(!A.richText||A.disabled||!h.value){B.value="p";return}try{const a=window.getSelection();if(!a||a.rangeCount===0){B.value="p";return}const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(!i||!h.value.contains(i)){B.value="p";return}const c=i.closest("h1, h2, h3, h4, h5, h6, p");if(!c){B.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?B.value=d:B.value="p"}catch{B.value="p"}},Il=()=>{if(!h.value){Ke.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&&h.value.contains(c))}Ke.value=n}catch{Ke.value=!1}},_n=a=>{if(!a||!h.value)return!1;const n=a.commonAncestorContainer;if(!n)return!1;const s=n.nodeType===3?n.parentElement:n;return s?h.value.contains(s):!1},Jn=()=>{Me.value=!1},pl=()=>{if(!A.floatingToolbar||!A.richText||A.disabled){Me.value=!1;return}const a=window.getSelection();if(!a||a.rangeCount===0){Me.value=!1;return}const n=a.getRangeAt(0);if(n.collapsed||!_n(n)){Me.value=!1;return}const s=n.getBoundingClientRect();if(!s||s.width===0&&s.height===0){Me.value=!1;return}const i=h.value;if(!i){Me.value=!1;return}const c=i.getBoundingClientRect();if(!c||c.width===0){Me.value=!1;return}const d=40,u=8,p=s.top-d/2+15;let y=s.left+s.width/2;const C=window.innerWidth||document.documentElement.clientWidth||0;let R=0;yt.value&&(R=yt.value.getBoundingClientRect().width);const O=(R||320)/2;let M=c.left+O,ue=c.right-O;if(ue<M){const le=c.left+c.width/2;M=le,ue=le}if(C>0){const le=O+u,We=C-O-u;if(M=Math.max(M,le),ue=Math.min(ue,We),ue<M){const $e=C/2;M=$e,ue=$e}}y<M?y=M:y>ue&&(y=ue),rt.value={position:"fixed",top:`${Math.max(p,8)}px`,left:`${y}px`,transform:"translate(-50%, -100%)",zIndex:10003},Me.value=!0},bo=a=>{A.disabled||!A.richText||(mt.value=mt.value===a?null:a,a==="askAi"&&(we.value=null))},Ao=()=>{mt.value=null,fe.value=null},Jl=a=>{_l(a),Ao()};let En=null,Yl=null,Mn=null,qn=null;const la=a=>{if(A.disabled||!A.richText){eo(),to();return}const n=a.target,s=n.closest("a"),i=n.closest("img");if(En&&(clearTimeout(En),En=null),Mn&&(clearTimeout(Mn),Mn=null),s&&s!==Yl){to(),Yl=s;let c=s.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=s.textContent||""),Xe.value=s,he.value=c,K.value=!0,ge.value=!0,Ho(s)}else!s&&Yl?(Yl=null,En=setTimeout(()=>{ge.value||eo()},150)):s&&s===Yl&&Ho(s);if(i&&i!==qn){eo(),qn=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),pt.value=i,Pt.value=c.trim()||L("textEditor.image.noAlt"),Ct.value=!0,H.value=!0,wo(i)}else!i&&qn?(qn=null,Mn=setTimeout(()=>{H.value||to()},150)):i&&i===qn&&wo(i)},na=a=>{const n=a.relatedTarget;(!n||!n.closest(".dss-text-editor-content")&&!n.closest(".dss-link-popup"))&&(Yl=null,qn=null,En&&(clearTimeout(En),En=null),Mn&&(clearTimeout(Mn),Mn=null),eo(),to())},eo=()=>{ge.value=!1,setTimeout(()=>{ge.value||(K.value=!1,he.value="",Ae.value||(Xe.value=null))},100)},Ho=a=>{if(!a||!h.value)return;const n=a.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;Re.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},to=()=>{H.value=!1,setTimeout(()=>{H.value||(Ct.value=!1,Pt.value="",Qt.value||(pt.value=null))},100)},wo=a=>{if(!a||!h.value)return;const n=a.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;pe.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},xo=()=>{if(!he.value||!Xe.value)return;let n=Xe.value.getAttribute("href")||he.value;!n.startsWith("http://")&&!n.startsWith("https://")&&!n.startsWith("mailto:")&&(n="https://"+n),window.open(n,"_blank","noopener,noreferrer")},Ro=()=>{if(Xe.value){const a=Xe.value.textContent||"",n=Xe.value.getAttribute("href")||"",s=Xe.value;Z.value=n,ze.value=a,He.value=a,ge.value=!1,K.value=!1,he.value="",Xe.value=s,Ae.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")||"";Z.value=d,ze.value=c,He.value=c,Xe.value=i,Ae.value=!0}}}else{U.value=Kt();const a=window.getSelection();let n="";a.rangeCount>0&&(n=a.getRangeAt(0).toString()),Z.value="",ze.value=n,He.value="",Xe.value=null,Ae.value=!0}e.nextTick(()=>{Ye.value&&(Ye.value.focus(),Ye.value.select())})},ro=()=>{Ae.value=!1,Z.value="",ze.value="",He.value="",Xe.value=null,U.value=null},Eo=()=>{if(!Z.value.trim()){ro();return}if(ot.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),Tt(),ot.value=!1):Tt(),ze.value.trim()||(ze.value=Z.value.trim()),Xe.value&&h.value&&h.value.contains(Xe.value)){const a=window.getSelection();a.rangeCount>0&&a.removeAllRanges();const n=Xe.value;if(n.setAttribute("href",Z.value.trim()),ze.value.trim()!==He.value.trim()){for(;n.firstChild;)n.removeChild(n.firstChild);n.textContent=ze.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),wt()}else if(h.value){h.value.focus();const a=window.getSelection();a.removeAllRanges(),U.value&&Yt(U.value);let n=null;if(a.rangeCount>0&&(n=a.getRangeAt(0)),n&&!n.collapsed){n.toString();const s=document.createElement("a");s.href=Z.value.trim(),s.textContent=ze.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(h.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=Z.value.trim(),d.textContent=ze.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=s.parentElement;for(;u&&u!==h.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==h.value){let p=u.nextElementSibling;if(p&&(p.innerHTML==="<br>"||p.innerHTML==="<br/>"||p.textContent.trim()==="")){p.textContent="",p.appendChild(d);const y=document.createTextNode(" ");p.appendChild(y);const C=document.createRange();C.setStartAfter(d),C.collapse(!0),a.removeAllRanges(),a.addRange(C)}else{if(n.startOffset>0){const C=s.textContent.substring(0,n.startOffset),R=C[C.length-1];if(R&&R!==" "&&R!==" "&&R!==`
104
104
  `){const O=document.createTextNode(" ");n.insertNode(O),n.setStartAfter(O)}}n.insertNode(d);const y=document.createTextNode(" ");n.setStartAfter(d),n.insertNode(y),n.setStartAfter(y),n.collapse(!0),a.removeAllRanges(),a.addRange(n)}}}else{if(i&&n.startOffset>0){const p=s.textContent.substring(0,n.startOffset),y=p[p.length-1];if(y&&y!==" "&&y!==" "&&y!==`
105
- `){const C=document.createTextNode(" ");n.insertNode(C),n.setStartAfter(C)}}n.insertNode(d);const u=document.createTextNode(" ");n.setStartAfter(d),n.insertNode(u),n.setStartAfter(u),n.collapse(!0),a.removeAllRanges(),a.addRange(n)}}bt()}e.nextTick(()=>{ul(),ro()})},lo=()=>{if(!h.value||Q.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(h.value,NodeFilter.SHOW_TEXT,{acceptNode:p=>{const y=p.parentElement;return!y||y.closest("a")||y.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 y=c[p],C=y.textContent;s.lastIndex=0;const R=[...C.matchAll(s)];if(R.length===0)continue;const O=R.filter(le=>{const We=le[0],$e=le.index;if($e>0&&C[$e-1]==="@"||$e+We.length<C.length&&C[$e+We.length]==="@")return!1;const ht=y.parentElement;return!(ht&&ht.closest("a"))});if(O.length===0)continue;if(O.length===1&&O[0][0]===C.trim()){const le=O[0][0],We=le.startsWith("http://")||le.startsWith("https://")?le:`https://${le}`,$e=document.createElement("a");$e.href=We,$e.textContent=le,$e.style.color="#60afdf",$e.style.textDecoration="underline",y.parentNode&&(y.parentNode.replaceChild($e,y),u=!0);continue}let M=0;const ue=document.createDocumentFragment();if(O.forEach(le=>{const We=le.index,$e=le[0];if(We>M){const qt=C.substring(M,We);qt&&ue.appendChild(document.createTextNode(qt))}const ht=$e.startsWith("http://")||$e.startsWith("https://")?$e:`https://${$e}`,Ut=document.createElement("a");Ut.href=ht,Ut.textContent=$e,Ut.style.color="#60afdf",Ut.style.textDecoration="underline",ue.appendChild(Ut),M=We+$e.length}),M<C.length){const le=C.substring(M);le&&ue.appendChild(document.createTextNode(le))}y.parentNode&&ue.childNodes.length>0&&(y.parentNode.replaceChild(ue,y),u=!0)}u&&n&&e.nextTick(()=>{Yt(n),ul()})},oa=()=>{if(!h.value)return;const a=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,n=document.createTreeWalker(h.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 y=0;const C=document.createDocumentFragment();p.forEach(R=>{const O=R.index,M=R[0].startsWith("<u>")?"u":"ins",ue=R[1]||R[2]||"";O>y&&C.appendChild(document.createTextNode(u.substring(y,O)));const le=document.createElement(M);le.textContent=ue,C.appendChild(le),y=O+R[0].length}),y<u.length&&C.appendChild(document.createTextNode(u.substring(y))),d.parentNode&&C.childNodes.length>0&&d.parentNode.replaceChild(C,d)}},io=a=>{if(!h.value||Q.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===h.value||!h.value.contains(c))return;const d=()=>{let qt="",nl=0,gl=!1;const It=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:rn=>rn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let ol=0;for(;It.nextNode();){const rn=It.currentNode,kn=rn.textContent||"",Ol=ol;if(ol+=kn.length,rn===i.startContainer){qt+=kn.substring(0,i.startOffset),nl=Ol+i.startOffset,gl=!0;break}qt+=kn}return gl||(nl=qt.length),{textBeforeCursor:qt,cursorCharOffset:nl}},{textBeforeCursor:u}=d();if(!u.length)return;let p=null,y=null;if(u.endsWith("**")&&(p=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(p=u.match(/__(.+?)__$/s))?y="strong":u.endsWith("*")&&!u.endsWith("**")&&(p=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(p=u.match(new RegExp("(?<!_)_([^_]+)_$")))?y="em":a===">"&&((p=u.match(/<u>(.+?)<\/u>$/s))||(p=u.match(/<ins>(.+?)<\/ins>$/s)))&&(y=p[0].startsWith("<u>")?"u":"ins",p[0].startsWith("<u>"),p[0].startsWith("<u>")),!p||!p[1])return;const C=p[0],R=p[1],O=u.length-C.length,ue=(qt=>{let nl=0;const gl=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:ol=>ol.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let It;for(;It=gl.nextNode();){const ol=(It.textContent||"").length;if(nl+ol>=qt)return{node:It,offset:qt-nl};nl+=ol}return null})(O);if(!ue)return;const le=document.createRange();le.setStart(ue.node,ue.offset),le.setEnd(i.endContainer,i.endOffset);const We=document.createElement(y);We.textContent=R,le.deleteContents(),le.insertNode(We);const $e=window.getSelection(),ht=document.createRange();ht.setStartAfter(We),ht.collapse(!0),$e.removeAllRanges(),$e.addRange(ht);const Ut=Kt();e.nextTick(()=>{bt(),Ut&&Yt(Ut)})},Ml=()=>{h.value&&(Xt.value=Kt(),xe.value="",et.value="",re.value="",lt.value="",yt.value="",Jt.value=null,pt.value=null,Y.value="upload",Qt.value=!0,el(),e.nextTick(()=>{Rt.value&&Rt.value.focus(),ct.value&&(ct.value.value="")}))},P=a=>{const n=a.target?.files?.[0];if(!n){Jt.value=null,et.value="";return}Jt.value=n;const s=new FileReader;s.onload=i=>{et.value=i.target?.result||""},s.readAsDataURL(n)},$l=()=>{ct.value&&ct.value.click()},Xl=()=>{lt.value&&(yt.value="")},Zn=()=>{yt.value&&(lt.value="")},xl=()=>{let a=pt.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")||"";pt.value=a,xe.value=n.trim()===""||n.trim()==="Image"?"":n;const s=a.getAttribute("src")||a.src||"";s.startsWith("http://")||s.startsWith("https://")?(re.value=s,et.value="",Y.value="url"):(et.value=s,re.value="",Y.value="upload");const c=a.style.width||a.getAttribute("width")||"",d=a.style.height||a.getAttribute("height")||"";lt.value=c.endsWith("px")?c.replace("px",""):c,yt.value=d.endsWith("px")?d.replace("px",""):d,Xt.value=null}else{Ml();return}Qt.value=!0,H.value=!1,kt.value=!1,e.nextTick(()=>{Y.value==="url"&&xt.value?(xt.value.focus(),xt.value.select()):Rt.value&&(Rt.value.focus(),Rt.value.select()),ct.value&&(ct.value.value="")})},vl=()=>{Qt.value=!1,xe.value="",et.value="",re.value="",lt.value="",yt.value="",Jt.value=null,pt.value=null,Xt.value=null,Y.value="upload"},Ot=()=>{const a=(xe.value||"").trim(),n=h.value?._mutationObserver;n&&n.disconnect(),nt.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),Tt(),nt.value=!1):Tt();const s=Y.value==="url"?re.value.trim():et.value;if(pt.value&&h.value&&h.value.contains(pt.value)){s&&(pt.value.src=s),pt.value.setAttribute("alt",a),pt.value.setAttribute("data-alt",a),lt.value?(pt.value.style.width=`${lt.value}px`,pt.value.setAttribute("width",lt.value)):(pt.value.style.removeProperty("width"),pt.value.removeAttribute("width")),yt.value?(pt.value.style.height=`${yt.value}px`,pt.value.setAttribute("height",yt.value)):(pt.value.style.removeProperty("height"),pt.value.removeAttribute("height"));const i=window.getSelection();if(i){i.removeAllRanges();const c=document.createRange();c.setStartAfter(pt.value),c.collapse(!0),i.addRange(c)}bt()}else{if(!s){n&&h.value&&n.observe(h.value,{childList:!0,subtree:!0}),vl();return}if(h.value){h.value.focus();const i=window.getSelection();i&&i.rangeCount>0&&i.removeAllRanges();const c=window.getSelection();let d=null;if(Xt.value&&(Yt(Xt.value),c&&c.rangeCount>0&&(d=c.getRangeAt(0))),!d&&c&&c.rangeCount>0&&(d=c.getRangeAt(0)),!d&&h.value){if(d=document.createRange(),h.value.childNodes.length===0){const C=document.createElement("p");C.innerHTML="<br>",h.value.appendChild(C),d.setStart(C,0),d.collapse(!0)}else d.selectNodeContents(h.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){vl();return}const u=d.commonAncestorContainer,p=u.nodeType===3?u.parentElement:u;if(!h.value.contains(p)){if(d=document.createRange(),h.value.childNodes.length===0){const C=document.createElement("p");C.innerHTML="<br>",h.value.appendChild(C),d.setStart(C,0),d.collapse(!0)}else d.selectNodeContents(h.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}const y=document.createElement("img");y.src=s,y.setAttribute("alt",a),y.setAttribute("data-alt",a),lt.value&&(y.style.width=`${lt.value}px`,y.setAttribute("width",lt.value)),yt.value&&(y.style.height=`${yt.value}px`,y.setAttribute("height",yt.value));try{d.insertNode(y),d.setStartAfter(y),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(h.value){if(h.value.childNodes.length===0){const O=document.createElement("p");h.value.appendChild(O),O.appendChild(y)}else{const O=h.value.lastChild;if(O&&O.nodeType===1)O.appendChild(y);else{const M=document.createElement("p");h.value.appendChild(M),M.appendChild(y)}}const R=document.createRange();R.setStartAfter(y),R.collapse(!0),c&&(c.removeAllRanges(),c.addRange(R))}}pt.value=y,bt()}}e.nextTick(()=>{n&&h.value&&n.observe(h.value,{childList:!0,subtree:!0}),ul(),pl(),vl()})};e.watch(()=>A.modelValue,a=>{if(A.richText&&h.value&&!Q.value){const n=Sl(a||""),i=h.value.innerHTML.replace(/&nbsp;|\u00A0/g," "),c=n.replace(/&nbsp;|\u00A0/g," ");if(i!==c){const d=Kt();h.value.innerHTML=n,e.nextTick(()=>{hn();const u=h.value.innerHTML||"",p=A.title||"",y=A.description||"";Ct.value=u,ie.value=p,X.value=y,tl.value=u,te.value=p,ce.value=y,tt.value=[],Et.value=[],Se.value&&(clearTimeout(Se.value),Se.value=null),nt.value=!1,d&&Yt(d),j(),Nl(),Dl(),ul(),pl(),xn(),it("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>A.richText,a=>{a?(pl(),e.nextTick(()=>{uo()})):(Jn(),se.value=[],je.value&&(je.value.disconnect(),je.value=null)),xn()}),e.watch(()=>A.floatingToolbar,a=>{a?pl():Jn()}),e.watch(()=>A.disabled,a=>{a&&Jn(),xn()}),e.watch(()=>A.description,()=>{e.nextTick(()=>{D.value?Ll():cl()})}),e.watch(()=>A.title,()=>{e.nextTick(()=>{sl.value?il():ql()})}),e.watch(()=>A.customToolbarSlots,()=>{e.nextTick(()=>{so()})},{deep:!0}),e.watch(()=>A.comments,(a,n)=>{if(A.commentUser){if(Te.value){Te.value=!1;return}Ft.value||A.richText&&h.value&&e.nextTick(()=>{fl()})}},{deep:!0,immediate:!1});const fl=()=>{if(A.commentUser&&!Ft.value&&!(!A.comments||!Array.isArray(A.comments)||A.comments.length===0)&&!(!A.richText||!h.value)){Ft.value=!0;try{const a=new Set,n=A.comments.filter(u=>{const p=String(u.conversation_id||u.id);return a.has(p)?!1:(a.add(p),!0)}),s=h.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 y=String(p);if(d.has(y))return;const C=h.value.querySelector(`[data-comment="${y}"]`);if(C){At(C,u),d.add(y);return}try{const R=Wt(u.selection_range,u.selection_text);if(R&&!R.collapsed){const O=R.commonAncestorContainer,M=O.nodeType===3?O.parentElement:O;if(M){const We=M.closest("[data-comment], [data-fake-comment]");if(We){const $e=We.getAttribute("data-comment")||We.getAttribute("data-fake-comment");if(String($e)===String(p)){We.setAttribute("data-comment",y),We.removeAttribute("data-fake-comment"),At(We,u),d.add(y);return}else return}}const ue=h.value.querySelector(`[data-comment="${y}"]`);if(ue){At(ue,u),d.add(y);return}const le=document.createElement("span");le.setAttribute("data-comment",y),At(le,u);try{R.surroundContents(le),c++,d.add(y)}catch{try{const $e=document.createRange();$e.setStart(R.startContainer,R.startOffset),$e.setEnd(R.endContainer,R.endOffset),hl($e),$e.surroundContents(le),c++,d.add(y)}catch{try{const ht=R.extractContents();le.appendChild(ht),R.insertNode(le),c++,d.add(y)}catch(ht){console.warn("Failed to create comment marker:",ht)}}}}}catch{}}),e.nextTick(()=>{it("restoreCommentsFromModel"),bt(),Ft.value=!1})}catch{Ft.value=!1}}},hl=a=>{if(!a||!h.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&&!Sn(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&&!$n(c)||a.setEndAfter(u))}else c.nodeType===1&&n.includes(c.tagName)&&d<c.childNodes.length&&a.setEndAfter(c);return a}catch{return a}},Sn=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},$n=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},Wt=(a,n)=>{if(!a||!h.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=[h.value];let d=null,u=!1,p=!1;for(;!p&&(d=c.pop());)if(d.nodeType===3){const y=i+d.length;!u&&a.start>=i&&a.start<=y&&(s.setStart(d,a.start-i),u=!0),u&&a.end>=i&&a.end<=y&&(s.setEnd(d,a.end-i),p=!0),i=y}else{let y=d.childNodes.length;for(;y--;)c.push(d.childNodes[y])}return u?hl(s):null}}catch{return null}return null},At=(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")},it=(a="unknown")=>{if(!A.commentUser||!A.richText||!h.value){se.value=[];return}Date.now()-_t.value<Nt&&St.value!==null||St.value===null&&(St.value=requestAnimationFrame(()=>{if(St.value=null,_t.value=Date.now(),Ge.value)return;Ge.value=!0;const s={},i=h.value;if(!i){Ge.value=!1;return}const c=i.closest(".editor-with-comments");if(!c){Ge.value=!1;return}const d=i.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],p=new Set;d.forEach(M=>{const ue=M.getAttribute("data-comment")||M.getAttribute("data-fake-comment");ue&&M.tagName==="SPAN"&&(p.has(ue)||(u.push(M),p.add(ue)))}),d.forEach(M=>{const ue=M.getAttribute("data-comment")||M.getAttribute("data-fake-comment");!ue||p.has(ue)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(M.tagName)?M.querySelector(`span[data-comment="${ue}"], span[data-fake-comment="${ue}"]`)||(u.push(M),p.add(ue)):M.tagName!=="SPAN"&&(u.push(M),p.add(ue)))});const y=c.getBoundingClientRect(),C=i.getBoundingClientRect();u.forEach((M,ue)=>{let le=M.getAttribute("data-comment")||M.getAttribute("data-fake-comment");if(!le)return;if(typeof le=="string"&&le.startsWith("comment-")){const cn=M.textContent?.trim(),Bt=A.comments?.find(en=>(typeof en.conversation_id=="string"&&en.conversation_id.startsWith("comment-")?null:en.conversation_id)&&en.selection_text?.trim()===cn);Bt?(le=String(Bt.conversation_id),M.setAttribute("data-comment",le),M.removeAttribute("data-fake-comment")):(le=String(Date.now()),M.setAttribute("data-comment",le),M.removeAttribute("data-fake-comment"))}const We=M.getBoundingClientRect(),$e=window.getComputedStyle(M),ht=parseFloat($e.lineHeight)||parseFloat($e.fontSize)*1.2,nl=We.top-C.top+ht/2-15,It=C.top-y.top+nl;let ol=null,rn=null,kn=0;const Ol=[],So=new Set;if(le&&A.comments){const cn=A.comments.find(Bt=>String(Bt.conversation_id||Bt.id)===String(le));if(cn){const Bt=cn.conversation||[];Bt.length>0?(Bt.forEach(en=>{en.user&&en.user.id&&!So.has(en.user.id)&&(So.add(en.user.id),Ol.push(en.user))}),kn=Bt.length):(kn=0,ol=null,rn=null),Ol.length>0?ol=Ol[0]:ol=null,Ol.length>1?rn=Ol[1]:rn=null}}const Vo=We.top+ht/2-15,Tn=Vo+30,No=5,Fo=Tn>C.top+No&&Vo<C.bottom-No?1:0;se.value.find(cn=>cn.id===le);let Dn=M;if(!Dn&&le&&h.value){const cn=String(le);Dn=h.value.querySelector(`[data-comment="${cn}"], [data-fake-comment="${cn}"]`)}const Al=Ol.length;s[le]?(s[le].top=It,s[le].opacity=Fo,s[le].element=Dn,s[le].firstUser=ol,s[le].secondUser=rn,s[le].totalCount=kn,s[le].uniqueUserCount=Al):s[le]={id:le,top:It,opacity:Fo,element:Dn,firstUser:ol,secondUser:rn,totalCount:kn,uniqueUserCount:Al}});const R=Object.values(s).map(M=>{const ue=Math.max(0,(M.uniqueUserCount??0)-2);if(!M.element&&M.id&&h.value){const We=String(M.id);M.element=h.value.querySelector(`[data-comment="${We}"], [data-fake-comment="${We}"]`)}return{...M,firstUser:M.firstUser||null,secondUser:M.secondUser||null,totalCount:M.totalCount,additionalCount:ue}});(se.value.length!==R.length||R.some((M,ue)=>{const le=se.value[ue];if(!le)return!0;const We=(le.firstUser?.id||null)!==(M.firstUser?.id||null),$e=(le.secondUser?.id||null)!==(M.secondUser?.id||null);return le.id!==M.id||Math.abs(le.top-M.top)>1||le.opacity!==M.opacity||le.totalCount!==M.totalCount||le.additionalCount!==M.additionalCount||We||$e||le.element!==M.element}))&&(se.value=R),Ge.value=!1}))},kl=a=>{if(!a)return;let n=a.element;if(!n&&a.id&&h.value){const s=String(a.id);n=h.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`)}n&&(Ln(),at.value=n,n.classList.add("editor-comment-highlighted"))},Ln=(a=!1)=>{!a&&Fe.value!==null&&at.value&&(at.value.getAttribute("data-comment")||at.value.getAttribute("data-fake-comment"))===Fe.value||(h.value&&h.value.querySelectorAll(".editor-comment-highlighted").forEach(s=>{s.classList.remove("editor-comment-highlighted")}),at.value&&(at.value.classList.remove("editor-comment-highlighted"),at.value=null))},co=a=>{if(!a||!a.element)return;Ln(!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}"]`;de("comment-marker-clicked",{commentId:n,selector:s,element:a.element})},no=()=>{Ln()},uo=()=>{!A.richText||!h.value||(je.value&&je.value.disconnect(),vt.value!==null&&(clearTimeout(vt.value),vt.value=null),je.value=new MutationObserver(()=>{vt.value===null&&(vt.value=setTimeout(()=>{vt.value=null,e.nextTick(()=>{it("MutationObserver")})},200))}),je.value.observe(h.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),it("setupCommentMarkersObserver-initial"))},Vn=(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 y=s.left-d.width-4;a.style.left=`${y}px`}if(d.bottom>p){const y=Math.max(8,p-d.height-8);a.style.top=`${y}px`}d.top<0&&(a.style.top="8px")};return e.watch(()=>fe.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(()=>{Vn(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,mt.value],()=>{we.value==="askAi"||mt.value==="askAi"?e.nextTick(()=>{Do()}):(fe.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(()=>A.locale,a=>{a&&a!==oe.value&&(oe.value=a)},{immediate:!0}),J({openCommentOverlayForSelector:On,updateCommentMarkers:it,restoreCommentsFromModel:fl}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container",[{"editor-with-comments":Lt.value},Ht.value]]),style:e.normalizeStyle(Mt.value)},[_.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:n[14]||(n[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",a1,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Bl,title:e.unref(L)("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,s1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!El.value}]),onClick:Zl,title:e.unref(L)("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,r1),n[61]||(n[61]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",i1,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[0]||(n[0]=s=>Pn("paragraph")),title:e.unref(L)("textEditor.toolbar.paragraphFormat")},[B.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:W.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,u1)):B.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:W.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,d1)):B.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:W.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,m1)):B.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:W.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,p1)):B.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:W.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,v1)):B.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:W.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,f1)):(e.openBlock(),e.createElementBlock("svg",h1,[...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,c1),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=>_l("<h1>"))},[e.createElementVNode("img",{src:W.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,g1),e.createElementVNode("h1",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[2]||(n[2]=s=>_l("<h2>"))},[e.createElementVNode("img",{src:W.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,y1),e.createElementVNode("h2",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[3]||(n[3]=s=>_l("<h3>"))},[e.createElementVNode("img",{src:W.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,k1),e.createElementVNode("h3",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[4]||(n[4]=s=>_l("<h4>"))},[e.createElementVNode("img",{src:W.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,C1),e.createElementVNode("h4",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[5]||(n[5]=s=>_l("<h5>"))},[e.createElementVNode("img",{src:W.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,b1),e.createElementVNode("h5",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[6]||(n[6]=s=>_l("<h6>"))},[e.createElementVNode("img",{src:W.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,w1),e.createElementVNode("h6",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[7]||(n[7]=s=>_l("<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(L)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Dt("bold")}]),onClick:n[9]||(n[9]=s=>Pl("bold")),title:e.unref(L)("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,x1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Dt("italic")}]),onClick:n[10]||(n[10]=s=>Pl("italic")),title:e.unref(L)("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,E1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Dt("underline")}]),onClick:n[11]||(n[11]=s=>Pl("underline")),title:e.unref(L)("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,S1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ke.value}]),onClick:sn,title:e.unref(L)("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,V1),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:Ul,title:e.unref(L)("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,B1)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:Ql,title:e.unref(L)("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,N1)),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":Dt("insertUnorderedList")}]),onClick:k,title:e.unref(L)("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,_1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Dt("insertOrderedList")}]),onClick:S,title:e.unref(L)("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,M1),n[64]||(n[64]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Ml,title:e.unref(L)("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,$1),Lt.value&&ae.value?(e.openBlock(),e.createElementBlock("div",L1)):e.createCommentVNode("",!0),Lt.value&&ae.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(L)("textEditor.toolbar.comment"),onClick:st},[...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,T1)):e.createCommentVNode("",!0),_.askAi?(e.openBlock(),e.createElementBlock("div",D1)):e.createCommentVNode("",!0),_.askAi?(e.openBlock(),e.createElementBlock("div",A1,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:n[12]||(n[12]=s=>Pn("askAi")),title:e.unref(L)("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",R1,e.toDisplayString(e.unref(L)("textEditor.toolbar.askAi")),1)],8,H1),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",F1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[Hl(s)?(e.openBlock(),e.createElementBlock("div",I1,[e.renderSlot(a.$slots,s)])):e.createCommentVNode("",!0),Hl(s)&&i<_.customToolbarSlots.length-1&&Rn(i)?(e.openBlock(),e.createElementBlock("div",z1)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(we.value==="paragraph"||we.value==="askAi")&&_.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:el})):e.createCommentVNode("",!0),e.createVNode(ha,{showModal:Ae.value,width:"500px",height:"55vh",onCloseModal:ro},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(L)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",P1,[e.createElementVNode("div",O1,[e.createElementVNode("label",W1,e.toDisplayString(e.unref(L)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:_e,type:"text","onUpdate:modelValue":n[15]||(n[15]=s=>Oe.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.link.enterAltText"),onKeyup:e.withKeys(Eo,["enter"])},null,40,q1),[[e.vModelText,Oe.value]])]),e.createElementVNode("div",Z1,[e.createElementVNode("label",U1,e.toDisplayString(e.unref(L)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:Ye,type:"text","onUpdate:modelValue":n[16]||(n[16]=s=>Z.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.link.enterUrl"),onKeyup:e.withKeys(Eo,["enter"])},null,40,Y1),[[e.vModelText,Z.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:ro},e.toDisplayString(e.unref(L)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Eo},e.toDisplayString(e.unref(L)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(ha,{showModal:Qt.value,width:"500px",height:"80vh",onCloseModal:vl},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(pt.value?e.unref(L)("textEditor.image.editImage"):e.unref(L)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",X1,[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(L)("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(L)("textEditor.image.imageLink")),3)]),Y.value==="upload"?(e.openBlock(),e.createElementBlock("div",j1,[e.createElementVNode("div",K1,[e.createElementVNode("div",G1,[yl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Q1,e.toDisplayString(e.unref(L)("textEditor.image.uploadImage")),1)),yl.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:$l},[e.createElementVNode("img",{src:et.value,alt:"Preview",class:"dss-image-preview-image"},null,8,J1),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:ct,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:P},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:ct,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:P},null,544))]),e.createElementVNode("div",em,[e.createElementVNode("label",tm,e.toDisplayString(e.unref(L)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Rt,type:"text","onUpdate:modelValue":n[19]||(n[19]=s=>xe.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Ot,["enter"])},null,40,lm),[[e.vModelText,xe.value]])]),e.createElementVNode("div",nm,[e.createElementVNode("label",om,e.toDisplayString(e.unref(L)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[20]||(n[20]=s=>lt.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(Ot,["enter"]),onInput:Xl},null,40,am),[[e.vModelText,lt.value]])]),e.createElementVNode("div",sm,[e.createElementVNode("label",rm,e.toDisplayString(e.unref(L)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[21]||(n[21]=s=>yt.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(Ot,["enter"]),onInput:Zn},null,40,im),[[e.vModelText,yt.value]])])])])):e.createCommentVNode("",!0),Y.value==="url"?(e.openBlock(),e.createElementBlock("div",cm,[e.createElementVNode("div",um,[e.createElementVNode("div",dm,[e.createElementVNode("label",mm,e.toDisplayString(e.unref(L)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:xt,type:"text","onUpdate:modelValue":n[22]||(n[22]=s=>re.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(Ot,["enter"])},null,40,pm),[[e.vModelText,re.value]])]),e.createElementVNode("div",vm,[e.createElementVNode("label",fm,e.toDisplayString(e.unref(L)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[23]||(n[23]=s=>xe.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Ot,["enter"])},null,40,hm),[[e.vModelText,xe.value]])]),e.createElementVNode("div",gm,[e.createElementVNode("label",ym,e.toDisplayString(e.unref(L)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[24]||(n[24]=s=>lt.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(Ot,["enter"]),onInput:Xl},null,40,km),[[e.vModelText,lt.value]])]),e.createElementVNode("div",Cm,[e.createElementVNode("label",bm,e.toDisplayString(e.unref(L)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[25]||(n[25]=s=>yt.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(Ot,["enter"]),onInput:Zn},null,40,wm),[[e.vModelText,yt.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:vl},e.toDisplayString(e.unref(L)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Ot},e.toDisplayString(e.unref(L)("textEditor.image.save")),1)]),_:1},8,["showModal"]),_.showTitle?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":nn.value&&sl.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.labels.title")),1),e.createElementVNode("div",xm,[sl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Em,[_.title?(e.openBlock(),e.createElementBlock("span",Sm,e.toDisplayString(_.title),1)):(e.openBlock(),e.createElementBlock("span",Vm,e.toDisplayString(ft.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:Ve,value:_.title,onInput:vn,onFocus:jn,onBlur:Fn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!sl.value}]),placeholder:ft.value,disabled:_.disabled,rows:"1"},null,42,Nm)])],2)):e.createCommentVNode("",!0),_.showTitle&&nn.value&&sl.value?(e.openBlock(),e.createElementBlock("div",Bm,[e.renderSlot(a.$slots,"title-slot")])):e.createCommentVNode("",!0),_.showDescription?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":Rl.value&&D.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.labels.description")),1),e.createElementVNode("div",_m,[D.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Mm,[_.description?(e.openBlock(),e.createElementBlock("span",$m,e.toDisplayString(_.description),1)):(e.openBlock(),e.createElementBlock("span",Lm,e.toDisplayString(zl.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:ot,value:_.description,onInput:jt,onFocus:In,onBlur:fn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!D.value}]),placeholder:zl.value,disabled:_.disabled,rows:"1"},null,42,Tm)])],2)):e.createCommentVNode("",!0),_.showDescription&&Rl.value&&D.value?(e.openBlock(),e.createElementBlock("div",Dm,[e.renderSlot(a.$slots,"description-slot")])):e.createCommentVNode("",!0),Lt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:6},e.renderList(se.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":Fe.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=>kl(s),onMouseleave:no},[s.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(i=>co(s),["stop"])},[s.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.firstUser.avatar,alt:s.firstUser.name||"avatar"},null,8,Rm)):(e.openBlock(),e.createElementBlock("span",Fm,e.toDisplayString(s.firstUser.initials||(s.firstUser.name?s.firstUser.name.charAt(0):"")),1))],8,Hm)):e.createCommentVNode("",!0),s.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(i=>co(s),["stop"])},[s.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.secondUser.avatar,alt:s.secondUser.name||"avatar"},null,8,zm)):(e.openBlock(),e.createElementBlock("span",Pm,e.toDisplayString(s.secondUser.initials||(s.secondUser.name?s.secondUser.name.charAt(0):"")),1))],8,Im)):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=>co(s),["stop"])},[e.createElementVNode("span",Wm,"+"+e.toDisplayString(s.additionalCount),1)],12,Om)):e.createCommentVNode("",!0)],46,Am))),128)):e.createCommentVNode("",!0),_.richText?(e.openBlock(),e.createElementBlock("div",Km,[e.createElementVNode("div",{ref_key:"editorRef",ref:h,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":_.disabled,"dss-text-editor-fixed-height":_.fixedHeight}]),style:e.normalizeStyle(jl.value),onInput:bt,onBlur:gn,onClick:ta,onMouseup:Co,onKeyup:Co,onKeydown:Ko,onPaste:Go,onMousemove:la,onMouseleave:na},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[Lt.value&&Fe.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(f.value)},[F.value||Qe.value.length>0?(e.openBlock(),e.createElementBlock("div",Gm,[e.createElementVNode("div",Qm,[F.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:F.value},null,8,Jm)):e.createCommentVNode("",!0)]),e.createElementVNode("div",e2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qe.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",t2,[e.createElementVNode("div",l2,[s.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.user.avatar,alt:s.user.name||"avatar"},null,8,n2)):(e.openBlock(),e.createElementBlock("span",o2,e.toDisplayString(s.user.initials||(s.user.name?s.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",a2,[e.createElementVNode("div",s2,[e.createElementVNode("div",r2,e.toDisplayString(s.user&&s.user.name||"Comment"),1),s.createdAt?(e.openBlock(),e.createElementBlock("div",i2,e.toDisplayString(Wl(new Date(s.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":pn(s.text)||s.class==="comment-started"}])},e.toDisplayString(s.text||""),3)]),A.commentUser&&s.user&&s.user.id===A.commentUser.id&&!pn(s.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>ll(s,i),["stop"]),title:e.unref(L)("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,c2)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",u2,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:E,"onUpdate:modelValue":n[26]||(n[26]=s=>g.value=s),class:"dss-comment-input",rows:"1",placeholder:e.unref(L)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(ne,["prevent","stop"]),["enter"]),onInput:n[27]||(n[27]=()=>{if(E.value){const s=E.value;s.style.height="auto",s.style.height=`${s.scrollHeight}px`}})},null,40,d2),[[e.vModelText,g.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(ne,["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",m2,[e.createElementVNode("div",p2,[e.createElementVNode("span",v2,e.toDisplayString(ml.value)+" "+e.toDisplayString(ml.value===1?e.unref(L)("textEditor.footer.word"):e.unref(L)("textEditor.footer.words")),1),n[70]||(n[70]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",f2,e.toDisplayString(un.value)+" "+e.toDisplayString(un.value===1?e.unref(L)("textEditor.footer.character"):e.unref(L)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",qm,[e.createElementVNode("textarea",{value:_.modelValue,onInput:on,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":_.fixedHeight}]),placeholder:Kl.value,rows:_.rows,disabled:_.disabled,style:e.normalizeStyle(wl.value)},null,46,Zm),e.createElementVNode("div",Um,[e.createElementVNode("div",Ym,[e.createElementVNode("span",Xm,e.toDisplayString(ml.value)+" "+e.toDisplayString(ml.value===1?e.unref(L)("textEditor.footer.word"):e.unref(L)("textEditor.footer.words")),1),n[67]||(n[67]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",jm,e.toDisplayString(un.value)+" "+e.toDisplayString(un.value===1?e.unref(L)("textEditor.footer.character"):e.unref(L)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[K.value&&he.value&&h.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(Re.value),onMouseenter:n[28]||(n[28]=s=>ge.value=!0),onMouseleave:eo},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(xo,["stop"]),title:he.value},e.toDisplayString(he.value),9,h2),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Ro,["stop"]),title:e.unref(L)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",y2,[...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,g2)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[kt.value&&Pt.value&&h.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(pe.value),onMouseenter:n[29]||(n[29]=s=>H.value=!0),onMouseleave:to},[e.createElementVNode("div",k2,[Pt.value===e.unref(L)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",C2,[...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:Pt.value},e.toDisplayString(Pt.value),9,b2)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(xl,["stop"]),title:e.unref(L)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",x2,[...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,w2)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[_.floatingToolbar&&_.richText&&Me.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:gt,class:"dss-floating-toolbar",style:e.normalizeStyle(rt.value),onMousedown:n[44]||(n[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",E2,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Bl,["stop"]),title:e.unref(L)("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,S2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!El.value}]),onClick:e.withModifiers(Zl,["stop"]),title:e.unref(L)("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,V2),n[89]||(n[89]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",N2,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[30]||(n[30]=e.withModifiers(s=>bo("paragraph"),["stop"])),title:e.unref(L)("textEditor.toolbar.paragraphFormat")},[B.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:W.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,_2)):B.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:W.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,M2)):B.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:W.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,$2)):B.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:W.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,L2)):B.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:W.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,T2)):B.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:W.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,D2)):(e.openBlock(),e.createElementBlock("svg",A2,[...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,B2),mt.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(L)("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(L)("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(L)("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(L)("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(L)("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(L)("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(L)("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":Dt("bold")}]),onClick:n[39]||(n[39]=e.withModifiers(s=>Pl("bold"),["stop"])),title:e.unref(L)("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,H2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Dt("italic")}]),onClick:n[40]||(n[40]=e.withModifiers(s=>Pl("italic"),["stop"])),title:e.unref(L)("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,R2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Dt("underline")}]),onClick:n[41]||(n[41]=e.withModifiers(s=>Pl("underline"),["stop"])),title:e.unref(L)("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,F2),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":Ke.value}]),onClick:e.withModifiers(sn,["stop"]),title:e.unref(L)("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,I2),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(Ul,["stop"]),title:e.unref(L)("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,P2)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(Ql,["stop"]),title:e.unref(L)("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,z2)),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":Dt("insertUnorderedList")}]),onClick:e.withModifiers(k,["stop"]),title:e.unref(L)("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,O2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Dt("insertOrderedList")}]),onClick:e.withModifiers(S,["stop"]),title:e.unref(L)("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,W2),n[94]||(n[94]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Ml,["stop"]),title:e.unref(L)("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,q2),Lt.value?(e.openBlock(),e.createElementBlock("div",Z2)):e.createCommentVNode("",!0),Lt.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(L)("textEditor.toolbar.comment"),onClick:e.withModifiers(st,["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,U2)):e.createCommentVNode("",!0),_.askAi?(e.openBlock(),e.createElementBlock("div",Y2)):e.createCommentVNode("",!0),_.askAi?(e.openBlock(),e.createElementBlock("div",X2,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:n[42]||(n[42]=e.withModifiers(s=>bo("askAi"),["stop"])),title:e.unref(L)("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",K2,e.toDisplayString(e.unref(L)("textEditor.toolbar.askAi")),1)],8,j2),mt.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)]),Bn.value?(e.openBlock(),e.createElementBlock("div",G2,[_.askAi&&Bn.value?(e.openBlock(),e.createElementBlock("div",Q2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[Hl(s)&&bn(s)?(e.openBlock(),e.createElementBlock("div",J2,[e.renderSlot(a.$slots,s)])):e.createCommentVNode("",!0),Hl(s)&&bn(s)&&i<_.customToolbarSlots.length-1&&Gl(i)?(e.openBlock(),e.createElementBlock("div",ep)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),np={class:"dss-color-picker__section-title"},op={class:"dss-color-picker__presets-row"},ap=["title","onClick"],sp={key:1,class:"dss-color-picker__section"},rp={class:"dss-color-picker__presets-row"},ip=["title","onClick"],cp={key:2,class:"dss-color-picker__section"},up={class:"dss-color-picker__section-header"},dp={class:"dss-color-picker__presets-row"},mp=["title","onClick"],pp=["onClick"],vp={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},fp=["title","onClick"],hp={class:"dss-color-picker__input-row"},gp=["value"],yp={__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(_,{emit:J}){function N(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 te=parseInt(X[1],16)/255,ce=parseInt(X[2],16)/255,Ve=parseInt(X[3],16)/255,ot=Math.max(te,ce,Ve),wt=Math.min(te,ce,Ve);let dl=0,Vt=0;const sl=(ot+wt)/2;if(ot!==wt){const D=ot-wt;switch(Vt=sl>.5?D/(2-ot-wt):D/(ot+wt),ot){case te:dl=((ce-Ve)/D+(ce<Ve?6:0))/6;break;case ce:dl=((Ve-te)/D+2)/6;break;case Ve:dl=((te-ce)/D+4)/6;break}}return{h:dl*360,s:Vt*100,l:sl*100}}function L(ie,X,te){X/=100,te/=100;const ce=X*Math.min(te,1-te),Ve=ot=>{const wt=(ot+ie/30)%12,dl=te-ce*Math.max(Math.min(wt-3,9-wt,1),-1);return Math.round(255*dl).toString(16).padStart(2,"0")};return`#${Ve(0)}${Ve(8)}${Ve(4)}`}function oe(ie){const X=ie.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!X)return null;let te=X[1];return te.length===3&&(te=te.split("").map(ce=>ce+ce).join("")),"#"+te}function W(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 te=Math.max(0,Math.min(255,Number.parseInt(X[1],10))),ce=Math.max(0,Math.min(255,Number.parseInt(X[2],10))),Ve=Math.max(0,Math.min(255,Number.parseInt(X[3],10)));return`#${te.toString(16).padStart(2,"0")}${ce.toString(16).padStart(2,"0")}${Ve.toString(16).padStart(2,"0")}`}function A(ie){if(typeof ie!="string")return null;const X=ie.trim();return oe(X)||W(X)}function de(ie,X,te){X/=100,te/=100;const ce=te+X*Math.min(te,1-te),Ve=ce===0?0:2-2*te/ce;return{h:ie,s:Ve*100,v:ce*100}}function dt(ie,X,te){X/=100,te/=100;const ce=te*(1-X/2),Ve=ce===0||ce===1?0:(te-ce)/Math.min(ce,1-ce);return{h:ie,s:Ve*100,l:ce*100}}const ee=_,h=J,we=e.ref(!1),ye=e.ref(!1),Q=e.ref(!1),K=e.ref(-1),he=e.ref(-1),Re=e.ref(null),ge=e.ref(null),Ae=e.ref(null),Z=e.ref(null),Oe=e.ref({top:0,left:0}),Ye=e.ref(N(ee.modelValue||"#b8a5de")),_e=e.computed(()=>Array.isArray(ee.presetGroups)&&ee.presetGroups.length>0),Xe=e.computed(()=>!ee.disableCustomColors),U=e.computed(()=>_e.value?0:ee.initialPresetCount!=null?ee.initialPresetCount:he.value<0?null:he.value),He=e.computed(()=>{const ie=U.value;return ie==null?!0:Math.max(0,ee.presetColors.length-ie)<ee.max}),Ke=e.computed(()=>!!(ye.value||K.value>=0||!ke.value&&ee.presetColors.length===0));e.computed(()=>{const ie=U.value;return ie!=null&&ee.presetColors.length>ie});const ke=e.computed(()=>_e.value||U.value!=null),Me=e.computed(()=>{const ie=U.value;return ie==null?[]:ee.presetColors.slice(0,ie)}),rt=e.computed(()=>{const ie=U.value;return ie==null?[]:ee.presetColors.slice(ie)});function gt(ie){const X=U.value;return X!=null?X+ie:-1}function mt(ie){const X=U.value;return X!=null&&ie>=X}function Qt(ie){mt(ie)&&(K.value=ie,Ye.value=N(ee.presetColors[ie]),ye.value=!0,e.nextTick(()=>Z.value?.focus()))}function xe(ie){if(!mt(ie))return;const X=ee.presetColors.filter((Ve,ot)=>ot!==ie);h("update:presetColors",X);const te=oe(ee.modelValue),ce=oe(ee.presetColors[ie]);if(te&&ce&&te.toLowerCase()===ce.toLowerCase()){const Ve=X[Math.max(0,ie-1)]||X[0];Ve&&h("update:modelValue",Ve)}}function Jt(){Q.value=!Q.value,Q.value||(K.value=-1,ye.value=!1)}function et(){if(!Xe.value||K.value<0)return;const ie=ct.value,X=oe(ie);if(X){const te=[...ee.presetColors];te[K.value]=X,h("update:presetColors",te),h("update:modelValue",X),K.value=-1,ye.value=!1}}function lt(){ee.disabled||!Xe.value||(K.value=-1,ye.value=!ye.value,ye.value&&(H(),e.nextTick(()=>Z.value?.focus())))}function yt(ie){const X=A(ie),te=A(ee.modelValue);return X&&te&&X.toLowerCase()===te.toLowerCase()}function Rt(){if(ee.disabled||!Xe.value||!He.value)return;const ie=ct.value,X=oe(ie);if(X){const te=[...ee.presetColors,X];h("update:presetColors",te),h("update:modelValue",X);const ce=U.value??he.value;ce>=0&&te.length-ce>=ee.max&&(ye.value=!1)}}const ct=e.computed(()=>{const{h:ie,s:X,l:te}=Ye.value;return L(ie,X,te)}),xt=e.computed(()=>ct.value.toLowerCase()),pt=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${Ye.value.h}, 100%, 50%))`})),Xt=e.computed(()=>{const ie=de(Ye.value.h,Ye.value.s,Ye.value.l);return{left:`${ie.s}%`,bottom:`${ie.v}%`,transform:"translate(-50%, 50%)"}}),kt=e.computed(()=>({left:`${Ye.value.h/360*100}%`,transform:"translateX(-50%)"})),Pt=e.computed(()=>({position:"fixed",left:`${Oe.value.left}px`,top:`${Oe.value.top}px`,zIndex:1002}));function pe(){if(!Re.value||!we.value)return;const ie=Re.value.getBoundingClientRect(),X=window.innerHeight||document.documentElement.clientHeight;let te=ie.bottom+4;const ce=ge.value;ce&&te+ce.offsetHeight>X-8&&(te=ie.top-4-ce.offsetHeight),Oe.value={top:te,left:ie.left}}function H(){const ie=ee.modelValue||"#b8a5de",X=A(ie);X&&(Ye.value=N(X))}function Y(){h("update:modelValue",ct.value)}function re(){ee.disabled||(we.value=!we.value,we.value&&(H(),e.nextTick(()=>{pe(),Z.value?.focus()})))}function fe(){const ie=ct.value,X=oe(ie);if(X){if(K.value>=0){const te=[...ee.presetColors];te[K.value]=X,h("update:presetColors",te),h("update:modelValue",X)}else if(Xe.value&&(ee.presetColors.length>0||_e.value)&&ye.value&&He.value&&!ee.presetColors.some(ce=>oe(ce)?.toLowerCase()===X.toLowerCase())){const ce=[...ee.presetColors,X];h("update:presetColors",ce),h("update:modelValue",X)}}we.value=!1,ye.value=!1,Q.value=!1,K.value=-1}function ze(ie){if(!Ae.value)return;const X=Ae.value.getBoundingClientRect(),te=ce=>{const Ve=Math.max(0,Math.min(1,(ce.clientX-X.left)/X.width)),ot=Math.max(0,Math.min(1,1-(ce.clientY-X.top)/X.height)),wt={h:Ye.value.h,s:Ve*100,v:ot*100};Ye.value=dt(wt.h,wt.s,wt.v)};te(ie),document.addEventListener("mousemove",te),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",te),Y()},{once:!0})}function tt(ie){if(!ie.currentTarget)return;const te=ie.currentTarget.getBoundingClientRect(),ce=Ve=>{const ot=Math.max(0,Math.min(1,(Ve.clientX-te.left)/te.width));Ye.value={...Ye.value,h:ot*360}};ce(ie),document.addEventListener("mousemove",ce),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",ce),Y()},{once:!0})}function Et(ie){const X=ie.target.value,te=A(X);te&&(Ye.value=N(te),h("update:modelValue",te))}function Se(ie){if(ee.disabled)return;const X=A(ie);X&&(Ye.value=N(X),h("update:modelValue",X))}let nt=null,Ct=null;function tl(){nt&&(document.removeEventListener("keydown",nt),nt=null),Ct&&(window.removeEventListener("resize",Ct),Ct=null)}return e.watch(we,ie=>{if(tl(),ie){if(!_e.value&&ee.initialPresetCount==null){const X=ee.presetColors.length;X>0&&(he.value<0||X<he.value)&&(he.value=X)}nt=X=>{X.key==="Escape"&&fe()},Ct=pe,document.addEventListener("keydown",nt),window.addEventListener("resize",Ct)}}),e.watch(()=>ee.modelValue,()=>{we.value&&H()},{immediate:!1}),e.watch(rt,ie=>{ie.length===0&&(Q.value=!1,K.value=-1,ye.value=!1)}),e.onBeforeUnmount(tl),(ie,X)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":_.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:Re,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":we.value}]),onClick:re},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:ct.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(fe,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:ge,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Pt.value)},[ke.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[_e.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(_.presetGroups,(te,ce)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+ce,class:"dss-color-picker__section"},[e.createElementVNode("span",np,e.toDisplayString(te.title),1),e.createElementVNode("div",op,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.colors,(Ve,ot)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+ce+"-"+ot,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":yt(Ve)}]),style:e.normalizeStyle({backgroundColor:Ve,"--dss-preset-color":Ve}),title:Ve,onClick:e.withModifiers(wt=>Se(Ve),["stop"])},null,14,ap))),128))])]))),128)):Me.value.length?(e.openBlock(),e.createElementBlock("div",sp,[X[1]||(X[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",rp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Me.value,(te,ce)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+ce,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":yt(te)}]),style:e.normalizeStyle({backgroundColor:te,"--dss-preset-color":te}),title:te,onClick:e.withModifiers(Ve=>Se(te),["stop"])},null,14,ip))),128))])])):e.createCommentVNode("",!0),Xe.value?(e.openBlock(),e.createElementBlock("div",cp,[e.createElementVNode("div",up,[X[3]||(X[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),rt.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":Q.value}]),title:"Manage custom colors",onClick:e.withModifiers(Jt,["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",dp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(rt.value,(te,ce)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+ce,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":Q.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!Q.value&&yt(te),"dss-color-picker__preset-bubble--editing":Q.value&&K.value===gt(ce)}]),style:e.normalizeStyle({backgroundColor:K.value===gt(ce)?ct.value:te,"--dss-preset-color":K.value===gt(ce)?ct.value:te}),title:K.value===gt(ce)?ct.value:te,onClick:e.withModifiers(Ve=>Q.value?Qt(gt(ce)):Se(te),["stop"])},null,14,mp),Q.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(Ve=>xe(gt(ce)),["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,pp)):e.createCommentVNode("",!0)],2))),128)),He.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(lt,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],64)):_.presetColors.length?(e.openBlock(),e.createElementBlock("div",vp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.presetColors,(te,ce)=>(e.openBlock(),e.createElementBlock("button",{key:ce,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":yt(te)}]),style:e.normalizeStyle({backgroundColor:te,"--dss-preset-color":te}),title:te,onClick:e.withModifiers(Ve=>Se(te),["stop"])},null,14,fp))),128)),Xe.value&&He.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(lt,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Ke.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:Ae,onMousedown:ze},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(pt.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(Xt.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:tt},[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(kt.value)},null,4)],32),e.createElementVNode("div",hp,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:Z,type:"text",class:"dss-color-picker__hex-input",value:xt.value,onInput:Et},null,40,gp)]),Xe.value&&ke.value&&(_.presetColors.length||_e.value)&&He.value&&K.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:Rt}," Save color ")):e.createCommentVNode("",!0),Xe.value&&ke.value&&K.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:et}," 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:fe}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},kp={key:0,class:"dss-loader"},Cp={key:0,class:"dss-loader-label"},bp={key:1,class:"dss-loader"},wp={key:0,class:"dss-loader-label"},xp={key:2,class:"dss-loader"},Ep={key:0,class:"dss-loader-label"},Sp={key:3,class:"dss-loader"},Vp={key:0,class:"dss-loader-label"},Np={key:4,class:"dss-loader"},Bp={key:0,class:"dss-loader-label"},_p={key:5,class:"dss-loader dss-loader--inline"},Mp={class:"dss-loader-inline-text"},$p={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""}},setup(_){const J=_,N=e.computed(()=>J.size==="small"?"dss-loaders--size-small":J.size==="large"?"dss-loaders--size-large":J.size==="medium"||J.size==null?"dss-loaders--size-medium":null),L=e.computed(()=>{const oe={};if(!(J.size==="small"||J.size==="medium"||J.size==="large"||J.size==null)){const W=typeof J.size=="number"?`${J.size}px`:String(J.size);oe["--dss-loader-size"]=W}return J.color&&(oe["--dss-loader-accent"]=J.color,oe["--dss-loader-accent-soft"]=`color-mix(in srgb, ${J.color} 30%, white)`),oe});return(oe,W)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",N.value]),style:e.normalizeStyle(L.value)},[_.type==="spinner"?(e.openBlock(),e.createElementBlock("div",kp,[W[0]||(W[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),_.label?(e.openBlock(),e.createElementBlock("span",Cp,e.toDisplayString(_.label),1)):e.createCommentVNode("",!0)])):_.type==="dots"?(e.openBlock(),e.createElementBlock("div",bp,[W[1]||(W[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)),_.label?(e.openBlock(),e.createElementBlock("span",wp,e.toDisplayString(_.label),1)):e.createCommentVNode("",!0)])):_.type==="battery"?(e.openBlock(),e.createElementBlock("div",xp,[W[2]||(W[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),_.label?(e.openBlock(),e.createElementBlock("span",Ep,e.toDisplayString(_.label),1)):e.createCommentVNode("",!0)])):_.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",Sp,[W[3]||(W[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)),_.label?(e.openBlock(),e.createElementBlock("span",Vp,e.toDisplayString(_.label),1)):e.createCommentVNode("",!0)])):_.type==="bars"?(e.openBlock(),e.createElementBlock("div",Np,[W[4]||(W[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)),_.label?(e.openBlock(),e.createElementBlock("span",Bp,e.toDisplayString(_.label),1)):e.createCommentVNode("",!0)])):_.type==="inline"?(e.openBlock(),e.createElementBlock("div",_p,[W[5]||(W[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",Mp,[e.renderSlot(oe.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(_.label),1)])])])):e.createCommentVNode("",!0)],6))}},Ha="dss-skeleton-item",Lp={__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:_=>["single","multiple"].includes(_)},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(_){const J=_,N=e.computed(()=>{const W={"dss-skeleton--loading":J.loading,"dss-skeleton--static":!J.shimmer,"dss-skeleton--multiple":J.mode==="multiple","dss-skeleton--dark":J.darkMode};return J.mode==="multiple"&&J.targetClass!==Ha&&(W[`dss-skeleton--target-${J.targetClass}`]=!0),W}),L=e.computed(()=>{const W={};return J.borderRadius&&(W.borderRadius=J.borderRadius),W}),oe=e.computed(()=>{const W={};return J.borderRadius&&(W["--dss-skeleton-border-radius"]=J.borderRadius),J.darkMode?(W["--dss-skeleton-bg"]=J.bgDark||"#322c3f",W["--dss-skeleton-shimmer"]=J.shimmerDark||"#3e3f41",W):(J.bgColor&&(W["--dss-skeleton-bg"]=J.bgColor),J.shimmerColor&&(W["--dss-skeleton-shimmer"]=J.shimmerColor),W)});return(W,A)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",N.value]),style:e.normalizeStyle(oe.value)},[_.loading&&_.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(L.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":_.loading&&_.mode==="single"}])},[e.renderSlot(W.$slots,"default")],2)],6))}},Tp={key:0,class:"dss-dnd-column-header"},Dp={class:"dss-dnd-column-title"},Ap={class:"dss-dnd-column-count"},Hp=["data-column"],Rp={key:0,class:"dss-dnd-indicator"},Fp=["onPointerdown"],Ip=["onPointerdown"],zp={class:"dss-dnd-item-content"},Pp={class:"dss-dnd-item-default"},Op={key:0,class:"dss-dnd-empty"},Wp={name:"DSSDnd"},qp=Object.assign(Wp,{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(_,{emit:J}){const N=_,L=J,oe=e.useSlots(),W=e.computed(()=>!!oe["delete-zone"]),A={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},de=e.computed(()=>({...A,...N.options})),dt=e.computed(()=>({"--dss-dnd-col-min-w":de.value.columnMinWidth,"--dss-dnd-col-max-w":de.value.columnMaxWidth,"--dss-dnd-col-gap":de.value.columnGap,"--dss-dnd-indicator-color":de.value.indicatorColor,"--dss-dnd-body-max-h":de.value.columnBodyMaxHeight}));function ee(pe){if(!de.value.ColColor||!pe)return{};const H=pe.background||pe.color;return H?{background:H}:{}}const h=e.ref(null),we=e.ref(null),ye=e.ref(!1),Q=e.ref(-1),K=e.ref(null);let he=null,Re=null,ge=null,Ae=null,Z=0,Oe=0,Ye="",_e=null;const Xe=5,U=e.computed(()=>{const pe={};for(const H of N.columns)pe[H.value]=N.items.filter(Y=>Y[N.columnKey]===H.value).sort((Y,re)=>(Y[N.positionKey]??0)-(re[N.positionKey]??0));return pe}),He=e.computed(()=>{const pe={},H=!!h.value,Y=h.value?.[N.itemKey],re=we.value,fe=Q.value;for(const ze of N.columns){const tt=U.value[ze.value]||[],Et=[],Se=re==ze.value;let nt=0;for(let Ct=0;Ct<tt.length;Ct++){const tl=tt[Ct],ie=H&&tl[N.itemKey]===Y;!ie&&Se&&fe===nt&&Et.push({type:"indicator",key:`ind-${nt}`}),ie||nt++,Et.push({type:"item",item:tl,isDragged:ie,key:`item-${tl[N.itemKey]}`})}Se&&fe>=nt&&Et.push({type:"indicator",key:"ind-end"}),pe[ze.value]=Et}return pe});function Ke(pe,H){const re=(U.value[pe]||[]).filter(tt=>tt[N.itemKey]!==h.value?.[N.itemKey]);if(re.length===0)return 1;if(H<=0){const tt=re[0][N.positionKey];return tt!=null&&tt>0?tt/2:.5}if(H>=re.length){const tt=re[re.length-1][N.positionKey];return(tt??0)+1}const fe=re[H-1][N.positionKey]??0,ze=re[H][N.positionKey]??0;return(fe+ze)/2}function ke(pe,H,Y){ge&&ge.remove();const re=pe.getBoundingClientRect(),fe=pe.cloneNode(!0);fe.classList.add("dss-dnd-ghost"),fe.style.cssText=`
105
+ `){const C=document.createTextNode(" ");n.insertNode(C),n.setStartAfter(C)}}n.insertNode(d);const u=document.createTextNode(" ");n.setStartAfter(d),n.insertNode(u),n.setStartAfter(u),n.collapse(!0),a.removeAllRanges(),a.addRange(n)}}wt()}e.nextTick(()=>{ul(),ro()})},lo=()=>{if(!h.value||Q.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(h.value,NodeFilter.SHOW_TEXT,{acceptNode:p=>{const y=p.parentElement;return!y||y.closest("a")||y.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 y=c[p],C=y.textContent;s.lastIndex=0;const R=[...C.matchAll(s)];if(R.length===0)continue;const O=R.filter(le=>{const We=le[0],$e=le.index;if($e>0&&C[$e-1]==="@"||$e+We.length<C.length&&C[$e+We.length]==="@")return!1;const gt=y.parentElement;return!(gt&&gt.closest("a"))});if(O.length===0)continue;if(O.length===1&&O[0][0]===C.trim()){const le=O[0][0],We=le.startsWith("http://")||le.startsWith("https://")?le:`https://${le}`,$e=document.createElement("a");$e.href=We,$e.textContent=le,$e.style.color="#60afdf",$e.style.textDecoration="underline",y.parentNode&&(y.parentNode.replaceChild($e,y),u=!0);continue}let M=0;const ue=document.createDocumentFragment();if(O.forEach(le=>{const We=le.index,$e=le[0];if(We>M){const qt=C.substring(M,We);qt&&ue.appendChild(document.createTextNode(qt))}const gt=$e.startsWith("http://")||$e.startsWith("https://")?$e:`https://${$e}`,Ut=document.createElement("a");Ut.href=gt,Ut.textContent=$e,Ut.style.color="#60afdf",Ut.style.textDecoration="underline",ue.appendChild(Ut),M=We+$e.length}),M<C.length){const le=C.substring(M);le&&ue.appendChild(document.createTextNode(le))}y.parentNode&&ue.childNodes.length>0&&(y.parentNode.replaceChild(ue,y),u=!0)}u&&n&&e.nextTick(()=>{Yt(n),ul()})},oa=()=>{if(!h.value)return;const a=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,n=document.createTreeWalker(h.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 y=0;const C=document.createDocumentFragment();p.forEach(R=>{const O=R.index,M=R[0].startsWith("<u>")?"u":"ins",ue=R[1]||R[2]||"";O>y&&C.appendChild(document.createTextNode(u.substring(y,O)));const le=document.createElement(M);le.textContent=ue,C.appendChild(le),y=O+R[0].length}),y<u.length&&C.appendChild(document.createTextNode(u.substring(y))),d.parentNode&&C.childNodes.length>0&&d.parentNode.replaceChild(C,d)}},io=a=>{if(!h.value||Q.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===h.value||!h.value.contains(c))return;const d=()=>{let qt="",nl=0,gl=!1;const It=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:rn=>rn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let ol=0;for(;It.nextNode();){const rn=It.currentNode,kn=rn.textContent||"",Ol=ol;if(ol+=kn.length,rn===i.startContainer){qt+=kn.substring(0,i.startOffset),nl=Ol+i.startOffset,gl=!0;break}qt+=kn}return gl||(nl=qt.length),{textBeforeCursor:qt,cursorCharOffset:nl}},{textBeforeCursor:u}=d();if(!u.length)return;let p=null,y=null;if(u.endsWith("**")&&(p=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(p=u.match(/__(.+?)__$/s))?y="strong":u.endsWith("*")&&!u.endsWith("**")&&(p=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(p=u.match(new RegExp("(?<!_)_([^_]+)_$")))?y="em":a===">"&&((p=u.match(/<u>(.+?)<\/u>$/s))||(p=u.match(/<ins>(.+?)<\/ins>$/s)))&&(y=p[0].startsWith("<u>")?"u":"ins",p[0].startsWith("<u>"),p[0].startsWith("<u>")),!p||!p[1])return;const C=p[0],R=p[1],O=u.length-C.length,ue=(qt=>{let nl=0;const gl=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:ol=>ol.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let It;for(;It=gl.nextNode();){const ol=(It.textContent||"").length;if(nl+ol>=qt)return{node:It,offset:qt-nl};nl+=ol}return null})(O);if(!ue)return;const le=document.createRange();le.setStart(ue.node,ue.offset),le.setEnd(i.endContainer,i.endOffset);const We=document.createElement(y);We.textContent=R,le.deleteContents(),le.insertNode(We);const $e=window.getSelection(),gt=document.createRange();gt.setStartAfter(We),gt.collapse(!0),$e.removeAllRanges(),$e.addRange(gt);const Ut=Kt();e.nextTick(()=>{wt(),Ut&&Yt(Ut)})},Ml=()=>{h.value&&(Xt.value=Kt(),xe.value="",et.value="",ie.value="",lt.value="",kt.value="",Jt.value=null,pt.value=null,Y.value="upload",Qt.value=!0,tl(),e.nextTick(()=>{Rt.value&&Rt.value.focus(),ct.value&&(ct.value.value="")}))},P=a=>{const n=a.target?.files?.[0];if(!n){Jt.value=null,et.value="";return}Jt.value=n;const s=new FileReader;s.onload=i=>{et.value=i.target?.result||""},s.readAsDataURL(n)},$l=()=>{ct.value&&ct.value.click()},Xl=()=>{lt.value&&(kt.value="")},Zn=()=>{kt.value&&(lt.value="")},xl=()=>{let a=pt.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")||"";pt.value=a,xe.value=n.trim()===""||n.trim()==="Image"?"":n;const s=a.getAttribute("src")||a.src||"";s.startsWith("http://")||s.startsWith("https://")?(ie.value=s,et.value="",Y.value="url"):(et.value=s,ie.value="",Y.value="upload");const c=a.style.width||a.getAttribute("width")||"",d=a.style.height||a.getAttribute("height")||"";lt.value=c.endsWith("px")?c.replace("px",""):c,kt.value=d.endsWith("px")?d.replace("px",""):d,Xt.value=null}else{Ml();return}Qt.value=!0,H.value=!1,Ct.value=!1,e.nextTick(()=>{Y.value==="url"&&ht.value?(ht.value.focus(),ht.value.select()):Rt.value&&(Rt.value.focus(),Rt.value.select()),ct.value&&(ct.value.value="")})},vl=()=>{Qt.value=!1,xe.value="",et.value="",ie.value="",lt.value="",kt.value="",Jt.value=null,pt.value=null,Xt.value=null,Y.value="upload"},Ot=()=>{const a=(xe.value||"").trim(),n=h.value?._mutationObserver;n&&n.disconnect(),ot.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),Tt(),ot.value=!1):Tt();const s=Y.value==="url"?ie.value.trim():et.value;if(pt.value&&h.value&&h.value.contains(pt.value)){s&&(pt.value.src=s),pt.value.setAttribute("alt",a),pt.value.setAttribute("data-alt",a),lt.value?(pt.value.style.width=`${lt.value}px`,pt.value.setAttribute("width",lt.value)):(pt.value.style.removeProperty("width"),pt.value.removeAttribute("width")),kt.value?(pt.value.style.height=`${kt.value}px`,pt.value.setAttribute("height",kt.value)):(pt.value.style.removeProperty("height"),pt.value.removeAttribute("height"));const i=window.getSelection();if(i){i.removeAllRanges();const c=document.createRange();c.setStartAfter(pt.value),c.collapse(!0),i.addRange(c)}wt()}else{if(!s){n&&h.value&&n.observe(h.value,{childList:!0,subtree:!0}),vl();return}if(h.value){h.value.focus();const i=window.getSelection();i&&i.rangeCount>0&&i.removeAllRanges();const c=window.getSelection();let d=null;if(Xt.value&&(Yt(Xt.value),c&&c.rangeCount>0&&(d=c.getRangeAt(0))),!d&&c&&c.rangeCount>0&&(d=c.getRangeAt(0)),!d&&h.value){if(d=document.createRange(),h.value.childNodes.length===0){const C=document.createElement("p");C.innerHTML="<br>",h.value.appendChild(C),d.setStart(C,0),d.collapse(!0)}else d.selectNodeContents(h.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){vl();return}const u=d.commonAncestorContainer,p=u.nodeType===3?u.parentElement:u;if(!h.value.contains(p)){if(d=document.createRange(),h.value.childNodes.length===0){const C=document.createElement("p");C.innerHTML="<br>",h.value.appendChild(C),d.setStart(C,0),d.collapse(!0)}else d.selectNodeContents(h.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}const y=document.createElement("img");y.src=s,y.setAttribute("alt",a),y.setAttribute("data-alt",a),lt.value&&(y.style.width=`${lt.value}px`,y.setAttribute("width",lt.value)),kt.value&&(y.style.height=`${kt.value}px`,y.setAttribute("height",kt.value));try{d.insertNode(y),d.setStartAfter(y),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(h.value){if(h.value.childNodes.length===0){const O=document.createElement("p");h.value.appendChild(O),O.appendChild(y)}else{const O=h.value.lastChild;if(O&&O.nodeType===1)O.appendChild(y);else{const M=document.createElement("p");h.value.appendChild(M),M.appendChild(y)}}const R=document.createRange();R.setStartAfter(y),R.collapse(!0),c&&(c.removeAllRanges(),c.addRange(R))}}pt.value=y,wt()}}e.nextTick(()=>{n&&h.value&&n.observe(h.value,{childList:!0,subtree:!0}),ul(),pl(),vl()})};e.watch(()=>A.modelValue,a=>{if(A.richText&&h.value&&!Q.value){const n=Sl(a||""),i=h.value.innerHTML.replace(/&nbsp;|\u00A0/g," "),c=n.replace(/&nbsp;|\u00A0/g," ");if(i!==c){const d=Kt();h.value.innerHTML=n,e.nextTick(()=>{hn();const u=h.value.innerHTML||"",p=A.title||"",y=A.description||"";bt.value=u,re.value=p,X.value=y,el.value=u,te.value=p,ce.value=y,tt.value=[],Et.value=[],Se.value&&(clearTimeout(Se.value),Se.value=null),ot.value=!1,d&&Yt(d),j(),Nl(),Dl(),ul(),pl(),xn(),it("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>A.richText,a=>{a?(pl(),e.nextTick(()=>{uo()})):(Jn(),se.value=[],je.value&&(je.value.disconnect(),je.value=null)),xn()}),e.watch(()=>A.floatingToolbar,a=>{a?pl():Jn()}),e.watch(()=>A.disabled,a=>{a&&Jn(),xn()}),e.watch(()=>A.description,()=>{e.nextTick(()=>{D.value?Ll():cl()})}),e.watch(()=>A.title,()=>{e.nextTick(()=>{sl.value?il():ql()})}),e.watch(()=>A.customToolbarSlots,()=>{e.nextTick(()=>{so()})},{deep:!0}),e.watch(()=>A.comments,(a,n)=>{if(A.commentUser){if(Te.value){Te.value=!1;return}Ft.value||A.richText&&h.value&&e.nextTick(()=>{fl()})}},{deep:!0,immediate:!1});const fl=()=>{if(A.commentUser&&!Ft.value&&!(!A.comments||!Array.isArray(A.comments)||A.comments.length===0)&&!(!A.richText||!h.value)){Ft.value=!0;try{const a=new Set,n=A.comments.filter(u=>{const p=String(u.conversation_id||u.id);return a.has(p)?!1:(a.add(p),!0)}),s=h.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 y=String(p);if(d.has(y))return;const C=h.value.querySelector(`[data-comment="${y}"]`);if(C){At(C,u),d.add(y);return}try{const R=Wt(u.selection_range,u.selection_text);if(R&&!R.collapsed){const O=R.commonAncestorContainer,M=O.nodeType===3?O.parentElement:O;if(M){const We=M.closest("[data-comment], [data-fake-comment]");if(We){const $e=We.getAttribute("data-comment")||We.getAttribute("data-fake-comment");if(String($e)===String(p)){We.setAttribute("data-comment",y),We.removeAttribute("data-fake-comment"),At(We,u),d.add(y);return}else return}}const ue=h.value.querySelector(`[data-comment="${y}"]`);if(ue){At(ue,u),d.add(y);return}const le=document.createElement("span");le.setAttribute("data-comment",y),At(le,u);try{R.surroundContents(le),c++,d.add(y)}catch{try{const $e=document.createRange();$e.setStart(R.startContainer,R.startOffset),$e.setEnd(R.endContainer,R.endOffset),hl($e),$e.surroundContents(le),c++,d.add(y)}catch{try{const gt=R.extractContents();le.appendChild(gt),R.insertNode(le),c++,d.add(y)}catch(gt){console.warn("Failed to create comment marker:",gt)}}}}}catch{}}),e.nextTick(()=>{it("restoreCommentsFromModel"),wt(),Ft.value=!1})}catch{Ft.value=!1}}},hl=a=>{if(!a||!h.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&&!Sn(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&&!$n(c)||a.setEndAfter(u))}else c.nodeType===1&&n.includes(c.tagName)&&d<c.childNodes.length&&a.setEndAfter(c);return a}catch{return a}},Sn=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},$n=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},Wt=(a,n)=>{if(!a||!h.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=[h.value];let d=null,u=!1,p=!1;for(;!p&&(d=c.pop());)if(d.nodeType===3){const y=i+d.length;!u&&a.start>=i&&a.start<=y&&(s.setStart(d,a.start-i),u=!0),u&&a.end>=i&&a.end<=y&&(s.setEnd(d,a.end-i),p=!0),i=y}else{let y=d.childNodes.length;for(;y--;)c.push(d.childNodes[y])}return u?hl(s):null}}catch{return null}return null},At=(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")},it=(a="unknown")=>{if(!A.commentUser||!A.richText||!h.value){se.value=[];return}Date.now()-_t.value<Nt&&St.value!==null||St.value===null&&(St.value=requestAnimationFrame(()=>{if(St.value=null,_t.value=Date.now(),Ge.value)return;Ge.value=!0;const s={},i=h.value;if(!i){Ge.value=!1;return}const c=i.closest(".editor-with-comments");if(!c){Ge.value=!1;return}const d=i.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],p=new Set;d.forEach(M=>{const ue=M.getAttribute("data-comment")||M.getAttribute("data-fake-comment");ue&&M.tagName==="SPAN"&&(p.has(ue)||(u.push(M),p.add(ue)))}),d.forEach(M=>{const ue=M.getAttribute("data-comment")||M.getAttribute("data-fake-comment");!ue||p.has(ue)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(M.tagName)?M.querySelector(`span[data-comment="${ue}"], span[data-fake-comment="${ue}"]`)||(u.push(M),p.add(ue)):M.tagName!=="SPAN"&&(u.push(M),p.add(ue)))});const y=c.getBoundingClientRect(),C=i.getBoundingClientRect();u.forEach((M,ue)=>{let le=M.getAttribute("data-comment")||M.getAttribute("data-fake-comment");if(!le)return;if(typeof le=="string"&&le.startsWith("comment-")){const cn=M.textContent?.trim(),Bt=A.comments?.find(en=>(typeof en.conversation_id=="string"&&en.conversation_id.startsWith("comment-")?null:en.conversation_id)&&en.selection_text?.trim()===cn);Bt?(le=String(Bt.conversation_id),M.setAttribute("data-comment",le),M.removeAttribute("data-fake-comment")):(le=String(Date.now()),M.setAttribute("data-comment",le),M.removeAttribute("data-fake-comment"))}const We=M.getBoundingClientRect(),$e=window.getComputedStyle(M),gt=parseFloat($e.lineHeight)||parseFloat($e.fontSize)*1.2,nl=We.top-C.top+gt/2-15,It=C.top-y.top+nl;let ol=null,rn=null,kn=0;const Ol=[],So=new Set;if(le&&A.comments){const cn=A.comments.find(Bt=>String(Bt.conversation_id||Bt.id)===String(le));if(cn){const Bt=cn.conversation||[];Bt.length>0?(Bt.forEach(en=>{en.user&&en.user.id&&!So.has(en.user.id)&&(So.add(en.user.id),Ol.push(en.user))}),kn=Bt.length):(kn=0,ol=null,rn=null),Ol.length>0?ol=Ol[0]:ol=null,Ol.length>1?rn=Ol[1]:rn=null}}const Vo=We.top+gt/2-15,Tn=Vo+30,No=5,Fo=Tn>C.top+No&&Vo<C.bottom-No?1:0;se.value.find(cn=>cn.id===le);let Dn=M;if(!Dn&&le&&h.value){const cn=String(le);Dn=h.value.querySelector(`[data-comment="${cn}"], [data-fake-comment="${cn}"]`)}const Al=Ol.length;s[le]?(s[le].top=It,s[le].opacity=Fo,s[le].element=Dn,s[le].firstUser=ol,s[le].secondUser=rn,s[le].totalCount=kn,s[le].uniqueUserCount=Al):s[le]={id:le,top:It,opacity:Fo,element:Dn,firstUser:ol,secondUser:rn,totalCount:kn,uniqueUserCount:Al}});const R=Object.values(s).map(M=>{const ue=Math.max(0,(M.uniqueUserCount??0)-2);if(!M.element&&M.id&&h.value){const We=String(M.id);M.element=h.value.querySelector(`[data-comment="${We}"], [data-fake-comment="${We}"]`)}return{...M,firstUser:M.firstUser||null,secondUser:M.secondUser||null,totalCount:M.totalCount,additionalCount:ue}});(se.value.length!==R.length||R.some((M,ue)=>{const le=se.value[ue];if(!le)return!0;const We=(le.firstUser?.id||null)!==(M.firstUser?.id||null),$e=(le.secondUser?.id||null)!==(M.secondUser?.id||null);return le.id!==M.id||Math.abs(le.top-M.top)>1||le.opacity!==M.opacity||le.totalCount!==M.totalCount||le.additionalCount!==M.additionalCount||We||$e||le.element!==M.element}))&&(se.value=R),Ge.value=!1}))},kl=a=>{if(!a)return;let n=a.element;if(!n&&a.id&&h.value){const s=String(a.id);n=h.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`)}n&&(Ln(),at.value=n,n.classList.add("editor-comment-highlighted"))},Ln=(a=!1)=>{!a&&Ie.value!==null&&at.value&&(at.value.getAttribute("data-comment")||at.value.getAttribute("data-fake-comment"))===Ie.value||(h.value&&h.value.querySelectorAll(".editor-comment-highlighted").forEach(s=>{s.classList.remove("editor-comment-highlighted")}),at.value&&(at.value.classList.remove("editor-comment-highlighted"),at.value=null))},co=a=>{if(!a||!a.element)return;Ln(!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}"]`;de("comment-marker-clicked",{commentId:n,selector:s,element:a.element})},no=()=>{Ln()},uo=()=>{!A.richText||!h.value||(je.value&&je.value.disconnect(),vt.value!==null&&(clearTimeout(vt.value),vt.value=null),je.value=new MutationObserver(()=>{vt.value===null&&(vt.value=setTimeout(()=>{vt.value=null,e.nextTick(()=>{it("MutationObserver")})},200))}),je.value.observe(h.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),it("setupCommentMarkersObserver-initial"))},Vn=(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 y=s.left-d.width-4;a.style.left=`${y}px`}if(d.bottom>p){const y=Math.max(8,p-d.height-8);a.style.top=`${y}px`}d.top<0&&(a.style.top="8px")};return e.watch(()=>fe.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(()=>{Vn(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,mt.value],()=>{we.value==="askAi"||mt.value==="askAi"?e.nextTick(()=>{Do()}):(fe.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(()=>A.locale,a=>{a&&a!==oe.value&&(oe.value=a)},{immediate:!0}),J({openCommentOverlayForSelector:On,updateCommentMarkers:it,restoreCommentsFromModel:fl}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container",[{"editor-with-comments":Lt.value},Ht.value]]),style:e.normalizeStyle(Mt.value)},[_.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:n[14]||(n[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",i1,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Bl,title:e.unref(L)("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,c1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!El.value}]),onClick:Zl,title:e.unref(L)("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,u1),n[61]||(n[61]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",d1,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[0]||(n[0]=s=>Pn("paragraph")),title:e.unref(L)("textEditor.toolbar.paragraphFormat")},[B.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:W.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,p1)):B.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:W.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,v1)):B.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:W.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,f1)):B.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:W.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,h1)):B.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:W.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,g1)):B.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:W.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,y1)):(e.openBlock(),e.createElementBlock("svg",k1,[...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,m1),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=>_l("<h1>"))},[e.createElementVNode("img",{src:W.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,C1),e.createElementVNode("h1",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[2]||(n[2]=s=>_l("<h2>"))},[e.createElementVNode("img",{src:W.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,b1),e.createElementVNode("h2",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[3]||(n[3]=s=>_l("<h3>"))},[e.createElementVNode("img",{src:W.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,w1),e.createElementVNode("h3",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[4]||(n[4]=s=>_l("<h4>"))},[e.createElementVNode("img",{src:W.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,x1),e.createElementVNode("h4",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[5]||(n[5]=s=>_l("<h5>"))},[e.createElementVNode("img",{src:W.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,E1),e.createElementVNode("h5",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[6]||(n[6]=s=>_l("<h6>"))},[e.createElementVNode("img",{src:W.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,S1),e.createElementVNode("h6",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[7]||(n[7]=s=>_l("<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(L)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Dt("bold")}]),onClick:n[9]||(n[9]=s=>Pl("bold")),title:e.unref(L)("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,V1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Dt("italic")}]),onClick:n[10]||(n[10]=s=>Pl("italic")),title:e.unref(L)("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,N1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Dt("underline")}]),onClick:n[11]||(n[11]=s=>Pl("underline")),title:e.unref(L)("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,B1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ke.value}]),onClick:sn,title:e.unref(L)("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,_1),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:Ul,title:e.unref(L)("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,$1)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:Ql,title:e.unref(L)("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,M1)),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":Dt("insertUnorderedList")}]),onClick:k,title:e.unref(L)("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,L1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Dt("insertOrderedList")}]),onClick:w,title:e.unref(L)("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,T1),n[64]||(n[64]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Ml,title:e.unref(L)("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,D1),Lt.value&&ae.value?(e.openBlock(),e.createElementBlock("div",A1)):e.createCommentVNode("",!0),Lt.value&&ae.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(L)("textEditor.toolbar.comment"),onClick:st},[...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,H1)):e.createCommentVNode("",!0),_.askAi?(e.openBlock(),e.createElementBlock("div",R1)):e.createCommentVNode("",!0),_.askAi?(e.openBlock(),e.createElementBlock("div",F1,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:n[12]||(n[12]=s=>Pn("askAi")),title:e.unref(L)("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",z1,e.toDisplayString(e.unref(L)("textEditor.toolbar.askAi")),1)],8,I1),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",P1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[Hl(s)?(e.openBlock(),e.createElementBlock("div",O1,[e.renderSlot(a.$slots,s)])):e.createCommentVNode("",!0),Hl(s)&&i<_.customToolbarSlots.length-1&&Rn(i)?(e.openBlock(),e.createElementBlock("div",W1)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(we.value==="paragraph"||we.value==="askAi")&&_.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:tl})):e.createCommentVNode("",!0),e.createVNode(ha,{showModal:Ae.value,width:"500px",height:"55vh",onCloseModal:ro},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(L)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",q1,[e.createElementVNode("div",Z1,[e.createElementVNode("label",U1,e.toDisplayString(e.unref(L)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:_e,type:"text","onUpdate:modelValue":n[15]||(n[15]=s=>ze.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.link.enterAltText"),onKeyup:e.withKeys(Eo,["enter"])},null,40,Y1),[[e.vModelText,ze.value]])]),e.createElementVNode("div",X1,[e.createElementVNode("label",j1,e.toDisplayString(e.unref(L)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:Ye,type:"text","onUpdate:modelValue":n[16]||(n[16]=s=>Z.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.link.enterUrl"),onKeyup:e.withKeys(Eo,["enter"])},null,40,K1),[[e.vModelText,Z.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:ro},e.toDisplayString(e.unref(L)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Eo},e.toDisplayString(e.unref(L)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(ha,{showModal:Qt.value,width:"500px",height:"80vh",onCloseModal:vl},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(pt.value?e.unref(L)("textEditor.image.editImage"):e.unref(L)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",G1,[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(L)("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(L)("textEditor.image.imageLink")),3)]),Y.value==="upload"?(e.openBlock(),e.createElementBlock("div",Q1,[e.createElementVNode("div",J1,[e.createElementVNode("div",em,[yl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",tm,e.toDisplayString(e.unref(L)("textEditor.image.uploadImage")),1)),yl.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:$l},[e.createElementVNode("img",{src:et.value,alt:"Preview",class:"dss-image-preview-image"},null,8,lm),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:ct,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:P},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:ct,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:P},null,544))]),e.createElementVNode("div",nm,[e.createElementVNode("label",om,e.toDisplayString(e.unref(L)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Rt,type:"text","onUpdate:modelValue":n[19]||(n[19]=s=>xe.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Ot,["enter"])},null,40,am),[[e.vModelText,xe.value]])]),e.createElementVNode("div",sm,[e.createElementVNode("label",rm,e.toDisplayString(e.unref(L)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[20]||(n[20]=s=>lt.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(Ot,["enter"]),onInput:Xl},null,40,im),[[e.vModelText,lt.value]])]),e.createElementVNode("div",cm,[e.createElementVNode("label",um,e.toDisplayString(e.unref(L)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[21]||(n[21]=s=>kt.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(Ot,["enter"]),onInput:Zn},null,40,dm),[[e.vModelText,kt.value]])])])])):e.createCommentVNode("",!0),Y.value==="url"?(e.openBlock(),e.createElementBlock("div",mm,[e.createElementVNode("div",pm,[e.createElementVNode("div",vm,[e.createElementVNode("label",fm,e.toDisplayString(e.unref(L)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:ht,type:"text","onUpdate:modelValue":n[22]||(n[22]=s=>ie.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(Ot,["enter"])},null,40,hm),[[e.vModelText,ie.value]])]),e.createElementVNode("div",gm,[e.createElementVNode("label",ym,e.toDisplayString(e.unref(L)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[23]||(n[23]=s=>xe.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Ot,["enter"])},null,40,km),[[e.vModelText,xe.value]])]),e.createElementVNode("div",Cm,[e.createElementVNode("label",bm,e.toDisplayString(e.unref(L)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[24]||(n[24]=s=>lt.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(Ot,["enter"]),onInput:Xl},null,40,wm),[[e.vModelText,lt.value]])]),e.createElementVNode("div",xm,[e.createElementVNode("label",Em,e.toDisplayString(e.unref(L)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[25]||(n[25]=s=>kt.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(Ot,["enter"]),onInput:Zn},null,40,Sm),[[e.vModelText,kt.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:vl},e.toDisplayString(e.unref(L)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Ot},e.toDisplayString(e.unref(L)("textEditor.image.save")),1)]),_:1},8,["showModal"]),_.showTitle?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":nn.value&&sl.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.labels.title")),1),e.createElementVNode("div",Vm,[sl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Nm,[_.title?(e.openBlock(),e.createElementBlock("span",Bm,e.toDisplayString(_.title),1)):(e.openBlock(),e.createElementBlock("span",_m,e.toDisplayString(ft.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:Ve,value:_.title,onInput:vn,onFocus:jn,onBlur:Fn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!sl.value}]),placeholder:ft.value,disabled:_.disabled,rows:"1"},null,42,Mm)])],2)):e.createCommentVNode("",!0),_.showTitle&&nn.value&&sl.value?(e.openBlock(),e.createElementBlock("div",$m,[e.renderSlot(a.$slots,"title-slot")])):e.createCommentVNode("",!0),_.showDescription?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":Rl.value&&D.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.labels.description")),1),e.createElementVNode("div",Lm,[D.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Tm,[_.description?(e.openBlock(),e.createElementBlock("span",Dm,e.toDisplayString(_.description),1)):(e.openBlock(),e.createElementBlock("span",Am,e.toDisplayString(zl.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:nt,value:_.description,onInput:jt,onFocus:In,onBlur:fn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!D.value}]),placeholder:zl.value,disabled:_.disabled,rows:"1"},null,42,Hm)])],2)):e.createCommentVNode("",!0),_.showDescription&&Rl.value&&D.value?(e.openBlock(),e.createElementBlock("div",Rm,[e.renderSlot(a.$slots,"description-slot")])):e.createCommentVNode("",!0),Lt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:6},e.renderList(se.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":Ie.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=>kl(s),onMouseleave:no},[s.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(i=>co(s),["stop"])},[s.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.firstUser.avatar,alt:s.firstUser.name||"avatar"},null,8,zm)):(e.openBlock(),e.createElementBlock("span",Pm,e.toDisplayString(s.firstUser.initials||(s.firstUser.name?s.firstUser.name.charAt(0):"")),1))],8,Im)):e.createCommentVNode("",!0),s.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(i=>co(s),["stop"])},[s.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.secondUser.avatar,alt:s.secondUser.name||"avatar"},null,8,Wm)):(e.openBlock(),e.createElementBlock("span",qm,e.toDisplayString(s.secondUser.initials||(s.secondUser.name?s.secondUser.name.charAt(0):"")),1))],8,Om)):e.createCommentVNode("",!0),s.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:s.secondUser?"30px":"15px"}),"data-has-second-user":s.secondUser?"true":"false",onClick:e.withModifiers(i=>co(s),["stop"])},[e.createElementVNode("span",Um,"+"+e.toDisplayString(s.additionalCount),1)],12,Zm)):e.createCommentVNode("",!0)],46,Fm))),128)):e.createCommentVNode("",!0),_.richText?(e.openBlock(),e.createElementBlock("div",Jm,[e.createElementVNode("div",{ref_key:"editorRef",ref:h,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":_.disabled,"dss-text-editor-fixed-height":_.fixedHeight}]),style:e.normalizeStyle(jl.value),onInput:wt,onBlur:gn,onClick:ta,onMouseup:Co,onKeyup:Co,onKeydown:Ko,onPaste:Go,onMousemove:la,onMouseleave:na},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[Lt.value&&Ie.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(f.value)},[F.value||Qe.value.length>0?(e.openBlock(),e.createElementBlock("div",e2,[e.createElementVNode("div",t2,[F.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:F.value},null,8,l2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",n2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qe.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",o2,[e.createElementVNode("div",a2,[s.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.user.avatar,alt:s.user.name||"avatar"},null,8,s2)):(e.openBlock(),e.createElementBlock("span",r2,e.toDisplayString(s.user.initials||(s.user.name?s.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",i2,[e.createElementVNode("div",c2,[e.createElementVNode("div",u2,e.toDisplayString(s.user&&s.user.name||"Comment"),1),s.createdAt?(e.openBlock(),e.createElementBlock("div",d2,e.toDisplayString(Wl(new Date(s.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":pn(s.text)||s.class==="comment-started"}])},e.toDisplayString(s.text||""),3)]),A.commentUser&&s.user&&s.user.id===A.commentUser.id&&!pn(s.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>ll(s,i),["stop"]),title:e.unref(L)("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,m2)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",p2,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:S,"onUpdate:modelValue":n[26]||(n[26]=s=>g.value=s),class:"dss-comment-input",rows:"1",placeholder:e.unref(L)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(ne,["prevent","stop"]),["enter"]),onInput:n[27]||(n[27]=()=>{if(S.value){const s=S.value;s.style.height="auto",s.style.height=`${s.scrollHeight}px`}})},null,40,v2),[[e.vModelText,g.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(ne,["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",f2,[e.createElementVNode("div",h2,[e.createElementVNode("span",g2,e.toDisplayString(ml.value)+" "+e.toDisplayString(ml.value===1?e.unref(L)("textEditor.footer.word"):e.unref(L)("textEditor.footer.words")),1),n[70]||(n[70]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",y2,e.toDisplayString(un.value)+" "+e.toDisplayString(un.value===1?e.unref(L)("textEditor.footer.character"):e.unref(L)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",Ym,[e.createElementVNode("textarea",{value:_.modelValue,onInput:on,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":_.fixedHeight}]),placeholder:Kl.value,rows:_.rows,disabled:_.disabled,style:e.normalizeStyle(wl.value)},null,46,Xm),e.createElementVNode("div",jm,[e.createElementVNode("div",Km,[e.createElementVNode("span",Gm,e.toDisplayString(ml.value)+" "+e.toDisplayString(ml.value===1?e.unref(L)("textEditor.footer.word"):e.unref(L)("textEditor.footer.words")),1),n[67]||(n[67]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Qm,e.toDisplayString(un.value)+" "+e.toDisplayString(un.value===1?e.unref(L)("textEditor.footer.character"):e.unref(L)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[K.value&&he.value&&h.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(Re.value),onMouseenter:n[28]||(n[28]=s=>ge.value=!0),onMouseleave:eo},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(xo,["stop"]),title:he.value},e.toDisplayString(he.value),9,k2),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Ro,["stop"]),title:e.unref(L)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",b2,[...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,C2)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Ct.value&&Pt.value&&h.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(pe.value),onMouseenter:n[29]||(n[29]=s=>H.value=!0),onMouseleave:to},[e.createElementVNode("div",w2,[Pt.value===e.unref(L)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",x2,[...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:Pt.value},e.toDisplayString(Pt.value),9,E2)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(xl,["stop"]),title:e.unref(L)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",V2,[...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,S2)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[_.floatingToolbar&&_.richText&&Me.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:yt,class:"dss-floating-toolbar",style:e.normalizeStyle(rt.value),onMousedown:n[44]||(n[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",N2,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Bl,["stop"]),title:e.unref(L)("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,B2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!El.value}]),onClick:e.withModifiers(Zl,["stop"]),title:e.unref(L)("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,_2),n[89]||(n[89]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",M2,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[30]||(n[30]=e.withModifiers(s=>bo("paragraph"),["stop"])),title:e.unref(L)("textEditor.toolbar.paragraphFormat")},[B.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:W.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,L2)):B.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:W.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,T2)):B.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:W.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,D2)):B.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:W.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,A2)):B.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:W.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,H2)):B.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:W.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,R2)):(e.openBlock(),e.createElementBlock("svg",F2,[...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,$2),mt.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(L)("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(L)("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(L)("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(L)("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(L)("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(L)("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(L)("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":Dt("bold")}]),onClick:n[39]||(n[39]=e.withModifiers(s=>Pl("bold"),["stop"])),title:e.unref(L)("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,I2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Dt("italic")}]),onClick:n[40]||(n[40]=e.withModifiers(s=>Pl("italic"),["stop"])),title:e.unref(L)("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,z2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Dt("underline")}]),onClick:n[41]||(n[41]=e.withModifiers(s=>Pl("underline"),["stop"])),title:e.unref(L)("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,P2),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":Ke.value}]),onClick:e.withModifiers(sn,["stop"]),title:e.unref(L)("textEditor.toolbar.citation")},[...n[81]||(n[81]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,O2),n[92]||(n[92]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ye.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(Ul,["stop"]),title:e.unref(L)("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,q2)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(Ql,["stop"]),title:e.unref(L)("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,W2)),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":Dt("insertUnorderedList")}]),onClick:e.withModifiers(k,["stop"]),title:e.unref(L)("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,Z2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Dt("insertOrderedList")}]),onClick:e.withModifiers(w,["stop"]),title:e.unref(L)("textEditor.toolbar.numberList")},[...n[85]||(n[85]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,U2),n[94]||(n[94]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Ml,["stop"]),title:e.unref(L)("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,Y2),Lt.value?(e.openBlock(),e.createElementBlock("div",X2)):e.createCommentVNode("",!0),Lt.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(L)("textEditor.toolbar.comment"),onClick:e.withModifiers(st,["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,j2)):e.createCommentVNode("",!0),_.askAi?(e.openBlock(),e.createElementBlock("div",K2)):e.createCommentVNode("",!0),_.askAi?(e.openBlock(),e.createElementBlock("div",G2,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:n[42]||(n[42]=e.withModifiers(s=>bo("askAi"),["stop"])),title:e.unref(L)("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",J2,e.toDisplayString(e.unref(L)("textEditor.toolbar.askAi")),1)],8,Q2),mt.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)]),Bn.value?(e.openBlock(),e.createElementBlock("div",ep,[_.askAi&&Bn.value?(e.openBlock(),e.createElementBlock("div",tp)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[Hl(s)&&bn(s)?(e.openBlock(),e.createElementBlock("div",lp,[e.renderSlot(a.$slots,s)])):e.createCommentVNode("",!0),Hl(s)&&bn(s)&&i<_.customToolbarSlots.length-1&&Gl(i)?(e.openBlock(),e.createElementBlock("div",np)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),sp={class:"dss-color-picker__section-title"},rp={class:"dss-color-picker__presets-row"},ip=["title","onClick"],cp={key:1,class:"dss-color-picker__section"},up={class:"dss-color-picker__presets-row"},dp=["title","onClick"],mp={key:2,class:"dss-color-picker__section"},pp={class:"dss-color-picker__section-header"},vp={class:"dss-color-picker__presets-row"},fp=["title","onClick"],hp=["onClick"],gp={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},yp=["title","onClick"],kp={class:"dss-color-picker__input-row"},Cp=["value"],bp={__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(_,{emit:J}){function N(re){const X=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(re);if(!X)return{h:0,s:0,l:50};const te=parseInt(X[1],16)/255,ce=parseInt(X[2],16)/255,Ve=parseInt(X[3],16)/255,nt=Math.max(te,ce,Ve),xt=Math.min(te,ce,Ve);let dl=0,Vt=0;const sl=(nt+xt)/2;if(nt!==xt){const D=nt-xt;switch(Vt=sl>.5?D/(2-nt-xt):D/(nt+xt),nt){case te:dl=((ce-Ve)/D+(ce<Ve?6:0))/6;break;case ce:dl=((Ve-te)/D+2)/6;break;case Ve:dl=((te-ce)/D+4)/6;break}}return{h:dl*360,s:Vt*100,l:sl*100}}function L(re,X,te){X/=100,te/=100;const ce=X*Math.min(te,1-te),Ve=nt=>{const xt=(nt+re/30)%12,dl=te-ce*Math.max(Math.min(xt-3,9-xt,1),-1);return Math.round(255*dl).toString(16).padStart(2,"0")};return`#${Ve(0)}${Ve(8)}${Ve(4)}`}function oe(re){const X=re.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!X)return null;let te=X[1];return te.length===3&&(te=te.split("").map(ce=>ce+ce).join("")),"#"+te}function W(re){const X=re.match(/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})(?:[\s,\/]+[\d.]+)?\s*\)$/i);if(!X)return null;const te=Math.max(0,Math.min(255,Number.parseInt(X[1],10))),ce=Math.max(0,Math.min(255,Number.parseInt(X[2],10))),Ve=Math.max(0,Math.min(255,Number.parseInt(X[3],10)));return`#${te.toString(16).padStart(2,"0")}${ce.toString(16).padStart(2,"0")}${Ve.toString(16).padStart(2,"0")}`}function A(re){if(typeof re!="string")return null;const X=re.trim();return oe(X)||W(X)}function de(re,X,te){X/=100,te/=100;const ce=te+X*Math.min(te,1-te),Ve=ce===0?0:2-2*te/ce;return{h:re,s:Ve*100,v:ce*100}}function dt(re,X,te){X/=100,te/=100;const ce=te*(1-X/2),Ve=ce===0||ce===1?0:(te-ce)/Math.min(ce,1-ce);return{h:re,s:Ve*100,l:ce*100}}const ee=_,h=J,we=e.ref(!1),ye=e.ref(!1),Q=e.ref(!1),K=e.ref(-1),he=e.ref(-1),Re=e.ref(null),ge=e.ref(null),Ae=e.ref(null),Z=e.ref(null),ze=e.ref({top:0,left:0}),Ye=e.ref(N(ee.modelValue||"#b8a5de")),_e=e.computed(()=>Array.isArray(ee.presetGroups)&&ee.presetGroups.length>0),Xe=e.computed(()=>!ee.disableCustomColors),U=e.computed(()=>_e.value?0:ee.initialPresetCount!=null?ee.initialPresetCount:he.value<0?null:he.value),He=e.computed(()=>{const re=U.value;return re==null?!0:Math.max(0,ee.presetColors.length-re)<ee.max}),Ke=e.computed(()=>!!(ye.value||K.value>=0||!ke.value&&ee.presetColors.length===0));e.computed(()=>{const re=U.value;return re!=null&&ee.presetColors.length>re});const ke=e.computed(()=>_e.value||U.value!=null),Me=e.computed(()=>{const re=U.value;return re==null?[]:ee.presetColors.slice(0,re)}),rt=e.computed(()=>{const re=U.value;return re==null?[]:ee.presetColors.slice(re)});function yt(re){const X=U.value;return X!=null?X+re:-1}function mt(re){const X=U.value;return X!=null&&re>=X}function Qt(re){mt(re)&&(K.value=re,Ye.value=N(ee.presetColors[re]),ye.value=!0,e.nextTick(()=>Z.value?.focus()))}function xe(re){if(!mt(re))return;const X=ee.presetColors.filter((Ve,nt)=>nt!==re);h("update:presetColors",X);const te=oe(ee.modelValue),ce=oe(ee.presetColors[re]);if(te&&ce&&te.toLowerCase()===ce.toLowerCase()){const Ve=X[Math.max(0,re-1)]||X[0];Ve&&h("update:modelValue",Ve)}}function Jt(){Q.value=!Q.value,Q.value||(K.value=-1,ye.value=!1)}function et(){if(!Xe.value||K.value<0)return;const re=ct.value,X=oe(re);if(X){const te=[...ee.presetColors];te[K.value]=X,h("update:presetColors",te),h("update:modelValue",X),K.value=-1,ye.value=!1}}function lt(){ee.disabled||!Xe.value||(K.value=-1,ye.value=!ye.value,ye.value&&(H(),e.nextTick(()=>Z.value?.focus())))}function kt(re){const X=A(re),te=A(ee.modelValue);return X&&te&&X.toLowerCase()===te.toLowerCase()}function Rt(){if(ee.disabled||!Xe.value||!He.value)return;const re=ct.value,X=oe(re);if(X){const te=[...ee.presetColors,X];h("update:presetColors",te),h("update:modelValue",X);const ce=U.value??he.value;ce>=0&&te.length-ce>=ee.max&&(ye.value=!1)}}const ct=e.computed(()=>{const{h:re,s:X,l:te}=Ye.value;return L(re,X,te)}),ht=e.computed(()=>ct.value.toLowerCase()),pt=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${Ye.value.h}, 100%, 50%))`})),Xt=e.computed(()=>{const re=de(Ye.value.h,Ye.value.s,Ye.value.l);return{left:`${re.s}%`,bottom:`${re.v}%`,transform:"translate(-50%, 50%)"}}),Ct=e.computed(()=>({left:`${Ye.value.h/360*100}%`,transform:"translateX(-50%)"})),Pt=e.computed(()=>({position:"fixed",left:`${ze.value.left}px`,top:`${ze.value.top}px`,zIndex:1002}));function pe(){if(!Re.value||!we.value)return;const re=Re.value.getBoundingClientRect(),X=window.innerHeight||document.documentElement.clientHeight;let te=re.bottom+4;const ce=ge.value;ce&&te+ce.offsetHeight>X-8&&(te=re.top-4-ce.offsetHeight),ze.value={top:te,left:re.left}}function H(){const re=ee.modelValue||"#b8a5de",X=A(re);X&&(Ye.value=N(X))}function Y(){h("update:modelValue",ct.value)}function ie(){ee.disabled||(we.value=!we.value,we.value&&(H(),e.nextTick(()=>{pe(),Z.value?.focus()})))}function fe(){const re=ct.value,X=oe(re);if(X){if(K.value>=0){const te=[...ee.presetColors];te[K.value]=X,h("update:presetColors",te),h("update:modelValue",X)}else if(Xe.value&&(ee.presetColors.length>0||_e.value)&&ye.value&&He.value&&!ee.presetColors.some(ce=>oe(ce)?.toLowerCase()===X.toLowerCase())){const ce=[...ee.presetColors,X];h("update:presetColors",ce),h("update:modelValue",X)}}we.value=!1,ye.value=!1,Q.value=!1,K.value=-1}function Fe(re){if(!Ae.value)return;const X=Ae.value.getBoundingClientRect(),te=ce=>{const Ve=Math.max(0,Math.min(1,(ce.clientX-X.left)/X.width)),nt=Math.max(0,Math.min(1,1-(ce.clientY-X.top)/X.height)),xt={h:Ye.value.h,s:Ve*100,v:nt*100};Ye.value=dt(xt.h,xt.s,xt.v)};te(re),document.addEventListener("mousemove",te),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",te),Y()},{once:!0})}function tt(re){if(!re.currentTarget)return;const te=re.currentTarget.getBoundingClientRect(),ce=Ve=>{const nt=Math.max(0,Math.min(1,(Ve.clientX-te.left)/te.width));Ye.value={...Ye.value,h:nt*360}};ce(re),document.addEventListener("mousemove",ce),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",ce),Y()},{once:!0})}function Et(re){const X=re.target.value,te=A(X);te&&(Ye.value=N(te),h("update:modelValue",te))}function Se(re){if(ee.disabled)return;const X=A(re);X&&(Ye.value=N(X),h("update:modelValue",X))}let ot=null,bt=null;function el(){ot&&(document.removeEventListener("keydown",ot),ot=null),bt&&(window.removeEventListener("resize",bt),bt=null)}return e.watch(we,re=>{if(el(),re){if(!_e.value&&ee.initialPresetCount==null){const X=ee.presetColors.length;X>0&&(he.value<0||X<he.value)&&(he.value=X)}ot=X=>{X.key==="Escape"&&fe()},bt=pe,document.addEventListener("keydown",ot),window.addEventListener("resize",bt)}}),e.watch(()=>ee.modelValue,()=>{we.value&&H()},{immediate:!1}),e.watch(rt,re=>{re.length===0&&(Q.value=!1,K.value=-1,ye.value=!1)}),e.onBeforeUnmount(el),(re,X)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":_.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:Re,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":we.value}]),onClick:ie},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:ct.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(fe,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:ge,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Pt.value)},[ke.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[_e.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(_.presetGroups,(te,ce)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+ce,class:"dss-color-picker__section"},[e.createElementVNode("span",sp,e.toDisplayString(te.title),1),e.createElementVNode("div",rp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.colors,(Ve,nt)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+ce+"-"+nt,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":kt(Ve)}]),style:e.normalizeStyle({backgroundColor:Ve,"--dss-preset-color":Ve}),title:Ve,onClick:e.withModifiers(xt=>Se(Ve),["stop"])},null,14,ip))),128))])]))),128)):Me.value.length?(e.openBlock(),e.createElementBlock("div",cp,[X[1]||(X[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",up,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Me.value,(te,ce)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+ce,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":kt(te)}]),style:e.normalizeStyle({backgroundColor:te,"--dss-preset-color":te}),title:te,onClick:e.withModifiers(Ve=>Se(te),["stop"])},null,14,dp))),128))])])):e.createCommentVNode("",!0),Xe.value?(e.openBlock(),e.createElementBlock("div",mp,[e.createElementVNode("div",pp,[X[3]||(X[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),rt.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":Q.value}]),title:"Manage custom colors",onClick:e.withModifiers(Jt,["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",vp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(rt.value,(te,ce)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+ce,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":Q.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!Q.value&&kt(te),"dss-color-picker__preset-bubble--editing":Q.value&&K.value===yt(ce)}]),style:e.normalizeStyle({backgroundColor:K.value===yt(ce)?ct.value:te,"--dss-preset-color":K.value===yt(ce)?ct.value:te}),title:K.value===yt(ce)?ct.value:te,onClick:e.withModifiers(Ve=>Q.value?Qt(yt(ce)):Se(te),["stop"])},null,14,fp),Q.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(Ve=>xe(yt(ce)),["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,hp)):e.createCommentVNode("",!0)],2))),128)),He.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(lt,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],64)):_.presetColors.length?(e.openBlock(),e.createElementBlock("div",gp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.presetColors,(te,ce)=>(e.openBlock(),e.createElementBlock("button",{key:ce,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":kt(te)}]),style:e.normalizeStyle({backgroundColor:te,"--dss-preset-color":te}),title:te,onClick:e.withModifiers(Ve=>Se(te),["stop"])},null,14,yp))),128)),Xe.value&&He.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(lt,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Ke.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:Ae,onMousedown:Fe},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(pt.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(Xt.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:tt},[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(Ct.value)},null,4)],32),e.createElementVNode("div",kp,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:Z,type:"text",class:"dss-color-picker__hex-input",value:ht.value,onInput:Et},null,40,Cp)]),Xe.value&&ke.value&&(_.presetColors.length||_e.value)&&He.value&&K.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:Rt}," Save color ")):e.createCommentVNode("",!0),Xe.value&&ke.value&&K.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:et}," 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:fe}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},wp={key:0,class:"dss-loader"},xp={key:0,class:"dss-loader-label"},Ep={key:1,class:"dss-loader"},Sp={key:0,class:"dss-loader-label"},Vp={key:2,class:"dss-loader"},Np={key:0,class:"dss-loader-label"},Bp={key:3,class:"dss-loader"},_p={key:0,class:"dss-loader-label"},Mp={key:4,class:"dss-loader"},$p={key:0,class:"dss-loader-label"},Lp={key:5,class:"dss-loader dss-loader--inline"},Tp={class:"dss-loader-inline-text"},Dp={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""}},setup(_){const J=_,N=e.computed(()=>J.size==="small"?"dss-loaders--size-small":J.size==="large"?"dss-loaders--size-large":J.size==="medium"||J.size==null?"dss-loaders--size-medium":null),L=e.computed(()=>{const oe={};if(!(J.size==="small"||J.size==="medium"||J.size==="large"||J.size==null)){const W=typeof J.size=="number"?`${J.size}px`:String(J.size);oe["--dss-loader-size"]=W}return J.color&&(oe["--dss-loader-accent"]=J.color,oe["--dss-loader-accent-soft"]=`color-mix(in srgb, ${J.color} 30%, white)`),oe});return(oe,W)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",N.value]),style:e.normalizeStyle(L.value)},[_.type==="spinner"?(e.openBlock(),e.createElementBlock("div",wp,[W[0]||(W[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),_.label?(e.openBlock(),e.createElementBlock("span",xp,e.toDisplayString(_.label),1)):e.createCommentVNode("",!0)])):_.type==="dots"?(e.openBlock(),e.createElementBlock("div",Ep,[W[1]||(W[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)),_.label?(e.openBlock(),e.createElementBlock("span",Sp,e.toDisplayString(_.label),1)):e.createCommentVNode("",!0)])):_.type==="battery"?(e.openBlock(),e.createElementBlock("div",Vp,[W[2]||(W[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),_.label?(e.openBlock(),e.createElementBlock("span",Np,e.toDisplayString(_.label),1)):e.createCommentVNode("",!0)])):_.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",Bp,[W[3]||(W[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)),_.label?(e.openBlock(),e.createElementBlock("span",_p,e.toDisplayString(_.label),1)):e.createCommentVNode("",!0)])):_.type==="bars"?(e.openBlock(),e.createElementBlock("div",Mp,[W[4]||(W[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)),_.label?(e.openBlock(),e.createElementBlock("span",$p,e.toDisplayString(_.label),1)):e.createCommentVNode("",!0)])):_.type==="inline"?(e.openBlock(),e.createElementBlock("div",Lp,[W[5]||(W[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",Tp,[e.renderSlot(oe.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(_.label),1)])])])):e.createCommentVNode("",!0)],6))}},Ha="dss-skeleton-item",Ap={__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:_=>["single","multiple"].includes(_)},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(_){const J=_,N=e.computed(()=>{const W={"dss-skeleton--loading":J.loading,"dss-skeleton--static":!J.shimmer,"dss-skeleton--multiple":J.mode==="multiple","dss-skeleton--dark":J.darkMode};return J.mode==="multiple"&&J.targetClass!==Ha&&(W[`dss-skeleton--target-${J.targetClass}`]=!0),W}),L=e.computed(()=>{const W={};return J.borderRadius&&(W.borderRadius=J.borderRadius),W}),oe=e.computed(()=>{const W={};return J.borderRadius&&(W["--dss-skeleton-border-radius"]=J.borderRadius),J.darkMode?(W["--dss-skeleton-bg"]=J.bgDark||"#322c3f",W["--dss-skeleton-shimmer"]=J.shimmerDark||"#3e3f41",W):(J.bgColor&&(W["--dss-skeleton-bg"]=J.bgColor),J.shimmerColor&&(W["--dss-skeleton-shimmer"]=J.shimmerColor),W)});return(W,A)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",N.value]),style:e.normalizeStyle(oe.value)},[_.loading&&_.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(L.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":_.loading&&_.mode==="single"}])},[e.renderSlot(W.$slots,"default")],2)],6))}},Hp={key:0,class:"dss-dnd-column-header"},Rp={class:"dss-dnd-column-title"},Fp={class:"dss-dnd-column-count"},Ip=["data-column"],zp={key:0,class:"dss-dnd-indicator"},Pp=["onPointerdown"],Op=["onPointerdown"],Wp={class:"dss-dnd-item-content"},qp={class:"dss-dnd-item-default"},Zp={key:0,class:"dss-dnd-empty"},Up={name:"DSSDnd"},Yp=Object.assign(Up,{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(_,{emit:J}){const N=_,L=J,oe=e.useSlots(),W=e.computed(()=>!!oe["delete-zone"]),A={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},de=e.computed(()=>({...A,...N.options})),dt=e.computed(()=>({"--dss-dnd-col-min-w":de.value.columnMinWidth,"--dss-dnd-col-max-w":de.value.columnMaxWidth,"--dss-dnd-col-gap":de.value.columnGap,"--dss-dnd-indicator-color":de.value.indicatorColor,"--dss-dnd-body-max-h":de.value.columnBodyMaxHeight}));function ee(pe){if(!de.value.ColColor||!pe)return{};const H=pe.background||pe.color;return H?{background:H}:{}}const h=e.ref(null),we=e.ref(null),ye=e.ref(!1),Q=e.ref(-1),K=e.ref(null);let he=null,Re=null,ge=null,Ae=null,Z=0,ze=0,Ye="",_e=null;const Xe=5,U=e.computed(()=>{const pe={};for(const H of N.columns)pe[H.value]=N.items.filter(Y=>Y[N.columnKey]===H.value).sort((Y,ie)=>(Y[N.positionKey]??0)-(ie[N.positionKey]??0));return pe}),He=e.computed(()=>{const pe={},H=!!h.value,Y=h.value?.[N.itemKey],ie=we.value,fe=Q.value;for(const Fe of N.columns){const tt=U.value[Fe.value]||[],Et=[],Se=ie==Fe.value;let ot=0;for(let bt=0;bt<tt.length;bt++){const el=tt[bt],re=H&&el[N.itemKey]===Y;!re&&Se&&fe===ot&&Et.push({type:"indicator",key:`ind-${ot}`}),re||ot++,Et.push({type:"item",item:el,isDragged:re,key:`item-${el[N.itemKey]}`})}Se&&fe>=ot&&Et.push({type:"indicator",key:"ind-end"}),pe[Fe.value]=Et}return pe});function Ke(pe,H){const ie=(U.value[pe]||[]).filter(tt=>tt[N.itemKey]!==h.value?.[N.itemKey]);if(ie.length===0)return 1;if(H<=0){const tt=ie[0][N.positionKey];return tt!=null&&tt>0?tt/2:.5}if(H>=ie.length){const tt=ie[ie.length-1][N.positionKey];return(tt??0)+1}const fe=ie[H-1][N.positionKey]??0,Fe=ie[H][N.positionKey]??0;return(fe+Fe)/2}function ke(pe,H,Y){ge&&ge.remove();const ie=pe.getBoundingClientRect(),fe=pe.cloneNode(!0);fe.classList.add("dss-dnd-ghost"),fe.style.cssText=`
106
106
  position: fixed;
107
107
  left: ${H-Z}px;
108
- top: ${Y-Oe}px;
109
- width: ${re.width}px;
110
- height: ${re.height}px;
108
+ top: ${Y-ze}px;
109
+ width: ${ie.width}px;
110
+ height: ${ie.height}px;
111
111
  z-index: 9999;
112
112
  pointer-events: none;
113
113
  opacity: ${de.value.dragGhostOpacity};
@@ -116,5 +116,5 @@
116
116
  background-color: ${de.value.dragSourceBackground};
117
117
  font-family: 'Work Sans', sans-serif;
118
118
  cursor: grabbing;
119
- `,document.body.appendChild(fe),ge=fe}function Me(pe,H){ge&&(ge.style.left=`${pe-Z}px`,ge.style.top=`${H-Oe}px`)}function rt(pe){pe.classList.add("dss-dnd-item--dragging"),pe.style.background=de.value.dragSourceBackground,pe.style.borderColor=de.value.dragSourceBorder,pe.style.transform="scale(0.97)"}function gt(pe){pe.classList.remove("dss-dnd-item--dragging"),pe.style.background="",pe.style.borderColor="",pe.style.transform=""}function mt(pe,H){return document.elementFromPoint(pe,H)?.closest(".dss-dnd-column-body")??null}function Qt(pe,H){return!!document.elementFromPoint(pe,H)?.closest("[data-dss-dnd-delete-zone]")}function xe(pe,H){if(W.value&&Qt(pe,H)){ye.value=!0,we.value=null,Q.value=-1;return}ye.value=!1;const Y=mt(pe,H),re=Y?.getAttribute("data-column")??null;if(!re){we.value=null,Q.value=-1;return}we.value=re;const fe=Y.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let ze=fe.length;for(let tt=0;tt<fe.length;tt++){const Et=fe[tt].getBoundingClientRect();if(H<Et.top+Et.height/2){ze=tt;break}}Q.value=ze}function Jt(pe){pe.preventDefault(),Me(pe.clientX,pe.clientY),!he&&(he=requestAnimationFrame(()=>{he=null,xe(pe.clientX,pe.clientY)}))}function et(pe){window.removeEventListener("pointermove",Jt),window.removeEventListener("pointerup",et),window.removeEventListener("pointercancel",et),Ae?.releasePointerCapture?.(pe.pointerId),gt(Ae),Ae=null;const H=W.value&&Qt(pe.clientX,pe.clientY);if(h.value&&H)L("delete",{item:h.value});else{const re=mt(pe.clientX,pe.clientY)?.getAttribute("data-column")??null;if(h.value&&re){const fe=h.value[N.columnKey],ze=re,Et=(U.value[ze]||[]).filter(tl=>tl[N.itemKey]!==h.value[N.itemKey]),Se=Math.max(0,Math.min(Q.value,Et.length)),nt=Ke(ze,Se),Ct=h.value[N.itemKey];L("move",{item:h.value,from:fe,to:ze,position:nt,index:Se}),Re&&clearTimeout(Re),K.value={id:Ct,from:fe,to:ze},Re=setTimeout(()=>{K.value=null},3500)}}ge&&(ge.remove(),ge=null),Ye!==null&&(document.body.style.cursor=Ye,Ye=""),Pt()}function lt(pe,H){pe.preventDefault();const Y=pe.target.closest(".dss-dnd-item");if(!Y)return;const re=Y.getBoundingClientRect();Z=pe.clientX-re.left,Oe=pe.clientY-re.top,Ye=document.body.style.cursor,document.body.style.cursor="grabbing",h.value=H,Ae=Y,ke(Y,pe.clientX,pe.clientY),requestAnimationFrame(()=>rt(Y)),Y.setPointerCapture?.(pe.pointerId),window.addEventListener("pointermove",Jt),window.addEventListener("pointerup",et,{once:!0}),window.addEventListener("pointercancel",et,{once:!0})}function yt(){_e&&(window.removeEventListener("pointermove",Rt),window.removeEventListener("pointerup",ct),window.removeEventListener("pointercancel",ct),_e=null)}function Rt(pe){if(!_e||pe.pointerId!==_e.pointerId)return;const H=pe.clientX-_e.startX,Y=pe.clientY-_e.startY;if(Math.abs(H)>=Xe||Math.abs(Y)>=Xe){const re=_e.item;yt(),lt(pe,re)}}function ct(pe){!_e||pe.pointerId!==_e.pointerId||yt()}function xt(pe,H){yt(),_e={item:H,startX:pe.clientX,startY:pe.clientY,pointerId:pe.pointerId},window.addEventListener("pointermove",Rt),window.addEventListener("pointerup",ct),window.addEventListener("pointercancel",ct)}function pt(pe,H){de.value.useHandle||xt(pe,H)}function Xt(pe,H){xt(pe,H)}function kt(){he&&(cancelAnimationFrame(he),he=null)}function Pt(){kt(),h.value=null,we.value=null,ye.value=!1,Q.value=-1}return e.onBeforeUnmount(()=>{kt(),yt(),Re&&clearTimeout(Re),ge&&(ge.remove(),ge=null)}),(pe,H)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":de.value.unstyled}]),style:e.normalizeStyle(dt.value)},[W.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(pe.$slots,"delete-zone",{isDragging:!!h.value,isOver:ye.value})],2),[[e.vShow,!!h.value||de.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.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(ee(Y))},[de.value.showHeader?(e.openBlock(),e.createElementBlock("div",Tp,[e.renderSlot(pe.$slots,"column-header",{column:Y,items:U.value[Y.value]||[]},()=>[e.createElementVNode("span",Dp,e.toDisplayString(Y.title||Y.value),1),e.createElementVNode("span",Ap,e.toDisplayString((U.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(He.value[Y.value],re=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:re.key},[re.type==="indicator"?(e.openBlock(),e.createElementBlock("div",Rp)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":re.isDragged,"dss-dnd-item--no-handle":!de.value.useHandle}]),onPointerdown:fe=>pt(fe,re.item)},[de.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(fe=>Xt(fe,re.item),["stop"])},[e.renderSlot(pe.$slots,"handle",{},()=>[H[0]||(H[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,Ip)):e.createCommentVNode("",!0),e.createElementVNode("div",zp,[e.renderSlot(pe.$slots,"item",{item:re.item,column:Y,justDropped:K.value?.id===re.item[_.itemKey],droppedFrom:K.value?.id===re.item[_.itemKey]?K.value.from:null,droppedTo:K.value?.id===re.item[_.itemKey]?K.value.to:null},()=>[e.createElementVNode("div",Pp,e.toDisplayString(re.item[_.itemKey]),1)])])],42,Fp))],64))),128)),(U.value[Y.value]||[]).length===0&&we.value!=Y.value?(e.openBlock(),e.createElementBlock("div",Op,[e.renderSlot(pe.$slots,"empty",{column:Y},()=>[H[1]||(H[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,Hp)],6))),128))],6))}}),Zp={name:"DSSConfetti"},Up=Object.assign(Zp,{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(_){const J=_,N=e.ref(null),L=e.ref(!1);let oe=[],W=null,A=null;function de(Q,K){const he=[];for(let Re=0;Re<J.count;Re++)he.push(dt(Q));return he}function dt(Q,K){return{x:Math.random()*Q,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:J.colors[Math.floor(Math.random()*J.colors.length)],tilt:Math.floor(Math.random()*10)-10,tiltInc:Math.random()*.08+.04,tiltAngle:0,opacity:Math.random()*.7+.3,speed:Math.random()*4+1.5}}function ee(Q,K,he,Re){Q.clearRect(0,0,K,he);for(const ge of oe)Q.save(),Q.globalAlpha=ge.opacity*Re,Q.beginPath(),Q.lineWidth=ge.r,Q.strokeStyle=ge.color,Q.moveTo(ge.x+ge.tilt+ge.r/2,ge.y),Q.lineTo(ge.x+ge.tilt,ge.y+ge.tilt+ge.r/2),Q.stroke(),Q.restore()}function h(Q,K,he){const Re=.3+he*.7;for(let ge=0;ge<oe.length;ge++){const Ae=oe[ge];Ae.tiltAngle+=Ae.tiltInc,Ae.y+=Ae.speed*Re,Ae.x+=Math.sin(Ae.d)*.5*Re,Ae.tilt=Math.sin(Ae.tiltAngle)*15,he>=.99&&Ae.y>K+20&&(oe[ge]=dt(Q))}}function we(){L.value=!0,e.nextTick(()=>{const Q=N.value;if(!Q)return;const K=Q.getContext("2d"),he=Q.parentElement;if(!he)return;const Re=he.getBoundingClientRect();Q.width=Re.width,Q.height=Re.height,oe=de(Q.width,Q.height);const ge=Date.now(),Ae=ge+J.duration,Z=()=>{const Oe=Date.now(),Ye=Oe-ge;if(Oe<Ae){let _e=1;Ye>J.fadeStart&&(_e=1-(Ye-J.fadeStart)/(J.duration-J.fadeStart)),ee(K,Q.width,Q.height,_e),h(Q.width,Q.height,_e),W=requestAnimationFrame(Z)}else ye()};Z()})}function ye(){W&&(cancelAnimationFrame(W),W=null),oe=[],L.value=!1}return e.watch(()=>J.trigger,Q=>{Q&&(A&&clearTimeout(A),A=setTimeout(we,J.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{ye(),A&&clearTimeout(A)}),(Q,K)=>L.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:N,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),Yp={class:"dss-filter-global-inner"},Xp=["placeholder","value"],jp=["title"],Kp={key:0,class:"dss-filter-funnel-badge"},Gp={key:1,class:"dss-filter-sortby"},Qp=["value"],Jp=["value"],e0=["disabled","title"],t0={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"},l0={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"},n0={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"},o0={class:"dss-filter-panel"},a0={key:0,class:"dss-filter-empty"},s0={class:"dss-filter-row-prefix"},r0={class:"dss-filter-cell"},i0=["onClick"],c0={class:"dss-filter-trigger-text"},u0=["placeholder"],d0={class:"dss-filter-popup-list"},m0=["onClick"],p0={key:0,class:"dss-filter-popup-empty"},v0={key:0,class:"dss-filter-cell"},f0=["onClick"],h0={class:"dss-filter-trigger-text"},g0={class:"dss-filter-popup-list"},y0=["onClick"],k0={key:1,class:"dss-filter-cell dss-filter-cell--value"},C0=["placeholder","onUpdate:modelValue"],b0={key:1,class:"dss-filter-date-wrap"},w0=["placeholder","onUpdate:modelValue"],x0=["placeholder","value","onInput","step"],E0={key:4,class:"dss-filter-between"},S0=["placeholder","value","onInput","step"],V0={class:"dss-filter-between-sep"},N0=["placeholder","value","onInput","step"],B0={key:5,class:"dss-filter-multiselect"},_0=["onClick"],M0={class:"dss-filter-trigger-text"},$0=["placeholder"],L0={class:"dss-filter-popup-list dss-filter-popup-list--check"},T0=["onClick"],D0=["checked"],A0={key:0,class:"dss-filter-popup-empty"},H0=["onClick"],R0={class:"dss-filter-foot"},F0={class:"dss-filter-cell"},I0=["placeholder"],z0={class:"dss-filter-popup-list"},P0=["onClick"],O0={key:0,class:"dss-filter-popup-divider"},W0=["onClick"],q0=["placeholder"],Z0={class:"dss-filter-popup-list"},U0=["onClick"],Y0={key:0,class:"dss-filter-popup-empty"},X0=["placeholder"],j0={class:"dss-filter-popup-list"},K0=["onClick"],G0={key:0,class:"dss-filter-popup-empty"},Q0={name:"DSSFilter"},J0=Object.assign(Q0,{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(_,{expose:J,emit:N}){const{t:L}=ho.useI18n(),oe=_,W=N,A={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},de=e.computed(()=>({...A,...oe.options})),dt={text:[{value:"contains"},{value:"not_contains"},{value:"equals"},{value:"not_equals"},{value:"starts_with"},{value:"ends_with"},{value:"is_empty"},{value:"is_not_empty"}],select:[{value:"is_any_of"},{value:"is_none_of"},{value:"is_empty"},{value:"is_not_empty"}],range:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],int:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],arraySelect:[{value:"contains_any"},{value:"contains_all"},{value:"not_contains_any"},{value:"is_empty"},{value:"is_not_empty"}],arrayText:[{value:"contains"},{value:"not_contains"},{value:"is_empty"},{value:"is_not_empty"}],date:[{value:"eq"},{value:"before"},{value:"after"},{value:"is_empty"},{value:"is_not_empty"}],boolean:[{value:"is_true"},{value:"is_false"},{value:"is_empty"},{value:"is_not_empty"}]},ee=new Set(["is_empty","is_not_empty","is_true","is_false"]),h=["label","name","title","keyword","full_name","value","text"],we=e.ref(""),ye=e.ref([]),Q=e.ref(null),K=e.ref(!1),he=e.ref(null),Re=e.ref(""),ge=e.ref(null),Ae=e.ref(""),Z=e.ref("asc");let Oe=1;function Ye(D){const V=D.find(B=>B&&typeof B=="object");if(!V)return null;for(const B of h)if(B in V&&typeof V[B]=="string")return B;return Object.keys(V).find(B=>typeof V[B]=="string")||null}function _e(D,V){const B=V.filter(ae=>ae!=null&&ae!=="NULL");if(B.length===0)return null;if(B.every(ae=>Array.isArray(ae))){const ae=B.flatMap(je=>je).filter(je=>je!=null);return ae.length===0?null:typeof ae.find(je=>je!=null)=="object"?"arraySelect":"arrayText"}return B.every(ae=>typeof ae=="boolean")?"boolean":B.every(ae=>typeof ae=="number")?new Set(B).size<=de.value.maxUniqueForEnum?"select":"range":B.every(ae=>typeof ae=="string")?new Set(B).size<=de.value.maxUniqueForSelect?"select":"text":B.some(ae=>typeof ae=="object"&&!Array.isArray(ae))?null:"text"}const Xe=e.computed(()=>{if(!oe.data?.length)return[];const D=new Set;for(const se of oe.data)if(se&&typeof se=="object")for(const je of Object.keys(se))D.add(je);const V=new Set(oe.exclude),B=[];for(const se of D){if(V.has(se))continue;const je=oe.config[se]||{},St=oe.data.map(vt=>vt?.[se]),ut=je.type||_e(se,St);if(!ut)continue;const Ge=je.filterMode||"contain",_t=Ge==="date"?"date":Ge==="string"?"text":ut,Nt={key:se,label:je.label||Vt(se),type:_t,filterMode:Ge};if(ut==="select"){const vt=St.filter(Lt=>Lt!=null&&Lt!=="NULL");Nt.uniqueValues=[...new Set(vt)].sort((Lt,Ht)=>typeof Lt=="number"&&typeof Ht=="number"?Lt-Ht:String(Lt).localeCompare(String(Ht)))}else if(ut==="range"||ut==="int"){const vt=St.filter(Lt=>typeof Lt=="number");Nt.min=Math.min(...vt),Nt.max=Math.max(...vt)}else if(ut==="arraySelect"){const vt=je.displayKey||Ye(St.flatMap(Lt=>Array.isArray(Lt)?Lt:[]));if(Nt.displayKey=vt,Array.isArray(je.uniqueValues)&&je.uniqueValues.length>0)Nt.uniqueValues=je.uniqueValues.map(Lt=>String(Lt));else{const Lt=St.flatMap(Ht=>Array.isArray(Ht)?Ht:[]).filter(Ht=>Ht!=null).map(Ht=>vt&&typeof Ht=="object"?Ht[vt]:String(Ht)).filter(Ht=>Ht!=null&&Ht!=="");Nt.uniqueValues=[...new Set(Lt)].sort((Ht,Mt)=>String(Ht).localeCompare(String(Mt)))}}B.push(Nt)}const ae=oe.config._order;return ae&&B.sort((se,je)=>{const St=ae.indexOf(se.key),ut=ae.indexOf(je.key);return St===-1&&ut===-1?0:St===-1?1:ut===-1?-1:St-ut}),B}),U=e.computed(()=>{const D={};for(const V of Xe.value)D[V.key]=V;return D}),He=e.computed(()=>Array.isArray(oe.config.groups)&&oe.config.groups.length>0),Ke=e.computed(()=>{if(!He.value)return[];const D=new Set(Xe.value.map(V=>V.key));return oe.config.groups.map(V=>({...V,keys:V.keys.filter(B=>D.has(B))})).filter(V=>V.keys.length>0)}),ke=e.computed(()=>{if(!He.value)return[];const D=new Set(oe.config.groups.flatMap(V=>V.keys));return Xe.value.filter(V=>!D.has(V.key))}),Me=e.computed(()=>{if(!ge.value)return[];const D=new Set(ge.value.keys),V=Xe.value.filter(ae=>D.has(ae.key));if(!Re.value)return V;const B=Re.value.toLowerCase();return V.filter(ae=>ae.label.toLowerCase().includes(B))}),rt=e.computed(()=>{if(!Re.value)return Xe.value;const D=Re.value.toLowerCase();return Xe.value.filter(V=>V.label.toLowerCase().includes(D))}),gt=e.computed(()=>Xe.value.filter(D=>!["arraySelect","arrayText"].includes(D.type))),mt=e.computed(()=>Ae.value?Z.value==="asc"?"Ascending":"Descending":"No sort selected");function Qt(D){Q.value===D?xe():(Q.value=D,Re.value="",ge.value=null)}function xe(){Q.value=null,Re.value="",ge.value=null}function Jt(D){const V=D.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");Q.value&&!V&&!D.target.closest(".dss-filter-popup")&&!D.target.closest(".dss-filter-trigger")&&!D.target.closest(".dss-filter-add-btn")&&xe(),K.value&&he.value&&!he.value.contains(D.target)&&(V||(K.value=!1))}e.onMounted(()=>document.addEventListener("click",Jt)),e.onBeforeUnmount(()=>document.removeEventListener("click",Jt));function et(D){return U.value[D]?.label||Vt(D)}function lt(D){return U.value[D.key]?.filterMode||"contain"}function yt(D){return L(`filter.operators.${D}`)}function Rt(D){const V=U.value[D.key];return(dt[V?.type]||dt.text).map(B=>({...B,label:L(`filter.operators.${B.value}`)}))}function ct(D){return ee.has(D)}function xt(D){const V=U.value[D.key];return V?V.type==="date"?"date":V.type==="boolean"?"boolean":V.type==="text"||V.type==="arrayText"?"text":V.type==="select"||V.type==="arraySelect"?"multiselect":V.type==="range"||V.type==="int"?D.operator==="between"?"between":"number":"text":"text"}function pt(D){return dt[D]?.[0]?.value||"contains"}function Xt(D,V){return ee.has(V)||D==="date"?null:D==="select"||D==="arraySelect"?[]:(D==="range"||D==="int")&&V==="between"?{min:null,max:null}:D==="range"||D==="int"?null:""}function kt(D){return U.value[D.key]?.uniqueValues||[]}function Pt(D){const V=kt(D);if(!Re.value)return V;const B=Re.value.toLowerCase();return V.filter(ae=>String(ae).toLowerCase().includes(B))}function pe(D){const V=D.value;return!V||V.length===0?L("filter.select"):V.length<=2?V.join(", "):L("filter.selectedCount",{count:V.length})}function H(D){const V=U.value[D],B=V?.filterMode||"contain",ae=V?.type||"text",se=B==="string"?"contains":pt(ae);ye.value.push(e.reactive({id:Oe++,key:D,operator:se,value:Xt(ae,se)})),xe()}function Y(D){ye.value=ye.value.filter(V=>V.id!==D)}function re(D,V){const ae=U.value[V]?.type||"text";D.key=V,D.operator=pt(ae),D.value=Xt(ae,D.operator),xe()}function fe(D,V){const B=xt(D);D.operator=V;const ae=xt(D);if(B!==ae||ee.has(V)){const se=U.value[D.key];D.value=Xt(se?.type||"text",V)}xe()}function ze(D,V){const B=V.target.value;D.value=B===""?null:Number(B)}function tt(D,V,B){const ae=B.target.value,se=ae===""?null:Number(ae);(!D.value||typeof D.value!="object")&&(D.value={min:null,max:null}),D.value={...D.value,[V]:isNaN(se)?null:se}}function Et(D,V){const B=D.value||[],ae=B.indexOf(V);D.value=ae>=0?B.filter(se=>se!==V):[...B,V]}function Se(){ye.value=[],we.value="",xe()}function nt(D){we.value=D.target.value}function Ct(D){Ae.value=D.target.value}function tl(){Z.value=Z.value==="asc"?"desc":"asc"}const ie=e.computed(()=>{if(!oe.data)return[];let D=oe.data;if(we.value){const V=we.value.toLowerCase();D=D.filter(B=>{for(const ae of Object.keys(B)){const se=B[ae];if(typeof se=="string"&&se.toLowerCase().includes(V)||typeof se=="number"&&String(se).includes(V)||Array.isArray(se)&&se.some(je=>je!=null&&(typeof je=="string"?je.toLowerCase().includes(V):typeof je=="object"?Object.values(je).some(St=>typeof St=="string"&&St.toLowerCase().includes(V)):!1)))return!0}return!1})}for(const V of ye.value){if(!ce(V))continue;const B=U.value[V.key];B&&(D=D.filter(ae=>Ve(ae,V,B)))}if(oe.showSortBy&&Ae.value){const V=Ae.value,B=Z.value==="asc"?1:-1;D=[...D].sort((ae,se)=>X(ae?.[V],se?.[V])*B)}return D});function X(D,V){const B=te(D),ae=te(V);return B==null&&ae==null?0:B==null?1:ae==null?-1:typeof B=="number"&&typeof ae=="number"?B-ae:String(B).localeCompare(String(ae),void 0,{numeric:!0,sensitivity:"base"})}function te(D){return D==null||D==="NULL"?null:typeof D=="string"||typeof D=="number"||typeof D=="boolean"?D:D instanceof Date?D.getTime():null}function ce(D){return ee.has(D.operator)?!0:D.value==null||typeof D.value=="string"&&D.value===""||Array.isArray(D.value)&&D.value.length===0?!1:D.value instanceof Date?!isNaN(D.value.getTime()):!(typeof D.value=="object"&&!Array.isArray(D.value)&&D.value.min==null&&D.value.max==null)}function Ve(D,V,B){const ae=D?.[V.key],se=V.value,je=V.operator;if(je==="is_empty")return dl(ae);if(je==="is_not_empty")return!dl(ae);const St=B.type;if(St==="text"||St==="arrayText"){const ut=St==="arrayText"&&Array.isArray(ae)?ae.filter(Nt=>Nt!=null).map(String).join(" "):ae!=null?String(ae):"",Ge=String(se).toLowerCase(),_t=ut.toLowerCase();switch(je){case"contains":return _t.includes(Ge);case"not_contains":return!_t.includes(Ge);case"equals":return _t===Ge;case"not_equals":return _t!==Ge;case"starts_with":return _t.startsWith(Ge);case"ends_with":return _t.endsWith(Ge);default:return!0}}if(St==="select")switch(je){case"is_any_of":return se.includes(ae);case"is_none_of":return!se.includes(ae);default:return!0}if(St==="range"||St==="int"){const ut=typeof ae=="number"?ae:Number(ae);if(typeof ut!="number"||isNaN(ut))return!1;if(je==="between"){const _t=se?.min!=null?Number(se.min):null,Nt=se?.max!=null?Number(se.max):null,vt=_t!=null&&!isNaN(_t)?_t:null,Lt=Nt!=null&&!isNaN(Nt)?Nt:null;return(vt==null||ut>=vt)&&(Lt==null||ut<=Lt)}const Ge=typeof se=="number"&&!isNaN(se)?se:Number(se);if(je==="contains"||je==="not_contains"){const _t=String(ut),Nt=String(se??"").toLowerCase(),vt=_t.toLowerCase().includes(Nt);return je==="contains"?vt:!vt}if(typeof Ge!="number"||isNaN(Ge))return!1;switch(je){case"eq":return ut===Ge;case"neq":return ut!==Ge;case"gt":return ut>Ge;case"gte":return ut>=Ge;case"lt":return ut<Ge;case"lte":return ut<=Ge;default:return!0}}if(St==="arraySelect"){if(!Array.isArray(ae))return!1;const ut=ae.filter(Ge=>Ge!=null).map(Ge=>B.displayKey&&typeof Ge=="object"?Ge[B.displayKey]:String(Ge));switch(je){case"contains_any":return ut.some(Ge=>se.includes(Ge));case"contains_all":return se.every(Ge=>ut.includes(Ge));case"not_contains_any":return!ut.some(Ge=>se.includes(Ge));default:return!0}}if(St==="date"){const ut=ot(se);if(!ut||isNaN(ut.getTime()))return!1;const Ge=ot(ae);if(!Ge||isNaN(Ge.getTime()))return!1;const _t=wt(Ge),Nt=wt(ut);switch(je){case"eq":return _t===Nt;case"before":return _t<Nt;case"after":return _t>Nt;default:return!0}}if(St==="boolean"){const ut=ae===!0||ae==="true"||ae===1,Ge=ae===!1||ae==="false"||ae===0;switch(je){case"is_true":return ut;case"is_false":return Ge;default:return!0}}return!0}function ot(D){if(D==null)return null;if(D instanceof Date)return isNaN(D.getTime())?null:D;if(typeof D=="number")return new Date(D>1e10?D:D*1e3);if(typeof D=="string"){const V=new Date(D);return isNaN(V.getTime())?null:V}return null}function wt(D){const V=D.getFullYear(),B=String(D.getMonth()+1).padStart(2,"0"),ae=String(D.getDate()).padStart(2,"0");return`${V}-${B}-${ae}`}function dl(D){return!!(D==null||D===""||D==="NULL"||Array.isArray(D)&&D.length===0||Array.isArray(D)&&D.every(V=>V==null))}e.watch(ie,D=>W("update:modelValue",D),{immediate:!0}),e.watch(()=>oe.data,()=>{ye.value=[],we.value="",K.value=!1,Ae.value="",Z.value="asc",xe()});function Vt(D){return D.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,V=>V.toUpperCase())}function sl(){const D=V=>{if(V==null)return V;if(V instanceof Date)return{_type:"Date",value:V.toISOString(),local:V.toLocaleDateString()};if(Array.isArray(V))return V.map(D);if(typeof V=="object"&&!Array.isArray(V)){const B={};for(const ae of Object.keys(V))B[ae]=D(V[ae]);return B}return V};return{globalSearch:we.value,rows:ye.value.map(V=>({key:V.key,operator:V.operator,value:D(V.value),defType:U.value[V.key]?.type,defFilterMode:U.value[V.key]?.filterMode})),filteredCount:ie.value?.length??0}}return J({getDebugState:sl}),(D,V)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":de.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:he},[e.createElementVNode("div",Yp,[V[20]||(V[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(L)("filter.searchAcrossFields"),value:we.value,onInput:nt},null,40,Xp),we.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:V[0]||(V[0]=B=>we.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:K.value||ye.value.length>0,"dss-filter-funnel-btn--with-sort":oe.showSortBy}]),onClick:V[1]||(V[1]=B=>K.value=!K.value),type:"button",title:K.value?e.unref(L)("filter.closeAdvancedFilter"):e.unref(L)("filter.openAdvancedFilter")},[V[14]||(V[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",Kp,e.toDisplayString(ye.value.length),1)):e.createCommentVNode("",!0)],10,jp),oe.showSortBy?(e.openBlock(),e.createElementBlock("div",Gp,[V[19]||(V[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:Ae.value,onChange:Ct},[V[15]||(V[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gt.value,B=>(e.openBlock(),e.createElementBlock("option",{key:B.key,value:B.key},e.toDisplayString(B.label),9,Jp))),128))],40,Qp),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:tl,disabled:!Ae.value,title:mt.value},[Ae.value?Z.value==="asc"?(e.openBlock(),e.createElementBlock("svg",l0,[...V[17]||(V[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",n0,[...V[18]||(V[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",t0,[...V[16]||(V[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,e0)])):e.createCommentVNode("",!0)]),K.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:V[13]||(V[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",o0,[ye.value.length===0?(e.openBlock(),e.createElementBlock("div",a0,e.toDisplayString(e.unref(L)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ye.value,(B,ae)=>(e.openBlock(),e.createElementBlock("div",{key:B.id,class:"dss-filter-row"},[e.createElementVNode("span",s0,e.toDisplayString(ae===0?e.unref(L)("filter.where"):e.unref(L)("filter.and")),1),e.createElementVNode("div",r0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(se=>Qt(`${B.id}:field`),["stop"])},[e.createElementVNode("span",c0,e.toDisplayString(et(B.key)),1),V[21]||(V[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,i0),Q.value===`${B.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:V[3]||(V[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":V[2]||(V[2]=se=>Re.value=se),placeholder:e.unref(L)("filter.searchAttributes")},null,8,u0),[[e.vModelText,Re.value]]),e.createElementVNode("ul",d0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(rt.value,se=>(e.openBlock(),e.createElementBlock("li",{key:se.key,class:"dss-filter-popup-item",onClick:je=>re(B,se.key)},e.toDisplayString(se.label),9,m0))),128)),rt.value.length===0?(e.openBlock(),e.createElementBlock("li",p0,e.toDisplayString(e.unref(L)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),lt(B)==="contain"||lt(B)==="date"?(e.openBlock(),e.createElementBlock("div",v0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(se=>Qt(`${B.id}:op`),["stop"])},[e.createElementVNode("span",h0,e.toDisplayString(yt(B.operator)),1),V[22]||(V[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,f0),Q.value===`${B.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:V[4]||(V[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",g0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rt(B),se=>(e.openBlock(),e.createElementBlock("li",{key:se.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:B.operator===se.value}]),onClick:je=>fe(B,se.value)},e.toDisplayString(se.label),11,y0))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),ct(B.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",k0,[lt(B)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.enterValue"),"onUpdate:modelValue":se=>B.value=se},null,8,C0)),[[e.vModelText,B.value]]):lt(B)==="date"?(e.openBlock(),e.createElementBlock("div",b0,[e.createVNode(ga,{mode:"single",modelValue:B.value,"onUpdate:modelValue":se=>B.value=se},null,8,["modelValue","onUpdate:modelValue"])])):xt(B)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.enterValue"),"onUpdate:modelValue":se=>B.value=se},null,8,w0)),[[e.vModelText,B.value]]):xt(B)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.enterValue"),value:B.value,onInput:se=>ze(B,se),step:U.value[B.key]?.type==="int"?1:void 0},null,40,x0)):xt(B)==="between"?(e.openBlock(),e.createElementBlock("div",E0,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.min"),value:B.value?.min,onInput:se=>tt(B,"min",se),step:U.value[B.key]?.type==="int"?1:void 0},null,40,S0),e.createElementVNode("span",V0,e.toDisplayString(e.unref(L)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.max"),value:B.value?.max,onInput:se=>tt(B,"max",se),step:U.value[B.key]?.type==="int"?1:void 0},null,40,N0)])):xt(B)==="multiselect"?(e.openBlock(),e.createElementBlock("div",B0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(se=>Qt(`${B.id}:val`),["stop"])},[e.createElementVNode("span",M0,e.toDisplayString(pe(B)),1),V[23]||(V[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,_0),Q.value===`${B.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:V[6]||(V[6]=e.withModifiers(()=>{},["stop"]))},[kt(B).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":V[5]||(V[5]=se=>Re.value=se),placeholder:e.unref(L)("filter.search")},null,8,$0)),[[e.vModelText,Re.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",L0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pt(B),se=>(e.openBlock(),e.createElementBlock("li",{key:se,class:"dss-filter-popup-item",onClick:je=>Et(B,se)},[e.createElementVNode("input",{type:"checkbox",checked:(B.value||[]).includes(se),tabindex:"-1"},null,8,D0),e.createElementVNode("span",null,e.toDisplayString(se),1)],8,T0))),128)),Pt(B).length===0?(e.openBlock(),e.createElementBlock("li",A0,e.toDisplayString(e.unref(L)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:se=>Y(B.id)},[...V[24]||(V[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,H0)]))),128)),e.createElementVNode("div",R0,[e.createElementVNode("div",F0,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:V[7]||(V[7]=e.withModifiers(B=>Qt("add"),["stop"]))},e.toDisplayString(e.unref(L)("filter.addFilter")),1),Q.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:V[12]||(V[12]=e.withModifiers(()=>{},["stop"]))},[He.value&&!ge.value&&!Re.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":V[8]||(V[8]=B=>Re.value=B),placeholder:e.unref(L)("filter.searchAttributes")},null,8,I0),[[e.vModelText,Re.value]]),e.createElementVNode("ul",z0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke.value,B=>(e.openBlock(),e.createElementBlock("li",{key:B.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:ae=>ge.value=B},[e.createElementVNode("span",null,e.toDisplayString(B.label),1),V[25]||(V[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,P0))),128)),ke.value.length>0?(e.openBlock(),e.createElementBlock("li",O0)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ke.value,B=>(e.openBlock(),e.createElementBlock("li",{key:B.key,class:"dss-filter-popup-item",onClick:ae=>H(B.key)},e.toDisplayString(B.label),9,W0))),128))])],64)):ge.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:V[9]||(V[9]=B=>ge.value=null)},[V[26]||(V[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(ge.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":V[10]||(V[10]=B=>Re.value=B),placeholder:e.unref(L)("filter.searchAttributes")},null,8,q0),[[e.vModelText,Re.value]]),e.createElementVNode("ul",Z0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Me.value,B=>(e.openBlock(),e.createElementBlock("li",{key:B.key,class:"dss-filter-popup-item",onClick:ae=>H(B.key)},e.toDisplayString(B.label),9,U0))),128)),Me.value.length===0?(e.openBlock(),e.createElementBlock("li",Y0,e.toDisplayString(e.unref(L)("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":V[11]||(V[11]=B=>Re.value=B),placeholder:e.unref(L)("filter.searchAttributes")},null,8,X0),[[e.vModelText,Re.value]]),e.createElementVNode("ul",j0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(rt.value,B=>(e.openBlock(),e.createElementBlock("li",{key:B.key,class:"dss-filter-popup-item",onClick:ae=>H(B.key)},e.toDisplayString(B.label),9,K0))),128)),rt.value.length===0?(e.openBlock(),e.createElementBlock("li",G0,e.toDisplayString(e.unref(L)("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:Se},e.toDisplayString(e.unref(L)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),e9={class:"dss-pill-field__pills"},t9=["data-value"],l9=["disabled"],n9={class:"dss-pill-field__pill-text"},o9={key:0,class:"dss-pill-field__pill-actions"},a9=["onClick"],s9=["onClick"],r9=["placeholder","disabled"],i9=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(_,{emit:J}){const N=_,L=J,oe=e.ref(""),W=e.ref([...N.modelValue]),A=e.ref(null);let de=null;const dt=e.ref(null),ee=e.ref(""),h=e.ref(null),we=e.ref(null),ye=e.computed(()=>{if(!we.value)return;const{width:He,height:Ke}=we.value;return{minWidth:`${He}px`,height:`${Ke}px`}});function Q(He,Ke){dt.value===Ke&&(h.value=He)}function K(){dt.value=null,ee.value="",we.value=null,h.value=null}const he=e.computed(()=>new Set(W.value.map(He=>He.trim()).filter(Boolean)));function Re(He){A.value=He,de&&clearTimeout(de),de=setTimeout(()=>{A.value=null,de=null},900)}function ge(He){const Ke=He.trim();return Ke?he.value.has(Ke)?(Re(Ke),!1):(W.value=[...W.value,Ke],L("update:modelValue",[...W.value]),!0):!1}function Ae(He){const Ke=He.split(/\r?\n/g).map(gt=>gt.trim()).filter(Boolean);if(!Ke.length)return;const ke=new Set(W.value.map(gt=>gt.trim()).filter(Boolean)),Me=[...W.value];let rt=null;for(const gt of Ke){if(ke.has(gt)){rt??=gt;continue}ke.add(gt),Me.push(gt)}Me.length!==W.value.length&&(W.value=Me,L("update:modelValue",[...W.value])),rt&&Re(rt)}function Z(He){N.disabled||(dt.value===He&&K(),W.value=W.value.filter((Ke,ke)=>ke!==He),L("update:modelValue",[...W.value]))}async function Oe(He,Ke){if(N.disabled)return;const ke=Ke.currentTarget.closest(".dss-pill-field__pill");ke&&(we.value={width:ke.offsetWidth,height:ke.offsetHeight}),dt.value=He,ee.value=W.value[He]??"",await e.nextTick();const Me=h.value;if(!Me)return;Me.focus();const rt=Me.value.length;Me.setSelectionRange(rt,rt)}function Ye(){K()}function _e(){if(N.disabled||dt.value===null)return;const He=dt.value,Ke=W.value[He]??"",ke=ee.value.trim();if(K(),ke!==Ke&&he.value.has(ke)){Re(ke);return}if(!ke){W.value=W.value.filter((rt,gt)=>gt!==He),L("update:modelValue",[...W.value]);return}const Me=W.value.map((rt,gt)=>gt===He?ke:rt);W.value=Me,L("update:modelValue",[...W.value])}function Xe(He){He.preventDefault(),!N.disabled&&(ge(oe.value),oe.value="")}function U(He){if(N.disabled)return;const Ke=He.clipboardData?.getData("text")??"";!Ke.includes(`
120
- `)&&!Ke.includes("\r")||(He.preventDefault(),Ae(Ke),oe.value="")}return e.watch(()=>N.modelValue,He=>{W.value=Array.isArray(He)?[...He]:[]},{deep:!0}),e.onBeforeUnmount(()=>{de&&clearTimeout(de)}),(He,Ke)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":He.disabled}])},[e.createElementVNode("div",e9,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(W.value,(ke,Me)=>(e.openBlock(),e.createElementBlock("span",{key:ke,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":A.value===ke,"dss-pill-field__pill--editing":dt.value===Me}]),style:e.normalizeStyle(dt.value===Me&&we.value?ye.value:void 0)},[dt.value===Me?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-pill-field__pill-edit-wrap","data-value":ee.value||" "},[e.withDirectives(e.createElementVNode("input",{ref_for:!0,ref:rt=>Q(rt,Me),"onUpdate:modelValue":Ke[0]||(Ke[0]=rt=>ee.value=rt),class:"dss-pill-field__pill-edit",type:"text",disabled:He.disabled,onKeydown:[e.withKeys(_e,["enter"]),e.withKeys(Ye,["esc"])],onBlur:_e},null,40,l9),[[e.vModelText,ee.value]])],8,t9)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",n9,e.toDisplayString(ke),1),He.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",o9,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:rt=>Oe(Me,rt)},[...Ke[2]||(Ke[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,a9),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:rt=>Z(Me)}," × ",8,s9)]))],64))],6))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Ke[1]||(Ke[1]=ke=>oe.value=ke),class:"dss-pill-field__input",type:"text",placeholder:W.value.length?"":He.placeholder,disabled:He.disabled,onPaste:U,onKeydown:e.withKeys(Xe,["enter"])},null,40,r9),[[e.vModelText,oe.value]])])],2))}}),c9={key:0,class:"dss-title dss-title--separator"},u9={__name:"DSSTitle",props:{type:{type:String,default:"main",validator:_=>["main","separator","subtitle"].includes(_)},h:{type:Number,default:null,validator:_=>_===null||Number.isInteger(_)&&_>=1&&_<=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(_,{expose:J,emit:N}){const L=_,oe=N,W=e.ref(null),A=e.computed(()=>`dss-title--${L.type}`),de=e.computed(()=>L.h!=null?`dss-title--h${L.h}`:null),dt={main:"div",subtitle:"p",separator:"span"},ee=e.computed(()=>L.h!=null?`h${L.h}`:dt[L.type]??"div"),h=e.computed(()=>L.editable?"plaintext-only":void 0),we=e.computed(()=>{const ge={};return L.size!=null&&(ge.fontSize=typeof L.size=="number"?`${L.size}px`:L.size),L.weight!=null&&(ge.fontWeight=L.weight),L.color!=null&&(ge.color=L.color),Object.keys(ge).length?ge:void 0}),ye=e.computed(()=>L.editable?{input:K,keydown:he,paste:Re}:{}),Q=()=>{const ge=W.value;!L.editable||!ge||document.activeElement!==ge&&(ge.innerText=L.modelValue??"")},K=ge=>{const Ae=ge.target.innerText;oe("update:modelValue",Ae),oe("change",Ae)},he=ge=>{ge.key==="Enter"&&ge.preventDefault()},Re=ge=>{ge.preventDefault();const Ae=(ge.clipboardData||window.clipboardData).getData("text/plain");document.execCommand("insertText",!1,Ae)};return e.watch(()=>L.modelValue,()=>{Q()}),e.watch(()=>L.editable,()=>{e.nextTick(Q)}),e.onMounted(()=>{e.nextTick(Q)}),J({focus:()=>W.value?.focus()}),(ge,Ae)=>_.type==="separator"?(e.openBlock(),e.createElementBlock("div",c9,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(ee.value),e.mergeProps({ref_key:"titleRef",ref:W,class:["dss-title__separator-label",de.value,{"dss-title--editable":_.editable}],style:we.value,contenteditable:h.value,spellcheck:_.editable?!1:void 0},e.toHandlers(ye.value)),{default:e.withCtx(()=>[_.editable?e.createCommentVNode("",!0):e.renderSlot(ge.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(_.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(ee.value),e.mergeProps({key:1,ref_key:"titleRef",ref:W,class:["dss-title",[A.value,de.value,{"dss-title--editable":_.editable}]],style:we.value,contenteditable:h.value,spellcheck:_.editable?!1:void 0},e.toHandlers(ye.value)),{default:e.withCtx(()=>[_.editable?e.createCommentVNode("",!0):e.renderSlot(ge.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(_.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))}},d9={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"}},m9={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"},p9={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"}},v9={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",comparison:{compareTo:"Compare to",active:"Comparison",previousPeriod:"Previous period",previousYear:"Previous year",custom:"Custom"},quickSelect:{today:"Today",lastWeek:"Last week",last15Days:"Last 15 days",last30Days:"Last 30 days",thisMonth:"This month",lastMonth:"Last 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"}},f9={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"}},go={chart:d9,table:m9,filter:p9,datepicker:v9,textEditor:f9},h9={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"}},g9={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"},y9={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"}},k9={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",comparison:{compareTo:"Comparer à",active:"Comparaison",previousPeriod:"Période précédente",previousYear:"Année précédente",custom:"Personnalisée"},quickSelect:{today:"Aujourd'hui",lastWeek:"Dernière semaine",last15Days:"15 derniers jours",last30Days:"30 derniers jours",thisMonth:"Ce mois",lastMonth:"Mois dernier",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"}},C9={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"}},yo={chart:h9,table:g9,filter:y9,datepicker:k9,textEditor:C9},b9={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"}},w9={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"},x9={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"}},E9={selectDate:"Selecteer datum",selectRange:"Selecteer bereik",selectFromList:"Selecteer een datum",noAvailableDates:"Geen datums beschikbaar",startDate:"Startdatum",endDate:"Einddatum",prevMonth:"Vorige maand",nextMonth:"Volgende maand",comparison:{compareTo:"Vergelijken met",active:"Vergelijking",previousPeriod:"Vorige periode",previousYear:"Vorig jaar",custom:"Aangepast"},quickSelect:{today:"Vandaag",lastWeek:"Afgelopen week",last15Days:"Laatste 15 dagen",last30Days:"Laatste 30 dagen",thisMonth:"Deze maand",lastMonth:"Vorige 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"}},S9={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"}},ko={chart:b9,table:w9,filter:x9,datepicker:E9,textEditor:S9},qo={en:go,fr:yo,nl:ko};function Fa(_){if(!_||!_.global)return;const J=_.global.availableLocales||[];Object.keys(qo).forEach(N=>{J.includes(N)&&_.global.mergeLocaleMessage(N,qo[N])})}const Zo={en:{textEditor:go.textEditor},fr:{textEditor:yo.textEditor},nl:{textEditor:ko.textEditor}};function Ia(_){if(!_||!_.global)return;const J=_.global.availableLocales||[];Object.keys(Zo).forEach(N=>{J.includes(N)&&_.global.mergeLocaleMessage(N,Zo[N])})}const Uo={en:{table:go.table},fr:{table:yo.table},nl:{table:ko.table}};function za(_){if(!_||!_.global)return;const J=_.global.availableLocales||[];Object.keys(Uo).forEach(N=>{J.includes(N)&&_.global.mergeLocaleMessage(N,Uo[N])})}const Yo={en:{datepicker:go.datepicker},fr:{datepicker:yo.datepicker},nl:{datepicker:ko.datepicker}};function Pa(_){if(!_||!_.global)return;const J=_.global.availableLocales||[];Object.keys(Yo).forEach(N=>{J.includes(N)&&_.global.mergeLocaleMessage(N,Yo[N])})}const Xo={en:{filter:go.filter},fr:{filter:yo.filter},nl:{filter:ko.filter}};function Oa(_){if(!_||!_.global)return;const J=_.global.availableLocales||[];Object.keys(Xo).forEach(N=>{J.includes(N)&&_.global.mergeLocaleMessage(N,Xo[N])})}const V9={chart:qo,textEditor:Zo,table:Uo,datepicker:Yo,filter:Xo};function N9(_){!_||!_.global||(Fa(_),Ia(_),za(_),Pa(_),Oa(_))}const B9={en:{...go},fr:{...yo},nl:{...ko}};ho.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:B9});exports.DSSChart=Mu;exports.DSSChartMessages=qo;exports.DSSColorPicker=yp;exports.DSSConfetti=Up;exports.DSSDatepicker=ga;exports.DSSDatepickerMessages=Yo;exports.DSSDnd=qp;exports.DSSFilter=J0;exports.DSSFilterMessages=Xo;exports.DSSLoader=$p;exports.DSSMessages=V9;exports.DSSModal=ha;exports.DSSPillField=i9;exports.DSSSkeleton=Lp;exports.DSSStepBar=Ra;exports.DSSTable=Qd;exports.DSSTableMessages=Uo;exports.DSSTextEditor=lp;exports.DSSTextEditorMessages=Zo;exports.DSSTitle=u9;exports.addDSSChartTranslations=Fa;exports.addDSSDatepickerTranslations=Pa;exports.addDSSFilterTranslations=Oa;exports.addDSSTableTranslations=za;exports.addDSSTextEditorTranslations=Ia;exports.addDSSTranslations=N9;
119
+ `,document.body.appendChild(fe),ge=fe}function Me(pe,H){ge&&(ge.style.left=`${pe-Z}px`,ge.style.top=`${H-ze}px`)}function rt(pe){pe.classList.add("dss-dnd-item--dragging"),pe.style.background=de.value.dragSourceBackground,pe.style.borderColor=de.value.dragSourceBorder,pe.style.transform="scale(0.97)"}function yt(pe){pe.classList.remove("dss-dnd-item--dragging"),pe.style.background="",pe.style.borderColor="",pe.style.transform=""}function mt(pe,H){return document.elementFromPoint(pe,H)?.closest(".dss-dnd-column-body")??null}function Qt(pe,H){return!!document.elementFromPoint(pe,H)?.closest("[data-dss-dnd-delete-zone]")}function xe(pe,H){if(W.value&&Qt(pe,H)){ye.value=!0,we.value=null,Q.value=-1;return}ye.value=!1;const Y=mt(pe,H),ie=Y?.getAttribute("data-column")??null;if(!ie){we.value=null,Q.value=-1;return}we.value=ie;const fe=Y.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let Fe=fe.length;for(let tt=0;tt<fe.length;tt++){const Et=fe[tt].getBoundingClientRect();if(H<Et.top+Et.height/2){Fe=tt;break}}Q.value=Fe}function Jt(pe){pe.preventDefault(),Me(pe.clientX,pe.clientY),!he&&(he=requestAnimationFrame(()=>{he=null,xe(pe.clientX,pe.clientY)}))}function et(pe){window.removeEventListener("pointermove",Jt),window.removeEventListener("pointerup",et),window.removeEventListener("pointercancel",et),Ae?.releasePointerCapture?.(pe.pointerId),yt(Ae),Ae=null;const H=W.value&&Qt(pe.clientX,pe.clientY);if(h.value&&H)L("delete",{item:h.value});else{const ie=mt(pe.clientX,pe.clientY)?.getAttribute("data-column")??null;if(h.value&&ie){const fe=h.value[N.columnKey],Fe=ie,Et=(U.value[Fe]||[]).filter(el=>el[N.itemKey]!==h.value[N.itemKey]),Se=Math.max(0,Math.min(Q.value,Et.length)),ot=Ke(Fe,Se),bt=h.value[N.itemKey];L("move",{item:h.value,from:fe,to:Fe,position:ot,index:Se}),Re&&clearTimeout(Re),K.value={id:bt,from:fe,to:Fe},Re=setTimeout(()=>{K.value=null},3500)}}ge&&(ge.remove(),ge=null),Ye!==null&&(document.body.style.cursor=Ye,Ye=""),Pt()}function lt(pe,H){pe.preventDefault();const Y=pe.target.closest(".dss-dnd-item");if(!Y)return;const ie=Y.getBoundingClientRect();Z=pe.clientX-ie.left,ze=pe.clientY-ie.top,Ye=document.body.style.cursor,document.body.style.cursor="grabbing",h.value=H,Ae=Y,ke(Y,pe.clientX,pe.clientY),requestAnimationFrame(()=>rt(Y)),Y.setPointerCapture?.(pe.pointerId),window.addEventListener("pointermove",Jt),window.addEventListener("pointerup",et,{once:!0}),window.addEventListener("pointercancel",et,{once:!0})}function kt(){_e&&(window.removeEventListener("pointermove",Rt),window.removeEventListener("pointerup",ct),window.removeEventListener("pointercancel",ct),_e=null)}function Rt(pe){if(!_e||pe.pointerId!==_e.pointerId)return;const H=pe.clientX-_e.startX,Y=pe.clientY-_e.startY;if(Math.abs(H)>=Xe||Math.abs(Y)>=Xe){const ie=_e.item;kt(),lt(pe,ie)}}function ct(pe){!_e||pe.pointerId!==_e.pointerId||kt()}function ht(pe,H){kt(),_e={item:H,startX:pe.clientX,startY:pe.clientY,pointerId:pe.pointerId},window.addEventListener("pointermove",Rt),window.addEventListener("pointerup",ct),window.addEventListener("pointercancel",ct)}function pt(pe,H){de.value.useHandle||ht(pe,H)}function Xt(pe,H){ht(pe,H)}function Ct(){he&&(cancelAnimationFrame(he),he=null)}function Pt(){Ct(),h.value=null,we.value=null,ye.value=!1,Q.value=-1}return e.onBeforeUnmount(()=>{Ct(),kt(),Re&&clearTimeout(Re),ge&&(ge.remove(),ge=null)}),(pe,H)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":de.value.unstyled}]),style:e.normalizeStyle(dt.value)},[W.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(pe.$slots,"delete-zone",{isDragging:!!h.value,isOver:ye.value})],2),[[e.vShow,!!h.value||de.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.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(ee(Y))},[de.value.showHeader?(e.openBlock(),e.createElementBlock("div",Hp,[e.renderSlot(pe.$slots,"column-header",{column:Y,items:U.value[Y.value]||[]},()=>[e.createElementVNode("span",Rp,e.toDisplayString(Y.title||Y.value),1),e.createElementVNode("span",Fp,e.toDisplayString((U.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(He.value[Y.value],ie=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ie.key},[ie.type==="indicator"?(e.openBlock(),e.createElementBlock("div",zp)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":ie.isDragged,"dss-dnd-item--no-handle":!de.value.useHandle}]),onPointerdown:fe=>pt(fe,ie.item)},[de.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(fe=>Xt(fe,ie.item),["stop"])},[e.renderSlot(pe.$slots,"handle",{},()=>[H[0]||(H[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,Op)):e.createCommentVNode("",!0),e.createElementVNode("div",Wp,[e.renderSlot(pe.$slots,"item",{item:ie.item,column:Y,justDropped:K.value?.id===ie.item[_.itemKey],droppedFrom:K.value?.id===ie.item[_.itemKey]?K.value.from:null,droppedTo:K.value?.id===ie.item[_.itemKey]?K.value.to:null},()=>[e.createElementVNode("div",qp,e.toDisplayString(ie.item[_.itemKey]),1)])])],42,Pp))],64))),128)),(U.value[Y.value]||[]).length===0&&we.value!=Y.value?(e.openBlock(),e.createElementBlock("div",Zp,[e.renderSlot(pe.$slots,"empty",{column:Y},()=>[H[1]||(H[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,Ip)],6))),128))],6))}}),Xp={name:"DSSConfetti"},jp=Object.assign(Xp,{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(_){const J=_,N=e.ref(null),L=e.ref(!1);let oe=[],W=null,A=null;function de(Q,K){const he=[];for(let Re=0;Re<J.count;Re++)he.push(dt(Q));return he}function dt(Q,K){return{x:Math.random()*Q,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:J.colors[Math.floor(Math.random()*J.colors.length)],tilt:Math.floor(Math.random()*10)-10,tiltInc:Math.random()*.08+.04,tiltAngle:0,opacity:Math.random()*.7+.3,speed:Math.random()*4+1.5}}function ee(Q,K,he,Re){Q.clearRect(0,0,K,he);for(const ge of oe)Q.save(),Q.globalAlpha=ge.opacity*Re,Q.beginPath(),Q.lineWidth=ge.r,Q.strokeStyle=ge.color,Q.moveTo(ge.x+ge.tilt+ge.r/2,ge.y),Q.lineTo(ge.x+ge.tilt,ge.y+ge.tilt+ge.r/2),Q.stroke(),Q.restore()}function h(Q,K,he){const Re=.3+he*.7;for(let ge=0;ge<oe.length;ge++){const Ae=oe[ge];Ae.tiltAngle+=Ae.tiltInc,Ae.y+=Ae.speed*Re,Ae.x+=Math.sin(Ae.d)*.5*Re,Ae.tilt=Math.sin(Ae.tiltAngle)*15,he>=.99&&Ae.y>K+20&&(oe[ge]=dt(Q))}}function we(){L.value=!0,e.nextTick(()=>{const Q=N.value;if(!Q)return;const K=Q.getContext("2d"),he=Q.parentElement;if(!he)return;const Re=he.getBoundingClientRect();Q.width=Re.width,Q.height=Re.height,oe=de(Q.width,Q.height);const ge=Date.now(),Ae=ge+J.duration,Z=()=>{const ze=Date.now(),Ye=ze-ge;if(ze<Ae){let _e=1;Ye>J.fadeStart&&(_e=1-(Ye-J.fadeStart)/(J.duration-J.fadeStart)),ee(K,Q.width,Q.height,_e),h(Q.width,Q.height,_e),W=requestAnimationFrame(Z)}else ye()};Z()})}function ye(){W&&(cancelAnimationFrame(W),W=null),oe=[],L.value=!1}return e.watch(()=>J.trigger,Q=>{Q&&(A&&clearTimeout(A),A=setTimeout(we,J.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{ye(),A&&clearTimeout(A)}),(Q,K)=>L.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:N,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),Kp={class:"dss-filter-global-inner"},Gp=["placeholder","value"],Qp=["title"],Jp={key:0,class:"dss-filter-funnel-badge"},e0={key:1,class:"dss-filter-sortby"},t0=["value"],l0=["value"],n0=["disabled","title"],o0={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"},a0={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"},s0={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"},r0={class:"dss-filter-panel"},i0={key:0,class:"dss-filter-empty"},c0={class:"dss-filter-row-prefix"},u0={class:"dss-filter-cell"},d0=["onClick"],m0={class:"dss-filter-trigger-text"},p0=["placeholder"],v0={class:"dss-filter-popup-list"},f0=["onClick"],h0={key:0,class:"dss-filter-popup-empty"},g0={key:0,class:"dss-filter-cell"},y0=["onClick"],k0={class:"dss-filter-trigger-text"},C0={class:"dss-filter-popup-list"},b0=["onClick"],w0={key:1,class:"dss-filter-cell dss-filter-cell--value"},x0=["placeholder","onUpdate:modelValue"],E0={key:1,class:"dss-filter-date-wrap"},S0=["placeholder","onUpdate:modelValue"],V0=["placeholder","value","onInput","step"],N0={key:4,class:"dss-filter-between"},B0=["placeholder","value","onInput","step"],_0={class:"dss-filter-between-sep"},M0=["placeholder","value","onInput","step"],$0={key:5,class:"dss-filter-multiselect"},L0=["onClick"],T0={class:"dss-filter-trigger-text"},D0=["placeholder"],A0={class:"dss-filter-popup-list dss-filter-popup-list--check"},H0=["onClick"],R0=["checked"],F0={key:0,class:"dss-filter-popup-empty"},I0=["onClick"],z0={class:"dss-filter-foot"},P0={class:"dss-filter-cell"},O0=["placeholder"],W0={class:"dss-filter-popup-list"},q0=["onClick"],Z0={key:0,class:"dss-filter-popup-divider"},U0=["onClick"],Y0=["placeholder"],X0={class:"dss-filter-popup-list"},j0=["onClick"],K0={key:0,class:"dss-filter-popup-empty"},G0=["placeholder"],Q0={class:"dss-filter-popup-list"},J0=["onClick"],e9={key:0,class:"dss-filter-popup-empty"},t9={name:"DSSFilter"},l9=Object.assign(t9,{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(_,{expose:J,emit:N}){const{t:L}=ho.useI18n(),oe=_,W=N,A={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},de=e.computed(()=>({...A,...oe.options})),dt={text:[{value:"contains"},{value:"not_contains"},{value:"equals"},{value:"not_equals"},{value:"starts_with"},{value:"ends_with"},{value:"is_empty"},{value:"is_not_empty"}],select:[{value:"is_any_of"},{value:"is_none_of"},{value:"is_empty"},{value:"is_not_empty"}],range:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],int:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],arraySelect:[{value:"contains_any"},{value:"contains_all"},{value:"not_contains_any"},{value:"is_empty"},{value:"is_not_empty"}],arrayText:[{value:"contains"},{value:"not_contains"},{value:"is_empty"},{value:"is_not_empty"}],date:[{value:"eq"},{value:"before"},{value:"after"},{value:"is_empty"},{value:"is_not_empty"}],boolean:[{value:"is_true"},{value:"is_false"},{value:"is_empty"},{value:"is_not_empty"}]},ee=new Set(["is_empty","is_not_empty","is_true","is_false"]),h=["label","name","title","keyword","full_name","value","text"],we=e.ref(""),ye=e.ref([]),Q=e.ref(null),K=e.ref(!1),he=e.ref(null),Re=e.ref(""),ge=e.ref(null),Ae=e.ref(""),Z=e.ref("asc");let ze=1;function Ye(D){const V=D.find(B=>B&&typeof B=="object");if(!V)return null;for(const B of h)if(B in V&&typeof V[B]=="string")return B;return Object.keys(V).find(B=>typeof V[B]=="string")||null}function _e(D,V){const B=V.filter(ae=>ae!=null&&ae!=="NULL");if(B.length===0)return null;if(B.every(ae=>Array.isArray(ae))){const ae=B.flatMap(je=>je).filter(je=>je!=null);return ae.length===0?null:typeof ae.find(je=>je!=null)=="object"?"arraySelect":"arrayText"}return B.every(ae=>typeof ae=="boolean")?"boolean":B.every(ae=>typeof ae=="number")?new Set(B).size<=de.value.maxUniqueForEnum?"select":"range":B.every(ae=>typeof ae=="string")?new Set(B).size<=de.value.maxUniqueForSelect?"select":"text":B.some(ae=>typeof ae=="object"&&!Array.isArray(ae))?null:"text"}const Xe=e.computed(()=>{if(!oe.data?.length)return[];const D=new Set;for(const se of oe.data)if(se&&typeof se=="object")for(const je of Object.keys(se))D.add(je);const V=new Set(oe.exclude),B=[];for(const se of D){if(V.has(se))continue;const je=oe.config[se]||{},St=oe.data.map(vt=>vt?.[se]),ut=je.type||_e(se,St);if(!ut)continue;const Ge=je.filterMode||"contain",_t=Ge==="date"?"date":Ge==="string"?"text":ut,Nt={key:se,label:je.label||Vt(se),type:_t,filterMode:Ge};if(ut==="select"){const vt=St.filter(Lt=>Lt!=null&&Lt!=="NULL");Nt.uniqueValues=[...new Set(vt)].sort((Lt,Ht)=>typeof Lt=="number"&&typeof Ht=="number"?Lt-Ht:String(Lt).localeCompare(String(Ht)))}else if(ut==="range"||ut==="int"){const vt=St.filter(Lt=>typeof Lt=="number");Nt.min=Math.min(...vt),Nt.max=Math.max(...vt)}else if(ut==="arraySelect"){const vt=je.displayKey||Ye(St.flatMap(Lt=>Array.isArray(Lt)?Lt:[]));if(Nt.displayKey=vt,Array.isArray(je.uniqueValues)&&je.uniqueValues.length>0)Nt.uniqueValues=je.uniqueValues.map(Lt=>String(Lt));else{const Lt=St.flatMap(Ht=>Array.isArray(Ht)?Ht:[]).filter(Ht=>Ht!=null).map(Ht=>vt&&typeof Ht=="object"?Ht[vt]:String(Ht)).filter(Ht=>Ht!=null&&Ht!=="");Nt.uniqueValues=[...new Set(Lt)].sort((Ht,Mt)=>String(Ht).localeCompare(String(Mt)))}}B.push(Nt)}const ae=oe.config._order;return ae&&B.sort((se,je)=>{const St=ae.indexOf(se.key),ut=ae.indexOf(je.key);return St===-1&&ut===-1?0:St===-1?1:ut===-1?-1:St-ut}),B}),U=e.computed(()=>{const D={};for(const V of Xe.value)D[V.key]=V;return D}),He=e.computed(()=>Array.isArray(oe.config.groups)&&oe.config.groups.length>0),Ke=e.computed(()=>{if(!He.value)return[];const D=new Set(Xe.value.map(V=>V.key));return oe.config.groups.map(V=>({...V,keys:V.keys.filter(B=>D.has(B))})).filter(V=>V.keys.length>0)}),ke=e.computed(()=>{if(!He.value)return[];const D=new Set(oe.config.groups.flatMap(V=>V.keys));return Xe.value.filter(V=>!D.has(V.key))}),Me=e.computed(()=>{if(!ge.value)return[];const D=new Set(ge.value.keys),V=Xe.value.filter(ae=>D.has(ae.key));if(!Re.value)return V;const B=Re.value.toLowerCase();return V.filter(ae=>ae.label.toLowerCase().includes(B))}),rt=e.computed(()=>{if(!Re.value)return Xe.value;const D=Re.value.toLowerCase();return Xe.value.filter(V=>V.label.toLowerCase().includes(D))}),yt=e.computed(()=>Xe.value.filter(D=>!["arraySelect","arrayText"].includes(D.type))),mt=e.computed(()=>Ae.value?Z.value==="asc"?"Ascending":"Descending":"No sort selected");function Qt(D){Q.value===D?xe():(Q.value=D,Re.value="",ge.value=null)}function xe(){Q.value=null,Re.value="",ge.value=null}function Jt(D){const V=D.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");Q.value&&!V&&!D.target.closest(".dss-filter-popup")&&!D.target.closest(".dss-filter-trigger")&&!D.target.closest(".dss-filter-add-btn")&&xe(),K.value&&he.value&&!he.value.contains(D.target)&&(V||(K.value=!1))}e.onMounted(()=>document.addEventListener("click",Jt)),e.onBeforeUnmount(()=>document.removeEventListener("click",Jt));function et(D){return U.value[D]?.label||Vt(D)}function lt(D){return U.value[D.key]?.filterMode||"contain"}function kt(D){return L(`filter.operators.${D}`)}function Rt(D){const V=U.value[D.key];return(dt[V?.type]||dt.text).map(B=>({...B,label:L(`filter.operators.${B.value}`)}))}function ct(D){return ee.has(D)}function ht(D){const V=U.value[D.key];return V?V.type==="date"?"date":V.type==="boolean"?"boolean":V.type==="text"||V.type==="arrayText"?"text":V.type==="select"||V.type==="arraySelect"?"multiselect":V.type==="range"||V.type==="int"?D.operator==="between"?"between":"number":"text":"text"}function pt(D){return dt[D]?.[0]?.value||"contains"}function Xt(D,V){return ee.has(V)||D==="date"?null:D==="select"||D==="arraySelect"?[]:(D==="range"||D==="int")&&V==="between"?{min:null,max:null}:D==="range"||D==="int"?null:""}function Ct(D){return U.value[D.key]?.uniqueValues||[]}function Pt(D){const V=Ct(D);if(!Re.value)return V;const B=Re.value.toLowerCase();return V.filter(ae=>String(ae).toLowerCase().includes(B))}function pe(D){const V=D.value;return!V||V.length===0?L("filter.select"):V.length<=2?V.join(", "):L("filter.selectedCount",{count:V.length})}function H(D){const V=U.value[D],B=V?.filterMode||"contain",ae=V?.type||"text",se=B==="string"?"contains":pt(ae);ye.value.push(e.reactive({id:ze++,key:D,operator:se,value:Xt(ae,se)})),xe()}function Y(D){ye.value=ye.value.filter(V=>V.id!==D)}function ie(D,V){const ae=U.value[V]?.type||"text";D.key=V,D.operator=pt(ae),D.value=Xt(ae,D.operator),xe()}function fe(D,V){const B=ht(D);D.operator=V;const ae=ht(D);if(B!==ae||ee.has(V)){const se=U.value[D.key];D.value=Xt(se?.type||"text",V)}xe()}function Fe(D,V){const B=V.target.value;D.value=B===""?null:Number(B)}function tt(D,V,B){const ae=B.target.value,se=ae===""?null:Number(ae);(!D.value||typeof D.value!="object")&&(D.value={min:null,max:null}),D.value={...D.value,[V]:isNaN(se)?null:se}}function Et(D,V){const B=D.value||[],ae=B.indexOf(V);D.value=ae>=0?B.filter(se=>se!==V):[...B,V]}function Se(){ye.value=[],we.value="",xe()}function ot(D){we.value=D.target.value}function bt(D){Ae.value=D.target.value}function el(){Z.value=Z.value==="asc"?"desc":"asc"}const re=e.computed(()=>{if(!oe.data)return[];let D=oe.data;if(we.value){const V=we.value.toLowerCase();D=D.filter(B=>{for(const ae of Object.keys(B)){const se=B[ae];if(typeof se=="string"&&se.toLowerCase().includes(V)||typeof se=="number"&&String(se).includes(V)||Array.isArray(se)&&se.some(je=>je!=null&&(typeof je=="string"?je.toLowerCase().includes(V):typeof je=="object"?Object.values(je).some(St=>typeof St=="string"&&St.toLowerCase().includes(V)):!1)))return!0}return!1})}for(const V of ye.value){if(!ce(V))continue;const B=U.value[V.key];B&&(D=D.filter(ae=>Ve(ae,V,B)))}if(oe.showSortBy&&Ae.value){const V=Ae.value,B=Z.value==="asc"?1:-1;D=[...D].sort((ae,se)=>X(ae?.[V],se?.[V])*B)}return D});function X(D,V){const B=te(D),ae=te(V);return B==null&&ae==null?0:B==null?1:ae==null?-1:typeof B=="number"&&typeof ae=="number"?B-ae:String(B).localeCompare(String(ae),void 0,{numeric:!0,sensitivity:"base"})}function te(D){return D==null||D==="NULL"?null:typeof D=="string"||typeof D=="number"||typeof D=="boolean"?D:D instanceof Date?D.getTime():null}function ce(D){return ee.has(D.operator)?!0:D.value==null||typeof D.value=="string"&&D.value===""||Array.isArray(D.value)&&D.value.length===0?!1:D.value instanceof Date?!isNaN(D.value.getTime()):!(typeof D.value=="object"&&!Array.isArray(D.value)&&D.value.min==null&&D.value.max==null)}function Ve(D,V,B){const ae=D?.[V.key],se=V.value,je=V.operator;if(je==="is_empty")return dl(ae);if(je==="is_not_empty")return!dl(ae);const St=B.type;if(St==="text"||St==="arrayText"){const ut=St==="arrayText"&&Array.isArray(ae)?ae.filter(Nt=>Nt!=null).map(String).join(" "):ae!=null?String(ae):"",Ge=String(se).toLowerCase(),_t=ut.toLowerCase();switch(je){case"contains":return _t.includes(Ge);case"not_contains":return!_t.includes(Ge);case"equals":return _t===Ge;case"not_equals":return _t!==Ge;case"starts_with":return _t.startsWith(Ge);case"ends_with":return _t.endsWith(Ge);default:return!0}}if(St==="select")switch(je){case"is_any_of":return se.includes(ae);case"is_none_of":return!se.includes(ae);default:return!0}if(St==="range"||St==="int"){const ut=typeof ae=="number"?ae:Number(ae);if(typeof ut!="number"||isNaN(ut))return!1;if(je==="between"){const _t=se?.min!=null?Number(se.min):null,Nt=se?.max!=null?Number(se.max):null,vt=_t!=null&&!isNaN(_t)?_t:null,Lt=Nt!=null&&!isNaN(Nt)?Nt:null;return(vt==null||ut>=vt)&&(Lt==null||ut<=Lt)}const Ge=typeof se=="number"&&!isNaN(se)?se:Number(se);if(je==="contains"||je==="not_contains"){const _t=String(ut),Nt=String(se??"").toLowerCase(),vt=_t.toLowerCase().includes(Nt);return je==="contains"?vt:!vt}if(typeof Ge!="number"||isNaN(Ge))return!1;switch(je){case"eq":return ut===Ge;case"neq":return ut!==Ge;case"gt":return ut>Ge;case"gte":return ut>=Ge;case"lt":return ut<Ge;case"lte":return ut<=Ge;default:return!0}}if(St==="arraySelect"){if(!Array.isArray(ae))return!1;const ut=ae.filter(Ge=>Ge!=null).map(Ge=>B.displayKey&&typeof Ge=="object"?Ge[B.displayKey]:String(Ge));switch(je){case"contains_any":return ut.some(Ge=>se.includes(Ge));case"contains_all":return se.every(Ge=>ut.includes(Ge));case"not_contains_any":return!ut.some(Ge=>se.includes(Ge));default:return!0}}if(St==="date"){const ut=nt(se);if(!ut||isNaN(ut.getTime()))return!1;const Ge=nt(ae);if(!Ge||isNaN(Ge.getTime()))return!1;const _t=xt(Ge),Nt=xt(ut);switch(je){case"eq":return _t===Nt;case"before":return _t<Nt;case"after":return _t>Nt;default:return!0}}if(St==="boolean"){const ut=ae===!0||ae==="true"||ae===1,Ge=ae===!1||ae==="false"||ae===0;switch(je){case"is_true":return ut;case"is_false":return Ge;default:return!0}}return!0}function nt(D){if(D==null)return null;if(D instanceof Date)return isNaN(D.getTime())?null:D;if(typeof D=="number")return new Date(D>1e10?D:D*1e3);if(typeof D=="string"){const V=new Date(D);return isNaN(V.getTime())?null:V}return null}function xt(D){const V=D.getFullYear(),B=String(D.getMonth()+1).padStart(2,"0"),ae=String(D.getDate()).padStart(2,"0");return`${V}-${B}-${ae}`}function dl(D){return!!(D==null||D===""||D==="NULL"||Array.isArray(D)&&D.length===0||Array.isArray(D)&&D.every(V=>V==null))}e.watch(re,D=>W("update:modelValue",D),{immediate:!0}),e.watch(()=>oe.data,()=>{ye.value=[],we.value="",K.value=!1,Ae.value="",Z.value="asc",xe()});function Vt(D){return D.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,V=>V.toUpperCase())}function sl(){const D=V=>{if(V==null)return V;if(V instanceof Date)return{_type:"Date",value:V.toISOString(),local:V.toLocaleDateString()};if(Array.isArray(V))return V.map(D);if(typeof V=="object"&&!Array.isArray(V)){const B={};for(const ae of Object.keys(V))B[ae]=D(V[ae]);return B}return V};return{globalSearch:we.value,rows:ye.value.map(V=>({key:V.key,operator:V.operator,value:D(V.value),defType:U.value[V.key]?.type,defFilterMode:U.value[V.key]?.filterMode})),filteredCount:re.value?.length??0}}return J({getDebugState:sl}),(D,V)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":de.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:he},[e.createElementVNode("div",Kp,[V[20]||(V[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(L)("filter.searchAcrossFields"),value:we.value,onInput:ot},null,40,Gp),we.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:V[0]||(V[0]=B=>we.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:K.value||ye.value.length>0,"dss-filter-funnel-btn--with-sort":oe.showSortBy}]),onClick:V[1]||(V[1]=B=>K.value=!K.value),type:"button",title:K.value?e.unref(L)("filter.closeAdvancedFilter"):e.unref(L)("filter.openAdvancedFilter")},[V[14]||(V[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",Jp,e.toDisplayString(ye.value.length),1)):e.createCommentVNode("",!0)],10,Qp),oe.showSortBy?(e.openBlock(),e.createElementBlock("div",e0,[V[19]||(V[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:Ae.value,onChange:bt},[V[15]||(V[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yt.value,B=>(e.openBlock(),e.createElementBlock("option",{key:B.key,value:B.key},e.toDisplayString(B.label),9,l0))),128))],40,t0),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:el,disabled:!Ae.value,title:mt.value},[Ae.value?Z.value==="asc"?(e.openBlock(),e.createElementBlock("svg",a0,[...V[17]||(V[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",s0,[...V[18]||(V[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",o0,[...V[16]||(V[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,n0)])):e.createCommentVNode("",!0)]),K.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:V[13]||(V[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",r0,[ye.value.length===0?(e.openBlock(),e.createElementBlock("div",i0,e.toDisplayString(e.unref(L)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ye.value,(B,ae)=>(e.openBlock(),e.createElementBlock("div",{key:B.id,class:"dss-filter-row"},[e.createElementVNode("span",c0,e.toDisplayString(ae===0?e.unref(L)("filter.where"):e.unref(L)("filter.and")),1),e.createElementVNode("div",u0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(se=>Qt(`${B.id}:field`),["stop"])},[e.createElementVNode("span",m0,e.toDisplayString(et(B.key)),1),V[21]||(V[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,d0),Q.value===`${B.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:V[3]||(V[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":V[2]||(V[2]=se=>Re.value=se),placeholder:e.unref(L)("filter.searchAttributes")},null,8,p0),[[e.vModelText,Re.value]]),e.createElementVNode("ul",v0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(rt.value,se=>(e.openBlock(),e.createElementBlock("li",{key:se.key,class:"dss-filter-popup-item",onClick:je=>ie(B,se.key)},e.toDisplayString(se.label),9,f0))),128)),rt.value.length===0?(e.openBlock(),e.createElementBlock("li",h0,e.toDisplayString(e.unref(L)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),lt(B)==="contain"||lt(B)==="date"?(e.openBlock(),e.createElementBlock("div",g0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(se=>Qt(`${B.id}:op`),["stop"])},[e.createElementVNode("span",k0,e.toDisplayString(kt(B.operator)),1),V[22]||(V[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,y0),Q.value===`${B.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:V[4]||(V[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",C0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rt(B),se=>(e.openBlock(),e.createElementBlock("li",{key:se.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:B.operator===se.value}]),onClick:je=>fe(B,se.value)},e.toDisplayString(se.label),11,b0))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),ct(B.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",w0,[lt(B)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.enterValue"),"onUpdate:modelValue":se=>B.value=se},null,8,x0)),[[e.vModelText,B.value]]):lt(B)==="date"?(e.openBlock(),e.createElementBlock("div",E0,[e.createVNode(ga,{mode:"single",modelValue:B.value,"onUpdate:modelValue":se=>B.value=se},null,8,["modelValue","onUpdate:modelValue"])])):ht(B)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.enterValue"),"onUpdate:modelValue":se=>B.value=se},null,8,S0)),[[e.vModelText,B.value]]):ht(B)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.enterValue"),value:B.value,onInput:se=>Fe(B,se),step:U.value[B.key]?.type==="int"?1:void 0},null,40,V0)):ht(B)==="between"?(e.openBlock(),e.createElementBlock("div",N0,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.min"),value:B.value?.min,onInput:se=>tt(B,"min",se),step:U.value[B.key]?.type==="int"?1:void 0},null,40,B0),e.createElementVNode("span",_0,e.toDisplayString(e.unref(L)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.max"),value:B.value?.max,onInput:se=>tt(B,"max",se),step:U.value[B.key]?.type==="int"?1:void 0},null,40,M0)])):ht(B)==="multiselect"?(e.openBlock(),e.createElementBlock("div",$0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(se=>Qt(`${B.id}:val`),["stop"])},[e.createElementVNode("span",T0,e.toDisplayString(pe(B)),1),V[23]||(V[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,L0),Q.value===`${B.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:V[6]||(V[6]=e.withModifiers(()=>{},["stop"]))},[Ct(B).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":V[5]||(V[5]=se=>Re.value=se),placeholder:e.unref(L)("filter.search")},null,8,D0)),[[e.vModelText,Re.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",A0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pt(B),se=>(e.openBlock(),e.createElementBlock("li",{key:se,class:"dss-filter-popup-item",onClick:je=>Et(B,se)},[e.createElementVNode("input",{type:"checkbox",checked:(B.value||[]).includes(se),tabindex:"-1"},null,8,R0),e.createElementVNode("span",null,e.toDisplayString(se),1)],8,H0))),128)),Pt(B).length===0?(e.openBlock(),e.createElementBlock("li",F0,e.toDisplayString(e.unref(L)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:se=>Y(B.id)},[...V[24]||(V[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,I0)]))),128)),e.createElementVNode("div",z0,[e.createElementVNode("div",P0,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:V[7]||(V[7]=e.withModifiers(B=>Qt("add"),["stop"]))},e.toDisplayString(e.unref(L)("filter.addFilter")),1),Q.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:V[12]||(V[12]=e.withModifiers(()=>{},["stop"]))},[He.value&&!ge.value&&!Re.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":V[8]||(V[8]=B=>Re.value=B),placeholder:e.unref(L)("filter.searchAttributes")},null,8,O0),[[e.vModelText,Re.value]]),e.createElementVNode("ul",W0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke.value,B=>(e.openBlock(),e.createElementBlock("li",{key:B.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:ae=>ge.value=B},[e.createElementVNode("span",null,e.toDisplayString(B.label),1),V[25]||(V[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,q0))),128)),ke.value.length>0?(e.openBlock(),e.createElementBlock("li",Z0)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ke.value,B=>(e.openBlock(),e.createElementBlock("li",{key:B.key,class:"dss-filter-popup-item",onClick:ae=>H(B.key)},e.toDisplayString(B.label),9,U0))),128))])],64)):ge.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:V[9]||(V[9]=B=>ge.value=null)},[V[26]||(V[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(ge.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":V[10]||(V[10]=B=>Re.value=B),placeholder:e.unref(L)("filter.searchAttributes")},null,8,Y0),[[e.vModelText,Re.value]]),e.createElementVNode("ul",X0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Me.value,B=>(e.openBlock(),e.createElementBlock("li",{key:B.key,class:"dss-filter-popup-item",onClick:ae=>H(B.key)},e.toDisplayString(B.label),9,j0))),128)),Me.value.length===0?(e.openBlock(),e.createElementBlock("li",K0,e.toDisplayString(e.unref(L)("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":V[11]||(V[11]=B=>Re.value=B),placeholder:e.unref(L)("filter.searchAttributes")},null,8,G0),[[e.vModelText,Re.value]]),e.createElementVNode("ul",Q0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(rt.value,B=>(e.openBlock(),e.createElementBlock("li",{key:B.key,class:"dss-filter-popup-item",onClick:ae=>H(B.key)},e.toDisplayString(B.label),9,J0))),128)),rt.value.length===0?(e.openBlock(),e.createElementBlock("li",e9,e.toDisplayString(e.unref(L)("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:Se},e.toDisplayString(e.unref(L)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),n9={class:"dss-pill-field__pills"},o9=["data-value"],a9=["disabled"],s9={class:"dss-pill-field__pill-text"},r9={key:0,class:"dss-pill-field__pill-actions"},i9=["onClick"],c9=["onClick"],u9=["placeholder","disabled"],d9=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(_,{emit:J}){const N=_,L=J,oe=e.ref(""),W=e.ref([...N.modelValue]),A=e.ref(null);let de=null;const dt=e.ref(null),ee=e.ref(""),h=e.ref(null),we=e.ref(null),ye=e.computed(()=>{if(!we.value)return;const{width:He,height:Ke}=we.value;return{minWidth:`${He}px`,height:`${Ke}px`}});function Q(He,Ke){dt.value===Ke&&(h.value=He)}function K(){dt.value=null,ee.value="",we.value=null,h.value=null}const he=e.computed(()=>new Set(W.value.map(He=>He.trim()).filter(Boolean)));function Re(He){A.value=He,de&&clearTimeout(de),de=setTimeout(()=>{A.value=null,de=null},900)}function ge(He){const Ke=He.trim();return Ke?he.value.has(Ke)?(Re(Ke),!1):(W.value=[...W.value,Ke],L("update:modelValue",[...W.value]),!0):!1}function Ae(He){const Ke=He.split(/\r?\n/g).map(yt=>yt.trim()).filter(Boolean);if(!Ke.length)return;const ke=new Set(W.value.map(yt=>yt.trim()).filter(Boolean)),Me=[...W.value];let rt=null;for(const yt of Ke){if(ke.has(yt)){rt??=yt;continue}ke.add(yt),Me.push(yt)}Me.length!==W.value.length&&(W.value=Me,L("update:modelValue",[...W.value])),rt&&Re(rt)}function Z(He){N.disabled||(dt.value===He&&K(),W.value=W.value.filter((Ke,ke)=>ke!==He),L("update:modelValue",[...W.value]))}async function ze(He,Ke){if(N.disabled)return;const ke=Ke.currentTarget.closest(".dss-pill-field__pill");ke&&(we.value={width:ke.offsetWidth,height:ke.offsetHeight}),dt.value=He,ee.value=W.value[He]??"",await e.nextTick();const Me=h.value;if(!Me)return;Me.focus();const rt=Me.value.length;Me.setSelectionRange(rt,rt)}function Ye(){K()}function _e(){if(N.disabled||dt.value===null)return;const He=dt.value,Ke=W.value[He]??"",ke=ee.value.trim();if(K(),ke!==Ke&&he.value.has(ke)){Re(ke);return}if(!ke){W.value=W.value.filter((rt,yt)=>yt!==He),L("update:modelValue",[...W.value]);return}const Me=W.value.map((rt,yt)=>yt===He?ke:rt);W.value=Me,L("update:modelValue",[...W.value])}function Xe(He){He.preventDefault(),!N.disabled&&(ge(oe.value),oe.value="")}function U(He){if(N.disabled)return;const Ke=He.clipboardData?.getData("text")??"";!Ke.includes(`
120
+ `)&&!Ke.includes("\r")||(He.preventDefault(),Ae(Ke),oe.value="")}return e.watch(()=>N.modelValue,He=>{W.value=Array.isArray(He)?[...He]:[]},{deep:!0}),e.onBeforeUnmount(()=>{de&&clearTimeout(de)}),(He,Ke)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":He.disabled}])},[e.createElementVNode("div",n9,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(W.value,(ke,Me)=>(e.openBlock(),e.createElementBlock("span",{key:ke,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":A.value===ke,"dss-pill-field__pill--editing":dt.value===Me}]),style:e.normalizeStyle(dt.value===Me&&we.value?ye.value:void 0)},[dt.value===Me?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-pill-field__pill-edit-wrap","data-value":ee.value||" "},[e.withDirectives(e.createElementVNode("input",{ref_for:!0,ref:rt=>Q(rt,Me),"onUpdate:modelValue":Ke[0]||(Ke[0]=rt=>ee.value=rt),class:"dss-pill-field__pill-edit",type:"text",disabled:He.disabled,onKeydown:[e.withKeys(_e,["enter"]),e.withKeys(Ye,["esc"])],onBlur:_e},null,40,a9),[[e.vModelText,ee.value]])],8,o9)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",s9,e.toDisplayString(ke),1),He.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",r9,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:rt=>ze(Me,rt)},[...Ke[2]||(Ke[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,i9),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:rt=>Z(Me)}," × ",8,c9)]))],64))],6))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Ke[1]||(Ke[1]=ke=>oe.value=ke),class:"dss-pill-field__input",type:"text",placeholder:W.value.length?"":He.placeholder,disabled:He.disabled,onPaste:U,onKeydown:e.withKeys(Xe,["enter"])},null,40,u9),[[e.vModelText,oe.value]])])],2))}}),m9={key:0,class:"dss-title dss-title--separator"},p9={__name:"DSSTitle",props:{type:{type:String,default:"main",validator:_=>["main","separator","subtitle"].includes(_)},h:{type:Number,default:null,validator:_=>_===null||Number.isInteger(_)&&_>=1&&_<=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(_,{expose:J,emit:N}){const L=_,oe=N,W=e.ref(null),A=e.computed(()=>`dss-title--${L.type}`),de=e.computed(()=>L.h!=null?`dss-title--h${L.h}`:null),dt={main:"div",subtitle:"p",separator:"span"},ee=e.computed(()=>L.h!=null?`h${L.h}`:dt[L.type]??"div"),h=e.computed(()=>L.editable?"plaintext-only":void 0),we=e.computed(()=>{const ge={};return L.size!=null&&(ge.fontSize=typeof L.size=="number"?`${L.size}px`:L.size),L.weight!=null&&(ge.fontWeight=L.weight),L.color!=null&&(ge.color=L.color),Object.keys(ge).length?ge:void 0}),ye=e.computed(()=>L.editable?{input:K,keydown:he,paste:Re}:{}),Q=()=>{const ge=W.value;!L.editable||!ge||document.activeElement!==ge&&(ge.innerText=L.modelValue??"")},K=ge=>{const Ae=ge.target.innerText;oe("update:modelValue",Ae),oe("change",Ae)},he=ge=>{ge.key==="Enter"&&ge.preventDefault()},Re=ge=>{ge.preventDefault();const Ae=(ge.clipboardData||window.clipboardData).getData("text/plain");document.execCommand("insertText",!1,Ae)};return e.watch(()=>L.modelValue,()=>{Q()}),e.watch(()=>L.editable,()=>{e.nextTick(Q)}),e.onMounted(()=>{e.nextTick(Q)}),J({focus:()=>W.value?.focus()}),(ge,Ae)=>_.type==="separator"?(e.openBlock(),e.createElementBlock("div",m9,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(ee.value),e.mergeProps({ref_key:"titleRef",ref:W,class:["dss-title__separator-label",de.value,{"dss-title--editable":_.editable}],style:we.value,contenteditable:h.value,spellcheck:_.editable?!1:void 0},e.toHandlers(ye.value)),{default:e.withCtx(()=>[_.editable?e.createCommentVNode("",!0):e.renderSlot(ge.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(_.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(ee.value),e.mergeProps({key:1,ref_key:"titleRef",ref:W,class:["dss-title",[A.value,de.value,{"dss-title--editable":_.editable}]],style:we.value,contenteditable:h.value,spellcheck:_.editable?!1:void 0},e.toHandlers(ye.value)),{default:e.withCtx(()=>[_.editable?e.createCommentVNode("",!0):e.renderSlot(ge.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(_.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))}},v9={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"}},f9={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"},h9={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"}},g9={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",comparison:{compareTo:"Compare to",active:"Comparison",previousPeriod:"Previous period",previousYear:"Previous year",custom:"Custom"},quickSelect:{today:"Today",lastWeek:"Last week",last15Days:"Last 15 days",last30Days:"Last 30 days",thisMonth:"This month",lastMonth:"Last 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"}},y9={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"}},go={chart:v9,table:f9,filter:h9,datepicker:g9,textEditor:y9},k9={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"}},C9={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"},b9={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"}},w9={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",comparison:{compareTo:"Comparer à",active:"Comparaison",previousPeriod:"Période précédente",previousYear:"Année précédente",custom:"Personnalisée"},quickSelect:{today:"Aujourd'hui",lastWeek:"Dernière semaine",last15Days:"15 derniers jours",last30Days:"30 derniers jours",thisMonth:"Ce mois",lastMonth:"Mois dernier",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"}},x9={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"}},yo={chart:k9,table:C9,filter:b9,datepicker:w9,textEditor:x9},E9={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"}},S9={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"},V9={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"}},N9={selectDate:"Selecteer datum",selectRange:"Selecteer bereik",selectFromList:"Selecteer een datum",noAvailableDates:"Geen datums beschikbaar",startDate:"Startdatum",endDate:"Einddatum",prevMonth:"Vorige maand",nextMonth:"Volgende maand",comparison:{compareTo:"Vergelijken met",active:"Vergelijking",previousPeriod:"Vorige periode",previousYear:"Vorig jaar",custom:"Aangepast"},quickSelect:{today:"Vandaag",lastWeek:"Afgelopen week",last15Days:"Laatste 15 dagen",last30Days:"Laatste 30 dagen",thisMonth:"Deze maand",lastMonth:"Vorige 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"}},B9={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"}},ko={chart:E9,table:S9,filter:V9,datepicker:N9,textEditor:B9},qo={en:go,fr:yo,nl:ko};function Fa(_){if(!_||!_.global)return;const J=_.global.availableLocales||[];Object.keys(qo).forEach(N=>{J.includes(N)&&_.global.mergeLocaleMessage(N,qo[N])})}const Zo={en:{textEditor:go.textEditor},fr:{textEditor:yo.textEditor},nl:{textEditor:ko.textEditor}};function Ia(_){if(!_||!_.global)return;const J=_.global.availableLocales||[];Object.keys(Zo).forEach(N=>{J.includes(N)&&_.global.mergeLocaleMessage(N,Zo[N])})}const Uo={en:{table:go.table},fr:{table:yo.table},nl:{table:ko.table}};function za(_){if(!_||!_.global)return;const J=_.global.availableLocales||[];Object.keys(Uo).forEach(N=>{J.includes(N)&&_.global.mergeLocaleMessage(N,Uo[N])})}const Yo={en:{datepicker:go.datepicker},fr:{datepicker:yo.datepicker},nl:{datepicker:ko.datepicker}};function Pa(_){if(!_||!_.global)return;const J=_.global.availableLocales||[];Object.keys(Yo).forEach(N=>{J.includes(N)&&_.global.mergeLocaleMessage(N,Yo[N])})}const Xo={en:{filter:go.filter},fr:{filter:yo.filter},nl:{filter:ko.filter}};function Oa(_){if(!_||!_.global)return;const J=_.global.availableLocales||[];Object.keys(Xo).forEach(N=>{J.includes(N)&&_.global.mergeLocaleMessage(N,Xo[N])})}const _9={chart:qo,textEditor:Zo,table:Uo,datepicker:Yo,filter:Xo};function M9(_){!_||!_.global||(Fa(_),Ia(_),za(_),Pa(_),Oa(_))}const $9={en:{...go},fr:{...yo},nl:{...ko}};ho.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:$9});exports.DSSChart=Tu;exports.DSSChartMessages=qo;exports.DSSColorPicker=bp;exports.DSSConfetti=jp;exports.DSSDatepicker=ga;exports.DSSDatepickerMessages=Yo;exports.DSSDnd=Yp;exports.DSSFilter=l9;exports.DSSFilterMessages=Xo;exports.DSSLoader=Dp;exports.DSSMessages=_9;exports.DSSModal=ha;exports.DSSPillField=d9;exports.DSSSkeleton=Ap;exports.DSSStepBar=Ra;exports.DSSTable=t1;exports.DSSTableMessages=Uo;exports.DSSTextEditor=ap;exports.DSSTextEditorMessages=Zo;exports.DSSTitle=p9;exports.addDSSChartTranslations=Fa;exports.addDSSDatepickerTranslations=Pa;exports.addDSSFilterTranslations=Oa;exports.addDSSTableTranslations=za;exports.addDSSTextEditorTranslations=Ia;exports.addDSSTranslations=M9;